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