@ikonai/sdk-react-ui 1.0.60 → 1.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/use-ikon-app.d.ts +5 -0
- package/app/use-ikon-debug.d.ts +6 -0
- package/debug/debug-overlay.d.ts +4 -2
- package/index.js +773 -729
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IkonUiCore as rn, UiStreamStore as on } from "@ikonai/sdk-ui";
|
|
2
|
-
import { UiStreamStore as
|
|
3
|
-
import sn, { useSyncExternalStore as
|
|
4
|
-
import { createLogger as ne, isInspectModeEnabled as ln, getOrCreateDeviceId as un, getSameOriginAuthUrl as dn, abortSignalTimeout as
|
|
5
|
-
import { randomUuid as
|
|
6
|
-
var
|
|
2
|
+
import { UiStreamStore as Gs } from "@ikonai/sdk-ui";
|
|
3
|
+
import sn, { useSyncExternalStore as Je, useMemo as W, memo as z, useRef as A, useCallback as D, Fragment as an, useEffect as _, useState as N, use as Ze, createContext as Ct, useReducer as cn } from "react";
|
|
4
|
+
import { createLogger as ne, isInspectModeEnabled as ln, getOrCreateDeviceId as un, getSameOriginAuthUrl as dn, abortSignalTimeout as _t, deriveAuthUrl as ye, getDebugOverlayParam as fn, subscribeToLogEvents as It, LogLevel as We, parseUrlParams as hn, clearSessionParamsFromUrl as pn, isCloudEnvironment as ot, extractUserIdFromToken as mn, deriveBackendType as st, IkonClient as gn, AccessDeniedError as yn, ServerFullError as bn, AuthenticationError as wn, isDebugModeEnabled as Ot, getLangParam as Sn } from "@ikonai/sdk";
|
|
5
|
+
import { randomUuid as zs } from "@ikonai/sdk";
|
|
6
|
+
var Re = { exports: {} }, de = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
9
|
* react-jsx-runtime.production.js
|
|
@@ -13,10 +13,10 @@ var ve = { exports: {} }, ue = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
16
|
+
var it;
|
|
17
17
|
function En() {
|
|
18
|
-
if (
|
|
19
|
-
|
|
18
|
+
if (it) return de;
|
|
19
|
+
it = 1;
|
|
20
20
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
21
21
|
function n(r, o, s) {
|
|
22
22
|
var i = null;
|
|
@@ -33,9 +33,9 @@ function En() {
|
|
|
33
33
|
props: s
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return de.Fragment = e, de.jsx = n, de.jsxs = n, de;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var fe = {};
|
|
39
39
|
/**
|
|
40
40
|
* @license React
|
|
41
41
|
* react-jsx-runtime.development.js
|
|
@@ -45,15 +45,15 @@ var de = {};
|
|
|
45
45
|
* This source code is licensed under the MIT license found in the
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
|
-
var
|
|
48
|
+
var at;
|
|
49
49
|
function vn() {
|
|
50
|
-
return
|
|
51
|
-
function t(
|
|
52
|
-
if (
|
|
53
|
-
if (typeof
|
|
54
|
-
return
|
|
55
|
-
if (typeof
|
|
56
|
-
switch (
|
|
50
|
+
return at || (at = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
|
+
function t(f) {
|
|
52
|
+
if (f == null) return null;
|
|
53
|
+
if (typeof f == "function")
|
|
54
|
+
return f.$$typeof === x ? null : f.displayName || f.name || null;
|
|
55
|
+
if (typeof f == "string") return f;
|
|
56
|
+
switch (f) {
|
|
57
57
|
case g:
|
|
58
58
|
return "Fragment";
|
|
59
59
|
case w:
|
|
@@ -64,225 +64,225 @@ function vn() {
|
|
|
64
64
|
return "Suspense";
|
|
65
65
|
case Q:
|
|
66
66
|
return "SuspenseList";
|
|
67
|
-
case
|
|
67
|
+
case I:
|
|
68
68
|
return "Activity";
|
|
69
69
|
}
|
|
70
|
-
if (typeof
|
|
71
|
-
switch (typeof
|
|
70
|
+
if (typeof f == "object")
|
|
71
|
+
switch (typeof f.tag == "number" && console.error(
|
|
72
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
|
-
),
|
|
74
|
-
case
|
|
73
|
+
), f.$$typeof) {
|
|
74
|
+
case y:
|
|
75
75
|
return "Portal";
|
|
76
|
-
case
|
|
77
|
-
return
|
|
78
|
-
case
|
|
79
|
-
return (
|
|
80
|
-
case
|
|
81
|
-
var
|
|
82
|
-
return
|
|
76
|
+
case E:
|
|
77
|
+
return f.displayName || "Context";
|
|
78
|
+
case v:
|
|
79
|
+
return (f._context.displayName || "Context") + ".Consumer";
|
|
80
|
+
case T:
|
|
81
|
+
var R = f.render;
|
|
82
|
+
return f = f.displayName, f || (f = R.displayName || R.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
83
83
|
case re:
|
|
84
|
-
return
|
|
84
|
+
return R = f.displayName || null, R !== null ? R : t(f.type) || "Memo";
|
|
85
85
|
case q:
|
|
86
|
-
|
|
86
|
+
R = f._payload, f = f._init;
|
|
87
87
|
try {
|
|
88
|
-
return t(
|
|
88
|
+
return t(f(R));
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
function e(
|
|
95
|
-
return "" +
|
|
94
|
+
function e(f) {
|
|
95
|
+
return "" + f;
|
|
96
96
|
}
|
|
97
|
-
function n(
|
|
97
|
+
function n(f) {
|
|
98
98
|
try {
|
|
99
|
-
e(
|
|
100
|
-
var
|
|
99
|
+
e(f);
|
|
100
|
+
var R = !1;
|
|
101
101
|
} catch {
|
|
102
|
-
|
|
102
|
+
R = !0;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
|
|
104
|
+
if (R) {
|
|
105
|
+
R = console;
|
|
106
|
+
var C = R.error, P = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
|
|
107
|
+
return C.call(
|
|
108
|
+
R,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
-
|
|
111
|
-
), e(
|
|
110
|
+
P
|
|
111
|
+
), e(f);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function r(
|
|
115
|
-
if (
|
|
116
|
-
if (typeof
|
|
114
|
+
function r(f) {
|
|
115
|
+
if (f === g) return "<>";
|
|
116
|
+
if (typeof f == "object" && f !== null && f.$$typeof === q)
|
|
117
117
|
return "<...>";
|
|
118
118
|
try {
|
|
119
|
-
var
|
|
120
|
-
return
|
|
119
|
+
var R = t(f);
|
|
120
|
+
return R ? "<" + R + ">" : "<...>";
|
|
121
121
|
} catch {
|
|
122
122
|
return "<...>";
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
function o() {
|
|
126
|
-
var
|
|
127
|
-
return
|
|
126
|
+
var f = $.A;
|
|
127
|
+
return f === null ? null : f.getOwner();
|
|
128
128
|
}
|
|
129
129
|
function s() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
|
-
function i(
|
|
133
|
-
if (V.call(
|
|
134
|
-
var
|
|
135
|
-
if (
|
|
132
|
+
function i(f) {
|
|
133
|
+
if (V.call(f, "key")) {
|
|
134
|
+
var R = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
135
|
+
if (R && R.isReactWarning) return !1;
|
|
136
136
|
}
|
|
137
|
-
return
|
|
137
|
+
return f.key !== void 0;
|
|
138
138
|
}
|
|
139
|
-
function a(
|
|
140
|
-
function
|
|
141
|
-
|
|
139
|
+
function a(f, R) {
|
|
140
|
+
function C() {
|
|
141
|
+
G || (G = !0, console.error(
|
|
142
142
|
"%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)",
|
|
143
|
-
|
|
143
|
+
R
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
get:
|
|
146
|
+
C.isReactWarning = !0, Object.defineProperty(f, "key", {
|
|
147
|
+
get: C,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
function l() {
|
|
152
|
-
var
|
|
153
|
-
return
|
|
152
|
+
var f = t(this.type);
|
|
153
|
+
return we[f] || (we[f] = !0, console.error(
|
|
154
154
|
"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."
|
|
155
|
-
)),
|
|
155
|
+
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
156
156
|
}
|
|
157
|
-
function f
|
|
158
|
-
var
|
|
159
|
-
return
|
|
157
|
+
function d(f, R, C, P, ee, le) {
|
|
158
|
+
var L = C.ref;
|
|
159
|
+
return f = {
|
|
160
160
|
$$typeof: u,
|
|
161
|
-
type:
|
|
162
|
-
key:
|
|
163
|
-
props:
|
|
164
|
-
_owner:
|
|
165
|
-
}, (
|
|
161
|
+
type: f,
|
|
162
|
+
key: R,
|
|
163
|
+
props: C,
|
|
164
|
+
_owner: P
|
|
165
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(f, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
get: l
|
|
168
|
-
}) : Object.defineProperty(
|
|
168
|
+
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
169
169
|
configurable: !1,
|
|
170
170
|
enumerable: !1,
|
|
171
171
|
writable: !0,
|
|
172
172
|
value: 0
|
|
173
|
-
}), Object.defineProperty(
|
|
173
|
+
}), Object.defineProperty(f, "_debugInfo", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
176
176
|
writable: !0,
|
|
177
177
|
value: null
|
|
178
|
-
}), Object.defineProperty(
|
|
178
|
+
}), Object.defineProperty(f, "_debugStack", {
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
182
|
value: ee
|
|
183
|
-
}), Object.defineProperty(
|
|
183
|
+
}), Object.defineProperty(f, "_debugTask", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
188
|
-
}), Object.freeze && (Object.freeze(
|
|
189
|
-
}
|
|
190
|
-
function h(
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
if (B(
|
|
195
|
-
for (
|
|
196
|
-
p(P
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
187
|
+
value: le
|
|
188
|
+
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
189
|
+
}
|
|
190
|
+
function h(f, R, C, P, ee, le) {
|
|
191
|
+
var L = R.children;
|
|
192
|
+
if (L !== void 0)
|
|
193
|
+
if (P)
|
|
194
|
+
if (B(L)) {
|
|
195
|
+
for (P = 0; P < L.length; P++)
|
|
196
|
+
p(L[P]);
|
|
197
|
+
Object.freeze && Object.freeze(L);
|
|
198
198
|
} else
|
|
199
199
|
console.error(
|
|
200
200
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
201
|
);
|
|
202
|
-
else p(
|
|
203
|
-
if (V.call(
|
|
204
|
-
|
|
205
|
-
var U = Object.keys(
|
|
206
|
-
return
|
|
202
|
+
else p(L);
|
|
203
|
+
if (V.call(R, "key")) {
|
|
204
|
+
L = t(f);
|
|
205
|
+
var U = Object.keys(R).filter(function(ue) {
|
|
206
|
+
return ue !== "key";
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
P = 0 < U.length ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}", ve[L + P] || (U = 0 < U.length ? "{" + U.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s {...props} />
|
|
212
212
|
React keys must be passed directly to JSX without using spread:
|
|
213
213
|
let props = %s;
|
|
214
214
|
<%s key={someKey} {...props} />`,
|
|
215
|
-
x,
|
|
216
215
|
P,
|
|
216
|
+
L,
|
|
217
217
|
U,
|
|
218
|
-
|
|
219
|
-
),
|
|
218
|
+
L
|
|
219
|
+
), ve[L + P] = !0);
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
for (var X in
|
|
224
|
-
X !== "key" && (
|
|
225
|
-
} else
|
|
226
|
-
return
|
|
227
|
-
|
|
228
|
-
typeof
|
|
229
|
-
),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
221
|
+
if (L = null, C !== void 0 && (n(C), L = "" + C), i(R) && (n(R.key), L = "" + R.key), "key" in R) {
|
|
222
|
+
C = {};
|
|
223
|
+
for (var X in R)
|
|
224
|
+
X !== "key" && (C[X] = R[X]);
|
|
225
|
+
} else C = R;
|
|
226
|
+
return L && a(
|
|
227
|
+
C,
|
|
228
|
+
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
229
|
+
), d(
|
|
230
|
+
f,
|
|
231
|
+
L,
|
|
232
|
+
C,
|
|
233
233
|
o(),
|
|
234
234
|
ee,
|
|
235
|
-
|
|
235
|
+
le
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function p(
|
|
239
|
-
|
|
238
|
+
function p(f) {
|
|
239
|
+
m(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === q && (f._payload.status === "fulfilled" ? m(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
return typeof
|
|
241
|
+
function m(f) {
|
|
242
|
+
return typeof f == "object" && f !== null && f.$$typeof === u;
|
|
243
243
|
}
|
|
244
|
-
var c = sn, u = Symbol.for("react.transitional.element"),
|
|
244
|
+
var c = sn, u = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), E = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), re = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), x = Symbol.for("react.client.reference"), $ = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, B = Array.isArray, K = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
247
|
c = {
|
|
248
|
-
react_stack_bottom_frame: function(
|
|
249
|
-
return
|
|
248
|
+
react_stack_bottom_frame: function(f) {
|
|
249
|
+
return f();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var
|
|
252
|
+
var G, we = {}, Se = c.react_stack_bottom_frame.bind(
|
|
253
253
|
c,
|
|
254
254
|
s
|
|
255
|
-
)(),
|
|
256
|
-
|
|
257
|
-
var
|
|
255
|
+
)(), Ee = K(r(s)), ve = {};
|
|
256
|
+
fe.Fragment = g, fe.jsx = function(f, R, C) {
|
|
257
|
+
var P = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
258
258
|
return h(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
259
|
+
f,
|
|
260
|
+
R,
|
|
261
|
+
C,
|
|
262
262
|
!1,
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
P ? Error("react-stack-top-frame") : Se,
|
|
264
|
+
P ? K(r(f)) : Ee
|
|
265
265
|
);
|
|
266
|
-
},
|
|
267
|
-
var
|
|
266
|
+
}, fe.jsxs = function(f, R, C) {
|
|
267
|
+
var P = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
268
268
|
return h(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
f,
|
|
270
|
+
R,
|
|
271
|
+
C,
|
|
272
272
|
!0,
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
P ? Error("react-stack-top-frame") : Se,
|
|
274
|
+
P ? K(r(f)) : Ee
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
|
-
})()),
|
|
277
|
+
})()), fe;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
279
|
+
var ct;
|
|
280
280
|
function Rn() {
|
|
281
|
-
return
|
|
281
|
+
return ct || (ct = 1, process.env.NODE_ENV === "production" ? Re.exports = En() : Re.exports = vn()), Re.exports;
|
|
282
282
|
}
|
|
283
283
|
var S = Rn();
|
|
284
284
|
function An(t, e) {
|
|
285
|
-
const n =
|
|
285
|
+
const n = Je(
|
|
286
286
|
(r) => t.subscribe(r),
|
|
287
287
|
() => {
|
|
288
288
|
const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
|
|
@@ -302,7 +302,7 @@ function An(t, e) {
|
|
|
302
302
|
}, [n]);
|
|
303
303
|
}
|
|
304
304
|
function Z(t, e) {
|
|
305
|
-
const n =
|
|
305
|
+
const n = Je(
|
|
306
306
|
(r) => t.subscribeNode(e, r),
|
|
307
307
|
() => t.getNodeVersion(e),
|
|
308
308
|
() => t.getNodeVersion(e)
|
|
@@ -353,8 +353,8 @@ const Ke = z(function t({ nodeId: e, context: n }) {
|
|
|
353
353
|
const a = n.library.resolve(r);
|
|
354
354
|
if (!a)
|
|
355
355
|
return Tn.warn(`No renderer for node type ${r.type}`), null;
|
|
356
|
-
const l = Cn(r),
|
|
357
|
-
return /* @__PURE__ */ S.jsx(h, { nodeId: e, context: n, className:
|
|
356
|
+
const l = Cn(r), d = l.length > 0 ? l.join(" ") : void 0, h = a;
|
|
357
|
+
return /* @__PURE__ */ S.jsx(h, { nodeId: e, context: n, className: d });
|
|
358
358
|
}, In);
|
|
359
359
|
function Nn(t, e) {
|
|
360
360
|
return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ S.jsx(Ke, { nodeId: n.id, context: e }, n.id));
|
|
@@ -363,28 +363,28 @@ function xn(t, e) {
|
|
|
363
363
|
return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
|
|
364
364
|
}
|
|
365
365
|
const Pn = z(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
|
|
366
|
-
const { rootViewId: l, rootNodeId:
|
|
366
|
+
const { rootViewId: l, rootNodeId: d } = An(e, r), h = A(s);
|
|
367
367
|
h.current = s;
|
|
368
|
-
const p =
|
|
368
|
+
const p = A(i);
|
|
369
369
|
p.current = i;
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
const c = D((
|
|
373
|
-
if (!
|
|
370
|
+
const m = A(a);
|
|
371
|
+
m.current = a;
|
|
372
|
+
const c = D((y, g) => {
|
|
373
|
+
if (!y)
|
|
374
374
|
return;
|
|
375
375
|
const b = kn(g);
|
|
376
|
-
h.current?.(
|
|
376
|
+
h.current?.(y, b);
|
|
377
377
|
}, []), u = W(() => {
|
|
378
|
-
const
|
|
378
|
+
const y = {
|
|
379
379
|
store: e,
|
|
380
380
|
library: n,
|
|
381
381
|
handlerCache: e.handlerCache,
|
|
382
382
|
// Access payloads from store at call time, not captured snapshot
|
|
383
383
|
getPayload: (g) => e.getSnapshot().payloads.get(g),
|
|
384
|
-
renderChildren: (g) => Nn(g,
|
|
384
|
+
renderChildren: (g) => Nn(g, y),
|
|
385
385
|
renderView: (g) => {
|
|
386
386
|
const b = e.getSnapshot().views.get(g);
|
|
387
|
-
return b ? /* @__PURE__ */ S.jsx(Ke, { nodeId: b.id, context:
|
|
387
|
+
return b ? /* @__PURE__ */ S.jsx(Ke, { nodeId: b.id, context: y }) : null;
|
|
388
388
|
},
|
|
389
389
|
dispatchAction: c,
|
|
390
390
|
// Access client/video via refs to avoid context recreation
|
|
@@ -392,12 +392,12 @@ const Pn = z(function({ store: e, library: n, viewId: r, emptyFallback: o = null
|
|
|
392
392
|
return p.current;
|
|
393
393
|
},
|
|
394
394
|
get video() {
|
|
395
|
-
return
|
|
395
|
+
return m.current;
|
|
396
396
|
}
|
|
397
397
|
};
|
|
398
|
-
return
|
|
398
|
+
return y;
|
|
399
399
|
}, [e, n, c]);
|
|
400
|
-
return !l || !
|
|
400
|
+
return !l || !d ? o : /* @__PURE__ */ S.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ S.jsx(Ke, { nodeId: d, context: u }) });
|
|
401
401
|
}, xn);
|
|
402
402
|
class Ln {
|
|
403
403
|
constructor(e, n) {
|
|
@@ -416,12 +416,12 @@ class Ln {
|
|
|
416
416
|
return this.renderers.get(e.type) ?? this.fallback;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Cs(t, e) {
|
|
420
420
|
const n = Object.entries(t);
|
|
421
421
|
return new Ln(n, e);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
return
|
|
423
|
+
function _s(t) {
|
|
424
|
+
return Je(
|
|
425
425
|
(e) => t.subscribe(e),
|
|
426
426
|
() => t.getSnapshot(),
|
|
427
427
|
() => t.getSnapshot()
|
|
@@ -429,7 +429,7 @@ function ks(t) {
|
|
|
429
429
|
}
|
|
430
430
|
function Mn() {
|
|
431
431
|
const t = ln();
|
|
432
|
-
return
|
|
432
|
+
return _(() => {
|
|
433
433
|
if (!t)
|
|
434
434
|
return;
|
|
435
435
|
let e = window.parent === window, n = null, r = [];
|
|
@@ -439,13 +439,13 @@ function Mn() {
|
|
|
439
439
|
n && !r.includes(n) && (n.style.outline = "", n.style.outlineOffset = ""), n = null, o.style.display = "none";
|
|
440
440
|
}
|
|
441
441
|
function i(c) {
|
|
442
|
-
for (const
|
|
443
|
-
|
|
442
|
+
for (const y of r)
|
|
443
|
+
y !== n && (y.style.outline = "", y.style.outlineOffset = "");
|
|
444
444
|
r = [];
|
|
445
445
|
const u = new Set(c);
|
|
446
|
-
for (const
|
|
447
|
-
const g =
|
|
448
|
-
u.has(g) && (
|
|
446
|
+
for (const y of document.querySelectorAll("[data-ikon-source]")) {
|
|
447
|
+
const g = y.getAttribute("data-ikon-source") ?? "";
|
|
448
|
+
u.has(g) && (y.style.outline = "2px solid #a6e3a1", y.style.outlineOffset = "1px", r.push(y));
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
function a(c) {
|
|
@@ -455,8 +455,8 @@ function Mn() {
|
|
|
455
455
|
if (!u || u === n)
|
|
456
456
|
return;
|
|
457
457
|
s(), n = u, n.style.outline = "2px solid #89b4fa", n.style.outlineOffset = "1px";
|
|
458
|
-
const
|
|
459
|
-
o.textContent =
|
|
458
|
+
const y = u.getAttribute("data-ikon-source") ?? "";
|
|
459
|
+
o.textContent = y, o.style.display = "block";
|
|
460
460
|
const g = u.getBoundingClientRect();
|
|
461
461
|
o.style.left = `${g.left}px`, o.style.top = `${Math.max(0, g.top - 24)}px`;
|
|
462
462
|
}
|
|
@@ -465,19 +465,19 @@ function Mn() {
|
|
|
465
465
|
return;
|
|
466
466
|
c.relatedTarget?.closest?.("[data-ikon-source]") !== n && s();
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function d(c) {
|
|
469
469
|
if (!e)
|
|
470
470
|
return;
|
|
471
471
|
const u = c.target.closest?.("[data-ikon-source]");
|
|
472
472
|
if (!u)
|
|
473
473
|
return;
|
|
474
474
|
c.preventDefault(), c.stopPropagation();
|
|
475
|
-
const
|
|
475
|
+
const y = {
|
|
476
476
|
sourceMarker: u.getAttribute("data-ikon-source") ?? "",
|
|
477
477
|
tagName: u.tagName.toLowerCase(),
|
|
478
478
|
textContent: (u.textContent ?? "").trim().substring(0, 200)
|
|
479
479
|
};
|
|
480
|
-
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail:
|
|
480
|
+
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: y })), window.parent.postMessage({ type: "ikon-element-selected", payload: y }, "*");
|
|
481
481
|
}
|
|
482
482
|
function h(c, u) {
|
|
483
483
|
return document.elementFromPoint(c, u)?.closest?.("[data-ikon-source]");
|
|
@@ -488,10 +488,10 @@ function Mn() {
|
|
|
488
488
|
n = c, n.style.outline = `2px solid ${r.includes(c) ? "#a6e3a1" : "#89b4fa"}`, n.style.outlineOffset = "1px";
|
|
489
489
|
const u = c.getAttribute("data-ikon-source") ?? "";
|
|
490
490
|
o.textContent = u, o.style.display = "block";
|
|
491
|
-
const
|
|
492
|
-
o.style.left = `${
|
|
491
|
+
const y = c.getBoundingClientRect();
|
|
492
|
+
o.style.left = `${y.left}px`, o.style.top = `${Math.max(0, y.top - 24)}px`;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function m(c) {
|
|
495
495
|
if (c.data?.type === "ikon-inspect-mode") {
|
|
496
496
|
const u = !!c.data.enabled;
|
|
497
497
|
!u && e && s(), e = u;
|
|
@@ -500,85 +500,85 @@ function Mn() {
|
|
|
500
500
|
if (c.data?.type === "ikon-inspect-at") {
|
|
501
501
|
const u = h(c.data.x, c.data.y);
|
|
502
502
|
p(u);
|
|
503
|
-
const
|
|
503
|
+
const y = u?.getAttribute("data-ikon-source") ?? "";
|
|
504
504
|
window.parent.postMessage({
|
|
505
505
|
type: "ikon-inspect-hover-result",
|
|
506
|
-
payload: { sourceMarker:
|
|
506
|
+
payload: { sourceMarker: y }
|
|
507
507
|
}, "*");
|
|
508
508
|
}
|
|
509
509
|
if (c.data?.type === "ikon-inspect-click") {
|
|
510
510
|
const u = h(c.data.x, c.data.y);
|
|
511
511
|
if (u) {
|
|
512
|
-
const
|
|
512
|
+
const y = {
|
|
513
513
|
sourceMarker: u.getAttribute("data-ikon-source") ?? "",
|
|
514
514
|
tagName: u.tagName.toLowerCase(),
|
|
515
515
|
textContent: (u.textContent ?? "").trim().substring(0, 200)
|
|
516
516
|
};
|
|
517
|
-
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail:
|
|
517
|
+
window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: y })), window.parent.postMessage({ type: "ikon-element-selected", payload: y }, "*");
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
if (c.data?.type === "ikon-inspect-click-add") {
|
|
521
521
|
const u = h(c.data.x, c.data.y);
|
|
522
522
|
if (u) {
|
|
523
|
-
const
|
|
523
|
+
const y = {
|
|
524
524
|
sourceMarker: u.getAttribute("data-ikon-source") ?? "",
|
|
525
525
|
tagName: u.tagName.toLowerCase(),
|
|
526
526
|
textContent: (u.textContent ?? "").trim().substring(0, 200)
|
|
527
527
|
};
|
|
528
528
|
window.parent.postMessage({
|
|
529
529
|
type: "ikon-inspect-rect-result",
|
|
530
|
-
payload: { elements: [
|
|
530
|
+
payload: { elements: [y], append: !0 }
|
|
531
531
|
}, "*");
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
if (c.data?.type === "ikon-inspect-rect") {
|
|
535
|
-
const { x1: u, y1:
|
|
536
|
-
for (const
|
|
537
|
-
const M =
|
|
538
|
-
M.right > u && M.left < g && M.bottom >
|
|
539
|
-
sourceMarker:
|
|
540
|
-
tagName:
|
|
541
|
-
textContent: (
|
|
535
|
+
const { x1: u, y1: y, x2: g, y2: b, append: w } = c.data, v = document.querySelectorAll("[data-ikon-source]"), E = [];
|
|
536
|
+
for (const T of v) {
|
|
537
|
+
const M = T.getBoundingClientRect();
|
|
538
|
+
M.right > u && M.left < g && M.bottom > y && M.top < b && E.push({
|
|
539
|
+
sourceMarker: T.getAttribute("data-ikon-source") ?? "",
|
|
540
|
+
tagName: T.tagName.toLowerCase(),
|
|
541
|
+
textContent: (T.textContent ?? "").trim().substring(0, 200)
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
|
-
|
|
544
|
+
E.length > 0 && window.parent.postMessage({
|
|
545
545
|
type: "ikon-inspect-rect-result",
|
|
546
|
-
payload: { elements:
|
|
546
|
+
payload: { elements: E, append: w ?? !1 }
|
|
547
547
|
}, "*");
|
|
548
548
|
}
|
|
549
549
|
c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
|
|
550
550
|
}
|
|
551
|
-
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click",
|
|
552
|
-
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click",
|
|
551
|
+
return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", d, !0), window.addEventListener("message", m), () => {
|
|
552
|
+
document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", d, !0), window.removeEventListener("message", m), s(), i([]), o.remove();
|
|
553
553
|
};
|
|
554
554
|
}, [t]), null;
|
|
555
555
|
}
|
|
556
|
-
const Un = ne("IkonUiSurface"),
|
|
556
|
+
const Un = ne("IkonUiSurface"), Ge = "ikon-ui";
|
|
557
557
|
function jn(t, e) {
|
|
558
558
|
return t === e;
|
|
559
559
|
}
|
|
560
|
-
const
|
|
561
|
-
const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a =
|
|
560
|
+
const Nt = z(function({ stores: e, registry: n, category: r = Ge, onAction: o, client: s }) {
|
|
561
|
+
const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = A(o);
|
|
562
562
|
a.current = o;
|
|
563
|
-
const l =
|
|
563
|
+
const l = A(s);
|
|
564
564
|
l.current = s;
|
|
565
|
-
const
|
|
565
|
+
const d = W(
|
|
566
566
|
() => {
|
|
567
|
-
const
|
|
567
|
+
const m = [];
|
|
568
568
|
for (const [c, u] of e) {
|
|
569
|
-
const
|
|
570
|
-
jn(u.category, r) && (!
|
|
569
|
+
const y = u.store.getSnapshot();
|
|
570
|
+
jn(u.category, r) && (!y.rootViewId || !y.views.has(y.rootViewId) || m.push({ key: c, store: u.store }));
|
|
571
571
|
}
|
|
572
|
-
return
|
|
572
|
+
return m;
|
|
573
573
|
},
|
|
574
574
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
575
575
|
[e, r, i]
|
|
576
|
-
), h =
|
|
577
|
-
return
|
|
576
|
+
), h = A(!1), p = d.length > 0;
|
|
577
|
+
return _(() => {
|
|
578
578
|
p && !h.current && (h.current = !0, Un.debug("First UI render"));
|
|
579
579
|
}, [p]), p ? /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
580
580
|
/* @__PURE__ */ S.jsx(Mn, {}),
|
|
581
|
-
|
|
581
|
+
d.map(({ key: m, store: c }) => /* @__PURE__ */ S.jsx(Pn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, m))
|
|
582
582
|
] }) : null;
|
|
583
583
|
});
|
|
584
584
|
class Dn {
|
|
@@ -639,7 +639,7 @@ class Dn {
|
|
|
639
639
|
if (n)
|
|
640
640
|
return n;
|
|
641
641
|
const r = {
|
|
642
|
-
category:
|
|
642
|
+
category: Ge,
|
|
643
643
|
store: new on()
|
|
644
644
|
};
|
|
645
645
|
return this.stores.set(e, r), r;
|
|
@@ -648,7 +648,7 @@ class Dn {
|
|
|
648
648
|
const r = this.stores.get(e);
|
|
649
649
|
if (!r)
|
|
650
650
|
return !1;
|
|
651
|
-
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ??
|
|
651
|
+
const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? Ge;
|
|
652
652
|
return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
|
|
653
653
|
}
|
|
654
654
|
notify(e) {
|
|
@@ -662,7 +662,7 @@ function $n(t) {
|
|
|
662
662
|
return e.length > 0 ? e : void 0;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function ae(t) {
|
|
666
666
|
if (typeof t == "string") {
|
|
667
667
|
const e = t.trim();
|
|
668
668
|
return e.length > 0 ? e : void 0;
|
|
@@ -672,7 +672,7 @@ function ie(t) {
|
|
|
672
672
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Qe(...t) {
|
|
676
676
|
let e = "";
|
|
677
677
|
for (const n of t)
|
|
678
678
|
if (n) {
|
|
@@ -681,17 +681,17 @@ function et(...t) {
|
|
|
681
681
|
}
|
|
682
682
|
return e || void 0;
|
|
683
683
|
}
|
|
684
|
-
const
|
|
685
|
-
function
|
|
684
|
+
const lt = /* @__PURE__ */ new WeakMap(), Bn = {};
|
|
685
|
+
function et(t) {
|
|
686
686
|
if (!t)
|
|
687
687
|
return Bn;
|
|
688
|
-
const e =
|
|
688
|
+
const e = lt.get(t);
|
|
689
689
|
if (e)
|
|
690
690
|
return e;
|
|
691
691
|
const n = {};
|
|
692
692
|
for (const [r, o] of Object.entries(t))
|
|
693
693
|
o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
|
|
694
|
-
return
|
|
694
|
+
return lt.set(t, n), n;
|
|
695
695
|
}
|
|
696
696
|
function Fn(t) {
|
|
697
697
|
let e = t.parentElement;
|
|
@@ -703,15 +703,15 @@ function Fn(t) {
|
|
|
703
703
|
}
|
|
704
704
|
return null;
|
|
705
705
|
}
|
|
706
|
-
const
|
|
707
|
-
function
|
|
706
|
+
const xt = 1.5;
|
|
707
|
+
function Pt(t, e) {
|
|
708
708
|
requestAnimationFrame(() => {
|
|
709
|
-
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight *
|
|
709
|
+
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * xt ? "auto" : "smooth";
|
|
710
710
|
"scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
|
-
const
|
|
714
|
-
function
|
|
713
|
+
const Ye = "data-ikon-scroll-indicator", Vn = 0.15, Ce = "data-ikon-at-bottom";
|
|
714
|
+
function Lt(t) {
|
|
715
715
|
return Math.max(t.clientHeight * Vn, 20);
|
|
716
716
|
}
|
|
717
717
|
function Wn(t) {
|
|
@@ -719,16 +719,16 @@ function Wn(t) {
|
|
|
719
719
|
}
|
|
720
720
|
function Kn(t) {
|
|
721
721
|
t.getAttribute(Ce) === null && (t.setAttribute(Ce, "true"), t.addEventListener("scroll", () => {
|
|
722
|
-
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <=
|
|
722
|
+
const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Lt(t);
|
|
723
723
|
t.setAttribute(Ce, s ? "true" : "false");
|
|
724
724
|
}, { passive: !0 }));
|
|
725
725
|
}
|
|
726
|
-
function
|
|
727
|
-
const e = t.parentElement ?? t, n = e.querySelector(`[${
|
|
726
|
+
function Gn(t) {
|
|
727
|
+
const e = t.parentElement ?? t, n = e.querySelector(`[${Ye}]`);
|
|
728
728
|
if (n)
|
|
729
729
|
return n;
|
|
730
730
|
const r = document.createElement("button");
|
|
731
|
-
return r.setAttribute(
|
|
731
|
+
return r.setAttribute(Ye, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
|
|
732
732
|
position: "absolute",
|
|
733
733
|
bottom: "12px",
|
|
734
734
|
left: "50%",
|
|
@@ -756,14 +756,14 @@ function Yn(t) {
|
|
|
756
756
|
r.style.opacity = "0.9";
|
|
757
757
|
}), e.appendChild(r), r;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
const n =
|
|
759
|
+
function Yn(t, e) {
|
|
760
|
+
const n = Gn(t);
|
|
761
761
|
n.style.display = "flex";
|
|
762
762
|
const r = () => {
|
|
763
|
-
|
|
763
|
+
Pt(t, e), n.style.display = "none";
|
|
764
764
|
}, o = () => {
|
|
765
765
|
const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
|
|
766
|
-
i - s - a <=
|
|
766
|
+
i - s - a <= Lt(t) && (n.style.display = "none");
|
|
767
767
|
};
|
|
768
768
|
return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
|
|
769
769
|
n.removeEventListener("click", r), t.removeEventListener("scroll", o);
|
|
@@ -771,8 +771,8 @@ function Gn(t, e) {
|
|
|
771
771
|
}
|
|
772
772
|
function zn() {
|
|
773
773
|
const t = z(function({ nodeId: n, context: r }) {
|
|
774
|
-
const o = Z(r.store, n), s =
|
|
775
|
-
return
|
|
774
|
+
const o = Z(r.store, n), s = A(null), i = ae(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, d = ae(o?.props?.priority), h = ae(o?.props?.key), p = o?.props?.preciseGeneratedAt;
|
|
775
|
+
return _(() => {
|
|
776
776
|
if (typeof document > "u")
|
|
777
777
|
return;
|
|
778
778
|
const c = s.current;
|
|
@@ -782,16 +782,16 @@ function zn() {
|
|
|
782
782
|
if (l !== !0) {
|
|
783
783
|
const w = Fn(c);
|
|
784
784
|
if (w)
|
|
785
|
-
if (Kn(w),
|
|
786
|
-
u =
|
|
785
|
+
if (Kn(w), d === "Polite" && !Wn(w))
|
|
786
|
+
u = Yn(w, c);
|
|
787
787
|
else {
|
|
788
|
-
const M = (w.parentElement ?? w).querySelector(`[${
|
|
789
|
-
M && (M.style.display = "none"),
|
|
788
|
+
const M = (w.parentElement ?? w).querySelector(`[${Ye}]`);
|
|
789
|
+
M && (M.style.display = "none"), Pt(w, c);
|
|
790
790
|
}
|
|
791
791
|
else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
792
|
-
const
|
|
792
|
+
const v = c.getBoundingClientRect().top, E = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(v) > E * xt ? "auto" : "smooth";
|
|
793
793
|
try {
|
|
794
|
-
c.scrollIntoView({ behavior:
|
|
794
|
+
c.scrollIntoView({ behavior: T, block: "end", inline: "nearest" });
|
|
795
795
|
} catch {
|
|
796
796
|
c.scrollIntoView(!1);
|
|
797
797
|
}
|
|
@@ -805,7 +805,7 @@ function zn() {
|
|
|
805
805
|
c.focus();
|
|
806
806
|
}
|
|
807
807
|
return u;
|
|
808
|
-
}, [l,
|
|
808
|
+
}, [l, d, i, h, p]), o ? /* @__PURE__ */ S.jsx(
|
|
809
809
|
"span",
|
|
810
810
|
{
|
|
811
811
|
ref: s,
|
|
@@ -829,16 +829,16 @@ function Xn() {
|
|
|
829
829
|
}, [i, r]);
|
|
830
830
|
if (!s)
|
|
831
831
|
return null;
|
|
832
|
-
const l =
|
|
832
|
+
const l = et(s.props);
|
|
833
833
|
delete l.onInvokeId;
|
|
834
|
-
const
|
|
834
|
+
const d = Qe(ae(s.props?.className), o), h = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
835
835
|
return /* @__PURE__ */ S.jsx(
|
|
836
836
|
"div",
|
|
837
837
|
{
|
|
838
838
|
...l,
|
|
839
839
|
"data-ikon-node-id": s.id,
|
|
840
840
|
"data-ikon-source": s.sourceMarker,
|
|
841
|
-
className:
|
|
841
|
+
className: d,
|
|
842
842
|
onClick: i ? a : void 0,
|
|
843
843
|
style: i ? { cursor: "pointer" } : void 0,
|
|
844
844
|
children: h
|
|
@@ -855,7 +855,7 @@ function Hn() {
|
|
|
855
855
|
const s = Z(r.store, n);
|
|
856
856
|
if (!s)
|
|
857
857
|
return null;
|
|
858
|
-
const i =
|
|
858
|
+
const i = et(s.props), a = Qe("relative", ae(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
859
859
|
return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
860
860
|
});
|
|
861
861
|
return ({ type: e }) => {
|
|
@@ -868,7 +868,7 @@ function qn() {
|
|
|
868
868
|
const s = Z(r.store, n);
|
|
869
869
|
if (!s)
|
|
870
870
|
return null;
|
|
871
|
-
const i =
|
|
871
|
+
const i = et(s.props), a = Qe("absolute", ae(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
872
872
|
return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
|
|
873
873
|
});
|
|
874
874
|
return ({ type: e }) => {
|
|
@@ -904,13 +904,13 @@ function nr(...t) {
|
|
|
904
904
|
n && n.trim() && e.push(n.trim());
|
|
905
905
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function ut(t) {
|
|
908
908
|
if (typeof t != "string")
|
|
909
909
|
return;
|
|
910
910
|
const e = t.trim();
|
|
911
911
|
return e.length > 0 ? e : void 0;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function Ae(t) {
|
|
914
914
|
if (typeof t == "boolean")
|
|
915
915
|
return t;
|
|
916
916
|
if (typeof t == "string") {
|
|
@@ -926,13 +926,13 @@ function or() {
|
|
|
926
926
|
context: r,
|
|
927
927
|
className: o
|
|
928
928
|
}) {
|
|
929
|
-
const s = Z(r.store, n), i =
|
|
930
|
-
if (
|
|
929
|
+
const s = Z(r.store, n), i = A(null), a = s ? Ae(s.props?.autoplay) : void 0, l = s ? ut(s.props?.src) : void 0;
|
|
930
|
+
if (_(() => {
|
|
931
931
|
a && i.current && i.current.play().catch(() => {
|
|
932
932
|
});
|
|
933
933
|
}, [a, l]), !s)
|
|
934
934
|
return null;
|
|
935
|
-
const
|
|
935
|
+
const d = nr(tr(s.props?.className), o), h = ut(s.props?.preload), p = Ae(s.props?.controls), m = Ae(s.props?.loop), c = Ae(s.props?.muted);
|
|
936
936
|
return /* @__PURE__ */ S.jsx(
|
|
937
937
|
"audio",
|
|
938
938
|
{
|
|
@@ -941,11 +941,11 @@ function or() {
|
|
|
941
941
|
...h !== void 0 ? { preload: h } : {},
|
|
942
942
|
...p !== void 0 ? { controls: p } : {},
|
|
943
943
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
944
|
-
...
|
|
944
|
+
...m !== void 0 ? { loop: m } : {},
|
|
945
945
|
...c !== void 0 ? { muted: c } : {},
|
|
946
946
|
"data-ikon-node-id": s.id,
|
|
947
947
|
"data-ikon-source": s.sourceMarker,
|
|
948
|
-
className:
|
|
948
|
+
className: d
|
|
949
949
|
}
|
|
950
950
|
);
|
|
951
951
|
});
|
|
@@ -954,7 +954,7 @@ function or() {
|
|
|
954
954
|
return t;
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function Mt(t) {
|
|
958
958
|
if (typeof t == "string") {
|
|
959
959
|
const e = t.trim();
|
|
960
960
|
return e.length > 0 ? e : void 0;
|
|
@@ -964,7 +964,7 @@ function Ut(t) {
|
|
|
964
964
|
return e.length > 0 ? e.join(" ") : void 0;
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function Ut(...t) {
|
|
968
968
|
const e = [];
|
|
969
969
|
for (const n of t)
|
|
970
970
|
n && n.trim() && e.push(n.trim());
|
|
@@ -988,30 +988,30 @@ function ze(t) {
|
|
|
988
988
|
const sr = "std.video-canvas", ir = "std.video-url-player";
|
|
989
989
|
function ar() {
|
|
990
990
|
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
991
|
-
const s = Z(r.store, n), i =
|
|
992
|
-
|
|
993
|
-
if (!
|
|
994
|
-
const g =
|
|
995
|
-
return
|
|
991
|
+
const s = Z(r.store, n), i = A(null), a = A(null), l = r.video, d = r.client, h = s ? ze(s.props?.streamId) : void 0, p = s ? _e(s.props?.width) : void 0, m = s ? _e(s.props?.height) : void 0, c = s ? Ut(Mt(s.props?.className), o) : o, [, u] = N(0);
|
|
992
|
+
_(() => {
|
|
993
|
+
if (!d?.isWebRtcEnabled) return;
|
|
994
|
+
const g = d.onWebRtcTrackMapChanged;
|
|
995
|
+
return d.onWebRtcTrackMapChanged = (b) => {
|
|
996
996
|
g?.(b), b.kind === "video" && u((w) => w + 1);
|
|
997
997
|
}, () => {
|
|
998
|
-
|
|
998
|
+
d.onWebRtcTrackMapChanged = g;
|
|
999
999
|
};
|
|
1000
|
-
}, [
|
|
1001
|
-
const
|
|
1002
|
-
return
|
|
1000
|
+
}, [d]);
|
|
1001
|
+
const y = d?.isWebRtcEnabled && h ? d.getWebRtcVideoStreamByStreamId(h) : null;
|
|
1002
|
+
return _(() => {
|
|
1003
1003
|
const g = i.current;
|
|
1004
|
-
if (!(!l || !g || !h ||
|
|
1004
|
+
if (!(!l || !g || !h || y))
|
|
1005
1005
|
return l.attachCanvas(h, g), () => {
|
|
1006
1006
|
l.detachCanvas(h);
|
|
1007
1007
|
};
|
|
1008
|
-
}, [l, h,
|
|
1008
|
+
}, [l, h, y]), _(() => {
|
|
1009
1009
|
const g = a.current;
|
|
1010
|
-
if (!(!g || !
|
|
1011
|
-
return g.srcObject =
|
|
1010
|
+
if (!(!g || !y))
|
|
1011
|
+
return g.srcObject = y, () => {
|
|
1012
1012
|
g.srcObject = null;
|
|
1013
1013
|
};
|
|
1014
|
-
}, [
|
|
1014
|
+
}, [y]), s ? y ? /* @__PURE__ */ S.jsx(
|
|
1015
1015
|
"video",
|
|
1016
1016
|
{
|
|
1017
1017
|
ref: a,
|
|
@@ -1023,7 +1023,7 @@ function ar() {
|
|
|
1023
1023
|
"data-ikon-video-stream-id": h,
|
|
1024
1024
|
className: c,
|
|
1025
1025
|
...p ? { width: p } : {},
|
|
1026
|
-
...
|
|
1026
|
+
...m ? { height: m } : {}
|
|
1027
1027
|
},
|
|
1028
1028
|
h
|
|
1029
1029
|
) : /* @__PURE__ */ S.jsx(
|
|
@@ -1035,7 +1035,7 @@ function ar() {
|
|
|
1035
1035
|
"data-ikon-video-stream-id": h,
|
|
1036
1036
|
className: c,
|
|
1037
1037
|
...p ? { width: p } : {},
|
|
1038
|
-
...
|
|
1038
|
+
...m ? { height: m } : {}
|
|
1039
1039
|
},
|
|
1040
1040
|
h
|
|
1041
1041
|
) : null;
|
|
@@ -1048,7 +1048,7 @@ function ar() {
|
|
|
1048
1048
|
function cr() {
|
|
1049
1049
|
return [ar(), lr(), or()];
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function he(t) {
|
|
1052
1052
|
if (typeof t == "boolean")
|
|
1053
1053
|
return t;
|
|
1054
1054
|
if (typeof t == "string") {
|
|
@@ -1063,13 +1063,13 @@ function lr() {
|
|
|
1063
1063
|
context: r,
|
|
1064
1064
|
className: o
|
|
1065
1065
|
}) {
|
|
1066
|
-
const s = Z(r.store, n), i =
|
|
1067
|
-
if (
|
|
1066
|
+
const s = Z(r.store, n), i = A(null), a = s ? he(s.props?.autoplay) : void 0, l = s ? ze(s.props?.src) : void 0;
|
|
1067
|
+
if (_(() => {
|
|
1068
1068
|
a && i.current && i.current.play().catch(() => {
|
|
1069
1069
|
});
|
|
1070
1070
|
}, [a, l]), !s)
|
|
1071
1071
|
return null;
|
|
1072
|
-
const
|
|
1072
|
+
const d = Ut(Mt(s.props?.className), o), h = ze(s.props?.poster), p = he(s.props?.controls), m = he(s.props?.loop), c = he(s.props?.muted), u = he(s.props?.playsInline), y = _e(s.props?.width), g = _e(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
|
|
1073
1073
|
return /* @__PURE__ */ S.jsx(
|
|
1074
1074
|
"video",
|
|
1075
1075
|
{
|
|
@@ -1078,14 +1078,14 @@ function lr() {
|
|
|
1078
1078
|
poster: h,
|
|
1079
1079
|
...p !== void 0 ? { controls: p } : {},
|
|
1080
1080
|
...a !== void 0 ? { autoPlay: a } : {},
|
|
1081
|
-
...
|
|
1081
|
+
...m !== void 0 ? { loop: m } : {},
|
|
1082
1082
|
...c !== void 0 ? { muted: c } : {},
|
|
1083
1083
|
...u !== void 0 ? { playsInline: u } : {},
|
|
1084
|
-
...
|
|
1084
|
+
...y ? { width: y } : {},
|
|
1085
1085
|
...g ? { height: g } : {},
|
|
1086
1086
|
"data-ikon-node-id": s.id,
|
|
1087
1087
|
"data-ikon-source": s.sourceMarker,
|
|
1088
|
-
className:
|
|
1088
|
+
className: d,
|
|
1089
1089
|
children: b
|
|
1090
1090
|
}
|
|
1091
1091
|
);
|
|
@@ -1289,14 +1289,14 @@ class gr {
|
|
|
1289
1289
|
(n.width !== o || n.height !== s) && (n.width = o, n.height = s, e.viewport(0, 0, o, s));
|
|
1290
1290
|
const i = performance.now(), a = (i - this.startTime) / 1e3, l = (i - this.lastFrameTime) / 1e3;
|
|
1291
1291
|
this.lastFrameTime = i, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1292
|
+
const d = this.uniformLocations.get("iResolution");
|
|
1293
|
+
d && e.uniform3f(d, o, s, 1);
|
|
1294
1294
|
const h = this.uniformLocations.get("iTime");
|
|
1295
1295
|
h && e.uniform1f(h, a);
|
|
1296
1296
|
const p = this.uniformLocations.get("iTimeDelta");
|
|
1297
1297
|
p && e.uniform1f(p, l);
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1298
|
+
const m = this.uniformLocations.get("iFrame");
|
|
1299
|
+
m && e.uniform1i(m, this.frameCount);
|
|
1300
1300
|
const c = this.uniformLocations.get("iMouse");
|
|
1301
1301
|
c && e.uniform4f(c, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
|
|
1302
1302
|
const u = this.uniformLocations.get("iDate");
|
|
@@ -1309,37 +1309,37 @@ class gr {
|
|
|
1309
1309
|
const w = this.uniformLocations.get(`iChannel${b}`);
|
|
1310
1310
|
w && e.uniform1i(w, b);
|
|
1311
1311
|
}
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1312
|
+
const y = this.uniformLocations.get("iChannelResolution");
|
|
1313
|
+
y && e.uniform3fv(y, this.channelResolution);
|
|
1314
1314
|
const g = this.uniformLocations.get("iChannelTime");
|
|
1315
1315
|
g && e.uniform1fv(g, this.channelTime);
|
|
1316
1316
|
for (const [b, w] of Object.entries(this.customUniforms)) {
|
|
1317
|
-
const
|
|
1318
|
-
if (
|
|
1317
|
+
const v = this.uniformLocations.get(b);
|
|
1318
|
+
if (v)
|
|
1319
1319
|
switch (w.type) {
|
|
1320
1320
|
case "float":
|
|
1321
|
-
e.uniform1f(
|
|
1321
|
+
e.uniform1f(v, w.value);
|
|
1322
1322
|
break;
|
|
1323
1323
|
case "vec2": {
|
|
1324
|
-
const
|
|
1325
|
-
e.uniform2f(
|
|
1324
|
+
const E = w.value;
|
|
1325
|
+
e.uniform2f(v, E[0], E[1]);
|
|
1326
1326
|
break;
|
|
1327
1327
|
}
|
|
1328
1328
|
case "vec3": {
|
|
1329
|
-
const
|
|
1330
|
-
e.uniform3f(
|
|
1329
|
+
const E = w.value;
|
|
1330
|
+
e.uniform3f(v, E[0], E[1], E[2]);
|
|
1331
1331
|
break;
|
|
1332
1332
|
}
|
|
1333
1333
|
case "vec4": {
|
|
1334
|
-
const
|
|
1335
|
-
e.uniform4f(
|
|
1334
|
+
const E = w.value;
|
|
1335
|
+
e.uniform4f(v, E[0], E[1], E[2], E[3]);
|
|
1336
1336
|
break;
|
|
1337
1337
|
}
|
|
1338
1338
|
case "int":
|
|
1339
|
-
e.uniform1i(
|
|
1339
|
+
e.uniform1i(v, w.value);
|
|
1340
1340
|
break;
|
|
1341
1341
|
case "bool":
|
|
1342
|
-
e.uniform1i(
|
|
1342
|
+
e.uniform1i(v, w.value ? 1 : 0);
|
|
1343
1343
|
break;
|
|
1344
1344
|
}
|
|
1345
1345
|
}
|
|
@@ -1435,73 +1435,73 @@ function Rr(t, e) {
|
|
|
1435
1435
|
const Ar = "std.shadertoy-canvas";
|
|
1436
1436
|
function Tr() {
|
|
1437
1437
|
const t = z(function({ nodeId: n, context: r, className: o }) {
|
|
1438
|
-
const s = Z(r.store, n), i =
|
|
1438
|
+
const s = Z(r.store, n), i = A(null), a = A(null), l = A(null), d = A(0), h = A(""), p = A({}), m = A({
|
|
1439
1439
|
x: 0,
|
|
1440
1440
|
y: 0,
|
|
1441
1441
|
clickX: 0,
|
|
1442
1442
|
clickY: 0,
|
|
1443
1443
|
isDown: !1
|
|
1444
|
-
}), c = s ? wr(s.props?.shaderSource) : "", u = s ? Ue(s.props?.fps) ?? 60 : 60,
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1447
|
-
if (
|
|
1444
|
+
}), c = s ? wr(s.props?.shaderSource) : "", u = s ? Ue(s.props?.fps) ?? 60 : 60, y = s?.props?.uniforms, g = W(() => Er(y), [y]), b = s?.props?.channels, w = W(() => vr(b), [b]), v = s ? Sr(s.props?.enableMouse) ?? !0 : !0, E = s ? Ue(s.props?.width) : void 0, T = s ? Ue(s.props?.height) : void 0, M = s ? br(yr(s.props?.className), o) : o;
|
|
1445
|
+
_(() => {
|
|
1446
|
+
const I = i.current;
|
|
1447
|
+
if (I) {
|
|
1448
1448
|
try {
|
|
1449
|
-
const
|
|
1450
|
-
a.current =
|
|
1451
|
-
} catch (
|
|
1452
|
-
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:",
|
|
1449
|
+
const x = new gr(I);
|
|
1450
|
+
a.current = x;
|
|
1451
|
+
} catch (x) {
|
|
1452
|
+
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", x);
|
|
1453
1453
|
}
|
|
1454
1454
|
return () => {
|
|
1455
1455
|
a.current && (a.current.destroy(), a.current = null);
|
|
1456
1456
|
};
|
|
1457
1457
|
}
|
|
1458
|
-
}, []),
|
|
1459
|
-
const
|
|
1460
|
-
if (!(!
|
|
1461
|
-
if (
|
|
1458
|
+
}, []), _(() => {
|
|
1459
|
+
const I = a.current;
|
|
1460
|
+
if (!(!I || !c) && h.current !== c)
|
|
1461
|
+
if (I.compile(c, g))
|
|
1462
1462
|
h.current = c, p.current = g;
|
|
1463
1463
|
else {
|
|
1464
|
-
const $ =
|
|
1464
|
+
const $ = I.getError();
|
|
1465
1465
|
console.error("[ShadertoyRenderer] Shader compilation failed:", $);
|
|
1466
1466
|
}
|
|
1467
|
-
}, [c, g]),
|
|
1468
|
-
const
|
|
1469
|
-
!
|
|
1470
|
-
}, [g]),
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
}, [w]),
|
|
1474
|
-
const
|
|
1475
|
-
if (!
|
|
1476
|
-
const
|
|
1477
|
-
const B = V -
|
|
1478
|
-
B >=
|
|
1467
|
+
}, [c, g]), _(() => {
|
|
1468
|
+
const I = a.current;
|
|
1469
|
+
!I || !h.current || Rr(p.current, g) || (I.setCustomUniforms(g), p.current = g);
|
|
1470
|
+
}, [g]), _(() => {
|
|
1471
|
+
const I = a.current;
|
|
1472
|
+
I && I.setChannels(w);
|
|
1473
|
+
}, [w]), _(() => {
|
|
1474
|
+
const I = a.current;
|
|
1475
|
+
if (!I || !h.current) return;
|
|
1476
|
+
const x = 1e3 / u, $ = (V) => {
|
|
1477
|
+
const B = V - d.current;
|
|
1478
|
+
B >= x && (d.current = V - B % x, I.draw()), l.current = requestAnimationFrame($);
|
|
1479
1479
|
};
|
|
1480
1480
|
return l.current = requestAnimationFrame($), () => {
|
|
1481
1481
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
1482
1482
|
};
|
|
1483
1483
|
}, [u]);
|
|
1484
1484
|
const Q = D(
|
|
1485
|
-
(
|
|
1486
|
-
if (!
|
|
1487
|
-
const
|
|
1488
|
-
if (!
|
|
1489
|
-
const V = window.devicePixelRatio || 1, B =
|
|
1490
|
-
|
|
1485
|
+
(I) => {
|
|
1486
|
+
if (!v) return;
|
|
1487
|
+
const x = i.current, $ = a.current;
|
|
1488
|
+
if (!x || !$) return;
|
|
1489
|
+
const V = window.devicePixelRatio || 1, B = x.getBoundingClientRect(), K = (I.clientX - B.left) * V, G = (B.height - (I.clientY - B.top)) * V;
|
|
1490
|
+
m.current.x = K, m.current.y = G, $.setMouse(K, G, m.current.clickX, m.current.clickY);
|
|
1491
1491
|
},
|
|
1492
|
-
[
|
|
1492
|
+
[v]
|
|
1493
1493
|
), re = D(
|
|
1494
|
-
(
|
|
1495
|
-
if (!
|
|
1496
|
-
const
|
|
1497
|
-
if (!
|
|
1498
|
-
const V = window.devicePixelRatio || 1, B =
|
|
1499
|
-
|
|
1494
|
+
(I) => {
|
|
1495
|
+
if (!v) return;
|
|
1496
|
+
const x = i.current, $ = a.current;
|
|
1497
|
+
if (!x || !$) return;
|
|
1498
|
+
const V = window.devicePixelRatio || 1, B = x.getBoundingClientRect(), K = (I.clientX - B.left) * V, G = (B.height - (I.clientY - B.top)) * V;
|
|
1499
|
+
m.current.isDown = !0, m.current.clickX = K, m.current.clickY = G, $.setMouse(K, G, K, G);
|
|
1500
1500
|
},
|
|
1501
|
-
[
|
|
1501
|
+
[v]
|
|
1502
1502
|
), q = D(() => {
|
|
1503
|
-
|
|
1504
|
-
}, [
|
|
1503
|
+
v && (m.current.isDown = !1, m.current.clickX = -Math.abs(m.current.clickX));
|
|
1504
|
+
}, [v]);
|
|
1505
1505
|
return s ? /* @__PURE__ */ S.jsx(
|
|
1506
1506
|
"canvas",
|
|
1507
1507
|
{
|
|
@@ -1509,8 +1509,8 @@ function Tr() {
|
|
|
1509
1509
|
"data-ikon-node-id": s.id,
|
|
1510
1510
|
"data-ikon-source": s.sourceMarker,
|
|
1511
1511
|
className: M,
|
|
1512
|
-
...
|
|
1513
|
-
...
|
|
1512
|
+
...E ? { width: E } : {},
|
|
1513
|
+
...T ? { height: T } : {},
|
|
1514
1514
|
onMouseMove: Q,
|
|
1515
1515
|
onMouseDown: re,
|
|
1516
1516
|
onMouseUp: q,
|
|
@@ -1527,7 +1527,7 @@ const kr = "shadertoy", Cr = async () => Tr();
|
|
|
1527
1527
|
function _r(t) {
|
|
1528
1528
|
t.registerModule(kr, Cr);
|
|
1529
1529
|
}
|
|
1530
|
-
const
|
|
1530
|
+
const dt = ne("UIRegistry");
|
|
1531
1531
|
class Ir {
|
|
1532
1532
|
baseResolvers = [];
|
|
1533
1533
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
@@ -1553,7 +1553,7 @@ class Ir {
|
|
|
1553
1553
|
const s = await o(), i = xr(s);
|
|
1554
1554
|
this.moduleResolvers.set(r, i), e = !0;
|
|
1555
1555
|
} catch (s) {
|
|
1556
|
-
|
|
1556
|
+
dt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
|
|
1557
1557
|
}
|
|
1558
1558
|
const n = [];
|
|
1559
1559
|
for (const r of this.moduleLoaders.keys())
|
|
@@ -1568,7 +1568,7 @@ class Ir {
|
|
|
1568
1568
|
for (const n of this.activeModuleOrder) {
|
|
1569
1569
|
const r = this.moduleResolvers.get(n);
|
|
1570
1570
|
if (!r) {
|
|
1571
|
-
|
|
1571
|
+
dt.warn(`Missing resolvers for module ${n}`);
|
|
1572
1572
|
continue;
|
|
1573
1573
|
}
|
|
1574
1574
|
for (const o of r) {
|
|
@@ -1596,9 +1596,9 @@ function Pr(t, e) {
|
|
|
1596
1596
|
return !1;
|
|
1597
1597
|
return !0;
|
|
1598
1598
|
}
|
|
1599
|
-
function
|
|
1599
|
+
function Is({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
1600
1600
|
return /* @__PURE__ */ S.jsx(
|
|
1601
|
-
|
|
1601
|
+
Nt,
|
|
1602
1602
|
{
|
|
1603
1603
|
stores: e,
|
|
1604
1604
|
registry: n,
|
|
@@ -1608,7 +1608,7 @@ function Cs({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
);
|
|
1610
1610
|
}
|
|
1611
|
-
const je = ne("MotionController"),
|
|
1611
|
+
const je = ne("MotionController"), ft = {
|
|
1612
1612
|
ease: [0.25, 0.1, 0.25, 1],
|
|
1613
1613
|
"ease-in": [0.42, 0, 1, 1],
|
|
1614
1614
|
"ease-out": [0, 0, 0.58, 1],
|
|
@@ -1641,53 +1641,53 @@ const je = ne("MotionController"), ht = {
|
|
|
1641
1641
|
function F(t) {
|
|
1642
1642
|
return t <= 0 ? 0 : t >= 1 ? 1 : t;
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1644
|
+
function ht(t) {
|
|
1645
1645
|
if (t == null) return;
|
|
1646
1646
|
const e = `${t}`.trim();
|
|
1647
1647
|
if (!e) return;
|
|
1648
1648
|
const n = Number.parseFloat(e);
|
|
1649
1649
|
return Number.isFinite(n) ? n : void 0;
|
|
1650
1650
|
}
|
|
1651
|
-
function
|
|
1651
|
+
function pt(t) {
|
|
1652
1652
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1654
|
+
function mt(t, e, n, r) {
|
|
1655
1655
|
const h = new Float32Array(11);
|
|
1656
1656
|
function p(g, b, w) {
|
|
1657
1657
|
return ((3 * b - 3 * w + 1) * g + (3 * w - 6 * b)) * g * g + 3 * b * g;
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1659
|
+
function m(g, b, w) {
|
|
1660
1660
|
return 3 * (3 * b - 3 * w + 1) * g * g + 2 * (3 * w - 6 * b) * g + 3 * b;
|
|
1661
1661
|
}
|
|
1662
1662
|
function c(g, b) {
|
|
1663
1663
|
for (let w = 0; w < 4; w += 1) {
|
|
1664
|
-
const
|
|
1665
|
-
if (
|
|
1664
|
+
const v = m(b, t, n);
|
|
1665
|
+
if (v === 0)
|
|
1666
1666
|
return b;
|
|
1667
|
-
const
|
|
1668
|
-
b -=
|
|
1667
|
+
const E = p(b, t, n) - g;
|
|
1668
|
+
b -= E / v;
|
|
1669
1669
|
}
|
|
1670
1670
|
return b;
|
|
1671
1671
|
}
|
|
1672
1672
|
function u(g, b, w) {
|
|
1673
|
-
let
|
|
1673
|
+
let v = 0, E = 0, T = 0;
|
|
1674
1674
|
do
|
|
1675
|
-
|
|
1676
|
-
while (Math.abs(
|
|
1677
|
-
return
|
|
1675
|
+
E = b + (w - b) / 2, v = p(E, t, n) - g, v > 0 ? w = E : b = E;
|
|
1676
|
+
while (Math.abs(v) > 1e-7 && ++T < 10);
|
|
1677
|
+
return E;
|
|
1678
1678
|
}
|
|
1679
|
-
function
|
|
1679
|
+
function y(g) {
|
|
1680
1680
|
let b = 0, w = 1;
|
|
1681
|
-
const
|
|
1682
|
-
for (; w !==
|
|
1681
|
+
const v = 10;
|
|
1682
|
+
for (; w !== v && h[w] <= g; w += 1)
|
|
1683
1683
|
b += 0.1;
|
|
1684
1684
|
w -= 1;
|
|
1685
|
-
const
|
|
1686
|
-
return M >= 1e-3 ? c(g,
|
|
1685
|
+
const E = (g - h[w]) / (h[w + 1] - h[w]), T = b + E * 0.1, M = m(T, t, n);
|
|
1686
|
+
return M >= 1e-3 ? c(g, T) : M === 0 ? T : u(g, b, b + 0.1);
|
|
1687
1687
|
}
|
|
1688
1688
|
for (let g = 0; g < 11; g += 1)
|
|
1689
1689
|
h[g] = p(g * 0.1, t, n);
|
|
1690
|
-
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : p(
|
|
1690
|
+
return (g) => g <= 0 ? 0 : g >= 1 ? 1 : p(y(g), e, r);
|
|
1691
1691
|
}
|
|
1692
1692
|
function Lr(t) {
|
|
1693
1693
|
const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
|
|
@@ -1702,15 +1702,15 @@ function Mr(t) {
|
|
|
1702
1702
|
const e = t.trim().toLowerCase();
|
|
1703
1703
|
if (!e || e === "linear")
|
|
1704
1704
|
return (n) => F(n);
|
|
1705
|
-
if (
|
|
1706
|
-
const [n, r, o, s] =
|
|
1705
|
+
if (ft[e]) {
|
|
1706
|
+
const [n, r, o, s] = ft[e], i = mt(n, r, o, s);
|
|
1707
1707
|
return (a) => F(i(F(a)));
|
|
1708
1708
|
}
|
|
1709
1709
|
if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
|
|
1710
1710
|
const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
|
|
1711
1711
|
if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
|
|
1712
|
-
const [o, s, i, a] = r, l =
|
|
1713
|
-
return (
|
|
1712
|
+
const [o, s, i, a] = r, l = mt(o, s, i, a);
|
|
1713
|
+
return (d) => F(l(F(d)));
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
1716
|
if (e.startsWith("steps(") && e.endsWith(")")) {
|
|
@@ -1774,7 +1774,7 @@ class jr {
|
|
|
1774
1774
|
const n = e.source?.trim();
|
|
1775
1775
|
if (!n)
|
|
1776
1776
|
return;
|
|
1777
|
-
const r =
|
|
1777
|
+
const r = ht(e.min) ?? 0, o = ht(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Mr(e.ease), d = Ur(e.map), h = e.targetId?.trim() || void 0;
|
|
1778
1778
|
return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
|
|
1779
1779
|
source: n.toLowerCase(),
|
|
1780
1780
|
min: r,
|
|
@@ -1782,7 +1782,7 @@ class jr {
|
|
|
1782
1782
|
clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
|
|
1783
1783
|
reverse: a,
|
|
1784
1784
|
ease: l,
|
|
1785
|
-
map:
|
|
1785
|
+
map: d,
|
|
1786
1786
|
targetId: h
|
|
1787
1787
|
};
|
|
1788
1788
|
}
|
|
@@ -1832,7 +1832,7 @@ class jr {
|
|
|
1832
1832
|
const n = this.bindingsByStyle.get(e);
|
|
1833
1833
|
if (!n || typeof document > "u")
|
|
1834
1834
|
return;
|
|
1835
|
-
const r = `.${
|
|
1835
|
+
const r = `.${pt(e)}`;
|
|
1836
1836
|
document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
|
|
1837
1837
|
}
|
|
1838
1838
|
applyStyleToElement(e, n, r) {
|
|
@@ -1872,7 +1872,7 @@ class jr {
|
|
|
1872
1872
|
}
|
|
1873
1873
|
resolveScrollContainer(e, n) {
|
|
1874
1874
|
if (n.targetId) {
|
|
1875
|
-
const r = `[data-ikon-motion-source="${
|
|
1875
|
+
const r = `[data-ikon-motion-source="${pt(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
|
|
1876
1876
|
if (o)
|
|
1877
1877
|
return o;
|
|
1878
1878
|
}
|
|
@@ -1882,9 +1882,9 @@ class jr {
|
|
|
1882
1882
|
const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
|
|
1883
1883
|
let i = this.applyClamp(s, n.clamp);
|
|
1884
1884
|
n.reverse && (i = 1 - i);
|
|
1885
|
-
const a = n.ease(i), l = Number.isFinite(a) ? a : 0,
|
|
1886
|
-
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${
|
|
1887
|
-
const h = this.applyMap(
|
|
1885
|
+
const a = n.ease(i), l = Number.isFinite(a) ? a : 0, d = l * 100;
|
|
1886
|
+
if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), n.map) {
|
|
1887
|
+
const h = this.applyMap(d, n.map);
|
|
1888
1888
|
h !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${h}`);
|
|
1889
1889
|
} else
|
|
1890
1890
|
e.style.removeProperty("--tw-motion-bind-value");
|
|
@@ -1989,7 +1989,7 @@ class jr {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
const De = new jr();
|
|
1991
1991
|
function Dr(t) {
|
|
1992
|
-
const e =
|
|
1992
|
+
const e = A(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
|
|
1993
1993
|
if (!(!s || typeof document > "u")) {
|
|
1994
1994
|
if (i) {
|
|
1995
1995
|
let l = e.current.get(s);
|
|
@@ -2011,7 +2011,7 @@ function Dr(t) {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
De.reset();
|
|
2013
2013
|
}, []);
|
|
2014
|
-
return
|
|
2014
|
+
return _(() => {
|
|
2015
2015
|
if (!t) return;
|
|
2016
2016
|
for (const a of t.getUiStyles())
|
|
2017
2017
|
n(a);
|
|
@@ -2019,7 +2019,7 @@ function Dr(t) {
|
|
|
2019
2019
|
return () => {
|
|
2020
2020
|
s?.(), i?.(), o();
|
|
2021
2021
|
};
|
|
2022
|
-
}, [t, o, n, r]),
|
|
2022
|
+
}, [t, o, n, r]), _(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
|
|
2023
2023
|
}
|
|
2024
2024
|
function $r(t) {
|
|
2025
2025
|
const e = [];
|
|
@@ -2030,8 +2030,8 @@ function $r(t) {
|
|
|
2030
2030
|
return e.sort(), e.join(",");
|
|
2031
2031
|
}
|
|
2032
2032
|
function Br(t) {
|
|
2033
|
-
const [e, n] =
|
|
2034
|
-
return
|
|
2033
|
+
const [e, n] = N(), r = A("");
|
|
2034
|
+
return _(() => {
|
|
2035
2035
|
if (!t) {
|
|
2036
2036
|
n(void 0), r.current = "";
|
|
2037
2037
|
return;
|
|
@@ -2043,24 +2043,24 @@ function Br(t) {
|
|
|
2043
2043
|
return o(), t.subscribe(o);
|
|
2044
2044
|
}, [t]), e;
|
|
2045
2045
|
}
|
|
2046
|
-
var Fr = typeof global == "object" && global && global.Object === Object && global, Vr = typeof self == "object" && self && self.Object === Object && self, Wr = Fr || Vr || Function("return this")(), Ie = Wr.Symbol,
|
|
2047
|
-
function
|
|
2048
|
-
var e = Kr.call(t,
|
|
2046
|
+
var Fr = typeof global == "object" && global && global.Object === Object && global, Vr = typeof self == "object" && self && self.Object === Object && self, Wr = Fr || Vr || Function("return this")(), Ie = Wr.Symbol, jt = Object.prototype, Kr = jt.hasOwnProperty, Gr = jt.toString, pe = Ie ? Ie.toStringTag : void 0;
|
|
2047
|
+
function Yr(t) {
|
|
2048
|
+
var e = Kr.call(t, pe), n = t[pe];
|
|
2049
2049
|
try {
|
|
2050
|
-
t[
|
|
2050
|
+
t[pe] = void 0;
|
|
2051
2051
|
var r = !0;
|
|
2052
2052
|
} catch {
|
|
2053
2053
|
}
|
|
2054
|
-
var o =
|
|
2055
|
-
return r && (e ? t[
|
|
2054
|
+
var o = Gr.call(t);
|
|
2055
|
+
return r && (e ? t[pe] = n : delete t[pe]), o;
|
|
2056
2056
|
}
|
|
2057
2057
|
var zr = Object.prototype, Xr = zr.toString;
|
|
2058
2058
|
function Hr(t) {
|
|
2059
2059
|
return Xr.call(t);
|
|
2060
2060
|
}
|
|
2061
|
-
var qr = "[object Null]", Jr = "[object Undefined]",
|
|
2061
|
+
var qr = "[object Null]", Jr = "[object Undefined]", gt = Ie ? Ie.toStringTag : void 0;
|
|
2062
2062
|
function Zr(t) {
|
|
2063
|
-
return t == null ? t === void 0 ? Jr : qr :
|
|
2063
|
+
return t == null ? t === void 0 ? Jr : qr : gt && gt in Object(t) ? Yr(t) : Hr(t);
|
|
2064
2064
|
}
|
|
2065
2065
|
function Qr(t) {
|
|
2066
2066
|
return t != null && typeof t == "object";
|
|
@@ -2069,7 +2069,7 @@ var eo = Array.isArray, to = "[object String]";
|
|
|
2069
2069
|
function no(t) {
|
|
2070
2070
|
return typeof t == "string" || !eo(t) && Qr(t) && Zr(t) == to;
|
|
2071
2071
|
}
|
|
2072
|
-
const
|
|
2072
|
+
const yt = "ikonUiModules";
|
|
2073
2073
|
function Xe(t) {
|
|
2074
2074
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2075
2075
|
}
|
|
@@ -2084,7 +2084,7 @@ function ro(t) {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
return Array.from(e);
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function Os(t, e) {
|
|
2088
2088
|
if (t === e)
|
|
2089
2089
|
return !0;
|
|
2090
2090
|
if (!t || !e)
|
|
@@ -2097,17 +2097,17 @@ function _s(t, e) {
|
|
|
2097
2097
|
return !0;
|
|
2098
2098
|
}
|
|
2099
2099
|
function oo(t) {
|
|
2100
|
-
if (!(!Xe(t) || !Object.prototype.hasOwnProperty.call(t,
|
|
2101
|
-
return ro(t[
|
|
2100
|
+
if (!(!Xe(t) || !Object.prototype.hasOwnProperty.call(t, yt)))
|
|
2101
|
+
return ro(t[yt]);
|
|
2102
2102
|
}
|
|
2103
|
-
function
|
|
2103
|
+
function Ns(...t) {
|
|
2104
2104
|
for (const e of t) {
|
|
2105
2105
|
const n = oo(e);
|
|
2106
2106
|
if (n !== void 0)
|
|
2107
2107
|
return n;
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
|
-
function
|
|
2110
|
+
function xs(t) {
|
|
2111
2111
|
if (!Xe(t))
|
|
2112
2112
|
return;
|
|
2113
2113
|
const e = t, n = Object.keys(e).find((l) => l.toLowerCase() === "modules");
|
|
@@ -2121,35 +2121,35 @@ function Os(t) {
|
|
|
2121
2121
|
const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
2122
2122
|
for (const l of r) {
|
|
2123
2123
|
if (typeof l == "string") {
|
|
2124
|
-
const
|
|
2125
|
-
if (!
|
|
2124
|
+
const y = l.trim();
|
|
2125
|
+
if (!y || i.has(y))
|
|
2126
2126
|
continue;
|
|
2127
|
-
o.push(
|
|
2127
|
+
o.push(y), i.add(y);
|
|
2128
2128
|
continue;
|
|
2129
2129
|
}
|
|
2130
2130
|
if (!Xe(l))
|
|
2131
2131
|
continue;
|
|
2132
|
-
const
|
|
2132
|
+
const d = l, h = Object.keys(d).find((y) => y.toLowerCase() === "name");
|
|
2133
2133
|
if (!h)
|
|
2134
2134
|
continue;
|
|
2135
|
-
const p =
|
|
2135
|
+
const p = d[h];
|
|
2136
2136
|
if (typeof p != "string")
|
|
2137
2137
|
continue;
|
|
2138
|
-
const
|
|
2139
|
-
if (!
|
|
2138
|
+
const m = p.trim();
|
|
2139
|
+
if (!m)
|
|
2140
2140
|
continue;
|
|
2141
|
-
const c = Object.keys(
|
|
2142
|
-
typeof u == "string" && s.set(
|
|
2141
|
+
const c = Object.keys(d).find((y) => y.toLowerCase() === "javascript"), u = c ? d[c] : void 0;
|
|
2142
|
+
typeof u == "string" && s.set(m, u), i.has(m) || (o.push(m), i.add(m));
|
|
2143
2143
|
}
|
|
2144
2144
|
if (!o.length && s.size === 0)
|
|
2145
2145
|
return { modules: [] };
|
|
2146
|
-
const a = Array.from(s.entries()).map(([l,
|
|
2146
|
+
const a = Array.from(s.entries()).map(([l, d]) => ({
|
|
2147
2147
|
name: l,
|
|
2148
|
-
javascript:
|
|
2148
|
+
javascript: d
|
|
2149
2149
|
}));
|
|
2150
2150
|
return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
|
|
2151
2151
|
}
|
|
2152
|
-
const
|
|
2152
|
+
const k = {
|
|
2153
2153
|
None: 0,
|
|
2154
2154
|
Letter: 1,
|
|
2155
2155
|
Word: 2,
|
|
@@ -2158,7 +2158,7 @@ const T = {
|
|
|
2158
2158
|
Emoji: 16
|
|
2159
2159
|
}, so = [
|
|
2160
2160
|
{
|
|
2161
|
-
flag:
|
|
2161
|
+
flag: k.Letter,
|
|
2162
2162
|
hints: [
|
|
2163
2163
|
"[data-motion-letter]",
|
|
2164
2164
|
"[data-letter]",
|
|
@@ -2167,7 +2167,7 @@ const T = {
|
|
|
2167
2167
|
]
|
|
2168
2168
|
},
|
|
2169
2169
|
{
|
|
2170
|
-
flag:
|
|
2170
|
+
flag: k.Word,
|
|
2171
2171
|
hints: [
|
|
2172
2172
|
"[data-motion-word]",
|
|
2173
2173
|
"[data-word]",
|
|
@@ -2176,7 +2176,7 @@ const T = {
|
|
|
2176
2176
|
]
|
|
2177
2177
|
},
|
|
2178
2178
|
{
|
|
2179
|
-
flag:
|
|
2179
|
+
flag: k.Line,
|
|
2180
2180
|
hints: [
|
|
2181
2181
|
"[data-motion-line]",
|
|
2182
2182
|
"[data-line]",
|
|
@@ -2185,7 +2185,7 @@ const T = {
|
|
|
2185
2185
|
]
|
|
2186
2186
|
},
|
|
2187
2187
|
{
|
|
2188
|
-
flag:
|
|
2188
|
+
flag: k.Paragraph,
|
|
2189
2189
|
hints: [
|
|
2190
2190
|
"[data-motion-paragraph]",
|
|
2191
2191
|
"[data-paragraph]",
|
|
@@ -2196,7 +2196,7 @@ const T = {
|
|
|
2196
2196
|
]
|
|
2197
2197
|
},
|
|
2198
2198
|
{
|
|
2199
|
-
flag:
|
|
2199
|
+
flag: k.Emoji,
|
|
2200
2200
|
hints: [
|
|
2201
2201
|
":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
|
|
2202
2202
|
"[data-motion-emoji]",
|
|
@@ -2205,27 +2205,27 @@ const T = {
|
|
|
2205
2205
|
"[data-emoji]"
|
|
2206
2206
|
]
|
|
2207
2207
|
}
|
|
2208
|
-
], He =
|
|
2209
|
-
function
|
|
2208
|
+
], He = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, io = k.Letter | k.Word | k.Line | k.Paragraph, bt = /* @__PURE__ */ new Map(), ao = 16384;
|
|
2209
|
+
function Ps(t, e) {
|
|
2210
2210
|
if (!t || t.length > ao)
|
|
2211
2211
|
return t;
|
|
2212
|
-
const n = To(e), r =
|
|
2213
|
-
if (o ===
|
|
2212
|
+
const n = To(e), r = ce(n, k.Emoji), o = n & io;
|
|
2213
|
+
if (o === k.None && !r)
|
|
2214
2214
|
return t;
|
|
2215
2215
|
const s = t.replace(/\r\n/g, `
|
|
2216
2216
|
`).replace(/\r/g, `
|
|
2217
2217
|
`);
|
|
2218
|
-
if (o ===
|
|
2219
|
-
return
|
|
2218
|
+
if (o === k.None)
|
|
2219
|
+
return vt(s);
|
|
2220
2220
|
const i = Ro(s);
|
|
2221
2221
|
if (i.length === 0)
|
|
2222
|
-
return r ?
|
|
2223
|
-
const a = Ao(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 },
|
|
2222
|
+
return r ? vt(s) : t;
|
|
2223
|
+
const a = Ao(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
|
|
2224
2224
|
for (const h of a) {
|
|
2225
2225
|
const p = co(h, n, l);
|
|
2226
|
-
|
|
2226
|
+
d.push(...p);
|
|
2227
2227
|
}
|
|
2228
|
-
return
|
|
2228
|
+
return d;
|
|
2229
2229
|
}
|
|
2230
2230
|
function co(t, e, n) {
|
|
2231
2231
|
const r = [];
|
|
@@ -2233,7 +2233,7 @@ function co(t, e, n) {
|
|
|
2233
2233
|
const s = lo(o, e, n);
|
|
2234
2234
|
r.push(...s);
|
|
2235
2235
|
}
|
|
2236
|
-
if (
|
|
2236
|
+
if (ce(e, k.Paragraph)) {
|
|
2237
2237
|
const o = n.paragraph++;
|
|
2238
2238
|
return [
|
|
2239
2239
|
/* @__PURE__ */ S.jsx(
|
|
@@ -2251,7 +2251,7 @@ function co(t, e, n) {
|
|
|
2251
2251
|
}
|
|
2252
2252
|
function lo(t, e, n) {
|
|
2253
2253
|
const r = uo(t.text, e, n), o = [];
|
|
2254
|
-
if (
|
|
2254
|
+
if (ce(e, k.Line)) {
|
|
2255
2255
|
const s = n.line++;
|
|
2256
2256
|
o.push(
|
|
2257
2257
|
/* @__PURE__ */ S.jsx("span", { "data-motion-line": !0, style: xe(s), children: r }, `motion-line-${s}`)
|
|
@@ -2265,22 +2265,22 @@ function lo(t, e, n) {
|
|
|
2265
2265
|
function uo(t, e, n) {
|
|
2266
2266
|
if (!t)
|
|
2267
2267
|
return [];
|
|
2268
|
-
const r =
|
|
2268
|
+
const r = ce(e, k.Word), o = [], s = /(\s+)/g;
|
|
2269
2269
|
let i = 0, a;
|
|
2270
2270
|
for (; (a = s.exec(t)) !== null; ) {
|
|
2271
2271
|
if (a.index > i) {
|
|
2272
2272
|
const l = t.slice(i, a.index);
|
|
2273
|
-
o.push(
|
|
2273
|
+
o.push(wt(l, n, e, r));
|
|
2274
2274
|
}
|
|
2275
2275
|
o.push(a[0]), i = a.index + a[0].length;
|
|
2276
2276
|
}
|
|
2277
2277
|
if (i < t.length) {
|
|
2278
2278
|
const l = t.slice(i);
|
|
2279
|
-
o.push(
|
|
2279
|
+
o.push(wt(l, n, e, r));
|
|
2280
2280
|
}
|
|
2281
2281
|
return o;
|
|
2282
2282
|
}
|
|
2283
|
-
function
|
|
2283
|
+
function wt(t, e, n, r) {
|
|
2284
2284
|
const o = e.word++, s = ho(t, n, e), i = `motion-word-${o}`, a = fo(o, r);
|
|
2285
2285
|
return r ? /* @__PURE__ */ S.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ S.jsx("span", { style: a, children: s }, i);
|
|
2286
2286
|
}
|
|
@@ -2290,29 +2290,29 @@ function fo(t, e) {
|
|
|
2290
2290
|
function ho(t, e, n) {
|
|
2291
2291
|
if (!t)
|
|
2292
2292
|
return [];
|
|
2293
|
-
const r =
|
|
2293
|
+
const r = ce(e, k.Letter), o = ce(e, k.Emoji);
|
|
2294
2294
|
if (!r) {
|
|
2295
2295
|
if (!o)
|
|
2296
2296
|
return [t];
|
|
2297
2297
|
const a = qe(t);
|
|
2298
2298
|
if (a.length === 0)
|
|
2299
2299
|
return [t];
|
|
2300
|
-
const { nodes: l } =
|
|
2300
|
+
const { nodes: l } = $t(a, n);
|
|
2301
2301
|
return l;
|
|
2302
2302
|
}
|
|
2303
2303
|
const s = [], i = qe(t);
|
|
2304
2304
|
for (const a of i) {
|
|
2305
|
-
const l = n.letter++,
|
|
2305
|
+
const l = n.letter++, d = `motion-letter-${l}`, h = xe(l);
|
|
2306
2306
|
if (a === `
|
|
2307
2307
|
`) {
|
|
2308
2308
|
s.push(
|
|
2309
|
-
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: h, children: /* @__PURE__ */ S.jsx("br", {}) },
|
|
2309
|
+
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: h, children: /* @__PURE__ */ S.jsx("br", {}) }, d)
|
|
2310
2310
|
);
|
|
2311
2311
|
continue;
|
|
2312
2312
|
}
|
|
2313
|
-
const
|
|
2313
|
+
const m = o && Dt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
|
|
2314
2314
|
s.push(
|
|
2315
|
-
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: h, ...
|
|
2315
|
+
/* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: h, ...m, children: c }, d)
|
|
2316
2316
|
);
|
|
2317
2317
|
}
|
|
2318
2318
|
return s;
|
|
@@ -2323,9 +2323,9 @@ function qe(t) {
|
|
|
2323
2323
|
const e = po();
|
|
2324
2324
|
return e ? Array.from(e.segment(t), (n) => n.segment) : mo(t);
|
|
2325
2325
|
}
|
|
2326
|
-
let
|
|
2326
|
+
let me;
|
|
2327
2327
|
function po() {
|
|
2328
|
-
return
|
|
2328
|
+
return me !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? me = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : me = null), me;
|
|
2329
2329
|
}
|
|
2330
2330
|
function mo(t) {
|
|
2331
2331
|
const e = [], n = Array.from(t);
|
|
@@ -2337,9 +2337,9 @@ function mo(t) {
|
|
|
2337
2337
|
return r && e.push(r), e;
|
|
2338
2338
|
}
|
|
2339
2339
|
function go(t, e) {
|
|
2340
|
-
return e ? !!(
|
|
2340
|
+
return e ? !!(St(t) || St(e) || wo(e) || yo(e) || bo(e) || Et(t) && Et(e)) : !1;
|
|
2341
2341
|
}
|
|
2342
|
-
function
|
|
2342
|
+
function St(t) {
|
|
2343
2343
|
return t.codePointAt(0) === 8205;
|
|
2344
2344
|
}
|
|
2345
2345
|
function yo(t) {
|
|
@@ -2350,7 +2350,7 @@ function bo(t) {
|
|
|
2350
2350
|
const e = t.codePointAt(0);
|
|
2351
2351
|
return e === void 0 ? !1 : e >= 127995 && e <= 127999;
|
|
2352
2352
|
}
|
|
2353
|
-
function
|
|
2353
|
+
function Et(t) {
|
|
2354
2354
|
const e = t.codePointAt(0);
|
|
2355
2355
|
return e === void 0 ? !1 : e >= 127462 && e <= 127487;
|
|
2356
2356
|
}
|
|
@@ -2370,7 +2370,7 @@ function So() {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
2372
|
let Be;
|
|
2373
|
-
function
|
|
2373
|
+
function Dt(t) {
|
|
2374
2374
|
return t ? (Be || (Be = Eo()), Be(t)) : !1;
|
|
2375
2375
|
}
|
|
2376
2376
|
function Eo() {
|
|
@@ -2414,7 +2414,7 @@ function Ao(t) {
|
|
|
2414
2414
|
n.push(r), r.breaks >= 2 && (e.push(n), n = []);
|
|
2415
2415
|
return n.length > 0 && e.push(n), e;
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2417
|
+
function ce(t, e) {
|
|
2418
2418
|
return (t & e) === e;
|
|
2419
2419
|
}
|
|
2420
2420
|
function xe(t) {
|
|
@@ -2434,27 +2434,27 @@ function xe(t) {
|
|
|
2434
2434
|
WebkitTextFillColor: "inherit"
|
|
2435
2435
|
};
|
|
2436
2436
|
}
|
|
2437
|
-
function
|
|
2437
|
+
function vt(t) {
|
|
2438
2438
|
if (!t)
|
|
2439
2439
|
return t;
|
|
2440
2440
|
const e = qe(t);
|
|
2441
2441
|
if (e.length === 0)
|
|
2442
2442
|
return t;
|
|
2443
|
-
const { nodes: n, sawEmoji: r } =
|
|
2443
|
+
const { nodes: n, sawEmoji: r } = $t(e);
|
|
2444
2444
|
return r ? n.length === 1 ? n[0] ?? t : n : t;
|
|
2445
2445
|
}
|
|
2446
|
-
function
|
|
2446
|
+
function $t(t, e) {
|
|
2447
2447
|
const n = [];
|
|
2448
2448
|
let r = "", o = !1, s = e?.emoji ?? 0;
|
|
2449
2449
|
const i = () => {
|
|
2450
2450
|
r && (n.push(r), r = "");
|
|
2451
2451
|
};
|
|
2452
2452
|
for (const a of t) {
|
|
2453
|
-
if (
|
|
2453
|
+
if (Dt(a)) {
|
|
2454
2454
|
o = !0, i();
|
|
2455
|
-
const
|
|
2455
|
+
const d = `motion-emoji-${e ? e.emoji++ : s++}`;
|
|
2456
2456
|
n.push(
|
|
2457
|
-
/* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: a },
|
|
2457
|
+
/* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: a }, d)
|
|
2458
2458
|
);
|
|
2459
2459
|
continue;
|
|
2460
2460
|
}
|
|
@@ -2464,53 +2464,53 @@ function Bt(t, e) {
|
|
|
2464
2464
|
}
|
|
2465
2465
|
function To(t) {
|
|
2466
2466
|
if (!t)
|
|
2467
|
-
return
|
|
2467
|
+
return k.None;
|
|
2468
2468
|
const e = t.trim();
|
|
2469
2469
|
if (!e)
|
|
2470
|
-
return
|
|
2471
|
-
const n =
|
|
2470
|
+
return k.None;
|
|
2471
|
+
const n = bt.get(e);
|
|
2472
2472
|
if (typeof n == "number")
|
|
2473
2473
|
return n;
|
|
2474
2474
|
if (typeof document > "u")
|
|
2475
|
-
return
|
|
2475
|
+
return k.None;
|
|
2476
2476
|
const r = e.split(/\s+/).filter(Boolean);
|
|
2477
2477
|
if (r.length === 0)
|
|
2478
|
-
return
|
|
2478
|
+
return k.None;
|
|
2479
2479
|
const s = r.map((l) => `.${ko(l)}`).map(
|
|
2480
2480
|
(l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Co(l)}(?![a-zA-Z0-9_-])`)
|
|
2481
2481
|
);
|
|
2482
|
-
let i =
|
|
2482
|
+
let i = k.None, a = !1;
|
|
2483
2483
|
for (const l of Array.from(document.styleSheets)) {
|
|
2484
|
-
let
|
|
2484
|
+
let d;
|
|
2485
2485
|
try {
|
|
2486
|
-
|
|
2486
|
+
d = l.cssRules;
|
|
2487
2487
|
} catch {
|
|
2488
2488
|
continue;
|
|
2489
2489
|
}
|
|
2490
|
-
const h =
|
|
2490
|
+
const h = Bt(d, s);
|
|
2491
2491
|
if (h.mask && (i |= h.mask, i === He))
|
|
2492
2492
|
break;
|
|
2493
2493
|
a ||= h.sawStyleRule;
|
|
2494
2494
|
}
|
|
2495
|
-
return (i !==
|
|
2495
|
+
return (i !== k.None || a) && bt.set(e, i), i;
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function Bt(t, e) {
|
|
2498
2498
|
if (!t)
|
|
2499
|
-
return { mask:
|
|
2500
|
-
let n =
|
|
2499
|
+
return { mask: k.None, sawStyleRule: !1 };
|
|
2500
|
+
let n = k.None, r = !1;
|
|
2501
2501
|
for (let o = 0; o < t.length; o++) {
|
|
2502
2502
|
const s = t[o];
|
|
2503
2503
|
if (s) {
|
|
2504
2504
|
if (s.type === CSSRule.STYLE_RULE) {
|
|
2505
2505
|
const a = s.selectorText ?? "";
|
|
2506
|
-
if (!a || !e.some((
|
|
2506
|
+
if (!a || !e.some((d) => d.test(a))) continue;
|
|
2507
2507
|
r = !0;
|
|
2508
|
-
for (const
|
|
2509
|
-
|
|
2508
|
+
for (const d of so)
|
|
2509
|
+
d.hints.some((h) => a.includes(h)) && (n |= d.flag);
|
|
2510
2510
|
if (n === He)
|
|
2511
2511
|
return { mask: n, sawStyleRule: !0 };
|
|
2512
2512
|
} else if ("cssRules" in s) {
|
|
2513
|
-
const i =
|
|
2513
|
+
const i = Bt(s.cssRules, e);
|
|
2514
2514
|
if (i.mask && (n |= i.mask, n === He))
|
|
2515
2515
|
return { mask: n, sawStyleRule: !0 };
|
|
2516
2516
|
r ||= i.sawStyleRule;
|
|
@@ -2525,7 +2525,7 @@ function ko(t) {
|
|
|
2525
2525
|
function Co(t) {
|
|
2526
2526
|
return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2527
2527
|
}
|
|
2528
|
-
const
|
|
2528
|
+
const tt = "ikon_auth_session", _o = 10080 * 60 * 1e3, Io = 60 * 1e3;
|
|
2529
2529
|
function Oo(t) {
|
|
2530
2530
|
try {
|
|
2531
2531
|
const e = t.split(".");
|
|
@@ -2536,16 +2536,16 @@ function Oo(t) {
|
|
|
2536
2536
|
return !0;
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function be(t) {
|
|
2540
2540
|
try {
|
|
2541
|
-
localStorage.setItem(
|
|
2541
|
+
localStorage.setItem(tt, JSON.stringify(t));
|
|
2542
2542
|
} catch {
|
|
2543
2543
|
console.warn("Failed to save auth session to localStorage");
|
|
2544
2544
|
}
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function Ft() {
|
|
2547
2547
|
try {
|
|
2548
|
-
const t = localStorage.getItem(
|
|
2548
|
+
const t = localStorage.getItem(tt);
|
|
2549
2549
|
if (!t) return null;
|
|
2550
2550
|
const e = JSON.parse(t);
|
|
2551
2551
|
return Date.now() - e.authenticatedAt > _o || Oo(e.token) ? (Oe(), null) : e;
|
|
@@ -2555,7 +2555,7 @@ function Vt() {
|
|
|
2555
2555
|
}
|
|
2556
2556
|
function Oe() {
|
|
2557
2557
|
try {
|
|
2558
|
-
localStorage.removeItem(
|
|
2558
|
+
localStorage.removeItem(tt);
|
|
2559
2559
|
} catch {
|
|
2560
2560
|
console.warn("Failed to clear auth session from localStorage");
|
|
2561
2561
|
}
|
|
@@ -2568,49 +2568,49 @@ function se(t) {
|
|
|
2568
2568
|
authenticatedAt: t.authenticatedAt
|
|
2569
2569
|
};
|
|
2570
2570
|
}
|
|
2571
|
-
const
|
|
2572
|
-
async function
|
|
2571
|
+
const Vt = 15e3, ge = ne("AuthService");
|
|
2572
|
+
async function Rt(t) {
|
|
2573
2573
|
try {
|
|
2574
2574
|
return await fetch(t, { method: "GET", mode: "no-cors" }), "no-cors probe SUCCEEDED → origin is reachable; the failure is most likely CORS (missing/!allowed Access-Control headers)";
|
|
2575
2575
|
} catch (e) {
|
|
2576
2576
|
return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
|
|
2577
2577
|
}
|
|
2578
2578
|
}
|
|
2579
|
-
async function
|
|
2579
|
+
async function Wt(t, e) {
|
|
2580
2580
|
const n = un(), r = {
|
|
2581
2581
|
method: "POST",
|
|
2582
2582
|
headers: { "Content-Type": "application/json" },
|
|
2583
2583
|
body: JSON.stringify({ deviceId: n, space: t })
|
|
2584
2584
|
}, o = typeof window < "u" ? window.location.origin : "?", s = `${e}/anonymous`;
|
|
2585
|
-
|
|
2585
|
+
ge.info(`Anonymous auth: POST ${s} (space=${t}, origin=${o})`);
|
|
2586
2586
|
let i;
|
|
2587
2587
|
try {
|
|
2588
2588
|
i = await fetch(s, r);
|
|
2589
|
-
} catch (
|
|
2590
|
-
const h =
|
|
2591
|
-
if (
|
|
2592
|
-
|
|
2589
|
+
} catch (d) {
|
|
2590
|
+
const h = d instanceof Error ? `${d.name}: ${d.message}` : String(d), p = dn(), m = p ? `${p}/anonymous` : null;
|
|
2591
|
+
if (m && m !== s) {
|
|
2592
|
+
ge.warn(`Anonymous auth could not reach ${s} (${h}); falling back to same-origin ${m}`);
|
|
2593
2593
|
try {
|
|
2594
|
-
i = await fetch(
|
|
2594
|
+
i = await fetch(m, r);
|
|
2595
2595
|
} catch (c) {
|
|
2596
|
-
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c),
|
|
2597
|
-
throw
|
|
2596
|
+
const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), y = await Rt(e);
|
|
2597
|
+
throw ge.error(`Anonymous auth failed on both direct (${s}: ${h}) and same-origin (${m}: ${u}). ${y}`), new Error(`Anonymous auth unreachable: direct ${s} (${h}) and same-origin ${m} (${u})`);
|
|
2598
2598
|
}
|
|
2599
2599
|
} else {
|
|
2600
|
-
const c = await
|
|
2601
|
-
throw
|
|
2600
|
+
const c = await Rt(e);
|
|
2601
|
+
throw ge.error(`Anonymous auth fetch threw for ${s} — ${h}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${h}). ${c}`);
|
|
2602
2602
|
}
|
|
2603
2603
|
}
|
|
2604
2604
|
if (!i.ok) {
|
|
2605
|
-
const
|
|
2606
|
-
throw
|
|
2605
|
+
const d = await i.text().catch(() => "Unknown error");
|
|
2606
|
+
throw ge.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${d}`), new Error(`Anonymous auth failed: ${i.status} ${d}`);
|
|
2607
2607
|
}
|
|
2608
2608
|
const { token: a } = await i.json(), l = {
|
|
2609
2609
|
token: a,
|
|
2610
2610
|
provider: "anonymous",
|
|
2611
2611
|
authenticatedAt: Date.now()
|
|
2612
2612
|
};
|
|
2613
|
-
return
|
|
2613
|
+
return be(l), l;
|
|
2614
2614
|
}
|
|
2615
2615
|
async function No({ email: t, spaceId: e, authUrl: n }) {
|
|
2616
2616
|
const r = await fetch(`${n}/email/send`, {
|
|
@@ -2620,7 +2620,7 @@ async function No({ email: t, spaceId: e, authUrl: n }) {
|
|
|
2620
2620
|
email: t.trim(),
|
|
2621
2621
|
space: e
|
|
2622
2622
|
}),
|
|
2623
|
-
signal:
|
|
2623
|
+
signal: _t(Vt)
|
|
2624
2624
|
});
|
|
2625
2625
|
if (!r.ok) {
|
|
2626
2626
|
const o = await r.text().catch(() => "Failed to send login code");
|
|
@@ -2635,7 +2635,7 @@ async function xo({ email: t, code: e, authUrl: n }) {
|
|
|
2635
2635
|
email: t.trim(),
|
|
2636
2636
|
code: e.trim()
|
|
2637
2637
|
}),
|
|
2638
|
-
signal:
|
|
2638
|
+
signal: _t(Vt)
|
|
2639
2639
|
});
|
|
2640
2640
|
if (!r.ok) {
|
|
2641
2641
|
const i = await r.text().catch(() => "Invalid code");
|
|
@@ -2646,7 +2646,7 @@ async function xo({ email: t, code: e, authUrl: n }) {
|
|
|
2646
2646
|
provider: "email",
|
|
2647
2647
|
authenticatedAt: Date.now()
|
|
2648
2648
|
};
|
|
2649
|
-
return
|
|
2649
|
+
return be(s), s;
|
|
2650
2650
|
}
|
|
2651
2651
|
function Po() {
|
|
2652
2652
|
const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
|
|
@@ -2655,7 +2655,7 @@ function Po() {
|
|
|
2655
2655
|
function Lo() {
|
|
2656
2656
|
return new URLSearchParams(window.location.search).get("error");
|
|
2657
2657
|
}
|
|
2658
|
-
function
|
|
2658
|
+
function At() {
|
|
2659
2659
|
window.history.replaceState({}, "", window.location.pathname);
|
|
2660
2660
|
}
|
|
2661
2661
|
function Mo(t, e, n, r) {
|
|
@@ -2688,7 +2688,7 @@ async function jo(t, e, n) {
|
|
|
2688
2688
|
provider: "passkey",
|
|
2689
2689
|
authenticatedAt: Date.now()
|
|
2690
2690
|
};
|
|
2691
|
-
return
|
|
2691
|
+
return be(s), s;
|
|
2692
2692
|
}
|
|
2693
2693
|
async function Do(t, e) {
|
|
2694
2694
|
const n = await fetch(`${t}/passkey/authentication/options`, {
|
|
@@ -2717,7 +2717,7 @@ async function $o(t, e) {
|
|
|
2717
2717
|
provider: "passkey",
|
|
2718
2718
|
authenticatedAt: Date.now()
|
|
2719
2719
|
};
|
|
2720
|
-
return
|
|
2720
|
+
return be(o), o;
|
|
2721
2721
|
}
|
|
2722
2722
|
function H(t) {
|
|
2723
2723
|
const e = new Uint8Array(t);
|
|
@@ -2732,13 +2732,13 @@ function Ne(t) {
|
|
|
2732
2732
|
i[a] = o.charCodeAt(a);
|
|
2733
2733
|
return s;
|
|
2734
2734
|
}
|
|
2735
|
-
function
|
|
2735
|
+
function nt() {
|
|
2736
2736
|
return Bo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2737
2737
|
}
|
|
2738
2738
|
const Bo = {
|
|
2739
2739
|
stubThis: (t) => t
|
|
2740
2740
|
};
|
|
2741
|
-
function
|
|
2741
|
+
function Kt(t) {
|
|
2742
2742
|
const { id: e } = t;
|
|
2743
2743
|
return {
|
|
2744
2744
|
...t,
|
|
@@ -2878,15 +2878,15 @@ class Vo {
|
|
|
2878
2878
|
}
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
|
-
const
|
|
2882
|
-
function
|
|
2881
|
+
const Yt = new Vo(), Wo = ["cross-platform", "platform"];
|
|
2882
|
+
function zt(t) {
|
|
2883
2883
|
if (t && !(Wo.indexOf(t) < 0))
|
|
2884
2884
|
return t;
|
|
2885
2885
|
}
|
|
2886
2886
|
async function Ko(t) {
|
|
2887
2887
|
!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 });
|
|
2888
2888
|
const { optionsJSON: e, useAutoRegister: n = !1 } = t;
|
|
2889
|
-
if (!
|
|
2889
|
+
if (!nt())
|
|
2890
2890
|
throw new Error("WebAuthn is not supported in this browser");
|
|
2891
2891
|
const r = {
|
|
2892
2892
|
...e,
|
|
@@ -2895,9 +2895,9 @@ async function Ko(t) {
|
|
|
2895
2895
|
...e.user,
|
|
2896
2896
|
id: Ne(e.user.id)
|
|
2897
2897
|
},
|
|
2898
|
-
excludeCredentials: e.excludeCredentials?.map(
|
|
2898
|
+
excludeCredentials: e.excludeCredentials?.map(Kt)
|
|
2899
2899
|
}, o = {};
|
|
2900
|
-
n && (o.mediation = "conditional"), o.publicKey = r, o.signal =
|
|
2900
|
+
n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Yt.createNewAbortSignal();
|
|
2901
2901
|
let s;
|
|
2902
2902
|
try {
|
|
2903
2903
|
s = await navigator.credentials.create(o);
|
|
@@ -2906,7 +2906,7 @@ async function Ko(t) {
|
|
|
2906
2906
|
}
|
|
2907
2907
|
if (!s)
|
|
2908
2908
|
throw new Error("Registration was not completed");
|
|
2909
|
-
const { id: i, rawId: a, response: l, type:
|
|
2909
|
+
const { id: i, rawId: a, response: l, type: d } = s;
|
|
2910
2910
|
let h;
|
|
2911
2911
|
typeof l.getTransports == "function" && (h = l.getTransports());
|
|
2912
2912
|
let p;
|
|
@@ -2916,11 +2916,11 @@ async function Ko(t) {
|
|
|
2916
2916
|
} catch (u) {
|
|
2917
2917
|
Fe("getPublicKeyAlgorithm()", u);
|
|
2918
2918
|
}
|
|
2919
|
-
let
|
|
2919
|
+
let m;
|
|
2920
2920
|
if (typeof l.getPublicKey == "function")
|
|
2921
2921
|
try {
|
|
2922
2922
|
const u = l.getPublicKey();
|
|
2923
|
-
u !== null && (
|
|
2923
|
+
u !== null && (m = H(u));
|
|
2924
2924
|
} catch (u) {
|
|
2925
2925
|
Fe("getPublicKey()", u);
|
|
2926
2926
|
}
|
|
@@ -2939,20 +2939,20 @@ async function Ko(t) {
|
|
|
2939
2939
|
clientDataJSON: H(l.clientDataJSON),
|
|
2940
2940
|
transports: h,
|
|
2941
2941
|
publicKeyAlgorithm: p,
|
|
2942
|
-
publicKey:
|
|
2942
|
+
publicKey: m,
|
|
2943
2943
|
authenticatorData: c
|
|
2944
2944
|
},
|
|
2945
|
-
type:
|
|
2945
|
+
type: d,
|
|
2946
2946
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2947
|
-
authenticatorAttachment:
|
|
2947
|
+
authenticatorAttachment: zt(s.authenticatorAttachment)
|
|
2948
2948
|
};
|
|
2949
2949
|
}
|
|
2950
2950
|
function Fe(t, e) {
|
|
2951
2951
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
2952
2952
|
`, e);
|
|
2953
2953
|
}
|
|
2954
|
-
function
|
|
2955
|
-
if (!
|
|
2954
|
+
function Go() {
|
|
2955
|
+
if (!nt())
|
|
2956
2956
|
return Ve.stubThis(new Promise((e) => e(!1)));
|
|
2957
2957
|
const t = globalThis.PublicKeyCredential;
|
|
2958
2958
|
return t?.isConditionalMediationAvailable === void 0 ? Ve.stubThis(new Promise((e) => e(!1))) : Ve.stubThis(t.isConditionalMediationAvailable());
|
|
@@ -2960,7 +2960,7 @@ function Yo() {
|
|
|
2960
2960
|
const Ve = {
|
|
2961
2961
|
stubThis: (t) => t
|
|
2962
2962
|
};
|
|
2963
|
-
function
|
|
2963
|
+
function Yo({ error: t, options: e }) {
|
|
2964
2964
|
const { publicKey: n } = e;
|
|
2965
2965
|
if (!n)
|
|
2966
2966
|
throw Error("options was missing required publicKey property");
|
|
@@ -3004,83 +3004,83 @@ function Go({ error: t, options: e }) {
|
|
|
3004
3004
|
async function zo(t) {
|
|
3005
3005
|
!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 });
|
|
3006
3006
|
const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
|
|
3007
|
-
if (!
|
|
3007
|
+
if (!nt())
|
|
3008
3008
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3009
3009
|
let o;
|
|
3010
|
-
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(
|
|
3010
|
+
e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(Kt));
|
|
3011
3011
|
const s = {
|
|
3012
3012
|
...e,
|
|
3013
3013
|
challenge: Ne(e.challenge),
|
|
3014
3014
|
allowCredentials: o
|
|
3015
3015
|
}, i = {};
|
|
3016
3016
|
if (n) {
|
|
3017
|
-
if (!await
|
|
3017
|
+
if (!await Go())
|
|
3018
3018
|
throw Error("Browser does not support WebAuthn autofill");
|
|
3019
3019
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
3020
3020
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
3021
3021
|
i.mediation = "conditional", s.allowCredentials = [];
|
|
3022
3022
|
}
|
|
3023
|
-
i.publicKey = s, i.signal =
|
|
3023
|
+
i.publicKey = s, i.signal = Yt.createNewAbortSignal();
|
|
3024
3024
|
let a;
|
|
3025
3025
|
try {
|
|
3026
3026
|
a = await navigator.credentials.get(i);
|
|
3027
3027
|
} catch (c) {
|
|
3028
|
-
throw
|
|
3028
|
+
throw Yo({ error: c, options: i });
|
|
3029
3029
|
}
|
|
3030
3030
|
if (!a)
|
|
3031
3031
|
throw new Error("Authentication was not completed");
|
|
3032
|
-
const { id: l, rawId:
|
|
3033
|
-
let
|
|
3034
|
-
return h.userHandle && (
|
|
3032
|
+
const { id: l, rawId: d, response: h, type: p } = a;
|
|
3033
|
+
let m;
|
|
3034
|
+
return h.userHandle && (m = H(h.userHandle)), {
|
|
3035
3035
|
id: l,
|
|
3036
|
-
rawId: H(
|
|
3036
|
+
rawId: H(d),
|
|
3037
3037
|
response: {
|
|
3038
3038
|
authenticatorData: H(h.authenticatorData),
|
|
3039
3039
|
clientDataJSON: H(h.clientDataJSON),
|
|
3040
3040
|
signature: H(h.signature),
|
|
3041
|
-
userHandle:
|
|
3041
|
+
userHandle: m
|
|
3042
3042
|
},
|
|
3043
3043
|
type: p,
|
|
3044
3044
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
3045
|
-
authenticatorAttachment:
|
|
3045
|
+
authenticatorAttachment: zt(a.authenticatorAttachment)
|
|
3046
3046
|
};
|
|
3047
3047
|
}
|
|
3048
|
-
const
|
|
3049
|
-
function
|
|
3050
|
-
const [n, r] =
|
|
3048
|
+
const rt = Ct(null);
|
|
3049
|
+
function Ls({ children: t, config: e }) {
|
|
3050
|
+
const [n, r] = N({
|
|
3051
3051
|
isAuthenticated: !1,
|
|
3052
3052
|
isLoading: !0,
|
|
3053
3053
|
user: null,
|
|
3054
3054
|
error: null
|
|
3055
3055
|
});
|
|
3056
|
-
|
|
3056
|
+
_(() => {
|
|
3057
3057
|
(() => {
|
|
3058
|
-
const
|
|
3059
|
-
if (
|
|
3060
|
-
|
|
3058
|
+
const m = Lo();
|
|
3059
|
+
if (m) {
|
|
3060
|
+
At(), r({
|
|
3061
3061
|
isAuthenticated: !1,
|
|
3062
3062
|
isLoading: !1,
|
|
3063
3063
|
user: null,
|
|
3064
|
-
error:
|
|
3064
|
+
error: m
|
|
3065
3065
|
});
|
|
3066
3066
|
return;
|
|
3067
3067
|
}
|
|
3068
3068
|
const c = Po();
|
|
3069
3069
|
if (c) {
|
|
3070
|
-
const
|
|
3070
|
+
const y = {
|
|
3071
3071
|
token: c.token,
|
|
3072
3072
|
provider: c.provider,
|
|
3073
3073
|
authenticatedAt: Date.now()
|
|
3074
3074
|
};
|
|
3075
|
-
|
|
3075
|
+
be(y), At(), r({
|
|
3076
3076
|
isAuthenticated: !0,
|
|
3077
3077
|
isLoading: !1,
|
|
3078
|
-
user: se(
|
|
3078
|
+
user: se(y),
|
|
3079
3079
|
error: null
|
|
3080
3080
|
});
|
|
3081
3081
|
return;
|
|
3082
3082
|
}
|
|
3083
|
-
const u =
|
|
3083
|
+
const u = Ft();
|
|
3084
3084
|
if (u) {
|
|
3085
3085
|
r({
|
|
3086
3086
|
isAuthenticated: !0,
|
|
@@ -3107,11 +3107,11 @@ function xs({ children: t, config: e }) {
|
|
|
3107
3107
|
}));
|
|
3108
3108
|
return;
|
|
3109
3109
|
}
|
|
3110
|
-
const
|
|
3110
|
+
const m = await ye(e.authUrl);
|
|
3111
3111
|
if (p === "guest") {
|
|
3112
3112
|
r((c) => ({ ...c, isLoading: !0 }));
|
|
3113
3113
|
try {
|
|
3114
|
-
const c = await
|
|
3114
|
+
const c = await Wt(e.spaceId, m);
|
|
3115
3115
|
r({
|
|
3116
3116
|
isAuthenticated: !0,
|
|
3117
3117
|
isLoading: !1,
|
|
@@ -3130,11 +3130,11 @@ function xs({ children: t, config: e }) {
|
|
|
3130
3130
|
if (p === "passkey") {
|
|
3131
3131
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3132
3132
|
try {
|
|
3133
|
-
const c = await Do(
|
|
3133
|
+
const c = await Do(m), u = await zo({ optionsJSON: c }), y = await $o(m, u);
|
|
3134
3134
|
r({
|
|
3135
3135
|
isAuthenticated: !0,
|
|
3136
3136
|
isLoading: !1,
|
|
3137
|
-
user: se(
|
|
3137
|
+
user: se(y),
|
|
3138
3138
|
error: null
|
|
3139
3139
|
});
|
|
3140
3140
|
} catch (c) {
|
|
@@ -3148,22 +3148,22 @@ function xs({ children: t, config: e }) {
|
|
|
3148
3148
|
}
|
|
3149
3149
|
if (p === "email")
|
|
3150
3150
|
throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3151
|
-
window.location.href = Mo(p, e.spaceId,
|
|
3151
|
+
window.location.href = Mo(p, e.spaceId, m);
|
|
3152
3152
|
},
|
|
3153
3153
|
[e.authUrl, e.spaceId]
|
|
3154
3154
|
), s = D(
|
|
3155
3155
|
async (p) => {
|
|
3156
3156
|
if (!e.spaceId)
|
|
3157
3157
|
throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
|
|
3158
|
-
const
|
|
3159
|
-
await No({ email: p, spaceId: e.spaceId, authUrl:
|
|
3158
|
+
const m = await ye(e.authUrl);
|
|
3159
|
+
await No({ email: p, spaceId: e.spaceId, authUrl: m });
|
|
3160
3160
|
},
|
|
3161
3161
|
[e.authUrl, e.spaceId]
|
|
3162
3162
|
), i = D(
|
|
3163
|
-
async (p,
|
|
3163
|
+
async (p, m) => {
|
|
3164
3164
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3165
3165
|
try {
|
|
3166
|
-
const c = await
|
|
3166
|
+
const c = await ye(e.authUrl), u = await xo({ email: p, code: m, authUrl: c });
|
|
3167
3167
|
r({
|
|
3168
3168
|
isAuthenticated: !0,
|
|
3169
3169
|
isLoading: !1,
|
|
@@ -3172,7 +3172,7 @@ function xs({ children: t, config: e }) {
|
|
|
3172
3172
|
});
|
|
3173
3173
|
} catch (c) {
|
|
3174
3174
|
const u = c instanceof Error ? c.message : "Code verification failed";
|
|
3175
|
-
throw r((
|
|
3175
|
+
throw r((y) => ({ ...y, isLoading: !1, error: u })), c;
|
|
3176
3176
|
}
|
|
3177
3177
|
},
|
|
3178
3178
|
[e.authUrl]
|
|
@@ -3185,14 +3185,14 @@ function xs({ children: t, config: e }) {
|
|
|
3185
3185
|
});
|
|
3186
3186
|
}, []), l = D(
|
|
3187
3187
|
async (p) => {
|
|
3188
|
-
const
|
|
3188
|
+
const m = await ye(e.authUrl);
|
|
3189
3189
|
r((c) => ({ ...c, isLoading: !0, error: null }));
|
|
3190
3190
|
try {
|
|
3191
|
-
const c = await Uo(
|
|
3191
|
+
const c = await Uo(m), u = await Ko({ optionsJSON: c }), y = await jo(m, u, p);
|
|
3192
3192
|
r({
|
|
3193
3193
|
isAuthenticated: !0,
|
|
3194
3194
|
isLoading: !1,
|
|
3195
|
-
user: se(
|
|
3195
|
+
user: se(y),
|
|
3196
3196
|
error: null
|
|
3197
3197
|
});
|
|
3198
3198
|
} catch (c) {
|
|
@@ -3204,39 +3204,39 @@ function xs({ children: t, config: e }) {
|
|
|
3204
3204
|
}
|
|
3205
3205
|
},
|
|
3206
3206
|
[e.authUrl]
|
|
3207
|
-
),
|
|
3207
|
+
), d = D(() => n.user?.token ?? null, [n.user]), h = W(
|
|
3208
3208
|
() => ({
|
|
3209
3209
|
state: n,
|
|
3210
3210
|
login: o,
|
|
3211
3211
|
logout: a,
|
|
3212
|
-
getToken:
|
|
3212
|
+
getToken: d,
|
|
3213
3213
|
registerPasskey: l,
|
|
3214
3214
|
requestEmailCode: s,
|
|
3215
3215
|
submitEmailCode: i
|
|
3216
3216
|
}),
|
|
3217
|
-
[n, o, a,
|
|
3217
|
+
[n, o, a, d, l, s, i]
|
|
3218
3218
|
);
|
|
3219
|
-
return /* @__PURE__ */ S.jsx(
|
|
3219
|
+
return /* @__PURE__ */ S.jsx(rt, { value: h, children: t });
|
|
3220
3220
|
}
|
|
3221
3221
|
function Xo() {
|
|
3222
|
-
const t =
|
|
3222
|
+
const t = Ze(rt);
|
|
3223
3223
|
if (!t)
|
|
3224
3224
|
throw new Error("useAuth must be used within an AuthProvider");
|
|
3225
3225
|
return t;
|
|
3226
3226
|
}
|
|
3227
3227
|
function Ho() {
|
|
3228
|
-
return
|
|
3228
|
+
return Ze(rt);
|
|
3229
3229
|
}
|
|
3230
|
-
function
|
|
3231
|
-
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Xo(), s =
|
|
3232
|
-
return
|
|
3230
|
+
function Ms(t) {
|
|
3231
|
+
const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Xo(), s = A(!1);
|
|
3232
|
+
return _(() => {
|
|
3233
3233
|
if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
|
|
3234
3234
|
return;
|
|
3235
3235
|
const i = new URLSearchParams(window.location.search), a = i.get(n);
|
|
3236
3236
|
if (a === "true" || a === "1" || a === "") {
|
|
3237
3237
|
i.delete(n);
|
|
3238
|
-
const l = i.toString(),
|
|
3239
|
-
window.history.replaceState({}, "",
|
|
3238
|
+
const l = i.toString(), d = window.location.pathname + (l ? `?${l}` : "");
|
|
3239
|
+
window.history.replaceState({}, "", d), s.current = !0, o("guest");
|
|
3240
3240
|
}
|
|
3241
3241
|
}, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
|
|
3242
3242
|
shouldRenderChildren: r.isAuthenticated,
|
|
@@ -3245,17 +3245,17 @@ function Ps(t) {
|
|
|
3245
3245
|
error: r.error
|
|
3246
3246
|
};
|
|
3247
3247
|
}
|
|
3248
|
-
const
|
|
3248
|
+
const Xt = (() => {
|
|
3249
3249
|
try {
|
|
3250
3250
|
return fn();
|
|
3251
3251
|
} catch {
|
|
3252
3252
|
return !1;
|
|
3253
3253
|
}
|
|
3254
3254
|
})(), Ht = Date.now(), te = [], qo = 300;
|
|
3255
|
-
function
|
|
3255
|
+
function Te(t) {
|
|
3256
3256
|
te.push(`[+${((Date.now() - Ht) / 1e3).toFixed(1)}s] ${t}`), te.length > qo && te.shift();
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function Tt(t) {
|
|
3259
3259
|
if (typeof t == "string")
|
|
3260
3260
|
return t;
|
|
3261
3261
|
if (t instanceof Error)
|
|
@@ -3266,29 +3266,29 @@ function kt(t) {
|
|
|
3266
3266
|
return String(t);
|
|
3267
3267
|
}
|
|
3268
3268
|
}
|
|
3269
|
-
let
|
|
3269
|
+
let kt = !1;
|
|
3270
3270
|
function qt() {
|
|
3271
|
-
if (
|
|
3271
|
+
if (kt || typeof window > "u")
|
|
3272
3272
|
return;
|
|
3273
|
-
|
|
3273
|
+
kt = !0, window.addEventListener("error", (e) => Te(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Te(`unhandledRejection: ${Tt(e.reason)}`));
|
|
3274
3274
|
const t = console;
|
|
3275
3275
|
for (const e of ["error", "warn", "log", "info"]) {
|
|
3276
3276
|
const n = t[e]?.bind(console) ?? (() => {
|
|
3277
3277
|
});
|
|
3278
3278
|
t[e] = (...r) => {
|
|
3279
3279
|
try {
|
|
3280
|
-
|
|
3280
|
+
Te(`console.${e}: ${r.map(Tt).join(" ")}`);
|
|
3281
3281
|
} catch {
|
|
3282
3282
|
}
|
|
3283
3283
|
n(...r);
|
|
3284
3284
|
};
|
|
3285
3285
|
}
|
|
3286
3286
|
try {
|
|
3287
|
-
|
|
3287
|
+
It((e) => Te(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: We.DEBUG });
|
|
3288
3288
|
} catch {
|
|
3289
3289
|
}
|
|
3290
3290
|
}
|
|
3291
|
-
|
|
3291
|
+
Xt && qt();
|
|
3292
3292
|
function Jo() {
|
|
3293
3293
|
let t = !1;
|
|
3294
3294
|
try {
|
|
@@ -3320,22 +3320,22 @@ function Zo() {
|
|
|
3320
3320
|
function Qo(t) {
|
|
3321
3321
|
return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
|
|
3322
3322
|
}
|
|
3323
|
-
function Jt({ state: t = "" }) {
|
|
3324
|
-
const e = t === "connected" || t === "reconnecting", [,
|
|
3325
|
-
if (
|
|
3326
|
-
if (!
|
|
3323
|
+
function Jt({ state: t = "", forceVisible: e = !1 }) {
|
|
3324
|
+
const n = Xt || e, r = t === "connected" || t === "reconnecting", [, o] = cn((l) => l + 1, 0), [s, i] = N(!0);
|
|
3325
|
+
if (_(() => {
|
|
3326
|
+
if (!n)
|
|
3327
3327
|
return;
|
|
3328
3328
|
qt();
|
|
3329
|
-
const
|
|
3330
|
-
return () => clearInterval(
|
|
3331
|
-
}, []), !
|
|
3329
|
+
const l = setInterval(o, 1e3);
|
|
3330
|
+
return () => clearInterval(l);
|
|
3331
|
+
}, [n]), !n)
|
|
3332
3332
|
return null;
|
|
3333
|
-
if (
|
|
3333
|
+
if (r && s)
|
|
3334
3334
|
return /* @__PURE__ */ S.jsxs(
|
|
3335
3335
|
"button",
|
|
3336
3336
|
{
|
|
3337
3337
|
type: "button",
|
|
3338
|
-
onClick: () =>
|
|
3338
|
+
onClick: () => i(!1),
|
|
3339
3339
|
style: { position: "fixed", bottom: 8, left: 8, zIndex: 2147483647, background: "#000", color: "#0f0", font: "13px monospace", padding: "6px 10px", border: "1px solid #0f0", borderRadius: 6 },
|
|
3340
3340
|
children: [
|
|
3341
3341
|
"🐞 debug (",
|
|
@@ -3344,8 +3344,8 @@ function Jt({ state: t = "" }) {
|
|
|
3344
3344
|
]
|
|
3345
3345
|
}
|
|
3346
3346
|
);
|
|
3347
|
-
const
|
|
3348
|
-
return /* @__PURE__ */ S.jsxs("div", { style: { ...
|
|
3347
|
+
const a = r ? { position: "fixed", bottom: 0, left: 0, right: 0, maxHeight: "45vh", borderTop: "2px solid #0f0" } : { position: "fixed", inset: 0 };
|
|
3348
|
+
return /* @__PURE__ */ S.jsxs("div", { style: { ...a, background: "rgba(0,0,0,0.92)", color: "#0f0", font: "14px/1.45 monospace", padding: "16px", overflow: "auto", zIndex: 2147483647 }, children: [
|
|
3349
3349
|
/* @__PURE__ */ S.jsxs("div", { style: { color: "#fff", fontSize: "18px", marginBottom: "6px" }, children: [
|
|
3350
3350
|
"Ikon debug overlay — state: ",
|
|
3351
3351
|
t || "?",
|
|
@@ -3354,16 +3354,16 @@ function Jt({ state: t = "" }) {
|
|
|
3354
3354
|
"s, ",
|
|
3355
3355
|
te.length,
|
|
3356
3356
|
" entries",
|
|
3357
|
-
|
|
3357
|
+
r && /* @__PURE__ */ S.jsx("button", { type: "button", onClick: () => i(!0), style: { marginLeft: 12, font: "12px monospace", background: "#0f0", color: "#000", border: "none", borderRadius: 4, padding: "2px 8px" }, children: "hide" })
|
|
3358
3358
|
] }),
|
|
3359
3359
|
/* @__PURE__ */ S.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
|
|
3360
3360
|
/* @__PURE__ */ S.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
|
|
3361
3361
|
/* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: Zo() }),
|
|
3362
3362
|
/* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
|
|
3363
|
-
/* @__PURE__ */ S.jsx("div", { children: te.length === 0 ? "(nothing captured yet)" : te.map((
|
|
3363
|
+
/* @__PURE__ */ S.jsx("div", { children: te.length === 0 ? "(nothing captured yet)" : te.map((l, d) => /* @__PURE__ */ S.jsx("div", { style: { color: Qo(l), wordBreak: "break-all" }, children: l }, d)) })
|
|
3364
3364
|
] });
|
|
3365
3365
|
}
|
|
3366
|
-
function
|
|
3366
|
+
function Us({
|
|
3367
3367
|
connectionState: t,
|
|
3368
3368
|
error: e,
|
|
3369
3369
|
isReady: n,
|
|
@@ -3375,17 +3375,17 @@ function Ls({
|
|
|
3375
3375
|
// renderIdle prop is intentionally accepted but never invoked — the runtime no longer
|
|
3376
3376
|
// emits the deprecated 'idle' state. Kept on the props for source compatibility.
|
|
3377
3377
|
renderIdle: l,
|
|
3378
|
-
renderConnecting:
|
|
3378
|
+
renderConnecting: d,
|
|
3379
3379
|
renderConnectingSlow: h,
|
|
3380
3380
|
renderConnected: p,
|
|
3381
|
-
renderOffline:
|
|
3381
|
+
renderOffline: m,
|
|
3382
3382
|
renderError: c
|
|
3383
3383
|
}) {
|
|
3384
|
-
const u =
|
|
3384
|
+
const u = A(!1), y = (() => {
|
|
3385
3385
|
switch (t) {
|
|
3386
3386
|
case "waitingForExternalConnectUrl":
|
|
3387
3387
|
case "connecting":
|
|
3388
|
-
return r ? h() :
|
|
3388
|
+
return r ? h() : d();
|
|
3389
3389
|
case "connected":
|
|
3390
3390
|
case "reconnecting": {
|
|
3391
3391
|
if (!n || !o || !s) return null;
|
|
@@ -3402,7 +3402,7 @@ function Ls({
|
|
|
3402
3402
|
case "offline": {
|
|
3403
3403
|
u.current = !1;
|
|
3404
3404
|
const g = e ?? i?.lastError?.message ?? null;
|
|
3405
|
-
return g ? c(g) :
|
|
3405
|
+
return g ? c(g) : m();
|
|
3406
3406
|
}
|
|
3407
3407
|
// 'idle' / 'connectingSlow' / 'offlineError' remain in the type union for back-compat
|
|
3408
3408
|
// string-equality checks in caller code but are no longer emitted — no case needed.
|
|
@@ -3411,11 +3411,11 @@ function Ls({
|
|
|
3411
3411
|
}
|
|
3412
3412
|
})();
|
|
3413
3413
|
return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
3414
|
-
|
|
3414
|
+
y,
|
|
3415
3415
|
/* @__PURE__ */ S.jsx(Jt, { state: t })
|
|
3416
3416
|
] });
|
|
3417
3417
|
}
|
|
3418
|
-
const
|
|
3418
|
+
const ke = ne("useIkonApp");
|
|
3419
3419
|
function es() {
|
|
3420
3420
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
|
|
3421
3421
|
return window.__IKON_AUTH_CONFIG__;
|
|
@@ -3424,30 +3424,30 @@ function ts() {
|
|
|
3424
3424
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
|
|
3425
3425
|
return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3426
3426
|
}
|
|
3427
|
-
function
|
|
3428
|
-
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport:
|
|
3429
|
-
|
|
3430
|
-
const [
|
|
3427
|
+
function js(t) {
|
|
3428
|
+
const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: d, proxy: h } = t, p = e === void 0 ? es() ?? null : e, m = ts(), c = Ho(), u = A(null), y = A(null), g = A(null), b = A(!1), w = A(!1), v = A(o), E = A(r), T = A(s), M = A(i), Q = A(a), re = A(l), q = A(d), I = A(h);
|
|
3429
|
+
v.current = o, E.current = r, T.current = s, M.current = i, Q.current = a, re.current = l, q.current = d, I.current = h;
|
|
3430
|
+
const [x, $] = N("connecting"), [V, B] = N(!1), [K, G] = N(null), [we, Se] = N(null), [Ee, ve] = N(!1), [f, R] = N(null), [C, P] = N(null), ee = A(!1), [le, L] = N(0), U = W(() => {
|
|
3431
3431
|
try {
|
|
3432
|
-
const
|
|
3433
|
-
return (
|
|
3432
|
+
const O = hn();
|
|
3433
|
+
return (O.sessionId || O.channelKey) && pn(), O;
|
|
3434
3434
|
} catch {
|
|
3435
3435
|
return { parameters: {} };
|
|
3436
3436
|
}
|
|
3437
|
-
}, []), X = W(() => p?.enabled ?
|
|
3438
|
-
!
|
|
3439
|
-
|
|
3440
|
-
}).catch((
|
|
3441
|
-
|
|
3437
|
+
}, []), X = W(() => p?.enabled ? Ft() : null, [p?.enabled, le]), ue = m?.enabled ?? !1, Pe = m?.host ?? "localhost", Le = m?.port ?? 8443;
|
|
3438
|
+
!ue && ot() && p && !p.enabled && p.spaceId && !C && !ee.current && (ee.current = !0, ye(p.authUrl).then((O) => Wt(p.spaceId, O)).then((O) => {
|
|
3439
|
+
P(O.token);
|
|
3440
|
+
}).catch((O) => {
|
|
3441
|
+
ke.error("Anonymous auth failed:", O), G(O instanceof Error ? O.message : "Anonymous auth failed"), ee.current = !1;
|
|
3442
3442
|
}));
|
|
3443
3443
|
const Me = W(() => {
|
|
3444
|
-
if (
|
|
3445
|
-
const
|
|
3444
|
+
if (ue) {
|
|
3445
|
+
const O = X?.token ? mn(X.token) ?? void 0 : void 0;
|
|
3446
3446
|
return {
|
|
3447
3447
|
local: {
|
|
3448
3448
|
host: Pe,
|
|
3449
3449
|
httpsPort: Le,
|
|
3450
|
-
userId:
|
|
3450
|
+
userId: O,
|
|
3451
3451
|
token: X?.token ?? void 0,
|
|
3452
3452
|
spaceId: p?.spaceId,
|
|
3453
3453
|
backendUrl: p?.backendUrl,
|
|
@@ -3460,21 +3460,21 @@ function Ms(t) {
|
|
|
3460
3460
|
sessionToken: {
|
|
3461
3461
|
token: X.token,
|
|
3462
3462
|
spaceId: p.spaceId,
|
|
3463
|
-
backendType:
|
|
3463
|
+
backendType: st(),
|
|
3464
3464
|
sessionId: U.sessionId,
|
|
3465
3465
|
channelKey: U.channelKey,
|
|
3466
3466
|
parameters: U.parameters
|
|
3467
3467
|
}
|
|
3468
|
-
} :
|
|
3468
|
+
} : C && p?.spaceId ? {
|
|
3469
3469
|
sessionToken: {
|
|
3470
|
-
token:
|
|
3470
|
+
token: C,
|
|
3471
3471
|
spaceId: p.spaceId,
|
|
3472
|
-
backendType:
|
|
3472
|
+
backendType: st(),
|
|
3473
3473
|
sessionId: U.sessionId,
|
|
3474
3474
|
channelKey: U.channelKey,
|
|
3475
3475
|
parameters: U.parameters
|
|
3476
3476
|
}
|
|
3477
|
-
} :
|
|
3477
|
+
} : ot() ? null : {
|
|
3478
3478
|
local: {
|
|
3479
3479
|
host: Pe,
|
|
3480
3480
|
httpsPort: Le,
|
|
@@ -3484,89 +3484,90 @@ function Ms(t) {
|
|
|
3484
3484
|
parameters: U.parameters
|
|
3485
3485
|
}
|
|
3486
3486
|
};
|
|
3487
|
-
}, [
|
|
3488
|
-
Dr(
|
|
3489
|
-
const Qt = Br(
|
|
3490
|
-
|
|
3487
|
+
}, [ue, Pe, Le, X?.token, p?.spaceId, p?.backendUrl, p?.authUrl, C, U.sessionId, U.channelKey, U.parameters]);
|
|
3488
|
+
Dr(f);
|
|
3489
|
+
const Qt = Br(f);
|
|
3490
|
+
_(() => {
|
|
3491
3491
|
if (!b.current) {
|
|
3492
3492
|
if (b.current = !0, g.current = Or(), n)
|
|
3493
|
-
for (const
|
|
3494
|
-
|
|
3495
|
-
g.current.loadRegisteredModules().catch((
|
|
3496
|
-
|
|
3493
|
+
for (const O of n)
|
|
3494
|
+
O(g.current);
|
|
3495
|
+
g.current.loadRegisteredModules().catch((O) => {
|
|
3496
|
+
ke.error("Failed to load UI modules", O);
|
|
3497
3497
|
});
|
|
3498
3498
|
}
|
|
3499
|
-
}, []),
|
|
3499
|
+
}, []), _(() => {
|
|
3500
3500
|
if (!Me) return;
|
|
3501
|
-
const
|
|
3501
|
+
const O = new gn({
|
|
3502
3502
|
...Me,
|
|
3503
|
-
timeouts:
|
|
3504
|
-
audio: M.current !== void 0 ||
|
|
3503
|
+
timeouts: E.current,
|
|
3504
|
+
audio: M.current !== void 0 || v.current ? {
|
|
3505
3505
|
enabled: M.current,
|
|
3506
|
-
...
|
|
3506
|
+
...v.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
|
|
3507
3507
|
} : void 0,
|
|
3508
3508
|
video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
|
|
3509
3509
|
mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
|
|
3510
|
-
webRtc:
|
|
3510
|
+
webRtc: T.current === !1 ? { enabled: !1 } : void 0,
|
|
3511
3511
|
websocket: re.current,
|
|
3512
3512
|
webtransport: q.current,
|
|
3513
|
-
proxy:
|
|
3514
|
-
onConnectionStateChange: (
|
|
3515
|
-
$(
|
|
3513
|
+
proxy: I.current,
|
|
3514
|
+
onConnectionStateChange: (Y) => {
|
|
3515
|
+
$(Y);
|
|
3516
3516
|
},
|
|
3517
|
-
onError: (
|
|
3518
|
-
Y
|
|
3517
|
+
onError: (Y) => {
|
|
3518
|
+
G(Y.message);
|
|
3519
3519
|
}
|
|
3520
3520
|
});
|
|
3521
|
-
u.current =
|
|
3522
|
-
const J = new Dn({ client:
|
|
3523
|
-
return
|
|
3524
|
-
if (
|
|
3525
|
-
|
|
3521
|
+
u.current = O;
|
|
3522
|
+
const J = new Dn({ client: O });
|
|
3523
|
+
return y.current = J, R(J), O.connect().catch((Y) => {
|
|
3524
|
+
if (ke.error("Connection failed:", Y), Y instanceof yn) {
|
|
3525
|
+
Se(Y.reason);
|
|
3526
3526
|
return;
|
|
3527
3527
|
}
|
|
3528
|
-
if (
|
|
3529
|
-
|
|
3528
|
+
if (Y instanceof bn) {
|
|
3529
|
+
ve(!0);
|
|
3530
3530
|
return;
|
|
3531
3531
|
}
|
|
3532
|
-
|
|
3532
|
+
Y instanceof wn && !w.current && (w.current = !0, ke.warn("Auth session appears stale, clearing and retrying"), c ? c.logout() : (Oe(), L((nn) => nn + 1)));
|
|
3533
3533
|
}), () => {
|
|
3534
|
-
|
|
3534
|
+
O.disconnect(), u.current = null, J.dispose(), y.current = null;
|
|
3535
3535
|
};
|
|
3536
3536
|
}, [Me]);
|
|
3537
|
-
const en = D((
|
|
3538
|
-
const
|
|
3539
|
-
u.current?.sendActionCall(
|
|
3537
|
+
const en = D((O, J) => {
|
|
3538
|
+
const Y = typeof J == "string" ? J : JSON.stringify(J ?? {});
|
|
3539
|
+
u.current?.sendActionCall(O, Y);
|
|
3540
3540
|
}, []);
|
|
3541
|
-
|
|
3542
|
-
if (
|
|
3541
|
+
_(() => {
|
|
3542
|
+
if (x !== "connecting") {
|
|
3543
3543
|
B(!1);
|
|
3544
3544
|
return;
|
|
3545
3545
|
}
|
|
3546
|
-
const
|
|
3546
|
+
const O = u.current?.slowConnectionThresholdMs ?? 5e3, J = setTimeout(() => B(!0), O);
|
|
3547
3547
|
return () => clearTimeout(J);
|
|
3548
|
-
}, [
|
|
3549
|
-
const tn =
|
|
3548
|
+
}, [x]);
|
|
3549
|
+
const tn = x === "connected" || x === "reconnecting";
|
|
3550
3550
|
return {
|
|
3551
|
-
connectionState:
|
|
3551
|
+
connectionState: x,
|
|
3552
3552
|
error: K,
|
|
3553
|
-
accessDeniedReason:
|
|
3554
|
-
isServerFull:
|
|
3553
|
+
accessDeniedReason: we,
|
|
3554
|
+
isServerFull: Ee,
|
|
3555
3555
|
stores: Qt,
|
|
3556
3556
|
client: u.current,
|
|
3557
3557
|
registry: g.current,
|
|
3558
3558
|
clientRef: u,
|
|
3559
|
-
uiRef:
|
|
3559
|
+
uiRef: y,
|
|
3560
3560
|
registryRef: g,
|
|
3561
3561
|
onAction: en,
|
|
3562
3562
|
isReady: tn,
|
|
3563
|
+
brandingRequired: u.current?.brandingRequired ?? !1,
|
|
3563
3564
|
isConnectingSlow: V,
|
|
3564
3565
|
webRtcVideoStreams: u.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3565
3566
|
webRtcTrackMap: u.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3566
3567
|
};
|
|
3567
3568
|
}
|
|
3568
|
-
function
|
|
3569
|
-
const e =
|
|
3569
|
+
function Ds(t) {
|
|
3570
|
+
const e = A(!1);
|
|
3570
3571
|
return D(() => {
|
|
3571
3572
|
if (e.current) return;
|
|
3572
3573
|
e.current = !0;
|
|
@@ -3576,26 +3577,26 @@ function Us(t) {
|
|
|
3576
3577
|
}
|
|
3577
3578
|
let ns = 0;
|
|
3578
3579
|
function rs(t = 5, e = 5e3) {
|
|
3579
|
-
const [n, r] =
|
|
3580
|
+
const [n, r] = N([]), o = A(/* @__PURE__ */ new Map()), s = D((i) => {
|
|
3580
3581
|
const a = o.current.get(i);
|
|
3581
|
-
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((
|
|
3582
|
+
a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((d) => d.id !== i));
|
|
3582
3583
|
}, []);
|
|
3583
|
-
return
|
|
3584
|
-
const i = o.current, a =
|
|
3584
|
+
return _(() => {
|
|
3585
|
+
const i = o.current, a = It(
|
|
3585
3586
|
(l) => {
|
|
3586
|
-
if (!
|
|
3587
|
+
if (!Ot())
|
|
3587
3588
|
return;
|
|
3588
|
-
const
|
|
3589
|
-
id:
|
|
3589
|
+
const d = `toast-${++ns}`, h = l.level === We.ERROR ? "error" : "warn", p = {
|
|
3590
|
+
id: d,
|
|
3590
3591
|
level: h,
|
|
3591
3592
|
message: l.message,
|
|
3592
3593
|
component: l.component
|
|
3593
3594
|
};
|
|
3594
3595
|
r((c) => [...c, p].slice(-t));
|
|
3595
|
-
const
|
|
3596
|
-
s(
|
|
3596
|
+
const m = setTimeout(() => {
|
|
3597
|
+
s(d);
|
|
3597
3598
|
}, e);
|
|
3598
|
-
i.set(
|
|
3599
|
+
i.set(d, m);
|
|
3599
3600
|
},
|
|
3600
3601
|
{ minLevel: We.WARN }
|
|
3601
3602
|
);
|
|
@@ -3608,8 +3609,8 @@ function rs(t = 5, e = 5e3) {
|
|
|
3608
3609
|
}, [t, e, s]), { toasts: n, dismissToast: s };
|
|
3609
3610
|
}
|
|
3610
3611
|
function os(t, e, n) {
|
|
3611
|
-
const [r, o] =
|
|
3612
|
-
return
|
|
3612
|
+
const [r, o] = N(n);
|
|
3613
|
+
return _(() => {
|
|
3613
3614
|
if (!t)
|
|
3614
3615
|
return;
|
|
3615
3616
|
let s = !0, i = null;
|
|
@@ -3624,9 +3625,9 @@ function os(t, e, n) {
|
|
|
3624
3625
|
};
|
|
3625
3626
|
}, [t, e]), r;
|
|
3626
3627
|
}
|
|
3627
|
-
function
|
|
3628
|
-
const [r, o] =
|
|
3629
|
-
return
|
|
3628
|
+
function $s(t, e, n) {
|
|
3629
|
+
const [r, o] = N(null);
|
|
3630
|
+
return _(() => {
|
|
3630
3631
|
if (!t)
|
|
3631
3632
|
return;
|
|
3632
3633
|
let s = !0;
|
|
@@ -3639,7 +3640,7 @@ function js(t, e, n) {
|
|
|
3639
3640
|
};
|
|
3640
3641
|
}, [t, e]), os(r ? t : null, r ?? "", n);
|
|
3641
3642
|
}
|
|
3642
|
-
const
|
|
3643
|
+
const ie = ne("IkonDebug"), ss = {
|
|
3643
3644
|
Digit1: "connecting",
|
|
3644
3645
|
Digit2: "connected",
|
|
3645
3646
|
Digit3: "reconnecting",
|
|
@@ -3648,47 +3649,55 @@ const ke = ne("IkonDebug"), ss = {
|
|
|
3648
3649
|
Digit0: "clear"
|
|
3649
3650
|
}, is = "Digit5", as = "Digit6", cs = "Synthetic debug error (Ctrl+Shift+5)", ls = "Synthetic debug access-denied (Ctrl+Shift+6)", us = 5e3;
|
|
3650
3651
|
function ds(t) {
|
|
3651
|
-
const e =
|
|
3652
|
-
return
|
|
3652
|
+
const e = Ot(), [n, r] = N(null), [o, s] = N(!1), [i, a] = N(null), [l, d] = N(null), [h, p] = N(!1), [m, c] = N(!1), [u, y] = N(!1);
|
|
3653
|
+
return _(() => {
|
|
3653
3654
|
if (!e)
|
|
3654
3655
|
return;
|
|
3655
|
-
const
|
|
3656
|
-
if (!
|
|
3656
|
+
const b = (w) => {
|
|
3657
|
+
if (!w.ctrlKey || !w.shiftKey)
|
|
3658
|
+
return;
|
|
3659
|
+
if (w.code === "KeyE") {
|
|
3660
|
+
w.preventDefault(), p((T) => (ie.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
|
|
3657
3661
|
return;
|
|
3658
|
-
|
|
3659
|
-
|
|
3662
|
+
}
|
|
3663
|
+
if (w.code === "Digit7") {
|
|
3664
|
+
w.preventDefault(), c((T) => (ie.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
|
|
3665
|
+
return;
|
|
3666
|
+
}
|
|
3667
|
+
if (w.code === "Digit8") {
|
|
3668
|
+
w.preventDefault(), y((T) => (ie.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
|
|
3660
3669
|
return;
|
|
3661
3670
|
}
|
|
3662
|
-
if (
|
|
3663
|
-
|
|
3671
|
+
if (w.code === as) {
|
|
3672
|
+
w.preventDefault(), d(ls), r(null), a(null), ie.warn("Forced access denied");
|
|
3664
3673
|
return;
|
|
3665
3674
|
}
|
|
3666
|
-
const
|
|
3667
|
-
if (
|
|
3675
|
+
const v = ss[w.code];
|
|
3676
|
+
if (v === void 0)
|
|
3668
3677
|
return;
|
|
3669
|
-
if (
|
|
3670
|
-
r(null), a(null),
|
|
3678
|
+
if (w.preventDefault(), v === "clear") {
|
|
3679
|
+
r(null), a(null), d(null), ie.warn("Cleared forced state");
|
|
3671
3680
|
return;
|
|
3672
3681
|
}
|
|
3673
|
-
const
|
|
3674
|
-
r(
|
|
3682
|
+
const E = w.code === is;
|
|
3683
|
+
r(v), a(E ? cs : null), d(null), ie.warn(`Forced state: ${v}${E ? " (with error)" : ""}`);
|
|
3675
3684
|
};
|
|
3676
|
-
return window.addEventListener("keydown",
|
|
3677
|
-
}, [e]),
|
|
3685
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
3686
|
+
}, [e]), _(() => {
|
|
3678
3687
|
if (n !== "connecting") {
|
|
3679
3688
|
s(!1);
|
|
3680
3689
|
return;
|
|
3681
3690
|
}
|
|
3682
|
-
const
|
|
3683
|
-
return () => clearTimeout(
|
|
3684
|
-
}, [n]), !e || n === null && !h && l === null ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, debugEnabled: e } : { app: {
|
|
3691
|
+
const b = setTimeout(() => s(!0), us);
|
|
3692
|
+
return () => clearTimeout(b);
|
|
3693
|
+
}, [n]), !e || n === null && !h && l === null && !m && !u ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
|
|
3685
3694
|
...t,
|
|
3686
3695
|
connectionState: n ?? t.connectionState,
|
|
3687
3696
|
isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
|
|
3688
3697
|
error: n === "offline" && i ? i : n ? null : t.error,
|
|
3689
3698
|
stores: h ? /* @__PURE__ */ new Map() : t.stores,
|
|
3690
3699
|
accessDeniedReason: l ?? t.accessDeniedReason
|
|
3691
|
-
}, forcedState: n, emptyStores: h, forcedError: i, forcedAccessDenied: l, debugEnabled: e };
|
|
3700
|
+
}, forcedState: n, emptyStores: h, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
|
|
3692
3701
|
}
|
|
3693
3702
|
function fs(t, e) {
|
|
3694
3703
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
@@ -3702,46 +3711,81 @@ function ps(t, e) {
|
|
|
3702
3711
|
function ms(t, e) {
|
|
3703
3712
|
return t === void 0 ? null : typeof t == "function" ? t(e) : t;
|
|
3704
3713
|
}
|
|
3705
|
-
function
|
|
3706
|
-
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, { app:
|
|
3707
|
-
if (
|
|
3708
|
-
return ms(o,
|
|
3709
|
-
const
|
|
3710
|
-
let
|
|
3711
|
-
switch (
|
|
3714
|
+
function Bs(t) {
|
|
3715
|
+
const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = ds(s), { app: a } = i, { connectionState: l, isConnectingSlow: d, stores: h, registry: p, client: m, onAction: c, isReady: u, error: y, accessDeniedReason: g, brandingRequired: b } = a, w = b || i.forcedBranding, v = A(null);
|
|
3716
|
+
if (u && h && p && (v.current = { stores: h, registry: p, client: m }), g)
|
|
3717
|
+
return ms(o, g);
|
|
3718
|
+
const E = v.current;
|
|
3719
|
+
let T = null;
|
|
3720
|
+
switch (l) {
|
|
3712
3721
|
case "waitingForExternalConnectUrl":
|
|
3713
3722
|
case "connecting":
|
|
3714
|
-
|
|
3723
|
+
T = fs(e, d);
|
|
3715
3724
|
break;
|
|
3716
3725
|
case "reconnecting":
|
|
3717
|
-
|
|
3726
|
+
T = hs(n);
|
|
3718
3727
|
break;
|
|
3719
3728
|
case "offline":
|
|
3720
|
-
|
|
3729
|
+
T = ps(r, y);
|
|
3721
3730
|
break;
|
|
3722
3731
|
default:
|
|
3723
|
-
|
|
3732
|
+
T = null;
|
|
3724
3733
|
}
|
|
3725
3734
|
return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
3726
|
-
|
|
3727
|
-
|
|
3735
|
+
E && /* @__PURE__ */ S.jsx(
|
|
3736
|
+
Nt,
|
|
3728
3737
|
{
|
|
3729
|
-
stores:
|
|
3730
|
-
registry:
|
|
3731
|
-
client:
|
|
3732
|
-
onAction:
|
|
3738
|
+
stores: E.stores,
|
|
3739
|
+
registry: E.registry,
|
|
3740
|
+
client: E.client,
|
|
3741
|
+
onAction: c
|
|
3733
3742
|
}
|
|
3734
3743
|
),
|
|
3735
|
-
|
|
3736
|
-
/* @__PURE__ */ S.jsx(
|
|
3737
|
-
/* @__PURE__ */ S.jsx(
|
|
3744
|
+
T,
|
|
3745
|
+
w && /* @__PURE__ */ S.jsx(ys, {}),
|
|
3746
|
+
/* @__PURE__ */ S.jsx(bs, {}),
|
|
3747
|
+
/* @__PURE__ */ S.jsx(Jt, { state: l, forceVisible: i.forcedDebugOverlay })
|
|
3738
3748
|
] });
|
|
3739
3749
|
}
|
|
3740
|
-
|
|
3750
|
+
const gs = "https://ikonai.com";
|
|
3751
|
+
function ys() {
|
|
3752
|
+
return /* @__PURE__ */ S.jsxs(
|
|
3753
|
+
"a",
|
|
3754
|
+
{
|
|
3755
|
+
className: "ikon-branding-banner",
|
|
3756
|
+
href: gs,
|
|
3757
|
+
target: "_blank",
|
|
3758
|
+
rel: "noopener noreferrer",
|
|
3759
|
+
style: {
|
|
3760
|
+
position: "fixed",
|
|
3761
|
+
left: 0,
|
|
3762
|
+
right: 0,
|
|
3763
|
+
bottom: 0,
|
|
3764
|
+
zIndex: 9996,
|
|
3765
|
+
display: "flex",
|
|
3766
|
+
alignItems: "center",
|
|
3767
|
+
justifyContent: "center",
|
|
3768
|
+
gap: "6px",
|
|
3769
|
+
padding: "8px 12px",
|
|
3770
|
+
background: "rgba(17, 17, 17, 0.92)",
|
|
3771
|
+
color: "#fff",
|
|
3772
|
+
font: '13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif',
|
|
3773
|
+
textDecoration: "none",
|
|
3774
|
+
boxShadow: "0 -1px 8px rgba(0, 0, 0, 0.25)",
|
|
3775
|
+
pointerEvents: "auto"
|
|
3776
|
+
},
|
|
3777
|
+
children: [
|
|
3778
|
+
/* @__PURE__ */ S.jsx("span", { style: { opacity: 0.75 }, children: "Made with" }),
|
|
3779
|
+
/* @__PURE__ */ S.jsx("span", { style: { fontWeight: 700 }, children: "Ikon" })
|
|
3780
|
+
]
|
|
3781
|
+
}
|
|
3782
|
+
);
|
|
3783
|
+
}
|
|
3784
|
+
function bs() {
|
|
3741
3785
|
const { toasts: t, dismissToast: e } = rs();
|
|
3742
|
-
return t.length === 0 ? null : /* @__PURE__ */ S.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ S.jsx(
|
|
3786
|
+
return t.length === 0 ? null : /* @__PURE__ */ S.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ S.jsx(ws, { toast: n, onDismiss: e }, n.id)) });
|
|
3743
3787
|
}
|
|
3744
|
-
function
|
|
3788
|
+
function ws({ toast: t, onDismiss: e }) {
|
|
3745
3789
|
return /* @__PURE__ */ S.jsxs(
|
|
3746
3790
|
"div",
|
|
3747
3791
|
{
|
|
@@ -3762,31 +3806,31 @@ function ys({ toast: t, onDismiss: e }) {
|
|
|
3762
3806
|
}
|
|
3763
3807
|
);
|
|
3764
3808
|
}
|
|
3765
|
-
const Zt =
|
|
3766
|
-
function
|
|
3809
|
+
const Zt = Ct(null);
|
|
3810
|
+
function Ss(t, e) {
|
|
3767
3811
|
return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
|
|
3768
3812
|
}
|
|
3769
|
-
function
|
|
3813
|
+
function Es(t, e) {
|
|
3770
3814
|
const n = Sn();
|
|
3771
3815
|
if (n && t.includes(n))
|
|
3772
3816
|
return n;
|
|
3773
3817
|
const r = navigator.language.split("-")[0];
|
|
3774
3818
|
return t.includes(r) ? r : e && t.includes(e) ? e : "en";
|
|
3775
3819
|
}
|
|
3776
|
-
function
|
|
3777
|
-
return e ?
|
|
3820
|
+
function vs(t, e, n) {
|
|
3821
|
+
return e ? Es(t, n) : n && t.includes(n) ? n : "en";
|
|
3778
3822
|
}
|
|
3779
|
-
function
|
|
3823
|
+
function Fs({
|
|
3780
3824
|
children: t,
|
|
3781
3825
|
translations: e,
|
|
3782
3826
|
defaultLanguage: n,
|
|
3783
3827
|
detectLanguage: r = !1
|
|
3784
3828
|
}) {
|
|
3785
|
-
const o = Object.keys(e), s =
|
|
3829
|
+
const o = Object.keys(e), s = vs(o, r, n), i = e[s] ?? e.en, a = W(
|
|
3786
3830
|
() => ({
|
|
3787
|
-
t: (l,
|
|
3831
|
+
t: (l, d) => {
|
|
3788
3832
|
const h = i[l];
|
|
3789
|
-
return
|
|
3833
|
+
return Ss(h, d);
|
|
3790
3834
|
},
|
|
3791
3835
|
locale: s,
|
|
3792
3836
|
translations: i
|
|
@@ -3795,77 +3839,77 @@ function $s({
|
|
|
3795
3839
|
);
|
|
3796
3840
|
return /* @__PURE__ */ S.jsx(Zt, { value: a, children: t });
|
|
3797
3841
|
}
|
|
3798
|
-
function
|
|
3799
|
-
const t =
|
|
3842
|
+
function Vs() {
|
|
3843
|
+
const t = Ze(Zt);
|
|
3800
3844
|
if (!t)
|
|
3801
3845
|
throw new Error("useI18n must be used within an I18nProvider");
|
|
3802
3846
|
return t;
|
|
3803
3847
|
}
|
|
3804
3848
|
export {
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3849
|
+
Ls as AuthProvider,
|
|
3850
|
+
Us as ConnectionStateRenderer,
|
|
3851
|
+
Xt as DEBUG_OVERLAY_ENABLED,
|
|
3808
3852
|
Jt as DebugOverlay,
|
|
3809
|
-
|
|
3853
|
+
Fs as I18nProvider,
|
|
3810
3854
|
Zn as IKON_UI_BASE_MODULE,
|
|
3811
3855
|
ur as IKON_UI_MEDIA_MODULE,
|
|
3812
3856
|
kr as IKON_UI_SHADERTOY_MODULE,
|
|
3813
3857
|
Ar as IKON_UI_SHADERTOY_TYPE,
|
|
3814
|
-
|
|
3858
|
+
Ge as IKON_UI_STREAM_CATEGORY,
|
|
3815
3859
|
sr as IKON_UI_VIDEO_CANVAS_TYPE,
|
|
3816
3860
|
ir as IKON_UI_VIDEO_URL_PLAYER_TYPE,
|
|
3817
|
-
|
|
3861
|
+
Bs as IkonApp,
|
|
3818
3862
|
Dn as IkonUi,
|
|
3819
3863
|
Ir as IkonUiRegistry,
|
|
3820
|
-
|
|
3864
|
+
Nt as IkonUiSurface,
|
|
3821
3865
|
Mn as InspectOverlay,
|
|
3822
|
-
|
|
3866
|
+
Is as ParallaxView,
|
|
3823
3867
|
Ln as UiComponentRegistry,
|
|
3824
3868
|
Pn as UiRenderer,
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3869
|
+
Gs as UiStreamStore,
|
|
3870
|
+
Os as areIkonUiModuleListsEqual,
|
|
3871
|
+
Wt as authenticateAnonymous,
|
|
3828
3872
|
Mo as buildOAuthRedirectUrl,
|
|
3829
3873
|
Oe as clearAuthSession,
|
|
3830
|
-
|
|
3874
|
+
At as clearOAuthParams,
|
|
3831
3875
|
Jn as createBaseResolvers,
|
|
3832
|
-
|
|
3876
|
+
Cs as createComponentLibrary,
|
|
3833
3877
|
Or as createIkonUiRegistry,
|
|
3834
3878
|
cr as createMediaResolvers,
|
|
3835
3879
|
Tr as createShadertoyRendererResolver,
|
|
3836
3880
|
jn as isIkonUiCategoryMatch,
|
|
3837
|
-
|
|
3881
|
+
Ft as loadAuthSession,
|
|
3838
3882
|
Qn as loadBaseModule,
|
|
3839
3883
|
dr as loadMediaModule,
|
|
3840
3884
|
Cr as loadShadertoyModule,
|
|
3841
3885
|
ro as normalizeIkonUiModuleList,
|
|
3842
|
-
|
|
3886
|
+
xs as parseIkonUiInitPayload,
|
|
3843
3887
|
Po as parseOAuthCallback,
|
|
3844
3888
|
Lo as parseOAuthError,
|
|
3845
|
-
|
|
3889
|
+
zs as randomUuid,
|
|
3846
3890
|
oo as readIkonUiModules,
|
|
3847
|
-
|
|
3891
|
+
Ns as readIkonUiModulesFromSources,
|
|
3848
3892
|
er as registerBaseModule,
|
|
3849
3893
|
fr as registerMediaModule,
|
|
3850
3894
|
_r as registerShadertoyModule,
|
|
3851
3895
|
Nn as renderChildren,
|
|
3852
|
-
|
|
3853
|
-
|
|
3896
|
+
Ps as renderMotionLetters,
|
|
3897
|
+
be as saveAuthSession,
|
|
3854
3898
|
No as sendLoginCode,
|
|
3855
3899
|
se as sessionToUser,
|
|
3856
3900
|
Xo as useAuth,
|
|
3857
|
-
|
|
3901
|
+
Ms as useAuthGuard,
|
|
3858
3902
|
Ho as useAuthOptional,
|
|
3859
|
-
|
|
3860
|
-
|
|
3903
|
+
Vs as useI18n,
|
|
3904
|
+
js as useIkonApp,
|
|
3861
3905
|
ds as useIkonDebug,
|
|
3862
3906
|
os as useIkonReactive,
|
|
3863
3907
|
Dr as useIkonStyles,
|
|
3864
3908
|
Br as useIkonUiStores,
|
|
3865
|
-
|
|
3866
|
-
|
|
3909
|
+
Ds as useLazyFont,
|
|
3910
|
+
$s as useReactive,
|
|
3867
3911
|
rs as useToasts,
|
|
3868
3912
|
Z as useUiNode,
|
|
3869
|
-
|
|
3913
|
+
_s as useUiStore,
|
|
3870
3914
|
xo as verifyLoginCode
|
|
3871
3915
|
};
|