@codingfactory/messenger-client 0.2.18 → 0.2.19

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 (2) hide show
  1. package/dist/index.js +535 -531
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ref as ve, getCurrentInstance as zt, computed as ie, watch as Ot, onUnmounted as De, toValue as Xn, onMounted as jt } from "vue";
2
- import { defineStore as _i, storeToRefs as Si } from "pinia";
3
- import $t, { isAxiosError as Ci, AxiosHeaders as wn } from "axios";
2
+ import { defineStore as Si, storeToRefs as Ci } from "pinia";
3
+ import $t, { isAxiosError as wi, AxiosHeaders as wn } from "axios";
4
4
  import { isAxiosError as uc } from "axios";
5
- import { useRoute as wi } from "vue-router";
5
+ import { useRoute as Ti } from "vue-router";
6
6
  const Wn = () => () => {
7
7
  }, Gn = () => () => {
8
8
  }, Jn = async () => {
@@ -29,7 +29,7 @@ const Wn = () => () => {
29
29
  unsubscribeFromConversation: Yn,
30
30
  subscribeToTyping: ts,
31
31
  unsubscribeFromTyping: Zn
32
- }, We = () => $.ECHO_INITIALIZED_EVENT, Pe = () => $.getEcho(), Ti = async () => $.waitForEcho(), ss = () => $.getConnectionStatus(), Tn = () => ss(), Ft = () => $.getAccessState(), ht = (e) => $.onConnectionStatusChange(e), Ei = (e) => $.onAccessStateChange(e), Ai = async () => {
32
+ }, We = () => $.ECHO_INITIALIZED_EVENT, Ae = () => $.getEcho(), ss = async () => $.waitForEcho(), rs = () => $.getConnectionStatus(), Tn = () => rs(), Ft = () => $.getAccessState(), ht = (e) => $.onConnectionStatusChange(e), Ei = (e) => $.onAccessStateChange(e), Ai = async () => {
33
33
  await $.reconnect();
34
34
  }, Ri = (e) => $.subscribeToPresenceStatus(e), Pi = () => $.unsubscribeFromPresenceStatus(), Mi = (e, n) => $.subscribeToConversation(e, n), xi = (e) => $.unsubscribeFromConversation(e), ki = (e, n) => $.subscribeToTyping(e, n), Li = (e) => $.unsubscribeFromTyping(e);
35
35
  function Ii(e) {
@@ -38,29 +38,29 @@ function Ii(e) {
38
38
  function Ui() {
39
39
  $.ECHO_INITIALIZED_EVENT = "messenger-client:echo-initialized", $.getEcho = () => null, $.waitForEcho = ns, $.getConnectionStatus = () => "disconnected", $.getAccessState = () => "available", $.onConnectionStatusChange = Wn, $.onAccessStateChange = Gn, $.reconnect = Jn, $.subscribeToPresenceStatus = Kn, $.unsubscribeFromPresenceStatus = Qn, $.subscribeToConversation = es, $.unsubscribeFromConversation = Yn, $.subscribeToTyping = ts, $.unsubscribeFromTyping = Zn;
40
40
  }
41
- function Me(e) {
41
+ function xe(e) {
42
42
  return typeof e == "object" && e !== null;
43
43
  }
44
44
  function Oi(e) {
45
- return Me(e) && typeof e.conversation_id == "string" && Me(e.message) && typeof e.message.id == "string" && typeof e.message.conversation_id == "string" && typeof e.message.author_id == "string";
45
+ return xe(e) && typeof e.conversation_id == "string" && xe(e.message) && typeof e.message.id == "string" && typeof e.message.conversation_id == "string" && typeof e.message.author_id == "string";
46
46
  }
47
47
  function Fi(e) {
48
- return Me(e) && typeof e.conversation_id == "string" && typeof e.user_id == "string" && typeof e.message_id == "string";
48
+ return xe(e) && typeof e.conversation_id == "string" && typeof e.user_id == "string" && typeof e.message_id == "string";
49
49
  }
50
50
  function Ni(e) {
51
- return Me(e) && typeof e.conversation_id == "string" && Me(e.message) && typeof e.message.id == "string";
51
+ return xe(e) && typeof e.conversation_id == "string" && xe(e.message) && typeof e.message.id == "string";
52
52
  }
53
53
  function Di(e) {
54
- return Me(e) && typeof e.conversation_id == "string" && typeof e.message_id == "string";
54
+ return xe(e) && typeof e.conversation_id == "string" && typeof e.message_id == "string";
55
55
  }
56
56
  function qi(e) {
57
- return Me(e) && typeof e.conversation_id == "string" && typeof e.message_id == "string" && Array.isArray(e.reactions);
57
+ return xe(e) && typeof e.conversation_id == "string" && typeof e.message_id == "string" && Array.isArray(e.reactions);
58
58
  }
59
59
  function zi(e) {
60
- return Me(e) && typeof e.conversation_id == "string";
60
+ return xe(e) && typeof e.conversation_id == "string";
61
61
  }
62
- const rs = $t;
63
- let Ht = rs;
62
+ const is = $t;
63
+ let Ht = is;
64
64
  function W() {
65
65
  return Ht;
66
66
  }
@@ -68,12 +68,12 @@ function ji(e) {
68
68
  Ht = e;
69
69
  }
70
70
  function $i() {
71
- Ht = rs;
71
+ Ht = is;
72
72
  }
73
- const is = {
73
+ const os = {
74
74
  currentUser: null
75
75
  };
76
- let Bt = () => is;
76
+ let Bt = () => os;
77
77
  function Fe() {
78
78
  return Bt;
79
79
  }
@@ -81,10 +81,10 @@ function Hi(e) {
81
81
  Bt = e;
82
82
  }
83
83
  function Bi() {
84
- Bt = () => is;
84
+ Bt = () => os;
85
85
  }
86
86
  function Z(e) {
87
- if (Ci(e)) {
87
+ if (wi(e)) {
88
88
  const n = e.response?.data?.message || e.message || "An error occurred";
89
89
  return n.includes("SQLSTATE") || n.includes("Connection:") || n.includes("\\Illuminate\\") ? "Something went wrong. Please try again later." : n;
90
90
  }
@@ -96,12 +96,12 @@ function Ka(e) {
96
96
  function Qa(e) {
97
97
  return typeof e == "object" && e !== null && "response" in e && typeof e.response == "object";
98
98
  }
99
- const os = {
99
+ const as = {
100
100
  async uploadImage() {
101
101
  throw new Error("messenger-client mediaApi.uploadImage is not configured");
102
102
  }
103
103
  };
104
- let Vt = os;
104
+ let Vt = as;
105
105
  function Vi() {
106
106
  return Vt;
107
107
  }
@@ -109,16 +109,16 @@ function Xi(e) {
109
109
  Vt = e;
110
110
  }
111
111
  function Wi() {
112
- Vt = os;
112
+ Vt = as;
113
113
  }
114
114
  function Gi(e) {
115
115
  return e !== null && typeof e == "object" && "id" in e && "type" in e && "participants" in e;
116
116
  }
117
- function as(e) {
117
+ function cs(e) {
118
118
  return typeof e == "object" && e !== null;
119
119
  }
120
120
  function $e(e) {
121
- return !as(e) || !("data" in e) ? e : e.data;
121
+ return !cs(e) || !("data" in e) ? e : e.data;
122
122
  }
123
123
  function st(e, n) {
124
124
  const i = e[n];
@@ -146,7 +146,7 @@ function Rt(e, n) {
146
146
  throw new Error(`Invalid messaging folder payload: missing numeric ${n}`);
147
147
  }
148
148
  function Nt(e) {
149
- if (!as(e))
149
+ if (!cs(e))
150
150
  throw new Error("Invalid messaging folder payload: expected object");
151
151
  return {
152
152
  id: st(e, "id"),
@@ -170,7 +170,7 @@ function An(e) {
170
170
  throw new Error("Invalid conversation payload from folder assignment endpoint");
171
171
  return e;
172
172
  }
173
- const Re = {
173
+ const Pe = {
174
174
  async fetchFolders() {
175
175
  const e = await W().get("/v1/messaging/folders");
176
176
  return Ji($e(e.data));
@@ -210,10 +210,10 @@ const Re = {
210
210
  if (Number.isFinite(n))
211
211
  return n;
212
212
  }
213
- }, cs = (e) => typeof e == "number" && e >= 500 && e < 600, Pn = (e) => {
213
+ }, us = (e) => typeof e == "number" && e >= 500 && e < 600, Pn = (e) => {
214
214
  const i = Wt(e.response?.status);
215
- return i === void 0 ? !0 : i === 429 || cs(i);
216
- }, us = (e) => {
215
+ return i === void 0 ? !0 : i === 429 || us(i);
216
+ }, ls = (e) => {
217
217
  if (typeof e == "number" && Number.isFinite(e) && e > 0)
218
218
  return Math.max(Rn, e * 1e3);
219
219
  if (typeof e == "string") {
@@ -227,7 +227,7 @@ const Re = {
227
227
  return Math.min(Ki, o);
228
228
  }, to = (e) => {
229
229
  const n = e;
230
- return Wt(n.response?.status) === 429 ? us(n.response?.headers?.["retry-after"]) : Qi;
230
+ return Wt(n.response?.status) === 429 ? ls(n.response?.headers?.["retry-after"]) : Qi;
231
231
  }, Mn = async (e) => {
232
232
  await new Promise((n) => {
233
233
  setTimeout(n, e);
@@ -397,15 +397,15 @@ function ho(e, n) {
397
397
  return Object.prototype.hasOwnProperty.call(e, "folder_id") ? e.folder_id ?? null : e.me?.folder_id === null ? null : typeof e.me?.folder_id == "string" ? e.me.folder_id : n?.folder_id;
398
398
  }
399
399
  function He(e, n) {
400
- const i = lo(e, n), o = typeof e.is_muted == "boolean" ? e.is_muted : i !== null || n?.is_muted === !0, c = e.last_message ? at(e.last_message) : n?.last_message, l = e.last_message_at ?? n?.last_message_at, d = typeof e.unread_count == "number" ? e.unread_count : n?.unread_count ?? 0, g = typeof e.is_pinned == "boolean" ? e.is_pinned : e.me?.is_pinned ?? n?.is_pinned ?? !1, h = typeof e.is_archived == "boolean" ? e.is_archived : e.me?.is_archived ?? n?.is_archived ?? !1, x = ho(e, n), M = typeof e.created_at == "string" ? e.created_at : n?.created_at ?? "", _ = (() => {
400
+ const i = lo(e, n), o = typeof e.is_muted == "boolean" ? e.is_muted : i !== null || n?.is_muted === !0, c = e.last_message ? at(e.last_message) : n?.last_message, l = e.last_message_at ?? n?.last_message_at, d = typeof e.unread_count == "number" ? e.unread_count : n?.unread_count ?? 0, g = typeof e.is_pinned == "boolean" ? e.is_pinned : e.me?.is_pinned ?? n?.is_pinned ?? !1, h = typeof e.is_archived == "boolean" ? e.is_archived : e.me?.is_archived ?? n?.is_archived ?? !1, x = ho(e, n), M = typeof e.created_at == "string" ? e.created_at : n?.created_at ?? "", y = (() => {
401
401
  if (!n || n.unread_count !== 0 || d <= 0)
402
402
  return !1;
403
- const C = n.last_message?.id, v = e.last_message?.id;
404
- return !C || !v ? !1 : C === v;
403
+ const C = n.last_message?.id, b = e.last_message?.id;
404
+ return !C || !b ? !1 : C === b;
405
405
  })();
406
406
  return {
407
407
  ...e,
408
- unread_count: o || _ ? 0 : d,
408
+ unread_count: o || y ? 0 : d,
409
409
  participants: uo(e.participants, n?.participants),
410
410
  is_muted: o,
411
411
  muted_until: i,
@@ -532,7 +532,7 @@ function xt(e) {
532
532
  i.is_request === !0 && n.set(i.id, i);
533
533
  return Array.from(n.values()).sort(ct);
534
534
  }
535
- const Gt = _i("messaging", {
535
+ const Gt = Si("messaging", {
536
536
  state: () => ({
537
537
  conversations: [],
538
538
  requests: [],
@@ -581,7 +581,7 @@ const Gt = _i("messaging", {
581
581
  },
582
582
  async fetchFolders() {
583
583
  try {
584
- const e = await Re.fetchFolders();
584
+ const e = await Pe.fetchFolders();
585
585
  return this.folders = Be(e), this.foldersLoaded = !0, this.normalizeFolderAssignmentsState(), this.folders;
586
586
  } catch (e) {
587
587
  throw this.error = Z(e), e;
@@ -589,7 +589,7 @@ const Gt = _i("messaging", {
589
589
  },
590
590
  async createFolder(e) {
591
591
  try {
592
- const n = await Re.createFolder(e);
592
+ const n = await Pe.createFolder(e);
593
593
  return this.folders = Be([...this.folders, n]), n;
594
594
  } catch (n) {
595
595
  throw this.error = Z(n), n;
@@ -597,7 +597,7 @@ const Gt = _i("messaging", {
597
597
  },
598
598
  async updateFolder(e, n) {
599
599
  try {
600
- const i = await Re.updateFolder(e, n);
600
+ const i = await Pe.updateFolder(e, n);
601
601
  return this.folders = Be(
602
602
  this.folders.map((o) => o.id === e ? i : o)
603
603
  ), i;
@@ -607,14 +607,14 @@ const Gt = _i("messaging", {
607
607
  },
608
608
  async deleteFolder(e) {
609
609
  try {
610
- await Re.deleteFolder(e), this.folders = this.folders.filter((n) => n.id !== e), this.foldersLoaded = !0, this.activeFolderId === e && (this.activeFolderId = null), this.normalizeFolderAssignmentsState();
610
+ await Pe.deleteFolder(e), this.folders = this.folders.filter((n) => n.id !== e), this.foldersLoaded = !0, this.activeFolderId === e && (this.activeFolderId = null), this.normalizeFolderAssignmentsState();
611
611
  } catch (n) {
612
612
  throw this.error = Z(n), n;
613
613
  }
614
614
  },
615
615
  async reorderFolders(e) {
616
616
  try {
617
- await Re.reorderFolders(e);
617
+ await Pe.reorderFolders(e);
618
618
  const n = new Map(this.folders.map((c) => [c.id, c])), i = [];
619
619
  for (const c of e) {
620
620
  const l = n.get(c);
@@ -636,7 +636,7 @@ const Gt = _i("messaging", {
636
636
  },
637
637
  async assignToFolder(e, n) {
638
638
  try {
639
- const i = await Re.assignFolder(e, n), o = this.conversations.find(
639
+ const i = await Pe.assignFolder(e, n), o = this.conversations.find(
640
640
  (d) => d.id === e
641
641
  ) ?? this.requests.find(
642
642
  (d) => d.id === e
@@ -671,11 +671,11 @@ const Gt = _i("messaging", {
671
671
  const d = await W().get("/v1/messaging/conversations", { params: l }), { items: g, nextCursor: h } = rt(
672
672
  d.data,
673
673
  "conversations"
674
- ), x = g.map((_) => {
674
+ ), x = g.map((y) => {
675
675
  const C = this.conversations.find(
676
- (v) => v.id === _.id
676
+ (b) => b.id === y.id
677
677
  );
678
- return He(_, C);
678
+ return He(y, C);
679
679
  });
680
680
  e ? this.conversations.push(...x) : this.conversations = x, this.normalizeFolderAssignmentsState(), this.lastFetch = Date.now();
681
681
  const M = {
@@ -699,7 +699,7 @@ const Gt = _i("messaging", {
699
699
  }), this.backgroundPollRetryAfterUntil = 0, this.backgroundPollTransientFailureCount = 0, !0;
700
700
  } catch (e) {
701
701
  const n = e, i = Wt(n.response?.status);
702
- return i === 429 ? (this.backgroundPollRetryAfterUntil = Date.now() + us(n.response?.headers?.["retry-after"]), !1) : (this.backgroundPollTransientFailureCount += 1, i === void 0 || cs(i) ? (this.backgroundPollRetryAfterUntil = Date.now() + eo(this.backgroundPollTransientFailureCount), !1) : (this.backgroundPollRetryAfterUntil = Date.now() + Xt, !1));
702
+ return i === 429 ? (this.backgroundPollRetryAfterUntil = Date.now() + ls(n.response?.headers?.["retry-after"]), !1) : (this.backgroundPollTransientFailureCount += 1, i === void 0 || us(i) ? (this.backgroundPollRetryAfterUntil = Date.now() + eo(this.backgroundPollTransientFailureCount), !1) : (this.backgroundPollRetryAfterUntil = Date.now() + Xt, !1));
703
703
  }
704
704
  },
705
705
  async fetchConversation(e) {
@@ -755,21 +755,21 @@ const Gt = _i("messaging", {
755
755
  try {
756
756
  c = await W().get(`/v1/messaging/conversations/${e}/messages`, { params: i });
757
757
  break;
758
- } catch (_) {
759
- if (!(o < Yi && Pn(_)))
760
- throw _;
761
- o += 1, await Mn(to(_));
758
+ } catch (y) {
759
+ if (!(o < Yi && Pn(y)))
760
+ throw y;
761
+ o += 1, await Mn(to(y));
762
762
  }
763
763
  const { items: l, nextCursor: d } = rt(
764
764
  c.data,
765
765
  "messages"
766
766
  ), g = l.map(at), h = [...g].reverse();
767
767
  if (n ? this.messages[e] = [...h, ...this.messages[e] || []] : this.messages[e] = h, (() => {
768
- const _ = this.conversations.find((C) => C.id === e) ?? this.requests.find((C) => C.id === e);
769
- return _ ? !_.last_message || !_.last_message_at : !1;
768
+ const y = this.conversations.find((C) => C.id === e) ?? this.requests.find((C) => C.id === e);
769
+ return y ? !y.last_message || !y.last_message_at : !1;
770
770
  })()) {
771
- const _ = this.messages[e]?.at(-1);
772
- _ && this.updateConversationLastMessage(e, _);
771
+ const y = this.messages[e]?.at(-1);
772
+ y && this.updateConversationLastMessage(e, y);
773
773
  }
774
774
  d ? (this.conversationCursors[e] = d, this.conversationHasMore[e] = !0) : (delete this.conversationCursors[e], this.conversationHasMore[e] = !1);
775
775
  const M = {
@@ -784,10 +784,10 @@ const Gt = _i("messaging", {
784
784
  }
785
785
  },
786
786
  async sendMessage(e, n, i, o, c, l, d) {
787
- const g = Fe()(), h = `temp-${Date.now()}-${Math.random()}`, x = typeof l == "string" && l.trim().length > 0 ? l.trim() : null, M = co(d), _ = g.currentUser, C = {
787
+ const g = Fe()(), h = `temp-${Date.now()}-${Math.random()}`, x = typeof l == "string" && l.trim().length > 0 ? l.trim() : null, M = co(d), y = g.currentUser, C = {
788
788
  id: h,
789
789
  conversation_id: e,
790
- author_id: _?.id || "",
790
+ author_id: y?.id || "",
791
791
  body: n || "",
792
792
  attachments: [],
793
793
  meta: x ? { shared_post_id: x } : {},
@@ -796,14 +796,14 @@ const Gt = _i("messaging", {
796
796
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
797
797
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
798
798
  };
799
- _ && (C.author = {
800
- id: _.id,
801
- name: _.name,
802
- ..._.avatar ? { avatar: _.avatar } : {},
803
- ..._.handle ? { handle: _.handle } : {}
799
+ y && (C.author = {
800
+ id: y.id,
801
+ name: y.name,
802
+ ...y.avatar ? { avatar: y.avatar } : {},
803
+ ...y.handle ? { handle: y.handle } : {}
804
804
  }), o != null && (C.reply_to_id = o), c != null && (C.reply_to = c), this.messages[e] || (this.messages[e] = []), this.messages[e].push(C), this._pendingSendIds.add(h);
805
805
  try {
806
- let v;
806
+ let b;
807
807
  const T = {
808
808
  body: n || "",
809
809
  ...o ? { reply_to_id: o } : {},
@@ -821,26 +821,26 @@ const Gt = _i("messaging", {
821
821
  };
822
822
  })
823
823
  );
824
- v = await W().post(`/v1/messaging/conversations/${e}/messages`, {
824
+ b = await W().post(`/v1/messaging/conversations/${e}/messages`, {
825
825
  ...T,
826
826
  attachments: k
827
827
  });
828
828
  } else
829
- v = await W().post(`/v1/messaging/conversations/${e}/messages`, {
829
+ b = await W().post(`/v1/messaging/conversations/${e}/messages`, {
830
830
  ...T,
831
831
  type: "text"
832
832
  });
833
- const w = v.data.data || v.data, f = { ...C, ...w, attachments: w.attachments ?? C.attachments }, m = at(f), b = this.messages[e], N = b.findIndex((k) => k.id === h);
834
- N >= 0 && (b[N] = m), this._pendingSendIds.delete(h);
833
+ const w = b.data.data || b.data, f = { ...C, ...w, attachments: w.attachments ?? C.attachments }, m = at(f), v = this.messages[e], N = v.findIndex((k) => k.id === h);
834
+ N >= 0 && (v[N] = m), this._pendingSendIds.delete(h);
835
835
  const q = m.id;
836
836
  let G = 0;
837
- for (let k = b.length - 1; k >= 0; k--) {
838
- const O = b[k];
839
- O && O.id === q && (G++, G > 1 && b.splice(k, 1));
837
+ for (let k = v.length - 1; k >= 0; k--) {
838
+ const O = v[k];
839
+ O && O.id === q && (G++, G > 1 && v.splice(k, 1));
840
840
  }
841
841
  return this.updateConversationLastMessage(e, m), m;
842
- } catch (v) {
843
- throw this._pendingSendIds.delete(h), this.messages[e] = this.messages[e].filter((T) => T.id !== h), this.error = Z(v), v;
842
+ } catch (b) {
843
+ throw this._pendingSendIds.delete(h), this.messages[e] = this.messages[e].filter((T) => T.id !== h), this.error = Z(b), b;
844
844
  }
845
845
  },
846
846
  async editMessage(e, n, i) {
@@ -1126,9 +1126,9 @@ const Gt = _i("messaging", {
1126
1126
  let g;
1127
1127
  try {
1128
1128
  g = await W().post(o, c);
1129
- } catch (_) {
1130
- if (!po(_))
1131
- throw _;
1129
+ } catch (y) {
1130
+ if (!po(y))
1131
+ throw y;
1132
1132
  g = await W().post(o, c);
1133
1133
  }
1134
1134
  const h = he(g.data) && "data" in g.data ? g.data.data : g.data, x = Un(
@@ -1136,10 +1136,10 @@ const Gt = _i("messaging", {
1136
1136
  );
1137
1137
  (x.length > 0 || d.length === 0) && this.updateMessageReactions(e, n, x);
1138
1138
  try {
1139
- const _ = await W().get(o), C = he(_.data) && "data" in _.data ? _.data.data : _.data, v = Un(
1139
+ const y = await W().get(o), C = he(y.data) && "data" in y.data ? y.data.data : y.data, b = Un(
1140
1140
  he(C) ? C.reactions : void 0
1141
1141
  );
1142
- this.updateMessageReactions(e, n, v);
1142
+ this.updateMessageReactions(e, n, b);
1143
1143
  } catch {
1144
1144
  }
1145
1145
  } catch (g) {
@@ -1177,7 +1177,7 @@ const Gt = _i("messaging", {
1177
1177
  },
1178
1178
  async acceptRequest(e) {
1179
1179
  try {
1180
- const n = await Re.acceptRequest(e);
1180
+ const n = await Pe.acceptRequest(e);
1181
1181
  this.requests = this.requests.filter((o) => o.id !== e);
1182
1182
  const i = He({
1183
1183
  ...n,
@@ -1192,7 +1192,7 @@ const Gt = _i("messaging", {
1192
1192
  },
1193
1193
  async declineRequest(e) {
1194
1194
  try {
1195
- await Re.declineRequest(e), this.requests = this.requests.filter((n) => n.id !== e);
1195
+ await Pe.declineRequest(e), this.requests = this.requests.filter((n) => n.id !== e);
1196
1196
  } catch (n) {
1197
1197
  throw this.error = Z(n), n;
1198
1198
  }
@@ -1265,79 +1265,79 @@ const Gt = _i("messaging", {
1265
1265
  });
1266
1266
  function Ya(e) {
1267
1267
  const n = Gt(), i = Fe()(), o = ve(!1), c = ve(null), l = ve(null), d = zt(), g = d !== null, h = 20, x = 250;
1268
- let M = 0, _ = null, C = null;
1269
- const v = ie(() => i.currentUser?.id), T = () => Xn(e)?.trim() ?? "";
1268
+ let M = 0, y = null, C = null;
1269
+ const b = ie(() => i.currentUser?.id), T = () => Xn(e)?.trim() ?? "";
1270
1270
  function w() {
1271
- _ && (clearTimeout(_), _ = null), M = 0;
1271
+ y && (clearTimeout(y), y = null), M = 0;
1272
1272
  }
1273
1273
  function f() {
1274
- !g || o.value || _ || M >= h || (_ = setTimeout(() => {
1275
- _ = null, M += 1, F();
1274
+ !g || o.value || y || M >= h || (y = setTimeout(() => {
1275
+ y = null, M += 1, F();
1276
1276
  }, x));
1277
1277
  }
1278
- function m(y) {
1279
- if (n.addMessage(y.message), y.message.author_id !== v.value) {
1280
- const I = n.getConversationById(y.conversation_id);
1281
- I && (I.unread_count = 0), n.markAsRead(y.conversation_id).catch(() => {
1278
+ function m(_) {
1279
+ if (n.addMessage(_.message), _.message.author_id !== b.value) {
1280
+ const I = n.getConversationById(_.conversation_id);
1281
+ I && (I.unread_count = 0), n.markAsRead(_.conversation_id).catch(() => {
1282
1282
  });
1283
1283
  }
1284
1284
  }
1285
- function b(y) {
1286
- n.applyParticipantReadState(y);
1285
+ function v(_) {
1286
+ n.applyParticipantReadState(_);
1287
1287
  }
1288
- function N(y) {
1289
- const I = n.getMessagesByConversationId(y.conversation_id), ae = I.findIndex((B) => B.id === y.message.id);
1288
+ function N(_) {
1289
+ const I = n.getMessagesByConversationId(_.conversation_id), ae = I.findIndex((B) => B.id === _.message.id);
1290
1290
  if (ae >= 0) {
1291
1291
  const B = I[ae];
1292
1292
  if (!B) return;
1293
1293
  const E = { ...B };
1294
- y.message.body !== void 0 && (E.body = y.message.body), y.message.edited_at !== void 0 && (E.edited_at = y.message.edited_at), y.message.meta !== void 0 && (E.meta = y.message.meta), I[ae] = E;
1295
- const V = n.getConversationById(y.conversation_id);
1296
- V && V.last_message?.id === y.message.id && (V.last_message = E);
1294
+ _.message.body !== void 0 && (E.body = _.message.body), _.message.edited_at !== void 0 && (E.edited_at = _.message.edited_at), _.message.meta !== void 0 && (E.meta = _.message.meta), I[ae] = E;
1295
+ const V = n.getConversationById(_.conversation_id);
1296
+ V && V.last_message?.id === _.message.id && (V.last_message = E);
1297
1297
  }
1298
1298
  }
1299
- function q(y) {
1300
- n.removeMessage(y.conversation_id, y.message_id);
1299
+ function q(_) {
1300
+ n.removeMessage(_.conversation_id, _.message_id);
1301
1301
  }
1302
- function G(y) {
1302
+ function G(_) {
1303
1303
  n.updateMessageReactions(
1304
- y.conversation_id,
1305
- y.message_id,
1306
- y.reactions
1304
+ _.conversation_id,
1305
+ _.message_id,
1306
+ _.reactions
1307
1307
  );
1308
1308
  }
1309
- function k(y) {
1310
- const I = n.getConversationById(y.conversation_id);
1309
+ function k(_) {
1310
+ const I = n.getConversationById(_.conversation_id);
1311
1311
  I && (I.is_request = !1), n.requests = n.requests.filter(
1312
- (ae) => ae.id !== y.conversation_id
1312
+ (ae) => ae.id !== _.conversation_id
1313
1313
  );
1314
1314
  }
1315
- function O(y) {
1316
- y.removed_user_id === v.value && (te(), n.deleteConversation(y.conversation_id).catch(() => {
1315
+ function O(_) {
1316
+ _.removed_user_id === b.value && (te(), n.deleteConversation(_.conversation_id).catch(() => {
1317
1317
  }));
1318
1318
  }
1319
- function H(y) {
1319
+ function H(_) {
1320
1320
  const I = l.value;
1321
- C && (C(), C = null), I && (y && !n.hasGlobalConversationSubscription(I) && xi(I), n.unregisterDetailSubscription(I), l.value = null), o.value = !1;
1321
+ C && (C(), C = null), I && (_ && !n.hasGlobalConversationSubscription(I) && xi(I), n.unregisterDetailSubscription(I), l.value = null), o.value = !1;
1322
1322
  }
1323
1323
  function F() {
1324
- const y = T();
1325
- if (!(o.value || !y)) {
1326
- if (!Pe()) {
1324
+ const _ = T();
1325
+ if (!(o.value || !_)) {
1326
+ if (!Ae()) {
1327
1327
  f();
1328
1328
  return;
1329
1329
  }
1330
1330
  c.value = null;
1331
1331
  try {
1332
- C = Mi(y, {
1332
+ C = Mi(_, {
1333
1333
  onMessageSent: m,
1334
- onMessageRead: b,
1334
+ onMessageRead: v,
1335
1335
  onMessageEdited: N,
1336
1336
  onMessageDeleted: q,
1337
1337
  onReactionToggled: G,
1338
1338
  onRequestAccepted: k,
1339
1339
  onParticipantRemoved: O
1340
- }), o.value = !0, l.value = y, n.registerDetailSubscription(y), w();
1340
+ }), o.value = !0, l.value = _, n.registerDetailSubscription(_), w();
1341
1341
  } catch (I) {
1342
1342
  c.value = I instanceof Error ? I.message : "Failed to subscribe to conversation", console.error("ConversationChannel: Subscribe error", I);
1343
1343
  }
@@ -1347,26 +1347,26 @@ function Ya(e) {
1347
1347
  o.value || F();
1348
1348
  }
1349
1349
  typeof window < "u" && window.addEventListener(We(), J);
1350
- const me = ht((y) => {
1351
- if (y === "connected") {
1350
+ const me = ht((_) => {
1351
+ if (_ === "connected") {
1352
1352
  o.value || F();
1353
1353
  return;
1354
1354
  }
1355
- (y === "disconnected" || y === "error") && (w(), H(!1));
1355
+ (_ === "disconnected" || _ === "error") && (w(), H(!1));
1356
1356
  });
1357
1357
  function te() {
1358
1358
  if (w(), !(!o.value || !l.value))
1359
1359
  try {
1360
1360
  H(!0), c.value = null;
1361
- } catch (y) {
1362
- c.value = y instanceof Error ? y.message : "Failed to unsubscribe from conversation", console.error("ConversationChannel: Unsubscribe error", y);
1361
+ } catch (_) {
1362
+ c.value = _ instanceof Error ? _.message : "Failed to unsubscribe from conversation", console.error("ConversationChannel: Unsubscribe error", _);
1363
1363
  }
1364
1364
  }
1365
1365
  return Ot(
1366
1366
  () => T(),
1367
- (y, I) => {
1368
- if (y !== I) {
1369
- if (w(), o.value && H(!0), !y) {
1367
+ (_, I) => {
1368
+ if (_ !== I) {
1369
+ if (w(), o.value && H(!0), !_) {
1370
1370
  c.value = null;
1371
1371
  return;
1372
1372
  }
@@ -1382,14 +1382,14 @@ function Ya(e) {
1382
1382
  unsubscribe: te
1383
1383
  };
1384
1384
  }
1385
- const ls = () => () => {
1386
- }, ds = async () => {
1385
+ const ds = () => () => {
1386
+ }, hs = async () => {
1387
1387
  }, be = {
1388
1388
  initializedEvent: "messenger-client:main-echo-initialized",
1389
1389
  getEcho: () => null,
1390
1390
  getConnectionStatus: () => "disconnected",
1391
- onConnectionStatusChange: ls,
1392
- reconnect: ds
1391
+ onConnectionStatusChange: ds,
1392
+ reconnect: hs
1393
1393
  };
1394
1394
  function bo() {
1395
1395
  return be.initializedEvent;
@@ -1410,7 +1410,7 @@ function wo(e) {
1410
1410
  e.initializedEvent && (be.initializedEvent = e.initializedEvent), e.getEcho && (be.getEcho = e.getEcho), e.getConnectionStatus && (be.getConnectionStatus = e.getConnectionStatus), e.onConnectionStatusChange && (be.onConnectionStatusChange = e.onConnectionStatusChange), e.reconnect && (be.reconnect = e.reconnect);
1411
1411
  }
1412
1412
  function To() {
1413
- be.initializedEvent = "messenger-client:main-echo-initialized", be.getEcho = () => null, be.getConnectionStatus = () => "disconnected", be.onConnectionStatusChange = ls, be.reconnect = ds;
1413
+ be.initializedEvent = "messenger-client:main-echo-initialized", be.getEcho = () => null, be.getConnectionStatus = () => "disconnected", be.onConnectionStatusChange = ds, be.reconnect = hs;
1414
1414
  }
1415
1415
  const Eo = {
1416
1416
  debug: () => {
@@ -1421,8 +1421,8 @@ const Eo = {
1421
1421
  },
1422
1422
  error: () => {
1423
1423
  }
1424
- }, hs = () => Eo;
1425
- let Jt = hs;
1424
+ }, fs = () => Eo;
1425
+ let Jt = fs;
1426
1426
  function Kt() {
1427
1427
  return Jt;
1428
1428
  }
@@ -1430,7 +1430,7 @@ function Ao(e) {
1430
1430
  Jt = e;
1431
1431
  }
1432
1432
  function Ro() {
1433
- Jt = hs;
1433
+ Jt = fs;
1434
1434
  }
1435
1435
  const Po = {
1436
1436
  connected: "",
@@ -1445,10 +1445,10 @@ function zn(e) {
1445
1445
  function Mo(e) {
1446
1446
  return e === "messenger" ? {
1447
1447
  initializedEvent: We(),
1448
- getConnectionStatus: ss,
1448
+ getConnectionStatus: rs,
1449
1449
  onConnectionStatusChange: ht,
1450
1450
  reconnect: Ai,
1451
- getEchoConnection: () => zn(Pe())
1451
+ getEchoConnection: () => zn(Ae())
1452
1452
  } : {
1453
1453
  initializedEvent: bo(),
1454
1454
  getConnectionStatus: _o,
@@ -1464,8 +1464,8 @@ function Za(e = {}) {
1464
1464
  const o = Mo(e.source ?? "app"), c = {
1465
1465
  ...Po,
1466
1466
  ...e.icons
1467
- }, l = ve(o.getConnectionStatus()), d = ve(null), g = ve(0), h = ve(!1), x = ve(!1), M = ve(!1), _ = ve(!1);
1468
- let C = null, v = null, T = null, w = null, f = null, m = null, b = null;
1467
+ }, l = ve(o.getConnectionStatus()), d = ve(null), g = ve(0), h = ve(!1), x = ve(!1), M = ve(!1), y = ve(!1);
1468
+ let C = null, b = null, T = null, w = null, f = null, m = null, v = null;
1469
1469
  const N = ie(() => l.value === "connected"), q = ie(() => l.value === "connecting"), G = ie(() => l.value === "disconnected"), k = ie(() => l.value === "error"), O = ie(() => G.value || k.value), H = ie(() => {
1470
1470
  switch (l.value) {
1471
1471
  case "connecting":
@@ -1507,8 +1507,8 @@ function Za(e = {}) {
1507
1507
  }), me = async () => {
1508
1508
  qn.debug("Manual reconnect triggered"), g.value += 1, await o.reconnect();
1509
1509
  }, te = (E, V = l.value) => {
1510
- if (E !== "connecting" && v && (clearTimeout(v), v = null), E === "disconnected" || E === "error") {
1511
- const ne = !_.value && V === E, _e = !x.value && (ne || V === "connected" || V === "connecting");
1510
+ if (E !== "connecting" && b && (clearTimeout(b), b = null), E === "disconnected" || E === "error") {
1511
+ const ne = !y.value && V === E, _e = !x.value && (ne || V === "connected" || V === "connecting");
1512
1512
  if (M.value = !0, _e) {
1513
1513
  h.value = !1, T && clearTimeout(T), T = setTimeout(() => {
1514
1514
  T = null, l.value !== "connected" && (h.value = !0);
@@ -1527,19 +1527,19 @@ function Za(e = {}) {
1527
1527
  h.value = !0;
1528
1528
  return;
1529
1529
  }
1530
- if (M.value || (h.value = !1), v)
1530
+ if (M.value || (h.value = !1), b)
1531
1531
  return;
1532
- v = setTimeout(() => {
1533
- if (v = null, l.value === "connecting") {
1532
+ b = setTimeout(() => {
1533
+ if (b = null, l.value === "connecting") {
1534
1534
  if (jn(o) === "connected") {
1535
- y("connected");
1535
+ _("connected");
1536
1536
  return;
1537
1537
  }
1538
- x.value = !0, qn.warn("Still connecting after 10s, treating as disconnected"), y("disconnected"), g.value += 1, o.reconnect();
1538
+ x.value = !0, qn.warn("Still connecting after 10s, treating as disconnected"), _("disconnected"), g.value += 1, o.reconnect();
1539
1539
  }
1540
1540
  }, 1e4);
1541
1541
  }
1542
- }, y = (E) => {
1542
+ }, _ = (E) => {
1543
1543
  const V = l.value;
1544
1544
  if (E === "connecting" && x.value) {
1545
1545
  l.value = "disconnected", te("disconnected", V);
@@ -1549,51 +1549,51 @@ function Za(e = {}) {
1549
1549
  }, I = () => {
1550
1550
  const E = jn(o), V = l.value;
1551
1551
  if (E === "connected" && V !== "connected") {
1552
- y("connected");
1552
+ _("connected");
1553
1553
  return;
1554
1554
  }
1555
1555
  if (E === "connecting" && V !== "connecting") {
1556
- y("connecting");
1556
+ _("connecting");
1557
1557
  return;
1558
1558
  }
1559
1559
  if ((E === "unavailable" || E === "failed" || E === "disconnected") && V !== "disconnected") {
1560
- y("disconnected");
1560
+ _("disconnected");
1561
1561
  return;
1562
1562
  }
1563
1563
  const ne = o.getConnectionStatus();
1564
- !E && ne === "connected" && V !== "connected" && y("connected");
1564
+ !E && ne === "connected" && V !== "connected" && _("connected");
1565
1565
  }, ae = () => {
1566
- if (f?.unbind && b && (f.unbind("connected", b.connected), f.unbind("connecting", b.connecting), f.unbind("disconnected", b.disconnected), f.unbind("unavailable", b.unavailable), f.unbind("error", b.error), f.unbind("state_change", b.stateChange)), f = o.getEchoConnection(), b = null, !f?.bind)
1566
+ if (f?.unbind && v && (f.unbind("connected", v.connected), f.unbind("connecting", v.connecting), f.unbind("disconnected", v.disconnected), f.unbind("unavailable", v.unavailable), f.unbind("error", v.error), f.unbind("state_change", v.stateChange)), f = o.getEchoConnection(), v = null, !f?.bind)
1567
1567
  return;
1568
- b = {
1569
- connected: () => y("connected"),
1570
- connecting: () => y("connecting"),
1571
- disconnected: () => y("disconnected"),
1572
- unavailable: () => y("disconnected"),
1573
- error: () => y("error"),
1568
+ v = {
1569
+ connected: () => _("connected"),
1570
+ connecting: () => _("connecting"),
1571
+ disconnected: () => _("disconnected"),
1572
+ unavailable: () => _("disconnected"),
1573
+ error: () => _("error"),
1574
1574
  stateChange: (V) => {
1575
1575
  const ne = V?.current;
1576
1576
  if (ne === "connected") {
1577
- y("connected");
1577
+ _("connected");
1578
1578
  return;
1579
1579
  }
1580
1580
  if (ne === "connecting") {
1581
- y("connecting");
1581
+ _("connecting");
1582
1582
  return;
1583
1583
  }
1584
- (ne === "unavailable" || ne === "failed" || ne === "disconnected") && y("disconnected");
1584
+ (ne === "unavailable" || ne === "failed" || ne === "disconnected") && _("disconnected");
1585
1585
  }
1586
- }, f.bind("connected", b.connected), f.bind("connecting", b.connecting), f.bind("disconnected", b.disconnected), f.bind("unavailable", b.unavailable), f.bind("error", b.error), f.bind("state_change", b.stateChange);
1586
+ }, f.bind("connected", v.connected), f.bind("connecting", v.connecting), f.bind("disconnected", v.disconnected), f.bind("unavailable", v.unavailable), f.bind("error", v.error), f.bind("state_change", v.stateChange);
1587
1587
  const E = f.state ?? null;
1588
1588
  if (E === "connected") {
1589
- y("connected");
1589
+ _("connected");
1590
1590
  return;
1591
1591
  }
1592
1592
  if (E === "connecting") {
1593
- y("connecting");
1593
+ _("connecting");
1594
1594
  return;
1595
1595
  }
1596
- (E === "unavailable" || E === "failed" || E === "disconnected") && y("disconnected");
1596
+ (E === "unavailable" || E === "failed" || E === "disconnected") && _("disconnected");
1597
1597
  }, B = ie(() => {
1598
1598
  if (!d.value || !N.value)
1599
1599
  return null;
@@ -1601,13 +1601,13 @@ function Za(e = {}) {
1601
1601
  return V > 0 ? `${V}m ${ne}s` : `${ne}s`;
1602
1602
  });
1603
1603
  return jt(() => {
1604
- l.value = o.getConnectionStatus(), C = o.onConnectionStatusChange(y), N.value && (d.value = /* @__PURE__ */ new Date()), te(l.value, l.value), _.value = !0, ae(), m = () => {
1604
+ l.value = o.getConnectionStatus(), C = o.onConnectionStatusChange(_), N.value && (d.value = /* @__PURE__ */ new Date()), te(l.value, l.value), y.value = !0, ae(), m = () => {
1605
1605
  ae(), I();
1606
1606
  }, window.addEventListener(o.initializedEvent, m), I(), w = setInterval(() => {
1607
1607
  I();
1608
1608
  }, 3e3);
1609
1609
  }), De(() => {
1610
- C?.(), v && (clearTimeout(v), v = null), T && (clearTimeout(T), T = null), w && (clearInterval(w), w = null), m && (window.removeEventListener(o.initializedEvent, m), m = null), f?.unbind && b && (f.unbind("connected", b.connected), f.unbind("connecting", b.connecting), f.unbind("disconnected", b.disconnected), f.unbind("unavailable", b.unavailable), f.unbind("error", b.error), f.unbind("state_change", b.stateChange)), f = null, b = null;
1610
+ C?.(), b && (clearTimeout(b), b = null), T && (clearTimeout(T), T = null), w && (clearInterval(w), w = null), m && (window.removeEventListener(o.initializedEvent, m), m = null), f?.unbind && v && (f.unbind("connected", v.connected), f.unbind("connecting", v.connecting), f.unbind("disconnected", v.disconnected), f.unbind("unavailable", v.unavailable), f.unbind("error", v.error), f.unbind("state_change", v.stateChange)), f = null, v = null;
1611
1611
  }), {
1612
1612
  connectionStatus: ie(() => l.value),
1613
1613
  isConnected: N,
@@ -1625,16 +1625,16 @@ function Za(e = {}) {
1625
1625
  reconnect: me
1626
1626
  };
1627
1627
  }
1628
- const fs = $t;
1629
- let Qt = fs;
1630
- function ps() {
1628
+ const ps = $t;
1629
+ let Qt = ps;
1630
+ function gs() {
1631
1631
  return Qt;
1632
1632
  }
1633
1633
  function xo(e) {
1634
1634
  Qt = e;
1635
1635
  }
1636
1636
  function ko() {
1637
- Qt = fs;
1637
+ Qt = ps;
1638
1638
  }
1639
1639
  const Lo = 6e4;
1640
1640
  function Io(e) {
@@ -1646,14 +1646,14 @@ function Uo(e) {
1646
1646
  const n = e.trim().toLowerCase();
1647
1647
  return Io(n) ? n : null;
1648
1648
  }
1649
- function gs(e) {
1649
+ function ms(e) {
1650
1650
  if (typeof e != "string")
1651
1651
  return null;
1652
1652
  const n = e.trim();
1653
1653
  return n.length > 0 ? n : null;
1654
1654
  }
1655
1655
  function qt(e) {
1656
- const n = gs(e);
1656
+ const n = ms(e);
1657
1657
  if (n === null)
1658
1658
  return null;
1659
1659
  const i = n.includes("T") ? n : n.replace(" ", "T"), o = /(?:Z|[+-]\d{2}:\d{2})$/i.test(i) ? i : `${i}Z`, c = new Date(o);
@@ -1671,15 +1671,15 @@ function Oo(e, n, i = {}) {
1671
1671
  return c - o.getTime() > l ? "offline" : e;
1672
1672
  }
1673
1673
  function $n(e, n = {}) {
1674
- const i = gs(e?.last_seen_at), o = Uo(e?.status);
1674
+ const i = ms(e?.last_seen_at), o = Uo(e?.status);
1675
1675
  return {
1676
1676
  status: Oo(o, i, n),
1677
1677
  lastSeenAt: i
1678
1678
  };
1679
1679
  }
1680
- const ms = () => {
1680
+ const vs = () => {
1681
1681
  };
1682
- let Yt = ms;
1682
+ let Yt = vs;
1683
1683
  function Fo() {
1684
1684
  return Yt;
1685
1685
  }
@@ -1687,11 +1687,11 @@ function No(e) {
1687
1687
  Yt = e;
1688
1688
  }
1689
1689
  function Do() {
1690
- Yt = ms;
1690
+ Yt = vs;
1691
1691
  }
1692
- const Ue = Kt()("GlobalMessaging"), qo = 3, zo = (e) => e.replace(/\/+$/, ""), jo = (e) => zo(window.location.pathname) === `/messages/${e}`, $o = (e) => e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
1692
+ const Me = Kt()("GlobalMessaging"), qo = 3, zo = (e) => e.replace(/\/+$/, ""), jo = (e) => zo(window.location.pathname) === `/messages/${e}`, $o = (e) => e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
1693
1693
  function ec() {
1694
- const e = Gt(), n = Fe()(), i = Fo(), o = ps(), c = wi(), l = zt(), { conversations: d } = Si(e), g = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map();
1694
+ const e = Gt(), n = Fe()(), i = Fo(), o = gs(), c = Ti(), l = zt(), { conversations: d } = Ci(e), g = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map();
1695
1695
  let x = !1;
1696
1696
  function M(k) {
1697
1697
  const O = h.get(k);
@@ -1702,19 +1702,19 @@ function ec() {
1702
1702
  } catch {
1703
1703
  }
1704
1704
  }
1705
- function _() {
1705
+ function y() {
1706
1706
  for (const k of g)
1707
1707
  M(k), e.unregisterGlobalConversationSubscription(k);
1708
1708
  g.clear();
1709
1709
  }
1710
1710
  function C(k) {
1711
- const O = Pe();
1711
+ const O = Ae();
1712
1712
  if (!O || g.has(k)) return;
1713
1713
  const H = `conversation.${k}`;
1714
1714
  M(k);
1715
1715
  const F = O.private(H), J = (B) => {
1716
1716
  if (!Oi(B)) {
1717
- Ue.warn("Dropping malformed ConversationMessageSent event", B);
1717
+ Me.warn("Dropping malformed ConversationMessageSent event", B);
1718
1718
  return;
1719
1719
  }
1720
1720
  const E = B, V = n.currentUser?.id;
@@ -1734,20 +1734,20 @@ function ec() {
1734
1734
  }
1735
1735
  }, me = (B) => {
1736
1736
  if (!Fi(B)) {
1737
- Ue.warn("Dropping malformed ConversationMessageRead event", B);
1737
+ Me.warn("Dropping malformed ConversationMessageRead event", B);
1738
1738
  return;
1739
1739
  }
1740
1740
  e.applyParticipantReadState(B);
1741
1741
  }, te = (B) => {
1742
1742
  if (!qi(B)) {
1743
- Ue.warn("Dropping malformed MessageReactionToggled event", B);
1743
+ Me.warn("Dropping malformed MessageReactionToggled event", B);
1744
1744
  return;
1745
1745
  }
1746
1746
  const E = B;
1747
1747
  e.updateMessageReactions(E.conversation_id, E.message_id, E.reactions);
1748
- }, y = (B) => {
1748
+ }, _ = (B) => {
1749
1749
  if (!Ni(B)) {
1750
- Ue.warn("Dropping malformed ConversationMessageEdited event", B);
1750
+ Me.warn("Dropping malformed ConversationMessageEdited event", B);
1751
1751
  return;
1752
1752
  }
1753
1753
  const E = B, V = e.getMessagesByConversationId(E.conversation_id), ne = V.findIndex((A) => A.id === E.message.id);
@@ -1765,14 +1765,14 @@ function ec() {
1765
1765
  });
1766
1766
  }, I = (B) => {
1767
1767
  if (!Di(B)) {
1768
- Ue.warn("Dropping malformed ConversationMessageDeleted event", B);
1768
+ Me.warn("Dropping malformed ConversationMessageDeleted event", B);
1769
1769
  return;
1770
1770
  }
1771
1771
  const E = B;
1772
1772
  e.removeMessage(E.conversation_id, E.message_id);
1773
1773
  }, ae = (B) => {
1774
1774
  if (!zi(B)) {
1775
- Ue.warn("Dropping malformed ConversationRequestAccepted event", B);
1775
+ Me.warn("Dropping malformed ConversationRequestAccepted event", B);
1776
1776
  return;
1777
1777
  }
1778
1778
  const E = B, V = e.getConversationById(E.conversation_id);
@@ -1780,22 +1780,22 @@ function ec() {
1780
1780
  (ne) => ne.id !== E.conversation_id
1781
1781
  );
1782
1782
  };
1783
- F.listen(".ConversationMessageSent", J), F.listen(".ConversationMessageRead", me), F.listen(".ConversationMessageEdited", y), F.listen(".ConversationMessageDeleted", I), F.listen(".MessageReactionToggled", te), F.listen(".ConversationRequestAccepted", ae), h.set(k, {
1783
+ F.listen(".ConversationMessageSent", J), F.listen(".ConversationMessageRead", me), F.listen(".ConversationMessageEdited", _), F.listen(".ConversationMessageDeleted", I), F.listen(".MessageReactionToggled", te), F.listen(".ConversationRequestAccepted", ae), h.set(k, {
1784
1784
  channel: F,
1785
1785
  bindings: [
1786
1786
  { event: ".ConversationMessageSent", handler: J },
1787
1787
  { event: ".ConversationMessageRead", handler: me },
1788
- { event: ".ConversationMessageEdited", handler: y },
1788
+ { event: ".ConversationMessageEdited", handler: _ },
1789
1789
  { event: ".ConversationMessageDeleted", handler: I },
1790
1790
  { event: ".MessageReactionToggled", handler: te },
1791
1791
  { event: ".ConversationRequestAccepted", handler: ae }
1792
1792
  ]
1793
1793
  }), g.add(k), e.registerGlobalConversationSubscription(k);
1794
1794
  }
1795
- function v() {
1796
- const k = Pe();
1795
+ function b() {
1796
+ const k = Ae();
1797
1797
  if (!k) {
1798
- _();
1798
+ y();
1799
1799
  return;
1800
1800
  }
1801
1801
  for (const O of g) {
@@ -1809,7 +1809,7 @@ function ec() {
1809
1809
  g.clear();
1810
1810
  }
1811
1811
  function T() {
1812
- const k = Pe();
1812
+ const k = Ae();
1813
1813
  if (!k) return;
1814
1814
  const O = e.conversations.slice(0, qo), H = new Set(O.map((F) => F.id));
1815
1815
  for (const F of g)
@@ -1848,13 +1848,13 @@ function ec() {
1848
1848
  J.status !== null && e.updatePresenceForUser(F.id, J.status, J.lastSeenAt);
1849
1849
  }
1850
1850
  } catch (O) {
1851
- Ue.warn("Failed to refresh messaging presence snapshot", O);
1851
+ Me.warn("Failed to refresh messaging presence snapshot", O);
1852
1852
  }
1853
1853
  }
1854
1854
  function m() {
1855
- !Pe() || x || (Ri(w), x = !0);
1855
+ !Ae() || x || (Ri(w), x = !0);
1856
1856
  }
1857
- function b() {
1857
+ function v() {
1858
1858
  x && (Pi(), x = !1);
1859
1859
  }
1860
1860
  const N = Ot(
@@ -1869,10 +1869,14 @@ function ec() {
1869
1869
  T();
1870
1870
  }
1871
1871
  ), G = ht((k) => {
1872
- k === "connected" ? (_(), T(), b(), m(), f()) : (k === "disconnected" || k === "error") && (_(), b());
1872
+ k === "connected" ? (y(), T(), v(), m(), f()) : (k === "disconnected" || k === "error") && (y(), v());
1873
1873
  });
1874
- T(), m(), f(), l !== null && De(() => {
1875
- N(), q(), G(), v(), b();
1874
+ T(), m(), f(), Ae() || ss().then((k) => {
1875
+ k && (y(), T(), v(), m(), f());
1876
+ }).catch((k) => {
1877
+ Me.warn("Failed to eagerly initialize messenger echo", k);
1878
+ }), l !== null && De(() => {
1879
+ N(), q(), G(), b(), v();
1876
1880
  });
1877
1881
  }
1878
1882
  function tc() {
@@ -1890,7 +1894,7 @@ function tc() {
1890
1894
  isSuspended: ie(() => e.value === "account_suspended")
1891
1895
  };
1892
1896
  }
1893
- const vs = () => null, bs = {
1897
+ const bs = () => null, ys = {
1894
1898
  sessionOpenUrl: "/v1/presence/session/open",
1895
1899
  sessionHeartbeatUrl: "/v1/presence/heartbeat",
1896
1900
  sessionCloseUrl: "/v1/presence/session/close",
@@ -1901,9 +1905,9 @@ const vs = () => null, bs = {
1901
1905
  activityDebounceMs: 5e3,
1902
1906
  heartbeatIntervalMs: 3e4,
1903
1907
  userAgentResolver: () => navigator.userAgent.slice(0, 256),
1904
- authTokenResolver: vs
1908
+ authTokenResolver: bs
1905
1909
  };
1906
- let lt = { ...bs };
1910
+ let lt = { ...ys };
1907
1911
  function Ho() {
1908
1912
  return lt;
1909
1913
  }
@@ -1914,16 +1918,16 @@ function Bo(e) {
1914
1918
  };
1915
1919
  }
1916
1920
  function Vo() {
1917
- lt = { ...bs };
1921
+ lt = { ...ys };
1918
1922
  }
1919
1923
  function Xo(e) {
1920
- return e.authTokenResolver !== vs;
1924
+ return e.authTokenResolver !== bs;
1921
1925
  }
1922
1926
  const Wo = 429, Go = 403, Jo = 423, Ko = "ACCOUNT_LIMITED", Qo = "ACCOUNT_SUSPENDED", Yo = "ACCOUNT_WRITE_TIMEOUT", Zo = 2, ea = 5 * 6e4;
1923
1927
  function Xe(e) {
1924
1928
  return typeof e == "object" && e !== null;
1925
1929
  }
1926
- function ys(e) {
1930
+ function _s(e) {
1927
1931
  if (!Xe(e))
1928
1932
  return null;
1929
1933
  const n = e.response;
@@ -1938,7 +1942,7 @@ function ys(e) {
1938
1942
  }
1939
1943
  return null;
1940
1944
  }
1941
- function _s(e) {
1945
+ function Ss(e) {
1942
1946
  if (!Xe(e))
1943
1947
  return null;
1944
1948
  const n = e.response;
@@ -1948,11 +1952,11 @@ function _s(e) {
1948
1952
  return Xe(i) && typeof i.code == "string" ? i.code : null;
1949
1953
  }
1950
1954
  function kt(e) {
1951
- const n = ys(e), i = _s(e);
1955
+ const n = _s(e), i = Ss(e);
1952
1956
  return n === Wo && i === Ko || n === Jo && i === Yo;
1953
1957
  }
1954
1958
  function Lt(e) {
1955
- const n = ys(e), i = _s(e);
1959
+ const n = _s(e), i = Ss(e);
1956
1960
  return n === Go && i === Qo ? !0 : e instanceof Error ? e.message.toLowerCase().includes("suspended") : !1;
1957
1961
  }
1958
1962
  function Ge() {
@@ -2007,18 +2011,18 @@ function oa(e, n, i) {
2007
2011
  }
2008
2012
  }
2009
2013
  function nc() {
2010
- const e = Fe()(), n = Ho(), i = ps(), o = ta(n.clientIdStorageKey);
2011
- let c = null, l = null, d = !1, g = It(n.accountLimitedUntilStorageKey), h = !1, x = !1, M = null, _ = 0;
2012
- const C = () => Xo(n) ? n.authTokenResolver() !== null : !0, v = () => {
2014
+ const e = Fe()(), n = Ho(), i = gs(), o = ta(n.clientIdStorageKey);
2015
+ let c = null, l = null, d = !1, g = It(n.accountLimitedUntilStorageKey), h = !1, x = !1, M = null, y = 0;
2016
+ const C = () => Xo(n) ? n.authTokenResolver() !== null : !0, b = () => {
2013
2017
  c && (clearInterval(c), c = null);
2014
2018
  }, T = () => {
2015
2019
  l && (clearTimeout(l), l = null);
2016
2020
  }, w = () => {
2017
- v(), c = setInterval(() => {
2021
+ b(), c = setInterval(() => {
2018
2022
  F();
2019
2023
  }, n.heartbeatIntervalMs);
2020
2024
  }, f = (I) => {
2021
- g || console.warn(I), sa(n.accountLimitedUntilStorageKey), g = !0, d = !1, M = null, v(), T();
2025
+ g || console.warn(I), sa(n.accountLimitedUntilStorageKey), g = !0, d = !1, M = null, b(), T();
2022
2026
  }, m = async (I) => {
2023
2027
  if (!(!d || x || g || h) && C() && M !== I)
2024
2028
  try {
@@ -2028,9 +2032,9 @@ function nc() {
2028
2032
  f("[Presence] Presence updates paused: account is temporarily limited");
2029
2033
  return;
2030
2034
  }
2031
- Lt(ae) && (h = !0, d = !1, M = null, v(), T());
2035
+ Lt(ae) && (h = !0, d = !1, M = null, b(), T());
2032
2036
  }
2033
- }, b = () => {
2037
+ }, v = () => {
2034
2038
  T(), !(!d || x || g || h || document.visibilityState !== "visible") && (l = setTimeout(() => {
2035
2039
  l = null, m("idle");
2036
2040
  }, n.idleAfterMs));
@@ -2038,7 +2042,7 @@ function nc() {
2038
2042
  if (x || !d || g || h || document.visibilityState !== "visible")
2039
2043
  return;
2040
2044
  const I = Date.now();
2041
- I - _ < n.activityDebounceMs || (_ = I, m("online"), b());
2045
+ I - y < n.activityDebounceMs || (y = I, m("online"), v());
2042
2046
  }, q = () => {
2043
2047
  N();
2044
2048
  }, G = () => {
@@ -2054,7 +2058,7 @@ function nc() {
2054
2058
  user_agent: n.userAgentResolver()
2055
2059
  }), ra(n.accountLimitedUntilStorageKey), g = !1, h = !1, d = !0, M = null, "opened";
2056
2060
  } catch (I) {
2057
- return kt(I) ? (f("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Lt(I) ? (h = !0, d = !1, M = null, v(), T(), "account_suspended") : "failed";
2061
+ return kt(I) ? (f("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Lt(I) ? (h = !0, d = !1, M = null, b(), T(), "account_suspended") : "failed";
2058
2062
  }
2059
2063
  }, H = async () => {
2060
2064
  for (let I = 0; I < Zo; I += 1)
@@ -2070,7 +2074,7 @@ function nc() {
2070
2074
  f("[Presence] Heartbeat paused: account is temporarily limited");
2071
2075
  return;
2072
2076
  }
2073
- Lt(I) && (h = !0, d = !1, M = null, v(), T());
2077
+ Lt(I) && (h = !0, d = !1, M = null, b(), T());
2074
2078
  }
2075
2079
  }, J = () => {
2076
2080
  if (!d)
@@ -2094,12 +2098,12 @@ function nc() {
2094
2098
  J();
2095
2099
  return;
2096
2100
  }
2097
- d && (w(), m("online"), b());
2101
+ d && (w(), m("online"), v());
2098
2102
  }
2099
2103
  }, te = () => {
2100
2104
  if (!x) {
2101
2105
  if (document.visibilityState === "hidden") {
2102
- J(), v(), T();
2106
+ J(), b(), T();
2103
2107
  return;
2104
2108
  }
2105
2109
  if (document.visibilityState === "visible" && !d) {
@@ -2108,8 +2112,8 @@ function nc() {
2108
2112
  }
2109
2113
  document.visibilityState === "visible" && d && !g && !h && N();
2110
2114
  }
2111
- }, y = () => {
2112
- x || (J(), v(), T());
2115
+ }, _ = () => {
2116
+ x || (J(), b(), T());
2113
2117
  };
2114
2118
  jt(async () => {
2115
2119
  if (e.isAuthenticated ?? e.currentUser !== null) {
@@ -2117,17 +2121,17 @@ function nc() {
2117
2121
  J();
2118
2122
  return;
2119
2123
  }
2120
- d && (w(), m("online"), b()), G(), document.addEventListener("visibilitychange", te), window.addEventListener("pagehide", y), window.addEventListener("beforeunload", y);
2124
+ d && (w(), m("online"), v()), G(), document.addEventListener("visibilitychange", te), window.addEventListener("pagehide", _), window.addEventListener("beforeunload", _);
2121
2125
  }
2122
2126
  }), De(() => {
2123
- x = !0, k(), T(), v(), J(), document.removeEventListener("visibilitychange", te), window.removeEventListener("pagehide", y), window.removeEventListener("beforeunload", y);
2127
+ x = !0, k(), T(), b(), J(), document.removeEventListener("visibilitychange", te), window.removeEventListener("pagehide", _), window.removeEventListener("beforeunload", _);
2124
2128
  });
2125
2129
  }
2126
2130
  const aa = 12e3;
2127
2131
  function sc(e) {
2128
- const n = Gt(), i = Fe()(), o = ve(!1), c = ve(null), l = ve(null), d = ve([]), g = /* @__PURE__ */ new Map(), h = zt(), x = h !== null, M = 20, _ = 250;
2129
- let C = !1, v = null, T = 0, w = null;
2130
- const f = ie(() => i.currentUser?.id), m = () => Xn(e)?.trim() ?? "", b = () => {
2132
+ const n = Gt(), i = Fe()(), o = ve(!1), c = ve(null), l = ve(null), d = ve([]), g = /* @__PURE__ */ new Map(), h = zt(), x = h !== null, M = 20, y = 250;
2133
+ let C = !1, b = null, T = 0, w = null;
2134
+ const f = ie(() => i.currentUser?.id), m = () => Xn(e)?.trim() ?? "", v = () => {
2131
2135
  const A = l.value?.trim() ?? "";
2132
2136
  if (A.length > 0)
2133
2137
  return A;
@@ -2150,7 +2154,7 @@ function sc(e) {
2150
2154
  }, H = () => {
2151
2155
  !x || o.value || w || T >= M || (w = setTimeout(() => {
2152
2156
  w = null, T += 1, te();
2153
- }, _));
2157
+ }, y));
2154
2158
  }, F = (A, U) => {
2155
2159
  G(A);
2156
2160
  const re = setTimeout(() => {
@@ -2161,7 +2165,7 @@ function sc(e) {
2161
2165
  C = !0, O();
2162
2166
  }, me = (A) => {
2163
2167
  try {
2164
- v && (v(), v = null), v = ki(A, {
2168
+ b && (b(), b = null), b = ki(A, {
2165
2169
  onTypingStart: I,
2166
2170
  onTypingStop: ae
2167
2171
  }), O(), o.value = !0, l.value = A;
@@ -2171,26 +2175,26 @@ function sc(e) {
2171
2175
  }, te = () => {
2172
2176
  const A = m();
2173
2177
  if (!(o.value || !A)) {
2174
- if (c.value = null, Pe() && Tn() === "connected") {
2178
+ if (c.value = null, Ae() && Tn() === "connected") {
2175
2179
  me(A);
2176
2180
  return;
2177
2181
  }
2178
- C = !1, Ti().then((U) => {
2182
+ C = !1, ss().then((U) => {
2179
2183
  if (C || o.value || !U)
2180
2184
  return;
2181
2185
  const re = m();
2182
- if (re && re === A && Pe() && Tn() === "connected") {
2186
+ if (re && re === A && Ae() && Tn() === "connected") {
2183
2187
  me(re);
2184
2188
  return;
2185
2189
  }
2186
2190
  H();
2187
2191
  }), H();
2188
2192
  }
2189
- }, y = () => {
2193
+ }, _ = () => {
2190
2194
  const A = l.value;
2191
2195
  if (J(), !(!o.value || !A))
2192
2196
  try {
2193
- v && (v(), v = null), Li(A), k(), q(A), o.value = !1, l.value = null, c.value = null;
2197
+ b && (b(), b = null), Li(A), k(), q(A), o.value = !1, l.value = null, c.value = null;
2194
2198
  } catch (U) {
2195
2199
  c.value = U instanceof Error ? U.message : "Failed to unsubscribe from typing channel";
2196
2200
  }
@@ -2198,7 +2202,7 @@ function sc(e) {
2198
2202
  function I(A) {
2199
2203
  if (A.user_id === f.value)
2200
2204
  return;
2201
- const U = b();
2205
+ const U = v();
2202
2206
  if (!U)
2203
2207
  return;
2204
2208
  const re = {
@@ -2212,11 +2216,11 @@ function sc(e) {
2212
2216
  if (A.user_id === f.value)
2213
2217
  return;
2214
2218
  G(A.user_id);
2215
- const U = b();
2219
+ const U = v();
2216
2220
  U && (d.value = d.value.filter((re) => re.id !== A.user_id), n.removeTypingUser(U, A.user_id));
2217
2221
  }
2218
2222
  const B = ie(() => {
2219
- const A = b();
2223
+ const A = v();
2220
2224
  if (!A)
2221
2225
  return d.value;
2222
2226
  const U = N(A);
@@ -2247,7 +2251,7 @@ function sc(e) {
2247
2251
  const fe = A[2];
2248
2252
  return fe ? A.length === 3 ? `${U.name}, ${re.name} and ${fe.name} are typing...` : `${A.length} people are typing...` : `${A.length} people are typing...`;
2249
2253
  }), V = ie(() => B.value.length > 0), ne = () => {
2250
- m() && (v && (v(), v = null), o.value = !1, l.value = null, te());
2254
+ m() && (b && (b(), b = null), o.value = !1, l.value = null, te());
2251
2255
  };
2252
2256
  typeof window < "u" && window.addEventListener(We(), ne);
2253
2257
  const _e = ht((A) => {
@@ -2256,13 +2260,13 @@ function sc(e) {
2256
2260
  return;
2257
2261
  }
2258
2262
  if (A === "disconnected" || A === "error") {
2259
- J(), v && (v(), v = null);
2260
- const U = b();
2263
+ J(), b && (b(), b = null);
2264
+ const U = v();
2261
2265
  U && q(U), o.value = !1, l.value = null, k();
2262
2266
  }
2263
2267
  });
2264
2268
  return h !== null && De(() => {
2265
- J(), _e(), k(), y(), typeof window < "u" && window.removeEventListener(We(), ne);
2269
+ J(), _e(), k(), _(), typeof window < "u" && window.removeEventListener(We(), ne);
2266
2270
  }), {
2267
2271
  isSubscribed: ie(() => o.value),
2268
2272
  error: ie(() => c.value),
@@ -2270,7 +2274,7 @@ function sc(e) {
2270
2274
  formatTypingIndicator: E,
2271
2275
  hasTypingUsers: V,
2272
2276
  subscribe: te,
2273
- unsubscribe: y
2277
+ unsubscribe: _
2274
2278
  };
2275
2279
  }
2276
2280
  function rc(e) {
@@ -2308,7 +2312,7 @@ class Zt {
2308
2312
  return this.stopListening(".client-" + n, i);
2309
2313
  }
2310
2314
  }
2311
- class Ss {
2315
+ class Cs {
2312
2316
  /**
2313
2317
  * Create a new class instance.
2314
2318
  */
@@ -2342,7 +2346,7 @@ class en extends Zt {
2342
2346
  * Create a new class instance.
2343
2347
  */
2344
2348
  constructor(n, i, o) {
2345
- super(), this.name = i, this.pusher = n, this.options = o, this.eventFormatter = new Ss(this.options.namespace), this.subscribe();
2349
+ super(), this.name = i, this.pusher = n, this.options = o, this.eventFormatter = new Cs(this.options.namespace), this.subscribe();
2346
2350
  }
2347
2351
  /**
2348
2352
  * Subscribe to a Pusher channel.
@@ -2414,7 +2418,7 @@ class en extends Zt {
2414
2418
  return this.subscription.bind(n, i), this;
2415
2419
  }
2416
2420
  }
2417
- class Cs extends en {
2421
+ class ws extends en {
2418
2422
  /**
2419
2423
  * Send a whisper event to other clients in the channel.
2420
2424
  */
@@ -2436,7 +2440,7 @@ class ua extends en {
2436
2440
  ), this;
2437
2441
  }
2438
2442
  }
2439
- class la extends Cs {
2443
+ class la extends ws {
2440
2444
  /**
2441
2445
  * Register a callback to be called anytime the member list changes.
2442
2446
  */
@@ -2471,12 +2475,12 @@ class la extends Cs {
2471
2475
  }), this;
2472
2476
  }
2473
2477
  }
2474
- class ws extends Zt {
2478
+ class Ts extends Zt {
2475
2479
  /**
2476
2480
  * Create a new class instance.
2477
2481
  */
2478
2482
  constructor(n, i, o) {
2479
- super(), this.events = {}, this.listeners = {}, this.name = i, this.socket = n, this.options = o, this.eventFormatter = new Ss(this.options.namespace), this.subscribe();
2483
+ super(), this.events = {}, this.listeners = {}, this.name = i, this.socket = n, this.options = o, this.eventFormatter = new Cs(this.options.namespace), this.subscribe();
2480
2484
  }
2481
2485
  /**
2482
2486
  * Subscribe to a Socket.io channel.
@@ -2547,7 +2551,7 @@ class ws extends Zt {
2547
2551
  )), (!i || this.listeners[n].length === 0) && (this.events[n] && (this.socket.removeListener(n, this.events[n]), delete this.events[n]), delete this.listeners[n]);
2548
2552
  }
2549
2553
  }
2550
- class Ts extends ws {
2554
+ class Es extends Ts {
2551
2555
  /**
2552
2556
  * Send a whisper event to other clients in the channel.
2553
2557
  */
@@ -2559,7 +2563,7 @@ class Ts extends ws {
2559
2563
  }), this;
2560
2564
  }
2561
2565
  }
2562
- class da extends Ts {
2566
+ class da extends Es {
2563
2567
  /**
2564
2568
  * Register a callback to be called anytime the member list changes.
2565
2569
  */
@@ -2645,7 +2649,7 @@ class dt extends Zt {
2645
2649
  return this;
2646
2650
  }
2647
2651
  }
2648
- class Es extends dt {
2652
+ class As extends dt {
2649
2653
  /**
2650
2654
  * Send a whisper event to other clients in the channel.
2651
2655
  */
@@ -2661,7 +2665,7 @@ class ha extends dt {
2661
2665
  return this;
2662
2666
  }
2663
2667
  }
2664
- class fa extends Es {
2668
+ class fa extends As {
2665
2669
  /**
2666
2670
  * Register a callback to be called anytime the member list changes.
2667
2671
  */
@@ -2687,7 +2691,7 @@ class fa extends Es {
2687
2691
  return this;
2688
2692
  }
2689
2693
  }
2690
- const As = class Rs {
2694
+ const Rs = class Ps {
2691
2695
  /**
2692
2696
  * Create a new class instance.
2693
2697
  */
@@ -2699,7 +2703,7 @@ const As = class Rs {
2699
2703
  */
2700
2704
  setOptions(n) {
2701
2705
  this.options = {
2702
- ...Rs._defaultOptions,
2706
+ ...Ps._defaultOptions,
2703
2707
  ...n,
2704
2708
  broadcaster: n.broadcaster
2705
2709
  };
@@ -2714,7 +2718,7 @@ const As = class Rs {
2714
2718
  return typeof window < "u" && (n = window.Laravel) != null && n.csrfToken ? window.Laravel.csrfToken : this.options.csrfToken ? this.options.csrfToken : typeof document < "u" && typeof document.querySelector == "function" ? ((i = document.querySelector('meta[name="csrf-token"]')) == null ? void 0 : i.getAttribute("content")) ?? null : null;
2715
2719
  }
2716
2720
  };
2717
- As._defaultOptions = {
2721
+ Rs._defaultOptions = {
2718
2722
  auth: {
2719
2723
  headers: {}
2720
2724
  },
@@ -2729,7 +2733,7 @@ As._defaultOptions = {
2729
2733
  key: null,
2730
2734
  namespace: "App.Events"
2731
2735
  };
2732
- let tn = As;
2736
+ let tn = Rs;
2733
2737
  class ot extends tn {
2734
2738
  constructor() {
2735
2739
  super(...arguments), this.channels = {};
@@ -2778,7 +2782,7 @@ class ot extends tn {
2778
2782
  * Get a private channel instance by name.
2779
2783
  */
2780
2784
  privateChannel(n) {
2781
- return this.channels["private-" + n] || (this.channels["private-" + n] = new Cs(
2785
+ return this.channels["private-" + n] || (this.channels["private-" + n] = new ws(
2782
2786
  this.pusher,
2783
2787
  "private-" + n,
2784
2788
  this.options
@@ -2907,7 +2911,7 @@ class pa extends tn {
2907
2911
  * Get a channel instance by name.
2908
2912
  */
2909
2913
  channel(n) {
2910
- return this.channels[n] || (this.channels[n] = new ws(
2914
+ return this.channels[n] || (this.channels[n] = new Ts(
2911
2915
  this.socket,
2912
2916
  n,
2913
2917
  this.options
@@ -2917,7 +2921,7 @@ class pa extends tn {
2917
2921
  * Get a private channel instance by name.
2918
2922
  */
2919
2923
  privateChannel(n) {
2920
- return this.channels["private-" + n] || (this.channels["private-" + n] = new Ts(
2924
+ return this.channels["private-" + n] || (this.channels["private-" + n] = new Es(
2921
2925
  this.socket,
2922
2926
  "private-" + n,
2923
2927
  this.options
@@ -3014,7 +3018,7 @@ class Hn extends tn {
3014
3018
  * Get a private channel instance by name.
3015
3019
  */
3016
3020
  privateChannel(n) {
3017
- return new Es();
3021
+ return new As();
3018
3022
  }
3019
3023
  /**
3020
3024
  * Get a private encrypted channel instance by name.
@@ -3282,18 +3286,18 @@ function va() {
3282
3286
  (function(i, o, c) {
3283
3287
  var l = this && this.__extends || /* @__PURE__ */ (function() {
3284
3288
  var w = function(f, m) {
3285
- return w = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(b, N) {
3286
- b.__proto__ = N;
3287
- } || function(b, N) {
3288
- for (var q in N) N.hasOwnProperty(q) && (b[q] = N[q]);
3289
+ return w = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(v, N) {
3290
+ v.__proto__ = N;
3291
+ } || function(v, N) {
3292
+ for (var q in N) N.hasOwnProperty(q) && (v[q] = N[q]);
3289
3293
  }, w(f, m);
3290
3294
  };
3291
3295
  return function(f, m) {
3292
3296
  w(f, m);
3293
- function b() {
3297
+ function v() {
3294
3298
  this.constructor = f;
3295
3299
  }
3296
- f.prototype = m === null ? Object.create(m) : (b.prototype = m.prototype, new b());
3300
+ f.prototype = m === null ? Object.create(m) : (v.prototype = m.prototype, new v());
3297
3301
  };
3298
3302
  })();
3299
3303
  Object.defineProperty(o, "__esModule", { value: !0 });
@@ -3306,13 +3310,13 @@ function va() {
3306
3310
  return w.prototype.encodedLength = function(f) {
3307
3311
  return this._paddingCharacter ? (f + 2) / 3 * 4 | 0 : (f * 8 + 5) / 6 | 0;
3308
3312
  }, w.prototype.encode = function(f) {
3309
- for (var m = "", b = 0; b < f.length - 2; b += 3) {
3310
- var N = f[b] << 16 | f[b + 1] << 8 | f[b + 2];
3313
+ for (var m = "", v = 0; v < f.length - 2; v += 3) {
3314
+ var N = f[v] << 16 | f[v + 1] << 8 | f[v + 2];
3311
3315
  m += this._encodeByte(N >>> 18 & 63), m += this._encodeByte(N >>> 12 & 63), m += this._encodeByte(N >>> 6 & 63), m += this._encodeByte(N >>> 0 & 63);
3312
3316
  }
3313
- var q = f.length - b;
3317
+ var q = f.length - v;
3314
3318
  if (q > 0) {
3315
- var N = f[b] << 16 | (q === 2 ? f[b + 1] << 8 : 0);
3319
+ var N = f[v] << 16 | (q === 2 ? f[v + 1] << 8 : 0);
3316
3320
  m += this._encodeByte(N >>> 18 & 63), m += this._encodeByte(N >>> 12 & 63), q === 2 ? m += this._encodeByte(N >>> 6 & 63) : m += this._paddingCharacter || "", m += this._paddingCharacter || "";
3317
3321
  }
3318
3322
  return m;
@@ -3323,9 +3327,9 @@ function va() {
3323
3327
  }, w.prototype.decode = function(f) {
3324
3328
  if (f.length === 0)
3325
3329
  return new Uint8Array(0);
3326
- for (var m = this._getPaddingLength(f), b = f.length - m, N = new Uint8Array(this.maxDecodedLength(b)), q = 0, G = 0, k = 0, O = 0, H = 0, F = 0, J = 0; G < b - 4; G += 4)
3330
+ for (var m = this._getPaddingLength(f), v = f.length - m, N = new Uint8Array(this.maxDecodedLength(v)), q = 0, G = 0, k = 0, O = 0, H = 0, F = 0, J = 0; G < v - 4; G += 4)
3327
3331
  O = this._decodeChar(f.charCodeAt(G + 0)), H = this._decodeChar(f.charCodeAt(G + 1)), F = this._decodeChar(f.charCodeAt(G + 2)), J = this._decodeChar(f.charCodeAt(G + 3)), N[q++] = O << 2 | H >>> 4, N[q++] = H << 4 | F >>> 2, N[q++] = F << 6 | J, k |= O & d, k |= H & d, k |= F & d, k |= J & d;
3328
- if (G < b - 1 && (O = this._decodeChar(f.charCodeAt(G)), H = this._decodeChar(f.charCodeAt(G + 1)), N[q++] = O << 2 | H >>> 4, k |= O & d, k |= H & d), G < b - 2 && (F = this._decodeChar(f.charCodeAt(G + 2)), N[q++] = H << 4 | F >>> 2, k |= F & d), G < b - 3 && (J = this._decodeChar(f.charCodeAt(G + 3)), N[q++] = F << 6 | J, k |= J & d), k !== 0)
3332
+ if (G < v - 1 && (O = this._decodeChar(f.charCodeAt(G)), H = this._decodeChar(f.charCodeAt(G + 1)), N[q++] = O << 2 | H >>> 4, k |= O & d, k |= H & d), G < v - 2 && (F = this._decodeChar(f.charCodeAt(G + 2)), N[q++] = H << 4 | F >>> 2, k |= F & d), G < v - 3 && (J = this._decodeChar(f.charCodeAt(G + 3)), N[q++] = F << 6 | J, k |= J & d), k !== 0)
3329
3333
  throw new Error("Base64Coder: incorrect characters for decoding");
3330
3334
  return N;
3331
3335
  }, w.prototype._encodeByte = function(f) {
@@ -3337,7 +3341,7 @@ function va() {
3337
3341
  }, w.prototype._getPaddingLength = function(f) {
3338
3342
  var m = 0;
3339
3343
  if (this._paddingCharacter) {
3340
- for (var b = f.length - 1; b >= 0 && f[b] === this._paddingCharacter; b--)
3344
+ for (var v = f.length - 1; v >= 0 && f[v] === this._paddingCharacter; v--)
3341
3345
  m++;
3342
3346
  if (f.length < 4 || m > 2)
3343
3347
  throw new Error("Base64Coder: incorrect padding");
@@ -3356,7 +3360,7 @@ function va() {
3356
3360
  return h.decode(w);
3357
3361
  }
3358
3362
  o.decode = M;
3359
- var _ = (
3363
+ var y = (
3360
3364
  /** @class */
3361
3365
  (function(w) {
3362
3366
  l(f, w);
@@ -3364,20 +3368,20 @@ function va() {
3364
3368
  return w !== null && w.apply(this, arguments) || this;
3365
3369
  }
3366
3370
  return f.prototype._encodeByte = function(m) {
3367
- var b = m;
3368
- return b += 65, b += 25 - m >>> 8 & 6, b += 51 - m >>> 8 & -75, b += 61 - m >>> 8 & -13, b += 62 - m >>> 8 & 49, String.fromCharCode(b);
3371
+ var v = m;
3372
+ return v += 65, v += 25 - m >>> 8 & 6, v += 51 - m >>> 8 & -75, v += 61 - m >>> 8 & -13, v += 62 - m >>> 8 & 49, String.fromCharCode(v);
3369
3373
  }, f.prototype._decodeChar = function(m) {
3370
- var b = d;
3371
- return b += (44 - m & m - 46) >>> 8 & -d + m - 45 + 62, b += (94 - m & m - 96) >>> 8 & -d + m - 95 + 63, b += (47 - m & m - 58) >>> 8 & -d + m - 48 + 52, b += (64 - m & m - 91) >>> 8 & -d + m - 65 + 0, b += (96 - m & m - 123) >>> 8 & -d + m - 97 + 26, b;
3374
+ var v = d;
3375
+ return v += (44 - m & m - 46) >>> 8 & -d + m - 45 + 62, v += (94 - m & m - 96) >>> 8 & -d + m - 95 + 63, v += (47 - m & m - 58) >>> 8 & -d + m - 48 + 52, v += (64 - m & m - 91) >>> 8 & -d + m - 65 + 0, v += (96 - m & m - 123) >>> 8 & -d + m - 97 + 26, v;
3372
3376
  }, f;
3373
3377
  })(g)
3374
3378
  );
3375
- o.URLSafeCoder = _;
3376
- var C = new _();
3377
- function v(w) {
3379
+ o.URLSafeCoder = y;
3380
+ var C = new y();
3381
+ function b(w) {
3378
3382
  return C.encode(w);
3379
3383
  }
3380
- o.encodeURLSafe = v;
3384
+ o.encodeURLSafe = b;
3381
3385
  function T(w) {
3382
3386
  return C.decode(w);
3383
3387
  }
@@ -3395,71 +3399,71 @@ function va() {
3395
3399
  Object.defineProperty(o, "__esModule", { value: !0 });
3396
3400
  var l = "utf8: invalid string", d = "utf8: invalid source encoding";
3397
3401
  function g(M) {
3398
- for (var _ = new Uint8Array(h(M)), C = 0, v = 0; v < M.length; v++) {
3399
- var T = M.charCodeAt(v);
3400
- T < 128 ? _[C++] = T : T < 2048 ? (_[C++] = 192 | T >> 6, _[C++] = 128 | T & 63) : T < 55296 ? (_[C++] = 224 | T >> 12, _[C++] = 128 | T >> 6 & 63, _[C++] = 128 | T & 63) : (v++, T = (T & 1023) << 10, T |= M.charCodeAt(v) & 1023, T += 65536, _[C++] = 240 | T >> 18, _[C++] = 128 | T >> 12 & 63, _[C++] = 128 | T >> 6 & 63, _[C++] = 128 | T & 63);
3402
+ for (var y = new Uint8Array(h(M)), C = 0, b = 0; b < M.length; b++) {
3403
+ var T = M.charCodeAt(b);
3404
+ T < 128 ? y[C++] = T : T < 2048 ? (y[C++] = 192 | T >> 6, y[C++] = 128 | T & 63) : T < 55296 ? (y[C++] = 224 | T >> 12, y[C++] = 128 | T >> 6 & 63, y[C++] = 128 | T & 63) : (b++, T = (T & 1023) << 10, T |= M.charCodeAt(b) & 1023, T += 65536, y[C++] = 240 | T >> 18, y[C++] = 128 | T >> 12 & 63, y[C++] = 128 | T >> 6 & 63, y[C++] = 128 | T & 63);
3401
3405
  }
3402
- return _;
3406
+ return y;
3403
3407
  }
3404
3408
  o.encode = g;
3405
3409
  function h(M) {
3406
- for (var _ = 0, C = 0; C < M.length; C++) {
3407
- var v = M.charCodeAt(C);
3408
- if (v < 128)
3409
- _ += 1;
3410
- else if (v < 2048)
3411
- _ += 2;
3412
- else if (v < 55296)
3413
- _ += 3;
3414
- else if (v <= 57343) {
3410
+ for (var y = 0, C = 0; C < M.length; C++) {
3411
+ var b = M.charCodeAt(C);
3412
+ if (b < 128)
3413
+ y += 1;
3414
+ else if (b < 2048)
3415
+ y += 2;
3416
+ else if (b < 55296)
3417
+ y += 3;
3418
+ else if (b <= 57343) {
3415
3419
  if (C >= M.length - 1)
3416
3420
  throw new Error(l);
3417
- C++, _ += 4;
3421
+ C++, y += 4;
3418
3422
  } else
3419
3423
  throw new Error(l);
3420
3424
  }
3421
- return _;
3425
+ return y;
3422
3426
  }
3423
3427
  o.encodedLength = h;
3424
3428
  function x(M) {
3425
- for (var _ = [], C = 0; C < M.length; C++) {
3426
- var v = M[C];
3427
- if (v & 128) {
3429
+ for (var y = [], C = 0; C < M.length; C++) {
3430
+ var b = M[C];
3431
+ if (b & 128) {
3428
3432
  var T = void 0;
3429
- if (v < 224) {
3433
+ if (b < 224) {
3430
3434
  if (C >= M.length)
3431
3435
  throw new Error(d);
3432
3436
  var w = M[++C];
3433
3437
  if ((w & 192) !== 128)
3434
3438
  throw new Error(d);
3435
- v = (v & 31) << 6 | w & 63, T = 128;
3436
- } else if (v < 240) {
3439
+ b = (b & 31) << 6 | w & 63, T = 128;
3440
+ } else if (b < 240) {
3437
3441
  if (C >= M.length - 1)
3438
3442
  throw new Error(d);
3439
3443
  var w = M[++C], f = M[++C];
3440
3444
  if ((w & 192) !== 128 || (f & 192) !== 128)
3441
3445
  throw new Error(d);
3442
- v = (v & 15) << 12 | (w & 63) << 6 | f & 63, T = 2048;
3443
- } else if (v < 248) {
3446
+ b = (b & 15) << 12 | (w & 63) << 6 | f & 63, T = 2048;
3447
+ } else if (b < 248) {
3444
3448
  if (C >= M.length - 2)
3445
3449
  throw new Error(d);
3446
3450
  var w = M[++C], f = M[++C], m = M[++C];
3447
3451
  if ((w & 192) !== 128 || (f & 192) !== 128 || (m & 192) !== 128)
3448
3452
  throw new Error(d);
3449
- v = (v & 15) << 18 | (w & 63) << 12 | (f & 63) << 6 | m & 63, T = 65536;
3453
+ b = (b & 15) << 18 | (w & 63) << 12 | (f & 63) << 6 | m & 63, T = 65536;
3450
3454
  } else
3451
3455
  throw new Error(d);
3452
- if (v < T || v >= 55296 && v <= 57343)
3456
+ if (b < T || b >= 55296 && b <= 57343)
3453
3457
  throw new Error(d);
3454
- if (v >= 65536) {
3455
- if (v > 1114111)
3458
+ if (b >= 65536) {
3459
+ if (b > 1114111)
3456
3460
  throw new Error(d);
3457
- v -= 65536, _.push(String.fromCharCode(55296 | v >> 10)), v = 56320 | v & 1023;
3461
+ b -= 65536, y.push(String.fromCharCode(55296 | b >> 10)), b = 56320 | b & 1023;
3458
3462
  }
3459
3463
  }
3460
- _.push(String.fromCharCode(v));
3464
+ y.push(String.fromCharCode(b));
3461
3465
  }
3462
- return _.join("");
3466
+ return y.join("");
3463
3467
  }
3464
3468
  o.decode = x;
3465
3469
  }),
@@ -3546,7 +3550,7 @@ function va() {
3546
3550
  return this.getRoot(s) + "/" + t + this.options.suffix + ".js";
3547
3551
  }
3548
3552
  }
3549
- var M = new l("_pusher_dependencies", "Pusher.DependenciesReceivers"), _ = new x({
3553
+ var M = new l("_pusher_dependencies", "Pusher.DependenciesReceivers"), y = new x({
3550
3554
  cdn_http: h.cdn_http,
3551
3555
  cdn_https: h.cdn_https,
3552
3556
  version: h.VERSION,
@@ -3593,7 +3597,7 @@ function va() {
3593
3597
  super(t), Object.setPrototypeOf(this, new.target.prototype);
3594
3598
  }
3595
3599
  }
3596
- class b extends Error {
3600
+ class v extends Error {
3597
3601
  constructor(t) {
3598
3602
  super(t), Object.setPrototypeOf(this, new.target.prototype);
3599
3603
  }
@@ -3665,17 +3669,17 @@ function va() {
3665
3669
  function me(r) {
3666
3670
  return E(ae(r));
3667
3671
  }
3668
- var te = String.fromCharCode, y = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", I = function(r) {
3672
+ var te = String.fromCharCode, _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", I = function(r) {
3669
3673
  var t = r.charCodeAt(0);
3670
3674
  return t < 128 ? r : t < 2048 ? te(192 | t >>> 6) + te(128 | t & 63) : te(224 | t >>> 12 & 15) + te(128 | t >>> 6 & 63) + te(128 | t & 63);
3671
3675
  }, ae = function(r) {
3672
3676
  return r.replace(/[^\x00-\x7F]/g, I);
3673
3677
  }, B = function(r) {
3674
3678
  var t = [0, 2, 1][r.length % 3], s = r.charCodeAt(0) << 16 | (r.length > 1 ? r.charCodeAt(1) : 0) << 8 | (r.length > 2 ? r.charCodeAt(2) : 0), a = [
3675
- y.charAt(s >>> 18),
3676
- y.charAt(s >>> 12 & 63),
3677
- t >= 2 ? "=" : y.charAt(s >>> 6 & 63),
3678
- t >= 1 ? "=" : y.charAt(s & 63)
3679
+ _.charAt(s >>> 18),
3680
+ _.charAt(s >>> 12 & 63),
3681
+ t >= 2 ? "=" : _.charAt(s >>> 6 & 63),
3682
+ t >= 1 ? "=" : _.charAt(s & 63)
3679
3683
  ];
3680
3684
  return a.join("");
3681
3685
  }, E = window.btoa || function(r) {
@@ -3816,7 +3820,7 @@ function va() {
3816
3820
  return !1;
3817
3821
  return !0;
3818
3822
  }
3819
- function xe(r) {
3823
+ function ke(r) {
3820
3824
  return we(r, function(t) {
3821
3825
  return typeof t == "object" && (t = Ye(t)), encodeURIComponent(me(t.toString()));
3822
3826
  });
@@ -3824,7 +3828,7 @@ function va() {
3824
3828
  function K(r) {
3825
3829
  var t = Qe(r, function(a) {
3826
3830
  return a !== void 0;
3827
- }), s = ge(ft(xe(t)), ue.method("join", "=")).join("&");
3831
+ }), s = ge(ft(ke(t)), ue.method("join", "=")).join("&");
3828
3832
  return s;
3829
3833
  }
3830
3834
  function qe(r) {
@@ -3861,7 +3865,7 @@ function va() {
3861
3865
  return JSON.stringify(qe(r));
3862
3866
  }
3863
3867
  }
3864
- class Ps {
3868
+ class Ms {
3865
3869
  constructor() {
3866
3870
  this.globalLog = (t) => {
3867
3871
  window.console && window.console.log && window.console.log(t);
@@ -3887,7 +3891,7 @@ function va() {
3887
3891
  Tt.log ? Tt.log(a) : Tt.logToConsole && t.bind(this)(a);
3888
3892
  }
3889
3893
  }
3890
- var oe = new Ps(), Ms = function(r, t, s, a, u) {
3894
+ var oe = new Ms(), xs = function(r, t, s, a, u) {
3891
3895
  (s.headers !== void 0 || s.headersProvider != null) && oe.warn(`To send headers with the ${a.toString()} request, you must use AJAX, rather than JSONP.`);
3892
3896
  var p = r.nextAuthCallbackID.toString();
3893
3897
  r.nextAuthCallbackID++;
@@ -3899,8 +3903,8 @@ function va() {
3899
3903
  L.src = s.endpoint + "?callback=" + encodeURIComponent(z) + "&" + t;
3900
3904
  var Q = S.getElementsByTagName("head")[0] || S.documentElement;
3901
3905
  Q.insertBefore(L, Q.firstChild);
3902
- }, xs = Ms;
3903
- class ks {
3906
+ }, ks = xs;
3907
+ class Ls {
3904
3908
  constructor(t) {
3905
3909
  this.src = t;
3906
3910
  }
@@ -3920,7 +3924,7 @@ function va() {
3920
3924
  this.script && (this.script.onload = this.script.onerror = null, this.script.onreadystatechange = null), this.script && this.script.parentNode && this.script.parentNode.removeChild(this.script), this.errorScript && this.errorScript.parentNode && this.errorScript.parentNode.removeChild(this.errorScript), this.script = null, this.errorScript = null;
3921
3925
  }
3922
3926
  }
3923
- class Ls {
3927
+ class Is {
3924
3928
  constructor(t, s) {
3925
3929
  this.url = t, this.data = s;
3926
3930
  }
@@ -3934,17 +3938,17 @@ function va() {
3934
3938
  this.request && this.request.cleanup();
3935
3939
  }
3936
3940
  }
3937
- var Is = function(r, t) {
3941
+ var Us = function(r, t) {
3938
3942
  return function(s, a) {
3939
3943
  var u = "http" + (t ? "s" : "") + "://", p = u + (r.host || r.options.host) + r.options.path, S = j.createJSONPRequest(p, s), L = j.ScriptReceivers.create(function(z, Q) {
3940
3944
  d.remove(L), S.cleanup(), Q && Q.host && (r.host = Q.host), a && a(z, Q);
3941
3945
  });
3942
3946
  S.send(L);
3943
3947
  };
3944
- }, Us = {
3948
+ }, Os = {
3945
3949
  name: "jsonp",
3946
- getAgent: Is
3947
- }, Os = Us;
3950
+ getAgent: Us
3951
+ }, Fs = Os;
3948
3952
  function pt(r, t, s) {
3949
3953
  var a = r + (t.useTLS ? "s" : ""), u = t.useTLS ? t.hostTLS : t.hostNonTLS;
3950
3954
  return a + "://" + u + s;
@@ -3953,17 +3957,17 @@ function va() {
3953
3957
  var s = "/app/" + r, a = "?protocol=" + h.PROTOCOL + "&client=js&version=" + h.VERSION + (t ? "&" + t : "");
3954
3958
  return s + a;
3955
3959
  }
3956
- var Fs = {
3960
+ var Ns = {
3957
3961
  getInitial: function(r, t) {
3958
3962
  var s = (t.httpPath || "") + gt(r, "flash=false");
3959
3963
  return pt("ws", t, s);
3960
3964
  }
3961
- }, Ns = {
3965
+ }, Ds = {
3962
3966
  getInitial: function(r, t) {
3963
3967
  var s = (t.httpPath || "/pusher") + gt(r);
3964
3968
  return pt("http", t, s);
3965
3969
  }
3966
- }, Ds = {
3970
+ }, qs = {
3967
3971
  getInitial: function(r, t) {
3968
3972
  return pt("http", t, t.httpPath || "/pusher");
3969
3973
  },
@@ -3971,7 +3975,7 @@ function va() {
3971
3975
  return gt(r);
3972
3976
  }
3973
3977
  };
3974
- class qs {
3978
+ class zs {
3975
3979
  constructor() {
3976
3980
  this._callbacks = {};
3977
3981
  }
@@ -4011,7 +4015,7 @@ function va() {
4011
4015
  }
4012
4016
  class Te {
4013
4017
  constructor(t) {
4014
- this.callbacks = new qs(), this.global_callbacks = [], this.failThrough = t;
4018
+ this.callbacks = new zs(), this.global_callbacks = [], this.failThrough = t;
4015
4019
  }
4016
4020
  bind(t, s, a) {
4017
4021
  return this.callbacks.add(t, s, a), this;
@@ -4039,7 +4043,7 @@ function va() {
4039
4043
  return this;
4040
4044
  }
4041
4045
  }
4042
- class zs extends Te {
4046
+ class js extends Te {
4043
4047
  constructor(t, s, a, u, p) {
4044
4048
  super(), this.initialize = j.transportConnectionInitializer, this.hooks = t, this.name = s, this.priority = a, this.key = u, this.options = p, this.state = "new", this.timeline = p.timeline, this.activityTimeout = p.activityTimeout, this.id = this.timeline.generateUniqueID();
4045
4049
  }
@@ -4126,11 +4130,11 @@ function va() {
4126
4130
  return this.hooks.isSupported(t);
4127
4131
  }
4128
4132
  createConnection(t, s, a, u) {
4129
- return new zs(this.hooks, t, s, a, u);
4133
+ return new js(this.hooks, t, s, a, u);
4130
4134
  }
4131
4135
  }
4132
- var js = new Ne({
4133
- urls: Fs,
4136
+ var $s = new Ne({
4137
+ urls: Ns,
4134
4138
  handlesActivityChecks: !1,
4135
4139
  supportsPing: !1,
4136
4140
  isInitialized: function() {
@@ -4143,7 +4147,7 @@ function va() {
4143
4147
  return j.createWebSocket(r);
4144
4148
  }
4145
4149
  }), nn = {
4146
- urls: Ns,
4150
+ urls: Ds,
4147
4151
  handlesActivityChecks: !1,
4148
4152
  supportsPing: !0,
4149
4153
  isInitialized: function() {
@@ -4161,13 +4165,13 @@ function va() {
4161
4165
  isSupported: function() {
4162
4166
  return j.isXHRSupported();
4163
4167
  }
4164
- }, $s = new Ne(pe({}, sn, on)), Hs = new Ne(pe({}, rn, on)), Bs = {
4165
- ws: js,
4166
- xhr_streaming: $s,
4167
- xhr_polling: Hs
4168
- }, Ze = Bs, Vs = new Ne({
4168
+ }, Hs = new Ne(pe({}, sn, on)), Bs = new Ne(pe({}, rn, on)), Vs = {
4169
+ ws: $s,
4170
+ xhr_streaming: Hs,
4171
+ xhr_polling: Bs
4172
+ }, Ze = Vs, Xs = new Ne({
4169
4173
  file: "sockjs",
4170
- urls: Ds,
4174
+ urls: qs,
4171
4175
  handlesActivityChecks: !0,
4172
4176
  supportsPing: !1,
4173
4177
  isSupported: function() {
@@ -4178,7 +4182,7 @@ function va() {
4178
4182
  },
4179
4183
  getSocket: function(r, t) {
4180
4184
  return new window.SockJS(r, null, {
4181
- js_path: _.getPath("sockjs", {
4185
+ js_path: y.getPath("sockjs", {
4182
4186
  useTLS: t.useTLS
4183
4187
  }),
4184
4188
  ignore_null_origin: t.ignoreNullOrigin
@@ -4194,10 +4198,10 @@ function va() {
4194
4198
  var t = j.isXDRSupported(r.useTLS);
4195
4199
  return t;
4196
4200
  }
4197
- }, Xs = new Ne(pe({}, sn, an)), Ws = new Ne(pe({}, rn, an));
4198
- Ze.xdr_streaming = Xs, Ze.xdr_polling = Ws, Ze.sockjs = Vs;
4199
- var Gs = Ze;
4200
- class Js extends Te {
4201
+ }, Ws = new Ne(pe({}, sn, an)), Gs = new Ne(pe({}, rn, an));
4202
+ Ze.xdr_streaming = Ws, Ze.xdr_polling = Gs, Ze.sockjs = Xs;
4203
+ var Js = Ze;
4204
+ class Ks extends Te {
4201
4205
  constructor() {
4202
4206
  super();
4203
4207
  var t = this;
@@ -4211,8 +4215,8 @@ function va() {
4211
4215
  return window.navigator.onLine === void 0 ? !0 : window.navigator.onLine;
4212
4216
  }
4213
4217
  }
4214
- var Ks = new Js();
4215
- class Qs {
4218
+ var Qs = new Ks();
4219
+ class Ys {
4216
4220
  constructor(t, s, a) {
4217
4221
  this.manager = t, this.transport = s, this.minPingDelay = a.minPingDelay, this.maxPingDelay = a.maxPingDelay, this.pingDelay = void 0;
4218
4222
  }
@@ -4290,8 +4294,8 @@ function va() {
4290
4294
  } : null;
4291
4295
  }
4292
4296
  };
4293
- var ke = cn;
4294
- class Ys extends Te {
4297
+ var Le = cn;
4298
+ class Zs extends Te {
4295
4299
  constructor(t, s) {
4296
4300
  super(), this.id = t, this.transport = s, this.activityTimeout = s.activityTimeout, this.bindListeners();
4297
4301
  }
@@ -4303,7 +4307,7 @@ function va() {
4303
4307
  }
4304
4308
  send_event(t, s, a) {
4305
4309
  var u = { event: t, data: s };
4306
- return a && (u.channel = a), oe.debug("Event sent", u), this.send(ke.encodeMessage(u));
4310
+ return a && (u.channel = a), oe.debug("Event sent", u), this.send(Le.encodeMessage(u));
4307
4311
  }
4308
4312
  ping() {
4309
4313
  this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
@@ -4316,7 +4320,7 @@ function va() {
4316
4320
  message: (a) => {
4317
4321
  var u;
4318
4322
  try {
4319
- u = ke.decodeMessage(a);
4323
+ u = Le.decodeMessage(a);
4320
4324
  } catch (p) {
4321
4325
  this.emit("error", {
4322
4326
  type: "MessageParseError",
@@ -4361,11 +4365,11 @@ function va() {
4361
4365
  });
4362
4366
  }
4363
4367
  handleCloseEvent(t) {
4364
- var s = ke.getCloseAction(t), a = ke.getCloseError(t);
4368
+ var s = Le.getCloseAction(t), a = Le.getCloseError(t);
4365
4369
  a && this.emit("error", a), s && this.emit(s, { action: s, error: a });
4366
4370
  }
4367
4371
  }
4368
- class Zs {
4372
+ class er {
4369
4373
  constructor(t, s) {
4370
4374
  this.transport = t, this.callback = s, this.bindListeners();
4371
4375
  }
@@ -4377,18 +4381,18 @@ function va() {
4377
4381
  this.unbindListeners();
4378
4382
  var s;
4379
4383
  try {
4380
- s = ke.processHandshake(t);
4384
+ s = Le.processHandshake(t);
4381
4385
  } catch (a) {
4382
4386
  this.finish("error", { error: a }), this.transport.close();
4383
4387
  return;
4384
4388
  }
4385
4389
  s.action === "connected" ? this.finish("connected", {
4386
- connection: new Ys(s.id, this.transport),
4390
+ connection: new Zs(s.id, this.transport),
4387
4391
  activityTimeout: s.activityTimeout
4388
4392
  }) : (this.finish(s.action, { error: s.error }), this.transport.close());
4389
4393
  }, this.onClosed = (t) => {
4390
4394
  this.unbindListeners();
4391
- var s = ke.getCloseAction(t) || "backoff", a = ke.getCloseError(t);
4395
+ var s = Le.getCloseAction(t) || "backoff", a = Le.getCloseError(t);
4392
4396
  this.finish(s, { error: a });
4393
4397
  }, this.transport.bind("message", this.onMessage), this.transport.bind("closed", this.onClosed);
4394
4398
  }
@@ -4399,7 +4403,7 @@ function va() {
4399
4403
  this.callback(pe({ transport: this.transport, action: t }, s));
4400
4404
  }
4401
4405
  }
4402
- class er {
4406
+ class tr {
4403
4407
  constructor(t, s) {
4404
4408
  this.timeline = t, this.options = s || {};
4405
4409
  }
@@ -4477,7 +4481,7 @@ function va() {
4477
4481
  }, s);
4478
4482
  }
4479
4483
  }
4480
- class tr {
4484
+ class nr {
4481
4485
  constructor() {
4482
4486
  this.reset();
4483
4487
  }
@@ -4509,7 +4513,7 @@ function va() {
4509
4513
  this.members = {}, this.count = 0, this.myID = null, this.me = null;
4510
4514
  }
4511
4515
  }
4512
- var nr = function(r, t, s, a) {
4516
+ var sr = function(r, t, s, a) {
4513
4517
  function u(p) {
4514
4518
  return p instanceof s ? p : new s(function(S) {
4515
4519
  S(p);
@@ -4536,12 +4540,12 @@ function va() {
4536
4540
  Q((a = a.apply(r, t || [])).next());
4537
4541
  });
4538
4542
  };
4539
- class sr extends bt {
4543
+ class rr extends bt {
4540
4544
  constructor(t, s) {
4541
- super(t, s), this.members = new tr();
4545
+ super(t, s), this.members = new nr();
4542
4546
  }
4543
4547
  authorize(t, s) {
4544
- super.authorize(t, (a, u) => nr(this, void 0, void 0, function* () {
4548
+ super.authorize(t, (a, u) => sr(this, void 0, void 0, function* () {
4545
4549
  if (!a)
4546
4550
  if (u = u, u.channel_data != null) {
4547
4551
  var p = JSON.parse(u.channel_data);
@@ -4591,8 +4595,8 @@ function va() {
4591
4595
  this.members.reset(), super.disconnect();
4592
4596
  }
4593
4597
  }
4594
- var rr = c(1), yt = c(0);
4595
- class ir extends bt {
4598
+ var ir = c(1), yt = c(0);
4599
+ class or extends bt {
4596
4600
  constructor(t, s, a) {
4597
4601
  super(t, s), this.key = null, this.nacl = a;
4598
4602
  }
@@ -4658,7 +4662,7 @@ function va() {
4658
4662
  this.emit(t, this.getDataToEmit(p));
4659
4663
  }
4660
4664
  getDataToEmit(t) {
4661
- let s = Object(rr.decode)(t);
4665
+ let s = Object(ir.decode)(t);
4662
4666
  try {
4663
4667
  return JSON.parse(s);
4664
4668
  } catch {
@@ -4666,7 +4670,7 @@ function va() {
4666
4670
  }
4667
4671
  }
4668
4672
  }
4669
- class or extends Te {
4673
+ class ar extends Te {
4670
4674
  constructor(t, s) {
4671
4675
  super(), this.state = "initialized", this.connection = null, this.key = t, this.options = s, this.timeline = this.options.timeline, this.usingTLS = this.options.useTLS, this.errorCallbacks = this.buildErrorCallbacks(), this.connectionCallbacks = this.buildConnectionCallbacks(this.errorCallbacks), this.handshakeCallbacks = this.buildHandshakeCallbacks(this.errorCallbacks);
4672
4676
  var a = j.getNetwork();
@@ -4822,12 +4826,12 @@ function va() {
4822
4826
  return this.state === "connecting" || this.state === "connected";
4823
4827
  }
4824
4828
  }
4825
- class ar {
4829
+ class cr {
4826
4830
  constructor() {
4827
4831
  this.channels = {};
4828
4832
  }
4829
4833
  add(t, s) {
4830
- return this.channels[t] || (this.channels[t] = cr(t, s)), this.channels[t];
4834
+ return this.channels[t] || (this.channels[t] = ur(t, s)), this.channels[t];
4831
4835
  }
4832
4836
  all() {
4833
4837
  return X(this.channels);
@@ -4845,7 +4849,7 @@ function va() {
4845
4849
  });
4846
4850
  }
4847
4851
  }
4848
- function cr(r, t) {
4852
+ function ur(r, t) {
4849
4853
  if (r.indexOf("private-encrypted-") === 0) {
4850
4854
  if (t.config.nacl)
4851
4855
  return Ee.createEncryptedChannel(r, t, t.config.nacl);
@@ -4861,12 +4865,12 @@ function va() {
4861
4865
  return Ee.createChannel(r, t);
4862
4866
  }
4863
4867
  }
4864
- var ur = {
4868
+ var lr = {
4865
4869
  createChannels() {
4866
- return new ar();
4870
+ return new cr();
4867
4871
  },
4868
4872
  createConnectionManager(r, t) {
4869
- return new or(r, t);
4873
+ return new ar(r, t);
4870
4874
  },
4871
4875
  createChannel(r, t) {
4872
4876
  return new vt(r, t);
@@ -4875,21 +4879,21 @@ function va() {
4875
4879
  return new bt(r, t);
4876
4880
  },
4877
4881
  createPresenceChannel(r, t) {
4878
- return new sr(r, t);
4882
+ return new rr(r, t);
4879
4883
  },
4880
4884
  createEncryptedChannel(r, t, s) {
4881
- return new ir(r, t, s);
4885
+ return new or(r, t, s);
4882
4886
  },
4883
4887
  createTimelineSender(r, t) {
4884
- return new er(r, t);
4888
+ return new tr(r, t);
4885
4889
  },
4886
4890
  createHandshake(r, t) {
4887
- return new Zs(r, t);
4891
+ return new er(r, t);
4888
4892
  },
4889
4893
  createAssistantToTheTransportManager(r, t, s) {
4890
- return new Qs(r, t, s);
4894
+ return new Ys(r, t, s);
4891
4895
  }
4892
- }, Ee = ur;
4896
+ }, Ee = lr;
4893
4897
  class un {
4894
4898
  constructor(t) {
4895
4899
  this.options = t || {}, this.livesLeft = this.options.lives || 1 / 0;
@@ -4907,7 +4911,7 @@ function va() {
4907
4911
  this.livesLeft -= 1;
4908
4912
  }
4909
4913
  }
4910
- class Le {
4914
+ class Ie {
4911
4915
  constructor(t, s) {
4912
4916
  this.strategies = t, this.loop = !!s.loop, this.failFast = !!s.failFast, this.timeout = s.timeout, this.timeoutLimit = s.timeoutLimit;
4913
4917
  }
@@ -4951,10 +4955,10 @@ function va() {
4951
4955
  return ye(this.strategies, ue.method("isSupported"));
4952
4956
  }
4953
4957
  connect(t, s) {
4954
- return lr(this.strategies, t, function(a, u) {
4958
+ return dr(this.strategies, t, function(a, u) {
4955
4959
  return function(p, S) {
4956
4960
  if (u[a].error = p, p) {
4957
- dr(u) && s(!0);
4961
+ hr(u) && s(!0);
4958
4962
  return;
4959
4963
  }
4960
4964
  Y(u, function(L) {
@@ -4964,13 +4968,13 @@ function va() {
4964
4968
  });
4965
4969
  }
4966
4970
  }
4967
- function lr(r, t, s) {
4971
+ function dr(r, t, s) {
4968
4972
  var a = ge(r, function(u, p, S, L) {
4969
4973
  return u.connect(t, s(p, L));
4970
4974
  });
4971
4975
  return {
4972
4976
  abort: function() {
4973
- Y(a, hr);
4977
+ Y(a, fr);
4974
4978
  },
4975
4979
  forceMinPriority: function(u) {
4976
4980
  Y(a, function(p) {
@@ -4979,15 +4983,15 @@ function va() {
4979
4983
  }
4980
4984
  };
4981
4985
  }
4982
- function dr(r) {
4986
+ function hr(r) {
4983
4987
  return Ce(r, function(t) {
4984
4988
  return !!t.error;
4985
4989
  });
4986
4990
  }
4987
- function hr(r) {
4991
+ function fr(r) {
4988
4992
  !r.error && !r.aborted && (r.abort(), r.aborted = !0);
4989
4993
  }
4990
- class fr {
4994
+ class pr {
4991
4995
  constructor(t, s, a) {
4992
4996
  this.strategy = t, this.transports = s, this.ttl = a.ttl || 1800 * 1e3, this.usingTLS = a.useTLS, this.timeline = a.timeline;
4993
4997
  }
@@ -4995,20 +4999,20 @@ function va() {
4995
4999
  return this.strategy.isSupported();
4996
5000
  }
4997
5001
  connect(t, s) {
4998
- var a = this.usingTLS, u = pr(a), p = u && u.cacheSkipCount ? u.cacheSkipCount : 0, S = [this.strategy];
5002
+ var a = this.usingTLS, u = gr(a), p = u && u.cacheSkipCount ? u.cacheSkipCount : 0, S = [this.strategy];
4999
5003
  if (u && u.timestamp + this.ttl >= ue.now()) {
5000
5004
  var L = this.transports[u.transport];
5001
5005
  L && (["ws", "wss"].includes(u.transport) || p > 3 ? (this.timeline.info({
5002
5006
  cached: !0,
5003
5007
  transport: u.transport,
5004
5008
  latency: u.latency
5005
- }), S.push(new Le([L], {
5009
+ }), S.push(new Ie([L], {
5006
5010
  timeout: u.latency * 2 + 1e3,
5007
5011
  failFast: !0
5008
5012
  }))) : p++);
5009
5013
  }
5010
5014
  var z = ue.now(), Q = S.pop().connect(t, function ee(ce, nt) {
5011
- ce ? (ln(a), S.length > 0 ? (z = ue.now(), Q = S.pop().connect(t, ee)) : s(ce)) : (gr(a, nt.transport.name, ue.now() - z, p), s(null, nt));
5015
+ ce ? (ln(a), S.length > 0 ? (z = ue.now(), Q = S.pop().connect(t, ee)) : s(ce)) : (mr(a, nt.transport.name, ue.now() - z, p), s(null, nt));
5012
5016
  });
5013
5017
  return {
5014
5018
  abort: function() {
@@ -5023,7 +5027,7 @@ function va() {
5023
5027
  function St(r) {
5024
5028
  return "pusherTransport" + (r ? "TLS" : "NonTLS");
5025
5029
  }
5026
- function pr(r) {
5030
+ function gr(r) {
5027
5031
  var t = j.getLocalStorage();
5028
5032
  if (t)
5029
5033
  try {
@@ -5035,7 +5039,7 @@ function va() {
5035
5039
  }
5036
5040
  return null;
5037
5041
  }
5038
- function gr(r, t, s, a) {
5042
+ function mr(r, t, s, a) {
5039
5043
  var u = j.getLocalStorage();
5040
5044
  if (u)
5041
5045
  try {
@@ -5090,7 +5094,7 @@ function va() {
5090
5094
  return a.connect(t, s);
5091
5095
  }
5092
5096
  }
5093
- class mr {
5097
+ class vr {
5094
5098
  constructor(t) {
5095
5099
  this.strategy = t;
5096
5100
  }
@@ -5109,10 +5113,10 @@ function va() {
5109
5113
  return r.isSupported();
5110
5114
  };
5111
5115
  }
5112
- var vr = function(r, t, s) {
5116
+ var br = function(r, t, s) {
5113
5117
  var a = {};
5114
- function u(Sn, mi, vi, bi, yi) {
5115
- var Cn = s(r, Sn, mi, vi, bi, yi);
5118
+ function u(Sn, vi, bi, yi, _i) {
5119
+ var Cn = s(r, Sn, vi, bi, yi, _i);
5116
5120
  return a[Sn] = Cn, Cn;
5117
5121
  }
5118
5122
  var p = Object.assign({}, t, {
@@ -5136,40 +5140,40 @@ function va() {
5136
5140
  lives: 2,
5137
5141
  minPingDelay: 1e4,
5138
5142
  maxPingDelay: r.activityTimeout
5139
- }), ce = u("ws", "ws", 3, p, Q), nt = u("wss", "ws", 3, S, Q), di = u("sockjs", "sockjs", 1, L), gn = u("xhr_streaming", "xhr_streaming", 1, L, ee), hi = u("xdr_streaming", "xdr_streaming", 1, L, ee), mn = u("xhr_polling", "xhr_polling", 1, L), fi = u("xdr_polling", "xdr_polling", 1, L), vn = new Le([ce], z), pi = new Le([nt], z), gi = new Le([di], z), bn = new Le([
5140
- new ze(je(gn), gn, hi)
5141
- ], z), yn = new Le([
5142
- new ze(je(mn), mn, fi)
5143
- ], z), _n = new Le([
5143
+ }), ce = u("ws", "ws", 3, p, Q), nt = u("wss", "ws", 3, S, Q), hi = u("sockjs", "sockjs", 1, L), gn = u("xhr_streaming", "xhr_streaming", 1, L, ee), fi = u("xdr_streaming", "xdr_streaming", 1, L, ee), mn = u("xhr_polling", "xhr_polling", 1, L), pi = u("xdr_polling", "xdr_polling", 1, L), vn = new Ie([ce], z), gi = new Ie([nt], z), mi = new Ie([hi], z), bn = new Ie([
5144
+ new ze(je(gn), gn, fi)
5145
+ ], z), yn = new Ie([
5146
+ new ze(je(mn), mn, pi)
5147
+ ], z), _n = new Ie([
5144
5148
  new ze(je(bn), new _t([
5145
5149
  bn,
5146
5150
  new et(yn, { delay: 4e3 })
5147
5151
  ]), yn)
5148
- ], z), Et = new ze(je(_n), _n, gi), At;
5152
+ ], z), Et = new ze(je(_n), _n, mi), At;
5149
5153
  return t.useTLS ? At = new _t([
5150
5154
  vn,
5151
5155
  new et(Et, { delay: 2e3 })
5152
5156
  ]) : At = new _t([
5153
5157
  vn,
5154
- new et(pi, { delay: 2e3 }),
5158
+ new et(gi, { delay: 2e3 }),
5155
5159
  new et(Et, { delay: 5e3 })
5156
- ]), new fr(new mr(new ze(je(ce), At, Et)), a, {
5160
+ ]), new pr(new vr(new ze(je(ce), At, Et)), a, {
5157
5161
  ttl: 18e5,
5158
5162
  timeline: t.timeline,
5159
5163
  useTLS: t.useTLS
5160
5164
  });
5161
- }, br = vr, yr = (function() {
5165
+ }, yr = br, _r = (function() {
5162
5166
  var r = this;
5163
5167
  r.timeline.info(r.buildTimelineMessage({
5164
5168
  transport: r.name + (r.options.useTLS ? "s" : "")
5165
- })), r.hooks.isInitialized() ? r.changeState("initialized") : r.hooks.file ? (r.changeState("initializing"), _.load(r.hooks.file, { useTLS: r.options.useTLS }, function(t, s) {
5169
+ })), r.hooks.isInitialized() ? r.changeState("initialized") : r.hooks.file ? (r.changeState("initializing"), y.load(r.hooks.file, { useTLS: r.options.useTLS }, function(t, s) {
5166
5170
  r.hooks.isInitialized() ? (r.changeState("initialized"), s(!0)) : (t && r.onError(t), r.onClose(), s(!1));
5167
5171
  })) : r.onClose();
5168
- }), _r = {
5172
+ }), Sr = {
5169
5173
  getRequest: function(r) {
5170
5174
  var t = new window.XDomainRequest();
5171
5175
  return t.ontimeout = function() {
5172
- r.emit("error", new b()), r.close();
5176
+ r.emit("error", new v()), r.close();
5173
5177
  }, t.onerror = function(s) {
5174
5178
  r.emit("error", s), r.close();
5175
5179
  }, t.onprogress = function() {
@@ -5181,9 +5185,9 @@ function va() {
5181
5185
  abortRequest: function(r) {
5182
5186
  r.ontimeout = r.onerror = r.onprogress = r.onload = null, r.abort();
5183
5187
  }
5184
- }, Sr = _r;
5185
- const Cr = 256 * 1024;
5186
- class wr extends Te {
5188
+ }, Cr = Sr;
5189
+ const wr = 256 * 1024;
5190
+ class Tr extends Te {
5187
5191
  constructor(t, s, a) {
5188
5192
  super(), this.hooks = t, this.method = s, this.url = a;
5189
5193
  }
@@ -5211,17 +5215,17 @@ function va() {
5211
5215
  return a !== -1 ? (this.position += a + 1, s.slice(0, a)) : null;
5212
5216
  }
5213
5217
  isBufferTooLong(t) {
5214
- return this.position === t.length && t.length > Cr;
5218
+ return this.position === t.length && t.length > wr;
5215
5219
  }
5216
5220
  }
5217
5221
  var Ct;
5218
5222
  (function(r) {
5219
5223
  r[r.CONNECTING = 0] = "CONNECTING", r[r.OPEN = 1] = "OPEN", r[r.CLOSED = 3] = "CLOSED";
5220
5224
  })(Ct || (Ct = {}));
5221
- var Ie = Ct, Tr = 1;
5222
- class Er {
5225
+ var Ue = Ct, Er = 1;
5226
+ class Ar {
5223
5227
  constructor(t, s) {
5224
- this.hooks = t, this.session = hn(1e3) + "/" + Mr(8), this.location = Ar(s), this.readyState = Ie.CONNECTING, this.openStream();
5228
+ this.hooks = t, this.session = hn(1e3) + "/" + xr(8), this.location = Rr(s), this.readyState = Ue.CONNECTING, this.openStream();
5225
5229
  }
5226
5230
  send(t) {
5227
5231
  return this.sendRaw(JSON.stringify([t]));
@@ -5233,9 +5237,9 @@ function va() {
5233
5237
  this.onClose(t, s, !0);
5234
5238
  }
5235
5239
  sendRaw(t) {
5236
- if (this.readyState === Ie.OPEN)
5240
+ if (this.readyState === Ue.OPEN)
5237
5241
  try {
5238
- return j.createSocketRequest("POST", dn(Rr(this.location, this.session))).start(t), !0;
5242
+ return j.createSocketRequest("POST", dn(Pr(this.location, this.session))).start(t), !0;
5239
5243
  } catch {
5240
5244
  return !1;
5241
5245
  }
@@ -5246,7 +5250,7 @@ function va() {
5246
5250
  this.closeStream(), this.openStream();
5247
5251
  }
5248
5252
  onClose(t, s, a) {
5249
- this.closeStream(), this.readyState = Ie.CLOSED, this.onclose && this.onclose({
5253
+ this.closeStream(), this.readyState = Ue.CLOSED, this.onclose && this.onclose({
5250
5254
  code: t,
5251
5255
  reason: s,
5252
5256
  wasClean: a
@@ -5254,7 +5258,7 @@ function va() {
5254
5258
  }
5255
5259
  onChunk(t) {
5256
5260
  if (t.status === 200) {
5257
- this.readyState === Ie.OPEN && this.onActivity();
5261
+ this.readyState === Ue.OPEN && this.onActivity();
5258
5262
  var s, a = t.data.slice(0, 1);
5259
5263
  switch (a) {
5260
5264
  case "o":
@@ -5278,10 +5282,10 @@ function va() {
5278
5282
  }
5279
5283
  }
5280
5284
  onOpen(t) {
5281
- this.readyState === Ie.CONNECTING ? (t && t.hostname && (this.location.base = Pr(this.location.base, t.hostname)), this.readyState = Ie.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
5285
+ this.readyState === Ue.CONNECTING ? (t && t.hostname && (this.location.base = Mr(this.location.base, t.hostname)), this.readyState = Ue.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
5282
5286
  }
5283
5287
  onEvent(t) {
5284
- this.readyState === Ie.OPEN && this.onmessage && this.onmessage({ data: t });
5288
+ this.readyState === Ue.OPEN && this.onmessage && this.onmessage({ data: t });
5285
5289
  }
5286
5290
  onActivity() {
5287
5291
  this.onactivity && this.onactivity();
@@ -5309,33 +5313,33 @@ function va() {
5309
5313
  this.stream && (this.stream.unbind_all(), this.stream.close(), this.stream = null);
5310
5314
  }
5311
5315
  }
5312
- function Ar(r) {
5316
+ function Rr(r) {
5313
5317
  var t = /([^\?]*)\/*(\??.*)/.exec(r);
5314
5318
  return {
5315
5319
  base: t[1],
5316
5320
  queryString: t[2]
5317
5321
  };
5318
5322
  }
5319
- function Rr(r, t) {
5323
+ function Pr(r, t) {
5320
5324
  return r.base + "/" + t + "/xhr_send";
5321
5325
  }
5322
5326
  function dn(r) {
5323
5327
  var t = r.indexOf("?") === -1 ? "?" : "&";
5324
- return r + t + "t=" + +/* @__PURE__ */ new Date() + "&n=" + Tr++;
5328
+ return r + t + "t=" + +/* @__PURE__ */ new Date() + "&n=" + Er++;
5325
5329
  }
5326
- function Pr(r, t) {
5330
+ function Mr(r, t) {
5327
5331
  var s = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);
5328
5332
  return s[1] + t + s[3];
5329
5333
  }
5330
5334
  function hn(r) {
5331
5335
  return j.randomInt(r);
5332
5336
  }
5333
- function Mr(r) {
5337
+ function xr(r) {
5334
5338
  for (var t = [], s = 0; s < r; s++)
5335
5339
  t.push(hn(32).toString(32));
5336
5340
  return t.join("");
5337
5341
  }
5338
- var xr = Er, kr = {
5342
+ var kr = Ar, Lr = {
5339
5343
  getReceiveURL: function(r, t) {
5340
5344
  return r.base + "/" + t + "/xhr_streaming" + r.queryString;
5341
5345
  },
@@ -5348,7 +5352,7 @@ function va() {
5348
5352
  onFinished: function(r, t) {
5349
5353
  r.onClose(1006, "Connection interrupted (" + t + ")", !1);
5350
5354
  }
5351
- }, Lr = kr, Ir = {
5355
+ }, Ir = Lr, Ur = {
5352
5356
  getReceiveURL: function(r, t) {
5353
5357
  return r.base + "/" + t + "/xhr" + r.queryString;
5354
5358
  },
@@ -5360,7 +5364,7 @@ function va() {
5360
5364
  onFinished: function(r, t) {
5361
5365
  t === 200 ? r.reconnect() : r.onClose(1006, "Connection interrupted (" + t + ")", !1);
5362
5366
  }
5363
- }, Ur = Ir, Or = {
5367
+ }, Or = Ur, Fr = {
5364
5368
  getRequest: function(r) {
5365
5369
  var t = j.getXHRAPI(), s = new t();
5366
5370
  return s.onreadystatechange = s.onprogress = function() {
@@ -5377,36 +5381,36 @@ function va() {
5377
5381
  abortRequest: function(r) {
5378
5382
  r.onreadystatechange = null, r.abort();
5379
5383
  }
5380
- }, Fr = Or, Nr = {
5384
+ }, Nr = Fr, Dr = {
5381
5385
  createStreamingSocket(r) {
5382
- return this.createSocket(Lr, r);
5386
+ return this.createSocket(Ir, r);
5383
5387
  },
5384
5388
  createPollingSocket(r) {
5385
- return this.createSocket(Ur, r);
5389
+ return this.createSocket(Or, r);
5386
5390
  },
5387
5391
  createSocket(r, t) {
5388
- return new xr(r, t);
5392
+ return new kr(r, t);
5389
5393
  },
5390
5394
  createXHR(r, t) {
5391
- return this.createRequest(Fr, r, t);
5395
+ return this.createRequest(Nr, r, t);
5392
5396
  },
5393
5397
  createRequest(r, t, s) {
5394
- return new wr(r, t, s);
5398
+ return new Tr(r, t, s);
5395
5399
  }
5396
- }, fn = Nr;
5400
+ }, fn = Dr;
5397
5401
  fn.createXDR = function(r, t) {
5398
- return this.createRequest(Sr, r, t);
5402
+ return this.createRequest(Cr, r, t);
5399
5403
  };
5400
- var Dr = fn, qr = {
5404
+ var qr = fn, zr = {
5401
5405
  nextAuthCallbackID: 1,
5402
5406
  auth_callbacks: {},
5403
5407
  ScriptReceivers: d,
5404
5408
  DependenciesReceivers: M,
5405
- getDefaultStrategy: br,
5406
- Transports: Gs,
5407
- transportConnectionInitializer: yr,
5408
- HTTPFactory: Dr,
5409
- TimelineTransport: Os,
5409
+ getDefaultStrategy: yr,
5410
+ Transports: Js,
5411
+ transportConnectionInitializer: _r,
5412
+ HTTPFactory: qr,
5413
+ TimelineTransport: Fs,
5410
5414
  getXHRAPI() {
5411
5415
  return window.XMLHttpRequest;
5412
5416
  },
@@ -5418,7 +5422,7 @@ function va() {
5418
5422
  var t = () => {
5419
5423
  this.onDocumentBody(r.ready);
5420
5424
  };
5421
- window.JSON ? t() : _.load("json2", {}, t);
5425
+ window.JSON ? t() : y.load("json2", {}, t);
5422
5426
  },
5423
5427
  getDocument() {
5424
5428
  return document;
@@ -5427,7 +5431,7 @@ function va() {
5427
5431
  return this.getDocument().location.protocol;
5428
5432
  },
5429
5433
  getAuthorizers() {
5430
- return { ajax: J, jsonp: xs };
5434
+ return { ajax: J, jsonp: ks };
5431
5435
  },
5432
5436
  onDocumentBody(r) {
5433
5437
  document.body ? r() : setTimeout(() => {
@@ -5435,10 +5439,10 @@ function va() {
5435
5439
  }, 0);
5436
5440
  },
5437
5441
  createJSONPRequest(r, t) {
5438
- return new Ls(r, t);
5442
+ return new Is(r, t);
5439
5443
  },
5440
5444
  createScriptRequest(r) {
5441
- return new ks(r);
5445
+ return new Ls(r);
5442
5446
  },
5443
5447
  getLocalStorage() {
5444
5448
  try {
@@ -5458,7 +5462,7 @@ function va() {
5458
5462
  return new ActiveXObject("Microsoft.XMLHTTP");
5459
5463
  },
5460
5464
  getNetwork() {
5461
- return Ks;
5465
+ return Qs;
5462
5466
  },
5463
5467
  createWebSocket(r) {
5464
5468
  var t = this.getWebSocketAPI();
@@ -5490,12 +5494,12 @@ function va() {
5490
5494
  return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0] / Math.pow(2, 32);
5491
5495
  }() * r);
5492
5496
  }
5493
- }, j = qr, wt;
5497
+ }, j = zr, wt;
5494
5498
  (function(r) {
5495
5499
  r[r.ERROR = 3] = "ERROR", r[r.INFO = 6] = "INFO", r[r.DEBUG = 7] = "DEBUG";
5496
5500
  })(wt || (wt = {}));
5497
5501
  var tt = wt;
5498
- class zr {
5502
+ class jr {
5499
5503
  constructor(t, s, a) {
5500
5504
  this.key = t, this.session = s, this.events = [], this.options = a || {}, this.sent = 0, this.uniqueID = 0;
5501
5505
  }
@@ -5533,7 +5537,7 @@ function va() {
5533
5537
  return this.uniqueID++, this.uniqueID;
5534
5538
  }
5535
5539
  }
5536
- class jr {
5540
+ class $r {
5537
5541
  constructor(t, s, a, u) {
5538
5542
  this.name = t, this.priority = s, this.transport = a, this.options = u || {};
5539
5543
  }
@@ -5582,14 +5586,14 @@ function va() {
5582
5586
  }
5583
5587
  };
5584
5588
  }
5585
- const { Transports: $r } = j;
5586
- var Hr = function(r, t, s, a, u, p) {
5587
- var S = $r[s];
5589
+ const { Transports: Hr } = j;
5590
+ var Br = function(r, t, s, a, u, p) {
5591
+ var S = Hr[s];
5588
5592
  if (!S)
5589
5593
  throw new k(s);
5590
5594
  var L = (!r.enabledTransports || R(r.enabledTransports, t) !== -1) && (!r.disabledTransports || R(r.disabledTransports, t) === -1), z;
5591
- return L ? (u = Object.assign({ ignoreNullOrigin: r.ignoreNullOrigin }, u), z = new jr(t, a, p ? p.getAssistant(S) : S, u)) : z = Br, z;
5592
- }, Br = {
5595
+ return L ? (u = Object.assign({ ignoreNullOrigin: r.ignoreNullOrigin }, u), z = new $r(t, a, p ? p.getAssistant(S) : S, u)) : z = Vr, z;
5596
+ }, Vr = {
5593
5597
  isSupported: function() {
5594
5598
  return !1;
5595
5599
  },
@@ -5606,14 +5610,14 @@ function va() {
5606
5610
  };
5607
5611
  }
5608
5612
  };
5609
- function Vr(r) {
5613
+ function Xr(r) {
5610
5614
  if (r == null)
5611
5615
  throw "You must pass an options object";
5612
5616
  if (r.cluster == null)
5613
5617
  throw "Options object must provide a cluster";
5614
5618
  "disableStats" in r && oe.warn("The disableStats option is deprecated in favor of enableStats");
5615
5619
  }
5616
- const Xr = (r, t) => {
5620
+ const Wr = (r, t) => {
5617
5621
  var s = "socket_id=" + encodeURIComponent(r.socketId);
5618
5622
  for (var a in t.params)
5619
5623
  s += "&" + encodeURIComponent(a) + "=" + encodeURIComponent(t.params[a]);
@@ -5624,15 +5628,15 @@ function va() {
5624
5628
  }
5625
5629
  return s;
5626
5630
  };
5627
- var Wr = (r) => {
5631
+ var Gr = (r) => {
5628
5632
  if (typeof j.getAuthorizers()[r.transport] > "u")
5629
5633
  throw `'${r.transport}' is not a recognized auth transport`;
5630
5634
  return (t, s) => {
5631
- const a = Xr(t, r);
5635
+ const a = Wr(t, r);
5632
5636
  j.getAuthorizers()[r.transport](j, a, r, w.UserAuthentication, s);
5633
5637
  };
5634
5638
  };
5635
- const Gr = (r, t) => {
5639
+ const Jr = (r, t) => {
5636
5640
  var s = "socket_id=" + encodeURIComponent(r.socketId);
5637
5641
  s += "&channel_name=" + encodeURIComponent(r.channelName);
5638
5642
  for (var a in t.params)
@@ -5644,15 +5648,15 @@ function va() {
5644
5648
  }
5645
5649
  return s;
5646
5650
  };
5647
- var Jr = (r) => {
5651
+ var Kr = (r) => {
5648
5652
  if (typeof j.getAuthorizers()[r.transport] > "u")
5649
5653
  throw `'${r.transport}' is not a recognized auth transport`;
5650
5654
  return (t, s) => {
5651
- const a = Gr(t, r);
5655
+ const a = Jr(t, r);
5652
5656
  j.getAuthorizers()[r.transport](j, a, r, w.ChannelAuthorization, s);
5653
5657
  };
5654
5658
  };
5655
- const Kr = (r, t, s) => {
5659
+ const Qr = (r, t, s) => {
5656
5660
  const a = {
5657
5661
  authTransport: t.transport,
5658
5662
  authEndpoint: t.endpoint,
@@ -5666,7 +5670,7 @@ function va() {
5666
5670
  s(S, a).authorize(u.socketId, p);
5667
5671
  };
5668
5672
  };
5669
- function Qr(r, t) {
5673
+ function Yr(r, t) {
5670
5674
  let s = {
5671
5675
  activityTimeout: r.activityTimeout || h.activityTimeout,
5672
5676
  cluster: r.cluster,
@@ -5679,46 +5683,46 @@ function va() {
5679
5683
  wsPath: r.wsPath || h.wsPath,
5680
5684
  wsPort: r.wsPort || h.wsPort,
5681
5685
  wssPort: r.wssPort || h.wssPort,
5682
- enableStats: ni(r),
5683
- httpHost: Yr(r),
5684
- useTLS: ti(r),
5685
- wsHost: Zr(r),
5686
- userAuthenticator: si(r),
5687
- channelAuthorizer: ii(r, t)
5686
+ enableStats: si(r),
5687
+ httpHost: Zr(r),
5688
+ useTLS: ni(r),
5689
+ wsHost: ei(r),
5690
+ userAuthenticator: ri(r),
5691
+ channelAuthorizer: oi(r, t)
5688
5692
  };
5689
5693
  return "disabledTransports" in r && (s.disabledTransports = r.disabledTransports), "enabledTransports" in r && (s.enabledTransports = r.enabledTransports), "ignoreNullOrigin" in r && (s.ignoreNullOrigin = r.ignoreNullOrigin), "timelineParams" in r && (s.timelineParams = r.timelineParams), "nacl" in r && (s.nacl = r.nacl), s;
5690
5694
  }
5691
- function Yr(r) {
5692
- return r.httpHost ? r.httpHost : r.cluster ? `sockjs-${r.cluster}.pusher.com` : h.httpHost;
5693
- }
5694
5695
  function Zr(r) {
5695
- return r.wsHost ? r.wsHost : ei(r.cluster);
5696
+ return r.httpHost ? r.httpHost : r.cluster ? `sockjs-${r.cluster}.pusher.com` : h.httpHost;
5696
5697
  }
5697
5698
  function ei(r) {
5698
- return `ws-${r}.pusher.com`;
5699
+ return r.wsHost ? r.wsHost : ti(r.cluster);
5699
5700
  }
5700
5701
  function ti(r) {
5701
- return j.getProtocol() === "https:" ? !0 : r.forceTLS !== !1;
5702
+ return `ws-${r}.pusher.com`;
5702
5703
  }
5703
5704
  function ni(r) {
5704
- return "enableStats" in r ? r.enableStats : "disableStats" in r ? !r.disableStats : !1;
5705
+ return j.getProtocol() === "https:" ? !0 : r.forceTLS !== !1;
5705
5706
  }
5706
5707
  function si(r) {
5708
+ return "enableStats" in r ? r.enableStats : "disableStats" in r ? !r.disableStats : !1;
5709
+ }
5710
+ function ri(r) {
5707
5711
  const t = Object.assign(Object.assign({}, h.userAuthentication), r.userAuthentication);
5708
- return "customHandler" in t && t.customHandler != null ? t.customHandler : Wr(t);
5712
+ return "customHandler" in t && t.customHandler != null ? t.customHandler : Gr(t);
5709
5713
  }
5710
- function ri(r, t) {
5714
+ function ii(r, t) {
5711
5715
  let s;
5712
5716
  return "channelAuthorization" in r ? s = Object.assign(Object.assign({}, h.channelAuthorization), r.channelAuthorization) : (s = {
5713
5717
  transport: r.authTransport || h.authTransport,
5714
5718
  endpoint: r.authEndpoint || h.authEndpoint
5715
- }, "auth" in r && ("params" in r.auth && (s.params = r.auth.params), "headers" in r.auth && (s.headers = r.auth.headers)), "authorizer" in r && (s.customHandler = Kr(t, s, r.authorizer))), s;
5719
+ }, "auth" in r && ("params" in r.auth && (s.params = r.auth.params), "headers" in r.auth && (s.headers = r.auth.headers)), "authorizer" in r && (s.customHandler = Qr(t, s, r.authorizer))), s;
5716
5720
  }
5717
- function ii(r, t) {
5718
- const s = ri(r, t);
5719
- return "customHandler" in s && s.customHandler != null ? s.customHandler : Jr(s);
5721
+ function oi(r, t) {
5722
+ const s = ii(r, t);
5723
+ return "customHandler" in s && s.customHandler != null ? s.customHandler : Kr(s);
5720
5724
  }
5721
- class oi extends Te {
5725
+ class ai extends Te {
5722
5726
  constructor(t) {
5723
5727
  super(function(s, a) {
5724
5728
  oe.debug(`No callbacks on watchlist events for ${s}`);
@@ -5736,14 +5740,14 @@ function va() {
5736
5740
  });
5737
5741
  }
5738
5742
  }
5739
- function ai() {
5743
+ function ci() {
5740
5744
  let r, t;
5741
5745
  return { promise: new Promise((a, u) => {
5742
5746
  r = a, t = u;
5743
5747
  }), resolve: r, reject: t };
5744
5748
  }
5745
- var ci = ai;
5746
- class ui extends Te {
5749
+ var ui = ci;
5750
+ class li extends Te {
5747
5751
  constructor(t) {
5748
5752
  super(function(s, a) {
5749
5753
  oe.debug("No callbacks on user for " + s);
@@ -5758,7 +5762,7 @@ function va() {
5758
5762
  });
5759
5763
  }, this.pusher = t, this.pusher.connection.bind("state_change", ({ previous: s, current: a }) => {
5760
5764
  s !== "connected" && a === "connected" && this._signin(), s === "connected" && a !== "connected" && (this._cleanup(), this._newSigninPromiseIfNeeded());
5761
- }), this.watchlist = new oi(t), this.pusher.connection.bind("message", (s) => {
5765
+ }), this.watchlist = new ai(t), this.pusher.connection.bind("message", (s) => {
5762
5766
  var a = s.event;
5763
5767
  a === "pusher:signin_success" && this._onSigninSuccess(s.data), this.serverToUserChannel && this.serverToUserChannel.name === s.channel && this.serverToUserChannel.handleEvent(s);
5764
5768
  });
@@ -5798,7 +5802,7 @@ function va() {
5798
5802
  _newSigninPromiseIfNeeded() {
5799
5803
  if (!this.signin_requested || this.signinDonePromise && !this.signinDonePromise.done)
5800
5804
  return;
5801
- const { promise: t, resolve: s } = ci();
5805
+ const { promise: t, resolve: s } = ui();
5802
5806
  t.done = !1;
5803
5807
  const a = () => {
5804
5808
  t.done = !0;
@@ -5818,7 +5822,7 @@ function va() {
5818
5822
  }));
5819
5823
  }
5820
5824
  constructor(t, s) {
5821
- li(t), Vr(s), this.key = t, this.config = Qr(s, this), this.channels = Ee.createChannels(), this.global_emitter = new Te(), this.sessionID = j.randomInt(1e9), this.timeline = new zr(this.key, this.sessionID, {
5825
+ di(t), Xr(s), this.key = t, this.config = Yr(s, this), this.channels = Ee.createChannels(), this.global_emitter = new Te(), this.sessionID = j.randomInt(1e9), this.timeline = new jr(this.key, this.sessionID, {
5822
5826
  cluster: this.config.cluster,
5823
5827
  features: de.getClientFeatures(),
5824
5828
  params: this.config.timelineParams || {},
@@ -5829,7 +5833,7 @@ function va() {
5829
5833
  host: this.config.statsHost,
5830
5834
  path: "/timeline/v2/" + j.TimelineTransport.name
5831
5835
  }));
5832
- var a = (u) => j.getDefaultStrategy(this.config, u, Hr);
5836
+ var a = (u) => j.getDefaultStrategy(this.config, u, Br);
5833
5837
  this.connection = Ee.createConnectionManager(this.key, {
5834
5838
  getStrategy: a,
5835
5839
  timeline: this.timeline,
@@ -5852,7 +5856,7 @@ function va() {
5852
5856
  this.channels.disconnect();
5853
5857
  }), this.connection.bind("error", (u) => {
5854
5858
  oe.warn(u);
5855
- }), de.instances.push(this), this.timeline.info({ instances: de.instances.length }), this.user = new ui(this), de.isReady && this.connect();
5859
+ }), de.instances.push(this), this.timeline.info({ instances: de.instances.length }), this.user = new li(this), de.isReady && this.connect();
5856
5860
  }
5857
5861
  channel(t) {
5858
5862
  return this.channels.find(t);
@@ -5911,7 +5915,7 @@ function va() {
5911
5915
  }
5912
5916
  de.instances = [], de.isReady = !1, de.logToConsole = !1, de.Runtime = j, de.ScriptReceivers = j.ScriptReceivers, de.DependenciesReceivers = j.DependenciesReceivers, de.auth_callbacks = j.auth_callbacks;
5913
5917
  var Tt = o.default = de;
5914
- function li(r) {
5918
+ function di(r) {
5915
5919
  if (r == null)
5916
5920
  throw "You must pass your app key when you instantiate Pusher.";
5917
5921
  }
@@ -6028,7 +6032,7 @@ function Vn(e, n) {
6028
6032
  "X-Requested-With": "XMLHttpRequest"
6029
6033
  }), typeof FormData < "u" && e.data instanceof FormData && (e.headers.delete("Content-Type"), e.headers.delete("content-type"));
6030
6034
  }
6031
- function Ae(e, n, i) {
6035
+ function Re(e, n, i) {
6032
6036
  const o = e[n];
6033
6037
  if (typeof o == "string" && o.trim() !== "")
6034
6038
  return o;
@@ -6044,14 +6048,14 @@ function xa(e) {
6044
6048
  function ka(e, n) {
6045
6049
  if (!se(e))
6046
6050
  return null;
6047
- const i = Ae(e, "user_id", "userId"), o = xa(e.status);
6051
+ const i = Re(e, "user_id", "userId"), o = xa(e.status);
6048
6052
  if (!i || !o)
6049
6053
  return null;
6050
6054
  const c = {
6051
6055
  user_id: i,
6052
- tenant_scope: Ae(e, "tenant_scope", "tenantScope") ?? n,
6056
+ tenant_scope: Re(e, "tenant_scope", "tenantScope") ?? n,
6053
6057
  status: o,
6054
- ts: Ae(e, "ts", "timestamp") ?? (/* @__PURE__ */ new Date()).toISOString()
6058
+ ts: Re(e, "ts", "timestamp") ?? (/* @__PURE__ */ new Date()).toISOString()
6055
6059
  }, l = e.tenant_id ?? e.tenantId;
6056
6060
  typeof l == "string" ? c.tenant_id = l : l === null && (c.tenant_id = null);
6057
6061
  const d = e.last_seen_at ?? e.lastSeenAt;
@@ -6060,7 +6064,7 @@ function ka(e, n) {
6060
6064
  function La(e) {
6061
6065
  if (!se(e))
6062
6066
  return null;
6063
- const n = Ae(e, "user_id", "userId"), i = Ae(e, "conversation_id", "conversationId");
6067
+ const n = Re(e, "user_id", "userId"), i = Re(e, "conversation_id", "conversationId");
6064
6068
  if (!n || !i)
6065
6069
  return null;
6066
6070
  const o = e.user, c = se(o) ? {
@@ -6081,7 +6085,7 @@ function La(e) {
6081
6085
  function Ia(e) {
6082
6086
  if (!se(e))
6083
6087
  return null;
6084
- const n = Ae(e, "user_id", "userId"), i = Ae(e, "conversation_id", "conversationId");
6088
+ const n = Re(e, "user_id", "userId"), i = Re(e, "conversation_id", "conversationId");
6085
6089
  if (!n || !i)
6086
6090
  return null;
6087
6091
  const o = se(e.user) ? {
@@ -6100,7 +6104,7 @@ function Ia(e) {
6100
6104
  function Ua(e) {
6101
6105
  if (!se(e))
6102
6106
  return null;
6103
- const n = Ae(e, "user_id", "userId"), i = Ae(e, "conversation_id", "conversationId");
6107
+ const n = Re(e, "user_id", "userId"), i = Re(e, "conversation_id", "conversationId");
6104
6108
  return !n || !i ? null : {
6105
6109
  user_id: n,
6106
6110
  conversation_id: i,
@@ -6144,26 +6148,26 @@ function Oe(e, n, i, o) {
6144
6148
  function oc(e) {
6145
6149
  const n = e.initializedEvent ?? "messenger-client:echo-initialized", i = e.bootstrapEndpoint ?? _a, o = e.bootstrapRefreshSkewMs ?? Sa, c = e.presenceFreshnessTtlMs ?? wa, l = (e.createLogger ?? Kt())("MessengerEcho");
6146
6150
  typeof window < "u" && (window.Pusher = ya);
6147
- let d = null, g = null, h = null, x = null, M = "disconnected", _ = "available", C = null, v = null;
6151
+ let d = null, g = null, h = null, x = null, M = "disconnected", y = "available", C = null, b = null;
6148
6152
  const T = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map(), m = (R) => {
6149
6153
  M = R;
6150
6154
  for (const P of T)
6151
6155
  P(R);
6152
- }, b = (R) => {
6153
- _ = R;
6156
+ }, v = (R) => {
6157
+ y = R;
6154
6158
  for (const P of w)
6155
6159
  P(R);
6156
6160
  }, N = () => {
6157
- v !== null && (clearTimeout(v), v = null);
6161
+ b !== null && (clearTimeout(b), b = null);
6158
6162
  }, q = (R = !0) => {
6159
6163
  h !== null && (h.disconnect(), h = null), x = null, R && m("disconnected");
6160
6164
  }, G = () => {
6161
- N(), d = null, g = null, C = null, b("available"), q(), f.clear();
6165
+ N(), d = null, g = null, C = null, v("available"), q(), f.clear();
6162
6166
  }, k = () => {
6163
6167
  if (!e.getSourceToken)
6164
6168
  return null;
6165
6169
  const R = e.getSourceToken();
6166
- return R === null ? (G(), null) : (C !== null && C !== R && (N(), d = null, g = null, b("available"), q()), C = R, R);
6170
+ return R === null ? (G(), null) : (C !== null && C !== R && (N(), d = null, g = null, v("available"), q()), C = R, R);
6167
6171
  }, O = (R) => {
6168
6172
  if (R === null)
6169
6173
  return !1;
@@ -6178,19 +6182,19 @@ function oc(e) {
6178
6182
  if (Number.isNaN(P))
6179
6183
  return;
6180
6184
  const D = Math.max(0, P - Date.now() - o);
6181
- v = setTimeout(() => {
6185
+ b = setTimeout(() => {
6182
6186
  J();
6183
6187
  }, D);
6184
- }, F = async (R = !1) => e.getSourceToken && k() === null || !R && _ === "account_suspended" ? null : !R && O(d) ? d : !R && g !== null ? await g : (g = (async () => {
6188
+ }, F = async (R = !1) => e.getSourceToken && k() === null || !R && y === "account_suspended" ? null : !R && O(d) ? d : !R && g !== null ? await g : (g = (async () => {
6185
6189
  try {
6186
6190
  const D = await e.bootstrapClient.get(
6187
6191
  i,
6188
6192
  R ? { params: { refresh: 1 } } : void 0
6189
6193
  ), X = Ra(D.data);
6190
- return d = X, b("available"), H(X), X;
6194
+ return d = X, v("available"), H(X), X;
6191
6195
  } catch (D) {
6192
6196
  if (Ma(D))
6193
- return d = null, N(), b("account_suspended"), q(), m("disconnected"), null;
6197
+ return d = null, N(), v("account_suspended"), q(), m("disconnected"), null;
6194
6198
  throw D;
6195
6199
  }
6196
6200
  })().finally(() => {
@@ -6258,7 +6262,7 @@ function oc(e) {
6258
6262
  return D.service.reverb.path && (Y.wsPath = D.service.reverb.path), h = new ga(Y), me(h), m("connecting"), typeof window < "u" && window.dispatchEvent(new CustomEvent(n)), h;
6259
6263
  })().finally(() => {
6260
6264
  x = null;
6261
- }), await x), y = $t.create({
6265
+ }), await x), _ = $t.create({
6262
6266
  timeout: e.requestTimeoutMs ?? Ca,
6263
6267
  withCredentials: !1,
6264
6268
  headers: {
@@ -6266,12 +6270,12 @@ function oc(e) {
6266
6270
  "X-Requested-With": "XMLHttpRequest"
6267
6271
  }
6268
6272
  });
6269
- y.interceptors.request.use(async (R) => {
6273
+ _.interceptors.request.use(async (R) => {
6270
6274
  const P = await F();
6271
6275
  if (P === null)
6272
6276
  throw new Error("Messenger bootstrap is unavailable.");
6273
6277
  return R.baseURL = P.service.apiBaseUrl, Vn(R, P.auth.token), R;
6274
- }), y.interceptors.response.use(
6278
+ }), _.interceptors.response.use(
6275
6279
  (R) => R,
6276
6280
  async (R) => {
6277
6281
  const P = R.config;
@@ -6279,14 +6283,14 @@ function oc(e) {
6279
6283
  P._messengerRetry = !0;
6280
6284
  const D = await F(!0);
6281
6285
  if (D !== null)
6282
- return P.baseURL = D.service.apiBaseUrl, Vn(P, D.auth.token), await y(P);
6286
+ return P.baseURL = D.service.apiBaseUrl, Vn(P, D.auth.token), await _(P);
6283
6287
  }
6284
6288
  return Promise.reject(R);
6285
6289
  }
6286
6290
  );
6287
- const I = () => _ === "account_suspended" ? null : h, ae = (R) => (T.add(R), R(M), () => {
6291
+ const I = () => y === "account_suspended" ? null : h, ae = (R) => (T.add(R), R(M), () => {
6288
6292
  T.delete(R);
6289
- }), B = (R) => (w.add(R), R(_), () => {
6293
+ }), B = (R) => (w.add(R), R(y), () => {
6290
6294
  w.delete(R);
6291
6295
  }), E = () => d?.auth.tenantId ?? "global", V = (R) => {
6292
6296
  const P = qt(R.ts)?.getTime() ?? qt(R.last_seen_at)?.getTime() ?? null;
@@ -6370,8 +6374,8 @@ function oc(e) {
6370
6374
  "Modules\\Messaging\\Events\\Broadcast\\TypingStateChanged"
6371
6375
  ], we = [".typing.start", "typing.start", ".TypingStarted", "TypingStarted", ".TypingStart", "TypingStart"], Ke = [".typing.stop", "typing.stop", ".TypingStopped", "TypingStopped", ".TypingStop", "TypingStop"], Qe = /* @__PURE__ */ new Set(["start", "typing"]), ft = /* @__PURE__ */ new Set(["stop", "idle", "viewing"]);
6372
6376
  for (const ye of ge) {
6373
- const Ce = (xe) => {
6374
- const K = La(xe);
6377
+ const Ce = (ke) => {
6378
+ const K = La(ke);
6375
6379
  if (K) {
6376
6380
  if (Qe.has(K.state)) {
6377
6381
  D.onTypingStart?.({
@@ -6395,8 +6399,8 @@ function oc(e) {
6395
6399
  X.listen(ye, Ce), Y.push({ event: ye, handler: Ce });
6396
6400
  }
6397
6401
  for (const ye of we) {
6398
- const Ce = (xe) => {
6399
- const K = Ia(xe);
6402
+ const Ce = (ke) => {
6403
+ const K = Ia(ke);
6400
6404
  if (!K)
6401
6405
  return;
6402
6406
  const qe = {
@@ -6414,8 +6418,8 @@ function oc(e) {
6414
6418
  X.listen(ye, Ce), Y.push({ event: ye, handler: Ce });
6415
6419
  }
6416
6420
  for (const ye of Ke) {
6417
- const Ce = (xe) => {
6418
- const K = Ua(xe);
6421
+ const Ce = (ke) => {
6422
+ const K = Ua(ke);
6419
6423
  if (!K)
6420
6424
  return;
6421
6425
  const qe = {
@@ -6447,15 +6451,15 @@ function oc(e) {
6447
6451
  }, ue = (R) => {
6448
6452
  h?.leave(`typing-conversation.${R}`);
6449
6453
  }, pe = async () => {
6450
- b("available"), q(), await te(!0);
6451
- }, Je = async () => _ === "account_suspended" ? null : await te();
6454
+ v("available"), q(), await te(!0);
6455
+ }, Je = async () => y === "account_suspended" ? null : await te();
6452
6456
  return {
6453
- apiClient: y,
6457
+ apiClient: _,
6454
6458
  initializedEvent: n,
6455
6459
  getEcho: I,
6456
6460
  waitForEcho: Je,
6457
6461
  getConnectionStatus: () => M,
6458
- getAccessState: () => _,
6462
+ getAccessState: () => y,
6459
6463
  onConnectionStatusChange: ae,
6460
6464
  onAccessStateChange: B,
6461
6465
  reconnect: pe,
@@ -6475,12 +6479,12 @@ export {
6475
6479
  W as getApi,
6476
6480
  Fe as getAuthStore,
6477
6481
  Tn as getConnectionStatus,
6478
- Pe as getEcho,
6479
- ss as getEchoConnectionStatus,
6482
+ Ae as getEcho,
6483
+ rs as getEchoConnectionStatus,
6480
6484
  We as getEchoInitializedEvent,
6481
6485
  Z as getErrorMessage,
6482
6486
  Kt as getLoggerFactory,
6483
- ps as getMainApi,
6487
+ gs as getMainApi,
6484
6488
  yo as getMainEcho,
6485
6489
  _o as getMainEchoConnectionStatus,
6486
6490
  bo as getMainEchoInitializedEvent,
@@ -6497,9 +6501,9 @@ export {
6497
6501
  Oi as isValidMessageSentEvent,
6498
6502
  qi as isValidReactionToggledEvent,
6499
6503
  zi as isValidRequestAcceptedEvent,
6500
- Re as messagingApi,
6504
+ Pe as messagingApi,
6501
6505
  Uo as normalizePresenceStatus,
6502
- gs as normalizePresenceTimestamp,
6506
+ ms as normalizePresenceTimestamp,
6503
6507
  ht as onConnectionStatusChange,
6504
6508
  So as onMainEchoConnectionStatusChange,
6505
6509
  Ei as onMessagingAccessStateChange,
@@ -6538,5 +6542,5 @@ export {
6538
6542
  Gt as useMessagingStore,
6539
6543
  nc as usePresence,
6540
6544
  sc as useTypingChannel,
6541
- Ti as waitForEcho
6545
+ ss as waitForEcho
6542
6546
  };