@ikonai/sdk-react-ui 1.0.37 → 1.0.39
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 +5 -0
- package/index.js +578 -573
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IkonUiCore as
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import
|
|
4
|
-
import { createLogger as Ee, getOrCreateDeviceId as
|
|
5
|
-
var ge = { exports: {} },
|
|
1
|
+
import { IkonUiCore as Pt, UiStreamStore as Mt } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as Do } from "@ikonai/sdk-ui";
|
|
3
|
+
import jt, { useSyncExternalStore as $e, useMemo as V, memo as K, useRef as w, useCallback as D, Fragment as Ut, useEffect as U, useState as J, createContext as pt, use as Ve } from "react";
|
|
4
|
+
import { createLogger as Ee, getOrCreateDeviceId as Lt, deriveAuthUrl as je, parseUrlParams as xt, clearSessionParamsFromUrl as Dt, isCloudEnvironment as Ge, extractUserIdFromToken as Ft, deriveBackendType as He, IkonClient as Bt, AccessDeniedError as $t, AuthenticationError as Vt, subscribeToLogEvents as Kt, isDebugModeEnabled as Yt, LogLevel as Je, getLangParam as zt } from "@ikonai/sdk";
|
|
5
|
+
var ge = { exports: {} }, ie = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -13,8 +13,8 @@ var ge = { exports: {} }, ae = {};
|
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
15
|
var Xe;
|
|
16
|
-
function
|
|
17
|
-
if (Xe) return
|
|
16
|
+
function Wt() {
|
|
17
|
+
if (Xe) return ie;
|
|
18
18
|
Xe = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
20
|
function r(n, o, s) {
|
|
@@ -32,9 +32,9 @@ function Kt() {
|
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ie.Fragment = e, ie.jsx = r, ie.jsxs = r, ie;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ae = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -45,12 +45,12 @@ var ce = {};
|
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
47
|
var Ze;
|
|
48
|
-
function
|
|
48
|
+
function qt() {
|
|
49
49
|
return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(d) {
|
|
51
51
|
if (d == null) return null;
|
|
52
52
|
if (typeof d == "function")
|
|
53
|
-
return d.$$typeof ===
|
|
53
|
+
return d.$$typeof === x ? null : d.displayName || d.name || null;
|
|
54
54
|
if (typeof d == "string") return d;
|
|
55
55
|
switch (d) {
|
|
56
56
|
case b:
|
|
@@ -59,9 +59,9 @@ function Yt() {
|
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case m:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case L:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case Y:
|
|
65
65
|
return "SuspenseList";
|
|
66
66
|
case _:
|
|
67
67
|
return "Activity";
|
|
@@ -72,16 +72,16 @@ function Yt() {
|
|
|
72
72
|
), d.$$typeof) {
|
|
73
73
|
case p:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case
|
|
75
|
+
case A:
|
|
76
76
|
return (d.displayName || "Context") + ".Provider";
|
|
77
77
|
case v:
|
|
78
78
|
return (d._context.displayName || "Context") + ".Consumer";
|
|
79
79
|
case I:
|
|
80
80
|
var S = d.render;
|
|
81
81
|
return d = d.displayName, d || (d = S.displayName || S.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
82
|
-
case
|
|
82
|
+
case Q:
|
|
83
83
|
return S = d.displayName || null, S !== null ? S : t(d.type) || "Memo";
|
|
84
|
-
case
|
|
84
|
+
case T:
|
|
85
85
|
S = d._payload, d = d._init;
|
|
86
86
|
try {
|
|
87
87
|
return t(d(S));
|
|
@@ -102,17 +102,17 @@ function Yt() {
|
|
|
102
102
|
}
|
|
103
103
|
if (S) {
|
|
104
104
|
S = console;
|
|
105
|
-
var
|
|
106
|
-
return
|
|
105
|
+
var k = S.error, P = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
|
|
106
|
+
return k.call(
|
|
107
107
|
S,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
P
|
|
110
110
|
), e(d);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function n(d) {
|
|
114
114
|
if (d === b) return "<>";
|
|
115
|
-
if (typeof d == "object" && d !== null && d.$$typeof ===
|
|
115
|
+
if (typeof d == "object" && d !== null && d.$$typeof === T)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
118
|
var S = t(d);
|
|
@@ -129,21 +129,21 @@ function Yt() {
|
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function i(d) {
|
|
132
|
-
if (
|
|
132
|
+
if (F.call(d, "key")) {
|
|
133
133
|
var S = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
134
134
|
if (S && S.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return d.key !== void 0;
|
|
137
137
|
}
|
|
138
138
|
function a(d, S) {
|
|
139
|
-
function
|
|
140
|
-
|
|
139
|
+
function k() {
|
|
140
|
+
he || (he = !0, console.error(
|
|
141
141
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
142
142
|
S
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
145
|
+
k.isReactWarning = !0, Object.defineProperty(d, "key", {
|
|
146
|
+
get: k,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
@@ -153,14 +153,14 @@ function Yt() {
|
|
|
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
|
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
155
155
|
}
|
|
156
|
-
function f(d, S,
|
|
157
|
-
return
|
|
156
|
+
function f(d, S, k, P, W, C, q, te) {
|
|
157
|
+
return k = C.ref, d = {
|
|
158
158
|
$$typeof: y,
|
|
159
159
|
type: d,
|
|
160
160
|
key: S,
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
161
|
+
props: C,
|
|
162
|
+
_owner: W
|
|
163
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(d, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: c
|
|
166
166
|
}) : Object.defineProperty(d, "ref", { enumerable: !1, value: null }), d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
@@ -177,7 +177,7 @@ function Yt() {
|
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
180
|
+
value: q
|
|
181
181
|
}), Object.defineProperty(d, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
@@ -185,60 +185,60 @@ function Yt() {
|
|
|
185
185
|
value: te
|
|
186
186
|
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
187
187
|
}
|
|
188
|
-
function l(d, S,
|
|
188
|
+
function l(d, S, k, P, W, C, q, te) {
|
|
189
189
|
var O = S.children;
|
|
190
190
|
if (O !== void 0)
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
u(O[
|
|
191
|
+
if (P)
|
|
192
|
+
if (z(O)) {
|
|
193
|
+
for (P = 0; P < O.length; P++)
|
|
194
|
+
u(O[P]);
|
|
195
195
|
Object.freeze && Object.freeze(O);
|
|
196
196
|
} else
|
|
197
197
|
console.error(
|
|
198
198
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
199
199
|
);
|
|
200
200
|
else u(O);
|
|
201
|
-
if (
|
|
201
|
+
if (F.call(S, "key")) {
|
|
202
202
|
O = t(d);
|
|
203
|
-
var
|
|
203
|
+
var G = Object.keys(S).filter(function(Te) {
|
|
204
204
|
return Te !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
P = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", ee[O + P] || (G = 0 < G.length ? "{" + G.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s {...props} />
|
|
210
210
|
React keys must be passed directly to JSX without using spread:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s key={someKey} {...props} />`,
|
|
213
|
-
|
|
213
|
+
P,
|
|
214
214
|
O,
|
|
215
|
-
|
|
215
|
+
G,
|
|
216
216
|
O
|
|
217
|
-
),
|
|
217
|
+
), ee[O + P] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (O = null,
|
|
220
|
-
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else
|
|
219
|
+
if (O = null, k !== void 0 && (r(k), O = "" + k), i(S) && (r(S.key), O = "" + S.key), "key" in S) {
|
|
220
|
+
k = {};
|
|
221
|
+
for (var re in S)
|
|
222
|
+
re !== "key" && (k[re] = S[re]);
|
|
223
|
+
} else k = S;
|
|
224
224
|
return O && a(
|
|
225
|
-
|
|
225
|
+
k,
|
|
226
226
|
typeof d == "function" ? d.displayName || d.name || "Unknown" : d
|
|
227
227
|
), f(
|
|
228
228
|
d,
|
|
229
229
|
O,
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
C,
|
|
231
|
+
W,
|
|
232
232
|
o(),
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
k,
|
|
234
|
+
q,
|
|
235
235
|
te
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function u(d) {
|
|
239
239
|
typeof d == "object" && d !== null && d.$$typeof === y && d._store && (d._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var h =
|
|
241
|
+
var h = jt, y = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), A = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), L = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), x = Symbol.for("react.client.reference"), N = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, z = Array.isArray, ne = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
h = {
|
|
@@ -246,43 +246,43 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
return d();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
249
|
+
var he, me = {}, se = h["react-stack-bottom-frame"].bind(
|
|
250
250
|
h,
|
|
251
251
|
s
|
|
252
|
-
)(), pe =
|
|
253
|
-
|
|
254
|
-
var
|
|
252
|
+
)(), pe = ne(n(s)), ee = {};
|
|
253
|
+
ae.Fragment = b, ae.jsx = function(d, S, k, P, W) {
|
|
254
|
+
var C = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return l(
|
|
256
256
|
d,
|
|
257
257
|
S,
|
|
258
|
-
|
|
258
|
+
k,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
P,
|
|
261
|
+
W,
|
|
262
|
+
C ? Error("react-stack-top-frame") : se,
|
|
263
|
+
C ? ne(n(d)) : pe
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
265
|
+
}, ae.jsxs = function(d, S, k, P, W) {
|
|
266
|
+
var C = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return l(
|
|
268
268
|
d,
|
|
269
269
|
S,
|
|
270
|
-
|
|
270
|
+
k,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
P,
|
|
273
|
+
W,
|
|
274
|
+
C ? Error("react-stack-top-frame") : se,
|
|
275
|
+
C ? ne(n(d)) : pe
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ae;
|
|
279
279
|
}
|
|
280
280
|
var Qe;
|
|
281
|
-
function
|
|
282
|
-
return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? ge.exports =
|
|
281
|
+
function Gt() {
|
|
282
|
+
return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? ge.exports = Wt() : ge.exports = qt()), ge.exports;
|
|
283
283
|
}
|
|
284
|
-
var E =
|
|
285
|
-
function
|
|
284
|
+
var E = Gt();
|
|
285
|
+
function Ht(t, e) {
|
|
286
286
|
const r = $e(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
@@ -294,7 +294,7 @@ function Wt(t, e) {
|
|
|
294
294
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
return
|
|
297
|
+
return V(() => {
|
|
298
298
|
const [n, o] = r.split(":");
|
|
299
299
|
return {
|
|
300
300
|
rootViewId: n || void 0,
|
|
@@ -302,16 +302,16 @@ function Wt(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function Z(t, e) {
|
|
306
306
|
const r = $e(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
|
-
return
|
|
311
|
+
return V(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const Jt = Ee("UIRenderer");
|
|
314
|
+
function Xt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,18 +322,18 @@ function Gt(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Zt(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Qt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function er(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function tr(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 Ue =
|
|
345
|
-
const n =
|
|
344
|
+
const Ue = K(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = Z(r.store, e), o = n ? Qt(n) : [], s = tr(o), i = V(
|
|
346
346
|
() => o.length === 0 ? null : o.map((u) => /* @__PURE__ */ E.jsx(t, { nodeId: u.id, context: r }, u.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
@@ -350,39 +350,39 @@ const Ue = Y(function t({ nodeId: e, context: r }) {
|
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */ E.jsx(
|
|
353
|
+
return /* @__PURE__ */ E.jsx(Ut, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
|
-
return
|
|
357
|
-
const c =
|
|
356
|
+
return Jt.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = Zt(n), f = c.length > 0 ? c.join(" ") : void 0, l = a;
|
|
358
358
|
return /* @__PURE__ */ E.jsx(l, { nodeId: e, context: r, className: f });
|
|
359
|
-
},
|
|
360
|
-
function
|
|
359
|
+
}, er);
|
|
360
|
+
function rr(t, e) {
|
|
361
361
|
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ E.jsx(Ue, { nodeId: r.id, context: e }, r.id));
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function nr(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 or = K(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Ht(e, n), l = w(s);
|
|
368
368
|
l.current = s;
|
|
369
369
|
const u = w(i);
|
|
370
370
|
u.current = i;
|
|
371
371
|
const h = w(a);
|
|
372
372
|
h.current = a;
|
|
373
|
-
const y =
|
|
373
|
+
const y = D((b, m) => {
|
|
374
374
|
if (!b)
|
|
375
375
|
return;
|
|
376
|
-
const g =
|
|
376
|
+
const g = Xt(m);
|
|
377
377
|
l.current?.(b, g);
|
|
378
|
-
}, []), p =
|
|
378
|
+
}, []), p = V(() => {
|
|
379
379
|
const b = {
|
|
380
380
|
store: e,
|
|
381
381
|
library: r,
|
|
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) => rr(m, b),
|
|
386
386
|
renderView: (m) => {
|
|
387
387
|
const g = e.getSnapshot().views.get(m);
|
|
388
388
|
return g ? /* @__PURE__ */ E.jsx(Ue, { nodeId: g.id, context: b }) : null;
|
|
@@ -399,8 +399,8 @@ const tr = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
399
399
|
return b;
|
|
400
400
|
}, [e, r, y]);
|
|
401
401
|
return !c || !f ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(Ue, { nodeId: f, context: p }) });
|
|
402
|
-
},
|
|
403
|
-
class
|
|
402
|
+
}, nr);
|
|
403
|
+
class sr {
|
|
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 rr {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function wo(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
|
-
return new
|
|
422
|
+
return new sr(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function vo(t) {
|
|
425
425
|
return $e(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
@@ -429,29 +429,29 @@ function bo(t) {
|
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
const Le = "ikon-ui";
|
|
432
|
-
function
|
|
432
|
+
function ir(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
const i =
|
|
435
|
+
const Ro = K(function({ stores: e, registry: r, category: n = Le, onAction: o, client: s }) {
|
|
436
|
+
const i = V(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
|
|
437
437
|
a.current = o;
|
|
438
438
|
const c = w(s);
|
|
439
439
|
c.current = s;
|
|
440
|
-
const f =
|
|
440
|
+
const f = V(
|
|
441
441
|
() => {
|
|
442
442
|
const l = [];
|
|
443
443
|
for (const [u, h] of e) {
|
|
444
444
|
const y = h.store.getSnapshot();
|
|
445
|
-
|
|
445
|
+
ir(h.category, n) && (!y.rootViewId || !y.views.has(y.rootViewId) || l.push({ key: u, store: h.store }));
|
|
446
446
|
}
|
|
447
447
|
return l;
|
|
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__ */ E.jsx(E.Fragment, { children: f.map(({ key: l, store: u }) => /* @__PURE__ */ E.jsx(
|
|
452
|
+
return f.length === 0 ? null : /* @__PURE__ */ E.jsx(E.Fragment, { children: f.map(({ key: l, store: u }) => /* @__PURE__ */ E.jsx(or, { store: u, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, l)) });
|
|
453
453
|
});
|
|
454
|
-
class
|
|
454
|
+
class ar {
|
|
455
455
|
core;
|
|
456
456
|
ownsCore;
|
|
457
457
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -459,7 +459,7 @@ class or {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new Pt({ 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();
|
|
@@ -510,7 +510,7 @@ class or {
|
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
512
|
category: Le,
|
|
513
|
-
store: new
|
|
513
|
+
store: new Mt()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -526,13 +526,13 @@ class or {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function cr(t) {
|
|
530
530
|
if (typeof t == "string") {
|
|
531
531
|
const e = t.trim();
|
|
532
532
|
return e.length > 0 ? e : void 0;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function fe(t) {
|
|
536
536
|
if (typeof t == "string") {
|
|
537
537
|
const e = t.trim();
|
|
538
538
|
return e.length > 0 ? e : void 0;
|
|
@@ -551,10 +551,10 @@ function Ke(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const et = /* @__PURE__ */ new WeakMap(),
|
|
554
|
+
const et = /* @__PURE__ */ new WeakMap(), ur = {};
|
|
555
555
|
function Ye(t) {
|
|
556
556
|
if (!t)
|
|
557
|
-
return
|
|
557
|
+
return ur;
|
|
558
558
|
const e = et.get(t);
|
|
559
559
|
if (e)
|
|
560
560
|
return e;
|
|
@@ -563,10 +563,10 @@ function Ye(t) {
|
|
|
563
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
564
564
|
return et.set(t, r), r;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
const t =
|
|
568
|
-
const o =
|
|
569
|
-
return
|
|
566
|
+
function lr() {
|
|
567
|
+
const t = K(function({ nodeId: r, context: n }) {
|
|
568
|
+
const o = Z(n.store, r), s = w(null), i = fe(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = fe(o?.props?.key), l = o?.props?.preciseGeneratedAt;
|
|
569
|
+
return U(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
572
572
|
const h = s.current;
|
|
@@ -574,17 +574,17 @@ function ar() {
|
|
|
574
574
|
return;
|
|
575
575
|
if (c !== !0) {
|
|
576
576
|
const g = ((v) => {
|
|
577
|
-
let
|
|
578
|
-
for (;
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
581
|
-
return
|
|
582
|
-
|
|
577
|
+
let A = v.parentElement;
|
|
578
|
+
for (; A; ) {
|
|
579
|
+
const L = window.getComputedStyle(A).overflowY;
|
|
580
|
+
if (L === "auto" || L === "scroll" || A.hasAttribute("data-radix-scroll-area-viewport"))
|
|
581
|
+
return A;
|
|
582
|
+
A = A.parentElement;
|
|
583
583
|
}
|
|
584
584
|
return null;
|
|
585
585
|
})(h);
|
|
586
586
|
g ? requestAnimationFrame(() => {
|
|
587
|
-
const v = g.getBoundingClientRect(),
|
|
587
|
+
const v = g.getBoundingClientRect(), A = h.getBoundingClientRect(), I = g.scrollTop + (A.bottom - v.bottom) + 16;
|
|
588
588
|
"scrollBehavior" in document.documentElement.style ? g.scrollTo({ top: I, behavior: "smooth" }) : g.scrollTop = I;
|
|
589
589
|
}) : typeof h.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
590
590
|
try {
|
|
@@ -618,16 +618,16 @@ function ar() {
|
|
|
618
618
|
return t;
|
|
619
619
|
};
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
const t =
|
|
623
|
-
const s =
|
|
621
|
+
function dr() {
|
|
622
|
+
const t = K(function({ nodeId: r, context: n, className: o }) {
|
|
623
|
+
const s = Z(n.store, r), i = cr(s?.props?.onInvokeId), a = D(() => {
|
|
624
624
|
i && n.dispatchAction(i);
|
|
625
625
|
}, [i, n]);
|
|
626
626
|
if (!s)
|
|
627
627
|
return null;
|
|
628
628
|
const c = Ye(s.props);
|
|
629
629
|
delete c.onInvokeId;
|
|
630
|
-
const f = Ke(
|
|
630
|
+
const f = Ke(fe(s.props?.className), o), l = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
631
631
|
return /* @__PURE__ */ E.jsx(
|
|
632
632
|
"div",
|
|
633
633
|
{
|
|
@@ -645,12 +645,12 @@ function cr() {
|
|
|
645
645
|
return t;
|
|
646
646
|
};
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
const t =
|
|
650
|
-
const s =
|
|
648
|
+
function fr() {
|
|
649
|
+
const t = K(function({ nodeId: r, context: n, className: o }) {
|
|
650
|
+
const s = Z(n.store, r);
|
|
651
651
|
if (!s)
|
|
652
652
|
return null;
|
|
653
|
-
const i = Ye(s.props), a = Ke("relative",
|
|
653
|
+
const i = Ye(s.props), a = Ke("relative", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
654
654
|
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
655
655
|
});
|
|
656
656
|
return ({ type: e }) => {
|
|
@@ -658,12 +658,12 @@ function ur() {
|
|
|
658
658
|
return t;
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
const t =
|
|
663
|
-
const s =
|
|
661
|
+
function hr() {
|
|
662
|
+
const t = K(function({ nodeId: r, context: n, className: o }) {
|
|
663
|
+
const s = Z(n.store, r);
|
|
664
664
|
if (!s)
|
|
665
665
|
return null;
|
|
666
|
-
const i = Ye(s.props), a = Ke("absolute",
|
|
666
|
+
const i = Ye(s.props), a = Ke("absolute", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
667
667
|
return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
668
668
|
});
|
|
669
669
|
return ({ type: e }) => {
|
|
@@ -671,19 +671,19 @@ function lr() {
|
|
|
671
671
|
return t;
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function mr() {
|
|
675
675
|
return [
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
676
|
+
dr(),
|
|
677
|
+
fr(),
|
|
678
|
+
hr(),
|
|
679
|
+
lr()
|
|
680
680
|
];
|
|
681
681
|
}
|
|
682
|
-
const
|
|
683
|
-
function
|
|
684
|
-
t.registerModule(
|
|
682
|
+
const pr = "base", gr = async () => mr();
|
|
683
|
+
function yr(t) {
|
|
684
|
+
t.registerModule(pr, gr);
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function br(t) {
|
|
687
687
|
if (typeof t == "string") {
|
|
688
688
|
const e = t.trim();
|
|
689
689
|
return e.length > 0 ? e : void 0;
|
|
@@ -693,7 +693,7 @@ function pr(t) {
|
|
|
693
693
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function Sr(...t) {
|
|
697
697
|
const e = [];
|
|
698
698
|
for (const r of t)
|
|
699
699
|
r && r.trim() && e.push(r.trim());
|
|
@@ -714,17 +714,17 @@ function ye(t) {
|
|
|
714
714
|
if (e === "false") return !1;
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
const
|
|
718
|
-
function
|
|
719
|
-
const t =
|
|
717
|
+
const wr = "std.audio-url-player";
|
|
718
|
+
function vr() {
|
|
719
|
+
const t = K(function({
|
|
720
720
|
nodeId: r,
|
|
721
721
|
context: n,
|
|
722
722
|
className: o
|
|
723
723
|
}) {
|
|
724
|
-
const s =
|
|
724
|
+
const s = Z(n.store, r);
|
|
725
725
|
if (!s)
|
|
726
726
|
return null;
|
|
727
|
-
const i =
|
|
727
|
+
const i = Sr(br(s.props?.className), o), a = tt(s.props?.src), c = tt(s.props?.preload), f = ye(s.props?.controls), l = ye(s.props?.autoplay), u = ye(s.props?.loop), h = ye(s.props?.muted);
|
|
728
728
|
return /* @__PURE__ */ E.jsx(
|
|
729
729
|
"audio",
|
|
730
730
|
{
|
|
@@ -740,7 +740,7 @@ function br() {
|
|
|
740
740
|
);
|
|
741
741
|
});
|
|
742
742
|
return ({ type: e }) => {
|
|
743
|
-
if (e ===
|
|
743
|
+
if (e === wr)
|
|
744
744
|
return t;
|
|
745
745
|
};
|
|
746
746
|
}
|
|
@@ -775,17 +775,17 @@ function xe(t) {
|
|
|
775
775
|
const e = t.trim();
|
|
776
776
|
return e.length > 0 ? e : void 0;
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
function
|
|
780
|
-
const t =
|
|
781
|
-
const s =
|
|
782
|
-
return
|
|
778
|
+
const Rr = "std.video-canvas", Er = "std.video-url-player";
|
|
779
|
+
function Ar() {
|
|
780
|
+
const t = K(function({ nodeId: r, context: n, className: o }) {
|
|
781
|
+
const s = Z(n.store, r), i = w(null), a = w(null), c = n.video, f = n.client, l = s ? xe(s.props?.streamId) : void 0, u = s ? Se(s.props?.width) : void 0, h = s ? Se(s.props?.height) : void 0, y = s ? yt(gt(s.props?.className), o) : o, p = f?.isWebRtcEnabled && l ? f.getWebRtcVideoStreamByStreamId(l) : null;
|
|
782
|
+
return U(() => {
|
|
783
783
|
const b = i.current;
|
|
784
784
|
if (!(!c || !b || !l || p))
|
|
785
785
|
return c.attachCanvas(l, b), () => {
|
|
786
786
|
c.detachCanvas(l);
|
|
787
787
|
};
|
|
788
|
-
}, [c, l, p]),
|
|
788
|
+
}, [c, l, p]), U(() => {
|
|
789
789
|
const b = a.current;
|
|
790
790
|
if (!(!b || !p))
|
|
791
791
|
return b.srcObject = p, () => {
|
|
@@ -819,14 +819,14 @@ function vr() {
|
|
|
819
819
|
) : null;
|
|
820
820
|
});
|
|
821
821
|
return ({ type: e }) => {
|
|
822
|
-
if (e ===
|
|
822
|
+
if (e === Rr)
|
|
823
823
|
return t;
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
return [
|
|
826
|
+
function kr() {
|
|
827
|
+
return [Ar(), Tr(), vr()];
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function ce(t) {
|
|
830
830
|
if (typeof t == "boolean")
|
|
831
831
|
return t;
|
|
832
832
|
if (typeof t == "string") {
|
|
@@ -835,16 +835,16 @@ function ue(t) {
|
|
|
835
835
|
if (e === "false") return !1;
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
const t =
|
|
838
|
+
function Tr() {
|
|
839
|
+
const t = K(function({
|
|
840
840
|
nodeId: r,
|
|
841
841
|
context: n,
|
|
842
842
|
className: o
|
|
843
843
|
}) {
|
|
844
|
-
const s =
|
|
844
|
+
const s = Z(n.store, r);
|
|
845
845
|
if (!s)
|
|
846
846
|
return null;
|
|
847
|
-
const i = yt(gt(s.props?.className), o), a = xe(s.props?.src), c = xe(s.props?.poster), f =
|
|
847
|
+
const i = yt(gt(s.props?.className), o), a = xe(s.props?.src), c = xe(s.props?.poster), f = ce(s.props?.controls), l = ce(s.props?.autoplay), u = ce(s.props?.loop), h = ce(s.props?.muted), y = ce(s.props?.playsInline), p = Se(s.props?.width), b = Se(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
848
848
|
return /* @__PURE__ */ E.jsx(
|
|
849
849
|
"video",
|
|
850
850
|
{
|
|
@@ -864,27 +864,27 @@ function Er() {
|
|
|
864
864
|
);
|
|
865
865
|
});
|
|
866
866
|
return ({ type: e }) => {
|
|
867
|
-
if (e ===
|
|
867
|
+
if (e === Er)
|
|
868
868
|
return t;
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
|
-
const
|
|
872
|
-
function
|
|
873
|
-
t.registerModule(
|
|
871
|
+
const Cr = "media", Ir = async () => kr();
|
|
872
|
+
function Or(t) {
|
|
873
|
+
t.registerModule(Cr, Ir);
|
|
874
874
|
}
|
|
875
|
-
const
|
|
875
|
+
const _r = `#version 300 es
|
|
876
876
|
in vec4 a_position;
|
|
877
877
|
void main() {
|
|
878
878
|
gl_Position = a_position;
|
|
879
879
|
}
|
|
880
880
|
`;
|
|
881
|
-
function
|
|
881
|
+
function Nr(t, e) {
|
|
882
882
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function Pr(t, e) {
|
|
885
885
|
const r = [];
|
|
886
886
|
for (const [n, o] of Object.entries(e)) {
|
|
887
|
-
if (
|
|
887
|
+
if (Nr(t, n))
|
|
888
888
|
continue;
|
|
889
889
|
let s;
|
|
890
890
|
switch (o.type) {
|
|
@@ -937,7 +937,7 @@ void main() {
|
|
|
937
937
|
}
|
|
938
938
|
`;
|
|
939
939
|
}
|
|
940
|
-
class
|
|
940
|
+
class Mr {
|
|
941
941
|
gl;
|
|
942
942
|
program = null;
|
|
943
943
|
positionBuffer = null;
|
|
@@ -973,10 +973,10 @@ class _r {
|
|
|
973
973
|
}
|
|
974
974
|
compile(e, r = {}) {
|
|
975
975
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
976
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
976
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, _r);
|
|
977
977
|
if (!o)
|
|
978
978
|
return !1;
|
|
979
|
-
const s =
|
|
979
|
+
const s = Pr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
980
980
|
if (!i)
|
|
981
981
|
return n.deleteShader(o), !1;
|
|
982
982
|
const a = n.createProgram();
|
|
@@ -1067,7 +1067,7 @@ class _r {
|
|
|
1067
1067
|
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();
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function jr(t) {
|
|
1071
1071
|
if (typeof t == "string") {
|
|
1072
1072
|
const e = t.trim();
|
|
1073
1073
|
return e.length > 0 ? e : void 0;
|
|
@@ -1077,7 +1077,7 @@ function Nr(t) {
|
|
|
1077
1077
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function Ur(...t) {
|
|
1081
1081
|
const e = [];
|
|
1082
1082
|
for (const r of t)
|
|
1083
1083
|
r && r.trim() && e.push(r.trim());
|
|
@@ -1092,10 +1092,10 @@ function Ce(t) {
|
|
|
1092
1092
|
return Math.floor(e);
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Lr(t) {
|
|
1096
1096
|
return typeof t == "string" ? t : "";
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function xr(t) {
|
|
1099
1099
|
if (typeof t == "boolean")
|
|
1100
1100
|
return t;
|
|
1101
1101
|
if (typeof t == "string") {
|
|
@@ -1104,7 +1104,7 @@ function jr(t) {
|
|
|
1104
1104
|
if (e === "false") return !1;
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function Dr(t) {
|
|
1108
1108
|
if (!t || typeof t != "object")
|
|
1109
1109
|
return {};
|
|
1110
1110
|
const e = {}, r = t;
|
|
@@ -1119,7 +1119,7 @@ function Ur(t) {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
return e;
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function Fr(t, e) {
|
|
1123
1123
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1124
1124
|
if (r.length !== n.length)
|
|
1125
1125
|
return !1;
|
|
@@ -1140,21 +1140,21 @@ function Lr(t, e) {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
return !0;
|
|
1142
1142
|
}
|
|
1143
|
-
const
|
|
1144
|
-
function
|
|
1145
|
-
const t =
|
|
1146
|
-
const s =
|
|
1143
|
+
const Br = "std.shadertoy-canvas";
|
|
1144
|
+
function $r() {
|
|
1145
|
+
const t = K(function({ nodeId: r, context: n, className: o }) {
|
|
1146
|
+
const s = Z(n.store, r), i = w(null), a = w(null), c = w(null), f = w(0), l = w(""), u = w({}), h = w({
|
|
1147
1147
|
x: 0,
|
|
1148
1148
|
y: 0,
|
|
1149
1149
|
clickX: 0,
|
|
1150
1150
|
clickY: 0,
|
|
1151
1151
|
isDown: !1
|
|
1152
|
-
}), y = s ?
|
|
1153
|
-
|
|
1154
|
-
const
|
|
1155
|
-
if (
|
|
1152
|
+
}), y = s ? Lr(s.props?.shaderSource) : "", p = s ? Ce(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, m = V(() => Dr(b), [b]), g = s ? xr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ce(s.props?.width) : void 0, A = s ? Ce(s.props?.height) : void 0, I = s ? Ur(jr(s.props?.className), o) : o;
|
|
1153
|
+
U(() => {
|
|
1154
|
+
const T = i.current;
|
|
1155
|
+
if (T) {
|
|
1156
1156
|
try {
|
|
1157
|
-
const _ = new
|
|
1157
|
+
const _ = new Mr(T);
|
|
1158
1158
|
a.current = _;
|
|
1159
1159
|
} catch (_) {
|
|
1160
1160
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", _);
|
|
@@ -1163,48 +1163,48 @@ function Dr() {
|
|
|
1163
1163
|
a.current && (a.current.destroy(), a.current = null);
|
|
1164
1164
|
};
|
|
1165
1165
|
}
|
|
1166
|
-
}, []),
|
|
1167
|
-
const
|
|
1168
|
-
if (!(!
|
|
1169
|
-
if (
|
|
1166
|
+
}, []), U(() => {
|
|
1167
|
+
const T = a.current;
|
|
1168
|
+
if (!(!T || !y) && l.current !== y)
|
|
1169
|
+
if (T.compile(y, m))
|
|
1170
1170
|
l.current = y, u.current = m;
|
|
1171
1171
|
else {
|
|
1172
|
-
const
|
|
1173
|
-
console.error("[ShadertoyRenderer] Shader compilation failed:",
|
|
1172
|
+
const x = T.getError();
|
|
1173
|
+
console.error("[ShadertoyRenderer] Shader compilation failed:", x);
|
|
1174
1174
|
}
|
|
1175
|
-
}, [y, m]),
|
|
1176
|
-
const
|
|
1177
|
-
!
|
|
1178
|
-
}, [m]),
|
|
1179
|
-
const
|
|
1180
|
-
if (!
|
|
1181
|
-
const _ = 1e3 / p,
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1175
|
+
}, [y, m]), U(() => {
|
|
1176
|
+
const T = a.current;
|
|
1177
|
+
!T || !l.current || Fr(u.current, m) || (T.setCustomUniforms(m), u.current = m);
|
|
1178
|
+
}, [m]), U(() => {
|
|
1179
|
+
const T = a.current;
|
|
1180
|
+
if (!T || !l.current) return;
|
|
1181
|
+
const _ = 1e3 / p, x = (N) => {
|
|
1182
|
+
const F = N - f.current;
|
|
1183
|
+
F >= _ && (f.current = N - F % _, T.draw()), c.current = requestAnimationFrame(x);
|
|
1184
1184
|
};
|
|
1185
|
-
return c.current = requestAnimationFrame(
|
|
1185
|
+
return c.current = requestAnimationFrame(x), () => {
|
|
1186
1186
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1187
1187
|
};
|
|
1188
1188
|
}, [p]);
|
|
1189
|
-
const
|
|
1190
|
-
(
|
|
1189
|
+
const L = D(
|
|
1190
|
+
(T) => {
|
|
1191
1191
|
if (!g) return;
|
|
1192
|
-
const _ = i.current,
|
|
1193
|
-
if (!_ || !
|
|
1194
|
-
const N = _.getBoundingClientRect(),
|
|
1195
|
-
h.current.x =
|
|
1192
|
+
const _ = i.current, x = a.current;
|
|
1193
|
+
if (!_ || !x) return;
|
|
1194
|
+
const N = _.getBoundingClientRect(), F = T.clientX - N.left, z = N.height - (T.clientY - N.top);
|
|
1195
|
+
h.current.x = F, h.current.y = z, x.setMouse(F, z, h.current.clickX, h.current.clickY);
|
|
1196
1196
|
},
|
|
1197
1197
|
[g]
|
|
1198
|
-
),
|
|
1199
|
-
(
|
|
1198
|
+
), Y = D(
|
|
1199
|
+
(T) => {
|
|
1200
1200
|
if (!g) return;
|
|
1201
|
-
const _ = i.current,
|
|
1202
|
-
if (!_ || !
|
|
1203
|
-
const N = _.getBoundingClientRect(),
|
|
1204
|
-
h.current.isDown = !0, h.current.clickX =
|
|
1201
|
+
const _ = i.current, x = a.current;
|
|
1202
|
+
if (!_ || !x) return;
|
|
1203
|
+
const N = _.getBoundingClientRect(), F = T.clientX - N.left, z = N.height - (T.clientY - N.top);
|
|
1204
|
+
h.current.isDown = !0, h.current.clickX = F, h.current.clickY = z, x.setMouse(F, z, F, z);
|
|
1205
1205
|
},
|
|
1206
1206
|
[g]
|
|
1207
|
-
),
|
|
1207
|
+
), Q = D(() => {
|
|
1208
1208
|
g && (h.current.isDown = !1, h.current.clickX = -Math.abs(h.current.clickX));
|
|
1209
1209
|
}, [g]);
|
|
1210
1210
|
return s ? /* @__PURE__ */ E.jsx(
|
|
@@ -1214,25 +1214,25 @@ function Dr() {
|
|
|
1214
1214
|
"data-ikon-node-id": s.id,
|
|
1215
1215
|
className: I,
|
|
1216
1216
|
...v ? { width: v } : {},
|
|
1217
|
-
...
|
|
1218
|
-
onMouseMove:
|
|
1219
|
-
onMouseDown:
|
|
1220
|
-
onMouseUp:
|
|
1221
|
-
onMouseLeave:
|
|
1217
|
+
...A ? { height: A } : {},
|
|
1218
|
+
onMouseMove: L,
|
|
1219
|
+
onMouseDown: Y,
|
|
1220
|
+
onMouseUp: Q,
|
|
1221
|
+
onMouseLeave: Q
|
|
1222
1222
|
}
|
|
1223
1223
|
) : null;
|
|
1224
1224
|
});
|
|
1225
1225
|
return ({ type: e }) => {
|
|
1226
|
-
if (e ===
|
|
1226
|
+
if (e === Br)
|
|
1227
1227
|
return t;
|
|
1228
1228
|
};
|
|
1229
1229
|
}
|
|
1230
|
-
const
|
|
1231
|
-
function
|
|
1232
|
-
t.registerModule(
|
|
1230
|
+
const Vr = "shadertoy", Kr = async () => $r();
|
|
1231
|
+
function Yr(t) {
|
|
1232
|
+
t.registerModule(Vr, Kr);
|
|
1233
1233
|
}
|
|
1234
1234
|
const rt = Ee("UIRegistry");
|
|
1235
|
-
class
|
|
1235
|
+
class zr {
|
|
1236
1236
|
baseResolvers = [];
|
|
1237
1237
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1238
1238
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1254,7 +1254,7 @@ class Vr {
|
|
|
1254
1254
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1255
1255
|
if (!this.moduleResolvers.has(n))
|
|
1256
1256
|
try {
|
|
1257
|
-
const s = await o(), i =
|
|
1257
|
+
const s = await o(), i = Gr(s);
|
|
1258
1258
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1259
1259
|
} catch (s) {
|
|
1260
1260
|
rt.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
@@ -1262,7 +1262,7 @@ class Vr {
|
|
|
1262
1262
|
const r = [];
|
|
1263
1263
|
for (const n of this.moduleLoaders.keys())
|
|
1264
1264
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1265
|
-
return
|
|
1265
|
+
return Hr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1266
1266
|
}
|
|
1267
1267
|
resolve(e) {
|
|
1268
1268
|
for (const r of this.baseResolvers) {
|
|
@@ -1282,17 +1282,17 @@ class Vr {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1286
|
-
const t = new
|
|
1287
|
-
return
|
|
1285
|
+
function Wr() {
|
|
1286
|
+
const t = new zr();
|
|
1287
|
+
return yr(t), Or(t), Yr(t), t.loadRegisteredModules(), t;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function qr(t) {
|
|
1290
1290
|
return Array.isArray(t) ? t : [t];
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1293
|
-
return t ?
|
|
1292
|
+
function Gr(t) {
|
|
1293
|
+
return t ? qr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1295
|
+
function Hr(t, e) {
|
|
1296
1296
|
if (t.length !== e.length)
|
|
1297
1297
|
return !1;
|
|
1298
1298
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1330,7 +1330,7 @@ const Ie = Ee("MotionController"), nt = {
|
|
|
1330
1330
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1331
1331
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1332
1332
|
};
|
|
1333
|
-
function
|
|
1333
|
+
function B(t) {
|
|
1334
1334
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1335
1335
|
}
|
|
1336
1336
|
function ot(t) {
|
|
@@ -1353,65 +1353,65 @@ function it(t, e, r, n) {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
function y(m, g) {
|
|
1355
1355
|
for (let v = 0; v < 4; v += 1) {
|
|
1356
|
-
const
|
|
1357
|
-
if (
|
|
1356
|
+
const A = h(g, t, r);
|
|
1357
|
+
if (A === 0)
|
|
1358
1358
|
return g;
|
|
1359
1359
|
const I = u(g, t, r) - m;
|
|
1360
|
-
g -= I /
|
|
1360
|
+
g -= I / A;
|
|
1361
1361
|
}
|
|
1362
1362
|
return g;
|
|
1363
1363
|
}
|
|
1364
1364
|
function p(m, g, v) {
|
|
1365
|
-
let
|
|
1365
|
+
let A = 0, I = 0, L = 0;
|
|
1366
1366
|
do
|
|
1367
|
-
I = g + (v - g) / 2,
|
|
1368
|
-
while (Math.abs(
|
|
1367
|
+
I = g + (v - g) / 2, A = u(I, t, r) - m, A > 0 ? v = I : g = I;
|
|
1368
|
+
while (Math.abs(A) > 1e-7 && ++L < 10);
|
|
1369
1369
|
return I;
|
|
1370
1370
|
}
|
|
1371
1371
|
function b(m) {
|
|
1372
1372
|
let g = 0, v = 1;
|
|
1373
|
-
const
|
|
1374
|
-
for (; v !==
|
|
1373
|
+
const A = 10;
|
|
1374
|
+
for (; v !== A && l[v] <= m; v += 1)
|
|
1375
1375
|
g += 0.1;
|
|
1376
1376
|
v -= 1;
|
|
1377
|
-
const I = (m - l[v]) / (l[v + 1] - l[v]),
|
|
1378
|
-
return
|
|
1377
|
+
const I = (m - l[v]) / (l[v + 1] - l[v]), L = g + I * 0.1, Y = h(L, t, r);
|
|
1378
|
+
return Y >= 1e-3 ? y(m, L) : Y === 0 ? L : p(m, g, g + 0.1);
|
|
1379
1379
|
}
|
|
1380
1380
|
for (let m = 0; m < 11; m += 1)
|
|
1381
1381
|
l[m] = u(m * 0.1, t, r);
|
|
1382
1382
|
return (m) => m <= 0 ? 0 : m >= 1 ? 1 : u(b(m), e, n);
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function Jr(t) {
|
|
1385
1385
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1386
1386
|
if (!e)
|
|
1387
|
-
return (o) =>
|
|
1387
|
+
return (o) => B(o);
|
|
1388
1388
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1389
|
-
return n === "start" || n === "jump-start" ? (o) =>
|
|
1389
|
+
return n === "start" || n === "jump-start" ? (o) => B(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => B(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => B((Math.floor(o * r) + 0.5) / r) : (o) => B(Math.floor(o * r) / r);
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function Xr(t) {
|
|
1392
1392
|
if (!t)
|
|
1393
|
-
return (r) =>
|
|
1393
|
+
return (r) => B(r);
|
|
1394
1394
|
const e = t.trim().toLowerCase();
|
|
1395
1395
|
if (!e || e === "linear")
|
|
1396
|
-
return (r) =>
|
|
1396
|
+
return (r) => B(r);
|
|
1397
1397
|
if (nt[e]) {
|
|
1398
1398
|
const [r, n, o, s] = nt[e], i = it(r, n, o, s);
|
|
1399
|
-
return (a) =>
|
|
1399
|
+
return (a) => B(i(B(a)));
|
|
1400
1400
|
}
|
|
1401
1401
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1402
1402
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1403
1403
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1404
1404
|
const [o, s, i, a] = n, c = it(o, s, i, a);
|
|
1405
|
-
return (f) =>
|
|
1405
|
+
return (f) => B(c(B(f)));
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1409
|
-
const r =
|
|
1410
|
-
return (n) => r(
|
|
1409
|
+
const r = Jr(e);
|
|
1410
|
+
return (n) => r(B(n));
|
|
1411
1411
|
}
|
|
1412
|
-
return (r) =>
|
|
1412
|
+
return (r) => B(r);
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1414
|
+
function Zr(t) {
|
|
1415
1415
|
if (!t)
|
|
1416
1416
|
return;
|
|
1417
1417
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1421,7 +1421,7 @@ function Hr(t) {
|
|
|
1421
1421
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1422
1422
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1423
1423
|
}
|
|
1424
|
-
class
|
|
1424
|
+
class Qr {
|
|
1425
1425
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1426
1426
|
observer;
|
|
1427
1427
|
observeScheduled = !1;
|
|
@@ -1466,7 +1466,7 @@ class Jr {
|
|
|
1466
1466
|
const r = e.source?.trim();
|
|
1467
1467
|
if (!r)
|
|
1468
1468
|
return;
|
|
1469
|
-
const n = ot(e.min) ?? 0, o = ot(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c =
|
|
1469
|
+
const n = ot(e.min) ?? 0, o = ot(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Xr(e.ease), f = Zr(e.map), l = e.targetId?.trim() || void 0;
|
|
1470
1470
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1471
1471
|
source: r.toLowerCase(),
|
|
1472
1472
|
min: n,
|
|
@@ -1592,7 +1592,7 @@ class Jr {
|
|
|
1592
1592
|
case "unclamped":
|
|
1593
1593
|
return e;
|
|
1594
1594
|
default:
|
|
1595
|
-
return
|
|
1595
|
+
return B(e);
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
1598
|
applyMap(e, r) {
|
|
@@ -1679,9 +1679,9 @@ class Jr {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
|
-
const Oe = new
|
|
1683
|
-
function
|
|
1684
|
-
const e = w(/* @__PURE__ */ new Map()), r =
|
|
1682
|
+
const Oe = new Qr();
|
|
1683
|
+
function en(t) {
|
|
1684
|
+
const e = w(/* @__PURE__ */ new Map()), r = D(({ styleId: s, css: i, common: a }) => {
|
|
1685
1685
|
if (!(!s || typeof document > "u")) {
|
|
1686
1686
|
if (i) {
|
|
1687
1687
|
let c = e.current.get(s);
|
|
@@ -1689,13 +1689,13 @@ function Xr(t) {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
Oe.registerStyle(s, a);
|
|
1691
1691
|
}
|
|
1692
|
-
}, []), n =
|
|
1692
|
+
}, []), n = D((s) => {
|
|
1693
1693
|
if (!(typeof document > "u"))
|
|
1694
1694
|
for (const i of s) {
|
|
1695
1695
|
const a = e.current.get(i);
|
|
1696
1696
|
a && (a.remove(), e.current.delete(i)), Oe.unregisterStyle(i);
|
|
1697
1697
|
}
|
|
1698
|
-
}, []), o =
|
|
1698
|
+
}, []), o = D(() => {
|
|
1699
1699
|
if (typeof document < "u") {
|
|
1700
1700
|
for (const s of e.current.values())
|
|
1701
1701
|
s.remove();
|
|
@@ -1703,7 +1703,7 @@ function Xr(t) {
|
|
|
1703
1703
|
}
|
|
1704
1704
|
Oe.reset();
|
|
1705
1705
|
}, []);
|
|
1706
|
-
return
|
|
1706
|
+
return U(() => {
|
|
1707
1707
|
if (!t) return;
|
|
1708
1708
|
for (const a of t.getUiStyles())
|
|
1709
1709
|
r(a);
|
|
@@ -1711,9 +1711,9 @@ function Xr(t) {
|
|
|
1711
1711
|
return () => {
|
|
1712
1712
|
s?.(), i?.(), o();
|
|
1713
1713
|
};
|
|
1714
|
-
}, [t, o, r, n]),
|
|
1714
|
+
}, [t, o, r, n]), U(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1716
|
+
function tn(t) {
|
|
1717
1717
|
const e = [];
|
|
1718
1718
|
for (const [r, n] of t) {
|
|
1719
1719
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1721,62 +1721,62 @@ function Zr(t) {
|
|
|
1721
1721
|
}
|
|
1722
1722
|
return e.sort(), e.join(",");
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1725
|
-
const [e, r] =
|
|
1726
|
-
return
|
|
1724
|
+
function rn(t) {
|
|
1725
|
+
const [e, r] = J(), n = w("");
|
|
1726
|
+
return U(() => {
|
|
1727
1727
|
if (!t) {
|
|
1728
1728
|
r(void 0), n.current = "";
|
|
1729
1729
|
return;
|
|
1730
1730
|
}
|
|
1731
1731
|
const o = () => {
|
|
1732
|
-
const s = t.getStores(), i =
|
|
1732
|
+
const s = t.getStores(), i = tn(s);
|
|
1733
1733
|
i !== n.current && (n.current = i, r(s));
|
|
1734
1734
|
};
|
|
1735
1735
|
return o(), t.subscribe(o);
|
|
1736
1736
|
}, [t]), e;
|
|
1737
1737
|
}
|
|
1738
|
-
var
|
|
1739
|
-
function
|
|
1740
|
-
var e =
|
|
1738
|
+
var nn = typeof global == "object" && global && global.Object === Object && global, on = typeof self == "object" && self && self.Object === Object && self, sn = nn || on || Function("return this")(), we = sn.Symbol, bt = Object.prototype, an = bt.hasOwnProperty, cn = bt.toString, ue = we ? we.toStringTag : void 0;
|
|
1739
|
+
function un(t) {
|
|
1740
|
+
var e = an.call(t, ue), r = t[ue];
|
|
1741
1741
|
try {
|
|
1742
|
-
t[
|
|
1742
|
+
t[ue] = void 0;
|
|
1743
1743
|
var n = !0;
|
|
1744
1744
|
} catch {
|
|
1745
1745
|
}
|
|
1746
|
-
var o =
|
|
1747
|
-
return n && (e ? t[
|
|
1748
|
-
}
|
|
1749
|
-
var an = Object.prototype, cn = an.toString;
|
|
1750
|
-
function un(t) {
|
|
1751
|
-
return cn.call(t);
|
|
1746
|
+
var o = cn.call(t);
|
|
1747
|
+
return n && (e ? t[ue] = r : delete t[ue]), o;
|
|
1752
1748
|
}
|
|
1753
|
-
var ln =
|
|
1749
|
+
var ln = Object.prototype, dn = ln.toString;
|
|
1754
1750
|
function fn(t) {
|
|
1755
|
-
return
|
|
1751
|
+
return dn.call(t);
|
|
1756
1752
|
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1753
|
+
var hn = "[object Null]", mn = "[object Undefined]", at = we ? we.toStringTag : void 0;
|
|
1754
|
+
function pn(t) {
|
|
1755
|
+
return t == null ? t === void 0 ? mn : hn : at && at in Object(t) ? un(t) : fn(t);
|
|
1759
1756
|
}
|
|
1760
|
-
var mn = Array.isArray, pn = "[object String]";
|
|
1761
1757
|
function gn(t) {
|
|
1762
|
-
return
|
|
1758
|
+
return t != null && typeof t == "object";
|
|
1759
|
+
}
|
|
1760
|
+
var yn = Array.isArray, bn = "[object String]";
|
|
1761
|
+
function Sn(t) {
|
|
1762
|
+
return typeof t == "string" || !yn(t) && gn(t) && pn(t) == bn;
|
|
1763
1763
|
}
|
|
1764
1764
|
const ct = "ikonUiModules";
|
|
1765
1765
|
function De(t) {
|
|
1766
1766
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1767
1767
|
}
|
|
1768
|
-
function
|
|
1768
|
+
function wn(t) {
|
|
1769
1769
|
if (!Array.isArray(t))
|
|
1770
1770
|
return;
|
|
1771
1771
|
const e = /* @__PURE__ */ new Set();
|
|
1772
1772
|
for (const r of t) {
|
|
1773
|
-
if (!
|
|
1773
|
+
if (!Sn(r)) continue;
|
|
1774
1774
|
const n = r.trim();
|
|
1775
1775
|
n && (e.has(n) || e.add(n));
|
|
1776
1776
|
}
|
|
1777
1777
|
return Array.from(e);
|
|
1778
1778
|
}
|
|
1779
|
-
function
|
|
1779
|
+
function Eo(t, e) {
|
|
1780
1780
|
if (t === e)
|
|
1781
1781
|
return !0;
|
|
1782
1782
|
if (!t || !e)
|
|
@@ -1788,18 +1788,18 @@ function wo(t, e) {
|
|
|
1788
1788
|
return !1;
|
|
1789
1789
|
return !0;
|
|
1790
1790
|
}
|
|
1791
|
-
function
|
|
1791
|
+
function vn(t) {
|
|
1792
1792
|
if (!(!De(t) || !Object.prototype.hasOwnProperty.call(t, ct)))
|
|
1793
|
-
return
|
|
1793
|
+
return wn(t[ct]);
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function Ao(...t) {
|
|
1796
1796
|
for (const e of t) {
|
|
1797
|
-
const r =
|
|
1797
|
+
const r = vn(e);
|
|
1798
1798
|
if (r !== void 0)
|
|
1799
1799
|
return r;
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1802
|
+
function ko(t) {
|
|
1803
1803
|
if (!De(t))
|
|
1804
1804
|
return;
|
|
1805
1805
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
@@ -1848,7 +1848,7 @@ const R = {
|
|
|
1848
1848
|
Line: 4,
|
|
1849
1849
|
Paragraph: 8,
|
|
1850
1850
|
Emoji: 16
|
|
1851
|
-
},
|
|
1851
|
+
}, Rn = [
|
|
1852
1852
|
{
|
|
1853
1853
|
flag: R.Letter,
|
|
1854
1854
|
hints: [
|
|
@@ -1897,11 +1897,11 @@ const R = {
|
|
|
1897
1897
|
"[data-emoji]"
|
|
1898
1898
|
]
|
|
1899
1899
|
}
|
|
1900
|
-
], Fe = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji,
|
|
1901
|
-
function
|
|
1902
|
-
if (!t || t.length >
|
|
1900
|
+
], Fe = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, En = R.Letter | R.Word | R.Line | R.Paragraph, ut = /* @__PURE__ */ new Map(), An = 16384;
|
|
1901
|
+
function To(t, e) {
|
|
1902
|
+
if (!t || t.length > An)
|
|
1903
1903
|
return t;
|
|
1904
|
-
const r =
|
|
1904
|
+
const r = $n(e), n = oe(r, R.Emoji), o = r & En;
|
|
1905
1905
|
if (o === R.None && !n)
|
|
1906
1906
|
return t;
|
|
1907
1907
|
const s = t.replace(/\r\n/g, `
|
|
@@ -1909,23 +1909,23 @@ function Eo(t, e) {
|
|
|
1909
1909
|
`);
|
|
1910
1910
|
if (o === R.None)
|
|
1911
1911
|
return ht(s);
|
|
1912
|
-
const i =
|
|
1912
|
+
const i = Fn(s);
|
|
1913
1913
|
if (i.length === 0)
|
|
1914
1914
|
return n ? ht(s) : t;
|
|
1915
|
-
const a =
|
|
1915
|
+
const a = Bn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1916
1916
|
for (const l of a) {
|
|
1917
|
-
const u =
|
|
1917
|
+
const u = kn(l, r, c);
|
|
1918
1918
|
f.push(...u);
|
|
1919
1919
|
}
|
|
1920
1920
|
return f;
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function kn(t, e, r) {
|
|
1923
1923
|
const n = [];
|
|
1924
1924
|
for (const o of t) {
|
|
1925
|
-
const s =
|
|
1925
|
+
const s = Tn(o, e, r);
|
|
1926
1926
|
n.push(...s);
|
|
1927
1927
|
}
|
|
1928
|
-
if (
|
|
1928
|
+
if (oe(e, R.Paragraph)) {
|
|
1929
1929
|
const o = r.paragraph++;
|
|
1930
1930
|
return [
|
|
1931
1931
|
/* @__PURE__ */ E.jsx(
|
|
@@ -1941,9 +1941,9 @@ function Rn(t, e, r) {
|
|
|
1941
1941
|
}
|
|
1942
1942
|
return n;
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1945
|
-
const n =
|
|
1946
|
-
if (
|
|
1944
|
+
function Tn(t, e, r) {
|
|
1945
|
+
const n = Cn(t.text, e, r), o = [];
|
|
1946
|
+
if (oe(e, R.Line)) {
|
|
1947
1947
|
const s = r.line++;
|
|
1948
1948
|
o.push(
|
|
1949
1949
|
/* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ae(s), children: n }, `motion-line-${s}`)
|
|
@@ -1954,10 +1954,10 @@ function En(t, e, r) {
|
|
|
1954
1954
|
o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1955
1955
|
return o;
|
|
1956
1956
|
}
|
|
1957
|
-
function
|
|
1957
|
+
function Cn(t, e, r) {
|
|
1958
1958
|
if (!t)
|
|
1959
1959
|
return [];
|
|
1960
|
-
const n =
|
|
1960
|
+
const n = oe(e, R.Word), o = [], s = /(\s+)/g;
|
|
1961
1961
|
let i = 0, a;
|
|
1962
1962
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1963
1963
|
if (a.index > i) {
|
|
@@ -1973,16 +1973,16 @@ function An(t, e, r) {
|
|
|
1973
1973
|
return o;
|
|
1974
1974
|
}
|
|
1975
1975
|
function lt(t, e, r, n) {
|
|
1976
|
-
const o = e.word++, s =
|
|
1976
|
+
const o = e.word++, s = On(t, r, e), i = `motion-word-${o}`, a = In(o, n);
|
|
1977
1977
|
return n ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1979
|
+
function In(t, e) {
|
|
1980
1980
|
return e ? { ...Ae(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1981
1981
|
}
|
|
1982
|
-
function
|
|
1982
|
+
function On(t, e, r) {
|
|
1983
1983
|
if (!t)
|
|
1984
1984
|
return [];
|
|
1985
|
-
const n =
|
|
1985
|
+
const n = oe(e, R.Letter), o = oe(e, R.Emoji);
|
|
1986
1986
|
if (!n) {
|
|
1987
1987
|
if (!o)
|
|
1988
1988
|
return [t];
|
|
@@ -2012,33 +2012,33 @@ function Tn(t, e, r) {
|
|
|
2012
2012
|
function Be(t) {
|
|
2013
2013
|
if (!t)
|
|
2014
2014
|
return [];
|
|
2015
|
-
const e =
|
|
2016
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
2015
|
+
const e = _n();
|
|
2016
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : Nn(t);
|
|
2017
2017
|
}
|
|
2018
|
-
let
|
|
2019
|
-
function
|
|
2020
|
-
return
|
|
2018
|
+
let le;
|
|
2019
|
+
function _n() {
|
|
2020
|
+
return le !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? le = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : le = null), le;
|
|
2021
2021
|
}
|
|
2022
|
-
function
|
|
2022
|
+
function Nn(t) {
|
|
2023
2023
|
const e = [], r = Array.from(t);
|
|
2024
2024
|
let n = "";
|
|
2025
2025
|
for (let o = 0; o < r.length; o++) {
|
|
2026
2026
|
const s = r[o], i = r[o + 1];
|
|
2027
|
-
n += s, !(i &&
|
|
2027
|
+
n += s, !(i && Pn(s, i)) && (e.push(n), n = "");
|
|
2028
2028
|
}
|
|
2029
2029
|
return n && e.push(n), e;
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2032
|
-
return e ? !!(dt(t) || dt(e) ||
|
|
2031
|
+
function Pn(t, e) {
|
|
2032
|
+
return e ? !!(dt(t) || dt(e) || Un(e) || Mn(e) || jn(e) || ft(t) && ft(e)) : !1;
|
|
2033
2033
|
}
|
|
2034
2034
|
function dt(t) {
|
|
2035
2035
|
return t.codePointAt(0) === 8205;
|
|
2036
2036
|
}
|
|
2037
|
-
function
|
|
2037
|
+
function Mn(t) {
|
|
2038
2038
|
const e = t.codePointAt(0);
|
|
2039
2039
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2040
2040
|
}
|
|
2041
|
-
function
|
|
2041
|
+
function jn(t) {
|
|
2042
2042
|
const e = t.codePointAt(0);
|
|
2043
2043
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2044
2044
|
}
|
|
@@ -2047,10 +2047,10 @@ function ft(t) {
|
|
|
2047
2047
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2048
2048
|
}
|
|
2049
2049
|
let _e;
|
|
2050
|
-
function
|
|
2051
|
-
return t ? (_e || (_e =
|
|
2050
|
+
function Un(t) {
|
|
2051
|
+
return t ? (_e || (_e = Ln()), _e(t)) : !1;
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2053
|
+
function Ln() {
|
|
2054
2054
|
try {
|
|
2055
2055
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2056
2056
|
return (e) => t.test(e);
|
|
@@ -2063,17 +2063,17 @@ function Mn() {
|
|
|
2063
2063
|
}
|
|
2064
2064
|
let Ne;
|
|
2065
2065
|
function St(t) {
|
|
2066
|
-
return t ? (Ne || (Ne =
|
|
2066
|
+
return t ? (Ne || (Ne = xn()), Ne(t)) : !1;
|
|
2067
2067
|
}
|
|
2068
|
-
function
|
|
2068
|
+
function xn() {
|
|
2069
2069
|
try {
|
|
2070
2070
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2071
2071
|
return (e) => t.test(e);
|
|
2072
2072
|
} catch {
|
|
2073
|
-
return
|
|
2073
|
+
return Dn;
|
|
2074
2074
|
}
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function Dn(t) {
|
|
2077
2077
|
if (!t)
|
|
2078
2078
|
return !1;
|
|
2079
2079
|
for (const e of Array.from(t)) {
|
|
@@ -2083,7 +2083,7 @@ function Un(t) {
|
|
|
2083
2083
|
}
|
|
2084
2084
|
return !1;
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2086
|
+
function Fn(t) {
|
|
2087
2087
|
const e = [];
|
|
2088
2088
|
let r = "", n = 0;
|
|
2089
2089
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2097,7 +2097,7 @@ function Ln(t) {
|
|
|
2097
2097
|
}
|
|
2098
2098
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
2099
2099
|
}
|
|
2100
|
-
function
|
|
2100
|
+
function Bn(t) {
|
|
2101
2101
|
if (t.length === 0)
|
|
2102
2102
|
return [];
|
|
2103
2103
|
const e = [];
|
|
@@ -2106,7 +2106,7 @@ function xn(t) {
|
|
|
2106
2106
|
r.push(n), n.breaks >= 2 && (e.push(r), r = []);
|
|
2107
2107
|
return r.length > 0 && e.push(r), e;
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function oe(t, e) {
|
|
2110
2110
|
return (t & e) === e;
|
|
2111
2111
|
}
|
|
2112
2112
|
function Ae(t) {
|
|
@@ -2154,7 +2154,7 @@ function wt(t, e) {
|
|
|
2154
2154
|
}
|
|
2155
2155
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2156
2156
|
}
|
|
2157
|
-
function
|
|
2157
|
+
function $n(t) {
|
|
2158
2158
|
if (!t)
|
|
2159
2159
|
return R.None;
|
|
2160
2160
|
const e = t.trim();
|
|
@@ -2168,8 +2168,8 @@ function Dn(t) {
|
|
|
2168
2168
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2169
2169
|
if (n.length === 0)
|
|
2170
2170
|
return R.None;
|
|
2171
|
-
const s = n.map((c) => `.${
|
|
2172
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2171
|
+
const s = n.map((c) => `.${Vn(c)}`).map(
|
|
2172
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Kn(c)}(?![a-zA-Z0-9_-])`)
|
|
2173
2173
|
);
|
|
2174
2174
|
let i = R.None, a = !1;
|
|
2175
2175
|
for (const c of Array.from(document.styleSheets)) {
|
|
@@ -2197,7 +2197,7 @@ function vt(t, e) {
|
|
|
2197
2197
|
const a = s.selectorText ?? "";
|
|
2198
2198
|
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2199
2199
|
n = !0;
|
|
2200
|
-
for (const f of
|
|
2200
|
+
for (const f of Rn)
|
|
2201
2201
|
f.hints.some((l) => a.includes(l)) && (r |= f.flag);
|
|
2202
2202
|
if (r === Fe)
|
|
2203
2203
|
return { mask: r, sawStyleRule: !0 };
|
|
@@ -2211,19 +2211,19 @@ function vt(t, e) {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
return { mask: r, sawStyleRule: n };
|
|
2213
2213
|
}
|
|
2214
|
-
function
|
|
2214
|
+
function Vn(t) {
|
|
2215
2215
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2216
2216
|
}
|
|
2217
|
-
function
|
|
2217
|
+
function Kn(t) {
|
|
2218
2218
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2219
2219
|
}
|
|
2220
|
-
const ze = "ikon_auth_session",
|
|
2221
|
-
function
|
|
2220
|
+
const ze = "ikon_auth_session", Yn = 7 * 24 * 60 * 60 * 1e3, zn = 60 * 1e3;
|
|
2221
|
+
function Wn(t) {
|
|
2222
2222
|
try {
|
|
2223
2223
|
const e = t.split(".");
|
|
2224
2224
|
if (e.length !== 3) return !0;
|
|
2225
2225
|
const r = JSON.parse(atob(e[1]));
|
|
2226
|
-
return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 -
|
|
2226
|
+
return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 - zn;
|
|
2227
2227
|
} catch {
|
|
2228
2228
|
return !0;
|
|
2229
2229
|
}
|
|
@@ -2240,7 +2240,7 @@ function Rt() {
|
|
|
2240
2240
|
const t = localStorage.getItem(ze);
|
|
2241
2241
|
if (!t) return null;
|
|
2242
2242
|
const e = JSON.parse(t);
|
|
2243
|
-
return Date.now() - e.authenticatedAt >
|
|
2243
|
+
return Date.now() - e.authenticatedAt > Yn || Wn(e.token) ? (ve(), null) : e;
|
|
2244
2244
|
} catch {
|
|
2245
2245
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2246
2246
|
}
|
|
@@ -2252,7 +2252,7 @@ function ve() {
|
|
|
2252
2252
|
console.warn("Failed to clear auth session from localStorage");
|
|
2253
2253
|
}
|
|
2254
2254
|
}
|
|
2255
|
-
function
|
|
2255
|
+
function de(t) {
|
|
2256
2256
|
return {
|
|
2257
2257
|
id: "",
|
|
2258
2258
|
provider: t.provider,
|
|
@@ -2261,7 +2261,7 @@ function fe(t) {
|
|
|
2261
2261
|
};
|
|
2262
2262
|
}
|
|
2263
2263
|
async function Et(t, e) {
|
|
2264
|
-
const r =
|
|
2264
|
+
const r = Lt(), n = await fetch(`${e}/anonymous`, {
|
|
2265
2265
|
method: "POST",
|
|
2266
2266
|
headers: { "Content-Type": "application/json" },
|
|
2267
2267
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2277,7 +2277,7 @@ async function Et(t, e) {
|
|
|
2277
2277
|
};
|
|
2278
2278
|
return ke(s), s;
|
|
2279
2279
|
}
|
|
2280
|
-
async function
|
|
2280
|
+
async function Co(t) {
|
|
2281
2281
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
2282
2282
|
method: "POST",
|
|
2283
2283
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2292,22 +2292,22 @@ async function Ao(t) {
|
|
|
2292
2292
|
throw new Error(i);
|
|
2293
2293
|
}
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2295
|
+
function qn() {
|
|
2296
2296
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2297
2297
|
return e && r ? { token: e, provider: r } : null;
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2299
|
+
function Gn() {
|
|
2300
2300
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2301
2301
|
return e ? decodeURIComponent(e) : null;
|
|
2302
2302
|
}
|
|
2303
2303
|
function mt() {
|
|
2304
2304
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2305
2305
|
}
|
|
2306
|
-
function
|
|
2306
|
+
function Hn(t, e, r, n) {
|
|
2307
2307
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2308
2308
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2309
2309
|
}
|
|
2310
|
-
async function
|
|
2310
|
+
async function Jn(t) {
|
|
2311
2311
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2312
2312
|
method: "POST",
|
|
2313
2313
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2318,7 +2318,7 @@ async function qn(t) {
|
|
|
2318
2318
|
}
|
|
2319
2319
|
return e.json();
|
|
2320
2320
|
}
|
|
2321
|
-
async function
|
|
2321
|
+
async function Xn(t, e, r) {
|
|
2322
2322
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2323
2323
|
method: "POST",
|
|
2324
2324
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2335,7 +2335,7 @@ async function Gn(t, e, r) {
|
|
|
2335
2335
|
};
|
|
2336
2336
|
return ke(s), s;
|
|
2337
2337
|
}
|
|
2338
|
-
async function
|
|
2338
|
+
async function Zn(t, e) {
|
|
2339
2339
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2340
2340
|
method: "POST",
|
|
2341
2341
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2347,7 +2347,7 @@ async function Hn(t, e) {
|
|
|
2347
2347
|
}
|
|
2348
2348
|
return r.json();
|
|
2349
2349
|
}
|
|
2350
|
-
async function
|
|
2350
|
+
async function Qn(t, e) {
|
|
2351
2351
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2352
2352
|
method: "POST",
|
|
2353
2353
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2364,7 +2364,7 @@ async function Jn(t, e) {
|
|
|
2364
2364
|
};
|
|
2365
2365
|
return ke(o), o;
|
|
2366
2366
|
}
|
|
2367
|
-
function
|
|
2367
|
+
function X(t) {
|
|
2368
2368
|
const e = new Uint8Array(t);
|
|
2369
2369
|
let r = "";
|
|
2370
2370
|
for (const o of e)
|
|
@@ -2378,9 +2378,9 @@ function Re(t) {
|
|
|
2378
2378
|
return s;
|
|
2379
2379
|
}
|
|
2380
2380
|
function We() {
|
|
2381
|
-
return
|
|
2381
|
+
return eo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2382
2382
|
}
|
|
2383
|
-
const
|
|
2383
|
+
const eo = {
|
|
2384
2384
|
stubThis: (t) => t
|
|
2385
2385
|
};
|
|
2386
2386
|
function At(t) {
|
|
@@ -2402,7 +2402,7 @@ function kt(t) {
|
|
|
2402
2402
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
2403
2403
|
);
|
|
2404
2404
|
}
|
|
2405
|
-
class
|
|
2405
|
+
class j extends Error {
|
|
2406
2406
|
constructor({ message: e, code: r, cause: n, name: o }) {
|
|
2407
2407
|
super(e, { cause: n }), Object.defineProperty(this, "code", {
|
|
2408
2408
|
enumerable: !0,
|
|
@@ -2412,20 +2412,20 @@ class M extends Error {
|
|
|
2412
2412
|
}), this.name = o ?? n.name, this.code = r;
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
|
-
function
|
|
2415
|
+
function to({ error: t, options: e }) {
|
|
2416
2416
|
const { publicKey: r } = e;
|
|
2417
2417
|
if (!r)
|
|
2418
2418
|
throw Error("options was missing required publicKey property");
|
|
2419
2419
|
if (t.name === "AbortError") {
|
|
2420
2420
|
if (e.signal instanceof AbortSignal)
|
|
2421
|
-
return new
|
|
2421
|
+
return new j({
|
|
2422
2422
|
message: "Registration ceremony was sent an abort signal",
|
|
2423
2423
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2424
2424
|
cause: t
|
|
2425
2425
|
});
|
|
2426
2426
|
} else if (t.name === "ConstraintError") {
|
|
2427
2427
|
if (r.authenticatorSelection?.requireResidentKey === !0)
|
|
2428
|
-
return new
|
|
2428
|
+
return new j({
|
|
2429
2429
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
2430
2430
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
2431
2431
|
cause: t
|
|
@@ -2434,36 +2434,36 @@ function Zn({ error: t, options: e }) {
|
|
|
2434
2434
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
2435
2435
|
e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
|
|
2436
2436
|
)
|
|
2437
|
-
return new
|
|
2437
|
+
return new j({
|
|
2438
2438
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2439
2439
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2440
2440
|
cause: t
|
|
2441
2441
|
});
|
|
2442
2442
|
if (r.authenticatorSelection?.userVerification === "required")
|
|
2443
|
-
return new
|
|
2443
|
+
return new j({
|
|
2444
2444
|
message: "User verification was required but no available authenticator supported it",
|
|
2445
2445
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2446
2446
|
cause: t
|
|
2447
2447
|
});
|
|
2448
2448
|
} else {
|
|
2449
2449
|
if (t.name === "InvalidStateError")
|
|
2450
|
-
return new
|
|
2450
|
+
return new j({
|
|
2451
2451
|
message: "The authenticator was previously registered",
|
|
2452
2452
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2453
2453
|
cause: t
|
|
2454
2454
|
});
|
|
2455
2455
|
if (t.name === "NotAllowedError")
|
|
2456
|
-
return new
|
|
2456
|
+
return new j({
|
|
2457
2457
|
message: t.message,
|
|
2458
2458
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2459
2459
|
cause: t
|
|
2460
2460
|
});
|
|
2461
2461
|
if (t.name === "NotSupportedError")
|
|
2462
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
2462
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new j({
|
|
2463
2463
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2464
2464
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2465
2465
|
cause: t
|
|
2466
|
-
}) : new
|
|
2466
|
+
}) : new j({
|
|
2467
2467
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2468
2468
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2469
2469
|
cause: t
|
|
@@ -2472,25 +2472,25 @@ function Zn({ error: t, options: e }) {
|
|
|
2472
2472
|
const n = globalThis.location.hostname;
|
|
2473
2473
|
if (kt(n)) {
|
|
2474
2474
|
if (r.rp.id !== n)
|
|
2475
|
-
return new
|
|
2475
|
+
return new j({
|
|
2476
2476
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
2477
2477
|
code: "ERROR_INVALID_RP_ID",
|
|
2478
2478
|
cause: t
|
|
2479
2479
|
});
|
|
2480
|
-
} else return new
|
|
2480
|
+
} else return new j({
|
|
2481
2481
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2482
2482
|
code: "ERROR_INVALID_DOMAIN",
|
|
2483
2483
|
cause: t
|
|
2484
2484
|
});
|
|
2485
2485
|
} else if (t.name === "TypeError") {
|
|
2486
2486
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
2487
|
-
return new
|
|
2487
|
+
return new j({
|
|
2488
2488
|
message: "User ID was not between 1 and 64 characters",
|
|
2489
2489
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2490
2490
|
cause: t
|
|
2491
2491
|
});
|
|
2492
2492
|
} else if (t.name === "UnknownError")
|
|
2493
|
-
return new
|
|
2493
|
+
return new j({
|
|
2494
2494
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2495
2495
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2496
2496
|
cause: t
|
|
@@ -2498,7 +2498,7 @@ function Zn({ error: t, options: e }) {
|
|
|
2498
2498
|
}
|
|
2499
2499
|
return t;
|
|
2500
2500
|
}
|
|
2501
|
-
class
|
|
2501
|
+
class ro {
|
|
2502
2502
|
constructor() {
|
|
2503
2503
|
Object.defineProperty(this, "controller", {
|
|
2504
2504
|
enumerable: !0,
|
|
@@ -2522,12 +2522,12 @@ class Qn {
|
|
|
2522
2522
|
}
|
|
2523
2523
|
}
|
|
2524
2524
|
}
|
|
2525
|
-
const Tt = new
|
|
2525
|
+
const Tt = new ro(), no = ["cross-platform", "platform"];
|
|
2526
2526
|
function Ct(t) {
|
|
2527
|
-
if (t && !(
|
|
2527
|
+
if (t && !(no.indexOf(t) < 0))
|
|
2528
2528
|
return t;
|
|
2529
2529
|
}
|
|
2530
|
-
async function
|
|
2530
|
+
async function oo(t) {
|
|
2531
2531
|
!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 });
|
|
2532
2532
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2533
2533
|
if (!We())
|
|
@@ -2546,7 +2546,7 @@ async function to(t) {
|
|
|
2546
2546
|
try {
|
|
2547
2547
|
s = await navigator.credentials.create(o);
|
|
2548
2548
|
} catch (p) {
|
|
2549
|
-
throw
|
|
2549
|
+
throw to({ error: p, options: o });
|
|
2550
2550
|
}
|
|
2551
2551
|
if (!s)
|
|
2552
2552
|
throw new Error("Registration was not completed");
|
|
@@ -2564,23 +2564,23 @@ async function to(t) {
|
|
|
2564
2564
|
if (typeof c.getPublicKey == "function")
|
|
2565
2565
|
try {
|
|
2566
2566
|
const p = c.getPublicKey();
|
|
2567
|
-
p !== null && (h =
|
|
2567
|
+
p !== null && (h = X(p));
|
|
2568
2568
|
} catch (p) {
|
|
2569
2569
|
Pe("getPublicKey()", p);
|
|
2570
2570
|
}
|
|
2571
2571
|
let y;
|
|
2572
2572
|
if (typeof c.getAuthenticatorData == "function")
|
|
2573
2573
|
try {
|
|
2574
|
-
y =
|
|
2574
|
+
y = X(c.getAuthenticatorData());
|
|
2575
2575
|
} catch (p) {
|
|
2576
2576
|
Pe("getAuthenticatorData()", p);
|
|
2577
2577
|
}
|
|
2578
2578
|
return {
|
|
2579
2579
|
id: i,
|
|
2580
|
-
rawId:
|
|
2580
|
+
rawId: X(a),
|
|
2581
2581
|
response: {
|
|
2582
|
-
attestationObject:
|
|
2583
|
-
clientDataJSON:
|
|
2582
|
+
attestationObject: X(c.attestationObject),
|
|
2583
|
+
clientDataJSON: X(c.clientDataJSON),
|
|
2584
2584
|
transports: l,
|
|
2585
2585
|
publicKeyAlgorithm: u,
|
|
2586
2586
|
publicKey: h,
|
|
@@ -2595,7 +2595,7 @@ function Pe(t, e) {
|
|
|
2595
2595
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2596
2596
|
`, e);
|
|
2597
2597
|
}
|
|
2598
|
-
function
|
|
2598
|
+
function so() {
|
|
2599
2599
|
if (!We())
|
|
2600
2600
|
return Me.stubThis(new Promise((e) => e(!1)));
|
|
2601
2601
|
const t = globalThis.PublicKeyCredential;
|
|
@@ -2604,20 +2604,20 @@ function ro() {
|
|
|
2604
2604
|
const Me = {
|
|
2605
2605
|
stubThis: (t) => t
|
|
2606
2606
|
};
|
|
2607
|
-
function
|
|
2607
|
+
function io({ error: t, options: e }) {
|
|
2608
2608
|
const { publicKey: r } = e;
|
|
2609
2609
|
if (!r)
|
|
2610
2610
|
throw Error("options was missing required publicKey property");
|
|
2611
2611
|
if (t.name === "AbortError") {
|
|
2612
2612
|
if (e.signal instanceof AbortSignal)
|
|
2613
|
-
return new
|
|
2613
|
+
return new j({
|
|
2614
2614
|
message: "Authentication ceremony was sent an abort signal",
|
|
2615
2615
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2616
2616
|
cause: t
|
|
2617
2617
|
});
|
|
2618
2618
|
} else {
|
|
2619
2619
|
if (t.name === "NotAllowedError")
|
|
2620
|
-
return new
|
|
2620
|
+
return new j({
|
|
2621
2621
|
message: t.message,
|
|
2622
2622
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2623
2623
|
cause: t
|
|
@@ -2626,18 +2626,18 @@ function no({ error: t, options: e }) {
|
|
|
2626
2626
|
const n = globalThis.location.hostname;
|
|
2627
2627
|
if (kt(n)) {
|
|
2628
2628
|
if (r.rpId !== n)
|
|
2629
|
-
return new
|
|
2629
|
+
return new j({
|
|
2630
2630
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
2631
2631
|
code: "ERROR_INVALID_RP_ID",
|
|
2632
2632
|
cause: t
|
|
2633
2633
|
});
|
|
2634
|
-
} else return new
|
|
2634
|
+
} else return new j({
|
|
2635
2635
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2636
2636
|
code: "ERROR_INVALID_DOMAIN",
|
|
2637
2637
|
cause: t
|
|
2638
2638
|
});
|
|
2639
2639
|
} else if (t.name === "UnknownError")
|
|
2640
|
-
return new
|
|
2640
|
+
return new j({
|
|
2641
2641
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2642
2642
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2643
2643
|
cause: t
|
|
@@ -2645,7 +2645,7 @@ function no({ error: t, options: e }) {
|
|
|
2645
2645
|
}
|
|
2646
2646
|
return t;
|
|
2647
2647
|
}
|
|
2648
|
-
async function
|
|
2648
|
+
async function ao(t) {
|
|
2649
2649
|
!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 });
|
|
2650
2650
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2651
2651
|
if (!We())
|
|
@@ -2658,7 +2658,7 @@ async function oo(t) {
|
|
|
2658
2658
|
allowCredentials: o
|
|
2659
2659
|
}, i = {};
|
|
2660
2660
|
if (r) {
|
|
2661
|
-
if (!await
|
|
2661
|
+
if (!await so())
|
|
2662
2662
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2663
2663
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2664
2664
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -2669,19 +2669,19 @@ async function oo(t) {
|
|
|
2669
2669
|
try {
|
|
2670
2670
|
a = await navigator.credentials.get(i);
|
|
2671
2671
|
} catch (y) {
|
|
2672
|
-
throw
|
|
2672
|
+
throw io({ error: y, options: i });
|
|
2673
2673
|
}
|
|
2674
2674
|
if (!a)
|
|
2675
2675
|
throw new Error("Authentication was not completed");
|
|
2676
2676
|
const { id: c, rawId: f, response: l, type: u } = a;
|
|
2677
2677
|
let h;
|
|
2678
|
-
return l.userHandle && (h =
|
|
2678
|
+
return l.userHandle && (h = X(l.userHandle)), {
|
|
2679
2679
|
id: c,
|
|
2680
|
-
rawId:
|
|
2680
|
+
rawId: X(f),
|
|
2681
2681
|
response: {
|
|
2682
|
-
authenticatorData:
|
|
2683
|
-
clientDataJSON:
|
|
2684
|
-
signature:
|
|
2682
|
+
authenticatorData: X(l.authenticatorData),
|
|
2683
|
+
clientDataJSON: X(l.clientDataJSON),
|
|
2684
|
+
signature: X(l.signature),
|
|
2685
2685
|
userHandle: h
|
|
2686
2686
|
},
|
|
2687
2687
|
type: u,
|
|
@@ -2690,16 +2690,16 @@ async function oo(t) {
|
|
|
2690
2690
|
};
|
|
2691
2691
|
}
|
|
2692
2692
|
const qe = pt(null);
|
|
2693
|
-
function
|
|
2694
|
-
const [r, n] =
|
|
2693
|
+
function Io({ children: t, config: e }) {
|
|
2694
|
+
const [r, n] = J({
|
|
2695
2695
|
isAuthenticated: !1,
|
|
2696
2696
|
isLoading: !0,
|
|
2697
2697
|
user: null,
|
|
2698
2698
|
error: null
|
|
2699
2699
|
});
|
|
2700
|
-
|
|
2700
|
+
U(() => {
|
|
2701
2701
|
(() => {
|
|
2702
|
-
const l =
|
|
2702
|
+
const l = Gn();
|
|
2703
2703
|
if (l) {
|
|
2704
2704
|
mt(), n({
|
|
2705
2705
|
isAuthenticated: !1,
|
|
@@ -2709,7 +2709,7 @@ function ko({ children: t, config: e }) {
|
|
|
2709
2709
|
});
|
|
2710
2710
|
return;
|
|
2711
2711
|
}
|
|
2712
|
-
const u =
|
|
2712
|
+
const u = qn();
|
|
2713
2713
|
if (u) {
|
|
2714
2714
|
const y = {
|
|
2715
2715
|
token: u.token,
|
|
@@ -2719,7 +2719,7 @@ function ko({ children: t, config: e }) {
|
|
|
2719
2719
|
ke(y), mt(), n({
|
|
2720
2720
|
isAuthenticated: !0,
|
|
2721
2721
|
isLoading: !1,
|
|
2722
|
-
user:
|
|
2722
|
+
user: de(y),
|
|
2723
2723
|
error: null
|
|
2724
2724
|
});
|
|
2725
2725
|
return;
|
|
@@ -2729,7 +2729,7 @@ function ko({ children: t, config: e }) {
|
|
|
2729
2729
|
n({
|
|
2730
2730
|
isAuthenticated: !0,
|
|
2731
2731
|
isLoading: !1,
|
|
2732
|
-
user:
|
|
2732
|
+
user: de(h),
|
|
2733
2733
|
error: null
|
|
2734
2734
|
});
|
|
2735
2735
|
return;
|
|
@@ -2742,7 +2742,7 @@ function ko({ children: t, config: e }) {
|
|
|
2742
2742
|
});
|
|
2743
2743
|
})();
|
|
2744
2744
|
}, []);
|
|
2745
|
-
const o =
|
|
2745
|
+
const o = D(
|
|
2746
2746
|
async (f) => {
|
|
2747
2747
|
if (!e.spaceId) {
|
|
2748
2748
|
n((u) => ({
|
|
@@ -2759,7 +2759,7 @@ function ko({ children: t, config: e }) {
|
|
|
2759
2759
|
n({
|
|
2760
2760
|
isAuthenticated: !0,
|
|
2761
2761
|
isLoading: !1,
|
|
2762
|
-
user:
|
|
2762
|
+
user: de(u),
|
|
2763
2763
|
error: null
|
|
2764
2764
|
});
|
|
2765
2765
|
} catch (u) {
|
|
@@ -2774,11 +2774,11 @@ function ko({ children: t, config: e }) {
|
|
|
2774
2774
|
if (f === "passkey") {
|
|
2775
2775
|
n((u) => ({ ...u, isLoading: !0, error: null }));
|
|
2776
2776
|
try {
|
|
2777
|
-
const u = await
|
|
2777
|
+
const u = await Zn(l), h = await ao({ optionsJSON: u }), y = await Qn(l, h);
|
|
2778
2778
|
n({
|
|
2779
2779
|
isAuthenticated: !0,
|
|
2780
2780
|
isLoading: !1,
|
|
2781
|
-
user:
|
|
2781
|
+
user: de(y),
|
|
2782
2782
|
error: null
|
|
2783
2783
|
});
|
|
2784
2784
|
} catch (u) {
|
|
@@ -2790,26 +2790,26 @@ function ko({ children: t, config: e }) {
|
|
|
2790
2790
|
}
|
|
2791
2791
|
return;
|
|
2792
2792
|
}
|
|
2793
|
-
window.location.href =
|
|
2793
|
+
window.location.href = Hn(f, e.spaceId, l);
|
|
2794
2794
|
},
|
|
2795
2795
|
[e.authUrl, e.spaceId]
|
|
2796
|
-
), s =
|
|
2796
|
+
), s = D(() => {
|
|
2797
2797
|
ve(), n({
|
|
2798
2798
|
isAuthenticated: !1,
|
|
2799
2799
|
isLoading: !1,
|
|
2800
2800
|
user: null,
|
|
2801
2801
|
error: null
|
|
2802
2802
|
});
|
|
2803
|
-
}, []), i =
|
|
2803
|
+
}, []), i = D(
|
|
2804
2804
|
async (f) => {
|
|
2805
2805
|
const l = je(e.authUrl);
|
|
2806
2806
|
n((u) => ({ ...u, isLoading: !0, error: null }));
|
|
2807
2807
|
try {
|
|
2808
|
-
const u = await
|
|
2808
|
+
const u = await Jn(l), h = await oo({ optionsJSON: u }), y = await Xn(l, h, f);
|
|
2809
2809
|
n({
|
|
2810
2810
|
isAuthenticated: !0,
|
|
2811
2811
|
isLoading: !1,
|
|
2812
|
-
user:
|
|
2812
|
+
user: de(y),
|
|
2813
2813
|
error: null
|
|
2814
2814
|
});
|
|
2815
2815
|
} catch (u) {
|
|
@@ -2821,7 +2821,7 @@ function ko({ children: t, config: e }) {
|
|
|
2821
2821
|
}
|
|
2822
2822
|
},
|
|
2823
2823
|
[e.authUrl]
|
|
2824
|
-
), a =
|
|
2824
|
+
), a = D(() => r.user?.token ?? null, [r.user]), c = V(
|
|
2825
2825
|
() => ({
|
|
2826
2826
|
state: r,
|
|
2827
2827
|
login: o,
|
|
@@ -2833,18 +2833,18 @@ function ko({ children: t, config: e }) {
|
|
|
2833
2833
|
);
|
|
2834
2834
|
return /* @__PURE__ */ E.jsx(qe, { value: c, children: t });
|
|
2835
2835
|
}
|
|
2836
|
-
function
|
|
2836
|
+
function co() {
|
|
2837
2837
|
const t = Ve(qe);
|
|
2838
2838
|
if (!t)
|
|
2839
2839
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2840
2840
|
return t;
|
|
2841
2841
|
}
|
|
2842
|
-
function
|
|
2842
|
+
function uo() {
|
|
2843
2843
|
return Ve(qe);
|
|
2844
2844
|
}
|
|
2845
|
-
function
|
|
2846
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2847
|
-
return
|
|
2845
|
+
function Oo(t) {
|
|
2846
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = co(), s = w(!1);
|
|
2847
|
+
return U(() => {
|
|
2848
2848
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2849
2849
|
return;
|
|
2850
2850
|
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
@@ -2860,7 +2860,7 @@ function To(t) {
|
|
|
2860
2860
|
error: n.error
|
|
2861
2861
|
};
|
|
2862
2862
|
}
|
|
2863
|
-
function
|
|
2863
|
+
function _o({
|
|
2864
2864
|
connectionState: t,
|
|
2865
2865
|
error: e,
|
|
2866
2866
|
isReady: r,
|
|
@@ -2905,160 +2905,165 @@ function Co({
|
|
|
2905
2905
|
}
|
|
2906
2906
|
}
|
|
2907
2907
|
const be = Ee("useIkonApp");
|
|
2908
|
-
function
|
|
2908
|
+
function lo() {
|
|
2909
2909
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2910
2910
|
return window.__IKON_AUTH_CONFIG__;
|
|
2911
2911
|
}
|
|
2912
|
-
function
|
|
2912
|
+
function fo() {
|
|
2913
2913
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
2914
2914
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2915
2915
|
}
|
|
2916
|
-
function
|
|
2917
|
-
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: f, proxy: l } = t, u = e === void 0 ?
|
|
2918
|
-
|
|
2919
|
-
const [N,
|
|
2916
|
+
function No(t) {
|
|
2917
|
+
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: f, proxy: l } = t, u = e === void 0 ? lo() ?? null : e, h = fo(), y = uo(), p = w(null), b = w(null), m = w(null), g = w(!1), v = w(!1), A = w(o), I = w(n), L = w(s), Y = w(i), Q = w(a), T = w(c), _ = w(f), x = w(l);
|
|
2918
|
+
A.current = o, I.current = n, L.current = s, Y.current = i, Q.current = a, T.current = c, _.current = f, x.current = l;
|
|
2919
|
+
const [N, F] = J("idle"), [z, ne] = J(null), [he, me] = J(null), [se, pe] = J(null), [ee, d] = J(null), [S, k] = J(!1), [P, W] = J(0), C = V(() => {
|
|
2920
2920
|
try {
|
|
2921
|
-
const
|
|
2922
|
-
return (
|
|
2921
|
+
const M = xt();
|
|
2922
|
+
return (M.sessionId || M.channelKey) && Dt(), M;
|
|
2923
2923
|
} catch {
|
|
2924
2924
|
return { parameters: {} };
|
|
2925
2925
|
}
|
|
2926
|
-
}, []),
|
|
2927
|
-
|
|
2928
|
-
!
|
|
2929
|
-
|
|
2930
|
-
}).catch((
|
|
2931
|
-
be.error("Anonymous auth failed:",
|
|
2926
|
+
}, []), q = V(() => u?.enabled ? Rt() : null, [u?.enabled, P]), te = h?.enabled ?? !1, O = h?.host ?? "localhost", G = h?.port ?? 8443;
|
|
2927
|
+
U(() => {
|
|
2928
|
+
!te && Ge() && u && !u.enabled && u.spaceId && !ee && !S && (k(!0), Et(u.spaceId, je(u.authUrl)).then(($) => {
|
|
2929
|
+
d($.token);
|
|
2930
|
+
}).catch(($) => {
|
|
2931
|
+
be.error("Anonymous auth failed:", $), ne($ instanceof Error ? $.message : "Anonymous auth failed");
|
|
2932
2932
|
}).finally(() => {
|
|
2933
|
-
|
|
2933
|
+
k(!1);
|
|
2934
2934
|
}));
|
|
2935
|
-
}, [
|
|
2936
|
-
const
|
|
2937
|
-
if (
|
|
2938
|
-
const
|
|
2935
|
+
}, [te, u, ee, S]);
|
|
2936
|
+
const re = V(() => {
|
|
2937
|
+
if (te) {
|
|
2938
|
+
const M = q?.token ? Ft(q.token) ?? void 0 : void 0;
|
|
2939
2939
|
return {
|
|
2940
2940
|
local: {
|
|
2941
|
-
host:
|
|
2942
|
-
httpsPort:
|
|
2943
|
-
userId:
|
|
2944
|
-
token:
|
|
2941
|
+
host: O,
|
|
2942
|
+
httpsPort: G,
|
|
2943
|
+
userId: M,
|
|
2944
|
+
token: q?.token ?? void 0,
|
|
2945
2945
|
spaceId: u?.spaceId,
|
|
2946
2946
|
backendUrl: u?.backendUrl,
|
|
2947
2947
|
authUrl: u?.authUrl,
|
|
2948
|
-
parameters:
|
|
2948
|
+
parameters: C.parameters
|
|
2949
2949
|
}
|
|
2950
2950
|
};
|
|
2951
2951
|
}
|
|
2952
|
-
return
|
|
2952
|
+
return q?.token && u?.spaceId ? {
|
|
2953
2953
|
sessionToken: {
|
|
2954
|
-
token:
|
|
2954
|
+
token: q.token,
|
|
2955
2955
|
spaceId: u.spaceId,
|
|
2956
2956
|
backendType: He(),
|
|
2957
|
-
sessionId:
|
|
2958
|
-
channelKey:
|
|
2959
|
-
parameters:
|
|
2957
|
+
sessionId: C.sessionId,
|
|
2958
|
+
channelKey: C.channelKey,
|
|
2959
|
+
parameters: C.parameters
|
|
2960
2960
|
}
|
|
2961
|
-
} :
|
|
2961
|
+
} : ee && u?.spaceId ? {
|
|
2962
2962
|
sessionToken: {
|
|
2963
|
-
token:
|
|
2963
|
+
token: ee,
|
|
2964
2964
|
spaceId: u.spaceId,
|
|
2965
2965
|
backendType: He(),
|
|
2966
|
-
sessionId:
|
|
2967
|
-
channelKey:
|
|
2968
|
-
parameters:
|
|
2966
|
+
sessionId: C.sessionId,
|
|
2967
|
+
channelKey: C.channelKey,
|
|
2968
|
+
parameters: C.parameters
|
|
2969
2969
|
}
|
|
2970
2970
|
} : Ge() ? null : {
|
|
2971
2971
|
local: {
|
|
2972
|
-
host:
|
|
2973
|
-
httpsPort:
|
|
2972
|
+
host: O,
|
|
2973
|
+
httpsPort: G,
|
|
2974
2974
|
spaceId: u?.spaceId,
|
|
2975
2975
|
backendUrl: u?.backendUrl,
|
|
2976
2976
|
authUrl: u?.authUrl,
|
|
2977
|
-
parameters:
|
|
2977
|
+
parameters: C.parameters
|
|
2978
2978
|
}
|
|
2979
2979
|
};
|
|
2980
|
-
}, [
|
|
2981
|
-
|
|
2982
|
-
const
|
|
2983
|
-
|
|
2980
|
+
}, [te, O, G, q?.token, u?.spaceId, u?.backendUrl, u?.authUrl, ee, C.sessionId, C.channelKey, C.parameters]);
|
|
2981
|
+
en(se);
|
|
2982
|
+
const Te = rn(se);
|
|
2983
|
+
U(() => {
|
|
2984
2984
|
if (!g.current) {
|
|
2985
|
-
if (g.current = !0, m.current =
|
|
2986
|
-
for (const
|
|
2987
|
-
|
|
2988
|
-
m.current.loadRegisteredModules().catch((
|
|
2989
|
-
be.error("Failed to load UI modules",
|
|
2985
|
+
if (g.current = !0, m.current = Wr(), r)
|
|
2986
|
+
for (const M of r)
|
|
2987
|
+
M(m.current);
|
|
2988
|
+
m.current.loadRegisteredModules().catch((M) => {
|
|
2989
|
+
be.error("Failed to load UI modules", M);
|
|
2990
2990
|
});
|
|
2991
2991
|
}
|
|
2992
|
-
}, []),
|
|
2993
|
-
if (!
|
|
2994
|
-
const
|
|
2995
|
-
...
|
|
2992
|
+
}, []), U(() => {
|
|
2993
|
+
if (!re) return;
|
|
2994
|
+
const M = new Bt({
|
|
2995
|
+
...re,
|
|
2996
2996
|
timeouts: I.current,
|
|
2997
|
-
audio:
|
|
2998
|
-
enabled:
|
|
2999
|
-
...
|
|
2997
|
+
audio: Y.current !== void 0 || A.current ? {
|
|
2998
|
+
enabled: Y.current,
|
|
2999
|
+
...A.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
3000
3000
|
} : void 0,
|
|
3001
|
-
video:
|
|
3001
|
+
video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
|
|
3002
3002
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3003
|
-
webRtc:
|
|
3004
|
-
websocket:
|
|
3003
|
+
webRtc: L.current ? { enabled: !0 } : void 0,
|
|
3004
|
+
websocket: T.current,
|
|
3005
3005
|
webtransport: _.current,
|
|
3006
|
-
proxy:
|
|
3007
|
-
onConnectionStateChange: (
|
|
3008
|
-
|
|
3006
|
+
proxy: x.current,
|
|
3007
|
+
onConnectionStateChange: (H) => {
|
|
3008
|
+
F(H);
|
|
3009
3009
|
},
|
|
3010
|
-
onError: (
|
|
3011
|
-
|
|
3010
|
+
onError: (H) => {
|
|
3011
|
+
ne(H.message);
|
|
3012
3012
|
}
|
|
3013
3013
|
});
|
|
3014
|
-
p.current =
|
|
3015
|
-
const
|
|
3016
|
-
return b.current =
|
|
3017
|
-
be.error("Connection failed:",
|
|
3014
|
+
p.current = M;
|
|
3015
|
+
const $ = new ar({ client: M });
|
|
3016
|
+
return b.current = $, pe($), M.connect().catch((H) => {
|
|
3017
|
+
if (be.error("Connection failed:", H), H instanceof $t) {
|
|
3018
|
+
me(H.reason);
|
|
3019
|
+
return;
|
|
3020
|
+
}
|
|
3021
|
+
H instanceof Vt && !v.current && (v.current = !0, be.warn("Auth session appears stale, clearing and retrying"), y ? y.logout() : (ve(), W((Nt) => Nt + 1)));
|
|
3018
3022
|
}), () => {
|
|
3019
|
-
|
|
3023
|
+
M.disconnect(), p.current = null, $.dispose(), b.current = null;
|
|
3020
3024
|
};
|
|
3021
|
-
}, [
|
|
3022
|
-
const
|
|
3023
|
-
const
|
|
3024
|
-
p.current?.sendActionCall(
|
|
3025
|
-
}, []),
|
|
3025
|
+
}, [re]);
|
|
3026
|
+
const Ot = D((M, $) => {
|
|
3027
|
+
const H = typeof $ == "string" ? $ : JSON.stringify($ ?? {});
|
|
3028
|
+
p.current?.sendActionCall(M, H);
|
|
3029
|
+
}, []), _t = N === "connected" || N === "reconnecting";
|
|
3026
3030
|
return {
|
|
3027
3031
|
connectionState: N,
|
|
3028
|
-
error:
|
|
3029
|
-
|
|
3032
|
+
error: z,
|
|
3033
|
+
accessDeniedReason: he,
|
|
3034
|
+
stores: Te,
|
|
3030
3035
|
client: p.current,
|
|
3031
3036
|
registry: m.current,
|
|
3032
3037
|
clientRef: p,
|
|
3033
3038
|
uiRef: b,
|
|
3034
3039
|
registryRef: m,
|
|
3035
|
-
onAction:
|
|
3036
|
-
isReady:
|
|
3040
|
+
onAction: Ot,
|
|
3041
|
+
isReady: _t,
|
|
3037
3042
|
webRtcVideoStreams: p.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3038
3043
|
webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3039
3044
|
};
|
|
3040
3045
|
}
|
|
3041
|
-
function
|
|
3046
|
+
function Po(t) {
|
|
3042
3047
|
const e = w(!1);
|
|
3043
|
-
return
|
|
3048
|
+
return D(() => {
|
|
3044
3049
|
if (e.current) return;
|
|
3045
3050
|
e.current = !0;
|
|
3046
3051
|
const r = document.createElement("link");
|
|
3047
3052
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
3048
3053
|
}, [t]);
|
|
3049
3054
|
}
|
|
3050
|
-
let
|
|
3051
|
-
function
|
|
3052
|
-
const [r, n] =
|
|
3055
|
+
let ho = 0;
|
|
3056
|
+
function Mo(t = 5, e = 5e3) {
|
|
3057
|
+
const [r, n] = J([]), o = w(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3053
3058
|
const a = o.current.get(i);
|
|
3054
3059
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
3055
3060
|
}, []);
|
|
3056
|
-
return
|
|
3057
|
-
const i = o.current, a =
|
|
3061
|
+
return U(() => {
|
|
3062
|
+
const i = o.current, a = Kt(
|
|
3058
3063
|
(c) => {
|
|
3059
|
-
if (
|
|
3064
|
+
if (!Yt())
|
|
3060
3065
|
return;
|
|
3061
|
-
const f = `toast-${++
|
|
3066
|
+
const f = `toast-${++ho}`, l = c.level === Je.ERROR ? "error" : "warn", u = {
|
|
3062
3067
|
id: f,
|
|
3063
3068
|
level: l,
|
|
3064
3069
|
message: c.message,
|
|
@@ -3081,30 +3086,30 @@ function _o(t = 5, e = 5e3) {
|
|
|
3081
3086
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3082
3087
|
}
|
|
3083
3088
|
const It = pt(null);
|
|
3084
|
-
function
|
|
3089
|
+
function mo(t, e) {
|
|
3085
3090
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3086
3091
|
}
|
|
3087
|
-
function
|
|
3088
|
-
const r =
|
|
3092
|
+
function po(t, e) {
|
|
3093
|
+
const r = zt();
|
|
3089
3094
|
if (r && t.includes(r))
|
|
3090
3095
|
return r;
|
|
3091
3096
|
const n = navigator.language.split("-")[0];
|
|
3092
3097
|
return t.includes(n) ? n : e && t.includes(e) ? e : "en";
|
|
3093
3098
|
}
|
|
3094
|
-
function
|
|
3095
|
-
return e ?
|
|
3099
|
+
function go(t, e, r) {
|
|
3100
|
+
return e ? po(t, r) : r && t.includes(r) ? r : "en";
|
|
3096
3101
|
}
|
|
3097
|
-
function
|
|
3102
|
+
function jo({
|
|
3098
3103
|
children: t,
|
|
3099
3104
|
translations: e,
|
|
3100
3105
|
defaultLanguage: r,
|
|
3101
3106
|
detectLanguage: n = !1
|
|
3102
3107
|
}) {
|
|
3103
|
-
const o = Object.keys(e), s =
|
|
3108
|
+
const o = Object.keys(e), s = go(o, n, r), i = e[s] ?? e.en, a = V(
|
|
3104
3109
|
() => ({
|
|
3105
3110
|
t: (c, f) => {
|
|
3106
3111
|
const l = i[c];
|
|
3107
|
-
return
|
|
3112
|
+
return mo(l, f);
|
|
3108
3113
|
},
|
|
3109
3114
|
locale: s,
|
|
3110
3115
|
translations: i
|
|
@@ -3113,67 +3118,67 @@ function No({
|
|
|
3113
3118
|
);
|
|
3114
3119
|
return /* @__PURE__ */ E.jsx(It, { value: a, children: t });
|
|
3115
3120
|
}
|
|
3116
|
-
function
|
|
3121
|
+
function Uo() {
|
|
3117
3122
|
const t = Ve(It);
|
|
3118
3123
|
if (!t)
|
|
3119
3124
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3120
3125
|
return t;
|
|
3121
3126
|
}
|
|
3122
3127
|
export {
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3128
|
+
Io as AuthProvider,
|
|
3129
|
+
_o as ConnectionStateRenderer,
|
|
3130
|
+
jo as I18nProvider,
|
|
3131
|
+
pr as IKON_UI_BASE_MODULE,
|
|
3132
|
+
Cr as IKON_UI_MEDIA_MODULE,
|
|
3133
|
+
Vr as IKON_UI_SHADERTOY_MODULE,
|
|
3134
|
+
Br as IKON_UI_SHADERTOY_TYPE,
|
|
3130
3135
|
Le as IKON_UI_STREAM_CATEGORY,
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3136
|
+
Rr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3137
|
+
Er as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3138
|
+
ar as IkonUi,
|
|
3139
|
+
zr as IkonUiRegistry,
|
|
3140
|
+
Ro as IkonUiSurface,
|
|
3141
|
+
sr as UiComponentRegistry,
|
|
3142
|
+
or as UiRenderer,
|
|
3143
|
+
Do as UiStreamStore,
|
|
3144
|
+
Eo as areIkonUiModuleListsEqual,
|
|
3140
3145
|
Et as authenticateAnonymous,
|
|
3141
|
-
|
|
3146
|
+
Hn as buildOAuthRedirectUrl,
|
|
3142
3147
|
ve as clearAuthSession,
|
|
3143
3148
|
mt as clearOAuthParams,
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3149
|
+
mr as createBaseResolvers,
|
|
3150
|
+
wo as createComponentLibrary,
|
|
3151
|
+
Wr as createIkonUiRegistry,
|
|
3152
|
+
kr as createMediaResolvers,
|
|
3153
|
+
$r as createShadertoyRendererResolver,
|
|
3154
|
+
ir as isIkonUiCategoryMatch,
|
|
3150
3155
|
Rt as loadAuthSession,
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3156
|
+
gr as loadBaseModule,
|
|
3157
|
+
Ir as loadMediaModule,
|
|
3158
|
+
Kr as loadShadertoyModule,
|
|
3159
|
+
wn as normalizeIkonUiModuleList,
|
|
3160
|
+
ko as parseIkonUiInitPayload,
|
|
3161
|
+
qn as parseOAuthCallback,
|
|
3162
|
+
Gn as parseOAuthError,
|
|
3163
|
+
vn as readIkonUiModules,
|
|
3164
|
+
Ao as readIkonUiModulesFromSources,
|
|
3165
|
+
yr as registerBaseModule,
|
|
3166
|
+
Or as registerMediaModule,
|
|
3167
|
+
Yr as registerShadertoyModule,
|
|
3168
|
+
rr as renderChildren,
|
|
3169
|
+
To as renderMotionLetters,
|
|
3165
3170
|
ke as saveAuthSession,
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3171
|
+
Co as sendMagicLink,
|
|
3172
|
+
de as sessionToUser,
|
|
3173
|
+
co as useAuth,
|
|
3174
|
+
Oo as useAuthGuard,
|
|
3175
|
+
uo as useAuthOptional,
|
|
3176
|
+
Uo as useI18n,
|
|
3177
|
+
No as useIkonApp,
|
|
3178
|
+
en as useIkonStyles,
|
|
3179
|
+
rn as useIkonUiStores,
|
|
3180
|
+
Po as useLazyFont,
|
|
3181
|
+
Mo as useToasts,
|
|
3182
|
+
Z as useUiNode,
|
|
3183
|
+
vo as useUiStore
|
|
3179
3184
|
};
|