@ikonai/sdk-react-ui 1.0.27 → 1.0.28
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 +10 -0
- package/index.js +827 -815
- 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
|
|
5
|
-
var
|
|
1
|
+
import { IkonUiCore as It, UiStreamStore as Ot } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as Mo } from "@ikonai/sdk-ui";
|
|
3
|
+
import _t, { useSyncExternalStore as Fe, useMemo as K, memo as W, useRef as v, useCallback as D, Fragment as Nt, useEffect as L, useState as G, createContext as ht, use as Be } from "react";
|
|
4
|
+
import { createLogger as Re, getOrCreateDeviceId as Pt, deriveAuthUrl as Pe, parseUrlParams as Mt, clearSessionParamsFromUrl as jt, isCloudEnvironment as ze, extractUserIdFromToken as Lt, deriveBackendType as qe, IkonClient as Ut, AuthenticationError as xt, subscribeToLogEvents as Dt, isDebugModeEnabled as Ft, LogLevel as Ge, getLangParam as Bt } from "@ikonai/sdk";
|
|
5
|
+
var pe = { exports: {} }, ie = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,10 +12,10 @@ var le = { exports: {} }, re = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
var He;
|
|
16
|
+
function $t() {
|
|
17
|
+
if (He) return ie;
|
|
18
|
+
He = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
20
|
function r(n, o, s) {
|
|
21
21
|
var i = null;
|
|
@@ -32,9 +32,9 @@ function xt() {
|
|
|
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
|
|
@@ -44,26 +44,26 @@ var ne = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
47
|
+
var Je;
|
|
48
|
+
function Vt() {
|
|
49
|
+
return Je || (Je = 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
53
|
return d.$$typeof === F ? null : d.displayName || d.name || null;
|
|
54
54
|
if (typeof d == "string") return d;
|
|
55
55
|
switch (d) {
|
|
56
|
-
case
|
|
56
|
+
case b:
|
|
57
57
|
return "Fragment";
|
|
58
|
-
case
|
|
58
|
+
case g:
|
|
59
59
|
return "Profiler";
|
|
60
|
-
case
|
|
60
|
+
case p:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case M:
|
|
63
63
|
return "Suspense";
|
|
64
64
|
case z:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case _:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
69
|
if (typeof d == "object")
|
|
@@ -74,17 +74,17 @@ function Dt() {
|
|
|
74
74
|
return "Portal";
|
|
75
75
|
case k:
|
|
76
76
|
return (d.displayName || "Context") + ".Provider";
|
|
77
|
-
case
|
|
77
|
+
case w:
|
|
78
78
|
return (d._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return d = d.displayName, d || (d =
|
|
82
|
-
case
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
|
|
79
|
+
case O:
|
|
80
|
+
var S = d.render;
|
|
81
|
+
return d = d.displayName, d || (d = S.displayName || S.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
82
|
+
case Q:
|
|
83
|
+
return S = d.displayName || null, S !== null ? S : t(d.type) || "Memo";
|
|
84
|
+
case T:
|
|
85
|
+
S = d._payload, d = d._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(d(
|
|
87
|
+
return t(d(S));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -96,33 +96,33 @@ function Dt() {
|
|
|
96
96
|
function r(d) {
|
|
97
97
|
try {
|
|
98
98
|
e(d);
|
|
99
|
-
var
|
|
99
|
+
var S = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
S = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (S) {
|
|
104
|
+
S = console;
|
|
105
|
+
var R = S.error, C = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
|
|
106
|
+
return R.call(
|
|
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
|
+
C
|
|
110
110
|
), e(d);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function n(d) {
|
|
114
|
-
if (d ===
|
|
115
|
-
if (typeof d == "object" && d !== null && d.$$typeof ===
|
|
114
|
+
if (d === b) return "<>";
|
|
115
|
+
if (typeof d == "object" && d !== null && d.$$typeof === T)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var S = t(d);
|
|
119
|
+
return S ? "<" + S + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var d =
|
|
125
|
+
var d = j.A;
|
|
126
126
|
return d === null ? null : d.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function s() {
|
|
@@ -130,37 +130,37 @@ function Dt() {
|
|
|
130
130
|
}
|
|
131
131
|
function i(d) {
|
|
132
132
|
if (U.call(d, "key")) {
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
133
|
+
var S = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
134
|
+
if (S && S.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return d.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(d,
|
|
139
|
-
function
|
|
138
|
+
function a(d, S) {
|
|
139
|
+
function R() {
|
|
140
140
|
J || (J = !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
|
+
R.isReactWarning = !0, Object.defineProperty(d, "key", {
|
|
146
|
+
get: R,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
function c() {
|
|
151
151
|
var d = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return he[d] || (he[d] = !0, console.error(
|
|
153
153
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
154
154
|
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
155
155
|
}
|
|
156
|
-
function f(d,
|
|
157
|
-
return
|
|
158
|
-
$$typeof:
|
|
156
|
+
function f(d, S, R, C, V, B, ee, se) {
|
|
157
|
+
return R = B.ref, d = {
|
|
158
|
+
$$typeof: m,
|
|
159
159
|
type: d,
|
|
160
|
-
key:
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
160
|
+
key: S,
|
|
161
|
+
props: B,
|
|
162
|
+
_owner: V
|
|
163
|
+
}, (R !== void 0 ? R : 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,68 +177,68 @@ function Dt() {
|
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
180
|
+
value: ee
|
|
181
181
|
}), Object.defineProperty(d, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
|
-
value:
|
|
185
|
+
value: se
|
|
186
186
|
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
187
187
|
}
|
|
188
|
-
function u(d,
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
h(
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function u(d, S, R, C, V, B, ee, se) {
|
|
189
|
+
var N = S.children;
|
|
190
|
+
if (N !== void 0)
|
|
191
|
+
if (C)
|
|
192
|
+
if (Y(N)) {
|
|
193
|
+
for (C = 0; C < N.length; C++)
|
|
194
|
+
h(N[C]);
|
|
195
|
+
Object.freeze && Object.freeze(N);
|
|
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
|
-
else h(
|
|
201
|
-
if (U.call(
|
|
202
|
-
|
|
203
|
-
var
|
|
204
|
-
return
|
|
200
|
+
else h(N);
|
|
201
|
+
if (U.call(S, "key")) {
|
|
202
|
+
N = t(d);
|
|
203
|
+
var X = Object.keys(S).filter(function(x) {
|
|
204
|
+
return x !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
C = 0 < X.length ? "{key: someKey, " + X.join(": ..., ") + ": ...}" : "{key: someKey}", me[N + C] || (X = 0 < X.length ? "{" + X.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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
),
|
|
213
|
+
C,
|
|
214
|
+
N,
|
|
215
|
+
X,
|
|
216
|
+
N
|
|
217
|
+
), me[N + C] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
219
|
+
if (N = null, R !== void 0 && (r(R), N = "" + R), i(S) && (r(S.key), N = "" + S.key), "key" in S) {
|
|
220
|
+
R = {};
|
|
221
|
+
for (var I in S)
|
|
222
|
+
I !== "key" && (R[I] = S[I]);
|
|
223
|
+
} else R = S;
|
|
224
|
+
return N && a(
|
|
225
|
+
R,
|
|
226
226
|
typeof d == "function" ? d.displayName || d.name || "Unknown" : d
|
|
227
227
|
), f(
|
|
228
228
|
d,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
N,
|
|
230
|
+
B,
|
|
231
|
+
V,
|
|
232
232
|
o(),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
R,
|
|
234
|
+
ee,
|
|
235
|
+
se
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function h(d) {
|
|
239
|
-
typeof d == "object" && d !== null && d.$$typeof ===
|
|
239
|
+
typeof d == "object" && d !== null && d.$$typeof === m && d._store && (d._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var l =
|
|
241
|
+
var l = _t, m = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), k = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), z = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), j = l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, Y = Array.isArray, re = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
244
|
l = {
|
|
@@ -246,44 +246,44 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
return d();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var J,
|
|
249
|
+
var J, he = {}, ne = l["react-stack-bottom-frame"].bind(
|
|
250
250
|
l,
|
|
251
251
|
s
|
|
252
|
-
)(),
|
|
253
|
-
|
|
254
|
-
var
|
|
252
|
+
)(), oe = re(n(s)), me = {};
|
|
253
|
+
ae.Fragment = b, ae.jsx = function(d, S, R, C, V) {
|
|
254
|
+
var B = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return u(
|
|
256
256
|
d,
|
|
257
|
-
|
|
258
|
-
b,
|
|
259
|
-
!1,
|
|
257
|
+
S,
|
|
260
258
|
R,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
259
|
+
!1,
|
|
260
|
+
C,
|
|
261
|
+
V,
|
|
262
|
+
B ? Error("react-stack-top-frame") : ne,
|
|
263
|
+
B ? re(n(d)) : oe
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
265
|
+
}, ae.jsxs = function(d, S, R, C, V) {
|
|
266
|
+
var B = 1e4 > j.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return u(
|
|
268
268
|
d,
|
|
269
|
-
|
|
270
|
-
b,
|
|
271
|
-
!0,
|
|
269
|
+
S,
|
|
272
270
|
R,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
!0,
|
|
272
|
+
C,
|
|
273
|
+
V,
|
|
274
|
+
B ? Error("react-stack-top-frame") : ne,
|
|
275
|
+
B ? re(n(d)) : oe
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ae;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var Xe;
|
|
281
|
+
function Kt() {
|
|
282
|
+
return Xe || (Xe = 1, process.env.NODE_ENV === "production" ? pe.exports = $t() : pe.exports = Vt()), pe.exports;
|
|
283
283
|
}
|
|
284
|
-
var A =
|
|
285
|
-
function
|
|
286
|
-
const r =
|
|
284
|
+
var A = Kt();
|
|
285
|
+
function Yt(t, e) {
|
|
286
|
+
const r = Fe(
|
|
287
287
|
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
289
289
|
const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
|
|
@@ -294,7 +294,7 @@ function Bt(t, e) {
|
|
|
294
294
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
return
|
|
297
|
+
return K(() => {
|
|
298
298
|
const [n, o] = r.split(":");
|
|
299
299
|
return {
|
|
300
300
|
rootViewId: n || void 0,
|
|
@@ -302,16 +302,16 @@ function Bt(t, e) {
|
|
|
302
302
|
};
|
|
303
303
|
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const r =
|
|
305
|
+
function H(t, e) {
|
|
306
|
+
const r = Fe(
|
|
307
307
|
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
|
-
return
|
|
311
|
+
return K(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const
|
|
314
|
-
function
|
|
313
|
+
const Wt = Re("UIRenderer");
|
|
314
|
+
function zt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,18 +322,18 @@ function Vt(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function qt(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Gt(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Ht(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Jt(t) {
|
|
337
337
|
if (t.length === 0) return "";
|
|
338
338
|
if (t.length === 1) return t[0].id;
|
|
339
339
|
let e = t[0].id;
|
|
@@ -341,8 +341,8 @@ function zt(t) {
|
|
|
341
341
|
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
const n =
|
|
344
|
+
const Me = W(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = H(r.store, e), o = n ? Gt(n) : [], s = Jt(o), i = K(
|
|
346
346
|
() => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ A.jsx(t, { nodeId: h.id, context: r }, h.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
348
|
[s, r]
|
|
@@ -350,44 +350,44 @@ const _e = V(function t({ nodeId: e, context: r }) {
|
|
|
350
350
|
if (!n)
|
|
351
351
|
return null;
|
|
352
352
|
if (n.type === "root")
|
|
353
|
-
return /* @__PURE__ */ A.jsx(
|
|
353
|
+
return /* @__PURE__ */ A.jsx(Nt, { children: i }, n.id);
|
|
354
354
|
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
|
-
return
|
|
357
|
-
const c =
|
|
356
|
+
return Wt.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = qt(n), f = c.length > 0 ? c.join(" ") : void 0, u = a;
|
|
358
358
|
return /* @__PURE__ */ A.jsx(u, { nodeId: e, context: r, className: f });
|
|
359
|
-
},
|
|
360
|
-
function
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ A.jsx(
|
|
359
|
+
}, Ht);
|
|
360
|
+
function Xt(t, e) {
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ A.jsx(Me, { nodeId: r.id, context: e }, r.id));
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Zt(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 Qt = W(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Yt(e, n), u = v(s);
|
|
368
368
|
u.current = s;
|
|
369
|
-
const h =
|
|
369
|
+
const h = v(i);
|
|
370
370
|
h.current = i;
|
|
371
|
-
const l =
|
|
371
|
+
const l = v(a);
|
|
372
372
|
l.current = a;
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
373
|
+
const m = D((b, p) => {
|
|
374
|
+
if (!b)
|
|
375
375
|
return;
|
|
376
|
-
const
|
|
377
|
-
u.current?.(
|
|
378
|
-
}, []), y =
|
|
379
|
-
const
|
|
376
|
+
const g = zt(p);
|
|
377
|
+
u.current?.(b, g);
|
|
378
|
+
}, []), y = K(() => {
|
|
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
|
-
getPayload: (
|
|
385
|
-
renderChildren: (
|
|
386
|
-
renderView: (
|
|
387
|
-
const
|
|
388
|
-
return
|
|
384
|
+
getPayload: (p) => e.getSnapshot().payloads.get(p),
|
|
385
|
+
renderChildren: (p) => Xt(p, b),
|
|
386
|
+
renderView: (p) => {
|
|
387
|
+
const g = e.getSnapshot().views.get(p);
|
|
388
|
+
return g ? /* @__PURE__ */ A.jsx(Me, { nodeId: g.id, context: b }) : null;
|
|
389
389
|
},
|
|
390
|
-
dispatchAction:
|
|
390
|
+
dispatchAction: m,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
392
392
|
get client() {
|
|
393
393
|
return h.current;
|
|
@@ -396,11 +396,11 @@ const Ht = V(function({ store: e, library: r, viewId: n, emptyFallback: o = null
|
|
|
396
396
|
return l.current;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
|
-
return
|
|
400
|
-
}, [e, r,
|
|
401
|
-
return !c || !f ? o : /* @__PURE__ */ A.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ A.jsx(
|
|
402
|
-
},
|
|
403
|
-
class
|
|
399
|
+
return b;
|
|
400
|
+
}, [e, r, m]);
|
|
401
|
+
return !c || !f ? o : /* @__PURE__ */ A.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ A.jsx(Me, { nodeId: f, context: y }) });
|
|
402
|
+
}, Zt);
|
|
403
|
+
class er {
|
|
404
404
|
constructor(e, r) {
|
|
405
405
|
if (this.fallback = r, e)
|
|
406
406
|
for (const [n, o] of e)
|
|
@@ -417,41 +417,41 @@ class Jt {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function po(t, e) {
|
|
421
421
|
const r = Object.entries(t);
|
|
422
|
-
return new
|
|
422
|
+
return new er(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
return
|
|
424
|
+
function go(t) {
|
|
425
|
+
return Fe(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
432
|
-
function
|
|
431
|
+
const je = "ikon-ui";
|
|
432
|
+
function tr(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
const i =
|
|
435
|
+
const yo = W(function({ stores: e, registry: r, category: n = je, onAction: o, client: s }) {
|
|
436
|
+
const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
|
|
437
437
|
a.current = o;
|
|
438
|
-
const c =
|
|
438
|
+
const c = v(s);
|
|
439
439
|
c.current = s;
|
|
440
|
-
const f =
|
|
440
|
+
const f = K(
|
|
441
441
|
() => {
|
|
442
442
|
const u = [];
|
|
443
443
|
for (const [h, l] of e) {
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const m = l.store.getSnapshot();
|
|
445
|
+
tr(l.category, n) && (!m.rootViewId || !m.views.has(m.rootViewId) || u.push({ key: h, store: l.store }));
|
|
446
446
|
}
|
|
447
447
|
return u;
|
|
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__ */ A.jsx(A.Fragment, { children: f.map(({ key: u, store: h }) => /* @__PURE__ */ A.jsx(
|
|
452
|
+
return f.length === 0 ? null : /* @__PURE__ */ A.jsx(A.Fragment, { children: f.map(({ key: u, store: h }) => /* @__PURE__ */ A.jsx(Qt, { store: h, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, u)) });
|
|
453
453
|
});
|
|
454
|
-
class
|
|
454
|
+
class rr {
|
|
455
455
|
core;
|
|
456
456
|
ownsCore;
|
|
457
457
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -459,7 +459,7 @@ class Zt {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new It({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
463
463
|
}
|
|
464
464
|
dispose() {
|
|
465
465
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -509,8 +509,8 @@ class Zt {
|
|
|
509
509
|
if (r)
|
|
510
510
|
return r;
|
|
511
511
|
const n = {
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
512
|
+
category: je,
|
|
513
|
+
store: new Ot()
|
|
514
514
|
};
|
|
515
515
|
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
@@ -518,7 +518,7 @@ class Zt {
|
|
|
518
518
|
const n = this.stores.get(e);
|
|
519
519
|
if (!n)
|
|
520
520
|
return !1;
|
|
521
|
-
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
521
|
+
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? je;
|
|
522
522
|
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
@@ -526,13 +526,13 @@ class Zt {
|
|
|
526
526
|
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function nr(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;
|
|
@@ -542,7 +542,7 @@ function ce(t) {
|
|
|
542
542
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function $e(...t) {
|
|
546
546
|
let e = "";
|
|
547
547
|
for (const r of t)
|
|
548
548
|
if (r) {
|
|
@@ -551,42 +551,42 @@ function De(...t) {
|
|
|
551
551
|
}
|
|
552
552
|
return e || void 0;
|
|
553
553
|
}
|
|
554
|
-
const
|
|
555
|
-
function
|
|
554
|
+
const Ze = /* @__PURE__ */ new WeakMap(), or = {};
|
|
555
|
+
function Ve(t) {
|
|
556
556
|
if (!t)
|
|
557
|
-
return
|
|
558
|
-
const e =
|
|
557
|
+
return or;
|
|
558
|
+
const e = Ze.get(t);
|
|
559
559
|
if (e)
|
|
560
560
|
return e;
|
|
561
561
|
const r = {};
|
|
562
562
|
for (const [n, o] of Object.entries(t))
|
|
563
563
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
564
|
-
return
|
|
564
|
+
return Ze.set(t, r), r;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
const t =
|
|
568
|
-
const o =
|
|
566
|
+
function sr() {
|
|
567
|
+
const t = W(function({ nodeId: r, context: n }) {
|
|
568
|
+
const o = H(n.store, r), s = v(null), i = fe(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = fe(o?.props?.key), u = o?.props?.preciseGeneratedAt;
|
|
569
569
|
return L(() => {
|
|
570
570
|
if (typeof document > "u")
|
|
571
571
|
return;
|
|
572
572
|
const l = s.current;
|
|
573
573
|
if (!l || i && l.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
|
|
574
574
|
return;
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
let k =
|
|
575
|
+
const m = c !== !0;
|
|
576
|
+
if (m) {
|
|
577
|
+
const g = ((w) => {
|
|
578
|
+
let k = w.parentElement;
|
|
579
579
|
for (; k; ) {
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
580
|
+
const M = window.getComputedStyle(k).overflowY;
|
|
581
|
+
if (M === "auto" || M === "scroll" || k.hasAttribute("data-radix-scroll-area-viewport"))
|
|
582
582
|
return k;
|
|
583
583
|
k = k.parentElement;
|
|
584
584
|
}
|
|
585
585
|
return null;
|
|
586
586
|
})(l);
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
"scrollBehavior" in document.documentElement.style ?
|
|
587
|
+
g ? requestAnimationFrame(() => {
|
|
588
|
+
const w = g.getBoundingClientRect(), k = l.getBoundingClientRect(), O = g.scrollTop + (k.bottom - w.bottom) + 16;
|
|
589
|
+
"scrollBehavior" in document.documentElement.style ? g.scrollTo({ top: O, behavior: "smooth" }) : g.scrollTop = O;
|
|
590
590
|
}) : typeof l.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
591
591
|
try {
|
|
592
592
|
l.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
|
|
@@ -598,7 +598,7 @@ function tr() {
|
|
|
598
598
|
const y = document.activeElement;
|
|
599
599
|
if (!(y instanceof HTMLInputElement || y instanceof HTMLTextAreaElement || y?.getAttribute("contenteditable") === "true") && typeof l.focus == "function")
|
|
600
600
|
try {
|
|
601
|
-
l.focus({ preventScroll: !
|
|
601
|
+
l.focus({ preventScroll: !m });
|
|
602
602
|
} catch {
|
|
603
603
|
l.focus();
|
|
604
604
|
}
|
|
@@ -619,16 +619,16 @@ function tr() {
|
|
|
619
619
|
return t;
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
const t =
|
|
624
|
-
const s =
|
|
622
|
+
function ir() {
|
|
623
|
+
const t = W(function({ nodeId: r, context: n, className: o }) {
|
|
624
|
+
const s = H(n.store, r), i = nr(s?.props?.onInvokeId), a = D(() => {
|
|
625
625
|
i && n.dispatchAction(i);
|
|
626
626
|
}, [i, n]);
|
|
627
627
|
if (!s)
|
|
628
628
|
return null;
|
|
629
|
-
const c =
|
|
629
|
+
const c = Ve(s.props);
|
|
630
630
|
delete c.onInvokeId;
|
|
631
|
-
const f =
|
|
631
|
+
const f = $e(fe(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
632
632
|
return /* @__PURE__ */ A.jsx(
|
|
633
633
|
"div",
|
|
634
634
|
{
|
|
@@ -646,12 +646,12 @@ function rr() {
|
|
|
646
646
|
return t;
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
const t =
|
|
651
|
-
const s =
|
|
649
|
+
function ar() {
|
|
650
|
+
const t = W(function({ nodeId: r, context: n, className: o }) {
|
|
651
|
+
const s = H(n.store, r);
|
|
652
652
|
if (!s)
|
|
653
653
|
return null;
|
|
654
|
-
const i =
|
|
654
|
+
const i = Ve(s.props), a = $e("relative", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
655
655
|
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
656
656
|
});
|
|
657
657
|
return ({ type: e }) => {
|
|
@@ -659,12 +659,12 @@ function nr() {
|
|
|
659
659
|
return t;
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
const t =
|
|
664
|
-
const s =
|
|
662
|
+
function cr() {
|
|
663
|
+
const t = W(function({ nodeId: r, context: n, className: o }) {
|
|
664
|
+
const s = H(n.store, r);
|
|
665
665
|
if (!s)
|
|
666
666
|
return null;
|
|
667
|
-
const i =
|
|
667
|
+
const i = Ve(s.props), a = $e("absolute", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
668
668
|
return /* @__PURE__ */ A.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
669
669
|
});
|
|
670
670
|
return ({ type: e }) => {
|
|
@@ -672,19 +672,19 @@ function or() {
|
|
|
672
672
|
return t;
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ur() {
|
|
676
676
|
return [
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
677
|
+
ir(),
|
|
678
|
+
ar(),
|
|
679
|
+
cr(),
|
|
680
|
+
sr()
|
|
681
681
|
];
|
|
682
682
|
}
|
|
683
|
-
const
|
|
684
|
-
function
|
|
685
|
-
t.registerModule(
|
|
683
|
+
const lr = "base", dr = async () => ur();
|
|
684
|
+
function fr(t) {
|
|
685
|
+
t.registerModule(lr, dr);
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function hr(t) {
|
|
688
688
|
if (typeof t == "string") {
|
|
689
689
|
const e = t.trim();
|
|
690
690
|
return e.length > 0 ? e : void 0;
|
|
@@ -694,19 +694,19 @@ function ur(t) {
|
|
|
694
694
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function mr(...t) {
|
|
698
698
|
const e = [];
|
|
699
699
|
for (const r of t)
|
|
700
700
|
r && r.trim() && e.push(r.trim());
|
|
701
701
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function Qe(t) {
|
|
704
704
|
if (typeof t != "string")
|
|
705
705
|
return;
|
|
706
706
|
const e = t.trim();
|
|
707
707
|
return e.length > 0 ? e : void 0;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function ge(t) {
|
|
710
710
|
if (typeof t == "boolean")
|
|
711
711
|
return t;
|
|
712
712
|
if (typeof t == "string") {
|
|
@@ -715,17 +715,17 @@ function de(t) {
|
|
|
715
715
|
if (e === "false") return !1;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
const
|
|
719
|
-
function
|
|
720
|
-
const t =
|
|
718
|
+
const pr = "std.audio-url-player";
|
|
719
|
+
function gr() {
|
|
720
|
+
const t = W(function({
|
|
721
721
|
nodeId: r,
|
|
722
722
|
context: n,
|
|
723
723
|
className: o
|
|
724
724
|
}) {
|
|
725
|
-
const s =
|
|
725
|
+
const s = H(n.store, r);
|
|
726
726
|
if (!s)
|
|
727
727
|
return null;
|
|
728
|
-
const i =
|
|
728
|
+
const i = mr(hr(s.props?.className), o), a = Qe(s.props?.src), c = Qe(s.props?.preload), f = ge(s.props?.controls), u = ge(s.props?.autoplay), h = ge(s.props?.loop), l = ge(s.props?.muted);
|
|
729
729
|
return /* @__PURE__ */ A.jsx(
|
|
730
730
|
"audio",
|
|
731
731
|
{
|
|
@@ -741,11 +741,11 @@ function fr() {
|
|
|
741
741
|
);
|
|
742
742
|
});
|
|
743
743
|
return ({ type: e }) => {
|
|
744
|
-
if (e ===
|
|
744
|
+
if (e === pr)
|
|
745
745
|
return t;
|
|
746
746
|
};
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function mt(t) {
|
|
749
749
|
if (typeof t == "string") {
|
|
750
750
|
const e = t.trim();
|
|
751
751
|
return e.length > 0 ? e : void 0;
|
|
@@ -755,13 +755,13 @@ function dt(t) {
|
|
|
755
755
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function pt(...t) {
|
|
759
759
|
const e = [];
|
|
760
760
|
for (const r of t)
|
|
761
761
|
r && r.trim() && e.push(r.trim());
|
|
762
762
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function Se(t) {
|
|
765
765
|
if (typeof t == "number" && Number.isFinite(t))
|
|
766
766
|
return Math.floor(t);
|
|
767
767
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -770,27 +770,27 @@ function fe(t) {
|
|
|
770
770
|
return Math.floor(e);
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Le(t) {
|
|
774
774
|
if (typeof t != "string")
|
|
775
775
|
return;
|
|
776
776
|
const e = t.trim();
|
|
777
777
|
return e.length > 0 ? e : void 0;
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
function
|
|
781
|
-
const t =
|
|
782
|
-
const s =
|
|
779
|
+
const yr = "std.video-canvas", Sr = "std.video-url-player";
|
|
780
|
+
function br() {
|
|
781
|
+
const t = W(function({ nodeId: r, context: n, className: o }) {
|
|
782
|
+
const s = H(n.store, r), i = v(null), a = v(null), c = n.video, f = n.client, u = s ? Le(s.props?.streamId) : void 0, h = s ? Se(s.props?.width) : void 0, l = s ? Se(s.props?.height) : void 0, m = s ? pt(mt(s.props?.className), o) : o, y = f?.isWebRtcEnabled && u ? f.getWebRtcVideoStreamByStreamId(u) : null;
|
|
783
783
|
return L(() => {
|
|
784
|
-
const
|
|
785
|
-
if (!(!c || !
|
|
786
|
-
return c.attachCanvas(u,
|
|
784
|
+
const b = i.current;
|
|
785
|
+
if (!(!c || !b || !u || y))
|
|
786
|
+
return c.attachCanvas(u, b), () => {
|
|
787
787
|
c.detachCanvas(u);
|
|
788
788
|
};
|
|
789
789
|
}, [c, u, y]), L(() => {
|
|
790
|
-
const
|
|
791
|
-
if (!(!
|
|
792
|
-
return
|
|
793
|
-
|
|
790
|
+
const b = a.current;
|
|
791
|
+
if (!(!b || !y))
|
|
792
|
+
return b.srcObject = y, () => {
|
|
793
|
+
b.srcObject = null;
|
|
794
794
|
};
|
|
795
795
|
}, [y]), s ? y ? /* @__PURE__ */ A.jsx(
|
|
796
796
|
"video",
|
|
@@ -801,7 +801,7 @@ function pr() {
|
|
|
801
801
|
muted: !0,
|
|
802
802
|
"data-ikon-node-id": s.id,
|
|
803
803
|
"data-ikon-video-stream-id": u,
|
|
804
|
-
className:
|
|
804
|
+
className: m,
|
|
805
805
|
...h ? { width: h } : {},
|
|
806
806
|
...l ? { height: l } : {}
|
|
807
807
|
},
|
|
@@ -812,7 +812,7 @@ function pr() {
|
|
|
812
812
|
ref: i,
|
|
813
813
|
"data-ikon-node-id": s.id,
|
|
814
814
|
"data-ikon-video-stream-id": u,
|
|
815
|
-
className:
|
|
815
|
+
className: m,
|
|
816
816
|
...h ? { width: h } : {},
|
|
817
817
|
...l ? { height: l } : {}
|
|
818
818
|
},
|
|
@@ -820,14 +820,14 @@ function pr() {
|
|
|
820
820
|
) : null;
|
|
821
821
|
});
|
|
822
822
|
return ({ type: e }) => {
|
|
823
|
-
if (e ===
|
|
823
|
+
if (e === yr)
|
|
824
824
|
return t;
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
|
-
function
|
|
828
|
-
return [
|
|
827
|
+
function wr() {
|
|
828
|
+
return [br(), vr(), gr()];
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function ce(t) {
|
|
831
831
|
if (typeof t == "boolean")
|
|
832
832
|
return t;
|
|
833
833
|
if (typeof t == "string") {
|
|
@@ -836,16 +836,16 @@ function oe(t) {
|
|
|
836
836
|
if (e === "false") return !1;
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
function
|
|
840
|
-
const t =
|
|
839
|
+
function vr() {
|
|
840
|
+
const t = W(function({
|
|
841
841
|
nodeId: r,
|
|
842
842
|
context: n,
|
|
843
843
|
className: o
|
|
844
844
|
}) {
|
|
845
|
-
const s =
|
|
845
|
+
const s = H(n.store, r);
|
|
846
846
|
if (!s)
|
|
847
847
|
return null;
|
|
848
|
-
const i =
|
|
848
|
+
const i = pt(mt(s.props?.className), o), a = Le(s.props?.src), c = Le(s.props?.poster), f = ce(s.props?.controls), u = ce(s.props?.autoplay), h = ce(s.props?.loop), l = ce(s.props?.muted), m = ce(s.props?.playsInline), y = Se(s.props?.width), b = Se(s.props?.height), p = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
849
849
|
return /* @__PURE__ */ A.jsx(
|
|
850
850
|
"video",
|
|
851
851
|
{
|
|
@@ -855,37 +855,37 @@ function yr() {
|
|
|
855
855
|
...u !== void 0 ? { autoPlay: u } : {},
|
|
856
856
|
...h !== void 0 ? { loop: h } : {},
|
|
857
857
|
...l !== void 0 ? { muted: l } : {},
|
|
858
|
-
...
|
|
858
|
+
...m !== void 0 ? { playsInline: m } : {},
|
|
859
859
|
...y ? { width: y } : {},
|
|
860
|
-
...
|
|
860
|
+
...b ? { height: b } : {},
|
|
861
861
|
"data-ikon-node-id": s.id,
|
|
862
862
|
className: i,
|
|
863
|
-
children:
|
|
863
|
+
children: p
|
|
864
864
|
}
|
|
865
865
|
);
|
|
866
866
|
});
|
|
867
867
|
return ({ type: e }) => {
|
|
868
|
-
if (e ===
|
|
868
|
+
if (e === Sr)
|
|
869
869
|
return t;
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
|
-
const
|
|
873
|
-
function
|
|
874
|
-
t.registerModule(
|
|
872
|
+
const Rr = "media", Er = async () => wr();
|
|
873
|
+
function Ar(t) {
|
|
874
|
+
t.registerModule(Rr, Er);
|
|
875
875
|
}
|
|
876
|
-
const
|
|
876
|
+
const kr = `#version 300 es
|
|
877
877
|
in vec4 a_position;
|
|
878
878
|
void main() {
|
|
879
879
|
gl_Position = a_position;
|
|
880
880
|
}
|
|
881
881
|
`;
|
|
882
|
-
function
|
|
882
|
+
function Tr(t, e) {
|
|
883
883
|
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function Cr(t, e) {
|
|
886
886
|
const r = [];
|
|
887
887
|
for (const [n, o] of Object.entries(e)) {
|
|
888
|
-
if (
|
|
888
|
+
if (Tr(t, n))
|
|
889
889
|
continue;
|
|
890
890
|
let s;
|
|
891
891
|
switch (o.type) {
|
|
@@ -938,7 +938,7 @@ void main() {
|
|
|
938
938
|
}
|
|
939
939
|
`;
|
|
940
940
|
}
|
|
941
|
-
class
|
|
941
|
+
class Ir {
|
|
942
942
|
gl;
|
|
943
943
|
program = null;
|
|
944
944
|
positionBuffer = null;
|
|
@@ -974,10 +974,10 @@ class Ar {
|
|
|
974
974
|
}
|
|
975
975
|
compile(e, r = {}) {
|
|
976
976
|
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
977
|
-
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER,
|
|
977
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, kr);
|
|
978
978
|
if (!o)
|
|
979
979
|
return !1;
|
|
980
|
-
const s =
|
|
980
|
+
const s = Cr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
981
981
|
if (!i)
|
|
982
982
|
return n.deleteShader(o), !1;
|
|
983
983
|
const a = n.createProgram();
|
|
@@ -1023,38 +1023,38 @@ class Ar {
|
|
|
1023
1023
|
h && e.uniform1i(h, this.frameCount);
|
|
1024
1024
|
const l = this.uniformLocations.get("iMouse");
|
|
1025
1025
|
l && e.uniform4f(l, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1026
|
-
const
|
|
1027
|
-
if (
|
|
1026
|
+
const m = this.uniformLocations.get("iDate");
|
|
1027
|
+
if (m) {
|
|
1028
1028
|
const y = /* @__PURE__ */ new Date();
|
|
1029
|
-
e.uniform4f(
|
|
1029
|
+
e.uniform4f(m, y.getFullYear(), y.getMonth(), y.getDate(), y.getHours() * 3600 + y.getMinutes() * 60 + y.getSeconds() + y.getMilliseconds() / 1e3);
|
|
1030
1030
|
}
|
|
1031
|
-
for (const [y,
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
switch (
|
|
1031
|
+
for (const [y, b] of Object.entries(this.customUniforms)) {
|
|
1032
|
+
const p = this.uniformLocations.get(y);
|
|
1033
|
+
if (p)
|
|
1034
|
+
switch (b.type) {
|
|
1035
1035
|
case "float":
|
|
1036
|
-
e.uniform1f(
|
|
1036
|
+
e.uniform1f(p, b.value);
|
|
1037
1037
|
break;
|
|
1038
1038
|
case "vec2": {
|
|
1039
|
-
const
|
|
1040
|
-
e.uniform2f(
|
|
1039
|
+
const g = b.value;
|
|
1040
|
+
e.uniform2f(p, g[0], g[1]);
|
|
1041
1041
|
break;
|
|
1042
1042
|
}
|
|
1043
1043
|
case "vec3": {
|
|
1044
|
-
const
|
|
1045
|
-
e.uniform3f(
|
|
1044
|
+
const g = b.value;
|
|
1045
|
+
e.uniform3f(p, g[0], g[1], g[2]);
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
1048
|
case "vec4": {
|
|
1049
|
-
const
|
|
1050
|
-
e.uniform4f(
|
|
1049
|
+
const g = b.value;
|
|
1050
|
+
e.uniform4f(p, g[0], g[1], g[2], g[3]);
|
|
1051
1051
|
break;
|
|
1052
1052
|
}
|
|
1053
1053
|
case "int":
|
|
1054
|
-
e.uniform1i(
|
|
1054
|
+
e.uniform1i(p, b.value);
|
|
1055
1055
|
break;
|
|
1056
1056
|
case "bool":
|
|
1057
|
-
e.uniform1i(
|
|
1057
|
+
e.uniform1i(p, b.value ? 1 : 0);
|
|
1058
1058
|
break;
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
@@ -1068,7 +1068,7 @@ class Ar {
|
|
|
1068
1068
|
this.program && (e.deleteProgram(this.program), this.program = null), this.positionBuffer && (e.deleteBuffer(this.positionBuffer), this.positionBuffer = null), this.vao && (e.deleteVertexArray(this.vao), this.vao = null), this.uniformLocations.clear();
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function Or(t) {
|
|
1072
1072
|
if (typeof t == "string") {
|
|
1073
1073
|
const e = t.trim();
|
|
1074
1074
|
return e.length > 0 ? e : void 0;
|
|
@@ -1078,13 +1078,13 @@ function Tr(t) {
|
|
|
1078
1078
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function _r(...t) {
|
|
1082
1082
|
const e = [];
|
|
1083
1083
|
for (const r of t)
|
|
1084
1084
|
r && r.trim() && e.push(r.trim());
|
|
1085
1085
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function ke(t) {
|
|
1088
1088
|
if (typeof t == "number" && Number.isFinite(t))
|
|
1089
1089
|
return Math.floor(t);
|
|
1090
1090
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -1093,10 +1093,10 @@ function ve(t) {
|
|
|
1093
1093
|
return Math.floor(e);
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function Nr(t) {
|
|
1097
1097
|
return typeof t == "string" ? t : "";
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Pr(t) {
|
|
1100
1100
|
if (typeof t == "boolean")
|
|
1101
1101
|
return t;
|
|
1102
1102
|
if (typeof t == "string") {
|
|
@@ -1105,7 +1105,7 @@ function Ir(t) {
|
|
|
1105
1105
|
if (e === "false") return !1;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function Mr(t) {
|
|
1109
1109
|
if (!t || typeof t != "object")
|
|
1110
1110
|
return {};
|
|
1111
1111
|
const e = {}, r = t;
|
|
@@ -1120,7 +1120,7 @@ function Or(t) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
return e;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function jr(t, e) {
|
|
1124
1124
|
const r = Object.keys(t), n = Object.keys(e);
|
|
1125
1125
|
if (r.length !== n.length)
|
|
1126
1126
|
return !1;
|
|
@@ -1141,99 +1141,99 @@ function _r(t, e) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
return !0;
|
|
1143
1143
|
}
|
|
1144
|
-
const
|
|
1145
|
-
function
|
|
1146
|
-
const t =
|
|
1147
|
-
const s =
|
|
1144
|
+
const Lr = "std.shadertoy-canvas";
|
|
1145
|
+
function Ur() {
|
|
1146
|
+
const t = W(function({ nodeId: r, context: n, className: o }) {
|
|
1147
|
+
const s = H(n.store, r), i = v(null), a = v(null), c = v(null), f = v(0), u = v(""), h = v({}), l = v({
|
|
1148
1148
|
x: 0,
|
|
1149
1149
|
y: 0,
|
|
1150
1150
|
clickX: 0,
|
|
1151
1151
|
clickY: 0,
|
|
1152
1152
|
isDown: !1
|
|
1153
|
-
}),
|
|
1153
|
+
}), m = s ? Nr(s.props?.shaderSource) : "", y = s ? ke(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, p = K(() => Mr(b), [b]), g = s ? Pr(s.props?.enableMouse) ?? !0 : !0, w = s ? ke(s.props?.width) : void 0, k = s ? ke(s.props?.height) : void 0, O = s ? _r(Or(s.props?.className), o) : o;
|
|
1154
1154
|
L(() => {
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1155
|
+
const T = i.current;
|
|
1156
|
+
if (T) {
|
|
1157
1157
|
try {
|
|
1158
|
-
const
|
|
1159
|
-
a.current =
|
|
1160
|
-
} catch (
|
|
1161
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1158
|
+
const _ = new Ir(T);
|
|
1159
|
+
a.current = _;
|
|
1160
|
+
} catch (_) {
|
|
1161
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", _);
|
|
1162
1162
|
}
|
|
1163
1163
|
return () => {
|
|
1164
1164
|
a.current && (a.current.destroy(), a.current = null);
|
|
1165
1165
|
};
|
|
1166
1166
|
}
|
|
1167
1167
|
}, []), L(() => {
|
|
1168
|
-
const
|
|
1169
|
-
if (!(!
|
|
1170
|
-
if (
|
|
1171
|
-
u.current =
|
|
1168
|
+
const T = a.current;
|
|
1169
|
+
if (!(!T || !m) && u.current !== m)
|
|
1170
|
+
if (T.compile(m, p))
|
|
1171
|
+
u.current = m, h.current = p;
|
|
1172
1172
|
else {
|
|
1173
|
-
const F =
|
|
1173
|
+
const F = T.getError();
|
|
1174
1174
|
console.error("[ShadertoyRenderer] Shader compilation failed:", F);
|
|
1175
1175
|
}
|
|
1176
|
-
}, [
|
|
1177
|
-
const
|
|
1178
|
-
!
|
|
1179
|
-
}, [
|
|
1180
|
-
const
|
|
1181
|
-
if (!
|
|
1182
|
-
const
|
|
1183
|
-
const U =
|
|
1184
|
-
U >=
|
|
1176
|
+
}, [m, p]), L(() => {
|
|
1177
|
+
const T = a.current;
|
|
1178
|
+
!T || !u.current || jr(h.current, p) || (T.setCustomUniforms(p), h.current = p);
|
|
1179
|
+
}, [p]), L(() => {
|
|
1180
|
+
const T = a.current;
|
|
1181
|
+
if (!T || !u.current) return;
|
|
1182
|
+
const _ = 1e3 / y, F = (j) => {
|
|
1183
|
+
const U = j - f.current;
|
|
1184
|
+
U >= _ && (f.current = j - U % _, T.draw()), c.current = requestAnimationFrame(F);
|
|
1185
1185
|
};
|
|
1186
1186
|
return c.current = requestAnimationFrame(F), () => {
|
|
1187
1187
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1188
1188
|
};
|
|
1189
1189
|
}, [y]);
|
|
1190
|
-
const
|
|
1191
|
-
(
|
|
1192
|
-
if (!
|
|
1193
|
-
const
|
|
1194
|
-
if (!
|
|
1195
|
-
const
|
|
1196
|
-
l.current.x = U, l.current.y =
|
|
1190
|
+
const M = D(
|
|
1191
|
+
(T) => {
|
|
1192
|
+
if (!g) return;
|
|
1193
|
+
const _ = i.current, F = a.current;
|
|
1194
|
+
if (!_ || !F) return;
|
|
1195
|
+
const j = _.getBoundingClientRect(), U = T.clientX - j.left, Y = j.height - (T.clientY - j.top);
|
|
1196
|
+
l.current.x = U, l.current.y = Y, F.setMouse(U, Y, l.current.clickX, l.current.clickY);
|
|
1197
1197
|
},
|
|
1198
|
-
[
|
|
1199
|
-
), z =
|
|
1200
|
-
(
|
|
1201
|
-
if (!
|
|
1202
|
-
const
|
|
1203
|
-
if (!
|
|
1204
|
-
const
|
|
1205
|
-
l.current.isDown = !0, l.current.clickX = U, l.current.clickY =
|
|
1198
|
+
[g]
|
|
1199
|
+
), z = D(
|
|
1200
|
+
(T) => {
|
|
1201
|
+
if (!g) return;
|
|
1202
|
+
const _ = i.current, F = a.current;
|
|
1203
|
+
if (!_ || !F) return;
|
|
1204
|
+
const j = _.getBoundingClientRect(), U = T.clientX - j.left, Y = j.height - (T.clientY - j.top);
|
|
1205
|
+
l.current.isDown = !0, l.current.clickX = U, l.current.clickY = Y, F.setMouse(U, Y, U, Y);
|
|
1206
1206
|
},
|
|
1207
|
-
[
|
|
1208
|
-
),
|
|
1209
|
-
|
|
1210
|
-
}, [
|
|
1207
|
+
[g]
|
|
1208
|
+
), Q = D(() => {
|
|
1209
|
+
g && (l.current.isDown = !1, l.current.clickX = -Math.abs(l.current.clickX));
|
|
1210
|
+
}, [g]);
|
|
1211
1211
|
return s ? /* @__PURE__ */ A.jsx(
|
|
1212
1212
|
"canvas",
|
|
1213
1213
|
{
|
|
1214
1214
|
ref: i,
|
|
1215
1215
|
"data-ikon-node-id": s.id,
|
|
1216
|
-
className:
|
|
1217
|
-
...
|
|
1216
|
+
className: O,
|
|
1217
|
+
...w ? { width: w } : {},
|
|
1218
1218
|
...k ? { height: k } : {},
|
|
1219
|
-
onMouseMove:
|
|
1219
|
+
onMouseMove: M,
|
|
1220
1220
|
onMouseDown: z,
|
|
1221
|
-
onMouseUp:
|
|
1222
|
-
onMouseLeave:
|
|
1221
|
+
onMouseUp: Q,
|
|
1222
|
+
onMouseLeave: Q
|
|
1223
1223
|
}
|
|
1224
1224
|
) : null;
|
|
1225
1225
|
});
|
|
1226
1226
|
return ({ type: e }) => {
|
|
1227
|
-
if (e ===
|
|
1227
|
+
if (e === Lr)
|
|
1228
1228
|
return t;
|
|
1229
1229
|
};
|
|
1230
1230
|
}
|
|
1231
|
-
const
|
|
1232
|
-
function
|
|
1233
|
-
t.registerModule(
|
|
1231
|
+
const xr = "shadertoy", Dr = async () => Ur();
|
|
1232
|
+
function Fr(t) {
|
|
1233
|
+
t.registerModule(xr, Dr);
|
|
1234
1234
|
}
|
|
1235
|
-
const
|
|
1236
|
-
class
|
|
1235
|
+
const et = Re("UIRegistry");
|
|
1236
|
+
class Br {
|
|
1237
1237
|
baseResolvers = [];
|
|
1238
1238
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1239
1239
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1255,15 +1255,15 @@ class Ur {
|
|
|
1255
1255
|
for (const [n, o] of this.moduleLoaders.entries())
|
|
1256
1256
|
if (!this.moduleResolvers.has(n))
|
|
1257
1257
|
try {
|
|
1258
|
-
const s = await o(), i =
|
|
1258
|
+
const s = await o(), i = Kr(s);
|
|
1259
1259
|
this.moduleResolvers.set(n, i), e = !0;
|
|
1260
1260
|
} catch (s) {
|
|
1261
|
-
|
|
1261
|
+
et.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
1262
1262
|
}
|
|
1263
1263
|
const r = [];
|
|
1264
1264
|
for (const n of this.moduleLoaders.keys())
|
|
1265
1265
|
this.moduleResolvers.has(n) && r.push(n);
|
|
1266
|
-
return
|
|
1266
|
+
return Yr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
1267
1267
|
}
|
|
1268
1268
|
resolve(e) {
|
|
1269
1269
|
for (const r of this.baseResolvers) {
|
|
@@ -1273,7 +1273,7 @@ class Ur {
|
|
|
1273
1273
|
for (const r of this.activeModuleOrder) {
|
|
1274
1274
|
const n = this.moduleResolvers.get(r);
|
|
1275
1275
|
if (!n) {
|
|
1276
|
-
|
|
1276
|
+
et.warn(`Missing resolvers for module ${r}`);
|
|
1277
1277
|
continue;
|
|
1278
1278
|
}
|
|
1279
1279
|
for (const o of n) {
|
|
@@ -1283,17 +1283,17 @@ class Ur {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1287
|
-
const t = new
|
|
1288
|
-
return
|
|
1286
|
+
function $r() {
|
|
1287
|
+
const t = new Br();
|
|
1288
|
+
return fr(t), Ar(t), Fr(t), t.loadRegisteredModules(), t;
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1290
|
+
function Vr(t) {
|
|
1291
1291
|
return Array.isArray(t) ? t : [t];
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return t ?
|
|
1293
|
+
function Kr(t) {
|
|
1294
|
+
return t ? Vr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function Yr(t, e) {
|
|
1297
1297
|
if (t.length !== e.length)
|
|
1298
1298
|
return !1;
|
|
1299
1299
|
for (let r = 0; r < t.length; r += 1)
|
|
@@ -1301,7 +1301,7 @@ function Br(t, e) {
|
|
|
1301
1301
|
return !1;
|
|
1302
1302
|
return !0;
|
|
1303
1303
|
}
|
|
1304
|
-
const
|
|
1304
|
+
const Te = Re("MotionController"), tt = {
|
|
1305
1305
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1306
1306
|
"ease-in": [0.42, 0, 1, 1],
|
|
1307
1307
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1331,88 +1331,88 @@ const Re = pe("MotionController"), Ze = {
|
|
|
1331
1331
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
1332
1332
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
1333
1333
|
};
|
|
1334
|
-
function
|
|
1334
|
+
function $(t) {
|
|
1335
1335
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function rt(t) {
|
|
1338
1338
|
if (t == null) return;
|
|
1339
1339
|
const e = `${t}`.trim();
|
|
1340
1340
|
if (!e) return;
|
|
1341
1341
|
const r = Number.parseFloat(e);
|
|
1342
1342
|
return Number.isFinite(r) ? r : void 0;
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function nt(t) {
|
|
1345
1345
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function ot(t, e, r, n) {
|
|
1348
1348
|
const u = new Float32Array(11);
|
|
1349
|
-
function h(
|
|
1350
|
-
return ((3 *
|
|
1349
|
+
function h(p, g, w) {
|
|
1350
|
+
return ((3 * g - 3 * w + 1) * p + (3 * w - 6 * g)) * p * p + 3 * g * p;
|
|
1351
1351
|
}
|
|
1352
|
-
function l(
|
|
1353
|
-
return 3 * (3 *
|
|
1352
|
+
function l(p, g, w) {
|
|
1353
|
+
return 3 * (3 * g - 3 * w + 1) * p * p + 2 * (3 * w - 6 * g) * p + 3 * g;
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1356
|
-
for (let
|
|
1357
|
-
const k = l(
|
|
1355
|
+
function m(p, g) {
|
|
1356
|
+
for (let w = 0; w < 4; w += 1) {
|
|
1357
|
+
const k = l(g, t, r);
|
|
1358
1358
|
if (k === 0)
|
|
1359
|
-
return
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1359
|
+
return g;
|
|
1360
|
+
const O = h(g, t, r) - p;
|
|
1361
|
+
g -= O / k;
|
|
1362
1362
|
}
|
|
1363
|
-
return
|
|
1363
|
+
return g;
|
|
1364
1364
|
}
|
|
1365
|
-
function y(
|
|
1366
|
-
let k = 0,
|
|
1365
|
+
function y(p, g, w) {
|
|
1366
|
+
let k = 0, O = 0, M = 0;
|
|
1367
1367
|
do
|
|
1368
|
-
|
|
1369
|
-
while (Math.abs(k) > 1e-7 && ++
|
|
1370
|
-
return
|
|
1368
|
+
O = g + (w - g) / 2, k = h(O, t, r) - p, k > 0 ? w = O : g = O;
|
|
1369
|
+
while (Math.abs(k) > 1e-7 && ++M < 10);
|
|
1370
|
+
return O;
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1373
|
-
let
|
|
1372
|
+
function b(p) {
|
|
1373
|
+
let g = 0, w = 1;
|
|
1374
1374
|
const k = 10;
|
|
1375
|
-
for (;
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
return z >= 1e-3 ?
|
|
1375
|
+
for (; w !== k && u[w] <= p; w += 1)
|
|
1376
|
+
g += 0.1;
|
|
1377
|
+
w -= 1;
|
|
1378
|
+
const O = (p - u[w]) / (u[w + 1] - u[w]), M = g + O * 0.1, z = l(M, t, r);
|
|
1379
|
+
return z >= 1e-3 ? m(p, M) : z === 0 ? M : y(p, g, g + 0.1);
|
|
1380
1380
|
}
|
|
1381
|
-
for (let
|
|
1382
|
-
u[
|
|
1383
|
-
return (
|
|
1381
|
+
for (let p = 0; p < 11; p += 1)
|
|
1382
|
+
u[p] = h(p * 0.1, t, r);
|
|
1383
|
+
return (p) => p <= 0 ? 0 : p >= 1 ? 1 : h(b(p), e, n);
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function Wr(t) {
|
|
1386
1386
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
1387
1387
|
if (!e)
|
|
1388
|
-
return (o) =>
|
|
1388
|
+
return (o) => $(o);
|
|
1389
1389
|
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1390
|
-
return n === "start" || n === "jump-start" ? (o) =>
|
|
1390
|
+
return n === "start" || n === "jump-start" ? (o) => $(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => $(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => $((Math.floor(o * r) + 0.5) / r) : (o) => $(Math.floor(o * r) / r);
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function zr(t) {
|
|
1393
1393
|
if (!t)
|
|
1394
|
-
return (r) =>
|
|
1394
|
+
return (r) => $(r);
|
|
1395
1395
|
const e = t.trim().toLowerCase();
|
|
1396
1396
|
if (!e || e === "linear")
|
|
1397
|
-
return (r) =>
|
|
1398
|
-
if (
|
|
1399
|
-
const [r, n, o, s] =
|
|
1400
|
-
return (a) =>
|
|
1397
|
+
return (r) => $(r);
|
|
1398
|
+
if (tt[e]) {
|
|
1399
|
+
const [r, n, o, s] = tt[e], i = ot(r, n, o, s);
|
|
1400
|
+
return (a) => $(i($(a)));
|
|
1401
1401
|
}
|
|
1402
1402
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1403
1403
|
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1404
1404
|
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1405
|
-
const [o, s, i, a] = n, c =
|
|
1406
|
-
return (f) =>
|
|
1405
|
+
const [o, s, i, a] = n, c = ot(o, s, i, a);
|
|
1406
|
+
return (f) => $(c($(f)));
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
1409
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
1410
|
-
const r =
|
|
1411
|
-
return (n) => r(
|
|
1410
|
+
const r = Wr(e);
|
|
1411
|
+
return (n) => r($(n));
|
|
1412
1412
|
}
|
|
1413
|
-
return (r) =>
|
|
1413
|
+
return (r) => $(r);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function qr(t) {
|
|
1416
1416
|
if (!t)
|
|
1417
1417
|
return;
|
|
1418
1418
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
@@ -1422,7 +1422,7 @@ function Kr(t) {
|
|
|
1422
1422
|
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1423
1423
|
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
1424
1424
|
}
|
|
1425
|
-
class
|
|
1425
|
+
class Gr {
|
|
1426
1426
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1427
1427
|
observer;
|
|
1428
1428
|
observeScheduled = !1;
|
|
@@ -1449,7 +1449,7 @@ class Yr {
|
|
|
1449
1449
|
try {
|
|
1450
1450
|
e();
|
|
1451
1451
|
} catch (r) {
|
|
1452
|
-
|
|
1452
|
+
Te.warn("Failed to cleanup binding listener", r);
|
|
1453
1453
|
}
|
|
1454
1454
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
|
|
1455
1455
|
}
|
|
@@ -1459,7 +1459,7 @@ class Yr {
|
|
|
1459
1459
|
const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1460
1460
|
return n.length === 0 ? void 0 : { bindings: n };
|
|
1461
1461
|
} catch (r) {
|
|
1462
|
-
|
|
1462
|
+
Te.warn("Failed to parse motion metadata", r);
|
|
1463
1463
|
return;
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
@@ -1467,7 +1467,7 @@ class Yr {
|
|
|
1467
1467
|
const r = e.source?.trim();
|
|
1468
1468
|
if (!r)
|
|
1469
1469
|
return;
|
|
1470
|
-
const n =
|
|
1470
|
+
const n = rt(e.min) ?? 0, o = rt(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = zr(e.ease), f = qr(e.map), u = e.targetId?.trim() || void 0;
|
|
1471
1471
|
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1472
1472
|
source: r.toLowerCase(),
|
|
1473
1473
|
min: n,
|
|
@@ -1525,7 +1525,7 @@ class Yr {
|
|
|
1525
1525
|
const r = this.bindingsByStyle.get(e);
|
|
1526
1526
|
if (!r || typeof document > "u")
|
|
1527
1527
|
return;
|
|
1528
|
-
const n = `.${
|
|
1528
|
+
const n = `.${nt(e)}`;
|
|
1529
1529
|
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1530
1530
|
}
|
|
1531
1531
|
applyStyleToElement(e, r, n) {
|
|
@@ -1565,7 +1565,7 @@ class Yr {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
resolveScrollContainer(e, r) {
|
|
1567
1567
|
if (r.targetId) {
|
|
1568
|
-
const n = `[data-ikon-motion-source="${
|
|
1568
|
+
const n = `[data-ikon-motion-source="${nt(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1569
1569
|
if (o)
|
|
1570
1570
|
return o;
|
|
1571
1571
|
}
|
|
@@ -1593,7 +1593,7 @@ class Yr {
|
|
|
1593
1593
|
case "unclamped":
|
|
1594
1594
|
return e;
|
|
1595
1595
|
default:
|
|
1596
|
-
return
|
|
1596
|
+
return $(e);
|
|
1597
1597
|
}
|
|
1598
1598
|
}
|
|
1599
1599
|
applyMap(e, r) {
|
|
@@ -1635,7 +1635,7 @@ class Yr {
|
|
|
1635
1635
|
try {
|
|
1636
1636
|
i();
|
|
1637
1637
|
} catch (a) {
|
|
1638
|
-
|
|
1638
|
+
Te.warn("Failed to cleanup listener", a);
|
|
1639
1639
|
}
|
|
1640
1640
|
this.globalCleanups.delete(i);
|
|
1641
1641
|
}
|
|
@@ -1680,29 +1680,29 @@ class Yr {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const
|
|
1684
|
-
function
|
|
1685
|
-
const e =
|
|
1683
|
+
const Ce = new Gr();
|
|
1684
|
+
function Hr(t) {
|
|
1685
|
+
const e = v(/* @__PURE__ */ new Map()), r = D(({ styleId: s, css: i, common: a }) => {
|
|
1686
1686
|
if (!(!s || typeof document > "u")) {
|
|
1687
1687
|
if (i) {
|
|
1688
1688
|
let c = e.current.get(s);
|
|
1689
1689
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1690
1690
|
}
|
|
1691
|
-
|
|
1691
|
+
Ce.registerStyle(s, a);
|
|
1692
1692
|
}
|
|
1693
|
-
}, []), n =
|
|
1693
|
+
}, []), n = D((s) => {
|
|
1694
1694
|
if (!(typeof document > "u"))
|
|
1695
1695
|
for (const i of s) {
|
|
1696
1696
|
const a = e.current.get(i);
|
|
1697
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1697
|
+
a && (a.remove(), e.current.delete(i)), Ce.unregisterStyle(i);
|
|
1698
1698
|
}
|
|
1699
|
-
}, []), o =
|
|
1699
|
+
}, []), o = D(() => {
|
|
1700
1700
|
if (typeof document < "u") {
|
|
1701
1701
|
for (const s of e.current.values())
|
|
1702
1702
|
s.remove();
|
|
1703
1703
|
e.current.clear();
|
|
1704
1704
|
}
|
|
1705
|
-
|
|
1705
|
+
Ce.reset();
|
|
1706
1706
|
}, []);
|
|
1707
1707
|
return L(() => {
|
|
1708
1708
|
if (!t) return;
|
|
@@ -1714,7 +1714,7 @@ function Wr(t) {
|
|
|
1714
1714
|
};
|
|
1715
1715
|
}, [t, o, r, n]), L(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function Jr(t) {
|
|
1718
1718
|
const e = [];
|
|
1719
1719
|
for (const [r, n] of t) {
|
|
1720
1720
|
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
@@ -1722,62 +1722,62 @@ function zr(t) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
return e.sort(), e.join(",");
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1726
|
-
const [e, r] = G(), n =
|
|
1725
|
+
function Xr(t) {
|
|
1726
|
+
const [e, r] = G(), n = v("");
|
|
1727
1727
|
return L(() => {
|
|
1728
1728
|
if (!t) {
|
|
1729
1729
|
r(void 0), n.current = "";
|
|
1730
1730
|
return;
|
|
1731
1731
|
}
|
|
1732
1732
|
const o = () => {
|
|
1733
|
-
const s = t.getStores(), i =
|
|
1733
|
+
const s = t.getStores(), i = Jr(s);
|
|
1734
1734
|
i !== n.current && (n.current = i, r(s));
|
|
1735
1735
|
};
|
|
1736
1736
|
return o(), t.subscribe(o);
|
|
1737
1737
|
}, [t]), e;
|
|
1738
1738
|
}
|
|
1739
|
-
var
|
|
1740
|
-
function
|
|
1741
|
-
var e =
|
|
1739
|
+
var Zr = typeof global == "object" && global && global.Object === Object && global, Qr = typeof self == "object" && self && self.Object === Object && self, en = Zr || Qr || Function("return this")(), be = en.Symbol, gt = Object.prototype, tn = gt.hasOwnProperty, rn = gt.toString, ue = be ? be.toStringTag : void 0;
|
|
1740
|
+
function nn(t) {
|
|
1741
|
+
var e = tn.call(t, ue), r = t[ue];
|
|
1742
1742
|
try {
|
|
1743
|
-
t[
|
|
1743
|
+
t[ue] = void 0;
|
|
1744
1744
|
var n = !0;
|
|
1745
1745
|
} catch {
|
|
1746
1746
|
}
|
|
1747
|
-
var o =
|
|
1748
|
-
return n && (e ? t[
|
|
1747
|
+
var o = rn.call(t);
|
|
1748
|
+
return n && (e ? t[ue] = r : delete t[ue]), o;
|
|
1749
1749
|
}
|
|
1750
|
-
var
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1750
|
+
var on = Object.prototype, sn = on.toString;
|
|
1751
|
+
function an(t) {
|
|
1752
|
+
return sn.call(t);
|
|
1753
1753
|
}
|
|
1754
|
-
var
|
|
1755
|
-
function
|
|
1756
|
-
return t == null ? t === void 0 ?
|
|
1754
|
+
var cn = "[object Null]", un = "[object Undefined]", st = be ? be.toStringTag : void 0;
|
|
1755
|
+
function ln(t) {
|
|
1756
|
+
return t == null ? t === void 0 ? un : cn : st && st in Object(t) ? nn(t) : an(t);
|
|
1757
1757
|
}
|
|
1758
|
-
function
|
|
1758
|
+
function dn(t) {
|
|
1759
1759
|
return t != null && typeof t == "object";
|
|
1760
1760
|
}
|
|
1761
|
-
var
|
|
1762
|
-
function
|
|
1763
|
-
return typeof t == "string" || !
|
|
1761
|
+
var fn = Array.isArray, hn = "[object String]";
|
|
1762
|
+
function mn(t) {
|
|
1763
|
+
return typeof t == "string" || !fn(t) && dn(t) && ln(t) == hn;
|
|
1764
1764
|
}
|
|
1765
|
-
const
|
|
1766
|
-
function
|
|
1765
|
+
const it = "ikonUiModules";
|
|
1766
|
+
function Ue(t) {
|
|
1767
1767
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function pn(t) {
|
|
1770
1770
|
if (!Array.isArray(t))
|
|
1771
1771
|
return;
|
|
1772
1772
|
const e = /* @__PURE__ */ new Set();
|
|
1773
1773
|
for (const r of t) {
|
|
1774
|
-
if (!
|
|
1774
|
+
if (!mn(r)) continue;
|
|
1775
1775
|
const n = r.trim();
|
|
1776
1776
|
n && (e.has(n) || e.add(n));
|
|
1777
1777
|
}
|
|
1778
1778
|
return Array.from(e);
|
|
1779
1779
|
}
|
|
1780
|
-
function
|
|
1780
|
+
function So(t, e) {
|
|
1781
1781
|
if (t === e)
|
|
1782
1782
|
return !0;
|
|
1783
1783
|
if (!t || !e)
|
|
@@ -1789,19 +1789,19 @@ function lo(t, e) {
|
|
|
1789
1789
|
return !1;
|
|
1790
1790
|
return !0;
|
|
1791
1791
|
}
|
|
1792
|
-
function
|
|
1793
|
-
if (!(!
|
|
1794
|
-
return
|
|
1792
|
+
function gn(t) {
|
|
1793
|
+
if (!(!Ue(t) || !Object.prototype.hasOwnProperty.call(t, it)))
|
|
1794
|
+
return pn(t[it]);
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function bo(...t) {
|
|
1797
1797
|
for (const e of t) {
|
|
1798
|
-
const r =
|
|
1798
|
+
const r = gn(e);
|
|
1799
1799
|
if (r !== void 0)
|
|
1800
1800
|
return r;
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
1803
|
-
function
|
|
1804
|
-
if (!
|
|
1803
|
+
function wo(t) {
|
|
1804
|
+
if (!Ue(t))
|
|
1805
1805
|
return;
|
|
1806
1806
|
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1807
1807
|
if (!r)
|
|
@@ -1814,15 +1814,15 @@ function ho(t) {
|
|
|
1814
1814
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
1815
1815
|
for (const c of n) {
|
|
1816
1816
|
if (typeof c == "string") {
|
|
1817
|
-
const
|
|
1818
|
-
if (!
|
|
1817
|
+
const b = c.trim();
|
|
1818
|
+
if (!b || i.has(b))
|
|
1819
1819
|
continue;
|
|
1820
|
-
o.push(
|
|
1820
|
+
o.push(b), i.add(b);
|
|
1821
1821
|
continue;
|
|
1822
1822
|
}
|
|
1823
|
-
if (!
|
|
1823
|
+
if (!Ue(c))
|
|
1824
1824
|
continue;
|
|
1825
|
-
const f = c, u = Object.keys(f).find((
|
|
1825
|
+
const f = c, u = Object.keys(f).find((b) => b.toLowerCase() === "name");
|
|
1826
1826
|
if (!u)
|
|
1827
1827
|
continue;
|
|
1828
1828
|
const h = f[u];
|
|
@@ -1831,7 +1831,7 @@ function ho(t) {
|
|
|
1831
1831
|
const l = h.trim();
|
|
1832
1832
|
if (!l)
|
|
1833
1833
|
continue;
|
|
1834
|
-
const
|
|
1834
|
+
const m = Object.keys(f).find((b) => b.toLowerCase() === "javascript"), y = m ? f[m] : void 0;
|
|
1835
1835
|
typeof y == "string" && s.set(l, y), i.has(l) || (o.push(l), i.add(l));
|
|
1836
1836
|
}
|
|
1837
1837
|
if (!o.length && s.size === 0)
|
|
@@ -1849,7 +1849,7 @@ const E = {
|
|
|
1849
1849
|
Line: 4,
|
|
1850
1850
|
Paragraph: 8,
|
|
1851
1851
|
Emoji: 16
|
|
1852
|
-
},
|
|
1852
|
+
}, yn = [
|
|
1853
1853
|
{
|
|
1854
1854
|
flag: E.Letter,
|
|
1855
1855
|
hints: [
|
|
@@ -1898,32 +1898,32 @@ const E = {
|
|
|
1898
1898
|
"[data-emoji]"
|
|
1899
1899
|
]
|
|
1900
1900
|
}
|
|
1901
|
-
],
|
|
1902
|
-
function
|
|
1903
|
-
if (!t || t.length >
|
|
1901
|
+
], xe = E.Letter | E.Word | E.Line | E.Paragraph | E.Emoji, Sn = E.Letter | E.Word | E.Line | E.Paragraph, at = /* @__PURE__ */ new Map(), bn = 16384;
|
|
1902
|
+
function vo(t, e) {
|
|
1903
|
+
if (!t || t.length > bn)
|
|
1904
1904
|
return t;
|
|
1905
|
-
const r =
|
|
1905
|
+
const r = Un(e), n = te(r, E.Emoji), o = r & Sn;
|
|
1906
1906
|
if (o === E.None && !n)
|
|
1907
1907
|
return t;
|
|
1908
1908
|
const s = t.replace(/\r\n/g, `
|
|
1909
1909
|
`).replace(/\r/g, `
|
|
1910
1910
|
`);
|
|
1911
1911
|
if (o === E.None)
|
|
1912
|
-
return
|
|
1913
|
-
const i =
|
|
1912
|
+
return dt(s);
|
|
1913
|
+
const i = jn(s);
|
|
1914
1914
|
if (i.length === 0)
|
|
1915
|
-
return n ?
|
|
1916
|
-
const a =
|
|
1915
|
+
return n ? dt(s) : t;
|
|
1916
|
+
const a = Ln(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1917
1917
|
for (const u of a) {
|
|
1918
|
-
const h =
|
|
1918
|
+
const h = wn(u, r, c);
|
|
1919
1919
|
f.push(...h);
|
|
1920
1920
|
}
|
|
1921
1921
|
return f;
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1923
|
+
function wn(t, e, r) {
|
|
1924
1924
|
const n = [];
|
|
1925
1925
|
for (const o of t) {
|
|
1926
|
-
const s =
|
|
1926
|
+
const s = vn(o, e, r);
|
|
1927
1927
|
n.push(...s);
|
|
1928
1928
|
}
|
|
1929
1929
|
if (te(e, E.Paragraph)) {
|
|
@@ -1933,7 +1933,7 @@ function gn(t, e, r) {
|
|
|
1933
1933
|
"span",
|
|
1934
1934
|
{
|
|
1935
1935
|
"data-motion-paragraph": !0,
|
|
1936
|
-
style:
|
|
1936
|
+
style: Ee(o),
|
|
1937
1937
|
children: n
|
|
1938
1938
|
},
|
|
1939
1939
|
`motion-paragraph-${o}`
|
|
@@ -1942,12 +1942,12 @@ function gn(t, e, r) {
|
|
|
1942
1942
|
}
|
|
1943
1943
|
return n;
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1946
|
-
const n =
|
|
1945
|
+
function vn(t, e, r) {
|
|
1946
|
+
const n = Rn(t.text, e, r), o = [];
|
|
1947
1947
|
if (te(e, E.Line)) {
|
|
1948
1948
|
const s = r.line++;
|
|
1949
1949
|
o.push(
|
|
1950
|
-
/* @__PURE__ */ A.jsx("span", { "data-motion-line": !0, style:
|
|
1950
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-line": !0, style: Ee(s), children: n }, `motion-line-${s}`)
|
|
1951
1951
|
);
|
|
1952
1952
|
} else
|
|
1953
1953
|
o.push(...n);
|
|
@@ -1955,7 +1955,7 @@ function yn(t, e, r) {
|
|
|
1955
1955
|
o.push(/* @__PURE__ */ A.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1956
1956
|
return o;
|
|
1957
1957
|
}
|
|
1958
|
-
function
|
|
1958
|
+
function Rn(t, e, r) {
|
|
1959
1959
|
if (!t)
|
|
1960
1960
|
return [];
|
|
1961
1961
|
const n = te(e, E.Word), o = [], s = /(\s+)/g;
|
|
@@ -1963,39 +1963,39 @@ function Sn(t, e, r) {
|
|
|
1963
1963
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1964
1964
|
if (a.index > i) {
|
|
1965
1965
|
const c = t.slice(i, a.index);
|
|
1966
|
-
o.push(
|
|
1966
|
+
o.push(ct(c, r, e, n));
|
|
1967
1967
|
}
|
|
1968
1968
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1969
1969
|
}
|
|
1970
1970
|
if (i < t.length) {
|
|
1971
1971
|
const c = t.slice(i);
|
|
1972
|
-
o.push(
|
|
1972
|
+
o.push(ct(c, r, e, n));
|
|
1973
1973
|
}
|
|
1974
1974
|
return o;
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const o = e.word++, s =
|
|
1976
|
+
function ct(t, e, r, n) {
|
|
1977
|
+
const o = e.word++, s = An(t, r, e), i = `motion-word-${o}`, a = En(o, n);
|
|
1978
1978
|
return n ? /* @__PURE__ */ A.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ A.jsx("span", { style: a, children: s }, i);
|
|
1979
1979
|
}
|
|
1980
|
-
function
|
|
1981
|
-
return e ? { ...
|
|
1980
|
+
function En(t, e) {
|
|
1981
|
+
return e ? { ...Ee(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1983
|
+
function An(t, e, r) {
|
|
1984
1984
|
if (!t)
|
|
1985
1985
|
return [];
|
|
1986
1986
|
const n = te(e, E.Letter), o = te(e, E.Emoji);
|
|
1987
1987
|
if (!n) {
|
|
1988
1988
|
if (!o)
|
|
1989
1989
|
return [t];
|
|
1990
|
-
const a =
|
|
1990
|
+
const a = De(t);
|
|
1991
1991
|
if (a.length === 0)
|
|
1992
1992
|
return [t];
|
|
1993
|
-
const { nodes: c } =
|
|
1993
|
+
const { nodes: c } = St(a, r);
|
|
1994
1994
|
return c;
|
|
1995
1995
|
}
|
|
1996
|
-
const s = [], i =
|
|
1996
|
+
const s = [], i = De(t);
|
|
1997
1997
|
for (const a of i) {
|
|
1998
|
-
const c = r.letter++, f = `motion-letter-${c}`, u =
|
|
1998
|
+
const c = r.letter++, f = `motion-letter-${c}`, u = Ee(c);
|
|
1999
1999
|
if (a === `
|
|
2000
2000
|
`) {
|
|
2001
2001
|
s.push(
|
|
@@ -2003,55 +2003,55 @@ function wn(t, e, r) {
|
|
|
2003
2003
|
);
|
|
2004
2004
|
continue;
|
|
2005
2005
|
}
|
|
2006
|
-
const l = o &&
|
|
2006
|
+
const l = o && yt(a) ? { "data-motion-emoji": !0 } : void 0, m = a === " " ? " " : a;
|
|
2007
2007
|
s.push(
|
|
2008
|
-
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: u, ...l, children:
|
|
2008
|
+
/* @__PURE__ */ A.jsx("span", { "data-motion-letter": !0, style: u, ...l, children: m }, f)
|
|
2009
2009
|
);
|
|
2010
2010
|
}
|
|
2011
2011
|
return s;
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function De(t) {
|
|
2014
2014
|
if (!t)
|
|
2015
2015
|
return [];
|
|
2016
|
-
const e =
|
|
2017
|
-
return e ? Array.from(e.segment(t), (r) => r.segment) :
|
|
2016
|
+
const e = kn();
|
|
2017
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : Tn(t);
|
|
2018
2018
|
}
|
|
2019
|
-
let
|
|
2020
|
-
function
|
|
2021
|
-
return
|
|
2019
|
+
let le;
|
|
2020
|
+
function kn() {
|
|
2021
|
+
return le !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? le = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : le = null), le;
|
|
2022
2022
|
}
|
|
2023
|
-
function
|
|
2023
|
+
function Tn(t) {
|
|
2024
2024
|
const e = [], r = Array.from(t);
|
|
2025
2025
|
let n = "";
|
|
2026
2026
|
for (let o = 0; o < r.length; o++) {
|
|
2027
2027
|
const s = r[o], i = r[o + 1];
|
|
2028
|
-
n += s, !(i &&
|
|
2028
|
+
n += s, !(i && Cn(s, i)) && (e.push(n), n = "");
|
|
2029
2029
|
}
|
|
2030
2030
|
return n && e.push(n), e;
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2033
|
-
return e ? !!(
|
|
2032
|
+
function Cn(t, e) {
|
|
2033
|
+
return e ? !!(ut(t) || ut(e) || _n(e) || In(e) || On(e) || lt(t) && lt(e)) : !1;
|
|
2034
2034
|
}
|
|
2035
|
-
function
|
|
2035
|
+
function ut(t) {
|
|
2036
2036
|
return t.codePointAt(0) === 8205;
|
|
2037
2037
|
}
|
|
2038
|
-
function
|
|
2038
|
+
function In(t) {
|
|
2039
2039
|
const e = t.codePointAt(0);
|
|
2040
2040
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
2041
2041
|
}
|
|
2042
|
-
function
|
|
2042
|
+
function On(t) {
|
|
2043
2043
|
const e = t.codePointAt(0);
|
|
2044
2044
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2046
|
+
function lt(t) {
|
|
2047
2047
|
const e = t.codePointAt(0);
|
|
2048
2048
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2049
2049
|
}
|
|
2050
|
-
let
|
|
2051
|
-
function
|
|
2052
|
-
return t ? (
|
|
2050
|
+
let Ie;
|
|
2051
|
+
function _n(t) {
|
|
2052
|
+
return t ? (Ie || (Ie = Nn()), Ie(t)) : !1;
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2054
|
+
function Nn() {
|
|
2055
2055
|
try {
|
|
2056
2056
|
const t = new RegExp("\\p{Mark}", "u");
|
|
2057
2057
|
return (e) => t.test(e);
|
|
@@ -2062,19 +2062,19 @@ function Cn() {
|
|
|
2062
2062
|
};
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
let
|
|
2066
|
-
function
|
|
2067
|
-
return t ? (
|
|
2065
|
+
let Oe;
|
|
2066
|
+
function yt(t) {
|
|
2067
|
+
return t ? (Oe || (Oe = Pn()), Oe(t)) : !1;
|
|
2068
2068
|
}
|
|
2069
|
-
function
|
|
2069
|
+
function Pn() {
|
|
2070
2070
|
try {
|
|
2071
2071
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
2072
2072
|
return (e) => t.test(e);
|
|
2073
2073
|
} catch {
|
|
2074
|
-
return
|
|
2074
|
+
return Mn;
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function Mn(t) {
|
|
2078
2078
|
if (!t)
|
|
2079
2079
|
return !1;
|
|
2080
2080
|
for (const e of Array.from(t)) {
|
|
@@ -2084,7 +2084,7 @@ function On(t) {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
return !1;
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function jn(t) {
|
|
2088
2088
|
const e = [];
|
|
2089
2089
|
let r = "", n = 0;
|
|
2090
2090
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -2098,7 +2098,7 @@ function _n(t) {
|
|
|
2098
2098
|
}
|
|
2099
2099
|
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
2100
2100
|
}
|
|
2101
|
-
function
|
|
2101
|
+
function Ln(t) {
|
|
2102
2102
|
if (t.length === 0)
|
|
2103
2103
|
return [];
|
|
2104
2104
|
const e = [];
|
|
@@ -2110,7 +2110,7 @@ function Nn(t) {
|
|
|
2110
2110
|
function te(t, e) {
|
|
2111
2111
|
return (t & e) === e;
|
|
2112
2112
|
}
|
|
2113
|
-
function
|
|
2113
|
+
function Ee(t) {
|
|
2114
2114
|
return {
|
|
2115
2115
|
"--tw-motion-seq-index": t.toString(),
|
|
2116
2116
|
backgroundColor: "inherit",
|
|
@@ -2127,23 +2127,23 @@ function ge(t) {
|
|
|
2127
2127
|
WebkitTextFillColor: "inherit"
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2130
|
+
function dt(t) {
|
|
2131
2131
|
if (!t)
|
|
2132
2132
|
return t;
|
|
2133
|
-
const e =
|
|
2133
|
+
const e = De(t);
|
|
2134
2134
|
if (e.length === 0)
|
|
2135
2135
|
return t;
|
|
2136
|
-
const { nodes: r, sawEmoji: n } =
|
|
2136
|
+
const { nodes: r, sawEmoji: n } = St(e);
|
|
2137
2137
|
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
2138
2138
|
}
|
|
2139
|
-
function
|
|
2139
|
+
function St(t, e) {
|
|
2140
2140
|
const r = [];
|
|
2141
2141
|
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
2142
2142
|
const i = () => {
|
|
2143
2143
|
n && (r.push(n), n = "");
|
|
2144
2144
|
};
|
|
2145
2145
|
for (const a of t) {
|
|
2146
|
-
if (
|
|
2146
|
+
if (yt(a)) {
|
|
2147
2147
|
o = !0, i();
|
|
2148
2148
|
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2149
2149
|
r.push(
|
|
@@ -2155,13 +2155,13 @@ function pt(t, e) {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function Un(t) {
|
|
2159
2159
|
if (!t)
|
|
2160
2160
|
return E.None;
|
|
2161
2161
|
const e = t.trim();
|
|
2162
2162
|
if (!e)
|
|
2163
2163
|
return E.None;
|
|
2164
|
-
const r =
|
|
2164
|
+
const r = at.get(e);
|
|
2165
2165
|
if (typeof r == "number")
|
|
2166
2166
|
return r;
|
|
2167
2167
|
if (typeof document > "u")
|
|
@@ -2169,8 +2169,8 @@ function Pn(t) {
|
|
|
2169
2169
|
const n = e.split(/\s+/).filter(Boolean);
|
|
2170
2170
|
if (n.length === 0)
|
|
2171
2171
|
return E.None;
|
|
2172
|
-
const s = n.map((c) => `.${
|
|
2173
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2172
|
+
const s = n.map((c) => `.${xn(c)}`).map(
|
|
2173
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Dn(c)}(?![a-zA-Z0-9_-])`)
|
|
2174
2174
|
);
|
|
2175
2175
|
let i = E.None, a = !1;
|
|
2176
2176
|
for (const c of Array.from(document.styleSheets)) {
|
|
@@ -2180,14 +2180,14 @@ function Pn(t) {
|
|
|
2180
2180
|
} catch {
|
|
2181
2181
|
continue;
|
|
2182
2182
|
}
|
|
2183
|
-
const u =
|
|
2184
|
-
if (u.mask && (i |= u.mask, i ===
|
|
2183
|
+
const u = bt(f, s);
|
|
2184
|
+
if (u.mask && (i |= u.mask, i === xe))
|
|
2185
2185
|
break;
|
|
2186
2186
|
a ||= u.sawStyleRule;
|
|
2187
2187
|
}
|
|
2188
|
-
return (i !== E.None || a) &&
|
|
2188
|
+
return (i !== E.None || a) && at.set(e, i), i;
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2190
|
+
function bt(t, e) {
|
|
2191
2191
|
if (!t)
|
|
2192
2192
|
return { mask: E.None, sawStyleRule: !1 };
|
|
2193
2193
|
let r = E.None, n = !1;
|
|
@@ -2198,13 +2198,13 @@ function gt(t, e) {
|
|
|
2198
2198
|
const a = s.selectorText ?? "";
|
|
2199
2199
|
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2200
2200
|
n = !0;
|
|
2201
|
-
for (const f of
|
|
2201
|
+
for (const f of yn)
|
|
2202
2202
|
f.hints.some((u) => a.includes(u)) && (r |= f.flag);
|
|
2203
|
-
if (r ===
|
|
2203
|
+
if (r === xe)
|
|
2204
2204
|
return { mask: r, sawStyleRule: !0 };
|
|
2205
2205
|
} else if ("cssRules" in s) {
|
|
2206
|
-
const i =
|
|
2207
|
-
if (i.mask && (r |= i.mask, r ===
|
|
2206
|
+
const i = bt(s.cssRules, e);
|
|
2207
|
+
if (i.mask && (r |= i.mask, r === xe))
|
|
2208
2208
|
return { mask: r, sawStyleRule: !0 };
|
|
2209
2209
|
n ||= i.sawStyleRule;
|
|
2210
2210
|
}
|
|
@@ -2212,38 +2212,48 @@ function gt(t, e) {
|
|
|
2212
2212
|
}
|
|
2213
2213
|
return { mask: r, sawStyleRule: n };
|
|
2214
2214
|
}
|
|
2215
|
-
function
|
|
2215
|
+
function xn(t) {
|
|
2216
2216
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2217
2217
|
}
|
|
2218
|
-
function
|
|
2218
|
+
function Dn(t) {
|
|
2219
2219
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2220
2220
|
}
|
|
2221
|
-
const
|
|
2222
|
-
function
|
|
2221
|
+
const Ke = "ikon_auth_session", Fn = 7 * 24 * 60 * 60 * 1e3, Bn = 60 * 1e3;
|
|
2222
|
+
function $n(t) {
|
|
2223
2223
|
try {
|
|
2224
|
-
|
|
2224
|
+
const e = t.split(".");
|
|
2225
|
+
if (e.length !== 3) return !0;
|
|
2226
|
+
const r = JSON.parse(atob(e[1]));
|
|
2227
|
+
return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 - Bn;
|
|
2228
|
+
} catch {
|
|
2229
|
+
return !0;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
function Ae(t) {
|
|
2233
|
+
try {
|
|
2234
|
+
localStorage.setItem(Ke, JSON.stringify(t));
|
|
2225
2235
|
} catch {
|
|
2226
2236
|
console.warn("Failed to save auth session to localStorage");
|
|
2227
2237
|
}
|
|
2228
2238
|
}
|
|
2229
|
-
function
|
|
2239
|
+
function wt() {
|
|
2230
2240
|
try {
|
|
2231
|
-
const t = localStorage.getItem(
|
|
2241
|
+
const t = localStorage.getItem(Ke);
|
|
2232
2242
|
if (!t) return null;
|
|
2233
2243
|
const e = JSON.parse(t);
|
|
2234
|
-
return Date.now() - e.authenticatedAt >
|
|
2244
|
+
return Date.now() - e.authenticatedAt > Fn || $n(e.token) ? (we(), null) : e;
|
|
2235
2245
|
} catch {
|
|
2236
2246
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2237
2247
|
}
|
|
2238
2248
|
}
|
|
2239
|
-
function
|
|
2249
|
+
function we() {
|
|
2240
2250
|
try {
|
|
2241
|
-
localStorage.removeItem(
|
|
2251
|
+
localStorage.removeItem(Ke);
|
|
2242
2252
|
} catch {
|
|
2243
2253
|
console.warn("Failed to clear auth session from localStorage");
|
|
2244
2254
|
}
|
|
2245
2255
|
}
|
|
2246
|
-
function
|
|
2256
|
+
function de(t) {
|
|
2247
2257
|
return {
|
|
2248
2258
|
id: "",
|
|
2249
2259
|
provider: t.provider,
|
|
@@ -2251,8 +2261,8 @@ function ae(t) {
|
|
|
2251
2261
|
authenticatedAt: t.authenticatedAt
|
|
2252
2262
|
};
|
|
2253
2263
|
}
|
|
2254
|
-
async function
|
|
2255
|
-
const r =
|
|
2264
|
+
async function vt(t, e) {
|
|
2265
|
+
const r = Pt(), n = await fetch(`${e}/anonymous`, {
|
|
2256
2266
|
method: "POST",
|
|
2257
2267
|
headers: { "Content-Type": "application/json" },
|
|
2258
2268
|
body: JSON.stringify({ deviceId: r, space: t })
|
|
@@ -2266,9 +2276,9 @@ async function bt(t, e) {
|
|
|
2266
2276
|
provider: "anonymous",
|
|
2267
2277
|
authenticatedAt: Date.now()
|
|
2268
2278
|
};
|
|
2269
|
-
return
|
|
2279
|
+
return Ae(s), s;
|
|
2270
2280
|
}
|
|
2271
|
-
async function
|
|
2281
|
+
async function Ro(t) {
|
|
2272
2282
|
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
2273
2283
|
method: "POST",
|
|
2274
2284
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2283,22 +2293,22 @@ async function po(t) {
|
|
|
2283
2293
|
throw new Error(i);
|
|
2284
2294
|
}
|
|
2285
2295
|
}
|
|
2286
|
-
function
|
|
2296
|
+
function Vn() {
|
|
2287
2297
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2288
2298
|
return e && r ? { token: e, provider: r } : null;
|
|
2289
2299
|
}
|
|
2290
|
-
function
|
|
2300
|
+
function Kn() {
|
|
2291
2301
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
2292
2302
|
return e ? decodeURIComponent(e) : null;
|
|
2293
2303
|
}
|
|
2294
|
-
function
|
|
2304
|
+
function ft() {
|
|
2295
2305
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2296
2306
|
}
|
|
2297
|
-
function
|
|
2307
|
+
function Yn(t, e, r, n) {
|
|
2298
2308
|
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2299
2309
|
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
2300
2310
|
}
|
|
2301
|
-
async function
|
|
2311
|
+
async function Wn(t) {
|
|
2302
2312
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
2303
2313
|
method: "POST",
|
|
2304
2314
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2309,7 +2319,7 @@ async function Fn(t) {
|
|
|
2309
2319
|
}
|
|
2310
2320
|
return e.json();
|
|
2311
2321
|
}
|
|
2312
|
-
async function
|
|
2322
|
+
async function zn(t, e, r) {
|
|
2313
2323
|
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
2314
2324
|
method: "POST",
|
|
2315
2325
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2324,9 +2334,9 @@ async function Bn(t, e, r) {
|
|
|
2324
2334
|
provider: "passkey",
|
|
2325
2335
|
authenticatedAt: Date.now()
|
|
2326
2336
|
};
|
|
2327
|
-
return
|
|
2337
|
+
return Ae(s), s;
|
|
2328
2338
|
}
|
|
2329
|
-
async function
|
|
2339
|
+
async function qn(t, e) {
|
|
2330
2340
|
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
2331
2341
|
method: "POST",
|
|
2332
2342
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2338,7 +2348,7 @@ async function $n(t, e) {
|
|
|
2338
2348
|
}
|
|
2339
2349
|
return r.json();
|
|
2340
2350
|
}
|
|
2341
|
-
async function
|
|
2351
|
+
async function Gn(t, e) {
|
|
2342
2352
|
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
2343
2353
|
method: "POST",
|
|
2344
2354
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2353,32 +2363,32 @@ async function Vn(t, e) {
|
|
|
2353
2363
|
provider: "passkey",
|
|
2354
2364
|
authenticatedAt: Date.now()
|
|
2355
2365
|
};
|
|
2356
|
-
return
|
|
2366
|
+
return Ae(o), o;
|
|
2357
2367
|
}
|
|
2358
|
-
function
|
|
2368
|
+
function q(t) {
|
|
2359
2369
|
const e = new Uint8Array(t);
|
|
2360
2370
|
let r = "";
|
|
2361
2371
|
for (const o of e)
|
|
2362
2372
|
r += String.fromCharCode(o);
|
|
2363
2373
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
2364
2374
|
}
|
|
2365
|
-
function
|
|
2375
|
+
function ve(t) {
|
|
2366
2376
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - e.length % 4) % 4, n = e.padEnd(e.length + r, "="), o = atob(n), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
|
|
2367
2377
|
for (let a = 0; a < o.length; a++)
|
|
2368
2378
|
i[a] = o.charCodeAt(a);
|
|
2369
2379
|
return s;
|
|
2370
2380
|
}
|
|
2371
|
-
function
|
|
2372
|
-
return
|
|
2381
|
+
function Ye() {
|
|
2382
|
+
return Hn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2373
2383
|
}
|
|
2374
|
-
const
|
|
2384
|
+
const Hn = {
|
|
2375
2385
|
stubThis: (t) => t
|
|
2376
2386
|
};
|
|
2377
|
-
function
|
|
2387
|
+
function Rt(t) {
|
|
2378
2388
|
const { id: e } = t;
|
|
2379
2389
|
return {
|
|
2380
2390
|
...t,
|
|
2381
|
-
id:
|
|
2391
|
+
id: ve(e),
|
|
2382
2392
|
/**
|
|
2383
2393
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
2384
2394
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -2387,7 +2397,7 @@ function wt(t) {
|
|
|
2387
2397
|
transports: t.transports
|
|
2388
2398
|
};
|
|
2389
2399
|
}
|
|
2390
|
-
function
|
|
2400
|
+
function Et(t) {
|
|
2391
2401
|
return (
|
|
2392
2402
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
2393
2403
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
@@ -2403,7 +2413,7 @@ class P extends Error {
|
|
|
2403
2413
|
}), this.name = o ?? n.name, this.code = r;
|
|
2404
2414
|
}
|
|
2405
2415
|
}
|
|
2406
|
-
function
|
|
2416
|
+
function Jn({ error: t, options: e }) {
|
|
2407
2417
|
const { publicKey: r } = e;
|
|
2408
2418
|
if (!r)
|
|
2409
2419
|
throw Error("options was missing required publicKey property");
|
|
@@ -2461,7 +2471,7 @@ function Yn({ error: t, options: e }) {
|
|
|
2461
2471
|
});
|
|
2462
2472
|
if (t.name === "SecurityError") {
|
|
2463
2473
|
const n = globalThis.location.hostname;
|
|
2464
|
-
if (
|
|
2474
|
+
if (Et(n)) {
|
|
2465
2475
|
if (r.rp.id !== n)
|
|
2466
2476
|
return new P({
|
|
2467
2477
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
@@ -2489,7 +2499,7 @@ function Yn({ error: t, options: e }) {
|
|
|
2489
2499
|
}
|
|
2490
2500
|
return t;
|
|
2491
2501
|
}
|
|
2492
|
-
class
|
|
2502
|
+
class Xn {
|
|
2493
2503
|
constructor() {
|
|
2494
2504
|
Object.defineProperty(this, "controller", {
|
|
2495
2505
|
enumerable: !0,
|
|
@@ -2513,31 +2523,31 @@ class Wn {
|
|
|
2513
2523
|
}
|
|
2514
2524
|
}
|
|
2515
2525
|
}
|
|
2516
|
-
const
|
|
2517
|
-
function
|
|
2518
|
-
if (t && !(
|
|
2526
|
+
const At = new Xn(), Zn = ["cross-platform", "platform"];
|
|
2527
|
+
function kt(t) {
|
|
2528
|
+
if (t && !(Zn.indexOf(t) < 0))
|
|
2519
2529
|
return t;
|
|
2520
2530
|
}
|
|
2521
|
-
async function
|
|
2531
|
+
async function Qn(t) {
|
|
2522
2532
|
!t.optionsJSON && t.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
2523
2533
|
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2524
|
-
if (
|
|
2534
|
+
if (!Ye())
|
|
2525
2535
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2526
2536
|
const n = {
|
|
2527
2537
|
...e,
|
|
2528
|
-
challenge:
|
|
2538
|
+
challenge: ve(e.challenge),
|
|
2529
2539
|
user: {
|
|
2530
2540
|
...e.user,
|
|
2531
|
-
id:
|
|
2541
|
+
id: ve(e.user.id)
|
|
2532
2542
|
},
|
|
2533
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2543
|
+
excludeCredentials: e.excludeCredentials?.map(Rt)
|
|
2534
2544
|
}, o = {};
|
|
2535
|
-
r && (o.mediation = "conditional"), o.publicKey = n, o.signal =
|
|
2545
|
+
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = At.createNewAbortSignal();
|
|
2536
2546
|
let s;
|
|
2537
2547
|
try {
|
|
2538
2548
|
s = await navigator.credentials.create(o);
|
|
2539
2549
|
} catch (y) {
|
|
2540
|
-
throw
|
|
2550
|
+
throw Jn({ error: y, options: o });
|
|
2541
2551
|
}
|
|
2542
2552
|
if (!s)
|
|
2543
2553
|
throw new Error("Registration was not completed");
|
|
@@ -2549,53 +2559,53 @@ async function qn(t) {
|
|
|
2549
2559
|
try {
|
|
2550
2560
|
h = c.getPublicKeyAlgorithm();
|
|
2551
2561
|
} catch (y) {
|
|
2552
|
-
|
|
2562
|
+
_e("getPublicKeyAlgorithm()", y);
|
|
2553
2563
|
}
|
|
2554
2564
|
let l;
|
|
2555
2565
|
if (typeof c.getPublicKey == "function")
|
|
2556
2566
|
try {
|
|
2557
2567
|
const y = c.getPublicKey();
|
|
2558
|
-
y !== null && (l =
|
|
2568
|
+
y !== null && (l = q(y));
|
|
2559
2569
|
} catch (y) {
|
|
2560
|
-
|
|
2570
|
+
_e("getPublicKey()", y);
|
|
2561
2571
|
}
|
|
2562
|
-
let
|
|
2572
|
+
let m;
|
|
2563
2573
|
if (typeof c.getAuthenticatorData == "function")
|
|
2564
2574
|
try {
|
|
2565
|
-
|
|
2575
|
+
m = q(c.getAuthenticatorData());
|
|
2566
2576
|
} catch (y) {
|
|
2567
|
-
|
|
2577
|
+
_e("getAuthenticatorData()", y);
|
|
2568
2578
|
}
|
|
2569
2579
|
return {
|
|
2570
2580
|
id: i,
|
|
2571
|
-
rawId:
|
|
2581
|
+
rawId: q(a),
|
|
2572
2582
|
response: {
|
|
2573
|
-
attestationObject:
|
|
2574
|
-
clientDataJSON:
|
|
2583
|
+
attestationObject: q(c.attestationObject),
|
|
2584
|
+
clientDataJSON: q(c.clientDataJSON),
|
|
2575
2585
|
transports: u,
|
|
2576
2586
|
publicKeyAlgorithm: h,
|
|
2577
2587
|
publicKey: l,
|
|
2578
|
-
authenticatorData:
|
|
2588
|
+
authenticatorData: m
|
|
2579
2589
|
},
|
|
2580
2590
|
type: f,
|
|
2581
2591
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2582
|
-
authenticatorAttachment:
|
|
2592
|
+
authenticatorAttachment: kt(s.authenticatorAttachment)
|
|
2583
2593
|
};
|
|
2584
2594
|
}
|
|
2585
|
-
function
|
|
2595
|
+
function _e(t, e) {
|
|
2586
2596
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2587
2597
|
`, e);
|
|
2588
2598
|
}
|
|
2589
|
-
function
|
|
2590
|
-
if (
|
|
2591
|
-
return
|
|
2599
|
+
function eo() {
|
|
2600
|
+
if (!Ye())
|
|
2601
|
+
return Ne.stubThis(new Promise((e) => e(!1)));
|
|
2592
2602
|
const t = globalThis.PublicKeyCredential;
|
|
2593
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2603
|
+
return t?.isConditionalMediationAvailable === void 0 ? Ne.stubThis(new Promise((e) => e(!1))) : Ne.stubThis(t.isConditionalMediationAvailable());
|
|
2594
2604
|
}
|
|
2595
|
-
const
|
|
2605
|
+
const Ne = {
|
|
2596
2606
|
stubThis: (t) => t
|
|
2597
2607
|
};
|
|
2598
|
-
function
|
|
2608
|
+
function to({ error: t, options: e }) {
|
|
2599
2609
|
const { publicKey: r } = e;
|
|
2600
2610
|
if (!r)
|
|
2601
2611
|
throw Error("options was missing required publicKey property");
|
|
@@ -2615,7 +2625,7 @@ function Hn({ error: t, options: e }) {
|
|
|
2615
2625
|
});
|
|
2616
2626
|
if (t.name === "SecurityError") {
|
|
2617
2627
|
const n = globalThis.location.hostname;
|
|
2618
|
-
if (
|
|
2628
|
+
if (Et(n)) {
|
|
2619
2629
|
if (r.rpId !== n)
|
|
2620
2630
|
return new P({
|
|
2621
2631
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
@@ -2636,52 +2646,52 @@ function Hn({ error: t, options: e }) {
|
|
|
2636
2646
|
}
|
|
2637
2647
|
return t;
|
|
2638
2648
|
}
|
|
2639
|
-
async function
|
|
2649
|
+
async function ro(t) {
|
|
2640
2650
|
!t.optionsJSON && t.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
|
|
2641
2651
|
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2642
|
-
if (
|
|
2652
|
+
if (!Ye())
|
|
2643
2653
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2644
2654
|
let o;
|
|
2645
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2655
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(Rt));
|
|
2646
2656
|
const s = {
|
|
2647
2657
|
...e,
|
|
2648
|
-
challenge:
|
|
2658
|
+
challenge: ve(e.challenge),
|
|
2649
2659
|
allowCredentials: o
|
|
2650
2660
|
}, i = {};
|
|
2651
2661
|
if (r) {
|
|
2652
|
-
if (!await
|
|
2662
|
+
if (!await eo())
|
|
2653
2663
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2654
2664
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2655
2665
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2656
2666
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2657
2667
|
}
|
|
2658
|
-
i.publicKey = s, i.signal =
|
|
2668
|
+
i.publicKey = s, i.signal = At.createNewAbortSignal();
|
|
2659
2669
|
let a;
|
|
2660
2670
|
try {
|
|
2661
2671
|
a = await navigator.credentials.get(i);
|
|
2662
|
-
} catch (
|
|
2663
|
-
throw
|
|
2672
|
+
} catch (m) {
|
|
2673
|
+
throw to({ error: m, options: i });
|
|
2664
2674
|
}
|
|
2665
2675
|
if (!a)
|
|
2666
2676
|
throw new Error("Authentication was not completed");
|
|
2667
2677
|
const { id: c, rawId: f, response: u, type: h } = a;
|
|
2668
2678
|
let l;
|
|
2669
|
-
return u.userHandle && (l =
|
|
2679
|
+
return u.userHandle && (l = q(u.userHandle)), {
|
|
2670
2680
|
id: c,
|
|
2671
|
-
rawId:
|
|
2681
|
+
rawId: q(f),
|
|
2672
2682
|
response: {
|
|
2673
|
-
authenticatorData:
|
|
2674
|
-
clientDataJSON:
|
|
2675
|
-
signature:
|
|
2683
|
+
authenticatorData: q(u.authenticatorData),
|
|
2684
|
+
clientDataJSON: q(u.clientDataJSON),
|
|
2685
|
+
signature: q(u.signature),
|
|
2676
2686
|
userHandle: l
|
|
2677
2687
|
},
|
|
2678
2688
|
type: h,
|
|
2679
2689
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2680
|
-
authenticatorAttachment:
|
|
2690
|
+
authenticatorAttachment: kt(a.authenticatorAttachment)
|
|
2681
2691
|
};
|
|
2682
2692
|
}
|
|
2683
|
-
const
|
|
2684
|
-
function
|
|
2693
|
+
const We = ht(null);
|
|
2694
|
+
function Eo({ children: t, config: e }) {
|
|
2685
2695
|
const [r, n] = G({
|
|
2686
2696
|
isAuthenticated: !1,
|
|
2687
2697
|
isLoading: !0,
|
|
@@ -2690,9 +2700,9 @@ function go({ children: t, config: e }) {
|
|
|
2690
2700
|
});
|
|
2691
2701
|
L(() => {
|
|
2692
2702
|
(() => {
|
|
2693
|
-
const u =
|
|
2703
|
+
const u = Kn();
|
|
2694
2704
|
if (u) {
|
|
2695
|
-
|
|
2705
|
+
ft(), n({
|
|
2696
2706
|
isAuthenticated: !1,
|
|
2697
2707
|
isLoading: !1,
|
|
2698
2708
|
user: null,
|
|
@@ -2700,27 +2710,27 @@ function go({ children: t, config: e }) {
|
|
|
2700
2710
|
});
|
|
2701
2711
|
return;
|
|
2702
2712
|
}
|
|
2703
|
-
const h =
|
|
2713
|
+
const h = Vn();
|
|
2704
2714
|
if (h) {
|
|
2705
|
-
const
|
|
2715
|
+
const m = {
|
|
2706
2716
|
token: h.token,
|
|
2707
2717
|
provider: h.provider,
|
|
2708
2718
|
authenticatedAt: Date.now()
|
|
2709
2719
|
};
|
|
2710
|
-
|
|
2720
|
+
Ae(m), ft(), n({
|
|
2711
2721
|
isAuthenticated: !0,
|
|
2712
2722
|
isLoading: !1,
|
|
2713
|
-
user:
|
|
2723
|
+
user: de(m),
|
|
2714
2724
|
error: null
|
|
2715
2725
|
});
|
|
2716
2726
|
return;
|
|
2717
2727
|
}
|
|
2718
|
-
const l =
|
|
2728
|
+
const l = wt();
|
|
2719
2729
|
if (l) {
|
|
2720
2730
|
n({
|
|
2721
2731
|
isAuthenticated: !0,
|
|
2722
2732
|
isLoading: !1,
|
|
2723
|
-
user:
|
|
2733
|
+
user: de(l),
|
|
2724
2734
|
error: null
|
|
2725
2735
|
});
|
|
2726
2736
|
return;
|
|
@@ -2733,7 +2743,7 @@ function go({ children: t, config: e }) {
|
|
|
2733
2743
|
});
|
|
2734
2744
|
})();
|
|
2735
2745
|
}, []);
|
|
2736
|
-
const o =
|
|
2746
|
+
const o = D(
|
|
2737
2747
|
async (f) => {
|
|
2738
2748
|
if (!e.spaceId) {
|
|
2739
2749
|
n((l) => ({
|
|
@@ -2742,20 +2752,20 @@ function go({ children: t, config: e }) {
|
|
|
2742
2752
|
}));
|
|
2743
2753
|
return;
|
|
2744
2754
|
}
|
|
2745
|
-
const u = e.authUrl ??
|
|
2755
|
+
const u = e.authUrl ?? Pe();
|
|
2746
2756
|
if (f === "guest") {
|
|
2747
2757
|
n((l) => ({ ...l, isLoading: !0 }));
|
|
2748
2758
|
try {
|
|
2749
|
-
const l = await
|
|
2759
|
+
const l = await vt(e.spaceId, u);
|
|
2750
2760
|
n({
|
|
2751
2761
|
isAuthenticated: !0,
|
|
2752
2762
|
isLoading: !1,
|
|
2753
|
-
user:
|
|
2763
|
+
user: de(l),
|
|
2754
2764
|
error: null
|
|
2755
2765
|
});
|
|
2756
2766
|
} catch (l) {
|
|
2757
|
-
n((
|
|
2758
|
-
...
|
|
2767
|
+
n((m) => ({
|
|
2768
|
+
...m,
|
|
2759
2769
|
isLoading: !1,
|
|
2760
2770
|
error: l instanceof Error ? l.message : "Guest login failed"
|
|
2761
2771
|
}));
|
|
@@ -2765,43 +2775,43 @@ function go({ children: t, config: e }) {
|
|
|
2765
2775
|
if (f === "passkey") {
|
|
2766
2776
|
n((l) => ({ ...l, isLoading: !0, error: null }));
|
|
2767
2777
|
try {
|
|
2768
|
-
const l = await
|
|
2778
|
+
const l = await qn(u), m = await ro({ optionsJSON: l }), y = await Gn(u, m);
|
|
2769
2779
|
n({
|
|
2770
2780
|
isAuthenticated: !0,
|
|
2771
2781
|
isLoading: !1,
|
|
2772
|
-
user:
|
|
2782
|
+
user: de(y),
|
|
2773
2783
|
error: null
|
|
2774
2784
|
});
|
|
2775
2785
|
} catch (l) {
|
|
2776
|
-
n((
|
|
2777
|
-
...
|
|
2786
|
+
n((m) => ({
|
|
2787
|
+
...m,
|
|
2778
2788
|
isLoading: !1,
|
|
2779
2789
|
error: l instanceof Error ? l.message : "Passkey login failed"
|
|
2780
2790
|
}));
|
|
2781
2791
|
}
|
|
2782
2792
|
return;
|
|
2783
2793
|
}
|
|
2784
|
-
const h =
|
|
2794
|
+
const h = Yn(f, e.spaceId, u);
|
|
2785
2795
|
window.location.href = h;
|
|
2786
2796
|
},
|
|
2787
2797
|
[e.authUrl, e.spaceId]
|
|
2788
|
-
), s =
|
|
2789
|
-
|
|
2798
|
+
), s = D(() => {
|
|
2799
|
+
we(), n({
|
|
2790
2800
|
isAuthenticated: !1,
|
|
2791
2801
|
isLoading: !1,
|
|
2792
2802
|
user: null,
|
|
2793
2803
|
error: null
|
|
2794
2804
|
});
|
|
2795
|
-
}, []), i =
|
|
2805
|
+
}, []), i = D(
|
|
2796
2806
|
async (f) => {
|
|
2797
|
-
const u = e.authUrl ??
|
|
2807
|
+
const u = e.authUrl ?? Pe();
|
|
2798
2808
|
n((h) => ({ ...h, isLoading: !0, error: null }));
|
|
2799
2809
|
try {
|
|
2800
|
-
const h = await
|
|
2810
|
+
const h = await Wn(u), l = await Qn({ optionsJSON: h }), m = await zn(u, l, f);
|
|
2801
2811
|
n({
|
|
2802
2812
|
isAuthenticated: !0,
|
|
2803
2813
|
isLoading: !1,
|
|
2804
|
-
user:
|
|
2814
|
+
user: de(m),
|
|
2805
2815
|
error: null
|
|
2806
2816
|
});
|
|
2807
2817
|
} catch (h) {
|
|
@@ -2813,7 +2823,7 @@ function go({ children: t, config: e }) {
|
|
|
2813
2823
|
}
|
|
2814
2824
|
},
|
|
2815
2825
|
[e.authUrl]
|
|
2816
|
-
), a =
|
|
2826
|
+
), a = D(() => r.user?.token ?? null, [r.user]), c = K(
|
|
2817
2827
|
() => ({
|
|
2818
2828
|
state: r,
|
|
2819
2829
|
login: o,
|
|
@@ -2823,19 +2833,19 @@ function go({ children: t, config: e }) {
|
|
|
2823
2833
|
}),
|
|
2824
2834
|
[r, o, s, a, i]
|
|
2825
2835
|
);
|
|
2826
|
-
return /* @__PURE__ */ A.jsx(
|
|
2836
|
+
return /* @__PURE__ */ A.jsx(We, { value: c, children: t });
|
|
2827
2837
|
}
|
|
2828
|
-
function
|
|
2829
|
-
const t =
|
|
2838
|
+
function no() {
|
|
2839
|
+
const t = Be(We);
|
|
2830
2840
|
if (!t)
|
|
2831
2841
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2832
2842
|
return t;
|
|
2833
2843
|
}
|
|
2834
|
-
function
|
|
2835
|
-
return
|
|
2844
|
+
function oo() {
|
|
2845
|
+
return Be(We);
|
|
2836
2846
|
}
|
|
2837
|
-
function
|
|
2838
|
-
const { config: e, guestUrlParam: r } = t, { state: n, login: o } =
|
|
2847
|
+
function Ao(t) {
|
|
2848
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = no(), s = v(!1);
|
|
2839
2849
|
return L(() => {
|
|
2840
2850
|
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2841
2851
|
return;
|
|
@@ -2852,7 +2862,7 @@ function So(t) {
|
|
|
2852
2862
|
error: n.error
|
|
2853
2863
|
};
|
|
2854
2864
|
}
|
|
2855
|
-
function
|
|
2865
|
+
function ko({
|
|
2856
2866
|
connectionState: t,
|
|
2857
2867
|
error: e,
|
|
2858
2868
|
isReady: r,
|
|
@@ -2891,166 +2901,168 @@ function bo({
|
|
|
2891
2901
|
return null;
|
|
2892
2902
|
}
|
|
2893
2903
|
}
|
|
2894
|
-
const
|
|
2895
|
-
function
|
|
2904
|
+
const ye = Re("useIkonApp");
|
|
2905
|
+
function so() {
|
|
2896
2906
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
2897
2907
|
return window.__IKON_AUTH_CONFIG__;
|
|
2898
2908
|
}
|
|
2899
|
-
function
|
|
2909
|
+
function io() {
|
|
2900
2910
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
2901
2911
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
2902
2912
|
}
|
|
2903
|
-
function
|
|
2904
|
-
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a } = t,
|
|
2905
|
-
|
|
2906
|
-
const [
|
|
2913
|
+
function To(t) {
|
|
2914
|
+
const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: f } = t, u = e === void 0 ? so() ?? null : e, h = io(), l = oo(), m = v(null), y = v(null), b = v(null), p = v(!1), g = v(!1), w = v(o), k = v(n), O = v(s), M = v(i), z = v(a), Q = v(c), T = v(f);
|
|
2915
|
+
w.current = o, k.current = n, O.current = s, M.current = i, z.current = a, Q.current = c, T.current = f;
|
|
2916
|
+
const [_, F] = G("idle"), [j, U] = G(null), [Y, re] = G(null), [J, he] = G(null), [ne, oe] = G(!1), [me, d] = G(0), S = K(() => {
|
|
2907
2917
|
try {
|
|
2908
|
-
const
|
|
2909
|
-
return (
|
|
2918
|
+
const I = Mt();
|
|
2919
|
+
return (I.sessionId || I.channelKey) && jt(), I;
|
|
2910
2920
|
} catch {
|
|
2911
2921
|
return { parameters: {} };
|
|
2912
2922
|
}
|
|
2913
|
-
}, []),
|
|
2923
|
+
}, []), R = K(() => u?.enabled ? wt() : null, [u?.enabled, me]), C = h?.enabled ?? !1, V = h?.host ?? "localhost", B = h?.port ?? 8443;
|
|
2914
2924
|
L(() => {
|
|
2915
|
-
!
|
|
2916
|
-
|
|
2917
|
-
}).catch((
|
|
2918
|
-
|
|
2925
|
+
!C && ze() && u && !u.enabled && u.spaceId && !J && !ne && (oe(!0), vt(u.spaceId, u.authUrl ?? Pe()).then((x) => {
|
|
2926
|
+
he(x.token);
|
|
2927
|
+
}).catch((x) => {
|
|
2928
|
+
ye.error("Anonymous auth failed:", x), U(x instanceof Error ? x.message : "Anonymous auth failed");
|
|
2919
2929
|
}).finally(() => {
|
|
2920
|
-
|
|
2930
|
+
oe(!1);
|
|
2921
2931
|
}));
|
|
2922
|
-
}, [
|
|
2923
|
-
const
|
|
2924
|
-
if (
|
|
2925
|
-
const
|
|
2932
|
+
}, [C, u, J, ne]);
|
|
2933
|
+
const ee = K(() => {
|
|
2934
|
+
if (C) {
|
|
2935
|
+
const I = R?.token ? Lt(R.token) ?? void 0 : void 0;
|
|
2926
2936
|
return {
|
|
2927
2937
|
local: {
|
|
2928
|
-
host:
|
|
2929
|
-
httpsPort:
|
|
2930
|
-
userId:
|
|
2931
|
-
token:
|
|
2932
|
-
spaceId:
|
|
2933
|
-
parameters:
|
|
2938
|
+
host: V,
|
|
2939
|
+
httpsPort: B,
|
|
2940
|
+
userId: I,
|
|
2941
|
+
token: R?.token ?? void 0,
|
|
2942
|
+
spaceId: u?.spaceId,
|
|
2943
|
+
parameters: S.parameters
|
|
2934
2944
|
}
|
|
2935
2945
|
};
|
|
2936
2946
|
}
|
|
2937
|
-
return
|
|
2947
|
+
return R?.token && u?.spaceId ? {
|
|
2938
2948
|
sessionToken: {
|
|
2939
|
-
token:
|
|
2940
|
-
spaceId:
|
|
2941
|
-
backendType:
|
|
2942
|
-
sessionId:
|
|
2943
|
-
channelKey:
|
|
2944
|
-
parameters:
|
|
2949
|
+
token: R.token,
|
|
2950
|
+
spaceId: u.spaceId,
|
|
2951
|
+
backendType: qe(),
|
|
2952
|
+
sessionId: S.sessionId,
|
|
2953
|
+
channelKey: S.channelKey,
|
|
2954
|
+
parameters: S.parameters
|
|
2945
2955
|
}
|
|
2946
|
-
} :
|
|
2956
|
+
} : J && u?.spaceId ? {
|
|
2947
2957
|
sessionToken: {
|
|
2948
|
-
token:
|
|
2949
|
-
spaceId:
|
|
2950
|
-
backendType:
|
|
2951
|
-
sessionId:
|
|
2952
|
-
channelKey:
|
|
2953
|
-
parameters:
|
|
2958
|
+
token: J,
|
|
2959
|
+
spaceId: u.spaceId,
|
|
2960
|
+
backendType: qe(),
|
|
2961
|
+
sessionId: S.sessionId,
|
|
2962
|
+
channelKey: S.channelKey,
|
|
2963
|
+
parameters: S.parameters
|
|
2954
2964
|
}
|
|
2955
|
-
} :
|
|
2965
|
+
} : ze() ? null : {
|
|
2956
2966
|
local: {
|
|
2957
|
-
host:
|
|
2958
|
-
httpsPort:
|
|
2959
|
-
spaceId:
|
|
2960
|
-
parameters:
|
|
2967
|
+
host: V,
|
|
2968
|
+
httpsPort: B,
|
|
2969
|
+
spaceId: u?.spaceId,
|
|
2970
|
+
parameters: S.parameters
|
|
2961
2971
|
}
|
|
2962
2972
|
};
|
|
2963
|
-
}, [
|
|
2964
|
-
|
|
2965
|
-
const
|
|
2973
|
+
}, [C, V, B, R?.token, u?.spaceId, J, S.sessionId, S.channelKey, S.parameters]);
|
|
2974
|
+
Hr(Y);
|
|
2975
|
+
const se = Xr(Y);
|
|
2966
2976
|
L(() => {
|
|
2967
|
-
if (!
|
|
2968
|
-
if (
|
|
2969
|
-
for (const
|
|
2970
|
-
b
|
|
2971
|
-
|
|
2972
|
-
|
|
2977
|
+
if (!p.current) {
|
|
2978
|
+
if (p.current = !0, b.current = $r(), r)
|
|
2979
|
+
for (const I of r)
|
|
2980
|
+
I(b.current);
|
|
2981
|
+
b.current.loadRegisteredModules().catch((I) => {
|
|
2982
|
+
ye.error("Failed to load UI modules", I);
|
|
2973
2983
|
});
|
|
2974
2984
|
}
|
|
2975
2985
|
}, []), L(() => {
|
|
2976
|
-
if (!
|
|
2977
|
-
const
|
|
2978
|
-
...
|
|
2979
|
-
timeouts:
|
|
2980
|
-
audio:
|
|
2981
|
-
enabled:
|
|
2982
|
-
...
|
|
2986
|
+
if (!ee) return;
|
|
2987
|
+
const I = new Ut({
|
|
2988
|
+
...ee,
|
|
2989
|
+
timeouts: k.current,
|
|
2990
|
+
audio: M.current !== void 0 || w.current ? {
|
|
2991
|
+
enabled: M.current,
|
|
2992
|
+
...w.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
2983
2993
|
} : void 0,
|
|
2984
|
-
video:
|
|
2994
|
+
video: z.current !== void 0 ? { enabled: z.current } : void 0,
|
|
2985
2995
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
2986
|
-
webRtc:
|
|
2987
|
-
|
|
2988
|
-
|
|
2996
|
+
webRtc: O.current ? { enabled: !0 } : void 0,
|
|
2997
|
+
websocket: Q.current,
|
|
2998
|
+
webtransport: T.current,
|
|
2999
|
+
onConnectionStateChange: (Z) => {
|
|
3000
|
+
F(Z);
|
|
2989
3001
|
},
|
|
2990
|
-
onError: (
|
|
2991
|
-
|
|
3002
|
+
onError: (Z) => {
|
|
3003
|
+
U(Z.message);
|
|
2992
3004
|
}
|
|
2993
3005
|
});
|
|
2994
|
-
|
|
2995
|
-
const
|
|
2996
|
-
return
|
|
2997
|
-
|
|
3006
|
+
m.current = I;
|
|
3007
|
+
const x = new rr({ client: I });
|
|
3008
|
+
return y.current = x, re(x), I.connect().catch((Z) => {
|
|
3009
|
+
ye.error("Connection failed:", Z), Z instanceof xt && !g.current && (g.current = !0, ye.warn("Auth session appears stale, clearing and retrying"), l ? l.logout() : (we(), d((Ct) => Ct + 1)));
|
|
2998
3010
|
}), () => {
|
|
2999
|
-
|
|
3011
|
+
I.disconnect(), m.current = null, x.dispose(), y.current = null;
|
|
3000
3012
|
};
|
|
3001
|
-
}, [
|
|
3002
|
-
const
|
|
3003
|
-
const
|
|
3004
|
-
|
|
3005
|
-
}, []),
|
|
3013
|
+
}, [ee]);
|
|
3014
|
+
const N = D((I, x) => {
|
|
3015
|
+
const Z = typeof x == "string" ? x : JSON.stringify(x ?? {});
|
|
3016
|
+
m.current?.sendActionCall(I, Z);
|
|
3017
|
+
}, []), X = _ === "connected" || _ === "reconnecting";
|
|
3006
3018
|
return {
|
|
3007
|
-
connectionState:
|
|
3008
|
-
error:
|
|
3009
|
-
stores:
|
|
3010
|
-
client:
|
|
3011
|
-
registry:
|
|
3012
|
-
clientRef:
|
|
3013
|
-
uiRef:
|
|
3014
|
-
registryRef:
|
|
3015
|
-
onAction:
|
|
3016
|
-
isReady:
|
|
3017
|
-
webRtcVideoStreams:
|
|
3018
|
-
webRtcTrackMap:
|
|
3019
|
+
connectionState: _,
|
|
3020
|
+
error: j,
|
|
3021
|
+
stores: se,
|
|
3022
|
+
client: m.current,
|
|
3023
|
+
registry: b.current,
|
|
3024
|
+
clientRef: m,
|
|
3025
|
+
uiRef: y,
|
|
3026
|
+
registryRef: b,
|
|
3027
|
+
onAction: N,
|
|
3028
|
+
isReady: X,
|
|
3029
|
+
webRtcVideoStreams: m.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3030
|
+
webRtcTrackMap: m.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3019
3031
|
};
|
|
3020
3032
|
}
|
|
3021
|
-
function
|
|
3022
|
-
const e =
|
|
3023
|
-
return
|
|
3033
|
+
function Co(t) {
|
|
3034
|
+
const e = v(!1);
|
|
3035
|
+
return D(() => {
|
|
3024
3036
|
if (e.current) return;
|
|
3025
3037
|
e.current = !0;
|
|
3026
3038
|
const r = document.createElement("link");
|
|
3027
3039
|
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
3028
3040
|
}, [t]);
|
|
3029
3041
|
}
|
|
3030
|
-
let
|
|
3031
|
-
function
|
|
3032
|
-
const [r, n] = G([]), o =
|
|
3042
|
+
let ao = 0;
|
|
3043
|
+
function Io(t = 5, e = 5e3) {
|
|
3044
|
+
const [r, n] = G([]), o = v(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3033
3045
|
const a = o.current.get(i);
|
|
3034
3046
|
a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
|
|
3035
3047
|
}, []);
|
|
3036
3048
|
return L(() => {
|
|
3037
|
-
const i = o.current, a =
|
|
3049
|
+
const i = o.current, a = Dt(
|
|
3038
3050
|
(c) => {
|
|
3039
|
-
if (!
|
|
3051
|
+
if (!Ft())
|
|
3040
3052
|
return;
|
|
3041
|
-
const f = `toast-${++
|
|
3053
|
+
const f = `toast-${++ao}`, u = c.level === Ge.ERROR ? "error" : "warn", h = {
|
|
3042
3054
|
id: f,
|
|
3043
3055
|
level: u,
|
|
3044
3056
|
message: c.message,
|
|
3045
3057
|
component: c.component
|
|
3046
3058
|
};
|
|
3047
|
-
n((
|
|
3059
|
+
n((m) => [...m, h].slice(-t));
|
|
3048
3060
|
const l = setTimeout(() => {
|
|
3049
3061
|
s(f);
|
|
3050
3062
|
}, e);
|
|
3051
3063
|
i.set(f, l);
|
|
3052
3064
|
},
|
|
3053
|
-
{ minLevel:
|
|
3065
|
+
{ minLevel: Ge.WARN }
|
|
3054
3066
|
);
|
|
3055
3067
|
return () => {
|
|
3056
3068
|
a();
|
|
@@ -3060,100 +3072,100 @@ function Ro(t = 5, e = 5e3) {
|
|
|
3060
3072
|
};
|
|
3061
3073
|
}, [t, e, s]), { toasts: r, dismissToast: s };
|
|
3062
3074
|
}
|
|
3063
|
-
const
|
|
3064
|
-
function
|
|
3075
|
+
const Tt = ht(null);
|
|
3076
|
+
function co(t, e) {
|
|
3065
3077
|
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
3066
3078
|
}
|
|
3067
|
-
function
|
|
3068
|
-
const
|
|
3069
|
-
if (
|
|
3070
|
-
return
|
|
3071
|
-
const
|
|
3072
|
-
return t.includes(
|
|
3079
|
+
function uo(t, e) {
|
|
3080
|
+
const r = Bt();
|
|
3081
|
+
if (r && t.includes(r))
|
|
3082
|
+
return r;
|
|
3083
|
+
const n = navigator.language.split("-")[0];
|
|
3084
|
+
return t.includes(n) ? n : e && t.includes(e) ? e : "en";
|
|
3073
3085
|
}
|
|
3074
|
-
function
|
|
3075
|
-
return e ?
|
|
3086
|
+
function lo(t, e, r) {
|
|
3087
|
+
return e ? uo(t, r) : r && t.includes(r) ? r : "en";
|
|
3076
3088
|
}
|
|
3077
|
-
function
|
|
3089
|
+
function Oo({
|
|
3078
3090
|
children: t,
|
|
3079
3091
|
translations: e,
|
|
3080
3092
|
defaultLanguage: r,
|
|
3081
3093
|
detectLanguage: n = !1
|
|
3082
3094
|
}) {
|
|
3083
|
-
const o = Object.keys(e), s =
|
|
3095
|
+
const o = Object.keys(e), s = lo(o, n, r), i = e[s] ?? e.en, a = K(
|
|
3084
3096
|
() => ({
|
|
3085
3097
|
t: (c, f) => {
|
|
3086
3098
|
const u = i[c];
|
|
3087
|
-
return
|
|
3099
|
+
return co(u, f);
|
|
3088
3100
|
},
|
|
3089
3101
|
locale: s,
|
|
3090
3102
|
translations: i
|
|
3091
3103
|
}),
|
|
3092
3104
|
[i, s]
|
|
3093
3105
|
);
|
|
3094
|
-
return /* @__PURE__ */ A.jsx(
|
|
3106
|
+
return /* @__PURE__ */ A.jsx(Tt, { value: a, children: t });
|
|
3095
3107
|
}
|
|
3096
|
-
function
|
|
3097
|
-
const t =
|
|
3108
|
+
function _o() {
|
|
3109
|
+
const t = Be(Tt);
|
|
3098
3110
|
if (!t)
|
|
3099
3111
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3100
3112
|
return t;
|
|
3101
3113
|
}
|
|
3102
3114
|
export {
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3115
|
+
Eo as AuthProvider,
|
|
3116
|
+
ko as ConnectionStateRenderer,
|
|
3117
|
+
Oo as I18nProvider,
|
|
3118
|
+
lr as IKON_UI_BASE_MODULE,
|
|
3119
|
+
Rr as IKON_UI_MEDIA_MODULE,
|
|
3120
|
+
xr as IKON_UI_SHADERTOY_MODULE,
|
|
3121
|
+
Lr as IKON_UI_SHADERTOY_TYPE,
|
|
3122
|
+
je as IKON_UI_STREAM_CATEGORY,
|
|
3123
|
+
yr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3124
|
+
Sr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3125
|
+
rr as IkonUi,
|
|
3126
|
+
Br as IkonUiRegistry,
|
|
3127
|
+
yo as IkonUiSurface,
|
|
3128
|
+
er as UiComponentRegistry,
|
|
3129
|
+
Qt as UiRenderer,
|
|
3130
|
+
Mo as UiStreamStore,
|
|
3131
|
+
So as areIkonUiModuleListsEqual,
|
|
3132
|
+
vt as authenticateAnonymous,
|
|
3133
|
+
Yn as buildOAuthRedirectUrl,
|
|
3134
|
+
we as clearAuthSession,
|
|
3135
|
+
ft as clearOAuthParams,
|
|
3136
|
+
ur as createBaseResolvers,
|
|
3137
|
+
po as createComponentLibrary,
|
|
3138
|
+
$r as createIkonUiRegistry,
|
|
3139
|
+
wr as createMediaResolvers,
|
|
3140
|
+
Ur as createShadertoyRendererResolver,
|
|
3141
|
+
tr as isIkonUiCategoryMatch,
|
|
3142
|
+
wt as loadAuthSession,
|
|
3143
|
+
dr as loadBaseModule,
|
|
3144
|
+
Er as loadMediaModule,
|
|
3145
|
+
Dr as loadShadertoyModule,
|
|
3146
|
+
pn as normalizeIkonUiModuleList,
|
|
3147
|
+
wo as parseIkonUiInitPayload,
|
|
3148
|
+
Vn as parseOAuthCallback,
|
|
3149
|
+
Kn as parseOAuthError,
|
|
3150
|
+
gn as readIkonUiModules,
|
|
3151
|
+
bo as readIkonUiModulesFromSources,
|
|
3152
|
+
fr as registerBaseModule,
|
|
3153
|
+
Ar as registerMediaModule,
|
|
3154
|
+
Fr as registerShadertoyModule,
|
|
3155
|
+
Xt as renderChildren,
|
|
3156
|
+
vo as renderMotionLetters,
|
|
3157
|
+
Ae as saveAuthSession,
|
|
3158
|
+
Ro as sendMagicLink,
|
|
3159
|
+
de as sessionToUser,
|
|
3160
|
+
no as useAuth,
|
|
3161
|
+
Ao as useAuthGuard,
|
|
3162
|
+
oo as useAuthOptional,
|
|
3163
|
+
_o as useI18n,
|
|
3164
|
+
To as useIkonApp,
|
|
3165
|
+
Hr as useIkonStyles,
|
|
3166
|
+
Xr as useIkonUiStores,
|
|
3167
|
+
Co as useLazyFont,
|
|
3168
|
+
Io as useToasts,
|
|
3169
|
+
H as useUiNode,
|
|
3170
|
+
go as useUiStore
|
|
3159
3171
|
};
|