marketplacepos 5.44.2 → 5.46.0

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 (191) hide show
  1. package/Marketplace/3rdpartylicenses.txt +31 -31
  2. package/Marketplace/{chunk-IA6KOBDJ.js → chunk-2HNZ6XV3.js} +1 -1
  3. package/Marketplace/{chunk-NAT7HRBS.js → chunk-2KDM4NDG.js} +1 -1
  4. package/Marketplace/chunk-3NFS6ZDY.js +1 -0
  5. package/Marketplace/chunk-3NHZEKEI.js +1 -0
  6. package/Marketplace/{chunk-5JQJRPL3.js → chunk-3TYYN7ZX.js} +1 -1
  7. package/Marketplace/{chunk-CUB2QFUO.js → chunk-3UN6FPMN.js} +1 -1
  8. package/Marketplace/{chunk-SYUFPF3D.js → chunk-3YP6ORBR.js} +1 -1
  9. package/Marketplace/{chunk-NXOXSOUJ.js → chunk-43E7L4CY.js} +1 -1
  10. package/Marketplace/{chunk-E4Z7OR75.js → chunk-4KHHGHFJ.js} +1 -1
  11. package/Marketplace/chunk-4UWGWYKJ.js +1 -0
  12. package/Marketplace/{chunk-MS3ZBCON.js → chunk-4VITMSIA.js} +1 -1
  13. package/Marketplace/{chunk-IIZDEGGW.js → chunk-5LQRO4AI.js} +1 -1
  14. package/Marketplace/{chunk-6QYD6NIJ.js → chunk-5PS6ZS3N.js} +1 -1
  15. package/Marketplace/{chunk-M7HQIICB.js → chunk-5QLKBL54.js} +1 -1
  16. package/Marketplace/{chunk-KCH7AGAT.js → chunk-5X2WQKXH.js} +1 -1
  17. package/Marketplace/{chunk-35XX6SQT.js → chunk-6KBMGQMI.js} +1 -1
  18. package/Marketplace/{chunk-IL5JIRWJ.js → chunk-6L7TD5DW.js} +1 -1
  19. package/Marketplace/{chunk-PNITO7BE.js → chunk-6RLISMEX.js} +1 -1
  20. package/Marketplace/{chunk-G7R7LUW4.js → chunk-74ELVGDK.js} +1 -1
  21. package/Marketplace/{chunk-4GW36MPQ.js → chunk-753FTTID.js} +1 -1
  22. package/Marketplace/{chunk-DXEJKRNB.js → chunk-76XHGJE7.js} +1 -1
  23. package/Marketplace/{chunk-LZCEM2PC.js → chunk-7AE3725T.js} +1 -1
  24. package/Marketplace/chunk-7WG7VRYR.js +1 -0
  25. package/Marketplace/{chunk-H3IVI3LN.js → chunk-A44LN77B.js} +1 -1
  26. package/Marketplace/{chunk-IMK2JGZA.js → chunk-A64VIOKR.js} +1 -1
  27. package/Marketplace/chunk-A6G2H7IF.js +2 -0
  28. package/Marketplace/chunk-A6PK5NP6.js +1 -0
  29. package/Marketplace/{chunk-CZDUJH26.js → chunk-AHLYED4C.js} +1 -1
  30. package/Marketplace/{chunk-QINTIYLK.js → chunk-AKVBFSUI.js} +1 -1
  31. package/Marketplace/{chunk-HVLMIZAB.js → chunk-AP24AK5A.js} +1 -1
  32. package/Marketplace/{chunk-L3FX4O3H.js → chunk-B67DSLBY.js} +1 -1
  33. package/Marketplace/{chunk-PFIBU2IX.js → chunk-BBQGPXDH.js} +1 -1
  34. package/Marketplace/{chunk-EQIFZBRG.js → chunk-BJUPMCEP.js} +2 -2
  35. package/Marketplace/{chunk-DL66NZ2A.js → chunk-BQIB3N6V.js} +1 -1
  36. package/Marketplace/{chunk-LA6B2JGP.js → chunk-CHWXOJDB.js} +1 -1
  37. package/Marketplace/{chunk-AVT3WVH4.js → chunk-DFFRRMPT.js} +1 -1
  38. package/Marketplace/{chunk-SM3P57SO.js → chunk-DFGZ4L65.js} +1 -1
  39. package/Marketplace/{chunk-PAMSUURJ.js → chunk-DLURPTQ3.js} +1 -1
  40. package/Marketplace/{chunk-YTL4RBBS.js → chunk-DQ3XZQ7W.js} +1 -1
  41. package/Marketplace/{chunk-M6UQ3NJ3.js → chunk-DUF425GC.js} +1 -1
  42. package/Marketplace/{chunk-YM4TJJMM.js → chunk-DZYBXWL2.js} +1 -1
  43. package/Marketplace/chunk-EBCTTFHD.js +2 -0
  44. package/Marketplace/chunk-EOLVRL5H.js +2 -0
  45. package/Marketplace/{chunk-SWQXSJ7O.js → chunk-ERXVXBTU.js} +1 -1
  46. package/Marketplace/chunk-EWTJL2KE.js +1 -0
  47. package/Marketplace/chunk-F6HNCBQX.js +5 -0
  48. package/Marketplace/{chunk-WW22F76D.js → chunk-FFCWYWBW.js} +1 -1
  49. package/Marketplace/{chunk-Q6P7MEKT.js → chunk-FHH5BTG7.js} +1 -1
  50. package/Marketplace/chunk-FHPIPQMB.js +15 -0
  51. package/Marketplace/{chunk-UGVEAL7H.js → chunk-FO7G4GMY.js} +1 -1
  52. package/Marketplace/{chunk-OC2FBL33.js → chunk-FPYZBABH.js} +1 -1
  53. package/Marketplace/{chunk-Z5GRNGHJ.js → chunk-FVORY74O.js} +1 -1
  54. package/Marketplace/{chunk-M2FCTYGU.js → chunk-FXQKRJWU.js} +1 -1
  55. package/Marketplace/{chunk-UWAXFTHD.js → chunk-FXVFO74P.js} +1 -1
  56. package/Marketplace/{chunk-B5VBBEEN.js → chunk-G7T42LFR.js} +1 -1
  57. package/Marketplace/{chunk-AJL3CYNX.js → chunk-GH5FTODR.js} +1 -1
  58. package/Marketplace/chunk-GVLJDP5K.js +1 -0
  59. package/Marketplace/{chunk-B5V5KFQU.js → chunk-HFCAD7GH.js} +1 -1
  60. package/Marketplace/{chunk-3LRWABHB.js → chunk-HVCIQI7B.js} +1 -1
  61. package/Marketplace/chunk-I2Y5WJEO.js +5 -0
  62. package/Marketplace/chunk-I4WCZRNL.js +1 -0
  63. package/Marketplace/{chunk-GCDQNJQN.js → chunk-ID2YZPRH.js} +1 -1
  64. package/Marketplace/chunk-IL2CPGYS.js +1 -0
  65. package/Marketplace/{chunk-CIAZIJGR.js → chunk-IQ4AFE6X.js} +1 -1
  66. package/Marketplace/{chunk-AEOSNAHH.js → chunk-J53BPEDH.js} +1 -1
  67. package/Marketplace/{chunk-SNPFU5TF.js → chunk-JL5DYPDV.js} +1 -1
  68. package/Marketplace/{chunk-CMTBBXR5.js → chunk-JVNHFIYT.js} +1 -1
  69. package/Marketplace/{chunk-UTCTTFIM.js → chunk-KVZ7LQSK.js} +1 -1
  70. package/Marketplace/{chunk-OAOQONOA.js → chunk-KXEADFBM.js} +1 -1
  71. package/Marketplace/chunk-LBXSZJDS.js +1 -0
  72. package/Marketplace/{chunk-OLOIQI4D.js → chunk-LDD4NVMB.js} +1 -1
  73. package/Marketplace/{chunk-KALG6D6L.js → chunk-LDPDLCRL.js} +1 -1
  74. package/Marketplace/chunk-LFMEBDL2.js +1 -0
  75. package/Marketplace/{chunk-E3ROEHBW.js → chunk-LRUVI2Z3.js} +1 -1
  76. package/Marketplace/chunk-LSCMIKJ2.js +1 -0
  77. package/Marketplace/{chunk-SB7NWPDS.js → chunk-M7V7A7Z6.js} +1 -1
  78. package/Marketplace/chunk-MO53T3IK.js +1 -0
  79. package/Marketplace/{chunk-6JUVLRWS.js → chunk-MVBY6S4R.js} +1 -1
  80. package/Marketplace/chunk-MW6Q6DZF.js +1 -0
  81. package/Marketplace/{chunk-PAEIUO2F.js → chunk-N2SPK2VI.js} +1 -1
  82. package/Marketplace/{chunk-EYBZQLBT.js → chunk-N6HMVYWS.js} +1 -1
  83. package/Marketplace/{chunk-UYYAK364.js → chunk-NERXQ5KH.js} +1 -1
  84. package/Marketplace/chunk-NFN7BQB3.js +3 -0
  85. package/Marketplace/{chunk-IHNN4Q2N.js → chunk-NNRBGHXB.js} +1 -1
  86. package/Marketplace/{chunk-W6FZQ6XT.js → chunk-OFZOAEW5.js} +1 -1
  87. package/Marketplace/{chunk-VPWALMDU.js → chunk-OIEZ4JUJ.js} +1 -1
  88. package/Marketplace/{chunk-B7KTCPKC.js → chunk-OJMQBH6T.js} +3 -3
  89. package/Marketplace/{chunk-K5GEJ2GZ.js → chunk-OK3LLCAK.js} +1 -1
  90. package/Marketplace/{chunk-EPVCMYCI.js → chunk-OLANEXLB.js} +1 -1
  91. package/Marketplace/{chunk-M6UMLTY2.js → chunk-OPKLFRVD.js} +1 -1
  92. package/Marketplace/{chunk-E2SXYIML.js → chunk-ORDCBJ4G.js} +1 -1
  93. package/Marketplace/{chunk-WQ3GDXQW.js → chunk-OXOTD33C.js} +1 -1
  94. package/Marketplace/{chunk-2ODVHD2K.js → chunk-PFXOFSJG.js} +1 -1
  95. package/Marketplace/{chunk-3IIKX554.js → chunk-PFZOP2J7.js} +1 -1
  96. package/Marketplace/{chunk-BXW7N3ER.js → chunk-PONMPAT5.js} +1 -1
  97. package/Marketplace/{chunk-YPWHTELF.js → chunk-PPHTN2H6.js} +1 -1
  98. package/Marketplace/{chunk-5JVEEL2T.js → chunk-PYXL7UF7.js} +1 -1
  99. package/Marketplace/{chunk-AYPY47VM.js → chunk-QBL6V7QF.js} +1 -1
  100. package/Marketplace/chunk-QGK4LEFP.js +1 -0
  101. package/Marketplace/{chunk-CCWNSX4Y.js → chunk-QHE3PKRD.js} +1 -1
  102. package/Marketplace/{chunk-AO46RPZ4.js → chunk-QK4BGDSS.js} +1 -1
  103. package/Marketplace/{chunk-WMFWJNS5.js → chunk-QNM4JQ46.js} +1 -1
  104. package/Marketplace/chunk-QP4C4R4W.js +1 -0
  105. package/Marketplace/{chunk-74IXJYWO.js → chunk-QS22J2SC.js} +1 -1
  106. package/Marketplace/{chunk-U7I4JXN6.js → chunk-RDJPSZRF.js} +1 -1
  107. package/Marketplace/{chunk-M5XGP4SG.js → chunk-RHHHL4OR.js} +1 -1
  108. package/Marketplace/{chunk-6BIM4KEI.js → chunk-RNTPX24O.js} +1 -1
  109. package/Marketplace/{chunk-M7NQID2Z.js → chunk-RTT3JVJM.js} +1 -1
  110. package/Marketplace/{chunk-KPGKJKR5.js → chunk-SMRDRDSH.js} +1 -1
  111. package/Marketplace/{chunk-E4KNET2R.js → chunk-TH6VZX34.js} +1 -1
  112. package/Marketplace/{chunk-WUHNNJ2C.js → chunk-TYG67JH3.js} +1 -1
  113. package/Marketplace/chunk-UBAADH47.js +1 -0
  114. package/Marketplace/chunk-UHJEXTOG.js +1 -0
  115. package/Marketplace/{chunk-ECRWEMEV.js → chunk-UHTMVOX6.js} +1 -1
  116. package/Marketplace/{chunk-UEPQYAWE.js → chunk-UIFPDTMW.js} +1 -1
  117. package/Marketplace/{chunk-GYPJGQYN.js → chunk-UUJWRGO4.js} +1 -1
  118. package/Marketplace/{chunk-D6URDVES.js → chunk-UXPULNCR.js} +1 -1
  119. package/Marketplace/{chunk-SN4AOGQK.js → chunk-UYLSZYOD.js} +1 -1
  120. package/Marketplace/{chunk-PH6H2XX4.js → chunk-V3CLQBGH.js} +1 -1
  121. package/Marketplace/{chunk-ATZ475FN.js → chunk-V3USB3ZU.js} +1 -1
  122. package/Marketplace/{chunk-74U7L3IP.js → chunk-V4UHOZJ4.js} +1 -1
  123. package/Marketplace/{chunk-77JJJNRM.js → chunk-V5KHEF77.js} +1 -1
  124. package/Marketplace/{chunk-ZOKAF4JQ.js → chunk-VCTMSNVC.js} +1 -1
  125. package/Marketplace/{chunk-5SYAYUVP.js → chunk-VKFFHT27.js} +1 -1
  126. package/Marketplace/{chunk-6EH5RQIV.js → chunk-VPFSU3X4.js} +1 -1
  127. package/Marketplace/chunk-VVX6LRMW.js +1 -0
  128. package/Marketplace/{chunk-GGSB6FC2.js → chunk-W3JKSCRF.js} +1 -1
  129. package/Marketplace/{chunk-5OHRA4AS.js → chunk-W3JTS22H.js} +1 -1
  130. package/Marketplace/{chunk-JXSBFTQM.js → chunk-W5L6FMO3.js} +1 -1
  131. package/Marketplace/chunk-WCVSETLP.js +2 -0
  132. package/Marketplace/{chunk-EH6HWI3G.js → chunk-WFT47MCY.js} +1 -1
  133. package/Marketplace/{chunk-3DMGCQAD.js → chunk-WHNSPPOH.js} +1 -1
  134. package/Marketplace/{chunk-NS46QSCM.js → chunk-WJAE4LW2.js} +1 -1
  135. package/Marketplace/chunk-WKSCLDT7.js +1 -0
  136. package/Marketplace/{chunk-MH4SJTQX.js → chunk-WLRPCY65.js} +1 -1
  137. package/Marketplace/{chunk-VIMB2VWB.js → chunk-WPELZYFP.js} +1 -1
  138. package/Marketplace/{chunk-IBCRFNV4.js → chunk-WVHSR3DQ.js} +1 -1
  139. package/Marketplace/{chunk-RECNBAEB.js → chunk-WWISWZF5.js} +1 -1
  140. package/Marketplace/{chunk-FIXI7CJ5.js → chunk-X5KQU53P.js} +1 -1
  141. package/Marketplace/{chunk-KX7FIURR.js → chunk-XB3CW7KH.js} +1 -1
  142. package/Marketplace/chunk-XEBKP2KL.js +1 -0
  143. package/Marketplace/{chunk-5KS4WK6H.js → chunk-XXWBR6S5.js} +1 -1
  144. package/Marketplace/{chunk-ZQ5EGXEB.js → chunk-YIXZLIPA.js} +1 -1
  145. package/Marketplace/{chunk-QJJ2WFVX.js → chunk-Z3ZYINRX.js} +1 -1
  146. package/Marketplace/chunk-ZBKUZ4CN.js +1 -0
  147. package/Marketplace/{chunk-VK3NG4L3.js → chunk-ZDXNJIJA.js} +1 -1
  148. package/Marketplace/chunk-ZHDGR4XE.js +1 -0
  149. package/Marketplace/chunk-ZWEHKGL5.js +1 -0
  150. package/Marketplace/index.html +2 -2
  151. package/Marketplace/{main-QWLBNOBB.js → main-3TBM4ISM.js} +1 -1
  152. package/Marketplace/{styles-X3FXEB7T.css → styles-EW2SXTVD.css} +1 -1
  153. package/package.json +1 -1
  154. package/Marketplace/chunk-2TXL3UEN.js +0 -1
  155. package/Marketplace/chunk-3OIE7ARG.js +0 -1
  156. package/Marketplace/chunk-3YNS3PF3.js +0 -1
  157. package/Marketplace/chunk-4J4NGUMH.js +0 -1
  158. package/Marketplace/chunk-5UGNYVSK.js +0 -1
  159. package/Marketplace/chunk-66N77XWP.js +0 -1
  160. package/Marketplace/chunk-6RKA4STM.js +0 -1
  161. package/Marketplace/chunk-7YA3MQOI.js +0 -1
  162. package/Marketplace/chunk-AQTXFEBA.js +0 -1
  163. package/Marketplace/chunk-BAUHJDSM.js +0 -1
  164. package/Marketplace/chunk-BU5LUO3S.js +0 -1
  165. package/Marketplace/chunk-DUEZ2ZYL.js +0 -2
  166. package/Marketplace/chunk-GIRXMYNI.js +0 -1
  167. package/Marketplace/chunk-GLZJR5RB.js +0 -1
  168. package/Marketplace/chunk-IT3DTSKV.js +0 -1
  169. package/Marketplace/chunk-L6WNU54G.js +0 -1
  170. package/Marketplace/chunk-LDHQNVI5.js +0 -1
  171. package/Marketplace/chunk-LZQRF7OP.js +0 -1
  172. package/Marketplace/chunk-MMLMRH2X.js +0 -1
  173. package/Marketplace/chunk-MS4AQ6UA.js +0 -0
  174. package/Marketplace/chunk-NRNXUMZX.js +0 -1
  175. package/Marketplace/chunk-O6GXF2YS.js +0 -4
  176. package/Marketplace/chunk-O75DCJY4.js +0 -1
  177. package/Marketplace/chunk-OPFENZ3W.js +0 -1
  178. package/Marketplace/chunk-OWQ3RWNF.js +0 -1
  179. package/Marketplace/chunk-P7NATRFC.js +0 -1
  180. package/Marketplace/chunk-QANQWW5Y.js +0 -15
  181. package/Marketplace/chunk-R46PZJM7.js +0 -1
  182. package/Marketplace/chunk-ROEKFCHJ.js +0 -2
  183. package/Marketplace/chunk-S25SHAFH.js +0 -5
  184. package/Marketplace/chunk-SLI26GUH.js +0 -1
  185. package/Marketplace/chunk-UBXKO4QI.js +0 -1
  186. package/Marketplace/chunk-UD3DLFU3.js +0 -1
  187. package/Marketplace/chunk-V5BKQSAT.js +0 -1
  188. package/Marketplace/chunk-VA7FHRY6.js +0 -2
  189. package/Marketplace/chunk-X3TNRXVW.js +0 -5
  190. package/Marketplace/chunk-YZKPQRLO.js +0 -2
  191. package/Marketplace/chunk-ZKZ5DIIR.js +0 -3
@@ -1 +1 @@
1
- import{a as mt}from"./chunk-7KG3DC5J.js";import{a as lt}from"./chunk-ZOKAF4JQ.js";import{a as st}from"./chunk-D6URDVES.js";import{h as it}from"./chunk-ZKZ5DIIR.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-AEOSNAHH.js";import"./chunk-TGMCGROM.js";import"./chunk-OWQ3RWNF.js";import{e as et}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{a as nt,b as ot,d as at,e as rt}from"./chunk-5JVEEL2T.js";import{c as tt}from"./chunk-PW42BQIY.js";import{m as ct,n as pt}from"./chunk-UGVEAL7H.js";import{A as Z,h as X,m as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-SWQXSJ7O.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{H as K,J as Q,d as A,f as j,g as U,j as W,k as q,m as J,n as G}from"./chunk-M2FCTYGU.js";import{$c as s,Fc as R,Gb as L,Gc as l,Hc as N,Ic as y,Kc as $,Lc as O,Mb as d,Mc as V,Rc as B,Sc as k,Tc as H,Yb as c,Z as b,ad as u,bd as T,ca as D,cd as z,f as w,ic as n,jc as o,kc as v,lc as f,mc as g,ob as M,oc as P,pb as I,rb as a,tc as E,uc as m,v as _,xb as S,xc as F,ya as h,za as C}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ft=(i,p)=>({"bg-gradient-danger":i,"bg-gradient-warning":p}),gt=()=>["/menu/products/status/notification/detail"],ut=i=>({ID:i});function _t(i,p){if(i&1&&(n(0,"span",15),v(1,"img",16),o(),l(2)),i&2){let t=p.item;a(),c("src",t.Img,I)("alt",t.Name),a(),y(" ",t.Name," ")}}function ht(i,p){if(i&1&&(f(0),l(1),s(2,"number"),n(3,"span"),l(4,"s"),o(),g()),i&2){let t=m().$implicit;a(),y(" ",T(2,1,t.DurationInSecond,"1.1-1")," ")}}function Ct(i,p){i&1&&l(0," - ")}function St(i,p){if(i&1&&(f(0),n(1,"tr",17)(2,"td")(3,"a",18),v(4,"img",19),n(5,"span"),l(6),o()()(),n(7,"td")(8,"b"),l(9),o(),v(10,"div",20),o(),n(11,"td"),d(12,ht,5,4,"ng-container",21)(13,Ct,1,0,"ng-template",null,0,z),o(),n(15,"td"),l(16),o(),n(17,"td"),l(18),s(19,"date"),o()(),g()),i&2){let t=p.$implicit,e=R(14);a(),c("ngClass",H(14,ft,t.Status==1,t.Status==0)),a(2),c("routerLink",B(17,gt))("queryParams",k(18,ut,t.ID)),a(),F("src",t.Img,I),a(2),N(t.Name),a(3),N(t.Label),a(),c("innerHTML",t.Message,M),a(2),c("ngIf",t.DurationInSecond)("ngIfElse",e),a(4),N(t.StatusLabel),a(2),y(" ",T(19,11,t.Created,"dd MMM yyyy HH:mm")," ")}}function vt(i,p){if(i&1){let t=P();f(0),n(1,"div",7)(2,"div",22)(3,"app-custom-paginator",23),s(4,"async"),s(5,"async"),E("total",function(){h(t);let r=m(2);return C(r.getRowCount())})("next",function(){h(t);let r=m(2);return C(r.getNotifications())})("previous",function(){h(t);let r=m(2);return C(r.getNotifications())}),o()()(),g()}if(i&2){let t=m().ngIf,e=m();a(3),c("filter",e.filter)("totaldata",t==null?null:t.length)("paginationTotal",u(4,4,e.rowCount$))("hasClicked",u(5,6,e.rowCount$))}}function Nt(i,p){if(i&1&&(f(0),d(1,vt,6,8,"ng-container",14),g()),i&2){let t=p.ngIf;a(),c("ngIf",t.length>0)}}var Ht=(()=>{class i{constructor(t,e,r){this.http=t,this.notificationService=e,this.authService=r,this.filter=new mt,this.destroy$=new w,this.channelOptions=r.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(D(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(_(e=>e.Data),_(e=>(e=this.setChannelLogoToNotifications(e),e=this.setTimeToSecond(e),e)),b(1))}setTimeToSecond(t){return t=t.map(e=>(e.DurationInSecond=parseInt(e.Duration)/1e3,e)),t}setChannelLogoToNotifications(t){return t=t.map(e=>(e.Img=tt.getChannelLogoByTypeId(e.TypeID),e)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(_(e=>e.Count),b(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||i)(S(et),S(lt),S(it))}}static{this.\u0275cmp=L({type:i,selectors:[["app-notification"]],decls:33,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Product Scan Job","hideSearchBox","true",3,"onSubmit"],["routerLink","/menu/products/status/notificationV2",1,"btn","btn-outline-secondary","btn-lg"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,r){e&1&&(n(0,"mainpanel",1),E("onSubmit",function(){return r.onFilter()}),n(1,"actions")(2,"a",2),l(3," Job Scan V2 "),o()(),n(4,"filters")(5,"div")(6,"h6",3),l(7,"Channel"),o(),n(8,"ng-select",4),V("ngModelChange",function(x){return O(r.filter.ChannelID,x)||(r.filter.ChannelID=x),x}),d(9,_t,3,3,"ng-template",5),o()()(),n(10,"content")(11,"div",6)(12,"div",7)(13,"div",8)(14,"div",9)(15,"table",10)(16,"thead",11)(17,"tr",12)(18,"th"),l(19,"Channel"),o(),n(20,"th"),l(21,"Process"),o(),n(22,"th"),l(23,"Duration"),o(),n(24,"th"),l(25,"Status"),o(),n(26,"th"),l(27,"Created"),o()()(),n(28,"tbody"),d(29,St,20,20,"ng-container",13),s(30,"async"),o()()()()(),d(31,Nt,2,1,"ng-container",14),s(32,"async"),o()()()),e&2&&(a(8),c("clearable",!0)("items",r.channelOptions),$("ngModel",r.filter.ChannelID),a(21),c("ngForOf",u(30,5,r.notifications$)),a(2),c("ngIf",u(32,7,r.notifications$)))},dependencies:[G,A,j,U,W,J,q,Z,X,Y,pt,ct,st,rt,at,nt,ot,Q,K],encapsulation:2})}}return i})();export{Ht as NotificationComponent};
1
+ import{a as mt}from"./chunk-7KG3DC5J.js";import{a as lt}from"./chunk-VCTMSNVC.js";import{a as st}from"./chunk-UXPULNCR.js";import{h as it}from"./chunk-NFN7BQB3.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-J53BPEDH.js";import"./chunk-TGMCGROM.js";import"./chunk-MW6Q6DZF.js";import{e as et}from"./chunk-W5L6FMO3.js";import"./chunk-K5XRGNWG.js";import{a as nt,b as ot,d as at,e as rt}from"./chunk-PYXL7UF7.js";import{c as tt}from"./chunk-PW42BQIY.js";import{m as ct,n as pt}from"./chunk-FO7G4GMY.js";import{A as Z,h as X,m as Y}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-NNRBGHXB.js";import"./chunk-BJUPMCEP.js";import{H as K,J as Q,d as A,f as j,g as U,j as W,k as q,m as J,n as G}from"./chunk-FXQKRJWU.js";import{$c as s,Fc as R,Gb as L,Gc as l,Hc as N,Ic as y,Kc as $,Lc as O,Mb as d,Mc as V,Rc as B,Sc as k,Tc as H,Yb as c,Z as b,ad as u,bd as T,ca as D,cd as z,f as w,ic as n,jc as o,kc as v,lc as f,mc as g,ob as M,oc as P,pb as I,rb as a,tc as E,uc as m,v as _,xb as S,xc as F,ya as h,za as C}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ft=(i,p)=>({"bg-gradient-danger":i,"bg-gradient-warning":p}),gt=()=>["/menu/products/status/notification/detail"],ut=i=>({ID:i});function _t(i,p){if(i&1&&(n(0,"span",15),v(1,"img",16),o(),l(2)),i&2){let t=p.item;a(),c("src",t.Img,I)("alt",t.Name),a(),y(" ",t.Name," ")}}function ht(i,p){if(i&1&&(f(0),l(1),s(2,"number"),n(3,"span"),l(4,"s"),o(),g()),i&2){let t=m().$implicit;a(),y(" ",T(2,1,t.DurationInSecond,"1.1-1")," ")}}function Ct(i,p){i&1&&l(0," - ")}function St(i,p){if(i&1&&(f(0),n(1,"tr",17)(2,"td")(3,"a",18),v(4,"img",19),n(5,"span"),l(6),o()()(),n(7,"td")(8,"b"),l(9),o(),v(10,"div",20),o(),n(11,"td"),d(12,ht,5,4,"ng-container",21)(13,Ct,1,0,"ng-template",null,0,z),o(),n(15,"td"),l(16),o(),n(17,"td"),l(18),s(19,"date"),o()(),g()),i&2){let t=p.$implicit,e=R(14);a(),c("ngClass",H(14,ft,t.Status==1,t.Status==0)),a(2),c("routerLink",B(17,gt))("queryParams",k(18,ut,t.ID)),a(),F("src",t.Img,I),a(2),N(t.Name),a(3),N(t.Label),a(),c("innerHTML",t.Message,M),a(2),c("ngIf",t.DurationInSecond)("ngIfElse",e),a(4),N(t.StatusLabel),a(2),y(" ",T(19,11,t.Created,"dd MMM yyyy HH:mm")," ")}}function vt(i,p){if(i&1){let t=P();f(0),n(1,"div",7)(2,"div",22)(3,"app-custom-paginator",23),s(4,"async"),s(5,"async"),E("total",function(){h(t);let r=m(2);return C(r.getRowCount())})("next",function(){h(t);let r=m(2);return C(r.getNotifications())})("previous",function(){h(t);let r=m(2);return C(r.getNotifications())}),o()()(),g()}if(i&2){let t=m().ngIf,e=m();a(3),c("filter",e.filter)("totaldata",t==null?null:t.length)("paginationTotal",u(4,4,e.rowCount$))("hasClicked",u(5,6,e.rowCount$))}}function Nt(i,p){if(i&1&&(f(0),d(1,vt,6,8,"ng-container",14),g()),i&2){let t=p.ngIf;a(),c("ngIf",t.length>0)}}var Ht=(()=>{class i{constructor(t,e,r){this.http=t,this.notificationService=e,this.authService=r,this.filter=new mt,this.destroy$=new w,this.channelOptions=r.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(D(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(_(e=>e.Data),_(e=>(e=this.setChannelLogoToNotifications(e),e=this.setTimeToSecond(e),e)),b(1))}setTimeToSecond(t){return t=t.map(e=>(e.DurationInSecond=parseInt(e.Duration)/1e3,e)),t}setChannelLogoToNotifications(t){return t=t.map(e=>(e.Img=tt.getChannelLogoByTypeId(e.TypeID),e)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(_(e=>e.Count),b(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||i)(S(et),S(lt),S(it))}}static{this.\u0275cmp=L({type:i,selectors:[["app-notification"]],decls:33,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Product Scan Job","hideSearchBox","true",3,"onSubmit"],["routerLink","/menu/products/status/notificationV2",1,"btn","btn-outline-secondary","btn-lg"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,r){e&1&&(n(0,"mainpanel",1),E("onSubmit",function(){return r.onFilter()}),n(1,"actions")(2,"a",2),l(3," Job Scan V2 "),o()(),n(4,"filters")(5,"div")(6,"h6",3),l(7,"Channel"),o(),n(8,"ng-select",4),V("ngModelChange",function(x){return O(r.filter.ChannelID,x)||(r.filter.ChannelID=x),x}),d(9,_t,3,3,"ng-template",5),o()()(),n(10,"content")(11,"div",6)(12,"div",7)(13,"div",8)(14,"div",9)(15,"table",10)(16,"thead",11)(17,"tr",12)(18,"th"),l(19,"Channel"),o(),n(20,"th"),l(21,"Process"),o(),n(22,"th"),l(23,"Duration"),o(),n(24,"th"),l(25,"Status"),o(),n(26,"th"),l(27,"Created"),o()()(),n(28,"tbody"),d(29,St,20,20,"ng-container",13),s(30,"async"),o()()()()(),d(31,Nt,2,1,"ng-container",14),s(32,"async"),o()()()),e&2&&(a(8),c("clearable",!0)("items",r.channelOptions),$("ngModel",r.filter.ChannelID),a(21),c("ngForOf",u(30,5,r.notifications$)),a(2),c("ngIf",u(32,7,r.notifications$)))},dependencies:[G,A,j,U,W,J,q,Z,X,Y,pt,ct,st,rt,at,nt,ot,Q,K],encapsulation:2})}}return i})();export{Ht as NotificationComponent};
@@ -1 +1 @@
1
- import{e as R}from"./chunk-JXSBFTQM.js";import{j as V,m as B,n as E}from"./chunk-M2FCTYGU.js";import{$c as s,Gb as y,Gc as a,Hc as k,Ic as A,Jc as N,Ka as m,Mb as x,Nc as T,Oa as h,Yb as C,Z as _,ad as p,dc as S,ic as r,jc as l,kc as g,oc as w,pa as v,rb as o,tc as f,uc as b,v as P,ya as d,za as c}from"./chunk-B7KTCPKC.js";function $(e,z){if(e&1){let i=w();r(0,"span",9),f("click",function(){d(i);let t=b();return c(t.onShowTotal())}),r(1,"i",10),a(2,"?"),l()()}}function D(e,z){if(e&1&&(r(0,"span"),a(1),s(2,"async"),s(3,"number"),l()),e&2){let i=b();o(),k(i.rowCountApi()?p(2,1,i.rowCount$):p(3,3,i.paginationTotal))}}var K=(()=>{class e{constructor(){this.httpService=v(R),this.nextButtonAlwaysVisible=h(!1),this.next=new m,this.filterChange=new m,this.previous=new m,this.total=new m,this.hasClicked=!1,this.rowCountApi=h(null),this.rowCount$=null}initRowCount(){this.rowCountApi()&&(this.hasClicked=!0,this.rowCount$=this.httpService.post(this.rowCountApi(),this.filter).pipe(P(i=>i.Count),_(1)))}onShowTotal(){this.total.emit(),this.initRowCount()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.filterChange.emit(this.filter),this.previous.emit()}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.filterChange.emit(this.filter),this.next.emit()}static{this.\u0275fac=function(u){return new(u||e)}}static{this.\u0275cmp=y({type:e,selectors:[["app-custom-paginator"]],inputs:{nextButtonAlwaysVisible:[1,"nextButtonAlwaysVisible"],filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked",rowCountApi:[1,"rowCountApi"]},outputs:{next:"next",filterChange:"filterChange",previous:"previous",total:"total"},decls:18,vars:12,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click","hidden"],[1,"fas","fa-arrow-left"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click","hidden"],[1,"fas","fa-arrow-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(u,t){if(u&1){let n=w();T(0),r(1,"div",0)(2,"div",1)(3,"div",2),a(4),s(5,"number"),s(6,"number"),x(7,$,3,0,"span",3)(8,D,4,5,"span"),a(9),l()(),r(10,"div",4)(11,"a",5),f("click",function(){return d(n),c(t.onPreviousPage())}),g(12,"i",6),a(13," Prev"),l(),r(14,"a",7),s(15,"async"),f("click",function(){return d(n),c(t.onNextPage())}),g(16,"i",8),a(17," Next"),l()()()}if(u&2){let n=t.filter.PageSize!=null||t.filter.PageSize!=null?t.filter.PageSize:t.filter.RowCount;o(4),N(" Showing ",p(5,6,n*(t.filter.PageNumber-1)+1)," - ",p(6,8,n*(t.filter.PageNumber-1)+t.totaldata)," of "),o(3),S(t.hasClicked?8:7),o(2),A(" records ~ ",t.filter.PageNumber," Page "),o(2),C("hidden",t.filter.PageNumber==1),o(3),C("hidden",(n*(t.filter.PageNumber-1)+t.totaldata==(t.rowCountApi()?p(15,10,t.rowCount$):t.paginationTotal)||t.totaldata<n)&&!t.nextButtonAlwaysVisible())}},dependencies:[E,V,B],encapsulation:2})}}return e})();export{K as a};
1
+ import{e as R}from"./chunk-W5L6FMO3.js";import{j as V,m as B,n as E}from"./chunk-FXQKRJWU.js";import{$c as s,Gb as y,Gc as a,Hc as k,Ic as A,Jc as N,Ka as m,Mb as x,Nc as T,Oa as h,Yb as C,Z as _,ad as p,dc as S,ic as r,jc as l,kc as g,oc as w,pa as v,rb as o,tc as f,uc as b,v as P,ya as d,za as c}from"./chunk-OJMQBH6T.js";function $(e,z){if(e&1){let i=w();r(0,"span",9),f("click",function(){d(i);let t=b();return c(t.onShowTotal())}),r(1,"i",10),a(2,"?"),l()()}}function D(e,z){if(e&1&&(r(0,"span"),a(1),s(2,"async"),s(3,"number"),l()),e&2){let i=b();o(),k(i.rowCountApi()?p(2,1,i.rowCount$):p(3,3,i.paginationTotal))}}var K=(()=>{class e{constructor(){this.httpService=v(R),this.nextButtonAlwaysVisible=h(!1),this.next=new m,this.filterChange=new m,this.previous=new m,this.total=new m,this.hasClicked=!1,this.rowCountApi=h(null),this.rowCount$=null}initRowCount(){this.rowCountApi()&&(this.hasClicked=!0,this.rowCount$=this.httpService.post(this.rowCountApi(),this.filter).pipe(P(i=>i.Count),_(1)))}onShowTotal(){this.total.emit(),this.initRowCount()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.filterChange.emit(this.filter),this.previous.emit()}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.filterChange.emit(this.filter),this.next.emit()}static{this.\u0275fac=function(u){return new(u||e)}}static{this.\u0275cmp=y({type:e,selectors:[["app-custom-paginator"]],inputs:{nextButtonAlwaysVisible:[1,"nextButtonAlwaysVisible"],filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked",rowCountApi:[1,"rowCountApi"]},outputs:{next:"next",filterChange:"filterChange",previous:"previous",total:"total"},decls:18,vars:12,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click","hidden"],[1,"fas","fa-arrow-left"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click","hidden"],[1,"fas","fa-arrow-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(u,t){if(u&1){let n=w();T(0),r(1,"div",0)(2,"div",1)(3,"div",2),a(4),s(5,"number"),s(6,"number"),x(7,$,3,0,"span",3)(8,D,4,5,"span"),a(9),l()(),r(10,"div",4)(11,"a",5),f("click",function(){return d(n),c(t.onPreviousPage())}),g(12,"i",6),a(13," Prev"),l(),r(14,"a",7),s(15,"async"),f("click",function(){return d(n),c(t.onNextPage())}),g(16,"i",8),a(17," Next"),l()()()}if(u&2){let n=t.filter.PageSize!=null||t.filter.PageSize!=null?t.filter.PageSize:t.filter.RowCount;o(4),N(" Showing ",p(5,6,n*(t.filter.PageNumber-1)+1)," - ",p(6,8,n*(t.filter.PageNumber-1)+t.totaldata)," of "),o(3),S(t.hasClicked?8:7),o(2),A(" records ~ ",t.filter.PageNumber," Page "),o(2),C("hidden",t.filter.PageNumber==1),o(3),C("hidden",(n*(t.filter.PageNumber-1)+t.totaldata==(t.rowCountApi()?p(15,10,t.rowCount$):t.paginationTotal)||t.totaldata<n)&&!t.nextButtonAlwaysVisible())}},dependencies:[E,V,B],encapsulation:2})}}return e})();export{K as a};
@@ -1,4 +1,4 @@
1
- import{a as E}from"./chunk-SM3P57SO.js";import{a as B}from"./chunk-ECRWEMEV.js";import{M as k,Y as z,ba as D}from"./chunk-LZCEM2PC.js";import{m as F}from"./chunk-6QYD6NIJ.js";import{Aa as x,Ca as l,Gb as v,Hb as b,Ib as C,Kb as a,Qc as w,Xb as u,Yb as $,_b as y,ac as I,ic as d,ja as f,jc as s,ka as g,kc as c,od as M,pa as m,rb as p,tc as S,xb as h}from"./chunk-B7KTCPKC.js";var L=(()=>{class t extends E{pathId;ngOnInit(){this.pathId="url(#"+z()+")"}static \u0275fac=(()=>{let n;return function(e){return(n||(n=l(t)))(e||t)}})();static \u0275cmp=v({type:t,selectors:[["SpinnerIcon"]],features:[a],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,e){i&1&&(x(),d(0,"svg",0)(1,"g"),c(2,"path",1),s(),d(3,"defs")(4,"clipPath",2),c(5,"rect",3),s()()()),i&2&&(I(e.getClassNames()),u("aria-label",e.ariaLabel)("aria-hidden",e.ariaHidden)("role",e.role),p(),u("clip-path",e.pathId),p(3),$("id",e.pathId))},encapsulation:2})}return t})();var V=({dt:t})=>`
1
+ import{a as E}from"./chunk-DFGZ4L65.js";import{a as B}from"./chunk-UHTMVOX6.js";import{M as k,Y as z,ba as D}from"./chunk-7AE3725T.js";import{m as F}from"./chunk-5PS6ZS3N.js";import{Aa as x,Ca as l,Gb as v,Hb as b,Ib as C,Kb as a,Qc as w,Xb as u,Yb as $,_b as y,ac as I,ic as d,ja as f,jc as s,ka as g,kc as c,od as M,pa as m,rb as p,tc as S,xb as h}from"./chunk-OJMQBH6T.js";var L=(()=>{class t extends E{pathId;ngOnInit(){this.pathId="url(#"+z()+")"}static \u0275fac=(()=>{let n;return function(e){return(n||(n=l(t)))(e||t)}})();static \u0275cmp=v({type:t,selectors:[["SpinnerIcon"]],features:[a],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M6.99701 14C5.85441 13.999 4.72939 13.7186 3.72012 13.1832C2.71084 12.6478 1.84795 11.8737 1.20673 10.9284C0.565504 9.98305 0.165424 8.89526 0.041387 7.75989C-0.0826496 6.62453 0.073125 5.47607 0.495122 4.4147C0.917119 3.35333 1.59252 2.4113 2.46241 1.67077C3.33229 0.930247 4.37024 0.413729 5.4857 0.166275C6.60117 -0.0811796 7.76026 -0.0520535 8.86188 0.251112C9.9635 0.554278 10.9742 1.12227 11.8057 1.90555C11.915 2.01493 11.9764 2.16319 11.9764 2.31778C11.9764 2.47236 11.915 2.62062 11.8057 2.73C11.7521 2.78503 11.688 2.82877 11.6171 2.85864C11.5463 2.8885 11.4702 2.90389 11.3933 2.90389C11.3165 2.90389 11.2404 2.8885 11.1695 2.85864C11.0987 2.82877 11.0346 2.78503 10.9809 2.73C9.9998 1.81273 8.73246 1.26138 7.39226 1.16876C6.05206 1.07615 4.72086 1.44794 3.62279 2.22152C2.52471 2.99511 1.72683 4.12325 1.36345 5.41602C1.00008 6.70879 1.09342 8.08723 1.62775 9.31926C2.16209 10.5513 3.10478 11.5617 4.29713 12.1803C5.48947 12.7989 6.85865 12.988 8.17414 12.7157C9.48963 12.4435 10.6711 11.7264 11.5196 10.6854C12.3681 9.64432 12.8319 8.34282 12.8328 7C12.8328 6.84529 12.8943 6.69692 13.0038 6.58752C13.1132 6.47812 13.2616 6.41667 13.4164 6.41667C13.5712 6.41667 13.7196 6.47812 13.8291 6.58752C13.9385 6.69692 14 6.84529 14 7C14 8.85651 13.2622 10.637 11.9489 11.9497C10.6356 13.2625 8.85432 14 6.99701 14Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,e){i&1&&(x(),d(0,"svg",0)(1,"g"),c(2,"path",1),s(),d(3,"defs")(4,"clipPath",2),c(5,"rect",3),s()()()),i&2&&(I(e.getClassNames()),u("aria-label",e.ariaLabel)("aria-hidden",e.ariaHidden)("role",e.role),p(),u("clip-path",e.pathId),p(3),$("id",e.pathId))},encapsulation:2})}return t})();var V=({dt:t})=>`
2
2
  .p-inputtext {
3
3
  font-family: inherit;
4
4
  font-feature-settings: inherit;
@@ -1 +1 @@
1
- import{a as o}from"./chunk-Q6P7MEKT.js";import{a as s,b as l}from"./chunk-IMK2JGZA.js";import"./chunk-ZKZ5DIIR.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-AEOSNAHH.js";import"./chunk-TGMCGROM.js";import"./chunk-OWQ3RWNF.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-PW42BQIY.js";import"./chunk-ATZ475FN.js";import"./chunk-SWQXSJ7O.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{F as c,J as d}from"./chunk-M2FCTYGU.js";import{Gb as a,Yb as i,ic as p,jc as m,kc as n,rb as r}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class t{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=a({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,v){e&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),m()()(),n(4,"router-outlet")),e&2&&(r(3),i("Tabs",v.tabs))},dependencies:[l,s,d,c],encapsulation:2})}}return t})(),g=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-M6UQ3NJ3.js").then(t=>t.OrderApiComponent)},canActivate:[o],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-3IIKX554.js").then(t=>t.ProductApiComponent)},canActivate:[o],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-3DMGCQAD.js").then(t=>t.EscrowApiComponent)},canActivate:[o],data:{title:"Escrow API"}}]}];export{f as JsonApiComponent,g as routes};
1
+ import{a as o}from"./chunk-FHH5BTG7.js";import{a as s,b as l}from"./chunk-A64VIOKR.js";import"./chunk-NFN7BQB3.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-J53BPEDH.js";import"./chunk-TGMCGROM.js";import"./chunk-MW6Q6DZF.js";import"./chunk-W5L6FMO3.js";import"./chunk-K5XRGNWG.js";import"./chunk-PW42BQIY.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-NNRBGHXB.js";import"./chunk-BJUPMCEP.js";import{F as c,J as d}from"./chunk-FXQKRJWU.js";import{Gb as a,Yb as i,ic as p,jc as m,kc as n,rb as r}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class t{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=a({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,v){e&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),m()()(),n(4,"router-outlet")),e&2&&(r(3),i("Tabs",v.tabs))},dependencies:[l,s,d,c],encapsulation:2})}}return t})(),g=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-DUF425GC.js").then(t=>t.OrderApiComponent)},canActivate:[o],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-PFZOP2J7.js").then(t=>t.ProductApiComponent)},canActivate:[o],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-WHNSPPOH.js").then(t=>t.EscrowApiComponent)},canActivate:[o],data:{title:"Escrow API"}}]}];export{f as JsonApiComponent,g as routes};
@@ -1 +1 @@
1
- import{Ea as b,Ga as f,Ja as v,c as u,ca as l,pa as i,wa as c}from"./chunk-B7KTCPKC.js";function m(e){e||(c(m),e=i(f));let o=new u(t=>e.onDestroy(t.next.bind(t)));return t=>t.pipe(l(o))}function g(e){e===void 0&&(c(g),e=i(b));let o=e.get(v);return t=>new u(n=>{let y=o.add(),a=!1;function r(){a||(y(),a=!0)}let d=t.subscribe({next:s=>{n.next(s),r()},complete:()=>{n.complete(),r()},error:s=>{n.error(s),r()}});return d.add(()=>{n.unsubscribe(),r()}),d})}export{m as a,g as b};
1
+ import{Ea as b,Ga as f,Ja as v,c as u,ca as l,pa as i,wa as c}from"./chunk-OJMQBH6T.js";function m(e){e||(c(m),e=i(f));let o=new u(t=>e.onDestroy(t.next.bind(t)));return t=>t.pipe(l(o))}function g(e){e===void 0&&(c(g),e=i(b));let o=e.get(v);return t=>new u(n=>{let y=o.add(),a=!1;function r(){a||(y(),a=!0)}let d=t.subscribe({next:s=>{n.next(s),r()},complete:()=>{n.complete(),r()},error:s=>{n.error(s),r()}});return d.add(()=>{n.unsubscribe(),r()}),d})}export{m as a,g as b};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-ZOKAF4JQ.js";import"./chunk-AEOSNAHH.js";import"./chunk-OWQ3RWNF.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as k,n as B}from"./chunk-UGVEAL7H.js";import"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{E as P,H as T,J as R,g as D,j as C,k as b,m as y,n as M}from"./chunk-M2FCTYGU.js";import{$c as c,Gb as h,Gc as n,Hc as d,Ic as _,Mb as s,Yb as m,aa as I,ad as E,bd as x,ic as i,jc as t,lc as f,mc as u,rb as o,uc as S,v as g,xb as v}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function N(a,p){if(a&1&&(i(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),n(9),t()()()()()()),a&2){let e=S().ngIf;o(9),d(e.Perflog)}}function L(a,p){if(a&1&&(f(0),i(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),n(5,"StackTrace"),t()(),i(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),n(10),t()()()()()(),u()),a&2){let e=S().ngIf;o(10),d(e==null?null:e.StackTrace)}}function A(a,p){if(a&1&&(f(0),i(1,"mainpanel",1)(2,"actions")(3,"a",2),n(4,"Back"),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),n(12,"General"),t()(),i(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),n(18,"Created Date"),t(),i(19,"div")(20,"span"),n(21),c(22,"date"),t()()()(),i(23,"div",10)(24,"div",11)(25,"label"),n(26,"Status"),t(),i(27,"div")(28,"span"),n(29),t()()()()(),i(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),n(34,"Duration"),t(),i(35,"div")(36,"span"),n(37),c(38,"number"),t()()()(),i(39,"div",10)(40,"div",11)(41,"label"),n(42,"Label"),t(),i(43,"div")(44,"span"),n(45),t()()()()()()()()(),i(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),n(51,"Message"),t()(),i(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),n(56),t()()()()()(),s(57,N,10,1,"div",16)(58,L,11,1,"ng-container",0),t()()()(),u()),a&2){let e=p.ngIf;o(),m("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(x(22,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",x(38,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m("ngIf",e==null?null:e.Perflog),o(),m("ngIf",e==null?null:e.StackTrace)}}var K=(()=>{class a{constructor(e,r){this.activatedRoute=e,this.notificationService=r}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(I(e=>{let r=e.ID;return this.notificationService.getNotificationDetail(r).pipe(g(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(r){return new(r||a)(v(P),v(w))}}static{this.\u0275cmp=h({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(r,l){r&1&&(s(0,A,59,16,"ng-container",0),c(1,"async")),r&2&&m("ngIf",E(1,1,l.notification$))},dependencies:[M,D,C,y,b,B,k,R,T],encapsulation:2})}}return a})();export{K as DetailComponent};
1
+ import{a as w}from"./chunk-VCTMSNVC.js";import"./chunk-J53BPEDH.js";import"./chunk-MW6Q6DZF.js";import"./chunk-W5L6FMO3.js";import"./chunk-K5XRGNWG.js";import{m as k,n as B}from"./chunk-FO7G4GMY.js";import"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-NNRBGHXB.js";import"./chunk-BJUPMCEP.js";import{E as P,H as T,J as R,g as D,j as C,k as b,m as y,n as M}from"./chunk-FXQKRJWU.js";import{$c as c,Gb as h,Gc as n,Hc as d,Ic as _,Mb as s,Yb as m,aa as I,ad as E,bd as x,ic as i,jc as t,lc as f,mc as u,rb as o,uc as S,v as g,xb as v}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function N(a,p){if(a&1&&(i(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),n(9),t()()()()()()),a&2){let e=S().ngIf;o(9),d(e.Perflog)}}function L(a,p){if(a&1&&(f(0),i(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),n(5,"StackTrace"),t()(),i(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),n(10),t()()()()()(),u()),a&2){let e=S().ngIf;o(10),d(e==null?null:e.StackTrace)}}function A(a,p){if(a&1&&(f(0),i(1,"mainpanel",1)(2,"actions")(3,"a",2),n(4,"Back"),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),n(12,"General"),t()(),i(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),n(18,"Created Date"),t(),i(19,"div")(20,"span"),n(21),c(22,"date"),t()()()(),i(23,"div",10)(24,"div",11)(25,"label"),n(26,"Status"),t(),i(27,"div")(28,"span"),n(29),t()()()()(),i(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),n(34,"Duration"),t(),i(35,"div")(36,"span"),n(37),c(38,"number"),t()()()(),i(39,"div",10)(40,"div",11)(41,"label"),n(42,"Label"),t(),i(43,"div")(44,"span"),n(45),t()()()()()()()()(),i(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),n(51,"Message"),t()(),i(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),n(56),t()()()()()(),s(57,N,10,1,"div",16)(58,L,11,1,"ng-container",0),t()()()(),u()),a&2){let e=p.ngIf;o(),m("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(x(22,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",x(38,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m("ngIf",e==null?null:e.Perflog),o(),m("ngIf",e==null?null:e.StackTrace)}}var K=(()=>{class a{constructor(e,r){this.activatedRoute=e,this.notificationService=r}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(I(e=>{let r=e.ID;return this.notificationService.getNotificationDetail(r).pipe(g(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(r){return new(r||a)(v(P),v(w))}}static{this.\u0275cmp=h({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(r,l){r&1&&(s(0,A,59,16,"ng-container",0),c(1,"async")),r&2&&m("ngIf",E(1,1,l.notification$))},dependencies:[M,D,C,y,b,B,k,R,T],encapsulation:2})}}return a})();export{K as DetailComponent};
@@ -1 +1 @@
1
- import{b as ae,e as re}from"./chunk-JXSBFTQM.js";import{b as ie,c as le}from"./chunk-PW42BQIY.js";import{b as M,c as W,i as me,j as _,k as S}from"./chunk-UGVEAL7H.js";import{c as T,e as K,h as R,i as Z,j as x,l as N,m as k,n as $,q as ee,s as te,w as ne,y as oe}from"./chunk-6QYD6NIJ.js";import{d as F,f as Q,g as X}from"./chunk-M2FCTYGU.js";import{Fc as A,Gb as y,Gc as r,Hc as P,Ic as Y,Kc as b,Lc as w,Mb as f,Mc as D,Sc as U,Tc as J,Yb as p,dc as h,ic as i,jc as l,kc as V,oc as I,pb as z,rb as a,tc as v,uc as L,xb as C,ya as c,za as g}from"./chunk-B7KTCPKC.js";function pe(t,u){if(t&1&&(i(0,"tr")(1,"td")(2,"a",11),V(3,"img",12),i(4,"span"),r(5),l()()(),i(6,"td"),r(7),l(),i(8,"td"),r(9),l()()),t&2){let n=u.$implicit;a(2),p("href","/menu/channel/marketplace/view?ID="+n.Key.ID,z),a(),p("src",n.Logo,z),a(2),P(n.Key.Name),a(2),P(n.Value.Out),a(2),P(n.Value.Tg)}}var We=(()=>{class t{constructor(n,o){this.dialogRef=n,this.data=o,this.generateChannelName(),this.channels=this.setChannelLogo(o.channels)}ngOnInit(){this.modalConfig=new _,this.modalConfig.title="Channel - New Order Configuration is not Unique!",this.modalConfig.headerType=me.Warning,this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideClose=!0}setChannelLogo(n){return n.map(o=>(o.Logo=le.getChannelLogoByTypeId(o.Key.TypeID),o))}generateChannelName(){this.channelNames="";let n=this.data.channels;n.forEach((o,e)=>{this.channelNames+=`${o.Key} ${e!=n.length-1?" + ":""}`})}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(W))}}static{this.\u0275cmp=y({type:t,selectors:[["app-modal-channel-warning"]],standalone:!1,decls:24,vars:2,consts:[[3,"onCancel","onClose","config"],["content","",1,"pt-2","px-4"],[1,"row"],[1,"col-12"],[1,"lh-base","fs-5"],[1,"mb-4"],[1,"table","table-bordered"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"fs-5","mt-4"],["href","https://support.dealpos.com/en/articles/8281096-setup-multiple-channel-marketplace-to-one-warehouse-outlet","target","_blank"],["target","_blank",3,"href"],[1,"me-3",2,"width","24px",3,"src"]],template:function(o,e){o&1&&(i(0,"modal-material",0),v("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),i(1,"div",1)(2,"div",2)(3,"div",3)(4,"p",4),r(5,"When your order configuration is not unique, your Dashboard Sales Report will be invalid. You can use either Outlet or Order Tag to differentiate Channel Order. "),l(),i(6,"h5",5),r(7,"Your duplicate Channels are"),l(),i(8,"table",6)(9,"thead")(10,"tr",7)(11,"th"),r(12,"Channel"),l(),i(13,"th"),r(14,"Outlet"),l(),i(15,"th"),r(16,"Tag"),l()()(),i(17,"tbody"),f(18,pe,10,5,"tr",8),l()(),i(19,"p",9),r(20," Please refer to this "),i(21,"a",10),r(22,"article"),l(),r(23," for more information "),l()()()()()),o&2&&(p("config",e.modalConfig),a(18),p("ngForOf",e.channels))},dependencies:[Q,S],encapsulation:2})}}return t})();var Ke=(()=>{class t{constructor(n,o,e){this.dialogRef=n,this.httpService=o,this.toastr=e,this.modalConfig=new _,this.modalConfig.title="Write Off Reason"}onSubmit(){let n={Name:this.reason};this.subscription=this.httpService.post("/api/channel/AddWriteoffOption",n).subscribe(o=>{this.toastr.success(o.Message,"Success"),this.dialogRef.close(n)})}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(re),C(ae))}}static{this.\u0275cmp=y({type:t,selectors:[["app-dialog-writeOff-reason"]],standalone:!1,decls:7,vars:3,consts:[["name","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"form-label-group"],["type","text","id","writeOffReason","placeholder","Write Off Reason","name","writeOffReason",1,"form-control",3,"ngModelChange","ngModel"],["for","shopid"]],template:function(o,e){if(o&1){let m=I();i(0,"modal-material",1),v("onClose",function(){return c(m),g(e.onClose())})("onCancel",function(){return c(m),g(e.onClose())})("onOk",function(){return c(m),g(e.onSubmit())}),i(1,"div",2)(2,"div",3)(3,"input",4,0),D("ngModelChange",function(s){return c(m),w(e.reason,s)||(e.reason=s),g(s)}),l(),i(5,"label",5),r(6,"Reason"),l()()()()}o&2&&(p("dynamicValidated",e.reason)("config",e.modalConfig),a(3),b("ngModel",e.reason))},dependencies:[T,R,k,S],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]})}}return t})();var ue=t=>({invalid:t});function fe(t,u){t&1&&(i(0,"small"),r(1," URL is required "),l())}function ce(t,u){if(t&1&&(i(0,"div",13),f(1,fe,2,0,"small",14),l()),t&2){L();let n=A(10);a(),p("ngIf",n.errors.required)}}function ge(t,u){t&1&&(i(0,"small"),r(1," Email is required "),l())}function Ce(t,u){t&1&&(i(0,"small"),r(1," Email is not valid "),l())}function he(t,u){if(t&1&&(i(0,"div",13),f(1,ge,2,0,"small",14)(2,Ce,2,0,"small",14),l()),t&2){L();let n=A(16);a(),p("ngIf",n.errors.required),a(),p("ngIf",n.errors.pattern)}}var Be=(()=>{class t{constructor(n){this.dialogRef=n}ngOnInit(){this.formData={URL:"",Email:""},this.initModalConfig()}initModalConfig(){this.modalConfig=new _,this.modalConfig.title="Fill data for Customer Support"}onSubmit(n){n!="Enter"&&this.dialogRef.close(this.formData)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||t)(C(M))}}static{this.\u0275cmp=y({type:t,selectors:[["app-contact-support"]],standalone:!1,decls:18,vars:9,consts:[["url","ngModel"],["email","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mx-4"],["for","customerURL"],[1,"input-group","mb-2"],[1,"input-group-prepend"],["id","tokopediaUrl",1,"border-start-0","rounded-start","input-group-text","pointer-default","bg-light",2,"height","58px",3,"ngClass"],["required","","type","text","id","customerURL","name","customerURL","title","customerURL",1,"form-control","border-start-0","customerUrl",3,"ngModelChange","ngModel"],["class","text-danger",4,"ngIf"],["for","customerEmail"],["required","","type","text","id","customerEmail","name","customerEmail","title","customerEmail","pattern","\\b[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,4}\\b",1,"form-control",3,"ngModelChange","ngModel"],[1,"text-danger"],[4,"ngIf"]],template:function(o,e){if(o&1){let m=I();i(0,"modal-material",2),v("onClose",function(){return c(m),g(e.onClose())})("onCancel",function(){return c(m),g(e.onClose())})("onOk",function(s){return c(m),g(e.onSubmit(s))}),i(1,"div",3)(2,"div",4)(3,"label",5),r(4,"Tokopedia URL"),l(),i(5,"div",6)(6,"div",7)(7,"span",8),r(8,"https://tokopedia.com/"),l()(),i(9,"input",9,0),D("ngModelChange",function(s){return c(m),w(e.formData.URL,s)||(e.formData.URL=s),g(s)}),l()(),f(11,ce,2,1,"div",10),i(12,"label",11),r(13,"Requester's Email"),l(),i(14,"div",6)(15,"input",12,1),D("ngModelChange",function(s){return c(m),w(e.formData.Email,s)||(e.formData.Email=s),g(s)}),l()(),f(17,he,3,2,"div",10),l()()()}if(o&2){let m=A(10),d=A(16);p("dynamicValidated",!m.invalid&&!d.invalid)("config",e.modalConfig),a(7),p("ngClass",U(7,ue,m.invalid&&(m.dirty||m.touched))),a(2),b("ngModel",e.formData.URL),a(2),p("ngIf",m.invalid&&(m.dirty||m.touched)),a(4),b("ngModel",e.formData.Email),a(2),p("ngIf",d.invalid&&(d.dirty||d.touched))}},dependencies:[F,X,T,R,ne,oe,k,S],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.input-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.input-group[_ngcontent-%COMP%] > input.ng-invalid.ng-touched[_ngcontent-%COMP%]{border-color:#fb404b}.input-group[_ngcontent-%COMP%] > input.customerUrl[_ngcontent-%COMP%]{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.invalid[_ngcontent-%COMP%]{border-color:#fb404b}.pointer-default[_ngcontent-%COMP%]{cursor:default}"]})}}return t})();var Je=(()=>{class t{constructor(n,o){this.dialogRef=n,this.data=o}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new _,this.modalConfig.title=this.data?.title,this.modalConfig.okText="SAVE"}onSubmit(){this.dialogRef.close(this.shopID)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(W))}}static{this.\u0275cmp=y({type:t,selectors:[["app-modal-dialog-tokopedia"]],standalone:!1,decls:7,vars:3,consts:[["name","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"form-label-group"],["type","text","id","shopid","placeholder","Shop ID","name","ShopID","data-toggle","tooltip","title","Channel Name",1,"form-control",3,"ngModelChange","ngModel"],["for","shopid"]],template:function(o,e){if(o&1){let m=I();i(0,"modal-material",1),v("onClose",function(){return c(m),g(e.onClose())})("onCancel",function(){return c(m),g(e.onClose())})("onOk",function(){return c(m),g(e.onSubmit())}),i(1,"div",2)(2,"div",3)(3,"input",4,0),D("ngModelChange",function(s){return c(m),w(e.shopID,s)||(e.shopID=s),g(s)}),l(),i(5,"label",5),r(6,"Shop ID"),l()()()()}o&2&&(p("dynamicValidated",e.shopID)("config",e.modalConfig),a(3),b("ngModel",e.shopID))},dependencies:[T,R,k,S],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]})}}return t})();var _e=t=>({"input-group":t}),ye=(t,u)=>({"is-invalid":t,"input-shopify rounded-start":u}),se=t=>({"is-invalid":t});function ve(t,u){t&1&&(i(0,"label",3),r(1,"Shopify URL"),l())}function Me(t,u){t&1&&(i(0,"label",3),r(1,"URL"),l())}function Se(t,u){t&1&&(i(0,"span",6),r(1,"myshopify.com"),l())}function Te(t,u){if(t&1&&(i(0,"div"),r(1),l()),t&2){let n=L(2);a(),Y("",n.data==null?null:n.data.title," url is required")}}function Re(t,u){if(t&1&&(i(0,"div",7),f(1,Te,2,1,"div"),l()),t&2){let n,o=L();a(),h(!(o.formGroup==null||(n=o.formGroup.get("URL"))==null)&&n.getError("required")?1:-1)}}function be(t,u){t&1&&r(0," API Key ")}function we(t,u){t&1&&r(0," Consumer Key ")}function De(t,u){t&1&&(r(0," ("),i(1,"a",11),r(2,"help center article"),l(),r(3,") "))}function Ee(t,u){t&1&&(i(0,"div",7),r(1,"API Key is required"),l())}function Oe(t,u){t&1&&r(0," Admin API Access Token ")}function Ge(t,u){t&1&&r(0," Consumer Secret ")}function Ve(t,u){t&1&&(i(0,"div",7),r(1,"Consumer Secret is required"),l())}var et=(()=>{class t{constructor(n,o){this.dialogRef=n,this.data=o,this.modalConfig=new _,this.urlCtrl=new N(null),this.channelType=ie}ngOnInit(){this.initModalConfig(),this.initFormGroup()}initFormGroup(){let n=[K.required];this.formGroup=new x({URL:new N(null,n),ConsumerKey:new N(null,[K.required]),ConsumerSecret:new N(null,[K.required])})}initModalConfig(){this.modalConfig=new _,this.modalConfig.title=this.data.title,this.modalConfig.okText="SAVE"}onClose(){this.dialogRef.close()}onSubmit(){this.formGroup.markAllAsTouched();let n=this.formGroup?.get("URL")?.getError("pattern"),o=this.formGroup?.get("ConsumerKey")?.valid,e=this.formGroup?.get("ConsumerSecret")?.valid;if(this.formGroup?.valid||n&&o&&e){let d=this.formGroup.value;d=this.trimShopifyUrl(d),this.dialogRef.close(d)}}trimShopifyUrl(n){if(this.data?.channelType==this.channelType.Shopify){let o=n.URL?.trim()||"";o=o.replace(/^https?:\/\//,""),o.includes(".myshopify.com")||(o=`${o}.myshopify.com`),n.URL=o}return n}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(W))}}static{this.\u0275cmp=y({type:t,selectors:[["app-modal-register-channel"]],standalone:!1,decls:23,vars:27,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[3,"formGroup"],["for","shopid",1,"form-label","fw-bold","mb-2"],[1,"mb-8","has-validation",3,"ngClass"],["type","text","id","shopid","name","URL","title","URL","formControlName","URL",1,"form-control","form-input","rounded",3,"placeholder","ngClass"],["id","basic-addon2",1,"input-group-text","rounded-end","form-input","text-secondary"],[1,"invalid-feedback"],[1,"mb-8","has-validation"],["type","text","id","ConsumerKey","name","ConsumerKey","title","ConsumerKey","formControlName","ConsumerKey",1,"form-control","rounded","form-input",3,"placeholder","ngClass"],["type","text","id","ConsumerSecret","name","ConsumerSecret","title","ConsumerSecret","formControlName","ConsumerSecret",1,"form-control","rounded","form-input",3,"placeholder","ngClass"],["target","_blank","href","https://support.dealpos.com/en/articles/9525716-shopify-authorization-at-dealpos-apps",1,"button","text-primary","fw-bold"]],template:function(o,e){if(o&1&&(i(0,"modal-material",0),v("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),i(1,"div",1)(2,"form",2),f(3,ve,2,0,"label",3),i(4,"div",4),f(5,Me,2,0,"label",3),V(6,"input",5),f(7,Se,2,0,"span",6)(8,Re,2,1,"div",7),l(),i(9,"div",8)(10,"label",3)(11,"span"),f(12,be,1,0)(13,we,1,0),l(),f(14,De,4,0),l(),V(15,"input",9),f(16,Ee,2,0,"div",7),l(),i(17,"div",8)(18,"label",3),f(19,Oe,1,0)(20,Ge,1,0),l(),V(21,"input",10),f(22,Ve,2,0,"div",7),l()()()()),o&2){let m,d,s,E,O,G;p("config",e.modalConfig),a(2),p("formGroup",e.formGroup),a(),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?3:-1),a(),p("ngClass",U(18,_e,(e.data==null?null:e.data.channelType)==e.channelType.Shopify)),a(),h((e.data==null?null:e.data.channelType)!=e.channelType.Shopify?5:-1),a(),p("placeholder",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"[ex: brand.myshopify.com]":"https://mydomain.com/")("ngClass",J(20,ye,(e.formGroup==null||(m=e.formGroup.get("URL"))==null?null:m.invalid)&&((e.formGroup==null||(m=e.formGroup.get("URL"))==null?null:m.dirty)||(e.formGroup==null||(m=e.formGroup.get("URL"))==null?null:m.touched)),(e.data==null?null:e.data.channelType)==e.channelType.Shopify)),a(),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?7:-1),a(),h(!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.invalid&&(!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.dirty||!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.touched)?8:-1),a(4),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?12:13),a(2),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?14:-1),a(),p("placeholder",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"[Create an app and copy the API Key]":"[Create an app and copy the Consumer Key]")("ngClass",U(23,se,(e.formGroup==null||(s=e.formGroup.get("ConsumerKey"))==null?null:s.invalid)&&((e.formGroup==null||(s=e.formGroup.get("ConsumerKey"))==null?null:s.dirty)||(e.formGroup==null||(s=e.formGroup.get("ConsumerKey"))==null?null:s.touched)))),a(),h(!(e.formGroup==null||(E=e.formGroup.get("ConsumerKey"))==null)&&E.getError("required")&&(!(e.formGroup==null||(E=e.formGroup.get("ConsumerKey"))==null)&&E.dirty||!(e.formGroup==null||(E=e.formGroup.get("ConsumerKey"))==null)&&E.touched)?16:-1),a(3),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?19:20),a(2),p("placeholder",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"[shpat***************************]":"cs_***************")("ngClass",U(25,se,(e.formGroup==null||(O=e.formGroup.get("ConsumerSecret"))==null?null:O.invalid)&&((e.formGroup==null||(O=e.formGroup.get("ConsumerSecret"))==null?null:O.dirty)||(e.formGroup==null||(O=e.formGroup.get("ConsumerSecret"))==null?null:O.touched)))),a(),h(!(e.formGroup==null||(G=e.formGroup.get("ConsumerSecret"))==null)&&G.getError("required")&&(!(e.formGroup==null||(G=e.formGroup.get("ConsumerSecret"))==null)&&G.dirty||!(e.formGroup==null||(G=e.formGroup.get("ConsumerSecret"))==null)&&G.touched)?22:-1)}},dependencies:[F,$,T,R,Z,S,ee,te],styles:[".input-shopify[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-input[_ngcontent-%COMP%]{min-height:3.625rem}"]})}}return t})();export{We as a,Ke as b,Be as c,Je as d,et as e};
1
+ import{b as ae,e as re}from"./chunk-W5L6FMO3.js";import{b as ie,c as le}from"./chunk-PW42BQIY.js";import{b as M,c as W,i as me,j as _,k as S}from"./chunk-FO7G4GMY.js";import{c as T,e as K,h as R,i as Z,j as x,l as N,m as k,n as $,q as ee,s as te,w as ne,y as oe}from"./chunk-5PS6ZS3N.js";import{d as F,f as Q,g as X}from"./chunk-FXQKRJWU.js";import{Fc as A,Gb as y,Gc as r,Hc as P,Ic as Y,Kc as b,Lc as w,Mb as f,Mc as D,Sc as U,Tc as J,Yb as p,dc as h,ic as i,jc as l,kc as V,oc as I,pb as z,rb as a,tc as v,uc as L,xb as C,ya as c,za as g}from"./chunk-OJMQBH6T.js";function pe(t,u){if(t&1&&(i(0,"tr")(1,"td")(2,"a",11),V(3,"img",12),i(4,"span"),r(5),l()()(),i(6,"td"),r(7),l(),i(8,"td"),r(9),l()()),t&2){let n=u.$implicit;a(2),p("href","/menu/channel/marketplace/view?ID="+n.Key.ID,z),a(),p("src",n.Logo,z),a(2),P(n.Key.Name),a(2),P(n.Value.Out),a(2),P(n.Value.Tg)}}var We=(()=>{class t{constructor(n,o){this.dialogRef=n,this.data=o,this.generateChannelName(),this.channels=this.setChannelLogo(o.channels)}ngOnInit(){this.modalConfig=new _,this.modalConfig.title="Channel - New Order Configuration is not Unique!",this.modalConfig.headerType=me.Warning,this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideClose=!0}setChannelLogo(n){return n.map(o=>(o.Logo=le.getChannelLogoByTypeId(o.Key.TypeID),o))}generateChannelName(){this.channelNames="";let n=this.data.channels;n.forEach((o,e)=>{this.channelNames+=`${o.Key} ${e!=n.length-1?" + ":""}`})}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(W))}}static{this.\u0275cmp=y({type:t,selectors:[["app-modal-channel-warning"]],standalone:!1,decls:24,vars:2,consts:[[3,"onCancel","onClose","config"],["content","",1,"pt-2","px-4"],[1,"row"],[1,"col-12"],[1,"lh-base","fs-5"],[1,"mb-4"],[1,"table","table-bordered"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"fs-5","mt-4"],["href","https://support.dealpos.com/en/articles/8281096-setup-multiple-channel-marketplace-to-one-warehouse-outlet","target","_blank"],["target","_blank",3,"href"],[1,"me-3",2,"width","24px",3,"src"]],template:function(o,e){o&1&&(i(0,"modal-material",0),v("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),i(1,"div",1)(2,"div",2)(3,"div",3)(4,"p",4),r(5,"When your order configuration is not unique, your Dashboard Sales Report will be invalid. You can use either Outlet or Order Tag to differentiate Channel Order. "),l(),i(6,"h5",5),r(7,"Your duplicate Channels are"),l(),i(8,"table",6)(9,"thead")(10,"tr",7)(11,"th"),r(12,"Channel"),l(),i(13,"th"),r(14,"Outlet"),l(),i(15,"th"),r(16,"Tag"),l()()(),i(17,"tbody"),f(18,pe,10,5,"tr",8),l()(),i(19,"p",9),r(20," Please refer to this "),i(21,"a",10),r(22,"article"),l(),r(23," for more information "),l()()()()()),o&2&&(p("config",e.modalConfig),a(18),p("ngForOf",e.channels))},dependencies:[Q,S],encapsulation:2})}}return t})();var Ke=(()=>{class t{constructor(n,o,e){this.dialogRef=n,this.httpService=o,this.toastr=e,this.modalConfig=new _,this.modalConfig.title="Write Off Reason"}onSubmit(){let n={Name:this.reason};this.subscription=this.httpService.post("/api/channel/AddWriteoffOption",n).subscribe(o=>{this.toastr.success(o.Message,"Success"),this.dialogRef.close(n)})}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(re),C(ae))}}static{this.\u0275cmp=y({type:t,selectors:[["app-dialog-writeOff-reason"]],standalone:!1,decls:7,vars:3,consts:[["name","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"form-label-group"],["type","text","id","writeOffReason","placeholder","Write Off Reason","name","writeOffReason",1,"form-control",3,"ngModelChange","ngModel"],["for","shopid"]],template:function(o,e){if(o&1){let m=I();i(0,"modal-material",1),v("onClose",function(){return c(m),g(e.onClose())})("onCancel",function(){return c(m),g(e.onClose())})("onOk",function(){return c(m),g(e.onSubmit())}),i(1,"div",2)(2,"div",3)(3,"input",4,0),D("ngModelChange",function(s){return c(m),w(e.reason,s)||(e.reason=s),g(s)}),l(),i(5,"label",5),r(6,"Reason"),l()()()()}o&2&&(p("dynamicValidated",e.reason)("config",e.modalConfig),a(3),b("ngModel",e.reason))},dependencies:[T,R,k,S],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]})}}return t})();var ue=t=>({invalid:t});function fe(t,u){t&1&&(i(0,"small"),r(1," URL is required "),l())}function ce(t,u){if(t&1&&(i(0,"div",13),f(1,fe,2,0,"small",14),l()),t&2){L();let n=A(10);a(),p("ngIf",n.errors.required)}}function ge(t,u){t&1&&(i(0,"small"),r(1," Email is required "),l())}function Ce(t,u){t&1&&(i(0,"small"),r(1," Email is not valid "),l())}function he(t,u){if(t&1&&(i(0,"div",13),f(1,ge,2,0,"small",14)(2,Ce,2,0,"small",14),l()),t&2){L();let n=A(16);a(),p("ngIf",n.errors.required),a(),p("ngIf",n.errors.pattern)}}var Be=(()=>{class t{constructor(n){this.dialogRef=n}ngOnInit(){this.formData={URL:"",Email:""},this.initModalConfig()}initModalConfig(){this.modalConfig=new _,this.modalConfig.title="Fill data for Customer Support"}onSubmit(n){n!="Enter"&&this.dialogRef.close(this.formData)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||t)(C(M))}}static{this.\u0275cmp=y({type:t,selectors:[["app-contact-support"]],standalone:!1,decls:18,vars:9,consts:[["url","ngModel"],["email","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mx-4"],["for","customerURL"],[1,"input-group","mb-2"],[1,"input-group-prepend"],["id","tokopediaUrl",1,"border-start-0","rounded-start","input-group-text","pointer-default","bg-light",2,"height","58px",3,"ngClass"],["required","","type","text","id","customerURL","name","customerURL","title","customerURL",1,"form-control","border-start-0","customerUrl",3,"ngModelChange","ngModel"],["class","text-danger",4,"ngIf"],["for","customerEmail"],["required","","type","text","id","customerEmail","name","customerEmail","title","customerEmail","pattern","\\b[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,4}\\b",1,"form-control",3,"ngModelChange","ngModel"],[1,"text-danger"],[4,"ngIf"]],template:function(o,e){if(o&1){let m=I();i(0,"modal-material",2),v("onClose",function(){return c(m),g(e.onClose())})("onCancel",function(){return c(m),g(e.onClose())})("onOk",function(s){return c(m),g(e.onSubmit(s))}),i(1,"div",3)(2,"div",4)(3,"label",5),r(4,"Tokopedia URL"),l(),i(5,"div",6)(6,"div",7)(7,"span",8),r(8,"https://tokopedia.com/"),l()(),i(9,"input",9,0),D("ngModelChange",function(s){return c(m),w(e.formData.URL,s)||(e.formData.URL=s),g(s)}),l()(),f(11,ce,2,1,"div",10),i(12,"label",11),r(13,"Requester's Email"),l(),i(14,"div",6)(15,"input",12,1),D("ngModelChange",function(s){return c(m),w(e.formData.Email,s)||(e.formData.Email=s),g(s)}),l()(),f(17,he,3,2,"div",10),l()()()}if(o&2){let m=A(10),d=A(16);p("dynamicValidated",!m.invalid&&!d.invalid)("config",e.modalConfig),a(7),p("ngClass",U(7,ue,m.invalid&&(m.dirty||m.touched))),a(2),b("ngModel",e.formData.URL),a(2),p("ngIf",m.invalid&&(m.dirty||m.touched)),a(4),b("ngModel",e.formData.Email),a(2),p("ngIf",d.invalid&&(d.dirty||d.touched))}},dependencies:[F,X,T,R,ne,oe,k,S],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.input-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.input-group[_ngcontent-%COMP%] > input.ng-invalid.ng-touched[_ngcontent-%COMP%]{border-color:#fb404b}.input-group[_ngcontent-%COMP%] > input.customerUrl[_ngcontent-%COMP%]{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.invalid[_ngcontent-%COMP%]{border-color:#fb404b}.pointer-default[_ngcontent-%COMP%]{cursor:default}"]})}}return t})();var Je=(()=>{class t{constructor(n,o){this.dialogRef=n,this.data=o}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new _,this.modalConfig.title=this.data?.title,this.modalConfig.okText="SAVE"}onSubmit(){this.dialogRef.close(this.shopID)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(W))}}static{this.\u0275cmp=y({type:t,selectors:[["app-modal-dialog-tokopedia"]],standalone:!1,decls:7,vars:3,consts:[["name","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"form-label-group"],["type","text","id","shopid","placeholder","Shop ID","name","ShopID","data-toggle","tooltip","title","Channel Name",1,"form-control",3,"ngModelChange","ngModel"],["for","shopid"]],template:function(o,e){if(o&1){let m=I();i(0,"modal-material",1),v("onClose",function(){return c(m),g(e.onClose())})("onCancel",function(){return c(m),g(e.onClose())})("onOk",function(){return c(m),g(e.onSubmit())}),i(1,"div",2)(2,"div",3)(3,"input",4,0),D("ngModelChange",function(s){return c(m),w(e.shopID,s)||(e.shopID=s),g(s)}),l(),i(5,"label",5),r(6,"Shop ID"),l()()()()}o&2&&(p("dynamicValidated",e.shopID)("config",e.modalConfig),a(3),b("ngModel",e.shopID))},dependencies:[T,R,k,S],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]})}}return t})();var _e=t=>({"input-group":t}),ye=(t,u)=>({"is-invalid":t,"input-shopify rounded-start":u}),se=t=>({"is-invalid":t});function ve(t,u){t&1&&(i(0,"label",3),r(1,"Shopify URL"),l())}function Me(t,u){t&1&&(i(0,"label",3),r(1,"URL"),l())}function Se(t,u){t&1&&(i(0,"span",6),r(1,"myshopify.com"),l())}function Te(t,u){if(t&1&&(i(0,"div"),r(1),l()),t&2){let n=L(2);a(),Y("",n.data==null?null:n.data.title," url is required")}}function Re(t,u){if(t&1&&(i(0,"div",7),f(1,Te,2,1,"div"),l()),t&2){let n,o=L();a(),h(!(o.formGroup==null||(n=o.formGroup.get("URL"))==null)&&n.getError("required")?1:-1)}}function be(t,u){t&1&&r(0," API Key ")}function we(t,u){t&1&&r(0," Consumer Key ")}function De(t,u){t&1&&(r(0," ("),i(1,"a",11),r(2,"help center article"),l(),r(3,") "))}function Ee(t,u){t&1&&(i(0,"div",7),r(1,"API Key is required"),l())}function Oe(t,u){t&1&&r(0," Admin API Access Token ")}function Ge(t,u){t&1&&r(0," Consumer Secret ")}function Ve(t,u){t&1&&(i(0,"div",7),r(1,"Consumer Secret is required"),l())}var et=(()=>{class t{constructor(n,o){this.dialogRef=n,this.data=o,this.modalConfig=new _,this.urlCtrl=new N(null),this.channelType=ie}ngOnInit(){this.initModalConfig(),this.initFormGroup()}initFormGroup(){let n=[K.required];this.formGroup=new x({URL:new N(null,n),ConsumerKey:new N(null,[K.required]),ConsumerSecret:new N(null,[K.required])})}initModalConfig(){this.modalConfig=new _,this.modalConfig.title=this.data.title,this.modalConfig.okText="SAVE"}onClose(){this.dialogRef.close()}onSubmit(){this.formGroup.markAllAsTouched();let n=this.formGroup?.get("URL")?.getError("pattern"),o=this.formGroup?.get("ConsumerKey")?.valid,e=this.formGroup?.get("ConsumerSecret")?.valid;if(this.formGroup?.valid||n&&o&&e){let d=this.formGroup.value;d=this.trimShopifyUrl(d),this.dialogRef.close(d)}}trimShopifyUrl(n){if(this.data?.channelType==this.channelType.Shopify){let o=n.URL?.trim()||"";o=o.replace(/^https?:\/\//,""),o.includes(".myshopify.com")||(o=`${o}.myshopify.com`),n.URL=o}return n}static{this.\u0275fac=function(o){return new(o||t)(C(M),C(W))}}static{this.\u0275cmp=y({type:t,selectors:[["app-modal-register-channel"]],standalone:!1,decls:23,vars:27,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[3,"formGroup"],["for","shopid",1,"form-label","fw-bold","mb-2"],[1,"mb-8","has-validation",3,"ngClass"],["type","text","id","shopid","name","URL","title","URL","formControlName","URL",1,"form-control","form-input","rounded",3,"placeholder","ngClass"],["id","basic-addon2",1,"input-group-text","rounded-end","form-input","text-secondary"],[1,"invalid-feedback"],[1,"mb-8","has-validation"],["type","text","id","ConsumerKey","name","ConsumerKey","title","ConsumerKey","formControlName","ConsumerKey",1,"form-control","rounded","form-input",3,"placeholder","ngClass"],["type","text","id","ConsumerSecret","name","ConsumerSecret","title","ConsumerSecret","formControlName","ConsumerSecret",1,"form-control","rounded","form-input",3,"placeholder","ngClass"],["target","_blank","href","https://support.dealpos.com/en/articles/9525716-shopify-authorization-at-dealpos-apps",1,"button","text-primary","fw-bold"]],template:function(o,e){if(o&1&&(i(0,"modal-material",0),v("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),i(1,"div",1)(2,"form",2),f(3,ve,2,0,"label",3),i(4,"div",4),f(5,Me,2,0,"label",3),V(6,"input",5),f(7,Se,2,0,"span",6)(8,Re,2,1,"div",7),l(),i(9,"div",8)(10,"label",3)(11,"span"),f(12,be,1,0)(13,we,1,0),l(),f(14,De,4,0),l(),V(15,"input",9),f(16,Ee,2,0,"div",7),l(),i(17,"div",8)(18,"label",3),f(19,Oe,1,0)(20,Ge,1,0),l(),V(21,"input",10),f(22,Ve,2,0,"div",7),l()()()()),o&2){let m,d,s,E,O,G;p("config",e.modalConfig),a(2),p("formGroup",e.formGroup),a(),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?3:-1),a(),p("ngClass",U(18,_e,(e.data==null?null:e.data.channelType)==e.channelType.Shopify)),a(),h((e.data==null?null:e.data.channelType)!=e.channelType.Shopify?5:-1),a(),p("placeholder",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"[ex: brand.myshopify.com]":"https://mydomain.com/")("ngClass",J(20,ye,(e.formGroup==null||(m=e.formGroup.get("URL"))==null?null:m.invalid)&&((e.formGroup==null||(m=e.formGroup.get("URL"))==null?null:m.dirty)||(e.formGroup==null||(m=e.formGroup.get("URL"))==null?null:m.touched)),(e.data==null?null:e.data.channelType)==e.channelType.Shopify)),a(),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?7:-1),a(),h(!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.invalid&&(!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.dirty||!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.touched)?8:-1),a(4),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?12:13),a(2),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?14:-1),a(),p("placeholder",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"[Create an app and copy the API Key]":"[Create an app and copy the Consumer Key]")("ngClass",U(23,se,(e.formGroup==null||(s=e.formGroup.get("ConsumerKey"))==null?null:s.invalid)&&((e.formGroup==null||(s=e.formGroup.get("ConsumerKey"))==null?null:s.dirty)||(e.formGroup==null||(s=e.formGroup.get("ConsumerKey"))==null?null:s.touched)))),a(),h(!(e.formGroup==null||(E=e.formGroup.get("ConsumerKey"))==null)&&E.getError("required")&&(!(e.formGroup==null||(E=e.formGroup.get("ConsumerKey"))==null)&&E.dirty||!(e.formGroup==null||(E=e.formGroup.get("ConsumerKey"))==null)&&E.touched)?16:-1),a(3),h((e.data==null?null:e.data.channelType)==e.channelType.Shopify?19:20),a(2),p("placeholder",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"[shpat***************************]":"cs_***************")("ngClass",U(25,se,(e.formGroup==null||(O=e.formGroup.get("ConsumerSecret"))==null?null:O.invalid)&&((e.formGroup==null||(O=e.formGroup.get("ConsumerSecret"))==null?null:O.dirty)||(e.formGroup==null||(O=e.formGroup.get("ConsumerSecret"))==null?null:O.touched)))),a(),h(!(e.formGroup==null||(G=e.formGroup.get("ConsumerSecret"))==null)&&G.getError("required")&&(!(e.formGroup==null||(G=e.formGroup.get("ConsumerSecret"))==null)&&G.dirty||!(e.formGroup==null||(G=e.formGroup.get("ConsumerSecret"))==null)&&G.touched)?22:-1)}},dependencies:[F,$,T,R,Z,S,ee,te],styles:[".input-shopify[_ngcontent-%COMP%]{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.form-input[_ngcontent-%COMP%]{min-height:3.625rem}"]})}}return t})();export{We as a,Ke as b,Be as c,Je as d,et as e};
@@ -1 +1 @@
1
- import{a as Ne}from"./chunk-AEOSNAHH.js";import{a as Ae}from"./chunk-OWQ3RWNF.js";import{b as Re,e as $e}from"./chunk-JXSBFTQM.js";import{b as He,c as Me,d as Le,i as be,j as We,k as je}from"./chunk-UGVEAL7H.js";import{m as Pe,n as De}from"./chunk-M2FCTYGU.js";import{$c as V,Gb as Ee,Gc as I,Hc as W,Ic as xe,Mb as _e,Yb as Ie,ad as K,dc as me,g as ve,ic as C,ja as ke,jc as y,kc as we,oa as U,pa as pe,rb as R,tc as Te,uc as J}from"./chunk-B7KTCPKC.js";import{a as _,b as M,c as L,i as d}from"./chunk-66YHNWRR.js";var v=class extends Error{constructor(e,t){let n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}},$=class extends Error{constructor(e="A timeout occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},S=class extends Error{constructor(e="An abort occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},X=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}},G=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}},Y=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}},O=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}},Q=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}};var j=class{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}},T=class{get(e,t){return this.send(M(_({},t),{method:"GET",url:e}))}post(e,t){return this.send(M(_({},t),{method:"POST",url:e}))}delete(e,t){return this.send(M(_({},t),{method:"DELETE",url:e}))}getCookieString(e){return""}};var s=function(i){return i[i.Trace=0]="Trace",i[i.Debug=1]="Debug",i[i.Information=2]="Information",i[i.Warning=3]="Warning",i[i.Error=4]="Error",i[i.Critical=5]="Critical",i[i.None=6]="None",i}(s||{});var x=class{constructor(){}log(e,t){}};x.instance=new x;var ze="8.0.17",g=class{static isRequired(e,t){if(e==null)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,n){if(!(e in t))throw new Error(`Unknown ${n} value: ${e}.`)}},p=class i{static get isBrowser(){return!i.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!i.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!i.isNode&&typeof window=="object"&&typeof window.document>"u"}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}};function N(i,e){let t="";return E(i)?(t=`Binary data of length ${i.byteLength}`,e&&(t+=`. Content: '${Je(i)}'`)):typeof i=="string"&&(t=`String data of length ${i.length}`,e&&(t+=`. Content: '${i}'`)),t}function Je(i){let e=new Uint8Array(i),t="";return e.forEach(n=>{let o=n<16?"0":"";t+=`0x${o}${n.toString(16)} `}),t.substr(0,t.length-1)}function E(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function ee(i,e,t,n,o,r){return d(this,null,function*(){let a={},[c,l]=P();a[c]=l,i.log(s.Trace,`(${e} transport) sending data. ${N(o,r.logMessageContent)}.`);let u=E(o)?"arraybuffer":"text",f=yield t.post(n,{content:o,headers:_(_({},a),r.headers),responseType:u,timeout:r.timeout,withCredentials:r.withCredentials});i.log(s.Trace,`(${e} transport) request complete. Response status: ${f.statusCode}.`)})}function Be(i){return i===void 0?new A(s.Information):i===null?x.instance:i.log!==void 0?i:new A(i)}var Z=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(t=>{})}},A=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let n=`[${new Date().toISOString()}] ${s[e]}: ${t}`;switch(e){case s.Critical:case s.Error:this.out.error(n);break;case s.Warning:this.out.warn(n);break;case s.Information:this.out.info(n);break;default:this.out.log(n);break}}}};function P(){let i="X-SignalR-User-Agent";return p.isNode&&(i="User-Agent"),[i,Ve(ze,Ke(),Ge(),Xe())]}function Ve(i,e,t,n){let o="Microsoft SignalR/",r=i.split(".");return o+=`${r[0]}.${r[1]}`,o+=` (${i}; `,e&&e!==""?o+=`${e}; `:o+="Unknown OS; ",o+=`${t}`,n?o+=`; ${n}`:o+="; Unknown Runtime Version",o+=")",o}function Ke(){if(p.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Xe(){if(p.isNode)return process.versions.node}function Ge(){return p.isNode?"NodeJS":"Browser"}function te(i){return i.stack?i.stack:i.message?i.message:`${i}`}function Ue(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}var ne=class extends T{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||p.isNode){let t=typeof __webpack_require__=="function"?__non_webpack_require__:L;this._jar=new(t("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=t("node-fetch"):this._fetchType=fetch,this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Ue());if(typeof AbortController>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:L;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}send(e){return d(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new S;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");let t=new this._abortControllerType,n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new S});let o=null;if(e.timeout){let l=e.timeout;o=setTimeout(()=>{t.abort(),this._logger.log(s.Warning,"Timeout from HTTP request."),n=new $},l)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},E(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let r;try{r=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:_({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(l){throw n||(this._logger.log(s.Warning,`Error from HTTP request. ${l}.`),l)}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){let l=yield Oe(r,"text");throw new v(l||r.statusText,r.status)}let c=yield Oe(r,e.responseType);return new j(r.status,r.statusText,c)})}getCookieString(e){let t="";return p.isNode&&this._jar&&this._jar.getCookies(e,(n,o)=>t=o.join("; ")),t}};function Oe(i,e){let t;switch(e){case"arraybuffer":t=i.arrayBuffer();break;case"text":t=i.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:t=i.text();break}return t}var oe=class extends T{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new S):e.method?e.url?new Promise((t,n)=>{let o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(E(e.content)?o.setRequestHeader("Content-Type","application/octet-stream"):o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));let r=e.headers;r&&Object.keys(r).forEach(a=>{o.setRequestHeader(a,r[a])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),n(new S)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?t(new j(o.status,o.statusText,o.response||o.responseText)):n(new v(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(s.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),n(new v(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(s.Warning,"Timeout from HTTP request."),n(new $)},o.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}};var ie=class extends T{constructor(e){if(super(),typeof fetch<"u"||p.isNode)this._httpClient=new ne(e);else if(typeof XMLHttpRequest<"u")this._httpClient=new oe(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new S):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}};var k=class i{static write(e){return`${e}${i.RecordSeparator}`}static parse(e){if(e[e.length-1]!==i.RecordSeparator)throw new Error("Message is incomplete.");let t=e.split(i.RecordSeparator);return t.pop(),t}};k.RecordSeparatorCode=30;k.RecordSeparator=String.fromCharCode(k.RecordSeparatorCode);var re=class{writeHandshakeRequest(e){return k.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(E(e)){let c=new Uint8Array(e),l=c.indexOf(k.RecordSeparatorCode);if(l===-1)throw new Error("Message is incomplete.");let u=l+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(c.slice(0,u))),n=c.byteLength>u?c.slice(u).buffer:null}else{let c=e,l=c.indexOf(k.RecordSeparator);if(l===-1)throw new Error("Message is incomplete.");let u=l+1;t=c.substring(0,u),n=c.length>u?c.substring(u):null}let o=k.parse(t),r=JSON.parse(o[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[n,r]}};var h=function(i){return i[i.Invocation=1]="Invocation",i[i.StreamItem=2]="StreamItem",i[i.Completion=3]="Completion",i[i.StreamInvocation=4]="StreamInvocation",i[i.CancelInvocation=5]="CancelInvocation",i[i.Ping=6]="Ping",i[i.Close=7]="Close",i[i.Ack=8]="Ack",i[i.Sequence=9]="Sequence",i}(h||{});var se=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Z(this,e)}};var ae=class{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}_send(e){return d(this,null,function*(){let t=this._protocol.writeMessage(e),n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let o=()=>{},r=()=>{};E(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise((a,c)=>{o=a,r=c})),this._messages.push(new Se(t,this._totalMessageCount,o,r))}try{this._reconnectInProgress||(yield this._connection.send(t))}catch{this._disconnected()}yield n})}_ack(e){let t=-1;for(let n=0;n<this._messages.length;n++){let o=this._messages[n];if(o._id<=e.sequenceId)t=n,E(o._message)?this._bufferedByteCount-=o._message.byteLength:this._bufferedByteCount-=o._message.length,o._resolver();else if(this._bufferedByteCount<this._bufferSize)o._resolver();else break}t!==-1&&(this._messages=this._messages.slice(t+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type!==h.Sequence?!1:(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;let t=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,t<=this._latestReceivedSequenceId?(t===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=t,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}_resend(){return d(this,null,function*(){let e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;yield this._connection.send(this._protocol.writeMessage({type:h.Sequence,sequenceId:e}));let t=this._messages;for(let n of t)yield this._connection.send(n._message);this._reconnectInProgress=!1})}_dispose(e){e??(e=new Error("Unable to reconnect to server."));for(let t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case h.Invocation:case h.StreamItem:case h.Completion:case h.StreamInvocation:case h.CancelInvocation:return!0;case h.Close:case h.Sequence:case h.Ping:case h.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(()=>d(this,null,function*(){try{this._reconnectInProgress||(yield this._connection.send(this._protocol.writeMessage({type:h.Ack,sequenceId:this._latestReceivedSequenceId})))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}},Se=class{constructor(e,t,n,o){this._message=e,this._id=t,this._resolver=n,this._rejector=o}};var Ye=30*1e3,Qe=15*1e3,Ze=1e5,m=function(i){return i.Disconnected="Disconnected",i.Connecting="Connecting",i.Connected="Connected",i.Disconnecting="Disconnecting",i.Reconnecting="Reconnecting",i}(m||{}),ce=class i{static create(e,t,n,o,r,a,c){return new i(e,t,n,o,r,a,c)}constructor(e,t,n,o,r,a,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(s.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},g.isRequired(e,"connection"),g.isRequired(t,"logger"),g.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=r??Ye,this.keepAliveIntervalInMilliseconds=a??Qe,this._statefulReconnectBufferSize=c??Ze,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=o,this._handshakeProtocol=new re,this.connection.onreceive=l=>this._processIncomingData(l),this.connection.onclose=l=>this._connectionClosed(l),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=m.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:h.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==m.Disconnected&&this._connectionState!==m.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return d(this,null,function*(){if(this._connectionState!==m.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=m.Connecting,this._logger.log(s.Debug,"Starting HubConnection.");try{yield this._startInternal(),p.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=m.Connected,this._connectionStarted=!0,this._logger.log(s.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=m.Disconnected,this._logger.log(s.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return d(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((t,n)=>{this._handshakeResolver=t,this._handshakeRejecter=n});yield this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);let n={protocol:this._protocol.name,version:t};if(this._logger.log(s.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(s.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;(this.connection.features.reconnect||!1)&&(this._messageBuffer=new ae(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(t){throw this._logger.log(s.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(t),t}})}stop(){return d(this,null,function*(){let e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch{}})}_stopInternal(e){if(this._connectionState===m.Disconnected)return this._logger.log(s.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===m.Disconnecting)return this._logger.log(s.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;let t=this._connectionState;return this._connectionState=m.Disconnecting,this._logger.log(s.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(s.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===m.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new S("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}_sendCloseMessage(){return d(this,null,function*(){try{yield this._sendWithProtocol(this._createCloseMessage())}catch{}})}stream(e,...t){let[n,o]=this._replaceStreamingParams(t),r=this._createStreamInvocation(e,t,o),a,c=new se;return c.cancelCallback=()=>{let l=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],a.then(()=>this._sendWithProtocol(l))},this._callbacks[r.invocationId]=(l,u)=>{if(u){c.error(u);return}else l&&(l.type===h.Completion?l.error?c.error(new Error(l.error)):c.complete():c.next(l.item))},a=this._sendWithProtocol(r).catch(l=>{c.error(l),delete this._callbacks[r.invocationId]}),this._launchStreams(n,a),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[n,o]=this._replaceStreamingParams(t),r=this._sendWithProtocol(this._createInvocation(e,t,!0,o));return this._launchStreams(n,r),r}invoke(e,...t){let[n,o]=this._replaceStreamingParams(t),r=this._createInvocation(e,t,!1,o);return new Promise((c,l)=>{this._callbacks[r.invocationId]=(f,D)=>{if(D){l(D);return}else f&&(f.type===h.Completion?f.error?l(new Error(f.error)):c(f.result):l(new Error(`Unexpected message type: ${f.type}`)))};let u=this._sendWithProtocol(r).catch(f=>{l(f),delete this._callbacks[r.invocationId]});this._launchStreams(n,u)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let n=this._methods[e];if(n)if(t){let o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let n of t)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(n)))switch(n.type){case h.Invocation:this._invokeClientMethod(n).catch(o=>{this._logger.log(s.Error,`Invoke client method threw error: ${te(o)}`)});break;case h.StreamItem:case h.Completion:{let o=this._callbacks[n.invocationId];if(o){n.type===h.Completion&&delete this._callbacks[n.invocationId];try{o(n)}catch(r){this._logger.log(s.Error,`Stream callback threw error: ${te(r)}`)}}break}case h.Ping:break;case h.Close:{this._logger.log(s.Information,"Close message received from server.");let o=n.error?new Error("Server returned an error on close: "+n.error):void 0;n.allowReconnect===!0?this.connection.stop(o):this._stopPromise=this._stopInternal(o);break}case h.Ack:this._messageBuffer&&this._messageBuffer._ack(n);break;case h.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(n);break;default:this._logger.log(s.Warning,`Invalid message type: ${n.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(o){let r="Error parsing handshake response: "+o;this._logger.log(s.Error,r);let a=new Error(r);throw this._handshakeRejecter(a),a}if(t.error){let o="Server returned handshake error: "+t.error;this._logger.log(s.Error,o);let r=new Error(o);throw this._handshakeRejecter(r),r}else this._logger.log(s.Debug,"Server handshake complete.");return this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>d(this,null,function*(){if(this._connectionState===m.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return d(this,null,function*(){let t=e.target.toLowerCase(),n=this._methods[t];if(!n){this._logger.log(s.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(s.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}let o=n.slice(),r=!!e.invocationId,a,c,l;for(let u of o)try{let f=a;a=yield u.apply(this,e.arguments),r&&a&&f&&(this._logger.log(s.Error,`Multiple results provided for '${t}'. Sending error to server.`),l=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(f){c=f,this._logger.log(s.Error,`A callback for the method '${t}' threw error '${f}'.`)}l?yield this._sendWithProtocol(l):r?(c?l=this._createCompletionMessage(e.invocationId,`${c}`,null):a!==void 0?l=this._createCompletionMessage(e.invocationId,null,a):(this._logger.log(s.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),l=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(l)):a&&this._logger.log(s.Error,`Result given for '${t}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(s.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new S("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===m.Disconnecting?this._completeClose(e):this._connectionState===m.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===m.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=m.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),p.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(s.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}_reconnect(e){return d(this,null,function*(){let t=Date.now(),n=0,o=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),r=this._getNextRetryDelay(n++,0,o);if(r===null){this._logger.log(s.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=m.Reconnecting,e?this._logger.log(s.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(s.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(a=>a.apply(this,[e]))}catch(a){this._logger.log(s.Error,`An onreconnecting callback called with error '${e}' threw error '${a}'.`)}if(this._connectionState!==m.Reconnecting){this._logger.log(s.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;r!==null;){if(this._logger.log(s.Information,`Reconnect attempt number ${n} will start in ${r} ms.`),yield new Promise(a=>{this._reconnectDelayHandle=setTimeout(a,r)}),this._reconnectDelayHandle=void 0,this._connectionState!==m.Reconnecting){this._logger.log(s.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=m.Connected,this._logger.log(s.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(a=>a.apply(this,[this.connection.connectionId]))}catch(a){this._logger.log(s.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${a}'.`)}return}catch(a){if(this._logger.log(s.Information,`Reconnect attempt failed because of error '${a}'.`),this._connectionState!==m.Reconnecting){this._logger.log(s.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===m.Disconnecting&&this._completeClose();return}o=a instanceof Error?a:new Error(a.toString()),r=this._getNextRetryDelay(n++,Date.now()-t,o)}}this._logger.log(s.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(o){return this._logger.log(s.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${o}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(n=>{let o=t[n];try{o(null,e)}catch(r){this._logger.log(s.Error,`Stream 'error' callback called with '${e}' threw error: ${te(r)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,o){if(n)return o.length!==0?{arguments:t,streamIds:o,target:e,type:h.Invocation}:{arguments:t,target:e,type:h.Invocation};{let r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:t,invocationId:r.toString(),streamIds:o,target:e,type:h.Invocation}:{arguments:t,invocationId:r.toString(),target:e,type:h.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||(t=Promise.resolve());for(let n in e)e[n].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n)))},error:o=>{let r;o instanceof Error?r=o.message:o&&o.toString?r=o.toString():r="Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n,r)))},next:o=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(n,o)))}})}}_replaceStreamingParams(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(this._isObservable(r)){let a=this._invocationId;this._invocationId++,t[a]=r,n.push(a.toString()),e.splice(o,1)}}return[t,n]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,t,n){let o=this._invocationId;return this._invocationId++,n.length!==0?{arguments:t,invocationId:o.toString(),streamIds:n,target:e,type:h.StreamInvocation}:{arguments:t,invocationId:o.toString(),target:e,type:h.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:h.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:h.StreamItem}}_createCompletionMessage(e,t,n){return t?{error:t,invocationId:e,type:h.Completion}:{invocationId:e,result:n,type:h.Completion}}_createCloseMessage(){return{type:h.Close}}};var et=[0,2e3,1e4,3e4,null],F=class{constructor(e){this._retryDelays=e!==void 0?[...e,null]:et}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}};var H=(()=>{class i{}return i.Authorization="Authorization",i.Cookie="Cookie",i})();var le=class extends T{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}send(e){return d(this,null,function*(){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);let n=yield this._innerClient.send(e);return t&&n.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):n})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[H.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[H.Authorization]&&delete e.headers[H.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}};var b=function(i){return i[i.None=0]="None",i[i.WebSockets=1]="WebSockets",i[i.ServerSentEvents=2]="ServerSentEvents",i[i.LongPolling=4]="LongPolling",i}(b||{}),w=function(i){return i[i.Text=1]="Text",i[i.Binary=2]="Binary",i}(w||{});var he=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};var q=class{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new he,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}connect(e,t){return d(this,null,function*(){if(g.isRequired(e,"url"),g.isRequired(t,"transferFormat"),g.isIn(t,w,"transferFormat"),this._url=e,this._logger.log(s.Trace,"(LongPolling transport) Connecting."),t===w.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");let[n,o]=P(),r=_({[n]:o},this._options.headers),a={abortSignal:this._pollAbort.signal,headers:r,timeout:1e5,withCredentials:this._options.withCredentials};t===w.Binary&&(a.responseType="arraybuffer");let c=`${e}&_=${Date.now()}`;this._logger.log(s.Trace,`(LongPolling transport) polling: ${c}.`);let l=yield this._httpClient.get(c,a);l.statusCode!==200?(this._logger.log(s.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new v(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,a)})}_poll(e,t){return d(this,null,function*(){try{for(;this._running;)try{let n=`${e}&_=${Date.now()}`;this._logger.log(s.Trace,`(LongPolling transport) polling: ${n}.`);let o=yield this._httpClient.get(n,t);o.statusCode===204?(this._logger.log(s.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):o.statusCode!==200?(this._logger.log(s.Error,`(LongPolling transport) Unexpected response code: ${o.statusCode}.`),this._closeError=new v(o.statusText||"",o.statusCode),this._running=!1):o.content?(this._logger.log(s.Trace,`(LongPolling transport) data received. ${N(o.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(o.content)):this._logger.log(s.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(n){this._running?n instanceof $?this._logger.log(s.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=n,this._running=!1):this._logger.log(s.Trace,`(LongPolling transport) Poll errored after shutdown: ${n.message}`)}}finally{this._logger.log(s.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return d(this,null,function*(){return this._running?ee(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return d(this,null,function*(){this._logger.log(s.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(s.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,n]=P();e[t]=n;let o={headers:_(_({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials},r;try{yield this._httpClient.delete(this._url,o)}catch(a){r=a}r?r instanceof v&&(r.statusCode===404?this._logger.log(s.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(s.Trace,`(LongPolling transport) Error sending a DELETE request: ${r}`)):this._logger.log(s.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(s.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(s.Trace,e),this.onclose(this._closeError)}}};var ue=class{constructor(e,t,n,o){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=o,this.onreceive=null,this.onclose=null}connect(e,t){return d(this,null,function*(){return g.isRequired(e,"url"),g.isRequired(t,"transferFormat"),g.isIn(t,w,"transferFormat"),this._logger.log(s.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((n,o)=>{let r=!1;if(t!==w.Text){o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let a;if(p.isBrowser||p.isWebWorker)a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let c=this._httpClient.getCookieString(e),l={};l.Cookie=c;let[u,f]=P();l[u]=f,a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:_(_({},l),this._options.headers)})}try{a.onmessage=c=>{if(this.onreceive)try{this._logger.log(s.Trace,`(SSE transport) data received. ${N(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(l){this._close(l);return}},a.onerror=c=>{r?this._close():o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},a.onopen=()=>{this._logger.log(s.Information,`SSE connected to ${this._url}`),this._eventSource=a,r=!0,n()}}catch(c){o(c);return}})})}send(e){return d(this,null,function*(){return this._eventSource?ee(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}};var de=class{constructor(e,t,n,o,r,a){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=o,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=a}connect(e,t){return d(this,null,function*(){g.isRequired(e,"url"),g.isRequired(t,"transferFormat"),g.isIn(t,w,"transferFormat"),this._logger.log(s.Trace,"(WebSockets transport) Connecting.");let n;return this._accessTokenFactory&&(n=yield this._accessTokenFactory()),new Promise((o,r)=>{e=e.replace(/^http/,"ws");let a,c=this._httpClient.getCookieString(e),l=!1;if(p.isNode||p.isReactNative){let u={},[f,D]=P();u[f]=D,n&&(u[H.Authorization]=`Bearer ${n}`),c&&(u[H.Cookie]=c),a=new this._webSocketConstructor(e,void 0,{headers:_(_({},u),this._headers)})}else n&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(n)}`);a||(a=new this._webSocketConstructor(e)),t===w.Binary&&(a.binaryType="arraybuffer"),a.onopen=u=>{this._logger.log(s.Information,`WebSocket connected to ${e}.`),this._webSocket=a,l=!0,o()},a.onerror=u=>{let f=null;typeof ErrorEvent<"u"&&u instanceof ErrorEvent?f=u.error:f="There was an error with the transport",this._logger.log(s.Information,`(WebSockets transport) ${f}.`)},a.onmessage=u=>{if(this._logger.log(s.Trace,`(WebSockets transport) data received. ${N(u.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(u.data)}catch(f){this._close(f);return}},a.onclose=u=>{if(l)this._close(u);else{let f=null;typeof ErrorEvent<"u"&&u instanceof ErrorEvent?f=u.error:f="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",r(new Error(f))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(s.Trace,`(WebSockets transport) sending data. ${N(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(s.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}};var Fe=100,fe=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,g.isRequired(e,"url"),this._logger=Be(t.logger),this.baseUrl=this._resolveUrl(e),t=t||{},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials=="boolean"||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.timeout=t.timeout===void 0?100*1e3:t.timeout;let n=null,o=null;if(p.isNode&&typeof L<"u"){let r=typeof __webpack_require__=="function"?__non_webpack_require__:L;n=r("ws"),o=r("eventsource")}!p.isNode&&typeof WebSocket<"u"&&!t.WebSocket?t.WebSocket=WebSocket:p.isNode&&!t.WebSocket&&n&&(t.WebSocket=n),!p.isNode&&typeof EventSource<"u"&&!t.EventSource?t.EventSource=EventSource:p.isNode&&!t.EventSource&&typeof o<"u"&&(t.EventSource=o),this._httpClient=new le(t.httpClient||new ie(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}start(e){return d(this,null,function*(){if(e=e||w.Binary,g.isIn(e,w,"transferFormat"),this._logger.log(s.Debug,`Starting connection with transfer format '${w[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){let t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(s.Error,t),yield this._stopPromise,Promise.reject(new S(t))}else if(this._connectionState!=="Connected"){let t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(s.Error,t),Promise.reject(new S(t))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Ce(this.transport)),this._sendQueue.send(e))}stop(e){return d(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(s.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(s.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(t=>{this._stopPromiseResolver=t}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return d(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch{}if(this.transport){try{yield this.transport.stop()}catch(t){this._logger.log(s.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(s.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return d(this,null,function*(){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===b.WebSockets)this.transport=this._constructTransport(b.WebSockets),yield this._startTransport(t,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let n=null,o=0;do{if(n=yield this._getNegotiationResponse(t),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new S("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(n.url&&(t=n.url),n.accessToken){let r=n.accessToken;this._accessTokenFactory=()=>r,this._httpClient._accessToken=r,this._httpClient._accessTokenFactory=void 0}o++}while(n.url&&o<Fe);if(o===Fe&&n.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(t,this._options.transport,n,e)}this.transport instanceof q&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(s.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(n){return this._logger.log(s.Error,"Failed to start the connection: "+n),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(n)}})}_getNegotiationResponse(e){return d(this,null,function*(){let t={},[n,o]=P();t[n]=o;let r=this._resolveNegotiateUrl(e);this._logger.log(s.Debug,`Sending negotiation request: ${r}.`);try{let a=yield this._httpClient.post(r,{content:"",headers:_(_({},t),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(a.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${a.statusCode}'`));let c=JSON.parse(a.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new O("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(a){let c="Failed to complete negotiation with the server: "+a;return a instanceof v&&a.statusCode===404&&(c=c+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(s.Error,c),Promise.reject(new O(c))}})}_createConnectUrl(e,t){return t?e+(e.indexOf("?")===-1?"?":"&")+`id=${t}`:e}_createTransport(e,t,n,o){return d(this,null,function*(){let r=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t)){this._logger.log(s.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,yield this._startTransport(r,o),this.connectionId=n.connectionId;return}let a=[],c=n.availableTransports||[],l=n;for(let u of c){let f=this._resolveTransportOrError(u,t,o,l?.useStatefulReconnect===!0);if(f instanceof Error)a.push(`${u.transport} failed:`),a.push(f);else if(this._isITransport(f)){if(this.transport=f,!l){try{l=yield this._getNegotiationResponse(e)}catch(D){return Promise.reject(D)}r=this._createConnectUrl(e,l.connectionToken)}try{yield this._startTransport(r,o),this.connectionId=l.connectionId;return}catch(D){if(this._logger.log(s.Error,`Failed to start the transport '${u.transport}': ${D}`),l=void 0,a.push(new Y(`${u.transport} failed: ${D}`,b[u.transport])),this._connectionState!=="Connecting"){let ye="Failed to select transport before stop() was called.";return this._logger.log(s.Debug,ye),Promise.reject(new S(ye))}}}}return a.length>0?Promise.reject(new Q(`Unable to connect to the server with any of the available transports. ${a.join(" ")}`,a)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case b.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new de(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case b.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new ue(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case b.LongPolling:return new q(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=n=>d(this,null,function*(){let o=!1;if(this.features.reconnect)try{this.features.disconnected(),yield this.transport.connect(e,t),yield this.features.resend()}catch{o=!0}else{this._stopConnection(n);return}o&&this._stopConnection(n)}):this.transport.onclose=n=>this._stopConnection(n),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,o){let r=b[e.transport];if(r==null)return this._logger.log(s.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(tt(t,r))if(e.transferFormats.map(c=>w[c]).indexOf(n)>=0){if(r===b.WebSockets&&!this._options.WebSocket||r===b.ServerSentEvents&&!this._options.EventSource)return this._logger.log(s.Debug,`Skipping transport '${b[r]}' because it is not supported in your environment.'`),new X(`'${b[r]}' is not supported in your environment.`,r);this._logger.log(s.Debug,`Selecting transport '${b[r]}'.`);try{return this.features.reconnect=r===b.WebSockets?o:void 0,this._constructTransport(r)}catch(c){return c}}else return this._logger.log(s.Debug,`Skipping transport '${b[r]}' because it does not support the requested transfer format '${w[n]}'.`),new Error(`'${b[r]}' does not support ${w[n]}.`);else return this._logger.log(s.Debug,`Skipping transport '${b[r]}' because it was disabled by the client.`),new G(`'${b[r]}' is disabled by the client.`,r)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(s.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(s.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(s.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(s.Error,`Connection disconnected with error '${e}'.`):this._logger.log(s.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(t=>{this._logger.log(s.Error,`TransportSendQueue.stop() threw error '${t}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(s.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!p.isBrowser)throw new Error(`Cannot resolve '${e}'.`);let t=window.document.createElement("a");return t.href=e,this._logger.log(s.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=new URL(e);t.pathname.endsWith("/")?t.pathname+="negotiate":t.pathname+="/negotiate";let n=new URLSearchParams(t.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this._negotiateVersion.toString()),n.has("useStatefulReconnect")?n.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&n.append("useStatefulReconnect","true"),t.search=n.toString(),t.toString()}};function tt(i,e){return!i||(e&i)!==0}var Ce=class i{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new B,this._transportResult=new B,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new B),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return d(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new B;let e=this._transportResult;this._transportResult=void 0;let t=typeof this._buffer[0]=="string"?this._buffer.join(""):i._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(t),e.resolve()}catch(n){e.reject(n)}}})}static _concatBuffers(e){let t=e.map(r=>r.byteLength).reduce((r,a)=>r+a),n=new Uint8Array(t),o=0;for(let r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return n.buffer}},B=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}};var nt="json",ge=class{constructor(){this.name=nt,this.version=2,this.transferFormat=w.Text}parseMessages(e,t){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];t===null&&(t=x.instance);let n=k.parse(e),o=[];for(let r of n){let a=JSON.parse(r);if(typeof a.type!="number")throw new Error("Invalid payload.");switch(a.type){case h.Invocation:this._isInvocationMessage(a);break;case h.StreamItem:this._isStreamItemMessage(a);break;case h.Completion:this._isCompletionMessage(a);break;case h.Ping:break;case h.Close:break;case h.Ack:this._isAckMessage(a);break;case h.Sequence:this._isSequenceMessage(a);break;default:t.log(s.Information,"Unknown message type '"+a.type+"' ignored.");continue}o.push(a)}return o}writeMessage(e){return k.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,t){if(typeof e!="string"||e==="")throw new Error(t)}};var ot={trace:s.Trace,debug:s.Debug,info:s.Information,information:s.Information,warn:s.Warning,warning:s.Warning,error:s.Error,critical:s.Critical,none:s.None};function it(i){let e=ot[i.toLowerCase()];if(typeof e<"u")return e;throw new Error(`Unknown log level: ${i}`)}var z=class{configureLogging(e){if(g.isRequired(e,"logging"),rt(e))this.logger=e;else if(typeof e=="string"){let t=it(e);this.logger=new A(t)}else this.logger=new A(e);return this}withUrl(e,t){return g.isRequired(e,"url"),g.isNotEmpty(e,"url"),this.url=e,typeof t=="object"?this.httpConnectionOptions=_(_({},this.httpConnectionOptions),t):this.httpConnectionOptions=M(_({},this.httpConnectionOptions),{transport:t}),this}withHubProtocol(e){return g.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new F(e):this.reconnectPolicy=e:this.reconnectPolicy=new F,this}withServerTimeout(e){return g.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return g.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");let t=new fe(this.url,e);return ce.create(t,this.logger||x.instance,this.protocol||new ge,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}};function rt(i){return i.log!==void 0}function ct(i,e){if(i&1&&(C(0,"span",11),we(1,"i",12),y(),C(2,"h4",13),I(3),y()),i&2){let t=J();R(3),W(t.data==null?null:t.data.Title)}}function lt(i,e){if(i&1&&(C(0,"span",14),we(1,"i",15),y(),C(2,"h4",16),I(3),y()),i&2){let t=J();R(3),W(t.data==null?null:t.data.Title)}}function ht(i,e){if(i&1&&(C(0,"div",4),I(1),y()),i&2){let t=J();R(),xe(" ",(t.data==null?null:t.data.Message)||"An error occurred during scan."," ")}}var qe=(()=>{class i{constructor(){this.data=pe(Me),this.dialogRef=pe(He),this.modalConfig=new We,this.modalConfig.title="Scan Product Notification",this.modalConfig.customWidth="500px",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.headerType=this.data?.StatusCode==200?be.Success:be.Error}onOk(){this.dialogRef.close()}onCancel(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=Ee({type:i,selectors:[["app-dialog-scan-notification"]],decls:26,vars:12,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"card","shadow","rounded-4","border-0","p-4",2,"background","#f8fafc","margin-bottom","0px"],[1,"d-flex","align-items-center","mb-4"],[1,"alert","alert-danger","fw-bold","mb-4","p-2","rounded-3"],[1,"lh-base","list-group","list-group-flush","mb-3","rounded-3","overflow-hidden"],[1,"list-group-item","bg-transparent","d-flex","justify-content-between","align-items-center"],[1,"fw-semibold","fs-5"],[1,"fw-bold","text-dark","fs-5"],[1,"fw-bold","text-success","fs-5"],[1,"fw-bold","text-danger","fs-5"],[1,"bg-success","bg-opacity-10","rounded-circle","d-flex","align-items-center","justify-content-center","me-3",2,"width","48px","height","48px"],[1,"fas","fa-check-circle","text-success","fs-2"],[1,"mb-0","text-success","fw-bold"],[1,"bg-danger","bg-opacity-10","rounded-circle","d-flex","align-items-center","justify-content-center","me-3",2,"width","48px","height","48px"],[1,"fas","fa-exclamation-triangle","text-danger","fs-2"],[1,"mb-0","text-danger","fw-bold"]],template:function(n,o){n&1&&(C(0,"modal-material",0),Te("onClose",function(){return o.onCancel()})("onCancel",function(){return o.onCancel()})("onOk",function(){return o.onOk()}),C(1,"div",1)(2,"div",2)(3,"div",3),_e(4,ct,4,1)(5,lt,4,1),y(),_e(6,ht,2,1,"div",4),C(7,"ul",5)(8,"li",6)(9,"span",7),I(10,"Total Products Scanned"),y(),C(11,"span",8),I(12),V(13,"number"),y()(),C(14,"li",6)(15,"span",7),I(16,"Products Found"),y(),C(17,"span",9),I(18),V(19,"number"),y()(),C(20,"li",6)(21,"span",7),I(22,"Products Not Found"),y(),C(23,"span",10),I(24),V(25,"number"),y()()()()()()),n&2&&(Ie("config",o.modalConfig),R(4),me(o.data.StatusCode==200?4:5),R(2),me(o.data.StatusCode!=200?6:-1),R(6),W(K(13,6,o.data==null?null:o.data.Total)),R(6),W(K(19,8,o.data==null?null:o.data.Found)),R(6),W(K(25,10,o.data==null?null:o.data.NotFound)))},dependencies:[De,Pe,je],encapsulation:2})}}return i})();var Co=(()=>{class i{constructor(t,n,o,r){this.decodeTokenService=t,this.toastr=n,this.httpService=o,this.dialog=r,this.initNotifications(),this.parseToken=this.decodeTokenService.getParseToken(),this.buildConnection()}initNotifications(){let t=JSON.parse(localStorage.getItem("Notifications"));this._notifications=new ve(t||[])}setNotification(t){let o=[...this._notifications.value,t];this.saveNotificationTotal(o),this._notifications.next(o)}saveNotificationTotal(t=[]){localStorage.setItem("Notifications",JSON.stringify(t))}getNotification(){return this._notifications.asObservable()}getNotificationDetail(t){return this.httpService.post("/api/notification/GetByID",{ID:t})}getNotificationV2Detail(t){return this.httpService.post(Ae.GetJobScanDetail,{ID:t})}buildConnection(){this.hubConnection=new z().withUrl("/MarketplaceHub").withAutomaticReconnect().configureLogging(s.Information).build(),this.startConnection(),this.onConnectionClose(),this.subscribeNotification()}connectToRegister(){this.hubConnection.invoke("SubscribeGroup",this.parseToken.PID)}subscribeToJobGroup(t){try{this.hubConnection.send("SubscribeGroup",t)}catch(n){console.error("Error subscribing to job group:",n)}}startConnection(){this.hubConnection.start().then(()=>{this.connectToRegister()}).catch(t=>console.log("Error while starting connection: "+t))}onConnectionClose(){this.hubConnection.onclose(()=>{this.buildConnection()})}subscribeNotification(){this.hubConnection.on("Notification",t=>{this.handleNotification(t)})}handleNotification(t){if(typeof t=="string"){let n=JSON.parse(t);this.setNotification(n),n.ID==this.parseToken.PID&&(n.StatusCode!=200?this.toastr.error(n.Message,n.Title,{enableHtml:!0}):this.toastr.success(n.Message,n.Title,{enableHtml:!0}))}else{let n=t.message?JSON.parse(t.message):null;this.dialog.open(qe,{data:n,id:"DialogScanNotificationComponent"})}}clearNotification(){localStorage.removeItem("Notifications"),this._notifications.next([])}static{this.\u0275fac=function(n){return new(n||i)(U(Ne),U(Re),U($e),U(Le))}}static{this.\u0275prov=ke({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{Co as a};
1
+ import{a as Ne}from"./chunk-J53BPEDH.js";import{a as Ae}from"./chunk-MW6Q6DZF.js";import{b as Re,e as $e}from"./chunk-W5L6FMO3.js";import{b as He,c as Me,d as Le,i as we,j as We,k as je}from"./chunk-FO7G4GMY.js";import{m as Pe,n as De}from"./chunk-FXQKRJWU.js";import{$c as V,Gb as Ee,Gc as I,Hc as W,Ic as xe,Mb as _e,Yb as Ie,ad as K,dc as me,g as ve,ic as C,ja as ke,jc as y,kc as be,oa as U,pa as pe,rb as R,tc as Te,uc as J}from"./chunk-OJMQBH6T.js";import{a as _,b as M,c as L,i as d}from"./chunk-66YHNWRR.js";var v=class extends Error{constructor(e,t){let n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}},$=class extends Error{constructor(e="A timeout occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},S=class extends Error{constructor(e="An abort occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},X=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}},G=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}},Y=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}},O=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}},Q=class extends Error{constructor(e,t){let n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}};var j=class{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}},T=class{get(e,t){return this.send(M(_({},t),{method:"GET",url:e}))}post(e,t){return this.send(M(_({},t),{method:"POST",url:e}))}delete(e,t){return this.send(M(_({},t),{method:"DELETE",url:e}))}getCookieString(e){return""}};var s=function(i){return i[i.Trace=0]="Trace",i[i.Debug=1]="Debug",i[i.Information=2]="Information",i[i.Warning=3]="Warning",i[i.Error=4]="Error",i[i.Critical=5]="Critical",i[i.None=6]="None",i}(s||{});var x=class{constructor(){}log(e,t){}};x.instance=new x;var ze="8.0.17",g=class{static isRequired(e,t){if(e==null)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,n){if(!(e in t))throw new Error(`Unknown ${n} value: ${e}.`)}},p=class i{static get isBrowser(){return!i.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!i.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!i.isNode&&typeof window=="object"&&typeof window.document>"u"}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}};function N(i,e){let t="";return E(i)?(t=`Binary data of length ${i.byteLength}`,e&&(t+=`. Content: '${Je(i)}'`)):typeof i=="string"&&(t=`String data of length ${i.length}`,e&&(t+=`. Content: '${i}'`)),t}function Je(i){let e=new Uint8Array(i),t="";return e.forEach(n=>{let o=n<16?"0":"";t+=`0x${o}${n.toString(16)} `}),t.substr(0,t.length-1)}function E(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function ee(i,e,t,n,o,r){return d(this,null,function*(){let a={},[c,l]=P();a[c]=l,i.log(s.Trace,`(${e} transport) sending data. ${N(o,r.logMessageContent)}.`);let u=E(o)?"arraybuffer":"text",f=yield t.post(n,{content:o,headers:_(_({},a),r.headers),responseType:u,timeout:r.timeout,withCredentials:r.withCredentials});i.log(s.Trace,`(${e} transport) request complete. Response status: ${f.statusCode}.`)})}function Be(i){return i===void 0?new A(s.Information):i===null?x.instance:i.log!==void 0?i:new A(i)}var Z=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(t=>{})}},A=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let n=`[${new Date().toISOString()}] ${s[e]}: ${t}`;switch(e){case s.Critical:case s.Error:this.out.error(n);break;case s.Warning:this.out.warn(n);break;case s.Information:this.out.info(n);break;default:this.out.log(n);break}}}};function P(){let i="X-SignalR-User-Agent";return p.isNode&&(i="User-Agent"),[i,Ve(ze,Ke(),Ge(),Xe())]}function Ve(i,e,t,n){let o="Microsoft SignalR/",r=i.split(".");return o+=`${r[0]}.${r[1]}`,o+=` (${i}; `,e&&e!==""?o+=`${e}; `:o+="Unknown OS; ",o+=`${t}`,n?o+=`; ${n}`:o+="; Unknown Runtime Version",o+=")",o}function Ke(){if(p.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Xe(){if(p.isNode)return process.versions.node}function Ge(){return p.isNode?"NodeJS":"Browser"}function te(i){return i.stack?i.stack:i.message?i.message:`${i}`}function Ue(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}var ne=class extends T{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||p.isNode){let t=typeof __webpack_require__=="function"?__non_webpack_require__:L;this._jar=new(t("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=t("node-fetch"):this._fetchType=fetch,this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Ue());if(typeof AbortController>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:L;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}send(e){return d(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new S;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");let t=new this._abortControllerType,n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new S});let o=null;if(e.timeout){let l=e.timeout;o=setTimeout(()=>{t.abort(),this._logger.log(s.Warning,"Timeout from HTTP request."),n=new $},l)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},E(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let r;try{r=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:_({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(l){throw n||(this._logger.log(s.Warning,`Error from HTTP request. ${l}.`),l)}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){let l=yield Oe(r,"text");throw new v(l||r.statusText,r.status)}let c=yield Oe(r,e.responseType);return new j(r.status,r.statusText,c)})}getCookieString(e){let t="";return p.isNode&&this._jar&&this._jar.getCookies(e,(n,o)=>t=o.join("; ")),t}};function Oe(i,e){let t;switch(e){case"arraybuffer":t=i.arrayBuffer();break;case"text":t=i.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:t=i.text();break}return t}var oe=class extends T{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new S):e.method?e.url?new Promise((t,n)=>{let o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(E(e.content)?o.setRequestHeader("Content-Type","application/octet-stream"):o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));let r=e.headers;r&&Object.keys(r).forEach(a=>{o.setRequestHeader(a,r[a])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),n(new S)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?t(new j(o.status,o.statusText,o.response||o.responseText)):n(new v(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(s.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),n(new v(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(s.Warning,"Timeout from HTTP request."),n(new $)},o.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}};var ie=class extends T{constructor(e){if(super(),typeof fetch<"u"||p.isNode)this._httpClient=new ne(e);else if(typeof XMLHttpRequest<"u")this._httpClient=new oe(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new S):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}};var k=class i{static write(e){return`${e}${i.RecordSeparator}`}static parse(e){if(e[e.length-1]!==i.RecordSeparator)throw new Error("Message is incomplete.");let t=e.split(i.RecordSeparator);return t.pop(),t}};k.RecordSeparatorCode=30;k.RecordSeparator=String.fromCharCode(k.RecordSeparatorCode);var re=class{writeHandshakeRequest(e){return k.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(E(e)){let c=new Uint8Array(e),l=c.indexOf(k.RecordSeparatorCode);if(l===-1)throw new Error("Message is incomplete.");let u=l+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(c.slice(0,u))),n=c.byteLength>u?c.slice(u).buffer:null}else{let c=e,l=c.indexOf(k.RecordSeparator);if(l===-1)throw new Error("Message is incomplete.");let u=l+1;t=c.substring(0,u),n=c.length>u?c.substring(u):null}let o=k.parse(t),r=JSON.parse(o[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[n,r]}};var h=function(i){return i[i.Invocation=1]="Invocation",i[i.StreamItem=2]="StreamItem",i[i.Completion=3]="Completion",i[i.StreamInvocation=4]="StreamInvocation",i[i.CancelInvocation=5]="CancelInvocation",i[i.Ping=6]="Ping",i[i.Close=7]="Close",i[i.Ack=8]="Ack",i[i.Sequence=9]="Sequence",i}(h||{});var se=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Z(this,e)}};var ae=class{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}_send(e){return d(this,null,function*(){let t=this._protocol.writeMessage(e),n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let o=()=>{},r=()=>{};E(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise((a,c)=>{o=a,r=c})),this._messages.push(new Se(t,this._totalMessageCount,o,r))}try{this._reconnectInProgress||(yield this._connection.send(t))}catch{this._disconnected()}yield n})}_ack(e){let t=-1;for(let n=0;n<this._messages.length;n++){let o=this._messages[n];if(o._id<=e.sequenceId)t=n,E(o._message)?this._bufferedByteCount-=o._message.byteLength:this._bufferedByteCount-=o._message.length,o._resolver();else if(this._bufferedByteCount<this._bufferSize)o._resolver();else break}t!==-1&&(this._messages=this._messages.slice(t+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type!==h.Sequence?!1:(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;let t=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,t<=this._latestReceivedSequenceId?(t===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=t,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}_resend(){return d(this,null,function*(){let e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;yield this._connection.send(this._protocol.writeMessage({type:h.Sequence,sequenceId:e}));let t=this._messages;for(let n of t)yield this._connection.send(n._message);this._reconnectInProgress=!1})}_dispose(e){e??(e=new Error("Unable to reconnect to server."));for(let t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case h.Invocation:case h.StreamItem:case h.Completion:case h.StreamInvocation:case h.CancelInvocation:return!0;case h.Close:case h.Sequence:case h.Ping:case h.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(()=>d(this,null,function*(){try{this._reconnectInProgress||(yield this._connection.send(this._protocol.writeMessage({type:h.Ack,sequenceId:this._latestReceivedSequenceId})))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}},Se=class{constructor(e,t,n,o){this._message=e,this._id=t,this._resolver=n,this._rejector=o}};var Ye=30*1e3,Qe=15*1e3,Ze=1e5,m=function(i){return i.Disconnected="Disconnected",i.Connecting="Connecting",i.Connected="Connected",i.Disconnecting="Disconnecting",i.Reconnecting="Reconnecting",i}(m||{}),ce=class i{static create(e,t,n,o,r,a,c){return new i(e,t,n,o,r,a,c)}constructor(e,t,n,o,r,a,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(s.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},g.isRequired(e,"connection"),g.isRequired(t,"logger"),g.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=r??Ye,this.keepAliveIntervalInMilliseconds=a??Qe,this._statefulReconnectBufferSize=c??Ze,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=o,this._handshakeProtocol=new re,this.connection.onreceive=l=>this._processIncomingData(l),this.connection.onclose=l=>this._connectionClosed(l),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=m.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:h.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==m.Disconnected&&this._connectionState!==m.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return d(this,null,function*(){if(this._connectionState!==m.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=m.Connecting,this._logger.log(s.Debug,"Starting HubConnection.");try{yield this._startInternal(),p.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=m.Connected,this._connectionStarted=!0,this._logger.log(s.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=m.Disconnected,this._logger.log(s.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return d(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((t,n)=>{this._handshakeResolver=t,this._handshakeRejecter=n});yield this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);let n={protocol:this._protocol.name,version:t};if(this._logger.log(s.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(s.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;(this.connection.features.reconnect||!1)&&(this._messageBuffer=new ae(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(t){throw this._logger.log(s.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(t),t}})}stop(){return d(this,null,function*(){let e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch{}})}_stopInternal(e){if(this._connectionState===m.Disconnected)return this._logger.log(s.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===m.Disconnecting)return this._logger.log(s.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;let t=this._connectionState;return this._connectionState=m.Disconnecting,this._logger.log(s.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(s.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===m.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new S("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}_sendCloseMessage(){return d(this,null,function*(){try{yield this._sendWithProtocol(this._createCloseMessage())}catch{}})}stream(e,...t){let[n,o]=this._replaceStreamingParams(t),r=this._createStreamInvocation(e,t,o),a,c=new se;return c.cancelCallback=()=>{let l=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],a.then(()=>this._sendWithProtocol(l))},this._callbacks[r.invocationId]=(l,u)=>{if(u){c.error(u);return}else l&&(l.type===h.Completion?l.error?c.error(new Error(l.error)):c.complete():c.next(l.item))},a=this._sendWithProtocol(r).catch(l=>{c.error(l),delete this._callbacks[r.invocationId]}),this._launchStreams(n,a),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[n,o]=this._replaceStreamingParams(t),r=this._sendWithProtocol(this._createInvocation(e,t,!0,o));return this._launchStreams(n,r),r}invoke(e,...t){let[n,o]=this._replaceStreamingParams(t),r=this._createInvocation(e,t,!1,o);return new Promise((c,l)=>{this._callbacks[r.invocationId]=(f,D)=>{if(D){l(D);return}else f&&(f.type===h.Completion?f.error?l(new Error(f.error)):c(f.result):l(new Error(`Unexpected message type: ${f.type}`)))};let u=this._sendWithProtocol(r).catch(f=>{l(f),delete this._callbacks[r.invocationId]});this._launchStreams(n,u)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let n=this._methods[e];if(n)if(t){let o=n.indexOf(t);o!==-1&&(n.splice(o,1),n.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let n of t)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(n)))switch(n.type){case h.Invocation:this._invokeClientMethod(n).catch(o=>{this._logger.log(s.Error,`Invoke client method threw error: ${te(o)}`)});break;case h.StreamItem:case h.Completion:{let o=this._callbacks[n.invocationId];if(o){n.type===h.Completion&&delete this._callbacks[n.invocationId];try{o(n)}catch(r){this._logger.log(s.Error,`Stream callback threw error: ${te(r)}`)}}break}case h.Ping:break;case h.Close:{this._logger.log(s.Information,"Close message received from server.");let o=n.error?new Error("Server returned an error on close: "+n.error):void 0;n.allowReconnect===!0?this.connection.stop(o):this._stopPromise=this._stopInternal(o);break}case h.Ack:this._messageBuffer&&this._messageBuffer._ack(n);break;case h.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(n);break;default:this._logger.log(s.Warning,`Invalid message type: ${n.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(o){let r="Error parsing handshake response: "+o;this._logger.log(s.Error,r);let a=new Error(r);throw this._handshakeRejecter(a),a}if(t.error){let o="Server returned handshake error: "+t.error;this._logger.log(s.Error,o);let r=new Error(o);throw this._handshakeRejecter(r),r}else this._logger.log(s.Debug,"Server handshake complete.");return this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>d(this,null,function*(){if(this._connectionState===m.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return d(this,null,function*(){let t=e.target.toLowerCase(),n=this._methods[t];if(!n){this._logger.log(s.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(s.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}let o=n.slice(),r=!!e.invocationId,a,c,l;for(let u of o)try{let f=a;a=yield u.apply(this,e.arguments),r&&a&&f&&(this._logger.log(s.Error,`Multiple results provided for '${t}'. Sending error to server.`),l=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(f){c=f,this._logger.log(s.Error,`A callback for the method '${t}' threw error '${f}'.`)}l?yield this._sendWithProtocol(l):r?(c?l=this._createCompletionMessage(e.invocationId,`${c}`,null):a!==void 0?l=this._createCompletionMessage(e.invocationId,null,a):(this._logger.log(s.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),l=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(l)):a&&this._logger.log(s.Error,`Result given for '${t}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(s.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new S("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===m.Disconnecting?this._completeClose(e):this._connectionState===m.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===m.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=m.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),p.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(s.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}_reconnect(e){return d(this,null,function*(){let t=Date.now(),n=0,o=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),r=this._getNextRetryDelay(n++,0,o);if(r===null){this._logger.log(s.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=m.Reconnecting,e?this._logger.log(s.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(s.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(a=>a.apply(this,[e]))}catch(a){this._logger.log(s.Error,`An onreconnecting callback called with error '${e}' threw error '${a}'.`)}if(this._connectionState!==m.Reconnecting){this._logger.log(s.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;r!==null;){if(this._logger.log(s.Information,`Reconnect attempt number ${n} will start in ${r} ms.`),yield new Promise(a=>{this._reconnectDelayHandle=setTimeout(a,r)}),this._reconnectDelayHandle=void 0,this._connectionState!==m.Reconnecting){this._logger.log(s.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=m.Connected,this._logger.log(s.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(a=>a.apply(this,[this.connection.connectionId]))}catch(a){this._logger.log(s.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${a}'.`)}return}catch(a){if(this._logger.log(s.Information,`Reconnect attempt failed because of error '${a}'.`),this._connectionState!==m.Reconnecting){this._logger.log(s.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===m.Disconnecting&&this._completeClose();return}o=a instanceof Error?a:new Error(a.toString()),r=this._getNextRetryDelay(n++,Date.now()-t,o)}}this._logger.log(s.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(o){return this._logger.log(s.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${o}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(n=>{let o=t[n];try{o(null,e)}catch(r){this._logger.log(s.Error,`Stream 'error' callback called with '${e}' threw error: ${te(r)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,o){if(n)return o.length!==0?{arguments:t,streamIds:o,target:e,type:h.Invocation}:{arguments:t,target:e,type:h.Invocation};{let r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:t,invocationId:r.toString(),streamIds:o,target:e,type:h.Invocation}:{arguments:t,invocationId:r.toString(),target:e,type:h.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||(t=Promise.resolve());for(let n in e)e[n].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n)))},error:o=>{let r;o instanceof Error?r=o.message:o&&o.toString?r=o.toString():r="Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n,r)))},next:o=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(n,o)))}})}}_replaceStreamingParams(e){let t=[],n=[];for(let o=0;o<e.length;o++){let r=e[o];if(this._isObservable(r)){let a=this._invocationId;this._invocationId++,t[a]=r,n.push(a.toString()),e.splice(o,1)}}return[t,n]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,t,n){let o=this._invocationId;return this._invocationId++,n.length!==0?{arguments:t,invocationId:o.toString(),streamIds:n,target:e,type:h.StreamInvocation}:{arguments:t,invocationId:o.toString(),target:e,type:h.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:h.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:h.StreamItem}}_createCompletionMessage(e,t,n){return t?{error:t,invocationId:e,type:h.Completion}:{invocationId:e,result:n,type:h.Completion}}_createCloseMessage(){return{type:h.Close}}};var et=[0,2e3,1e4,3e4,null],F=class{constructor(e){this._retryDelays=e!==void 0?[...e,null]:et}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}};var H=(()=>{class i{}return i.Authorization="Authorization",i.Cookie="Cookie",i})();var le=class extends T{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}send(e){return d(this,null,function*(){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);let n=yield this._innerClient.send(e);return t&&n.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):n})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[H.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[H.Authorization]&&delete e.headers[H.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}};var w=function(i){return i[i.None=0]="None",i[i.WebSockets=1]="WebSockets",i[i.ServerSentEvents=2]="ServerSentEvents",i[i.LongPolling=4]="LongPolling",i}(w||{}),b=function(i){return i[i.Text=1]="Text",i[i.Binary=2]="Binary",i}(b||{});var he=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};var q=class{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new he,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}connect(e,t){return d(this,null,function*(){if(g.isRequired(e,"url"),g.isRequired(t,"transferFormat"),g.isIn(t,b,"transferFormat"),this._url=e,this._logger.log(s.Trace,"(LongPolling transport) Connecting."),t===b.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");let[n,o]=P(),r=_({[n]:o},this._options.headers),a={abortSignal:this._pollAbort.signal,headers:r,timeout:1e5,withCredentials:this._options.withCredentials};t===b.Binary&&(a.responseType="arraybuffer");let c=`${e}&_=${Date.now()}`;this._logger.log(s.Trace,`(LongPolling transport) polling: ${c}.`);let l=yield this._httpClient.get(c,a);l.statusCode!==200?(this._logger.log(s.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new v(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,a)})}_poll(e,t){return d(this,null,function*(){try{for(;this._running;)try{let n=`${e}&_=${Date.now()}`;this._logger.log(s.Trace,`(LongPolling transport) polling: ${n}.`);let o=yield this._httpClient.get(n,t);o.statusCode===204?(this._logger.log(s.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):o.statusCode!==200?(this._logger.log(s.Error,`(LongPolling transport) Unexpected response code: ${o.statusCode}.`),this._closeError=new v(o.statusText||"",o.statusCode),this._running=!1):o.content?(this._logger.log(s.Trace,`(LongPolling transport) data received. ${N(o.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(o.content)):this._logger.log(s.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(n){this._running?n instanceof $?this._logger.log(s.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=n,this._running=!1):this._logger.log(s.Trace,`(LongPolling transport) Poll errored after shutdown: ${n.message}`)}}finally{this._logger.log(s.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return d(this,null,function*(){return this._running?ee(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return d(this,null,function*(){this._logger.log(s.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(s.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,n]=P();e[t]=n;let o={headers:_(_({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials},r;try{yield this._httpClient.delete(this._url,o)}catch(a){r=a}r?r instanceof v&&(r.statusCode===404?this._logger.log(s.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(s.Trace,`(LongPolling transport) Error sending a DELETE request: ${r}`)):this._logger.log(s.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(s.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(s.Trace,e),this.onclose(this._closeError)}}};var ue=class{constructor(e,t,n,o){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=o,this.onreceive=null,this.onclose=null}connect(e,t){return d(this,null,function*(){return g.isRequired(e,"url"),g.isRequired(t,"transferFormat"),g.isIn(t,b,"transferFormat"),this._logger.log(s.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((n,o)=>{let r=!1;if(t!==b.Text){o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let a;if(p.isBrowser||p.isWebWorker)a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let c=this._httpClient.getCookieString(e),l={};l.Cookie=c;let[u,f]=P();l[u]=f,a=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:_(_({},l),this._options.headers)})}try{a.onmessage=c=>{if(this.onreceive)try{this._logger.log(s.Trace,`(SSE transport) data received. ${N(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(l){this._close(l);return}},a.onerror=c=>{r?this._close():o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},a.onopen=()=>{this._logger.log(s.Information,`SSE connected to ${this._url}`),this._eventSource=a,r=!0,n()}}catch(c){o(c);return}})})}send(e){return d(this,null,function*(){return this._eventSource?ee(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}};var de=class{constructor(e,t,n,o,r,a){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=o,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=a}connect(e,t){return d(this,null,function*(){g.isRequired(e,"url"),g.isRequired(t,"transferFormat"),g.isIn(t,b,"transferFormat"),this._logger.log(s.Trace,"(WebSockets transport) Connecting.");let n;return this._accessTokenFactory&&(n=yield this._accessTokenFactory()),new Promise((o,r)=>{e=e.replace(/^http/,"ws");let a,c=this._httpClient.getCookieString(e),l=!1;if(p.isNode||p.isReactNative){let u={},[f,D]=P();u[f]=D,n&&(u[H.Authorization]=`Bearer ${n}`),c&&(u[H.Cookie]=c),a=new this._webSocketConstructor(e,void 0,{headers:_(_({},u),this._headers)})}else n&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(n)}`);a||(a=new this._webSocketConstructor(e)),t===b.Binary&&(a.binaryType="arraybuffer"),a.onopen=u=>{this._logger.log(s.Information,`WebSocket connected to ${e}.`),this._webSocket=a,l=!0,o()},a.onerror=u=>{let f=null;typeof ErrorEvent<"u"&&u instanceof ErrorEvent?f=u.error:f="There was an error with the transport",this._logger.log(s.Information,`(WebSockets transport) ${f}.`)},a.onmessage=u=>{if(this._logger.log(s.Trace,`(WebSockets transport) data received. ${N(u.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(u.data)}catch(f){this._close(f);return}},a.onclose=u=>{if(l)this._close(u);else{let f=null;typeof ErrorEvent<"u"&&u instanceof ErrorEvent?f=u.error:f="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",r(new Error(f))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(s.Trace,`(WebSockets transport) sending data. ${N(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(s.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}};var Fe=100,fe=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,g.isRequired(e,"url"),this._logger=Be(t.logger),this.baseUrl=this._resolveUrl(e),t=t||{},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials=="boolean"||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.timeout=t.timeout===void 0?100*1e3:t.timeout;let n=null,o=null;if(p.isNode&&typeof L<"u"){let r=typeof __webpack_require__=="function"?__non_webpack_require__:L;n=r("ws"),o=r("eventsource")}!p.isNode&&typeof WebSocket<"u"&&!t.WebSocket?t.WebSocket=WebSocket:p.isNode&&!t.WebSocket&&n&&(t.WebSocket=n),!p.isNode&&typeof EventSource<"u"&&!t.EventSource?t.EventSource=EventSource:p.isNode&&!t.EventSource&&typeof o<"u"&&(t.EventSource=o),this._httpClient=new le(t.httpClient||new ie(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}start(e){return d(this,null,function*(){if(e=e||b.Binary,g.isIn(e,b,"transferFormat"),this._logger.log(s.Debug,`Starting connection with transfer format '${b[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){let t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(s.Error,t),yield this._stopPromise,Promise.reject(new S(t))}else if(this._connectionState!=="Connected"){let t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(s.Error,t),Promise.reject(new S(t))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Ce(this.transport)),this._sendQueue.send(e))}stop(e){return d(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(s.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(s.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(t=>{this._stopPromiseResolver=t}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return d(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch{}if(this.transport){try{yield this.transport.stop()}catch(t){this._logger.log(s.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(s.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return d(this,null,function*(){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===w.WebSockets)this.transport=this._constructTransport(w.WebSockets),yield this._startTransport(t,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let n=null,o=0;do{if(n=yield this._getNegotiationResponse(t),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new S("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(n.url&&(t=n.url),n.accessToken){let r=n.accessToken;this._accessTokenFactory=()=>r,this._httpClient._accessToken=r,this._httpClient._accessTokenFactory=void 0}o++}while(n.url&&o<Fe);if(o===Fe&&n.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(t,this._options.transport,n,e)}this.transport instanceof q&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(s.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(n){return this._logger.log(s.Error,"Failed to start the connection: "+n),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(n)}})}_getNegotiationResponse(e){return d(this,null,function*(){let t={},[n,o]=P();t[n]=o;let r=this._resolveNegotiateUrl(e);this._logger.log(s.Debug,`Sending negotiation request: ${r}.`);try{let a=yield this._httpClient.post(r,{content:"",headers:_(_({},t),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(a.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${a.statusCode}'`));let c=JSON.parse(a.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new O("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(a){let c="Failed to complete negotiation with the server: "+a;return a instanceof v&&a.statusCode===404&&(c=c+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(s.Error,c),Promise.reject(new O(c))}})}_createConnectUrl(e,t){return t?e+(e.indexOf("?")===-1?"?":"&")+`id=${t}`:e}_createTransport(e,t,n,o){return d(this,null,function*(){let r=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t)){this._logger.log(s.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,yield this._startTransport(r,o),this.connectionId=n.connectionId;return}let a=[],c=n.availableTransports||[],l=n;for(let u of c){let f=this._resolveTransportOrError(u,t,o,l?.useStatefulReconnect===!0);if(f instanceof Error)a.push(`${u.transport} failed:`),a.push(f);else if(this._isITransport(f)){if(this.transport=f,!l){try{l=yield this._getNegotiationResponse(e)}catch(D){return Promise.reject(D)}r=this._createConnectUrl(e,l.connectionToken)}try{yield this._startTransport(r,o),this.connectionId=l.connectionId;return}catch(D){if(this._logger.log(s.Error,`Failed to start the transport '${u.transport}': ${D}`),l=void 0,a.push(new Y(`${u.transport} failed: ${D}`,w[u.transport])),this._connectionState!=="Connecting"){let ye="Failed to select transport before stop() was called.";return this._logger.log(s.Debug,ye),Promise.reject(new S(ye))}}}}return a.length>0?Promise.reject(new Q(`Unable to connect to the server with any of the available transports. ${a.join(" ")}`,a)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case w.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new de(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case w.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new ue(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case w.LongPolling:return new q(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=n=>d(this,null,function*(){let o=!1;if(this.features.reconnect)try{this.features.disconnected(),yield this.transport.connect(e,t),yield this.features.resend()}catch{o=!0}else{this._stopConnection(n);return}o&&this._stopConnection(n)}):this.transport.onclose=n=>this._stopConnection(n),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,o){let r=w[e.transport];if(r==null)return this._logger.log(s.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(tt(t,r))if(e.transferFormats.map(c=>b[c]).indexOf(n)>=0){if(r===w.WebSockets&&!this._options.WebSocket||r===w.ServerSentEvents&&!this._options.EventSource)return this._logger.log(s.Debug,`Skipping transport '${w[r]}' because it is not supported in your environment.'`),new X(`'${w[r]}' is not supported in your environment.`,r);this._logger.log(s.Debug,`Selecting transport '${w[r]}'.`);try{return this.features.reconnect=r===w.WebSockets?o:void 0,this._constructTransport(r)}catch(c){return c}}else return this._logger.log(s.Debug,`Skipping transport '${w[r]}' because it does not support the requested transfer format '${b[n]}'.`),new Error(`'${w[r]}' does not support ${b[n]}.`);else return this._logger.log(s.Debug,`Skipping transport '${w[r]}' because it was disabled by the client.`),new G(`'${w[r]}' is disabled by the client.`,r)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(s.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(s.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(s.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(s.Error,`Connection disconnected with error '${e}'.`):this._logger.log(s.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(t=>{this._logger.log(s.Error,`TransportSendQueue.stop() threw error '${t}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(s.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!p.isBrowser)throw new Error(`Cannot resolve '${e}'.`);let t=window.document.createElement("a");return t.href=e,this._logger.log(s.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=new URL(e);t.pathname.endsWith("/")?t.pathname+="negotiate":t.pathname+="/negotiate";let n=new URLSearchParams(t.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this._negotiateVersion.toString()),n.has("useStatefulReconnect")?n.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&n.append("useStatefulReconnect","true"),t.search=n.toString(),t.toString()}};function tt(i,e){return!i||(e&i)!==0}var Ce=class i{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new B,this._transportResult=new B,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new B),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return d(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new B;let e=this._transportResult;this._transportResult=void 0;let t=typeof this._buffer[0]=="string"?this._buffer.join(""):i._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(t),e.resolve()}catch(n){e.reject(n)}}})}static _concatBuffers(e){let t=e.map(r=>r.byteLength).reduce((r,a)=>r+a),n=new Uint8Array(t),o=0;for(let r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return n.buffer}},B=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}};var nt="json",ge=class{constructor(){this.name=nt,this.version=2,this.transferFormat=b.Text}parseMessages(e,t){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];t===null&&(t=x.instance);let n=k.parse(e),o=[];for(let r of n){let a=JSON.parse(r);if(typeof a.type!="number")throw new Error("Invalid payload.");switch(a.type){case h.Invocation:this._isInvocationMessage(a);break;case h.StreamItem:this._isStreamItemMessage(a);break;case h.Completion:this._isCompletionMessage(a);break;case h.Ping:break;case h.Close:break;case h.Ack:this._isAckMessage(a);break;case h.Sequence:this._isSequenceMessage(a);break;default:t.log(s.Information,"Unknown message type '"+a.type+"' ignored.");continue}o.push(a)}return o}writeMessage(e){return k.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,t){if(typeof e!="string"||e==="")throw new Error(t)}};var ot={trace:s.Trace,debug:s.Debug,info:s.Information,information:s.Information,warn:s.Warning,warning:s.Warning,error:s.Error,critical:s.Critical,none:s.None};function it(i){let e=ot[i.toLowerCase()];if(typeof e<"u")return e;throw new Error(`Unknown log level: ${i}`)}var z=class{configureLogging(e){if(g.isRequired(e,"logging"),rt(e))this.logger=e;else if(typeof e=="string"){let t=it(e);this.logger=new A(t)}else this.logger=new A(e);return this}withUrl(e,t){return g.isRequired(e,"url"),g.isNotEmpty(e,"url"),this.url=e,typeof t=="object"?this.httpConnectionOptions=_(_({},this.httpConnectionOptions),t):this.httpConnectionOptions=M(_({},this.httpConnectionOptions),{transport:t}),this}withHubProtocol(e){return g.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new F(e):this.reconnectPolicy=e:this.reconnectPolicy=new F,this}withServerTimeout(e){return g.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return g.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");let t=new fe(this.url,e);return ce.create(t,this.logger||x.instance,this.protocol||new ge,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}};function rt(i){return i.log!==void 0}function ct(i,e){if(i&1&&(C(0,"span",11),be(1,"i",12),y(),C(2,"h4",13),I(3),y()),i&2){let t=J();R(3),W(t.data==null?null:t.data.Title)}}function lt(i,e){if(i&1&&(C(0,"span",14),be(1,"i",15),y(),C(2,"h4",16),I(3),y()),i&2){let t=J();R(3),W(t.data==null?null:t.data.Title)}}function ht(i,e){if(i&1&&(C(0,"div",4),I(1),y()),i&2){let t=J();R(),xe(" ",(t.data==null?null:t.data.Message)||"An error occurred during scan."," ")}}var qe=(()=>{class i{constructor(){this.data=pe(Me),this.dialogRef=pe(He),this.modalConfig=new We,this.modalConfig.title="Scan Product Notification",this.modalConfig.customWidth="500px",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.headerType=this.data?.StatusCode==200?we.Success:we.Error}onOk(){this.dialogRef.close()}onCancel(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=Ee({type:i,selectors:[["app-dialog-scan-notification"]],decls:26,vars:12,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"card","shadow","rounded-4","border-0","p-4",2,"background","#f8fafc","margin-bottom","0px"],[1,"d-flex","align-items-center","mb-4"],[1,"alert","alert-danger","fw-bold","mb-4","p-2","rounded-3"],[1,"lh-base","list-group","list-group-flush","mb-3","rounded-3","overflow-hidden"],[1,"list-group-item","bg-transparent","d-flex","justify-content-between","align-items-center","border-0"],[1,"fw-semibold","fs-5"],[1,"fw-bold","text-dark","fs-5"],[1,"fw-bold","text-success","fs-5"],[1,"fw-bold","text-danger","fs-5"],[1,"bg-success","bg-opacity-10","rounded-circle","d-flex","align-items-center","justify-content-center","me-3",2,"width","48px","height","48px"],[1,"fas","fa-check-circle","text-success","fs-2"],[1,"mb-0","text-success","fw-bold"],[1,"bg-danger","bg-opacity-10","rounded-circle","d-flex","align-items-center","justify-content-center","me-3",2,"width","48px","height","48px"],[1,"fas","fa-exclamation-triangle","text-danger","fs-2"],[1,"mb-0","text-danger","fw-bold"]],template:function(n,o){n&1&&(C(0,"modal-material",0),Te("onClose",function(){return o.onCancel()})("onCancel",function(){return o.onCancel()})("onOk",function(){return o.onOk()}),C(1,"div",1)(2,"div",2)(3,"div",3),_e(4,ct,4,1)(5,lt,4,1),y(),_e(6,ht,2,1,"div",4),C(7,"ul",5)(8,"li",6)(9,"span",7),I(10,"Total Products Scanned"),y(),C(11,"span",8),I(12),V(13,"number"),y()(),C(14,"li",6)(15,"span",7),I(16,"Products Found"),y(),C(17,"span",9),I(18),V(19,"number"),y()(),C(20,"li",6)(21,"span",7),I(22,"Products Not Found"),y(),C(23,"span",10),I(24),V(25,"number"),y()()()()()()),n&2&&(Ie("config",o.modalConfig),R(4),me(o.data.StatusCode==200?4:5),R(2),me(o.data.StatusCode!=200?6:-1),R(6),W(K(13,6,o.data==null?null:o.data.Total)),R(6),W(K(19,8,o.data==null?null:o.data.Found)),R(6),W(K(25,10,o.data==null?null:o.data.NotFound)))},dependencies:[De,Pe,je],encapsulation:2})}}return i})();var Co=(()=>{class i{constructor(t,n,o,r){this.decodeTokenService=t,this.toastr=n,this.httpService=o,this.dialog=r,this.initNotifications(),this.parseToken=this.decodeTokenService.getParseToken(),this.buildConnection()}initNotifications(){let t=JSON.parse(localStorage.getItem("Notifications"));this._notifications=new ve(t||[])}setNotification(t){let o=[...this._notifications.value,t];this.saveNotificationTotal(o),this._notifications.next(o)}saveNotificationTotal(t=[]){localStorage.setItem("Notifications",JSON.stringify(t))}getNotification(){return this._notifications.asObservable()}getNotificationDetail(t){return this.httpService.post("/api/notification/GetByID",{ID:t})}getNotificationV2Detail(t){return this.httpService.post(Ae.GetJobScanDetail,{ID:t})}buildConnection(){this.hubConnection=new z().withUrl("/MarketplaceHub").withAutomaticReconnect().configureLogging(s.Information).build(),this.startConnection(),this.onConnectionClose(),this.subscribeNotification()}connectToRegister(){this.hubConnection.invoke("SubscribeGroup",this.parseToken.PID)}subscribeToJobGroup(t){try{this.hubConnection.send("SubscribeGroup",t)}catch(n){console.error("Error subscribing to job group:",n)}}startConnection(){this.hubConnection.start().then(()=>{this.connectToRegister()}).catch(t=>console.log("Error while starting connection: "+t))}onConnectionClose(){this.hubConnection.onclose(()=>{this.buildConnection()})}subscribeNotification(){this.hubConnection.on("Notification",t=>{this.handleNotification(t)})}handleNotification(t){if(typeof t=="string"){let n=JSON.parse(t);this.setNotification(n),n.ID==this.parseToken.PID&&(n.StatusCode!=200?this.toastr.error(n.Message,n.Title,{enableHtml:!0}):this.toastr.success(n.Message,n.Title,{enableHtml:!0}))}else{let n=t.message?JSON.parse(t.message):null;this.dialog.open(qe,{data:n,id:"DialogScanNotificationComponent"})}}clearNotification(){localStorage.removeItem("Notifications"),this._notifications.next([])}static{this.\u0275fac=function(n){return new(n||i)(U(Ne),U(Re),U($e),U(Le))}}static{this.\u0275prov=ke({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{Co as a};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-OWQ3RWNF.js";import{e as c}from"./chunk-JXSBFTQM.js";import{ja as i,pa as o}from"./chunk-B7KTCPKC.js";var h=(()=>{class t{constructor(){this.httpService=o(c)}getConfig(){return this.httpService.post(r.PosAccountGetConfig,{})}saveConfig(e){return this.httpService.post(r.SubmitConfig,e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=i({token:t,factory:t.\u0275fac})}}return t})();export{h as a};
1
+ import{a as r}from"./chunk-MW6Q6DZF.js";import{e as c}from"./chunk-W5L6FMO3.js";import{ja as i,pa as o}from"./chunk-OJMQBH6T.js";var h=(()=>{class t{constructor(){this.httpService=o(c)}getConfig(){return this.httpService.post(r.PosAccountGetConfig,{})}saveConfig(e){return this.httpService.post(r.SubmitConfig,e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=i({token:t,factory:t.\u0275fac})}}return t})();export{h as a};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-YERZ6W22.js";import{a as c}from"./chunk-OWQ3RWNF.js";import{e as u}from"./chunk-JXSBFTQM.js";import{c as p}from"./chunk-PW42BQIY.js";import{ja as s,pa as l,v as i}from"./chunk-B7KTCPKC.js";var m=(()=>{class a{constructor(){this.httpService=l(u)}getNotificationDetail(e){return this.httpService.post(c.GetJobScanDetail,{ID:e}).pipe(i(r=>{let t=r.Data;return t.DurationInSecond=t.Duration?t.Duration/1e3:0,t.ProcessLabel=this.generateLabel(t),t.ProcessDescription=this.generateDescription(t),t}))}getNotificationList(e){return this.httpService.post(c.GetJobScanList,e).pipe(i(r=>{let t=r.Data;return t=t.map(n=>(n.Img=p.getChannelLogoByTypeId(n.TypeID),n.DurationInSecond=n.Duration?n.Duration/1e3:0,n.ProcessLabel=this.generateLabel(n),n.ProcessDescription=this.generateDescription(n),n)),{Data:t,Count:r.Count}}))}generateLabel(e){let r=null;switch(e.ScanTypeID){case o.Active:r="Active";break;case o.Sellable:r="Sellable";break;case o.All:r="All";break}return`Asynchronous Scan - ${r}`}generateDescription(e){return`${e.OriginGetCount} found in ${e.ChannelName} ( ${e.SkuFoundCount} Sold In Channel + ${e.SkuNotFoundCount} Not In POS)`}static{this.\u0275fac=function(r){return new(r||a)}}static{this.\u0275prov=s({token:a,factory:a.\u0275fac})}}return a})();export{m as a};
1
+ import{a as o}from"./chunk-YERZ6W22.js";import{a as c}from"./chunk-MW6Q6DZF.js";import{e as u}from"./chunk-W5L6FMO3.js";import{c as p}from"./chunk-PW42BQIY.js";import{ja as s,pa as l,v as i}from"./chunk-OJMQBH6T.js";var m=(()=>{class a{constructor(){this.httpService=l(u)}getNotificationDetail(e){return this.httpService.post(c.GetJobScanDetail,{ID:e}).pipe(i(r=>{let t=r.Data;return t.DurationInSecond=t.Duration?t.Duration/1e3:0,t.ProcessLabel=this.generateLabel(t),t.ProcessDescription=this.generateDescription(t),t}))}getNotificationList(e){return this.httpService.post(c.GetJobScanList,e).pipe(i(r=>{let t=r.Data;return t=t.map(n=>(n.Img=p.getChannelLogoByTypeId(n.TypeID),n.DurationInSecond=n.Duration?n.Duration/1e3:0,n.ProcessLabel=this.generateLabel(n),n.ProcessDescription=this.generateDescription(n),n)),{Data:t,Count:r.Count}}))}generateLabel(e){let r=null;switch(e.ScanTypeID){case o.Active:r="Active";break;case o.Sellable:r="Sellable";break;case o.All:r="All";break}return`Asynchronous Scan - ${r}`}generateDescription(e){return`${e.OriginGetCount} found in ${e.ChannelName} ( ${e.SkuFoundCount} Sold In Channel + ${e.SkuNotFoundCount} Not In POS)`}static{this.\u0275fac=function(r){return new(r||a)}}static{this.\u0275prov=s({token:a,factory:a.\u0275fac})}}return a})();export{m as a};
@@ -0,0 +1 @@
1
+ import{c as C}from"./chunk-PW42BQIY.js";import{b as v,c as x,j as V,k as R}from"./chunk-FO7G4GMY.js";import{r as A}from"./chunk-NNRBGHXB.js";import{d as P}from"./chunk-FXQKRJWU.js";import{Gb as y,Gc as m,Hc as g,Ra as u,Sc as E,Yb as d,ec as S,gc as O,hc as b,ic as a,jc as l,rb as p,tc as T,xb as f}from"./chunk-OJMQBH6T.js";var K=i=>({"bg-gradient-warning":i});function U(i,I){if(i&1&&(a(0,"tr",5)(1,"td"),m(2),l(),a(3,"td",6),m(4),l()()),i&2){let t=I.$implicit;d("matTooltip",t.duplicateMessage),p(2),g(t==null?null:t.Name),p(),d("ngClass",E(4,K,t.isDuplicate)),p(),g(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var lt=(()=>{class i{constructor(t,e){this.data=t,this.dialogRef=e,this.variants=u([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,e={},o=[],h=t.filter(n=>C.IsEmpty(n.ChannelVariationSKU));t.filter(n=>C.IsNotEmpty(n.ChannelVariationSKU)).forEach((n,r,M)=>{e[n.ChannelVariationSKU]=M.filter(s=>s.ChannelVariationSKU===n.ChannelVariationSKU)}),Object.keys(e).forEach(n=>{e[n].length>1&&(e[n]=e[n].map((r,M,s)=>{let _=`SKU ${r.ChannelVariationSKU} is duplicated with variant`;return s.forEach((c,L)=>{c.Name!==r.Name&&(_+=` ${s.length>2?c.Name+(L!==s.length-1?",":""):c.Name}`)}),r.duplicateMessage=_,r.isDuplicate=!0,r})),o.push(...e[n])}),o.push(...h),this.variants.set(o)}initModalConfig(){this.modalConfig=new V,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(e){return new(e||i)(f(x),f(v))}}static{this.\u0275cmp=y({type:i,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),T("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),m(6,"Variant"),l(),a(7,"th",4),m(8,"SKU"),l()()(),a(9,"tbody"),O(10,U,5,6,"tr",5,S),l()()()()),e&2&&(d("config",o.modalConfig),p(10),b(o.variants()))},dependencies:[P,A,R],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]})}}return i})();export{lt as a};