@ikonai/sdk-react-ui 1.0.20 → 1.0.21
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/index.js +341 -333
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IkonUiCore as kt, UiStreamStore as Ct } from "@ikonai/sdk-ui";
|
|
2
|
-
import { UiStreamStore as
|
|
2
|
+
import { UiStreamStore as Co } from "@ikonai/sdk-ui";
|
|
3
3
|
import It, { useSyncExternalStore as Ue, useMemo as K, memo as z, useRef as A, useCallback as x, Fragment as Ot, useEffect as M, useState as W, createContext as lt, use as xe } from "react";
|
|
4
|
-
import { createLogger as ge, getOrCreateDeviceId as _t, deriveAuthUrl as Oe, parseUrlParams as Nt, clearSessionParamsFromUrl as Pt, isCloudEnvironment as Ke, deriveBackendType as Ye, IkonClient as
|
|
4
|
+
import { createLogger as ge, getOrCreateDeviceId as _t, deriveAuthUrl as Oe, parseUrlParams as Nt, clearSessionParamsFromUrl as Pt, isCloudEnvironment as Ke, extractUserIdFromToken as jt, deriveBackendType as Ye, IkonClient as Lt, subscribeToLogEvents as Mt, isDebugModeEnabled as Ut, LogLevel as We } from "@ikonai/sdk";
|
|
5
5
|
var de = { exports: {} }, oe = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
@@ -13,7 +13,7 @@ var de = { exports: {} }, oe = {};
|
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
15
|
var ze;
|
|
16
|
-
function
|
|
16
|
+
function xt() {
|
|
17
17
|
if (ze) return oe;
|
|
18
18
|
ze = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
@@ -45,7 +45,7 @@ var se = {};
|
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
47
|
var qe;
|
|
48
|
-
function
|
|
48
|
+
function Dt() {
|
|
49
49
|
return qe || (qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(l) {
|
|
51
51
|
if (l == null) return null;
|
|
@@ -79,7 +79,7 @@ function xt() {
|
|
|
79
79
|
case _:
|
|
80
80
|
var b = l.render;
|
|
81
81
|
return l = l.displayName, l || (l = b.displayName || b.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
|
|
82
|
-
case
|
|
82
|
+
case Z:
|
|
83
83
|
return b = l.displayName || null, b !== null ? b : t(l.type) || "Memo";
|
|
84
84
|
case C:
|
|
85
85
|
b = l._payload, l = l._init;
|
|
@@ -149,7 +149,7 @@ function xt() {
|
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
151
|
var l = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return H[l] || (H[l] = !0, console.error(
|
|
153
153
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
154
154
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
155
155
|
}
|
|
@@ -238,7 +238,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
function h(l) {
|
|
239
239
|
typeof l == "object" && l !== null && l.$$typeof === g && l._store && (l._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var u = It, g = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"),
|
|
241
|
+
var u = It, g = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), O = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, Y = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
u = {
|
|
@@ -246,10 +246,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
return l();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var B,
|
|
249
|
+
var B, H = {}, X = u["react-stack-bottom-frame"].bind(
|
|
250
250
|
u,
|
|
251
251
|
s
|
|
252
|
-
)(), ee =
|
|
252
|
+
)(), ee = Q(n(s)), te = {};
|
|
253
253
|
se.Fragment = S, se.jsx = function(l, b, k, N, E) {
|
|
254
254
|
var I = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return d(
|
|
@@ -259,8 +259,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
259
259
|
!1,
|
|
260
260
|
N,
|
|
261
261
|
E,
|
|
262
|
-
I ? Error("react-stack-top-frame") :
|
|
263
|
-
I ?
|
|
262
|
+
I ? Error("react-stack-top-frame") : X,
|
|
263
|
+
I ? Q(n(l)) : ee
|
|
264
264
|
);
|
|
265
265
|
}, se.jsxs = function(l, b, k, N, E) {
|
|
266
266
|
var I = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
@@ -271,18 +271,18 @@ React keys must be passed directly to JSX without using spread:
|
|
|
271
271
|
!0,
|
|
272
272
|
N,
|
|
273
273
|
E,
|
|
274
|
-
I ? Error("react-stack-top-frame") :
|
|
275
|
-
I ?
|
|
274
|
+
I ? Error("react-stack-top-frame") : X,
|
|
275
|
+
I ? Q(n(l)) : ee
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
}()), se;
|
|
279
279
|
}
|
|
280
280
|
var Ge;
|
|
281
|
-
function
|
|
282
|
-
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? de.exports =
|
|
281
|
+
function Ft() {
|
|
282
|
+
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? de.exports = xt() : de.exports = Dt()), de.exports;
|
|
283
283
|
}
|
|
284
|
-
var R =
|
|
285
|
-
function
|
|
284
|
+
var R = Ft();
|
|
285
|
+
function Bt(t, e) {
|
|
286
286
|
const r = Ue(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
@@ -302,7 +302,7 @@ function Ft(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function J(t, e) {
|
|
306
306
|
const r = Ue(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
@@ -310,8 +310,8 @@ function H(t, e) {
|
|
|
310
310
|
);
|
|
311
311
|
return K(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const $t = ge("UIRenderer");
|
|
314
|
+
function Vt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,18 +322,18 @@ function $t(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Kt(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Yt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Wt(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function zt(t) {
|
|
337
337
|
if (t.length === 0) return "";
|
|
338
338
|
if (t.length === 1) return t[0].id;
|
|
339
339
|
let e = t[0].id;
|
|
@@ -342,7 +342,7 @@ function Wt(t) {
|
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
344
|
const _e = z(function t({ nodeId: e, context: r }) {
|
|
345
|
-
const n =
|
|
345
|
+
const n = J(r.store, e), o = n ? Yt(n) : [], s = zt(o), i = K(
|
|
346
346
|
() => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ R.jsx(t, { nodeId: h.id, context: r }, h.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
@@ -353,18 +353,18 @@ const _e = z(function t({ nodeId: e, context: r }) {
|
|
|
353
353
|
return /* @__PURE__ */ R.jsx(Ot, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
|
-
return
|
|
357
|
-
const c =
|
|
356
|
+
return $t.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = Kt(n), f = c.length > 0 ? c.join(" ") : void 0, d = a;
|
|
358
358
|
return /* @__PURE__ */ R.jsx(d, { nodeId: e, context: r, className: f });
|
|
359
|
-
},
|
|
360
|
-
function
|
|
359
|
+
}, Wt);
|
|
360
|
+
function qt(t, e) {
|
|
361
361
|
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(_e, { nodeId: r.id, context: e }, r.id));
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Gt(t, e) {
|
|
364
364
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
const { rootViewId: c, rootNodeId: f } =
|
|
366
|
+
const Ht = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Bt(e, n), d = A(s);
|
|
368
368
|
d.current = s;
|
|
369
369
|
const h = A(i);
|
|
370
370
|
h.current = i;
|
|
@@ -373,7 +373,7 @@ const Gt = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
373
373
|
const g = x((S, m) => {
|
|
374
374
|
if (!S)
|
|
375
375
|
return;
|
|
376
|
-
const p =
|
|
376
|
+
const p = Vt(m);
|
|
377
377
|
d.current?.(S, p);
|
|
378
378
|
}, []), y = K(() => {
|
|
379
379
|
const S = {
|
|
@@ -382,7 +382,7 @@ const Gt = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
382
382
|
handlerCache: e.handlerCache,
|
|
383
383
|
// Access payloads from store at call time, not captured snapshot
|
|
384
384
|
getPayload: (m) => e.getSnapshot().payloads.get(m),
|
|
385
|
-
renderChildren: (m) =>
|
|
385
|
+
renderChildren: (m) => qt(m, S),
|
|
386
386
|
renderView: (m) => {
|
|
387
387
|
const p = e.getSnapshot().views.get(m);
|
|
388
388
|
return p ? /* @__PURE__ */ R.jsx(_e, { nodeId: p.id, context: S }) : null;
|
|
@@ -399,8 +399,8 @@ const Gt = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
399
399
|
return S;
|
|
400
400
|
}, [e, r, g]);
|
|
401
401
|
return !c || !f ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(_e, { nodeId: f, context: y }) });
|
|
402
|
-
},
|
|
403
|
-
class
|
|
402
|
+
}, Gt);
|
|
403
|
+
class Jt {
|
|
404
404
|
constructor(e, r) {
|
|
405
405
|
if (this.fallback = r, e)
|
|
406
406
|
for (const [n, o] of e)
|
|
@@ -417,11 +417,11 @@ class Ht {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function ao(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
|
-
return new
|
|
422
|
+
return new Jt(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function co(t) {
|
|
425
425
|
return Ue(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
@@ -429,10 +429,10 @@ function ao(t) {
|
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
const Ne = "ikon-ui";
|
|
432
|
-
function
|
|
432
|
+
function Xt(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
435
|
+
const uo = z(function({ stores: e, registry: r, category: n = Ne, onAction: o, client: s }) {
|
|
436
436
|
const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = A(o);
|
|
437
437
|
a.current = o;
|
|
438
438
|
const c = A(s);
|
|
@@ -442,16 +442,16 @@ const co = z(function({ stores: e, registry: r, category: n = Ne, onAction: o, c
|
|
|
442
442
|
const d = [];
|
|
443
443
|
for (const [h, u] of e) {
|
|
444
444
|
const g = u.store.getSnapshot();
|
|
445
|
-
|
|
445
|
+
Xt(u.category, n) && (!g.rootViewId || !g.views.has(g.rootViewId) || d.push({ key: h, store: u.store }));
|
|
446
446
|
}
|
|
447
447
|
return d;
|
|
448
448
|
},
|
|
449
449
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
450
450
|
[e, n, i]
|
|
451
451
|
);
|
|
452
|
-
return f.length === 0 ? null : /* @__PURE__ */ R.jsx(R.Fragment, { children: f.map(({ key: d, store: h }) => /* @__PURE__ */ R.jsx(
|
|
452
|
+
return f.length === 0 ? null : /* @__PURE__ */ R.jsx(R.Fragment, { children: f.map(({ key: d, store: h }) => /* @__PURE__ */ R.jsx(Ht, { store: h, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, d)) });
|
|
453
453
|
});
|
|
454
|
-
class
|
|
454
|
+
class Zt {
|
|
455
455
|
core;
|
|
456
456
|
ownsCore;
|
|
457
457
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -526,7 +526,7 @@ class Xt {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function Qt(t) {
|
|
530
530
|
if (typeof t == "string") {
|
|
531
531
|
const e = t.trim();
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
@@ -551,10 +551,10 @@ function De(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const He = /* @__PURE__ */ new WeakMap(),
|
|
554
|
+
const He = /* @__PURE__ */ new WeakMap(), er = {};
|
|
555
555
|
function Fe(t) {
|
|
556
556
|
if (!t)
|
|
557
|
-
return
|
|
557
|
+
return er;
|
|
558
558
|
const e = He.get(t);
|
|
559
559
|
if (e)
|
|
560
560
|
return e;
|
|
@@ -563,9 +563,9 @@ function Fe(t) {
|
|
|
563
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
564
564
|
return He.set(t, r), r;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function tr() {
|
|
567
567
|
const t = z(function({ nodeId: r, context: n }) {
|
|
568
|
-
const o =
|
|
568
|
+
const o = J(n.store, r), s = A(null), i = le(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = le(o?.props?.key), d = o?.props?.preciseGeneratedAt;
|
|
569
569
|
return M(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
@@ -619,9 +619,9 @@ function er() {
|
|
|
619
619
|
return t;
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function rr() {
|
|
623
623
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
624
|
-
const s =
|
|
624
|
+
const s = J(n.store, r), i = Qt(s?.props?.onInvokeId), a = x(() => {
|
|
625
625
|
i && n.dispatchAction(i);
|
|
626
626
|
}, [i, n]);
|
|
627
627
|
if (!s)
|
|
@@ -646,9 +646,9 @@ function tr() {
|
|
|
646
646
|
return t;
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function nr() {
|
|
650
650
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
651
|
-
const s =
|
|
651
|
+
const s = J(n.store, r);
|
|
652
652
|
if (!s)
|
|
653
653
|
return null;
|
|
654
654
|
const i = Fe(s.props), a = De("relative", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
@@ -659,9 +659,9 @@ function rr() {
|
|
|
659
659
|
return t;
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function or() {
|
|
663
663
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
664
|
-
const s =
|
|
664
|
+
const s = J(n.store, r);
|
|
665
665
|
if (!s)
|
|
666
666
|
return null;
|
|
667
667
|
const i = Fe(s.props), a = De("absolute", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
@@ -672,19 +672,19 @@ function nr() {
|
|
|
672
672
|
return t;
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function sr() {
|
|
676
676
|
return [
|
|
677
|
-
tr(),
|
|
678
677
|
rr(),
|
|
679
678
|
nr(),
|
|
680
|
-
|
|
679
|
+
or(),
|
|
680
|
+
tr()
|
|
681
681
|
];
|
|
682
682
|
}
|
|
683
|
-
const
|
|
684
|
-
function ar(t) {
|
|
685
|
-
t.registerModule(sr, ir);
|
|
686
|
-
}
|
|
683
|
+
const ir = "base", ar = async () => sr();
|
|
687
684
|
function cr(t) {
|
|
685
|
+
t.registerModule(ir, ar);
|
|
686
|
+
}
|
|
687
|
+
function ur(t) {
|
|
688
688
|
if (typeof t == "string") {
|
|
689
689
|
const e = t.trim();
|
|
690
690
|
return e.length > 0 ? e : void 0;
|
|
@@ -694,7 +694,7 @@ function cr(t) {
|
|
|
694
694
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function lr(...t) {
|
|
698
698
|
const e = [];
|
|
699
699
|
for (const r of t)
|
|
700
700
|
r && r.trim() && e.push(r.trim());
|
|
@@ -715,17 +715,17 @@ function fe(t) {
|
|
|
715
715
|
if (e === "false") return !1;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
const
|
|
719
|
-
function
|
|
718
|
+
const dr = "std.audio-url-player";
|
|
719
|
+
function fr() {
|
|
720
720
|
const t = z(function({
|
|
721
721
|
nodeId: r,
|
|
722
722
|
context: n,
|
|
723
723
|
className: o
|
|
724
724
|
}) {
|
|
725
|
-
const s =
|
|
725
|
+
const s = J(n.store, r);
|
|
726
726
|
if (!s)
|
|
727
727
|
return null;
|
|
728
|
-
const i = ur(
|
|
728
|
+
const i = lr(ur(s.props?.className), o), a = Je(s.props?.src), c = Je(s.props?.preload), f = fe(s.props?.controls), d = fe(s.props?.autoplay), h = fe(s.props?.loop), u = fe(s.props?.muted);
|
|
729
729
|
return /* @__PURE__ */ R.jsx(
|
|
730
730
|
"audio",
|
|
731
731
|
{
|
|
@@ -741,7 +741,7 @@ function dr() {
|
|
|
741
741
|
);
|
|
742
742
|
});
|
|
743
743
|
return ({ type: e }) => {
|
|
744
|
-
if (e ===
|
|
744
|
+
if (e === dr)
|
|
745
745
|
return t;
|
|
746
746
|
};
|
|
747
747
|
}
|
|
@@ -776,10 +776,10 @@ function Pe(t) {
|
|
|
776
776
|
const e = t.trim();
|
|
777
777
|
return e.length > 0 ? e : void 0;
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
function
|
|
779
|
+
const hr = "std.video-canvas", mr = "std.video-url-player";
|
|
780
|
+
function pr() {
|
|
781
781
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
782
|
-
const s =
|
|
782
|
+
const s = J(n.store, r), i = A(null), a = A(null), c = n.video, f = n.client, d = f?.isWebRtcEnabled ? f.webRtcVideoStream : null, h = f?.isWebRtcEnabled ? f.webRtcScreenStream : null, u = s ? Pe(s.props?.streamId) : void 0, g = s ? he(s.props?.width) : void 0, y = s ? he(s.props?.height) : void 0, S = s ? ft(dt(s.props?.className), o) : o, m = u?.includes("screen") ? h : d;
|
|
783
783
|
return M(() => {
|
|
784
784
|
const p = i.current;
|
|
785
785
|
if (!(!c || !p || !u || m))
|
|
@@ -820,12 +820,12 @@ function mr() {
|
|
|
820
820
|
) : null;
|
|
821
821
|
});
|
|
822
822
|
return ({ type: e }) => {
|
|
823
|
-
if (e ===
|
|
823
|
+
if (e === hr)
|
|
824
824
|
return t;
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
return [
|
|
827
|
+
function gr() {
|
|
828
|
+
return [pr(), yr(), fr()];
|
|
829
829
|
}
|
|
830
830
|
function ie(t) {
|
|
831
831
|
if (typeof t == "boolean")
|
|
@@ -836,13 +836,13 @@ function ie(t) {
|
|
|
836
836
|
if (e === "false") return !1;
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function yr() {
|
|
840
840
|
const t = z(function({
|
|
841
841
|
nodeId: r,
|
|
842
842
|
context: n,
|
|
843
843
|
className: o
|
|
844
844
|
}) {
|
|
845
|
-
const s =
|
|
845
|
+
const s = J(n.store, r);
|
|
846
846
|
if (!s)
|
|
847
847
|
return null;
|
|
848
848
|
const i = ft(dt(s.props?.className), o), a = Pe(s.props?.src), c = Pe(s.props?.poster), f = ie(s.props?.controls), d = ie(s.props?.autoplay), h = ie(s.props?.loop), u = ie(s.props?.muted), g = ie(s.props?.playsInline), y = he(s.props?.width), S = he(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
@@ -865,27 +865,27 @@ function gr() {
|
|
|
865
865
|
);
|
|
866
866
|
});
|
|
867
867
|
return ({ type: e }) => {
|
|
868
|
-
if (e ===
|
|
868
|
+
if (e === mr)
|
|
869
869
|
return t;
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
|
-
const
|
|
873
|
-
function
|
|
874
|
-
t.registerModule(
|
|
872
|
+
const Sr = "media", br = async () => gr();
|
|
873
|
+
function wr(t) {
|
|
874
|
+
t.registerModule(Sr, br);
|
|
875
875
|
}
|
|
876
|
-
const
|
|
876
|
+
const vr = `#version 300 es
|
|
877
877
|
in vec4 a_position;
|
|
878
878
|
void main() {
|
|
879
879
|
gl_Position = a_position;
|
|
880
880
|
}
|
|
881
881
|
`;
|
|
882
|
-
function
|
|
882
|
+
function Rr(t, e) {
|
|
883
883
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function Er(t, e) {
|
|
886
886
|
const r = [];
|
|
887
887
|
for (const [n, o] of Object.entries(e)) {
|
|
888
|
-
if (
|
|
888
|
+
if (Rr(t, n))
|
|
889
889
|
continue;
|
|
890
890
|
let s;
|
|
891
891
|
switch (o.type) {
|
|
@@ -938,7 +938,7 @@ void main() {
|
|
|
938
938
|
}
|
|
939
939
|
`;
|
|
940
940
|
}
|
|
941
|
-
class
|
|
941
|
+
class Ar {
|
|
942
942
|
gl;
|
|
943
943
|
program = null;
|
|
944
944
|
positionBuffer = null;
|
|
@@ -974,10 +974,10 @@ class Er {
|
|
|
974
974
|
}
|
|
975
975
|
compile(e, r = {}) {
|
|
976
976
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
977
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
977
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, vr);
|
|
978
978
|
if (!o)
|
|
979
979
|
return !1;
|
|
980
|
-
const s =
|
|
980
|
+
const s = Er(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
981
981
|
if (!i)
|
|
982
982
|
return n.deleteShader(o), !1;
|
|
983
983
|
const a = n.createProgram();
|
|
@@ -1068,7 +1068,7 @@ class Er {
|
|
|
1068
1068
|
this.program && (e.deleteProgram(this.program), this.program = null), this.positionBuffer && (e.deleteBuffer(this.positionBuffer), this.positionBuffer = null), this.vao && (e.deleteVertexArray(this.vao), this.vao = null), this.uniformLocations.clear();
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function Tr(t) {
|
|
1072
1072
|
if (typeof t == "string") {
|
|
1073
1073
|
const e = t.trim();
|
|
1074
1074
|
return e.length > 0 ? e : void 0;
|
|
@@ -1078,7 +1078,7 @@ function Ar(t) {
|
|
|
1078
1078
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function kr(...t) {
|
|
1082
1082
|
const e = [];
|
|
1083
1083
|
for (const r of t)
|
|
1084
1084
|
r && r.trim() && e.push(r.trim());
|
|
@@ -1093,10 +1093,10 @@ function ve(t) {
|
|
|
1093
1093
|
return Math.floor(e);
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function Cr(t) {
|
|
1097
1097
|
return typeof t == "string" ? t : "";
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Ir(t) {
|
|
1100
1100
|
if (typeof t == "boolean")
|
|
1101
1101
|
return t;
|
|
1102
1102
|
if (typeof t == "string") {
|
|
@@ -1105,7 +1105,7 @@ function Cr(t) {
|
|
|
1105
1105
|
if (e === "false") return !1;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function Or(t) {
|
|
1109
1109
|
if (!t || typeof t != "object")
|
|
1110
1110
|
return {};
|
|
1111
1111
|
const e = {}, r = t;
|
|
@@ -1120,7 +1120,7 @@ function Ir(t) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
return e;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function _r(t, e) {
|
|
1124
1124
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1125
1125
|
if (r.length !== n.length)
|
|
1126
1126
|
return !1;
|
|
@@ -1141,21 +1141,21 @@ function Or(t, e) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
return !0;
|
|
1143
1143
|
}
|
|
1144
|
-
const
|
|
1145
|
-
function
|
|
1144
|
+
const Nr = "std.shadertoy-canvas";
|
|
1145
|
+
function Pr() {
|
|
1146
1146
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
1147
|
-
const s =
|
|
1147
|
+
const s = J(n.store, r), i = A(null), a = A(null), c = A(null), f = A(0), d = A(""), h = A({}), u = A({
|
|
1148
1148
|
x: 0,
|
|
1149
1149
|
y: 0,
|
|
1150
1150
|
clickX: 0,
|
|
1151
1151
|
clickY: 0,
|
|
1152
1152
|
isDown: !1
|
|
1153
|
-
}), g = s ?
|
|
1153
|
+
}), g = s ? Cr(s.props?.shaderSource) : "", y = s ? ve(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, m = K(() => Or(S), [S]), p = s ? Ir(s.props?.enableMouse) ?? !0 : !0, w = s ? ve(s.props?.width) : void 0, T = s ? ve(s.props?.height) : void 0, _ = s ? kr(Tr(s.props?.className), o) : o;
|
|
1154
1154
|
M(() => {
|
|
1155
1155
|
const C = i.current;
|
|
1156
1156
|
if (C) {
|
|
1157
1157
|
try {
|
|
1158
|
-
const P = new
|
|
1158
|
+
const P = new Ar(C);
|
|
1159
1159
|
a.current = P;
|
|
1160
1160
|
} catch (P) {
|
|
1161
1161
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
@@ -1175,7 +1175,7 @@ function Nr() {
|
|
|
1175
1175
|
}
|
|
1176
1176
|
}, [g, m]), M(() => {
|
|
1177
1177
|
const C = a.current;
|
|
1178
|
-
!C || !d.current ||
|
|
1178
|
+
!C || !d.current || _r(h.current, m) || (C.setCustomUniforms(m), h.current = m);
|
|
1179
1179
|
}, [m]), M(() => {
|
|
1180
1180
|
const C = a.current;
|
|
1181
1181
|
if (!C || !d.current) return;
|
|
@@ -1205,7 +1205,7 @@ function Nr() {
|
|
|
1205
1205
|
u.current.isDown = !0, u.current.clickX = F, u.current.clickY = Y, U.setMouse(F, Y, F, Y);
|
|
1206
1206
|
},
|
|
1207
1207
|
[p]
|
|
1208
|
-
),
|
|
1208
|
+
), Z = x(() => {
|
|
1209
1209
|
p && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
|
|
1210
1210
|
}, [p]);
|
|
1211
1211
|
return s ? /* @__PURE__ */ R.jsx(
|
|
@@ -1218,22 +1218,22 @@ function Nr() {
|
|
|
1218
1218
|
...T ? { height: T } : {},
|
|
1219
1219
|
onMouseMove: D,
|
|
1220
1220
|
onMouseDown: G,
|
|
1221
|
-
onMouseUp:
|
|
1222
|
-
onMouseLeave:
|
|
1221
|
+
onMouseUp: Z,
|
|
1222
|
+
onMouseLeave: Z
|
|
1223
1223
|
}
|
|
1224
1224
|
) : null;
|
|
1225
1225
|
});
|
|
1226
1226
|
return ({ type: e }) => {
|
|
1227
|
-
if (e ===
|
|
1227
|
+
if (e === Nr)
|
|
1228
1228
|
return t;
|
|
1229
1229
|
};
|
|
1230
1230
|
}
|
|
1231
|
-
const
|
|
1232
|
-
function
|
|
1233
|
-
t.registerModule(
|
|
1231
|
+
const jr = "shadertoy", Lr = async () => Pr();
|
|
1232
|
+
function Mr(t) {
|
|
1233
|
+
t.registerModule(jr, Lr);
|
|
1234
1234
|
}
|
|
1235
1235
|
const Xe = ge("UIRegistry");
|
|
1236
|
-
class
|
|
1236
|
+
class Ur {
|
|
1237
1237
|
baseResolvers = [];
|
|
1238
1238
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1239
1239
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1255,7 +1255,7 @@ class Mr {
|
|
|
1255
1255
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1256
1256
|
if (!this.moduleResolvers.has(n))
|
|
1257
1257
|
try {
|
|
1258
|
-
const s = await o(), i =
|
|
1258
|
+
const s = await o(), i = Fr(s);
|
|
1259
1259
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1260
1260
|
} catch (s) {
|
|
1261
1261
|
Xe.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
@@ -1263,7 +1263,7 @@ class Mr {
|
|
|
1263
1263
|
const r = [];
|
|
1264
1264
|
for (const n of this.moduleLoaders.keys())
|
|
1265
1265
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1266
|
-
return
|
|
1266
|
+
return Br(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1267
1267
|
}
|
|
1268
1268
|
resolve(e) {
|
|
1269
1269
|
for (const r of this.baseResolvers) {
|
|
@@ -1283,17 +1283,17 @@ class Mr {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1287
|
-
const t = new
|
|
1288
|
-
return
|
|
1286
|
+
function xr() {
|
|
1287
|
+
const t = new Ur();
|
|
1288
|
+
return cr(t), wr(t), Mr(t), t.loadRegisteredModules(), t;
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1290
|
+
function Dr(t) {
|
|
1291
1291
|
return Array.isArray(t) ? t : [t];
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return t ?
|
|
1293
|
+
function Fr(t) {
|
|
1294
|
+
return t ? Dr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function Br(t, e) {
|
|
1297
1297
|
if (t.length !== e.length)
|
|
1298
1298
|
return !1;
|
|
1299
1299
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1382,14 +1382,14 @@ function tt(t, e, r, n) {
|
|
|
1382
1382
|
d[m] = h(m * 0.1, t, r);
|
|
1383
1383
|
return (m) => m <= 0 ? 0 : m >= 1 ? 1 : h(S(m), e, n);
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function $r(t) {
|
|
1386
1386
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1387
1387
|
if (!e)
|
|
1388
1388
|
return (o) => $(o);
|
|
1389
1389
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1390
1390
|
return n === "start" || n === "jump-start" ? (o) => $(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => $(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => $((Math.floor(o * r) + 0.5) / r) : (o) => $(Math.floor(o * r) / r);
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function Vr(t) {
|
|
1393
1393
|
if (!t)
|
|
1394
1394
|
return (r) => $(r);
|
|
1395
1395
|
const e = t.trim().toLowerCase();
|
|
@@ -1407,12 +1407,12 @@ function $r(t) {
|
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
1409
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1410
|
-
const r =
|
|
1410
|
+
const r = $r(e);
|
|
1411
1411
|
return (n) => r($(n));
|
|
1412
1412
|
}
|
|
1413
1413
|
return (r) => $(r);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Kr(t) {
|
|
1416
1416
|
if (!t)
|
|
1417
1417
|
return;
|
|
1418
1418
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1422,7 +1422,7 @@ function Vr(t) {
|
|
|
1422
1422
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1423
1423
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1424
1424
|
}
|
|
1425
|
-
class
|
|
1425
|
+
class Yr {
|
|
1426
1426
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1427
1427
|
observer;
|
|
1428
1428
|
observeScheduled = !1;
|
|
@@ -1467,7 +1467,7 @@ class Kr {
|
|
|
1467
1467
|
const r = e.source?.trim();
|
|
1468
1468
|
if (!r)
|
|
1469
1469
|
return;
|
|
1470
|
-
const n = Qe(e.min) ?? 0, o = Qe(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c =
|
|
1470
|
+
const n = Qe(e.min) ?? 0, o = Qe(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Vr(e.ease), f = Kr(e.map), d = e.targetId?.trim() || void 0;
|
|
1471
1471
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1472
1472
|
source: r.toLowerCase(),
|
|
1473
1473
|
min: n,
|
|
@@ -1680,8 +1680,8 @@ class Kr {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const Ee = new
|
|
1684
|
-
function
|
|
1683
|
+
const Ee = new Yr();
|
|
1684
|
+
function Wr(t) {
|
|
1685
1685
|
const e = A(/* @__PURE__ */ new Map()), r = x(({ styleId: s, css: i, common: a }) => {
|
|
1686
1686
|
if (!(!s || typeof document > "u")) {
|
|
1687
1687
|
if (i) {
|
|
@@ -1714,7 +1714,7 @@ function Yr(t) {
|
|
|
1714
1714
|
};
|
|
1715
1715
|
}, [t, o, r, n]), M(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function zr(t) {
|
|
1718
1718
|
const e = [];
|
|
1719
1719
|
for (const [r, n] of t) {
|
|
1720
1720
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1722,7 +1722,7 @@ function Wr(t) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
return e.sort(), e.join(",");
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1725
|
+
function qr(t) {
|
|
1726
1726
|
const [e, r] = W(), n = A("");
|
|
1727
1727
|
return M(() => {
|
|
1728
1728
|
if (!t) {
|
|
@@ -1730,54 +1730,54 @@ function zr(t) {
|
|
|
1730
1730
|
return;
|
|
1731
1731
|
}
|
|
1732
1732
|
const o = () => {
|
|
1733
|
-
const s = t.getStores(), i =
|
|
1733
|
+
const s = t.getStores(), i = zr(s);
|
|
1734
1734
|
i !== n.current && (n.current = i, r(s));
|
|
1735
1735
|
};
|
|
1736
1736
|
return o(), t.subscribe(o);
|
|
1737
1737
|
}, [t]), e;
|
|
1738
1738
|
}
|
|
1739
|
-
var
|
|
1740
|
-
function
|
|
1741
|
-
var e =
|
|
1739
|
+
var Gr = typeof global == "object" && global && global.Object === Object && global, Hr = typeof self == "object" && self && self.Object === Object && self, Jr = Gr || Hr || Function("return this")(), me = Jr.Symbol, ht = Object.prototype, Xr = ht.hasOwnProperty, Zr = ht.toString, ae = me ? me.toStringTag : void 0;
|
|
1740
|
+
function Qr(t) {
|
|
1741
|
+
var e = Xr.call(t, ae), r = t[ae];
|
|
1742
1742
|
try {
|
|
1743
1743
|
t[ae] = void 0;
|
|
1744
1744
|
var n = !0;
|
|
1745
1745
|
} catch {
|
|
1746
1746
|
}
|
|
1747
|
-
var o =
|
|
1747
|
+
var o = Zr.call(t);
|
|
1748
1748
|
return n && (e ? t[ae] = r : delete t[ae]), o;
|
|
1749
1749
|
}
|
|
1750
|
-
var
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1753
|
-
}
|
|
1754
|
-
var rn = "[object Null]", nn = "[object Undefined]", rt = me ? me.toStringTag : void 0;
|
|
1755
|
-
function on(t) {
|
|
1756
|
-
return t == null ? t === void 0 ? nn : rn : rt && rt in Object(t) ? Zr(t) : tn(t);
|
|
1750
|
+
var en = Object.prototype, tn = en.toString;
|
|
1751
|
+
function rn(t) {
|
|
1752
|
+
return tn.call(t);
|
|
1757
1753
|
}
|
|
1754
|
+
var nn = "[object Null]", on = "[object Undefined]", rt = me ? me.toStringTag : void 0;
|
|
1758
1755
|
function sn(t) {
|
|
1756
|
+
return t == null ? t === void 0 ? on : nn : rt && rt in Object(t) ? Qr(t) : rn(t);
|
|
1757
|
+
}
|
|
1758
|
+
function an(t) {
|
|
1759
1759
|
return t != null && typeof t == "object";
|
|
1760
1760
|
}
|
|
1761
|
-
var
|
|
1762
|
-
function
|
|
1763
|
-
return typeof t == "string" || !
|
|
1761
|
+
var cn = Array.isArray, un = "[object String]";
|
|
1762
|
+
function ln(t) {
|
|
1763
|
+
return typeof t == "string" || !cn(t) && an(t) && sn(t) == un;
|
|
1764
1764
|
}
|
|
1765
1765
|
const nt = "ikonUiModules";
|
|
1766
1766
|
function je(t) {
|
|
1767
1767
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function dn(t) {
|
|
1770
1770
|
if (!Array.isArray(t))
|
|
1771
1771
|
return;
|
|
1772
1772
|
const e = /* @__PURE__ */ new Set();
|
|
1773
1773
|
for (const r of t) {
|
|
1774
|
-
if (!
|
|
1774
|
+
if (!ln(r)) continue;
|
|
1775
1775
|
const n = r.trim();
|
|
1776
1776
|
n && (e.has(n) || e.add(n));
|
|
1777
1777
|
}
|
|
1778
1778
|
return Array.from(e);
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function lo(t, e) {
|
|
1781
1781
|
if (t === e)
|
|
1782
1782
|
return !0;
|
|
1783
1783
|
if (!t || !e)
|
|
@@ -1789,18 +1789,18 @@ function uo(t, e) {
|
|
|
1789
1789
|
return !1;
|
|
1790
1790
|
return !0;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1792
|
+
function fn(t) {
|
|
1793
1793
|
if (!(!je(t) || !Object.prototype.hasOwnProperty.call(t, nt)))
|
|
1794
|
-
return
|
|
1794
|
+
return dn(t[nt]);
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function fo(...t) {
|
|
1797
1797
|
for (const e of t) {
|
|
1798
|
-
const r =
|
|
1798
|
+
const r = fn(e);
|
|
1799
1799
|
if (r !== void 0)
|
|
1800
1800
|
return r;
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
1803
|
-
function
|
|
1803
|
+
function ho(t) {
|
|
1804
1804
|
if (!je(t))
|
|
1805
1805
|
return;
|
|
1806
1806
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
@@ -1849,7 +1849,7 @@ const v = {
|
|
|
1849
1849
|
Line: 4,
|
|
1850
1850
|
Paragraph: 8,
|
|
1851
1851
|
Emoji: 16
|
|
1852
|
-
},
|
|
1852
|
+
}, hn = [
|
|
1853
1853
|
{
|
|
1854
1854
|
flag: v.Letter,
|
|
1855
1855
|
hints: [
|
|
@@ -1898,11 +1898,11 @@ const v = {
|
|
|
1898
1898
|
"[data-emoji]"
|
|
1899
1899
|
]
|
|
1900
1900
|
}
|
|
1901
|
-
], Le = v.Letter | v.Word | v.Line | v.Paragraph | v.Emoji,
|
|
1902
|
-
function
|
|
1903
|
-
if (!t || t.length >
|
|
1901
|
+
], Le = v.Letter | v.Word | v.Line | v.Paragraph | v.Emoji, mn = v.Letter | v.Word | v.Line | v.Paragraph, ot = /* @__PURE__ */ new Map(), pn = 16384;
|
|
1902
|
+
function mo(t, e) {
|
|
1903
|
+
if (!t || t.length > pn)
|
|
1904
1904
|
return t;
|
|
1905
|
-
const r =
|
|
1905
|
+
const r = Pn(e), n = ne(r, v.Emoji), o = r & mn;
|
|
1906
1906
|
if (o === v.None && !n)
|
|
1907
1907
|
return t;
|
|
1908
1908
|
const s = t.replace(/\r\n/g, `
|
|
@@ -1910,20 +1910,20 @@ function ho(t, e) {
|
|
|
1910
1910
|
`);
|
|
1911
1911
|
if (o === v.None)
|
|
1912
1912
|
return ct(s);
|
|
1913
|
-
const i =
|
|
1913
|
+
const i = _n(s);
|
|
1914
1914
|
if (i.length === 0)
|
|
1915
1915
|
return n ? ct(s) : t;
|
|
1916
|
-
const a =
|
|
1916
|
+
const a = Nn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1917
1917
|
for (const d of a) {
|
|
1918
|
-
const h =
|
|
1918
|
+
const h = gn(d, r, c);
|
|
1919
1919
|
f.push(...h);
|
|
1920
1920
|
}
|
|
1921
1921
|
return f;
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1923
|
+
function gn(t, e, r) {
|
|
1924
1924
|
const n = [];
|
|
1925
1925
|
for (const o of t) {
|
|
1926
|
-
const s =
|
|
1926
|
+
const s = yn(o, e, r);
|
|
1927
1927
|
n.push(...s);
|
|
1928
1928
|
}
|
|
1929
1929
|
if (ne(e, v.Paragraph)) {
|
|
@@ -1942,8 +1942,8 @@ function pn(t, e, r) {
|
|
|
1942
1942
|
}
|
|
1943
1943
|
return n;
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1946
|
-
const n =
|
|
1945
|
+
function yn(t, e, r) {
|
|
1946
|
+
const n = Sn(t.text, e, r), o = [];
|
|
1947
1947
|
if (ne(e, v.Line)) {
|
|
1948
1948
|
const s = r.line++;
|
|
1949
1949
|
o.push(
|
|
@@ -1955,7 +1955,7 @@ function gn(t, e, r) {
|
|
|
1955
1955
|
o.push(/* @__PURE__ */ R.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1956
1956
|
return o;
|
|
1957
1957
|
}
|
|
1958
|
-
function
|
|
1958
|
+
function Sn(t, e, r) {
|
|
1959
1959
|
if (!t)
|
|
1960
1960
|
return [];
|
|
1961
1961
|
const n = ne(e, v.Word), o = [], s = /(\s+)/g;
|
|
@@ -1974,13 +1974,13 @@ function yn(t, e, r) {
|
|
|
1974
1974
|
return o;
|
|
1975
1975
|
}
|
|
1976
1976
|
function st(t, e, r, n) {
|
|
1977
|
-
const o = e.word++, s =
|
|
1977
|
+
const o = e.word++, s = wn(t, r, e), i = `motion-word-${o}`, a = bn(o, n);
|
|
1978
1978
|
return n ? /* @__PURE__ */ R.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ R.jsx("span", { style: a, children: s }, i);
|
|
1979
1979
|
}
|
|
1980
|
-
function
|
|
1980
|
+
function bn(t, e) {
|
|
1981
1981
|
return e ? { ...ye(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1983
|
+
function wn(t, e, r) {
|
|
1984
1984
|
if (!t)
|
|
1985
1985
|
return [];
|
|
1986
1986
|
const n = ne(e, v.Letter), o = ne(e, v.Emoji);
|
|
@@ -2013,33 +2013,33 @@ function bn(t, e, r) {
|
|
|
2013
2013
|
function Me(t) {
|
|
2014
2014
|
if (!t)
|
|
2015
2015
|
return [];
|
|
2016
|
-
const e =
|
|
2017
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
2016
|
+
const e = vn();
|
|
2017
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : Rn(t);
|
|
2018
2018
|
}
|
|
2019
2019
|
let ce;
|
|
2020
|
-
function
|
|
2020
|
+
function vn() {
|
|
2021
2021
|
return ce !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? ce = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : ce = null), ce;
|
|
2022
2022
|
}
|
|
2023
|
-
function
|
|
2023
|
+
function Rn(t) {
|
|
2024
2024
|
const e = [], r = Array.from(t);
|
|
2025
2025
|
let n = "";
|
|
2026
2026
|
for (let o = 0; o < r.length; o++) {
|
|
2027
2027
|
const s = r[o], i = r[o + 1];
|
|
2028
|
-
n += s, !(i &&
|
|
2028
|
+
n += s, !(i && En(s, i)) && (e.push(n), n = "");
|
|
2029
2029
|
}
|
|
2030
2030
|
return n && e.push(n), e;
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2033
|
-
return e ? !!(it(t) || it(e) ||
|
|
2032
|
+
function En(t, e) {
|
|
2033
|
+
return e ? !!(it(t) || it(e) || kn(e) || An(e) || Tn(e) || at(t) && at(e)) : !1;
|
|
2034
2034
|
}
|
|
2035
2035
|
function it(t) {
|
|
2036
2036
|
return t.codePointAt(0) === 8205;
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function An(t) {
|
|
2039
2039
|
const e = t.codePointAt(0);
|
|
2040
2040
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2042
|
+
function Tn(t) {
|
|
2043
2043
|
const e = t.codePointAt(0);
|
|
2044
2044
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2045
2045
|
}
|
|
@@ -2048,10 +2048,10 @@ function at(t) {
|
|
|
2048
2048
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2049
2049
|
}
|
|
2050
2050
|
let Ae;
|
|
2051
|
-
function
|
|
2052
|
-
return t ? (Ae || (Ae =
|
|
2051
|
+
function kn(t) {
|
|
2052
|
+
return t ? (Ae || (Ae = Cn()), Ae(t)) : !1;
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2054
|
+
function Cn() {
|
|
2055
2055
|
try {
|
|
2056
2056
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2057
2057
|
return (e) => t.test(e);
|
|
@@ -2064,17 +2064,17 @@ function kn() {
|
|
|
2064
2064
|
}
|
|
2065
2065
|
let Te;
|
|
2066
2066
|
function mt(t) {
|
|
2067
|
-
return t ? (Te || (Te =
|
|
2067
|
+
return t ? (Te || (Te = In()), Te(t)) : !1;
|
|
2068
2068
|
}
|
|
2069
|
-
function
|
|
2069
|
+
function In() {
|
|
2070
2070
|
try {
|
|
2071
2071
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2072
2072
|
return (e) => t.test(e);
|
|
2073
2073
|
} catch {
|
|
2074
|
-
return
|
|
2074
|
+
return On;
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function On(t) {
|
|
2078
2078
|
if (!t)
|
|
2079
2079
|
return !1;
|
|
2080
2080
|
for (const e of Array.from(t)) {
|
|
@@ -2084,7 +2084,7 @@ function In(t) {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
return !1;
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function _n(t) {
|
|
2088
2088
|
const e = [];
|
|
2089
2089
|
let r = "", n = 0;
|
|
2090
2090
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2098,7 +2098,7 @@ function On(t) {
|
|
|
2098
2098
|
}
|
|
2099
2099
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
2100
2100
|
}
|
|
2101
|
-
function
|
|
2101
|
+
function Nn(t) {
|
|
2102
2102
|
if (t.length === 0)
|
|
2103
2103
|
return [];
|
|
2104
2104
|
const e = [];
|
|
@@ -2155,7 +2155,7 @@ function pt(t, e) {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function Pn(t) {
|
|
2159
2159
|
if (!t)
|
|
2160
2160
|
return v.None;
|
|
2161
2161
|
const e = t.trim();
|
|
@@ -2169,8 +2169,8 @@ function Nn(t) {
|
|
|
2169
2169
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2170
2170
|
if (n.length === 0)
|
|
2171
2171
|
return v.None;
|
|
2172
|
-
const s = n.map((c) => `.${
|
|
2173
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2172
|
+
const s = n.map((c) => `.${jn(c)}`).map(
|
|
2173
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Ln(c)}(?![a-zA-Z0-9_-])`)
|
|
2174
2174
|
);
|
|
2175
2175
|
let i = v.None, a = !1;
|
|
2176
2176
|
for (const c of Array.from(document.styleSheets)) {
|
|
@@ -2198,7 +2198,7 @@ function gt(t, e) {
|
|
|
2198
2198
|
const a = s.selectorText ?? "";
|
|
2199
2199
|
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2200
2200
|
n = !0;
|
|
2201
|
-
for (const f of
|
|
2201
|
+
for (const f of hn)
|
|
2202
2202
|
f.hints.some((d) => a.includes(d)) && (r |= f.flag);
|
|
2203
2203
|
if (r === Le)
|
|
2204
2204
|
return { mask: r, sawStyleRule: !0 };
|
|
@@ -2212,13 +2212,13 @@ function gt(t, e) {
|
|
|
2212
2212
|
}
|
|
2213
2213
|
return { mask: r, sawStyleRule: n };
|
|
2214
2214
|
}
|
|
2215
|
-
function
|
|
2215
|
+
function jn(t) {
|
|
2216
2216
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2217
2217
|
}
|
|
2218
|
-
function
|
|
2218
|
+
function Ln(t) {
|
|
2219
2219
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2220
2220
|
}
|
|
2221
|
-
const Be = "ikon_auth_session",
|
|
2221
|
+
const Be = "ikon_auth_session", Mn = 7 * 24 * 60 * 60 * 1e3;
|
|
2222
2222
|
function Se(t) {
|
|
2223
2223
|
try {
|
|
2224
2224
|
localStorage.setItem(Be, JSON.stringify(t));
|
|
@@ -2231,7 +2231,7 @@ function yt() {
|
|
|
2231
2231
|
const t = localStorage.getItem(Be);
|
|
2232
2232
|
if (!t) return null;
|
|
2233
2233
|
const e = JSON.parse(t);
|
|
2234
|
-
return Date.now() - e.authenticatedAt >
|
|
2234
|
+
return Date.now() - e.authenticatedAt > Mn ? (St(), null) : e;
|
|
2235
2235
|
} catch {
|
|
2236
2236
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2237
2237
|
}
|
|
@@ -2268,7 +2268,7 @@ async function bt(t, e) {
|
|
|
2268
2268
|
};
|
|
2269
2269
|
return Se(s), s;
|
|
2270
2270
|
}
|
|
2271
|
-
async function
|
|
2271
|
+
async function po(t) {
|
|
2272
2272
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
2273
2273
|
method: "POST",
|
|
2274
2274
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2283,22 +2283,22 @@ async function mo(t) {
|
|
|
2283
2283
|
throw new Error(i);
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2286
|
+
function Un() {
|
|
2287
2287
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2288
2288
|
return e && r ? { token: e, provider: r } : null;
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function xn() {
|
|
2291
2291
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2292
2292
|
return e ? decodeURIComponent(e) : null;
|
|
2293
2293
|
}
|
|
2294
2294
|
function ut() {
|
|
2295
2295
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2296
2296
|
}
|
|
2297
|
-
function
|
|
2297
|
+
function Dn(t, e, r, n) {
|
|
2298
2298
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2299
2299
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2300
2300
|
}
|
|
2301
|
-
async function
|
|
2301
|
+
async function Fn(t) {
|
|
2302
2302
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2303
2303
|
method: "POST",
|
|
2304
2304
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2309,7 +2309,7 @@ async function Dn(t) {
|
|
|
2309
2309
|
}
|
|
2310
2310
|
return e.json();
|
|
2311
2311
|
}
|
|
2312
|
-
async function
|
|
2312
|
+
async function Bn(t, e, r) {
|
|
2313
2313
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2314
2314
|
method: "POST",
|
|
2315
2315
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2326,7 +2326,7 @@ async function Fn(t, e, r) {
|
|
|
2326
2326
|
};
|
|
2327
2327
|
return Se(s), s;
|
|
2328
2328
|
}
|
|
2329
|
-
async function
|
|
2329
|
+
async function $n(t, e) {
|
|
2330
2330
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2331
2331
|
method: "POST",
|
|
2332
2332
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2338,7 +2338,7 @@ async function Bn(t, e) {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
return r.json();
|
|
2340
2340
|
}
|
|
2341
|
-
async function
|
|
2341
|
+
async function Vn(t, e) {
|
|
2342
2342
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2343
2343
|
method: "POST",
|
|
2344
2344
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2369,9 +2369,9 @@ function pe(t) {
|
|
|
2369
2369
|
return s;
|
|
2370
2370
|
}
|
|
2371
2371
|
function $e() {
|
|
2372
|
-
return
|
|
2372
|
+
return Kn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2373
2373
|
}
|
|
2374
|
-
const
|
|
2374
|
+
const Kn = {
|
|
2375
2375
|
stubThis: (t) => t
|
|
2376
2376
|
};
|
|
2377
2377
|
function wt(t) {
|
|
@@ -2403,7 +2403,7 @@ class j extends Error {
|
|
|
2403
2403
|
}), this.name = o ?? n.name, this.code = r;
|
|
2404
2404
|
}
|
|
2405
2405
|
}
|
|
2406
|
-
function
|
|
2406
|
+
function Yn({ error: t, options: e }) {
|
|
2407
2407
|
const { publicKey: r } = e;
|
|
2408
2408
|
if (!r)
|
|
2409
2409
|
throw Error("options was missing required publicKey property");
|
|
@@ -2489,7 +2489,7 @@ function Kn({ error: t, options: e }) {
|
|
|
2489
2489
|
}
|
|
2490
2490
|
return t;
|
|
2491
2491
|
}
|
|
2492
|
-
class
|
|
2492
|
+
class Wn {
|
|
2493
2493
|
constructor() {
|
|
2494
2494
|
Object.defineProperty(this, "controller", {
|
|
2495
2495
|
enumerable: !0,
|
|
@@ -2513,12 +2513,12 @@ class Yn {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
const Rt = new
|
|
2516
|
+
const Rt = new Wn(), zn = ["cross-platform", "platform"];
|
|
2517
2517
|
function Et(t) {
|
|
2518
|
-
if (t && !(
|
|
2518
|
+
if (t && !(zn.indexOf(t) < 0))
|
|
2519
2519
|
return t;
|
|
2520
2520
|
}
|
|
2521
|
-
async function
|
|
2521
|
+
async function qn(t) {
|
|
2522
2522
|
!t.optionsJSON && t.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
2523
2523
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2524
2524
|
if (!$e())
|
|
@@ -2537,7 +2537,7 @@ async function zn(t) {
|
|
|
2537
2537
|
try {
|
|
2538
2538
|
s = await navigator.credentials.create(o);
|
|
2539
2539
|
} catch (y) {
|
|
2540
|
-
throw
|
|
2540
|
+
throw Yn({ error: y, options: o });
|
|
2541
2541
|
}
|
|
2542
2542
|
if (!s)
|
|
2543
2543
|
throw new Error("Registration was not completed");
|
|
@@ -2586,7 +2586,7 @@ function ke(t, e) {
|
|
|
2586
2586
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2587
2587
|
`, e);
|
|
2588
2588
|
}
|
|
2589
|
-
function
|
|
2589
|
+
function Gn() {
|
|
2590
2590
|
if (!$e())
|
|
2591
2591
|
return Ce.stubThis(new Promise((e) => e(!1)));
|
|
2592
2592
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2595,7 +2595,7 @@ function qn() {
|
|
|
2595
2595
|
const Ce = {
|
|
2596
2596
|
stubThis: (t) => t
|
|
2597
2597
|
};
|
|
2598
|
-
function
|
|
2598
|
+
function Hn({ error: t, options: e }) {
|
|
2599
2599
|
const { publicKey: r } = e;
|
|
2600
2600
|
if (!r)
|
|
2601
2601
|
throw Error("options was missing required publicKey property");
|
|
@@ -2636,7 +2636,7 @@ function Gn({ error: t, options: e }) {
|
|
|
2636
2636
|
}
|
|
2637
2637
|
return t;
|
|
2638
2638
|
}
|
|
2639
|
-
async function
|
|
2639
|
+
async function Jn(t) {
|
|
2640
2640
|
!t.optionsJSON && t.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
2641
2641
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2642
2642
|
if (!$e())
|
|
@@ -2649,7 +2649,7 @@ async function Hn(t) {
|
|
|
2649
2649
|
allowCredentials: o
|
|
2650
2650
|
}, i = {};
|
|
2651
2651
|
if (r) {
|
|
2652
|
-
if (!await
|
|
2652
|
+
if (!await Gn())
|
|
2653
2653
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2654
2654
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2655
2655
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -2660,7 +2660,7 @@ async function Hn(t) {
|
|
|
2660
2660
|
try {
|
|
2661
2661
|
a = await navigator.credentials.get(i);
|
|
2662
2662
|
} catch (g) {
|
|
2663
|
-
throw
|
|
2663
|
+
throw Hn({ error: g, options: i });
|
|
2664
2664
|
}
|
|
2665
2665
|
if (!a)
|
|
2666
2666
|
throw new Error("Authentication was not completed");
|
|
@@ -2681,7 +2681,7 @@ async function Hn(t) {
|
|
|
2681
2681
|
};
|
|
2682
2682
|
}
|
|
2683
2683
|
const Ve = lt(null);
|
|
2684
|
-
function
|
|
2684
|
+
function go({ children: t, config: e }) {
|
|
2685
2685
|
const [r, n] = W({
|
|
2686
2686
|
isAuthenticated: !1,
|
|
2687
2687
|
isLoading: !0,
|
|
@@ -2690,7 +2690,7 @@ function po({ children: t, config: e }) {
|
|
|
2690
2690
|
});
|
|
2691
2691
|
M(() => {
|
|
2692
2692
|
(() => {
|
|
2693
|
-
const d =
|
|
2693
|
+
const d = xn();
|
|
2694
2694
|
if (d) {
|
|
2695
2695
|
ut(), n({
|
|
2696
2696
|
isAuthenticated: !1,
|
|
@@ -2700,7 +2700,7 @@ function po({ children: t, config: e }) {
|
|
|
2700
2700
|
});
|
|
2701
2701
|
return;
|
|
2702
2702
|
}
|
|
2703
|
-
const h =
|
|
2703
|
+
const h = Un();
|
|
2704
2704
|
if (h) {
|
|
2705
2705
|
const g = {
|
|
2706
2706
|
token: h.token,
|
|
@@ -2765,7 +2765,7 @@ function po({ children: t, config: e }) {
|
|
|
2765
2765
|
if (f === "passkey") {
|
|
2766
2766
|
n((u) => ({ ...u, isLoading: !0, error: null }));
|
|
2767
2767
|
try {
|
|
2768
|
-
const u = await
|
|
2768
|
+
const u = await $n(d), g = await Jn({ optionsJSON: u }), y = await Vn(d, g);
|
|
2769
2769
|
n({
|
|
2770
2770
|
isAuthenticated: !0,
|
|
2771
2771
|
isLoading: !1,
|
|
@@ -2781,7 +2781,7 @@ function po({ children: t, config: e }) {
|
|
|
2781
2781
|
}
|
|
2782
2782
|
return;
|
|
2783
2783
|
}
|
|
2784
|
-
const h =
|
|
2784
|
+
const h = Dn(f, e.spaceId, d);
|
|
2785
2785
|
window.location.href = h;
|
|
2786
2786
|
},
|
|
2787
2787
|
[e.authUrl, e.spaceId]
|
|
@@ -2797,7 +2797,7 @@ function po({ children: t, config: e }) {
|
|
|
2797
2797
|
const d = e.authUrl ?? Oe();
|
|
2798
2798
|
n((h) => ({ ...h, isLoading: !0, error: null }));
|
|
2799
2799
|
try {
|
|
2800
|
-
const h = await
|
|
2800
|
+
const h = await Fn(d), u = await qn({ optionsJSON: h }), g = await Bn(d, u, f);
|
|
2801
2801
|
n({
|
|
2802
2802
|
isAuthenticated: !0,
|
|
2803
2803
|
isLoading: !1,
|
|
@@ -2825,17 +2825,17 @@ function po({ children: t, config: e }) {
|
|
|
2825
2825
|
);
|
|
2826
2826
|
return /* @__PURE__ */ R.jsx(Ve, { value: c, children: t });
|
|
2827
2827
|
}
|
|
2828
|
-
function
|
|
2828
|
+
function Xn() {
|
|
2829
2829
|
const t = xe(Ve);
|
|
2830
2830
|
if (!t)
|
|
2831
2831
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2832
2832
|
return t;
|
|
2833
2833
|
}
|
|
2834
|
-
function
|
|
2834
|
+
function yo() {
|
|
2835
2835
|
return xe(Ve);
|
|
2836
2836
|
}
|
|
2837
|
-
function
|
|
2838
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2837
|
+
function So(t) {
|
|
2838
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Xn(), s = A(!1);
|
|
2839
2839
|
return M(() => {
|
|
2840
2840
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2841
2841
|
return;
|
|
@@ -2852,7 +2852,7 @@ function yo(t) {
|
|
|
2852
2852
|
error: n.error
|
|
2853
2853
|
};
|
|
2854
2854
|
}
|
|
2855
|
-
function
|
|
2855
|
+
function bo({
|
|
2856
2856
|
connectionState: t,
|
|
2857
2857
|
error: e,
|
|
2858
2858
|
isReady: r,
|
|
@@ -2892,72 +2892,80 @@ function So({
|
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
2894
|
const Ie = ge("useIkonApp");
|
|
2895
|
-
function
|
|
2895
|
+
function Zn() {
|
|
2896
2896
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2897
2897
|
return window.__IKON_AUTH_CONFIG__;
|
|
2898
2898
|
}
|
|
2899
|
-
function
|
|
2899
|
+
function Qn() {
|
|
2900
2900
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
2901
2901
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2902
2902
|
}
|
|
2903
|
-
function
|
|
2904
|
-
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s } = t, i = e === void 0 ?
|
|
2903
|
+
function wo(t) {
|
|
2904
|
+
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s } = t, i = e === void 0 ? Zn() ?? null : e, a = Qn(), c = A(null), f = A(null), d = A(null), h = A(!1), u = A(o), g = A(n), y = A(s);
|
|
2905
2905
|
u.current = o, g.current = n, y.current = s;
|
|
2906
|
-
const [S, m] = W("idle"), [p, w] = W(null), [T, _] = W(null), [D, G] = W(null), [
|
|
2906
|
+
const [S, m] = W("idle"), [p, w] = W(null), [T, _] = W(null), [D, G] = W(null), [Z, C] = W(null), [P, U] = W(null), [O, F] = W(null), [Y, Q] = W(!1), B = K(() => {
|
|
2907
2907
|
try {
|
|
2908
2908
|
const E = Nt();
|
|
2909
2909
|
return (E.sessionId || E.channelKey) && Pt(), E;
|
|
2910
2910
|
} catch {
|
|
2911
2911
|
return { parameters: {} };
|
|
2912
2912
|
}
|
|
2913
|
-
}, []),
|
|
2913
|
+
}, []), H = K(() => i?.enabled ? yt() : null, [i?.enabled]), X = a?.enabled ?? !1, ee = a?.host ?? "localhost", te = a?.port ?? 8443;
|
|
2914
2914
|
M(() => {
|
|
2915
|
-
!
|
|
2915
|
+
!X && Ke() && i && !i.enabled && i.spaceId && !O && !Y && (Q(!0), bt(i.spaceId, i.authUrl ?? Oe()).then((I) => {
|
|
2916
2916
|
F(I.token);
|
|
2917
2917
|
}).catch((I) => {
|
|
2918
2918
|
Ie.error("Anonymous auth failed:", I), w(I instanceof Error ? I.message : "Anonymous auth failed");
|
|
2919
2919
|
}).finally(() => {
|
|
2920
|
-
|
|
2920
|
+
Q(!1);
|
|
2921
2921
|
}));
|
|
2922
|
-
}, [
|
|
2923
|
-
const l = K(() =>
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
channelKey: B.channelKey,
|
|
2937
|
-
parameters: B.parameters
|
|
2938
|
-
}
|
|
2939
|
-
} : O && i?.spaceId ? {
|
|
2940
|
-
sessionToken: {
|
|
2941
|
-
token: O,
|
|
2942
|
-
spaceId: i.spaceId,
|
|
2943
|
-
backendType: Ye(),
|
|
2944
|
-
sessionId: B.sessionId,
|
|
2945
|
-
channelKey: B.channelKey,
|
|
2946
|
-
parameters: B.parameters
|
|
2947
|
-
}
|
|
2948
|
-
} : Ke() ? null : {
|
|
2949
|
-
local: {
|
|
2950
|
-
host: ee,
|
|
2951
|
-
httpsPort: te,
|
|
2952
|
-
spaceId: i?.spaceId,
|
|
2953
|
-
parameters: B.parameters
|
|
2922
|
+
}, [X, i, O, Y]);
|
|
2923
|
+
const l = K(() => {
|
|
2924
|
+
if (X) {
|
|
2925
|
+
const E = H?.token ? jt(H.token) ?? void 0 : void 0;
|
|
2926
|
+
return {
|
|
2927
|
+
local: {
|
|
2928
|
+
host: ee,
|
|
2929
|
+
httpsPort: te,
|
|
2930
|
+
userId: E,
|
|
2931
|
+
token: H?.token ?? void 0,
|
|
2932
|
+
spaceId: i?.spaceId,
|
|
2933
|
+
parameters: B.parameters
|
|
2934
|
+
}
|
|
2935
|
+
};
|
|
2954
2936
|
}
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2937
|
+
return H?.token && i?.spaceId ? {
|
|
2938
|
+
sessionToken: {
|
|
2939
|
+
token: H.token,
|
|
2940
|
+
spaceId: i.spaceId,
|
|
2941
|
+
backendType: Ye(),
|
|
2942
|
+
sessionId: B.sessionId,
|
|
2943
|
+
channelKey: B.channelKey,
|
|
2944
|
+
parameters: B.parameters
|
|
2945
|
+
}
|
|
2946
|
+
} : O && i?.spaceId ? {
|
|
2947
|
+
sessionToken: {
|
|
2948
|
+
token: O,
|
|
2949
|
+
spaceId: i.spaceId,
|
|
2950
|
+
backendType: Ye(),
|
|
2951
|
+
sessionId: B.sessionId,
|
|
2952
|
+
channelKey: B.channelKey,
|
|
2953
|
+
parameters: B.parameters
|
|
2954
|
+
}
|
|
2955
|
+
} : Ke() ? null : {
|
|
2956
|
+
local: {
|
|
2957
|
+
host: ee,
|
|
2958
|
+
httpsPort: te,
|
|
2959
|
+
spaceId: i?.spaceId,
|
|
2960
|
+
parameters: B.parameters
|
|
2961
|
+
}
|
|
2962
|
+
};
|
|
2963
|
+
}, [X, ee, te, H?.token, i?.spaceId, O, B.sessionId, B.channelKey, B.parameters]);
|
|
2964
|
+
Wr(T);
|
|
2965
|
+
const b = qr(T);
|
|
2958
2966
|
M(() => {
|
|
2959
2967
|
if (!h.current) {
|
|
2960
|
-
if (h.current = !0, d.current =
|
|
2968
|
+
if (h.current = !0, d.current = xr(), r)
|
|
2961
2969
|
for (const E of r)
|
|
2962
2970
|
E(d.current);
|
|
2963
2971
|
d.current.loadRegisteredModules().catch((E) => {
|
|
@@ -2966,7 +2974,7 @@ function bo(t) {
|
|
|
2966
2974
|
}
|
|
2967
2975
|
}, []), M(() => {
|
|
2968
2976
|
if (!l) return;
|
|
2969
|
-
const E = new
|
|
2977
|
+
const E = new Lt({
|
|
2970
2978
|
...l,
|
|
2971
2979
|
timeouts: g.current,
|
|
2972
2980
|
audio: u.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : void 0,
|
|
@@ -2980,7 +2988,7 @@ function bo(t) {
|
|
|
2980
2988
|
}
|
|
2981
2989
|
});
|
|
2982
2990
|
c.current = E;
|
|
2983
|
-
const I = new
|
|
2991
|
+
const I = new Zt({ client: E });
|
|
2984
2992
|
return f.current = I, _(I), E.connect().catch((V) => {
|
|
2985
2993
|
Ie.error("Connection failed:", V);
|
|
2986
2994
|
}), () => {
|
|
@@ -3003,11 +3011,11 @@ function bo(t) {
|
|
|
3003
3011
|
onAction: k,
|
|
3004
3012
|
isReady: N,
|
|
3005
3013
|
webRtcAudioStream: D,
|
|
3006
|
-
webRtcVideoStream:
|
|
3014
|
+
webRtcVideoStream: Z,
|
|
3007
3015
|
webRtcScreenStream: P
|
|
3008
3016
|
};
|
|
3009
3017
|
}
|
|
3010
|
-
function
|
|
3018
|
+
function vo(t) {
|
|
3011
3019
|
const e = A(!1);
|
|
3012
3020
|
return x(() => {
|
|
3013
3021
|
if (e.current) return;
|
|
@@ -3016,18 +3024,18 @@ function wo(t) {
|
|
|
3016
3024
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
3017
3025
|
}, [t]);
|
|
3018
3026
|
}
|
|
3019
|
-
let
|
|
3020
|
-
function
|
|
3027
|
+
let eo = 0;
|
|
3028
|
+
function Ro(t = 5, e = 5e3) {
|
|
3021
3029
|
const [r, n] = W([]), o = A(/* @__PURE__ */ new Map()), s = x((i) => {
|
|
3022
3030
|
const a = o.current.get(i);
|
|
3023
3031
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
3024
3032
|
}, []);
|
|
3025
3033
|
return M(() => {
|
|
3026
|
-
const i = o.current, a =
|
|
3034
|
+
const i = o.current, a = Mt(
|
|
3027
3035
|
(c) => {
|
|
3028
|
-
if (!
|
|
3036
|
+
if (!Ut())
|
|
3029
3037
|
return;
|
|
3030
|
-
const f = `toast-${++
|
|
3038
|
+
const f = `toast-${++eo}`, d = c.level === We.ERROR ? "error" : "warn", h = {
|
|
3031
3039
|
id: f,
|
|
3032
3040
|
level: d,
|
|
3033
3041
|
message: c.message,
|
|
@@ -3050,30 +3058,30 @@ function vo(t = 5, e = 5e3) {
|
|
|
3050
3058
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3051
3059
|
}
|
|
3052
3060
|
const At = lt(null);
|
|
3053
|
-
function
|
|
3061
|
+
function to(t, e) {
|
|
3054
3062
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3055
3063
|
}
|
|
3056
|
-
function
|
|
3064
|
+
function ro(t, e) {
|
|
3057
3065
|
const n = new URLSearchParams(window.location.search).get("lang");
|
|
3058
3066
|
if (n && t.includes(n))
|
|
3059
3067
|
return n;
|
|
3060
3068
|
const o = navigator.language.split("-")[0];
|
|
3061
3069
|
return t.includes(o) ? o : e && t.includes(e) ? e : "en";
|
|
3062
3070
|
}
|
|
3063
|
-
function
|
|
3064
|
-
return e ?
|
|
3071
|
+
function no(t, e, r) {
|
|
3072
|
+
return e ? ro(t, r) : r && t.includes(r) ? r : "en";
|
|
3065
3073
|
}
|
|
3066
|
-
function
|
|
3074
|
+
function Eo({
|
|
3067
3075
|
children: t,
|
|
3068
3076
|
translations: e,
|
|
3069
3077
|
defaultLanguage: r,
|
|
3070
3078
|
detectLanguage: n = !1
|
|
3071
3079
|
}) {
|
|
3072
|
-
const o = Object.keys(e), s =
|
|
3080
|
+
const o = Object.keys(e), s = no(o, n, r), i = e[s] ?? e.en, a = K(
|
|
3073
3081
|
() => ({
|
|
3074
3082
|
t: (c, f) => {
|
|
3075
3083
|
const d = i[c];
|
|
3076
|
-
return
|
|
3084
|
+
return to(d, f);
|
|
3077
3085
|
},
|
|
3078
3086
|
locale: s,
|
|
3079
3087
|
translations: i
|
|
@@ -3082,67 +3090,67 @@ function Ro({
|
|
|
3082
3090
|
);
|
|
3083
3091
|
return /* @__PURE__ */ R.jsx(At, { value: a, children: t });
|
|
3084
3092
|
}
|
|
3085
|
-
function
|
|
3093
|
+
function Ao() {
|
|
3086
3094
|
const t = xe(At);
|
|
3087
3095
|
if (!t)
|
|
3088
3096
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3089
3097
|
return t;
|
|
3090
3098
|
}
|
|
3091
3099
|
export {
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3100
|
+
go as AuthProvider,
|
|
3101
|
+
bo as ConnectionStateRenderer,
|
|
3102
|
+
Eo as I18nProvider,
|
|
3103
|
+
ir as IKON_UI_BASE_MODULE,
|
|
3104
|
+
Sr as IKON_UI_MEDIA_MODULE,
|
|
3105
|
+
jr as IKON_UI_SHADERTOY_MODULE,
|
|
3106
|
+
Nr as IKON_UI_SHADERTOY_TYPE,
|
|
3099
3107
|
Ne as IKON_UI_STREAM_CATEGORY,
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3108
|
+
hr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3109
|
+
mr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3110
|
+
Zt as IkonUi,
|
|
3111
|
+
Ur as IkonUiRegistry,
|
|
3112
|
+
uo as IkonUiSurface,
|
|
3113
|
+
Jt as UiComponentRegistry,
|
|
3114
|
+
Ht as UiRenderer,
|
|
3115
|
+
Co as UiStreamStore,
|
|
3116
|
+
lo as areIkonUiModuleListsEqual,
|
|
3109
3117
|
bt as authenticateAnonymous,
|
|
3110
|
-
|
|
3118
|
+
Dn as buildOAuthRedirectUrl,
|
|
3111
3119
|
St as clearAuthSession,
|
|
3112
3120
|
ut as clearOAuthParams,
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3121
|
+
sr as createBaseResolvers,
|
|
3122
|
+
ao as createComponentLibrary,
|
|
3123
|
+
xr as createIkonUiRegistry,
|
|
3124
|
+
gr as createMediaResolvers,
|
|
3125
|
+
Pr as createShadertoyRendererResolver,
|
|
3126
|
+
Xt as isIkonUiCategoryMatch,
|
|
3119
3127
|
yt as loadAuthSession,
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3128
|
+
ar as loadBaseModule,
|
|
3129
|
+
br as loadMediaModule,
|
|
3130
|
+
Lr as loadShadertoyModule,
|
|
3131
|
+
dn as normalizeIkonUiModuleList,
|
|
3132
|
+
ho as parseIkonUiInitPayload,
|
|
3133
|
+
Un as parseOAuthCallback,
|
|
3134
|
+
xn as parseOAuthError,
|
|
3135
|
+
fn as readIkonUiModules,
|
|
3136
|
+
fo as readIkonUiModulesFromSources,
|
|
3137
|
+
cr as registerBaseModule,
|
|
3138
|
+
wr as registerMediaModule,
|
|
3139
|
+
Mr as registerShadertoyModule,
|
|
3140
|
+
qt as renderChildren,
|
|
3141
|
+
mo as renderMotionLetters,
|
|
3134
3142
|
Se as saveAuthSession,
|
|
3135
|
-
|
|
3143
|
+
po as sendMagicLink,
|
|
3136
3144
|
ue as sessionToUser,
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3145
|
+
Xn as useAuth,
|
|
3146
|
+
So as useAuthGuard,
|
|
3147
|
+
yo as useAuthOptional,
|
|
3148
|
+
Ao as useI18n,
|
|
3149
|
+
wo as useIkonApp,
|
|
3150
|
+
Wr as useIkonStyles,
|
|
3151
|
+
qr as useIkonUiStores,
|
|
3152
|
+
vo as useLazyFont,
|
|
3153
|
+
Ro as useToasts,
|
|
3154
|
+
J as useUiNode,
|
|
3155
|
+
co as useUiStore
|
|
3148
3156
|
};
|