liveroom-client-element 0.0.25 → 0.0.26

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.
@@ -1,37 +1,37 @@
1
- var Oe = Object.defineProperty;
2
- var Se = (s, n, t) => n in s ? Oe(s, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[n] = t;
3
- var g = (s, n, t) => (Se(s, typeof n != "symbol" ? n + "" : n, t), t);
4
- function dt() {
1
+ var Se = Object.defineProperty;
2
+ var xe = (s, n, t) => n in s ? Se(s, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[n] = t;
3
+ var d = (s, n, t) => (xe(s, typeof n != "symbol" ? n + "" : n, t), t);
4
+ function mt() {
5
5
  }
6
- function ae(s) {
6
+ function he(s) {
7
7
  return s();
8
8
  }
9
- function Zt() {
9
+ function Qt() {
10
10
  return /* @__PURE__ */ Object.create(null);
11
11
  }
12
- function yt(s) {
13
- s.forEach(ae);
12
+ function bt(s) {
13
+ s.forEach(he);
14
14
  }
15
- function he(s) {
15
+ function ce(s) {
16
16
  return typeof s == "function";
17
17
  }
18
- function xe(s, n) {
18
+ function Me(s, n) {
19
19
  return s != s ? n == n : s !== n || s && typeof s == "object" || typeof s == "function";
20
20
  }
21
- function Me(s) {
21
+ function Le(s) {
22
22
  return Object.keys(s).length === 0;
23
23
  }
24
- function z(s, n) {
24
+ function X(s, n) {
25
25
  s.appendChild(n);
26
26
  }
27
- function Le(s, n, t) {
28
- const e = Ne(s);
27
+ function Ne(s, n, t) {
28
+ const e = Re(s);
29
29
  if (!e.getElementById(n)) {
30
- const r = et("style");
31
- r.id = n, r.textContent = t, Re(e, r);
30
+ const r = rt("style");
31
+ r.id = n, r.textContent = t, He(e, r);
32
32
  }
33
33
  }
34
- function Ne(s) {
34
+ function Re(s) {
35
35
  if (!s)
36
36
  return document;
37
37
  const n = s.getRootNode ? s.getRootNode() : s.ownerDocument;
@@ -41,30 +41,30 @@ function Ne(s) {
41
41
  n
42
42
  ) : s.ownerDocument;
43
43
  }
44
- function Re(s, n) {
45
- return z(
44
+ function He(s, n) {
45
+ return X(
46
46
  /** @type {Document} */
47
47
  s.head || s,
48
48
  n
49
49
  ), n.sheet;
50
50
  }
51
- function At(s, n, t) {
51
+ function xt(s, n, t) {
52
52
  s.insertBefore(n, t || null);
53
53
  }
54
- function mt(s) {
54
+ function Et(s) {
55
55
  s.parentNode && s.parentNode.removeChild(s);
56
56
  }
57
- function et(s) {
57
+ function rt(s) {
58
58
  return document.createElement(s);
59
59
  }
60
- function Qt(s) {
60
+ function Kt(s) {
61
61
  return document.createElementNS("http://www.w3.org/2000/svg", s);
62
62
  }
63
- function ce(s) {
63
+ function le(s) {
64
64
  return document.createTextNode(s);
65
65
  }
66
- function xt() {
67
- return ce(" ");
66
+ function Rt() {
67
+ return le(" ");
68
68
  }
69
69
  function S(s, n, t) {
70
70
  t == null ? s.removeAttribute(n) : s.getAttribute(n) !== t && s.setAttribute(n, t);
@@ -72,14 +72,14 @@ function S(s, n, t) {
72
72
  function Pe(s) {
73
73
  return Array.from(s.childNodes);
74
74
  }
75
- function He(s, n) {
75
+ function Ie(s, n) {
76
76
  n = "" + n, s.data !== n && (s.data = /** @type {string} */
77
77
  n);
78
78
  }
79
- function rt(s, n, t, e) {
79
+ function at(s, n, t, e) {
80
80
  t == null ? s.style.removeProperty(n) : s.style.setProperty(n, t, e ? "important" : "");
81
81
  }
82
- function Ie(s) {
82
+ function De(s) {
83
83
  const n = {};
84
84
  return s.childNodes.forEach(
85
85
  /** @param {Element} node */
@@ -88,131 +88,131 @@ function Ie(s) {
88
88
  }
89
89
  ), n;
90
90
  }
91
- let gt;
92
- function lt(s) {
93
- gt = s;
91
+ let wt;
92
+ function gt(s) {
93
+ wt = s;
94
94
  }
95
- function le() {
96
- if (!gt)
95
+ function ue() {
96
+ if (!wt)
97
97
  throw new Error("Function called outside component initialization");
98
- return gt;
99
- }
100
- function De(s) {
101
- le().$$.on_mount.push(s);
98
+ return wt;
102
99
  }
103
100
  function Ue(s) {
104
- le().$$.on_destroy.push(s);
105
- }
106
- const ot = [], Kt = [];
107
- let at = [];
108
- const te = [], Je = /* @__PURE__ */ Promise.resolve();
109
- let Nt = !1;
110
- function Ve() {
111
- Nt || (Nt = !0, Je.then(ut));
112
- }
113
- function Rt(s) {
114
- at.push(s);
115
- }
116
- const Mt = /* @__PURE__ */ new Set();
117
- let it = 0;
118
- function ut() {
119
- if (it !== 0)
101
+ ue().$$.on_mount.push(s);
102
+ }
103
+ function Je(s) {
104
+ ue().$$.on_destroy.push(s);
105
+ }
106
+ const ct = [], te = [];
107
+ let ut = [];
108
+ const ee = [], Ve = /* @__PURE__ */ Promise.resolve();
109
+ let It = !1;
110
+ function Be() {
111
+ It || (It = !0, Ve.then(lt));
112
+ }
113
+ function Dt(s) {
114
+ ut.push(s);
115
+ }
116
+ const Ht = /* @__PURE__ */ new Set();
117
+ let ht = 0;
118
+ function lt() {
119
+ if (ht !== 0)
120
120
  return;
121
- const s = gt;
121
+ const s = wt;
122
122
  do {
123
123
  try {
124
- for (; it < ot.length; ) {
125
- const n = ot[it];
126
- it++, lt(n), Be(n.$$);
124
+ for (; ht < ct.length; ) {
125
+ const n = ct[ht];
126
+ ht++, gt(n), Fe(n.$$);
127
127
  }
128
128
  } catch (n) {
129
- throw ot.length = 0, it = 0, n;
129
+ throw ct.length = 0, ht = 0, n;
130
130
  }
131
- for (lt(null), ot.length = 0, it = 0; Kt.length; )
132
- Kt.pop()();
133
- for (let n = 0; n < at.length; n += 1) {
134
- const t = at[n];
135
- Mt.has(t) || (Mt.add(t), t());
131
+ for (gt(null), ct.length = 0, ht = 0; te.length; )
132
+ te.pop()();
133
+ for (let n = 0; n < ut.length; n += 1) {
134
+ const t = ut[n];
135
+ Ht.has(t) || (Ht.add(t), t());
136
136
  }
137
- at.length = 0;
138
- } while (ot.length);
139
- for (; te.length; )
140
- te.pop()();
141
- Nt = !1, Mt.clear(), lt(s);
137
+ ut.length = 0;
138
+ } while (ct.length);
139
+ for (; ee.length; )
140
+ ee.pop()();
141
+ It = !1, Ht.clear(), gt(s);
142
142
  }
143
- function Be(s) {
143
+ function Fe(s) {
144
144
  if (s.fragment !== null) {
145
- s.update(), yt(s.before_update);
145
+ s.update(), bt(s.before_update);
146
146
  const n = s.dirty;
147
- s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, n), s.after_update.forEach(Rt);
147
+ s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, n), s.after_update.forEach(Dt);
148
148
  }
149
149
  }
150
- function Fe(s) {
150
+ function ze(s) {
151
151
  const n = [], t = [];
152
- at.forEach((e) => s.indexOf(e) === -1 ? n.push(e) : t.push(e)), t.forEach((e) => e()), at = n;
152
+ ut.forEach((e) => s.indexOf(e) === -1 ? n.push(e) : t.push(e)), t.forEach((e) => e()), ut = n;
153
153
  }
154
- const ze = /* @__PURE__ */ new Set();
155
- function ue(s, n) {
156
- s && s.i && (ze.delete(s), s.i(n));
154
+ const We = /* @__PURE__ */ new Set();
155
+ function pe(s, n) {
156
+ s && s.i && (We.delete(s), s.i(n));
157
157
  }
158
- function ee(s) {
158
+ function se(s) {
159
159
  return (s == null ? void 0 : s.length) !== void 0 ? s : Array.from(s);
160
160
  }
161
- function We(s, n) {
161
+ function Ge(s, n) {
162
162
  s.d(1), n.delete(s.key);
163
163
  }
164
- function Ge(s, n, t, e, r, i, o, h, p, f, d, _) {
164
+ function Xe(s, n, t, e, r, i, a, h, p, g, _, f) {
165
165
  let A = s.length, T = i.length, x = A;
166
166
  const H = {};
167
167
  for (; x--; )
168
168
  H[s[x].key] = x;
169
- const M = [], G = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), Y = [];
169
+ const M = [], q = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), tt = [];
170
170
  for (x = T; x--; ) {
171
- const O = _(r, i, x), m = t(O);
172
- let L = o.get(m);
173
- L ? e && Y.push(() => L.p(O, n)) : (L = f(m, O), L.c()), G.set(m, M[x] = L), m in H && X.set(m, Math.abs(x - H[m]));
171
+ const O = f(r, i, x), P = t(O);
172
+ let m = a.get(P);
173
+ m ? e && tt.push(() => m.p(O, n)) : (m = g(P, O), m.c()), q.set(P, M[x] = m), P in H && Z.set(P, Math.abs(x - H[P]));
174
174
  }
175
- const Z = /* @__PURE__ */ new Set(), Q = /* @__PURE__ */ new Set();
176
- function K(O) {
177
- ue(O, 1), O.m(h, d), o.set(O.key, O), d = O.first, T--;
175
+ const et = /* @__PURE__ */ new Set(), st = /* @__PURE__ */ new Set();
176
+ function Q(O) {
177
+ pe(O, 1), O.m(h, _), a.set(O.key, O), _ = O.first, T--;
178
178
  }
179
179
  for (; A && T; ) {
180
- const O = M[T - 1], m = s[A - 1], L = O.key, R = m.key;
181
- O === m ? (d = O.first, A--, T--) : G.has(R) ? !o.has(L) || Z.has(L) ? K(O) : Q.has(R) ? A-- : X.get(L) > X.get(R) ? (Q.add(L), K(O)) : (Z.add(R), A--) : (p(m, o), A--);
180
+ const O = M[T - 1], P = s[A - 1], m = O.key, I = P.key;
181
+ O === P ? (_ = O.first, A--, T--) : q.has(I) ? !a.has(m) || et.has(m) ? Q(O) : st.has(I) ? A-- : Z.get(m) > Z.get(I) ? (st.add(m), Q(O)) : (et.add(I), A--) : (p(P, a), A--);
182
182
  }
183
183
  for (; A--; ) {
184
184
  const O = s[A];
185
- G.has(O.key) || p(O, o);
185
+ q.has(O.key) || p(O, a);
186
186
  }
187
187
  for (; T; )
188
- K(M[T - 1]);
189
- return yt(Y), M;
188
+ Q(M[T - 1]);
189
+ return bt(tt), M;
190
190
  }
191
- function Xe(s, n, t) {
191
+ function Ye(s, n, t) {
192
192
  const { fragment: e, after_update: r } = s.$$;
193
- e && e.m(n, t), Rt(() => {
194
- const i = s.$$.on_mount.map(ae).filter(he);
195
- s.$$.on_destroy ? s.$$.on_destroy.push(...i) : yt(i), s.$$.on_mount = [];
196
- }), r.forEach(Rt);
193
+ e && e.m(n, t), Dt(() => {
194
+ const i = s.$$.on_mount.map(he).filter(ce);
195
+ s.$$.on_destroy ? s.$$.on_destroy.push(...i) : bt(i), s.$$.on_mount = [];
196
+ }), r.forEach(Dt);
197
197
  }
198
198
  function qe(s, n) {
199
199
  const t = s.$$;
200
- t.fragment !== null && (Fe(t.after_update), yt(t.on_destroy), t.fragment && t.fragment.d(n), t.on_destroy = t.fragment = null, t.ctx = []);
200
+ t.fragment !== null && (ze(t.after_update), bt(t.on_destroy), t.fragment && t.fragment.d(n), t.on_destroy = t.fragment = null, t.ctx = []);
201
201
  }
202
- function Ye(s, n) {
203
- s.$$.dirty[0] === -1 && (ot.push(s), Ve(), s.$$.dirty.fill(0)), s.$$.dirty[n / 31 | 0] |= 1 << n % 31;
202
+ function Ze(s, n) {
203
+ s.$$.dirty[0] === -1 && (ct.push(s), Be(), s.$$.dirty.fill(0)), s.$$.dirty[n / 31 | 0] |= 1 << n % 31;
204
204
  }
205
- function Ze(s, n, t, e, r, i, o, h = [-1]) {
206
- const p = gt;
207
- lt(s);
208
- const f = s.$$ = {
205
+ function Qe(s, n, t, e, r, i, a = null, h = [-1]) {
206
+ const p = wt;
207
+ gt(s);
208
+ const g = s.$$ = {
209
209
  fragment: null,
210
210
  ctx: [],
211
211
  // state
212
212
  props: i,
213
- update: dt,
213
+ update: mt,
214
214
  not_equal: r,
215
- bound: Zt(),
215
+ bound: Qt(),
216
216
  // lifecycle
217
217
  on_mount: [],
218
218
  on_destroy: [],
@@ -221,48 +221,48 @@ function Ze(s, n, t, e, r, i, o, h = [-1]) {
221
221
  after_update: [],
222
222
  context: new Map(n.context || (p ? p.$$.context : [])),
223
223
  // everything else
224
- callbacks: Zt(),
224
+ callbacks: Qt(),
225
225
  dirty: h,
226
226
  skip_bound: !1,
227
227
  root: n.target || p.$$.root
228
228
  };
229
- o && o(f.root);
230
- let d = !1;
231
- if (f.ctx = t ? t(s, n.props || {}, (_, A, ...T) => {
229
+ a && a(g.root);
230
+ let _ = !1;
231
+ if (g.ctx = t ? t(s, n.props || {}, (f, A, ...T) => {
232
232
  const x = T.length ? T[0] : A;
233
- return f.ctx && r(f.ctx[_], f.ctx[_] = x) && (!f.skip_bound && f.bound[_] && f.bound[_](x), d && Ye(s, _)), A;
234
- }) : [], f.update(), d = !0, yt(f.before_update), f.fragment = e ? e(f.ctx) : !1, n.target) {
233
+ return g.ctx && r(g.ctx[f], g.ctx[f] = x) && (!g.skip_bound && g.bound[f] && g.bound[f](x), _ && Ze(s, f)), A;
234
+ }) : [], g.update(), _ = !0, bt(g.before_update), g.fragment = e ? e(g.ctx) : !1, n.target) {
235
235
  if (n.hydrate) {
236
- const _ = Pe(n.target);
237
- f.fragment && f.fragment.l(_), _.forEach(mt);
236
+ const f = Pe(n.target);
237
+ g.fragment && g.fragment.l(f), f.forEach(Et);
238
238
  } else
239
- f.fragment && f.fragment.c();
240
- n.intro && ue(s.$$.fragment), Xe(s, n.target, n.anchor), ut();
239
+ g.fragment && g.fragment.c();
240
+ n.intro && pe(s.$$.fragment), Ye(s, n.target, n.anchor), lt();
241
241
  }
242
- lt(p);
242
+ gt(p);
243
243
  }
244
- let pe;
245
- typeof HTMLElement == "function" && (pe = class extends HTMLElement {
244
+ let fe;
245
+ typeof HTMLElement == "function" && (fe = class extends HTMLElement {
246
246
  constructor(n, t, e) {
247
247
  super();
248
248
  /** The Svelte component constructor */
249
- g(this, "$$ctor");
249
+ d(this, "$$ctor");
250
250
  /** Slots */
251
- g(this, "$$s");
251
+ d(this, "$$s");
252
252
  /** The Svelte component instance */
253
- g(this, "$$c");
253
+ d(this, "$$c");
254
254
  /** Whether or not the custom element is connected */
255
- g(this, "$$cn", !1);
255
+ d(this, "$$cn", !1);
256
256
  /** Component props data */
257
- g(this, "$$d", {});
257
+ d(this, "$$d", {});
258
258
  /** `true` if currently in the process of reflecting component props back to attributes */
259
- g(this, "$$r", !1);
259
+ d(this, "$$r", !1);
260
260
  /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
261
- g(this, "$$p_d", {});
261
+ d(this, "$$p_d", {});
262
262
  /** @type {Record<string, Function[]>} Event listeners */
263
- g(this, "$$l", {});
263
+ d(this, "$$l", {});
264
264
  /** @type {Map<Function, Function>} Event listener unsubscribe functions */
265
- g(this, "$$l_u", /* @__PURE__ */ new Map());
265
+ d(this, "$$l_u", /* @__PURE__ */ new Map());
266
266
  this.$$ctor = n, this.$$s = t, e && this.attachShadow({ mode: "open" });
267
267
  }
268
268
  addEventListener(n, t, e) {
@@ -282,32 +282,32 @@ typeof HTMLElement == "function" && (pe = class extends HTMLElement {
282
282
  if (this.$$cn = !0, !this.$$c) {
283
283
  let n = function(i) {
284
284
  return () => {
285
- let o;
285
+ let a;
286
286
  return {
287
287
  c: function() {
288
- o = et("slot"), i !== "default" && S(o, "name", i);
288
+ a = rt("slot"), i !== "default" && S(a, "name", i);
289
289
  },
290
290
  /**
291
291
  * @param {HTMLElement} target
292
292
  * @param {HTMLElement} [anchor]
293
293
  */
294
- m: function(f, d) {
295
- At(f, o, d);
294
+ m: function(g, _) {
295
+ xt(g, a, _);
296
296
  },
297
- d: function(f) {
298
- f && mt(o);
297
+ d: function(g) {
298
+ g && Et(a);
299
299
  }
300
300
  };
301
301
  };
302
302
  };
303
303
  if (await Promise.resolve(), !this.$$cn)
304
304
  return;
305
- const t = {}, e = Ie(this);
305
+ const t = {}, e = De(this);
306
306
  for (const i of this.$$s)
307
307
  i in e && (t[i] = [n(i)]);
308
308
  for (const i of this.attributes) {
309
- const o = this.$$g_p(i.name);
310
- o in this.$$d || (this.$$d[o] = Et(o, i.value, this.$$p_d, "toProp"));
309
+ const a = this.$$g_p(i.name);
310
+ a in this.$$d || (this.$$d[a] = Tt(a, i.value, this.$$p_d, "toProp"));
311
311
  }
312
312
  this.$$c = new this.$$ctor({
313
313
  target: this.shadowRoot || this,
@@ -323,21 +323,21 @@ typeof HTMLElement == "function" && (pe = class extends HTMLElement {
323
323
  this.$$r = !0;
324
324
  for (const i in this.$$p_d)
325
325
  if (this.$$d[i] = this.$$c.$$.ctx[this.$$c.$$.props[i]], this.$$p_d[i].reflect) {
326
- const o = Et(
326
+ const a = Tt(
327
327
  i,
328
328
  this.$$d[i],
329
329
  this.$$p_d,
330
330
  "toAttribute"
331
331
  );
332
- o == null ? this.removeAttribute(i) : this.setAttribute(this.$$p_d[i].attribute || i, o);
332
+ a == null ? this.removeAttribute(this.$$p_d[i].attribute || i) : this.setAttribute(this.$$p_d[i].attribute || i, a);
333
333
  }
334
334
  this.$$r = !1;
335
335
  };
336
336
  this.$$c.$$.after_update.push(r), r();
337
337
  for (const i in this.$$l)
338
- for (const o of this.$$l[i]) {
339
- const h = this.$$c.$on(i, o);
340
- this.$$l_u.set(o, h);
338
+ for (const a of this.$$l[i]) {
339
+ const h = this.$$c.$on(i, a);
340
+ this.$$l_u.set(a, h);
341
341
  }
342
342
  this.$$l = {};
343
343
  }
@@ -346,7 +346,7 @@ typeof HTMLElement == "function" && (pe = class extends HTMLElement {
346
346
  // and setting attributes through setAttribute etc, this is helpful
347
347
  attributeChangedCallback(n, t, e) {
348
348
  var r;
349
- this.$$r || (n = this.$$g_p(n), this.$$d[n] = Et(n, e, this.$$p_d, "toProp"), (r = this.$$c) == null || r.$set({ [n]: this.$$d[n] }));
349
+ this.$$r || (n = this.$$g_p(n), this.$$d[n] = Tt(n, e, this.$$p_d, "toProp"), (r = this.$$c) == null || r.$set({ [n]: this.$$d[n] }));
350
350
  }
351
351
  disconnectedCallback() {
352
352
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -359,7 +359,7 @@ typeof HTMLElement == "function" && (pe = class extends HTMLElement {
359
359
  ) || n;
360
360
  }
361
361
  });
362
- function Et(s, n, t, e) {
362
+ function Tt(s, n, t, e) {
363
363
  var i;
364
364
  const r = (i = t[s]) == null ? void 0 : i.type;
365
365
  if (n = r === "Boolean" && typeof n != "boolean" ? n != null : n, !e || !t[s])
@@ -389,8 +389,8 @@ function Et(s, n, t, e) {
389
389
  return n;
390
390
  }
391
391
  }
392
- function Qe(s, n, t, e, r, i) {
393
- let o = class extends pe {
392
+ function Ke(s, n, t, e, r, i) {
393
+ let a = class extends fe {
394
394
  constructor() {
395
395
  super(s, t, r), this.$$p_d = n;
396
396
  }
@@ -401,26 +401,26 @@ function Qe(s, n, t, e, r, i) {
401
401
  }
402
402
  };
403
403
  return Object.keys(n).forEach((h) => {
404
- Object.defineProperty(o.prototype, h, {
404
+ Object.defineProperty(a.prototype, h, {
405
405
  get() {
406
406
  return this.$$c && h in this.$$c ? this.$$c[h] : this.$$d[h];
407
407
  },
408
408
  set(p) {
409
- var f;
410
- p = Et(h, p, n), this.$$d[h] = p, (f = this.$$c) == null || f.$set({ [h]: p });
409
+ var g;
410
+ p = Tt(h, p, n), this.$$d[h] = p, (g = this.$$c) == null || g.$set({ [h]: p });
411
411
  }
412
412
  });
413
413
  }), e.forEach((h) => {
414
- Object.defineProperty(o.prototype, h, {
414
+ Object.defineProperty(a.prototype, h, {
415
415
  get() {
416
416
  var p;
417
417
  return (p = this.$$c) == null ? void 0 : p[h];
418
418
  }
419
419
  });
420
- }), i && (o = i(o)), s.element = /** @type {any} */
421
- o, o;
420
+ }), i && (a = i(a)), s.element = /** @type {any} */
421
+ a, a;
422
422
  }
423
- class Ke {
423
+ class ts {
424
424
  constructor() {
425
425
  /**
426
426
  * ### PRIVATE API
@@ -429,7 +429,7 @@ class Ke {
429
429
  *
430
430
  * @type {any}
431
431
  */
432
- g(this, "$$");
432
+ d(this, "$$");
433
433
  /**
434
434
  * ### PRIVATE API
435
435
  *
@@ -437,11 +437,11 @@ class Ke {
437
437
  *
438
438
  * @type {any}
439
439
  */
440
- g(this, "$$set");
440
+ d(this, "$$set");
441
441
  }
442
442
  /** @returns {void} */
443
443
  $destroy() {
444
- qe(this, 1), this.$destroy = dt;
444
+ qe(this, 1), this.$destroy = mt;
445
445
  }
446
446
  /**
447
447
  * @template {Extract<keyof Events, string>} K
@@ -450,8 +450,8 @@ class Ke {
450
450
  * @returns {() => void}
451
451
  */
452
452
  $on(n, t) {
453
- if (!he(t))
454
- return dt;
453
+ if (!ce(t))
454
+ return mt;
455
455
  const e = this.$$.callbacks[n] || (this.$$.callbacks[n] = []);
456
456
  return e.push(t), () => {
457
457
  const r = e.indexOf(t);
@@ -463,60 +463,60 @@ class Ke {
463
463
  * @returns {void}
464
464
  */
465
465
  $set(n) {
466
- this.$$set && !Me(n) && (this.$$.skip_bound = !0, this.$$set(n), this.$$.skip_bound = !1);
466
+ this.$$set && !Le(n) && (this.$$.skip_bound = !0, this.$$set(n), this.$$.skip_bound = !1);
467
467
  }
468
468
  }
469
- const ts = "4";
470
- typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ts);
471
- const { isArray: es } = Array, ss = Object.keys, vt = (s) => {
469
+ const es = "4";
470
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(es);
471
+ const { isArray: ss } = Array, ns = Object.keys, _t = (s) => {
472
472
  if (!s)
473
473
  return s;
474
- if (es(s)) {
474
+ if (ss(s)) {
475
475
  const n = [], t = s.length;
476
476
  for (let e = 0; e < t; e++)
477
- n.push(vt(s[e]));
477
+ n.push(_t(s[e]));
478
478
  return n;
479
479
  } else if (typeof s == "object") {
480
- const n = ss(s), t = n.length, e = {};
480
+ const n = ns(s), t = n.length, e = {};
481
481
  for (let r = 0; r < t; r++) {
482
482
  const i = n[r];
483
- e[i] = vt(s[i]);
483
+ e[i] = _t(s[i]);
484
484
  }
485
485
  return e;
486
486
  }
487
487
  return s;
488
488
  };
489
- class J {
489
+ class B {
490
490
  constructor(n) {
491
- g(this, "path");
492
- g(this, "from");
491
+ d(this, "path");
492
+ d(this, "from");
493
493
  this.path = n;
494
494
  }
495
495
  }
496
- const ns = /~1/g, rs = /~0/g, is = /~/g, os = /\//g;
497
- function as(s) {
498
- return s.indexOf("~") === -1 ? s : s.replace(ns, "/").replace(rs, "~");
499
- }
496
+ const rs = /~1/g, is = /~0/g, os = /~/g, as = /\//g;
500
497
  function hs(s) {
501
- return s.indexOf("/") === -1 && s.indexOf("~") === -1 ? s : s.replace(is, "~0").replace(os, "~1");
498
+ return s.indexOf("~") === -1 ? s : s.replace(rs, "/").replace(is, "~");
502
499
  }
503
500
  function cs(s) {
504
- return s ? s.slice(1).split("/").map(as) : [];
501
+ return s.indexOf("/") === -1 && s.indexOf("~") === -1 ? s : s.replace(os, "~0").replace(as, "~1");
502
+ }
503
+ function ls(s) {
504
+ return s ? s.slice(1).split("/").map(hs) : [];
505
505
  }
506
506
  function $(s) {
507
- return ls(s) ? "" : "/" + s.map((n) => hs(String(n))).join("/");
507
+ return us(s) ? "" : "/" + s.map((n) => cs(String(n))).join("/");
508
508
  }
509
- const E = (s) => typeof s == "string" ? cs(s) : s, ls = (s) => !s.length, us = Object.prototype.hasOwnProperty;
510
- function ps(s, n) {
511
- return us.call(s, n);
509
+ const E = (s) => typeof s == "string" ? ls(s) : s, us = (s) => !s.length, ps = Object.prototype.hasOwnProperty;
510
+ function fs(s, n) {
511
+ return ps.call(s, n);
512
512
  }
513
- const { isArray: fe } = Array, j = (s, n) => {
513
+ const { isArray: de } = Array, j = (s, n) => {
514
514
  const t = n.length;
515
515
  if (!t)
516
516
  return { val: s };
517
517
  let e, r;
518
- for (let o = 0; o < t; o++)
519
- if (e = s, r = n[o], fe(e)) {
518
+ for (let a = 0; a < t; a++)
519
+ if (e = s, r = n[a], de(e)) {
520
520
  const h = e.length;
521
521
  if (r === "-")
522
522
  r = h;
@@ -529,15 +529,15 @@ const { isArray: fe } = Array, j = (s, n) => {
529
529
  }
530
530
  s = e[r];
531
531
  } else if (typeof e == "object" && e)
532
- s = ps(e, r) ? e[r] : void 0;
532
+ s = fs(e, r) ? e[r] : void 0;
533
533
  else
534
534
  throw new Error("NOT_FOUND");
535
535
  return { val: s, obj: e, key: r };
536
- }, wt = (s) => fe(s.obj) && typeof s.key == "number", jt = (s) => typeof s.obj == "object" && typeof s.key == "string";
537
- class Dt extends J {
536
+ }, kt = (s) => de(s.obj) && typeof s.key == "number", Mt = (s) => typeof s.obj == "object" && typeof s.key == "string";
537
+ class Ft extends B {
538
538
  constructor(t, e) {
539
539
  super(t);
540
- g(this, "value");
540
+ d(this, "value");
541
541
  this.value = e;
542
542
  }
543
543
  op() {
@@ -547,19 +547,19 @@ class Dt extends J {
547
547
  return 0;
548
548
  }
549
549
  apply(t) {
550
- const { val: e, key: r, obj: i } = j(t, this.path), o = vt(this.value);
550
+ const { val: e, key: r, obj: i } = j(t, this.path), a = _t(this.value);
551
551
  if (!i)
552
- t = o;
552
+ t = a;
553
553
  else if (typeof r == "string")
554
- i[r] = o;
554
+ i[r] = a;
555
555
  else {
556
556
  const h = i.length;
557
557
  if (r < h)
558
- i.splice(r, 0, o);
558
+ i.splice(r, 0, a);
559
559
  else {
560
560
  if (r > h)
561
561
  throw new Error("INVALID_INDEX");
562
- i.push(o);
562
+ i.push(a);
563
563
  }
564
564
  }
565
565
  return { doc: t, old: e };
@@ -578,10 +578,10 @@ class Dt extends J {
578
578
  t.encodeArrayHeader(3), t.writer.u8(0), t.encodeArray(this.path), t.encodeAny(this.value);
579
579
  }
580
580
  }
581
- class de extends J {
581
+ class ge extends B {
582
582
  constructor(t, e) {
583
583
  super(t);
584
- g(this, "oldValue");
584
+ d(this, "oldValue");
585
585
  this.oldValue = e;
586
586
  }
587
587
  op() {
@@ -594,7 +594,7 @@ class de extends J {
594
594
  const e = j(t, this.path);
595
595
  if (e.val === void 0)
596
596
  throw new Error("NOT_FOUND");
597
- return jt(e) ? delete e.obj[e.key] : wt(e) ? e.val !== void 0 && e.obj.splice(e.key, 1) : t = null, { doc: t, old: e.val };
597
+ return Mt(e) ? delete e.obj[e.key] : kt(e) ? e.val !== void 0 && e.obj.splice(e.key, 1) : t = null, { doc: t, old: e.val };
598
598
  }
599
599
  toJson(t) {
600
600
  const e = {
@@ -612,11 +612,11 @@ class de extends J {
612
612
  t.encodeArrayHeader(r ? 3 : 2), t.writer.u8(1), t.encodeArray(this.path), r && t.encodeAny(this.oldValue);
613
613
  }
614
614
  }
615
- class fs extends J {
615
+ class ds extends B {
616
616
  constructor(t, e, r) {
617
617
  super(t);
618
- g(this, "value");
619
- g(this, "oldValue");
618
+ d(this, "value");
619
+ d(this, "oldValue");
620
620
  this.value = e, this.oldValue = r;
621
621
  }
622
622
  op() {
@@ -629,7 +629,7 @@ class fs extends J {
629
629
  const e = j(t, this.path);
630
630
  if (e.val === void 0)
631
631
  throw new Error("NOT_FOUND");
632
- return jt(e) ? e.obj[e.key] = this.value : wt(e) ? e.obj[e.key] = this.value : t = this.value, { doc: t, old: e.val };
632
+ return Mt(e) ? e.obj[e.key] = this.value : kt(e) ? e.obj[e.key] = this.value : t = this.value, { doc: t, old: e.val };
633
633
  }
634
634
  toJson(t) {
635
635
  const e = {
@@ -648,10 +648,10 @@ class fs extends J {
648
648
  t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(2), t.encodeArray(this.path), t.encodeAny(this.value), r && t.encodeAny(this.oldValue);
649
649
  }
650
650
  }
651
- class ds extends J {
651
+ class gs extends B {
652
652
  constructor(t, e) {
653
653
  super(t);
654
- g(this, "from");
654
+ d(this, "from");
655
655
  this.from = e;
656
656
  }
657
657
  op() {
@@ -661,8 +661,8 @@ class ds extends J {
661
661
  return 4;
662
662
  }
663
663
  apply(t) {
664
- const e = new de(E(this.from), void 0).apply(t);
665
- return new Dt(this.path, e.old).apply(e.doc);
664
+ const e = new ge(E(this.from), void 0).apply(t);
665
+ return new Ft(this.path, e.old).apply(e.doc);
666
666
  }
667
667
  toJson(t) {
668
668
  return {
@@ -678,10 +678,10 @@ class ds extends J {
678
678
  t.encodeArrayHeader(3), t.writer.u8(4), t.encodeArray(this.path), t.encodeArray(this.from);
679
679
  }
680
680
  }
681
- class gs extends J {
681
+ class vs extends B {
682
682
  constructor(t, e) {
683
683
  super(t);
684
- g(this, "from");
684
+ d(this, "from");
685
685
  this.from = e;
686
686
  }
687
687
  op() {
@@ -694,7 +694,7 @@ class gs extends J {
694
694
  const { val: e } = j(t, this.from);
695
695
  if (e === void 0)
696
696
  throw new Error("NOT_FOUND");
697
- return new Dt(this.path, vt(e)).apply(t);
697
+ return new Ft(this.path, _t(e)).apply(t);
698
698
  }
699
699
  toJson(t) {
700
700
  return {
@@ -710,14 +710,14 @@ class gs extends J {
710
710
  t.encodeArrayHeader(3), t.writer.u8(3), t.encodeArray(this.path), t.encodeArray(this.from);
711
711
  }
712
712
  }
713
- class D extends J {
713
+ class U extends B {
714
714
  apply(n) {
715
715
  if (!this.test(n))
716
716
  throw new Error("TEST");
717
717
  return { doc: n };
718
718
  }
719
719
  }
720
- const Ct = (s, n) => {
720
+ const Ot = (s, n) => {
721
721
  if (s === n)
722
722
  return !0;
723
723
  if (s && n && typeof s == "object" && typeof n == "object") {
@@ -728,7 +728,7 @@ const Ct = (s, n) => {
728
728
  if (t = s.length, t !== n.length)
729
729
  return !1;
730
730
  for (e = t; e-- !== 0; )
731
- if (!Ct(s[e], n[e]))
731
+ if (!Ot(s[e], n[e]))
732
732
  return !1;
733
733
  return !0;
734
734
  }
@@ -736,18 +736,18 @@ const Ct = (s, n) => {
736
736
  return !1;
737
737
  for (e = t; e-- !== 0; ) {
738
738
  const i = r[e];
739
- if (!Ct(s[i], n[i]))
739
+ if (!Ot(s[i], n[i]))
740
740
  return !1;
741
741
  }
742
742
  return !0;
743
743
  }
744
744
  return !1;
745
745
  };
746
- class vs extends D {
746
+ class ys extends U {
747
747
  constructor(t, e, r) {
748
748
  super(t);
749
- g(this, "value");
750
- g(this, "not");
749
+ d(this, "value");
750
+ d(this, "not");
751
751
  this.value = e, this.not = r;
752
752
  }
753
753
  op() {
@@ -760,7 +760,7 @@ class vs extends D {
760
760
  const { val: e } = j(t, this.path);
761
761
  if (e === void 0)
762
762
  return !!this.not;
763
- const r = Ct(e, this.value);
763
+ const r = Ot(e, this.value);
764
764
  return this.not ? !r : r;
765
765
  }
766
766
  toJson(t) {
@@ -779,7 +779,7 @@ class vs extends D {
779
779
  t.encodeArrayHeader(this.not ? 4 : 3), t.writer.u8(5), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeAny(this.value), this.not && t.writer.u8(1);
780
780
  }
781
781
  }
782
- class ys extends J {
782
+ class ms extends B {
783
783
  constructor(n) {
784
784
  super(n);
785
785
  }
@@ -806,10 +806,10 @@ class ys extends J {
806
806
  n.encodeArrayHeader(2), n.writer.u8(8), n.encodeArray(this.path);
807
807
  }
808
808
  }
809
- class ms extends J {
809
+ class ws extends B {
810
810
  constructor(t, e) {
811
811
  super(t);
812
- g(this, "inc");
812
+ d(this, "inc");
813
813
  this.inc = e;
814
814
  }
815
815
  op() {
@@ -836,11 +836,11 @@ class ms extends J {
836
836
  t.encodeArrayHeader(3), t.writer.u8(9), t.encodeArray(this.path), t.encodeNumber(this.inc);
837
837
  }
838
838
  }
839
- class ws extends J {
839
+ class _s extends B {
840
840
  constructor(t, e, r) {
841
841
  super(t);
842
- g(this, "pos");
843
- g(this, "str");
842
+ d(this, "pos");
843
+ d(this, "str");
844
844
  this.pos = e, this.str = r;
845
845
  }
846
846
  op() {
@@ -857,8 +857,8 @@ class ws extends J {
857
857
  if (this.pos !== 0)
858
858
  throw new Error("POS");
859
859
  }
860
- const o = typeof e == "string" ? e : "", h = Math.min(this.pos, o.length), p = o.slice(0, h), f = o.slice(h), d = p + this.str + f;
861
- return i ? i[r] = d : t = d, { doc: t, old: e };
860
+ const a = typeof e == "string" ? e : "", h = Math.min(this.pos, a.length), p = a.slice(0, h), g = a.slice(h), _ = p + this.str + g;
861
+ return i ? i[r] = _ : t = _, { doc: t, old: e };
862
862
  }
863
863
  toJson(t) {
864
864
  return {
@@ -875,12 +875,12 @@ class ws extends J {
875
875
  t.encodeArrayHeader(4), t.writer.u8(6), t.encodeArray(this.path), t.encodeNumber(this.pos), t.encodeString(this.str);
876
876
  }
877
877
  }
878
- class _s extends J {
878
+ class bs extends B {
879
879
  constructor(t, e, r, i) {
880
880
  super(t);
881
- g(this, "pos");
882
- g(this, "str");
883
- g(this, "len");
881
+ d(this, "pos");
882
+ d(this, "str");
883
+ d(this, "len");
884
884
  this.pos = e, this.str = r, this.len = i;
885
885
  }
886
886
  op() {
@@ -896,7 +896,7 @@ class _s extends J {
896
896
  const { val: e, key: r, obj: i } = j(t, this.path);
897
897
  if (typeof e != "string")
898
898
  throw new Error("NOT_A_STRING");
899
- const o = e.length, h = Math.min(this.pos, e.length), p = Math.min(h, o), f = this.str !== void 0 ? this.str.length : this.len, d = Math.min(h + f, o), _ = e.slice(0, p), A = e.substr(d), T = _ + A;
899
+ const a = e.length, h = Math.min(this.pos, e.length), p = Math.min(h, a), g = this.str !== void 0 ? this.str.length : this.len, _ = Math.min(h + g, a), f = e.slice(0, p), A = e.substr(_), T = f + A;
900
900
  return i ? i[r] = T : t = T, { doc: t, old: e };
901
901
  }
902
902
  toJson(t) {
@@ -921,15 +921,15 @@ class _s extends J {
921
921
  t.encodeArrayHeader(r ? 4 : 5), t.writer.u8(7), t.encodeArray(this.path), t.encodeNumber(this.pos), r ? t.encodeString(this.str) : (t.writer.u8(0), t.encodeNumber(this.len));
922
922
  }
923
923
  }
924
- const { isArray: bs } = Array, Pt = (s) => !!s && typeof s == "object" && typeof s.text == "string", Ht = (s) => !!s && typeof s == "object" && bs(s.children), Es = (s, n) => {
924
+ const { isArray: Es } = Array, Ut = (s) => !!s && typeof s == "object" && typeof s.text == "string", Jt = (s) => !!s && typeof s == "object" && Es(s.children), ks = (s, n) => {
925
925
  const t = new RegExp(s, n ? "i" : void 0);
926
926
  return (e) => t.test(e);
927
927
  };
928
- class ks extends J {
928
+ class Cs extends B {
929
929
  constructor(t, e, r) {
930
930
  super(t);
931
- g(this, "pos");
932
- g(this, "props");
931
+ d(this, "pos");
932
+ d(this, "props");
933
933
  this.pos = e, this.props = r;
934
934
  }
935
935
  op() {
@@ -943,11 +943,11 @@ class ks extends J {
943
943
  if (e.val === void 0)
944
944
  throw new Error("NOT_FOUND");
945
945
  const r = this.split(e.val);
946
- return jt(e) ? e.obj[e.key] = r : wt(e) ? (e.obj[e.key] = r[0], e.obj.splice(e.key + 1, 0, r[1])) : t = r, { doc: t, old: e.val };
946
+ return Mt(e) ? e.obj[e.key] = r : kt(e) ? (e.obj[e.key] = r[0], e.obj.splice(e.key + 1, 0, r[1])) : t = r, { doc: t, old: e.val };
947
947
  }
948
948
  split(t) {
949
949
  if (typeof t == "string") {
950
- const { pos: e, props: r } = this, i = t.slice(0, e), o = t.slice(e);
950
+ const { pos: e, props: r } = this, i = t.slice(0, e), a = t.slice(e);
951
951
  return r ? [
952
952
  {
953
953
  ...r,
@@ -955,11 +955,11 @@ class ks extends J {
955
955
  },
956
956
  {
957
957
  ...r,
958
- text: o
958
+ text: a
959
959
  }
960
- ] : [i, o];
961
- } else if (Pt(t)) {
962
- const { pos: e, props: r } = this, i = t.text.slice(0, e), o = t.text.slice(e);
960
+ ] : [i, a];
961
+ } else if (Ut(t)) {
962
+ const { pos: e, props: r } = this, i = t.text.slice(0, e), a = t.text.slice(e);
963
963
  return [
964
964
  {
965
965
  ...t,
@@ -969,11 +969,11 @@ class ks extends J {
969
969
  {
970
970
  ...t,
971
971
  ...r,
972
- text: o
972
+ text: a
973
973
  }
974
974
  ];
975
- } else if (Ht(t)) {
976
- const { pos: e, props: r } = this, i = t.children.slice(0, e), o = t.children.slice(e);
975
+ } else if (Jt(t)) {
976
+ const { pos: e, props: r } = this, i = t.children.slice(0, e), a = t.children.slice(e);
977
977
  return [
978
978
  {
979
979
  ...t,
@@ -983,7 +983,7 @@ class ks extends J {
983
983
  {
984
984
  ...t,
985
985
  ...r,
986
- children: o
986
+ children: a
987
987
  }
988
988
  ];
989
989
  } else if (typeof t == "number") {
@@ -1008,11 +1008,11 @@ class ks extends J {
1008
1008
  t.encodeArrayHeader(this.props ? 4 : 3), t.writer.u8(10), t.encodeArray(this.path), t.encodeNumber(this.pos), this.props && t.encodeObject(this.props);
1009
1009
  }
1010
1010
  }
1011
- class Cs extends J {
1011
+ class $s extends B {
1012
1012
  constructor(t, e, r) {
1013
1013
  super(t);
1014
- g(this, "pos");
1015
- g(this, "props");
1014
+ d(this, "pos");
1015
+ d(this, "props");
1016
1016
  this.pos = e, this.props = r;
1017
1017
  }
1018
1018
  op() {
@@ -1023,15 +1023,15 @@ class Cs extends J {
1023
1023
  }
1024
1024
  apply(t) {
1025
1025
  const e = j(t, this.path);
1026
- if (!wt(e))
1026
+ if (!kt(e))
1027
1027
  throw new Error("INVALID_TARGET");
1028
1028
  if (e.key <= 0)
1029
1029
  throw new Error("INVALID_KEY");
1030
- const r = e.obj[e.key - 1], i = e.obj[e.key], o = this.merge(r, i);
1031
- return e.obj[e.key - 1] = o, e.obj.splice(e.key, 1), { doc: t, old: [r, i] };
1030
+ const r = e.obj[e.key - 1], i = e.obj[e.key], a = this.merge(r, i);
1031
+ return e.obj[e.key - 1] = a, e.obj.splice(e.key, 1), { doc: t, old: [r, i] };
1032
1032
  }
1033
1033
  merge(t, e) {
1034
- return typeof t == "string" && typeof e == "string" || typeof t == "number" && typeof e == "number" ? t + e : Pt(t) && Pt(e) ? { ...t, ...e, text: t.text + e.text } : Ht(t) && Ht(e) ? { ...t, ...e, children: [...t.children, ...e.children] } : [t, e];
1034
+ return typeof t == "string" && typeof e == "string" || typeof t == "number" && typeof e == "number" ? t + e : Ut(t) && Ut(e) ? { ...t, ...e, text: t.text + e.text } : Jt(t) && Jt(e) ? { ...t, ...e, children: [...t.children, ...e.children] } : [t, e];
1035
1035
  }
1036
1036
  toJson(t) {
1037
1037
  const e = {
@@ -1049,12 +1049,12 @@ class Cs extends J {
1049
1049
  t.encodeArrayHeader(this.props ? 4 : 3), t.writer.u8(11), t.encodeArray(this.path), t.encodeNumber(this.pos), this.props && t.encodeAny(this.props);
1050
1050
  }
1051
1051
  }
1052
- const { isArray: $s } = Array;
1053
- class As extends J {
1052
+ const { isArray: As } = Array;
1053
+ class Ts extends B {
1054
1054
  constructor(t, e, r) {
1055
1055
  super(t);
1056
- g(this, "props");
1057
- g(this, "deleteNull");
1056
+ d(this, "props");
1057
+ d(this, "deleteNull");
1058
1058
  this.props = e, this.deleteNull = r;
1059
1059
  }
1060
1060
  op() {
@@ -1065,10 +1065,10 @@ class As extends J {
1065
1065
  }
1066
1066
  apply(t) {
1067
1067
  const e = j(t, this.path);
1068
- return wt(e) ? e.val !== void 0 && (e.obj[e.key] = this.extend(e.val)) : jt(e) ? e.obj[e.key] = this.extend(e.val) : t = this.extend(t), { doc: t };
1068
+ return kt(e) ? e.val !== void 0 && (e.obj[e.key] = this.extend(e.val)) : Mt(e) ? e.obj[e.key] = this.extend(e.val) : t = this.extend(t), { doc: t };
1069
1069
  }
1070
1070
  extend(t) {
1071
- if ($s(t) || typeof t != "object" || !t)
1071
+ if (As(t) || typeof t != "object" || !t)
1072
1072
  return t;
1073
1073
  for (const [e, r] of Object.entries(this.props)) {
1074
1074
  if (e === "__proto__")
@@ -1098,7 +1098,7 @@ class As extends J {
1098
1098
  t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(12), t.encodeArray(this.path), t.encodeObject(this.props), r && t.writer.u8(1);
1099
1099
  }
1100
1100
  }
1101
- class js extends D {
1101
+ class js extends U {
1102
1102
  constructor(n) {
1103
1103
  super(n);
1104
1104
  }
@@ -1125,7 +1125,7 @@ class js extends D {
1125
1125
  n.encodeArrayHeader(2), n.writer.u8(31), n.encodeArray(t ? this.path.slice(t.path.length) : this.path);
1126
1126
  }
1127
1127
  }
1128
- class Ts extends D {
1128
+ class Os extends U {
1129
1129
  constructor(n) {
1130
1130
  super(n);
1131
1131
  }
@@ -1158,11 +1158,11 @@ class Ts extends D {
1158
1158
  n.encodeArrayHeader(2), n.writer.u8(38), n.encodeArray(t ? this.path.slice(t.path.length) : this.path);
1159
1159
  }
1160
1160
  }
1161
- const { isArray: Os } = Array;
1162
- class Ss extends D {
1161
+ const { isArray: Ss } = Array;
1162
+ class xs extends U {
1163
1163
  constructor(t, e) {
1164
1164
  super(t);
1165
- g(this, "type");
1165
+ d(this, "type");
1166
1166
  this.type = e;
1167
1167
  }
1168
1168
  op() {
@@ -1173,7 +1173,7 @@ class Ss extends D {
1173
1173
  }
1174
1174
  test(t) {
1175
1175
  const { val: e } = j(t, this.path);
1176
- return e === null ? this.type.indexOf("null") > -1 : Os(e) ? this.type.indexOf("array") > -1 : this.type.indexOf(typeof e) > -1 || typeof e == "number" && e === Math.round(e) && this.type.indexOf("integer") > -1;
1176
+ return e === null ? this.type.indexOf("null") > -1 : Ss(e) ? this.type.indexOf("array") > -1 : this.type.indexOf(typeof e) > -1 || typeof e == "number" && e === Math.round(e) && this.type.indexOf("integer") > -1;
1177
1177
  }
1178
1178
  toJson(t) {
1179
1179
  return {
@@ -1189,12 +1189,12 @@ class Ss extends D {
1189
1189
  t.encodeArrayHeader(3), t.writer.u8(39), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeArray(this.type);
1190
1190
  }
1191
1191
  }
1192
- class xs extends D {
1192
+ class Ms extends U {
1193
1193
  constructor(t, e, r, i) {
1194
1194
  super(t);
1195
- g(this, "pos");
1196
- g(this, "str");
1197
- g(this, "not");
1195
+ d(this, "pos");
1196
+ d(this, "str");
1197
+ d(this, "not");
1198
1198
  this.pos = e, this.str = r, this.not = i;
1199
1199
  }
1200
1200
  op() {
@@ -1207,7 +1207,7 @@ class xs extends D {
1207
1207
  const { val: e } = j(t, this.path);
1208
1208
  if (typeof e != "string")
1209
1209
  return !1;
1210
- const r = e.length, i = Math.min(this.pos, r), o = Math.min(this.pos + this.str.length, r), h = e.substring(i, o) === this.str;
1210
+ const r = e.length, i = Math.min(this.pos, r), a = Math.min(this.pos + this.str.length, r), h = e.substring(i, a) === this.str;
1211
1211
  return this.not ? !h : h;
1212
1212
  }
1213
1213
  toJson(t) {
@@ -1227,11 +1227,11 @@ class xs extends D {
1227
1227
  t.encodeArrayHeader(this.not ? 5 : 4), t.writer.u8(40), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.pos), t.encodeString(this.str), this.not && t.writer.u8(1);
1228
1228
  }
1229
1229
  }
1230
- class Ms extends D {
1230
+ class Ls extends U {
1231
1231
  constructor(t, e, r) {
1232
1232
  super(t);
1233
- g(this, "len");
1234
- g(this, "not");
1233
+ d(this, "len");
1234
+ d(this, "not");
1235
1235
  this.len = e, this.not = r;
1236
1236
  }
1237
1237
  op() {
@@ -1263,11 +1263,11 @@ class Ms extends D {
1263
1263
  t.encodeArrayHeader(this.not ? 4 : 3), t.writer.u8(41), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.len), this.not && t.writer.u8(1);
1264
1264
  }
1265
1265
  }
1266
- class Ls extends D {
1266
+ class Ns extends U {
1267
1267
  constructor(t, e, r) {
1268
1268
  super(t);
1269
- g(this, "value");
1270
- g(this, "ignore_case");
1269
+ d(this, "value");
1270
+ d(this, "ignore_case");
1271
1271
  this.value = e, this.ignore_case = r;
1272
1272
  }
1273
1273
  op() {
@@ -1300,11 +1300,11 @@ class Ls extends D {
1300
1300
  t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(30), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
1301
1301
  }
1302
1302
  }
1303
- class Ns extends D {
1303
+ class Rs extends U {
1304
1304
  constructor(t, e, r) {
1305
1305
  super(t);
1306
- g(this, "value");
1307
- g(this, "ignore_case");
1306
+ d(this, "value");
1307
+ d(this, "ignore_case");
1308
1308
  this.value = e, this.ignore_case = r;
1309
1309
  }
1310
1310
  op() {
@@ -1337,11 +1337,11 @@ class Ns extends D {
1337
1337
  t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(32), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
1338
1338
  }
1339
1339
  }
1340
- class Rs extends D {
1340
+ class Hs extends U {
1341
1341
  constructor(t, e, r) {
1342
1342
  super(t);
1343
- g(this, "value");
1344
- g(this, "ignore_case");
1343
+ d(this, "value");
1344
+ d(this, "ignore_case");
1345
1345
  this.value = e, this.ignore_case = r;
1346
1346
  }
1347
1347
  op() {
@@ -1374,10 +1374,10 @@ class Rs extends D {
1374
1374
  t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(37), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
1375
1375
  }
1376
1376
  }
1377
- class Ps extends D {
1377
+ class Ps extends U {
1378
1378
  constructor(t, e) {
1379
1379
  super(t);
1380
- g(this, "value");
1380
+ d(this, "value");
1381
1381
  this.value = e;
1382
1382
  }
1383
1383
  op() {
@@ -1389,7 +1389,7 @@ class Ps extends D {
1389
1389
  test(t) {
1390
1390
  const { val: e } = j(t, this.path);
1391
1391
  for (const r of this.value)
1392
- if (Ct(e, r))
1392
+ if (Ot(e, r))
1393
1393
  return !0;
1394
1394
  return !1;
1395
1395
  }
@@ -1407,10 +1407,10 @@ class Ps extends D {
1407
1407
  t.encodeArrayHeader(3), t.writer.u8(33), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeArray(this.value);
1408
1408
  }
1409
1409
  }
1410
- class Hs extends D {
1410
+ class Is extends U {
1411
1411
  constructor(t, e) {
1412
1412
  super(t);
1413
- g(this, "value");
1413
+ d(this, "value");
1414
1414
  this.value = e;
1415
1415
  }
1416
1416
  op() {
@@ -1437,10 +1437,10 @@ class Hs extends D {
1437
1437
  t.encodeArrayHeader(3), t.writer.u8(34), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.value);
1438
1438
  }
1439
1439
  }
1440
- class Is extends D {
1440
+ class Ds extends U {
1441
1441
  constructor(t, e) {
1442
1442
  super(t);
1443
- g(this, "value");
1443
+ d(this, "value");
1444
1444
  this.value = e;
1445
1445
  }
1446
1446
  op() {
@@ -1467,17 +1467,17 @@ class Is extends D {
1467
1467
  t.encodeArrayHeader(3), t.writer.u8(36), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeNumber(this.value);
1468
1468
  }
1469
1469
  }
1470
- class Ut extends D {
1470
+ class zt extends U {
1471
1471
  constructor(t, e) {
1472
1472
  super(t);
1473
- g(this, "ops");
1473
+ d(this, "ops");
1474
1474
  this.ops = e;
1475
1475
  }
1476
1476
  }
1477
- class Ds extends Ut {
1477
+ class Us extends zt {
1478
1478
  constructor(t, e) {
1479
1479
  super(t, e);
1480
- g(this, "ops");
1480
+ d(this, "ops");
1481
1481
  this.ops = e;
1482
1482
  }
1483
1483
  op() {
@@ -1511,14 +1511,14 @@ class Ds extends Ut {
1511
1511
  t.encodeArrayHeader(3), t.writer.u8(43), t.encodeArray(r);
1512
1512
  const i = this.ops.length;
1513
1513
  t.encodeArrayHeader(i);
1514
- for (let o = 0; o < i; o++)
1515
- this.ops[o].encode(t, this);
1514
+ for (let a = 0; a < i; a++)
1515
+ this.ops[a].encode(t, this);
1516
1516
  }
1517
1517
  }
1518
- class Us extends Ut {
1518
+ class Js extends zt {
1519
1519
  constructor(t, e) {
1520
1520
  super(t, e);
1521
- g(this, "ops");
1521
+ d(this, "ops");
1522
1522
  this.ops = e;
1523
1523
  }
1524
1524
  op() {
@@ -1555,10 +1555,10 @@ class Us extends Ut {
1555
1555
  this.ops[i].encode(t, this);
1556
1556
  }
1557
1557
  }
1558
- class Js extends Ut {
1558
+ class Vs extends zt {
1559
1559
  constructor(t, e) {
1560
1560
  super(t, e);
1561
- g(this, "ops");
1561
+ d(this, "ops");
1562
1562
  this.ops = e;
1563
1563
  }
1564
1564
  op() {
@@ -1595,12 +1595,12 @@ class Js extends Ut {
1595
1595
  this.ops[i].encode(t, this);
1596
1596
  }
1597
1597
  }
1598
- class Vs extends D {
1598
+ class Bs extends U {
1599
1599
  constructor(t, e, r, i) {
1600
1600
  super(t);
1601
- g(this, "value");
1602
- g(this, "ignore_case");
1603
- g(this, "matcher");
1601
+ d(this, "value");
1602
+ d(this, "ignore_case");
1603
+ d(this, "matcher");
1604
1604
  this.value = e, this.ignore_case = r, this.matcher = i(e, r);
1605
1605
  }
1606
1606
  op() {
@@ -1630,11 +1630,11 @@ class Vs extends D {
1630
1630
  t.encodeArrayHeader(r ? 4 : 3), t.writer.u8(35), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value), r && t.writer.u8(1);
1631
1631
  }
1632
1632
  }
1633
- const { isArray: Bs } = Array;
1634
- class Fs extends D {
1633
+ const { isArray: Fs } = Array;
1634
+ class zs extends U {
1635
1635
  constructor(t, e) {
1636
1636
  super(t);
1637
- g(this, "value");
1637
+ d(this, "value");
1638
1638
  this.value = e;
1639
1639
  }
1640
1640
  op() {
@@ -1645,7 +1645,7 @@ class Fs extends D {
1645
1645
  }
1646
1646
  test(t) {
1647
1647
  const { val: e } = j(t, this.path);
1648
- return e === null ? this.value === "null" : Bs(e) ? this.value === "array" : typeof e === this.value || typeof e == "number" && e === Math.round(e) && this.value === "integer";
1648
+ return e === null ? this.value === "null" : Fs(e) ? this.value === "array" : typeof e === this.value || typeof e == "number" && e === Math.round(e) && this.value === "integer";
1649
1649
  }
1650
1650
  toJson(t) {
1651
1651
  return {
@@ -1661,110 +1661,110 @@ class Fs extends D {
1661
1661
  t.encodeArrayHeader(3), t.writer.u8(42), t.encodeArray(e ? this.path.slice(e.path.length) : this.path), t.encodeString(this.value);
1662
1662
  }
1663
1663
  }
1664
- const zs = (s, n) => {
1664
+ const Ws = (s, n) => {
1665
1665
  switch (s.op) {
1666
1666
  case "add":
1667
- return new Dt(E(s.path), s.value);
1667
+ return new Ft(E(s.path), s.value);
1668
1668
  case "remove":
1669
- return new de(E(s.path), s.oldValue);
1669
+ return new ge(E(s.path), s.oldValue);
1670
1670
  case "replace":
1671
- return new fs(E(s.path), s.value, s.oldValue);
1671
+ return new ds(E(s.path), s.value, s.oldValue);
1672
1672
  case "move":
1673
- return new ds(E(s.path), E(s.from));
1674
- case "copy":
1675
1673
  return new gs(E(s.path), E(s.from));
1674
+ case "copy":
1675
+ return new vs(E(s.path), E(s.from));
1676
1676
  case "flip":
1677
- return new ys(E(s.path));
1677
+ return new ms(E(s.path));
1678
1678
  case "inc":
1679
- return new ms(E(s.path), s.inc);
1679
+ return new ws(E(s.path), s.inc);
1680
1680
  case "str_ins":
1681
- return new ws(E(s.path), s.pos, s.str);
1681
+ return new _s(E(s.path), s.pos, s.str);
1682
1682
  case "str_del":
1683
- return new _s(E(s.path), s.pos, s.str, s.len);
1683
+ return new bs(E(s.path), s.pos, s.str, s.len);
1684
1684
  case "split":
1685
- return new ks(E(s.path), s.pos, s.props || null);
1686
- case "merge":
1687
1685
  return new Cs(E(s.path), s.pos, s.props || null);
1686
+ case "merge":
1687
+ return new $s(E(s.path), s.pos, s.props || null);
1688
1688
  case "extend":
1689
- return new As(E(s.path), s.props, !!s.deleteNull);
1689
+ return new Ts(E(s.path), s.props, !!s.deleteNull);
1690
1690
  default:
1691
- return kt(s, n);
1691
+ return jt(s, n);
1692
1692
  }
1693
- }, kt = (s, n) => {
1693
+ }, jt = (s, n) => {
1694
1694
  switch (s.op) {
1695
1695
  case "test":
1696
- return new vs(E(s.path), s.value, !!s.not);
1696
+ return new ys(E(s.path), s.value, !!s.not);
1697
1697
  case "defined":
1698
1698
  return new js(E(s.path));
1699
1699
  case "undefined":
1700
- return new Ts(E(s.path));
1700
+ return new Os(E(s.path));
1701
1701
  case "type":
1702
- return new Fs(E(s.path), s.value);
1702
+ return new zs(E(s.path), s.value);
1703
1703
  case "test_type":
1704
- return new Ss(E(s.path), s.type);
1704
+ return new xs(E(s.path), s.type);
1705
1705
  case "test_string":
1706
- return new xs(E(s.path), s.pos, s.str, !!s.not);
1706
+ return new Ms(E(s.path), s.pos, s.str, !!s.not);
1707
1707
  case "test_string_len":
1708
- return new Ms(E(s.path), s.len, !!s.not);
1708
+ return new Ls(E(s.path), s.len, !!s.not);
1709
1709
  case "contains":
1710
- return new Ls(E(s.path), s.value, !!s.ignore_case);
1711
- case "ends":
1712
1710
  return new Ns(E(s.path), s.value, !!s.ignore_case);
1713
- case "starts":
1711
+ case "ends":
1714
1712
  return new Rs(E(s.path), s.value, !!s.ignore_case);
1713
+ case "starts":
1714
+ return new Hs(E(s.path), s.value, !!s.ignore_case);
1715
1715
  case "matches":
1716
- return new Vs(E(s.path), s.value, !!s.ignore_case, n.createMatcher || Es);
1716
+ return new Bs(E(s.path), s.value, !!s.ignore_case, n.createMatcher || ks);
1717
1717
  case "in":
1718
1718
  return new Ps(E(s.path), s.value);
1719
1719
  case "less":
1720
- return new Hs(E(s.path), s.value);
1721
- case "more":
1722
1720
  return new Is(E(s.path), s.value);
1721
+ case "more":
1722
+ return new Ds(E(s.path), s.value);
1723
1723
  case "and": {
1724
1724
  const t = E(s.path);
1725
- return new Ds(t, s.apply.map((e) => kt({ ...e, path: [...t, ...E(e.path)] }, n)));
1725
+ return new Us(t, s.apply.map((e) => jt({ ...e, path: [...t, ...E(e.path)] }, n)));
1726
1726
  }
1727
1727
  case "or": {
1728
1728
  const t = E(s.path);
1729
- return new Us(t, s.apply.map((e) => kt({ ...e, path: [...t, ...E(e.path)] }, n)));
1729
+ return new Js(t, s.apply.map((e) => jt({ ...e, path: [...t, ...E(e.path)] }, n)));
1730
1730
  }
1731
1731
  case "not": {
1732
1732
  const t = E(s.path);
1733
- return new Js(t, s.apply.map((e) => kt({ ...e, path: [...t, ...E(e.path)] }, n)));
1733
+ return new Vs(t, s.apply.map((e) => jt({ ...e, path: [...t, ...E(e.path)] }, n)));
1734
1734
  }
1735
1735
  default:
1736
1736
  throw new Error("OP_UNKNOWN");
1737
1737
  }
1738
1738
  };
1739
- function Ws(s, n, t) {
1740
- t.mutate || (s = vt(s));
1739
+ function Gs(s, n, t) {
1740
+ t.mutate || (s = _t(s));
1741
1741
  const e = [], r = n.length;
1742
1742
  for (let i = 0; i < r; i++) {
1743
- const h = zs(n[i], t).apply(s);
1743
+ const h = Ws(n[i], t).apply(s);
1744
1744
  s = h.doc, e.push(h);
1745
1745
  }
1746
1746
  return { doc: s, res: e };
1747
1747
  }
1748
- var pt = (s) => typeof s == "function" ? s : function() {
1748
+ var vt = (s) => typeof s == "function" ? s : function() {
1749
1749
  return s;
1750
- }, Gs = typeof self < "u" ? self : null, ct = typeof window < "u" ? window : null, ft = Gs || ct || ft, Xs = "2.0.0", B = { connecting: 0, open: 1, closing: 2, closed: 3 }, qs = 1e4, Ys = 1e3, U = {
1750
+ }, Xs = typeof self < "u" ? self : null, dt = typeof window < "u" ? window : null, yt = Xs || dt || yt, Ys = "2.0.0", W = { connecting: 0, open: 1, closing: 2, closed: 3 }, qs = 1e4, Zs = 1e3, V = {
1751
1751
  closed: "closed",
1752
1752
  errored: "errored",
1753
1753
  joined: "joined",
1754
1754
  joining: "joining",
1755
1755
  leaving: "leaving"
1756
- }, W = {
1756
+ }, Y = {
1757
1757
  close: "phx_close",
1758
1758
  error: "phx_error",
1759
1759
  join: "phx_join",
1760
1760
  reply: "phx_reply",
1761
1761
  leave: "phx_leave"
1762
- }, It = {
1762
+ }, Vt = {
1763
1763
  longpoll: "longpoll",
1764
1764
  websocket: "websocket"
1765
- }, Zs = {
1765
+ }, Qs = {
1766
1766
  complete: 4
1767
- }, _t = class {
1767
+ }, $t = class {
1768
1768
  constructor(s, n, t, e) {
1769
1769
  this.channel = s, this.event = n, this.payload = t || function() {
1770
1770
  return {};
@@ -1810,7 +1810,7 @@ var pt = (s) => typeof s == "function" ? s : function() {
1810
1810
  trigger(s, n) {
1811
1811
  this.channel.trigger(this.refEvent, { status: s, response: n });
1812
1812
  }
1813
- }, ge = class {
1813
+ }, ve = class {
1814
1814
  constructor(s, n) {
1815
1815
  this.callback = s, this.timerCalc = n, this.timer = null, this.tries = 0;
1816
1816
  }
@@ -1822,23 +1822,23 @@ var pt = (s) => typeof s == "function" ? s : function() {
1822
1822
  this.tries = this.tries + 1, this.callback();
1823
1823
  }, this.timerCalc(this.tries + 1));
1824
1824
  }
1825
- }, Qs = class {
1825
+ }, Ks = class {
1826
1826
  constructor(s, n, t) {
1827
- this.state = U.closed, this.topic = s, this.params = pt(n || {}), this.socket = t, this.bindings = [], this.bindingRef = 0, this.timeout = this.socket.timeout, this.joinedOnce = !1, this.joinPush = new _t(this, W.join, this.params, this.timeout), this.pushBuffer = [], this.stateChangeRefs = [], this.rejoinTimer = new ge(() => {
1827
+ this.state = V.closed, this.topic = s, this.params = vt(n || {}), this.socket = t, this.bindings = [], this.bindingRef = 0, this.timeout = this.socket.timeout, this.joinedOnce = !1, this.joinPush = new $t(this, Y.join, this.params, this.timeout), this.pushBuffer = [], this.stateChangeRefs = [], this.rejoinTimer = new ve(() => {
1828
1828
  this.socket.isConnected() && this.rejoin();
1829
1829
  }, this.socket.rejoinAfterMs), this.stateChangeRefs.push(this.socket.onError(() => this.rejoinTimer.reset())), this.stateChangeRefs.push(this.socket.onOpen(() => {
1830
1830
  this.rejoinTimer.reset(), this.isErrored() && this.rejoin();
1831
1831
  })), this.joinPush.receive("ok", () => {
1832
- this.state = U.joined, this.rejoinTimer.reset(), this.pushBuffer.forEach((e) => e.send()), this.pushBuffer = [];
1832
+ this.state = V.joined, this.rejoinTimer.reset(), this.pushBuffer.forEach((e) => e.send()), this.pushBuffer = [];
1833
1833
  }), this.joinPush.receive("error", () => {
1834
- this.state = U.errored, this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
1834
+ this.state = V.errored, this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
1835
1835
  }), this.onClose(() => {
1836
- this.rejoinTimer.reset(), this.socket.hasLogger() && this.socket.log("channel", `close ${this.topic} ${this.joinRef()}`), this.state = U.closed, this.socket.remove(this);
1836
+ this.rejoinTimer.reset(), this.socket.hasLogger() && this.socket.log("channel", `close ${this.topic} ${this.joinRef()}`), this.state = V.closed, this.socket.remove(this);
1837
1837
  }), this.onError((e) => {
1838
- this.socket.hasLogger() && this.socket.log("channel", `error ${this.topic}`, e), this.isJoining() && this.joinPush.reset(), this.state = U.errored, this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
1838
+ this.socket.hasLogger() && this.socket.log("channel", `error ${this.topic}`, e), this.isJoining() && this.joinPush.reset(), this.state = V.errored, this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
1839
1839
  }), this.joinPush.receive("timeout", () => {
1840
- this.socket.hasLogger() && this.socket.log("channel", `timeout ${this.topic} (${this.joinRef()})`, this.joinPush.timeout), new _t(this, W.leave, pt({}), this.timeout).send(), this.state = U.errored, this.joinPush.reset(), this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
1841
- }), this.on(W.reply, (e, r) => {
1840
+ this.socket.hasLogger() && this.socket.log("channel", `timeout ${this.topic} (${this.joinRef()})`, this.joinPush.timeout), new $t(this, Y.leave, vt({}), this.timeout).send(), this.state = V.errored, this.joinPush.reset(), this.socket.isConnected() && this.rejoinTimer.scheduleTimeout();
1841
+ }), this.on(Y.reply, (e, r) => {
1842
1842
  this.trigger(this.replyEventName(r), e);
1843
1843
  });
1844
1844
  }
@@ -1848,10 +1848,10 @@ var pt = (s) => typeof s == "function" ? s : function() {
1848
1848
  return this.timeout = s, this.joinedOnce = !0, this.rejoin(), this.joinPush;
1849
1849
  }
1850
1850
  onClose(s) {
1851
- this.on(W.close, s);
1851
+ this.on(Y.close, s);
1852
1852
  }
1853
1853
  onError(s) {
1854
- return this.on(W.error, (n) => s(n));
1854
+ return this.on(Y.error, (n) => s(n));
1855
1855
  }
1856
1856
  on(s, n) {
1857
1857
  let t = this.bindingRef++;
@@ -1866,16 +1866,16 @@ var pt = (s) => typeof s == "function" ? s : function() {
1866
1866
  push(s, n, t = this.timeout) {
1867
1867
  if (n = n || {}, !this.joinedOnce)
1868
1868
  throw new Error(`tried to push '${s}' to '${this.topic}' before joining. Use channel.join() before pushing events`);
1869
- let e = new _t(this, s, function() {
1869
+ let e = new $t(this, s, function() {
1870
1870
  return n;
1871
1871
  }, t);
1872
1872
  return this.canPush() ? e.send() : (e.startTimeout(), this.pushBuffer.push(e)), e;
1873
1873
  }
1874
1874
  leave(s = this.timeout) {
1875
- this.rejoinTimer.reset(), this.joinPush.cancelTimeout(), this.state = U.leaving;
1875
+ this.rejoinTimer.reset(), this.joinPush.cancelTimeout(), this.state = V.leaving;
1876
1876
  let n = () => {
1877
- this.socket.hasLogger() && this.socket.log("channel", `leave ${this.topic}`), this.trigger(W.close, "leave");
1878
- }, t = new _t(this, W.leave, pt({}), s);
1877
+ this.socket.hasLogger() && this.socket.log("channel", `leave ${this.topic}`), this.trigger(Y.close, "leave");
1878
+ }, t = new $t(this, Y.leave, vt({}), s);
1879
1879
  return t.receive("ok", () => n()).receive("timeout", () => n()), t.send(), this.canPush() || t.trigger("ok", {}), t;
1880
1880
  }
1881
1881
  onMessage(s, n, t) {
@@ -1888,58 +1888,58 @@ var pt = (s) => typeof s == "function" ? s : function() {
1888
1888
  return this.joinPush.ref;
1889
1889
  }
1890
1890
  rejoin(s = this.timeout) {
1891
- this.isLeaving() || (this.socket.leaveOpenTopic(this.topic), this.state = U.joining, this.joinPush.resend(s));
1891
+ this.isLeaving() || (this.socket.leaveOpenTopic(this.topic), this.state = V.joining, this.joinPush.resend(s));
1892
1892
  }
1893
1893
  trigger(s, n, t, e) {
1894
1894
  let r = this.onMessage(s, n, t, e);
1895
1895
  if (n && !r)
1896
1896
  throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");
1897
- let i = this.bindings.filter((o) => o.event === s);
1898
- for (let o = 0; o < i.length; o++)
1899
- i[o].callback(r, t, e || this.joinRef());
1897
+ let i = this.bindings.filter((a) => a.event === s);
1898
+ for (let a = 0; a < i.length; a++)
1899
+ i[a].callback(r, t, e || this.joinRef());
1900
1900
  }
1901
1901
  replyEventName(s) {
1902
1902
  return `chan_reply_${s}`;
1903
1903
  }
1904
1904
  isClosed() {
1905
- return this.state === U.closed;
1905
+ return this.state === V.closed;
1906
1906
  }
1907
1907
  isErrored() {
1908
- return this.state === U.errored;
1908
+ return this.state === V.errored;
1909
1909
  }
1910
1910
  isJoined() {
1911
- return this.state === U.joined;
1911
+ return this.state === V.joined;
1912
1912
  }
1913
1913
  isJoining() {
1914
- return this.state === U.joining;
1914
+ return this.state === V.joining;
1915
1915
  }
1916
1916
  isLeaving() {
1917
- return this.state === U.leaving;
1917
+ return this.state === V.leaving;
1918
1918
  }
1919
- }, $t = class {
1920
- static request(s, n, t, e, r, i, o) {
1921
- if (ft.XDomainRequest) {
1922
- let h = new ft.XDomainRequest();
1923
- return this.xdomainRequest(h, s, n, e, r, i, o);
1919
+ }, St = class {
1920
+ static request(s, n, t, e, r, i, a) {
1921
+ if (yt.XDomainRequest) {
1922
+ let h = new yt.XDomainRequest();
1923
+ return this.xdomainRequest(h, s, n, e, r, i, a);
1924
1924
  } else {
1925
- let h = new ft.XMLHttpRequest();
1926
- return this.xhrRequest(h, s, n, t, e, r, i, o);
1925
+ let h = new yt.XMLHttpRequest();
1926
+ return this.xhrRequest(h, s, n, t, e, r, i, a);
1927
1927
  }
1928
1928
  }
1929
- static xdomainRequest(s, n, t, e, r, i, o) {
1929
+ static xdomainRequest(s, n, t, e, r, i, a) {
1930
1930
  return s.timeout = r, s.open(n, t), s.onload = () => {
1931
1931
  let h = this.parseJSON(s.responseText);
1932
- o && o(h);
1932
+ a && a(h);
1933
1933
  }, i && (s.ontimeout = i), s.onprogress = () => {
1934
1934
  }, s.send(e), s;
1935
1935
  }
1936
- static xhrRequest(s, n, t, e, r, i, o, h) {
1936
+ static xhrRequest(s, n, t, e, r, i, a, h) {
1937
1937
  return s.open(n, t, !0), s.timeout = i, s.setRequestHeader("Content-Type", e), s.onerror = () => h && h(null), s.onreadystatechange = () => {
1938
- if (s.readyState === Zs.complete && h) {
1938
+ if (s.readyState === Qs.complete && h) {
1939
1939
  let p = this.parseJSON(s.responseText);
1940
1940
  h(p);
1941
1941
  }
1942
- }, o && (s.ontimeout = o), s.send(r), s;
1942
+ }, a && (s.ontimeout = a), s.send(r), s;
1943
1943
  }
1944
1944
  static parseJSON(s) {
1945
1945
  if (!s || s === "")
@@ -1966,28 +1966,28 @@ var pt = (s) => typeof s == "function" ? s : function() {
1966
1966
  let t = s.match(/\?/) ? "&" : "?";
1967
1967
  return `${s}${t}${this.serialize(n)}`;
1968
1968
  }
1969
- }, Lt = class {
1969
+ }, Pt = class {
1970
1970
  constructor(s) {
1971
1971
  this.endPoint = null, this.token = null, this.skipHeartbeat = !0, this.reqs = /* @__PURE__ */ new Set(), this.onopen = function() {
1972
1972
  }, this.onerror = function() {
1973
1973
  }, this.onmessage = function() {
1974
1974
  }, this.onclose = function() {
1975
- }, this.pollEndpoint = this.normalizeEndpoint(s), this.readyState = B.connecting, this.poll();
1975
+ }, this.pollEndpoint = this.normalizeEndpoint(s), this.readyState = W.connecting, this.poll();
1976
1976
  }
1977
1977
  normalizeEndpoint(s) {
1978
- return s.replace("ws://", "http://").replace("wss://", "https://").replace(new RegExp("(.*)/" + It.websocket), "$1/" + It.longpoll);
1978
+ return s.replace("ws://", "http://").replace("wss://", "https://").replace(new RegExp("(.*)/" + Vt.websocket), "$1/" + Vt.longpoll);
1979
1979
  }
1980
1980
  endpointURL() {
1981
- return $t.appendParams(this.pollEndpoint, { token: this.token });
1981
+ return St.appendParams(this.pollEndpoint, { token: this.token });
1982
1982
  }
1983
1983
  closeAndRetry(s, n, t) {
1984
- this.close(s, n, t), this.readyState = B.connecting;
1984
+ this.close(s, n, t), this.readyState = W.connecting;
1985
1985
  }
1986
1986
  ontimeout() {
1987
1987
  this.onerror("timeout"), this.closeAndRetry(1005, "timeout", !1);
1988
1988
  }
1989
1989
  isActive() {
1990
- return this.readyState === B.open || this.readyState === B.connecting;
1990
+ return this.readyState === W.open || this.readyState === W.connecting;
1991
1991
  }
1992
1992
  poll() {
1993
1993
  this.ajax("GET", null, () => this.ontimeout(), (s) => {
@@ -2006,7 +2006,7 @@ var pt = (s) => typeof s == "function" ? s : function() {
2006
2006
  this.poll();
2007
2007
  break;
2008
2008
  case 410:
2009
- this.readyState = B.open, this.onopen({}), this.poll();
2009
+ this.readyState = W.open, this.onopen({}), this.poll();
2010
2010
  break;
2011
2011
  case 403:
2012
2012
  this.onerror(403), this.close(1008, "forbidden", !1);
@@ -2028,7 +2028,7 @@ var pt = (s) => typeof s == "function" ? s : function() {
2028
2028
  close(s, n, t) {
2029
2029
  for (let r of this.reqs)
2030
2030
  r.abort();
2031
- this.readyState = B.closed;
2031
+ this.readyState = W.closed;
2032
2032
  let e = Object.assign({ code: 1e3, reason: void 0, wasClean: !0 }, { code: s, reason: n, wasClean: t });
2033
2033
  typeof CloseEvent < "u" ? this.onclose(new CloseEvent("close", e)) : this.onclose(e);
2034
2034
  }
@@ -2036,11 +2036,11 @@ var pt = (s) => typeof s == "function" ? s : function() {
2036
2036
  let r, i = () => {
2037
2037
  this.reqs.delete(r), t();
2038
2038
  };
2039
- r = $t.request(s, this.endpointURL(), "application/json", n, this.timeout, i, (o) => {
2040
- this.reqs.delete(r), this.isActive() && e(o);
2039
+ r = St.request(s, this.endpointURL(), "application/json", n, this.timeout, i, (a) => {
2040
+ this.reqs.delete(r), this.isActive() && e(a);
2041
2041
  }), this.reqs.add(r);
2042
2042
  }
2043
- }, bt = {
2043
+ }, At = {
2044
2044
  HEADER_LENGTH: 1,
2045
2045
  META_LENGTH: 4,
2046
2046
  KINDS: { push: 0, reply: 1, broadcast: 2 },
@@ -2056,15 +2056,15 @@ var pt = (s) => typeof s == "function" ? s : function() {
2056
2056
  if (s.constructor === ArrayBuffer)
2057
2057
  return n(this.binaryDecode(s));
2058
2058
  {
2059
- let [t, e, r, i, o] = JSON.parse(s);
2060
- return n({ join_ref: t, ref: e, topic: r, event: i, payload: o });
2059
+ let [t, e, r, i, a] = JSON.parse(s);
2060
+ return n({ join_ref: t, ref: e, topic: r, event: i, payload: a });
2061
2061
  }
2062
2062
  },
2063
2063
  binaryEncode(s) {
2064
- let { join_ref: n, ref: t, event: e, topic: r, payload: i } = s, o = this.META_LENGTH + n.length + t.length + r.length + e.length, h = new ArrayBuffer(this.HEADER_LENGTH + o), p = new DataView(h), f = 0;
2065
- p.setUint8(f++, this.KINDS.push), p.setUint8(f++, n.length), p.setUint8(f++, t.length), p.setUint8(f++, r.length), p.setUint8(f++, e.length), Array.from(n, (_) => p.setUint8(f++, _.charCodeAt(0))), Array.from(t, (_) => p.setUint8(f++, _.charCodeAt(0))), Array.from(r, (_) => p.setUint8(f++, _.charCodeAt(0))), Array.from(e, (_) => p.setUint8(f++, _.charCodeAt(0)));
2066
- var d = new Uint8Array(h.byteLength + i.byteLength);
2067
- return d.set(new Uint8Array(h), 0), d.set(new Uint8Array(i), h.byteLength), d.buffer;
2064
+ let { join_ref: n, ref: t, event: e, topic: r, payload: i } = s, a = this.META_LENGTH + n.length + t.length + r.length + e.length, h = new ArrayBuffer(this.HEADER_LENGTH + a), p = new DataView(h), g = 0;
2065
+ p.setUint8(g++, this.KINDS.push), p.setUint8(g++, n.length), p.setUint8(g++, t.length), p.setUint8(g++, r.length), p.setUint8(g++, e.length), Array.from(n, (f) => p.setUint8(g++, f.charCodeAt(0))), Array.from(t, (f) => p.setUint8(g++, f.charCodeAt(0))), Array.from(r, (f) => p.setUint8(g++, f.charCodeAt(0))), Array.from(e, (f) => p.setUint8(g++, f.charCodeAt(0)));
2066
+ var _ = new Uint8Array(h.byteLength + i.byteLength);
2067
+ return _.set(new Uint8Array(h), 0), _.set(new Uint8Array(i), h.byteLength), _.buffer;
2068
2068
  },
2069
2069
  binaryDecode(s) {
2070
2070
  let n = new DataView(s), t = n.getUint8(0), e = new TextDecoder();
@@ -2078,49 +2078,49 @@ var pt = (s) => typeof s == "function" ? s : function() {
2078
2078
  }
2079
2079
  },
2080
2080
  decodePush(s, n, t) {
2081
- let e = n.getUint8(1), r = n.getUint8(2), i = n.getUint8(3), o = this.HEADER_LENGTH + this.META_LENGTH - 1, h = t.decode(s.slice(o, o + e));
2082
- o = o + e;
2083
- let p = t.decode(s.slice(o, o + r));
2084
- o = o + r;
2085
- let f = t.decode(s.slice(o, o + i));
2086
- o = o + i;
2087
- let d = s.slice(o, s.byteLength);
2088
- return { join_ref: h, ref: null, topic: p, event: f, payload: d };
2081
+ let e = n.getUint8(1), r = n.getUint8(2), i = n.getUint8(3), a = this.HEADER_LENGTH + this.META_LENGTH - 1, h = t.decode(s.slice(a, a + e));
2082
+ a = a + e;
2083
+ let p = t.decode(s.slice(a, a + r));
2084
+ a = a + r;
2085
+ let g = t.decode(s.slice(a, a + i));
2086
+ a = a + i;
2087
+ let _ = s.slice(a, s.byteLength);
2088
+ return { join_ref: h, ref: null, topic: p, event: g, payload: _ };
2089
2089
  },
2090
2090
  decodeReply(s, n, t) {
2091
- let e = n.getUint8(1), r = n.getUint8(2), i = n.getUint8(3), o = n.getUint8(4), h = this.HEADER_LENGTH + this.META_LENGTH, p = t.decode(s.slice(h, h + e));
2091
+ let e = n.getUint8(1), r = n.getUint8(2), i = n.getUint8(3), a = n.getUint8(4), h = this.HEADER_LENGTH + this.META_LENGTH, p = t.decode(s.slice(h, h + e));
2092
2092
  h = h + e;
2093
- let f = t.decode(s.slice(h, h + r));
2093
+ let g = t.decode(s.slice(h, h + r));
2094
2094
  h = h + r;
2095
- let d = t.decode(s.slice(h, h + i));
2095
+ let _ = t.decode(s.slice(h, h + i));
2096
2096
  h = h + i;
2097
- let _ = t.decode(s.slice(h, h + o));
2098
- h = h + o;
2099
- let A = s.slice(h, s.byteLength), T = { status: _, response: A };
2100
- return { join_ref: p, ref: f, topic: d, event: W.reply, payload: T };
2097
+ let f = t.decode(s.slice(h, h + a));
2098
+ h = h + a;
2099
+ let A = s.slice(h, s.byteLength), T = { status: f, response: A };
2100
+ return { join_ref: p, ref: g, topic: _, event: Y.reply, payload: T };
2101
2101
  },
2102
2102
  decodeBroadcast(s, n, t) {
2103
- let e = n.getUint8(1), r = n.getUint8(2), i = this.HEADER_LENGTH + 2, o = t.decode(s.slice(i, i + e));
2103
+ let e = n.getUint8(1), r = n.getUint8(2), i = this.HEADER_LENGTH + 2, a = t.decode(s.slice(i, i + e));
2104
2104
  i = i + e;
2105
2105
  let h = t.decode(s.slice(i, i + r));
2106
2106
  i = i + r;
2107
2107
  let p = s.slice(i, s.byteLength);
2108
- return { join_ref: null, ref: null, topic: o, event: h, payload: p };
2108
+ return { join_ref: null, ref: null, topic: a, event: h, payload: p };
2109
2109
  }
2110
- }, Ks = class {
2110
+ }, tn = class {
2111
2111
  constructor(s, n = {}) {
2112
- this.stateChangeCallbacks = { open: [], close: [], error: [], message: [] }, this.channels = [], this.sendBuffer = [], this.ref = 0, this.timeout = n.timeout || qs, this.transport = n.transport || ft.WebSocket || Lt, this.establishedConnections = 0, this.defaultEncoder = bt.encode.bind(bt), this.defaultDecoder = bt.decode.bind(bt), this.closeWasClean = !1, this.binaryType = n.binaryType || "arraybuffer", this.connectClock = 1, this.transport !== Lt ? (this.encode = n.encode || this.defaultEncoder, this.decode = n.decode || this.defaultDecoder) : (this.encode = this.defaultEncoder, this.decode = this.defaultDecoder);
2112
+ this.stateChangeCallbacks = { open: [], close: [], error: [], message: [] }, this.channels = [], this.sendBuffer = [], this.ref = 0, this.timeout = n.timeout || qs, this.transport = n.transport || yt.WebSocket || Pt, this.establishedConnections = 0, this.defaultEncoder = At.encode.bind(At), this.defaultDecoder = At.decode.bind(At), this.closeWasClean = !1, this.binaryType = n.binaryType || "arraybuffer", this.connectClock = 1, this.transport !== Pt ? (this.encode = n.encode || this.defaultEncoder, this.decode = n.decode || this.defaultDecoder) : (this.encode = this.defaultEncoder, this.decode = this.defaultDecoder);
2113
2113
  let t = null;
2114
- ct && ct.addEventListener && (ct.addEventListener("pagehide", (e) => {
2114
+ dt && dt.addEventListener && (dt.addEventListener("pagehide", (e) => {
2115
2115
  this.conn && (this.disconnect(), t = this.connectClock);
2116
- }), ct.addEventListener("pageshow", (e) => {
2116
+ }), dt.addEventListener("pageshow", (e) => {
2117
2117
  t === this.connectClock && (t = null, this.connect());
2118
- })), this.heartbeatIntervalMs = n.heartbeatIntervalMs || 3e4, this.rejoinAfterMs = (e) => n.rejoinAfterMs ? n.rejoinAfterMs(e) : [1e3, 2e3, 5e3][e - 1] || 1e4, this.reconnectAfterMs = (e) => n.reconnectAfterMs ? n.reconnectAfterMs(e) : [10, 50, 100, 150, 200, 250, 500, 1e3, 2e3][e - 1] || 5e3, this.logger = n.logger || null, this.longpollerTimeout = n.longpollerTimeout || 2e4, this.params = pt(n.params || {}), this.endPoint = `${s}/${It.websocket}`, this.vsn = n.vsn || Xs, this.heartbeatTimeoutTimer = null, this.heartbeatTimer = null, this.pendingHeartbeatRef = null, this.reconnectTimer = new ge(() => {
2118
+ })), this.heartbeatIntervalMs = n.heartbeatIntervalMs || 3e4, this.rejoinAfterMs = (e) => n.rejoinAfterMs ? n.rejoinAfterMs(e) : [1e3, 2e3, 5e3][e - 1] || 1e4, this.reconnectAfterMs = (e) => n.reconnectAfterMs ? n.reconnectAfterMs(e) : [10, 50, 100, 150, 200, 250, 500, 1e3, 2e3][e - 1] || 5e3, this.logger = n.logger || null, this.longpollerTimeout = n.longpollerTimeout || 2e4, this.params = vt(n.params || {}), this.endPoint = `${s}/${Vt.websocket}`, this.vsn = n.vsn || Ys, this.heartbeatTimeoutTimer = null, this.heartbeatTimer = null, this.pendingHeartbeatRef = null, this.reconnectTimer = new ve(() => {
2119
2119
  this.teardown(() => this.connect());
2120
2120
  }, this.reconnectAfterMs);
2121
2121
  }
2122
2122
  getLongPollTransport() {
2123
- return Lt;
2123
+ return Pt;
2124
2124
  }
2125
2125
  replaceTransport(s) {
2126
2126
  this.connectClock++, this.closeWasClean = !0, this.reconnectTimer.reset(), this.sendBuffer = [], this.conn && (this.conn.close(), this.conn = null), this.transport = s;
@@ -2129,14 +2129,14 @@ var pt = (s) => typeof s == "function" ? s : function() {
2129
2129
  return location.protocol.match(/^https/) ? "wss" : "ws";
2130
2130
  }
2131
2131
  endPointURL() {
2132
- let s = $t.appendParams($t.appendParams(this.endPoint, this.params()), { vsn: this.vsn });
2132
+ let s = St.appendParams(St.appendParams(this.endPoint, this.params()), { vsn: this.vsn });
2133
2133
  return s.charAt(0) !== "/" ? s : s.charAt(1) === "/" ? `${this.protocol()}:${s}` : `${this.protocol()}://${location.host}${s}`;
2134
2134
  }
2135
2135
  disconnect(s, n, t) {
2136
2136
  this.connectClock++, this.closeWasClean = !0, this.reconnectTimer.reset(), this.teardown(s, n, t);
2137
2137
  }
2138
2138
  connect(s) {
2139
- s && (console && console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"), this.params = pt(s)), !this.conn && (this.connectClock++, this.closeWasClean = !1, this.conn = new this.transport(this.endPointURL()), this.conn.binaryType = this.binaryType, this.conn.timeout = this.longpollerTimeout, this.conn.onopen = () => this.onConnOpen(), this.conn.onerror = (n) => this.onConnError(n), this.conn.onmessage = (n) => this.onConnMessage(n), this.conn.onclose = (n) => this.onConnClose(n));
2139
+ s && (console && console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"), this.params = vt(s)), !this.conn && (this.connectClock++, this.closeWasClean = !1, this.conn = new this.transport(this.endPointURL()), this.conn.binaryType = this.binaryType, this.conn.timeout = this.longpollerTimeout, this.conn.onopen = () => this.onConnOpen(), this.conn.onerror = (n) => this.onConnError(n), this.conn.onmessage = (n) => this.onConnMessage(n), this.conn.onclose = (n) => this.onConnClose(n));
2140
2140
  }
2141
2141
  log(s, n, t) {
2142
2142
  this.logger(s, n, t);
@@ -2177,7 +2177,7 @@ var pt = (s) => typeof s == "function" ? s : function() {
2177
2177
  this.hasLogger() && this.log("transport", `connected to ${this.endPointURL()}`), this.closeWasClean = !1, this.establishedConnections++, this.flushSendBuffer(), this.reconnectTimer.reset(), this.resetHeartbeat(), this.stateChangeCallbacks.open.forEach(([, s]) => s());
2178
2178
  }
2179
2179
  heartbeatTimeout() {
2180
- this.pendingHeartbeatRef && (this.pendingHeartbeatRef = null, this.hasLogger() && this.log("transport", "heartbeat timeout. Attempting to re-establish connection"), this.triggerChanError(), this.closeWasClean = !1, this.teardown(() => this.reconnectTimer.scheduleTimeout(), Ys, "heartbeat timeout"));
2180
+ this.pendingHeartbeatRef && (this.pendingHeartbeatRef = null, this.hasLogger() && this.log("transport", "heartbeat timeout. Attempting to re-establish connection"), this.triggerChanError(), this.closeWasClean = !1, this.teardown(() => this.reconnectTimer.scheduleTimeout(), Zs, "heartbeat timeout"));
2181
2181
  }
2182
2182
  resetHeartbeat() {
2183
2183
  this.conn && this.conn.skipHeartbeat || (this.pendingHeartbeatRef = null, this.clearHeartbeats(), this.heartbeatTimer = setTimeout(() => this.sendHeartbeat(), this.heartbeatIntervalMs));
@@ -2205,7 +2205,7 @@ var pt = (s) => typeof s == "function" ? s : function() {
2205
2205
  }, 150 * n);
2206
2206
  }
2207
2207
  waitForSocketClosed(s, n = 1) {
2208
- if (n === 5 || !this.conn || this.conn.readyState === B.closed) {
2208
+ if (n === 5 || !this.conn || this.conn.readyState === W.closed) {
2209
2209
  s();
2210
2210
  return;
2211
2211
  }
@@ -2226,16 +2226,16 @@ var pt = (s) => typeof s == "function" ? s : function() {
2226
2226
  }
2227
2227
  triggerChanError() {
2228
2228
  this.channels.forEach((s) => {
2229
- s.isErrored() || s.isLeaving() || s.isClosed() || s.trigger(W.error);
2229
+ s.isErrored() || s.isLeaving() || s.isClosed() || s.trigger(Y.error);
2230
2230
  });
2231
2231
  }
2232
2232
  connectionState() {
2233
2233
  switch (this.conn && this.conn.readyState) {
2234
- case B.connecting:
2234
+ case W.connecting:
2235
2235
  return "connecting";
2236
- case B.open:
2236
+ case W.open:
2237
2237
  return "open";
2238
- case B.closing:
2238
+ case W.closing:
2239
2239
  return "closing";
2240
2240
  default:
2241
2241
  return "closed";
@@ -2252,7 +2252,7 @@ var pt = (s) => typeof s == "function" ? s : function() {
2252
2252
  this.stateChangeCallbacks[n] = this.stateChangeCallbacks[n].filter(([t]) => s.indexOf(t) === -1);
2253
2253
  }
2254
2254
  channel(s, n = {}) {
2255
- let t = new Qs(s, n, this);
2255
+ let t = new Ks(s, n, this);
2256
2256
  return this.channels.push(t), t;
2257
2257
  }
2258
2258
  push(s) {
@@ -2274,11 +2274,11 @@ var pt = (s) => typeof s == "function" ? s : function() {
2274
2274
  }
2275
2275
  onConnMessage(s) {
2276
2276
  this.decode(s.data, (n) => {
2277
- let { topic: t, event: e, payload: r, ref: i, join_ref: o } = n;
2277
+ let { topic: t, event: e, payload: r, ref: i, join_ref: a } = n;
2278
2278
  i && i === this.pendingHeartbeatRef && (this.clearHeartbeats(), this.pendingHeartbeatRef = null, this.heartbeatTimer = setTimeout(() => this.sendHeartbeat(), this.heartbeatIntervalMs)), this.hasLogger() && this.log("receive", `${r.status || ""} ${t} ${e} ${i && "(" + i + ")" || ""}`, r);
2279
2279
  for (let h = 0; h < this.channels.length; h++) {
2280
2280
  const p = this.channels[h];
2281
- p.isMember(t, e, r, o) && p.trigger(e, r, i, o);
2281
+ p.isMember(t, e, r, a) && p.trigger(e, r, i, a);
2282
2282
  }
2283
2283
  for (let h = 0; h < this.stateChangeCallbacks.message.length; h++) {
2284
2284
  let [, p] = this.stateChangeCallbacks.message[h];
@@ -2291,16 +2291,16 @@ var pt = (s) => typeof s == "function" ? s : function() {
2291
2291
  n && (this.hasLogger() && this.log("transport", `leaving duplicate topic "${s}"`), n.leave());
2292
2292
  }
2293
2293
  };
2294
- class tn {
2294
+ class en {
2295
2295
  constructor(n) {
2296
- this.connected = !1, this.config = n, this.socket = new Ks(this.config.url, this.config.socketOptions || { logger: (t, e, r) => {
2297
- console.log(`${t}: ${e}`, r);
2296
+ this.connected = !1, this.config = n, this.socket = new tn(this.config.url, this.config.socketOptions || { logger: (t, e, r) => {
2297
+ console.debug(`${t}: ${e}`, r);
2298
2298
  } }), this.channel = this.socket.channel(this.config.topic, this.config.params), this.eventTarget = new EventTarget();
2299
2299
  }
2300
2300
  /** connect to socket and join channel. will do nothing if already connected */
2301
2301
  connect() {
2302
- this.connected || (this.socket.onError((n) => this.emitError("socket error", n)), this.socket.connect(), this.channel.onError((n) => console.log("channel error", n)), this.channel.join().receive("ok", () => {
2303
- console.log("joined");
2302
+ this.connected || (this.socket.onError((n) => this.emitError("socket error", n)), this.socket.connect(), this.channel.onError((n) => this.emitError("channel error", n)), this.channel.join().receive("ok", (n) => {
2303
+ console.debug("channel joined", n);
2304
2304
  }).receive("error", (n) => {
2305
2305
  this.emitError("channel join error", n);
2306
2306
  }), this.channel.on("state:change", (n) => this.handleChange(n)), this.channel.on("state:patch", (n) => this.handlePatch(n)), this.connected = !0);
@@ -2350,7 +2350,7 @@ class tn {
2350
2350
  if (this.eventTarget.dispatchEvent(new CustomEvent("livestate-patch", {
2351
2351
  detail: { patch: n, version: t }
2352
2352
  })), this.versionMatches(t)) {
2353
- const { doc: e, res: r } = Ws(this.state, n, { mutate: !1 });
2353
+ const { doc: e, res: r } = Gs(this.state, n, { mutate: !1 });
2354
2354
  this.state = e, this.stateVersion = t, this.eventTarget.dispatchEvent(new CustomEvent("livestate-change", {
2355
2355
  detail: {
2356
2356
  state: this.state,
@@ -2377,7 +2377,7 @@ class tn {
2377
2377
  }
2378
2378
  }
2379
2379
  Promise.resolve();
2380
- var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2380
+ var ne = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2381
2381
  /*! *****************************************************************************
2382
2382
  Copyright (C) Microsoft. All rights reserved.
2383
2383
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -2392,244 +2392,244 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
2392
2392
  See the Apache Version 2.0 License for specific language governing permissions
2393
2393
  and limitations under the License.
2394
2394
  ***************************************************************************** */
2395
- var ne;
2395
+ var re;
2396
2396
  (function(s) {
2397
2397
  (function(n) {
2398
- var t = typeof se == "object" ? se : typeof self == "object" ? self : typeof this == "object" ? this : Function("return this;")(), e = r(s);
2398
+ var t = typeof ne == "object" ? ne : typeof self == "object" ? self : typeof this == "object" ? this : Function("return this;")(), e = r(s);
2399
2399
  typeof t.Reflect > "u" ? t.Reflect = s : e = r(t.Reflect, e), n(e);
2400
- function r(i, o) {
2400
+ function r(i, a) {
2401
2401
  return function(h, p) {
2402
- typeof i[h] != "function" && Object.defineProperty(i, h, { configurable: !0, writable: !0, value: p }), o && o(h, p);
2402
+ typeof i[h] != "function" && Object.defineProperty(i, h, { configurable: !0, writable: !0, value: p }), a && a(h, p);
2403
2403
  };
2404
2404
  }
2405
2405
  })(function(n) {
2406
- var t = Object.prototype.hasOwnProperty, e = typeof Symbol == "function", r = e && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", i = e && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", o = typeof Object.create == "function", h = { __proto__: [] } instanceof Array, p = !o && !h, f = {
2406
+ var t = Object.prototype.hasOwnProperty, e = typeof Symbol == "function", r = e && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", i = e && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", a = typeof Object.create == "function", h = { __proto__: [] } instanceof Array, p = !a && !h, g = {
2407
2407
  // create an object in dictionary mode (a.k.a. "slow" mode in v8)
2408
- create: o ? function() {
2409
- return St(/* @__PURE__ */ Object.create(null));
2408
+ create: a ? function() {
2409
+ return Nt(/* @__PURE__ */ Object.create(null));
2410
2410
  } : h ? function() {
2411
- return St({ __proto__: null });
2411
+ return Nt({ __proto__: null });
2412
2412
  } : function() {
2413
- return St({});
2413
+ return Nt({});
2414
2414
  },
2415
- has: p ? function(a, c) {
2416
- return t.call(a, c);
2417
- } : function(a, c) {
2418
- return c in a;
2415
+ has: p ? function(o, c) {
2416
+ return t.call(o, c);
2417
+ } : function(o, c) {
2418
+ return c in o;
2419
2419
  },
2420
- get: p ? function(a, c) {
2421
- return t.call(a, c) ? a[c] : void 0;
2422
- } : function(a, c) {
2423
- return a[c];
2420
+ get: p ? function(o, c) {
2421
+ return t.call(o, c) ? o[c] : void 0;
2422
+ } : function(o, c) {
2423
+ return o[c];
2424
2424
  }
2425
- }, d = Object.getPrototypeOf(Function), _ = typeof process == "object" && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL === "true", A = !_ && typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Ae(), T = !_ && typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : je(), x = !_ && typeof WeakMap == "function" ? WeakMap : Te(), H = new x();
2426
- function M(a, c, l, u) {
2427
- if (N(l)) {
2428
- if (!Gt(a))
2425
+ }, _ = Object.getPrototypeOf(Function), f = typeof process == "object" && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL === "true", A = !f && typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : Te(), T = !f && typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : je(), x = !f && typeof WeakMap == "function" ? WeakMap : Oe(), H = new x();
2426
+ function M(o, c, l, u) {
2427
+ if (L(l)) {
2428
+ if (!Xt(o))
2429
2429
  throw new TypeError();
2430
- if (!Xt(c))
2430
+ if (!Yt(c))
2431
2431
  throw new TypeError();
2432
- return R(a, c);
2432
+ return I(o, c);
2433
2433
  } else {
2434
- if (!Gt(a))
2434
+ if (!Xt(o))
2435
2435
  throw new TypeError();
2436
- if (!P(c))
2436
+ if (!N(c))
2437
2437
  throw new TypeError();
2438
- if (!P(u) && !N(u) && !st(u))
2438
+ if (!N(u) && !L(u) && !it(u))
2439
2439
  throw new TypeError();
2440
- return st(u) && (u = void 0), l = F(l), tt(a, c, l, u);
2440
+ return it(u) && (u = void 0), l = G(l), D(o, c, l, u);
2441
2441
  }
2442
2442
  }
2443
2443
  n("decorate", M);
2444
- function G(a, c) {
2444
+ function q(o, c) {
2445
2445
  function l(u, v) {
2446
- if (!P(u))
2446
+ if (!N(u))
2447
2447
  throw new TypeError();
2448
- if (!N(v) && !be(v))
2448
+ if (!L(v) && !Ee(v))
2449
2449
  throw new TypeError();
2450
- Bt(a, c, u, v);
2450
+ nt(o, c, u, v);
2451
2451
  }
2452
2452
  return l;
2453
2453
  }
2454
- n("metadata", G);
2455
- function X(a, c, l, u) {
2456
- if (!P(l))
2454
+ n("metadata", q);
2455
+ function Z(o, c, l, u) {
2456
+ if (!N(l))
2457
2457
  throw new TypeError();
2458
- return N(u) || (u = F(u)), Bt(a, c, l, u);
2458
+ return L(u) || (u = G(u)), nt(o, c, l, u);
2459
2459
  }
2460
- n("defineMetadata", X);
2461
- function Y(a, c, l) {
2462
- if (!P(c))
2460
+ n("defineMetadata", Z);
2461
+ function tt(o, c, l) {
2462
+ if (!N(c))
2463
2463
  throw new TypeError();
2464
- return N(l) || (l = F(l)), ht(a, c, l);
2464
+ return L(l) || (l = G(l)), F(o, c, l);
2465
2465
  }
2466
- n("hasMetadata", Y);
2467
- function Z(a, c, l) {
2468
- if (!P(c))
2466
+ n("hasMetadata", tt);
2467
+ function et(o, c, l) {
2468
+ if (!N(c))
2469
2469
  throw new TypeError();
2470
- return N(l) || (l = F(l)), Tt(a, c, l);
2470
+ return L(l) || (l = G(l)), z(o, c, l);
2471
2471
  }
2472
- n("hasOwnMetadata", Z);
2473
- function Q(a, c, l) {
2474
- if (!P(c))
2472
+ n("hasOwnMetadata", et);
2473
+ function st(o, c, l) {
2474
+ if (!N(c))
2475
2475
  throw new TypeError();
2476
- return N(l) || (l = F(l)), Jt(a, c, l);
2476
+ return L(l) || (l = G(l)), pt(o, c, l);
2477
2477
  }
2478
- n("getMetadata", Q);
2479
- function K(a, c, l) {
2480
- if (!P(c))
2478
+ n("getMetadata", st);
2479
+ function Q(o, c, l) {
2480
+ if (!N(c))
2481
2481
  throw new TypeError();
2482
- return N(l) || (l = F(l)), Vt(a, c, l);
2482
+ return L(l) || (l = G(l)), ft(o, c, l);
2483
2483
  }
2484
- n("getOwnMetadata", K);
2485
- function O(a, c) {
2486
- if (!P(a))
2484
+ n("getOwnMetadata", Q);
2485
+ function O(o, c) {
2486
+ if (!N(o))
2487
2487
  throw new TypeError();
2488
- return N(c) || (c = F(c)), Ft(a, c);
2488
+ return L(c) || (c = G(c)), Ct(o, c);
2489
2489
  }
2490
2490
  n("getMetadataKeys", O);
2491
- function m(a, c) {
2492
- if (!P(a))
2491
+ function P(o, c) {
2492
+ if (!N(o))
2493
2493
  throw new TypeError();
2494
- return N(c) || (c = F(c)), zt(a, c);
2494
+ return L(c) || (c = G(c)), Wt(o, c);
2495
2495
  }
2496
- n("getOwnMetadataKeys", m);
2497
- function L(a, c, l) {
2498
- if (!P(c))
2496
+ n("getOwnMetadataKeys", P);
2497
+ function m(o, c, l) {
2498
+ if (!N(c))
2499
2499
  throw new TypeError();
2500
- N(l) || (l = F(l));
2501
- var u = V(
2500
+ L(l) || (l = G(l));
2501
+ var u = J(
2502
2502
  c,
2503
2503
  l,
2504
2504
  /*Create*/
2505
2505
  !1
2506
2506
  );
2507
- if (N(u) || !u.delete(a))
2507
+ if (L(u) || !u.delete(o))
2508
2508
  return !1;
2509
2509
  if (u.size > 0)
2510
2510
  return !0;
2511
2511
  var v = H.get(c);
2512
2512
  return v.delete(l), v.size > 0 || H.delete(c), !0;
2513
2513
  }
2514
- n("deleteMetadata", L);
2515
- function R(a, c) {
2516
- for (var l = a.length - 1; l >= 0; --l) {
2517
- var u = a[l], v = u(c);
2518
- if (!N(v) && !st(v)) {
2519
- if (!Xt(v))
2514
+ n("deleteMetadata", m);
2515
+ function I(o, c) {
2516
+ for (var l = o.length - 1; l >= 0; --l) {
2517
+ var u = o[l], v = u(c);
2518
+ if (!L(v) && !it(v)) {
2519
+ if (!Yt(v))
2520
2520
  throw new TypeError();
2521
2521
  c = v;
2522
2522
  }
2523
2523
  }
2524
2524
  return c;
2525
2525
  }
2526
- function tt(a, c, l, u) {
2527
- for (var v = a.length - 1; v >= 0; --v) {
2528
- var I = a[v], w = I(c, l, u);
2529
- if (!N(w) && !st(w)) {
2530
- if (!P(w))
2526
+ function D(o, c, l, u) {
2527
+ for (var v = o.length - 1; v >= 0; --v) {
2528
+ var R = o[v], w = R(c, l, u);
2529
+ if (!L(w) && !it(w)) {
2530
+ if (!N(w))
2531
2531
  throw new TypeError();
2532
2532
  u = w;
2533
2533
  }
2534
2534
  }
2535
2535
  return u;
2536
2536
  }
2537
- function V(a, c, l) {
2538
- var u = H.get(a);
2539
- if (N(u)) {
2537
+ function J(o, c, l) {
2538
+ var u = H.get(o);
2539
+ if (L(u)) {
2540
2540
  if (!l)
2541
2541
  return;
2542
- u = new A(), H.set(a, u);
2542
+ u = new A(), H.set(o, u);
2543
2543
  }
2544
2544
  var v = u.get(c);
2545
- if (N(v)) {
2545
+ if (L(v)) {
2546
2546
  if (!l)
2547
2547
  return;
2548
2548
  v = new A(), u.set(c, v);
2549
2549
  }
2550
2550
  return v;
2551
2551
  }
2552
- function ht(a, c, l) {
2553
- var u = Tt(a, c, l);
2552
+ function F(o, c, l) {
2553
+ var u = z(o, c, l);
2554
2554
  if (u)
2555
2555
  return !0;
2556
- var v = Ot(c);
2557
- return st(v) ? !1 : ht(a, v, l);
2556
+ var v = Lt(c);
2557
+ return it(v) ? !1 : F(o, v, l);
2558
2558
  }
2559
- function Tt(a, c, l) {
2560
- var u = V(
2559
+ function z(o, c, l) {
2560
+ var u = J(
2561
2561
  c,
2562
2562
  l,
2563
2563
  /*Create*/
2564
2564
  !1
2565
2565
  );
2566
- return N(u) ? !1 : we(u.has(a));
2566
+ return L(u) ? !1 : _e(u.has(o));
2567
2567
  }
2568
- function Jt(a, c, l) {
2569
- var u = Tt(a, c, l);
2568
+ function pt(o, c, l) {
2569
+ var u = z(o, c, l);
2570
2570
  if (u)
2571
- return Vt(a, c, l);
2572
- var v = Ot(c);
2573
- if (!st(v))
2574
- return Jt(a, v, l);
2571
+ return ft(o, c, l);
2572
+ var v = Lt(c);
2573
+ if (!it(v))
2574
+ return pt(o, v, l);
2575
2575
  }
2576
- function Vt(a, c, l) {
2577
- var u = V(
2576
+ function ft(o, c, l) {
2577
+ var u = J(
2578
2578
  c,
2579
2579
  l,
2580
2580
  /*Create*/
2581
2581
  !1
2582
2582
  );
2583
- if (!N(u))
2584
- return u.get(a);
2583
+ if (!L(u))
2584
+ return u.get(o);
2585
2585
  }
2586
- function Bt(a, c, l, u) {
2587
- var v = V(
2586
+ function nt(o, c, l, u) {
2587
+ var v = J(
2588
2588
  l,
2589
2589
  u,
2590
2590
  /*Create*/
2591
2591
  !0
2592
2592
  );
2593
- v.set(a, c);
2593
+ v.set(o, c);
2594
2594
  }
2595
- function Ft(a, c) {
2596
- var l = zt(a, c), u = Ot(a);
2595
+ function Ct(o, c) {
2596
+ var l = Wt(o, c), u = Lt(o);
2597
2597
  if (u === null)
2598
2598
  return l;
2599
- var v = Ft(u, c);
2599
+ var v = Ct(u, c);
2600
2600
  if (v.length <= 0)
2601
2601
  return l;
2602
2602
  if (l.length <= 0)
2603
2603
  return v;
2604
- for (var I = new T(), w = [], b = 0, y = l; b < y.length; b++) {
2605
- var k = y[b], C = I.has(k);
2606
- C || (I.add(k), w.push(k));
2604
+ for (var R = new T(), w = [], b = 0, y = l; b < y.length; b++) {
2605
+ var k = y[b], C = R.has(k);
2606
+ C || (R.add(k), w.push(k));
2607
2607
  }
2608
- for (var q = 0, Yt = v; q < Yt.length; q++) {
2609
- var k = Yt[q], C = I.has(k);
2610
- C || (I.add(k), w.push(k));
2608
+ for (var K = 0, Zt = v; K < Zt.length; K++) {
2609
+ var k = Zt[K], C = R.has(k);
2610
+ C || (R.add(k), w.push(k));
2611
2611
  }
2612
2612
  return w;
2613
2613
  }
2614
- function zt(a, c) {
2615
- var l = [], u = V(
2616
- a,
2614
+ function Wt(o, c) {
2615
+ var l = [], u = J(
2616
+ o,
2617
2617
  c,
2618
2618
  /*Create*/
2619
2619
  !1
2620
2620
  );
2621
- if (N(u))
2621
+ if (L(u))
2622
2622
  return l;
2623
- for (var v = u.keys(), I = Ee(v), w = 0; ; ) {
2624
- var b = Ce(I);
2623
+ for (var v = u.keys(), R = ke(v), w = 0; ; ) {
2624
+ var b = $e(R);
2625
2625
  if (!b)
2626
2626
  return l.length = w, l;
2627
- var y = ke(b);
2627
+ var y = Ce(b);
2628
2628
  try {
2629
2629
  l[w] = y;
2630
2630
  } catch (k) {
2631
2631
  try {
2632
- $e(I);
2632
+ Ae(R);
2633
2633
  } finally {
2634
2634
  throw k;
2635
2635
  }
@@ -2637,10 +2637,10 @@ var ne;
2637
2637
  w++;
2638
2638
  }
2639
2639
  }
2640
- function Wt(a) {
2641
- if (a === null)
2640
+ function Gt(o) {
2641
+ if (o === null)
2642
2642
  return 1;
2643
- switch (typeof a) {
2643
+ switch (typeof o) {
2644
2644
  case "undefined":
2645
2645
  return 0;
2646
2646
  case "boolean":
@@ -2652,102 +2652,102 @@ var ne;
2652
2652
  case "number":
2653
2653
  return 5;
2654
2654
  case "object":
2655
- return a === null ? 1 : 6;
2655
+ return o === null ? 1 : 6;
2656
2656
  default:
2657
2657
  return 6;
2658
2658
  }
2659
2659
  }
2660
- function N(a) {
2661
- return a === void 0;
2660
+ function L(o) {
2661
+ return o === void 0;
2662
2662
  }
2663
- function st(a) {
2664
- return a === null;
2663
+ function it(o) {
2664
+ return o === null;
2665
2665
  }
2666
- function ve(a) {
2667
- return typeof a == "symbol";
2666
+ function ye(o) {
2667
+ return typeof o == "symbol";
2668
2668
  }
2669
- function P(a) {
2670
- return typeof a == "object" ? a !== null : typeof a == "function";
2669
+ function N(o) {
2670
+ return typeof o == "object" ? o !== null : typeof o == "function";
2671
2671
  }
2672
- function ye(a, c) {
2673
- switch (Wt(a)) {
2672
+ function me(o, c) {
2673
+ switch (Gt(o)) {
2674
2674
  case 0:
2675
- return a;
2675
+ return o;
2676
2676
  case 1:
2677
- return a;
2677
+ return o;
2678
2678
  case 2:
2679
- return a;
2679
+ return o;
2680
2680
  case 3:
2681
- return a;
2681
+ return o;
2682
2682
  case 4:
2683
- return a;
2683
+ return o;
2684
2684
  case 5:
2685
- return a;
2685
+ return o;
2686
2686
  }
2687
- var l = c === 3 ? "string" : c === 5 ? "number" : "default", u = qt(a, r);
2687
+ var l = c === 3 ? "string" : c === 5 ? "number" : "default", u = qt(o, r);
2688
2688
  if (u !== void 0) {
2689
- var v = u.call(a, l);
2690
- if (P(v))
2689
+ var v = u.call(o, l);
2690
+ if (N(v))
2691
2691
  throw new TypeError();
2692
2692
  return v;
2693
2693
  }
2694
- return me(a, l === "default" ? "number" : l);
2694
+ return we(o, l === "default" ? "number" : l);
2695
2695
  }
2696
- function me(a, c) {
2696
+ function we(o, c) {
2697
2697
  if (c === "string") {
2698
- var l = a.toString;
2699
- if (nt(l)) {
2700
- var u = l.call(a);
2701
- if (!P(u))
2698
+ var l = o.toString;
2699
+ if (ot(l)) {
2700
+ var u = l.call(o);
2701
+ if (!N(u))
2702
2702
  return u;
2703
2703
  }
2704
- var v = a.valueOf;
2705
- if (nt(v)) {
2706
- var u = v.call(a);
2707
- if (!P(u))
2704
+ var v = o.valueOf;
2705
+ if (ot(v)) {
2706
+ var u = v.call(o);
2707
+ if (!N(u))
2708
2708
  return u;
2709
2709
  }
2710
2710
  } else {
2711
- var v = a.valueOf;
2712
- if (nt(v)) {
2713
- var u = v.call(a);
2714
- if (!P(u))
2711
+ var v = o.valueOf;
2712
+ if (ot(v)) {
2713
+ var u = v.call(o);
2714
+ if (!N(u))
2715
2715
  return u;
2716
2716
  }
2717
- var I = a.toString;
2718
- if (nt(I)) {
2719
- var u = I.call(a);
2720
- if (!P(u))
2717
+ var R = o.toString;
2718
+ if (ot(R)) {
2719
+ var u = R.call(o);
2720
+ if (!N(u))
2721
2721
  return u;
2722
2722
  }
2723
2723
  }
2724
2724
  throw new TypeError();
2725
2725
  }
2726
- function we(a) {
2727
- return !!a;
2726
+ function _e(o) {
2727
+ return !!o;
2728
2728
  }
2729
- function _e(a) {
2730
- return "" + a;
2729
+ function be(o) {
2730
+ return "" + o;
2731
2731
  }
2732
- function F(a) {
2733
- var c = ye(
2734
- a,
2732
+ function G(o) {
2733
+ var c = me(
2734
+ o,
2735
2735
  3
2736
2736
  /* String */
2737
2737
  );
2738
- return ve(c) ? c : _e(c);
2738
+ return ye(c) ? c : be(c);
2739
2739
  }
2740
- function Gt(a) {
2741
- return Array.isArray ? Array.isArray(a) : a instanceof Object ? a instanceof Array : Object.prototype.toString.call(a) === "[object Array]";
2740
+ function Xt(o) {
2741
+ return Array.isArray ? Array.isArray(o) : o instanceof Object ? o instanceof Array : Object.prototype.toString.call(o) === "[object Array]";
2742
2742
  }
2743
- function nt(a) {
2744
- return typeof a == "function";
2743
+ function ot(o) {
2744
+ return typeof o == "function";
2745
2745
  }
2746
- function Xt(a) {
2747
- return typeof a == "function";
2746
+ function Yt(o) {
2747
+ return typeof o == "function";
2748
2748
  }
2749
- function be(a) {
2750
- switch (Wt(a)) {
2749
+ function Ee(o) {
2750
+ switch (Gt(o)) {
2751
2751
  case 3:
2752
2752
  return !0;
2753
2753
  case 4:
@@ -2756,46 +2756,46 @@ var ne;
2756
2756
  return !1;
2757
2757
  }
2758
2758
  }
2759
- function qt(a, c) {
2760
- var l = a[c];
2759
+ function qt(o, c) {
2760
+ var l = o[c];
2761
2761
  if (l != null) {
2762
- if (!nt(l))
2762
+ if (!ot(l))
2763
2763
  throw new TypeError();
2764
2764
  return l;
2765
2765
  }
2766
2766
  }
2767
- function Ee(a) {
2768
- var c = qt(a, i);
2769
- if (!nt(c))
2767
+ function ke(o) {
2768
+ var c = qt(o, i);
2769
+ if (!ot(c))
2770
2770
  throw new TypeError();
2771
- var l = c.call(a);
2772
- if (!P(l))
2771
+ var l = c.call(o);
2772
+ if (!N(l))
2773
2773
  throw new TypeError();
2774
2774
  return l;
2775
2775
  }
2776
- function ke(a) {
2777
- return a.value;
2776
+ function Ce(o) {
2777
+ return o.value;
2778
2778
  }
2779
- function Ce(a) {
2780
- var c = a.next();
2779
+ function $e(o) {
2780
+ var c = o.next();
2781
2781
  return c.done ? !1 : c;
2782
2782
  }
2783
- function $e(a) {
2784
- var c = a.return;
2785
- c && c.call(a);
2783
+ function Ae(o) {
2784
+ var c = o.return;
2785
+ c && c.call(o);
2786
2786
  }
2787
- function Ot(a) {
2788
- var c = Object.getPrototypeOf(a);
2789
- if (typeof a != "function" || a === d || c !== d)
2787
+ function Lt(o) {
2788
+ var c = Object.getPrototypeOf(o);
2789
+ if (typeof o != "function" || o === _ || c !== _)
2790
2790
  return c;
2791
- var l = a.prototype, u = l && Object.getPrototypeOf(l);
2791
+ var l = o.prototype, u = l && Object.getPrototypeOf(l);
2792
2792
  if (u == null || u === Object.prototype)
2793
2793
  return c;
2794
2794
  var v = u.constructor;
2795
- return typeof v != "function" || v === a ? c : v;
2795
+ return typeof v != "function" || v === o ? c : v;
2796
2796
  }
2797
- function Ae() {
2798
- var a = {}, c = [], l = (
2797
+ function Te() {
2798
+ var o = {}, c = [], l = (
2799
2799
  /** @class */
2800
2800
  function() {
2801
2801
  function w(b, y, k) {
@@ -2823,7 +2823,7 @@ var ne;
2823
2823
  /** @class */
2824
2824
  function() {
2825
2825
  function w() {
2826
- this._keys = [], this._values = [], this._cacheKey = a, this._cacheIndex = -2;
2826
+ this._keys = [], this._values = [], this._cacheKey = o, this._cacheIndex = -2;
2827
2827
  }
2828
2828
  return Object.defineProperty(w.prototype, "size", {
2829
2829
  get: function() {
@@ -2860,17 +2860,17 @@ var ne;
2860
2860
  if (y >= 0) {
2861
2861
  for (var k = this._keys.length, C = y + 1; C < k; C++)
2862
2862
  this._keys[C - 1] = this._keys[C], this._values[C - 1] = this._values[C];
2863
- return this._keys.length--, this._values.length--, b === this._cacheKey && (this._cacheKey = a, this._cacheIndex = -2), !0;
2863
+ return this._keys.length--, this._values.length--, b === this._cacheKey && (this._cacheKey = o, this._cacheIndex = -2), !0;
2864
2864
  }
2865
2865
  return !1;
2866
2866
  }, w.prototype.clear = function() {
2867
- this._keys.length = 0, this._values.length = 0, this._cacheKey = a, this._cacheIndex = -2;
2867
+ this._keys.length = 0, this._values.length = 0, this._cacheKey = o, this._cacheIndex = -2;
2868
2868
  }, w.prototype.keys = function() {
2869
2869
  return new l(this._keys, this._values, u);
2870
2870
  }, w.prototype.values = function() {
2871
2871
  return new l(this._keys, this._values, v);
2872
2872
  }, w.prototype.entries = function() {
2873
- return new l(this._keys, this._values, I);
2873
+ return new l(this._keys, this._values, R);
2874
2874
  }, w.prototype["@@iterator"] = function() {
2875
2875
  return this.entries();
2876
2876
  }, w.prototype[i] = function() {
@@ -2886,7 +2886,7 @@ var ne;
2886
2886
  function v(w, b) {
2887
2887
  return b;
2888
2888
  }
2889
- function I(w, b) {
2889
+ function R(w, b) {
2890
2890
  return [w, b];
2891
2891
  }
2892
2892
  }
@@ -2894,39 +2894,39 @@ var ne;
2894
2894
  return (
2895
2895
  /** @class */
2896
2896
  function() {
2897
- function a() {
2897
+ function o() {
2898
2898
  this._map = new A();
2899
2899
  }
2900
- return Object.defineProperty(a.prototype, "size", {
2900
+ return Object.defineProperty(o.prototype, "size", {
2901
2901
  get: function() {
2902
2902
  return this._map.size;
2903
2903
  },
2904
2904
  enumerable: !0,
2905
2905
  configurable: !0
2906
- }), a.prototype.has = function(c) {
2906
+ }), o.prototype.has = function(c) {
2907
2907
  return this._map.has(c);
2908
- }, a.prototype.add = function(c) {
2908
+ }, o.prototype.add = function(c) {
2909
2909
  return this._map.set(c, c), this;
2910
- }, a.prototype.delete = function(c) {
2910
+ }, o.prototype.delete = function(c) {
2911
2911
  return this._map.delete(c);
2912
- }, a.prototype.clear = function() {
2912
+ }, o.prototype.clear = function() {
2913
2913
  this._map.clear();
2914
- }, a.prototype.keys = function() {
2914
+ }, o.prototype.keys = function() {
2915
2915
  return this._map.keys();
2916
- }, a.prototype.values = function() {
2916
+ }, o.prototype.values = function() {
2917
2917
  return this._map.values();
2918
- }, a.prototype.entries = function() {
2918
+ }, o.prototype.entries = function() {
2919
2919
  return this._map.entries();
2920
- }, a.prototype["@@iterator"] = function() {
2920
+ }, o.prototype["@@iterator"] = function() {
2921
2921
  return this.keys();
2922
- }, a.prototype[i] = function() {
2922
+ }, o.prototype[i] = function() {
2923
2923
  return this.keys();
2924
- }, a;
2924
+ }, o;
2925
2925
  }()
2926
2926
  );
2927
2927
  }
2928
- function Te() {
2929
- var a = 16, c = f.create(), l = u();
2928
+ function Oe() {
2929
+ var o = 16, c = g.create(), l = u();
2930
2930
  return (
2931
2931
  /** @class */
2932
2932
  function() {
@@ -2939,21 +2939,21 @@ var ne;
2939
2939
  /*create*/
2940
2940
  !1
2941
2941
  );
2942
- return C !== void 0 ? f.has(C, this._key) : !1;
2942
+ return C !== void 0 ? g.has(C, this._key) : !1;
2943
2943
  }, y.prototype.get = function(k) {
2944
2944
  var C = v(
2945
2945
  k,
2946
2946
  /*create*/
2947
2947
  !1
2948
2948
  );
2949
- return C !== void 0 ? f.get(C, this._key) : void 0;
2949
+ return C !== void 0 ? g.get(C, this._key) : void 0;
2950
2950
  }, y.prototype.set = function(k, C) {
2951
- var q = v(
2951
+ var K = v(
2952
2952
  k,
2953
2953
  /*create*/
2954
2954
  !0
2955
2955
  );
2956
- return q[this._key] = C, this;
2956
+ return K[this._key] = C, this;
2957
2957
  }, y.prototype.delete = function(k) {
2958
2958
  var C = v(
2959
2959
  k,
@@ -2970,41 +2970,41 @@ var ne;
2970
2970
  var y;
2971
2971
  do
2972
2972
  y = "@@WeakMap@@" + b();
2973
- while (f.has(c, y));
2973
+ while (g.has(c, y));
2974
2974
  return c[y] = !0, y;
2975
2975
  }
2976
2976
  function v(y, k) {
2977
2977
  if (!t.call(y, l)) {
2978
2978
  if (!k)
2979
2979
  return;
2980
- Object.defineProperty(y, l, { value: f.create() });
2980
+ Object.defineProperty(y, l, { value: g.create() });
2981
2981
  }
2982
2982
  return y[l];
2983
2983
  }
2984
- function I(y, k) {
2984
+ function R(y, k) {
2985
2985
  for (var C = 0; C < k; ++C)
2986
2986
  y[C] = Math.random() * 255 | 0;
2987
2987
  return y;
2988
2988
  }
2989
2989
  function w(y) {
2990
- return typeof Uint8Array == "function" ? typeof crypto < "u" ? crypto.getRandomValues(new Uint8Array(y)) : typeof msCrypto < "u" ? msCrypto.getRandomValues(new Uint8Array(y)) : I(new Uint8Array(y), y) : I(new Array(y), y);
2990
+ return typeof Uint8Array == "function" ? typeof crypto < "u" ? crypto.getRandomValues(new Uint8Array(y)) : typeof msCrypto < "u" ? msCrypto.getRandomValues(new Uint8Array(y)) : R(new Uint8Array(y), y) : R(new Array(y), y);
2991
2991
  }
2992
2992
  function b() {
2993
- var y = w(a);
2993
+ var y = w(o);
2994
2994
  y[6] = y[6] & 79 | 64, y[8] = y[8] & 191 | 128;
2995
- for (var k = "", C = 0; C < a; ++C) {
2996
- var q = y[C];
2997
- (C === 4 || C === 6 || C === 8) && (k += "-"), q < 16 && (k += "0"), k += q.toString(16).toLowerCase();
2995
+ for (var k = "", C = 0; C < o; ++C) {
2996
+ var K = y[C];
2997
+ (C === 4 || C === 6 || C === 8) && (k += "-"), K < 16 && (k += "0"), k += K.toString(16).toLowerCase();
2998
2998
  }
2999
2999
  return k;
3000
3000
  }
3001
3001
  }
3002
- function St(a) {
3003
- return a.__ = void 0, delete a.__, a;
3002
+ function Nt(o) {
3003
+ return o.__ = void 0, delete o.__, o;
3004
3004
  }
3005
3005
  });
3006
- })(ne || (ne = {}));
3007
- function en() {
3006
+ })(re || (re = {}));
3007
+ function sn() {
3008
3008
  const s = document.createElement("style");
3009
3009
  return s.textContent = `
3010
3010
  * {
@@ -3012,177 +3012,182 @@ function en() {
3012
3012
  }
3013
3013
  `, s;
3014
3014
  }
3015
- function sn() {
3015
+ function nn() {
3016
3016
  const s = document.createElement("style");
3017
3017
  return s.textContent = `
3018
3018
  * {
3019
3019
  pointer-events: none !important;
3020
+ user-select: none !important;
3020
3021
  }
3021
3022
  `, s;
3022
3023
  }
3023
- function nn(s) {
3024
- Le(s, "svelte-150j673", '#liveroom-client-element.svelte-150j673.svelte-150j673{font-family:Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;line-height:1.5;font-weight:400;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}#users-container.svelte-150j673.svelte-150j673{z-index:99999;position:fixed;inset:0;overflow:hidden;pointer-events:none}.user.svelte-150j673.svelte-150j673{z-index:10;position:absolute;top:0;left:0;user-select:none;transform:translate(var(--x), var(--y));transition:transform 100ms linear;will-change:transform}.user.svelte-150j673 .cursor.svelte-150j673{position:absolute;top:0;left:0;color:var(--color);transform-origin:top left;transform:rotate(6deg)}.user[data-isself="true"].svelte-150j673 .cursor.svelte-150j673{display:none}.user-name.svelte-150j673.svelte-150j673{padding:0.25rem 0.7rem;font-size:0.8rem;font-weight:600;color:black;background-color:var(--color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:9999px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05)}.user.svelte-150j673 .user-name.svelte-150j673{position:absolute;top:20px;left:16px}.user[data-isself="true"].svelte-150j673 .user-name.svelte-150j673{display:none}.user.svelte-150j673 .halo.svelte-150j673{transform:scale(0);z-index:-1;position:absolute;top:-60px;left:-60px;width:120px;height:120px;border-radius:9999px;background-color:var(--color);opacity:0.25;transition:transform 100ms ease-out;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05)}.user.svelte-150j673 .halo[data-show="true"].svelte-150j673{transform:scale(1)}');
3024
+ function rn(s) {
3025
+ Ne(s, "svelte-150j673", '#liveroom-client-element.svelte-150j673.svelte-150j673{font-family:Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;line-height:1.5;font-weight:400;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}#users-container.svelte-150j673.svelte-150j673{z-index:99999;position:fixed;inset:0;overflow:hidden;pointer-events:none}.user.svelte-150j673.svelte-150j673{z-index:10;position:absolute;top:0;left:0;user-select:none;transform:translate(var(--x), var(--y));transition:transform 100ms linear;will-change:transform}.user.svelte-150j673 .cursor.svelte-150j673{position:absolute;top:0;left:0;color:var(--color);transform-origin:top left;transform:rotate(6deg)}.user[data-isself="true"].svelte-150j673 .cursor.svelte-150j673{display:none}.user-name.svelte-150j673.svelte-150j673{padding:0.25rem 0.7rem;font-size:0.8rem;font-weight:600;color:black;background-color:var(--color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:9999px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05)}.user.svelte-150j673 .user-name.svelte-150j673{position:absolute;top:20px;left:16px}.user[data-isself="true"].svelte-150j673 .user-name.svelte-150j673{display:none}.user.svelte-150j673 .halo.svelte-150j673{transform:scale(0);z-index:-1;position:absolute;top:-60px;left:-60px;width:120px;height:120px;border-radius:9999px;background-color:var(--color);opacity:0.25;transition:transform 100ms ease-out;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05)}.user.svelte-150j673 .halo[data-show="true"].svelte-150j673{transform:scale(1)}');
3025
3026
  }
3026
- function re(s, n, t) {
3027
+ function ie(s, n, t) {
3027
3028
  const e = s.slice();
3028
- return e[21] = n[t], e;
3029
+ return e[22] = n[t], e;
3029
3030
  }
3030
- function ie(s) {
3031
- let n, t = [], e = /* @__PURE__ */ new Map(), r = ee(Object.values(
3031
+ function oe(s) {
3032
+ let n, t = [], e = /* @__PURE__ */ new Map(), r = se(Object.values(
3032
3033
  /*users*/
3033
3034
  s[0]
3034
3035
  ));
3035
- const i = (o) => (
3036
+ const i = (a) => (
3036
3037
  /*user*/
3037
- o[21].id
3038
+ a[22].id
3038
3039
  );
3039
- for (let o = 0; o < r.length; o += 1) {
3040
- let h = re(s, r, o), p = i(h);
3041
- e.set(p, t[o] = oe(p, h));
3040
+ for (let a = 0; a < r.length; a += 1) {
3041
+ let h = ie(s, r, a), p = i(h);
3042
+ e.set(p, t[a] = ae(p, h));
3042
3043
  }
3043
3044
  return {
3044
3045
  c() {
3045
- n = et("div");
3046
- for (let o = 0; o < t.length; o += 1)
3047
- t[o].c();
3046
+ n = rt("div");
3047
+ for (let a = 0; a < t.length; a += 1)
3048
+ t[a].c();
3048
3049
  S(n, "id", "users-container"), S(n, "class", "svelte-150j673");
3049
3050
  },
3050
- m(o, h) {
3051
- At(o, n, h);
3051
+ m(a, h) {
3052
+ xt(a, n, h);
3052
3053
  for (let p = 0; p < t.length; p += 1)
3053
3054
  t[p] && t[p].m(n, null);
3054
3055
  },
3055
- p(o, h) {
3056
+ p(a, h) {
3056
3057
  h & /*Object, users, me, parseFloat, users_count*/
3057
- 7 && (r = ee(Object.values(
3058
+ 7 && (r = se(Object.values(
3058
3059
  /*users*/
3059
- o[0]
3060
- )), t = Ge(t, h, i, 1, o, r, e, n, We, oe, null, re));
3060
+ a[0]
3061
+ )), t = Xe(t, h, i, 1, a, r, e, n, Ge, ae, null, ie));
3061
3062
  },
3062
- d(o) {
3063
- o && mt(n);
3063
+ d(a) {
3064
+ a && Et(n);
3064
3065
  for (let h = 0; h < t.length; h += 1)
3065
3066
  t[h].d();
3066
3067
  }
3067
3068
  };
3068
3069
  }
3069
- function oe(s, n) {
3070
- let t, e, r, i, o, h = (
3070
+ function ae(s, n) {
3071
+ let t, e, r, i, a, h = (
3071
3072
  /*user*/
3072
- n[21].name + ""
3073
- ), p, f, d, _, A, T, x;
3073
+ n[22].name + ""
3074
+ ), p, g, _, f, A, T, x;
3074
3075
  return {
3075
3076
  key: s,
3076
3077
  first: null,
3077
3078
  c() {
3078
- t = et("div"), e = Qt("svg"), r = Qt("path"), i = xt(), o = et("span"), p = ce(h), f = xt(), d = et("div"), A = xt(), S(r, "d", "M2.2706 0.0593359L25.4277 8.05957H25.45926C25.65896 8.13153 25.83096 8.25952 25.95221 8.42653C26.07357 8.59354 26.13851 8.79166 26.13851 8.99459C26.13851 9.19751 26.07357 9.39564 25.95221 9.56265C25.83096 9.72966 25.65896 9.85765 25.45926 9.92962L15.3543 13.7698L11.3124 23.37C11.2344 23.5561 11.0994 23.7156 10.9248 23.828C10.7503 23.9402 10.5443 24.0002 10.3335 24C10.1172 24 9.9061 23.9365 9.7291 23.8184C9.552 23.7004 9.4176 23.5332 9.344 23.34L0.9233 1.33937C0.8555 1.16076 0.8426 0.967504 0.8861 0.782189C0.9297 0.596873 1.0278 0.427163 1.1691 0.292901C1.3105 0.158639 1.4891 0.0653762 1.6841 0.0240151C1.8792 -0.0173461 2.0826 -0.00509504 2.2706 0.0593359Z"), S(e, "width", "23"), S(e, "viewBox", "0 0 27 24"), S(e, "fill", "currentColor"), S(e, "aria-hidden", "true"), S(e, "xmlns", "http://www.w3.org/2000/svg"), S(e, "class", "cursor svelte-150j673"), S(o, "class", "user-name svelte-150j673"), S(d, "class", "halo svelte-150j673"), S(d, "data-show", _ = /*user*/
3079
- (n[21].id == /*me*/
3079
+ t = rt("div"), e = Kt("svg"), r = Kt("path"), i = Rt(), a = rt("span"), p = le(h), g = Rt(), _ = rt("div"), A = Rt(), S(r, "d", "M2.2706 0.0593359L25.4277 8.05957H25.45926C25.65896 8.13153 25.83096 8.25952 25.95221 8.42653C26.07357 8.59354 26.13851 8.79166 26.13851 8.99459C26.13851 9.19751 26.07357 9.39564 25.95221 9.56265C25.83096 9.72966 25.65896 9.85765 25.45926 9.92962L15.3543 13.7698L11.3124 23.37C11.2344 23.5561 11.0994 23.7156 10.9248 23.828C10.7503 23.9402 10.5443 24.0002 10.3335 24C10.1172 24 9.9061 23.9365 9.7291 23.8184C9.552 23.7004 9.4176 23.5332 9.344 23.34L0.9233 1.33937C0.8555 1.16076 0.8426 0.967504 0.8861 0.782189C0.9297 0.596873 1.0278 0.427163 1.1691 0.292901C1.3105 0.158639 1.4891 0.0653762 1.6841 0.0240151C1.8792 -0.0173461 2.0826 -0.00509504 2.2706 0.0593359Z"), S(e, "width", "23"), S(e, "viewBox", "0 0 27 24"), S(e, "fill", "currentColor"), S(e, "aria-hidden", "true"), S(e, "xmlns", "http://www.w3.org/2000/svg"), S(e, "class", "cursor svelte-150j673"), S(a, "class", "user-name svelte-150j673"), S(_, "class", "halo svelte-150j673"), S(_, "data-show", f = /*user*/
3080
+ (n[22].id == /*me*/
3080
3081
  n[1].id && /*user*/
3081
- n[21].is_shift_key_down || /*user*/
3082
- n[21].id != /*me*/
3082
+ n[22].is_shift_key_down || /*user*/
3083
+ n[22].id != /*me*/
3083
3084
  n[1].id && /*user*/
3084
- (n[21].is_shift_key_down || /*user*/
3085
- n[21].is_mouse_down)) && /*users_count*/
3085
+ (n[22].is_shift_key_down || /*user*/
3086
+ n[22].is_mouse_down)) && /*users_count*/
3086
3087
  n[2] > 1), S(t, "id", T = "user-" + /*user*/
3087
- n[21].id), S(t, "class", "user svelte-150j673"), S(t, "data-isself", x = /*user*/
3088
- n[21].id == /*me*/
3089
- n[1].id), rt(
3088
+ n[22].id), S(t, "class", "user svelte-150j673"), S(t, "data-isself", x = /*user*/
3089
+ n[22].id == /*me*/
3090
+ n[1].id), at(
3090
3091
  t,
3091
3092
  "--color",
3092
3093
  /*user*/
3093
- n[21].color
3094
- ), rt(t, "--x", parseFloat(
3094
+ n[22].color
3095
+ ), at(t, "--x", parseFloat(
3095
3096
  /*user*/
3096
- n[21].x
3097
- ) + "vw"), rt(t, "--y", parseFloat(
3097
+ n[22].x
3098
+ ) + "vw"), at(t, "--y", parseFloat(
3098
3099
  /*user*/
3099
- n[21].y
3100
+ n[22].y
3100
3101
  ) + "vh"), this.first = t;
3101
3102
  },
3102
3103
  m(H, M) {
3103
- At(H, t, M), z(t, e), z(e, r), z(t, i), z(t, o), z(o, p), z(t, f), z(t, d), z(t, A);
3104
+ xt(H, t, M), X(t, e), X(e, r), X(t, i), X(t, a), X(a, p), X(t, g), X(t, _), X(t, A);
3104
3105
  },
3105
3106
  p(H, M) {
3106
3107
  n = H, M & /*users*/
3107
3108
  1 && h !== (h = /*user*/
3108
- n[21].name + "") && He(p, h), M & /*users, me, users_count*/
3109
- 7 && _ !== (_ = /*user*/
3110
- (n[21].id == /*me*/
3109
+ n[22].name + "") && Ie(p, h), M & /*users, me, users_count*/
3110
+ 7 && f !== (f = /*user*/
3111
+ (n[22].id == /*me*/
3111
3112
  n[1].id && /*user*/
3112
- n[21].is_shift_key_down || /*user*/
3113
- n[21].id != /*me*/
3113
+ n[22].is_shift_key_down || /*user*/
3114
+ n[22].id != /*me*/
3114
3115
  n[1].id && /*user*/
3115
- (n[21].is_shift_key_down || /*user*/
3116
- n[21].is_mouse_down)) && /*users_count*/
3117
- n[2] > 1) && S(d, "data-show", _), M & /*users*/
3116
+ (n[22].is_shift_key_down || /*user*/
3117
+ n[22].is_mouse_down)) && /*users_count*/
3118
+ n[2] > 1) && S(_, "data-show", f), M & /*users*/
3118
3119
  1 && T !== (T = "user-" + /*user*/
3119
- n[21].id) && S(t, "id", T), M & /*users, me*/
3120
+ n[22].id) && S(t, "id", T), M & /*users, me*/
3120
3121
  3 && x !== (x = /*user*/
3121
- n[21].id == /*me*/
3122
+ n[22].id == /*me*/
3122
3123
  n[1].id) && S(t, "data-isself", x), M & /*users*/
3123
- 1 && rt(
3124
+ 1 && at(
3124
3125
  t,
3125
3126
  "--color",
3126
3127
  /*user*/
3127
- n[21].color
3128
+ n[22].color
3128
3129
  ), M & /*users*/
3129
- 1 && rt(t, "--x", parseFloat(
3130
+ 1 && at(t, "--x", parseFloat(
3130
3131
  /*user*/
3131
- n[21].x
3132
+ n[22].x
3132
3133
  ) + "vw"), M & /*users*/
3133
- 1 && rt(t, "--y", parseFloat(
3134
+ 1 && at(t, "--y", parseFloat(
3134
3135
  /*user*/
3135
- n[21].y
3136
+ n[22].y
3136
3137
  ) + "vh");
3137
3138
  },
3138
3139
  d(H) {
3139
- H && mt(t);
3140
+ H && Et(t);
3140
3141
  }
3141
3142
  };
3142
3143
  }
3143
- function rn(s) {
3144
+ function on(s) {
3144
3145
  let n, t = (
3145
3146
  /*me*/
3146
3147
  s[1] && /*users*/
3147
- s[0] && ie(s)
3148
+ s[0] && oe(s)
3148
3149
  );
3149
3150
  return {
3150
3151
  c() {
3151
- n = et("div"), t && t.c(), S(n, "id", "liveroom-client-element"), S(n, "class", "svelte-150j673");
3152
+ n = rt("div"), t && t.c(), S(n, "id", "liveroom-client-element"), S(n, "class", "svelte-150j673");
3152
3153
  },
3153
3154
  m(e, r) {
3154
- At(e, n, r), t && t.m(n, null);
3155
+ xt(e, n, r), t && t.m(n, null);
3155
3156
  },
3156
3157
  p(e, [r]) {
3157
3158
  /*me*/
3158
3159
  e[1] && /*users*/
3159
- e[0] ? t ? t.p(e, r) : (t = ie(e), t.c(), t.m(n, null)) : t && (t.d(1), t = null);
3160
+ e[0] ? t ? t.p(e, r) : (t = oe(e), t.c(), t.m(n, null)) : t && (t.d(1), t = null);
3160
3161
  },
3161
- i: dt,
3162
- o: dt,
3162
+ i: mt,
3163
+ o: mt,
3163
3164
  d(e) {
3164
- e && mt(n), t && t.d();
3165
+ e && Et(n), t && t.d();
3165
3166
  }
3166
3167
  };
3167
3168
  }
3168
- function on(s, n, t) {
3169
- let { url: e } = n, { room_id: r } = n, { user_name: i } = n, o, h = !1, p = en(), f = sn(), d, _, A;
3170
- De(async () => {
3171
- const m = new URLSearchParams(window.location.search), L = m.get("_liveroom"), R = L == null ? void 0 : L.split("https://meet.google.com/");
3172
- let tt = R == null ? void 0 : R[0];
3173
- !!(R != null && R[1]) && (tt = R[1].split("?")[0]), t(3, r = tt || r);
3174
- const ht = m.get("_liveroom_user_name");
3175
- ht && t(4, i = ht), T();
3176
- }), Ue(() => {
3177
- x(), O();
3169
+ function Bt(s, n) {
3170
+ return s.tagName === "BODY" ? window : n === "vertical" && s.scrollHeight > s.clientHeight || n === "horizontal" && s.scrollWidth > s.clientWidth ? s : s.parentElement ? Bt(s.parentElement, n) : window;
3171
+ }
3172
+ function an(s, n, t) {
3173
+ let { version: e } = n, { url: r } = n, { room_id: i } = n, { user_name: a = void 0 } = n, h, p = !1, g = sn(), _ = nn(), f, A, T;
3174
+ Ue(async () => {
3175
+ console.log(`[Liveroom] Starting... (v${e})`);
3176
+ const m = new URLSearchParams(window.location.search), I = m.get("_liveroom"), D = I == null ? void 0 : I.split("https://meet.google.com/");
3177
+ let J = D == null ? void 0 : D[0];
3178
+ !!(D != null && D[1]) && (J = D[1].split("?")[0]), t(3, i = J || i);
3179
+ const z = m.get("_liveroom_user_name");
3180
+ z && t(4, a = z), x();
3181
+ }), Je(() => {
3182
+ H(), P();
3178
3183
  });
3179
- function T() {
3180
- o = new tn({
3181
- url: e,
3182
- topic: `liveroom-livestate:${r}`,
3184
+ function x() {
3185
+ h = new en({
3186
+ url: r,
3187
+ topic: `liveroom-livestate:${i}`,
3183
3188
  params: {
3184
- room_id: r,
3185
- user_name: i,
3189
+ room_id: i,
3190
+ user_name: a,
3186
3191
  referrer: document.referrer,
3187
3192
  current_url: window.location.href,
3188
3193
  inner_width: window.innerWidth,
@@ -3191,33 +3196,50 @@ function on(s, n, t) {
3191
3196
  user_agent: window.navigator.userAgent
3192
3197
  },
3193
3198
  socketOptions: { logger: null }
3194
- }), o.addEventListener("click-from-another-user", ({ detail: { x: m, y: L } }) => {
3195
- const R = new MouseEvent(
3199
+ }), h.addEventListener("wheel-from-another-user", ({ detail: { delta_x: m, delta_y: I, x: D, y: J } }) => {
3200
+ const F = parseInt(m), z = parseInt(I), pt = new WheelEvent(
3201
+ "wheel",
3202
+ {
3203
+ view: window,
3204
+ bubbles: !0,
3205
+ cancelable: !0,
3206
+ clientX: window.innerWidth * parseFloat(D) / 100,
3207
+ clientY: window.innerHeight * parseFloat(J) / 100,
3208
+ deltaX: F,
3209
+ deltaY: z,
3210
+ deltaMode: 0
3211
+ }
3212
+ ), ft = document.head.contains(_);
3213
+ ft && document.head.removeChild(_);
3214
+ const nt = document.elementFromPoint(pt.clientX, pt.clientY);
3215
+ ft && document.head.appendChild(_), (nt instanceof HTMLElement || nt instanceof SVGElement) && (Math.abs(z) >= Math.abs(F) ? Bt(nt, "vertical").scrollBy(0, z) : Bt(nt, "horizontal").scrollBy(F, 0));
3216
+ }), h.addEventListener("click-from-another-user", ({ detail: { x: m, y: I } }) => {
3217
+ const D = new MouseEvent(
3196
3218
  "click",
3197
3219
  {
3198
3220
  view: window,
3199
3221
  bubbles: !0,
3200
3222
  cancelable: !0,
3201
3223
  clientX: window.innerWidth * parseFloat(m) / 100,
3202
- clientY: window.innerHeight * parseFloat(L) / 100
3224
+ clientY: window.innerHeight * parseFloat(I) / 100
3203
3225
  }
3204
- ), tt = document.head.contains(f);
3205
- tt && document.head.removeChild(f);
3206
- const V = document.elementFromPoint(R.clientX, R.clientY);
3207
- tt && document.head.appendChild(f), (V instanceof HTMLElement || V instanceof SVGElement) && V.dispatchEvent(R);
3208
- }), o.addEventListener("livestate-change", ({ detail: { state: m } }) => {
3209
- t(3, r = m.room_id), t(1, d = m.me), t(0, _ = m.users);
3210
- }), o.connect(), window.addEventListener("mousemove", H), window.addEventListener("mousedown", M), window.addEventListener("mouseup", G), window.addEventListener("keydown", Y), window.addEventListener("keyup", Z), window.addEventListener("resize", Q);
3211
- }
3212
- function x() {
3213
- window.removeEventListener("resize", Q), window.removeEventListener("keyup", Z), window.removeEventListener("keydown", Y), window.removeEventListener("mouseup", G), window.removeEventListener("mousedown", M), window.removeEventListener("mousemove", H), o == null || o.disconnect();
3214
- }
3215
- function H(m) {
3216
- o && (d != null && d.id) && o.dispatchEvent(new CustomEvent(
3226
+ ), J = document.head.contains(_);
3227
+ J && document.head.removeChild(_);
3228
+ const F = document.elementFromPoint(D.clientX, D.clientY);
3229
+ J && document.head.appendChild(_), (F instanceof HTMLElement || F instanceof SVGElement) && F.dispatchEvent(D);
3230
+ }), h.addEventListener("livestate-change", ({ detail: { state: m } }) => {
3231
+ t(3, i = m.room_id), t(1, f = m.me), t(0, A = m.users);
3232
+ }), h.connect(), window.addEventListener("mousemove", M), window.addEventListener("mousedown", q), window.addEventListener("mouseup", Z), window.addEventListener("keydown", et), window.addEventListener("keyup", st), window.addEventListener("resize", Q);
3233
+ }
3234
+ function H() {
3235
+ window.removeEventListener("resize", Q), window.removeEventListener("keyup", st), window.removeEventListener("keydown", et), window.removeEventListener("mouseup", Z), window.removeEventListener("mousedown", q), window.removeEventListener("mousemove", M), h == null || h.disconnect();
3236
+ }
3237
+ function M(m) {
3238
+ h && (f != null && f.id) && h.dispatchEvent(new CustomEvent(
3217
3239
  "mouse_move",
3218
3240
  {
3219
3241
  detail: {
3220
- user_id: d.id,
3242
+ user_id: f.id,
3221
3243
  x: Number(m.clientX / window.innerWidth * 100).toFixed(2),
3222
3244
  // in %
3223
3245
  y: Number(m.clientY / window.innerHeight * 100).toFixed(2)
@@ -3226,70 +3248,89 @@ function on(s, n, t) {
3226
3248
  }
3227
3249
  ));
3228
3250
  }
3229
- function M() {
3230
- o && (d != null && d.id) && o.dispatchEvent(new CustomEvent("mouse_down", { detail: { user_id: d.id } }));
3251
+ function q() {
3252
+ h && (f != null && f.id) && h.dispatchEvent(new CustomEvent("mouse_down", { detail: { user_id: f.id } }));
3231
3253
  }
3232
- function G() {
3233
- o && (d != null && d.id) && o.dispatchEvent(new CustomEvent("mouse_up", { detail: { user_id: d.id } }));
3254
+ function Z() {
3255
+ h && (f != null && f.id) && h.dispatchEvent(new CustomEvent("mouse_up", { detail: { user_id: f.id } }));
3234
3256
  }
3235
- const X = ["Shift"];
3236
- function Y(m) {
3237
- !m.repeat && X.includes(m.key) && o && (d != null && d.id) && o.dispatchEvent(new CustomEvent("key_down", { detail: { key: m.key, user_id: d.id } }));
3257
+ const tt = ["Shift"];
3258
+ function et(m) {
3259
+ !m.repeat && tt.includes(m.key) && h && (f != null && f.id) && h.dispatchEvent(new CustomEvent("key_down", { detail: { key: m.key, user_id: f.id } }));
3238
3260
  }
3239
- function Z(m) {
3240
- X.includes(m.key) && o && (d != null && d.id) && o.dispatchEvent(new CustomEvent("key_up", { detail: { key: m.key, user_id: d.id } }));
3261
+ function st(m) {
3262
+ tt.includes(m.key) && h && (f != null && f.id) && h.dispatchEvent(new CustomEvent("key_up", { detail: { key: m.key, user_id: f.id } }));
3241
3263
  }
3242
3264
  function Q() {
3243
- o && (d != null && d.id) && o.dispatchEvent(new CustomEvent(
3265
+ h && (f != null && f.id) && h.dispatchEvent(new CustomEvent(
3244
3266
  "window_resize",
3245
3267
  {
3246
3268
  detail: {
3247
3269
  inner_width: window.innerWidth,
3248
3270
  inner_height: window.innerHeight,
3249
- user_id: d.id
3271
+ user_id: f.id
3250
3272
  }
3251
3273
  }
3252
3274
  ));
3253
3275
  }
3254
- function K() {
3255
- document.head.appendChild(p), document.head.appendChild(f), t(6, h = !0);
3256
- }
3257
3276
  function O() {
3258
- document.head.removeChild(p), document.head.removeChild(f), t(6, h = !1);
3277
+ document.head.appendChild(g), document.head.appendChild(_), t(7, p = !0);
3278
+ }
3279
+ function P() {
3280
+ document.head.removeChild(g), document.head.removeChild(_), t(7, p = !1);
3259
3281
  }
3260
3282
  return s.$$set = (m) => {
3261
- "url" in m && t(5, e = m.url), "room_id" in m && t(3, r = m.room_id), "user_name" in m && t(4, i = m.user_name);
3283
+ "version" in m && t(5, e = m.version), "url" in m && t(6, r = m.url), "room_id" in m && t(3, i = m.room_id), "user_name" in m && t(4, a = m.user_name);
3262
3284
  }, s.$$.update = () => {
3263
3285
  s.$$.dirty & /*users*/
3264
- 1 && t(2, A = Object.keys(_ || {}).length), s.$$.dirty & /*isClickBlocked, users*/
3265
- 65 && !h && _ && Object.values(_).some((m) => m.type == "admin" && m.is_space_key_down) && K(), s.$$.dirty & /*isClickBlocked, users*/
3266
- 65 && h && _ && Object.values(_).filter((m) => m.type == "admin").every((m) => !m.is_space_key_down) && O();
3267
- }, [_, d, A, r, i, e, h];
3286
+ 1 && t(2, T = Object.keys(A || {}).length), s.$$.dirty & /*isClickBlocked, users*/
3287
+ 129 && !p && A && Object.values(A).some((m) => m.type == "admin" && m.is_space_key_down) && O(), s.$$.dirty & /*isClickBlocked, users*/
3288
+ 129 && p && A && Object.values(A).filter((m) => m.type == "admin").every((m) => !m.is_space_key_down) && P();
3289
+ }, [A, f, T, i, a, e, r, p];
3268
3290
  }
3269
- class an extends Ke {
3291
+ class hn extends ts {
3270
3292
  constructor(n) {
3271
- super(), Ze(this, n, on, rn, xe, { url: 5, room_id: 3, user_name: 4 }, nn);
3293
+ super(), Qe(
3294
+ this,
3295
+ n,
3296
+ an,
3297
+ on,
3298
+ Me,
3299
+ {
3300
+ version: 5,
3301
+ url: 6,
3302
+ room_id: 3,
3303
+ user_name: 4
3304
+ },
3305
+ rn
3306
+ );
3272
3307
  }
3273
- get url() {
3308
+ get version() {
3274
3309
  return this.$$.ctx[5];
3275
3310
  }
3311
+ set version(n) {
3312
+ this.$$set({ version: n }), lt();
3313
+ }
3314
+ get url() {
3315
+ return this.$$.ctx[6];
3316
+ }
3276
3317
  set url(n) {
3277
- this.$$set({ url: n }), ut();
3318
+ this.$$set({ url: n }), lt();
3278
3319
  }
3279
3320
  get room_id() {
3280
3321
  return this.$$.ctx[3];
3281
3322
  }
3282
3323
  set room_id(n) {
3283
- this.$$set({ room_id: n }), ut();
3324
+ this.$$set({ room_id: n }), lt();
3284
3325
  }
3285
3326
  get user_name() {
3286
3327
  return this.$$.ctx[4];
3287
3328
  }
3288
3329
  set user_name(n) {
3289
- this.$$set({ user_name: n }), ut();
3330
+ this.$$set({ user_name: n }), lt();
3290
3331
  }
3291
3332
  }
3292
- customElements.define("liveroom-client-element", Qe(an, { url: {}, room_id: {}, user_name: {} }, [], [], !0));
3333
+ customElements.define("liveroom-client-element", Ke(hn, { version: {}, url: {}, room_id: {}, user_name: {} }, [], [], !0));
3293
3334
  export {
3294
- an as default
3335
+ hn as default
3295
3336
  };