@ikonai/sdk-react-ui 1.0.18 → 1.0.20
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/app/use-ikon-app.d.ts +1 -1
- package/index.d.ts +1 -1
- package/index.js +493 -499
- package/package.json +1 -1
- package/{shader/shader-gl.d.ts → shadertoy/shadertoy-gl.d.ts} +1 -1
- package/shadertoy/shadertoy-module.d.ts +7 -0
- package/shadertoy/shadertoy-renderer.d.ts +3 -0
- package/shader/shader-module.d.ts +0 -7
- package/shader/shader-renderer.d.ts +0 -3
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as
|
|
1
|
+
import { IkonUiCore as kt, UiStreamStore as Ct } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as ko } from "@ikonai/sdk-ui";
|
|
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 jt, subscribeToLogEvents as Lt, isDebugModeEnabled as Mt, LogLevel as We } from "@ikonai/sdk";
|
|
5
5
|
var de = { exports: {} }, oe = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
@@ -12,10 +12,10 @@ var de = { exports: {} }, oe = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
var ze;
|
|
16
|
+
function Ut() {
|
|
17
|
+
if (ze) return oe;
|
|
18
|
+
ze = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
20
|
function r(n, o, s) {
|
|
21
21
|
var i = null;
|
|
@@ -44,9 +44,9 @@ var se = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
47
|
+
var qe;
|
|
48
|
+
function xt() {
|
|
49
|
+
return qe || (qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(l) {
|
|
51
51
|
if (l == null) return null;
|
|
52
52
|
if (typeof l == "function")
|
|
@@ -79,7 +79,7 @@ function Dt() {
|
|
|
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 X:
|
|
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,11 +149,11 @@ function Dt() {
|
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
151
|
var l = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return Q[l] || (Q[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
|
}
|
|
156
|
-
function f(l, b, k, N, E, I, V,
|
|
156
|
+
function f(l, b, k, N, E, I, V, be) {
|
|
157
157
|
return k = I.ref, l = {
|
|
158
158
|
$$typeof: g,
|
|
159
159
|
type: l,
|
|
@@ -182,14 +182,14 @@ function Dt() {
|
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
|
-
value:
|
|
185
|
+
value: be
|
|
186
186
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
187
187
|
}
|
|
188
|
-
function d(l, b, k, N, E, I, V,
|
|
188
|
+
function d(l, b, k, N, E, I, V, be) {
|
|
189
189
|
var L = b.children;
|
|
190
190
|
if (L !== void 0)
|
|
191
191
|
if (N)
|
|
192
|
-
if (
|
|
192
|
+
if (Y(L)) {
|
|
193
193
|
for (N = 0; N < L.length; N++)
|
|
194
194
|
h(L[N]);
|
|
195
195
|
Object.freeze && Object.freeze(L);
|
|
@@ -200,8 +200,8 @@ function Dt() {
|
|
|
200
200
|
else h(L);
|
|
201
201
|
if (F.call(b, "key")) {
|
|
202
202
|
L = t(l);
|
|
203
|
-
var re = Object.keys(b).filter(function(
|
|
204
|
-
return
|
|
203
|
+
var re = Object.keys(b).filter(function(Tt) {
|
|
204
|
+
return Tt !== "key";
|
|
205
205
|
});
|
|
206
206
|
N = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", te[L + N] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -218,8 +218,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
218
218
|
}
|
|
219
219
|
if (L = null, k !== void 0 && (r(k), L = "" + k), i(b) && (r(b.key), L = "" + b.key), "key" in b) {
|
|
220
220
|
k = {};
|
|
221
|
-
for (var
|
|
222
|
-
|
|
221
|
+
for (var we in b)
|
|
222
|
+
we !== "key" && (k[we] = b[we]);
|
|
223
223
|
} else k = b;
|
|
224
224
|
return L && a(
|
|
225
225
|
k,
|
|
@@ -232,13 +232,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
232
232
|
o(),
|
|
233
233
|
k,
|
|
234
234
|
V,
|
|
235
|
-
|
|
235
|
+
be
|
|
236
236
|
);
|
|
237
237
|
}
|
|
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 =
|
|
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"), X = 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, Z = 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, Q = {}, J = u["react-stack-bottom-frame"].bind(
|
|
250
250
|
u,
|
|
251
251
|
s
|
|
252
|
-
)(), ee =
|
|
252
|
+
)(), ee = Z(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") : J,
|
|
263
|
+
I ? Z(n(l)) : ee
|
|
264
264
|
);
|
|
265
265
|
}, se.jsxs = function(l, b, k, N, E) {
|
|
266
266
|
var I = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
@@ -271,19 +271,19 @@ 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") : J,
|
|
275
|
+
I ? Z(n(l)) : ee
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
}()), se;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var Ge;
|
|
281
|
+
function Dt() {
|
|
282
|
+
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? de.exports = Ut() : de.exports = xt()), de.exports;
|
|
283
283
|
}
|
|
284
|
-
var R =
|
|
285
|
-
function
|
|
286
|
-
const r =
|
|
284
|
+
var R = Dt();
|
|
285
|
+
function Ft(t, e) {
|
|
286
|
+
const r = Ue(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
289
289
|
const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
|
|
@@ -303,15 +303,15 @@ function Bt(t, e) {
|
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
305
|
function H(t, e) {
|
|
306
|
-
const r =
|
|
306
|
+
const r = Ue(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
311
|
return K(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const Bt = ge("UIRenderer");
|
|
314
|
+
function $t(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,18 +322,18 @@ function Vt(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Vt(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Kt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
333
|
function Yt(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Wt(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;
|
|
@@ -341,8 +341,8 @@ function zt(t) {
|
|
|
341
341
|
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
const n = H(r.store, e), o = n ?
|
|
344
|
+
const _e = z(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = H(r.store, e), o = n ? Kt(n) : [], s = Wt(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]
|
|
@@ -350,21 +350,21 @@ const Ne = z(function t({ nodeId: e, context: r }) {
|
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */ R.jsx(
|
|
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 Bt.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = Vt(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
359
|
}, Yt);
|
|
360
|
-
function
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(
|
|
360
|
+
function zt(t, e) {
|
|
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 qt(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 Gt = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Ft(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 Ht = 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 = $t(m);
|
|
377
377
|
d.current?.(S, p);
|
|
378
378
|
}, []), y = K(() => {
|
|
379
379
|
const S = {
|
|
@@ -382,10 +382,10 @@ const Ht = 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) => zt(m, S),
|
|
386
386
|
renderView: (m) => {
|
|
387
387
|
const p = e.getSnapshot().views.get(m);
|
|
388
|
-
return p ? /* @__PURE__ */ R.jsx(
|
|
388
|
+
return p ? /* @__PURE__ */ R.jsx(_e, { nodeId: p.id, context: S }) : null;
|
|
389
389
|
},
|
|
390
390
|
dispatchAction: g,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
@@ -398,9 +398,9 @@ const Ht = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
398
398
|
};
|
|
399
399
|
return S;
|
|
400
400
|
}, [e, r, g]);
|
|
401
|
-
return !c || !f ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(
|
|
402
|
-
},
|
|
403
|
-
class
|
|
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
|
+
}, qt);
|
|
403
|
+
class Ht {
|
|
404
404
|
constructor(e, r) {
|
|
405
405
|
if (this.fallback = r, e)
|
|
406
406
|
for (const [n, o] of e)
|
|
@@ -417,22 +417,22 @@ class Jt {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function io(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
|
-
return new
|
|
422
|
+
return new Ht(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
return
|
|
424
|
+
function ao(t) {
|
|
425
|
+
return Ue(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
432
|
-
function
|
|
431
|
+
const Ne = "ikon-ui";
|
|
432
|
+
function Jt(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
435
|
+
const co = 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 uo = z(function({ stores: e, registry: r, category: n = Pe, onAction: o, c
|
|
|
442
442
|
const d = [];
|
|
443
443
|
for (const [h, u] of e) {
|
|
444
444
|
const g = u.store.getSnapshot();
|
|
445
|
-
|
|
445
|
+
Jt(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(Gt, { store: h, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, d)) });
|
|
453
453
|
});
|
|
454
|
-
class
|
|
454
|
+
class Xt {
|
|
455
455
|
core;
|
|
456
456
|
ownsCore;
|
|
457
457
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -459,7 +459,7 @@ class Zt {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new kt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
463
463
|
}
|
|
464
464
|
dispose() {
|
|
465
465
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -509,8 +509,8 @@ class Zt {
|
|
|
509
509
|
if (r)
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
512
|
+
category: Ne,
|
|
513
|
+
store: new Ct()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -518,7 +518,7 @@ class Zt {
|
|
|
518
518
|
const n = this.stores.get(e);
|
|
519
519
|
if (!n)
|
|
520
520
|
return !1;
|
|
521
|
-
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
521
|
+
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Ne;
|
|
522
522
|
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
@@ -526,7 +526,7 @@ class Zt {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function Zt(t) {
|
|
530
530
|
if (typeof t == "string") {
|
|
531
531
|
const e = t.trim();
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
@@ -542,7 +542,7 @@ function le(t) {
|
|
|
542
542
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function De(...t) {
|
|
546
546
|
let e = "";
|
|
547
547
|
for (const r of t)
|
|
548
548
|
if (r) {
|
|
@@ -551,19 +551,19 @@ function Fe(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
554
|
+
const He = /* @__PURE__ */ new WeakMap(), Qt = {};
|
|
555
|
+
function Fe(t) {
|
|
556
556
|
if (!t)
|
|
557
|
-
return
|
|
558
|
-
const e =
|
|
557
|
+
return Qt;
|
|
558
|
+
const e = He.get(t);
|
|
559
559
|
if (e)
|
|
560
560
|
return e;
|
|
561
561
|
const r = {};
|
|
562
562
|
for (const [n, o] of Object.entries(t))
|
|
563
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
564
|
-
return
|
|
564
|
+
return He.set(t, r), r;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function er() {
|
|
567
567
|
const t = z(function({ nodeId: r, context: n }) {
|
|
568
568
|
const o = H(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(() => {
|
|
@@ -619,16 +619,16 @@ function tr() {
|
|
|
619
619
|
return t;
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function tr() {
|
|
623
623
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
624
|
-
const s = H(n.store, r), i =
|
|
624
|
+
const s = H(n.store, r), i = Zt(s?.props?.onInvokeId), a = x(() => {
|
|
625
625
|
i && n.dispatchAction(i);
|
|
626
626
|
}, [i, n]);
|
|
627
627
|
if (!s)
|
|
628
628
|
return null;
|
|
629
|
-
const c =
|
|
629
|
+
const c = Fe(s.props);
|
|
630
630
|
delete c.onInvokeId;
|
|
631
|
-
const f =
|
|
631
|
+
const f = De(le(s.props?.className), o), d = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
632
632
|
return /* @__PURE__ */ R.jsx(
|
|
633
633
|
"div",
|
|
634
634
|
{
|
|
@@ -646,12 +646,12 @@ function rr() {
|
|
|
646
646
|
return t;
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function rr() {
|
|
650
650
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
651
651
|
const s = H(n.store, r);
|
|
652
652
|
if (!s)
|
|
653
653
|
return null;
|
|
654
|
-
const i =
|
|
654
|
+
const i = Fe(s.props), a = De("relative", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
655
655
|
return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
656
656
|
});
|
|
657
657
|
return ({ type: e }) => {
|
|
@@ -659,12 +659,12 @@ function nr() {
|
|
|
659
659
|
return t;
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function nr() {
|
|
663
663
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
664
664
|
const s = H(n.store, r);
|
|
665
665
|
if (!s)
|
|
666
666
|
return null;
|
|
667
|
-
const i =
|
|
667
|
+
const i = Fe(s.props), a = De("absolute", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
668
668
|
return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
669
669
|
});
|
|
670
670
|
return ({ type: e }) => {
|
|
@@ -672,19 +672,19 @@ function or() {
|
|
|
672
672
|
return t;
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function or() {
|
|
676
676
|
return [
|
|
677
|
+
tr(),
|
|
677
678
|
rr(),
|
|
678
679
|
nr(),
|
|
679
|
-
|
|
680
|
-
tr()
|
|
680
|
+
er()
|
|
681
681
|
];
|
|
682
682
|
}
|
|
683
|
-
const
|
|
684
|
-
function
|
|
685
|
-
t.registerModule(
|
|
683
|
+
const sr = "base", ir = async () => or();
|
|
684
|
+
function ar(t) {
|
|
685
|
+
t.registerModule(sr, ir);
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function cr(t) {
|
|
688
688
|
if (typeof t == "string") {
|
|
689
689
|
const e = t.trim();
|
|
690
690
|
return e.length > 0 ? e : void 0;
|
|
@@ -694,13 +694,13 @@ function ur(t) {
|
|
|
694
694
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function ur(...t) {
|
|
698
698
|
const e = [];
|
|
699
699
|
for (const r of t)
|
|
700
700
|
r && r.trim() && e.push(r.trim());
|
|
701
701
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function Je(t) {
|
|
704
704
|
if (typeof t != "string")
|
|
705
705
|
return;
|
|
706
706
|
const e = t.trim();
|
|
@@ -715,8 +715,8 @@ function fe(t) {
|
|
|
715
715
|
if (e === "false") return !1;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
const
|
|
719
|
-
function
|
|
718
|
+
const lr = "std.audio-url-player";
|
|
719
|
+
function dr() {
|
|
720
720
|
const t = z(function({
|
|
721
721
|
nodeId: r,
|
|
722
722
|
context: n,
|
|
@@ -725,7 +725,7 @@ function fr() {
|
|
|
725
725
|
const s = H(n.store, r);
|
|
726
726
|
if (!s)
|
|
727
727
|
return null;
|
|
728
|
-
const i =
|
|
728
|
+
const i = ur(cr(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,11 +741,11 @@ function fr() {
|
|
|
741
741
|
);
|
|
742
742
|
});
|
|
743
743
|
return ({ type: e }) => {
|
|
744
|
-
if (e ===
|
|
744
|
+
if (e === lr)
|
|
745
745
|
return t;
|
|
746
746
|
};
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function dt(t) {
|
|
749
749
|
if (typeof t == "string") {
|
|
750
750
|
const e = t.trim();
|
|
751
751
|
return e.length > 0 ? e : void 0;
|
|
@@ -755,13 +755,13 @@ function ft(t) {
|
|
|
755
755
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function ft(...t) {
|
|
759
759
|
const e = [];
|
|
760
760
|
for (const r of t)
|
|
761
761
|
r && r.trim() && e.push(r.trim());
|
|
762
762
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function he(t) {
|
|
765
765
|
if (typeof t == "number" && Number.isFinite(t))
|
|
766
766
|
return Math.floor(t);
|
|
767
767
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -770,16 +770,16 @@ function me(t) {
|
|
|
770
770
|
return Math.floor(e);
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Pe(t) {
|
|
774
774
|
if (typeof t != "string")
|
|
775
775
|
return;
|
|
776
776
|
const e = t.trim();
|
|
777
777
|
return e.length > 0 ? e : void 0;
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
function
|
|
779
|
+
const fr = "std.video-canvas", hr = "std.video-url-player";
|
|
780
|
+
function mr() {
|
|
781
781
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
782
|
-
const s = H(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 ?
|
|
782
|
+
const s = H(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 pr() {
|
|
|
820
820
|
) : null;
|
|
821
821
|
});
|
|
822
822
|
return ({ type: e }) => {
|
|
823
|
-
if (e ===
|
|
823
|
+
if (e === fr)
|
|
824
824
|
return t;
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
return [
|
|
827
|
+
function pr() {
|
|
828
|
+
return [mr(), gr(), dr()];
|
|
829
829
|
}
|
|
830
830
|
function ie(t) {
|
|
831
831
|
if (typeof t == "boolean")
|
|
@@ -836,7 +836,7 @@ function ie(t) {
|
|
|
836
836
|
if (e === "false") return !1;
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function gr() {
|
|
840
840
|
const t = z(function({
|
|
841
841
|
nodeId: r,
|
|
842
842
|
context: n,
|
|
@@ -845,7 +845,7 @@ function yr() {
|
|
|
845
845
|
const s = H(n.store, r);
|
|
846
846
|
if (!s)
|
|
847
847
|
return null;
|
|
848
|
-
const i =
|
|
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;
|
|
849
849
|
return /* @__PURE__ */ R.jsx(
|
|
850
850
|
"video",
|
|
851
851
|
{
|
|
@@ -865,27 +865,27 @@ function yr() {
|
|
|
865
865
|
);
|
|
866
866
|
});
|
|
867
867
|
return ({ type: e }) => {
|
|
868
|
-
if (e ===
|
|
868
|
+
if (e === hr)
|
|
869
869
|
return t;
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
|
-
const
|
|
873
|
-
function
|
|
874
|
-
t.registerModule(
|
|
872
|
+
const yr = "media", Sr = async () => pr();
|
|
873
|
+
function br(t) {
|
|
874
|
+
t.registerModule(yr, Sr);
|
|
875
875
|
}
|
|
876
|
-
const
|
|
876
|
+
const wr = `#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 vr(t, e) {
|
|
883
883
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function Rr(t, e) {
|
|
886
886
|
const r = [];
|
|
887
887
|
for (const [n, o] of Object.entries(e)) {
|
|
888
|
-
if (
|
|
888
|
+
if (vr(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 Er {
|
|
942
942
|
gl;
|
|
943
943
|
program = null;
|
|
944
944
|
positionBuffer = null;
|
|
@@ -974,10 +974,10 @@ class Ar {
|
|
|
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, wr);
|
|
978
978
|
if (!o)
|
|
979
979
|
return !1;
|
|
980
|
-
const s =
|
|
980
|
+
const s = Rr(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 Ar {
|
|
|
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 Ar(t) {
|
|
1072
1072
|
if (typeof t == "string") {
|
|
1073
1073
|
const e = t.trim();
|
|
1074
1074
|
return e.length > 0 ? e : void 0;
|
|
@@ -1078,13 +1078,13 @@ function Tr(t) {
|
|
|
1078
1078
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function Tr(...t) {
|
|
1082
1082
|
const e = [];
|
|
1083
1083
|
for (const r of t)
|
|
1084
1084
|
r && r.trim() && e.push(r.trim());
|
|
1085
1085
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function ve(t) {
|
|
1088
1088
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1089
1089
|
return Math.floor(t);
|
|
1090
1090
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1093,10 +1093,10 @@ function Re(t) {
|
|
|
1093
1093
|
return Math.floor(e);
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function kr(t) {
|
|
1097
1097
|
return typeof t == "string" ? t : "";
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Cr(t) {
|
|
1100
1100
|
if (typeof t == "boolean")
|
|
1101
1101
|
return t;
|
|
1102
1102
|
if (typeof t == "string") {
|
|
@@ -1105,7 +1105,7 @@ function Ir(t) {
|
|
|
1105
1105
|
if (e === "false") return !1;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function Ir(t) {
|
|
1109
1109
|
if (!t || typeof t != "object")
|
|
1110
1110
|
return {};
|
|
1111
1111
|
const e = {}, r = t;
|
|
@@ -1120,7 +1120,7 @@ function Or(t) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
return e;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function Or(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,8 +1141,8 @@ function _r(t, e) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
return !0;
|
|
1143
1143
|
}
|
|
1144
|
-
const
|
|
1145
|
-
function
|
|
1144
|
+
const _r = "std.shadertoy-canvas";
|
|
1145
|
+
function Nr() {
|
|
1146
1146
|
const t = z(function({ nodeId: r, context: n, className: o }) {
|
|
1147
1147
|
const s = H(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,
|
|
@@ -1150,15 +1150,15 @@ function Pr() {
|
|
|
1150
1150
|
clickX: 0,
|
|
1151
1151
|
clickY: 0,
|
|
1152
1152
|
isDown: !1
|
|
1153
|
-
}), g = s ?
|
|
1153
|
+
}), g = s ? kr(s.props?.shaderSource) : "", y = s ? ve(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, m = K(() => Ir(S), [S]), p = s ? Cr(s.props?.enableMouse) ?? !0 : !0, w = s ? ve(s.props?.width) : void 0, T = s ? ve(s.props?.height) : void 0, _ = s ? Tr(Ar(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 Er(C);
|
|
1159
1159
|
a.current = P;
|
|
1160
1160
|
} catch (P) {
|
|
1161
|
-
console.error("[
|
|
1161
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
|
|
1162
1162
|
}
|
|
1163
1163
|
return () => {
|
|
1164
1164
|
a.current && (a.current.destroy(), a.current = null);
|
|
@@ -1171,11 +1171,11 @@ function Pr() {
|
|
|
1171
1171
|
d.current = g, h.current = m;
|
|
1172
1172
|
else {
|
|
1173
1173
|
const U = C.getError();
|
|
1174
|
-
console.error("[
|
|
1174
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", U);
|
|
1175
1175
|
}
|
|
1176
1176
|
}, [g, m]), M(() => {
|
|
1177
1177
|
const C = a.current;
|
|
1178
|
-
!C || !d.current ||
|
|
1178
|
+
!C || !d.current || Or(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;
|
|
@@ -1192,8 +1192,8 @@ function Pr() {
|
|
|
1192
1192
|
if (!p) return;
|
|
1193
1193
|
const P = i.current, U = a.current;
|
|
1194
1194
|
if (!P || !U) return;
|
|
1195
|
-
const O = P.getBoundingClientRect(), F = C.clientX - O.left,
|
|
1196
|
-
u.current.x = F, u.current.y =
|
|
1195
|
+
const O = P.getBoundingClientRect(), F = C.clientX - O.left, Y = O.height - (C.clientY - O.top);
|
|
1196
|
+
u.current.x = F, u.current.y = Y, U.setMouse(F, Y, u.current.clickX, u.current.clickY);
|
|
1197
1197
|
},
|
|
1198
1198
|
[p]
|
|
1199
1199
|
), G = x(
|
|
@@ -1201,11 +1201,11 @@ function Pr() {
|
|
|
1201
1201
|
if (!p) return;
|
|
1202
1202
|
const P = i.current, U = a.current;
|
|
1203
1203
|
if (!P || !U) return;
|
|
1204
|
-
const O = P.getBoundingClientRect(), F = C.clientX - O.left,
|
|
1205
|
-
u.current.isDown = !0, u.current.clickX = F, u.current.clickY =
|
|
1204
|
+
const O = P.getBoundingClientRect(), F = C.clientX - O.left, Y = O.height - (C.clientY - O.top);
|
|
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
|
+
), X = 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 Pr() {
|
|
|
1218
1218
|
...T ? { height: T } : {},
|
|
1219
1219
|
onMouseMove: D,
|
|
1220
1220
|
onMouseDown: G,
|
|
1221
|
-
onMouseUp:
|
|
1222
|
-
onMouseLeave:
|
|
1221
|
+
onMouseUp: X,
|
|
1222
|
+
onMouseLeave: X
|
|
1223
1223
|
}
|
|
1224
1224
|
) : null;
|
|
1225
1225
|
});
|
|
1226
1226
|
return ({ type: e }) => {
|
|
1227
|
-
if (e ===
|
|
1227
|
+
if (e === _r)
|
|
1228
1228
|
return t;
|
|
1229
1229
|
};
|
|
1230
1230
|
}
|
|
1231
|
-
const
|
|
1232
|
-
function
|
|
1233
|
-
t.registerModule(
|
|
1231
|
+
const Pr = "shadertoy", jr = async () => Nr();
|
|
1232
|
+
function Lr(t) {
|
|
1233
|
+
t.registerModule(Pr, jr);
|
|
1234
1234
|
}
|
|
1235
|
-
const
|
|
1236
|
-
class
|
|
1235
|
+
const Xe = ge("UIRegistry");
|
|
1236
|
+
class Mr {
|
|
1237
1237
|
baseResolvers = [];
|
|
1238
1238
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1239
1239
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1255,15 +1255,15 @@ class Ur {
|
|
|
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 = Dr(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);
|
|
1262
1262
|
}
|
|
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 Fr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1267
1267
|
}
|
|
1268
1268
|
resolve(e) {
|
|
1269
1269
|
for (const r of this.baseResolvers) {
|
|
@@ -1273,7 +1273,7 @@ class Ur {
|
|
|
1273
1273
|
for (const r of this.activeModuleOrder) {
|
|
1274
1274
|
const n = this.moduleResolvers.get(r);
|
|
1275
1275
|
if (!n) {
|
|
1276
|
-
|
|
1276
|
+
Xe.warn(`Missing resolvers for module ${r}`);
|
|
1277
1277
|
continue;
|
|
1278
1278
|
}
|
|
1279
1279
|
for (const o of n) {
|
|
@@ -1283,17 +1283,17 @@ class Ur {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1287
|
-
const t = new
|
|
1288
|
-
return
|
|
1286
|
+
function Ur() {
|
|
1287
|
+
const t = new Mr();
|
|
1288
|
+
return ar(t), br(t), Lr(t), t.loadRegisteredModules(), t;
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1290
|
+
function xr(t) {
|
|
1291
1291
|
return Array.isArray(t) ? t : [t];
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return t ?
|
|
1293
|
+
function Dr(t) {
|
|
1294
|
+
return t ? xr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function Fr(t, e) {
|
|
1297
1297
|
if (t.length !== e.length)
|
|
1298
1298
|
return !1;
|
|
1299
1299
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1301,7 +1301,7 @@ function Br(t, e) {
|
|
|
1301
1301
|
return !1;
|
|
1302
1302
|
return !0;
|
|
1303
1303
|
}
|
|
1304
|
-
const
|
|
1304
|
+
const Re = ge("MotionController"), Ze = {
|
|
1305
1305
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1306
1306
|
"ease-in": [0.42, 0, 1, 1],
|
|
1307
1307
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1334,17 +1334,17 @@ const Ee = ye("MotionController"), Qe = {
|
|
|
1334
1334
|
function $(t) {
|
|
1335
1335
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Qe(t) {
|
|
1338
1338
|
if (t == null) return;
|
|
1339
1339
|
const e = `${t}`.trim();
|
|
1340
1340
|
if (!e) return;
|
|
1341
1341
|
const r = Number.parseFloat(e);
|
|
1342
1342
|
return Number.isFinite(r) ? r : void 0;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function et(t) {
|
|
1345
1345
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function tt(t, e, r, n) {
|
|
1348
1348
|
const d = new Float32Array(11);
|
|
1349
1349
|
function h(m, p, w) {
|
|
1350
1350
|
return ((3 * p - 3 * w + 1) * m + (3 * w - 6 * p)) * m * m + 3 * p * m;
|
|
@@ -1382,37 +1382,37 @@ function rt(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 Br(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 $r(t) {
|
|
1393
1393
|
if (!t)
|
|
1394
1394
|
return (r) => $(r);
|
|
1395
1395
|
const e = t.trim().toLowerCase();
|
|
1396
1396
|
if (!e || e === "linear")
|
|
1397
1397
|
return (r) => $(r);
|
|
1398
|
-
if (
|
|
1399
|
-
const [r, n, o, s] =
|
|
1398
|
+
if (Ze[e]) {
|
|
1399
|
+
const [r, n, o, s] = Ze[e], i = tt(r, n, o, s);
|
|
1400
1400
|
return (a) => $(i($(a)));
|
|
1401
1401
|
}
|
|
1402
1402
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1403
1403
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1404
1404
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1405
|
-
const [o, s, i, a] = n, c =
|
|
1405
|
+
const [o, s, i, a] = n, c = tt(o, s, i, a);
|
|
1406
1406
|
return (f) => $(c($(f)));
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
1409
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1410
|
-
const r =
|
|
1410
|
+
const r = Br(e);
|
|
1411
1411
|
return (n) => r($(n));
|
|
1412
1412
|
}
|
|
1413
1413
|
return (r) => $(r);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Vr(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 Kr(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 Kr {
|
|
1426
1426
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1427
1427
|
observer;
|
|
1428
1428
|
observeScheduled = !1;
|
|
@@ -1449,7 +1449,7 @@ class Wr {
|
|
|
1449
1449
|
try {
|
|
1450
1450
|
e();
|
|
1451
1451
|
} catch (r) {
|
|
1452
|
-
|
|
1452
|
+
Re.warn("Failed to cleanup binding listener", r);
|
|
1453
1453
|
}
|
|
1454
1454
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
|
|
1455
1455
|
}
|
|
@@ -1459,7 +1459,7 @@ class Wr {
|
|
|
1459
1459
|
const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1460
1460
|
return n.length === 0 ? void 0 : { bindings: n };
|
|
1461
1461
|
} catch (r) {
|
|
1462
|
-
|
|
1462
|
+
Re.warn("Failed to parse motion metadata", r);
|
|
1463
1463
|
return;
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
@@ -1467,7 +1467,7 @@ class Wr {
|
|
|
1467
1467
|
const r = e.source?.trim();
|
|
1468
1468
|
if (!r)
|
|
1469
1469
|
return;
|
|
1470
|
-
const n =
|
|
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 = $r(e.ease), f = Vr(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,
|
|
@@ -1525,7 +1525,7 @@ class Wr {
|
|
|
1525
1525
|
const r = this.bindingsByStyle.get(e);
|
|
1526
1526
|
if (!r || typeof document > "u")
|
|
1527
1527
|
return;
|
|
1528
|
-
const n = `.${
|
|
1528
|
+
const n = `.${et(e)}`;
|
|
1529
1529
|
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1530
1530
|
}
|
|
1531
1531
|
applyStyleToElement(e, r, n) {
|
|
@@ -1565,7 +1565,7 @@ class Wr {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
resolveScrollContainer(e, r) {
|
|
1567
1567
|
if (r.targetId) {
|
|
1568
|
-
const n = `[data-ikon-motion-source="${
|
|
1568
|
+
const n = `[data-ikon-motion-source="${et(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1569
1569
|
if (o)
|
|
1570
1570
|
return o;
|
|
1571
1571
|
}
|
|
@@ -1635,7 +1635,7 @@ class Wr {
|
|
|
1635
1635
|
try {
|
|
1636
1636
|
i();
|
|
1637
1637
|
} catch (a) {
|
|
1638
|
-
|
|
1638
|
+
Re.warn("Failed to cleanup listener", a);
|
|
1639
1639
|
}
|
|
1640
1640
|
this.globalCleanups.delete(i);
|
|
1641
1641
|
}
|
|
@@ -1680,7 +1680,7 @@ class Wr {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const
|
|
1683
|
+
const Ee = new Kr();
|
|
1684
1684
|
function Yr(t) {
|
|
1685
1685
|
const e = A(/* @__PURE__ */ new Map()), r = x(({ styleId: s, css: i, common: a }) => {
|
|
1686
1686
|
if (!(!s || typeof document > "u")) {
|
|
@@ -1688,13 +1688,13 @@ function Yr(t) {
|
|
|
1688
1688
|
let c = e.current.get(s);
|
|
1689
1689
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1690
1690
|
}
|
|
1691
|
-
|
|
1691
|
+
Ee.registerStyle(s, a);
|
|
1692
1692
|
}
|
|
1693
1693
|
}, []), n = x((s) => {
|
|
1694
1694
|
if (!(typeof document > "u"))
|
|
1695
1695
|
for (const i of s) {
|
|
1696
1696
|
const a = e.current.get(i);
|
|
1697
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1697
|
+
a && (a.remove(), e.current.delete(i)), Ee.unregisterStyle(i);
|
|
1698
1698
|
}
|
|
1699
1699
|
}, []), o = x(() => {
|
|
1700
1700
|
if (typeof document < "u") {
|
|
@@ -1702,7 +1702,7 @@ function Yr(t) {
|
|
|
1702
1702
|
s.remove();
|
|
1703
1703
|
e.current.clear();
|
|
1704
1704
|
}
|
|
1705
|
-
|
|
1705
|
+
Ee.reset();
|
|
1706
1706
|
}, []);
|
|
1707
1707
|
return M(() => {
|
|
1708
1708
|
if (!t) return;
|
|
@@ -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 Wr(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,62 +1722,62 @@ function zr(t) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
return e.sort(), e.join(",");
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1726
|
-
const [e, r] =
|
|
1725
|
+
function zr(t) {
|
|
1726
|
+
const [e, r] = W(), n = A("");
|
|
1727
1727
|
return M(() => {
|
|
1728
1728
|
if (!t) {
|
|
1729
1729
|
r(void 0), n.current = "";
|
|
1730
1730
|
return;
|
|
1731
1731
|
}
|
|
1732
1732
|
const o = () => {
|
|
1733
|
-
const s = t.getStores(), i =
|
|
1733
|
+
const s = t.getStores(), i = Wr(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 qr = typeof global == "object" && global && global.Object === Object && global, Gr = typeof self == "object" && self && self.Object === Object && self, Hr = qr || Gr || Function("return this")(), me = Hr.Symbol, ht = Object.prototype, Jr = ht.hasOwnProperty, Xr = ht.toString, ae = me ? me.toStringTag : void 0;
|
|
1740
|
+
function Zr(t) {
|
|
1741
|
+
var e = Jr.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 = Xr.call(t);
|
|
1748
1748
|
return n && (e ? t[ae] = r : delete t[ae]), o;
|
|
1749
1749
|
}
|
|
1750
|
-
var
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1750
|
+
var Qr = Object.prototype, en = Qr.toString;
|
|
1751
|
+
function tn(t) {
|
|
1752
|
+
return en.call(t);
|
|
1753
1753
|
}
|
|
1754
|
-
var
|
|
1755
|
-
function
|
|
1756
|
-
return t == null ? t === void 0 ?
|
|
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);
|
|
1757
1757
|
}
|
|
1758
|
-
function
|
|
1758
|
+
function sn(t) {
|
|
1759
1759
|
return t != null && typeof t == "object";
|
|
1760
1760
|
}
|
|
1761
|
-
var
|
|
1762
|
-
function
|
|
1763
|
-
return typeof t == "string" || !
|
|
1761
|
+
var an = Array.isArray, cn = "[object String]";
|
|
1762
|
+
function un(t) {
|
|
1763
|
+
return typeof t == "string" || !an(t) && sn(t) && on(t) == cn;
|
|
1764
1764
|
}
|
|
1765
|
-
const
|
|
1766
|
-
function
|
|
1765
|
+
const nt = "ikonUiModules";
|
|
1766
|
+
function je(t) {
|
|
1767
1767
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function ln(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 (!un(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 uo(t, e) {
|
|
1781
1781
|
if (t === e)
|
|
1782
1782
|
return !0;
|
|
1783
1783
|
if (!t || !e)
|
|
@@ -1789,19 +1789,19 @@ function lo(t, e) {
|
|
|
1789
1789
|
return !1;
|
|
1790
1790
|
return !0;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1793
|
-
if (!(!
|
|
1794
|
-
return
|
|
1792
|
+
function dn(t) {
|
|
1793
|
+
if (!(!je(t) || !Object.prototype.hasOwnProperty.call(t, nt)))
|
|
1794
|
+
return ln(t[nt]);
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function lo(...t) {
|
|
1797
1797
|
for (const e of t) {
|
|
1798
|
-
const r =
|
|
1798
|
+
const r = dn(e);
|
|
1799
1799
|
if (r !== void 0)
|
|
1800
1800
|
return r;
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
1803
|
-
function
|
|
1804
|
-
if (!
|
|
1803
|
+
function fo(t) {
|
|
1804
|
+
if (!je(t))
|
|
1805
1805
|
return;
|
|
1806
1806
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1807
1807
|
if (!r)
|
|
@@ -1820,7 +1820,7 @@ function ho(t) {
|
|
|
1820
1820
|
o.push(S), i.add(S);
|
|
1821
1821
|
continue;
|
|
1822
1822
|
}
|
|
1823
|
-
if (!
|
|
1823
|
+
if (!je(c))
|
|
1824
1824
|
continue;
|
|
1825
1825
|
const f = c, d = Object.keys(f).find((S) => S.toLowerCase() === "name");
|
|
1826
1826
|
if (!d)
|
|
@@ -1849,7 +1849,7 @@ const v = {
|
|
|
1849
1849
|
Line: 4,
|
|
1850
1850
|
Paragraph: 8,
|
|
1851
1851
|
Emoji: 16
|
|
1852
|
-
},
|
|
1852
|
+
}, fn = [
|
|
1853
1853
|
{
|
|
1854
1854
|
flag: v.Letter,
|
|
1855
1855
|
hints: [
|
|
@@ -1898,32 +1898,32 @@ const v = {
|
|
|
1898
1898
|
"[data-emoji]"
|
|
1899
1899
|
]
|
|
1900
1900
|
}
|
|
1901
|
-
],
|
|
1902
|
-
function
|
|
1903
|
-
if (!t || t.length >
|
|
1901
|
+
], Le = v.Letter | v.Word | v.Line | v.Paragraph | v.Emoji, hn = v.Letter | v.Word | v.Line | v.Paragraph, ot = /* @__PURE__ */ new Map(), mn = 16384;
|
|
1902
|
+
function ho(t, e) {
|
|
1903
|
+
if (!t || t.length > mn)
|
|
1904
1904
|
return t;
|
|
1905
|
-
const r =
|
|
1905
|
+
const r = Nn(e), n = ne(r, v.Emoji), o = r & hn;
|
|
1906
1906
|
if (o === v.None && !n)
|
|
1907
1907
|
return t;
|
|
1908
1908
|
const s = t.replace(/\r\n/g, `
|
|
1909
1909
|
`).replace(/\r/g, `
|
|
1910
1910
|
`);
|
|
1911
1911
|
if (o === v.None)
|
|
1912
|
-
return
|
|
1913
|
-
const i =
|
|
1912
|
+
return ct(s);
|
|
1913
|
+
const i = On(s);
|
|
1914
1914
|
if (i.length === 0)
|
|
1915
|
-
return n ?
|
|
1916
|
-
const a =
|
|
1915
|
+
return n ? ct(s) : t;
|
|
1916
|
+
const a = _n(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 = pn(d, r, c);
|
|
1919
1919
|
f.push(...h);
|
|
1920
1920
|
}
|
|
1921
1921
|
return f;
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1923
|
+
function pn(t, e, r) {
|
|
1924
1924
|
const n = [];
|
|
1925
1925
|
for (const o of t) {
|
|
1926
|
-
const s =
|
|
1926
|
+
const s = gn(o, e, r);
|
|
1927
1927
|
n.push(...s);
|
|
1928
1928
|
}
|
|
1929
1929
|
if (ne(e, v.Paragraph)) {
|
|
@@ -1933,7 +1933,7 @@ function gn(t, e, r) {
|
|
|
1933
1933
|
"span",
|
|
1934
1934
|
{
|
|
1935
1935
|
"data-motion-paragraph": !0,
|
|
1936
|
-
style:
|
|
1936
|
+
style: ye(o),
|
|
1937
1937
|
children: n
|
|
1938
1938
|
},
|
|
1939
1939
|
`motion-paragraph-${o}`
|
|
@@ -1942,12 +1942,12 @@ function gn(t, e, r) {
|
|
|
1942
1942
|
}
|
|
1943
1943
|
return n;
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1946
|
-
const n =
|
|
1945
|
+
function gn(t, e, r) {
|
|
1946
|
+
const n = yn(t.text, e, r), o = [];
|
|
1947
1947
|
if (ne(e, v.Line)) {
|
|
1948
1948
|
const s = r.line++;
|
|
1949
1949
|
o.push(
|
|
1950
|
-
/* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style:
|
|
1950
|
+
/* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style: ye(s), children: n }, `motion-line-${s}`)
|
|
1951
1951
|
);
|
|
1952
1952
|
} else
|
|
1953
1953
|
o.push(...n);
|
|
@@ -1955,7 +1955,7 @@ function yn(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 yn(t, e, r) {
|
|
1959
1959
|
if (!t)
|
|
1960
1960
|
return [];
|
|
1961
1961
|
const n = ne(e, v.Word), o = [], s = /(\s+)/g;
|
|
@@ -1963,39 +1963,39 @@ function Sn(t, e, r) {
|
|
|
1963
1963
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1964
1964
|
if (a.index > i) {
|
|
1965
1965
|
const c = t.slice(i, a.index);
|
|
1966
|
-
o.push(
|
|
1966
|
+
o.push(st(c, r, e, n));
|
|
1967
1967
|
}
|
|
1968
1968
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1969
1969
|
}
|
|
1970
1970
|
if (i < t.length) {
|
|
1971
1971
|
const c = t.slice(i);
|
|
1972
|
-
o.push(
|
|
1972
|
+
o.push(st(c, r, e, n));
|
|
1973
1973
|
}
|
|
1974
1974
|
return o;
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const o = e.word++, s =
|
|
1976
|
+
function st(t, e, r, n) {
|
|
1977
|
+
const o = e.word++, s = bn(t, r, e), i = `motion-word-${o}`, a = Sn(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
|
|
1981
|
-
return e ? { ...
|
|
1980
|
+
function Sn(t, e) {
|
|
1981
|
+
return e ? { ...ye(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1983
|
+
function bn(t, e, r) {
|
|
1984
1984
|
if (!t)
|
|
1985
1985
|
return [];
|
|
1986
1986
|
const n = ne(e, v.Letter), o = ne(e, v.Emoji);
|
|
1987
1987
|
if (!n) {
|
|
1988
1988
|
if (!o)
|
|
1989
1989
|
return [t];
|
|
1990
|
-
const a =
|
|
1990
|
+
const a = Me(t);
|
|
1991
1991
|
if (a.length === 0)
|
|
1992
1992
|
return [t];
|
|
1993
|
-
const { nodes: c } =
|
|
1993
|
+
const { nodes: c } = pt(a, r);
|
|
1994
1994
|
return c;
|
|
1995
1995
|
}
|
|
1996
|
-
const s = [], i =
|
|
1996
|
+
const s = [], i = Me(t);
|
|
1997
1997
|
for (const a of i) {
|
|
1998
|
-
const c = r.letter++, f = `motion-letter-${c}`, d =
|
|
1998
|
+
const c = r.letter++, f = `motion-letter-${c}`, d = ye(c);
|
|
1999
1999
|
if (a === `
|
|
2000
2000
|
`) {
|
|
2001
2001
|
s.push(
|
|
@@ -2003,55 +2003,55 @@ function wn(t, e, r) {
|
|
|
2003
2003
|
);
|
|
2004
2004
|
continue;
|
|
2005
2005
|
}
|
|
2006
|
-
const u = o &&
|
|
2006
|
+
const u = o && mt(a) ? { "data-motion-emoji": !0 } : void 0, g = a === " " ? " " : a;
|
|
2007
2007
|
s.push(
|
|
2008
2008
|
/* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, ...u, children: g }, f)
|
|
2009
2009
|
);
|
|
2010
2010
|
}
|
|
2011
2011
|
return s;
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
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 = wn();
|
|
2017
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : vn(t);
|
|
2018
2018
|
}
|
|
2019
2019
|
let ce;
|
|
2020
|
-
function
|
|
2020
|
+
function wn() {
|
|
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 vn(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 && Rn(s, i)) && (e.push(n), n = "");
|
|
2029
2029
|
}
|
|
2030
2030
|
return n && e.push(n), e;
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2033
|
-
return e ? !!(
|
|
2032
|
+
function Rn(t, e) {
|
|
2033
|
+
return e ? !!(it(t) || it(e) || Tn(e) || En(e) || An(e) || at(t) && at(e)) : !1;
|
|
2034
2034
|
}
|
|
2035
|
-
function
|
|
2035
|
+
function it(t) {
|
|
2036
2036
|
return t.codePointAt(0) === 8205;
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function En(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 An(t) {
|
|
2043
2043
|
const e = t.codePointAt(0);
|
|
2044
2044
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2046
|
+
function at(t) {
|
|
2047
2047
|
const e = t.codePointAt(0);
|
|
2048
2048
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2049
2049
|
}
|
|
2050
|
-
let
|
|
2051
|
-
function
|
|
2052
|
-
return t ? (
|
|
2050
|
+
let Ae;
|
|
2051
|
+
function Tn(t) {
|
|
2052
|
+
return t ? (Ae || (Ae = kn()), Ae(t)) : !1;
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2054
|
+
function kn() {
|
|
2055
2055
|
try {
|
|
2056
2056
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2057
2057
|
return (e) => t.test(e);
|
|
@@ -2062,19 +2062,19 @@ function Cn() {
|
|
|
2062
2062
|
};
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
let
|
|
2066
|
-
function
|
|
2067
|
-
return t ? (
|
|
2065
|
+
let Te;
|
|
2066
|
+
function mt(t) {
|
|
2067
|
+
return t ? (Te || (Te = Cn()), Te(t)) : !1;
|
|
2068
2068
|
}
|
|
2069
|
-
function
|
|
2069
|
+
function Cn() {
|
|
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 In;
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function In(t) {
|
|
2078
2078
|
if (!t)
|
|
2079
2079
|
return !1;
|
|
2080
2080
|
for (const e of Array.from(t)) {
|
|
@@ -2084,7 +2084,7 @@ function On(t) {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
return !1;
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function On(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 _n(t) {
|
|
|
2098
2098
|
}
|
|
2099
2099
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
2100
2100
|
}
|
|
2101
|
-
function
|
|
2101
|
+
function _n(t) {
|
|
2102
2102
|
if (t.length === 0)
|
|
2103
2103
|
return [];
|
|
2104
2104
|
const e = [];
|
|
@@ -2110,7 +2110,7 @@ function Nn(t) {
|
|
|
2110
2110
|
function ne(t, e) {
|
|
2111
2111
|
return (t & e) === e;
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function ye(t) {
|
|
2114
2114
|
return {
|
|
2115
2115
|
"--tw-motion-seq-index": t.toString(),
|
|
2116
2116
|
backgroundColor: "inherit",
|
|
@@ -2127,23 +2127,23 @@ function Se(t) {
|
|
|
2127
2127
|
WebkitTextFillColor: "inherit"
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2130
|
+
function ct(t) {
|
|
2131
2131
|
if (!t)
|
|
2132
2132
|
return t;
|
|
2133
|
-
const e =
|
|
2133
|
+
const e = Me(t);
|
|
2134
2134
|
if (e.length === 0)
|
|
2135
2135
|
return t;
|
|
2136
|
-
const { nodes: r, sawEmoji: n } =
|
|
2136
|
+
const { nodes: r, sawEmoji: n } = pt(e);
|
|
2137
2137
|
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
2138
2138
|
}
|
|
2139
|
-
function
|
|
2139
|
+
function pt(t, e) {
|
|
2140
2140
|
const r = [];
|
|
2141
2141
|
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
2142
2142
|
const i = () => {
|
|
2143
2143
|
n && (r.push(n), n = "");
|
|
2144
2144
|
};
|
|
2145
2145
|
for (const a of t) {
|
|
2146
|
-
if (
|
|
2146
|
+
if (mt(a)) {
|
|
2147
2147
|
o = !0, i();
|
|
2148
2148
|
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2149
2149
|
r.push(
|
|
@@ -2155,13 +2155,13 @@ function gt(t, e) {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function Nn(t) {
|
|
2159
2159
|
if (!t)
|
|
2160
2160
|
return v.None;
|
|
2161
2161
|
const e = t.trim();
|
|
2162
2162
|
if (!e)
|
|
2163
2163
|
return v.None;
|
|
2164
|
-
const r =
|
|
2164
|
+
const r = ot.get(e);
|
|
2165
2165
|
if (typeof r == "number")
|
|
2166
2166
|
return r;
|
|
2167
2167
|
if (typeof document > "u")
|
|
@@ -2169,8 +2169,8 @@ function Pn(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) => `.${Pn(c)}`).map(
|
|
2173
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${jn(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)) {
|
|
@@ -2180,14 +2180,14 @@ function Pn(t) {
|
|
|
2180
2180
|
} catch {
|
|
2181
2181
|
continue;
|
|
2182
2182
|
}
|
|
2183
|
-
const d =
|
|
2184
|
-
if (d.mask && (i |= d.mask, i ===
|
|
2183
|
+
const d = gt(f, s);
|
|
2184
|
+
if (d.mask && (i |= d.mask, i === Le))
|
|
2185
2185
|
break;
|
|
2186
2186
|
a ||= d.sawStyleRule;
|
|
2187
2187
|
}
|
|
2188
|
-
return (i !== v.None || a) &&
|
|
2188
|
+
return (i !== v.None || a) && ot.set(e, i), i;
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2190
|
+
function gt(t, e) {
|
|
2191
2191
|
if (!t)
|
|
2192
2192
|
return { mask: v.None, sawStyleRule: !1 };
|
|
2193
2193
|
let r = v.None, n = !1;
|
|
@@ -2198,13 +2198,13 @@ function yt(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 fn)
|
|
2202
2202
|
f.hints.some((d) => a.includes(d)) && (r |= f.flag);
|
|
2203
|
-
if (r ===
|
|
2203
|
+
if (r === Le)
|
|
2204
2204
|
return { mask: r, sawStyleRule: !0 };
|
|
2205
2205
|
} else if ("cssRules" in s) {
|
|
2206
|
-
const i =
|
|
2207
|
-
if (i.mask && (r |= i.mask, r ===
|
|
2206
|
+
const i = gt(s.cssRules, e);
|
|
2207
|
+
if (i.mask && (r |= i.mask, r === Le))
|
|
2208
2208
|
return { mask: r, sawStyleRule: !0 };
|
|
2209
2209
|
n ||= i.sawStyleRule;
|
|
2210
2210
|
}
|
|
@@ -2212,33 +2212,33 @@ function yt(t, e) {
|
|
|
2212
2212
|
}
|
|
2213
2213
|
return { mask: r, sawStyleRule: n };
|
|
2214
2214
|
}
|
|
2215
|
-
function
|
|
2215
|
+
function Pn(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 jn(t) {
|
|
2219
2219
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2220
2220
|
}
|
|
2221
|
-
const
|
|
2222
|
-
function
|
|
2221
|
+
const Be = "ikon_auth_session", Ln = 7 * 24 * 60 * 60 * 1e3;
|
|
2222
|
+
function Se(t) {
|
|
2223
2223
|
try {
|
|
2224
|
-
localStorage.setItem(
|
|
2224
|
+
localStorage.setItem(Be, JSON.stringify(t));
|
|
2225
2225
|
} catch {
|
|
2226
2226
|
console.warn("Failed to save auth session to localStorage");
|
|
2227
2227
|
}
|
|
2228
2228
|
}
|
|
2229
|
-
function
|
|
2229
|
+
function yt() {
|
|
2230
2230
|
try {
|
|
2231
|
-
const t = localStorage.getItem(
|
|
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 > Ln ? (St(), null) : e;
|
|
2235
2235
|
} catch {
|
|
2236
2236
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2237
2237
|
}
|
|
2238
2238
|
}
|
|
2239
|
-
function
|
|
2239
|
+
function St() {
|
|
2240
2240
|
try {
|
|
2241
|
-
localStorage.removeItem(
|
|
2241
|
+
localStorage.removeItem(Be);
|
|
2242
2242
|
} catch {
|
|
2243
2243
|
console.warn("Failed to clear auth session from localStorage");
|
|
2244
2244
|
}
|
|
@@ -2251,8 +2251,8 @@ function ue(t) {
|
|
|
2251
2251
|
authenticatedAt: t.authenticatedAt
|
|
2252
2252
|
};
|
|
2253
2253
|
}
|
|
2254
|
-
async function
|
|
2255
|
-
const r =
|
|
2254
|
+
async function bt(t, e) {
|
|
2255
|
+
const r = _t(), n = await fetch(`${e}/anonymous`, {
|
|
2256
2256
|
method: "POST",
|
|
2257
2257
|
headers: { "Content-Type": "application/json" },
|
|
2258
2258
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2266,9 +2266,9 @@ async function wt(t, e) {
|
|
|
2266
2266
|
provider: "anonymous",
|
|
2267
2267
|
authenticatedAt: Date.now()
|
|
2268
2268
|
};
|
|
2269
|
-
return
|
|
2269
|
+
return Se(s), s;
|
|
2270
2270
|
}
|
|
2271
|
-
async function
|
|
2271
|
+
async function mo(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 po(t) {
|
|
|
2283
2283
|
throw new Error(i);
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
|
-
function
|
|
2286
|
+
function Mn() {
|
|
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 Un() {
|
|
2291
2291
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2292
2292
|
return e ? decodeURIComponent(e) : null;
|
|
2293
2293
|
}
|
|
2294
|
-
function
|
|
2294
|
+
function ut() {
|
|
2295
2295
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2296
2296
|
}
|
|
2297
|
-
function
|
|
2297
|
+
function xn(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 Dn(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 Fn(t) {
|
|
|
2309
2309
|
}
|
|
2310
2310
|
return e.json();
|
|
2311
2311
|
}
|
|
2312
|
-
async function
|
|
2312
|
+
async function Fn(t, e, r) {
|
|
2313
2313
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2314
2314
|
method: "POST",
|
|
2315
2315
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2324,9 +2324,9 @@ async function Bn(t, e, r) {
|
|
|
2324
2324
|
provider: "passkey",
|
|
2325
2325
|
authenticatedAt: Date.now()
|
|
2326
2326
|
};
|
|
2327
|
-
return
|
|
2327
|
+
return Se(s), s;
|
|
2328
2328
|
}
|
|
2329
|
-
async function
|
|
2329
|
+
async function Bn(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 $n(t, e) {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
return r.json();
|
|
2340
2340
|
}
|
|
2341
|
-
async function
|
|
2341
|
+
async function $n(t, e) {
|
|
2342
2342
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2343
2343
|
method: "POST",
|
|
2344
2344
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2353,7 +2353,7 @@ async function Vn(t, e) {
|
|
|
2353
2353
|
provider: "passkey",
|
|
2354
2354
|
authenticatedAt: Date.now()
|
|
2355
2355
|
};
|
|
2356
|
-
return
|
|
2356
|
+
return Se(o), o;
|
|
2357
2357
|
}
|
|
2358
2358
|
function q(t) {
|
|
2359
2359
|
const e = new Uint8Array(t);
|
|
@@ -2362,23 +2362,23 @@ function q(t) {
|
|
|
2362
2362
|
r += String.fromCharCode(o);
|
|
2363
2363
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2364
2364
|
}
|
|
2365
|
-
function
|
|
2365
|
+
function pe(t) {
|
|
2366
2366
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - e.length % 4) % 4, n = e.padEnd(e.length + r, "="), o = atob(n), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2367
2367
|
for (let a = 0; a < o.length; a++)
|
|
2368
2368
|
i[a] = o.charCodeAt(a);
|
|
2369
2369
|
return s;
|
|
2370
2370
|
}
|
|
2371
|
-
function
|
|
2372
|
-
return
|
|
2371
|
+
function $e() {
|
|
2372
|
+
return Vn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2373
2373
|
}
|
|
2374
|
-
const
|
|
2374
|
+
const Vn = {
|
|
2375
2375
|
stubThis: (t) => t
|
|
2376
2376
|
};
|
|
2377
|
-
function
|
|
2377
|
+
function wt(t) {
|
|
2378
2378
|
const { id: e } = t;
|
|
2379
2379
|
return {
|
|
2380
2380
|
...t,
|
|
2381
|
-
id:
|
|
2381
|
+
id: pe(e),
|
|
2382
2382
|
/**
|
|
2383
2383
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2384
2384
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2387,7 +2387,7 @@ function vt(t) {
|
|
|
2387
2387
|
transports: t.transports
|
|
2388
2388
|
};
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function vt(t) {
|
|
2391
2391
|
return (
|
|
2392
2392
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2393
2393
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(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 Kn({ error: t, options: e }) {
|
|
2407
2407
|
const { publicKey: r } = e;
|
|
2408
2408
|
if (!r)
|
|
2409
2409
|
throw Error("options was missing required publicKey property");
|
|
@@ -2461,7 +2461,7 @@ function Wn({ error: t, options: e }) {
|
|
|
2461
2461
|
});
|
|
2462
2462
|
if (t.name === "SecurityError") {
|
|
2463
2463
|
const n = globalThis.location.hostname;
|
|
2464
|
-
if (
|
|
2464
|
+
if (vt(n)) {
|
|
2465
2465
|
if (r.rp.id !== n)
|
|
2466
2466
|
return new j({
|
|
2467
2467
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
@@ -2513,31 +2513,31 @@ class Yn {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
const
|
|
2517
|
-
function
|
|
2518
|
-
if (t && !(
|
|
2516
|
+
const Rt = new Yn(), Wn = ["cross-platform", "platform"];
|
|
2517
|
+
function Et(t) {
|
|
2518
|
+
if (t && !(Wn.indexOf(t) < 0))
|
|
2519
2519
|
return t;
|
|
2520
2520
|
}
|
|
2521
|
-
async function
|
|
2521
|
+
async function zn(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
|
-
if (
|
|
2524
|
+
if (!$e())
|
|
2525
2525
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2526
2526
|
const n = {
|
|
2527
2527
|
...e,
|
|
2528
|
-
challenge:
|
|
2528
|
+
challenge: pe(e.challenge),
|
|
2529
2529
|
user: {
|
|
2530
2530
|
...e.user,
|
|
2531
|
-
id:
|
|
2531
|
+
id: pe(e.user.id)
|
|
2532
2532
|
},
|
|
2533
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2533
|
+
excludeCredentials: e.excludeCredentials?.map(wt)
|
|
2534
2534
|
}, o = {};
|
|
2535
|
-
r && (o.mediation = "conditional"), o.publicKey = n, o.signal =
|
|
2535
|
+
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Rt.createNewAbortSignal();
|
|
2536
2536
|
let s;
|
|
2537
2537
|
try {
|
|
2538
2538
|
s = await navigator.credentials.create(o);
|
|
2539
2539
|
} catch (y) {
|
|
2540
|
-
throw
|
|
2540
|
+
throw Kn({ error: y, options: o });
|
|
2541
2541
|
}
|
|
2542
2542
|
if (!s)
|
|
2543
2543
|
throw new Error("Registration was not completed");
|
|
@@ -2549,7 +2549,7 @@ async function qn(t) {
|
|
|
2549
2549
|
try {
|
|
2550
2550
|
h = c.getPublicKeyAlgorithm();
|
|
2551
2551
|
} catch (y) {
|
|
2552
|
-
|
|
2552
|
+
ke("getPublicKeyAlgorithm()", y);
|
|
2553
2553
|
}
|
|
2554
2554
|
let u;
|
|
2555
2555
|
if (typeof c.getPublicKey == "function")
|
|
@@ -2557,14 +2557,14 @@ async function qn(t) {
|
|
|
2557
2557
|
const y = c.getPublicKey();
|
|
2558
2558
|
y !== null && (u = q(y));
|
|
2559
2559
|
} catch (y) {
|
|
2560
|
-
|
|
2560
|
+
ke("getPublicKey()", y);
|
|
2561
2561
|
}
|
|
2562
2562
|
let g;
|
|
2563
2563
|
if (typeof c.getAuthenticatorData == "function")
|
|
2564
2564
|
try {
|
|
2565
2565
|
g = q(c.getAuthenticatorData());
|
|
2566
2566
|
} catch (y) {
|
|
2567
|
-
|
|
2567
|
+
ke("getAuthenticatorData()", y);
|
|
2568
2568
|
}
|
|
2569
2569
|
return {
|
|
2570
2570
|
id: i,
|
|
@@ -2579,23 +2579,23 @@ async function qn(t) {
|
|
|
2579
2579
|
},
|
|
2580
2580
|
type: f,
|
|
2581
2581
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2582
|
-
authenticatorAttachment:
|
|
2582
|
+
authenticatorAttachment: Et(s.authenticatorAttachment)
|
|
2583
2583
|
};
|
|
2584
2584
|
}
|
|
2585
|
-
function
|
|
2585
|
+
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
|
|
2590
|
-
if (
|
|
2591
|
-
return
|
|
2589
|
+
function qn() {
|
|
2590
|
+
if (!$e())
|
|
2591
|
+
return Ce.stubThis(new Promise((e) => e(!1)));
|
|
2592
2592
|
const t = globalThis.PublicKeyCredential;
|
|
2593
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2593
|
+
return t?.isConditionalMediationAvailable === void 0 ? Ce.stubThis(new Promise((e) => e(!1))) : Ce.stubThis(t.isConditionalMediationAvailable());
|
|
2594
2594
|
}
|
|
2595
|
-
const
|
|
2595
|
+
const Ce = {
|
|
2596
2596
|
stubThis: (t) => t
|
|
2597
2597
|
};
|
|
2598
|
-
function
|
|
2598
|
+
function Gn({ error: t, options: e }) {
|
|
2599
2599
|
const { publicKey: r } = e;
|
|
2600
2600
|
if (!r)
|
|
2601
2601
|
throw Error("options was missing required publicKey property");
|
|
@@ -2615,7 +2615,7 @@ function Hn({ error: t, options: e }) {
|
|
|
2615
2615
|
});
|
|
2616
2616
|
if (t.name === "SecurityError") {
|
|
2617
2617
|
const n = globalThis.location.hostname;
|
|
2618
|
-
if (
|
|
2618
|
+
if (vt(n)) {
|
|
2619
2619
|
if (r.rpId !== n)
|
|
2620
2620
|
return new j({
|
|
2621
2621
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
@@ -2636,31 +2636,31 @@ function Hn({ error: t, options: e }) {
|
|
|
2636
2636
|
}
|
|
2637
2637
|
return t;
|
|
2638
2638
|
}
|
|
2639
|
-
async function
|
|
2639
|
+
async function Hn(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
|
-
if (
|
|
2642
|
+
if (!$e())
|
|
2643
2643
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2644
2644
|
let o;
|
|
2645
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2645
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(wt));
|
|
2646
2646
|
const s = {
|
|
2647
2647
|
...e,
|
|
2648
|
-
challenge:
|
|
2648
|
+
challenge: pe(e.challenge),
|
|
2649
2649
|
allowCredentials: o
|
|
2650
2650
|
}, i = {};
|
|
2651
2651
|
if (r) {
|
|
2652
|
-
if (!await
|
|
2652
|
+
if (!await qn())
|
|
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');
|
|
2656
2656
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2657
2657
|
}
|
|
2658
|
-
i.publicKey = s, i.signal =
|
|
2658
|
+
i.publicKey = s, i.signal = Rt.createNewAbortSignal();
|
|
2659
2659
|
let a;
|
|
2660
2660
|
try {
|
|
2661
2661
|
a = await navigator.credentials.get(i);
|
|
2662
2662
|
} catch (g) {
|
|
2663
|
-
throw
|
|
2663
|
+
throw Gn({ error: g, options: i });
|
|
2664
2664
|
}
|
|
2665
2665
|
if (!a)
|
|
2666
2666
|
throw new Error("Authentication was not completed");
|
|
@@ -2677,12 +2677,12 @@ async function Jn(t) {
|
|
|
2677
2677
|
},
|
|
2678
2678
|
type: h,
|
|
2679
2679
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2680
|
-
authenticatorAttachment:
|
|
2680
|
+
authenticatorAttachment: Et(a.authenticatorAttachment)
|
|
2681
2681
|
};
|
|
2682
2682
|
}
|
|
2683
|
-
const
|
|
2684
|
-
function
|
|
2685
|
-
const [r, n] =
|
|
2683
|
+
const Ve = lt(null);
|
|
2684
|
+
function po({ children: t, config: e }) {
|
|
2685
|
+
const [r, n] = W({
|
|
2686
2686
|
isAuthenticated: !1,
|
|
2687
2687
|
isLoading: !0,
|
|
2688
2688
|
user: null,
|
|
@@ -2690,9 +2690,9 @@ function go({ children: t, config: e }) {
|
|
|
2690
2690
|
});
|
|
2691
2691
|
M(() => {
|
|
2692
2692
|
(() => {
|
|
2693
|
-
const d =
|
|
2693
|
+
const d = Un();
|
|
2694
2694
|
if (d) {
|
|
2695
|
-
|
|
2695
|
+
ut(), n({
|
|
2696
2696
|
isAuthenticated: !1,
|
|
2697
2697
|
isLoading: !1,
|
|
2698
2698
|
user: null,
|
|
@@ -2700,14 +2700,14 @@ function go({ children: t, config: e }) {
|
|
|
2700
2700
|
});
|
|
2701
2701
|
return;
|
|
2702
2702
|
}
|
|
2703
|
-
const h =
|
|
2703
|
+
const h = Mn();
|
|
2704
2704
|
if (h) {
|
|
2705
2705
|
const g = {
|
|
2706
2706
|
token: h.token,
|
|
2707
2707
|
provider: h.provider,
|
|
2708
2708
|
authenticatedAt: Date.now()
|
|
2709
2709
|
};
|
|
2710
|
-
|
|
2710
|
+
Se(g), ut(), n({
|
|
2711
2711
|
isAuthenticated: !0,
|
|
2712
2712
|
isLoading: !1,
|
|
2713
2713
|
user: ue(g),
|
|
@@ -2715,7 +2715,7 @@ function go({ children: t, config: e }) {
|
|
|
2715
2715
|
});
|
|
2716
2716
|
return;
|
|
2717
2717
|
}
|
|
2718
|
-
const u =
|
|
2718
|
+
const u = yt();
|
|
2719
2719
|
if (u) {
|
|
2720
2720
|
n({
|
|
2721
2721
|
isAuthenticated: !0,
|
|
@@ -2742,11 +2742,11 @@ function go({ children: t, config: e }) {
|
|
|
2742
2742
|
}));
|
|
2743
2743
|
return;
|
|
2744
2744
|
}
|
|
2745
|
-
const d = e.authUrl ??
|
|
2745
|
+
const d = e.authUrl ?? Oe();
|
|
2746
2746
|
if (f === "guest") {
|
|
2747
2747
|
n((u) => ({ ...u, isLoading: !0 }));
|
|
2748
2748
|
try {
|
|
2749
|
-
const u = await
|
|
2749
|
+
const u = await bt(e.spaceId, d);
|
|
2750
2750
|
n({
|
|
2751
2751
|
isAuthenticated: !0,
|
|
2752
2752
|
isLoading: !1,
|
|
@@ -2765,7 +2765,7 @@ function go({ 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 Bn(d), g = await Hn({ optionsJSON: u }), y = await $n(d, g);
|
|
2769
2769
|
n({
|
|
2770
2770
|
isAuthenticated: !0,
|
|
2771
2771
|
isLoading: !1,
|
|
@@ -2781,12 +2781,12 @@ function go({ children: t, config: e }) {
|
|
|
2781
2781
|
}
|
|
2782
2782
|
return;
|
|
2783
2783
|
}
|
|
2784
|
-
const h =
|
|
2784
|
+
const h = xn(f, e.spaceId, d);
|
|
2785
2785
|
window.location.href = h;
|
|
2786
2786
|
},
|
|
2787
2787
|
[e.authUrl, e.spaceId]
|
|
2788
2788
|
), s = x(() => {
|
|
2789
|
-
|
|
2789
|
+
St(), n({
|
|
2790
2790
|
isAuthenticated: !1,
|
|
2791
2791
|
isLoading: !1,
|
|
2792
2792
|
user: null,
|
|
@@ -2794,10 +2794,10 @@ function go({ children: t, config: e }) {
|
|
|
2794
2794
|
});
|
|
2795
2795
|
}, []), i = x(
|
|
2796
2796
|
async (f) => {
|
|
2797
|
-
const d = e.authUrl ??
|
|
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 Dn(d), u = await zn({ optionsJSON: h }), g = await Fn(d, u, f);
|
|
2801
2801
|
n({
|
|
2802
2802
|
isAuthenticated: !0,
|
|
2803
2803
|
isLoading: !1,
|
|
@@ -2823,19 +2823,19 @@ function go({ children: t, config: e }) {
|
|
|
2823
2823
|
}),
|
|
2824
2824
|
[r, o, s, a, i]
|
|
2825
2825
|
);
|
|
2826
|
-
return /* @__PURE__ */ R.jsx(
|
|
2826
|
+
return /* @__PURE__ */ R.jsx(Ve, { value: c, children: t });
|
|
2827
2827
|
}
|
|
2828
|
-
function
|
|
2829
|
-
const t =
|
|
2828
|
+
function Jn() {
|
|
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
|
|
2835
|
-
return
|
|
2834
|
+
function go() {
|
|
2835
|
+
return xe(Ve);
|
|
2836
2836
|
}
|
|
2837
|
-
function
|
|
2838
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2837
|
+
function yo(t) {
|
|
2838
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Jn(), 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 So(t) {
|
|
|
2852
2852
|
error: n.error
|
|
2853
2853
|
};
|
|
2854
2854
|
}
|
|
2855
|
-
function
|
|
2855
|
+
function So({
|
|
2856
2856
|
connectionState: t,
|
|
2857
2857
|
error: e,
|
|
2858
2858
|
isReady: r,
|
|
@@ -2891,88 +2891,82 @@ function bo({
|
|
|
2891
2891
|
return null;
|
|
2892
2892
|
}
|
|
2893
2893
|
}
|
|
2894
|
-
const
|
|
2895
|
-
function
|
|
2894
|
+
const Ie = ge("useIkonApp");
|
|
2895
|
+
function Xn() {
|
|
2896
2896
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2897
2897
|
return window.__IKON_AUTH_CONFIG__;
|
|
2898
2898
|
}
|
|
2899
|
-
function
|
|
2899
|
+
function Zn() {
|
|
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 bo(t) {
|
|
2904
|
+
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s } = t, i = e === void 0 ? Xn() ?? null : e, a = Zn(), 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] =
|
|
2906
|
+
const [S, m] = W("idle"), [p, w] = W(null), [T, _] = W(null), [D, G] = W(null), [X, C] = W(null), [P, U] = W(null), [O, F] = W(null), [Y, Z] = 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
|
+
}, []), Q = K(() => i?.enabled ? yt() : null, [i?.enabled]), J = a?.enabled ?? !1, ee = a?.host ?? "localhost", te = a?.port ?? 8443;
|
|
2914
2914
|
M(() => {
|
|
2915
|
-
!
|
|
2915
|
+
!J && Ke() && i && !i.enabled && i.spaceId && !O && !Y && (Z(!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
|
+
Z(!1);
|
|
2921
2921
|
}));
|
|
2922
|
-
}, [
|
|
2923
|
-
const l = K(() => {
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
httpsPort: te,
|
|
2930
|
-
userId: E,
|
|
2931
|
-
parameters: B.parameters
|
|
2932
|
-
}
|
|
2933
|
-
};
|
|
2922
|
+
}, [J, i, O, Y]);
|
|
2923
|
+
const l = K(() => J ? {
|
|
2924
|
+
local: {
|
|
2925
|
+
host: ee,
|
|
2926
|
+
httpsPort: te,
|
|
2927
|
+
spaceId: i?.spaceId,
|
|
2928
|
+
parameters: B.parameters
|
|
2934
2929
|
}
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
}, [X, ee, te, J?.token, i?.spaceId, O, B.sessionId, B.channelKey, B.parameters]);
|
|
2930
|
+
} : Q?.token && i?.spaceId ? {
|
|
2931
|
+
sessionToken: {
|
|
2932
|
+
token: Q.token,
|
|
2933
|
+
spaceId: i.spaceId,
|
|
2934
|
+
backendType: Ye(),
|
|
2935
|
+
sessionId: B.sessionId,
|
|
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
|
|
2954
|
+
}
|
|
2955
|
+
}, [J, ee, te, Q?.token, i?.spaceId, O, B.sessionId, B.channelKey, B.parameters]);
|
|
2962
2956
|
Yr(T);
|
|
2963
|
-
const b =
|
|
2957
|
+
const b = zr(T);
|
|
2964
2958
|
M(() => {
|
|
2965
2959
|
if (!h.current) {
|
|
2966
|
-
if (h.current = !0, d.current =
|
|
2960
|
+
if (h.current = !0, d.current = Ur(), r)
|
|
2967
2961
|
for (const E of r)
|
|
2968
2962
|
E(d.current);
|
|
2969
2963
|
d.current.loadRegisteredModules().catch((E) => {
|
|
2970
|
-
|
|
2964
|
+
Ie.error("Failed to load UI modules", E);
|
|
2971
2965
|
});
|
|
2972
2966
|
}
|
|
2973
2967
|
}, []), M(() => {
|
|
2974
2968
|
if (!l) return;
|
|
2975
|
-
const E = new
|
|
2969
|
+
const E = new jt({
|
|
2976
2970
|
...l,
|
|
2977
2971
|
timeouts: g.current,
|
|
2978
2972
|
audio: u.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : void 0,
|
|
@@ -2986,9 +2980,9 @@ function wo(t) {
|
|
|
2986
2980
|
}
|
|
2987
2981
|
});
|
|
2988
2982
|
c.current = E;
|
|
2989
|
-
const I = new
|
|
2983
|
+
const I = new Xt({ client: E });
|
|
2990
2984
|
return f.current = I, _(I), E.connect().catch((V) => {
|
|
2991
|
-
|
|
2985
|
+
Ie.error("Connection failed:", V);
|
|
2992
2986
|
}), () => {
|
|
2993
2987
|
E.disconnect(), c.current = null, I.dispose(), f.current = null, G(null), C(null), U(null);
|
|
2994
2988
|
};
|
|
@@ -3009,11 +3003,11 @@ function wo(t) {
|
|
|
3009
3003
|
onAction: k,
|
|
3010
3004
|
isReady: N,
|
|
3011
3005
|
webRtcAudioStream: D,
|
|
3012
|
-
webRtcVideoStream:
|
|
3006
|
+
webRtcVideoStream: X,
|
|
3013
3007
|
webRtcScreenStream: P
|
|
3014
3008
|
};
|
|
3015
3009
|
}
|
|
3016
|
-
function
|
|
3010
|
+
function wo(t) {
|
|
3017
3011
|
const e = A(!1);
|
|
3018
3012
|
return x(() => {
|
|
3019
3013
|
if (e.current) return;
|
|
@@ -3022,18 +3016,18 @@ function vo(t) {
|
|
|
3022
3016
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
3023
3017
|
}, [t]);
|
|
3024
3018
|
}
|
|
3025
|
-
let
|
|
3026
|
-
function
|
|
3027
|
-
const [r, n] =
|
|
3019
|
+
let Qn = 0;
|
|
3020
|
+
function vo(t = 5, e = 5e3) {
|
|
3021
|
+
const [r, n] = W([]), o = A(/* @__PURE__ */ new Map()), s = x((i) => {
|
|
3028
3022
|
const a = o.current.get(i);
|
|
3029
3023
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
3030
3024
|
}, []);
|
|
3031
3025
|
return M(() => {
|
|
3032
|
-
const i = o.current, a =
|
|
3026
|
+
const i = o.current, a = Lt(
|
|
3033
3027
|
(c) => {
|
|
3034
|
-
if (!
|
|
3028
|
+
if (!Mt())
|
|
3035
3029
|
return;
|
|
3036
|
-
const f = `toast-${++
|
|
3030
|
+
const f = `toast-${++Qn}`, d = c.level === We.ERROR ? "error" : "warn", h = {
|
|
3037
3031
|
id: f,
|
|
3038
3032
|
level: d,
|
|
3039
3033
|
message: c.message,
|
|
@@ -3045,7 +3039,7 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3045
3039
|
}, e);
|
|
3046
3040
|
i.set(f, u);
|
|
3047
3041
|
},
|
|
3048
|
-
{ minLevel:
|
|
3042
|
+
{ minLevel: We.WARN }
|
|
3049
3043
|
);
|
|
3050
3044
|
return () => {
|
|
3051
3045
|
a();
|
|
@@ -3055,100 +3049,100 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3055
3049
|
};
|
|
3056
3050
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3057
3051
|
}
|
|
3058
|
-
const
|
|
3059
|
-
function
|
|
3052
|
+
const At = lt(null);
|
|
3053
|
+
function eo(t, e) {
|
|
3060
3054
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3061
3055
|
}
|
|
3062
|
-
function
|
|
3056
|
+
function to(t, e) {
|
|
3063
3057
|
const n = new URLSearchParams(window.location.search).get("lang");
|
|
3064
3058
|
if (n && t.includes(n))
|
|
3065
3059
|
return n;
|
|
3066
3060
|
const o = navigator.language.split("-")[0];
|
|
3067
3061
|
return t.includes(o) ? o : e && t.includes(e) ? e : "en";
|
|
3068
3062
|
}
|
|
3069
|
-
function
|
|
3070
|
-
return e ?
|
|
3063
|
+
function ro(t, e, r) {
|
|
3064
|
+
return e ? to(t, r) : r && t.includes(r) ? r : "en";
|
|
3071
3065
|
}
|
|
3072
|
-
function
|
|
3066
|
+
function Ro({
|
|
3073
3067
|
children: t,
|
|
3074
3068
|
translations: e,
|
|
3075
3069
|
defaultLanguage: r,
|
|
3076
3070
|
detectLanguage: n = !1
|
|
3077
3071
|
}) {
|
|
3078
|
-
const o = Object.keys(e), s =
|
|
3072
|
+
const o = Object.keys(e), s = ro(o, n, r), i = e[s] ?? e.en, a = K(
|
|
3079
3073
|
() => ({
|
|
3080
3074
|
t: (c, f) => {
|
|
3081
3075
|
const d = i[c];
|
|
3082
|
-
return
|
|
3076
|
+
return eo(d, f);
|
|
3083
3077
|
},
|
|
3084
3078
|
locale: s,
|
|
3085
3079
|
translations: i
|
|
3086
3080
|
}),
|
|
3087
3081
|
[i, s]
|
|
3088
3082
|
);
|
|
3089
|
-
return /* @__PURE__ */ R.jsx(
|
|
3083
|
+
return /* @__PURE__ */ R.jsx(At, { value: a, children: t });
|
|
3090
3084
|
}
|
|
3091
|
-
function
|
|
3092
|
-
const t =
|
|
3085
|
+
function Eo() {
|
|
3086
|
+
const t = xe(At);
|
|
3093
3087
|
if (!t)
|
|
3094
3088
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3095
3089
|
return t;
|
|
3096
3090
|
}
|
|
3097
3091
|
export {
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3092
|
+
po as AuthProvider,
|
|
3093
|
+
So as ConnectionStateRenderer,
|
|
3094
|
+
Ro as I18nProvider,
|
|
3095
|
+
sr as IKON_UI_BASE_MODULE,
|
|
3096
|
+
yr as IKON_UI_MEDIA_MODULE,
|
|
3097
|
+
Pr as IKON_UI_SHADERTOY_MODULE,
|
|
3098
|
+
_r as IKON_UI_SHADERTOY_TYPE,
|
|
3099
|
+
Ne as IKON_UI_STREAM_CATEGORY,
|
|
3100
|
+
fr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3101
|
+
hr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3102
|
+
Xt as IkonUi,
|
|
3103
|
+
Mr as IkonUiRegistry,
|
|
3104
|
+
co as IkonUiSurface,
|
|
3105
|
+
Ht as UiComponentRegistry,
|
|
3106
|
+
Gt as UiRenderer,
|
|
3107
|
+
ko as UiStreamStore,
|
|
3108
|
+
uo as areIkonUiModuleListsEqual,
|
|
3109
|
+
bt as authenticateAnonymous,
|
|
3110
|
+
xn as buildOAuthRedirectUrl,
|
|
3111
|
+
St as clearAuthSession,
|
|
3112
|
+
ut as clearOAuthParams,
|
|
3113
|
+
or as createBaseResolvers,
|
|
3114
|
+
io as createComponentLibrary,
|
|
3115
|
+
Ur as createIkonUiRegistry,
|
|
3116
|
+
pr as createMediaResolvers,
|
|
3117
|
+
Nr as createShadertoyRendererResolver,
|
|
3118
|
+
Jt as isIkonUiCategoryMatch,
|
|
3119
|
+
yt as loadAuthSession,
|
|
3120
|
+
ir as loadBaseModule,
|
|
3121
|
+
Sr as loadMediaModule,
|
|
3122
|
+
jr as loadShadertoyModule,
|
|
3123
|
+
ln as normalizeIkonUiModuleList,
|
|
3124
|
+
fo as parseIkonUiInitPayload,
|
|
3125
|
+
Mn as parseOAuthCallback,
|
|
3126
|
+
Un as parseOAuthError,
|
|
3127
|
+
dn as readIkonUiModules,
|
|
3128
|
+
lo as readIkonUiModulesFromSources,
|
|
3129
|
+
ar as registerBaseModule,
|
|
3130
|
+
br as registerMediaModule,
|
|
3131
|
+
Lr as registerShadertoyModule,
|
|
3132
|
+
zt as renderChildren,
|
|
3133
|
+
ho as renderMotionLetters,
|
|
3134
|
+
Se as saveAuthSession,
|
|
3135
|
+
mo as sendMagicLink,
|
|
3142
3136
|
ue as sessionToUser,
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3137
|
+
Jn as useAuth,
|
|
3138
|
+
yo as useAuthGuard,
|
|
3139
|
+
go as useAuthOptional,
|
|
3140
|
+
Eo as useI18n,
|
|
3141
|
+
bo as useIkonApp,
|
|
3148
3142
|
Yr as useIkonStyles,
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3143
|
+
zr as useIkonUiStores,
|
|
3144
|
+
wo as useLazyFont,
|
|
3145
|
+
vo as useToasts,
|
|
3152
3146
|
H as useUiNode,
|
|
3153
|
-
|
|
3147
|
+
ao as useUiStore
|
|
3154
3148
|
};
|