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