@moq/watch 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ui/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Button as lt, Icon as V, Stats as Bt } from "@moq/ui-core";
2
2
  import { Signals as It, Moq as Nt } from "@moq/hang";
3
- const Ut = !1, Ft = (t, e) => t === e, Kt = /* @__PURE__ */ Symbol("solid-track"), rt = {
3
+ const Ut = !1, Ft = (t, e) => t === e, Kt = /* @__PURE__ */ Symbol("solid-track"), nt = {
4
4
  equals: Ft
5
5
  };
6
6
  let Et = Wt;
7
- const F = 1, nt = 2, Pt = {
7
+ const F = 1, rt = 2, Pt = {
8
8
  owned: null,
9
9
  cleanups: null,
10
10
  context: null,
@@ -13,42 +13,42 @@ const F = 1, nt = 2, Pt = {
13
13
  var g = null;
14
14
  let ft = null, Dt = null, w = null, A = null, z = null, ct = 0;
15
15
  function tt(t, e) {
16
- const r = w, a = g, n = t.length === 0, o = e === void 0 ? a : e, s = n ? Pt : {
16
+ const n = w, a = g, r = t.length === 0, o = e === void 0 ? a : e, s = r ? Pt : {
17
17
  owned: null,
18
18
  cleanups: null,
19
19
  context: o ? o.context : null,
20
20
  owner: o
21
- }, i = n ? t : () => t(() => R(() => X(s)));
21
+ }, i = r ? t : () => t(() => R(() => X(s)));
22
22
  g = s, w = null;
23
23
  try {
24
24
  return Y(i, !0);
25
25
  } finally {
26
- w = r, g = a;
26
+ w = n, g = a;
27
27
  }
28
28
  }
29
29
  function j(t, e) {
30
- e = e ? Object.assign({}, rt, e) : rt;
31
- const r = {
30
+ e = e ? Object.assign({}, nt, e) : nt;
31
+ const n = {
32
32
  value: t,
33
33
  observers: null,
34
34
  observerSlots: null,
35
35
  comparator: e.equals || void 0
36
- }, a = (n) => (typeof n == "function" && (n = n(r.value)), Tt(r, n));
37
- return [jt.bind(r), a];
36
+ }, a = (r) => (typeof r == "function" && (r = r(n.value)), Tt(n, r));
37
+ return [jt.bind(n), a];
38
38
  }
39
- function T(t, e, r) {
39
+ function T(t, e, n) {
40
40
  const a = bt(t, e, !1, F);
41
41
  Z(a);
42
42
  }
43
- function Mt(t, e, r) {
43
+ function Mt(t, e, n) {
44
44
  Et = Yt;
45
45
  const a = bt(t, e, !1, F);
46
46
  a.user = !0, z ? z.push(a) : Z(a);
47
47
  }
48
- function U(t, e, r) {
49
- r = r ? Object.assign({}, rt, r) : rt;
48
+ function U(t, e, n) {
49
+ n = n ? Object.assign({}, nt, n) : nt;
50
50
  const a = bt(t, e, !0, 0);
51
- return a.observers = null, a.observerSlots = null, a.comparator = r.equals || void 0, Z(a), jt.bind(a);
51
+ return a.observers = null, a.observerSlots = null, a.comparator = n.equals || void 0, Z(a), jt.bind(a);
52
52
  }
53
53
  function R(t) {
54
54
  if (w === null) return t();
@@ -70,10 +70,10 @@ function Gt() {
70
70
  return g;
71
71
  }
72
72
  function Jt(t, e) {
73
- const r = /* @__PURE__ */ Symbol("context");
73
+ const n = /* @__PURE__ */ Symbol("context");
74
74
  return {
75
- id: r,
76
- Provider: ee(r),
75
+ id: n,
76
+ Provider: ee(n),
77
77
  defaultValue: t
78
78
  };
79
79
  }
@@ -82,11 +82,11 @@ function qt(t) {
82
82
  return g && g.context && (e = g.context[t.id]) !== void 0 ? e : t.defaultValue;
83
83
  }
84
84
  function Qt(t) {
85
- const e = U(t), r = U(() => ht(e()));
86
- return r.toArray = () => {
87
- const a = r();
85
+ const e = U(t), n = U(() => ht(e()));
86
+ return n.toArray = () => {
87
+ const a = n();
88
88
  return Array.isArray(a) ? a : a != null ? [a] : [];
89
- }, r;
89
+ }, n;
90
90
  }
91
91
  function jt() {
92
92
  if (this.sources && this.state)
@@ -101,11 +101,11 @@ function jt() {
101
101
  }
102
102
  return this.value;
103
103
  }
104
- function Tt(t, e, r) {
104
+ function Tt(t, e, n) {
105
105
  let a = t.value;
106
106
  return (!t.comparator || !t.comparator(a, e)) && (t.value = e, t.observers && t.observers.length && Y(() => {
107
- for (let n = 0; n < t.observers.length; n += 1) {
108
- const o = t.observers[n], s = ft && ft.running;
107
+ for (let r = 0; r < t.observers.length; r += 1) {
108
+ const o = t.observers[r], s = ft && ft.running;
109
109
  s && ft.disposed.has(o), (s ? !o.tState : !o.state) && (o.pure ? A.push(o) : z.push(o), o.observers && Ot(o)), s || (o.state = F);
110
110
  }
111
111
  if (A.length > 1e6)
@@ -118,20 +118,20 @@ function Z(t) {
118
118
  const e = ct;
119
119
  Xt(t, t.value, e);
120
120
  }
121
- function Xt(t, e, r) {
121
+ function Xt(t, e, n) {
122
122
  let a;
123
- const n = g, o = w;
123
+ const r = g, o = w;
124
124
  w = g = t;
125
125
  try {
126
126
  a = t.fn(e);
127
127
  } catch (s) {
128
- return t.pure && (t.state = F, t.owned && t.owned.forEach(X), t.owned = null), t.updatedAt = r + 1, Vt(s);
128
+ return t.pure && (t.state = F, t.owned && t.owned.forEach(X), t.owned = null), t.updatedAt = n + 1, Vt(s);
129
129
  } finally {
130
- w = o, g = n;
130
+ w = o, g = r;
131
131
  }
132
- (!t.updatedAt || t.updatedAt <= r) && (t.updatedAt != null && "observers" in t ? Tt(t, a) : t.value = a, t.updatedAt = r);
132
+ (!t.updatedAt || t.updatedAt <= n) && (t.updatedAt != null && "observers" in t ? Tt(t, a) : t.value = a, t.updatedAt = n);
133
133
  }
134
- function bt(t, e, r, a = F, n) {
134
+ function bt(t, e, n, a = F, r) {
135
135
  const o = {
136
136
  fn: t,
137
137
  state: a,
@@ -143,34 +143,34 @@ function bt(t, e, r, a = F, n) {
143
143
  value: e,
144
144
  owner: g,
145
145
  context: g ? g.context : null,
146
- pure: r
146
+ pure: n
147
147
  };
148
148
  return g === null || g !== Pt && (g.owned ? g.owned.push(o) : g.owned = [o]), o;
149
149
  }
150
150
  function at(t) {
151
151
  if (t.state === 0) return;
152
- if (t.state === nt) return ot(t);
152
+ if (t.state === rt) return ot(t);
153
153
  if (t.suspense && R(t.suspense.inFallback)) return t.suspense.effects.push(t);
154
154
  const e = [t];
155
155
  for (; (t = t.owner) && (!t.updatedAt || t.updatedAt < ct); )
156
156
  t.state && e.push(t);
157
- for (let r = e.length - 1; r >= 0; r--)
158
- if (t = e[r], t.state === F)
157
+ for (let n = e.length - 1; n >= 0; n--)
158
+ if (t = e[n], t.state === F)
159
159
  Z(t);
160
- else if (t.state === nt) {
160
+ else if (t.state === rt) {
161
161
  const a = A;
162
162
  A = null, Y(() => ot(t, e[0]), !1), A = a;
163
163
  }
164
164
  }
165
165
  function Y(t, e) {
166
166
  if (A) return t();
167
- let r = !1;
168
- e || (A = []), z ? r = !0 : z = [], ct++;
167
+ let n = !1;
168
+ e || (A = []), z ? n = !0 : z = [], ct++;
169
169
  try {
170
170
  const a = t();
171
- return Zt(r), a;
171
+ return Zt(n), a;
172
172
  } catch (a) {
173
- r || (z = null), A = null, Vt(a);
173
+ n || (z = null), A = null, Vt(a);
174
174
  }
175
175
  }
176
176
  function Zt(t) {
@@ -182,37 +182,37 @@ function Wt(t) {
182
182
  for (let e = 0; e < t.length; e++) at(t[e]);
183
183
  }
184
184
  function Yt(t) {
185
- let e, r = 0;
185
+ let e, n = 0;
186
186
  for (e = 0; e < t.length; e++) {
187
187
  const a = t[e];
188
- a.user ? t[r++] = a : at(a);
188
+ a.user ? t[n++] = a : at(a);
189
189
  }
190
- for (e = 0; e < r; e++) at(t[e]);
190
+ for (e = 0; e < n; e++) at(t[e]);
191
191
  }
192
192
  function ot(t, e) {
193
193
  t.state = 0;
194
- for (let r = 0; r < t.sources.length; r += 1) {
195
- const a = t.sources[r];
194
+ for (let n = 0; n < t.sources.length; n += 1) {
195
+ const a = t.sources[n];
196
196
  if (a.sources) {
197
- const n = a.state;
198
- n === F ? a !== e && (!a.updatedAt || a.updatedAt < ct) && at(a) : n === nt && ot(a, e);
197
+ const r = a.state;
198
+ r === F ? a !== e && (!a.updatedAt || a.updatedAt < ct) && at(a) : r === rt && ot(a, e);
199
199
  }
200
200
  }
201
201
  }
202
202
  function Ot(t) {
203
203
  for (let e = 0; e < t.observers.length; e += 1) {
204
- const r = t.observers[e];
205
- r.state || (r.state = nt, r.pure ? A.push(r) : z.push(r), r.observers && Ot(r));
204
+ const n = t.observers[e];
205
+ n.state || (n.state = rt, n.pure ? A.push(n) : z.push(n), n.observers && Ot(n));
206
206
  }
207
207
  }
208
208
  function X(t) {
209
209
  let e;
210
210
  if (t.sources)
211
211
  for (; t.sources.length; ) {
212
- const r = t.sources.pop(), a = t.sourceSlots.pop(), n = r.observers;
213
- if (n && n.length) {
214
- const o = n.pop(), s = r.observerSlots.pop();
215
- a < n.length && (o.sourceSlots[s] = a, n[a] = o, r.observerSlots[a] = s);
212
+ const n = t.sources.pop(), a = t.sourceSlots.pop(), r = n.observers;
213
+ if (r && r.length) {
214
+ const o = r.pop(), s = n.observerSlots.pop();
215
+ a < r.length && (o.sourceSlots[s] = a, r[a] = o, n.observerSlots[a] = s);
216
216
  }
217
217
  }
218
218
  if (t.tOwned) {
@@ -241,8 +241,8 @@ function ht(t) {
241
241
  if (typeof t == "function" && !t.length) return ht(t());
242
242
  if (Array.isArray(t)) {
243
243
  const e = [];
244
- for (let r = 0; r < t.length; r++) {
245
- const a = ht(t[r]);
244
+ for (let n = 0; n < t.length; n++) {
245
+ const a = ht(t[n]);
246
246
  Array.isArray(a) ? e.push.apply(e, a) : e.push(a);
247
247
  }
248
248
  return e;
@@ -251,42 +251,42 @@ function ht(t) {
251
251
  }
252
252
  function ee(t, e) {
253
253
  return function(a) {
254
- let n;
255
- return T(() => n = R(() => (g.context = {
254
+ let r;
255
+ return T(() => r = R(() => (g.context = {
256
256
  ...g.context,
257
257
  [t]: a.value
258
- }, Qt(() => a.children))), void 0), n;
258
+ }, Qt(() => a.children))), void 0), r;
259
259
  };
260
260
  }
261
- const re = /* @__PURE__ */ Symbol("fallback");
261
+ const ne = /* @__PURE__ */ Symbol("fallback");
262
262
  function wt(t) {
263
263
  for (let e = 0; e < t.length; e++) t[e]();
264
264
  }
265
- function ne(t, e, r = {}) {
266
- let a = [], n = [], o = [], s = 0, i = e.length > 1 ? [] : null;
265
+ function re(t, e, n = {}) {
266
+ let a = [], r = [], o = [], s = 0, i = e.length > 1 ? [] : null;
267
267
  return ut(() => wt(o)), () => {
268
268
  let c = t() || [], f = c.length, d, l;
269
269
  return c[Kt], R(() => {
270
270
  let $, _, h, E, P, b, v, m, q;
271
271
  if (f === 0)
272
- s !== 0 && (wt(o), o = [], a = [], n = [], s = 0, i && (i = [])), r.fallback && (a = [re], n[0] = tt((B) => (o[0] = B, r.fallback())), s = 1);
272
+ s !== 0 && (wt(o), o = [], a = [], r = [], s = 0, i && (i = [])), n.fallback && (a = [ne], r[0] = tt((B) => (o[0] = B, n.fallback())), s = 1);
273
273
  else if (s === 0) {
274
- for (n = new Array(f), l = 0; l < f; l++)
275
- a[l] = c[l], n[l] = tt(M);
274
+ for (r = new Array(f), l = 0; l < f; l++)
275
+ a[l] = c[l], r[l] = tt(M);
276
276
  s = f;
277
277
  } else {
278
278
  for (h = new Array(f), E = new Array(f), i && (P = new Array(f)), b = 0, v = Math.min(s, f); b < v && a[b] === c[b]; b++) ;
279
279
  for (v = s - 1, m = f - 1; v >= b && m >= b && a[v] === c[m]; v--, m--)
280
- h[m] = n[v], E[m] = o[v], i && (P[m] = i[v]);
280
+ h[m] = r[v], E[m] = o[v], i && (P[m] = i[v]);
281
281
  for ($ = /* @__PURE__ */ new Map(), _ = new Array(m + 1), l = m; l >= b; l--)
282
282
  q = c[l], d = $.get(q), _[l] = d === void 0 ? -1 : d, $.set(q, l);
283
283
  for (d = b; d <= v; d++)
284
- q = a[d], l = $.get(q), l !== void 0 && l !== -1 ? (h[l] = n[d], E[l] = o[d], i && (P[l] = i[d]), l = _[l], $.set(q, l)) : o[d]();
284
+ q = a[d], l = $.get(q), l !== void 0 && l !== -1 ? (h[l] = r[d], E[l] = o[d], i && (P[l] = i[d]), l = _[l], $.set(q, l)) : o[d]();
285
285
  for (l = b; l < f; l++)
286
- l in h ? (n[l] = h[l], o[l] = E[l], i && (i[l] = P[l], i[l](l))) : n[l] = tt(M);
287
- n = n.slice(0, s = f), a = c.slice(0);
286
+ l in h ? (r[l] = h[l], o[l] = E[l], i && (i[l] = P[l], i[l](l))) : r[l] = tt(M);
287
+ r = r.slice(0, s = f), a = c.slice(0);
288
288
  }
289
- return n;
289
+ return r;
290
290
  });
291
291
  function M($) {
292
292
  if (o[l] = $, i) {
@@ -305,117 +305,117 @@ function gt(t) {
305
305
  const e = "fallback" in t && {
306
306
  fallback: () => t.fallback
307
307
  };
308
- return U(ne(() => t.each, t.children, e || void 0));
308
+ return U(re(() => t.each, t.children, e || void 0));
309
309
  }
310
310
  function L(t) {
311
- const e = t.keyed, r = U(() => t.when, void 0, void 0), a = e ? r : U(r, void 0, {
312
- equals: (n, o) => !n == !o
311
+ const e = t.keyed, n = U(() => t.when, void 0, void 0), a = e ? n : U(n, void 0, {
312
+ equals: (r, o) => !r == !o
313
313
  });
314
314
  return U(() => {
315
- const n = a();
316
- if (n) {
315
+ const r = a();
316
+ if (r) {
317
317
  const o = t.children;
318
- return typeof o == "function" && o.length > 0 ? R(() => o(e ? n : () => {
318
+ return typeof o == "function" && o.length > 0 ? R(() => o(e ? r : () => {
319
319
  if (!R(a)) throw ae("Show");
320
- return r();
320
+ return n();
321
321
  })) : o;
322
322
  }
323
323
  return t.fallback;
324
324
  }, void 0, void 0);
325
325
  }
326
326
  const oe = (t) => U(() => t());
327
- function ie(t, e, r) {
328
- let a = r.length, n = e.length, o = a, s = 0, i = 0, c = e[n - 1].nextSibling, f = null;
329
- for (; s < n || i < o; ) {
330
- if (e[s] === r[i]) {
327
+ function ie(t, e, n) {
328
+ let a = n.length, r = e.length, o = a, s = 0, i = 0, c = e[r - 1].nextSibling, f = null;
329
+ for (; s < r || i < o; ) {
330
+ if (e[s] === n[i]) {
331
331
  s++, i++;
332
332
  continue;
333
333
  }
334
- for (; e[n - 1] === r[o - 1]; )
335
- n--, o--;
336
- if (n === s) {
337
- const d = o < a ? i ? r[i - 1].nextSibling : r[o - i] : c;
338
- for (; i < o; ) t.insertBefore(r[i++], d);
334
+ for (; e[r - 1] === n[o - 1]; )
335
+ r--, o--;
336
+ if (r === s) {
337
+ const d = o < a ? i ? n[i - 1].nextSibling : n[o - i] : c;
338
+ for (; i < o; ) t.insertBefore(n[i++], d);
339
339
  } else if (o === i)
340
- for (; s < n; )
340
+ for (; s < r; )
341
341
  (!f || !f.has(e[s])) && e[s].remove(), s++;
342
- else if (e[s] === r[o - 1] && r[i] === e[n - 1]) {
343
- const d = e[--n].nextSibling;
344
- t.insertBefore(r[i++], e[s++].nextSibling), t.insertBefore(r[--o], d), e[n] = r[o];
342
+ else if (e[s] === n[o - 1] && n[i] === e[r - 1]) {
343
+ const d = e[--r].nextSibling;
344
+ t.insertBefore(n[i++], e[s++].nextSibling), t.insertBefore(n[--o], d), e[r] = n[o];
345
345
  } else {
346
346
  if (!f) {
347
347
  f = /* @__PURE__ */ new Map();
348
348
  let l = i;
349
- for (; l < o; ) f.set(r[l], l++);
349
+ for (; l < o; ) f.set(n[l], l++);
350
350
  }
351
351
  const d = f.get(e[s]);
352
352
  if (d != null)
353
353
  if (i < d && d < o) {
354
354
  let l = s, M = 1, $;
355
- for (; ++l < n && l < o && !(($ = f.get(e[l])) == null || $ !== d + M); )
355
+ for (; ++l < r && l < o && !(($ = f.get(e[l])) == null || $ !== d + M); )
356
356
  M++;
357
357
  if (M > d - i) {
358
358
  const _ = e[s];
359
- for (; i < d; ) t.insertBefore(r[i++], _);
360
- } else t.replaceChild(r[i++], e[s++]);
359
+ for (; i < d; ) t.insertBefore(n[i++], _);
360
+ } else t.replaceChild(n[i++], e[s++]);
361
361
  } else s++;
362
362
  else e[s++].remove();
363
363
  }
364
364
  }
365
365
  }
366
366
  const mt = "_$DX_DELEGATE";
367
- function W(t, e, r, a) {
368
- let n;
367
+ function W(t, e, n, a) {
368
+ let r;
369
369
  const o = () => {
370
370
  const i = document.createElement("template");
371
371
  return i.innerHTML = t, i.content.firstChild;
372
- }, s = () => (n || (n = o())).cloneNode(!0);
372
+ }, s = () => (r || (r = o())).cloneNode(!0);
373
373
  return s.cloneNode = s, s;
374
374
  }
375
375
  function se(t, e = window.document) {
376
- const r = e[mt] || (e[mt] = /* @__PURE__ */ new Set());
377
- for (let a = 0, n = t.length; a < n; a++) {
376
+ const n = e[mt] || (e[mt] = /* @__PURE__ */ new Set());
377
+ for (let a = 0, r = t.length; a < r; a++) {
378
378
  const o = t[a];
379
- r.has(o) || (r.add(o), e.addEventListener(o, ue));
379
+ n.has(o) || (n.add(o), e.addEventListener(o, ue));
380
380
  }
381
381
  }
382
- function et(t, e, r) {
383
- r == null ? t.removeAttribute(e) : t.setAttribute(e, r);
382
+ function et(t, e, n) {
383
+ n == null ? t.removeAttribute(e) : t.setAttribute(e, n);
384
384
  }
385
385
  function pt(t, e) {
386
386
  e == null ? t.removeAttribute("class") : t.className = e;
387
387
  }
388
- function yt(t, e, r) {
389
- if (!e) return r ? et(t, "style") : e;
388
+ function yt(t, e, n) {
389
+ if (!e) return n ? et(t, "style") : e;
390
390
  const a = t.style;
391
391
  if (typeof e == "string") return a.cssText = e;
392
- typeof r == "string" && (a.cssText = r = void 0), r || (r = {}), e || (e = {});
393
- let n, o;
394
- for (o in r)
395
- e[o] == null && a.removeProperty(o), delete r[o];
392
+ typeof n == "string" && (a.cssText = n = void 0), n || (n = {}), e || (e = {});
393
+ let r, o;
394
+ for (o in n)
395
+ e[o] == null && a.removeProperty(o), delete n[o];
396
396
  for (o in e)
397
- n = e[o], n !== r[o] && (a.setProperty(o, n), r[o] = n);
398
- return r;
397
+ r = e[o], r !== n[o] && (a.setProperty(o, r), n[o] = r);
398
+ return n;
399
399
  }
400
- function le(t, e, r) {
401
- r != null ? t.style.setProperty(e, r) : t.style.removeProperty(e);
400
+ function le(t, e, n) {
401
+ n != null ? t.style.setProperty(e, n) : t.style.removeProperty(e);
402
402
  }
403
- function ce(t, e, r) {
404
- return R(() => t(e, r));
403
+ function ce(t, e, n) {
404
+ return R(() => t(e, n));
405
405
  }
406
- function p(t, e, r, a) {
407
- if (r !== void 0 && !a && (a = []), typeof e != "function") return it(t, e, a, r);
408
- T((n) => it(t, e(), n, r), a);
406
+ function p(t, e, n, a) {
407
+ if (n !== void 0 && !a && (a = []), typeof e != "function") return it(t, e, a, n);
408
+ T((r) => it(t, e(), r, n), a);
409
409
  }
410
410
  function ue(t) {
411
411
  let e = t.target;
412
- const r = `$$${t.type}`, a = t.target, n = t.currentTarget, o = (c) => Object.defineProperty(t, "target", {
412
+ const n = `$$${t.type}`, a = t.target, r = t.currentTarget, o = (c) => Object.defineProperty(t, "target", {
413
413
  configurable: !0,
414
414
  value: c
415
415
  }), s = () => {
416
- const c = e[r];
416
+ const c = e[n];
417
417
  if (c && !e.disabled) {
418
- const f = e[`${r}Data`];
418
+ const f = e[`${n}Data`];
419
419
  if (f !== void 0 ? c.call(e, f, t) : c.call(e, t), t.cancelBubble) return;
420
420
  }
421
421
  return e.host && typeof e.host != "string" && !e.host._$host && e.contains(t.target) && o(e.host), !0;
@@ -435,112 +435,112 @@ function ue(t) {
435
435
  e = e._$host, i();
436
436
  break;
437
437
  }
438
- if (e.parentNode === n)
438
+ if (e.parentNode === r)
439
439
  break;
440
440
  }
441
441
  } else i();
442
442
  o(a);
443
443
  }
444
- function it(t, e, r, a, n) {
445
- for (; typeof r == "function"; ) r = r();
446
- if (e === r) return r;
444
+ function it(t, e, n, a, r) {
445
+ for (; typeof n == "function"; ) n = n();
446
+ if (e === n) return n;
447
447
  const o = typeof e, s = a !== void 0;
448
- if (t = s && r[0] && r[0].parentNode || t, o === "string" || o === "number") {
449
- if (o === "number" && (e = e.toString(), e === r))
450
- return r;
448
+ if (t = s && n[0] && n[0].parentNode || t, o === "string" || o === "number") {
449
+ if (o === "number" && (e = e.toString(), e === n))
450
+ return n;
451
451
  if (s) {
452
- let i = r[0];
453
- i && i.nodeType === 3 ? i.data !== e && (i.data = e) : i = document.createTextNode(e), r = H(t, r, a, i);
452
+ let i = n[0];
453
+ i && i.nodeType === 3 ? i.data !== e && (i.data = e) : i = document.createTextNode(e), n = H(t, n, a, i);
454
454
  } else
455
- r !== "" && typeof r == "string" ? r = t.firstChild.data = e : r = t.textContent = e;
455
+ n !== "" && typeof n == "string" ? n = t.firstChild.data = e : n = t.textContent = e;
456
456
  } else if (e == null || o === "boolean")
457
- r = H(t, r, a);
457
+ n = H(t, n, a);
458
458
  else {
459
459
  if (o === "function")
460
460
  return T(() => {
461
461
  let i = e();
462
462
  for (; typeof i == "function"; ) i = i();
463
- r = it(t, i, r, a);
464
- }), () => r;
463
+ n = it(t, i, n, a);
464
+ }), () => n;
465
465
  if (Array.isArray(e)) {
466
- const i = [], c = r && Array.isArray(r);
467
- if (_t(i, e, r, n))
468
- return T(() => r = it(t, i, r, a, !0)), () => r;
466
+ const i = [], c = n && Array.isArray(n);
467
+ if (_t(i, e, n, r))
468
+ return T(() => n = it(t, i, n, a, !0)), () => n;
469
469
  if (i.length === 0) {
470
- if (r = H(t, r, a), s) return r;
471
- } else c ? r.length === 0 ? xt(t, i, a) : ie(t, r, i) : (r && H(t), xt(t, i));
472
- r = i;
470
+ if (n = H(t, n, a), s) return n;
471
+ } else c ? n.length === 0 ? xt(t, i, a) : ie(t, n, i) : (n && H(t), xt(t, i));
472
+ n = i;
473
473
  } else if (e.nodeType) {
474
- if (Array.isArray(r)) {
475
- if (s) return r = H(t, r, a, e);
476
- H(t, r, null, e);
477
- } else r == null || r === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild);
478
- r = e;
474
+ if (Array.isArray(n)) {
475
+ if (s) return n = H(t, n, a, e);
476
+ H(t, n, null, e);
477
+ } else n == null || n === "" || !t.firstChild ? t.appendChild(e) : t.replaceChild(e, t.firstChild);
478
+ n = e;
479
479
  }
480
480
  }
481
- return r;
481
+ return n;
482
482
  }
483
- function _t(t, e, r, a) {
484
- let n = !1;
483
+ function _t(t, e, n, a) {
484
+ let r = !1;
485
485
  for (let o = 0, s = e.length; o < s; o++) {
486
- let i = e[o], c = r && r[t.length], f;
486
+ let i = e[o], c = n && n[t.length], f;
487
487
  if (!(i == null || i === !0 || i === !1)) if ((f = typeof i) == "object" && i.nodeType)
488
488
  t.push(i);
489
489
  else if (Array.isArray(i))
490
- n = _t(t, i, c) || n;
490
+ r = _t(t, i, c) || r;
491
491
  else if (f === "function")
492
492
  if (a) {
493
493
  for (; typeof i == "function"; ) i = i();
494
- n = _t(t, Array.isArray(i) ? i : [i], Array.isArray(c) ? c : [c]) || n;
494
+ r = _t(t, Array.isArray(i) ? i : [i], Array.isArray(c) ? c : [c]) || r;
495
495
  } else
496
- t.push(i), n = !0;
496
+ t.push(i), r = !0;
497
497
  else {
498
498
  const d = String(i);
499
499
  c && c.nodeType === 3 && c.data === d ? t.push(c) : t.push(document.createTextNode(d));
500
500
  }
501
501
  }
502
- return n;
502
+ return r;
503
503
  }
504
- function xt(t, e, r = null) {
505
- for (let a = 0, n = e.length; a < n; a++) t.insertBefore(e[a], r);
504
+ function xt(t, e, n = null) {
505
+ for (let a = 0, r = e.length; a < r; a++) t.insertBefore(e[a], n);
506
506
  }
507
- function H(t, e, r, a) {
508
- if (r === void 0) return t.textContent = "";
509
- const n = a || document.createTextNode("");
507
+ function H(t, e, n, a) {
508
+ if (n === void 0) return t.textContent = "";
509
+ const r = a || document.createTextNode("");
510
510
  if (e.length) {
511
511
  let o = !1;
512
512
  for (let s = e.length - 1; s >= 0; s--) {
513
513
  const i = e[s];
514
- if (n !== i) {
514
+ if (r !== i) {
515
515
  const c = i.parentNode === t;
516
- !o && !s ? c ? t.replaceChild(n, i) : t.insertBefore(n, r) : c && i.remove();
516
+ !o && !s ? c ? t.replaceChild(r, i) : t.insertBefore(r, n) : c && i.remove();
517
517
  } else o = !0;
518
518
  }
519
- } else t.insertBefore(n, r);
520
- return [n];
519
+ } else t.insertBefore(r, n);
520
+ return [r];
521
521
  }
522
522
  function fe(t) {
523
- return Object.keys(t).reduce((r, a) => {
524
- const n = t[a];
525
- return r[a] = Object.assign({}, n), zt(n.value) && !_e(n.value) && !Array.isArray(n.value) && (r[a].value = Object.assign({}, n.value)), Array.isArray(n.value) && (r[a].value = n.value.slice(0)), r;
523
+ return Object.keys(t).reduce((n, a) => {
524
+ const r = t[a];
525
+ return n[a] = Object.assign({}, r), zt(r.value) && !_e(r.value) && !Array.isArray(r.value) && (n[a].value = Object.assign({}, r.value)), Array.isArray(r.value) && (n[a].value = r.value.slice(0)), n;
526
526
  }, {});
527
527
  }
528
528
  function de(t) {
529
- return t ? Object.keys(t).reduce((r, a) => {
530
- const n = t[a];
531
- return r[a] = zt(n) && "value" in n ? n : {
532
- value: n
533
- }, r[a].attribute || (r[a].attribute = pe(a)), r[a].parse = "parse" in r[a] ? r[a].parse : typeof r[a].value != "string", r;
529
+ return t ? Object.keys(t).reduce((n, a) => {
530
+ const r = t[a];
531
+ return n[a] = zt(r) && "value" in r ? r : {
532
+ value: r
533
+ }, n[a].attribute || (n[a].attribute = pe(a)), n[a].parse = "parse" in n[a] ? n[a].parse : typeof n[a].value != "string", n;
534
534
  }, {}) : {};
535
535
  }
536
536
  function he(t) {
537
- return Object.keys(t).reduce((r, a) => (r[a] = t[a].value, r), {});
537
+ return Object.keys(t).reduce((n, a) => (n[a] = t[a].value, n), {});
538
538
  }
539
539
  function ge(t, e) {
540
- const r = fe(e);
541
- return Object.keys(e).forEach((n) => {
542
- const o = r[n], s = t.getAttribute(o.attribute), i = t[n];
543
- s != null && (o.value = o.parse ? Lt(s) : s), i != null && (o.value = Array.isArray(i) ? i.slice(0) : i), o.reflect && kt(t, o.attribute, o.value, !!o.parse), Object.defineProperty(t, n, {
540
+ const n = fe(e);
541
+ return Object.keys(e).forEach((r) => {
542
+ const o = n[r], s = t.getAttribute(o.attribute), i = t[r];
543
+ s != null && (o.value = o.parse ? Lt(s) : s), i != null && (o.value = Array.isArray(i) ? i.slice(0) : i), o.reflect && kt(t, o.attribute, o.value, !!o.parse), Object.defineProperty(t, r, {
544
544
  get() {
545
545
  return o.value;
546
546
  },
@@ -548,12 +548,12 @@ function ge(t, e) {
548
548
  const f = o.value;
549
549
  o.value = c, o.reflect && kt(this, o.attribute, o.value, !!o.parse);
550
550
  for (let d = 0, l = this.__propertyChangedCallbacks.length; d < l; d++)
551
- this.__propertyChangedCallbacks[d](n, c, f);
551
+ this.__propertyChangedCallbacks[d](r, c, f);
552
552
  },
553
553
  enumerable: !0,
554
554
  configurable: !0
555
555
  });
556
- }), r;
556
+ }), n;
557
557
  }
558
558
  function Lt(t) {
559
559
  if (t)
@@ -563,13 +563,13 @@ function Lt(t) {
563
563
  return t;
564
564
  }
565
565
  }
566
- function kt(t, e, r, a) {
567
- if (r == null || r === !1) return t.removeAttribute(e);
568
- let n = a ? JSON.stringify(r) : r;
569
- t.__updating[e] = !0, n === "true" && (n = ""), t.setAttribute(e, n), Promise.resolve().then(() => delete t.__updating[e]);
566
+ function kt(t, e, n, a) {
567
+ if (n == null || n === !1) return t.removeAttribute(e);
568
+ let r = a ? JSON.stringify(n) : n;
569
+ t.__updating[e] = !0, r === "true" && (r = ""), t.setAttribute(e, r), Promise.resolve().then(() => delete t.__updating[e]);
570
570
  }
571
571
  function pe(t) {
572
- return t.replace(/\.?([A-Z]+)/g, (e, r) => "-" + r.toLowerCase()).replace("_", "-").replace(/^-/, "");
572
+ return t.replace(/\.?([A-Z]+)/g, (e, n) => "-" + n.toLowerCase()).replace("_", "-").replace(/^-/, "");
573
573
  }
574
574
  function zt(t) {
575
575
  return t != null && (typeof t == "object" || typeof t == "function");
@@ -582,24 +582,24 @@ function be(t) {
582
582
  }
583
583
  let dt;
584
584
  function ve(t, e) {
585
- const r = Object.keys(e);
585
+ const n = Object.keys(e);
586
586
  return class extends t {
587
587
  static get observedAttributes() {
588
- return r.map((n) => e[n].attribute);
588
+ return n.map((r) => e[r].attribute);
589
589
  }
590
590
  constructor() {
591
591
  super(), this.__initialized = !1, this.__released = !1, this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = {};
592
- for (let n of r)
593
- this[n] = void 0;
592
+ for (let r of n)
593
+ this[r] = void 0;
594
594
  }
595
595
  connectedCallback() {
596
596
  if (this.__initialized) return;
597
597
  this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = ge(this, e);
598
- const n = he(this.props), o = this.Component, s = dt;
598
+ const r = he(this.props), o = this.Component, s = dt;
599
599
  try {
600
- dt = this, this.__initialized = !0, be(o) ? new o(n, {
600
+ dt = this, this.__initialized = !0, be(o) ? new o(r, {
601
601
  element: this
602
- }) : o(n, {
602
+ }) : o(r, {
603
603
  element: this
604
604
  });
605
605
  } finally {
@@ -609,56 +609,56 @@ function ve(t, e) {
609
609
  async disconnectedCallback() {
610
610
  if (await Promise.resolve(), this.isConnected) return;
611
611
  this.__propertyChangedCallbacks.length = 0;
612
- let n = null;
613
- for (; n = this.__releaseCallbacks.pop(); ) n(this);
612
+ let r = null;
613
+ for (; r = this.__releaseCallbacks.pop(); ) r(this);
614
614
  delete this.__initialized, this.__released = !0;
615
615
  }
616
- attributeChangedCallback(n, o, s) {
617
- if (this.__initialized && !this.__updating[n] && (n = this.lookupProp(n), n in e)) {
618
- if (s == null && !this[n]) return;
619
- this[n] = e[n].parse ? Lt(s) : s;
616
+ attributeChangedCallback(r, o, s) {
617
+ if (this.__initialized && !this.__updating[r] && (r = this.lookupProp(r), r in e)) {
618
+ if (s == null && !this[r]) return;
619
+ this[r] = e[r].parse ? Lt(s) : s;
620
620
  }
621
621
  }
622
- lookupProp(n) {
622
+ lookupProp(r) {
623
623
  if (e)
624
- return r.find((o) => n === o || n === e[o].attribute);
624
+ return n.find((o) => r === o || r === e[o].attribute);
625
625
  }
626
626
  get renderRoot() {
627
627
  return this.shadowRoot || this.attachShadow({
628
628
  mode: "open"
629
629
  });
630
630
  }
631
- addReleaseCallback(n) {
632
- this.__releaseCallbacks.push(n);
631
+ addReleaseCallback(r) {
632
+ this.__releaseCallbacks.push(r);
633
633
  }
634
- addPropertyChangedCallback(n) {
635
- this.__propertyChangedCallbacks.push(n);
634
+ addPropertyChangedCallback(r) {
635
+ this.__propertyChangedCallbacks.push(r);
636
636
  }
637
637
  };
638
638
  }
639
- function we(t, e = {}, r = {}) {
639
+ function we(t, e = {}, n = {}) {
640
640
  const {
641
641
  BaseElement: a = HTMLElement,
642
- extension: n,
642
+ extension: r,
643
643
  customElements: o = window.customElements
644
- } = r;
644
+ } = n;
645
645
  return (s) => {
646
646
  let i = o.get(t);
647
- return i ? (i.prototype.Component = s, i) : (i = ve(a, de(e)), i.prototype.Component = s, i.prototype.registeredTag = t, o.define(t, i, n), i);
647
+ return i ? (i.prototype.Component = s, i) : (i = ve(a, de(e)), i.prototype.Component = s, i.prototype.registeredTag = t, o.define(t, i, r), i);
648
648
  };
649
649
  }
650
650
  function me(t) {
651
- const e = Object.keys(t), r = {};
651
+ const e = Object.keys(t), n = {};
652
652
  for (let a = 0; a < e.length; a++) {
653
- const [n, o] = j(t[e[a]]);
654
- Object.defineProperty(r, e[a], {
655
- get: n,
653
+ const [r, o] = j(t[e[a]]);
654
+ Object.defineProperty(n, e[a], {
655
+ get: r,
656
656
  set(s) {
657
657
  o(() => s);
658
658
  }
659
659
  });
660
660
  }
661
- return r;
661
+ return n;
662
662
  }
663
663
  function ye(t) {
664
664
  if (t.assignedSlot && t.assignedSlot._$owner) return t.assignedSlot._$owner;
@@ -668,43 +668,43 @@ function ye(t) {
668
668
  return e && e.assignedSlot ? e.assignedSlot._$owner : t._$owner;
669
669
  }
670
670
  function xe(t) {
671
- return (e, r) => {
672
- const { element: a } = r;
673
- return tt((n) => {
671
+ return (e, n) => {
672
+ const { element: a } = n;
673
+ return tt((r) => {
674
674
  const o = me(e);
675
675
  a.addPropertyChangedCallback((i, c) => o[i] = c), a.addReleaseCallback(() => {
676
- a.renderRoot.textContent = "", n();
676
+ a.renderRoot.textContent = "", r();
677
677
  });
678
- const s = t(o, r);
678
+ const s = t(o, n);
679
679
  return p(a.renderRoot, s);
680
680
  }, ye(a));
681
681
  };
682
682
  }
683
- function ke(t, e, r) {
684
- return arguments.length === 2 && (r = e, e = {}), we(t, e)(xe(r));
683
+ function ke(t, e, n) {
684
+ return arguments.length === 2 && (n = e, e = {}), we(t, e)(xe(n));
685
685
  }
686
686
  function D(t) {
687
- const [e, r] = j(t.peek(), { equals: !1 }), a = t.subscribe((n) => r(() => n));
687
+ const [e, n] = j(t.peek(), { equals: !1 }), a = t.subscribe((r) => n(() => r));
688
688
  return ut(() => a()), e;
689
689
  }
690
690
  const st = Jt();
691
691
  function Ce(t) {
692
- const [e, r] = j("no-url"), [a, n] = j(!1), o = D(t.moqWatch.audio.muted), [s, i] = j(0), c = D(t.moqWatch.video.stalled), f = D(t.moqWatch.jitter), [d, l] = j([]), M = D(t.moqWatch.video.source.track), [$, _] = j(!1), [h, E] = j(!!document.fullscreenElement), P = () => {
693
- t.moqWatch.paused.set(!t.moqWatch.paused.get());
692
+ const [e, n] = j("no-url"), [a, r] = j(!1), o = D(t.moqWatch.backend.audio.muted), [s, i] = j(0), c = D(t.moqWatch.backend.video.stalled), f = D(t.moqWatch.backend.jitter), [d, l] = j([]), M = D(t.moqWatch.backend.video.source.track), [$, _] = j(!1), [h, E] = j(!!document.fullscreenElement), P = () => {
693
+ t.moqWatch.paused = !t.moqWatch.paused;
694
694
  }, b = () => {
695
695
  document.fullscreenElement ? document.exitFullscreen() : t.moqWatch.requestFullscreen();
696
696
  }, v = (S) => {
697
- t.moqWatch.audio.volume.set(S / 100);
697
+ t.moqWatch.backend.audio.volume.set(S / 100);
698
698
  }, m = () => {
699
- t.moqWatch.audio.muted.update((S) => !S);
699
+ t.moqWatch.backend.audio.muted.update((S) => !S);
700
700
  }, q = (S) => {
701
- t.moqWatch.jitter.set(S);
701
+ t.moqWatch.jitter = S;
702
702
  }, B = (S) => {
703
- t.moqWatch.video.source.target.update((N) => ({
703
+ t.moqWatch.backend.video.source.target.update((N) => ({
704
704
  ...N,
705
705
  name: S
706
706
  }));
707
- }, y = D(t.moqWatch.video.timestamp), O = D(t.moqWatch.video.buffered), I = D(t.moqWatch.audio.buffered), x = {
707
+ }, y = D(t.moqWatch.backend.video.timestamp), O = D(t.moqWatch.backend.video.buffered), I = D(t.moqWatch.backend.audio.buffered), x = {
708
708
  moqWatch: t.moqWatch,
709
709
  watchStatus: e,
710
710
  togglePlayback: P,
@@ -729,15 +729,15 @@ function Ce(t) {
729
729
  }, C = t.moqWatch, k = new It.Effect();
730
730
  k.run((S) => {
731
731
  const N = S.get(C.connection.url), J = S.get(C.connection.status), Q = S.get(C.broadcast.status);
732
- N ? J === "disconnected" ? r("disconnected") : J === "connecting" ? r("connecting") : Q === "offline" ? r("offline") : Q === "loading" ? r("loading") : Q === "live" ? r("live") : J === "connected" && r("connected") : r("no-url");
732
+ N ? J === "disconnected" ? n("disconnected") : J === "connecting" ? n("connecting") : Q === "offline" ? n("offline") : Q === "loading" ? n("loading") : Q === "live" ? n("live") : J === "connected" && n("connected") : n("no-url");
733
733
  }), k.run((S) => {
734
- const N = S.get(C.paused);
735
- n(!N);
734
+ const N = S.get(C.backend.paused);
735
+ r(!N);
736
736
  }), k.run((S) => {
737
- const N = S.get(C.audio.volume);
737
+ const N = S.get(C.backend.audio.volume);
738
738
  i(N * 100);
739
739
  }), k.run((S) => {
740
- const J = S.get(C.video.source.catalog)?.renditions ?? {}, Q = Object.entries(J).map(([Rt, vt]) => ({
740
+ const J = S.get(C.backend.video.source.catalog)?.renditions ?? {}, Q = Object.entries(J).map(([Rt, vt]) => ({
741
741
  name: Rt,
742
742
  width: vt.codedWidth,
743
743
  height: vt.codedHeight
@@ -775,25 +775,25 @@ function $e() {
775
775
  var Ae = /* @__PURE__ */ W('<div class=watch-ui__buffer><div role=slider tabindex=0 aria-label="Buffer jitter"><div class=watch-ui__buffer-playhead></div><div class="watch-ui__buffer-track watch-ui__buffer-track--video"><span class=watch-ui__buffer-track-label>Video</span></div><div class="watch-ui__buffer-track watch-ui__buffer-track--audio"><span class=watch-ui__buffer-track-label>Audio</span></div><div class=watch-ui__buffer-target-area><div class=watch-ui__buffer-target-line><span class=watch-ui__buffer-target-label>'), Ct = /* @__PURE__ */ W("<span class=watch-ui__buffer-overflow-label>s"), St = /* @__PURE__ */ W("<div class=watch-ui__buffer-range>");
776
776
  const $t = 0, At = 100;
777
777
  function Ee(t) {
778
- const e = K(), r = () => t.max ?? 5e3, [a, n] = j(!1), o = (_, h, E) => {
779
- const P = _.start - h, b = _.end - h, v = Math.max(0, P), m = Math.min(b, r()), q = v / r() * 100, B = Math.max(0.5, (m - v) / r() * 100), y = b > r(), O = y ? Nt.Time.Milli.toSecond(b - v).toFixed(1) : null;
778
+ const e = K(), n = () => t.max ?? 5e3, [a, r] = j(!1), o = (_, h, E) => {
779
+ const P = _.start - h, b = _.end - h, v = Math.max(0, P), m = Math.min(b, n()), q = v / n() * 100, B = Math.max(0.5, (m - v) / n() * 100), y = b > n(), O = y ? Nt.Time.Milli.toSecond(b - v).toFixed(1) : null;
780
780
  return {
781
781
  style: `left: ${q}%; width: ${B}%; background: ${E};`,
782
782
  isOverflow: y,
783
783
  overflowSec: O
784
784
  };
785
- }, s = (_, h) => h ? "#f87171" : _ > 0 ? "#facc15" : "#4ade80", i = U(() => e.jitter() / r() * 100);
785
+ }, s = (_, h) => h ? "#f87171" : _ > 0 ? "#facc15" : "#4ade80", i = U(() => e.jitter() / n() * 100);
786
786
  let c;
787
787
  const f = 48, d = (_) => {
788
788
  if (!c) return;
789
- const h = c.getBoundingClientRect(), E = h.width - f, b = Math.max(0, Math.min(_ - h.left - f, E)) / E * r(), v = Math.round(b / At) * At, m = Math.max($t, Math.min(r(), v));
789
+ const h = c.getBoundingClientRect(), E = h.width - f, b = Math.max(0, Math.min(_ - h.left - f, E)) / E * n(), v = Math.round(b / At) * At, m = Math.max($t, Math.min(n(), v));
790
790
  e.setJitter(m);
791
791
  }, l = (_) => {
792
- n(!0), d(_.clientX), document.addEventListener("mousemove", M), document.addEventListener("mouseup", $);
792
+ r(!0), d(_.clientX), document.addEventListener("mousemove", M), document.addEventListener("mouseup", $);
793
793
  }, M = (_) => {
794
794
  a() && d(_.clientX);
795
795
  }, $ = () => {
796
- n(!1), document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", $);
796
+ r(!1), document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", $);
797
797
  };
798
798
  return ut(() => {
799
799
  document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", $);
@@ -860,7 +860,7 @@ function Ee(t) {
860
860
  });
861
861
  }
862
862
  }), null), p(q, () => `${Math.round(e.jitter())}ms`), T((y) => {
863
- var O = `watch-ui__buffer-visualization ${a() ? "watch-ui__buffer-visualization--dragging" : ""}`, I = e.jitter(), x = r(), C = `${i()}%`;
863
+ var O = `watch-ui__buffer-visualization ${a() ? "watch-ui__buffer-visualization--dragging" : ""}`, I = e.jitter(), x = n(), C = `${i()}%`;
864
864
  return O !== y.e && pt(h, y.e = O), I !== y.t && et(h, "aria-valuenow", y.t = I), x !== y.a && et(h, "aria-valuemax", y.a = x), C !== y.o && le(m, "left", y.o = C), y;
865
865
  }, {
866
866
  e: void 0,
@@ -920,13 +920,13 @@ function Me() {
920
920
  }
921
921
  var qe = /* @__PURE__ */ W("<div class=watch-ui__quality-selector><label for=quality-select class=watch-ui__quality-label>Quality: </label><select id=quality-select class=watch-ui__quality-select><option value>Auto"), je = /* @__PURE__ */ W("<option>");
922
922
  function Te() {
923
- const t = K(), e = (r) => {
924
- const a = r.currentTarget.value || void 0;
923
+ const t = K(), e = (n) => {
924
+ const a = n.currentTarget.value || void 0;
925
925
  t.setActiveRendition(a);
926
926
  };
927
927
  return (() => {
928
- var r = qe(), a = r.firstChild, n = a.nextSibling;
929
- return n.firstChild, n.addEventListener("change", e), p(n, u(gt, {
928
+ var n = qe(), a = n.firstChild, r = a.nextSibling;
929
+ return r.firstChild, r.addEventListener("change", e), p(r, u(gt, {
930
930
  get each() {
931
931
  return t.availableRenditions() ?? [];
932
932
  },
@@ -937,7 +937,7 @@ function Te() {
937
937
  return () => i() ? ` (${o.width}x${o.height})` : "";
938
938
  })(), null), T(() => s.value = o.name), s;
939
939
  })()
940
- }), null), T(() => n.value = t.activeRendition() ?? ""), r;
940
+ }), null), T(() => r.value = t.activeRendition() ?? ""), n;
941
941
  })();
942
942
  }
943
943
  function We() {
@@ -957,24 +957,24 @@ function We() {
957
957
  var Oe = /* @__PURE__ */ W('<div class="watch-ui__volume-slider flex--center"><input type=range min=0 max=100><span class=watch-ui__volume-label>');
958
958
  const Ve = (t, e) => e || t === 0 ? u(V.Mute, {}) : t > 0 && t <= 33 ? u(V.VolumeLow, {}) : t > 33 && t <= 66 ? u(V.VolumeMedium, {}) : u(V.VolumeHigh, {});
959
959
  function Le() {
960
- const [t, e] = j(0), r = K(), a = (n) => {
961
- const o = n.currentTarget, s = parseFloat(o.value);
962
- r.setVolume(s);
960
+ const [t, e] = j(0), n = K(), a = (r) => {
961
+ const o = r.currentTarget, s = parseFloat(o.value);
962
+ n.setVolume(s);
963
963
  };
964
964
  return Mt(() => {
965
- const n = r.currentVolume() || 0;
966
- e(Math.round(n));
965
+ const r = n.currentVolume() || 0;
966
+ e(Math.round(r));
967
967
  }), (() => {
968
- var n = Oe(), o = n.firstChild, s = o.nextSibling;
969
- return p(n, u(lt, {
968
+ var r = Oe(), o = r.firstChild, s = o.nextSibling;
969
+ return p(r, u(lt, {
970
970
  get title() {
971
- return r.isMuted() ? "Unmute" : "Mute";
971
+ return n.isMuted() ? "Unmute" : "Mute";
972
972
  },
973
- onClick: () => r.toggleMuted(),
973
+ onClick: () => n.toggleMuted(),
974
974
  get children() {
975
- return Ve(r.currentVolume(), r.isMuted());
975
+ return Ve(n.currentVolume(), n.isMuted());
976
976
  }
977
- }), o), o.addEventListener("change", a), p(s, t), T(() => o.value = r.currentVolume()), n;
977
+ }), o), o.addEventListener("change", a), p(s, t), T(() => o.value = n.currentVolume()), r;
978
978
  })();
979
979
  }
980
980
  var ze = /* @__PURE__ */ W('<div class="watch-ui__status-indicator flex--center"><span></span><span>');
@@ -1013,25 +1013,25 @@ const Re = {
1013
1013
  };
1014
1014
  function Ie() {
1015
1015
  const t = K(), e = () => {
1016
- const r = t.watchStatus();
1017
- return Re[r] || Be;
1016
+ const n = t.watchStatus();
1017
+ return Re[n] || Be;
1018
1018
  };
1019
1019
  return (() => {
1020
- var r = ze(), a = r.firstChild, n = a.nextSibling;
1021
- return p(n, () => e().text), T((o) => {
1020
+ var n = ze(), a = n.firstChild, r = a.nextSibling;
1021
+ return p(r, () => e().text), T((o) => {
1022
1022
  var s = `watch-ui__status-indicator-dot watch-ui__status-indicator-dot--${e().variant}`, i = `watch-ui__status-indicator-text watch-ui__status-indicator-text--${e().variant}`;
1023
- return s !== o.e && pt(a, o.e = s), i !== o.t && pt(n, o.t = i), o;
1023
+ return s !== o.e && pt(a, o.e = s), i !== o.t && pt(r, o.t = i), o;
1024
1024
  }, {
1025
1025
  e: void 0,
1026
1026
  t: void 0
1027
- }), r;
1027
+ }), n;
1028
1028
  })();
1029
1029
  }
1030
1030
  var Ne = /* @__PURE__ */ W('<div class=watch-ui__controls><div class="watch-ui__playback-controls flex--align-center"></div><div class=watch-ui__latency-controls>');
1031
1031
  function Ue() {
1032
1032
  return (() => {
1033
- var t = Ne(), e = t.firstChild, r = e.nextSibling;
1034
- return p(e, u(Me, {}), null), p(e, u(Le, {}), null), p(e, u(Ie, {}), null), p(e, u(We, {}), null), p(e, u(Pe, {}), null), p(r, u(Ee, {}), null), p(r, u(Te, {}), null), t;
1033
+ var t = Ne(), e = t.firstChild, n = e.nextSibling;
1034
+ return p(e, u(Me, {}), null), p(e, u(Le, {}), null), p(e, u(Ie, {}), null), p(e, u(We, {}), null), p(e, u(Pe, {}), null), p(n, u(Ee, {}), null), p(n, u(Te, {}), null), t;
1035
1035
  })();
1036
1036
  }
1037
1037
  const Fe = ':host{--color-white: #ffffff;--color-white-alpha-05: rgba(255, 255, 255, .05);--color-white-alpha-10: rgba(255, 255, 255, .1);--color-white-alpha-15: rgba(255, 255, 255, .15);--color-white-alpha-20: rgba(255, 255, 255, .2);--color-white-alpha-25: rgba(255, 255, 255, .25);--color-white-alpha-30: rgba(255, 255, 255, .3);--color-white-alpha-70: rgba(255, 255, 255, .7);--color-white-alpha-90: rgba(255, 255, 255, .9);--color-gray-100: #9ca3af;--color-gray-950: #1a1a1a;--color-blue-400: #00dfff;--color-blue-500: #52a1ff;--color-blue-900: #1b3243;--color-purple-400: #a855f7;--color-purple-500: #c27bff;--color-purple-900: #31144a;--color-green-400: #65ee2e;--color-green-900: #3d4928;--color-yellow-400: #facc15;--color-orange-300: rgb(253, 186, 116);--color-orange-400: #ff9900;--color-orange-450: #fb923c;--color-orange-500: #f97316;--color-orange-900: #4d301b;--color-amber-600: #d97706;--color-amber-600-alpha-20: rgba(217, 119, 6, .2);--color-amber-600-alpha-30: rgba(217, 119, 6, .3);--color-orange-400-alpha-20: rgba(255, 153, 0, .2);--color-orange-500-alpha-30: rgba(249, 115, 22, .3);--color-orange-500-alpha-40: rgba(249, 115, 22, .4);--color-orange-500-alpha-50: rgba(249, 115, 22, .5);--color-orange-500-alpha-60: rgba(249, 115, 22, .6);--color-orange-500-alpha-80: rgba(249, 115, 22, .8);--color-red-300: rgb(252, 165, 165);--color-red-400-alpha-25: rgba(248, 113, 113, .25);--color-red-500-alpha-25: rgba(239, 68, 68, .25);--color-red-500-alpha-45: rgba(239, 68, 68, .45);--color-red-500-alpha-60: rgba(239, 68, 68, .6);--color-red-600-alpha-25: rgba(220, 38, 38, .25);--color-red-900-alpha-35: rgba(127, 29, 29, .35);--color-red: #e60000;--color-black-alpha-8: rgba(0, 0, 0, .08);--color-black-alpha-10: rgba(0, 0, 0, .1);--color-black-alpha-60: rgba(0, 0, 0, .6);--color-black-alpha-70: rgba(0, 0, 0, .7);--color-black-alpha-85: rgba(0, 0, 0, .85);--color-black: #000000;--spacing-1: .0625rem;--spacing-2: .125rem;--spacing-4: .25rem;--spacing-8: .5rem;--spacing-12: .75rem;--spacing-16: 1rem;--spacing-24: 1.5rem;--spacing-32: 2rem;--spacing-48: 3rem;--border-radius-sm: .5rem;--border-radius-md: .75rem;--border-radius-lg: 1rem}:is(.flex--center){display:flex;justify-content:center;align-items:center}:is(.flex--align-center){align-items:center}:is(.flex--space-between){justify-content:space-between}.button{color:var(--color-white);cursor:pointer;background-color:var(--color-white-alpha-10);border:var(--spacing-1) solid var(--color-white-alpha-20);border-radius:50%;width:2.25rem;height:2.25rem;transform-origin:center;transition:transform .1s cubic-bezier(.4,0,.2,1)}.button:hover:not(:disabled){transform:scale(1.02);color:var(--color-white);background-color:var(--color-white-alpha-20);box-shadow:0 var(--spacing-2) var(--spacing-8) var(--color-black-alpha-10)}.button:active:not(:disabled){transform:scale(.98);box-shadow:0 var(--spacing-1) var(--spacing-4) var(--color-black-alpha-8)}.button:disabled{opacity:.5;cursor:default;color:var(--color-gray-100)}.stats{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;pointer-events:none;z-index:2;width:100%;height:inherit;container-type:inline-size}.stats .stats__panel{position:absolute;display:flex;align-items:flex-start;justify-content:center;flex-direction:row;flex-wrap:wrap;gap:var(--spacing-12);max-width:240px;width:100%;background-color:var(--color-black-alpha-85);border:1px solid var(--color-white-alpha-25);border-radius:8px;padding:var(--spacing-12);pointer-events:auto;top:8px}@container (width > 480px) and (width <= 768px){.stats .stats__panel{max-width:360px;padding:var(--spacing-24)}}@container (width > 768px){.stats .stats__panel{max-width:600px;padding:var(--spacing-24)}}.stats .stats__panel .stats__item{display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:row;height:auto;column-gap:var(--spacing-8);flex-basis:calc(50% - var(--spacing-12));flex-grow:1;flex-shrink:1}@container (width > 480px){.stats .stats__panel .stats__item{flex-basis:calc(25% - var(--spacing-12))}}.stats .stats__panel .stats__item .stats__icon-wrapper{display:none;padding:var(--spacing-8);border-radius:8px;width:fit-content;height:fit-content;flex-shrink:0}@container (width > 480px){.stats .stats__panel .stats__item .stats__icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-direction:row}}.stats .stats__panel .stats__item .stats__icon-wrapper svg{width:100%;height:100%}.stats .stats__panel .stats__item.stats__item--network .stats__icon-wrapper{background-color:var(--color-blue-900)}.stats .stats__panel .stats__item.stats__item--network,.stats .stats__panel .stats__item.stats__item--network .stats__item-data{color:var(--color-blue-400)}.stats .stats__panel .stats__item.stats__item--video .stats__icon-wrapper{background-color:var(--color-purple-900)}.stats .stats__panel .stats__item.stats__item--video,.stats .stats__panel .stats__item.stats__item--video .stats__item-data{color:var(--color-purple-400)}.stats .stats__panel .stats__item.stats__item--audio .stats__icon-wrapper{background-color:var(--color-green-900)}.stats .stats__panel .stats__item.stats__item--audio,.stats .stats__panel .stats__item.stats__item--audio .stats__item-data{color:var(--color-green-400)}.stats .stats__panel .stats__item.stats__item--buffer .stats__icon-wrapper{background-color:var(--color-orange-900)}.stats .stats__panel .stats__item.stats__item--buffer,.stats .stats__panel .stats__item.stats__item--buffer .stats__item-data{color:var(--color-orange-400)}.stats .stats__panel .stats__item .stats__item-detail{display:flex;align-items:flex-start;justify-content:space-evenly;flex-direction:column;gap:var(--spacing-4)}.stats .stats__panel .stats__item .stats__item-detail .stats__item-title{font-size:12px;font-weight:500;text-transform:capitalize;color:var(--color-gray-100);font-family:Segoe UI,Roboto,sans-serif;letter-spacing:1px;line-height:12px}.stats .stats__panel .stats__item .stats__item-detail .stats__item-data{font-size:16px;font-weight:700;font-family:Segoe UI,Roboto,sans-serif;white-space:pre-wrap;line-height:1.5}.watch-ui__video-container{display:block;position:relative;width:100%;height:auto;border-radius:var(--spacing-4);margin:0 auto;pointer-events:none}.watch-ui__controls{display:flex;flex-direction:column;gap:var(--spacing-24)}.button.button--playback{width:3rem;height:3rem;background:linear-gradient(to bottom right,var(--color-orange-400),var(--color-orange-500),var(--color-amber-600));box-shadow:0 0 var(--spacing-16) var(--color-orange-500-alpha-60);transition:box-shadow .15s cubic-bezier(.4,0,.2,1);position:relative;overflow:hidden}.button.button--playback:hover:not(:disabled){box-shadow:0 0 var(--spacing-24) var(--color-orange-500-alpha-80);transform:scale(1.02)}.button.button--playback:active:not(:disabled){transform:scale(.98)}.button.button--playback:before{content:"";position:absolute;inset:0;background:linear-gradient(to bottom right,var(--color-white-alpha-30),transparent);opacity:0;transition:opacity .15s cubic-bezier(.4,0,.2,1);pointer-events:none}.button.button--playback:hover:before{opacity:1}.button.button--playback:after{content:"";position:absolute;inset:0;background-color:var(--color-white-alpha-20);border-radius:50%;filter:blur(var(--spacing-24));pointer-events:none}.watch-ui__playback-controls{display:flex;place-content:center space-around;gap:var(--spacing-8);padding:var(--spacing-8) 0}.watch-ui__latency-controls{display:flex;flex-direction:column;gap:var(--spacing-16)}.watch-ui__volume-slider{gap:var(--spacing-4)}.watch-ui__volume-label{width:var(--spacing-16);text-align:right}.watch-ui__quality-selector{display:flex;align-items:center;gap:var(--spacing-8);background:transparent;border-radius:var(--spacing-8)}.watch-ui__quality-label{font-size:1.25rem;font-weight:500;color:var(--color-white);white-space:nowrap}.watch-ui__quality-select{flex:0 1 auto;font-size:1rem;padding:var(--spacing-8);border-radius:var(--spacing-4);background:var(--color-white-alpha-10);color:var(--color-white);border:var(--spacing-1) solid var(--color-white-alpha-20);cursor:pointer;transition:background .2s ease}.watch-ui__quality-select:hover{background:var(--color-white-alpha-15)}.watch-ui__quality-select:focus{outline:var(--spacing-2) solid var(--color-white-alpha-30);outline-offset:var(--spacing-2)}.watch-ui__quality-select option{background:var(--color-gray-950);color:var(--color-white)}.watch-ui__buffer{width:100%}.watch-ui__buffer-visualization{position:relative;width:100%;height:3.75rem;background:var(--color-white-alpha-10);border-radius:var(--spacing-4);cursor:pointer;user-select:none;padding-left:var(--spacing-48);box-sizing:border-box}.watch-ui__buffer-playhead{position:absolute;left:var(--spacing-48);top:0;bottom:0;width:var(--spacing-2);background:var(--color-white);z-index:3}.watch-ui__buffer-track{display:flex;align-items:center;position:absolute;left:var(--spacing-48);right:0;height:var(--spacing-24)}.watch-ui__buffer-track--video{top:var(--spacing-4)}.watch-ui__buffer-track--audio{top:var(--spacing-32)}.watch-ui__buffer-track-label{position:absolute;left:-2.875rem;width:2.5rem;font-size:.625rem;color:var(--color-white-alpha-70);text-align:right;padding-right:var(--spacing-4);pointer-events:none;box-sizing:border-box}.watch-ui__buffer-range{position:absolute;display:flex;align-items:center;justify-content:flex-end;top:var(--spacing-2);height:calc(100% - var(--spacing-4));border-radius:var(--spacing-2);min-width:var(--spacing-2);opacity:.85;overflow:hidden}.watch-ui__buffer-overflow-label{font-size:.5625rem;font-weight:500;color:var(--color-black-alpha-70);padding-right:var(--spacing-4)}.watch-ui__buffer-target-area{position:absolute;top:0;bottom:0;left:var(--spacing-48);right:0;pointer-events:none}.watch-ui__buffer-target-line{position:absolute;top:0;bottom:0;width:.1875rem;background:var(--color-orange-400, var(--color-orange-450));z-index:2;cursor:ew-resize;border-radius:var(--spacing-1);pointer-events:auto}.watch-ui__buffer-target-label{position:absolute;bottom:100%;left:50%;transform:translate(-50%);font-size:.6875rem;font-weight:500;color:var(--color-orange-400, var(--color-orange-450));white-space:nowrap;margin-bottom:var(--spacing-2);opacity:0;transition:opacity .15s ease;pointer-events:none}.watch-ui__buffer-visualization:hover .watch-ui__buffer-target-label,.watch-ui__buffer-visualization--dragging .watch-ui__buffer-target-label{opacity:1}.watch-ui__buffering{position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;background-color:var(--color-black-alpha-40);backdrop-filter:blur(var(--spacing-2));pointer-events:auto}.watch-ui__buffering-spinner{width:2.5rem;height:2.5rem;border:var(--spacing-4) solid var(--color-white-alpha-20);border-top:var(--spacing-4) solid var(--color-white);border-radius:50%;animation:buffer-spin 1s linear infinite}@keyframes buffer-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.watch-ui__status-indicator{gap:var(--spacing-12);backdrop-filter:blur(var(--spacing-16))}.watch-ui__status-indicator-dot{position:relative;width:.75rem;height:.75rem;border-radius:50%;flex-shrink:0;z-index:1}.watch-ui__status-indicator-dot:after{content:"";position:absolute;inset:0;border-radius:50%;background:currentcolor;transform:scale(1);opacity:.5;animation:status-pulse 1.5s ease-out infinite;z-index:-1}.watch-ui__status-indicator-dot:after{display:none}.watch-ui__status-indicator-dot--live:after,.watch-ui__status-indicator-dot--connected:after,.watch-ui__status-indicator-dot--loading:after,.watch-ui__status-indicator-dot--connecting:after{display:block}.watch-ui__status-indicator-dot--error{background:var(--color-gray-100);color:var(--color-gray-100)}.watch-ui__status-indicator-text--error{color:var(--color-gray-100)}.watch-ui__status-indicator-dot--connecting{background:var(--color-yellow-400);color:var(--color-yellow-400)}.watch-ui__status-indicator-text--connecting{color:var(--color-yellow-400)}.watch-ui__status-indicator-dot--loading{background:var(--color-yellow-400);color:var(--color-yellow-400)}.watch-ui__status-indicator-text--loading{color:var(--color-yellow-400)}.watch-ui__status-indicator-dot--live{background:var(--color-green-400);color:var(--color-green-400)}.watch-ui__status-indicator-text--live{color:var(--color-green-400)}.watch-ui__status-indicator-dot--connected{background:var(--color-blue-500);color:var(--color-blue-500)}.watch-ui__status-indicator-text--connected{color:var(--color-blue-500)}.watch-ui__status-indicator-text{font-size:1rem;letter-spacing:.1rem}@keyframes status-pulse{0%{transform:scale(1);opacity:.5}70%{opacity:.25}to{transform:scale(2.5);opacity:0}}';
@@ -1046,8 +1046,8 @@ function He(t) {
1046
1046
  var e = Ke();
1047
1047
  return p(e, Fe), e;
1048
1048
  })(), (() => {
1049
- var e = De(), r = e.firstChild;
1050
- return r._$owner = Gt(), p(e, () => {
1049
+ var e = De(), n = e.firstChild;
1050
+ return n._$owner = Gt(), p(e, () => {
1051
1051
  const a = qt(st);
1052
1052
  return a ? u(L, {
1053
1053
  get when() {
@@ -1056,7 +1056,7 @@ function He(t) {
1056
1056
  get children() {
1057
1057
  return u(Bt, {
1058
1058
  context: st,
1059
- getElement: (n) => n?.moqWatch
1059
+ getElement: (r) => r?.moqWatch.backend
1060
1060
  });
1061
1061
  }
1062
1062
  }) : null;
@@ -1068,18 +1068,18 @@ function He(t) {
1068
1068
  ke("moq-watch-ui", (t, {
1069
1069
  element: e
1070
1070
  }) => {
1071
- const [r, a] = j();
1071
+ const [n, a] = j();
1072
1072
  return Ht(async () => {
1073
1073
  await customElements.whenDefined("moq-watch");
1074
- const n = e.querySelector("moq-watch");
1075
- a(n || void 0);
1074
+ const r = e.querySelector("moq-watch");
1075
+ a(r || void 0);
1076
1076
  }), u(L, {
1077
1077
  get when() {
1078
- return r();
1078
+ return n();
1079
1079
  },
1080
1080
  keyed: !0,
1081
- children: (n) => u(He, {
1082
- watch: n
1081
+ children: (r) => u(He, {
1082
+ watch: r
1083
1083
  })
1084
1084
  });
1085
1085
  });