@moq/publish 0.1.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/README.md +100 -0
- package/audio/capture-worklet.d.ts +2 -0
- package/audio/capture-worklet.d.ts.map +1 -0
- package/audio/capture.d.ts +6 -0
- package/audio/capture.d.ts.map +1 -0
- package/audio/encoder.d.ts +31 -0
- package/audio/encoder.d.ts.map +1 -0
- package/audio/index.d.ts +3 -0
- package/audio/index.d.ts.map +1 -0
- package/audio/types.d.ts +18 -0
- package/audio/types.d.ts.map +1 -0
- package/broadcast.d.ts +36 -0
- package/broadcast.d.ts.map +1 -0
- package/chat/index.d.ts +19 -0
- package/chat/index.d.ts.map +1 -0
- package/chat/message.d.ts +19 -0
- package/chat/message.d.ts.map +1 -0
- package/chat/typing.d.ts +19 -0
- package/chat/typing.d.ts.map +1 -0
- package/element.d.ts +32 -0
- package/element.d.ts.map +1 -0
- package/element.js +141 -0
- package/element.js.map +1 -0
- package/index.d.ts +9 -0
- package/index.d.ts.map +1 -0
- package/index.js +24 -0
- package/index.js.map +1 -0
- package/libav-opus-af-BlMWboA7.js +368 -0
- package/libav-opus-af-BlMWboA7.js.map +1 -0
- package/location/index.d.ts +33 -0
- package/location/index.d.ts.map +1 -0
- package/location/peers.d.ts +26 -0
- package/location/peers.d.ts.map +1 -0
- package/location/window.d.ts +35 -0
- package/location/window.d.ts.map +1 -0
- package/main-DGBFe0O7.js +2301 -0
- package/main-DGBFe0O7.js.map +1 -0
- package/package.json +41 -0
- package/preview.d.ts +21 -0
- package/preview.d.ts.map +1 -0
- package/screen-BCioRZHS.js +6579 -0
- package/screen-BCioRZHS.js.map +1 -0
- package/source/camera.d.ts +19 -0
- package/source/camera.d.ts.map +1 -0
- package/source/device.d.ts +19 -0
- package/source/device.d.ts.map +1 -0
- package/source/file.d.ts +20 -0
- package/source/file.d.ts.map +1 -0
- package/source/index.d.ts +6 -0
- package/source/index.d.ts.map +1 -0
- package/source/microphone.d.ts +19 -0
- package/source/microphone.d.ts.map +1 -0
- package/source/screen.d.ts +22 -0
- package/source/screen.d.ts.map +1 -0
- package/support/element.d.ts +22 -0
- package/support/element.d.ts.map +1 -0
- package/support/element.js +184 -0
- package/support/element.js.map +1 -0
- package/support/index.d.ts +29 -0
- package/support/index.d.ts.map +1 -0
- package/support/index.js +63 -0
- package/support/index.js.map +1 -0
- package/ui/components/CameraSourceButton.d.ts +2 -0
- package/ui/components/CameraSourceButton.d.ts.map +1 -0
- package/ui/components/FileSourceButton.d.ts +2 -0
- package/ui/components/FileSourceButton.d.ts.map +1 -0
- package/ui/components/MediaSourceSelector.d.ts +8 -0
- package/ui/components/MediaSourceSelector.d.ts.map +1 -0
- package/ui/components/MicrophoneSourceButton.d.ts +2 -0
- package/ui/components/MicrophoneSourceButton.d.ts.map +1 -0
- package/ui/components/NothingSourceButton.d.ts +2 -0
- package/ui/components/NothingSourceButton.d.ts.map +1 -0
- package/ui/components/PublishControls.d.ts +2 -0
- package/ui/components/PublishControls.d.ts.map +1 -0
- package/ui/components/PublishStatusIndicator.d.ts +2 -0
- package/ui/components/PublishStatusIndicator.d.ts.map +1 -0
- package/ui/components/ScreenSourceButton.d.ts +2 -0
- package/ui/components/ScreenSourceButton.d.ts.map +1 -0
- package/ui/context.d.ts +25 -0
- package/ui/context.d.ts.map +1 -0
- package/ui/element.d.ts +5 -0
- package/ui/element.d.ts.map +1 -0
- package/ui/hooks/use-publish-ui.d.ts +15 -0
- package/ui/hooks/use-publish-ui.d.ts.map +1 -0
- package/ui/index.d.ts +7 -0
- package/ui/index.d.ts.map +1 -0
- package/ui/index.js +974 -0
- package/ui/index.js.map +1 -0
- package/user.d.ts +25 -0
- package/user.d.ts.map +1 -0
- package/video/encoder.d.ts +31 -0
- package/video/encoder.d.ts.map +1 -0
- package/video/index.d.ts +85 -0
- package/video/index.d.ts.map +1 -0
- package/video/polyfill.d.ts +3 -0
- package/video/polyfill.d.ts.map +1 -0
- package/video/types.d.ts +20 -0
- package/video/types.d.ts.map +1 -0
package/ui/index.js
ADDED
|
@@ -0,0 +1,974 @@
|
|
|
1
|
+
import { Button as R, Icon as j } from "@moq/ui-core";
|
|
2
|
+
const $e = !1, Ee = (e, t) => e === t, qe = /* @__PURE__ */ Symbol("solid-track"), Z = {
|
|
3
|
+
equals: Ee
|
|
4
|
+
};
|
|
5
|
+
let he = _e;
|
|
6
|
+
const I = 1, X = 2, pe = {
|
|
7
|
+
owned: null,
|
|
8
|
+
cleanups: null,
|
|
9
|
+
context: null,
|
|
10
|
+
owner: null
|
|
11
|
+
};
|
|
12
|
+
var g = null;
|
|
13
|
+
let ne = null, Oe = null, v = null, y = null, q = null, re = 0;
|
|
14
|
+
function W(e, t) {
|
|
15
|
+
const r = v, o = g, n = e.length === 0, i = t === void 0 ? o : t, l = n ? pe : {
|
|
16
|
+
owned: null,
|
|
17
|
+
cleanups: null,
|
|
18
|
+
context: i ? i.context : null,
|
|
19
|
+
owner: i
|
|
20
|
+
}, s = n ? e : () => e(() => O(() => D(l)));
|
|
21
|
+
g = l, v = null;
|
|
22
|
+
try {
|
|
23
|
+
return G(s, !0);
|
|
24
|
+
} finally {
|
|
25
|
+
v = r, g = o;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function x(e, t) {
|
|
29
|
+
t = t ? Object.assign({}, Z, t) : Z;
|
|
30
|
+
const r = {
|
|
31
|
+
value: e,
|
|
32
|
+
observers: null,
|
|
33
|
+
observerSlots: null,
|
|
34
|
+
comparator: t.equals || void 0
|
|
35
|
+
}, o = (n) => (typeof n == "function" && (n = n(r.value)), ve(r, n));
|
|
36
|
+
return [ge.bind(r), o];
|
|
37
|
+
}
|
|
38
|
+
function U(e, t, r) {
|
|
39
|
+
const o = ae(e, t, !1, I);
|
|
40
|
+
H(o);
|
|
41
|
+
}
|
|
42
|
+
function be(e, t, r) {
|
|
43
|
+
he = Fe;
|
|
44
|
+
const o = ae(e, t, !1, I);
|
|
45
|
+
o.user = !0, q ? q.push(o) : H(o);
|
|
46
|
+
}
|
|
47
|
+
function T(e, t, r) {
|
|
48
|
+
r = r ? Object.assign({}, Z, r) : Z;
|
|
49
|
+
const o = ae(e, t, !0, 0);
|
|
50
|
+
return o.observers = null, o.observerSlots = null, o.comparator = r.equals || void 0, H(o), ge.bind(o);
|
|
51
|
+
}
|
|
52
|
+
function O(e) {
|
|
53
|
+
if (v === null) return e();
|
|
54
|
+
const t = v;
|
|
55
|
+
v = null;
|
|
56
|
+
try {
|
|
57
|
+
return e();
|
|
58
|
+
} finally {
|
|
59
|
+
v = t;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function Me(e) {
|
|
63
|
+
be(() => O(e));
|
|
64
|
+
}
|
|
65
|
+
function Ne(e) {
|
|
66
|
+
return g === null || (g.cleanups === null ? g.cleanups = [e] : g.cleanups.push(e)), e;
|
|
67
|
+
}
|
|
68
|
+
function Ie() {
|
|
69
|
+
return g;
|
|
70
|
+
}
|
|
71
|
+
function Te(e, t) {
|
|
72
|
+
const r = /* @__PURE__ */ Symbol("context");
|
|
73
|
+
return {
|
|
74
|
+
id: r,
|
|
75
|
+
Provider: ze(r),
|
|
76
|
+
defaultValue: e
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function je(e) {
|
|
80
|
+
let t;
|
|
81
|
+
return g && g.context && (t = g.context[e.id]) !== void 0 ? t : e.defaultValue;
|
|
82
|
+
}
|
|
83
|
+
function Ue(e) {
|
|
84
|
+
const t = T(e), r = T(() => se(t()));
|
|
85
|
+
return r.toArray = () => {
|
|
86
|
+
const o = r();
|
|
87
|
+
return Array.isArray(o) ? o : o != null ? [o] : [];
|
|
88
|
+
}, r;
|
|
89
|
+
}
|
|
90
|
+
function ge() {
|
|
91
|
+
if (this.sources && this.state)
|
|
92
|
+
if (this.state === I) H(this);
|
|
93
|
+
else {
|
|
94
|
+
const e = y;
|
|
95
|
+
y = null, G(() => ee(this), !1), y = e;
|
|
96
|
+
}
|
|
97
|
+
if (v) {
|
|
98
|
+
const e = this.observers ? this.observers.length : 0;
|
|
99
|
+
v.sources ? (v.sources.push(this), v.sourceSlots.push(e)) : (v.sources = [this], v.sourceSlots = [e]), this.observers ? (this.observers.push(v), this.observerSlots.push(v.sources.length - 1)) : (this.observers = [v], this.observerSlots = [v.sources.length - 1]);
|
|
100
|
+
}
|
|
101
|
+
return this.value;
|
|
102
|
+
}
|
|
103
|
+
function ve(e, t, r) {
|
|
104
|
+
let o = e.value;
|
|
105
|
+
return (!e.comparator || !e.comparator(o, t)) && (e.value = t, e.observers && e.observers.length && G(() => {
|
|
106
|
+
for (let n = 0; n < e.observers.length; n += 1) {
|
|
107
|
+
const i = e.observers[n], l = ne && ne.running;
|
|
108
|
+
l && ne.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? y.push(i) : q.push(i), i.observers && me(i)), l || (i.state = I);
|
|
109
|
+
}
|
|
110
|
+
if (y.length > 1e6)
|
|
111
|
+
throw y = [], new Error();
|
|
112
|
+
}, !1)), t;
|
|
113
|
+
}
|
|
114
|
+
function H(e) {
|
|
115
|
+
if (!e.fn) return;
|
|
116
|
+
D(e);
|
|
117
|
+
const t = re;
|
|
118
|
+
Be(e, e.value, t);
|
|
119
|
+
}
|
|
120
|
+
function Be(e, t, r) {
|
|
121
|
+
let o;
|
|
122
|
+
const n = g, i = v;
|
|
123
|
+
v = g = e;
|
|
124
|
+
try {
|
|
125
|
+
o = e.fn(t);
|
|
126
|
+
} catch (l) {
|
|
127
|
+
return e.pure && (e.state = I, e.owned && e.owned.forEach(D), e.owned = null), e.updatedAt = r + 1, we(l);
|
|
128
|
+
} finally {
|
|
129
|
+
v = i, g = n;
|
|
130
|
+
}
|
|
131
|
+
(!e.updatedAt || e.updatedAt <= r) && (e.updatedAt != null && "observers" in e ? ve(e, o) : e.value = o, e.updatedAt = r);
|
|
132
|
+
}
|
|
133
|
+
function ae(e, t, r, o = I, n) {
|
|
134
|
+
const i = {
|
|
135
|
+
fn: e,
|
|
136
|
+
state: o,
|
|
137
|
+
updatedAt: null,
|
|
138
|
+
owned: null,
|
|
139
|
+
sources: null,
|
|
140
|
+
sourceSlots: null,
|
|
141
|
+
cleanups: null,
|
|
142
|
+
value: t,
|
|
143
|
+
owner: g,
|
|
144
|
+
context: g ? g.context : null,
|
|
145
|
+
pure: r
|
|
146
|
+
};
|
|
147
|
+
return g === null || g !== pe && (g.owned ? g.owned.push(i) : g.owned = [i]), i;
|
|
148
|
+
}
|
|
149
|
+
function Y(e) {
|
|
150
|
+
if (e.state === 0) return;
|
|
151
|
+
if (e.state === X) return ee(e);
|
|
152
|
+
if (e.suspense && O(e.suspense.inFallback)) return e.suspense.effects.push(e);
|
|
153
|
+
const t = [e];
|
|
154
|
+
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < re); )
|
|
155
|
+
e.state && t.push(e);
|
|
156
|
+
for (let r = t.length - 1; r >= 0; r--)
|
|
157
|
+
if (e = t[r], e.state === I)
|
|
158
|
+
H(e);
|
|
159
|
+
else if (e.state === X) {
|
|
160
|
+
const o = y;
|
|
161
|
+
y = null, G(() => ee(e, t[0]), !1), y = o;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function G(e, t) {
|
|
165
|
+
if (y) return e();
|
|
166
|
+
let r = !1;
|
|
167
|
+
t || (y = []), q ? r = !0 : q = [], re++;
|
|
168
|
+
try {
|
|
169
|
+
const o = e();
|
|
170
|
+
return Le(r), o;
|
|
171
|
+
} catch (o) {
|
|
172
|
+
r || (q = null), y = null, we(o);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function Le(e) {
|
|
176
|
+
if (y && (_e(y), y = null), e) return;
|
|
177
|
+
const t = q;
|
|
178
|
+
q = null, t.length && G(() => he(t), !1);
|
|
179
|
+
}
|
|
180
|
+
function _e(e) {
|
|
181
|
+
for (let t = 0; t < e.length; t++) Y(e[t]);
|
|
182
|
+
}
|
|
183
|
+
function Fe(e) {
|
|
184
|
+
let t, r = 0;
|
|
185
|
+
for (t = 0; t < e.length; t++) {
|
|
186
|
+
const o = e[t];
|
|
187
|
+
o.user ? e[r++] = o : Y(o);
|
|
188
|
+
}
|
|
189
|
+
for (t = 0; t < r; t++) Y(e[t]);
|
|
190
|
+
}
|
|
191
|
+
function ee(e, t) {
|
|
192
|
+
e.state = 0;
|
|
193
|
+
for (let r = 0; r < e.sources.length; r += 1) {
|
|
194
|
+
const o = e.sources[r];
|
|
195
|
+
if (o.sources) {
|
|
196
|
+
const n = o.state;
|
|
197
|
+
n === I ? o !== t && (!o.updatedAt || o.updatedAt < re) && Y(o) : n === X && ee(o, t);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function me(e) {
|
|
202
|
+
for (let t = 0; t < e.observers.length; t += 1) {
|
|
203
|
+
const r = e.observers[t];
|
|
204
|
+
r.state || (r.state = X, r.pure ? y.push(r) : q.push(r), r.observers && me(r));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function D(e) {
|
|
208
|
+
let t;
|
|
209
|
+
if (e.sources)
|
|
210
|
+
for (; e.sources.length; ) {
|
|
211
|
+
const r = e.sources.pop(), o = e.sourceSlots.pop(), n = r.observers;
|
|
212
|
+
if (n && n.length) {
|
|
213
|
+
const i = n.pop(), l = r.observerSlots.pop();
|
|
214
|
+
o < n.length && (i.sourceSlots[l] = o, n[o] = i, r.observerSlots[o] = l);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (e.tOwned) {
|
|
218
|
+
for (t = e.tOwned.length - 1; t >= 0; t--) D(e.tOwned[t]);
|
|
219
|
+
delete e.tOwned;
|
|
220
|
+
}
|
|
221
|
+
if (e.owned) {
|
|
222
|
+
for (t = e.owned.length - 1; t >= 0; t--) D(e.owned[t]);
|
|
223
|
+
e.owned = null;
|
|
224
|
+
}
|
|
225
|
+
if (e.cleanups) {
|
|
226
|
+
for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
|
|
227
|
+
e.cleanups = null;
|
|
228
|
+
}
|
|
229
|
+
e.state = 0;
|
|
230
|
+
}
|
|
231
|
+
function Re(e) {
|
|
232
|
+
return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
|
|
233
|
+
cause: e
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function we(e, t = g) {
|
|
237
|
+
throw Re(e);
|
|
238
|
+
}
|
|
239
|
+
function se(e) {
|
|
240
|
+
if (typeof e == "function" && !e.length) return se(e());
|
|
241
|
+
if (Array.isArray(e)) {
|
|
242
|
+
const t = [];
|
|
243
|
+
for (let r = 0; r < e.length; r++) {
|
|
244
|
+
const o = se(e[r]);
|
|
245
|
+
Array.isArray(o) ? t.push.apply(t, o) : t.push(o);
|
|
246
|
+
}
|
|
247
|
+
return t;
|
|
248
|
+
}
|
|
249
|
+
return e;
|
|
250
|
+
}
|
|
251
|
+
function ze(e, t) {
|
|
252
|
+
return function(o) {
|
|
253
|
+
let n;
|
|
254
|
+
return U(() => n = O(() => (g.context = {
|
|
255
|
+
...g.context,
|
|
256
|
+
[e]: o.value
|
|
257
|
+
}, Ue(() => o.children))), void 0), n;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
const Ke = /* @__PURE__ */ Symbol("fallback");
|
|
261
|
+
function ce(e) {
|
|
262
|
+
for (let t = 0; t < e.length; t++) e[t]();
|
|
263
|
+
}
|
|
264
|
+
function De(e, t, r = {}) {
|
|
265
|
+
let o = [], n = [], i = [], l = 0, s = t.length > 1 ? [] : null;
|
|
266
|
+
return Ne(() => ce(i)), () => {
|
|
267
|
+
let u = e() || [], p = u.length, c, a;
|
|
268
|
+
return u[qe], O(() => {
|
|
269
|
+
let S, $, E, B, L, C, A, m, M;
|
|
270
|
+
if (p === 0)
|
|
271
|
+
l !== 0 && (ce(i), i = [], o = [], n = [], l = 0, s && (s = [])), r.fallback && (o = [Ke], n[0] = W((oe) => (i[0] = oe, r.fallback())), l = 1);
|
|
272
|
+
else if (l === 0) {
|
|
273
|
+
for (n = new Array(p), a = 0; a < p; a++)
|
|
274
|
+
o[a] = u[a], n[a] = W(k);
|
|
275
|
+
l = p;
|
|
276
|
+
} else {
|
|
277
|
+
for (E = new Array(p), B = new Array(p), s && (L = new Array(p)), C = 0, A = Math.min(l, p); C < A && o[C] === u[C]; C++) ;
|
|
278
|
+
for (A = l - 1, m = p - 1; A >= C && m >= C && o[A] === u[m]; A--, m--)
|
|
279
|
+
E[m] = n[A], B[m] = i[A], s && (L[m] = s[A]);
|
|
280
|
+
for (S = /* @__PURE__ */ new Map(), $ = new Array(m + 1), a = m; a >= C; a--)
|
|
281
|
+
M = u[a], c = S.get(M), $[a] = c === void 0 ? -1 : c, S.set(M, a);
|
|
282
|
+
for (c = C; c <= A; c++)
|
|
283
|
+
M = o[c], a = S.get(M), a !== void 0 && a !== -1 ? (E[a] = n[c], B[a] = i[c], s && (L[a] = s[c]), a = $[a], S.set(M, a)) : i[c]();
|
|
284
|
+
for (a = C; a < p; a++)
|
|
285
|
+
a in E ? (n[a] = E[a], i[a] = B[a], s && (s[a] = L[a], s[a](a))) : n[a] = W(k);
|
|
286
|
+
n = n.slice(0, l = p), o = u.slice(0);
|
|
287
|
+
}
|
|
288
|
+
return n;
|
|
289
|
+
});
|
|
290
|
+
function k(S) {
|
|
291
|
+
if (i[a] = S, s) {
|
|
292
|
+
const [$, E] = x(a);
|
|
293
|
+
return s[a] = E, t(u[a], $);
|
|
294
|
+
}
|
|
295
|
+
return t(u[a]);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function f(e, t) {
|
|
300
|
+
return O(() => e(t || {}));
|
|
301
|
+
}
|
|
302
|
+
const Ve = (e) => `Stale read from <${e}>.`;
|
|
303
|
+
function He(e) {
|
|
304
|
+
const t = "fallback" in e && {
|
|
305
|
+
fallback: () => e.fallback
|
|
306
|
+
};
|
|
307
|
+
return T(De(() => e.each, e.children, t || void 0));
|
|
308
|
+
}
|
|
309
|
+
function V(e) {
|
|
310
|
+
const t = e.keyed, r = T(() => e.when, void 0, void 0), o = t ? r : T(r, void 0, {
|
|
311
|
+
equals: (n, i) => !n == !i
|
|
312
|
+
});
|
|
313
|
+
return T(() => {
|
|
314
|
+
const n = o();
|
|
315
|
+
if (n) {
|
|
316
|
+
const i = e.children;
|
|
317
|
+
return typeof i == "function" && i.length > 0 ? O(() => i(t ? n : () => {
|
|
318
|
+
if (!O(o)) throw Ve("Show");
|
|
319
|
+
return r();
|
|
320
|
+
})) : i;
|
|
321
|
+
}
|
|
322
|
+
return e.fallback;
|
|
323
|
+
}, void 0, void 0);
|
|
324
|
+
}
|
|
325
|
+
const ye = (e) => T(() => e());
|
|
326
|
+
function Ge(e, t, r) {
|
|
327
|
+
let o = r.length, n = t.length, i = o, l = 0, s = 0, u = t[n - 1].nextSibling, p = null;
|
|
328
|
+
for (; l < n || s < i; ) {
|
|
329
|
+
if (t[l] === r[s]) {
|
|
330
|
+
l++, s++;
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
for (; t[n - 1] === r[i - 1]; )
|
|
334
|
+
n--, i--;
|
|
335
|
+
if (n === l) {
|
|
336
|
+
const c = i < o ? s ? r[s - 1].nextSibling : r[i - s] : u;
|
|
337
|
+
for (; s < i; ) e.insertBefore(r[s++], c);
|
|
338
|
+
} else if (i === s)
|
|
339
|
+
for (; l < n; )
|
|
340
|
+
(!p || !p.has(t[l])) && t[l].remove(), l++;
|
|
341
|
+
else if (t[l] === r[i - 1] && r[s] === t[n - 1]) {
|
|
342
|
+
const c = t[--n].nextSibling;
|
|
343
|
+
e.insertBefore(r[s++], t[l++].nextSibling), e.insertBefore(r[--i], c), t[n] = r[i];
|
|
344
|
+
} else {
|
|
345
|
+
if (!p) {
|
|
346
|
+
p = /* @__PURE__ */ new Map();
|
|
347
|
+
let a = s;
|
|
348
|
+
for (; a < i; ) p.set(r[a], a++);
|
|
349
|
+
}
|
|
350
|
+
const c = p.get(t[l]);
|
|
351
|
+
if (c != null)
|
|
352
|
+
if (s < c && c < i) {
|
|
353
|
+
let a = l, k = 1, S;
|
|
354
|
+
for (; ++a < n && a < i && !((S = p.get(t[a])) == null || S !== c + k); )
|
|
355
|
+
k++;
|
|
356
|
+
if (k > c - s) {
|
|
357
|
+
const $ = t[l];
|
|
358
|
+
for (; s < c; ) e.insertBefore(r[s++], $);
|
|
359
|
+
} else e.replaceChild(r[s++], t[l++]);
|
|
360
|
+
} else l++;
|
|
361
|
+
else t[l++].remove();
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function P(e, t, r, o) {
|
|
366
|
+
let n;
|
|
367
|
+
const i = () => {
|
|
368
|
+
const s = document.createElement("template");
|
|
369
|
+
return s.innerHTML = e, s.content.firstChild;
|
|
370
|
+
}, l = () => (n || (n = i())).cloneNode(!0);
|
|
371
|
+
return l.cloneNode = l, l;
|
|
372
|
+
}
|
|
373
|
+
function ue(e, t) {
|
|
374
|
+
t == null ? e.removeAttribute("class") : e.className = t;
|
|
375
|
+
}
|
|
376
|
+
function Je(e, t, r) {
|
|
377
|
+
return O(() => e(t, r));
|
|
378
|
+
}
|
|
379
|
+
function w(e, t, r, o) {
|
|
380
|
+
if (r !== void 0 && !o && (o = []), typeof t != "function") return te(e, t, o, r);
|
|
381
|
+
U((n) => te(e, t(), n, r), o);
|
|
382
|
+
}
|
|
383
|
+
function te(e, t, r, o, n) {
|
|
384
|
+
for (; typeof r == "function"; ) r = r();
|
|
385
|
+
if (t === r) return r;
|
|
386
|
+
const i = typeof t, l = o !== void 0;
|
|
387
|
+
if (e = l && r[0] && r[0].parentNode || e, i === "string" || i === "number") {
|
|
388
|
+
if (i === "number" && (t = t.toString(), t === r))
|
|
389
|
+
return r;
|
|
390
|
+
if (l) {
|
|
391
|
+
let s = r[0];
|
|
392
|
+
s && s.nodeType === 3 ? s.data !== t && (s.data = t) : s = document.createTextNode(t), r = F(e, r, o, s);
|
|
393
|
+
} else
|
|
394
|
+
r !== "" && typeof r == "string" ? r = e.firstChild.data = t : r = e.textContent = t;
|
|
395
|
+
} else if (t == null || i === "boolean")
|
|
396
|
+
r = F(e, r, o);
|
|
397
|
+
else {
|
|
398
|
+
if (i === "function")
|
|
399
|
+
return U(() => {
|
|
400
|
+
let s = t();
|
|
401
|
+
for (; typeof s == "function"; ) s = s();
|
|
402
|
+
r = te(e, s, r, o);
|
|
403
|
+
}), () => r;
|
|
404
|
+
if (Array.isArray(t)) {
|
|
405
|
+
const s = [], u = r && Array.isArray(r);
|
|
406
|
+
if (le(s, t, r, n))
|
|
407
|
+
return U(() => r = te(e, s, r, o, !0)), () => r;
|
|
408
|
+
if (s.length === 0) {
|
|
409
|
+
if (r = F(e, r, o), l) return r;
|
|
410
|
+
} else u ? r.length === 0 ? de(e, s, o) : Ge(e, r, s) : (r && F(e), de(e, s));
|
|
411
|
+
r = s;
|
|
412
|
+
} else if (t.nodeType) {
|
|
413
|
+
if (Array.isArray(r)) {
|
|
414
|
+
if (l) return r = F(e, r, o, t);
|
|
415
|
+
F(e, r, null, t);
|
|
416
|
+
} else r == null || r === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
|
|
417
|
+
r = t;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return r;
|
|
421
|
+
}
|
|
422
|
+
function le(e, t, r, o) {
|
|
423
|
+
let n = !1;
|
|
424
|
+
for (let i = 0, l = t.length; i < l; i++) {
|
|
425
|
+
let s = t[i], u = r && r[e.length], p;
|
|
426
|
+
if (!(s == null || s === !0 || s === !1)) if ((p = typeof s) == "object" && s.nodeType)
|
|
427
|
+
e.push(s);
|
|
428
|
+
else if (Array.isArray(s))
|
|
429
|
+
n = le(e, s, u) || n;
|
|
430
|
+
else if (p === "function")
|
|
431
|
+
if (o) {
|
|
432
|
+
for (; typeof s == "function"; ) s = s();
|
|
433
|
+
n = le(e, Array.isArray(s) ? s : [s], Array.isArray(u) ? u : [u]) || n;
|
|
434
|
+
} else
|
|
435
|
+
e.push(s), n = !0;
|
|
436
|
+
else {
|
|
437
|
+
const c = String(s);
|
|
438
|
+
u && u.nodeType === 3 && u.data === c ? e.push(u) : e.push(document.createTextNode(c));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return n;
|
|
442
|
+
}
|
|
443
|
+
function de(e, t, r = null) {
|
|
444
|
+
for (let o = 0, n = t.length; o < n; o++) e.insertBefore(t[o], r);
|
|
445
|
+
}
|
|
446
|
+
function F(e, t, r, o) {
|
|
447
|
+
if (r === void 0) return e.textContent = "";
|
|
448
|
+
const n = o || document.createTextNode("");
|
|
449
|
+
if (t.length) {
|
|
450
|
+
let i = !1;
|
|
451
|
+
for (let l = t.length - 1; l >= 0; l--) {
|
|
452
|
+
const s = t[l];
|
|
453
|
+
if (n !== s) {
|
|
454
|
+
const u = s.parentNode === e;
|
|
455
|
+
!i && !l ? u ? e.replaceChild(n, s) : e.insertBefore(n, r) : u && s.remove();
|
|
456
|
+
} else i = !0;
|
|
457
|
+
}
|
|
458
|
+
} else e.insertBefore(n, r);
|
|
459
|
+
return [n];
|
|
460
|
+
}
|
|
461
|
+
function Qe(e) {
|
|
462
|
+
return Object.keys(e).reduce((r, o) => {
|
|
463
|
+
const n = e[o];
|
|
464
|
+
return r[o] = Object.assign({}, n), Se(n.value) && !et(n.value) && !Array.isArray(n.value) && (r[o].value = Object.assign({}, n.value)), Array.isArray(n.value) && (r[o].value = n.value.slice(0)), r;
|
|
465
|
+
}, {});
|
|
466
|
+
}
|
|
467
|
+
function We(e) {
|
|
468
|
+
return e ? Object.keys(e).reduce((r, o) => {
|
|
469
|
+
const n = e[o];
|
|
470
|
+
return r[o] = Se(n) && "value" in n ? n : {
|
|
471
|
+
value: n
|
|
472
|
+
}, r[o].attribute || (r[o].attribute = Ye(o)), r[o].parse = "parse" in r[o] ? r[o].parse : typeof r[o].value != "string", r;
|
|
473
|
+
}, {}) : {};
|
|
474
|
+
}
|
|
475
|
+
function Ze(e) {
|
|
476
|
+
return Object.keys(e).reduce((r, o) => (r[o] = e[o].value, r), {});
|
|
477
|
+
}
|
|
478
|
+
function Xe(e, t) {
|
|
479
|
+
const r = Qe(t);
|
|
480
|
+
return Object.keys(t).forEach((n) => {
|
|
481
|
+
const i = r[n], l = e.getAttribute(i.attribute), s = e[n];
|
|
482
|
+
l != null && (i.value = i.parse ? xe(l) : l), s != null && (i.value = Array.isArray(s) ? s.slice(0) : s), i.reflect && fe(e, i.attribute, i.value, !!i.parse), Object.defineProperty(e, n, {
|
|
483
|
+
get() {
|
|
484
|
+
return i.value;
|
|
485
|
+
},
|
|
486
|
+
set(u) {
|
|
487
|
+
const p = i.value;
|
|
488
|
+
i.value = u, i.reflect && fe(this, i.attribute, i.value, !!i.parse);
|
|
489
|
+
for (let c = 0, a = this.__propertyChangedCallbacks.length; c < a; c++)
|
|
490
|
+
this.__propertyChangedCallbacks[c](n, u, p);
|
|
491
|
+
},
|
|
492
|
+
enumerable: !0,
|
|
493
|
+
configurable: !0
|
|
494
|
+
});
|
|
495
|
+
}), r;
|
|
496
|
+
}
|
|
497
|
+
function xe(e) {
|
|
498
|
+
if (e)
|
|
499
|
+
try {
|
|
500
|
+
return JSON.parse(e);
|
|
501
|
+
} catch {
|
|
502
|
+
return e;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
function fe(e, t, r, o) {
|
|
506
|
+
if (r == null || r === !1) return e.removeAttribute(t);
|
|
507
|
+
let n = o ? JSON.stringify(r) : r;
|
|
508
|
+
e.__updating[t] = !0, n === "true" && (n = ""), e.setAttribute(t, n), Promise.resolve().then(() => delete e.__updating[t]);
|
|
509
|
+
}
|
|
510
|
+
function Ye(e) {
|
|
511
|
+
return e.replace(/\.?([A-Z]+)/g, (t, r) => "-" + r.toLowerCase()).replace("_", "-").replace(/^-/, "");
|
|
512
|
+
}
|
|
513
|
+
function Se(e) {
|
|
514
|
+
return e != null && (typeof e == "object" || typeof e == "function");
|
|
515
|
+
}
|
|
516
|
+
function et(e) {
|
|
517
|
+
return Object.prototype.toString.call(e) === "[object Function]";
|
|
518
|
+
}
|
|
519
|
+
function tt(e) {
|
|
520
|
+
return typeof e == "function" && e.toString().indexOf("class") === 0;
|
|
521
|
+
}
|
|
522
|
+
let ie;
|
|
523
|
+
function rt(e, t) {
|
|
524
|
+
const r = Object.keys(t);
|
|
525
|
+
return class extends e {
|
|
526
|
+
static get observedAttributes() {
|
|
527
|
+
return r.map((n) => t[n].attribute);
|
|
528
|
+
}
|
|
529
|
+
constructor() {
|
|
530
|
+
super(), this.__initialized = !1, this.__released = !1, this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = {};
|
|
531
|
+
for (let n of r)
|
|
532
|
+
this[n] = void 0;
|
|
533
|
+
}
|
|
534
|
+
connectedCallback() {
|
|
535
|
+
if (this.__initialized) return;
|
|
536
|
+
this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = Xe(this, t);
|
|
537
|
+
const n = Ze(this.props), i = this.Component, l = ie;
|
|
538
|
+
try {
|
|
539
|
+
ie = this, this.__initialized = !0, tt(i) ? new i(n, {
|
|
540
|
+
element: this
|
|
541
|
+
}) : i(n, {
|
|
542
|
+
element: this
|
|
543
|
+
});
|
|
544
|
+
} finally {
|
|
545
|
+
ie = l;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
async disconnectedCallback() {
|
|
549
|
+
if (await Promise.resolve(), this.isConnected) return;
|
|
550
|
+
this.__propertyChangedCallbacks.length = 0;
|
|
551
|
+
let n = null;
|
|
552
|
+
for (; n = this.__releaseCallbacks.pop(); ) n(this);
|
|
553
|
+
delete this.__initialized, this.__released = !0;
|
|
554
|
+
}
|
|
555
|
+
attributeChangedCallback(n, i, l) {
|
|
556
|
+
if (this.__initialized && !this.__updating[n] && (n = this.lookupProp(n), n in t)) {
|
|
557
|
+
if (l == null && !this[n]) return;
|
|
558
|
+
this[n] = t[n].parse ? xe(l) : l;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
lookupProp(n) {
|
|
562
|
+
if (t)
|
|
563
|
+
return r.find((i) => n === i || n === t[i].attribute);
|
|
564
|
+
}
|
|
565
|
+
get renderRoot() {
|
|
566
|
+
return this.shadowRoot || this.attachShadow({
|
|
567
|
+
mode: "open"
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
addReleaseCallback(n) {
|
|
571
|
+
this.__releaseCallbacks.push(n);
|
|
572
|
+
}
|
|
573
|
+
addPropertyChangedCallback(n) {
|
|
574
|
+
this.__propertyChangedCallbacks.push(n);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
function ot(e, t = {}, r = {}) {
|
|
579
|
+
const {
|
|
580
|
+
BaseElement: o = HTMLElement,
|
|
581
|
+
extension: n,
|
|
582
|
+
customElements: i = window.customElements
|
|
583
|
+
} = r;
|
|
584
|
+
return (l) => {
|
|
585
|
+
let s = i.get(e);
|
|
586
|
+
return s ? (s.prototype.Component = l, s) : (s = rt(o, We(t)), s.prototype.Component = l, s.prototype.registeredTag = e, i.define(e, s, n), s);
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
function nt(e) {
|
|
590
|
+
const t = Object.keys(e), r = {};
|
|
591
|
+
for (let o = 0; o < t.length; o++) {
|
|
592
|
+
const [n, i] = x(e[t[o]]);
|
|
593
|
+
Object.defineProperty(r, t[o], {
|
|
594
|
+
get: n,
|
|
595
|
+
set(l) {
|
|
596
|
+
i(() => l);
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
return r;
|
|
601
|
+
}
|
|
602
|
+
function it(e) {
|
|
603
|
+
if (e.assignedSlot && e.assignedSlot._$owner) return e.assignedSlot._$owner;
|
|
604
|
+
let t = e.parentNode;
|
|
605
|
+
for (; t && !t._$owner && !(t.assignedSlot && t.assignedSlot._$owner); )
|
|
606
|
+
t = t.parentNode;
|
|
607
|
+
return t && t.assignedSlot ? t.assignedSlot._$owner : e._$owner;
|
|
608
|
+
}
|
|
609
|
+
function st(e) {
|
|
610
|
+
return (t, r) => {
|
|
611
|
+
const { element: o } = r;
|
|
612
|
+
return W((n) => {
|
|
613
|
+
const i = nt(t);
|
|
614
|
+
o.addPropertyChangedCallback((s, u) => i[s] = u), o.addReleaseCallback(() => {
|
|
615
|
+
o.renderRoot.textContent = "", n();
|
|
616
|
+
});
|
|
617
|
+
const l = e(i, r);
|
|
618
|
+
return w(o.renderRoot, l);
|
|
619
|
+
}, it(o));
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
function lt(e, t, r) {
|
|
623
|
+
return arguments.length === 2 && (r = t, t = {}), ot(e, t)(st(r));
|
|
624
|
+
}
|
|
625
|
+
const Ce = Te();
|
|
626
|
+
function at(e) {
|
|
627
|
+
const [t, r] = x([]), [o, n] = x(), [i, l] = x([]), [s, u] = x(), [p, c] = x(!1), [a, k] = x(!1), [S, $] = x(!1), [E, B] = x(!1), [L, C] = x(!1), [A, m] = x("no-url"), M = (d) => {
|
|
628
|
+
e.moqPublish.source.set(d), e.moqPublish.invisible.set(!1), e.moqPublish.muted.set(!0);
|
|
629
|
+
}, oe = {
|
|
630
|
+
moqPublish: e.moqPublish,
|
|
631
|
+
cameraDevices: t,
|
|
632
|
+
microphoneDevices: i,
|
|
633
|
+
publishStatus: A,
|
|
634
|
+
cameraActive: p,
|
|
635
|
+
screenActive: a,
|
|
636
|
+
microphoneActive: S,
|
|
637
|
+
fileActive: E,
|
|
638
|
+
setFile: M,
|
|
639
|
+
nothingActive: L,
|
|
640
|
+
selectedCameraSource: o,
|
|
641
|
+
selectedMicrophoneSource: s
|
|
642
|
+
};
|
|
643
|
+
return be(() => {
|
|
644
|
+
const d = e.moqPublish;
|
|
645
|
+
d.muted.set(!0), d.invisible.set(!0), d.source.set(void 0), d.signals.effect((h) => {
|
|
646
|
+
const b = () => r([]), _ = h.get(d.video);
|
|
647
|
+
if (!_ || !("device" in _)) {
|
|
648
|
+
b();
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
const N = h.get(_.device.available);
|
|
652
|
+
if (!N || N.length < 2) {
|
|
653
|
+
b();
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
r(N);
|
|
657
|
+
}), d.signals.effect((h) => {
|
|
658
|
+
const b = () => l([]), _ = h.get(d.audio);
|
|
659
|
+
if (!_ || !("device" in _)) {
|
|
660
|
+
b();
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
if (!h.get(d.broadcast.audio.enabled)) {
|
|
664
|
+
b();
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
const K = h.get(_.device.available);
|
|
668
|
+
if (!K || K.length < 2) {
|
|
669
|
+
b();
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
l(K);
|
|
673
|
+
}), d.signals.effect((h) => {
|
|
674
|
+
const b = h.get(d.source), _ = h.get(d.muted), N = h.get(d.invisible);
|
|
675
|
+
C(b === void 0 && _ && N);
|
|
676
|
+
}), d.signals.effect((h) => {
|
|
677
|
+
const b = !h.get(d.muted);
|
|
678
|
+
$(b);
|
|
679
|
+
}), d.signals.effect((h) => {
|
|
680
|
+
const b = h.get(d.source), _ = h.get(d.video);
|
|
681
|
+
_ && b === "camera" ? (c(!0), k(!1)) : _ && b === "screen" ? (k(!0), c(!1)) : (c(!1), k(!1));
|
|
682
|
+
}), d.signals.effect((h) => {
|
|
683
|
+
const b = h.get(d.video);
|
|
684
|
+
if (!b || !("device" in b)) return;
|
|
685
|
+
const _ = h.get(b.device.requested);
|
|
686
|
+
n(_);
|
|
687
|
+
}), d.signals.effect((h) => {
|
|
688
|
+
const b = h.get(d.audio);
|
|
689
|
+
if (!b || !("device" in b)) return;
|
|
690
|
+
const _ = h.get(b.device.requested);
|
|
691
|
+
u(_);
|
|
692
|
+
}), d.signals.effect((h) => {
|
|
693
|
+
const b = h.get(d.connection.url), _ = h.get(d.connection.status), N = h.get(d.broadcast.audio.source), K = h.get(d.broadcast.video.source), ke = h.get(d.muted), Pe = h.get(d.invisible), J = N && !ke, Q = K && !Pe;
|
|
694
|
+
b ? _ === "disconnected" ? m("disconnected") : _ === "connecting" ? m("connecting") : !J && !Q ? m("select-source") : !J && Q ? m("video-only") : J && !Q ? m("audio-only") : J && Q && m("live") : m("no-url");
|
|
695
|
+
}), d.signals.effect((h) => {
|
|
696
|
+
const b = h.get(d.source);
|
|
697
|
+
B(b instanceof File);
|
|
698
|
+
});
|
|
699
|
+
}), f(Ce.Provider, {
|
|
700
|
+
value: oe,
|
|
701
|
+
get children() {
|
|
702
|
+
return e.children;
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
function z() {
|
|
707
|
+
const e = je(Ce);
|
|
708
|
+
if (!e)
|
|
709
|
+
throw new Error("usePublishUIContext must be used within a PublishUIContextProvider");
|
|
710
|
+
return e;
|
|
711
|
+
}
|
|
712
|
+
var ct = /* @__PURE__ */ P("<select class=publish-ui__media-selector-dropdown>"), ut = /* @__PURE__ */ P('<div class="publish-ui__media-selector-wrapper flex--center">'), dt = /* @__PURE__ */ P("<option>");
|
|
713
|
+
function Ae(e) {
|
|
714
|
+
const [t, r] = x(!1), o = () => r((n) => !n);
|
|
715
|
+
return (() => {
|
|
716
|
+
var n = ut();
|
|
717
|
+
return w(n, f(R, {
|
|
718
|
+
onClick: o,
|
|
719
|
+
class: "publish-ui__media-selector-toggle button",
|
|
720
|
+
get title() {
|
|
721
|
+
return t() ? "Hide Sources" : "Show Sources";
|
|
722
|
+
},
|
|
723
|
+
get children() {
|
|
724
|
+
return f(V, {
|
|
725
|
+
get when() {
|
|
726
|
+
return t();
|
|
727
|
+
},
|
|
728
|
+
get fallback() {
|
|
729
|
+
return f(j.ArrowDown, {});
|
|
730
|
+
},
|
|
731
|
+
get children() {
|
|
732
|
+
return f(j.ArrowUp, {});
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
}), null), w(n, f(V, {
|
|
737
|
+
get when() {
|
|
738
|
+
return t();
|
|
739
|
+
},
|
|
740
|
+
get children() {
|
|
741
|
+
var i = ct();
|
|
742
|
+
return i.addEventListener("change", (l) => {
|
|
743
|
+
e.onSelected?.(l.currentTarget.value), r(!1);
|
|
744
|
+
}), w(i, f(He, {
|
|
745
|
+
get each() {
|
|
746
|
+
return e.sources;
|
|
747
|
+
},
|
|
748
|
+
children: (l) => (() => {
|
|
749
|
+
var s = dt();
|
|
750
|
+
return w(s, () => l.label), U(() => s.value = l.deviceId), s;
|
|
751
|
+
})()
|
|
752
|
+
})), U(() => i.value = e.selectedSource), i;
|
|
753
|
+
}
|
|
754
|
+
}), null), n;
|
|
755
|
+
})();
|
|
756
|
+
}
|
|
757
|
+
var ft = /* @__PURE__ */ P('<div class="publish-ui__source-button-wrapper flex--center">');
|
|
758
|
+
function ht() {
|
|
759
|
+
const e = z(), t = () => {
|
|
760
|
+
e.moqPublish.source.peek() === "camera" ? e.moqPublish.invisible.update((o) => !o) : (e.moqPublish.source.set("camera"), e.moqPublish.invisible.set(!1));
|
|
761
|
+
}, r = (o) => {
|
|
762
|
+
const n = e.moqPublish.video.peek();
|
|
763
|
+
!n || !("device" in n) || n.device.preferred.set(o);
|
|
764
|
+
};
|
|
765
|
+
return (() => {
|
|
766
|
+
var o = ft();
|
|
767
|
+
return w(o, f(R, {
|
|
768
|
+
title: "Camera",
|
|
769
|
+
get class() {
|
|
770
|
+
return `publish-ui__source-button flex--center ${e.cameraActive() ? "publish-ui__source-button--active" : ""}`;
|
|
771
|
+
},
|
|
772
|
+
onClick: t,
|
|
773
|
+
get children() {
|
|
774
|
+
return f(j.Camera, {});
|
|
775
|
+
}
|
|
776
|
+
}), null), w(o, f(V, {
|
|
777
|
+
get when() {
|
|
778
|
+
return ye(() => !!e.cameraActive())() && e.cameraDevices().length;
|
|
779
|
+
},
|
|
780
|
+
get children() {
|
|
781
|
+
return f(Ae, {
|
|
782
|
+
get sources() {
|
|
783
|
+
return e.cameraDevices();
|
|
784
|
+
},
|
|
785
|
+
get selectedSource() {
|
|
786
|
+
return e.selectedCameraSource?.();
|
|
787
|
+
},
|
|
788
|
+
onSelected: r
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
}), null), o;
|
|
792
|
+
})();
|
|
793
|
+
}
|
|
794
|
+
var pt = /* @__PURE__ */ P("<input type=file accept=video/*,audio/*,image/* style=display:none>");
|
|
795
|
+
function bt() {
|
|
796
|
+
const [e, t] = x(), r = z(), o = () => e()?.click(), n = (i) => {
|
|
797
|
+
const l = i.target, s = l.files?.[0];
|
|
798
|
+
s && (r.setFile(s), l.value = "");
|
|
799
|
+
};
|
|
800
|
+
return [(() => {
|
|
801
|
+
var i = pt();
|
|
802
|
+
return i.addEventListener("change", n), Je(t, i), i;
|
|
803
|
+
})(), f(R, {
|
|
804
|
+
title: "Upload File",
|
|
805
|
+
get class() {
|
|
806
|
+
return `publish-ui__source-button flex--center ${r.fileActive() ? "publish-ui__source-button--active" : ""}`;
|
|
807
|
+
},
|
|
808
|
+
onClick: o,
|
|
809
|
+
get children() {
|
|
810
|
+
return f(j.File, {});
|
|
811
|
+
}
|
|
812
|
+
})];
|
|
813
|
+
}
|
|
814
|
+
var gt = /* @__PURE__ */ P('<div class="publish-ui__source-button-wrapper flex--center">');
|
|
815
|
+
function vt() {
|
|
816
|
+
const e = z(), t = () => {
|
|
817
|
+
e.moqPublish.source.peek() === "camera" ? e.moqPublish.muted.update((o) => !o) : (e.moqPublish.source.set("camera"), e.moqPublish.muted.set(!1));
|
|
818
|
+
}, r = (o) => {
|
|
819
|
+
const n = e.moqPublish.audio.peek();
|
|
820
|
+
!n || !("device" in n) || n.device.preferred.set(o);
|
|
821
|
+
};
|
|
822
|
+
return (() => {
|
|
823
|
+
var o = gt();
|
|
824
|
+
return w(o, f(R, {
|
|
825
|
+
title: "Microphone",
|
|
826
|
+
get class() {
|
|
827
|
+
return `publish-ui__source-button flex--center ${e.microphoneActive() ? "publish-ui__source-button--active" : ""}`;
|
|
828
|
+
},
|
|
829
|
+
onClick: t,
|
|
830
|
+
get children() {
|
|
831
|
+
return f(j.Microphone, {});
|
|
832
|
+
}
|
|
833
|
+
}), null), w(o, f(V, {
|
|
834
|
+
get when() {
|
|
835
|
+
return ye(() => !!e.microphoneActive())() && e.microphoneDevices().length;
|
|
836
|
+
},
|
|
837
|
+
get children() {
|
|
838
|
+
return f(Ae, {
|
|
839
|
+
get sources() {
|
|
840
|
+
return e.microphoneDevices();
|
|
841
|
+
},
|
|
842
|
+
get selectedSource() {
|
|
843
|
+
return e.selectedMicrophoneSource?.();
|
|
844
|
+
},
|
|
845
|
+
onSelected: r
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
}), null), o;
|
|
849
|
+
})();
|
|
850
|
+
}
|
|
851
|
+
function _t() {
|
|
852
|
+
const e = z();
|
|
853
|
+
return f(R, {
|
|
854
|
+
title: "No Source",
|
|
855
|
+
get class() {
|
|
856
|
+
return `publish-ui__source-button flex--center publish-ui__source-button--no-source ${e.nothingActive() ? "publish-ui__source-button--no-source-active" : ""}`;
|
|
857
|
+
},
|
|
858
|
+
onClick: () => {
|
|
859
|
+
e.moqPublish.source.set(void 0), e.moqPublish.muted.set(!0), e.moqPublish.invisible.set(!0);
|
|
860
|
+
},
|
|
861
|
+
get children() {
|
|
862
|
+
return f(j.Ban, {});
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
var mt = /* @__PURE__ */ P('<div class="publish-ui__status-indicator flex--center"><span></span><span>');
|
|
867
|
+
const wt = {
|
|
868
|
+
"no-url": {
|
|
869
|
+
variant: "error",
|
|
870
|
+
text: "No URL"
|
|
871
|
+
},
|
|
872
|
+
disconnected: {
|
|
873
|
+
variant: "error",
|
|
874
|
+
text: "Disconnected"
|
|
875
|
+
},
|
|
876
|
+
connecting: {
|
|
877
|
+
variant: "connecting",
|
|
878
|
+
text: "Connecting..."
|
|
879
|
+
},
|
|
880
|
+
"select-source": {
|
|
881
|
+
variant: "warning",
|
|
882
|
+
text: "Select Source"
|
|
883
|
+
},
|
|
884
|
+
"video-only": {
|
|
885
|
+
variant: "video-only",
|
|
886
|
+
text: "Video Only"
|
|
887
|
+
},
|
|
888
|
+
"audio-only": {
|
|
889
|
+
variant: "audio-only",
|
|
890
|
+
text: "Audio Only"
|
|
891
|
+
},
|
|
892
|
+
live: {
|
|
893
|
+
variant: "live",
|
|
894
|
+
text: "Live"
|
|
895
|
+
}
|
|
896
|
+
}, yt = {
|
|
897
|
+
variant: "error",
|
|
898
|
+
text: "Unknown"
|
|
899
|
+
};
|
|
900
|
+
function xt() {
|
|
901
|
+
const e = z(), t = () => {
|
|
902
|
+
const r = e.publishStatus();
|
|
903
|
+
return wt[r] || yt;
|
|
904
|
+
};
|
|
905
|
+
return (() => {
|
|
906
|
+
var r = mt(), o = r.firstChild, n = o.nextSibling;
|
|
907
|
+
return w(n, () => t().text), U((i) => {
|
|
908
|
+
var l = `publish-ui__status-indicator-dot publish-ui__status-indicator-dot--${t().variant}`, s = `publish-ui__status-indicator-text publish-ui__status-indicator-text--${t().variant}`;
|
|
909
|
+
return l !== i.e && ue(o, i.e = l), s !== i.t && ue(n, i.t = s), i;
|
|
910
|
+
}, {
|
|
911
|
+
e: void 0,
|
|
912
|
+
t: void 0
|
|
913
|
+
}), r;
|
|
914
|
+
})();
|
|
915
|
+
}
|
|
916
|
+
function St() {
|
|
917
|
+
const e = z();
|
|
918
|
+
return f(R, {
|
|
919
|
+
title: "Screen",
|
|
920
|
+
get class() {
|
|
921
|
+
return `publish-ui__source-button flex--center ${e.screenActive() ? "publish-ui__source-button--active" : ""}`;
|
|
922
|
+
},
|
|
923
|
+
onClick: () => {
|
|
924
|
+
e.moqPublish.source.set("screen"), e.moqPublish.invisible.set(!1), e.moqPublish.muted.set(!0);
|
|
925
|
+
},
|
|
926
|
+
get children() {
|
|
927
|
+
return f(j.Screen, {});
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
var Ct = /* @__PURE__ */ P('<div class="publish-ui__controls flex--center flex--space-between"><div class="publish-ui__source-selector flex--center"><span class=publish-ui__source-label>Source:');
|
|
932
|
+
function At() {
|
|
933
|
+
return (() => {
|
|
934
|
+
var e = Ct(), t = e.firstChild;
|
|
935
|
+
return t.firstChild, w(t, f(vt, {}), null), w(t, f(ht, {}), null), w(t, f(St, {}), null), w(t, f(bt, {}), null), w(t, f(_t, {}), null), w(e, f(xt, {}), null), e;
|
|
936
|
+
})();
|
|
937
|
+
}
|
|
938
|
+
const kt = ':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-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-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-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-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-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)}.publish-ui__controls{gap:var(--spacing-16);margin:var(--spacing-8) 0;border-radius:var(--border-radius-lg);border:var(--spacing-1) solid var(--color-white-alpha-10);padding:var(--spacing-16)}.publish-ui__source-label{font-size:1rem;font-weight:600;letter-spacing:.1rem;color:var(--color-white-alpha-90)}.publish-ui__source-selector{gap:var(--spacing-16)}.publish-ui__source-button-wrapper{position:relative}.publish-ui__source-button{width:44px;height:44px;border-radius:var(--border-radius-md);background:var(--color-white-alpha-05);backdrop-filter:blur(6px);border:var(--spacing-1) solid var(--color-white-alpha-10);transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .15s ease}.publish-ui__source-button:hover{border-color:var(--color-white-alpha-20)}.publish-ui__source-button svg{color:var(--color-white-alpha-70);transition:color .2s ease;position:relative;z-index:1}.publish-ui__source-button--active{background:linear-gradient(135deg,var(--color-orange-500-alpha-30),var(--color-amber-600-alpha-30));border:var(--spacing-1) solid var(--color-orange-500-alpha-50);box-shadow:0 0 24px var(--color-orange-500-alpha-40)}.publish-ui__source-button--active svg{color:var(--color-orange-300)}.publish-ui__source-button--active:before{content:"";position:absolute;inset:0;border-radius:var(--border-radius-md);background:linear-gradient(135deg,var(--color-orange-400-alpha-20),var(--color-amber-600-alpha-20));filter:blur(16px);z-index:0}.publish-ui__source-button--no-source{background:var(--color-white-alpha-05);border:var(--spacing-1) solid var(--color-white-alpha-10)}.publish-ui__source-button--no-source svg{color:var(--color-white-alpha-50)}.publish-ui__source-button--no-source-active{background:linear-gradient(135deg,var(--color-red-500-alpha-25),var(--color-red-900-alpha-35));border:var(--spacing-1) solid var(--color-red-500-alpha-60);box-shadow:0 0 18px var(--color-red-500-alpha-45)}.publish-ui__source-button--no-source-active svg{color:var(--color-red-300)}.publish-ui__source-button--no-source-active:before{content:"";position:absolute;inset:0;border-radius:var(--border-radius-md);background:linear-gradient(135deg,var(--color-red-400-alpha-25),var(--color-red-600-alpha-25));filter:blur(16px);z-index:0}.publish-ui__media-selector-wrapper{position:relative;gap:var(--spacing-8)}.publish-ui__media-selector-toggle{font-size:.75rem;cursor:pointer}.publish-ui__media-selector-toggle.button,.publish-ui__media-selector-toggle.button:hover:not(:disabled){background-color:unset;box-shadow:none;border:unset}.publish-ui__media-selector-dropdown{position:absolute;top:var(--spacing-48);right:var(--spacing-8);padding:var(--spacing-12) var(--spacing-16);background:var(--color-black-alpha-85);border:var(--spacing-1) solid var(--color-white-alpha-10);border-radius:var(--border-radius-sm);color:var(--color-white);cursor:pointer;z-index:1;outline:none;box-shadow:none}.publish-ui__status-indicator{gap:var(--spacing-12);padding:var(--spacing-12) var(--spacing-24);border-radius:12px;background:var(--color-black-alpha-60);backdrop-filter:blur(16px);border:var(--spacing-1) solid var(--color-white-alpha-10)}.publish-ui__status-indicator-dot{position:relative;width:12px;height:12px;border-radius:50%;flex-shrink:0;z-index:1}.publish-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}.publish-ui__status-indicator-dot:after{display:none}.publish-ui__status-indicator-dot--live:after,.publish-ui__status-indicator-dot--warning:after,.publish-ui__status-indicator-dot--connecting:after,.publish-ui__status-indicator-dot--audio-only:after,.publish-ui__status-indicator-dot--video-only:after{display:block}.publish-ui__status-indicator-dot--error{background:var(--color-gray-100);color:var(--color-gray-100)}.publish-ui__status-indicator-text--error{color:var(--color-gray-100)}.publish-ui__status-indicator-dot--warning{background:var(--color-yellow-400);color:var(--color-yellow-400)}.publish-ui__status-indicator-text--warning{color:var(--color-yellow-400)}.publish-ui__status-indicator-dot--live{background:var(--color-green-400);color:var(--color-green-400)}.publish-ui__status-indicator-text--live{color:var(--color-green-400)}.publish-ui__status-indicator-dot--audio-only{background:var(--color-blue-500);color:var(--color-blue-500)}.publish-ui__status-indicator-text--audio-only{color:var(--color-blue-500)}.publish-ui__status-indicator-dot--video-only{background:var(--color-purple-500);color:var(--color-purple-500)}.publish-ui__status-indicator-text--video-only{color:var(--color-purple-500)}.publish-ui__status-indicator-dot--connecting{background:var(--color-gray-100);color:var(--color-gray-100)}.publish-ui__status-indicator-text--connecting{color:var(--color-gray-100)}.publish-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}}';
|
|
939
|
+
var Pt = /* @__PURE__ */ P("<style>"), $t = /* @__PURE__ */ P("<slot>");
|
|
940
|
+
function Et(e) {
|
|
941
|
+
return [(() => {
|
|
942
|
+
var t = Pt();
|
|
943
|
+
return w(t, kt), t;
|
|
944
|
+
})(), (() => {
|
|
945
|
+
var t = $t();
|
|
946
|
+
return t._$owner = Ie(), t;
|
|
947
|
+
})(), f(at, {
|
|
948
|
+
get moqPublish() {
|
|
949
|
+
return e.publish;
|
|
950
|
+
},
|
|
951
|
+
get children() {
|
|
952
|
+
return f(At, {});
|
|
953
|
+
}
|
|
954
|
+
})];
|
|
955
|
+
}
|
|
956
|
+
lt("moq-publish-ui", (e, {
|
|
957
|
+
element: t
|
|
958
|
+
}) => {
|
|
959
|
+
const [r, o] = x();
|
|
960
|
+
return Me(async () => {
|
|
961
|
+
await customElements.whenDefined("moq-publish");
|
|
962
|
+
const n = t.querySelector("moq-publish");
|
|
963
|
+
o(n || void 0);
|
|
964
|
+
}), f(V, {
|
|
965
|
+
get when() {
|
|
966
|
+
return r();
|
|
967
|
+
},
|
|
968
|
+
keyed: !0,
|
|
969
|
+
children: (n) => f(Et, {
|
|
970
|
+
publish: n
|
|
971
|
+
})
|
|
972
|
+
});
|
|
973
|
+
});
|
|
974
|
+
//# sourceMappingURL=index.js.map
|