@ikonai/sdk-react-ui 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/index.js +1463 -1099
- package/package.json +1 -1
- package/shader/shader-gl.d.ts +33 -0
- package/shader/shader-module.d.ts +7 -0
- package/shader/shader-renderer.d.ts +3 -0
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 kt, UiStreamStore as Tt } from "@ikonai/sdk-ui";
|
|
2
|
+
import { UiStreamStore as po } from "@ikonai/sdk-ui";
|
|
3
|
+
import Ct, { useSyncExternalStore as $e, useMemo as z, memo as Y, useRef as w, useCallback as B, Fragment as It, useEffect as F, useState as ee, createContext as lt, use as Be } from "react";
|
|
4
|
+
import { createLogger as Re, getOrCreateDeviceId as Se, deriveAuthUrl as je, parseUrlParams as Nt, isCloudEnvironment as Ye, extractUserIdFromToken as Ot, deriveBackendType as We, IkonClient as _t } from "@ikonai/sdk";
|
|
5
|
+
var ye = { exports: {} }, ae = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -14,10 +14,10 @@ var ge = { exports: {} }, ne = {};
|
|
|
14
14
|
*/
|
|
15
15
|
var qe;
|
|
16
16
|
function Pt() {
|
|
17
|
-
if (qe) return
|
|
17
|
+
if (qe) return ae;
|
|
18
18
|
qe = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
20
|
-
function n
|
|
20
|
+
function r(n, o, s) {
|
|
21
21
|
var i = null;
|
|
22
22
|
if (s !== void 0 && (i = "" + s), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
23
23
|
s = {};
|
|
@@ -26,15 +26,15 @@ function Pt() {
|
|
|
26
26
|
} else s = o;
|
|
27
27
|
return o = s.ref, {
|
|
28
28
|
$$typeof: t,
|
|
29
|
-
type:
|
|
29
|
+
type: n,
|
|
30
30
|
key: i,
|
|
31
31
|
ref: o !== void 0 ? o : null,
|
|
32
32
|
props: s
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ae.Fragment = e, ae.jsx = r, ae.jsxs = r, ae;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ce = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -45,25 +45,25 @@ var re = {};
|
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
47
|
var Je;
|
|
48
|
-
function
|
|
48
|
+
function jt() {
|
|
49
49
|
return Je || (Je = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(u) {
|
|
51
51
|
if (u == null) return null;
|
|
52
52
|
if (typeof u == "function")
|
|
53
|
-
return u.$$typeof ===
|
|
53
|
+
return u.$$typeof === M ? null : u.displayName || u.name || null;
|
|
54
54
|
if (typeof u == "string") return u;
|
|
55
55
|
switch (u) {
|
|
56
|
-
case
|
|
56
|
+
case b:
|
|
57
57
|
return "Fragment";
|
|
58
|
-
case
|
|
58
|
+
case p:
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case m:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case V:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case G:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case C:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
69
|
if (typeof u == "object")
|
|
@@ -72,19 +72,19 @@ function _t() {
|
|
|
72
72
|
), u.$$typeof) {
|
|
73
73
|
case S:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case
|
|
75
|
+
case P:
|
|
76
76
|
return (u.displayName || "Context") + ".Provider";
|
|
77
|
-
case
|
|
77
|
+
case A:
|
|
78
78
|
return (u._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return u = u.displayName, u || (u =
|
|
82
|
-
case le:
|
|
83
|
-
return p = u.displayName || null, p !== null ? p : t(u.type) || "Memo";
|
|
79
|
+
case j:
|
|
80
|
+
var g = u.render;
|
|
81
|
+
return u = u.displayName, u || (u = g.displayName || g.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
|
|
84
82
|
case Z:
|
|
85
|
-
|
|
83
|
+
return g = u.displayName || null, g !== null ? g : t(u.type) || "Memo";
|
|
84
|
+
case k:
|
|
85
|
+
g = u._payload, u = u._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(u(
|
|
87
|
+
return t(u(g));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -93,57 +93,57 @@ function _t() {
|
|
|
93
93
|
function e(u) {
|
|
94
94
|
return "" + u;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function r(u) {
|
|
97
97
|
try {
|
|
98
98
|
e(u);
|
|
99
|
-
var
|
|
99
|
+
var g = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
g = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (g) {
|
|
104
|
+
g = console;
|
|
105
|
+
var E = g.error, T = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
|
|
106
|
+
return E.call(
|
|
107
|
+
g,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
109
|
+
T
|
|
110
110
|
), e(u);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (u ===
|
|
115
|
-
if (typeof u == "object" && u !== null && u.$$typeof ===
|
|
113
|
+
function n(u) {
|
|
114
|
+
if (u === b) return "<>";
|
|
115
|
+
if (typeof u == "object" && u !== null && u.$$typeof === k)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var g = t(u);
|
|
119
|
+
return g ? "<" + g + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
function o() {
|
|
125
|
-
var u =
|
|
125
|
+
var u = I.A;
|
|
126
126
|
return u === null ? null : u.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function s() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
131
|
function i(u) {
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
132
|
+
if (L.call(u, "key")) {
|
|
133
|
+
var g = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
134
|
+
if (g && g.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return u.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function a(u,
|
|
139
|
-
function
|
|
140
|
-
|
|
138
|
+
function a(u, g) {
|
|
139
|
+
function E() {
|
|
140
|
+
oe || (oe = !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
|
+
g
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
145
|
+
E.isReactWarning = !0, Object.defineProperty(u, "key", {
|
|
146
|
+
get: E,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
@@ -153,14 +153,14 @@ function _t() {
|
|
|
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
|
)), u = this.props.ref, u !== void 0 ? u : null;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
158
|
-
$$typeof:
|
|
156
|
+
function f(u, g, E, T, K, x, Q, ie) {
|
|
157
|
+
return E = x.ref, u = {
|
|
158
|
+
$$typeof: y,
|
|
159
159
|
type: u,
|
|
160
|
-
key:
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
160
|
+
key: g,
|
|
161
|
+
props: x,
|
|
162
|
+
_owner: K
|
|
163
|
+
}, (E !== void 0 ? E : null) !== null ? Object.defineProperty(u, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
get: c
|
|
166
166
|
}) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
|
|
@@ -177,141 +177,141 @@ function _t() {
|
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
180
|
+
value: Q
|
|
181
181
|
}), Object.defineProperty(u, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
184
184
|
writable: !0,
|
|
185
|
-
value:
|
|
185
|
+
value: ie
|
|
186
186
|
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
187
187
|
}
|
|
188
|
-
function l(u,
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
193
|
-
for (
|
|
194
|
-
h(T
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function l(u, g, E, T, K, x, Q, ie) {
|
|
189
|
+
var N = g.children;
|
|
190
|
+
if (N !== void 0)
|
|
191
|
+
if (T)
|
|
192
|
+
if (W(N)) {
|
|
193
|
+
for (T = 0; T < N.length; T++)
|
|
194
|
+
h(N[T]);
|
|
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 (
|
|
202
|
-
|
|
203
|
-
var
|
|
204
|
-
return
|
|
200
|
+
else h(N);
|
|
201
|
+
if (L.call(g, "key")) {
|
|
202
|
+
N = t(u);
|
|
203
|
+
var X = Object.keys(g).filter(function(U) {
|
|
204
|
+
return U !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
T = 0 < X.length ? "{key: someKey, " + X.join(": ..., ") + ": ...}" : "{key: someKey}", se[N + T] || (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
|
-
k,
|
|
214
213
|
T,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
N,
|
|
215
|
+
X,
|
|
216
|
+
N
|
|
217
|
+
), se[N + T] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
219
|
+
if (N = null, E !== void 0 && (r(E), N = "" + E), i(g) && (r(g.key), N = "" + g.key), "key" in g) {
|
|
220
|
+
E = {};
|
|
221
|
+
for (var O in g)
|
|
222
|
+
O !== "key" && (E[O] = g[O]);
|
|
223
|
+
} else E = g;
|
|
224
|
+
return N && a(
|
|
225
|
+
E,
|
|
226
226
|
typeof u == "function" ? u.displayName || u.name || "Unknown" : u
|
|
227
|
-
),
|
|
227
|
+
), f(
|
|
228
228
|
u,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
N,
|
|
230
|
+
x,
|
|
231
|
+
K,
|
|
232
232
|
o(),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
E,
|
|
234
|
+
Q,
|
|
235
|
+
ie
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function h(u) {
|
|
239
|
-
typeof u == "object" && u !== null && u.$$typeof ===
|
|
239
|
+
typeof u == "object" && u !== null && u.$$typeof === y && u._store && (u._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var d = Ct, y = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), P = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), M = Symbol.for("react.client.reference"), I = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, W = Array.isArray, te = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
d = {
|
|
245
245
|
"react-stack-bottom-frame": function(u) {
|
|
246
246
|
return u();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
249
|
+
var oe, pe = {}, H = d["react-stack-bottom-frame"].bind(
|
|
250
|
+
d,
|
|
251
251
|
s
|
|
252
|
-
)(),
|
|
253
|
-
|
|
254
|
-
var
|
|
252
|
+
)(), ge = te(n(s)), se = {};
|
|
253
|
+
ce.Fragment = b, ce.jsx = function(u, g, E, T, K) {
|
|
254
|
+
var x = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return l(
|
|
256
256
|
u,
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
g,
|
|
258
|
+
E,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
T,
|
|
261
|
+
K,
|
|
262
|
+
x ? Error("react-stack-top-frame") : H,
|
|
263
|
+
x ? te(n(u)) : ge
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
265
|
+
}, ce.jsxs = function(u, g, E, T, K) {
|
|
266
|
+
var x = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return l(
|
|
268
268
|
u,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
g,
|
|
270
|
+
E,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
T,
|
|
273
|
+
K,
|
|
274
|
+
x ? Error("react-stack-top-frame") : H,
|
|
275
|
+
x ? te(n(u)) : ge
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ce;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var Ge;
|
|
281
|
+
function Mt() {
|
|
282
|
+
return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? ye.exports = Pt() : ye.exports = jt()), ye.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
(
|
|
284
|
+
var R = Mt();
|
|
285
|
+
function Ut(t, e) {
|
|
286
|
+
const r = $e(
|
|
287
|
+
(n) => t.subscribe(n),
|
|
288
288
|
() => {
|
|
289
|
-
const
|
|
289
|
+
const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
|
|
290
290
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
291
291
|
},
|
|
292
292
|
() => {
|
|
293
|
-
const
|
|
293
|
+
const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
|
|
294
294
|
return `${o ?? ""}:${s?.id ?? ""}`;
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
return
|
|
298
|
-
const [
|
|
297
|
+
return z(() => {
|
|
298
|
+
const [n, o] = r.split(":");
|
|
299
299
|
return {
|
|
300
|
-
rootViewId:
|
|
300
|
+
rootViewId: n || void 0,
|
|
301
301
|
rootNodeId: o || void 0
|
|
302
302
|
};
|
|
303
|
-
}, [
|
|
303
|
+
}, [r]);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const
|
|
307
|
-
(
|
|
305
|
+
function J(t, e) {
|
|
306
|
+
const r = $e(
|
|
307
|
+
(n) => t.subscribeNode(e, n),
|
|
308
308
|
() => t.getNodeVersion(e),
|
|
309
309
|
() => t.getNodeVersion(e)
|
|
310
310
|
);
|
|
311
|
-
return
|
|
311
|
+
return z(() => t.getNode(e), [t, e, r]);
|
|
312
312
|
}
|
|
313
|
-
const Lt =
|
|
314
|
-
function
|
|
313
|
+
const Lt = Re("UIRenderer");
|
|
314
|
+
function xt(t) {
|
|
315
315
|
if (t === void 0)
|
|
316
316
|
return "{}";
|
|
317
317
|
if (typeof t == "string")
|
|
@@ -322,93 +322,93 @@ function Ut(t) {
|
|
|
322
322
|
return "{}";
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function Dt(t) {
|
|
326
326
|
const e = t.styleIds;
|
|
327
327
|
return Array.isArray(e) ? e : [];
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function Ft(t) {
|
|
330
330
|
const e = t.children;
|
|
331
331
|
return Array.isArray(e) ? e : [];
|
|
332
332
|
}
|
|
333
333
|
function $t(t, e) {
|
|
334
334
|
return t.nodeId === e.nodeId && t.context === e.context;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Bt(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;
|
|
340
|
-
for (let
|
|
341
|
-
e += "," + t[
|
|
340
|
+
for (let r = 1; r < t.length; r++)
|
|
341
|
+
e += "," + t[r].id;
|
|
342
342
|
return e;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
const
|
|
346
|
-
() => o.length === 0 ? null : o.map((h) => /* @__PURE__ */
|
|
344
|
+
const Me = Y(function t({ nodeId: e, context: r }) {
|
|
345
|
+
const n = J(r.store, e), o = n ? Ft(n) : [], s = Bt(o), i = z(
|
|
346
|
+
() => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ R.jsx(t, { nodeId: h.id, context: r }, h.id)),
|
|
347
347
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
348
|
-
[s,
|
|
348
|
+
[s, r]
|
|
349
349
|
);
|
|
350
|
-
if (!
|
|
350
|
+
if (!n)
|
|
351
351
|
return null;
|
|
352
|
-
if (
|
|
353
|
-
return /* @__PURE__ */
|
|
354
|
-
const a =
|
|
352
|
+
if (n.type === "root")
|
|
353
|
+
return /* @__PURE__ */ R.jsx(It, { children: i }, n.id);
|
|
354
|
+
const a = r.library.resolve(n);
|
|
355
355
|
if (!a)
|
|
356
|
-
return Lt.warn(`No renderer for node type ${
|
|
357
|
-
const c =
|
|
358
|
-
return /* @__PURE__ */
|
|
356
|
+
return Lt.warn(`No renderer for node type ${n.type}`), null;
|
|
357
|
+
const c = Dt(n), f = c.length > 0 ? c.join(" ") : void 0, l = a;
|
|
358
|
+
return /* @__PURE__ */ R.jsx(l, { nodeId: e, context: r, className: f });
|
|
359
359
|
}, $t);
|
|
360
|
-
function Bt(t, e) {
|
|
361
|
-
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ E.jsx(je, { nodeId: n.id, context: e }, n.id));
|
|
362
|
-
}
|
|
363
360
|
function Vt(t, e) {
|
|
361
|
+
return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(Me, { nodeId: r.id, context: e }, r.id));
|
|
362
|
+
}
|
|
363
|
+
function Kt(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:
|
|
366
|
+
const zt = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
367
|
+
const { rootViewId: c, rootNodeId: f } = Ut(e, n), l = w(s);
|
|
368
368
|
l.current = s;
|
|
369
|
-
const h =
|
|
369
|
+
const h = w(i);
|
|
370
370
|
h.current = i;
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
371
|
+
const d = w(a);
|
|
372
|
+
d.current = a;
|
|
373
|
+
const y = B((b, m) => {
|
|
374
|
+
if (!b)
|
|
375
375
|
return;
|
|
376
|
-
const
|
|
377
|
-
l.current?.(
|
|
378
|
-
}, []), S =
|
|
379
|
-
const
|
|
376
|
+
const p = xt(m);
|
|
377
|
+
l.current?.(b, p);
|
|
378
|
+
}, []), S = z(() => {
|
|
379
|
+
const b = {
|
|
380
380
|
store: e,
|
|
381
|
-
library:
|
|
381
|
+
library: r,
|
|
382
382
|
handlerCache: e.handlerCache,
|
|
383
383
|
// Access payloads from store at call time, not captured snapshot
|
|
384
384
|
getPayload: (m) => e.getSnapshot().payloads.get(m),
|
|
385
|
-
renderChildren: (m) =>
|
|
385
|
+
renderChildren: (m) => Vt(m, b),
|
|
386
386
|
renderView: (m) => {
|
|
387
|
-
const
|
|
388
|
-
return
|
|
387
|
+
const p = e.getSnapshot().views.get(m);
|
|
388
|
+
return p ? /* @__PURE__ */ R.jsx(Me, { nodeId: p.id, context: b }) : null;
|
|
389
389
|
},
|
|
390
|
-
dispatchAction:
|
|
390
|
+
dispatchAction: y,
|
|
391
391
|
// Access client/video via refs to avoid context recreation
|
|
392
392
|
get client() {
|
|
393
393
|
return h.current;
|
|
394
394
|
},
|
|
395
395
|
get video() {
|
|
396
|
-
return
|
|
396
|
+
return d.current;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
|
-
return
|
|
400
|
-
}, [e,
|
|
401
|
-
return !c || !
|
|
402
|
-
},
|
|
403
|
-
class
|
|
404
|
-
constructor(e,
|
|
405
|
-
if (this.fallback =
|
|
406
|
-
for (const [
|
|
407
|
-
this.renderers.set(
|
|
399
|
+
return b;
|
|
400
|
+
}, [e, r, y]);
|
|
401
|
+
return !c || !f ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(Me, { nodeId: f, context: S }) });
|
|
402
|
+
}, Kt);
|
|
403
|
+
class Yt {
|
|
404
|
+
constructor(e, r) {
|
|
405
|
+
if (this.fallback = r, e)
|
|
406
|
+
for (const [n, o] of e)
|
|
407
|
+
this.renderers.set(n, o);
|
|
408
408
|
}
|
|
409
409
|
renderers = /* @__PURE__ */ new Map();
|
|
410
|
-
register(e,
|
|
411
|
-
this.renderers.set(e,
|
|
410
|
+
register(e, r) {
|
|
411
|
+
this.renderers.set(e, r);
|
|
412
412
|
}
|
|
413
413
|
setFallback(e) {
|
|
414
414
|
this.fallback = e;
|
|
@@ -417,39 +417,39 @@ class zt {
|
|
|
417
417
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
const
|
|
422
|
-
return new
|
|
420
|
+
function Hn(t, e) {
|
|
421
|
+
const r = Object.entries(t);
|
|
422
|
+
return new Yt(r, e);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function Xn(t) {
|
|
425
425
|
return $e(
|
|
426
426
|
(e) => t.subscribe(e),
|
|
427
427
|
() => t.getSnapshot(),
|
|
428
428
|
() => t.getSnapshot()
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const
|
|
431
|
+
const Ue = "ikon-ui";
|
|
432
432
|
function Wt(t, e) {
|
|
433
433
|
return t === e;
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
const i =
|
|
435
|
+
const Zn = Y(function({ stores: e, registry: r, category: n = Ue, onAction: o, client: s }) {
|
|
436
|
+
const i = z(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
|
|
437
437
|
a.current = o;
|
|
438
|
-
const c =
|
|
438
|
+
const c = w(s);
|
|
439
439
|
c.current = s;
|
|
440
|
-
const
|
|
440
|
+
const f = z(
|
|
441
441
|
() => {
|
|
442
442
|
const l = [];
|
|
443
|
-
for (const [h,
|
|
444
|
-
const
|
|
445
|
-
Wt(
|
|
443
|
+
for (const [h, d] of e) {
|
|
444
|
+
const y = d.store.getSnapshot();
|
|
445
|
+
Wt(d.category, n) && (!y.rootViewId || !y.views.has(y.rootViewId) || l.push({ key: h, store: d.store }));
|
|
446
446
|
}
|
|
447
447
|
return l;
|
|
448
448
|
},
|
|
449
449
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
450
|
-
[e,
|
|
450
|
+
[e, n, i]
|
|
451
451
|
);
|
|
452
|
-
return
|
|
452
|
+
return f.length === 0 ? null : /* @__PURE__ */ R.jsx(R.Fragment, { children: f.map(({ key: l, store: h }) => /* @__PURE__ */ R.jsx(zt, { store: h, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, l)) });
|
|
453
453
|
});
|
|
454
454
|
class qt {
|
|
455
455
|
core;
|
|
@@ -459,7 +459,7 @@ class qt {
|
|
|
459
459
|
unsubscribeClears;
|
|
460
460
|
unsubscribeStoreChanges;
|
|
461
461
|
constructor(e) {
|
|
462
|
-
this.core = e?.core ?? new
|
|
462
|
+
this.core = e?.core ?? new kt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
|
|
463
463
|
}
|
|
464
464
|
dispose() {
|
|
465
465
|
this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
|
|
@@ -485,82 +485,82 @@ class qt {
|
|
|
485
485
|
this.stores.delete(e) && this.notify(e);
|
|
486
486
|
};
|
|
487
487
|
syncStreamSnapshot = (e) => {
|
|
488
|
-
const
|
|
489
|
-
if (!
|
|
488
|
+
const r = this.core.uiStore.getSnapshot(e);
|
|
489
|
+
if (!r || !r.rootViewId) {
|
|
490
490
|
this.handleUiStreamCleared(e);
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
493
|
-
if (!
|
|
493
|
+
if (!r.views.get(r.rootViewId)) {
|
|
494
494
|
this.handleUiStreamCleared(e);
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
|
-
const s = this.ensureStoreEntry(e).store.replaceSnapshot(
|
|
497
|
+
const s = this.ensureStoreEntry(e).store.replaceSnapshot(r), i = this.updateCategory(e, r.category);
|
|
498
498
|
(s || i) && this.notify(e);
|
|
499
499
|
};
|
|
500
500
|
syncAllStreams() {
|
|
501
|
-
const e = this.core.uiStore.getSnapshots(),
|
|
502
|
-
for (const
|
|
503
|
-
this.syncStreamSnapshot(
|
|
504
|
-
for (const
|
|
505
|
-
|
|
501
|
+
const e = this.core.uiStore.getSnapshots(), r = /* @__PURE__ */ new Set();
|
|
502
|
+
for (const n of e)
|
|
503
|
+
this.syncStreamSnapshot(n.streamId), r.add(n.streamId);
|
|
504
|
+
for (const n of this.stores.keys())
|
|
505
|
+
r.has(n) || (this.stores.delete(n), this.notify(n));
|
|
506
506
|
}
|
|
507
507
|
ensureStoreEntry(e) {
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
510
|
-
return
|
|
511
|
-
const
|
|
512
|
-
category:
|
|
513
|
-
store: new
|
|
508
|
+
const r = this.stores.get(e);
|
|
509
|
+
if (r)
|
|
510
|
+
return r;
|
|
511
|
+
const n = {
|
|
512
|
+
category: Ue,
|
|
513
|
+
store: new Tt()
|
|
514
514
|
};
|
|
515
|
-
return this.stores.set(e,
|
|
515
|
+
return this.stores.set(e, n), n;
|
|
516
516
|
}
|
|
517
|
-
updateCategory(e,
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
517
|
+
updateCategory(e, r) {
|
|
518
|
+
const n = this.stores.get(e);
|
|
519
|
+
if (!n)
|
|
520
520
|
return !1;
|
|
521
|
-
const o =
|
|
522
|
-
return
|
|
521
|
+
const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Ue;
|
|
522
|
+
return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
|
|
523
523
|
}
|
|
524
524
|
notify(e) {
|
|
525
|
-
for (const
|
|
526
|
-
|
|
525
|
+
for (const r of this.listeners)
|
|
526
|
+
r(e);
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function ne(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
|
if (Array.isArray(t)) {
|
|
535
|
-
const e = t.filter((
|
|
535
|
+
const e = t.filter((r) => typeof r == "string").map((r) => r.trim()).filter(Boolean);
|
|
536
536
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function he(...t) {
|
|
540
540
|
let e = "";
|
|
541
|
-
for (const
|
|
542
|
-
if (
|
|
543
|
-
const
|
|
544
|
-
|
|
541
|
+
for (const r of t)
|
|
542
|
+
if (r) {
|
|
543
|
+
const n = r.trim();
|
|
544
|
+
n && (e = e ? e + " " + n : n);
|
|
545
545
|
}
|
|
546
546
|
return e || void 0;
|
|
547
547
|
}
|
|
548
|
-
const
|
|
549
|
-
function
|
|
548
|
+
const He = /* @__PURE__ */ new WeakMap(), Jt = {};
|
|
549
|
+
function me(t) {
|
|
550
550
|
if (!t)
|
|
551
551
|
return Jt;
|
|
552
|
-
const e =
|
|
552
|
+
const e = He.get(t);
|
|
553
553
|
if (e)
|
|
554
554
|
return e;
|
|
555
|
-
const
|
|
556
|
-
for (const [
|
|
557
|
-
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n
|
|
558
|
-
return
|
|
559
|
-
}
|
|
560
|
-
function
|
|
561
|
-
const t =
|
|
562
|
-
const o =
|
|
563
|
-
return
|
|
555
|
+
const r = {};
|
|
556
|
+
for (const [n, o] of Object.entries(t))
|
|
557
|
+
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
|
|
558
|
+
return He.set(t, r), r;
|
|
559
|
+
}
|
|
560
|
+
function Gt() {
|
|
561
|
+
const t = Y(function({ nodeId: r, context: n }) {
|
|
562
|
+
const o = J(n.store, r), s = w(null), i = ne(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0;
|
|
563
|
+
return F(() => {
|
|
564
564
|
if (typeof document > "u")
|
|
565
565
|
return;
|
|
566
566
|
const l = s.current;
|
|
@@ -579,7 +579,7 @@ function Yt() {
|
|
|
579
579
|
} catch {
|
|
580
580
|
l.focus();
|
|
581
581
|
}
|
|
582
|
-
}, [c, i]), o ? /* @__PURE__ */
|
|
582
|
+
}, [c, i]), o ? /* @__PURE__ */ R.jsx(
|
|
583
583
|
"span",
|
|
584
584
|
{
|
|
585
585
|
ref: s,
|
|
@@ -596,32 +596,32 @@ function Yt() {
|
|
|
596
596
|
return t;
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
const t =
|
|
601
|
-
const s =
|
|
599
|
+
function Ht() {
|
|
600
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
601
|
+
const s = J(n.store, r);
|
|
602
602
|
if (!s)
|
|
603
603
|
return null;
|
|
604
|
-
const i =
|
|
605
|
-
return /* @__PURE__ */
|
|
604
|
+
const i = me(s.props), a = he(ne(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
605
|
+
return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
606
606
|
});
|
|
607
607
|
return ({ type: e }) => {
|
|
608
608
|
if (e === "common.div")
|
|
609
609
|
return t;
|
|
610
610
|
};
|
|
611
611
|
}
|
|
612
|
-
function
|
|
613
|
-
const t =
|
|
614
|
-
const s =
|
|
612
|
+
function Xt() {
|
|
613
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
614
|
+
const s = J(n.store, r);
|
|
615
615
|
if (!s)
|
|
616
616
|
return null;
|
|
617
|
-
const i =
|
|
618
|
-
return /* @__PURE__ */
|
|
617
|
+
const i = me(s.props), a = he(ne(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
618
|
+
return /* @__PURE__ */ R.jsx(
|
|
619
619
|
"form",
|
|
620
620
|
{
|
|
621
621
|
...i,
|
|
622
622
|
"data-ikon-node-id": s.id,
|
|
623
623
|
className: a,
|
|
624
|
-
onSubmit: (
|
|
624
|
+
onSubmit: (f) => f.preventDefault(),
|
|
625
625
|
children: c
|
|
626
626
|
}
|
|
627
627
|
);
|
|
@@ -631,13 +631,13 @@ function Ht() {
|
|
|
631
631
|
return t;
|
|
632
632
|
};
|
|
633
633
|
}
|
|
634
|
-
function
|
|
635
|
-
const t =
|
|
636
|
-
const s =
|
|
634
|
+
function Zt() {
|
|
635
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
636
|
+
const s = J(n.store, r);
|
|
637
637
|
if (!s)
|
|
638
638
|
return null;
|
|
639
|
-
const i =
|
|
640
|
-
return /* @__PURE__ */
|
|
639
|
+
const i = me(s.props), a = he(ne(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
640
|
+
return /* @__PURE__ */ R.jsx(
|
|
641
641
|
"div",
|
|
642
642
|
{
|
|
643
643
|
...i,
|
|
@@ -654,63 +654,63 @@ function Xt() {
|
|
|
654
654
|
return t;
|
|
655
655
|
};
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
const t =
|
|
659
|
-
const s =
|
|
657
|
+
function Qt() {
|
|
658
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
659
|
+
const s = J(n.store, r);
|
|
660
660
|
if (!s)
|
|
661
661
|
return null;
|
|
662
|
-
const i =
|
|
663
|
-
return /* @__PURE__ */
|
|
662
|
+
const i = me(s.props), a = he("relative", ne(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
663
|
+
return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
664
664
|
});
|
|
665
665
|
return ({ type: e }) => {
|
|
666
666
|
if (e === "common.stack")
|
|
667
667
|
return t;
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
const t =
|
|
672
|
-
const s =
|
|
670
|
+
function er() {
|
|
671
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
672
|
+
const s = J(n.store, r);
|
|
673
673
|
if (!s)
|
|
674
674
|
return null;
|
|
675
|
-
const i =
|
|
676
|
-
return /* @__PURE__ */
|
|
675
|
+
const i = me(s.props), a = he("absolute", ne(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
676
|
+
return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
|
|
677
677
|
});
|
|
678
678
|
return ({ type: e }) => {
|
|
679
679
|
if (e === "common.layer")
|
|
680
680
|
return t;
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function tr() {
|
|
684
684
|
return [
|
|
685
|
-
Gt(),
|
|
686
685
|
Ht(),
|
|
687
686
|
Xt(),
|
|
688
687
|
Zt(),
|
|
689
688
|
Qt(),
|
|
690
|
-
|
|
689
|
+
er(),
|
|
690
|
+
Gt()
|
|
691
691
|
];
|
|
692
692
|
}
|
|
693
|
-
const
|
|
694
|
-
function
|
|
695
|
-
t.registerModule(
|
|
693
|
+
const rr = "base", nr = async () => tr();
|
|
694
|
+
function or(t) {
|
|
695
|
+
t.registerModule(rr, nr);
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function dt(t) {
|
|
698
698
|
if (typeof t == "string") {
|
|
699
699
|
const e = t.trim();
|
|
700
700
|
return e.length > 0 ? e : void 0;
|
|
701
701
|
}
|
|
702
702
|
if (Array.isArray(t)) {
|
|
703
|
-
const e = t.filter((
|
|
703
|
+
const e = t.filter((r) => typeof r == "string").map((r) => r.trim()).filter(Boolean);
|
|
704
704
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function ft(...t) {
|
|
708
708
|
const e = [];
|
|
709
|
-
for (const
|
|
710
|
-
|
|
709
|
+
for (const r of t)
|
|
710
|
+
r && r.trim() && e.push(r.trim());
|
|
711
711
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function be(t) {
|
|
714
714
|
if (typeof t == "number" && Number.isFinite(t))
|
|
715
715
|
return Math.floor(t);
|
|
716
716
|
if (typeof t == "string" && t.trim().length > 0) {
|
|
@@ -725,38 +725,38 @@ function Le(t) {
|
|
|
725
725
|
const e = t.trim();
|
|
726
726
|
return e.length > 0 ? e : void 0;
|
|
727
727
|
}
|
|
728
|
-
const
|
|
729
|
-
function
|
|
730
|
-
const t =
|
|
731
|
-
const s =
|
|
732
|
-
return
|
|
733
|
-
const
|
|
734
|
-
if (!(!a || !
|
|
735
|
-
return a.attachCanvas(c,
|
|
728
|
+
const sr = "media.video-canvas", ir = "media.video-url-player";
|
|
729
|
+
function ar() {
|
|
730
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
731
|
+
const s = J(n.store, r), i = w(null), a = n.video, c = s ? Le(s.props?.streamId) : void 0, f = s ? be(s.props?.width) : void 0, l = s ? be(s.props?.height) : void 0, h = s ? ft(dt(s.props?.className), o) : o;
|
|
732
|
+
return F(() => {
|
|
733
|
+
const d = i.current;
|
|
734
|
+
if (!(!a || !d || !c))
|
|
735
|
+
return a.attachCanvas(c, d), () => {
|
|
736
736
|
a.detachCanvas(c);
|
|
737
737
|
};
|
|
738
|
-
}, [a, c]), s ? /* @__PURE__ */
|
|
738
|
+
}, [a, c]), s ? /* @__PURE__ */ R.jsx(
|
|
739
739
|
"canvas",
|
|
740
740
|
{
|
|
741
741
|
ref: i,
|
|
742
742
|
"data-ikon-node-id": s.id,
|
|
743
743
|
"data-ikon-video-stream-id": c,
|
|
744
744
|
className: h,
|
|
745
|
-
...
|
|
745
|
+
...f ? { width: f } : {},
|
|
746
746
|
...l ? { height: l } : {}
|
|
747
747
|
},
|
|
748
748
|
c
|
|
749
749
|
) : null;
|
|
750
750
|
});
|
|
751
751
|
return ({ type: e }) => {
|
|
752
|
-
if (e ===
|
|
752
|
+
if (e === sr)
|
|
753
753
|
return t;
|
|
754
754
|
};
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
return [
|
|
756
|
+
function cr() {
|
|
757
|
+
return [ar(), ur()];
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function ue(t) {
|
|
760
760
|
if (typeof t == "boolean")
|
|
761
761
|
return t;
|
|
762
762
|
if (typeof t == "string") {
|
|
@@ -765,28 +765,28 @@ function oe(t) {
|
|
|
765
765
|
if (e === "false") return !1;
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
const t =
|
|
770
|
-
nodeId:
|
|
771
|
-
context:
|
|
768
|
+
function ur() {
|
|
769
|
+
const t = Y(function({
|
|
770
|
+
nodeId: r,
|
|
771
|
+
context: n,
|
|
772
772
|
className: o
|
|
773
773
|
}) {
|
|
774
|
-
const s =
|
|
774
|
+
const s = J(n.store, r);
|
|
775
775
|
if (!s)
|
|
776
776
|
return null;
|
|
777
|
-
const i = dt(
|
|
778
|
-
return /* @__PURE__ */
|
|
777
|
+
const i = ft(dt(s.props?.className), o), a = Le(s.props?.src), c = Le(s.props?.poster), f = ue(s.props?.controls), l = ue(s.props?.autoplay), h = ue(s.props?.loop), d = ue(s.props?.muted), y = ue(s.props?.playsInline), S = be(s.props?.width), b = be(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
|
|
778
|
+
return /* @__PURE__ */ R.jsx(
|
|
779
779
|
"video",
|
|
780
780
|
{
|
|
781
781
|
src: a,
|
|
782
782
|
poster: c,
|
|
783
|
-
...
|
|
783
|
+
...f !== void 0 ? { controls: f } : {},
|
|
784
784
|
...l !== void 0 ? { autoPlay: l } : {},
|
|
785
785
|
...h !== void 0 ? { loop: h } : {},
|
|
786
|
-
...
|
|
787
|
-
...
|
|
786
|
+
...d !== void 0 ? { muted: d } : {},
|
|
787
|
+
...y !== void 0 ? { playsInline: y } : {},
|
|
788
788
|
...S ? { width: S } : {},
|
|
789
|
-
...
|
|
789
|
+
...b ? { height: b } : {},
|
|
790
790
|
"data-ikon-node-id": s.id,
|
|
791
791
|
className: i,
|
|
792
792
|
children: m
|
|
@@ -794,84 +794,443 @@ function un() {
|
|
|
794
794
|
);
|
|
795
795
|
});
|
|
796
796
|
return ({ type: e }) => {
|
|
797
|
-
if (e ===
|
|
797
|
+
if (e === ir)
|
|
798
|
+
return t;
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
const lr = "media", dr = async () => cr();
|
|
802
|
+
function fr(t) {
|
|
803
|
+
t.registerModule(lr, dr);
|
|
804
|
+
}
|
|
805
|
+
const hr = `#version 300 es
|
|
806
|
+
in vec4 a_position;
|
|
807
|
+
void main() {
|
|
808
|
+
gl_Position = a_position;
|
|
809
|
+
}
|
|
810
|
+
`;
|
|
811
|
+
function mr(t, e) {
|
|
812
|
+
return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
|
|
813
|
+
}
|
|
814
|
+
function pr(t, e) {
|
|
815
|
+
const r = [];
|
|
816
|
+
for (const [n, o] of Object.entries(e)) {
|
|
817
|
+
if (mr(t, n))
|
|
818
|
+
continue;
|
|
819
|
+
let s;
|
|
820
|
+
switch (o.type) {
|
|
821
|
+
case "float":
|
|
822
|
+
s = "float";
|
|
823
|
+
break;
|
|
824
|
+
case "vec2":
|
|
825
|
+
s = "vec2";
|
|
826
|
+
break;
|
|
827
|
+
case "vec3":
|
|
828
|
+
s = "vec3";
|
|
829
|
+
break;
|
|
830
|
+
case "vec4":
|
|
831
|
+
s = "vec4";
|
|
832
|
+
break;
|
|
833
|
+
case "int":
|
|
834
|
+
s = "int";
|
|
835
|
+
break;
|
|
836
|
+
case "bool":
|
|
837
|
+
s = "bool";
|
|
838
|
+
break;
|
|
839
|
+
default:
|
|
840
|
+
s = "float";
|
|
841
|
+
}
|
|
842
|
+
r.push(`uniform ${s} ${n};`);
|
|
843
|
+
}
|
|
844
|
+
return `#version 300 es
|
|
845
|
+
precision highp float;
|
|
846
|
+
|
|
847
|
+
// Standard ShaderToy uniforms
|
|
848
|
+
uniform vec3 iResolution;
|
|
849
|
+
uniform float iTime;
|
|
850
|
+
uniform float iTimeDelta;
|
|
851
|
+
uniform int iFrame;
|
|
852
|
+
uniform vec4 iMouse;
|
|
853
|
+
uniform vec4 iDate;
|
|
854
|
+
|
|
855
|
+
// Custom uniforms
|
|
856
|
+
${r.join(`
|
|
857
|
+
`)}
|
|
858
|
+
|
|
859
|
+
out vec4 frag_out_color;
|
|
860
|
+
|
|
861
|
+
${t}
|
|
862
|
+
|
|
863
|
+
void main() {
|
|
864
|
+
vec4 color = vec4(0.0);
|
|
865
|
+
mainImage(color, gl_FragCoord.xy);
|
|
866
|
+
frag_out_color = color;
|
|
867
|
+
}
|
|
868
|
+
`;
|
|
869
|
+
}
|
|
870
|
+
class gr {
|
|
871
|
+
gl;
|
|
872
|
+
program = null;
|
|
873
|
+
positionBuffer = null;
|
|
874
|
+
vao = null;
|
|
875
|
+
uniformLocations = /* @__PURE__ */ new Map();
|
|
876
|
+
customUniforms = {};
|
|
877
|
+
startTime = performance.now();
|
|
878
|
+
lastFrameTime = performance.now();
|
|
879
|
+
frameCount = 0;
|
|
880
|
+
mouseX = 0;
|
|
881
|
+
mouseY = 0;
|
|
882
|
+
mouseClickX = 0;
|
|
883
|
+
mouseClickY = 0;
|
|
884
|
+
lastError = null;
|
|
885
|
+
currentShaderSource = "";
|
|
886
|
+
constructor(e) {
|
|
887
|
+
const r = e.getContext("webgl2", {
|
|
888
|
+
alpha: !1,
|
|
889
|
+
antialias: !1,
|
|
890
|
+
depth: !1,
|
|
891
|
+
stencil: !1,
|
|
892
|
+
preserveDrawingBuffer: !1
|
|
893
|
+
});
|
|
894
|
+
if (!r)
|
|
895
|
+
throw new Error("WebGL2 is not supported");
|
|
896
|
+
this.gl = r, this.initializeGeometry();
|
|
897
|
+
}
|
|
898
|
+
initializeGeometry() {
|
|
899
|
+
const e = this.gl;
|
|
900
|
+
this.vao = e.createVertexArray(), e.bindVertexArray(this.vao), this.positionBuffer = e.createBuffer(), e.bindBuffer(e.ARRAY_BUFFER, this.positionBuffer);
|
|
901
|
+
const r = new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]);
|
|
902
|
+
e.bufferData(e.ARRAY_BUFFER, r, e.STATIC_DRAW), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
|
|
903
|
+
}
|
|
904
|
+
compile(e, r = {}) {
|
|
905
|
+
this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
|
|
906
|
+
const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, hr);
|
|
907
|
+
if (!o)
|
|
908
|
+
return !1;
|
|
909
|
+
const s = pr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
|
|
910
|
+
if (!i)
|
|
911
|
+
return n.deleteShader(o), !1;
|
|
912
|
+
const a = n.createProgram();
|
|
913
|
+
return a ? (n.attachShader(a, o), n.attachShader(a, i), n.linkProgram(a), n.deleteShader(o), n.deleteShader(i), n.getProgramParameter(a, n.LINK_STATUS) ? (this.program && n.deleteProgram(this.program), this.program = a, this.cacheUniformLocations(), !0) : (this.lastError = n.getProgramInfoLog(a) || "Program link failed", n.deleteProgram(a), !1)) : (this.lastError = "Failed to create program", n.deleteShader(o), n.deleteShader(i), !1);
|
|
914
|
+
}
|
|
915
|
+
recompileWithUniforms(e) {
|
|
916
|
+
return this.currentShaderSource ? this.compile(this.currentShaderSource, e) : !1;
|
|
917
|
+
}
|
|
918
|
+
compileShader(e, r) {
|
|
919
|
+
const n = this.gl, o = n.createShader(e);
|
|
920
|
+
return o ? (n.shaderSource(o, r), n.compileShader(o), n.getShaderParameter(o, n.COMPILE_STATUS) ? o : (this.lastError = n.getShaderInfoLog(o) || "Shader compilation failed", n.deleteShader(o), null)) : (this.lastError = "Failed to create shader", null);
|
|
921
|
+
}
|
|
922
|
+
cacheUniformLocations() {
|
|
923
|
+
if (!this.program) return;
|
|
924
|
+
const e = this.gl;
|
|
925
|
+
this.uniformLocations.clear();
|
|
926
|
+
const r = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
|
|
927
|
+
for (const n of r)
|
|
928
|
+
this.uniformLocations.set(n, e.getUniformLocation(this.program, n));
|
|
929
|
+
for (const n of Object.keys(this.customUniforms))
|
|
930
|
+
this.uniformLocations.set(n, e.getUniformLocation(this.program, n));
|
|
931
|
+
}
|
|
932
|
+
setCustomUniforms(e) {
|
|
933
|
+
const r = Object.keys(e).some((o) => !(o in this.customUniforms)), n = Object.keys(this.customUniforms).some((o) => !(o in e));
|
|
934
|
+
r || n ? this.recompileWithUniforms(e) : this.customUniforms = e;
|
|
935
|
+
}
|
|
936
|
+
setMouse(e, r, n, o) {
|
|
937
|
+
this.mouseX = e, this.mouseY = r, this.mouseClickX = n, this.mouseClickY = o;
|
|
938
|
+
}
|
|
939
|
+
draw() {
|
|
940
|
+
if (!this.program) return;
|
|
941
|
+
const e = this.gl, r = e.canvas, n = r.clientWidth, o = r.clientHeight;
|
|
942
|
+
(r.width !== n || r.height !== o) && (r.width = n, r.height = o, e.viewport(0, 0, n, o));
|
|
943
|
+
const s = performance.now(), i = (s - this.startTime) / 1e3, a = (s - this.lastFrameTime) / 1e3;
|
|
944
|
+
this.lastFrameTime = s, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
945
|
+
const c = this.uniformLocations.get("iResolution");
|
|
946
|
+
c && e.uniform3f(c, n, o, 1);
|
|
947
|
+
const f = this.uniformLocations.get("iTime");
|
|
948
|
+
f && e.uniform1f(f, i);
|
|
949
|
+
const l = this.uniformLocations.get("iTimeDelta");
|
|
950
|
+
l && e.uniform1f(l, a);
|
|
951
|
+
const h = this.uniformLocations.get("iFrame");
|
|
952
|
+
h && e.uniform1i(h, this.frameCount);
|
|
953
|
+
const d = this.uniformLocations.get("iMouse");
|
|
954
|
+
d && e.uniform4f(d, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
955
|
+
const y = this.uniformLocations.get("iDate");
|
|
956
|
+
if (y) {
|
|
957
|
+
const S = /* @__PURE__ */ new Date();
|
|
958
|
+
e.uniform4f(y, S.getFullYear(), S.getMonth(), S.getDate(), S.getHours() * 3600 + S.getMinutes() * 60 + S.getSeconds() + S.getMilliseconds() / 1e3);
|
|
959
|
+
}
|
|
960
|
+
for (const [S, b] of Object.entries(this.customUniforms)) {
|
|
961
|
+
const m = this.uniformLocations.get(S);
|
|
962
|
+
if (m)
|
|
963
|
+
switch (b.type) {
|
|
964
|
+
case "float":
|
|
965
|
+
e.uniform1f(m, b.value);
|
|
966
|
+
break;
|
|
967
|
+
case "vec2": {
|
|
968
|
+
const p = b.value;
|
|
969
|
+
e.uniform2f(m, p[0], p[1]);
|
|
970
|
+
break;
|
|
971
|
+
}
|
|
972
|
+
case "vec3": {
|
|
973
|
+
const p = b.value;
|
|
974
|
+
e.uniform3f(m, p[0], p[1], p[2]);
|
|
975
|
+
break;
|
|
976
|
+
}
|
|
977
|
+
case "vec4": {
|
|
978
|
+
const p = b.value;
|
|
979
|
+
e.uniform4f(m, p[0], p[1], p[2], p[3]);
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
case "int":
|
|
983
|
+
e.uniform1i(m, b.value);
|
|
984
|
+
break;
|
|
985
|
+
case "bool":
|
|
986
|
+
e.uniform1i(m, b.value ? 1 : 0);
|
|
987
|
+
break;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
e.drawArrays(e.TRIANGLES, 0, 6), e.bindVertexArray(null);
|
|
991
|
+
}
|
|
992
|
+
getError() {
|
|
993
|
+
return this.lastError;
|
|
994
|
+
}
|
|
995
|
+
destroy() {
|
|
996
|
+
const e = this.gl;
|
|
997
|
+
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();
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
function yr(t) {
|
|
1001
|
+
if (typeof t == "string") {
|
|
1002
|
+
const e = t.trim();
|
|
1003
|
+
return e.length > 0 ? e : void 0;
|
|
1004
|
+
}
|
|
1005
|
+
if (Array.isArray(t)) {
|
|
1006
|
+
const e = t.filter((r) => typeof r == "string").map((r) => r.trim()).filter(Boolean);
|
|
1007
|
+
return e.length > 0 ? e.join(" ") : void 0;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
function Sr(...t) {
|
|
1011
|
+
const e = [];
|
|
1012
|
+
for (const r of t)
|
|
1013
|
+
r && r.trim() && e.push(r.trim());
|
|
1014
|
+
return e.length > 0 ? e.join(" ") : void 0;
|
|
1015
|
+
}
|
|
1016
|
+
function ke(t) {
|
|
1017
|
+
if (typeof t == "number" && Number.isFinite(t))
|
|
1018
|
+
return Math.floor(t);
|
|
1019
|
+
if (typeof t == "string" && t.trim().length > 0) {
|
|
1020
|
+
const e = Number(t);
|
|
1021
|
+
if (Number.isFinite(e))
|
|
1022
|
+
return Math.floor(e);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
function br(t) {
|
|
1026
|
+
return typeof t == "string" ? t : "";
|
|
1027
|
+
}
|
|
1028
|
+
function wr(t) {
|
|
1029
|
+
if (typeof t == "boolean")
|
|
1030
|
+
return t;
|
|
1031
|
+
if (typeof t == "string") {
|
|
1032
|
+
const e = t.trim().toLowerCase();
|
|
1033
|
+
if (e === "true") return !0;
|
|
1034
|
+
if (e === "false") return !1;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
function vr(t) {
|
|
1038
|
+
if (!t || typeof t != "object")
|
|
1039
|
+
return {};
|
|
1040
|
+
const e = {}, r = t;
|
|
1041
|
+
for (const [n, o] of Object.entries(r)) {
|
|
1042
|
+
if (!o || typeof o != "object")
|
|
1043
|
+
continue;
|
|
1044
|
+
const s = o, i = s.value, a = s.type;
|
|
1045
|
+
i === void 0 || typeof a != "string" || !["float", "vec2", "vec3", "vec4", "int", "bool"].includes(a) || (e[n] = {
|
|
1046
|
+
value: i,
|
|
1047
|
+
type: a
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
return e;
|
|
1051
|
+
}
|
|
1052
|
+
function Rr(t, e) {
|
|
1053
|
+
const r = Object.keys(t), n = Object.keys(e);
|
|
1054
|
+
if (r.length !== n.length)
|
|
1055
|
+
return !1;
|
|
1056
|
+
for (const o of r) {
|
|
1057
|
+
if (!(o in e))
|
|
1058
|
+
return !1;
|
|
1059
|
+
const s = t[o], i = e[o];
|
|
1060
|
+
if (s.type !== i.type)
|
|
1061
|
+
return !1;
|
|
1062
|
+
if (Array.isArray(s.value) && Array.isArray(i.value)) {
|
|
1063
|
+
if (s.value.length !== i.value.length)
|
|
1064
|
+
return !1;
|
|
1065
|
+
for (let a = 0; a < s.value.length; a++)
|
|
1066
|
+
if (s.value[a] !== i.value[a])
|
|
1067
|
+
return !1;
|
|
1068
|
+
} else if (s.value !== i.value)
|
|
1069
|
+
return !1;
|
|
1070
|
+
}
|
|
1071
|
+
return !0;
|
|
1072
|
+
}
|
|
1073
|
+
const Er = "shader.shader";
|
|
1074
|
+
function Ar() {
|
|
1075
|
+
const t = Y(function({ nodeId: r, context: n, className: o }) {
|
|
1076
|
+
const s = J(n.store, r), i = w(null), a = w(null), c = w(null), f = w(0), l = w(""), h = w({}), d = w({
|
|
1077
|
+
x: 0,
|
|
1078
|
+
y: 0,
|
|
1079
|
+
clickX: 0,
|
|
1080
|
+
clickY: 0,
|
|
1081
|
+
isDown: !1
|
|
1082
|
+
}), y = s ? br(s.props?.shaderSource) : "", S = s ? ke(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, m = z(() => vr(b), [b]), p = s ? wr(s.props?.enableMouse) ?? !0 : !0, A = s ? ke(s.props?.width) : void 0, P = s ? ke(s.props?.height) : void 0, j = s ? Sr(yr(s.props?.className), o) : o;
|
|
1083
|
+
F(() => {
|
|
1084
|
+
const k = i.current;
|
|
1085
|
+
if (k) {
|
|
1086
|
+
try {
|
|
1087
|
+
const C = new gr(k);
|
|
1088
|
+
a.current = C;
|
|
1089
|
+
} catch (C) {
|
|
1090
|
+
console.error("[ShaderRenderer] Failed to create WebGL2 context:", C);
|
|
1091
|
+
}
|
|
1092
|
+
return () => {
|
|
1093
|
+
a.current && (a.current.destroy(), a.current = null);
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
}, []), F(() => {
|
|
1097
|
+
const k = a.current;
|
|
1098
|
+
if (!(!k || !y) && l.current !== y)
|
|
1099
|
+
if (k.compile(y, m))
|
|
1100
|
+
l.current = y, h.current = m;
|
|
1101
|
+
else {
|
|
1102
|
+
const M = k.getError();
|
|
1103
|
+
console.error("[ShaderRenderer] Shader compilation failed:", M);
|
|
1104
|
+
}
|
|
1105
|
+
}, [y, m]), F(() => {
|
|
1106
|
+
const k = a.current;
|
|
1107
|
+
!k || !l.current || Rr(h.current, m) || (k.setCustomUniforms(m), h.current = m);
|
|
1108
|
+
}, [m]), F(() => {
|
|
1109
|
+
const k = a.current;
|
|
1110
|
+
if (!k || !l.current) return;
|
|
1111
|
+
const C = 1e3 / S, M = (I) => {
|
|
1112
|
+
const L = I - f.current;
|
|
1113
|
+
L >= C && (f.current = I - L % C, k.draw()), c.current = requestAnimationFrame(M);
|
|
1114
|
+
};
|
|
1115
|
+
return c.current = requestAnimationFrame(M), () => {
|
|
1116
|
+
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
1117
|
+
};
|
|
1118
|
+
}, [S]);
|
|
1119
|
+
const V = B(
|
|
1120
|
+
(k) => {
|
|
1121
|
+
if (!p) return;
|
|
1122
|
+
const C = i.current, M = a.current;
|
|
1123
|
+
if (!C || !M) return;
|
|
1124
|
+
const I = C.getBoundingClientRect(), L = k.clientX - I.left, W = I.height - (k.clientY - I.top);
|
|
1125
|
+
d.current.x = L, d.current.y = W, M.setMouse(L, W, d.current.clickX, d.current.clickY);
|
|
1126
|
+
},
|
|
1127
|
+
[p]
|
|
1128
|
+
), G = B(
|
|
1129
|
+
(k) => {
|
|
1130
|
+
if (!p) return;
|
|
1131
|
+
const C = i.current, M = a.current;
|
|
1132
|
+
if (!C || !M) return;
|
|
1133
|
+
const I = C.getBoundingClientRect(), L = k.clientX - I.left, W = I.height - (k.clientY - I.top);
|
|
1134
|
+
d.current.isDown = !0, d.current.clickX = L, d.current.clickY = W, M.setMouse(L, W, L, W);
|
|
1135
|
+
},
|
|
1136
|
+
[p]
|
|
1137
|
+
), Z = B(() => {
|
|
1138
|
+
p && (d.current.isDown = !1, d.current.clickX = -Math.abs(d.current.clickX));
|
|
1139
|
+
}, [p]);
|
|
1140
|
+
return s ? /* @__PURE__ */ R.jsx(
|
|
1141
|
+
"canvas",
|
|
1142
|
+
{
|
|
1143
|
+
ref: i,
|
|
1144
|
+
"data-ikon-node-id": s.id,
|
|
1145
|
+
className: j,
|
|
1146
|
+
...A ? { width: A } : {},
|
|
1147
|
+
...P ? { height: P } : {},
|
|
1148
|
+
onMouseMove: V,
|
|
1149
|
+
onMouseDown: G,
|
|
1150
|
+
onMouseUp: Z,
|
|
1151
|
+
onMouseLeave: Z
|
|
1152
|
+
}
|
|
1153
|
+
) : null;
|
|
1154
|
+
});
|
|
1155
|
+
return ({ type: e }) => {
|
|
1156
|
+
if (e === Er)
|
|
798
1157
|
return t;
|
|
799
1158
|
};
|
|
800
1159
|
}
|
|
801
|
-
const
|
|
802
|
-
function
|
|
803
|
-
t.registerModule(
|
|
1160
|
+
const kr = "shader", Tr = async () => Ar();
|
|
1161
|
+
function Cr(t) {
|
|
1162
|
+
t.registerModule(kr, Tr);
|
|
804
1163
|
}
|
|
805
|
-
const
|
|
806
|
-
class
|
|
1164
|
+
const Xe = Re("UIRegistry");
|
|
1165
|
+
class Ir {
|
|
807
1166
|
baseResolvers = [];
|
|
808
1167
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
809
1168
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
810
1169
|
activeModuleOrder = [];
|
|
811
1170
|
registerResolvers(e) {
|
|
812
|
-
const
|
|
813
|
-
this.baseResolvers.push(...
|
|
1171
|
+
const r = Array.isArray(e) ? e : [e];
|
|
1172
|
+
this.baseResolvers.push(...r.filter(Boolean));
|
|
814
1173
|
}
|
|
815
|
-
registerModule(e,
|
|
816
|
-
const
|
|
817
|
-
if (!
|
|
818
|
-
this.moduleLoaders.set(e,
|
|
1174
|
+
registerModule(e, r) {
|
|
1175
|
+
const n = this.moduleLoaders.get(e);
|
|
1176
|
+
if (!n) {
|
|
1177
|
+
this.moduleLoaders.set(e, r);
|
|
819
1178
|
return;
|
|
820
1179
|
}
|
|
821
|
-
|
|
1180
|
+
n !== r && (this.moduleLoaders.set(e, r), this.moduleResolvers.delete(e));
|
|
822
1181
|
}
|
|
823
1182
|
async loadRegisteredModules() {
|
|
824
1183
|
let e = !1;
|
|
825
|
-
for (const [
|
|
826
|
-
if (!this.moduleResolvers.has(
|
|
1184
|
+
for (const [n, o] of this.moduleLoaders.entries())
|
|
1185
|
+
if (!this.moduleResolvers.has(n))
|
|
827
1186
|
try {
|
|
828
|
-
const s = await o(), i =
|
|
829
|
-
this.moduleResolvers.set(
|
|
1187
|
+
const s = await o(), i = _r(s);
|
|
1188
|
+
this.moduleResolvers.set(n, i), e = !0;
|
|
830
1189
|
} catch (s) {
|
|
831
|
-
|
|
1190
|
+
Xe.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
|
|
832
1191
|
}
|
|
833
|
-
const
|
|
834
|
-
for (const
|
|
835
|
-
this.moduleResolvers.has(
|
|
836
|
-
return
|
|
1192
|
+
const r = [];
|
|
1193
|
+
for (const n of this.moduleLoaders.keys())
|
|
1194
|
+
this.moduleResolvers.has(n) && r.push(n);
|
|
1195
|
+
return Pr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
|
|
837
1196
|
}
|
|
838
1197
|
resolve(e) {
|
|
839
|
-
for (const
|
|
840
|
-
const
|
|
841
|
-
if (
|
|
1198
|
+
for (const r of this.baseResolvers) {
|
|
1199
|
+
const n = r(e);
|
|
1200
|
+
if (n) return n;
|
|
842
1201
|
}
|
|
843
|
-
for (const
|
|
844
|
-
const
|
|
845
|
-
if (!
|
|
846
|
-
|
|
1202
|
+
for (const r of this.activeModuleOrder) {
|
|
1203
|
+
const n = this.moduleResolvers.get(r);
|
|
1204
|
+
if (!n) {
|
|
1205
|
+
Xe.warn(`Missing resolvers for module ${r}`);
|
|
847
1206
|
continue;
|
|
848
1207
|
}
|
|
849
|
-
for (const o of
|
|
1208
|
+
for (const o of n) {
|
|
850
1209
|
const s = o(e);
|
|
851
1210
|
if (s) return s;
|
|
852
1211
|
}
|
|
853
1212
|
}
|
|
854
1213
|
}
|
|
855
1214
|
}
|
|
856
|
-
function
|
|
857
|
-
const t = new
|
|
858
|
-
return
|
|
1215
|
+
function Nr() {
|
|
1216
|
+
const t = new Ir();
|
|
1217
|
+
return or(t), fr(t), Cr(t), t.loadRegisteredModules(), t;
|
|
859
1218
|
}
|
|
860
|
-
function
|
|
1219
|
+
function Or(t) {
|
|
861
1220
|
return Array.isArray(t) ? t : [t];
|
|
862
1221
|
}
|
|
863
|
-
function
|
|
864
|
-
return t ?
|
|
1222
|
+
function _r(t) {
|
|
1223
|
+
return t ? Or(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
865
1224
|
}
|
|
866
|
-
function
|
|
1225
|
+
function Pr(t, e) {
|
|
867
1226
|
if (t.length !== e.length)
|
|
868
1227
|
return !1;
|
|
869
|
-
for (let
|
|
870
|
-
if (t[
|
|
1228
|
+
for (let r = 0; r < t.length; r += 1)
|
|
1229
|
+
if (t[r] !== e[r])
|
|
871
1230
|
return !1;
|
|
872
1231
|
return !0;
|
|
873
1232
|
}
|
|
874
|
-
const
|
|
1233
|
+
const Te = Re("MotionController"), Ze = {
|
|
875
1234
|
ease: [0.25, 0.1, 0.25, 1],
|
|
876
1235
|
"ease-in": [0.42, 0, 1, 1],
|
|
877
1236
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -901,98 +1260,98 @@ const ke = Ee("MotionController"), Xe = {
|
|
|
901
1260
|
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
902
1261
|
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
903
1262
|
};
|
|
904
|
-
function
|
|
1263
|
+
function D(t) {
|
|
905
1264
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
906
1265
|
}
|
|
907
|
-
function
|
|
1266
|
+
function Qe(t) {
|
|
908
1267
|
if (t == null) return;
|
|
909
1268
|
const e = `${t}`.trim();
|
|
910
1269
|
if (!e) return;
|
|
911
|
-
const
|
|
912
|
-
return Number.isFinite(
|
|
1270
|
+
const r = Number.parseFloat(e);
|
|
1271
|
+
return Number.isFinite(r) ? r : void 0;
|
|
913
1272
|
}
|
|
914
|
-
function
|
|
1273
|
+
function et(t) {
|
|
915
1274
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
916
1275
|
}
|
|
917
|
-
function
|
|
1276
|
+
function tt(t, e, r, n) {
|
|
918
1277
|
const l = new Float32Array(11);
|
|
919
|
-
function h(m,
|
|
920
|
-
return ((3 *
|
|
921
|
-
}
|
|
922
|
-
function
|
|
923
|
-
return 3 * (3 *
|
|
924
|
-
}
|
|
925
|
-
function
|
|
926
|
-
for (let
|
|
927
|
-
const
|
|
928
|
-
if (
|
|
929
|
-
return
|
|
930
|
-
const
|
|
931
|
-
|
|
1278
|
+
function h(m, p, A) {
|
|
1279
|
+
return ((3 * p - 3 * A + 1) * m + (3 * A - 6 * p)) * m * m + 3 * p * m;
|
|
1280
|
+
}
|
|
1281
|
+
function d(m, p, A) {
|
|
1282
|
+
return 3 * (3 * p - 3 * A + 1) * m * m + 2 * (3 * A - 6 * p) * m + 3 * p;
|
|
1283
|
+
}
|
|
1284
|
+
function y(m, p) {
|
|
1285
|
+
for (let A = 0; A < 4; A += 1) {
|
|
1286
|
+
const P = d(p, t, r);
|
|
1287
|
+
if (P === 0)
|
|
1288
|
+
return p;
|
|
1289
|
+
const j = h(p, t, r) - m;
|
|
1290
|
+
p -= j / P;
|
|
932
1291
|
}
|
|
933
|
-
return
|
|
1292
|
+
return p;
|
|
934
1293
|
}
|
|
935
|
-
function S(m,
|
|
936
|
-
let
|
|
1294
|
+
function S(m, p, A) {
|
|
1295
|
+
let P = 0, j = 0, V = 0;
|
|
937
1296
|
do
|
|
938
|
-
|
|
939
|
-
while (Math.abs(
|
|
940
|
-
return
|
|
941
|
-
}
|
|
942
|
-
function
|
|
943
|
-
let
|
|
944
|
-
const
|
|
945
|
-
for (;
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
const
|
|
949
|
-
return
|
|
1297
|
+
j = p + (A - p) / 2, P = h(j, t, r) - m, P > 0 ? A = j : p = j;
|
|
1298
|
+
while (Math.abs(P) > 1e-7 && ++V < 10);
|
|
1299
|
+
return j;
|
|
1300
|
+
}
|
|
1301
|
+
function b(m) {
|
|
1302
|
+
let p = 0, A = 1;
|
|
1303
|
+
const P = 10;
|
|
1304
|
+
for (; A !== P && l[A] <= m; A += 1)
|
|
1305
|
+
p += 0.1;
|
|
1306
|
+
A -= 1;
|
|
1307
|
+
const j = (m - l[A]) / (l[A + 1] - l[A]), V = p + j * 0.1, G = d(V, t, r);
|
|
1308
|
+
return G >= 1e-3 ? y(m, V) : G === 0 ? V : S(m, p, p + 0.1);
|
|
950
1309
|
}
|
|
951
1310
|
for (let m = 0; m < 11; m += 1)
|
|
952
|
-
l[m] = h(m * 0.1, t,
|
|
953
|
-
return (m) => m <= 0 ? 0 : m >= 1 ? 1 : h(
|
|
1311
|
+
l[m] = h(m * 0.1, t, r);
|
|
1312
|
+
return (m) => m <= 0 ? 0 : m >= 1 ? 1 : h(b(m), e, n);
|
|
954
1313
|
}
|
|
955
|
-
function
|
|
1314
|
+
function jr(t) {
|
|
956
1315
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
957
1316
|
if (!e)
|
|
958
|
-
return (o) =>
|
|
959
|
-
const
|
|
960
|
-
return
|
|
1317
|
+
return (o) => D(o);
|
|
1318
|
+
const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
|
|
1319
|
+
return n === "start" || n === "jump-start" ? (o) => D(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => D(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => D((Math.floor(o * r) + 0.5) / r) : (o) => D(Math.floor(o * r) / r);
|
|
961
1320
|
}
|
|
962
|
-
function
|
|
1321
|
+
function Mr(t) {
|
|
963
1322
|
if (!t)
|
|
964
|
-
return (
|
|
1323
|
+
return (r) => D(r);
|
|
965
1324
|
const e = t.trim().toLowerCase();
|
|
966
1325
|
if (!e || e === "linear")
|
|
967
|
-
return (
|
|
968
|
-
if (
|
|
969
|
-
const [
|
|
970
|
-
return (a) =>
|
|
1326
|
+
return (r) => D(r);
|
|
1327
|
+
if (Ze[e]) {
|
|
1328
|
+
const [r, n, o, s] = Ze[e], i = tt(r, n, o, s);
|
|
1329
|
+
return (a) => D(i(D(a)));
|
|
971
1330
|
}
|
|
972
1331
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
973
|
-
const
|
|
974
|
-
if (
|
|
975
|
-
const [o, s, i, a] =
|
|
976
|
-
return (
|
|
1332
|
+
const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1333
|
+
if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
|
|
1334
|
+
const [o, s, i, a] = n, c = tt(o, s, i, a);
|
|
1335
|
+
return (f) => D(c(D(f)));
|
|
977
1336
|
}
|
|
978
1337
|
}
|
|
979
1338
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
980
|
-
const
|
|
981
|
-
return (
|
|
1339
|
+
const r = jr(e);
|
|
1340
|
+
return (n) => r(D(n));
|
|
982
1341
|
}
|
|
983
|
-
return (
|
|
1342
|
+
return (r) => D(r);
|
|
984
1343
|
}
|
|
985
|
-
function
|
|
1344
|
+
function Ur(t) {
|
|
986
1345
|
if (!t)
|
|
987
1346
|
return;
|
|
988
1347
|
const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
|
|
989
1348
|
if (!e)
|
|
990
1349
|
return;
|
|
991
|
-
const [
|
|
992
|
-
if (![
|
|
993
|
-
return { inStart:
|
|
1350
|
+
const [r, n, o, s] = e.slice(1).map((i) => Number.parseFloat(i));
|
|
1351
|
+
if (![r, n, o, s].some((i) => !Number.isFinite(i)))
|
|
1352
|
+
return { inStart: r, inEnd: n, outStart: o, outEnd: s };
|
|
994
1353
|
}
|
|
995
|
-
class
|
|
1354
|
+
class Lr {
|
|
996
1355
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
997
1356
|
observer;
|
|
998
1357
|
observeScheduled = !1;
|
|
@@ -1001,15 +1360,15 @@ class En {
|
|
|
1001
1360
|
elementStates = /* @__PURE__ */ new Map();
|
|
1002
1361
|
styleToElements = /* @__PURE__ */ new Map();
|
|
1003
1362
|
globalCleanups = /* @__PURE__ */ new Set();
|
|
1004
|
-
registerStyle(e,
|
|
1363
|
+
registerStyle(e, r) {
|
|
1005
1364
|
if (!e)
|
|
1006
1365
|
return;
|
|
1007
|
-
const
|
|
1008
|
-
if (!
|
|
1366
|
+
const n = this.parseMetadata(r);
|
|
1367
|
+
if (!n) {
|
|
1009
1368
|
this.bindingsByStyle.delete(e), this.cleanupStyle(e);
|
|
1010
1369
|
return;
|
|
1011
1370
|
}
|
|
1012
|
-
this.bindingsByStyle.set(e,
|
|
1371
|
+
this.bindingsByStyle.set(e, n), this.cleanupStyle(e), this.ensureObserver(), this.scheduleScan(e);
|
|
1013
1372
|
}
|
|
1014
1373
|
unregisterStyle(e) {
|
|
1015
1374
|
e && (this.bindingsByStyle.delete(e), this.cleanupStyle(e), this.pendingScanStyles.delete(e));
|
|
@@ -1018,34 +1377,34 @@ class En {
|
|
|
1018
1377
|
for (const e of Array.from(this.globalCleanups))
|
|
1019
1378
|
try {
|
|
1020
1379
|
e();
|
|
1021
|
-
} catch (
|
|
1022
|
-
|
|
1380
|
+
} catch (r) {
|
|
1381
|
+
Te.warn("Failed to cleanup binding listener", r);
|
|
1023
1382
|
}
|
|
1024
1383
|
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);
|
|
1025
1384
|
}
|
|
1026
1385
|
parseMetadata(e) {
|
|
1027
1386
|
if (e)
|
|
1028
1387
|
try {
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1031
|
-
} catch (
|
|
1032
|
-
|
|
1388
|
+
const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
|
|
1389
|
+
return n.length === 0 ? void 0 : { bindings: n };
|
|
1390
|
+
} catch (r) {
|
|
1391
|
+
Te.warn("Failed to parse motion metadata", r);
|
|
1033
1392
|
return;
|
|
1034
1393
|
}
|
|
1035
1394
|
}
|
|
1036
1395
|
parseBinding(e) {
|
|
1037
|
-
const
|
|
1038
|
-
if (!
|
|
1396
|
+
const r = e.source?.trim();
|
|
1397
|
+
if (!r)
|
|
1039
1398
|
return;
|
|
1040
|
-
const
|
|
1041
|
-
return Number.isNaN(
|
|
1042
|
-
source:
|
|
1043
|
-
min:
|
|
1399
|
+
const n = Qe(e.min) ?? 0, o = Qe(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Mr(e.ease), f = Ur(e.map), l = e.targetId?.trim() || void 0;
|
|
1400
|
+
return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
|
|
1401
|
+
source: r.toLowerCase(),
|
|
1402
|
+
min: n,
|
|
1044
1403
|
max: s,
|
|
1045
1404
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1046
1405
|
reverse: a,
|
|
1047
1406
|
ease: c,
|
|
1048
|
-
map:
|
|
1407
|
+
map: f,
|
|
1049
1408
|
targetId: l
|
|
1050
1409
|
};
|
|
1051
1410
|
}
|
|
@@ -1053,7 +1412,7 @@ class En {
|
|
|
1053
1412
|
if (typeof document > "u" || this.observer)
|
|
1054
1413
|
return;
|
|
1055
1414
|
const e = () => {
|
|
1056
|
-
this.observer || typeof document > "u" || (this.observer = new MutationObserver((
|
|
1415
|
+
this.observer || typeof document > "u" || (this.observer = new MutationObserver((r) => this.handleMutations(r)), this.observer.observe(document.body, {
|
|
1057
1416
|
childList: !0,
|
|
1058
1417
|
subtree: !0,
|
|
1059
1418
|
attributes: !0,
|
|
@@ -1071,7 +1430,7 @@ class En {
|
|
|
1071
1430
|
scheduleScan(e) {
|
|
1072
1431
|
if (typeof document > "u" || (this.pendingScanStyles.add(e), this.scanScheduled))
|
|
1073
1432
|
return;
|
|
1074
|
-
const
|
|
1433
|
+
const r = () => {
|
|
1075
1434
|
if (this.pendingScanStyles.size === 0) {
|
|
1076
1435
|
this.scanScheduled = !1;
|
|
1077
1436
|
return;
|
|
@@ -1080,82 +1439,82 @@ class En {
|
|
|
1080
1439
|
this.pendingScanStyles.clear(), this.scanScheduled = !1;
|
|
1081
1440
|
for (const s of o)
|
|
1082
1441
|
this.scanExistingNodes(s);
|
|
1083
|
-
},
|
|
1084
|
-
this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(
|
|
1442
|
+
}, n = () => {
|
|
1443
|
+
this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(r) : setTimeout(r, 0);
|
|
1085
1444
|
};
|
|
1086
1445
|
document.readyState === "loading" ? document.addEventListener(
|
|
1087
1446
|
"DOMContentLoaded",
|
|
1088
1447
|
() => {
|
|
1089
|
-
|
|
1448
|
+
n();
|
|
1090
1449
|
},
|
|
1091
1450
|
{ once: !0 }
|
|
1092
|
-
) :
|
|
1451
|
+
) : n();
|
|
1093
1452
|
}
|
|
1094
1453
|
scanExistingNodes(e) {
|
|
1095
|
-
const
|
|
1096
|
-
if (!
|
|
1454
|
+
const r = this.bindingsByStyle.get(e);
|
|
1455
|
+
if (!r || typeof document > "u")
|
|
1097
1456
|
return;
|
|
1098
|
-
const
|
|
1099
|
-
document.querySelectorAll(
|
|
1457
|
+
const n = `.${et(e)}`;
|
|
1458
|
+
document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
|
|
1100
1459
|
}
|
|
1101
|
-
applyStyleToElement(e,
|
|
1102
|
-
this.ensureStyleState(e,
|
|
1460
|
+
applyStyleToElement(e, r, n) {
|
|
1461
|
+
this.ensureStyleState(e, r) && this.attachBindings(e, r, n);
|
|
1103
1462
|
}
|
|
1104
|
-
ensureStyleState(e,
|
|
1105
|
-
let
|
|
1106
|
-
if (
|
|
1463
|
+
ensureStyleState(e, r) {
|
|
1464
|
+
let n = this.elementStates.get(e);
|
|
1465
|
+
if (n || (n = /* @__PURE__ */ new Map(), this.elementStates.set(e, n)), n.has(r))
|
|
1107
1466
|
return !1;
|
|
1108
|
-
|
|
1109
|
-
let o = this.styleToElements.get(
|
|
1110
|
-
return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(
|
|
1467
|
+
n.set(r, /* @__PURE__ */ new Set());
|
|
1468
|
+
let o = this.styleToElements.get(r);
|
|
1469
|
+
return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(r, o)), o.add(e), !0;
|
|
1111
1470
|
}
|
|
1112
|
-
attachBindings(e,
|
|
1113
|
-
for (const o of
|
|
1114
|
-
this.attachBinding(e,
|
|
1471
|
+
attachBindings(e, r, n) {
|
|
1472
|
+
for (const o of n.bindings)
|
|
1473
|
+
this.attachBinding(e, r, o);
|
|
1115
1474
|
}
|
|
1116
|
-
attachBinding(e,
|
|
1117
|
-
switch (
|
|
1475
|
+
attachBinding(e, r, n) {
|
|
1476
|
+
switch (n.source) {
|
|
1118
1477
|
case "scrolly":
|
|
1119
|
-
this.attachScrollBinding(e,
|
|
1478
|
+
this.attachScrollBinding(e, r, n);
|
|
1120
1479
|
break;
|
|
1121
1480
|
}
|
|
1122
1481
|
}
|
|
1123
|
-
attachScrollBinding(e,
|
|
1124
|
-
const o = this.resolveScrollContainer(e,
|
|
1482
|
+
attachScrollBinding(e, r, n) {
|
|
1483
|
+
const o = this.resolveScrollContainer(e, n);
|
|
1125
1484
|
if (!o)
|
|
1126
1485
|
return;
|
|
1127
1486
|
const s = () => {
|
|
1128
|
-
this.applyBindingValues(e,
|
|
1487
|
+
this.applyBindingValues(e, n, o.scrollTop);
|
|
1129
1488
|
};
|
|
1130
1489
|
s();
|
|
1131
1490
|
const i = new AbortController();
|
|
1132
|
-
o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e,
|
|
1491
|
+
o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e, r, () => i.abort());
|
|
1133
1492
|
const a = () => s();
|
|
1134
|
-
window.addEventListener("resize", a), this.registerCleanup(e,
|
|
1493
|
+
window.addEventListener("resize", a), this.registerCleanup(e, r, () => window.removeEventListener("resize", a));
|
|
1135
1494
|
}
|
|
1136
|
-
resolveScrollContainer(e,
|
|
1137
|
-
if (
|
|
1138
|
-
const
|
|
1495
|
+
resolveScrollContainer(e, r) {
|
|
1496
|
+
if (r.targetId) {
|
|
1497
|
+
const n = `[data-ikon-motion-source="${et(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
|
|
1139
1498
|
if (o)
|
|
1140
1499
|
return o;
|
|
1141
1500
|
}
|
|
1142
1501
|
return e.closest('[data-ikon-view-type="scroll-view"]');
|
|
1143
1502
|
}
|
|
1144
|
-
applyBindingValues(e,
|
|
1145
|
-
const o =
|
|
1146
|
-
let i = this.applyClamp(s,
|
|
1147
|
-
|
|
1148
|
-
const a =
|
|
1149
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${
|
|
1150
|
-
const l = this.applyMap(
|
|
1503
|
+
applyBindingValues(e, r, n) {
|
|
1504
|
+
const o = r.max - r.min, s = o === 0 ? n > r.min ? 1 : 0 : (n - r.min) / o;
|
|
1505
|
+
let i = this.applyClamp(s, r.clamp);
|
|
1506
|
+
r.reverse && (i = 1 - i);
|
|
1507
|
+
const a = r.ease(i), c = Number.isFinite(a) ? a : 0, f = c * 100;
|
|
1508
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${f}`), r.map) {
|
|
1509
|
+
const l = this.applyMap(f, r.map);
|
|
1151
1510
|
l !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${l}`);
|
|
1152
1511
|
} else
|
|
1153
1512
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
1154
1513
|
}
|
|
1155
|
-
applyClamp(e,
|
|
1514
|
+
applyClamp(e, r) {
|
|
1156
1515
|
if (!Number.isFinite(e))
|
|
1157
1516
|
return 0;
|
|
1158
|
-
switch (
|
|
1517
|
+
switch (r) {
|
|
1159
1518
|
case "freeze-start":
|
|
1160
1519
|
return e < 0 ? 0 : e;
|
|
1161
1520
|
case "freeze-end":
|
|
@@ -1163,265 +1522,265 @@ class En {
|
|
|
1163
1522
|
case "unclamped":
|
|
1164
1523
|
return e;
|
|
1165
1524
|
default:
|
|
1166
|
-
return
|
|
1525
|
+
return D(e);
|
|
1167
1526
|
}
|
|
1168
1527
|
}
|
|
1169
|
-
applyMap(e,
|
|
1170
|
-
const
|
|
1171
|
-
if (
|
|
1172
|
-
return
|
|
1173
|
-
const o = (e -
|
|
1174
|
-
return
|
|
1528
|
+
applyMap(e, r) {
|
|
1529
|
+
const n = r.inEnd - r.inStart;
|
|
1530
|
+
if (n === 0)
|
|
1531
|
+
return r.outEnd;
|
|
1532
|
+
const o = (e - r.inStart) / n;
|
|
1533
|
+
return r.outStart + o * (r.outEnd - r.outStart);
|
|
1175
1534
|
}
|
|
1176
|
-
registerCleanup(e,
|
|
1177
|
-
const s = this.elementStates.get(e)?.get(
|
|
1178
|
-
s && (s.add(
|
|
1535
|
+
registerCleanup(e, r, n) {
|
|
1536
|
+
const s = this.elementStates.get(e)?.get(r);
|
|
1537
|
+
s && (s.add(n), this.globalCleanups.add(n));
|
|
1179
1538
|
}
|
|
1180
1539
|
cleanupStyle(e) {
|
|
1181
|
-
const
|
|
1182
|
-
if (!
|
|
1540
|
+
const r = this.styleToElements.get(e);
|
|
1541
|
+
if (!r)
|
|
1183
1542
|
return;
|
|
1184
|
-
const
|
|
1185
|
-
for (const o of
|
|
1543
|
+
const n = Array.from(r);
|
|
1544
|
+
for (const o of n)
|
|
1186
1545
|
this.cleanupElementStyle(o, e);
|
|
1187
1546
|
this.styleToElements.delete(e);
|
|
1188
1547
|
}
|
|
1189
1548
|
cleanupElement(e) {
|
|
1190
|
-
const
|
|
1191
|
-
if (!
|
|
1549
|
+
const r = this.elementStates.get(e);
|
|
1550
|
+
if (!r)
|
|
1192
1551
|
return;
|
|
1193
|
-
const
|
|
1194
|
-
for (const o of
|
|
1552
|
+
const n = Array.from(r.keys());
|
|
1553
|
+
for (const o of n)
|
|
1195
1554
|
this.cleanupElementStyle(e, o);
|
|
1196
1555
|
}
|
|
1197
|
-
cleanupElementStyle(e,
|
|
1198
|
-
const
|
|
1199
|
-
if (!
|
|
1556
|
+
cleanupElementStyle(e, r) {
|
|
1557
|
+
const n = this.elementStates.get(e);
|
|
1558
|
+
if (!n)
|
|
1200
1559
|
return;
|
|
1201
|
-
const o =
|
|
1560
|
+
const o = n.get(r);
|
|
1202
1561
|
if (!o)
|
|
1203
1562
|
return;
|
|
1204
1563
|
for (const i of o) {
|
|
1205
1564
|
try {
|
|
1206
1565
|
i();
|
|
1207
1566
|
} catch (a) {
|
|
1208
|
-
|
|
1567
|
+
Te.warn("Failed to cleanup listener", a);
|
|
1209
1568
|
}
|
|
1210
1569
|
this.globalCleanups.delete(i);
|
|
1211
1570
|
}
|
|
1212
|
-
o.clear(),
|
|
1213
|
-
const s = this.styleToElements.get(
|
|
1214
|
-
s && (s.delete(e), s.size === 0 && this.styleToElements.delete(
|
|
1571
|
+
o.clear(), n.delete(r);
|
|
1572
|
+
const s = this.styleToElements.get(r);
|
|
1573
|
+
s && (s.delete(e), s.size === 0 && this.styleToElements.delete(r)), n.size === 0 && (this.elementStates.delete(e), this.clearBindingProperties(e));
|
|
1215
1574
|
}
|
|
1216
1575
|
clearBindingProperties(e) {
|
|
1217
1576
|
e.style.removeProperty("--tw-motion-bind-source-value"), e.style.removeProperty("--tw-motion-bind-progress"), e.style.removeProperty("--tw-motion-bind-progress-ratio"), e.style.removeProperty("--tw-motion-bind-value");
|
|
1218
1577
|
}
|
|
1219
1578
|
handleMutations(e) {
|
|
1220
|
-
for (const
|
|
1221
|
-
|
|
1579
|
+
for (const r of e)
|
|
1580
|
+
r.type === "childList" ? (r.addedNodes.forEach((n) => this.scanNode(n)), r.removedNodes.forEach((n) => this.cleanupNode(n))) : r.type === "attributes" && r.target instanceof HTMLElement && this.handleClassMutation(r.target);
|
|
1222
1581
|
}
|
|
1223
1582
|
handleClassMutation(e) {
|
|
1224
|
-
const
|
|
1225
|
-
if (!
|
|
1583
|
+
const r = this.elementStates.get(e);
|
|
1584
|
+
if (!r) {
|
|
1226
1585
|
this.processElement(e);
|
|
1227
1586
|
return;
|
|
1228
1587
|
}
|
|
1229
|
-
for (const
|
|
1230
|
-
e.classList.contains(
|
|
1588
|
+
for (const n of r.keys())
|
|
1589
|
+
e.classList.contains(n) || this.cleanupElementStyle(e, n);
|
|
1231
1590
|
this.processElement(e);
|
|
1232
1591
|
}
|
|
1233
1592
|
scanNode(e) {
|
|
1234
1593
|
if (!(e instanceof HTMLElement))
|
|
1235
1594
|
return;
|
|
1236
|
-
this.processElement(e), e.querySelectorAll("[class]").forEach((
|
|
1595
|
+
this.processElement(e), e.querySelectorAll("[class]").forEach((n) => this.processElement(n));
|
|
1237
1596
|
}
|
|
1238
1597
|
cleanupNode(e) {
|
|
1239
1598
|
if (!(e instanceof HTMLElement))
|
|
1240
1599
|
return;
|
|
1241
|
-
this.cleanupElement(e), e.querySelectorAll("[class]").forEach((
|
|
1600
|
+
this.cleanupElement(e), e.querySelectorAll("[class]").forEach((n) => this.cleanupElement(n));
|
|
1242
1601
|
}
|
|
1243
1602
|
processElement(e) {
|
|
1244
1603
|
if (!e.classList || e.classList.length === 0)
|
|
1245
1604
|
return;
|
|
1246
|
-
const
|
|
1247
|
-
for (let
|
|
1248
|
-
const o = n
|
|
1605
|
+
const r = e.classList;
|
|
1606
|
+
for (let n = 0; n < r.length; n++) {
|
|
1607
|
+
const o = r[n], s = this.bindingsByStyle.get(o);
|
|
1249
1608
|
s && this.ensureStyleState(e, o) && this.attachBindings(e, o, s);
|
|
1250
1609
|
}
|
|
1251
1610
|
}
|
|
1252
1611
|
}
|
|
1253
|
-
const
|
|
1254
|
-
function
|
|
1255
|
-
const e =
|
|
1612
|
+
const Ce = new Lr();
|
|
1613
|
+
function xr(t) {
|
|
1614
|
+
const e = w(/* @__PURE__ */ new Map()), r = B(({ styleId: s, css: i, common: a }) => {
|
|
1256
1615
|
if (!(!s || typeof document > "u")) {
|
|
1257
1616
|
if (i) {
|
|
1258
1617
|
let c = e.current.get(s);
|
|
1259
1618
|
c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
|
|
1260
1619
|
}
|
|
1261
|
-
|
|
1620
|
+
Ce.registerStyle(s, a);
|
|
1262
1621
|
}
|
|
1263
|
-
}, []),
|
|
1622
|
+
}, []), n = B((s) => {
|
|
1264
1623
|
if (!(typeof document > "u"))
|
|
1265
1624
|
for (const i of s) {
|
|
1266
1625
|
const a = e.current.get(i);
|
|
1267
|
-
a && (a.remove(), e.current.delete(i)),
|
|
1626
|
+
a && (a.remove(), e.current.delete(i)), Ce.unregisterStyle(i);
|
|
1268
1627
|
}
|
|
1269
|
-
}, []), o =
|
|
1628
|
+
}, []), o = B(() => {
|
|
1270
1629
|
if (typeof document < "u") {
|
|
1271
1630
|
for (const s of e.current.values())
|
|
1272
1631
|
s.remove();
|
|
1273
1632
|
e.current.clear();
|
|
1274
1633
|
}
|
|
1275
|
-
|
|
1634
|
+
Ce.reset();
|
|
1276
1635
|
}, []);
|
|
1277
|
-
return
|
|
1636
|
+
return F(() => {
|
|
1278
1637
|
if (!t) return;
|
|
1279
1638
|
for (const a of t.getUiStyles())
|
|
1280
|
-
|
|
1281
|
-
const s = t.subscribeToStyles(
|
|
1639
|
+
r(a);
|
|
1640
|
+
const s = t.subscribeToStyles(r), i = t.subscribeToStyleDeletes?.(n);
|
|
1282
1641
|
return () => {
|
|
1283
1642
|
s?.(), i?.(), o();
|
|
1284
1643
|
};
|
|
1285
|
-
}, [t, o,
|
|
1644
|
+
}, [t, o, r, n]), F(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
|
|
1286
1645
|
}
|
|
1287
|
-
function
|
|
1646
|
+
function Dr(t) {
|
|
1288
1647
|
const e = [];
|
|
1289
|
-
for (const [
|
|
1290
|
-
const o =
|
|
1291
|
-
e.push(`${
|
|
1648
|
+
for (const [r, n] of t) {
|
|
1649
|
+
const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
|
|
1650
|
+
e.push(`${r}:${s ? "1" : "0"}`);
|
|
1292
1651
|
}
|
|
1293
1652
|
return e.sort(), e.join(",");
|
|
1294
1653
|
}
|
|
1295
|
-
function
|
|
1296
|
-
const [e,
|
|
1297
|
-
return
|
|
1654
|
+
function Fr(t) {
|
|
1655
|
+
const [e, r] = ee(), n = w("");
|
|
1656
|
+
return F(() => {
|
|
1298
1657
|
if (!t) {
|
|
1299
|
-
|
|
1658
|
+
r(void 0), n.current = "";
|
|
1300
1659
|
return;
|
|
1301
1660
|
}
|
|
1302
1661
|
const o = () => {
|
|
1303
|
-
const s = t.getStores(), i =
|
|
1304
|
-
i !==
|
|
1662
|
+
const s = t.getStores(), i = Dr(s);
|
|
1663
|
+
i !== n.current && (n.current = i, r(s));
|
|
1305
1664
|
};
|
|
1306
1665
|
return o(), t.subscribe(o);
|
|
1307
1666
|
}, [t]), e;
|
|
1308
1667
|
}
|
|
1309
|
-
var
|
|
1310
|
-
function
|
|
1311
|
-
var e =
|
|
1668
|
+
var $r = typeof global == "object" && global && global.Object === Object && global, Br = typeof self == "object" && self && self.Object === Object && self, Vr = $r || Br || Function("return this")(), we = Vr.Symbol, ht = Object.prototype, Kr = ht.hasOwnProperty, zr = ht.toString, le = we ? we.toStringTag : void 0;
|
|
1669
|
+
function Yr(t) {
|
|
1670
|
+
var e = Kr.call(t, le), r = t[le];
|
|
1312
1671
|
try {
|
|
1313
|
-
t[
|
|
1314
|
-
var
|
|
1672
|
+
t[le] = void 0;
|
|
1673
|
+
var n = !0;
|
|
1315
1674
|
} catch {
|
|
1316
1675
|
}
|
|
1317
|
-
var o =
|
|
1318
|
-
return
|
|
1676
|
+
var o = zr.call(t);
|
|
1677
|
+
return n && (e ? t[le] = r : delete t[le]), o;
|
|
1319
1678
|
}
|
|
1320
|
-
var
|
|
1321
|
-
function
|
|
1322
|
-
return
|
|
1679
|
+
var Wr = Object.prototype, qr = Wr.toString;
|
|
1680
|
+
function Jr(t) {
|
|
1681
|
+
return qr.call(t);
|
|
1323
1682
|
}
|
|
1324
|
-
var
|
|
1325
|
-
function
|
|
1326
|
-
return t == null ? t === void 0 ?
|
|
1683
|
+
var Gr = "[object Null]", Hr = "[object Undefined]", rt = we ? we.toStringTag : void 0;
|
|
1684
|
+
function Xr(t) {
|
|
1685
|
+
return t == null ? t === void 0 ? Hr : Gr : rt && rt in Object(t) ? Yr(t) : Jr(t);
|
|
1327
1686
|
}
|
|
1328
|
-
function
|
|
1687
|
+
function Zr(t) {
|
|
1329
1688
|
return t != null && typeof t == "object";
|
|
1330
1689
|
}
|
|
1331
|
-
var
|
|
1332
|
-
function
|
|
1333
|
-
return typeof t == "string" || !
|
|
1690
|
+
var Qr = Array.isArray, en = "[object String]";
|
|
1691
|
+
function tn(t) {
|
|
1692
|
+
return typeof t == "string" || !Qr(t) && Zr(t) && Xr(t) == en;
|
|
1334
1693
|
}
|
|
1335
1694
|
const nt = "ikonUiModules";
|
|
1336
|
-
function
|
|
1695
|
+
function xe(t) {
|
|
1337
1696
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
1338
1697
|
}
|
|
1339
|
-
function
|
|
1698
|
+
function rn(t) {
|
|
1340
1699
|
if (!Array.isArray(t))
|
|
1341
1700
|
return;
|
|
1342
1701
|
const e = /* @__PURE__ */ new Set();
|
|
1343
|
-
for (const
|
|
1344
|
-
if (!
|
|
1345
|
-
const
|
|
1346
|
-
|
|
1702
|
+
for (const r of t) {
|
|
1703
|
+
if (!tn(r)) continue;
|
|
1704
|
+
const n = r.trim();
|
|
1705
|
+
n && (e.has(n) || e.add(n));
|
|
1347
1706
|
}
|
|
1348
1707
|
return Array.from(e);
|
|
1349
1708
|
}
|
|
1350
|
-
function
|
|
1709
|
+
function Qn(t, e) {
|
|
1351
1710
|
if (t === e)
|
|
1352
1711
|
return !0;
|
|
1353
1712
|
if (!t || !e)
|
|
1354
1713
|
return !t && !e;
|
|
1355
1714
|
if (t.length !== e.length)
|
|
1356
1715
|
return !1;
|
|
1357
|
-
for (let
|
|
1358
|
-
if (t[
|
|
1716
|
+
for (let r = 0; r < t.length; r += 1)
|
|
1717
|
+
if (t[r] !== e[r])
|
|
1359
1718
|
return !1;
|
|
1360
1719
|
return !0;
|
|
1361
1720
|
}
|
|
1362
|
-
function
|
|
1363
|
-
if (!(!
|
|
1364
|
-
return
|
|
1721
|
+
function nn(t) {
|
|
1722
|
+
if (!(!xe(t) || !Object.prototype.hasOwnProperty.call(t, nt)))
|
|
1723
|
+
return rn(t[nt]);
|
|
1365
1724
|
}
|
|
1366
|
-
function
|
|
1725
|
+
function eo(...t) {
|
|
1367
1726
|
for (const e of t) {
|
|
1368
|
-
const
|
|
1369
|
-
if (
|
|
1370
|
-
return
|
|
1727
|
+
const r = nn(e);
|
|
1728
|
+
if (r !== void 0)
|
|
1729
|
+
return r;
|
|
1371
1730
|
}
|
|
1372
1731
|
}
|
|
1373
|
-
function
|
|
1374
|
-
if (!
|
|
1732
|
+
function to(t) {
|
|
1733
|
+
if (!xe(t))
|
|
1375
1734
|
return;
|
|
1376
|
-
const e = t,
|
|
1377
|
-
if (!
|
|
1735
|
+
const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
|
|
1736
|
+
if (!r)
|
|
1378
1737
|
return;
|
|
1379
|
-
const
|
|
1380
|
-
if (
|
|
1738
|
+
const n = e[r];
|
|
1739
|
+
if (n === null)
|
|
1381
1740
|
return { resetToDefault: !0 };
|
|
1382
|
-
if (!Array.isArray(
|
|
1741
|
+
if (!Array.isArray(n))
|
|
1383
1742
|
return;
|
|
1384
1743
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
1385
|
-
for (const c of
|
|
1744
|
+
for (const c of n) {
|
|
1386
1745
|
if (typeof c == "string") {
|
|
1387
|
-
const
|
|
1388
|
-
if (!
|
|
1746
|
+
const b = c.trim();
|
|
1747
|
+
if (!b || i.has(b))
|
|
1389
1748
|
continue;
|
|
1390
|
-
o.push(
|
|
1749
|
+
o.push(b), i.add(b);
|
|
1391
1750
|
continue;
|
|
1392
1751
|
}
|
|
1393
|
-
if (!
|
|
1752
|
+
if (!xe(c))
|
|
1394
1753
|
continue;
|
|
1395
|
-
const
|
|
1754
|
+
const f = c, l = Object.keys(f).find((b) => b.toLowerCase() === "name");
|
|
1396
1755
|
if (!l)
|
|
1397
1756
|
continue;
|
|
1398
|
-
const h =
|
|
1757
|
+
const h = f[l];
|
|
1399
1758
|
if (typeof h != "string")
|
|
1400
1759
|
continue;
|
|
1401
|
-
const
|
|
1402
|
-
if (!
|
|
1760
|
+
const d = h.trim();
|
|
1761
|
+
if (!d)
|
|
1403
1762
|
continue;
|
|
1404
|
-
const
|
|
1405
|
-
typeof S == "string" && s.set(
|
|
1763
|
+
const y = Object.keys(f).find((b) => b.toLowerCase() === "javascript"), S = y ? f[y] : void 0;
|
|
1764
|
+
typeof S == "string" && s.set(d, S), i.has(d) || (o.push(d), i.add(d));
|
|
1406
1765
|
}
|
|
1407
1766
|
if (!o.length && s.size === 0)
|
|
1408
1767
|
return { modules: [] };
|
|
1409
|
-
const a = Array.from(s.entries()).map(([c,
|
|
1768
|
+
const a = Array.from(s.entries()).map(([c, f]) => ({
|
|
1410
1769
|
name: c,
|
|
1411
|
-
javascript:
|
|
1770
|
+
javascript: f
|
|
1412
1771
|
}));
|
|
1413
1772
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
1414
1773
|
}
|
|
1415
|
-
const
|
|
1774
|
+
const v = {
|
|
1416
1775
|
None: 0,
|
|
1417
1776
|
Letter: 1,
|
|
1418
1777
|
Word: 2,
|
|
1419
1778
|
Line: 4,
|
|
1420
1779
|
Paragraph: 8,
|
|
1421
1780
|
Emoji: 16
|
|
1422
|
-
},
|
|
1781
|
+
}, on = [
|
|
1423
1782
|
{
|
|
1424
|
-
flag:
|
|
1783
|
+
flag: v.Letter,
|
|
1425
1784
|
hints: [
|
|
1426
1785
|
"[data-motion-letter]",
|
|
1427
1786
|
"[data-letter]",
|
|
@@ -1430,7 +1789,7 @@ const b = {
|
|
|
1430
1789
|
]
|
|
1431
1790
|
},
|
|
1432
1791
|
{
|
|
1433
|
-
flag:
|
|
1792
|
+
flag: v.Word,
|
|
1434
1793
|
hints: [
|
|
1435
1794
|
"[data-motion-word]",
|
|
1436
1795
|
"[data-word]",
|
|
@@ -1439,7 +1798,7 @@ const b = {
|
|
|
1439
1798
|
]
|
|
1440
1799
|
},
|
|
1441
1800
|
{
|
|
1442
|
-
flag:
|
|
1801
|
+
flag: v.Line,
|
|
1443
1802
|
hints: [
|
|
1444
1803
|
"[data-motion-line]",
|
|
1445
1804
|
"[data-line]",
|
|
@@ -1448,7 +1807,7 @@ const b = {
|
|
|
1448
1807
|
]
|
|
1449
1808
|
},
|
|
1450
1809
|
{
|
|
1451
|
-
flag:
|
|
1810
|
+
flag: v.Paragraph,
|
|
1452
1811
|
hints: [
|
|
1453
1812
|
"[data-motion-paragraph]",
|
|
1454
1813
|
"[data-paragraph]",
|
|
@@ -1459,7 +1818,7 @@ const b = {
|
|
|
1459
1818
|
]
|
|
1460
1819
|
},
|
|
1461
1820
|
{
|
|
1462
|
-
flag:
|
|
1821
|
+
flag: v.Emoji,
|
|
1463
1822
|
hints: [
|
|
1464
1823
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
1465
1824
|
"[data-motion-emoji]",
|
|
@@ -1468,160 +1827,160 @@ const b = {
|
|
|
1468
1827
|
"[data-emoji]"
|
|
1469
1828
|
]
|
|
1470
1829
|
}
|
|
1471
|
-
],
|
|
1472
|
-
function
|
|
1473
|
-
if (!t || t.length >
|
|
1830
|
+
], De = v.Letter | v.Word | v.Line | v.Paragraph | v.Emoji, sn = v.Letter | v.Word | v.Line | v.Paragraph, ot = /* @__PURE__ */ new Map(), an = 16384;
|
|
1831
|
+
function ro(t, e) {
|
|
1832
|
+
if (!t || t.length > an)
|
|
1474
1833
|
return t;
|
|
1475
|
-
const
|
|
1476
|
-
if (o ===
|
|
1834
|
+
const r = An(e), n = re(r, v.Emoji), o = r & sn;
|
|
1835
|
+
if (o === v.None && !n)
|
|
1477
1836
|
return t;
|
|
1478
1837
|
const s = t.replace(/\r\n/g, `
|
|
1479
1838
|
`).replace(/\r/g, `
|
|
1480
1839
|
`);
|
|
1481
|
-
if (o ===
|
|
1482
|
-
return
|
|
1483
|
-
const i =
|
|
1840
|
+
if (o === v.None)
|
|
1841
|
+
return ct(s);
|
|
1842
|
+
const i = Rn(s);
|
|
1484
1843
|
if (i.length === 0)
|
|
1485
|
-
return
|
|
1486
|
-
const a =
|
|
1844
|
+
return n ? ct(s) : t;
|
|
1845
|
+
const a = En(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
|
|
1487
1846
|
for (const l of a) {
|
|
1488
|
-
const h =
|
|
1489
|
-
|
|
1847
|
+
const h = cn(l, r, c);
|
|
1848
|
+
f.push(...h);
|
|
1490
1849
|
}
|
|
1491
|
-
return
|
|
1850
|
+
return f;
|
|
1492
1851
|
}
|
|
1493
|
-
function
|
|
1494
|
-
const
|
|
1852
|
+
function cn(t, e, r) {
|
|
1853
|
+
const n = [];
|
|
1495
1854
|
for (const o of t) {
|
|
1496
|
-
const s =
|
|
1497
|
-
|
|
1855
|
+
const s = un(o, e, r);
|
|
1856
|
+
n.push(...s);
|
|
1498
1857
|
}
|
|
1499
|
-
if (
|
|
1500
|
-
const o =
|
|
1858
|
+
if (re(e, v.Paragraph)) {
|
|
1859
|
+
const o = r.paragraph++;
|
|
1501
1860
|
return [
|
|
1502
|
-
/* @__PURE__ */
|
|
1861
|
+
/* @__PURE__ */ R.jsx(
|
|
1503
1862
|
"span",
|
|
1504
1863
|
{
|
|
1505
1864
|
"data-motion-paragraph": !0,
|
|
1506
|
-
style:
|
|
1507
|
-
children:
|
|
1865
|
+
style: Ee(o),
|
|
1866
|
+
children: n
|
|
1508
1867
|
},
|
|
1509
1868
|
`motion-paragraph-${o}`
|
|
1510
1869
|
)
|
|
1511
1870
|
];
|
|
1512
1871
|
}
|
|
1513
|
-
return
|
|
1872
|
+
return n;
|
|
1514
1873
|
}
|
|
1515
|
-
function
|
|
1516
|
-
const
|
|
1517
|
-
if (
|
|
1518
|
-
const s =
|
|
1874
|
+
function un(t, e, r) {
|
|
1875
|
+
const n = ln(t.text, e, r), o = [];
|
|
1876
|
+
if (re(e, v.Line)) {
|
|
1877
|
+
const s = r.line++;
|
|
1519
1878
|
o.push(
|
|
1520
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style: Ee(s), children: n }, `motion-line-${s}`)
|
|
1521
1880
|
);
|
|
1522
1881
|
} else
|
|
1523
|
-
o.push(...
|
|
1882
|
+
o.push(...n);
|
|
1524
1883
|
for (let s = 0; s < t.breaks; s++)
|
|
1525
|
-
o.push(/* @__PURE__ */
|
|
1884
|
+
o.push(/* @__PURE__ */ R.jsx("br", {}, `motion-break-${r.br++}`));
|
|
1526
1885
|
return o;
|
|
1527
1886
|
}
|
|
1528
|
-
function
|
|
1887
|
+
function ln(t, e, r) {
|
|
1529
1888
|
if (!t)
|
|
1530
1889
|
return [];
|
|
1531
|
-
const
|
|
1890
|
+
const n = re(e, v.Word), o = [], s = /(\s+)/g;
|
|
1532
1891
|
let i = 0, a;
|
|
1533
1892
|
for (; (a = s.exec(t)) !== null; ) {
|
|
1534
1893
|
if (a.index > i) {
|
|
1535
1894
|
const c = t.slice(i, a.index);
|
|
1536
|
-
o.push(
|
|
1895
|
+
o.push(st(c, r, e, n));
|
|
1537
1896
|
}
|
|
1538
1897
|
o.push(a[0]), i = a.index + a[0].length;
|
|
1539
1898
|
}
|
|
1540
1899
|
if (i < t.length) {
|
|
1541
1900
|
const c = t.slice(i);
|
|
1542
|
-
o.push(
|
|
1901
|
+
o.push(st(c, r, e, n));
|
|
1543
1902
|
}
|
|
1544
1903
|
return o;
|
|
1545
1904
|
}
|
|
1546
|
-
function
|
|
1547
|
-
const o = e.word++, s =
|
|
1548
|
-
return
|
|
1905
|
+
function st(t, e, r, n) {
|
|
1906
|
+
const o = e.word++, s = fn(t, r, e), i = `motion-word-${o}`, a = dn(o, n);
|
|
1907
|
+
return n ? /* @__PURE__ */ R.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ R.jsx("span", { style: a, children: s }, i);
|
|
1549
1908
|
}
|
|
1550
|
-
function
|
|
1551
|
-
return e ? { ...
|
|
1909
|
+
function dn(t, e) {
|
|
1910
|
+
return e ? { ...Ee(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
|
|
1552
1911
|
}
|
|
1553
|
-
function
|
|
1912
|
+
function fn(t, e, r) {
|
|
1554
1913
|
if (!t)
|
|
1555
1914
|
return [];
|
|
1556
|
-
const
|
|
1557
|
-
if (!
|
|
1915
|
+
const n = re(e, v.Letter), o = re(e, v.Emoji);
|
|
1916
|
+
if (!n) {
|
|
1558
1917
|
if (!o)
|
|
1559
1918
|
return [t];
|
|
1560
|
-
const a =
|
|
1919
|
+
const a = Fe(t);
|
|
1561
1920
|
if (a.length === 0)
|
|
1562
1921
|
return [t];
|
|
1563
|
-
const { nodes: c } = pt(a,
|
|
1922
|
+
const { nodes: c } = pt(a, r);
|
|
1564
1923
|
return c;
|
|
1565
1924
|
}
|
|
1566
|
-
const s = [], i =
|
|
1925
|
+
const s = [], i = Fe(t);
|
|
1567
1926
|
for (const a of i) {
|
|
1568
|
-
const c =
|
|
1927
|
+
const c = r.letter++, f = `motion-letter-${c}`, l = Ee(c);
|
|
1569
1928
|
if (a === `
|
|
1570
1929
|
`) {
|
|
1571
1930
|
s.push(
|
|
1572
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: l, children: /* @__PURE__ */ R.jsx("br", {}) }, f)
|
|
1573
1932
|
);
|
|
1574
1933
|
continue;
|
|
1575
1934
|
}
|
|
1576
|
-
const
|
|
1935
|
+
const d = o && mt(a) ? { "data-motion-emoji": !0 } : void 0, y = a === " " ? " " : a;
|
|
1577
1936
|
s.push(
|
|
1578
|
-
/* @__PURE__ */
|
|
1937
|
+
/* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: l, ...d, children: y }, f)
|
|
1579
1938
|
);
|
|
1580
1939
|
}
|
|
1581
1940
|
return s;
|
|
1582
1941
|
}
|
|
1583
|
-
function
|
|
1942
|
+
function Fe(t) {
|
|
1584
1943
|
if (!t)
|
|
1585
1944
|
return [];
|
|
1586
|
-
const e =
|
|
1587
|
-
return e ? Array.from(e.segment(t), (
|
|
1945
|
+
const e = hn();
|
|
1946
|
+
return e ? Array.from(e.segment(t), (r) => r.segment) : mn(t);
|
|
1588
1947
|
}
|
|
1589
|
-
let
|
|
1590
|
-
function
|
|
1591
|
-
return
|
|
1948
|
+
let de;
|
|
1949
|
+
function hn() {
|
|
1950
|
+
return de !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? de = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : de = null), de;
|
|
1592
1951
|
}
|
|
1593
|
-
function
|
|
1594
|
-
const e = [],
|
|
1595
|
-
let
|
|
1596
|
-
for (let o = 0; o <
|
|
1597
|
-
const s =
|
|
1598
|
-
|
|
1952
|
+
function mn(t) {
|
|
1953
|
+
const e = [], r = Array.from(t);
|
|
1954
|
+
let n = "";
|
|
1955
|
+
for (let o = 0; o < r.length; o++) {
|
|
1956
|
+
const s = r[o], i = r[o + 1];
|
|
1957
|
+
n += s, !(i && pn(s, i)) && (e.push(n), n = "");
|
|
1599
1958
|
}
|
|
1600
|
-
return
|
|
1959
|
+
return n && e.push(n), e;
|
|
1601
1960
|
}
|
|
1602
|
-
function
|
|
1603
|
-
return e ? !!(
|
|
1961
|
+
function pn(t, e) {
|
|
1962
|
+
return e ? !!(it(t) || it(e) || Sn(e) || gn(e) || yn(e) || at(t) && at(e)) : !1;
|
|
1604
1963
|
}
|
|
1605
|
-
function
|
|
1964
|
+
function it(t) {
|
|
1606
1965
|
return t.codePointAt(0) === 8205;
|
|
1607
1966
|
}
|
|
1608
|
-
function
|
|
1967
|
+
function gn(t) {
|
|
1609
1968
|
const e = t.codePointAt(0);
|
|
1610
1969
|
return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
|
|
1611
1970
|
}
|
|
1612
|
-
function
|
|
1971
|
+
function yn(t) {
|
|
1613
1972
|
const e = t.codePointAt(0);
|
|
1614
1973
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
1615
1974
|
}
|
|
1616
|
-
function
|
|
1975
|
+
function at(t) {
|
|
1617
1976
|
const e = t.codePointAt(0);
|
|
1618
1977
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
1619
1978
|
}
|
|
1620
1979
|
let Ie;
|
|
1621
|
-
function
|
|
1622
|
-
return t ? (Ie || (Ie =
|
|
1980
|
+
function Sn(t) {
|
|
1981
|
+
return t ? (Ie || (Ie = bn()), Ie(t)) : !1;
|
|
1623
1982
|
}
|
|
1624
|
-
function
|
|
1983
|
+
function bn() {
|
|
1625
1984
|
try {
|
|
1626
1985
|
const t = new RegExp("\\p{Mark}", "u");
|
|
1627
1986
|
return (e) => t.test(e);
|
|
@@ -1632,55 +1991,55 @@ function rr() {
|
|
|
1632
1991
|
};
|
|
1633
1992
|
}
|
|
1634
1993
|
}
|
|
1635
|
-
let
|
|
1636
|
-
function
|
|
1637
|
-
return t ? (
|
|
1994
|
+
let Ne;
|
|
1995
|
+
function mt(t) {
|
|
1996
|
+
return t ? (Ne || (Ne = wn()), Ne(t)) : !1;
|
|
1638
1997
|
}
|
|
1639
|
-
function
|
|
1998
|
+
function wn() {
|
|
1640
1999
|
try {
|
|
1641
2000
|
const t = new RegExp("\\p{Extended_Pictographic}", "u");
|
|
1642
2001
|
return (e) => t.test(e);
|
|
1643
2002
|
} catch {
|
|
1644
|
-
return
|
|
2003
|
+
return vn;
|
|
1645
2004
|
}
|
|
1646
2005
|
}
|
|
1647
|
-
function
|
|
2006
|
+
function vn(t) {
|
|
1648
2007
|
if (!t)
|
|
1649
2008
|
return !1;
|
|
1650
2009
|
for (const e of Array.from(t)) {
|
|
1651
|
-
const
|
|
1652
|
-
if (
|
|
2010
|
+
const r = e.codePointAt(0);
|
|
2011
|
+
if (r !== void 0 && (r >= 126976 && r <= 127231 || r >= 127232 && r <= 127487 || r >= 127488 && r <= 127743 || r >= 127744 && r <= 128511 || r >= 128512 && r <= 128591 || r >= 128640 && r <= 128767 || r >= 128768 && r <= 128895 || r >= 128896 && r <= 129023 || r >= 129024 && r <= 129279 || r >= 129280 && r <= 129535 || r >= 129536 && r <= 129791 || r >= 9728 && r <= 9983 || r >= 9984 && r <= 10175 || r === 8205 || r === 65039 || r === 8419))
|
|
1653
2012
|
return !0;
|
|
1654
2013
|
}
|
|
1655
2014
|
return !1;
|
|
1656
2015
|
}
|
|
1657
|
-
function
|
|
2016
|
+
function Rn(t) {
|
|
1658
2017
|
const e = [];
|
|
1659
|
-
let
|
|
2018
|
+
let r = "", n = 0;
|
|
1660
2019
|
for (let o = 0; o < t.length; o++) {
|
|
1661
2020
|
const s = t[o];
|
|
1662
2021
|
if (s === `
|
|
1663
2022
|
`) {
|
|
1664
|
-
|
|
2023
|
+
n += 1;
|
|
1665
2024
|
continue;
|
|
1666
2025
|
}
|
|
1667
|
-
|
|
2026
|
+
n > 0 && (e.push({ text: r, breaks: n }), r = "", n = 0), r += s;
|
|
1668
2027
|
}
|
|
1669
|
-
return (
|
|
2028
|
+
return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
|
|
1670
2029
|
}
|
|
1671
|
-
function
|
|
2030
|
+
function En(t) {
|
|
1672
2031
|
if (t.length === 0)
|
|
1673
2032
|
return [];
|
|
1674
2033
|
const e = [];
|
|
1675
|
-
let
|
|
1676
|
-
for (const
|
|
1677
|
-
|
|
1678
|
-
return
|
|
2034
|
+
let r = [];
|
|
2035
|
+
for (const n of t)
|
|
2036
|
+
r.push(n), n.breaks >= 2 && (e.push(r), r = []);
|
|
2037
|
+
return r.length > 0 && e.push(r), e;
|
|
1679
2038
|
}
|
|
1680
|
-
function
|
|
2039
|
+
function re(t, e) {
|
|
1681
2040
|
return (t & e) === e;
|
|
1682
2041
|
}
|
|
1683
|
-
function
|
|
2042
|
+
function Ee(t) {
|
|
1684
2043
|
return {
|
|
1685
2044
|
"--tw-motion-seq-index": t.toString(),
|
|
1686
2045
|
backgroundColor: "inherit",
|
|
@@ -1697,123 +2056,123 @@ function Re(t) {
|
|
|
1697
2056
|
WebkitTextFillColor: "inherit"
|
|
1698
2057
|
};
|
|
1699
2058
|
}
|
|
1700
|
-
function
|
|
2059
|
+
function ct(t) {
|
|
1701
2060
|
if (!t)
|
|
1702
2061
|
return t;
|
|
1703
|
-
const e =
|
|
2062
|
+
const e = Fe(t);
|
|
1704
2063
|
if (e.length === 0)
|
|
1705
2064
|
return t;
|
|
1706
|
-
const { nodes:
|
|
1707
|
-
return
|
|
2065
|
+
const { nodes: r, sawEmoji: n } = pt(e);
|
|
2066
|
+
return n ? r.length === 1 ? r[0] ?? t : r : t;
|
|
1708
2067
|
}
|
|
1709
2068
|
function pt(t, e) {
|
|
1710
|
-
const
|
|
1711
|
-
let
|
|
2069
|
+
const r = [];
|
|
2070
|
+
let n = "", o = !1, s = e?.emoji ?? 0;
|
|
1712
2071
|
const i = () => {
|
|
1713
|
-
|
|
2072
|
+
n && (r.push(n), n = "");
|
|
1714
2073
|
};
|
|
1715
2074
|
for (const a of t) {
|
|
1716
|
-
if (
|
|
2075
|
+
if (mt(a)) {
|
|
1717
2076
|
o = !0, i();
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1720
|
-
/* @__PURE__ */
|
|
2077
|
+
const f = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2078
|
+
r.push(
|
|
2079
|
+
/* @__PURE__ */ R.jsx("span", { "data-motion-emoji": !0, children: a }, f)
|
|
1721
2080
|
);
|
|
1722
2081
|
continue;
|
|
1723
2082
|
}
|
|
1724
|
-
|
|
2083
|
+
n += a;
|
|
1725
2084
|
}
|
|
1726
|
-
return i(), o ? { nodes:
|
|
2085
|
+
return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
|
|
1727
2086
|
}
|
|
1728
|
-
function
|
|
2087
|
+
function An(t) {
|
|
1729
2088
|
if (!t)
|
|
1730
|
-
return
|
|
2089
|
+
return v.None;
|
|
1731
2090
|
const e = t.trim();
|
|
1732
2091
|
if (!e)
|
|
1733
|
-
return
|
|
1734
|
-
const
|
|
1735
|
-
if (typeof
|
|
1736
|
-
return
|
|
2092
|
+
return v.None;
|
|
2093
|
+
const r = ot.get(e);
|
|
2094
|
+
if (typeof r == "number")
|
|
2095
|
+
return r;
|
|
1737
2096
|
if (typeof document > "u")
|
|
1738
|
-
return
|
|
1739
|
-
const
|
|
1740
|
-
if (
|
|
1741
|
-
return
|
|
1742
|
-
const s =
|
|
1743
|
-
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${
|
|
2097
|
+
return v.None;
|
|
2098
|
+
const n = e.split(/\s+/).filter(Boolean);
|
|
2099
|
+
if (n.length === 0)
|
|
2100
|
+
return v.None;
|
|
2101
|
+
const s = n.map((c) => `.${kn(c)}`).map(
|
|
2102
|
+
(c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Tn(c)}(?![a-zA-Z0-9_-])`)
|
|
1744
2103
|
);
|
|
1745
|
-
let i =
|
|
2104
|
+
let i = v.None, a = !1;
|
|
1746
2105
|
for (const c of Array.from(document.styleSheets)) {
|
|
1747
|
-
let
|
|
2106
|
+
let f;
|
|
1748
2107
|
try {
|
|
1749
|
-
|
|
2108
|
+
f = c.cssRules;
|
|
1750
2109
|
} catch {
|
|
1751
2110
|
continue;
|
|
1752
2111
|
}
|
|
1753
|
-
const l =
|
|
1754
|
-
if (l.mask && (i |= l.mask, i ===
|
|
2112
|
+
const l = gt(f, s);
|
|
2113
|
+
if (l.mask && (i |= l.mask, i === De))
|
|
1755
2114
|
break;
|
|
1756
2115
|
a ||= l.sawStyleRule;
|
|
1757
2116
|
}
|
|
1758
|
-
return (i !==
|
|
2117
|
+
return (i !== v.None || a) && ot.set(e, i), i;
|
|
1759
2118
|
}
|
|
1760
|
-
function
|
|
2119
|
+
function gt(t, e) {
|
|
1761
2120
|
if (!t)
|
|
1762
|
-
return { mask:
|
|
1763
|
-
let
|
|
2121
|
+
return { mask: v.None, sawStyleRule: !1 };
|
|
2122
|
+
let r = v.None, n = !1;
|
|
1764
2123
|
for (let o = 0; o < t.length; o++) {
|
|
1765
2124
|
const s = t[o];
|
|
1766
2125
|
if (s) {
|
|
1767
2126
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
1768
2127
|
const a = s.selectorText ?? "";
|
|
1769
|
-
if (!a || !e.some((
|
|
1770
|
-
|
|
1771
|
-
for (const
|
|
1772
|
-
|
|
1773
|
-
if (
|
|
1774
|
-
return { mask:
|
|
2128
|
+
if (!a || !e.some((f) => f.test(a))) continue;
|
|
2129
|
+
n = !0;
|
|
2130
|
+
for (const f of on)
|
|
2131
|
+
f.hints.some((l) => a.includes(l)) && (r |= f.flag);
|
|
2132
|
+
if (r === De)
|
|
2133
|
+
return { mask: r, sawStyleRule: !0 };
|
|
1775
2134
|
} else if ("cssRules" in s) {
|
|
1776
|
-
const i =
|
|
1777
|
-
if (i.mask && (
|
|
1778
|
-
return { mask:
|
|
1779
|
-
|
|
2135
|
+
const i = gt(s.cssRules, e);
|
|
2136
|
+
if (i.mask && (r |= i.mask, r === De))
|
|
2137
|
+
return { mask: r, sawStyleRule: !0 };
|
|
2138
|
+
n ||= i.sawStyleRule;
|
|
1780
2139
|
}
|
|
1781
2140
|
}
|
|
1782
2141
|
}
|
|
1783
|
-
return { mask:
|
|
2142
|
+
return { mask: r, sawStyleRule: n };
|
|
1784
2143
|
}
|
|
1785
|
-
function
|
|
2144
|
+
function kn(t) {
|
|
1786
2145
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1787
2146
|
}
|
|
1788
|
-
function
|
|
2147
|
+
function Tn(t) {
|
|
1789
2148
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
1790
2149
|
}
|
|
1791
|
-
const
|
|
1792
|
-
function
|
|
2150
|
+
const Ve = "ikon_auth_session", Cn = 7 * 24 * 60 * 60 * 1e3;
|
|
2151
|
+
function Ae(t) {
|
|
1793
2152
|
try {
|
|
1794
|
-
localStorage.setItem(
|
|
2153
|
+
localStorage.setItem(Ve, JSON.stringify(t));
|
|
1795
2154
|
} catch {
|
|
1796
2155
|
console.warn("Failed to save auth session to localStorage");
|
|
1797
2156
|
}
|
|
1798
2157
|
}
|
|
1799
|
-
function
|
|
2158
|
+
function yt() {
|
|
1800
2159
|
try {
|
|
1801
|
-
const t = localStorage.getItem(
|
|
2160
|
+
const t = localStorage.getItem(Ve);
|
|
1802
2161
|
if (!t) return null;
|
|
1803
2162
|
const e = JSON.parse(t);
|
|
1804
|
-
return Date.now() - e.authenticatedAt >
|
|
2163
|
+
return Date.now() - e.authenticatedAt > Cn ? (St(), null) : e;
|
|
1805
2164
|
} catch {
|
|
1806
2165
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
1807
2166
|
}
|
|
1808
2167
|
}
|
|
1809
|
-
function
|
|
2168
|
+
function St() {
|
|
1810
2169
|
try {
|
|
1811
|
-
localStorage.removeItem(
|
|
2170
|
+
localStorage.removeItem(Ve);
|
|
1812
2171
|
} catch {
|
|
1813
2172
|
console.warn("Failed to clear auth session from localStorage");
|
|
1814
2173
|
}
|
|
1815
2174
|
}
|
|
1816
|
-
function
|
|
2175
|
+
function fe(t) {
|
|
1817
2176
|
return {
|
|
1818
2177
|
id: "",
|
|
1819
2178
|
provider: t.provider,
|
|
@@ -1821,30 +2180,30 @@ function ae(t) {
|
|
|
1821
2180
|
authenticatedAt: t.authenticatedAt
|
|
1822
2181
|
};
|
|
1823
2182
|
}
|
|
1824
|
-
async function
|
|
1825
|
-
const
|
|
2183
|
+
async function bt(t, e) {
|
|
2184
|
+
const r = Se(), n = await fetch(`${e}/anonymous`, {
|
|
1826
2185
|
method: "POST",
|
|
1827
2186
|
headers: { "Content-Type": "application/json" },
|
|
1828
|
-
body: JSON.stringify({ deviceId:
|
|
2187
|
+
body: JSON.stringify({ deviceId: r, space: t })
|
|
1829
2188
|
});
|
|
1830
|
-
if (!
|
|
1831
|
-
const i = await
|
|
1832
|
-
throw new Error(`Anonymous auth failed: ${
|
|
2189
|
+
if (!n.ok) {
|
|
2190
|
+
const i = await n.text().catch(() => "Unknown error");
|
|
2191
|
+
throw new Error(`Anonymous auth failed: ${n.status} ${i}`);
|
|
1833
2192
|
}
|
|
1834
|
-
const { token: o } = await
|
|
2193
|
+
const { token: o } = await n.json(), s = {
|
|
1835
2194
|
token: o,
|
|
1836
2195
|
provider: "anonymous",
|
|
1837
2196
|
authenticatedAt: Date.now()
|
|
1838
2197
|
};
|
|
1839
|
-
return
|
|
2198
|
+
return Ae(s), s;
|
|
1840
2199
|
}
|
|
1841
|
-
async function
|
|
1842
|
-
const { email: e, spaceId:
|
|
2200
|
+
async function no(t) {
|
|
2201
|
+
const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
|
|
1843
2202
|
method: "POST",
|
|
1844
2203
|
headers: { "Content-Type": "application/json" },
|
|
1845
2204
|
body: JSON.stringify({
|
|
1846
2205
|
email: e.trim(),
|
|
1847
|
-
space:
|
|
2206
|
+
space: r,
|
|
1848
2207
|
return: o
|
|
1849
2208
|
})
|
|
1850
2209
|
});
|
|
@@ -1853,102 +2212,102 @@ async function Br(t) {
|
|
|
1853
2212
|
throw new Error(i);
|
|
1854
2213
|
}
|
|
1855
2214
|
}
|
|
1856
|
-
function
|
|
1857
|
-
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"),
|
|
1858
|
-
return e &&
|
|
2215
|
+
function In() {
|
|
2216
|
+
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
|
|
2217
|
+
return e && r ? { token: e, provider: r } : null;
|
|
1859
2218
|
}
|
|
1860
|
-
function
|
|
2219
|
+
function Nn() {
|
|
1861
2220
|
const e = new URLSearchParams(window.location.search).get("error");
|
|
1862
2221
|
return e ? decodeURIComponent(e) : null;
|
|
1863
2222
|
}
|
|
1864
|
-
function
|
|
2223
|
+
function ut() {
|
|
1865
2224
|
window.history.replaceState({}, "", window.location.pathname);
|
|
1866
2225
|
}
|
|
1867
|
-
function
|
|
1868
|
-
const o =
|
|
1869
|
-
return `${
|
|
2226
|
+
function On(t, e, r, n) {
|
|
2227
|
+
const o = n ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2228
|
+
return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
|
|
1870
2229
|
}
|
|
1871
|
-
async function
|
|
2230
|
+
async function _n(t) {
|
|
1872
2231
|
const e = await fetch(`${t}/passkey/registration/options`, {
|
|
1873
2232
|
method: "POST",
|
|
1874
2233
|
headers: { "Content-Type": "application/json" }
|
|
1875
2234
|
});
|
|
1876
2235
|
if (!e.ok) {
|
|
1877
|
-
const
|
|
1878
|
-
throw new Error(
|
|
2236
|
+
const r = await e.text().catch(() => "Failed to get registration options");
|
|
2237
|
+
throw new Error(r);
|
|
1879
2238
|
}
|
|
1880
2239
|
return e.json();
|
|
1881
2240
|
}
|
|
1882
|
-
async function
|
|
1883
|
-
const
|
|
2241
|
+
async function Pn(t, e, r) {
|
|
2242
|
+
const n = await fetch(`${t}/passkey/registration/verify`, {
|
|
1884
2243
|
method: "POST",
|
|
1885
2244
|
headers: { "Content-Type": "application/json" },
|
|
1886
|
-
body: JSON.stringify({ response: e, name:
|
|
2245
|
+
body: JSON.stringify({ response: e, name: r })
|
|
1887
2246
|
});
|
|
1888
|
-
if (!
|
|
1889
|
-
const i = await
|
|
2247
|
+
if (!n.ok) {
|
|
2248
|
+
const i = await n.text().catch(() => "Registration verification failed");
|
|
1890
2249
|
throw new Error(i);
|
|
1891
2250
|
}
|
|
1892
|
-
const { token: o } = await
|
|
2251
|
+
const { token: o } = await n.json(), s = {
|
|
1893
2252
|
token: o,
|
|
1894
2253
|
provider: "passkey",
|
|
1895
2254
|
authenticatedAt: Date.now()
|
|
1896
2255
|
};
|
|
1897
|
-
return
|
|
2256
|
+
return Ae(s), s;
|
|
1898
2257
|
}
|
|
1899
|
-
async function
|
|
1900
|
-
const
|
|
2258
|
+
async function jn(t, e) {
|
|
2259
|
+
const r = await fetch(`${t}/passkey/authentication/options`, {
|
|
1901
2260
|
method: "POST",
|
|
1902
2261
|
headers: { "Content-Type": "application/json" },
|
|
1903
2262
|
body: JSON.stringify({ email: e })
|
|
1904
2263
|
});
|
|
1905
|
-
if (!
|
|
1906
|
-
const
|
|
1907
|
-
throw new Error(
|
|
2264
|
+
if (!r.ok) {
|
|
2265
|
+
const n = await r.text().catch(() => "Failed to get authentication options");
|
|
2266
|
+
throw new Error(n);
|
|
1908
2267
|
}
|
|
1909
|
-
return
|
|
2268
|
+
return r.json();
|
|
1910
2269
|
}
|
|
1911
|
-
async function
|
|
1912
|
-
const
|
|
2270
|
+
async function Mn(t, e) {
|
|
2271
|
+
const r = await fetch(`${t}/passkey/authentication/verify`, {
|
|
1913
2272
|
method: "POST",
|
|
1914
2273
|
headers: { "Content-Type": "application/json" },
|
|
1915
2274
|
body: JSON.stringify({ response: e })
|
|
1916
2275
|
});
|
|
1917
|
-
if (!
|
|
1918
|
-
const s = await
|
|
2276
|
+
if (!r.ok) {
|
|
2277
|
+
const s = await r.text().catch(() => "Authentication verification failed");
|
|
1919
2278
|
throw new Error(s);
|
|
1920
2279
|
}
|
|
1921
|
-
const { token:
|
|
1922
|
-
token:
|
|
2280
|
+
const { token: n } = await r.json(), o = {
|
|
2281
|
+
token: n,
|
|
1923
2282
|
provider: "passkey",
|
|
1924
2283
|
authenticatedAt: Date.now()
|
|
1925
2284
|
};
|
|
1926
|
-
return
|
|
2285
|
+
return Ae(o), o;
|
|
1927
2286
|
}
|
|
1928
|
-
function
|
|
2287
|
+
function q(t) {
|
|
1929
2288
|
const e = new Uint8Array(t);
|
|
1930
|
-
let
|
|
2289
|
+
let r = "";
|
|
1931
2290
|
for (const o of e)
|
|
1932
|
-
|
|
1933
|
-
return btoa(
|
|
2291
|
+
r += String.fromCharCode(o);
|
|
2292
|
+
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
1934
2293
|
}
|
|
1935
|
-
function
|
|
1936
|
-
const e = t.replace(/-/g, "+").replace(/_/g, "/"),
|
|
2294
|
+
function ve(t) {
|
|
2295
|
+
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);
|
|
1937
2296
|
for (let a = 0; a < o.length; a++)
|
|
1938
2297
|
i[a] = o.charCodeAt(a);
|
|
1939
2298
|
return s;
|
|
1940
2299
|
}
|
|
1941
|
-
function
|
|
1942
|
-
return
|
|
2300
|
+
function Ke() {
|
|
2301
|
+
return Un.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
1943
2302
|
}
|
|
1944
|
-
const
|
|
2303
|
+
const Un = {
|
|
1945
2304
|
stubThis: (t) => t
|
|
1946
2305
|
};
|
|
1947
|
-
function
|
|
2306
|
+
function wt(t) {
|
|
1948
2307
|
const { id: e } = t;
|
|
1949
2308
|
return {
|
|
1950
2309
|
...t,
|
|
1951
|
-
id:
|
|
2310
|
+
id: ve(e),
|
|
1952
2311
|
/**
|
|
1953
2312
|
* `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
|
|
1954
2313
|
* transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
|
|
@@ -1957,101 +2316,101 @@ function bt(t) {
|
|
|
1957
2316
|
transports: t.transports
|
|
1958
2317
|
};
|
|
1959
2318
|
}
|
|
1960
|
-
function
|
|
2319
|
+
function vt(t) {
|
|
1961
2320
|
return (
|
|
1962
2321
|
// Consider localhost valid as well since it's okay wrt Secure Contexts
|
|
1963
2322
|
t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
|
|
1964
2323
|
);
|
|
1965
2324
|
}
|
|
1966
|
-
class
|
|
1967
|
-
constructor({ message: e, code:
|
|
1968
|
-
super(e, { cause:
|
|
2325
|
+
class _ extends Error {
|
|
2326
|
+
constructor({ message: e, code: r, cause: n, name: o }) {
|
|
2327
|
+
super(e, { cause: n }), Object.defineProperty(this, "code", {
|
|
1969
2328
|
enumerable: !0,
|
|
1970
2329
|
configurable: !0,
|
|
1971
2330
|
writable: !0,
|
|
1972
2331
|
value: void 0
|
|
1973
|
-
}), this.name = o ??
|
|
2332
|
+
}), this.name = o ?? n.name, this.code = r;
|
|
1974
2333
|
}
|
|
1975
2334
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const { publicKey:
|
|
1978
|
-
if (!
|
|
2335
|
+
function Ln({ error: t, options: e }) {
|
|
2336
|
+
const { publicKey: r } = e;
|
|
2337
|
+
if (!r)
|
|
1979
2338
|
throw Error("options was missing required publicKey property");
|
|
1980
2339
|
if (t.name === "AbortError") {
|
|
1981
2340
|
if (e.signal instanceof AbortSignal)
|
|
1982
|
-
return new
|
|
2341
|
+
return new _({
|
|
1983
2342
|
message: "Registration ceremony was sent an abort signal",
|
|
1984
2343
|
code: "ERROR_CEREMONY_ABORTED",
|
|
1985
2344
|
cause: t
|
|
1986
2345
|
});
|
|
1987
2346
|
} else if (t.name === "ConstraintError") {
|
|
1988
|
-
if (
|
|
1989
|
-
return new
|
|
2347
|
+
if (r.authenticatorSelection?.requireResidentKey === !0)
|
|
2348
|
+
return new _({
|
|
1990
2349
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
1991
2350
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
1992
2351
|
cause: t
|
|
1993
2352
|
});
|
|
1994
2353
|
if (
|
|
1995
2354
|
// @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
|
|
1996
|
-
e.mediation === "conditional" &&
|
|
2355
|
+
e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
|
|
1997
2356
|
)
|
|
1998
|
-
return new
|
|
2357
|
+
return new _({
|
|
1999
2358
|
message: "User verification was required during automatic registration but it could not be performed",
|
|
2000
2359
|
code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
|
|
2001
2360
|
cause: t
|
|
2002
2361
|
});
|
|
2003
|
-
if (
|
|
2004
|
-
return new
|
|
2362
|
+
if (r.authenticatorSelection?.userVerification === "required")
|
|
2363
|
+
return new _({
|
|
2005
2364
|
message: "User verification was required but no available authenticator supported it",
|
|
2006
2365
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
2007
2366
|
cause: t
|
|
2008
2367
|
});
|
|
2009
2368
|
} else {
|
|
2010
2369
|
if (t.name === "InvalidStateError")
|
|
2011
|
-
return new
|
|
2370
|
+
return new _({
|
|
2012
2371
|
message: "The authenticator was previously registered",
|
|
2013
2372
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
2014
2373
|
cause: t
|
|
2015
2374
|
});
|
|
2016
2375
|
if (t.name === "NotAllowedError")
|
|
2017
|
-
return new
|
|
2376
|
+
return new _({
|
|
2018
2377
|
message: t.message,
|
|
2019
2378
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2020
2379
|
cause: t
|
|
2021
2380
|
});
|
|
2022
2381
|
if (t.name === "NotSupportedError")
|
|
2023
|
-
return
|
|
2382
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new _({
|
|
2024
2383
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
2025
2384
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
2026
2385
|
cause: t
|
|
2027
|
-
}) : new
|
|
2386
|
+
}) : new _({
|
|
2028
2387
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
2029
2388
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
2030
2389
|
cause: t
|
|
2031
2390
|
});
|
|
2032
2391
|
if (t.name === "SecurityError") {
|
|
2033
|
-
const
|
|
2034
|
-
if (
|
|
2035
|
-
if (
|
|
2036
|
-
return new
|
|
2037
|
-
message: `The RP ID "${
|
|
2392
|
+
const n = globalThis.location.hostname;
|
|
2393
|
+
if (vt(n)) {
|
|
2394
|
+
if (r.rp.id !== n)
|
|
2395
|
+
return new _({
|
|
2396
|
+
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
2038
2397
|
code: "ERROR_INVALID_RP_ID",
|
|
2039
2398
|
cause: t
|
|
2040
2399
|
});
|
|
2041
|
-
} else return new
|
|
2400
|
+
} else return new _({
|
|
2042
2401
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2043
2402
|
code: "ERROR_INVALID_DOMAIN",
|
|
2044
2403
|
cause: t
|
|
2045
2404
|
});
|
|
2046
2405
|
} else if (t.name === "TypeError") {
|
|
2047
|
-
if (
|
|
2048
|
-
return new
|
|
2406
|
+
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
2407
|
+
return new _({
|
|
2049
2408
|
message: "User ID was not between 1 and 64 characters",
|
|
2050
2409
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
2051
2410
|
cause: t
|
|
2052
2411
|
});
|
|
2053
2412
|
} else if (t.name === "UnknownError")
|
|
2054
|
-
return new
|
|
2413
|
+
return new _({
|
|
2055
2414
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
2056
2415
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2057
2416
|
cause: t
|
|
@@ -2059,7 +2418,7 @@ function wr({ error: t, options: e }) {
|
|
|
2059
2418
|
}
|
|
2060
2419
|
return t;
|
|
2061
2420
|
}
|
|
2062
|
-
class
|
|
2421
|
+
class xn {
|
|
2063
2422
|
constructor() {
|
|
2064
2423
|
Object.defineProperty(this, "controller", {
|
|
2065
2424
|
enumerable: !0,
|
|
@@ -2070,8 +2429,8 @@ class Er {
|
|
|
2070
2429
|
}
|
|
2071
2430
|
createNewAbortSignal() {
|
|
2072
2431
|
if (this.controller) {
|
|
2073
|
-
const
|
|
2074
|
-
|
|
2432
|
+
const r = new Error("Cancelling existing WebAuthn API call for new one");
|
|
2433
|
+
r.name = "AbortError", this.controller.abort(r);
|
|
2075
2434
|
}
|
|
2076
2435
|
const e = new AbortController();
|
|
2077
2436
|
return this.controller = e, e.signal;
|
|
@@ -2083,35 +2442,35 @@ class Er {
|
|
|
2083
2442
|
}
|
|
2084
2443
|
}
|
|
2085
2444
|
}
|
|
2086
|
-
const
|
|
2087
|
-
function
|
|
2088
|
-
if (t && !(
|
|
2445
|
+
const Rt = new xn(), Dn = ["cross-platform", "platform"];
|
|
2446
|
+
function Et(t) {
|
|
2447
|
+
if (t && !(Dn.indexOf(t) < 0))
|
|
2089
2448
|
return t;
|
|
2090
2449
|
}
|
|
2091
|
-
async function
|
|
2450
|
+
async function Fn(t) {
|
|
2092
2451
|
!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 });
|
|
2093
|
-
const { optionsJSON: e, useAutoRegister:
|
|
2094
|
-
if (!
|
|
2452
|
+
const { optionsJSON: e, useAutoRegister: r = !1 } = t;
|
|
2453
|
+
if (!Ke())
|
|
2095
2454
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2096
|
-
const
|
|
2455
|
+
const n = {
|
|
2097
2456
|
...e,
|
|
2098
|
-
challenge:
|
|
2457
|
+
challenge: ve(e.challenge),
|
|
2099
2458
|
user: {
|
|
2100
2459
|
...e.user,
|
|
2101
|
-
id:
|
|
2460
|
+
id: ve(e.user.id)
|
|
2102
2461
|
},
|
|
2103
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2462
|
+
excludeCredentials: e.excludeCredentials?.map(wt)
|
|
2104
2463
|
}, o = {};
|
|
2105
|
-
|
|
2464
|
+
r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Rt.createNewAbortSignal();
|
|
2106
2465
|
let s;
|
|
2107
2466
|
try {
|
|
2108
2467
|
s = await navigator.credentials.create(o);
|
|
2109
2468
|
} catch (S) {
|
|
2110
|
-
throw
|
|
2469
|
+
throw Ln({ error: S, options: o });
|
|
2111
2470
|
}
|
|
2112
2471
|
if (!s)
|
|
2113
2472
|
throw new Error("Registration was not completed");
|
|
2114
|
-
const { id: i, rawId: a, response: c, type:
|
|
2473
|
+
const { id: i, rawId: a, response: c, type: f } = s;
|
|
2115
2474
|
let l;
|
|
2116
2475
|
typeof c.getTransports == "function" && (l = c.getTransports());
|
|
2117
2476
|
let h;
|
|
@@ -2119,86 +2478,86 @@ async function vr(t) {
|
|
|
2119
2478
|
try {
|
|
2120
2479
|
h = c.getPublicKeyAlgorithm();
|
|
2121
2480
|
} catch (S) {
|
|
2122
|
-
|
|
2481
|
+
Oe("getPublicKeyAlgorithm()", S);
|
|
2123
2482
|
}
|
|
2124
|
-
let
|
|
2483
|
+
let d;
|
|
2125
2484
|
if (typeof c.getPublicKey == "function")
|
|
2126
2485
|
try {
|
|
2127
2486
|
const S = c.getPublicKey();
|
|
2128
|
-
S !== null && (
|
|
2487
|
+
S !== null && (d = q(S));
|
|
2129
2488
|
} catch (S) {
|
|
2130
|
-
|
|
2489
|
+
Oe("getPublicKey()", S);
|
|
2131
2490
|
}
|
|
2132
|
-
let
|
|
2491
|
+
let y;
|
|
2133
2492
|
if (typeof c.getAuthenticatorData == "function")
|
|
2134
2493
|
try {
|
|
2135
|
-
|
|
2494
|
+
y = q(c.getAuthenticatorData());
|
|
2136
2495
|
} catch (S) {
|
|
2137
|
-
|
|
2496
|
+
Oe("getAuthenticatorData()", S);
|
|
2138
2497
|
}
|
|
2139
2498
|
return {
|
|
2140
2499
|
id: i,
|
|
2141
|
-
rawId:
|
|
2500
|
+
rawId: q(a),
|
|
2142
2501
|
response: {
|
|
2143
|
-
attestationObject:
|
|
2144
|
-
clientDataJSON:
|
|
2502
|
+
attestationObject: q(c.attestationObject),
|
|
2503
|
+
clientDataJSON: q(c.clientDataJSON),
|
|
2145
2504
|
transports: l,
|
|
2146
2505
|
publicKeyAlgorithm: h,
|
|
2147
|
-
publicKey:
|
|
2148
|
-
authenticatorData:
|
|
2506
|
+
publicKey: d,
|
|
2507
|
+
authenticatorData: y
|
|
2149
2508
|
},
|
|
2150
|
-
type:
|
|
2509
|
+
type: f,
|
|
2151
2510
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2152
|
-
authenticatorAttachment:
|
|
2511
|
+
authenticatorAttachment: Et(s.authenticatorAttachment)
|
|
2153
2512
|
};
|
|
2154
2513
|
}
|
|
2155
|
-
function
|
|
2514
|
+
function Oe(t, e) {
|
|
2156
2515
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2157
2516
|
`, e);
|
|
2158
2517
|
}
|
|
2159
|
-
function
|
|
2160
|
-
if (!
|
|
2161
|
-
return
|
|
2518
|
+
function $n() {
|
|
2519
|
+
if (!Ke())
|
|
2520
|
+
return _e.stubThis(new Promise((e) => e(!1)));
|
|
2162
2521
|
const t = globalThis.PublicKeyCredential;
|
|
2163
|
-
return t?.isConditionalMediationAvailable === void 0 ?
|
|
2522
|
+
return t?.isConditionalMediationAvailable === void 0 ? _e.stubThis(new Promise((e) => e(!1))) : _e.stubThis(t.isConditionalMediationAvailable());
|
|
2164
2523
|
}
|
|
2165
|
-
const
|
|
2524
|
+
const _e = {
|
|
2166
2525
|
stubThis: (t) => t
|
|
2167
2526
|
};
|
|
2168
|
-
function
|
|
2169
|
-
const { publicKey:
|
|
2170
|
-
if (!
|
|
2527
|
+
function Bn({ error: t, options: e }) {
|
|
2528
|
+
const { publicKey: r } = e;
|
|
2529
|
+
if (!r)
|
|
2171
2530
|
throw Error("options was missing required publicKey property");
|
|
2172
2531
|
if (t.name === "AbortError") {
|
|
2173
2532
|
if (e.signal instanceof AbortSignal)
|
|
2174
|
-
return new
|
|
2533
|
+
return new _({
|
|
2175
2534
|
message: "Authentication ceremony was sent an abort signal",
|
|
2176
2535
|
code: "ERROR_CEREMONY_ABORTED",
|
|
2177
2536
|
cause: t
|
|
2178
2537
|
});
|
|
2179
2538
|
} else {
|
|
2180
2539
|
if (t.name === "NotAllowedError")
|
|
2181
|
-
return new
|
|
2540
|
+
return new _({
|
|
2182
2541
|
message: t.message,
|
|
2183
2542
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
2184
2543
|
cause: t
|
|
2185
2544
|
});
|
|
2186
2545
|
if (t.name === "SecurityError") {
|
|
2187
|
-
const
|
|
2188
|
-
if (
|
|
2189
|
-
if (
|
|
2190
|
-
return new
|
|
2191
|
-
message: `The RP ID "${
|
|
2546
|
+
const n = globalThis.location.hostname;
|
|
2547
|
+
if (vt(n)) {
|
|
2548
|
+
if (r.rpId !== n)
|
|
2549
|
+
return new _({
|
|
2550
|
+
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
2192
2551
|
code: "ERROR_INVALID_RP_ID",
|
|
2193
2552
|
cause: t
|
|
2194
2553
|
});
|
|
2195
|
-
} else return new
|
|
2554
|
+
} else return new _({
|
|
2196
2555
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2197
2556
|
code: "ERROR_INVALID_DOMAIN",
|
|
2198
2557
|
cause: t
|
|
2199
2558
|
});
|
|
2200
2559
|
} else if (t.name === "UnknownError")
|
|
2201
|
-
return new
|
|
2560
|
+
return new _({
|
|
2202
2561
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
2203
2562
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
2204
2563
|
cause: t
|
|
@@ -2206,63 +2565,63 @@ function kr({ error: t, options: e }) {
|
|
|
2206
2565
|
}
|
|
2207
2566
|
return t;
|
|
2208
2567
|
}
|
|
2209
|
-
async function
|
|
2568
|
+
async function Vn(t) {
|
|
2210
2569
|
!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 });
|
|
2211
|
-
const { optionsJSON: e, useBrowserAutofill:
|
|
2212
|
-
if (!
|
|
2570
|
+
const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
|
|
2571
|
+
if (!Ke())
|
|
2213
2572
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2214
2573
|
let o;
|
|
2215
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
2574
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(wt));
|
|
2216
2575
|
const s = {
|
|
2217
2576
|
...e,
|
|
2218
|
-
challenge:
|
|
2577
|
+
challenge: ve(e.challenge),
|
|
2219
2578
|
allowCredentials: o
|
|
2220
2579
|
}, i = {};
|
|
2221
|
-
if (
|
|
2222
|
-
if (!await
|
|
2580
|
+
if (r) {
|
|
2581
|
+
if (!await $n())
|
|
2223
2582
|
throw Error("Browser does not support WebAuthn autofill");
|
|
2224
|
-
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 &&
|
|
2583
|
+
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
|
|
2225
2584
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
2226
2585
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
2227
2586
|
}
|
|
2228
|
-
i.publicKey = s, i.signal =
|
|
2587
|
+
i.publicKey = s, i.signal = Rt.createNewAbortSignal();
|
|
2229
2588
|
let a;
|
|
2230
2589
|
try {
|
|
2231
2590
|
a = await navigator.credentials.get(i);
|
|
2232
|
-
} catch (
|
|
2233
|
-
throw
|
|
2591
|
+
} catch (y) {
|
|
2592
|
+
throw Bn({ error: y, options: i });
|
|
2234
2593
|
}
|
|
2235
2594
|
if (!a)
|
|
2236
2595
|
throw new Error("Authentication was not completed");
|
|
2237
|
-
const { id: c, rawId:
|
|
2238
|
-
let
|
|
2239
|
-
return l.userHandle && (
|
|
2596
|
+
const { id: c, rawId: f, response: l, type: h } = a;
|
|
2597
|
+
let d;
|
|
2598
|
+
return l.userHandle && (d = q(l.userHandle)), {
|
|
2240
2599
|
id: c,
|
|
2241
|
-
rawId:
|
|
2600
|
+
rawId: q(f),
|
|
2242
2601
|
response: {
|
|
2243
|
-
authenticatorData:
|
|
2244
|
-
clientDataJSON:
|
|
2245
|
-
signature:
|
|
2246
|
-
userHandle:
|
|
2602
|
+
authenticatorData: q(l.authenticatorData),
|
|
2603
|
+
clientDataJSON: q(l.clientDataJSON),
|
|
2604
|
+
signature: q(l.signature),
|
|
2605
|
+
userHandle: d
|
|
2247
2606
|
},
|
|
2248
2607
|
type: h,
|
|
2249
2608
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2250
|
-
authenticatorAttachment:
|
|
2609
|
+
authenticatorAttachment: Et(a.authenticatorAttachment)
|
|
2251
2610
|
};
|
|
2252
2611
|
}
|
|
2253
|
-
const
|
|
2254
|
-
function
|
|
2255
|
-
const [
|
|
2612
|
+
const ze = lt(null);
|
|
2613
|
+
function oo({ children: t, config: e }) {
|
|
2614
|
+
const [r, n] = ee({
|
|
2256
2615
|
isAuthenticated: !1,
|
|
2257
2616
|
isLoading: !0,
|
|
2258
2617
|
user: null,
|
|
2259
2618
|
error: null
|
|
2260
2619
|
});
|
|
2261
|
-
|
|
2620
|
+
F(() => {
|
|
2262
2621
|
(() => {
|
|
2263
|
-
const l =
|
|
2622
|
+
const l = Nn();
|
|
2264
2623
|
if (l) {
|
|
2265
|
-
|
|
2624
|
+
ut(), n({
|
|
2266
2625
|
isAuthenticated: !1,
|
|
2267
2626
|
isLoading: !1,
|
|
2268
2627
|
user: null,
|
|
@@ -2270,32 +2629,32 @@ function Vr({ children: t, config: e }) {
|
|
|
2270
2629
|
});
|
|
2271
2630
|
return;
|
|
2272
2631
|
}
|
|
2273
|
-
const h =
|
|
2632
|
+
const h = In();
|
|
2274
2633
|
if (h) {
|
|
2275
|
-
const
|
|
2634
|
+
const y = {
|
|
2276
2635
|
token: h.token,
|
|
2277
2636
|
provider: h.provider,
|
|
2278
2637
|
authenticatedAt: Date.now()
|
|
2279
2638
|
};
|
|
2280
|
-
|
|
2639
|
+
Ae(y), ut(), n({
|
|
2281
2640
|
isAuthenticated: !0,
|
|
2282
2641
|
isLoading: !1,
|
|
2283
|
-
user:
|
|
2642
|
+
user: fe(y),
|
|
2284
2643
|
error: null
|
|
2285
2644
|
});
|
|
2286
2645
|
return;
|
|
2287
2646
|
}
|
|
2288
|
-
const
|
|
2289
|
-
if (
|
|
2290
|
-
|
|
2647
|
+
const d = yt();
|
|
2648
|
+
if (d) {
|
|
2649
|
+
n({
|
|
2291
2650
|
isAuthenticated: !0,
|
|
2292
2651
|
isLoading: !1,
|
|
2293
|
-
user:
|
|
2652
|
+
user: fe(d),
|
|
2294
2653
|
error: null
|
|
2295
2654
|
});
|
|
2296
2655
|
return;
|
|
2297
2656
|
}
|
|
2298
|
-
|
|
2657
|
+
n({
|
|
2299
2658
|
isAuthenticated: !1,
|
|
2300
2659
|
isLoading: !1,
|
|
2301
2660
|
user: null,
|
|
@@ -2303,139 +2662,139 @@ function Vr({ children: t, config: e }) {
|
|
|
2303
2662
|
});
|
|
2304
2663
|
})();
|
|
2305
2664
|
}, []);
|
|
2306
|
-
const o =
|
|
2307
|
-
async (
|
|
2665
|
+
const o = B(
|
|
2666
|
+
async (f) => {
|
|
2308
2667
|
if (!e.spaceId) {
|
|
2309
|
-
|
|
2310
|
-
...
|
|
2668
|
+
n((d) => ({
|
|
2669
|
+
...d,
|
|
2311
2670
|
error: "Space ID is not configured"
|
|
2312
2671
|
}));
|
|
2313
2672
|
return;
|
|
2314
2673
|
}
|
|
2315
|
-
const l = e.authUrl ??
|
|
2316
|
-
if (
|
|
2317
|
-
|
|
2674
|
+
const l = e.authUrl ?? je();
|
|
2675
|
+
if (f === "guest") {
|
|
2676
|
+
n((d) => ({ ...d, isLoading: !0 }));
|
|
2318
2677
|
try {
|
|
2319
|
-
const
|
|
2320
|
-
|
|
2678
|
+
const d = await bt(e.spaceId, l);
|
|
2679
|
+
n({
|
|
2321
2680
|
isAuthenticated: !0,
|
|
2322
2681
|
isLoading: !1,
|
|
2323
|
-
user:
|
|
2682
|
+
user: fe(d),
|
|
2324
2683
|
error: null
|
|
2325
2684
|
});
|
|
2326
|
-
} catch (
|
|
2327
|
-
|
|
2328
|
-
...
|
|
2685
|
+
} catch (d) {
|
|
2686
|
+
n((y) => ({
|
|
2687
|
+
...y,
|
|
2329
2688
|
isLoading: !1,
|
|
2330
|
-
error:
|
|
2689
|
+
error: d instanceof Error ? d.message : "Guest login failed"
|
|
2331
2690
|
}));
|
|
2332
2691
|
}
|
|
2333
2692
|
return;
|
|
2334
2693
|
}
|
|
2335
|
-
if (
|
|
2336
|
-
|
|
2694
|
+
if (f === "passkey") {
|
|
2695
|
+
n((d) => ({ ...d, isLoading: !0, error: null }));
|
|
2337
2696
|
try {
|
|
2338
|
-
const
|
|
2339
|
-
|
|
2697
|
+
const d = await jn(l), y = await Vn({ optionsJSON: d }), S = await Mn(l, y);
|
|
2698
|
+
n({
|
|
2340
2699
|
isAuthenticated: !0,
|
|
2341
2700
|
isLoading: !1,
|
|
2342
|
-
user:
|
|
2701
|
+
user: fe(S),
|
|
2343
2702
|
error: null
|
|
2344
2703
|
});
|
|
2345
|
-
} catch (
|
|
2346
|
-
|
|
2347
|
-
...
|
|
2704
|
+
} catch (d) {
|
|
2705
|
+
n((y) => ({
|
|
2706
|
+
...y,
|
|
2348
2707
|
isLoading: !1,
|
|
2349
|
-
error:
|
|
2708
|
+
error: d instanceof Error ? d.message : "Passkey login failed"
|
|
2350
2709
|
}));
|
|
2351
2710
|
}
|
|
2352
2711
|
return;
|
|
2353
2712
|
}
|
|
2354
|
-
const h =
|
|
2713
|
+
const h = On(f, e.spaceId, l);
|
|
2355
2714
|
window.location.href = h;
|
|
2356
2715
|
},
|
|
2357
2716
|
[e.authUrl, e.spaceId]
|
|
2358
|
-
), s =
|
|
2359
|
-
|
|
2717
|
+
), s = B(() => {
|
|
2718
|
+
St(), n({
|
|
2360
2719
|
isAuthenticated: !1,
|
|
2361
2720
|
isLoading: !1,
|
|
2362
2721
|
user: null,
|
|
2363
2722
|
error: null
|
|
2364
2723
|
});
|
|
2365
|
-
}, []), i =
|
|
2366
|
-
async (
|
|
2367
|
-
const l = e.authUrl ??
|
|
2368
|
-
|
|
2724
|
+
}, []), i = B(
|
|
2725
|
+
async (f) => {
|
|
2726
|
+
const l = e.authUrl ?? je();
|
|
2727
|
+
n((h) => ({ ...h, isLoading: !0, error: null }));
|
|
2369
2728
|
try {
|
|
2370
|
-
const h = await
|
|
2371
|
-
|
|
2729
|
+
const h = await _n(l), d = await Fn({ optionsJSON: h }), y = await Pn(l, d, f);
|
|
2730
|
+
n({
|
|
2372
2731
|
isAuthenticated: !0,
|
|
2373
2732
|
isLoading: !1,
|
|
2374
|
-
user:
|
|
2733
|
+
user: fe(y),
|
|
2375
2734
|
error: null
|
|
2376
2735
|
});
|
|
2377
2736
|
} catch (h) {
|
|
2378
|
-
|
|
2379
|
-
...
|
|
2737
|
+
n((d) => ({
|
|
2738
|
+
...d,
|
|
2380
2739
|
isLoading: !1,
|
|
2381
2740
|
error: h instanceof Error ? h.message : "Passkey registration failed"
|
|
2382
2741
|
}));
|
|
2383
2742
|
}
|
|
2384
2743
|
},
|
|
2385
2744
|
[e.authUrl]
|
|
2386
|
-
), a =
|
|
2745
|
+
), a = B(() => r.user?.token ?? null, [r.user]), c = z(
|
|
2387
2746
|
() => ({
|
|
2388
|
-
state:
|
|
2747
|
+
state: r,
|
|
2389
2748
|
login: o,
|
|
2390
2749
|
logout: s,
|
|
2391
2750
|
getToken: a,
|
|
2392
2751
|
registerPasskey: i
|
|
2393
2752
|
}),
|
|
2394
|
-
[
|
|
2753
|
+
[r, o, s, a, i]
|
|
2395
2754
|
);
|
|
2396
|
-
return /* @__PURE__ */
|
|
2755
|
+
return /* @__PURE__ */ R.jsx(ze, { value: c, children: t });
|
|
2397
2756
|
}
|
|
2398
|
-
function
|
|
2399
|
-
const t =
|
|
2757
|
+
function Kn() {
|
|
2758
|
+
const t = Be(ze);
|
|
2400
2759
|
if (!t)
|
|
2401
2760
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
2402
2761
|
return t;
|
|
2403
2762
|
}
|
|
2404
|
-
function
|
|
2405
|
-
return
|
|
2763
|
+
function so() {
|
|
2764
|
+
return Be(ze);
|
|
2406
2765
|
}
|
|
2407
|
-
function
|
|
2408
|
-
const { config: e, guestUrlParam:
|
|
2409
|
-
return
|
|
2410
|
-
if (!
|
|
2766
|
+
function io(t) {
|
|
2767
|
+
const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Kn(), s = w(!1);
|
|
2768
|
+
return F(() => {
|
|
2769
|
+
if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
|
|
2411
2770
|
return;
|
|
2412
|
-
const i = new URLSearchParams(window.location.search), a = i.get(
|
|
2771
|
+
const i = new URLSearchParams(window.location.search), a = i.get(r);
|
|
2413
2772
|
if (a === "true" || a === "1" || a === "") {
|
|
2414
|
-
i.delete(
|
|
2415
|
-
const c = i.toString(),
|
|
2416
|
-
window.history.replaceState({}, "",
|
|
2773
|
+
i.delete(r);
|
|
2774
|
+
const c = i.toString(), f = window.location.pathname + (c ? `?${c}` : "");
|
|
2775
|
+
window.history.replaceState({}, "", f), s.current = !0, o("guest");
|
|
2417
2776
|
}
|
|
2418
|
-
}, [
|
|
2419
|
-
shouldRenderChildren:
|
|
2420
|
-
isCheckingAuth:
|
|
2421
|
-
isAuthenticated:
|
|
2422
|
-
error:
|
|
2777
|
+
}, [r, n.isAuthenticated, n.isLoading, e.methods, o]), {
|
|
2778
|
+
shouldRenderChildren: n.isAuthenticated,
|
|
2779
|
+
isCheckingAuth: n.isLoading,
|
|
2780
|
+
isAuthenticated: n.isAuthenticated,
|
|
2781
|
+
error: n.error
|
|
2423
2782
|
};
|
|
2424
2783
|
}
|
|
2425
|
-
function
|
|
2784
|
+
function ao({
|
|
2426
2785
|
connectionState: t,
|
|
2427
2786
|
error: e,
|
|
2428
|
-
isReady:
|
|
2429
|
-
stores:
|
|
2787
|
+
isReady: r,
|
|
2788
|
+
stores: n,
|
|
2430
2789
|
registry: o,
|
|
2431
2790
|
client: s,
|
|
2432
2791
|
onAction: i,
|
|
2433
2792
|
renderIdle: a,
|
|
2434
2793
|
renderConnecting: c,
|
|
2435
|
-
renderConnectingSlow:
|
|
2794
|
+
renderConnectingSlow: f,
|
|
2436
2795
|
renderConnected: l,
|
|
2437
2796
|
renderOffline: h,
|
|
2438
|
-
renderError:
|
|
2797
|
+
renderError: d
|
|
2439
2798
|
}) {
|
|
2440
2799
|
switch (t) {
|
|
2441
2800
|
case "idle":
|
|
@@ -2443,11 +2802,11 @@ function Wr({
|
|
|
2443
2802
|
case "connecting":
|
|
2444
2803
|
return c();
|
|
2445
2804
|
case "connectingSlow":
|
|
2446
|
-
return
|
|
2805
|
+
return f();
|
|
2447
2806
|
case "connected":
|
|
2448
2807
|
case "reconnecting":
|
|
2449
|
-
return !
|
|
2450
|
-
stores:
|
|
2808
|
+
return !r || !n || !o ? null : l({
|
|
2809
|
+
stores: n,
|
|
2451
2810
|
registry: o,
|
|
2452
2811
|
client: s,
|
|
2453
2812
|
onAction: i,
|
|
@@ -2456,223 +2815,228 @@ function Wr({
|
|
|
2456
2815
|
case "offline":
|
|
2457
2816
|
return h();
|
|
2458
2817
|
case "offlineError":
|
|
2459
|
-
return
|
|
2818
|
+
return d(e ?? s?.lastError?.message ?? null);
|
|
2460
2819
|
default:
|
|
2461
2820
|
return null;
|
|
2462
2821
|
}
|
|
2463
2822
|
}
|
|
2464
|
-
const Pe =
|
|
2465
|
-
function
|
|
2466
|
-
const { authConfig: e, localServer:
|
|
2467
|
-
|
|
2468
|
-
const [
|
|
2823
|
+
const Pe = Re("useIkonApp");
|
|
2824
|
+
function co(t) {
|
|
2825
|
+
const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: c = !0, timeouts: f, audio: l, video: h, mediaSession: d, debug: y } = t, S = w(null), b = w(null), m = w(null), p = w(!1), A = w(l), P = w(h), j = w(d), V = w(y), G = w(f), Z = w(i), k = w(a), C = w(s), M = w(c);
|
|
2826
|
+
A.current = l, P.current = h, j.current = d, V.current = y, G.current = f, Z.current = i, k.current = a, C.current = s, M.current = c;
|
|
2827
|
+
const [I, L] = ee("idle"), [W, te] = ee(null), [oe, pe] = ee(null), [H, ge] = ee(null), [se, u] = ee(!1), g = z(() => {
|
|
2469
2828
|
try {
|
|
2470
|
-
return
|
|
2829
|
+
return Nt();
|
|
2471
2830
|
} catch {
|
|
2472
2831
|
return { parameters: {} };
|
|
2473
2832
|
}
|
|
2474
|
-
}, []),
|
|
2475
|
-
|
|
2476
|
-
!
|
|
2477
|
-
|
|
2478
|
-
}).catch((
|
|
2479
|
-
Pe.error("Anonymous auth failed:",
|
|
2833
|
+
}, []), E = z(() => e?.enabled ? yt() : null, [e?.enabled]), T = r?.enabled ?? !1, K = r?.host ?? "localhost", x = r?.httpsPort ?? 8443;
|
|
2834
|
+
F(() => {
|
|
2835
|
+
!T && Ye() && e && !e.enabled && e.spaceId && !H && !se && (u(!0), bt(e.spaceId, e.authUrl ?? je()).then((U) => {
|
|
2836
|
+
ge(U.token);
|
|
2837
|
+
}).catch((U) => {
|
|
2838
|
+
Pe.error("Anonymous auth failed:", U), te(U instanceof Error ? U.message : "Anonymous auth failed");
|
|
2480
2839
|
}).finally(() => {
|
|
2481
2840
|
u(!1);
|
|
2482
2841
|
}));
|
|
2483
|
-
}, [
|
|
2484
|
-
const
|
|
2485
|
-
if (
|
|
2486
|
-
const
|
|
2842
|
+
}, [T, e, H, se]);
|
|
2843
|
+
const Q = z(() => {
|
|
2844
|
+
if (T) {
|
|
2845
|
+
const O = E?.token ? Ot(E.token) ?? Se() : Se();
|
|
2487
2846
|
return {
|
|
2488
2847
|
local: {
|
|
2489
|
-
host:
|
|
2490
|
-
httpsPort:
|
|
2491
|
-
userId:
|
|
2492
|
-
parameters:
|
|
2848
|
+
host: K,
|
|
2849
|
+
httpsPort: x,
|
|
2850
|
+
userId: O,
|
|
2851
|
+
parameters: g.parameters
|
|
2493
2852
|
}
|
|
2494
2853
|
};
|
|
2495
2854
|
}
|
|
2496
|
-
return
|
|
2855
|
+
return E?.token && e?.spaceId ? {
|
|
2497
2856
|
sessionToken: {
|
|
2498
|
-
token:
|
|
2857
|
+
token: E.token,
|
|
2499
2858
|
spaceId: e.spaceId,
|
|
2500
2859
|
backendType: We(),
|
|
2501
|
-
sessionId:
|
|
2502
|
-
channelKey:
|
|
2503
|
-
parameters:
|
|
2860
|
+
sessionId: g.sessionId,
|
|
2861
|
+
channelKey: g.channelKey,
|
|
2862
|
+
parameters: g.parameters
|
|
2504
2863
|
}
|
|
2505
|
-
} :
|
|
2864
|
+
} : H && e?.spaceId ? {
|
|
2506
2865
|
sessionToken: {
|
|
2507
|
-
token:
|
|
2866
|
+
token: H,
|
|
2508
2867
|
spaceId: e.spaceId,
|
|
2509
2868
|
backendType: We(),
|
|
2510
|
-
sessionId:
|
|
2511
|
-
channelKey:
|
|
2512
|
-
parameters:
|
|
2869
|
+
sessionId: g.sessionId,
|
|
2870
|
+
channelKey: g.channelKey,
|
|
2871
|
+
parameters: g.parameters
|
|
2513
2872
|
}
|
|
2514
|
-
} :
|
|
2873
|
+
} : Ye() ? null : {
|
|
2515
2874
|
local: {
|
|
2516
|
-
host:
|
|
2517
|
-
httpsPort:
|
|
2518
|
-
userId:
|
|
2519
|
-
parameters:
|
|
2875
|
+
host: K,
|
|
2876
|
+
httpsPort: x,
|
|
2877
|
+
userId: Se(),
|
|
2878
|
+
parameters: g.parameters
|
|
2520
2879
|
}
|
|
2521
2880
|
};
|
|
2522
|
-
}, [
|
|
2523
|
-
|
|
2524
|
-
const
|
|
2525
|
-
|
|
2526
|
-
if (!
|
|
2527
|
-
if (
|
|
2528
|
-
for (const
|
|
2529
|
-
|
|
2530
|
-
o?.(m.current), m.current.loadRegisteredModules().catch((
|
|
2531
|
-
Pe.error("Failed to load UI modules",
|
|
2881
|
+
}, [T, K, x, E?.token, e?.spaceId, H, g.sessionId, g.channelKey, g.parameters]);
|
|
2882
|
+
xr(oe);
|
|
2883
|
+
const ie = Fr(oe);
|
|
2884
|
+
F(() => {
|
|
2885
|
+
if (!p.current) {
|
|
2886
|
+
if (p.current = !0, m.current = Nr(), n)
|
|
2887
|
+
for (const O of n)
|
|
2888
|
+
O(m.current);
|
|
2889
|
+
o?.(m.current), m.current.loadRegisteredModules().catch((O) => {
|
|
2890
|
+
Pe.error("Failed to load UI modules", O);
|
|
2532
2891
|
});
|
|
2533
2892
|
}
|
|
2534
|
-
}, []),
|
|
2535
|
-
if (!
|
|
2536
|
-
const
|
|
2537
|
-
...
|
|
2538
|
-
debug:
|
|
2539
|
-
timeouts:
|
|
2540
|
-
audio:
|
|
2541
|
-
video:
|
|
2542
|
-
mediaSession:
|
|
2543
|
-
onConnectionStateChange: (
|
|
2544
|
-
|
|
2893
|
+
}, []), F(() => {
|
|
2894
|
+
if (!Q) return;
|
|
2895
|
+
const O = new _t({
|
|
2896
|
+
...Q,
|
|
2897
|
+
debug: V.current,
|
|
2898
|
+
timeouts: G.current,
|
|
2899
|
+
audio: A.current,
|
|
2900
|
+
video: P.current,
|
|
2901
|
+
mediaSession: j.current,
|
|
2902
|
+
onConnectionStateChange: ($) => {
|
|
2903
|
+
L($), Z.current?.($);
|
|
2545
2904
|
},
|
|
2546
|
-
onError: (
|
|
2547
|
-
|
|
2905
|
+
onError: ($) => {
|
|
2906
|
+
te($.message), k.current?.($);
|
|
2548
2907
|
},
|
|
2549
2908
|
onJoined: () => {
|
|
2550
|
-
const
|
|
2551
|
-
|
|
2909
|
+
const $ = O.globalState?.SessionId;
|
|
2910
|
+
M.current && $ && window.history.replaceState(null, "", `/s/${$}${window.location.search}`), C.current?.($);
|
|
2552
2911
|
}
|
|
2553
2912
|
});
|
|
2554
|
-
S.current =
|
|
2555
|
-
const
|
|
2556
|
-
return
|
|
2557
|
-
Pe.error("Connection failed:",
|
|
2913
|
+
S.current = O;
|
|
2914
|
+
const U = new qt({ client: O });
|
|
2915
|
+
return b.current = U, pe(U), O.connect().catch(($) => {
|
|
2916
|
+
Pe.error("Connection failed:", $);
|
|
2558
2917
|
}), () => {
|
|
2559
|
-
|
|
2918
|
+
O.disconnect(), S.current = null, U.dispose(), b.current = null;
|
|
2560
2919
|
};
|
|
2561
|
-
}, [
|
|
2562
|
-
const
|
|
2563
|
-
const
|
|
2564
|
-
S.current?.sendActionCall(
|
|
2565
|
-
}, []),
|
|
2920
|
+
}, [Q]);
|
|
2921
|
+
const N = B((O, U) => {
|
|
2922
|
+
const $ = typeof U == "string" ? U : JSON.stringify(U ?? {});
|
|
2923
|
+
S.current?.sendActionCall(O, $);
|
|
2924
|
+
}, []), X = I === "connected" || I === "reconnecting";
|
|
2566
2925
|
return {
|
|
2567
|
-
connectionState:
|
|
2568
|
-
error:
|
|
2569
|
-
stores:
|
|
2926
|
+
connectionState: I,
|
|
2927
|
+
error: W,
|
|
2928
|
+
stores: ie,
|
|
2570
2929
|
client: S.current,
|
|
2571
2930
|
registry: m.current,
|
|
2572
2931
|
clientRef: S,
|
|
2573
|
-
uiRef:
|
|
2932
|
+
uiRef: b,
|
|
2574
2933
|
registryRef: m,
|
|
2575
|
-
onAction:
|
|
2576
|
-
isReady:
|
|
2934
|
+
onAction: N,
|
|
2935
|
+
isReady: X
|
|
2577
2936
|
};
|
|
2578
2937
|
}
|
|
2579
|
-
function
|
|
2580
|
-
const e =
|
|
2581
|
-
return
|
|
2938
|
+
function uo(t) {
|
|
2939
|
+
const e = w(!1);
|
|
2940
|
+
return B(() => {
|
|
2582
2941
|
if (e.current) return;
|
|
2583
2942
|
e.current = !0;
|
|
2584
|
-
const
|
|
2585
|
-
|
|
2943
|
+
const r = document.createElement("link");
|
|
2944
|
+
r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
2586
2945
|
}, [t]);
|
|
2587
2946
|
}
|
|
2588
|
-
const
|
|
2589
|
-
function
|
|
2590
|
-
return e ? t.replace(/\{(\w+)\}/g, (
|
|
2947
|
+
const At = lt(null);
|
|
2948
|
+
function zn(t, e) {
|
|
2949
|
+
return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
|
|
2591
2950
|
}
|
|
2592
|
-
function
|
|
2593
|
-
const
|
|
2594
|
-
if (
|
|
2595
|
-
return
|
|
2951
|
+
function Yn(t, e) {
|
|
2952
|
+
const n = new URLSearchParams(window.location.search).get("lang");
|
|
2953
|
+
if (n && t.includes(n))
|
|
2954
|
+
return n;
|
|
2596
2955
|
const o = navigator.language.split("-")[0];
|
|
2597
2956
|
return t.includes(o) ? o : e && t.includes(e) ? e : "en";
|
|
2598
2957
|
}
|
|
2599
|
-
function
|
|
2600
|
-
return e ?
|
|
2958
|
+
function Wn(t, e, r) {
|
|
2959
|
+
return e ? Yn(t, r) : r && t.includes(r) ? r : "en";
|
|
2601
2960
|
}
|
|
2602
|
-
function
|
|
2961
|
+
function lo({
|
|
2603
2962
|
children: t,
|
|
2604
2963
|
translations: e,
|
|
2605
|
-
defaultLanguage:
|
|
2606
|
-
detectLanguage:
|
|
2964
|
+
defaultLanguage: r,
|
|
2965
|
+
detectLanguage: n = !1
|
|
2607
2966
|
}) {
|
|
2608
|
-
const o = Object.keys(e), s =
|
|
2967
|
+
const o = Object.keys(e), s = Wn(o, n, r), i = e[s] ?? e.en, a = z(
|
|
2609
2968
|
() => ({
|
|
2610
|
-
t: (c,
|
|
2969
|
+
t: (c, f) => {
|
|
2611
2970
|
const l = i[c];
|
|
2612
|
-
return
|
|
2971
|
+
return zn(l, f);
|
|
2613
2972
|
},
|
|
2614
2973
|
locale: s,
|
|
2615
2974
|
translations: i
|
|
2616
2975
|
}),
|
|
2617
2976
|
[i, s]
|
|
2618
2977
|
);
|
|
2619
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ R.jsx(At, { value: a, children: t });
|
|
2620
2979
|
}
|
|
2621
|
-
function
|
|
2622
|
-
const t =
|
|
2980
|
+
function fo() {
|
|
2981
|
+
const t = Be(At);
|
|
2623
2982
|
if (!t)
|
|
2624
2983
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
2625
2984
|
return t;
|
|
2626
2985
|
}
|
|
2627
2986
|
export {
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2987
|
+
oo as AuthProvider,
|
|
2988
|
+
ao as ConnectionStateRenderer,
|
|
2989
|
+
lo as I18nProvider,
|
|
2990
|
+
rr as IKON_UI_BASE_MODULE,
|
|
2991
|
+
lr as IKON_UI_MEDIA_MODULE,
|
|
2992
|
+
kr as IKON_UI_SHADER_MODULE,
|
|
2993
|
+
Er as IKON_UI_SHADER_TYPE,
|
|
2994
|
+
Ue as IKON_UI_STREAM_CATEGORY,
|
|
2995
|
+
sr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
2996
|
+
ir as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
2636
2997
|
qt as IkonUi,
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2998
|
+
Ir as IkonUiRegistry,
|
|
2999
|
+
Zn as IkonUiSurface,
|
|
3000
|
+
Yt as UiComponentRegistry,
|
|
3001
|
+
zt as UiRenderer,
|
|
3002
|
+
po as UiStreamStore,
|
|
3003
|
+
Qn as areIkonUiModuleListsEqual,
|
|
3004
|
+
bt as authenticateAnonymous,
|
|
3005
|
+
On as buildOAuthRedirectUrl,
|
|
3006
|
+
St as clearAuthSession,
|
|
3007
|
+
ut as clearOAuthParams,
|
|
3008
|
+
tr as createBaseResolvers,
|
|
3009
|
+
Hn as createComponentLibrary,
|
|
3010
|
+
Nr as createIkonUiRegistry,
|
|
3011
|
+
cr as createMediaResolvers,
|
|
3012
|
+
Ar as createShaderRendererResolver,
|
|
2651
3013
|
Wt as isIkonUiCategoryMatch,
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
3014
|
+
yt as loadAuthSession,
|
|
3015
|
+
nr as loadBaseModule,
|
|
3016
|
+
dr as loadMediaModule,
|
|
3017
|
+
Tr as loadShaderModule,
|
|
3018
|
+
rn as normalizeIkonUiModuleList,
|
|
3019
|
+
to as parseIkonUiInitPayload,
|
|
3020
|
+
In as parseOAuthCallback,
|
|
3021
|
+
Nn as parseOAuthError,
|
|
3022
|
+
nn as readIkonUiModules,
|
|
3023
|
+
eo as readIkonUiModulesFromSources,
|
|
3024
|
+
or as registerBaseModule,
|
|
3025
|
+
fr as registerMediaModule,
|
|
3026
|
+
Cr as registerShaderModule,
|
|
3027
|
+
Vt as renderChildren,
|
|
3028
|
+
ro as renderMotionLetters,
|
|
3029
|
+
Ae as saveAuthSession,
|
|
3030
|
+
no as sendMagicLink,
|
|
3031
|
+
fe as sessionToUser,
|
|
3032
|
+
Kn as useAuth,
|
|
3033
|
+
io as useAuthGuard,
|
|
3034
|
+
so as useAuthOptional,
|
|
3035
|
+
fo as useI18n,
|
|
3036
|
+
co as useIkonApp,
|
|
3037
|
+
xr as useIkonStyles,
|
|
3038
|
+
Fr as useIkonUiStores,
|
|
3039
|
+
uo as useLazyFont,
|
|
3040
|
+
J as useUiNode,
|
|
3041
|
+
Xn as useUiStore
|
|
2678
3042
|
};
|