@ikonai/sdk-react-ui 1.3.0 → 1.3.2
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 +20 -0
- package/auth/auth-service.d.ts +37 -2
- package/auth/index.d.ts +2 -1
- package/auth/oauth-continuation.d.ts +36 -0
- package/auth/storage.d.ts +25 -1
- package/auth/types.d.ts +19 -0
- package/auth/use-auth-guard.d.ts +7 -0
- package/index.js +991 -719
- package/package.json +1 -1
- package/theme/ikon-surface.css +1 -0
package/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { IkonUiCore as e, LiveSnapshotCache as t, UiStreamStore as n, UiStreamStore as r, isPrerenderVisible as i, prefetchBootSnapshot as a } from "@ikonai/sdk-ui";
|
|
2
|
-
import { AccessDeniedError as o, AppStartupFailedError as s, AuthenticationError as c, IKON_INSPECT_MODE_CHANGED_EVENT as l, IkonClient as u, LogLevel as d, ProvisioningTimeoutError as f, ServerFullError as p, ServerUnavailableError as m, SessionNotFoundError as h, abortSignalTimeout as g, clearLoginPrompt as _, createLogger as v,
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { Fragment as
|
|
2
|
+
import { AccessDeniedError as o, AppStartupFailedError as s, AuthenticationError as c, IKON_INSPECT_MODE_CHANGED_EVENT as l, IkonClient as u, LogLevel as d, ProvisioningTimeoutError as f, ServerFullError as p, ServerUnavailableError as m, SessionNotFoundError as h, abortSignalTimeout as g, clearLoginPrompt as _, createLogger as v, createPkceChallenge as y, deriveAuthUrl as b, deriveBackendType as x, deriveCrossOriginAuthUrl as S, extractUserIdFromToken as ee, getDebugOverlayParam as te, getLangParam as ne, getLoginPromptState as re, getOrCreateDeviceId as ie, getSameOriginAuthUrl as C, isCloudEnvironment as ae, isDebugModeEnabled as oe, isEmbedded as w, isInspectModeEnabled as se, parseUrlParams as ce, randomUuid as T, reportConnectTimeline as le, setLoginPromptRequired as ue, startEmbeddedOAuthSignIn as E, subscribeLoginPrompt as de, subscribeToLogEvents as fe, takePkceVerifier as pe } from "@ikonai/sdk";
|
|
3
|
+
import { Fragment as me, createContext as he, memo as D, use as ge, useCallback as O, useEffect as k, useLayoutEffect as _e, useMemo as A, useReducer as ve, useRef as j, useState as M, useSyncExternalStore as N } from "react";
|
|
4
|
+
import { Fragment as ye, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
5
5
|
//#region src/renderer/use-root-view.ts
|
|
6
|
-
function
|
|
7
|
-
let n =
|
|
6
|
+
function be(e, t) {
|
|
7
|
+
let n = N((t) => e.subscribe(t), () => {
|
|
8
8
|
let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
|
|
9
9
|
return `${r ?? ""}:${i?.id ?? ""}`;
|
|
10
10
|
}, () => {
|
|
11
11
|
let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
|
|
12
12
|
return `${r ?? ""}:${i?.id ?? ""}`;
|
|
13
13
|
});
|
|
14
|
-
return
|
|
14
|
+
return A(() => {
|
|
15
15
|
let [e, t] = n.split(":");
|
|
16
16
|
return {
|
|
17
17
|
rootViewId: e || void 0,
|
|
@@ -22,8 +22,8 @@ function he(e, t) {
|
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/renderer/use-ui-node.ts
|
|
24
24
|
function I(e, t) {
|
|
25
|
-
let n =
|
|
26
|
-
return
|
|
25
|
+
let n = N((n) => e.subscribeNode(t, n), () => e.getNodeVersion(t), () => e.getNodeVersion(t));
|
|
26
|
+
return A(() => e.getNode(t), [
|
|
27
27
|
e,
|
|
28
28
|
t,
|
|
29
29
|
n
|
|
@@ -31,8 +31,8 @@ function I(e, t) {
|
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/renderer/ui-renderer.tsx
|
|
34
|
-
var
|
|
35
|
-
function
|
|
34
|
+
var xe = v("UIRenderer");
|
|
35
|
+
function Se(e) {
|
|
36
36
|
if (e === void 0) return "{}";
|
|
37
37
|
if (typeof e == "string") return e;
|
|
38
38
|
try {
|
|
@@ -41,28 +41,28 @@ function _e(e) {
|
|
|
41
41
|
return "{}";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ce(e) {
|
|
45
45
|
let t = e.styleIds;
|
|
46
46
|
return Array.isArray(t) ? t : [];
|
|
47
47
|
}
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
let [t, n] =
|
|
51
|
-
return
|
|
48
|
+
var we = 1500;
|
|
49
|
+
function Te(e) {
|
|
50
|
+
let [t, n] = M(0);
|
|
51
|
+
return k(() => {
|
|
52
52
|
if (e.subscribe) return e.subscribe(() => n((e) => e + 1));
|
|
53
53
|
}, [e]), t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
let [i, a] =
|
|
55
|
+
function Ee({ nodeType: e, nodeId: t, context: n, className: r }) {
|
|
56
|
+
let [i, a] = M(!1), o = I(n.store, t), s = Te(n.library), c = A(() => o ? n.library.resolve(o) : void 0, [
|
|
57
57
|
n.library,
|
|
58
58
|
o,
|
|
59
59
|
s
|
|
60
60
|
]);
|
|
61
|
-
return
|
|
62
|
-
let e = setTimeout(() => a(!0),
|
|
61
|
+
return k(() => {
|
|
62
|
+
let e = setTimeout(() => a(!0), we);
|
|
63
63
|
return () => clearTimeout(e);
|
|
64
|
-
}, [e]),
|
|
65
|
-
!i || c ||
|
|
64
|
+
}, [e]), k(() => {
|
|
65
|
+
!i || c || xe.error(`No React resolver is registered for node type '${e}', so it renders as an error placeholder instead of the component you expected. A custom node needs all four parts: (1) the React component, (2) a resolver that matches '${e}', (3) a registerModule(...) call for it in app.tsx, and (4) the C# view.AddNode("${e}", ...) extension. Prefer native view.* components where they fit.`);
|
|
66
66
|
}, [
|
|
67
67
|
i,
|
|
68
68
|
c,
|
|
@@ -87,69 +87,69 @@ function be({ nodeType: e, nodeId: t, context: n, className: r }) {
|
|
|
87
87
|
children: `Unregistered node type: ${e}\nNo React resolver is registered for it — register the component's module in app.tsx (see the console for details).`
|
|
88
88
|
}) : null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function De(e) {
|
|
91
91
|
let t = e.children;
|
|
92
92
|
return Array.isArray(t) ? t : [];
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Oe(e, t) {
|
|
95
95
|
return e.nodeId === t.nodeId && e.context === t.context;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function ke(e) {
|
|
98
98
|
if (e.length === 0) return "";
|
|
99
99
|
if (e.length === 1) return e[0].id;
|
|
100
100
|
let t = e[0].id;
|
|
101
101
|
for (let n = 1; n < e.length; n++) t += "," + e[n].id;
|
|
102
102
|
return t;
|
|
103
103
|
}
|
|
104
|
-
var
|
|
105
|
-
let r = I(n.store, t), i = r ?
|
|
104
|
+
var Ae = D(function e({ nodeId: t, context: n }) {
|
|
105
|
+
let r = I(n.store, t), i = r ? De(r) : [], a = ke(i), o = A(() => i.length === 0 ? null : i.map((t) => /* @__PURE__ */ P(e, {
|
|
106
106
|
nodeId: t.id,
|
|
107
107
|
context: n
|
|
108
108
|
}, t.id)), [a, n]);
|
|
109
109
|
if (!r) return null;
|
|
110
|
-
if (r.type === "root") return /* @__PURE__ */ P(
|
|
111
|
-
let s =
|
|
110
|
+
if (r.type === "root") return /* @__PURE__ */ P(me, { children: o }, r.id);
|
|
111
|
+
let s = Ce(r), c = s.length > 0 ? s.join(" ") : void 0, l = n.library.resolve(r);
|
|
112
112
|
return l ? /* @__PURE__ */ P(l, {
|
|
113
113
|
nodeId: t,
|
|
114
114
|
context: n,
|
|
115
115
|
className: c
|
|
116
|
-
}) : /* @__PURE__ */ P(
|
|
116
|
+
}) : /* @__PURE__ */ P(Ee, {
|
|
117
117
|
nodeType: r.type,
|
|
118
118
|
nodeId: r.id,
|
|
119
119
|
context: n,
|
|
120
120
|
className: c
|
|
121
121
|
});
|
|
122
|
-
},
|
|
123
|
-
function
|
|
124
|
-
return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ P(
|
|
122
|
+
}, Oe);
|
|
123
|
+
function je(e, t) {
|
|
124
|
+
return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ P(Ae, {
|
|
125
125
|
nodeId: e.id,
|
|
126
126
|
context: t
|
|
127
127
|
}, e.id));
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Me(e, t) {
|
|
130
130
|
return e.store === t.store && e.library === t.library && e.viewId === t.viewId && e.emptyFallback === t.emptyFallback;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
133
|
-
let { rootViewId: s, rootNodeId: c } =
|
|
132
|
+
var Ne = D(function({ store: e, library: t, viewId: n, emptyFallback: r = null, onAction: i, client: a, video: o }) {
|
|
133
|
+
let { rootViewId: s, rootNodeId: c } = be(e, n), l = j(i);
|
|
134
134
|
l.current = i;
|
|
135
|
-
let u =
|
|
135
|
+
let u = j(a);
|
|
136
136
|
u.current = a;
|
|
137
|
-
let d =
|
|
137
|
+
let d = j(o);
|
|
138
138
|
d.current = o;
|
|
139
|
-
let f =
|
|
139
|
+
let f = O((e, t) => {
|
|
140
140
|
if (!e) return;
|
|
141
|
-
let n =
|
|
141
|
+
let n = Se(t);
|
|
142
142
|
l.current?.(e, n);
|
|
143
|
-
}, []), p =
|
|
143
|
+
}, []), p = A(() => {
|
|
144
144
|
let n = {
|
|
145
145
|
store: e,
|
|
146
146
|
library: t,
|
|
147
147
|
handlerCache: e.handlerCache,
|
|
148
148
|
getPayload: (t) => e.getSnapshot().payloads.get(t),
|
|
149
|
-
renderChildren: (e) =>
|
|
149
|
+
renderChildren: (e) => je(e, n),
|
|
150
150
|
renderView: (t) => {
|
|
151
151
|
let r = e.getSnapshot().views.get(t);
|
|
152
|
-
return r ? /* @__PURE__ */ P(
|
|
152
|
+
return r ? /* @__PURE__ */ P(Ae, {
|
|
153
153
|
nodeId: r.id,
|
|
154
154
|
context: n
|
|
155
155
|
}) : null;
|
|
@@ -171,12 +171,12 @@ var De = T(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
171
171
|
return !s || !c ? r : /* @__PURE__ */ P("div", {
|
|
172
172
|
"data-ikon-view-id": s,
|
|
173
173
|
style: { display: "contents" },
|
|
174
|
-
children: /* @__PURE__ */ P(
|
|
174
|
+
children: /* @__PURE__ */ P(Ae, {
|
|
175
175
|
nodeId: c,
|
|
176
176
|
context: p
|
|
177
177
|
})
|
|
178
178
|
});
|
|
179
|
-
},
|
|
179
|
+
}, Me), Pe = class {
|
|
180
180
|
fallback;
|
|
181
181
|
renderers = /* @__PURE__ */ new Map();
|
|
182
182
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -201,29 +201,29 @@ var De = T(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
|
|
|
201
201
|
for (let e of this.listeners) e();
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
function
|
|
205
|
-
return new
|
|
204
|
+
function Fe(e, t) {
|
|
205
|
+
return new Pe(Object.entries(e), t);
|
|
206
206
|
}
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region src/renderer/use-ui-store.ts
|
|
209
|
-
function
|
|
210
|
-
return
|
|
209
|
+
function Ie(e) {
|
|
210
|
+
return N((t) => e.subscribe(t), () => e.getSnapshot(), () => e.getSnapshot());
|
|
211
211
|
}
|
|
212
212
|
//#endregion
|
|
213
213
|
//#region src/inspect/inspect-overlay.tsx
|
|
214
|
-
function
|
|
215
|
-
let [e, t] =
|
|
216
|
-
return
|
|
214
|
+
function Le() {
|
|
215
|
+
let [e, t] = M(se), n = j(!1);
|
|
216
|
+
return k(() => {
|
|
217
217
|
if (e) return;
|
|
218
218
|
let r = () => {
|
|
219
|
-
|
|
219
|
+
se() && t(!0);
|
|
220
220
|
}, i = (e) => {
|
|
221
221
|
e.data?.type === "ikon-inspect-mode" && e.data.enabled && (n.current = !0, t(!0));
|
|
222
222
|
};
|
|
223
223
|
return window.addEventListener(l, r), window.addEventListener("message", i), () => {
|
|
224
224
|
window.removeEventListener(l, r), window.removeEventListener("message", i);
|
|
225
225
|
};
|
|
226
|
-
}, [e]),
|
|
226
|
+
}, [e]), k(() => {
|
|
227
227
|
if (!e) return;
|
|
228
228
|
let t = window.parent === window || n.current, r = null, i = [], a = document.createElement("div");
|
|
229
229
|
a.style.cssText = "position:fixed;z-index:99999;pointer-events:none;padding:2px 6px;background:#1e1e2e;color:#cdd6f4;font-size:11px;border-radius:4px;border:1px solid #45475a;white-space:nowrap;display:none;font-family:monospace;", document.body.appendChild(a);
|
|
@@ -351,20 +351,20 @@ function je() {
|
|
|
351
351
|
}
|
|
352
352
|
//#endregion
|
|
353
353
|
//#region src/surface.tsx
|
|
354
|
-
var
|
|
355
|
-
function
|
|
354
|
+
var L = v("IkonUiSurface"), Re = "ikon-ui";
|
|
355
|
+
function ze(e, t) {
|
|
356
356
|
return e === t;
|
|
357
357
|
}
|
|
358
|
-
var
|
|
359
|
-
let a =
|
|
358
|
+
var Be = D(function({ stores: e, registry: t, category: n = Re, onAction: r, client: i }) {
|
|
359
|
+
let a = A(() => Array.from(e.keys()).sort().join(","), [e]), o = j(r);
|
|
360
360
|
o.current = r;
|
|
361
|
-
let s =
|
|
361
|
+
let s = j(i);
|
|
362
362
|
s.current = i;
|
|
363
|
-
let c =
|
|
363
|
+
let c = A(() => {
|
|
364
364
|
let t = [];
|
|
365
365
|
for (let [r, i] of e) {
|
|
366
366
|
let e = i.store.getSnapshot();
|
|
367
|
-
|
|
367
|
+
ze(i.category, n) && (!e.rootViewId || !e.views.has(e.rootViewId) || t.push({
|
|
368
368
|
key: r,
|
|
369
369
|
store: i.store
|
|
370
370
|
}));
|
|
@@ -374,17 +374,17 @@ var Fe = T(function({ stores: e, registry: t, category: n = Ne, onAction: r, cli
|
|
|
374
374
|
e,
|
|
375
375
|
n,
|
|
376
376
|
a
|
|
377
|
-
]), l =
|
|
378
|
-
return
|
|
379
|
-
u && !l.current && (l.current = !0,
|
|
380
|
-
}, [u]), u ? /* @__PURE__ */ F(
|
|
377
|
+
]), l = j(!1), u = c.length > 0;
|
|
378
|
+
return k(() => {
|
|
379
|
+
u && !l.current && (l.current = !0, L.debug("First UI render"));
|
|
380
|
+
}, [u]), u ? /* @__PURE__ */ F(ye, { children: [/* @__PURE__ */ P(Le, {}), c.map(({ key: e, store: n }) => /* @__PURE__ */ P(Ne, {
|
|
381
381
|
store: n,
|
|
382
382
|
library: t,
|
|
383
383
|
onAction: o.current,
|
|
384
384
|
client: s.current,
|
|
385
385
|
video: s.current?.media?.video
|
|
386
386
|
}, e))] }) : null;
|
|
387
|
-
}),
|
|
387
|
+
}), Ve = class {
|
|
388
388
|
core;
|
|
389
389
|
ownsCore;
|
|
390
390
|
stores = /* @__PURE__ */ new Map();
|
|
@@ -456,7 +456,7 @@ var Fe = T(function({ stores: e, registry: t, category: n = Ne, onAction: r, cli
|
|
|
456
456
|
let t = this.stores.get(e);
|
|
457
457
|
if (t) return t;
|
|
458
458
|
let n = {
|
|
459
|
-
category:
|
|
459
|
+
category: Re,
|
|
460
460
|
store: new r()
|
|
461
461
|
};
|
|
462
462
|
return this.stores.set(e, n), n;
|
|
@@ -476,13 +476,13 @@ var Fe = T(function({ stores: e, registry: t, category: n = Ne, onAction: r, cli
|
|
|
476
476
|
};
|
|
477
477
|
//#endregion
|
|
478
478
|
//#region src/base/base-div.tsx
|
|
479
|
-
function
|
|
479
|
+
function He(e) {
|
|
480
480
|
if (typeof e == "string") {
|
|
481
481
|
let t = e.trim();
|
|
482
482
|
return t.length > 0 ? t : void 0;
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function R(e) {
|
|
486
486
|
if (typeof e == "string") {
|
|
487
487
|
let t = e.trim();
|
|
488
488
|
return t.length > 0 ? t : void 0;
|
|
@@ -492,7 +492,7 @@ function z(e) {
|
|
|
492
492
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ue(...e) {
|
|
496
496
|
let t = "";
|
|
497
497
|
for (let n of e) if (n) {
|
|
498
498
|
let e = n.trim();
|
|
@@ -500,8 +500,8 @@ function B(...e) {
|
|
|
500
500
|
}
|
|
501
501
|
return t || void 0;
|
|
502
502
|
}
|
|
503
|
-
var
|
|
504
|
-
function
|
|
503
|
+
var z = /* @__PURE__ */ new WeakMap(), We = {};
|
|
504
|
+
function B(e) {
|
|
505
505
|
let t = {};
|
|
506
506
|
for (let n of e.split(";")) {
|
|
507
507
|
let e = n.indexOf(":");
|
|
@@ -513,28 +513,28 @@ function ze(e) {
|
|
|
513
513
|
}
|
|
514
514
|
return t;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Ge(e, t) {
|
|
517
517
|
let n = e && typeof e == "object" ? e : void 0;
|
|
518
518
|
return t ? {
|
|
519
519
|
...n ?? {},
|
|
520
520
|
cursor: t
|
|
521
521
|
} : n;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
if (!e) return
|
|
525
|
-
let t =
|
|
523
|
+
function Ke(e) {
|
|
524
|
+
if (!e) return We;
|
|
525
|
+
let t = z.get(e);
|
|
526
526
|
if (t) return t;
|
|
527
527
|
let n = {};
|
|
528
528
|
for (let [t, r] of Object.entries(e)) if (r != null) {
|
|
529
529
|
if (t === "style" && typeof r == "string") {
|
|
530
|
-
n[t] =
|
|
530
|
+
n[t] = B(r);
|
|
531
531
|
continue;
|
|
532
532
|
}
|
|
533
533
|
(typeof r == "string" || typeof r == "number" || typeof r == "boolean") && (n[t] = r);
|
|
534
534
|
}
|
|
535
|
-
return
|
|
535
|
+
return z.set(e, n), n;
|
|
536
536
|
}
|
|
537
|
-
function
|
|
537
|
+
function V(e) {
|
|
538
538
|
let t = e.parentElement;
|
|
539
539
|
for (; t;) {
|
|
540
540
|
let e = window.getComputedStyle(t).overflowY;
|
|
@@ -543,30 +543,30 @@ function Ve(e) {
|
|
|
543
543
|
}
|
|
544
544
|
return null;
|
|
545
545
|
}
|
|
546
|
-
var
|
|
547
|
-
function
|
|
546
|
+
var H = 1.5;
|
|
547
|
+
function qe(e, t) {
|
|
548
548
|
requestAnimationFrame(() => {
|
|
549
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = e.scrollTop + (r.bottom - n.bottom) + 16, a = Math.abs(i - e.scrollTop) > e.clientHeight *
|
|
549
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = e.scrollTop + (r.bottom - n.bottom) + 16, a = Math.abs(i - e.scrollTop) > e.clientHeight * H ? "auto" : "smooth";
|
|
550
550
|
"scrollBehavior" in document.documentElement.style ? e.scrollTo({
|
|
551
551
|
top: i,
|
|
552
552
|
behavior: a
|
|
553
553
|
}) : e.scrollTop = i;
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
-
var U = "data-ikon-scroll-indicator",
|
|
557
|
-
function
|
|
558
|
-
return Math.max(e.clientHeight *
|
|
556
|
+
var U = "data-ikon-scroll-indicator", Je = .15, W = "data-ikon-at-bottom";
|
|
557
|
+
function Ye(e) {
|
|
558
|
+
return Math.max(e.clientHeight * Je, 20);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function Xe(e) {
|
|
561
561
|
return e.getAttribute(W) !== "false";
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Ze(e) {
|
|
564
564
|
e.getAttribute(W) === null && (e.setAttribute(W, "true"), e.addEventListener("scroll", () => {
|
|
565
|
-
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e, i = n - t - r <=
|
|
565
|
+
let { scrollTop: t, scrollHeight: n, clientHeight: r } = e, i = n - t - r <= Ye(e);
|
|
566
566
|
e.setAttribute(W, i ? "true" : "false");
|
|
567
567
|
}, { passive: !0 }));
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function Qe(e) {
|
|
570
570
|
let t = e.parentElement ?? e, n = t.querySelector(`[${U}]`);
|
|
571
571
|
if (n) return n;
|
|
572
572
|
let r = document.createElement("button");
|
|
@@ -598,36 +598,36 @@ function qe(e) {
|
|
|
598
598
|
r.style.opacity = "0.9";
|
|
599
599
|
}), t.appendChild(r), r;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
602
|
-
let n =
|
|
601
|
+
function $e(e, t) {
|
|
602
|
+
let n = Qe(e);
|
|
603
603
|
n.style.display = "flex";
|
|
604
604
|
let r = () => {
|
|
605
|
-
|
|
605
|
+
qe(e, t), n.style.display = "none";
|
|
606
606
|
}, i = () => {
|
|
607
607
|
let { scrollTop: t, scrollHeight: r, clientHeight: i } = e;
|
|
608
|
-
r - t - i <=
|
|
608
|
+
r - t - i <= Ye(e) && (n.style.display = "none");
|
|
609
609
|
};
|
|
610
610
|
return n.addEventListener("click", r), e.addEventListener("scroll", i, { passive: !0 }), () => {
|
|
611
611
|
n.removeEventListener("click", r), e.removeEventListener("scroll", i);
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
|
-
function
|
|
615
|
-
let e =
|
|
616
|
-
let n = I(t.store, e), r =
|
|
617
|
-
return
|
|
614
|
+
function et() {
|
|
615
|
+
let e = D(function({ nodeId: e, context: t }) {
|
|
616
|
+
let n = I(t.store, e), r = j(null), i = R(n?.props?.targetViewId), a = n?.props?.focusOnly, o = typeof a == "boolean" ? a : void 0, s = R(n?.props?.priority), c = R(n?.props?.key), l = n?.props?.preciseGeneratedAt;
|
|
617
|
+
return k(() => {
|
|
618
618
|
if (typeof document > "u") return;
|
|
619
619
|
let e = r.current;
|
|
620
620
|
if (!e || i && e.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i) return;
|
|
621
621
|
let t;
|
|
622
622
|
if (o !== !0) {
|
|
623
|
-
let n =
|
|
624
|
-
if (n) if (
|
|
623
|
+
let n = V(e);
|
|
624
|
+
if (n) if (Ze(n), s === "Polite" && !Xe(n)) t = $e(n, e);
|
|
625
625
|
else {
|
|
626
626
|
let t = (n.parentElement ?? n).querySelector(`[${U}]`);
|
|
627
|
-
t && (t.style.display = "none"),
|
|
627
|
+
t && (t.style.display = "none"), qe(n, e);
|
|
628
628
|
}
|
|
629
629
|
else typeof e.scrollIntoView == "function" && requestAnimationFrame(() => {
|
|
630
|
-
let t = e.getBoundingClientRect().top, n = typeof window < "u" ? window.innerHeight : 0, r = Math.abs(t) > n *
|
|
630
|
+
let t = e.getBoundingClientRect().top, n = typeof window < "u" ? window.innerHeight : 0, r = Math.abs(t) > n * H ? "auto" : "smooth";
|
|
631
631
|
try {
|
|
632
632
|
e.scrollIntoView({
|
|
633
633
|
behavior: r,
|
|
@@ -670,15 +670,15 @@ function Ye() {
|
|
|
670
670
|
if (t === "std.focus-hint") return e;
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
function
|
|
674
|
-
let e =
|
|
675
|
-
let r = I(t.store, e), i =
|
|
673
|
+
function tt() {
|
|
674
|
+
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
675
|
+
let r = I(t.store, e), i = He(r?.props?.onInvokeId), a = O(() => {
|
|
676
676
|
i && t.dispatchAction(i);
|
|
677
677
|
}, [i, t]);
|
|
678
678
|
if (!r) return null;
|
|
679
|
-
let o =
|
|
679
|
+
let o = Ke(r.props);
|
|
680
680
|
delete o.onInvokeId;
|
|
681
|
-
let s =
|
|
681
|
+
let s = Ue(R(r.props?.className), n), c = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
682
682
|
return /* @__PURE__ */ P("div", {
|
|
683
683
|
...o,
|
|
684
684
|
"data-ikon-node-id": r.id,
|
|
@@ -690,7 +690,7 @@ function Xe() {
|
|
|
690
690
|
onKeyDown: i ? (e) => {
|
|
691
691
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
|
|
692
692
|
} : void 0,
|
|
693
|
-
style:
|
|
693
|
+
style: Ge(o.style, i ? "pointer" : void 0),
|
|
694
694
|
children: c
|
|
695
695
|
});
|
|
696
696
|
});
|
|
@@ -698,11 +698,11 @@ function Xe() {
|
|
|
698
698
|
if (t === "std.div") return e;
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
let e =
|
|
701
|
+
function nt() {
|
|
702
|
+
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
703
703
|
let r = I(t.store, e);
|
|
704
704
|
if (!r) return null;
|
|
705
|
-
let i =
|
|
705
|
+
let i = Ke(r.props), a = Ue("relative", R(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
706
706
|
return /* @__PURE__ */ P("div", {
|
|
707
707
|
...i,
|
|
708
708
|
"data-ikon-node-id": r.id,
|
|
@@ -715,11 +715,11 @@ function Ze() {
|
|
|
715
715
|
if (t === "std.stack") return e;
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
|
-
function
|
|
719
|
-
let e =
|
|
718
|
+
function rt() {
|
|
719
|
+
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
720
720
|
let r = I(t.store, e);
|
|
721
721
|
if (!r) return null;
|
|
722
|
-
let i =
|
|
722
|
+
let i = Ke(r.props), a = Ue("absolute", R(r.props?.className), n), o = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
723
723
|
return /* @__PURE__ */ P("div", {
|
|
724
724
|
...i,
|
|
725
725
|
"data-ikon-node-id": r.id,
|
|
@@ -732,23 +732,23 @@ function Qe() {
|
|
|
732
732
|
if (t === "std.layer") return e;
|
|
733
733
|
};
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function it() {
|
|
736
736
|
return [
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
737
|
+
tt(),
|
|
738
|
+
nt(),
|
|
739
|
+
rt(),
|
|
740
|
+
et()
|
|
741
741
|
];
|
|
742
742
|
}
|
|
743
743
|
//#endregion
|
|
744
744
|
//#region src/base/base-module.ts
|
|
745
|
-
var
|
|
746
|
-
function
|
|
747
|
-
e.registerModule(
|
|
745
|
+
var at = "base", ot = async () => it();
|
|
746
|
+
function st(e) {
|
|
747
|
+
e.registerModule(at, ot);
|
|
748
748
|
}
|
|
749
749
|
//#endregion
|
|
750
750
|
//#region src/media/audio-player.tsx
|
|
751
|
-
function
|
|
751
|
+
function ct(e) {
|
|
752
752
|
if (typeof e == "string") {
|
|
753
753
|
let t = e.trim();
|
|
754
754
|
return t.length > 0 ? t : void 0;
|
|
@@ -758,17 +758,17 @@ function rt(e) {
|
|
|
758
758
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function lt(...e) {
|
|
762
762
|
let t = [];
|
|
763
763
|
for (let n of e) n && n.trim() && t.push(n.trim());
|
|
764
764
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function ut(e) {
|
|
767
767
|
if (typeof e != "string") return;
|
|
768
768
|
let t = e.trim();
|
|
769
769
|
return t.length > 0 ? t : void 0;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function dt(e) {
|
|
772
772
|
if (typeof e == "boolean") return e;
|
|
773
773
|
if (typeof e == "string") {
|
|
774
774
|
let t = e.trim().toLowerCase();
|
|
@@ -776,13 +776,13 @@ function ot(e) {
|
|
|
776
776
|
if (t === "false") return !1;
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
|
-
function
|
|
780
|
-
let e =
|
|
781
|
-
let r = I(t.store, e), i =
|
|
782
|
-
if (
|
|
779
|
+
function ft() {
|
|
780
|
+
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
781
|
+
let r = I(t.store, e), i = j(null), a = r ? dt(r.props?.autoplay) : void 0, o = r ? ut(r.props?.src) : void 0;
|
|
782
|
+
if (k(() => {
|
|
783
783
|
a && i.current && i.current.play().catch(() => {});
|
|
784
784
|
}, [a, o]), !r) return null;
|
|
785
|
-
let s =
|
|
785
|
+
let s = lt(ct(r.props?.className), n), c = ut(r.props?.preload), l = dt(r.props?.controls), u = dt(r.props?.loop), d = dt(r.props?.muted);
|
|
786
786
|
return /* @__PURE__ */ P("audio", {
|
|
787
787
|
ref: i,
|
|
788
788
|
src: o,
|
|
@@ -802,7 +802,7 @@ function st() {
|
|
|
802
802
|
}
|
|
803
803
|
//#endregion
|
|
804
804
|
//#region src/media/video-canvas.tsx
|
|
805
|
-
function
|
|
805
|
+
function pt(e) {
|
|
806
806
|
if (typeof e == "string") {
|
|
807
807
|
let t = e.trim();
|
|
808
808
|
return t.length > 0 ? t : void 0;
|
|
@@ -812,28 +812,28 @@ function ct(e) {
|
|
|
812
812
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function mt(...e) {
|
|
816
816
|
let t = [];
|
|
817
817
|
for (let n of e) n && n.trim() && t.push(n.trim());
|
|
818
818
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function ht(e) {
|
|
821
821
|
if (typeof e == "number" && Number.isFinite(e)) return Math.floor(e);
|
|
822
822
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
823
823
|
let t = Number(e);
|
|
824
824
|
if (Number.isFinite(t)) return Math.floor(t);
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function gt(e) {
|
|
828
828
|
if (typeof e != "string") return;
|
|
829
829
|
let t = e.trim();
|
|
830
830
|
return t.length > 0 ? t : void 0;
|
|
831
831
|
}
|
|
832
|
-
var
|
|
833
|
-
function
|
|
834
|
-
let e =
|
|
835
|
-
let r = I(t.store, e), i =
|
|
836
|
-
|
|
832
|
+
var _t = v("IkonVideoCanvas"), vt = 100, yt = 50, bt = "std.video-canvas", xt = "std.video-url-player";
|
|
833
|
+
function St() {
|
|
834
|
+
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
835
|
+
let r = I(t.store, e), i = j(null), a = j(null), o = t.client, s = r ? gt(r.props?.streamId) : void 0, c = r ? ht(r.props?.width) : void 0, l = r ? ht(r.props?.height) : void 0, u = r ? mt(pt(r.props?.className), n) : n, [, d] = M(0);
|
|
836
|
+
k(() => {
|
|
837
837
|
if (!o?.isWebRtcEnabled) return;
|
|
838
838
|
let e = o.onWebRtcTrackMapChanged;
|
|
839
839
|
return o.onWebRtcTrackMapChanged = (t) => {
|
|
@@ -843,22 +843,22 @@ function _t() {
|
|
|
843
843
|
};
|
|
844
844
|
}, [o]);
|
|
845
845
|
let f = o?.isWebRtcEnabled && s ? o.getWebRtcVideoStreamByStreamId(s) : null;
|
|
846
|
-
return
|
|
846
|
+
return k(() => {
|
|
847
847
|
let e = i.current;
|
|
848
848
|
if (!e || !s || f) return;
|
|
849
849
|
let n = !1, r, a = 0, o = () => {
|
|
850
850
|
if (n) return;
|
|
851
851
|
let i = t.video ?? t.client?.media?.video;
|
|
852
852
|
if (!i) {
|
|
853
|
-
if (a++ >=
|
|
854
|
-
|
|
853
|
+
if (a++ >= yt) {
|
|
854
|
+
_t.warn(`Gave up attaching the canvas for stream ${s}: video playback never became available`);
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
|
-
r = setTimeout(o,
|
|
857
|
+
r = setTimeout(o, vt);
|
|
858
858
|
return;
|
|
859
859
|
}
|
|
860
860
|
i.attachCanvas(s, e).catch((e) => {
|
|
861
|
-
|
|
861
|
+
_t.error(`Failed to attach the canvas for stream ${s}, it will stay blank: ${String(e)}`);
|
|
862
862
|
});
|
|
863
863
|
};
|
|
864
864
|
return o(), () => {
|
|
@@ -868,7 +868,7 @@ function _t() {
|
|
|
868
868
|
t,
|
|
869
869
|
s,
|
|
870
870
|
f
|
|
871
|
-
]),
|
|
871
|
+
]), k(() => {
|
|
872
872
|
let e = a.current;
|
|
873
873
|
if (!(!e || !f)) return e.srcObject = f, () => {
|
|
874
874
|
e.srcObject = null;
|
|
@@ -898,14 +898,14 @@ function _t() {
|
|
|
898
898
|
if (t === "std.video-canvas") return e;
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function Ct() {
|
|
902
902
|
return [
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
903
|
+
St(),
|
|
904
|
+
Tt(),
|
|
905
|
+
ft()
|
|
906
906
|
];
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function wt(e) {
|
|
909
909
|
if (typeof e == "boolean") return e;
|
|
910
910
|
if (typeof e == "string") {
|
|
911
911
|
let t = e.trim().toLowerCase();
|
|
@@ -913,13 +913,13 @@ function yt(e) {
|
|
|
913
913
|
if (t === "false") return !1;
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
|
-
function
|
|
917
|
-
let e =
|
|
918
|
-
let r = I(t.store, e), i =
|
|
919
|
-
if (
|
|
916
|
+
function Tt() {
|
|
917
|
+
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
918
|
+
let r = I(t.store, e), i = j(null), a = r ? wt(r.props?.autoplay) : void 0, o = r ? gt(r.props?.src) : void 0;
|
|
919
|
+
if (k(() => {
|
|
920
920
|
a && i.current && i.current.play().catch(() => {});
|
|
921
921
|
}, [a, o]), !r) return null;
|
|
922
|
-
let s =
|
|
922
|
+
let s = mt(pt(r.props?.className), n), c = gt(r.props?.poster), l = wt(r.props?.controls), u = wt(r.props?.loop), d = wt(r.props?.muted), f = wt(r.props?.playsInline), p = ht(r.props?.width), m = ht(r.props?.height), h = r.children?.length ? t.renderChildren(r.children) : void 0;
|
|
923
923
|
return /* @__PURE__ */ P("video", {
|
|
924
924
|
ref: i,
|
|
925
925
|
src: o,
|
|
@@ -943,20 +943,20 @@ function bt() {
|
|
|
943
943
|
}
|
|
944
944
|
//#endregion
|
|
945
945
|
//#region src/media/media-module.ts
|
|
946
|
-
var
|
|
947
|
-
function
|
|
948
|
-
e.registerModule(
|
|
946
|
+
var Et = "media", Dt = async () => Ct();
|
|
947
|
+
function Ot(e) {
|
|
948
|
+
e.registerModule(Et, Dt);
|
|
949
949
|
}
|
|
950
950
|
//#endregion
|
|
951
951
|
//#region src/shadertoy/shadertoy-gl.ts
|
|
952
|
-
var
|
|
953
|
-
function
|
|
952
|
+
var kt = "#version 300 es\nin vec4 a_position;\nvoid main() {\n gl_Position = a_position;\n}\n", At = 4;
|
|
953
|
+
function jt(e, t) {
|
|
954
954
|
return RegExp(`\\buniform\\s+\\w+\\s+${t}\\s*;`, "g").test(e);
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Mt(e, t) {
|
|
957
957
|
let n = [];
|
|
958
958
|
for (let [r, i] of Object.entries(t)) {
|
|
959
|
-
if (
|
|
959
|
+
if (jt(e, r)) continue;
|
|
960
960
|
let t;
|
|
961
961
|
switch (i.type) {
|
|
962
962
|
case "float":
|
|
@@ -1014,7 +1014,7 @@ void main() {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
`;
|
|
1016
1016
|
}
|
|
1017
|
-
var
|
|
1017
|
+
var Nt = class {
|
|
1018
1018
|
gl;
|
|
1019
1019
|
program = null;
|
|
1020
1020
|
positionBuffer = null;
|
|
@@ -1030,7 +1030,7 @@ var Ot = class {
|
|
|
1030
1030
|
mouseClickY = 0;
|
|
1031
1031
|
channels = [];
|
|
1032
1032
|
channelResolution = /* @__PURE__ */ new Float32Array(12);
|
|
1033
|
-
channelTime = new Float32Array(
|
|
1033
|
+
channelTime = new Float32Array(At);
|
|
1034
1034
|
lastError = null;
|
|
1035
1035
|
currentShaderSource = "";
|
|
1036
1036
|
constructor(e) {
|
|
@@ -1065,7 +1065,7 @@ var Ot = class {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
initializeChannels() {
|
|
1067
1067
|
let e = this.gl;
|
|
1068
|
-
for (let t = 0; t <
|
|
1068
|
+
for (let t = 0; t < At; t++) {
|
|
1069
1069
|
let t = e.createTexture();
|
|
1070
1070
|
e.bindTexture(e.TEXTURE_2D, t), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([
|
|
1071
1071
|
0,
|
|
@@ -1082,7 +1082,7 @@ var Ot = class {
|
|
|
1082
1082
|
e.bindTexture(e.TEXTURE_2D, null);
|
|
1083
1083
|
}
|
|
1084
1084
|
setChannels(e) {
|
|
1085
|
-
for (let t = 0; t <
|
|
1085
|
+
for (let t = 0; t < At; t++) {
|
|
1086
1086
|
let n = e[t] ?? null, r = this.channels[t];
|
|
1087
1087
|
if (r.url !== n) {
|
|
1088
1088
|
if (r.url = n, !n) {
|
|
@@ -1113,9 +1113,9 @@ var Ot = class {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
compile(e, t = {}) {
|
|
1115
1115
|
this.lastError = null, this.customUniforms = t, this.currentShaderSource = e;
|
|
1116
|
-
let n = this.gl, r = this.compileShader(n.VERTEX_SHADER,
|
|
1116
|
+
let n = this.gl, r = this.compileShader(n.VERTEX_SHADER, kt);
|
|
1117
1117
|
if (!r) return !1;
|
|
1118
|
-
let i =
|
|
1118
|
+
let i = Mt(e, t), a = this.compileShader(n.FRAGMENT_SHADER, i);
|
|
1119
1119
|
if (!a) return n.deleteShader(r), !1;
|
|
1120
1120
|
let o = n.createProgram();
|
|
1121
1121
|
return o ? (n.attachShader(o, r), n.attachShader(o, a), n.linkProgram(o), n.deleteShader(r), n.deleteShader(a), n.getProgramParameter(o, n.LINK_STATUS) ? (this.program && n.deleteProgram(this.program), this.program = o, this.cacheUniformLocations(), !0) : (this.lastError = n.getProgramInfoLog(o) || "Program link failed", n.deleteProgram(o), !1)) : (this.lastError = "Failed to create program", n.deleteShader(r), n.deleteShader(a), !1);
|
|
@@ -1139,7 +1139,7 @@ var Ot = class {
|
|
|
1139
1139
|
"iMouse",
|
|
1140
1140
|
"iDate"
|
|
1141
1141
|
]) this.uniformLocations.set(t, e.getUniformLocation(this.program, t));
|
|
1142
|
-
for (let t = 0; t <
|
|
1142
|
+
for (let t = 0; t < At; t++) this.uniformLocations.set(`iChannel${t}`, e.getUniformLocation(this.program, `iChannel${t}`));
|
|
1143
1143
|
this.uniformLocations.set("iChannelResolution", e.getUniformLocation(this.program, "iChannelResolution[0]")), this.uniformLocations.set("iChannelTime", e.getUniformLocation(this.program, "iChannelTime[0]"));
|
|
1144
1144
|
for (let t of Object.keys(this.customUniforms)) this.uniformLocations.set(t, e.getUniformLocation(this.program, t));
|
|
1145
1145
|
}
|
|
@@ -1171,7 +1171,7 @@ var Ot = class {
|
|
|
1171
1171
|
let t = /* @__PURE__ */ new Date();
|
|
1172
1172
|
e.uniform4f(p, t.getFullYear(), t.getMonth(), t.getDate(), t.getHours() * 3600 + t.getMinutes() * 60 + t.getSeconds() + t.getMilliseconds() / 1e3);
|
|
1173
1173
|
}
|
|
1174
|
-
for (let t = 0; t <
|
|
1174
|
+
for (let t = 0; t < At; t++) {
|
|
1175
1175
|
e.activeTexture(e.TEXTURE0 + t), e.bindTexture(e.TEXTURE_2D, this.channels[t].texture);
|
|
1176
1176
|
let n = this.uniformLocations.get(`iChannel${t}`);
|
|
1177
1177
|
n && e.uniform1i(n, t);
|
|
@@ -1221,7 +1221,7 @@ var Ot = class {
|
|
|
1221
1221
|
};
|
|
1222
1222
|
//#endregion
|
|
1223
1223
|
//#region src/shadertoy/shadertoy-renderer.tsx
|
|
1224
|
-
function
|
|
1224
|
+
function Pt(e) {
|
|
1225
1225
|
if (typeof e == "string") {
|
|
1226
1226
|
let t = e.trim();
|
|
1227
1227
|
return t.length > 0 ? t : void 0;
|
|
@@ -1231,22 +1231,22 @@ function kt(e) {
|
|
|
1231
1231
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function Ft(...e) {
|
|
1235
1235
|
let t = [];
|
|
1236
1236
|
for (let n of e) n && n.trim() && t.push(n.trim());
|
|
1237
1237
|
return t.length > 0 ? t.join(" ") : void 0;
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function It(e) {
|
|
1240
1240
|
if (typeof e == "number" && Number.isFinite(e)) return Math.floor(e);
|
|
1241
1241
|
if (typeof e == "string" && e.trim().length > 0) {
|
|
1242
1242
|
let t = Number(e);
|
|
1243
1243
|
if (Number.isFinite(t)) return Math.floor(t);
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function Lt(e) {
|
|
1247
1247
|
return typeof e == "string" ? e : "";
|
|
1248
1248
|
}
|
|
1249
|
-
function
|
|
1249
|
+
function Rt(e) {
|
|
1250
1250
|
if (typeof e == "boolean") return e;
|
|
1251
1251
|
if (typeof e == "string") {
|
|
1252
1252
|
let t = e.trim().toLowerCase();
|
|
@@ -1254,7 +1254,7 @@ function Nt(e) {
|
|
|
1254
1254
|
if (t === "false") return !1;
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function zt(e) {
|
|
1258
1258
|
if (!e || typeof e != "object") return {};
|
|
1259
1259
|
let t = {}, n = e;
|
|
1260
1260
|
for (let [e, r] of Object.entries(n)) {
|
|
@@ -1274,10 +1274,10 @@ function Pt(e) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
return t;
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function Bt(e) {
|
|
1278
1278
|
return Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : null) : [];
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function Vt(e, t) {
|
|
1281
1281
|
let n = Object.keys(e), r = Object.keys(t);
|
|
1282
1282
|
if (n.length !== r.length) return !1;
|
|
1283
1283
|
for (let r of n) {
|
|
@@ -1291,21 +1291,21 @@ function It(e, t) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
return !0;
|
|
1293
1293
|
}
|
|
1294
|
-
var
|
|
1295
|
-
function
|
|
1296
|
-
let e =
|
|
1297
|
-
let r = I(t.store, e), i =
|
|
1294
|
+
var Ht = "std.shadertoy-canvas";
|
|
1295
|
+
function Ut() {
|
|
1296
|
+
let e = D(function({ nodeId: e, context: t, className: n }) {
|
|
1297
|
+
let r = I(t.store, e), i = j(null), a = j(null), o = j(null), s = j(0), c = j(""), l = j({}), u = j({
|
|
1298
1298
|
x: 0,
|
|
1299
1299
|
y: 0,
|
|
1300
1300
|
clickX: 0,
|
|
1301
1301
|
clickY: 0,
|
|
1302
1302
|
isDown: !1
|
|
1303
|
-
}), d = r ?
|
|
1304
|
-
|
|
1303
|
+
}), d = r ? Lt(r.props?.shaderSource) : "", f = r ? It(r.props?.fps) ?? 60 : 60, p = r?.props?.uniforms, m = A(() => zt(p), [p]), h = r?.props?.channels, g = A(() => Bt(h), [h]), _ = r ? Rt(r.props?.enableMouse) ?? !0 : !0, v = r ? It(r.props?.width) : void 0, y = r ? It(r.props?.height) : void 0, b = r ? Ft(Pt(r.props?.className), n) : n;
|
|
1304
|
+
k(() => {
|
|
1305
1305
|
let e = i.current;
|
|
1306
1306
|
if (e) {
|
|
1307
1307
|
try {
|
|
1308
|
-
let t = new
|
|
1308
|
+
let t = new Nt(e);
|
|
1309
1309
|
a.current = t;
|
|
1310
1310
|
} catch (e) {
|
|
1311
1311
|
console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", e);
|
|
@@ -1314,20 +1314,20 @@ function Rt() {
|
|
|
1314
1314
|
a.current &&= (a.current.destroy(), null);
|
|
1315
1315
|
};
|
|
1316
1316
|
}
|
|
1317
|
-
}, []),
|
|
1317
|
+
}, []), k(() => {
|
|
1318
1318
|
let e = a.current;
|
|
1319
1319
|
if (!(!e || !d) && c.current !== d) if (e.compile(d, m)) c.current = d, l.current = m;
|
|
1320
1320
|
else {
|
|
1321
1321
|
let t = e.getError();
|
|
1322
1322
|
console.error("[ShadertoyRenderer] Shader compilation failed:", t);
|
|
1323
1323
|
}
|
|
1324
|
-
}, [d, m]),
|
|
1324
|
+
}, [d, m]), k(() => {
|
|
1325
1325
|
let e = a.current;
|
|
1326
|
-
!e || !c.current ||
|
|
1327
|
-
}, [m]),
|
|
1326
|
+
!e || !c.current || Vt(l.current, m) || (e.setCustomUniforms(m), l.current = m);
|
|
1327
|
+
}, [m]), k(() => {
|
|
1328
1328
|
let e = a.current;
|
|
1329
1329
|
e && e.setChannels(g);
|
|
1330
|
-
}, [g]),
|
|
1330
|
+
}, [g]), k(() => {
|
|
1331
1331
|
let e = a.current;
|
|
1332
1332
|
if (!e || !c.current) return;
|
|
1333
1333
|
let t = 1e3 / f, n = (r) => {
|
|
@@ -1338,32 +1338,32 @@ function Rt() {
|
|
|
1338
1338
|
o.current !== null && (cancelAnimationFrame(o.current), o.current = null);
|
|
1339
1339
|
};
|
|
1340
1340
|
}, [f]);
|
|
1341
|
-
let
|
|
1341
|
+
let x = O((e) => {
|
|
1342
1342
|
if (!_) return;
|
|
1343
1343
|
let t = i.current, n = a.current;
|
|
1344
1344
|
if (!t || !n) return;
|
|
1345
1345
|
let r = window.devicePixelRatio || 1, o = t.getBoundingClientRect(), s = (e.clientX - o.left) * r, c = (o.height - (e.clientY - o.top)) * r;
|
|
1346
1346
|
u.current.x = s, u.current.y = c, n.setMouse(s, c, u.current.clickX, u.current.clickY);
|
|
1347
|
-
}, [_]),
|
|
1347
|
+
}, [_]), S = O((e) => {
|
|
1348
1348
|
if (!_) return;
|
|
1349
1349
|
let t = i.current, n = a.current;
|
|
1350
1350
|
if (!t || !n) return;
|
|
1351
1351
|
let r = window.devicePixelRatio || 1, o = t.getBoundingClientRect(), s = (e.clientX - o.left) * r, c = (o.height - (e.clientY - o.top)) * r;
|
|
1352
1352
|
u.current.isDown = !0, u.current.clickX = s, u.current.clickY = c, n.setMouse(s, c, s, c);
|
|
1353
|
-
}, [_]),
|
|
1353
|
+
}, [_]), ee = O(() => {
|
|
1354
1354
|
_ && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
|
|
1355
1355
|
}, [_]);
|
|
1356
1356
|
return r ? /* @__PURE__ */ P("canvas", {
|
|
1357
1357
|
ref: i,
|
|
1358
1358
|
"data-ikon-node-id": r.id,
|
|
1359
1359
|
"data-ikon-source": r.sourceMarker,
|
|
1360
|
-
className:
|
|
1360
|
+
className: b,
|
|
1361
1361
|
...v ? { width: v } : {},
|
|
1362
1362
|
...y ? { height: y } : {},
|
|
1363
|
-
onMouseMove:
|
|
1364
|
-
onMouseDown:
|
|
1365
|
-
onMouseUp:
|
|
1366
|
-
onMouseLeave:
|
|
1363
|
+
onMouseMove: x,
|
|
1364
|
+
onMouseDown: S,
|
|
1365
|
+
onMouseUp: ee,
|
|
1366
|
+
onMouseLeave: ee
|
|
1367
1367
|
}) : null;
|
|
1368
1368
|
});
|
|
1369
1369
|
return ({ type: t }) => {
|
|
@@ -1372,13 +1372,13 @@ function Rt() {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
//#endregion
|
|
1374
1374
|
//#region src/shadertoy/shadertoy-module.ts
|
|
1375
|
-
var
|
|
1376
|
-
function
|
|
1377
|
-
e.registerModule(
|
|
1375
|
+
var Wt = "shadertoy", Gt = async () => Ut();
|
|
1376
|
+
function Kt(e) {
|
|
1377
|
+
e.registerModule(Wt, Gt);
|
|
1378
1378
|
}
|
|
1379
1379
|
//#endregion
|
|
1380
1380
|
//#region src/ikon-ui-registry.ts
|
|
1381
|
-
var
|
|
1381
|
+
var qt = v("UIRegistry"), Jt = class {
|
|
1382
1382
|
baseResolvers = [];
|
|
1383
1383
|
moduleLoaders = /* @__PURE__ */ new Map();
|
|
1384
1384
|
moduleResolvers = /* @__PURE__ */ new Map();
|
|
@@ -1404,14 +1404,14 @@ var Ht = v("UIRegistry"), Ut = class {
|
|
|
1404
1404
|
async loadRegisteredModules() {
|
|
1405
1405
|
let e = !1;
|
|
1406
1406
|
for (let [t, n] of this.moduleLoaders.entries()) if (!this.moduleResolvers.has(t)) try {
|
|
1407
|
-
let r =
|
|
1407
|
+
let r = Zt(await n());
|
|
1408
1408
|
this.moduleResolvers.set(t, r), e = !0;
|
|
1409
1409
|
} catch (e) {
|
|
1410
|
-
|
|
1410
|
+
qt.error(`[IkonUiRegistry] Failed to load module '${t}'.`, e);
|
|
1411
1411
|
}
|
|
1412
1412
|
let t = [];
|
|
1413
1413
|
for (let e of this.moduleLoaders.keys()) this.moduleResolvers.has(e) && t.push(e);
|
|
1414
|
-
return
|
|
1414
|
+
return Qt(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e && this.notify(), e;
|
|
1415
1415
|
}
|
|
1416
1416
|
resolve(e) {
|
|
1417
1417
|
for (let t of this.baseResolvers) {
|
|
@@ -1421,7 +1421,7 @@ var Ht = v("UIRegistry"), Ut = class {
|
|
|
1421
1421
|
for (let t of this.activeModuleOrder) {
|
|
1422
1422
|
let n = this.moduleResolvers.get(t);
|
|
1423
1423
|
if (!n) {
|
|
1424
|
-
|
|
1424
|
+
qt.warn(`Missing resolvers for module ${t}`);
|
|
1425
1425
|
continue;
|
|
1426
1426
|
}
|
|
1427
1427
|
for (let t of n) {
|
|
@@ -1434,25 +1434,25 @@ var Ht = v("UIRegistry"), Ut = class {
|
|
|
1434
1434
|
for (let e of this.listeners) e();
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
|
-
function
|
|
1438
|
-
let e = new
|
|
1439
|
-
return
|
|
1437
|
+
function Yt() {
|
|
1438
|
+
let e = new Jt();
|
|
1439
|
+
return st(e), Ot(e), Kt(e), e.loadRegisteredModules(), e;
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function Xt(e) {
|
|
1442
1442
|
return Array.isArray(e) ? e : [e];
|
|
1443
1443
|
}
|
|
1444
|
-
function
|
|
1445
|
-
return e ?
|
|
1444
|
+
function Zt(e) {
|
|
1445
|
+
return e ? Xt(e).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1447
|
+
function Qt(e, t) {
|
|
1448
1448
|
if (e.length !== t.length) return !1;
|
|
1449
1449
|
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
1450
1450
|
return !0;
|
|
1451
1451
|
}
|
|
1452
1452
|
//#endregion
|
|
1453
1453
|
//#region src/parallax-view.tsx
|
|
1454
|
-
function
|
|
1455
|
-
return /* @__PURE__ */ P(
|
|
1454
|
+
function $t({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
|
|
1455
|
+
return /* @__PURE__ */ P(Be, {
|
|
1456
1456
|
stores: t,
|
|
1457
1457
|
registry: n,
|
|
1458
1458
|
category: e,
|
|
@@ -1462,7 +1462,7 @@ function Jt({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
|
|
|
1462
1462
|
}
|
|
1463
1463
|
//#endregion
|
|
1464
1464
|
//#region src/motion/motion-controller.ts
|
|
1465
|
-
var
|
|
1465
|
+
var en = v("MotionController"), tn = {
|
|
1466
1466
|
ease: [
|
|
1467
1467
|
.25,
|
|
1468
1468
|
.1,
|
|
@@ -1635,17 +1635,17 @@ var Yt = v("MotionController"), Xt = {
|
|
|
1635
1635
|
function G(e) {
|
|
1636
1636
|
return e <= 0 ? 0 : e >= 1 ? 1 : e;
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1638
|
+
function nn(e) {
|
|
1639
1639
|
if (e == null) return;
|
|
1640
1640
|
let t = e.trim();
|
|
1641
1641
|
if (!t) return;
|
|
1642
1642
|
let n = Number.parseFloat(t);
|
|
1643
1643
|
return Number.isFinite(n) ? n : void 0;
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function rn(e) {
|
|
1646
1646
|
return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
1647
1647
|
}
|
|
1648
|
-
function
|
|
1648
|
+
function an(e, t, n, r) {
|
|
1649
1649
|
let i = 1 / 10, a = /* @__PURE__ */ new Float32Array(11);
|
|
1650
1650
|
function o(e, t, n) {
|
|
1651
1651
|
return ((3 * t - 3 * n + 1) * e + (3 * n - 6 * t)) * e * e + 3 * t * e;
|
|
@@ -1679,34 +1679,34 @@ function $t(e, t, n, r) {
|
|
|
1679
1679
|
for (let t = 0; t < 11; t += 1) a[t] = o(t * i, e, n);
|
|
1680
1680
|
return (e) => e <= 0 ? 0 : e >= 1 ? 1 : o(u(e), t, r);
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1682
|
+
function on(e) {
|
|
1683
1683
|
let t = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(e);
|
|
1684
1684
|
if (!t) return (e) => G(e);
|
|
1685
1685
|
let n = Math.max(1, parseInt(t[1], 10)), r = (t[2] ?? "end").toLowerCase();
|
|
1686
1686
|
return r === "start" || r === "jump-start" ? (e) => G(Math.ceil(e * n) / n) : r === "none" || r === "jump-none" ? (e) => G(Math.round(e * n) / n) : r === "both" || r === "jump-both" ? (e) => G((Math.floor(e * n) + .5) / n) : (e) => G(Math.floor(e * n) / n);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function sn(e) {
|
|
1689
1689
|
if (!e) return (e) => G(e);
|
|
1690
1690
|
let t = e.trim().toLowerCase();
|
|
1691
1691
|
if (!t || t === "linear") return (e) => G(e);
|
|
1692
|
-
if (
|
|
1693
|
-
let [e, n, r, i] =
|
|
1692
|
+
if (tn[t]) {
|
|
1693
|
+
let [e, n, r, i] = tn[t], a = an(e, n, r, i);
|
|
1694
1694
|
return (e) => G(a(G(e)));
|
|
1695
1695
|
}
|
|
1696
1696
|
if (t.startsWith("cubic-bezier(") && t.endsWith(")")) {
|
|
1697
1697
|
let e = t.slice(13, -1).split(",").map((e) => Number.parseFloat(e.trim()));
|
|
1698
1698
|
if (e.length === 4 && e.every((e) => Number.isFinite(e))) {
|
|
1699
|
-
let [t, n, r, i] = e, a =
|
|
1699
|
+
let [t, n, r, i] = e, a = an(t, n, r, i);
|
|
1700
1700
|
return (e) => G(a(G(e)));
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
1703
1703
|
if (t.startsWith("steps(") && t.endsWith(")")) {
|
|
1704
|
-
let e =
|
|
1704
|
+
let e = on(t);
|
|
1705
1705
|
return (t) => e(G(t));
|
|
1706
1706
|
}
|
|
1707
1707
|
return (e) => G(e);
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1709
|
+
function cn(e) {
|
|
1710
1710
|
if (!e) return;
|
|
1711
1711
|
let t = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(e);
|
|
1712
1712
|
if (!t) return;
|
|
@@ -1723,7 +1723,7 @@ function nn(e) {
|
|
|
1723
1723
|
outEnd: a
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
|
-
var
|
|
1726
|
+
var ln = new class {
|
|
1727
1727
|
bindingsByStyle = /* @__PURE__ */ new Map();
|
|
1728
1728
|
observer;
|
|
1729
1729
|
observeScheduled = !1;
|
|
@@ -1748,7 +1748,7 @@ var rn = new class {
|
|
|
1748
1748
|
for (let e of Array.from(this.globalCleanups)) try {
|
|
1749
1749
|
e();
|
|
1750
1750
|
} catch (e) {
|
|
1751
|
-
|
|
1751
|
+
en.warn("Failed to cleanup binding listener", e);
|
|
1752
1752
|
}
|
|
1753
1753
|
this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer &&= (this.observer.disconnect(), void 0);
|
|
1754
1754
|
}
|
|
@@ -1757,14 +1757,14 @@ var rn = new class {
|
|
|
1757
1757
|
let t = (JSON.parse(e).motionBindings ?? []).map((e) => this.parseBinding(e)).filter((e) => e !== void 0);
|
|
1758
1758
|
return t.length === 0 ? void 0 : { bindings: t };
|
|
1759
1759
|
} catch (e) {
|
|
1760
|
-
|
|
1760
|
+
en.warn("Failed to parse motion metadata", e);
|
|
1761
1761
|
return;
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
1764
|
parseBinding(e) {
|
|
1765
1765
|
let t = e.source?.trim();
|
|
1766
1766
|
if (!t) return;
|
|
1767
|
-
let n =
|
|
1767
|
+
let n = nn(e.min) ?? 0, r = nn(e.max), i = r === void 0 ? n + 100 : r, a = (e.clamp ?? "clamp").trim().toLowerCase(), o = !!e.reverse, s = sn(e.ease), c = cn(e.map), l = e.targetId?.trim() || void 0;
|
|
1768
1768
|
if (!(Number.isNaN(n) || Number.isNaN(i))) return {
|
|
1769
1769
|
source: t.toLowerCase(),
|
|
1770
1770
|
min: n,
|
|
@@ -1810,7 +1810,7 @@ var rn = new class {
|
|
|
1810
1810
|
scanExistingNodes(e) {
|
|
1811
1811
|
let t = this.bindingsByStyle.get(e);
|
|
1812
1812
|
if (!t || typeof document > "u") return;
|
|
1813
|
-
let n = `.${
|
|
1813
|
+
let n = `.${rn(e)}`;
|
|
1814
1814
|
document.querySelectorAll(n).forEach((n) => this.applyStyleToElement(n, e, t));
|
|
1815
1815
|
}
|
|
1816
1816
|
applyStyleToElement(e, t, n) {
|
|
@@ -1846,7 +1846,7 @@ var rn = new class {
|
|
|
1846
1846
|
}
|
|
1847
1847
|
resolveScrollContainer(e, t) {
|
|
1848
1848
|
if (t.targetId) {
|
|
1849
|
-
let e = `[data-ikon-motion-source="${
|
|
1849
|
+
let e = `[data-ikon-motion-source="${rn(t.targetId)}"]`, n = typeof document < "u" ? document.querySelector(e) : null;
|
|
1850
1850
|
if (n) return n;
|
|
1851
1851
|
}
|
|
1852
1852
|
return e.closest("[data-ikon-view-type=\"scroll-view\"]");
|
|
@@ -1901,7 +1901,7 @@ var rn = new class {
|
|
|
1901
1901
|
try {
|
|
1902
1902
|
e();
|
|
1903
1903
|
} catch (e) {
|
|
1904
|
-
|
|
1904
|
+
en.warn("Failed to cleanup listener", e);
|
|
1905
1905
|
}
|
|
1906
1906
|
this.globalCleanups.delete(e);
|
|
1907
1907
|
}
|
|
@@ -1941,28 +1941,28 @@ var rn = new class {
|
|
|
1941
1941
|
}();
|
|
1942
1942
|
//#endregion
|
|
1943
1943
|
//#region src/use-ikon-styles.ts
|
|
1944
|
-
function
|
|
1945
|
-
let t =
|
|
1944
|
+
function un(e) {
|
|
1945
|
+
let t = j(/* @__PURE__ */ new Map()), n = O(({ styleId: e, css: n, common: r }) => {
|
|
1946
1946
|
if (!(!e || typeof document > "u")) {
|
|
1947
1947
|
if (n) {
|
|
1948
1948
|
let r = t.current.get(e);
|
|
1949
1949
|
r || (r = document.createElement("style"), r.setAttribute("data-ikon-style-id", e), document.head.appendChild(r), t.current.set(e, r)), r.textContent = n;
|
|
1950
1950
|
}
|
|
1951
|
-
|
|
1951
|
+
ln.registerStyle(e, r);
|
|
1952
1952
|
}
|
|
1953
|
-
}, []), r =
|
|
1953
|
+
}, []), r = O((e) => {
|
|
1954
1954
|
if (!(typeof document > "u")) for (let n of e) {
|
|
1955
1955
|
let e = t.current.get(n);
|
|
1956
|
-
e && (e.remove(), t.current.delete(n)),
|
|
1956
|
+
e && (e.remove(), t.current.delete(n)), ln.unregisterStyle(n);
|
|
1957
1957
|
}
|
|
1958
|
-
}, []), i =
|
|
1958
|
+
}, []), i = O(() => {
|
|
1959
1959
|
if (typeof document < "u") {
|
|
1960
1960
|
for (let e of t.current.values()) e.remove();
|
|
1961
1961
|
t.current.clear();
|
|
1962
1962
|
}
|
|
1963
|
-
|
|
1963
|
+
ln.reset();
|
|
1964
1964
|
}, []);
|
|
1965
|
-
return
|
|
1965
|
+
return k(() => {
|
|
1966
1966
|
if (!e) return;
|
|
1967
1967
|
for (let t of e.getUiStyles()) n(t);
|
|
1968
1968
|
let t = e.subscribeToStyles(n), a = e.subscribeToStyleDeletes?.(r);
|
|
@@ -1974,7 +1974,7 @@ function an(e) {
|
|
|
1974
1974
|
i,
|
|
1975
1975
|
n,
|
|
1976
1976
|
r
|
|
1977
|
-
]),
|
|
1977
|
+
]), k(() => () => i(), [i]), {
|
|
1978
1978
|
setStyle: n,
|
|
1979
1979
|
deleteStyles: r,
|
|
1980
1980
|
reset: i
|
|
@@ -1982,7 +1982,7 @@ function an(e) {
|
|
|
1982
1982
|
}
|
|
1983
1983
|
//#endregion
|
|
1984
1984
|
//#region src/use-ikon-ui-stores.ts
|
|
1985
|
-
function
|
|
1985
|
+
function dn(e) {
|
|
1986
1986
|
let t = [];
|
|
1987
1987
|
for (let [n, r] of e) {
|
|
1988
1988
|
let e = r.store.getSnapshot(), i = e.rootViewId && e.views.has(e.rootViewId);
|
|
@@ -1990,15 +1990,15 @@ function on(e) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
return t.sort(), t.join(",");
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1994
|
-
let [t, n] =
|
|
1995
|
-
return
|
|
1993
|
+
function fn(e) {
|
|
1994
|
+
let [t, n] = M(), r = j("");
|
|
1995
|
+
return k(() => {
|
|
1996
1996
|
if (!e) {
|
|
1997
1997
|
n(void 0), r.current = "";
|
|
1998
1998
|
return;
|
|
1999
1999
|
}
|
|
2000
2000
|
let t = () => {
|
|
2001
|
-
let t = e.getStores(), i =
|
|
2001
|
+
let t = e.getStores(), i = dn(t);
|
|
2002
2002
|
i !== r.current && (r.current = i, n(t));
|
|
2003
2003
|
};
|
|
2004
2004
|
return t(), e.subscribe(t);
|
|
@@ -2013,7 +2013,7 @@ var K = {
|
|
|
2013
2013
|
Line: 4,
|
|
2014
2014
|
Paragraph: 8,
|
|
2015
2015
|
Emoji: 16
|
|
2016
|
-
},
|
|
2016
|
+
}, pn = [
|
|
2017
2017
|
{
|
|
2018
2018
|
flag: K.Letter,
|
|
2019
2019
|
hints: [
|
|
@@ -2062,16 +2062,16 @@ var K = {
|
|
|
2062
2062
|
"[data-emoji]"
|
|
2063
2063
|
]
|
|
2064
2064
|
}
|
|
2065
|
-
],
|
|
2066
|
-
function
|
|
2067
|
-
if (!e || e.length >
|
|
2068
|
-
let n =
|
|
2065
|
+
], mn = K.Letter | K.Word | K.Line | K.Paragraph | K.Emoji, hn = K.Letter | K.Word | K.Line | K.Paragraph, gn = /* @__PURE__ */ new Map(), _n = 16384;
|
|
2066
|
+
function vn(e, t) {
|
|
2067
|
+
if (!e || e.length > _n) return e;
|
|
2068
|
+
let n = qn(t), r = Un(n, K.Emoji), i = n & hn;
|
|
2069
2069
|
if (i === K.None && !r) return e;
|
|
2070
2070
|
let a = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
2071
|
-
if (i === K.None) return
|
|
2072
|
-
let o =
|
|
2073
|
-
if (o.length === 0) return r ?
|
|
2074
|
-
let s =
|
|
2071
|
+
if (i === K.None) return Gn(a);
|
|
2072
|
+
let o = Vn(a);
|
|
2073
|
+
if (o.length === 0) return r ? Gn(a) : e;
|
|
2074
|
+
let s = Hn(o), c = {
|
|
2075
2075
|
letter: 0,
|
|
2076
2076
|
word: 0,
|
|
2077
2077
|
line: 0,
|
|
@@ -2080,58 +2080,58 @@ function pn(e, t) {
|
|
|
2080
2080
|
emoji: 0
|
|
2081
2081
|
}, l = [];
|
|
2082
2082
|
for (let e of s) {
|
|
2083
|
-
let t =
|
|
2083
|
+
let t = yn(e, n, c);
|
|
2084
2084
|
l.push(...t);
|
|
2085
2085
|
}
|
|
2086
2086
|
return l;
|
|
2087
2087
|
}
|
|
2088
|
-
function
|
|
2088
|
+
function yn(e, t, n) {
|
|
2089
2089
|
let r = [];
|
|
2090
2090
|
for (let i of e) {
|
|
2091
|
-
let e =
|
|
2091
|
+
let e = bn(i, t, n);
|
|
2092
2092
|
r.push(...e);
|
|
2093
2093
|
}
|
|
2094
|
-
if (
|
|
2094
|
+
if (Un(t, K.Paragraph)) {
|
|
2095
2095
|
let e = n.paragraph++;
|
|
2096
2096
|
return [/* @__PURE__ */ P("span", {
|
|
2097
2097
|
"data-motion-paragraph": !0,
|
|
2098
|
-
style:
|
|
2098
|
+
style: Wn(e),
|
|
2099
2099
|
children: r
|
|
2100
2100
|
}, `motion-paragraph-${e}`)];
|
|
2101
2101
|
}
|
|
2102
2102
|
return r;
|
|
2103
2103
|
}
|
|
2104
|
-
function
|
|
2105
|
-
let r =
|
|
2106
|
-
if (
|
|
2104
|
+
function bn(e, t, n) {
|
|
2105
|
+
let r = xn(e.text, t, n), i = [];
|
|
2106
|
+
if (Un(t, K.Line)) {
|
|
2107
2107
|
let e = n.line++;
|
|
2108
2108
|
i.push(/* @__PURE__ */ P("span", {
|
|
2109
2109
|
"data-motion-line": !0,
|
|
2110
|
-
style:
|
|
2110
|
+
style: Wn(e),
|
|
2111
2111
|
children: r
|
|
2112
2112
|
}, `motion-line-${e}`));
|
|
2113
2113
|
} else i.push(...r);
|
|
2114
2114
|
for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */ P("br", {}, `motion-break-${n.br++}`));
|
|
2115
2115
|
return i;
|
|
2116
2116
|
}
|
|
2117
|
-
function
|
|
2117
|
+
function xn(e, t, n) {
|
|
2118
2118
|
if (!e) return [];
|
|
2119
|
-
let r =
|
|
2119
|
+
let r = Un(t, K.Word), i = [], a = /(\s+)/g, o = 0, s;
|
|
2120
2120
|
for (; (s = a.exec(e)) !== null;) {
|
|
2121
2121
|
if (s.index > o) {
|
|
2122
2122
|
let a = e.slice(o, s.index);
|
|
2123
|
-
i.push(
|
|
2123
|
+
i.push(Sn(a, n, t, r));
|
|
2124
2124
|
}
|
|
2125
2125
|
i.push(s[0]), o = s.index + s[0].length;
|
|
2126
2126
|
}
|
|
2127
2127
|
if (o < e.length) {
|
|
2128
2128
|
let a = e.slice(o);
|
|
2129
|
-
i.push(
|
|
2129
|
+
i.push(Sn(a, n, t, r));
|
|
2130
2130
|
}
|
|
2131
2131
|
return i;
|
|
2132
2132
|
}
|
|
2133
|
-
function
|
|
2134
|
-
let i = t.word++, a =
|
|
2133
|
+
function Sn(e, t, n, r) {
|
|
2134
|
+
let i = t.word++, a = wn(e, n, t), o = `motion-word-${i}`, s = Cn(i, r);
|
|
2135
2135
|
return r ? /* @__PURE__ */ P("span", {
|
|
2136
2136
|
"data-motion-word": !0,
|
|
2137
2137
|
style: s,
|
|
@@ -2141,25 +2141,25 @@ function _n(e, t, n, r) {
|
|
|
2141
2141
|
children: a
|
|
2142
2142
|
}, o);
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function Cn(e, t) {
|
|
2145
2145
|
return t ? {
|
|
2146
|
-
...
|
|
2146
|
+
...Wn(e),
|
|
2147
2147
|
whiteSpace: "nowrap"
|
|
2148
2148
|
} : { whiteSpace: "nowrap" };
|
|
2149
2149
|
}
|
|
2150
|
-
function
|
|
2150
|
+
function wn(e, t, n) {
|
|
2151
2151
|
if (!e) return [];
|
|
2152
|
-
let r =
|
|
2152
|
+
let r = Un(t, K.Letter), i = Un(t, K.Emoji);
|
|
2153
2153
|
if (!r) {
|
|
2154
2154
|
if (!i) return [e];
|
|
2155
|
-
let t =
|
|
2155
|
+
let t = Tn(e);
|
|
2156
2156
|
if (t.length === 0) return [e];
|
|
2157
|
-
let { nodes: r } =
|
|
2157
|
+
let { nodes: r } = Kn(t, n);
|
|
2158
2158
|
return r;
|
|
2159
2159
|
}
|
|
2160
|
-
let a = [], o =
|
|
2160
|
+
let a = [], o = Tn(e);
|
|
2161
2161
|
for (let e of o) {
|
|
2162
|
-
let t = n.letter++, r = `motion-letter-${t}`, o =
|
|
2162
|
+
let t = n.letter++, r = `motion-letter-${t}`, o = Wn(t);
|
|
2163
2163
|
if (e === "\n") {
|
|
2164
2164
|
a.push(/* @__PURE__ */ P("span", {
|
|
2165
2165
|
"data-motion-letter": !0,
|
|
@@ -2168,7 +2168,7 @@ function yn(e, t, n) {
|
|
|
2168
2168
|
}, r));
|
|
2169
2169
|
continue;
|
|
2170
2170
|
}
|
|
2171
|
-
let s = i &&
|
|
2171
|
+
let s = i && Rn(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
|
|
2172
2172
|
a.push(/* @__PURE__ */ P("span", {
|
|
2173
2173
|
"data-motion-letter": !0,
|
|
2174
2174
|
style: o,
|
|
@@ -2178,46 +2178,46 @@ function yn(e, t, n) {
|
|
|
2178
2178
|
}
|
|
2179
2179
|
return a;
|
|
2180
2180
|
}
|
|
2181
|
-
function
|
|
2181
|
+
function Tn(e) {
|
|
2182
2182
|
if (!e) return [];
|
|
2183
|
-
let t =
|
|
2184
|
-
return t ? Array.from(t.segment(e), (e) => e.segment) :
|
|
2183
|
+
let t = Dn();
|
|
2184
|
+
return t ? Array.from(t.segment(e), (e) => e.segment) : On(e);
|
|
2185
2185
|
}
|
|
2186
|
-
var
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
2186
|
+
var En;
|
|
2187
|
+
function Dn() {
|
|
2188
|
+
return En === void 0 && (En = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), En;
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2190
|
+
function On(e) {
|
|
2191
2191
|
let t = [], n = Array.from(e), r = "";
|
|
2192
2192
|
for (let e = 0; e < n.length; e++) {
|
|
2193
2193
|
let i = n[e], a = n[e + 1];
|
|
2194
|
-
r += i, !(a &&
|
|
2194
|
+
r += i, !(a && kn(i, a)) && (t.push(r), r = "");
|
|
2195
2195
|
}
|
|
2196
2196
|
return r && t.push(r), t;
|
|
2197
2197
|
}
|
|
2198
|
-
function
|
|
2199
|
-
return t ? !!(
|
|
2198
|
+
function kn(e, t) {
|
|
2199
|
+
return t ? !!(An(e) || An(t) || Fn(t) || jn(t) || Mn(t) || Nn(e) && Nn(t)) : !1;
|
|
2200
2200
|
}
|
|
2201
|
-
function
|
|
2201
|
+
function An(e) {
|
|
2202
2202
|
return e.codePointAt(0) === 8205;
|
|
2203
2203
|
}
|
|
2204
|
-
function
|
|
2204
|
+
function jn(e) {
|
|
2205
2205
|
let t = e.codePointAt(0);
|
|
2206
2206
|
return t === void 0 ? !1 : t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999;
|
|
2207
2207
|
}
|
|
2208
|
-
function
|
|
2208
|
+
function Mn(e) {
|
|
2209
2209
|
let t = e.codePointAt(0);
|
|
2210
2210
|
return t !== void 0 && t >= 127995 && t <= 127999;
|
|
2211
2211
|
}
|
|
2212
|
-
function
|
|
2212
|
+
function Nn(e) {
|
|
2213
2213
|
let t = e.codePointAt(0);
|
|
2214
2214
|
return t !== void 0 && t >= 127462 && t <= 127487;
|
|
2215
2215
|
}
|
|
2216
|
-
var
|
|
2217
|
-
function
|
|
2218
|
-
return e ? (
|
|
2216
|
+
var Pn;
|
|
2217
|
+
function Fn(e) {
|
|
2218
|
+
return e ? (Pn ||= In(), Pn(e)) : !1;
|
|
2219
2219
|
}
|
|
2220
|
-
function
|
|
2220
|
+
function In() {
|
|
2221
2221
|
try {
|
|
2222
2222
|
let e = /\p{Mark}/u;
|
|
2223
2223
|
return (t) => e.test(t);
|
|
@@ -2228,19 +2228,19 @@ function jn() {
|
|
|
2228
2228
|
};
|
|
2229
2229
|
}
|
|
2230
2230
|
}
|
|
2231
|
-
var
|
|
2232
|
-
function
|
|
2233
|
-
return e ? (
|
|
2231
|
+
var Ln;
|
|
2232
|
+
function Rn(e) {
|
|
2233
|
+
return e ? (Ln ||= zn(), Ln(e)) : !1;
|
|
2234
2234
|
}
|
|
2235
|
-
function
|
|
2235
|
+
function zn() {
|
|
2236
2236
|
try {
|
|
2237
2237
|
let e = /\p{Extended_Pictographic}/u;
|
|
2238
2238
|
return (t) => e.test(t);
|
|
2239
2239
|
} catch {
|
|
2240
|
-
return
|
|
2240
|
+
return Bn;
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
|
-
function
|
|
2243
|
+
function Bn(e) {
|
|
2244
2244
|
if (!e) return !1;
|
|
2245
2245
|
for (let t of Array.from(e)) {
|
|
2246
2246
|
let e = t.codePointAt(0);
|
|
@@ -2248,7 +2248,7 @@ function Fn(e) {
|
|
|
2248
2248
|
}
|
|
2249
2249
|
return !1;
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2251
|
+
function Vn(e) {
|
|
2252
2252
|
let t = [], n = "", r = 0;
|
|
2253
2253
|
for (let i = 0; i < e.length; i++) {
|
|
2254
2254
|
let a = e[i];
|
|
@@ -2266,16 +2266,16 @@ function In(e) {
|
|
|
2266
2266
|
breaks: r
|
|
2267
2267
|
}), t;
|
|
2268
2268
|
}
|
|
2269
|
-
function
|
|
2269
|
+
function Hn(e) {
|
|
2270
2270
|
if (e.length === 0) return [];
|
|
2271
2271
|
let t = [], n = [];
|
|
2272
2272
|
for (let r of e) n.push(r), r.breaks >= 2 && (t.push(n), n = []);
|
|
2273
2273
|
return n.length > 0 && t.push(n), t;
|
|
2274
2274
|
}
|
|
2275
|
-
function
|
|
2275
|
+
function Un(e, t) {
|
|
2276
2276
|
return (e & t) === t;
|
|
2277
2277
|
}
|
|
2278
|
-
function
|
|
2278
|
+
function Wn(e) {
|
|
2279
2279
|
return {
|
|
2280
2280
|
"--tw-motion-seq-index": e.toString(),
|
|
2281
2281
|
backgroundColor: "inherit",
|
|
@@ -2292,19 +2292,19 @@ function Rn(e) {
|
|
|
2292
2292
|
WebkitTextFillColor: "inherit"
|
|
2293
2293
|
};
|
|
2294
2294
|
}
|
|
2295
|
-
function
|
|
2295
|
+
function Gn(e) {
|
|
2296
2296
|
if (!e) return e;
|
|
2297
|
-
let t =
|
|
2297
|
+
let t = Tn(e);
|
|
2298
2298
|
if (t.length === 0) return e;
|
|
2299
|
-
let { nodes: n, sawEmoji: r } =
|
|
2299
|
+
let { nodes: n, sawEmoji: r } = Kn(t);
|
|
2300
2300
|
return r ? n.length === 1 ? n[0] ?? e : n : e;
|
|
2301
2301
|
}
|
|
2302
|
-
function
|
|
2302
|
+
function Kn(e, t) {
|
|
2303
2303
|
let n = [], r = "", i = !1, a = t?.emoji ?? 0, o = () => {
|
|
2304
2304
|
r &&= (n.push(r), "");
|
|
2305
2305
|
};
|
|
2306
2306
|
for (let s of e) {
|
|
2307
|
-
if (
|
|
2307
|
+
if (Rn(s)) {
|
|
2308
2308
|
i = !0, o();
|
|
2309
2309
|
let e = `motion-emoji-${t ? t.emoji++ : a++}`;
|
|
2310
2310
|
n.push(/* @__PURE__ */ P("span", {
|
|
@@ -2323,16 +2323,16 @@ function Bn(e, t) {
|
|
|
2323
2323
|
sawEmoji: !1
|
|
2324
2324
|
};
|
|
2325
2325
|
}
|
|
2326
|
-
function
|
|
2326
|
+
function qn(e) {
|
|
2327
2327
|
if (!e) return K.None;
|
|
2328
2328
|
let t = e.trim();
|
|
2329
2329
|
if (!t) return K.None;
|
|
2330
|
-
let n =
|
|
2330
|
+
let n = gn.get(t);
|
|
2331
2331
|
if (typeof n == "number") return n;
|
|
2332
2332
|
if (typeof document > "u") return K.None;
|
|
2333
2333
|
let r = t.split(/\s+/).filter(Boolean);
|
|
2334
2334
|
if (r.length === 0) return K.None;
|
|
2335
|
-
let i = r.map((e) => `.${
|
|
2335
|
+
let i = r.map((e) => `.${Yn(e)}`).map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${Xn(e)}(?![a-zA-Z0-9_-])`)), a = K.None, o = !1;
|
|
2336
2336
|
for (let e of Array.from(document.styleSheets)) {
|
|
2337
2337
|
let t;
|
|
2338
2338
|
try {
|
|
@@ -2340,13 +2340,13 @@ function Vn(e) {
|
|
|
2340
2340
|
} catch {
|
|
2341
2341
|
continue;
|
|
2342
2342
|
}
|
|
2343
|
-
let n =
|
|
2344
|
-
if (n.mask && (a |= n.mask, a ===
|
|
2343
|
+
let n = Jn(t, i);
|
|
2344
|
+
if (n.mask && (a |= n.mask, a === mn)) break;
|
|
2345
2345
|
o ||= n.sawStyleRule;
|
|
2346
2346
|
}
|
|
2347
|
-
return (a !== K.None || o) &&
|
|
2347
|
+
return (a !== K.None || o) && gn.set(t, a), a;
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2349
|
+
function Jn(e, t) {
|
|
2350
2350
|
if (!e) return {
|
|
2351
2351
|
mask: K.None,
|
|
2352
2352
|
sawStyleRule: !1
|
|
@@ -2359,14 +2359,14 @@ function Hn(e, t) {
|
|
|
2359
2359
|
let e = a.selectorText ?? "";
|
|
2360
2360
|
if (!e || !t.some((t) => t.test(e))) continue;
|
|
2361
2361
|
r = !0;
|
|
2362
|
-
for (let t of
|
|
2363
|
-
if (n ===
|
|
2362
|
+
for (let t of pn) t.hints.some((t) => e.includes(t)) && (n |= t.flag);
|
|
2363
|
+
if (n === mn) return {
|
|
2364
2364
|
mask: n,
|
|
2365
2365
|
sawStyleRule: !0
|
|
2366
2366
|
};
|
|
2367
2367
|
} else if ("cssRules" in a) {
|
|
2368
|
-
let e =
|
|
2369
|
-
if (e.mask && (n |= e.mask, n ===
|
|
2368
|
+
let e = Jn(a.cssRules, t);
|
|
2369
|
+
if (e.mask && (n |= e.mask, n === mn)) return {
|
|
2370
2370
|
mask: n,
|
|
2371
2371
|
sawStyleRule: !0
|
|
2372
2372
|
};
|
|
@@ -2379,82 +2379,118 @@ function Hn(e, t) {
|
|
|
2379
2379
|
sawStyleRule: r
|
|
2380
2380
|
};
|
|
2381
2381
|
}
|
|
2382
|
-
function
|
|
2382
|
+
function Yn(e) {
|
|
2383
2383
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
2384
2384
|
}
|
|
2385
|
-
function
|
|
2385
|
+
function Xn(e) {
|
|
2386
2386
|
return e.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
|
|
2387
2387
|
}
|
|
2388
2388
|
//#endregion
|
|
2389
2389
|
//#region src/auth/storage.ts
|
|
2390
|
-
var
|
|
2391
|
-
function
|
|
2390
|
+
var Zn = "ikon-auth-session", Qn = "ikon-auth-refreshable", $n = "ikon-auth-auto-login-attempted-run", er = 6048e5, tr = 6e4;
|
|
2391
|
+
function nr(e) {
|
|
2392
2392
|
try {
|
|
2393
2393
|
let t = e.split(".");
|
|
2394
2394
|
if (t.length !== 3) return !0;
|
|
2395
2395
|
let n = t[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), i = JSON.parse(atob(r));
|
|
2396
|
-
return typeof i.exp == "number" && Date.now() >= i.exp * 1e3 -
|
|
2396
|
+
return typeof i.exp == "number" && Date.now() >= i.exp * 1e3 - tr;
|
|
2397
2397
|
} catch {
|
|
2398
2398
|
return !0;
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2401
|
+
function q(e) {
|
|
2402
2402
|
try {
|
|
2403
|
-
localStorage.setItem(
|
|
2403
|
+
localStorage.setItem(Zn, JSON.stringify(e));
|
|
2404
2404
|
} catch {
|
|
2405
2405
|
console.warn("Failed to save auth session to localStorage");
|
|
2406
2406
|
}
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2408
|
+
function rr() {
|
|
2409
2409
|
try {
|
|
2410
|
-
let e = localStorage.getItem(
|
|
2410
|
+
let e = localStorage.getItem(Zn);
|
|
2411
2411
|
if (!e) return null;
|
|
2412
2412
|
let t = JSON.parse(e);
|
|
2413
|
-
return Date.now() - t.authenticatedAt >
|
|
2413
|
+
return Date.now() - t.authenticatedAt > er || nr(t.token) ? (ur(), null) : t;
|
|
2414
2414
|
} catch {
|
|
2415
2415
|
return console.warn("Failed to load auth session from localStorage"), null;
|
|
2416
2416
|
}
|
|
2417
2417
|
}
|
|
2418
|
-
function
|
|
2418
|
+
function ir(e) {
|
|
2419
|
+
try {
|
|
2420
|
+
localStorage.removeItem(Zn), localStorage.setItem(Qn, JSON.stringify(e));
|
|
2421
|
+
} catch {
|
|
2422
|
+
console.warn("Failed to save the auth session marker to localStorage");
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
function ar() {
|
|
2426
|
+
try {
|
|
2427
|
+
let e = localStorage.getItem(Qn);
|
|
2428
|
+
if (!e) return null;
|
|
2429
|
+
let t = JSON.parse(e);
|
|
2430
|
+
return Date.now() - t.renewedAt > er ? (sr(), null) : t;
|
|
2431
|
+
} catch {
|
|
2432
|
+
return console.warn("Failed to load the auth session marker from localStorage"), null;
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
function or() {
|
|
2436
|
+
let e = ar();
|
|
2437
|
+
e && ir({
|
|
2438
|
+
...e,
|
|
2439
|
+
renewedAt: Date.now()
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
function sr() {
|
|
2419
2443
|
try {
|
|
2420
|
-
|
|
2444
|
+
localStorage.removeItem(Qn);
|
|
2445
|
+
} catch {
|
|
2446
|
+
console.warn("Failed to clear the auth session marker from localStorage");
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
function cr() {
|
|
2450
|
+
rr()?.provider === "anonymous" && ur(), ar()?.provider === "anonymous" && sr();
|
|
2451
|
+
}
|
|
2452
|
+
function lr() {
|
|
2453
|
+
try {
|
|
2454
|
+
let e = typeof window < "u" ? new URLSearchParams(window.location.search) : void 0;
|
|
2455
|
+
if (e?.get("ikon_token") || e?.get("ikon_code")) return !0;
|
|
2421
2456
|
} catch {}
|
|
2422
|
-
let e =
|
|
2457
|
+
let e = rr()?.provider ?? ar()?.provider;
|
|
2423
2458
|
return e !== void 0 && e !== "anonymous";
|
|
2424
2459
|
}
|
|
2425
|
-
function
|
|
2460
|
+
function ur() {
|
|
2426
2461
|
try {
|
|
2427
|
-
localStorage.removeItem(
|
|
2462
|
+
localStorage.removeItem(Zn);
|
|
2428
2463
|
} catch {
|
|
2429
2464
|
console.warn("Failed to clear auth session from localStorage");
|
|
2430
2465
|
}
|
|
2431
2466
|
}
|
|
2432
|
-
function
|
|
2467
|
+
function dr(e) {
|
|
2433
2468
|
if (e) try {
|
|
2434
|
-
sessionStorage.setItem(
|
|
2469
|
+
sessionStorage.setItem($n, e);
|
|
2435
2470
|
} catch {
|
|
2436
2471
|
console.warn("Failed to record auto-login attempt in sessionStorage");
|
|
2437
2472
|
}
|
|
2438
2473
|
}
|
|
2439
|
-
function
|
|
2474
|
+
function fr() {
|
|
2440
2475
|
try {
|
|
2441
|
-
return sessionStorage.getItem(
|
|
2476
|
+
return sessionStorage.getItem($n);
|
|
2442
2477
|
} catch {
|
|
2443
2478
|
return null;
|
|
2444
2479
|
}
|
|
2445
2480
|
}
|
|
2446
|
-
function
|
|
2481
|
+
function J(e) {
|
|
2447
2482
|
return {
|
|
2448
2483
|
id: "",
|
|
2449
2484
|
provider: e.provider,
|
|
2450
2485
|
token: e.token,
|
|
2451
|
-
authenticatedAt: e.authenticatedAt
|
|
2486
|
+
authenticatedAt: e.authenticatedAt,
|
|
2487
|
+
expiresAt: e.expiresAt
|
|
2452
2488
|
};
|
|
2453
2489
|
}
|
|
2454
2490
|
//#endregion
|
|
2455
2491
|
//#region src/auth/auth-service.ts
|
|
2456
|
-
var
|
|
2457
|
-
async function
|
|
2492
|
+
var pr = 15e3, mr = 15e3, Y = v("AuthService");
|
|
2493
|
+
async function hr(e) {
|
|
2458
2494
|
try {
|
|
2459
2495
|
return await fetch(e, {
|
|
2460
2496
|
method: "GET",
|
|
@@ -2464,34 +2500,34 @@ async function rr(e) {
|
|
|
2464
2500
|
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)`;
|
|
2465
2501
|
}
|
|
2466
2502
|
}
|
|
2467
|
-
var
|
|
2468
|
-
function
|
|
2469
|
-
if (e.headers.get(
|
|
2503
|
+
var gr = "x-ikon-auth-service";
|
|
2504
|
+
function _r(e) {
|
|
2505
|
+
if (e.headers.get(gr) !== null) return !1;
|
|
2470
2506
|
if (e.status === 404 || e.status === 405) return !0;
|
|
2471
2507
|
let t = e.headers.get("content-type") ?? "";
|
|
2472
2508
|
return e.status === 200 && t.includes("text/html");
|
|
2473
2509
|
}
|
|
2474
2510
|
async function X(e, t, n) {
|
|
2475
|
-
let r = `${e}${t}`, i =
|
|
2511
|
+
let r = `${e}${t}`, i = C(), a = i !== null && e === i, o = a ? await S() : i, s = o !== null && o !== e ? `${o}${t}` : null, c;
|
|
2476
2512
|
try {
|
|
2477
2513
|
c = await fetch(r, n);
|
|
2478
2514
|
} catch (i) {
|
|
2479
2515
|
let a = i instanceof Error ? `${i.name}: ${i.message}` : String(i);
|
|
2480
2516
|
if (!s) {
|
|
2481
|
-
let n = await
|
|
2482
|
-
throw
|
|
2517
|
+
let n = await hr(e);
|
|
2518
|
+
throw Y.error(`Auth request ${t} could not reach ${r} — ${a}. ${n}`), Error(`Auth request could not reach ${r} (${a}). ${n}`, { cause: i });
|
|
2483
2519
|
}
|
|
2484
|
-
|
|
2520
|
+
Y.warn(`Auth request ${t} could not reach ${r} (${a}); falling back to ${s}`);
|
|
2485
2521
|
try {
|
|
2486
2522
|
return await fetch(s, n);
|
|
2487
2523
|
} catch (n) {
|
|
2488
|
-
let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await
|
|
2489
|
-
throw
|
|
2524
|
+
let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await hr(e);
|
|
2525
|
+
throw Y.error(`Auth request ${t} failed on both ${r} (${a}) and ${s} (${i}). ${o}`), Error(`Auth request unreachable: ${r} (${a}) and ${s} (${i})`, { cause: n });
|
|
2490
2526
|
}
|
|
2491
2527
|
}
|
|
2492
|
-
return a && s !== null &&
|
|
2528
|
+
return a && s !== null && _r(c) ? (Y.warn(`Auth request ${t} got a non-auth-service answer from ${r} (${c.status}); this LB has no /ikon/auth route, falling back to ${s}`), fetch(s, n)) : c;
|
|
2493
2529
|
}
|
|
2494
|
-
async function
|
|
2530
|
+
async function vr(e, t, n) {
|
|
2495
2531
|
let r = ie(), i = n === "guest" ? "anonymous" : n, a = {
|
|
2496
2532
|
method: "POST",
|
|
2497
2533
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2501,20 +2537,20 @@ async function or(e, t, n) {
|
|
|
2501
2537
|
...i ? { method: i } : {}
|
|
2502
2538
|
})
|
|
2503
2539
|
}, o = typeof window < "u" ? window.location.origin : "?";
|
|
2504
|
-
|
|
2540
|
+
Y.debug(`Anonymous auth: POST ${t}/anonymous (space=${e}, origin=${o})`);
|
|
2505
2541
|
let s = await X(t, "/anonymous", a);
|
|
2506
2542
|
if (!s.ok) {
|
|
2507
2543
|
let e = await s.text().catch(() => "Unknown error");
|
|
2508
|
-
throw
|
|
2544
|
+
throw Y.error(`Anonymous auth HTTP ${s.status} from ${s.url}: ${e}`), Error(`Anonymous auth failed: ${s.status} ${e}`);
|
|
2509
2545
|
}
|
|
2510
2546
|
let { token: c } = await s.json(), l = {
|
|
2511
2547
|
token: c,
|
|
2512
2548
|
provider: "anonymous",
|
|
2513
2549
|
authenticatedAt: Date.now()
|
|
2514
2550
|
};
|
|
2515
|
-
return
|
|
2551
|
+
return q(l), l;
|
|
2516
2552
|
}
|
|
2517
|
-
async function
|
|
2553
|
+
async function yr({ email: e, spaceId: t, authUrl: n }) {
|
|
2518
2554
|
let r = await X(n, "/email/send", {
|
|
2519
2555
|
method: "POST",
|
|
2520
2556
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2522,14 +2558,14 @@ async function sr({ email: e, spaceId: t, authUrl: n }) {
|
|
|
2522
2558
|
email: e.trim(),
|
|
2523
2559
|
space: t
|
|
2524
2560
|
}),
|
|
2525
|
-
signal: g(
|
|
2561
|
+
signal: g(pr)
|
|
2526
2562
|
});
|
|
2527
2563
|
if (!r.ok) {
|
|
2528
2564
|
let e = await r.text().catch(() => "Failed to send login code");
|
|
2529
2565
|
throw Error(e);
|
|
2530
2566
|
}
|
|
2531
2567
|
}
|
|
2532
|
-
async function
|
|
2568
|
+
async function br({ email: e, code: t, authUrl: n }) {
|
|
2533
2569
|
let r = await X(n, "/email/code", {
|
|
2534
2570
|
method: "POST",
|
|
2535
2571
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2537,7 +2573,7 @@ async function cr({ email: e, code: t, authUrl: n }) {
|
|
|
2537
2573
|
email: e.trim(),
|
|
2538
2574
|
code: t.trim()
|
|
2539
2575
|
}),
|
|
2540
|
-
signal: g(
|
|
2576
|
+
signal: g(pr)
|
|
2541
2577
|
});
|
|
2542
2578
|
if (!r.ok) {
|
|
2543
2579
|
let e = await r.text().catch(() => "Invalid code");
|
|
@@ -2548,34 +2584,90 @@ async function cr({ email: e, code: t, authUrl: n }) {
|
|
|
2548
2584
|
provider: "email",
|
|
2549
2585
|
authenticatedAt: Date.now()
|
|
2550
2586
|
};
|
|
2551
|
-
return
|
|
2587
|
+
return q(a), a;
|
|
2552
2588
|
}
|
|
2553
|
-
function
|
|
2589
|
+
function xr() {
|
|
2554
2590
|
let e = new URLSearchParams(window.location.search), t = e.get("ikon_token"), n = e.get("ikon_provider");
|
|
2555
2591
|
return t && n ? {
|
|
2556
2592
|
token: t,
|
|
2557
2593
|
provider: n
|
|
2558
2594
|
} : null;
|
|
2559
2595
|
}
|
|
2560
|
-
function
|
|
2596
|
+
function Sr() {
|
|
2597
|
+
let e = new URLSearchParams(window.location.search), t = e.get("ikon_code"), n = e.get("ikon_provider");
|
|
2598
|
+
return t && n ? {
|
|
2599
|
+
code: t,
|
|
2600
|
+
provider: n
|
|
2601
|
+
} : null;
|
|
2602
|
+
}
|
|
2603
|
+
async function Cr(e, t, n) {
|
|
2604
|
+
let r = pe();
|
|
2605
|
+
if (!r) throw Error("This sign-in was started in a different browser or tab");
|
|
2606
|
+
let i = await X(await b(n), "/oauth/exchange", {
|
|
2607
|
+
method: "POST",
|
|
2608
|
+
headers: { "Content-Type": "application/json" },
|
|
2609
|
+
body: JSON.stringify({
|
|
2610
|
+
code: e,
|
|
2611
|
+
codeVerifier: r,
|
|
2612
|
+
supportsRefresh: !0
|
|
2613
|
+
}),
|
|
2614
|
+
signal: g(pr)
|
|
2615
|
+
});
|
|
2616
|
+
if (!i.ok) throw Error("Could not complete the sign-in");
|
|
2617
|
+
let { token: a, expiresAt: o } = await i.json(), s = {
|
|
2618
|
+
token: a,
|
|
2619
|
+
provider: t,
|
|
2620
|
+
authenticatedAt: Date.now(),
|
|
2621
|
+
expiresAt: o
|
|
2622
|
+
};
|
|
2623
|
+
return o ? ir({
|
|
2624
|
+
provider: t,
|
|
2625
|
+
authenticatedAt: s.authenticatedAt,
|
|
2626
|
+
renewedAt: s.authenticatedAt
|
|
2627
|
+
}) : q(s), s;
|
|
2628
|
+
}
|
|
2629
|
+
async function wr(e) {
|
|
2630
|
+
let t = C();
|
|
2631
|
+
if (t === null) return null;
|
|
2632
|
+
let n;
|
|
2633
|
+
try {
|
|
2634
|
+
n = await fetch(`${t}/session/refresh`, {
|
|
2635
|
+
method: "POST",
|
|
2636
|
+
signal: g(mr)
|
|
2637
|
+
});
|
|
2638
|
+
} catch (e) {
|
|
2639
|
+
let n = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
|
|
2640
|
+
throw Y.warn(`Session renewal could not reach ${t}/session/refresh (${n})`), Error(`Session renewal could not reach the auth service (${n})`, { cause: e });
|
|
2641
|
+
}
|
|
2642
|
+
if (n.status === 401) return null;
|
|
2643
|
+
if (!n.ok) throw Error(`Session renewal failed: ${n.status}`);
|
|
2644
|
+
let { token: r, expiresAt: i } = await n.json();
|
|
2645
|
+
return {
|
|
2646
|
+
token: r,
|
|
2647
|
+
provider: e.provider,
|
|
2648
|
+
authenticatedAt: e.authenticatedAt,
|
|
2649
|
+
expiresAt: i
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
function Tr() {
|
|
2561
2653
|
let e = new URLSearchParams(window.location.search), t = e.get("error");
|
|
2562
2654
|
return t ? {
|
|
2563
2655
|
code: t,
|
|
2564
2656
|
provider: e.get("ikon_provider")
|
|
2565
2657
|
} : null;
|
|
2566
2658
|
}
|
|
2567
|
-
function
|
|
2659
|
+
function Er() {
|
|
2568
2660
|
return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("ikon-signed-out");
|
|
2569
2661
|
}
|
|
2570
|
-
var
|
|
2662
|
+
var Dr = {
|
|
2571
2663
|
google: "Google",
|
|
2572
2664
|
facebook: "Facebook",
|
|
2573
2665
|
apple: "Apple",
|
|
2574
2666
|
microsoft: "Microsoft",
|
|
2575
2667
|
signicat: "eID"
|
|
2576
2668
|
};
|
|
2577
|
-
function
|
|
2578
|
-
let r = t ?
|
|
2669
|
+
function Or(e, t, n) {
|
|
2670
|
+
let r = t ? Dr[t] ?? t : "this provider";
|
|
2579
2671
|
switch (e) {
|
|
2580
2672
|
case "account_exists_unverified_email": {
|
|
2581
2673
|
let e = `This email address already has an account on this app that uses a different sign-in method. For security, ${r} sign-in can't be connected to it automatically.`;
|
|
@@ -2586,21 +2678,22 @@ function pr(e, t, n) {
|
|
|
2586
2678
|
default: return e;
|
|
2587
2679
|
}
|
|
2588
2680
|
}
|
|
2589
|
-
function
|
|
2681
|
+
function kr() {
|
|
2590
2682
|
let e = new URLSearchParams(window.location.search);
|
|
2591
2683
|
for (let t of [
|
|
2592
2684
|
"ikon_token",
|
|
2685
|
+
"ikon_code",
|
|
2593
2686
|
"ikon_provider",
|
|
2594
2687
|
"error"
|
|
2595
2688
|
]) e.delete(t);
|
|
2596
2689
|
let t = e.toString();
|
|
2597
2690
|
window.history.replaceState({}, "", t.length > 0 ? `${window.location.pathname}?${t}` : window.location.pathname);
|
|
2598
2691
|
}
|
|
2599
|
-
function
|
|
2600
|
-
let i = r ?? window.location.origin + window.location.pathname + window.location.search;
|
|
2601
|
-
return `${n}/oauth/${e}?space=${encodeURIComponent(t)}&return=${encodeURIComponent(i)}`;
|
|
2692
|
+
async function Ar(e, t, n, r) {
|
|
2693
|
+
let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await y(), o = a ? `&code_challenge=${encodeURIComponent(a)}` : "";
|
|
2694
|
+
return `${n}/oauth/${e}?space=${encodeURIComponent(t)}&return=${encodeURIComponent(i)}${o}`;
|
|
2602
2695
|
}
|
|
2603
|
-
async function
|
|
2696
|
+
async function jr(e) {
|
|
2604
2697
|
let t = await X(e, "/passkey/registration/options", {
|
|
2605
2698
|
method: "POST",
|
|
2606
2699
|
headers: { "Content-Type": "application/json" }
|
|
@@ -2611,7 +2704,7 @@ async function gr(e) {
|
|
|
2611
2704
|
}
|
|
2612
2705
|
return t.json();
|
|
2613
2706
|
}
|
|
2614
|
-
async function
|
|
2707
|
+
async function Mr(e, t, n) {
|
|
2615
2708
|
let r = await X(e, "/passkey/registration/verify", {
|
|
2616
2709
|
method: "POST",
|
|
2617
2710
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2629,9 +2722,9 @@ async function _r(e, t, n) {
|
|
|
2629
2722
|
provider: "passkey",
|
|
2630
2723
|
authenticatedAt: Date.now()
|
|
2631
2724
|
};
|
|
2632
|
-
return
|
|
2725
|
+
return q(a), a;
|
|
2633
2726
|
}
|
|
2634
|
-
async function
|
|
2727
|
+
async function Nr(e, t) {
|
|
2635
2728
|
let n = await X(e, "/passkey/authentication/options", {
|
|
2636
2729
|
method: "POST",
|
|
2637
2730
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2643,7 +2736,7 @@ async function vr(e, t) {
|
|
|
2643
2736
|
}
|
|
2644
2737
|
return n.json();
|
|
2645
2738
|
}
|
|
2646
|
-
async function
|
|
2739
|
+
async function Pr(e, t) {
|
|
2647
2740
|
let n = await X(e, "/passkey/authentication/verify", {
|
|
2648
2741
|
method: "POST",
|
|
2649
2742
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2658,7 +2751,16 @@ async function yr(e, t) {
|
|
|
2658
2751
|
provider: "passkey",
|
|
2659
2752
|
authenticatedAt: Date.now()
|
|
2660
2753
|
};
|
|
2661
|
-
return
|
|
2754
|
+
return q(i), i;
|
|
2755
|
+
}
|
|
2756
|
+
async function Fr(e, t) {
|
|
2757
|
+
try {
|
|
2758
|
+
await X(await b(t), "/logout", {
|
|
2759
|
+
method: "POST",
|
|
2760
|
+
headers: { Authorization: `Bearer ${e}` },
|
|
2761
|
+
signal: g(pr)
|
|
2762
|
+
});
|
|
2763
|
+
} catch {}
|
|
2662
2764
|
}
|
|
2663
2765
|
//#endregion
|
|
2664
2766
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/bufferToBase64URLString.js
|
|
@@ -2669,30 +2771,30 @@ function Z(e) {
|
|
|
2669
2771
|
}
|
|
2670
2772
|
//#endregion
|
|
2671
2773
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js
|
|
2672
|
-
function
|
|
2774
|
+
function Ir(e) {
|
|
2673
2775
|
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - t.length % 4) % 4, r = t.padEnd(t.length + n, "="), i = atob(r), a = new ArrayBuffer(i.length), o = new Uint8Array(a);
|
|
2674
2776
|
for (let e = 0; e < i.length; e++) o[e] = i.charCodeAt(e);
|
|
2675
2777
|
return a;
|
|
2676
2778
|
}
|
|
2677
2779
|
//#endregion
|
|
2678
2780
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js
|
|
2679
|
-
function
|
|
2680
|
-
return
|
|
2781
|
+
function Lr() {
|
|
2782
|
+
return Rr.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
2681
2783
|
}
|
|
2682
|
-
var
|
|
2784
|
+
var Rr = { stubThis: (e) => e };
|
|
2683
2785
|
//#endregion
|
|
2684
2786
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js
|
|
2685
|
-
function
|
|
2787
|
+
function zr(e) {
|
|
2686
2788
|
let { id: t } = e;
|
|
2687
2789
|
return {
|
|
2688
2790
|
...e,
|
|
2689
|
-
id:
|
|
2791
|
+
id: Ir(t),
|
|
2690
2792
|
transports: e.transports
|
|
2691
2793
|
};
|
|
2692
2794
|
}
|
|
2693
2795
|
//#endregion
|
|
2694
2796
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js
|
|
2695
|
-
function
|
|
2797
|
+
function Br(e) {
|
|
2696
2798
|
return e === "localhost" || /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e);
|
|
2697
2799
|
}
|
|
2698
2800
|
//#endregion
|
|
@@ -2709,7 +2811,7 @@ var Q = class extends Error {
|
|
|
2709
2811
|
};
|
|
2710
2812
|
//#endregion
|
|
2711
2813
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js
|
|
2712
|
-
function
|
|
2814
|
+
function Vr({ error: e, options: t }) {
|
|
2713
2815
|
let { publicKey: n } = t;
|
|
2714
2816
|
if (!n) throw Error("options was missing required publicKey property");
|
|
2715
2817
|
if (e.name === "AbortError") {
|
|
@@ -2755,7 +2857,7 @@ function Tr({ error: e, options: t }) {
|
|
|
2755
2857
|
});
|
|
2756
2858
|
else if (e.name === "SecurityError") {
|
|
2757
2859
|
let t = globalThis.location.hostname;
|
|
2758
|
-
if (!
|
|
2860
|
+
if (!Br(t)) return new Q({
|
|
2759
2861
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2760
2862
|
code: "ERROR_INVALID_DOMAIN",
|
|
2761
2863
|
cause: e
|
|
@@ -2778,7 +2880,7 @@ function Tr({ error: e, options: t }) {
|
|
|
2778
2880
|
});
|
|
2779
2881
|
return e;
|
|
2780
2882
|
}
|
|
2781
|
-
var
|
|
2883
|
+
var Hr = new class {
|
|
2782
2884
|
constructor() {
|
|
2783
2885
|
Object.defineProperty(this, "controller", {
|
|
2784
2886
|
enumerable: !0,
|
|
@@ -2801,31 +2903,31 @@ var Er = new class {
|
|
|
2801
2903
|
e.name = "AbortError", this.controller.abort(e), this.controller = void 0;
|
|
2802
2904
|
}
|
|
2803
2905
|
}
|
|
2804
|
-
}(),
|
|
2805
|
-
function
|
|
2806
|
-
if (e && !(
|
|
2906
|
+
}(), Ur = ["cross-platform", "platform"];
|
|
2907
|
+
function Wr(e) {
|
|
2908
|
+
if (e && !(Ur.indexOf(e) < 0)) return e;
|
|
2807
2909
|
}
|
|
2808
2910
|
//#endregion
|
|
2809
2911
|
//#region ../../node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js
|
|
2810
|
-
async function
|
|
2912
|
+
async function Gr(e) {
|
|
2811
2913
|
!e.optionsJSON && e.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."), e = { optionsJSON: e });
|
|
2812
2914
|
let { optionsJSON: t, useAutoRegister: n = !1 } = e;
|
|
2813
|
-
if (!
|
|
2915
|
+
if (!Lr()) throw Error("WebAuthn is not supported in this browser");
|
|
2814
2916
|
let r = {
|
|
2815
2917
|
...t,
|
|
2816
|
-
challenge:
|
|
2918
|
+
challenge: Ir(t.challenge),
|
|
2817
2919
|
user: {
|
|
2818
2920
|
...t.user,
|
|
2819
|
-
id:
|
|
2921
|
+
id: Ir(t.user.id)
|
|
2820
2922
|
},
|
|
2821
|
-
excludeCredentials: t.excludeCredentials?.map(
|
|
2923
|
+
excludeCredentials: t.excludeCredentials?.map(zr)
|
|
2822
2924
|
}, i = {};
|
|
2823
|
-
n && (i.mediation = "conditional"), i.publicKey = r, i.signal =
|
|
2925
|
+
n && (i.mediation = "conditional"), i.publicKey = r, i.signal = Hr.createNewAbortSignal();
|
|
2824
2926
|
let a;
|
|
2825
2927
|
try {
|
|
2826
2928
|
a = await navigator.credentials.create(i);
|
|
2827
2929
|
} catch (e) {
|
|
2828
|
-
throw
|
|
2930
|
+
throw Vr({
|
|
2829
2931
|
error: e,
|
|
2830
2932
|
options: i
|
|
2831
2933
|
});
|
|
@@ -2837,20 +2939,20 @@ async function kr(e) {
|
|
|
2837
2939
|
if (typeof c.getPublicKeyAlgorithm == "function") try {
|
|
2838
2940
|
d = c.getPublicKeyAlgorithm();
|
|
2839
2941
|
} catch (e) {
|
|
2840
|
-
|
|
2942
|
+
Kr("getPublicKeyAlgorithm()", e);
|
|
2841
2943
|
}
|
|
2842
2944
|
let f;
|
|
2843
2945
|
if (typeof c.getPublicKey == "function") try {
|
|
2844
2946
|
let e = c.getPublicKey();
|
|
2845
2947
|
e !== null && (f = Z(e));
|
|
2846
2948
|
} catch (e) {
|
|
2847
|
-
|
|
2949
|
+
Kr("getPublicKey()", e);
|
|
2848
2950
|
}
|
|
2849
2951
|
let p;
|
|
2850
2952
|
if (typeof c.getAuthenticatorData == "function") try {
|
|
2851
2953
|
p = Z(c.getAuthenticatorData());
|
|
2852
2954
|
} catch (e) {
|
|
2853
|
-
|
|
2955
|
+
Kr("getAuthenticatorData()", e);
|
|
2854
2956
|
}
|
|
2855
2957
|
return {
|
|
2856
2958
|
id: o,
|
|
@@ -2865,23 +2967,23 @@ async function kr(e) {
|
|
|
2865
2967
|
},
|
|
2866
2968
|
type: l,
|
|
2867
2969
|
clientExtensionResults: a.getClientExtensionResults(),
|
|
2868
|
-
authenticatorAttachment:
|
|
2970
|
+
authenticatorAttachment: Wr(a.authenticatorAttachment)
|
|
2869
2971
|
};
|
|
2870
2972
|
}
|
|
2871
|
-
function
|
|
2973
|
+
function Kr(e, t) {
|
|
2872
2974
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`, t);
|
|
2873
2975
|
}
|
|
2874
2976
|
//#endregion
|
|
2875
2977
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js
|
|
2876
|
-
function
|
|
2877
|
-
if (!
|
|
2978
|
+
function qr() {
|
|
2979
|
+
if (!Lr()) return Jr.stubThis(new Promise((e) => e(!1)));
|
|
2878
2980
|
let e = globalThis.PublicKeyCredential;
|
|
2879
|
-
return e?.isConditionalMediationAvailable === void 0 ?
|
|
2981
|
+
return e?.isConditionalMediationAvailable === void 0 ? Jr.stubThis(new Promise((e) => e(!1))) : Jr.stubThis(e.isConditionalMediationAvailable());
|
|
2880
2982
|
}
|
|
2881
|
-
var
|
|
2983
|
+
var Jr = { stubThis: (e) => e };
|
|
2882
2984
|
//#endregion
|
|
2883
2985
|
//#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js
|
|
2884
|
-
function
|
|
2986
|
+
function Yr({ error: e, options: t }) {
|
|
2885
2987
|
let { publicKey: n } = t;
|
|
2886
2988
|
if (!n) throw Error("options was missing required publicKey property");
|
|
2887
2989
|
if (e.name === "AbortError") {
|
|
@@ -2897,7 +2999,7 @@ function Nr({ error: e, options: t }) {
|
|
|
2897
2999
|
});
|
|
2898
3000
|
else if (e.name === "SecurityError") {
|
|
2899
3001
|
let t = globalThis.location.hostname;
|
|
2900
|
-
if (!
|
|
3002
|
+
if (!Br(t)) return new Q({
|
|
2901
3003
|
message: `${globalThis.location.hostname} is an invalid domain`,
|
|
2902
3004
|
code: "ERROR_INVALID_DOMAIN",
|
|
2903
3005
|
cause: e
|
|
@@ -2916,28 +3018,28 @@ function Nr({ error: e, options: t }) {
|
|
|
2916
3018
|
}
|
|
2917
3019
|
//#endregion
|
|
2918
3020
|
//#region ../../node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js
|
|
2919
|
-
async function
|
|
3021
|
+
async function Xr(e) {
|
|
2920
3022
|
!e.optionsJSON && e.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."), e = { optionsJSON: e });
|
|
2921
3023
|
let { optionsJSON: t, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = e;
|
|
2922
|
-
if (!
|
|
3024
|
+
if (!Lr()) throw Error("WebAuthn is not supported in this browser");
|
|
2923
3025
|
let i;
|
|
2924
|
-
t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(
|
|
3026
|
+
t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(zr));
|
|
2925
3027
|
let a = {
|
|
2926
3028
|
...t,
|
|
2927
|
-
challenge:
|
|
3029
|
+
challenge: Ir(t.challenge),
|
|
2928
3030
|
allowCredentials: i
|
|
2929
3031
|
}, o = {};
|
|
2930
3032
|
if (n) {
|
|
2931
|
-
if (!await
|
|
3033
|
+
if (!await qr()) throw Error("Browser does not support WebAuthn autofill");
|
|
2932
3034
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r) throw Error("No <input> with \"webauthn\" as the only or last value in its `autocomplete` attribute was detected");
|
|
2933
3035
|
o.mediation = "conditional", a.allowCredentials = [];
|
|
2934
3036
|
}
|
|
2935
|
-
o.publicKey = a, o.signal =
|
|
3037
|
+
o.publicKey = a, o.signal = Hr.createNewAbortSignal();
|
|
2936
3038
|
let s;
|
|
2937
3039
|
try {
|
|
2938
3040
|
s = await navigator.credentials.get(o);
|
|
2939
3041
|
} catch (e) {
|
|
2940
|
-
throw
|
|
3042
|
+
throw Yr({
|
|
2941
3043
|
error: e,
|
|
2942
3044
|
options: o
|
|
2943
3045
|
});
|
|
@@ -2955,54 +3057,128 @@ async function Pr(e) {
|
|
|
2955
3057
|
},
|
|
2956
3058
|
type: d,
|
|
2957
3059
|
clientExtensionResults: s.getClientExtensionResults(),
|
|
2958
|
-
authenticatorAttachment:
|
|
3060
|
+
authenticatorAttachment: Wr(s.authenticatorAttachment)
|
|
2959
3061
|
};
|
|
2960
3062
|
}
|
|
2961
3063
|
//#endregion
|
|
2962
3064
|
//#region src/auth/auth-context.tsx
|
|
2963
|
-
var
|
|
2964
|
-
function
|
|
2965
|
-
let [r, i] =
|
|
3065
|
+
var Zr = he(null), Qr = 12e4;
|
|
3066
|
+
function $r({ children: e, config: n }) {
|
|
3067
|
+
let [r, i] = M({
|
|
2966
3068
|
isAuthenticated: !1,
|
|
2967
3069
|
isLoading: !0,
|
|
2968
3070
|
user: null,
|
|
2969
3071
|
error: null
|
|
2970
|
-
}), a = n.methods.includes("email")
|
|
2971
|
-
|
|
3072
|
+
}), a = n.methods.includes("email"), o = !n.requireSignIn || n.methods.includes("guest") || n.methods.includes("global"), s = j(!1), c = j(!1), l = O(async (e) => {
|
|
3073
|
+
if (!c.current) {
|
|
3074
|
+
c.current = !0;
|
|
3075
|
+
try {
|
|
3076
|
+
let t = await wr(e);
|
|
3077
|
+
if (t === null) {
|
|
3078
|
+
sr(), i({
|
|
3079
|
+
isAuthenticated: !1,
|
|
3080
|
+
isLoading: !1,
|
|
3081
|
+
user: null,
|
|
3082
|
+
error: null
|
|
3083
|
+
});
|
|
3084
|
+
return;
|
|
3085
|
+
}
|
|
3086
|
+
or(), i({
|
|
3087
|
+
isAuthenticated: !0,
|
|
3088
|
+
isLoading: !1,
|
|
3089
|
+
user: J(t),
|
|
3090
|
+
error: null
|
|
3091
|
+
});
|
|
3092
|
+
} catch {} finally {
|
|
3093
|
+
c.current = !1;
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
}, []);
|
|
3097
|
+
k(() => {
|
|
2972
3098
|
(() => {
|
|
2973
|
-
|
|
2974
|
-
e &&
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
3099
|
+
if (s.current) return;
|
|
3100
|
+
let e = n.devLoginRunId, t = !!e && fr() === e;
|
|
3101
|
+
e && !Er() && dr(e);
|
|
3102
|
+
let r = !!n.devLoginToken && !!e && !t && !nr(n.devLoginToken) && !Er();
|
|
3103
|
+
o || cr();
|
|
3104
|
+
let c = Tr();
|
|
3105
|
+
if (c) {
|
|
3106
|
+
kr(), i({
|
|
2978
3107
|
isAuthenticated: !1,
|
|
2979
3108
|
isLoading: !1,
|
|
2980
3109
|
user: null,
|
|
2981
|
-
error:
|
|
3110
|
+
error: Or(c.code, c.provider, { emailSignInAvailable: a })
|
|
2982
3111
|
});
|
|
2983
3112
|
return;
|
|
2984
3113
|
}
|
|
2985
|
-
let
|
|
2986
|
-
if (
|
|
3114
|
+
let l = Sr();
|
|
3115
|
+
if (l) {
|
|
3116
|
+
s.current = !0, kr(), Cr(l.code, l.provider, n.authUrl).then((e) => {
|
|
3117
|
+
i({
|
|
3118
|
+
isAuthenticated: !0,
|
|
3119
|
+
isLoading: !1,
|
|
3120
|
+
user: J(e),
|
|
3121
|
+
error: null
|
|
3122
|
+
});
|
|
3123
|
+
}).catch((e) => {
|
|
3124
|
+
i({
|
|
3125
|
+
isAuthenticated: !1,
|
|
3126
|
+
isLoading: !1,
|
|
3127
|
+
user: null,
|
|
3128
|
+
error: e instanceof Error ? e.message : "Could not complete the sign-in"
|
|
3129
|
+
});
|
|
3130
|
+
});
|
|
3131
|
+
return;
|
|
3132
|
+
}
|
|
3133
|
+
let u = xr();
|
|
3134
|
+
if (u) {
|
|
2987
3135
|
let e = {
|
|
2988
|
-
token:
|
|
2989
|
-
provider:
|
|
3136
|
+
token: u.token,
|
|
3137
|
+
provider: u.provider,
|
|
2990
3138
|
authenticatedAt: Date.now()
|
|
2991
3139
|
};
|
|
2992
|
-
|
|
3140
|
+
q(e), kr(), i({
|
|
2993
3141
|
isAuthenticated: !0,
|
|
2994
3142
|
isLoading: !1,
|
|
2995
|
-
user:
|
|
3143
|
+
user: J(e),
|
|
2996
3144
|
error: null
|
|
2997
3145
|
});
|
|
2998
3146
|
return;
|
|
2999
3147
|
}
|
|
3000
|
-
let
|
|
3001
|
-
if (
|
|
3148
|
+
let d = ar();
|
|
3149
|
+
if (d) {
|
|
3150
|
+
s.current = !0, wr(d).then((e) => {
|
|
3151
|
+
if (e === null) {
|
|
3152
|
+
sr(), i({
|
|
3153
|
+
isAuthenticated: !1,
|
|
3154
|
+
isLoading: !1,
|
|
3155
|
+
user: null,
|
|
3156
|
+
error: null
|
|
3157
|
+
});
|
|
3158
|
+
return;
|
|
3159
|
+
}
|
|
3160
|
+
or(), i({
|
|
3161
|
+
isAuthenticated: !0,
|
|
3162
|
+
isLoading: !1,
|
|
3163
|
+
user: J(e),
|
|
3164
|
+
error: null
|
|
3165
|
+
});
|
|
3166
|
+
}).catch(() => {
|
|
3167
|
+
i({
|
|
3168
|
+
isAuthenticated: !1,
|
|
3169
|
+
isLoading: !1,
|
|
3170
|
+
user: null,
|
|
3171
|
+
error: null
|
|
3172
|
+
});
|
|
3173
|
+
});
|
|
3174
|
+
return;
|
|
3175
|
+
}
|
|
3176
|
+
let f = rr();
|
|
3177
|
+
if (f && !(r && f.provider === "anonymous")) {
|
|
3002
3178
|
i({
|
|
3003
3179
|
isAuthenticated: !0,
|
|
3004
3180
|
isLoading: !1,
|
|
3005
|
-
user:
|
|
3181
|
+
user: J(f),
|
|
3006
3182
|
error: null
|
|
3007
3183
|
});
|
|
3008
3184
|
return;
|
|
@@ -3013,10 +3189,10 @@ function Ir({ children: e, config: n }) {
|
|
|
3013
3189
|
provider: "dev",
|
|
3014
3190
|
authenticatedAt: Date.now()
|
|
3015
3191
|
};
|
|
3016
|
-
|
|
3192
|
+
q(e), i({
|
|
3017
3193
|
isAuthenticated: !0,
|
|
3018
3194
|
isLoading: !1,
|
|
3019
|
-
user:
|
|
3195
|
+
user: J(e),
|
|
3020
3196
|
error: null
|
|
3021
3197
|
});
|
|
3022
3198
|
return;
|
|
@@ -3029,11 +3205,24 @@ function Ir({ children: e, config: n }) {
|
|
|
3029
3205
|
});
|
|
3030
3206
|
})();
|
|
3031
3207
|
}, [
|
|
3208
|
+
n.authUrl,
|
|
3032
3209
|
n.devLoginToken,
|
|
3033
3210
|
n.devLoginRunId,
|
|
3034
|
-
a
|
|
3035
|
-
|
|
3036
|
-
|
|
3211
|
+
a,
|
|
3212
|
+
o
|
|
3213
|
+
]), k(() => {
|
|
3214
|
+
let e = r.user?.expiresAt;
|
|
3215
|
+
if (!e) return;
|
|
3216
|
+
let t = ar();
|
|
3217
|
+
if (!t) return;
|
|
3218
|
+
let n = Date.parse(e) - Qr, i = setTimeout(() => void l(t), Math.max(0, n - Date.now())), a = () => {
|
|
3219
|
+
document.visibilityState === "visible" && Date.now() >= n && l(t);
|
|
3220
|
+
};
|
|
3221
|
+
return document.addEventListener("visibilitychange", a), () => {
|
|
3222
|
+
clearTimeout(i), document.removeEventListener("visibilitychange", a);
|
|
3223
|
+
};
|
|
3224
|
+
}, [r.user?.expiresAt, l]);
|
|
3225
|
+
let u = O(async (e) => {
|
|
3037
3226
|
if (!n.spaceId) {
|
|
3038
3227
|
i((e) => ({
|
|
3039
3228
|
...e,
|
|
@@ -3043,7 +3232,7 @@ function Ir({ children: e, config: n }) {
|
|
|
3043
3232
|
}
|
|
3044
3233
|
let t;
|
|
3045
3234
|
try {
|
|
3046
|
-
t = await
|
|
3235
|
+
t = await b(n.authUrl);
|
|
3047
3236
|
} catch (e) {
|
|
3048
3237
|
i((t) => ({
|
|
3049
3238
|
...t,
|
|
@@ -3058,11 +3247,11 @@ function Ir({ children: e, config: n }) {
|
|
|
3058
3247
|
isLoading: !0
|
|
3059
3248
|
}));
|
|
3060
3249
|
try {
|
|
3061
|
-
let r = await
|
|
3250
|
+
let r = await vr(n.spaceId, t, e);
|
|
3062
3251
|
i({
|
|
3063
3252
|
isAuthenticated: !0,
|
|
3064
3253
|
isLoading: !1,
|
|
3065
|
-
user:
|
|
3254
|
+
user: J(r),
|
|
3066
3255
|
error: null
|
|
3067
3256
|
});
|
|
3068
3257
|
} catch (e) {
|
|
@@ -3081,11 +3270,11 @@ function Ir({ children: e, config: n }) {
|
|
|
3081
3270
|
error: null
|
|
3082
3271
|
}));
|
|
3083
3272
|
try {
|
|
3084
|
-
let e = await
|
|
3273
|
+
let e = await Xr({ optionsJSON: await Nr(t) }), n = await Pr(t, e);
|
|
3085
3274
|
i({
|
|
3086
3275
|
isAuthenticated: !0,
|
|
3087
3276
|
isLoading: !1,
|
|
3088
|
-
user:
|
|
3277
|
+
user: J(n),
|
|
3089
3278
|
error: null
|
|
3090
3279
|
});
|
|
3091
3280
|
} catch (e) {
|
|
@@ -3098,34 +3287,42 @@ function Ir({ children: e, config: n }) {
|
|
|
3098
3287
|
return;
|
|
3099
3288
|
}
|
|
3100
3289
|
if (e === "email") throw Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
|
|
3101
|
-
|
|
3102
|
-
|
|
3290
|
+
if (w()) {
|
|
3291
|
+
await E(e, n.spaceId) || i((e) => ({
|
|
3292
|
+
...e,
|
|
3293
|
+
isLoading: !1,
|
|
3294
|
+
error: "The sign-in window did not complete. Allow pop-ups for this site and try again."
|
|
3295
|
+
}));
|
|
3296
|
+
return;
|
|
3297
|
+
}
|
|
3298
|
+
window.location.href = await Ar(e, n.spaceId, t);
|
|
3299
|
+
}, [n.authUrl, n.spaceId]), d = O(async (e) => {
|
|
3103
3300
|
if (!n.spaceId) throw i((e) => ({
|
|
3104
3301
|
...e,
|
|
3105
3302
|
error: "Space ID is not configured"
|
|
3106
3303
|
})), Error("Space ID is not configured");
|
|
3107
|
-
let t = await
|
|
3108
|
-
await
|
|
3304
|
+
let t = await b(n.authUrl);
|
|
3305
|
+
await yr({
|
|
3109
3306
|
email: e,
|
|
3110
3307
|
spaceId: n.spaceId,
|
|
3111
3308
|
authUrl: t
|
|
3112
3309
|
});
|
|
3113
|
-
}, [n.authUrl, n.spaceId]),
|
|
3310
|
+
}, [n.authUrl, n.spaceId]), f = O(async (e, t) => {
|
|
3114
3311
|
i((e) => ({
|
|
3115
3312
|
...e,
|
|
3116
3313
|
isLoading: !0,
|
|
3117
3314
|
error: null
|
|
3118
3315
|
}));
|
|
3119
3316
|
try {
|
|
3120
|
-
let r = await
|
|
3317
|
+
let r = await br({
|
|
3121
3318
|
email: e,
|
|
3122
3319
|
code: t,
|
|
3123
|
-
authUrl: await
|
|
3320
|
+
authUrl: await b(n.authUrl)
|
|
3124
3321
|
});
|
|
3125
3322
|
i({
|
|
3126
3323
|
isAuthenticated: !0,
|
|
3127
3324
|
isLoading: !1,
|
|
3128
|
-
user:
|
|
3325
|
+
user: J(r),
|
|
3129
3326
|
error: null
|
|
3130
3327
|
});
|
|
3131
3328
|
} catch (e) {
|
|
@@ -3136,26 +3333,27 @@ function Ir({ children: e, config: n }) {
|
|
|
3136
3333
|
error: t
|
|
3137
3334
|
})), e;
|
|
3138
3335
|
}
|
|
3139
|
-
}, [n.authUrl]),
|
|
3140
|
-
|
|
3336
|
+
}, [n.authUrl]), p = O(() => {
|
|
3337
|
+
let e = r.user?.token;
|
|
3338
|
+
e && Fr(e, n.authUrl), ur(), sr(), t.clearAll(), i({
|
|
3141
3339
|
isAuthenticated: !1,
|
|
3142
3340
|
isLoading: !1,
|
|
3143
3341
|
user: null,
|
|
3144
3342
|
error: null
|
|
3145
3343
|
});
|
|
3146
|
-
}, []),
|
|
3147
|
-
let t = await
|
|
3344
|
+
}, [r.user?.token, n.authUrl]), m = O(async (e) => {
|
|
3345
|
+
let t = await b(n.authUrl);
|
|
3148
3346
|
i((e) => ({
|
|
3149
3347
|
...e,
|
|
3150
3348
|
isLoading: !0,
|
|
3151
3349
|
error: null
|
|
3152
3350
|
}));
|
|
3153
3351
|
try {
|
|
3154
|
-
let n = await
|
|
3352
|
+
let n = await Mr(t, await Gr({ optionsJSON: await jr(t) }), e);
|
|
3155
3353
|
i({
|
|
3156
3354
|
isAuthenticated: !0,
|
|
3157
3355
|
isLoading: !1,
|
|
3158
|
-
user:
|
|
3356
|
+
user: J(n),
|
|
3159
3357
|
error: null
|
|
3160
3358
|
});
|
|
3161
3359
|
} catch (e) {
|
|
@@ -3165,52 +3363,111 @@ function Ir({ children: e, config: n }) {
|
|
|
3165
3363
|
error: e instanceof Error ? e.message : "Passkey registration failed"
|
|
3166
3364
|
}));
|
|
3167
3365
|
}
|
|
3168
|
-
}, [n.authUrl]),
|
|
3366
|
+
}, [n.authUrl]), h = O(() => r.user?.token ?? null, [r.user]), g = A(() => ({
|
|
3169
3367
|
state: r,
|
|
3170
|
-
login:
|
|
3171
|
-
logout:
|
|
3172
|
-
getToken:
|
|
3173
|
-
registerPasskey:
|
|
3174
|
-
requestEmailCode:
|
|
3175
|
-
submitEmailCode:
|
|
3368
|
+
login: u,
|
|
3369
|
+
logout: p,
|
|
3370
|
+
getToken: h,
|
|
3371
|
+
registerPasskey: m,
|
|
3372
|
+
requestEmailCode: d,
|
|
3373
|
+
submitEmailCode: f
|
|
3176
3374
|
}), [
|
|
3177
3375
|
r,
|
|
3178
|
-
o,
|
|
3179
|
-
l,
|
|
3180
|
-
d,
|
|
3181
3376
|
u,
|
|
3182
|
-
|
|
3183
|
-
|
|
3377
|
+
p,
|
|
3378
|
+
h,
|
|
3379
|
+
m,
|
|
3380
|
+
d,
|
|
3381
|
+
f
|
|
3184
3382
|
]);
|
|
3185
|
-
return /* @__PURE__ */ P(
|
|
3186
|
-
value:
|
|
3383
|
+
return /* @__PURE__ */ P(Zr, {
|
|
3384
|
+
value: g,
|
|
3187
3385
|
children: e
|
|
3188
3386
|
});
|
|
3189
3387
|
}
|
|
3190
|
-
function
|
|
3191
|
-
let e =
|
|
3388
|
+
function ei() {
|
|
3389
|
+
let e = ge(Zr);
|
|
3192
3390
|
if (!e) throw Error("useAuth must be used within an AuthProvider");
|
|
3193
3391
|
return e;
|
|
3194
3392
|
}
|
|
3195
|
-
function
|
|
3196
|
-
return
|
|
3393
|
+
function ti() {
|
|
3394
|
+
return ge(Zr);
|
|
3395
|
+
}
|
|
3396
|
+
//#endregion
|
|
3397
|
+
//#region src/auth/oauth-continuation.ts
|
|
3398
|
+
var ni = "ikon-oauth", ri = "ikon-oauth-continue";
|
|
3399
|
+
function ii() {
|
|
3400
|
+
if (typeof window > "u") return !1;
|
|
3401
|
+
let e = new URL(window.location.href).searchParams.get(ni);
|
|
3402
|
+
return e ? (li(e), !0) : ci() !== null;
|
|
3403
|
+
}
|
|
3404
|
+
function ai() {
|
|
3405
|
+
return oi() !== null;
|
|
3406
|
+
}
|
|
3407
|
+
function oi() {
|
|
3408
|
+
return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? ci();
|
|
3409
|
+
}
|
|
3410
|
+
async function si() {
|
|
3411
|
+
let e = oi();
|
|
3412
|
+
if (!e) return !1;
|
|
3413
|
+
ui();
|
|
3414
|
+
try {
|
|
3415
|
+
let t = rr();
|
|
3416
|
+
if (!t?.token) return !1;
|
|
3417
|
+
let n = await fetch("/ikon/oauth/continue", {
|
|
3418
|
+
method: "POST",
|
|
3419
|
+
headers: {
|
|
3420
|
+
"content-type": "application/json",
|
|
3421
|
+
authorization: `Bearer ${t.token}`
|
|
3422
|
+
},
|
|
3423
|
+
body: JSON.stringify({ continueId: e })
|
|
3424
|
+
});
|
|
3425
|
+
if (!n.ok) return !1;
|
|
3426
|
+
let { consentUrl: r } = await n.json();
|
|
3427
|
+
return r ? (window.location.href = r, !0) : !1;
|
|
3428
|
+
} catch {
|
|
3429
|
+
return !1;
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
function ci() {
|
|
3433
|
+
try {
|
|
3434
|
+
return sessionStorage.getItem(ri);
|
|
3435
|
+
} catch {
|
|
3436
|
+
return null;
|
|
3437
|
+
}
|
|
3438
|
+
}
|
|
3439
|
+
function li(e) {
|
|
3440
|
+
try {
|
|
3441
|
+
sessionStorage.setItem(ri, e);
|
|
3442
|
+
} catch {}
|
|
3443
|
+
}
|
|
3444
|
+
function ui() {
|
|
3445
|
+
try {
|
|
3446
|
+
sessionStorage.removeItem(ri);
|
|
3447
|
+
} catch {}
|
|
3448
|
+
try {
|
|
3449
|
+
let e = new URL(window.location.href);
|
|
3450
|
+
e.searchParams.has("ikon-oauth") && (e.searchParams.delete(ni), window.history.replaceState(null, "", e.toString()));
|
|
3451
|
+
} catch {}
|
|
3197
3452
|
}
|
|
3198
3453
|
//#endregion
|
|
3199
3454
|
//#region src/auth/use-auth-guard.ts
|
|
3200
|
-
function
|
|
3201
|
-
let { config: t, guestUrlParam: n } = e, { state: r, login: i } =
|
|
3202
|
-
|
|
3203
|
-
|
|
3455
|
+
function di(e) {
|
|
3456
|
+
let { config: t, guestUrlParam: n } = e, { state: r, login: i } = ei(), a = j(!1), o = N(de, re, re), s = o.required;
|
|
3457
|
+
k(() => {
|
|
3458
|
+
ii() && ue("An application is asking to act as you. Sign in to review what it wants.");
|
|
3459
|
+
}, []), k(() => {
|
|
3460
|
+
s && r.isAuthenticated && r.user && r.user.provider !== "anonymous" && (_(), ai() && si());
|
|
3204
3461
|
}, [
|
|
3205
|
-
|
|
3462
|
+
s,
|
|
3206
3463
|
r.isAuthenticated,
|
|
3207
3464
|
r.user
|
|
3208
|
-
]),
|
|
3465
|
+
]), k(() => {
|
|
3209
3466
|
if (!n || r.isAuthenticated || r.isLoading || a.current) return;
|
|
3210
3467
|
let e = t.methods.includes("global") ? "global" : t.methods.includes("guest") ? "guest" : null;
|
|
3211
3468
|
if (!e) return;
|
|
3212
3469
|
let o = new URLSearchParams(window.location.search), s = o.get(n);
|
|
3213
|
-
if (s === "true" || s === "1" || s === "" ||
|
|
3470
|
+
if (s === "true" || s === "1" || s === "" || Er()) {
|
|
3214
3471
|
o.delete(n);
|
|
3215
3472
|
let t = o.toString(), r = window.location.pathname + (t ? `?${t}` : "");
|
|
3216
3473
|
window.history.replaceState({}, "", r), a.current = !0, i(e);
|
|
@@ -3222,29 +3479,30 @@ function zr(e) {
|
|
|
3222
3479
|
t.methods,
|
|
3223
3480
|
i
|
|
3224
3481
|
]);
|
|
3225
|
-
let
|
|
3482
|
+
let c = t.methods.includes("guest") || t.methods.includes("global"), l = r.isAuthenticated && (c || r.user?.provider !== "anonymous"), u = !!t.requireSignIn && !l;
|
|
3226
3483
|
return {
|
|
3227
|
-
shouldRenderChildren: !
|
|
3484
|
+
shouldRenderChildren: !u && !s,
|
|
3228
3485
|
isCheckingAuth: r.isLoading,
|
|
3229
3486
|
isAuthenticated: r.isAuthenticated,
|
|
3230
3487
|
error: r.error,
|
|
3231
|
-
isLoginPrompt:
|
|
3232
|
-
dismissLoginPrompt: _
|
|
3488
|
+
isLoginPrompt: s && !u,
|
|
3489
|
+
dismissLoginPrompt: _,
|
|
3490
|
+
loginPromptReason: s ? o.reason : null
|
|
3233
3491
|
};
|
|
3234
3492
|
}
|
|
3235
3493
|
//#endregion
|
|
3236
3494
|
//#region src/debug/debug-overlay.tsx
|
|
3237
|
-
var
|
|
3495
|
+
var fi = (() => {
|
|
3238
3496
|
try {
|
|
3239
3497
|
return te();
|
|
3240
3498
|
} catch {
|
|
3241
3499
|
return !1;
|
|
3242
3500
|
}
|
|
3243
|
-
})(),
|
|
3244
|
-
function
|
|
3245
|
-
$.push(`[+${((Date.now() -
|
|
3501
|
+
})(), pi = Date.now(), $ = [], mi = 300;
|
|
3502
|
+
function hi(e) {
|
|
3503
|
+
$.push(`[+${((Date.now() - pi) / 1e3).toFixed(1)}s] ${e}`), $.length > mi && $.shift();
|
|
3246
3504
|
}
|
|
3247
|
-
function
|
|
3505
|
+
function gi(e) {
|
|
3248
3506
|
if (typeof e == "string") return e;
|
|
3249
3507
|
if (e instanceof Error) return `${e.name}: ${e.message}`;
|
|
3250
3508
|
try {
|
|
@@ -3253,10 +3511,10 @@ function Wr(e) {
|
|
|
3253
3511
|
return String(e);
|
|
3254
3512
|
}
|
|
3255
3513
|
}
|
|
3256
|
-
var
|
|
3257
|
-
function
|
|
3258
|
-
if (
|
|
3259
|
-
|
|
3514
|
+
var _i = !1;
|
|
3515
|
+
function vi() {
|
|
3516
|
+
if (_i || typeof window > "u") return;
|
|
3517
|
+
_i = !0, window.addEventListener("error", (e) => hi(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => hi(`unhandledRejection: ${gi(e.reason)}`));
|
|
3260
3518
|
let e = console;
|
|
3261
3519
|
for (let t of [
|
|
3262
3520
|
"error",
|
|
@@ -3267,17 +3525,17 @@ function Kr() {
|
|
|
3267
3525
|
let n = e[t]?.bind(console) ?? (() => void 0);
|
|
3268
3526
|
e[t] = (...e) => {
|
|
3269
3527
|
try {
|
|
3270
|
-
|
|
3528
|
+
hi(`console.${t}: ${e.map(gi).join(" ")}`);
|
|
3271
3529
|
} catch {}
|
|
3272
3530
|
n(...e);
|
|
3273
3531
|
};
|
|
3274
3532
|
}
|
|
3275
3533
|
try {
|
|
3276
|
-
|
|
3534
|
+
fe((e) => hi(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: d.DEBUG });
|
|
3277
3535
|
} catch {}
|
|
3278
3536
|
}
|
|
3279
|
-
|
|
3280
|
-
function
|
|
3537
|
+
fi && vi();
|
|
3538
|
+
function yi() {
|
|
3281
3539
|
let e = !1;
|
|
3282
3540
|
try {
|
|
3283
3541
|
let t = URL.createObjectURL(new Blob([""]));
|
|
@@ -3287,11 +3545,11 @@ function qr() {
|
|
|
3287
3545
|
} catch {}
|
|
3288
3546
|
return e;
|
|
3289
3547
|
}
|
|
3290
|
-
function
|
|
3548
|
+
function bi() {
|
|
3291
3549
|
let e = globalThis;
|
|
3292
3550
|
return [
|
|
3293
3551
|
`Worker=${typeof Worker < "u"}`,
|
|
3294
|
-
`moduleWorker=${
|
|
3552
|
+
`moduleWorker=${yi()}`,
|
|
3295
3553
|
`WebSocket=${typeof WebSocket < "u"}`,
|
|
3296
3554
|
`WebTransport=${e.WebTransport !== void 0}`,
|
|
3297
3555
|
`RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
|
|
@@ -3304,14 +3562,14 @@ function Jr() {
|
|
|
3304
3562
|
`online=${typeof navigator < "u" ? navigator.onLine : "?"}`
|
|
3305
3563
|
].join(" ");
|
|
3306
3564
|
}
|
|
3307
|
-
function
|
|
3565
|
+
function xi(e) {
|
|
3308
3566
|
return /ERROR|error:|Rejection/.test(e) ? "#f88" : /WARN|warn:/.test(e) ? "#fc6" : "#9d9";
|
|
3309
3567
|
}
|
|
3310
|
-
function
|
|
3311
|
-
let n =
|
|
3312
|
-
return
|
|
3568
|
+
function Si({ state: e = "", forceVisible: t = !1 }) {
|
|
3569
|
+
let n = fi || t, r = e === "connected" || e === "reconnecting", [, i] = ve((e) => e + 1, 0), [a, o] = M(!0);
|
|
3570
|
+
return k(() => {
|
|
3313
3571
|
if (!n) return;
|
|
3314
|
-
|
|
3572
|
+
vi();
|
|
3315
3573
|
let e = setInterval(i, 1e3);
|
|
3316
3574
|
return () => clearInterval(e);
|
|
3317
3575
|
}, [n]), n ? r && a ? /* @__PURE__ */ F("button", {
|
|
@@ -3365,7 +3623,7 @@ function Xr({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3365
3623
|
"Ikon debug overlay — state: ",
|
|
3366
3624
|
e || "?",
|
|
3367
3625
|
", +",
|
|
3368
|
-
Math.round((Date.now() -
|
|
3626
|
+
Math.round((Date.now() - pi) / 1e3),
|
|
3369
3627
|
"s, ",
|
|
3370
3628
|
$.length,
|
|
3371
3629
|
" entries",
|
|
@@ -3406,7 +3664,7 @@ function Xr({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3406
3664
|
color: "#8cf",
|
|
3407
3665
|
marginBottom: "4px"
|
|
3408
3666
|
},
|
|
3409
|
-
children:
|
|
3667
|
+
children: bi()
|
|
3410
3668
|
}),
|
|
3411
3669
|
/* @__PURE__ */ P("div", {
|
|
3412
3670
|
style: {
|
|
@@ -3417,7 +3675,7 @@ function Xr({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3417
3675
|
}),
|
|
3418
3676
|
/* @__PURE__ */ P("div", { children: $.length === 0 ? "(nothing captured yet)" : $.map((e, t) => /* @__PURE__ */ P("div", {
|
|
3419
3677
|
style: {
|
|
3420
|
-
color:
|
|
3678
|
+
color: xi(e),
|
|
3421
3679
|
wordBreak: "break-all"
|
|
3422
3680
|
},
|
|
3423
3681
|
children: e
|
|
@@ -3427,8 +3685,8 @@ function Xr({ state: e = "", forceVisible: t = !1 }) {
|
|
|
3427
3685
|
}
|
|
3428
3686
|
//#endregion
|
|
3429
3687
|
//#region src/app/connection-state-renderer.tsx
|
|
3430
|
-
function
|
|
3431
|
-
let m =
|
|
3688
|
+
function Ci({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, stores: i, registry: a, client: o, onAction: s, renderIdle: c, renderConnecting: l, renderConnectingSlow: u, renderConnected: d, renderOffline: f, renderError: p }) {
|
|
3689
|
+
let m = j(!1), h = (() => {
|
|
3432
3690
|
switch (e) {
|
|
3433
3691
|
case "waitingForExternalConnectUrl":
|
|
3434
3692
|
case "connecting": return r ? u() : l();
|
|
@@ -3453,221 +3711,235 @@ function Zr({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, sto
|
|
|
3453
3711
|
default: return null;
|
|
3454
3712
|
}
|
|
3455
3713
|
})();
|
|
3456
|
-
return /* @__PURE__ */ F(
|
|
3714
|
+
return /* @__PURE__ */ F(ye, { children: [h, /* @__PURE__ */ P(Si, { state: e })] });
|
|
3457
3715
|
}
|
|
3458
3716
|
//#endregion
|
|
3459
3717
|
//#region src/app/boot-snapshot-variant.ts
|
|
3460
|
-
function
|
|
3718
|
+
function wi(e, t) {
|
|
3461
3719
|
return e === !1 ? !1 : t ? "signed-in" : "guest";
|
|
3462
3720
|
}
|
|
3463
3721
|
//#endregion
|
|
3464
3722
|
//#region src/app/use-ikon-app.ts
|
|
3465
|
-
var
|
|
3466
|
-
function
|
|
3723
|
+
var Ti = v("useIkonApp");
|
|
3724
|
+
function Ei() {
|
|
3467
3725
|
if (typeof window < "u" && window.__IKON_AUTH_CONFIG__) return window.__IKON_AUTH_CONFIG__;
|
|
3468
3726
|
}
|
|
3469
|
-
function
|
|
3727
|
+
function Di() {
|
|
3470
3728
|
if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__) return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
|
|
3471
3729
|
}
|
|
3472
|
-
function
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3730
|
+
function Oi(e, t) {
|
|
3731
|
+
return {
|
|
3732
|
+
...e,
|
|
3733
|
+
...t ?? {}
|
|
3734
|
+
};
|
|
3735
|
+
}
|
|
3736
|
+
function ki(e) {
|
|
3737
|
+
let { authConfig: n, modules: r, parameters: l, timeouts: d, backgroundAudio: g, webRtc: _, audio: v, video: y, websocket: S, webtransport: te, proxy: ne, liveSnapshot: re, bootSnapshot: ie } = e, C = n === void 0 ? Ei() ?? null : n, oe = Di(), w = ti(), se = !!w && w.state.isLoading, T = j(null), ue = j(null), E = j(null), de = j(!1), fe = j(!1), pe = j(g), me = j(d), he = j(_), D = j(v), ge = j(y), _e = j(S), ve = j(te), N = j(ne), ye = j(re), P = j(ie), F = j("local"), be = j(void 0);
|
|
3738
|
+
pe.current = g, me.current = d, he.current = _, D.current = v, ge.current = y, _e.current = S, ve.current = te, N.current = ne, ye.current = re, P.current = ie;
|
|
3739
|
+
let [I, xe] = M("connecting"), [Se, Ce] = M(!1), [we, Te] = M(!1), [Ee, De] = M(null), [Oe, ke] = M(null), [Ae, je] = M(!1), [Me, Ne] = M(!1), [Pe, Fe] = M(!1), [Ie, Le] = M(null), [L, Re] = M(null), [ze, Be] = M(!1), He = j(!1), [R, Ue] = M(0), z = A(() => {
|
|
3476
3740
|
try {
|
|
3477
|
-
return
|
|
3741
|
+
return ce();
|
|
3478
3742
|
} catch {
|
|
3479
3743
|
return { parameters: {} };
|
|
3480
3744
|
}
|
|
3481
|
-
}, []),
|
|
3482
|
-
|
|
3483
|
-
let
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3745
|
+
}, []), We = JSON.stringify(l ?? {}), B = A(() => Oi(z.parameters, l), [z.parameters, We]), Ge = (C?.methods?.length ?? 0) > 0, Ke = wi(ie, Ge && lr());
|
|
3746
|
+
Ke !== !1 && !i() && a(Ke);
|
|
3747
|
+
let V = A(() => {
|
|
3748
|
+
if (!C?.spaceId) return null;
|
|
3749
|
+
let e = w?.state.user;
|
|
3750
|
+
return e ? {
|
|
3751
|
+
token: e.token,
|
|
3752
|
+
provider: e.provider,
|
|
3753
|
+
authenticatedAt: e.authenticatedAt
|
|
3754
|
+
} : rr();
|
|
3755
|
+
}, [
|
|
3756
|
+
C?.spaceId,
|
|
3757
|
+
R,
|
|
3758
|
+
w?.state.isLoading,
|
|
3759
|
+
w?.state.isAuthenticated,
|
|
3760
|
+
w?.state.user?.token
|
|
3761
|
+
]), H = oe?.enabled ?? !1, qe = oe?.host ?? "localhost", U = oe?.port ?? 8443, Je = !se && !!C && !V && !C.requireSignIn && !!C.spaceId && (ae() || H);
|
|
3762
|
+
Je && !L && !ze && !He.current && (He.current = !0, b(C.authUrl).then((e) => vr(C.spaceId, e)).then((e) => {
|
|
3763
|
+
Re(e.token), Be(!0);
|
|
3492
3764
|
}).catch((e) => {
|
|
3493
|
-
|
|
3765
|
+
Ti.error("Anonymous auth failed:", e), He.current = !1, H ? Be(!0) : De(e instanceof Error ? e.message : "Anonymous auth failed");
|
|
3494
3766
|
}));
|
|
3495
|
-
let
|
|
3496
|
-
if (
|
|
3497
|
-
if (
|
|
3498
|
-
if (
|
|
3499
|
-
let e =
|
|
3767
|
+
let W = A(() => {
|
|
3768
|
+
if (se) return null;
|
|
3769
|
+
if (H) {
|
|
3770
|
+
if (Je && !ze) return null;
|
|
3771
|
+
let e = V?.token ?? L ?? void 0, t = e ? ee(e) ?? void 0 : void 0;
|
|
3500
3772
|
return { local: {
|
|
3501
|
-
host:
|
|
3502
|
-
httpsPort:
|
|
3773
|
+
host: qe,
|
|
3774
|
+
httpsPort: U,
|
|
3503
3775
|
userId: t,
|
|
3504
|
-
token:
|
|
3776
|
+
token: V?.token ?? void 0,
|
|
3505
3777
|
identityToken: e,
|
|
3506
|
-
spaceId:
|
|
3507
|
-
backendUrl:
|
|
3508
|
-
authUrl:
|
|
3509
|
-
parameters:
|
|
3778
|
+
spaceId: C?.spaceId,
|
|
3779
|
+
backendUrl: C?.backendUrl,
|
|
3780
|
+
authUrl: C?.authUrl,
|
|
3781
|
+
parameters: B
|
|
3510
3782
|
} };
|
|
3511
3783
|
}
|
|
3512
|
-
return
|
|
3513
|
-
token:
|
|
3514
|
-
spaceId:
|
|
3515
|
-
backendType:
|
|
3516
|
-
sessionIdentityHash:
|
|
3517
|
-
parameters:
|
|
3518
|
-
} } :
|
|
3519
|
-
token:
|
|
3520
|
-
spaceId:
|
|
3521
|
-
backendType:
|
|
3522
|
-
sessionIdentityHash:
|
|
3523
|
-
parameters:
|
|
3784
|
+
return V?.token && C?.spaceId ? { sessionToken: {
|
|
3785
|
+
token: V.token,
|
|
3786
|
+
spaceId: C.spaceId,
|
|
3787
|
+
backendType: x(),
|
|
3788
|
+
sessionIdentityHash: z.sessionIdentityHash,
|
|
3789
|
+
parameters: B
|
|
3790
|
+
} } : L && C?.spaceId ? { sessionToken: {
|
|
3791
|
+
token: L,
|
|
3792
|
+
spaceId: C.spaceId,
|
|
3793
|
+
backendType: x(),
|
|
3794
|
+
sessionIdentityHash: z.sessionIdentityHash,
|
|
3795
|
+
parameters: B
|
|
3524
3796
|
} } : ae() ? null : { local: {
|
|
3525
|
-
host:
|
|
3526
|
-
httpsPort:
|
|
3527
|
-
spaceId:
|
|
3528
|
-
backendUrl:
|
|
3529
|
-
authUrl:
|
|
3530
|
-
parameters:
|
|
3797
|
+
host: qe,
|
|
3798
|
+
httpsPort: U,
|
|
3799
|
+
spaceId: C?.spaceId,
|
|
3800
|
+
backendUrl: C?.backendUrl,
|
|
3801
|
+
authUrl: C?.authUrl,
|
|
3802
|
+
parameters: B
|
|
3531
3803
|
} };
|
|
3532
3804
|
}, [
|
|
3533
|
-
|
|
3805
|
+
se,
|
|
3806
|
+
H,
|
|
3807
|
+
qe,
|
|
3534
3808
|
U,
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
B
|
|
3544
|
-
V.sessionIdentityHash,
|
|
3545
|
-
V.parameters
|
|
3809
|
+
V?.token,
|
|
3810
|
+
C?.spaceId,
|
|
3811
|
+
C?.backendUrl,
|
|
3812
|
+
C?.authUrl,
|
|
3813
|
+
L,
|
|
3814
|
+
Je,
|
|
3815
|
+
ze,
|
|
3816
|
+
z.sessionIdentityHash,
|
|
3817
|
+
B
|
|
3546
3818
|
]);
|
|
3547
|
-
|
|
3548
|
-
let
|
|
3549
|
-
|
|
3550
|
-
if (!
|
|
3551
|
-
if (
|
|
3552
|
-
|
|
3553
|
-
|
|
3819
|
+
F.current = C?.spaceId ?? "local", be.current = V?.token ?? L ?? void 0, un(Ie);
|
|
3820
|
+
let Ye = fn(Ie);
|
|
3821
|
+
k(() => {
|
|
3822
|
+
if (!de.current) {
|
|
3823
|
+
if (de.current = !0, E.current = Yt(), r) for (let e of r) e(E.current);
|
|
3824
|
+
E.current.loadRegisteredModules().catch((e) => {
|
|
3825
|
+
Ti.error("Failed to load UI modules", e);
|
|
3554
3826
|
});
|
|
3555
3827
|
}
|
|
3556
|
-
}, []),
|
|
3557
|
-
if (!
|
|
3828
|
+
}, []), k(() => {
|
|
3829
|
+
if (!W) return;
|
|
3558
3830
|
let e = new u({
|
|
3559
|
-
...
|
|
3560
|
-
timeouts:
|
|
3561
|
-
audio:
|
|
3562
|
-
enabled:
|
|
3563
|
-
...
|
|
3831
|
+
...W,
|
|
3832
|
+
timeouts: me.current,
|
|
3833
|
+
audio: D.current !== void 0 || pe.current ? {
|
|
3834
|
+
enabled: D.current,
|
|
3835
|
+
...pe.current ? { background: {
|
|
3564
3836
|
allowOnDesktop: !0,
|
|
3565
3837
|
allowOnMobile: !0
|
|
3566
3838
|
} } : {}
|
|
3567
3839
|
} : void 0,
|
|
3568
|
-
video:
|
|
3840
|
+
video: ge.current === void 0 ? void 0 : { enabled: ge.current },
|
|
3569
3841
|
mediaSession: {
|
|
3570
3842
|
title: document.title || void 0,
|
|
3571
3843
|
artist: document.title || void 0
|
|
3572
3844
|
},
|
|
3573
|
-
webRtc:
|
|
3574
|
-
websocket:
|
|
3575
|
-
webtransport:
|
|
3576
|
-
proxy:
|
|
3845
|
+
webRtc: he.current === !1 ? { enabled: !1 } : void 0,
|
|
3846
|
+
websocket: _e.current,
|
|
3847
|
+
webtransport: ve.current,
|
|
3848
|
+
proxy: N.current,
|
|
3577
3849
|
onConnectionStateChange: (e) => {
|
|
3578
|
-
|
|
3850
|
+
xe(e);
|
|
3579
3851
|
},
|
|
3580
3852
|
onError: (e) => {
|
|
3581
|
-
|
|
3853
|
+
De(e.message);
|
|
3582
3854
|
}
|
|
3583
3855
|
});
|
|
3584
|
-
|
|
3585
|
-
let n =
|
|
3856
|
+
T.current = e;
|
|
3857
|
+
let n = ye.current ?? !0, r = be.current, i = r ? ee(r) ?? null : null, a = n && i ? {
|
|
3586
3858
|
enabled: !0,
|
|
3587
|
-
appId:
|
|
3859
|
+
appId: F.current,
|
|
3588
3860
|
userId: i
|
|
3589
|
-
} : void 0, l =
|
|
3861
|
+
} : void 0, l = V != null && V.provider !== "anonymous", d = Ge && (l || lr()), g = new Ve({
|
|
3590
3862
|
client: e,
|
|
3591
3863
|
liveSnapshot: a,
|
|
3592
|
-
bootSnapshot:
|
|
3864
|
+
bootSnapshot: wi(P.current, d)
|
|
3593
3865
|
});
|
|
3594
|
-
ue.current = g,
|
|
3866
|
+
ue.current = g, Le(g), Te(!1);
|
|
3595
3867
|
let _ = g.subscribeToUiUpdates(() => {
|
|
3596
|
-
|
|
3868
|
+
Te(!0), le();
|
|
3597
3869
|
});
|
|
3598
3870
|
return e.connect().catch((e) => {
|
|
3599
|
-
if (
|
|
3600
|
-
|
|
3871
|
+
if (Ti.error("Connection failed:", e), e instanceof o) {
|
|
3872
|
+
ke(e.reason);
|
|
3601
3873
|
return;
|
|
3602
3874
|
}
|
|
3603
3875
|
if (e instanceof p) {
|
|
3604
|
-
|
|
3876
|
+
je(!0);
|
|
3605
3877
|
return;
|
|
3606
3878
|
}
|
|
3607
3879
|
if (e instanceof h) {
|
|
3608
|
-
|
|
3880
|
+
Ne(!0);
|
|
3609
3881
|
return;
|
|
3610
3882
|
}
|
|
3611
3883
|
if (!(e instanceof m)) {
|
|
3612
3884
|
if (e instanceof s) {
|
|
3613
|
-
|
|
3885
|
+
Fe(!0);
|
|
3614
3886
|
return;
|
|
3615
3887
|
}
|
|
3616
|
-
e instanceof f || e instanceof c && !
|
|
3888
|
+
e instanceof f || e instanceof c && !fe.current && (fe.current = !0, Ti.warn("Auth session appears stale, clearing and retrying"), t.clearAll(), w ? w.logout() : (ur(), Ue((e) => e + 1)));
|
|
3617
3889
|
}
|
|
3618
3890
|
}), () => {
|
|
3619
|
-
_(), e.disconnect(),
|
|
3891
|
+
_(), e.disconnect(), T.current = null, g.dispose(), ue.current = null;
|
|
3620
3892
|
};
|
|
3621
|
-
}, [
|
|
3622
|
-
let
|
|
3893
|
+
}, [W]);
|
|
3894
|
+
let Xe = O((e, t) => {
|
|
3623
3895
|
let n = typeof t == "string" ? t : JSON.stringify(t ?? {});
|
|
3624
|
-
|
|
3896
|
+
T.current?.sendActionCall(e, n);
|
|
3625
3897
|
}, []);
|
|
3626
|
-
|
|
3627
|
-
if (
|
|
3628
|
-
|
|
3898
|
+
k(() => {
|
|
3899
|
+
if (I !== "connecting") {
|
|
3900
|
+
Ce(!1);
|
|
3629
3901
|
return;
|
|
3630
3902
|
}
|
|
3631
|
-
let e =
|
|
3903
|
+
let e = T.current?.slowConnectionThresholdMs ?? 5e3, t = setTimeout(() => Ce(!0), e);
|
|
3632
3904
|
return () => clearTimeout(t);
|
|
3633
|
-
}, [
|
|
3634
|
-
let
|
|
3635
|
-
return
|
|
3636
|
-
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(
|
|
3637
|
-
}, [
|
|
3638
|
-
connectionState:
|
|
3639
|
-
error:
|
|
3640
|
-
accessDeniedReason:
|
|
3641
|
-
isServerFull:
|
|
3642
|
-
isSessionExpired:
|
|
3643
|
-
isStartupFailed:
|
|
3644
|
-
stores:
|
|
3645
|
-
client:
|
|
3646
|
-
registry:
|
|
3647
|
-
clientRef:
|
|
3905
|
+
}, [I]);
|
|
3906
|
+
let Ze = I === "connected" || I === "reconnecting", Qe = we && I !== "offline";
|
|
3907
|
+
return k(() => {
|
|
3908
|
+
typeof document > "u" || (document.documentElement.dataset.ikonLive = String(Qe));
|
|
3909
|
+
}, [Qe]), {
|
|
3910
|
+
connectionState: I,
|
|
3911
|
+
error: Ee,
|
|
3912
|
+
accessDeniedReason: Oe,
|
|
3913
|
+
isServerFull: Ae,
|
|
3914
|
+
isSessionExpired: Me,
|
|
3915
|
+
isStartupFailed: Pe,
|
|
3916
|
+
stores: Ye,
|
|
3917
|
+
client: T.current,
|
|
3918
|
+
registry: E.current,
|
|
3919
|
+
clientRef: T,
|
|
3648
3920
|
uiRef: ue,
|
|
3649
|
-
registryRef:
|
|
3650
|
-
onAction:
|
|
3651
|
-
isReady:
|
|
3652
|
-
isLive:
|
|
3653
|
-
brandingRequired:
|
|
3654
|
-
isConnectingSlow:
|
|
3655
|
-
webRtcVideoStreams:
|
|
3656
|
-
webRtcTrackMap:
|
|
3921
|
+
registryRef: E,
|
|
3922
|
+
onAction: Xe,
|
|
3923
|
+
isReady: Ze,
|
|
3924
|
+
isLive: Qe,
|
|
3925
|
+
brandingRequired: T.current?.brandingRequired ?? !1,
|
|
3926
|
+
isConnectingSlow: Se,
|
|
3927
|
+
webRtcVideoStreams: T.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
|
|
3928
|
+
webRtcTrackMap: T.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
|
|
3657
3929
|
};
|
|
3658
3930
|
}
|
|
3659
3931
|
//#endregion
|
|
3660
3932
|
//#region src/hooks/use-toasts.ts
|
|
3661
|
-
var
|
|
3662
|
-
function
|
|
3663
|
-
let [n, r] =
|
|
3933
|
+
var Ai = 0;
|
|
3934
|
+
function ji(e = 5, t = 5e3) {
|
|
3935
|
+
let [n, r] = M([]), i = j(/* @__PURE__ */ new Map()), a = O((e) => {
|
|
3664
3936
|
let t = i.current.get(e);
|
|
3665
3937
|
t && (clearTimeout(t), i.current.delete(e)), r((t) => t.filter((t) => t.id !== e));
|
|
3666
3938
|
}, []);
|
|
3667
|
-
return
|
|
3668
|
-
let n = i.current, o =
|
|
3939
|
+
return k(() => {
|
|
3940
|
+
let n = i.current, o = fe((i) => {
|
|
3669
3941
|
if (!oe()) return;
|
|
3670
|
-
let o = `toast-${++
|
|
3942
|
+
let o = `toast-${++Ai}`, s = {
|
|
3671
3943
|
id: o,
|
|
3672
3944
|
level: i.level === d.ERROR ? "error" : "warn",
|
|
3673
3945
|
message: i.message,
|
|
@@ -3695,9 +3967,9 @@ function ii(e = 5, t = 5e3) {
|
|
|
3695
3967
|
}
|
|
3696
3968
|
//#endregion
|
|
3697
3969
|
//#region src/hooks/use-ikon-reactive.ts
|
|
3698
|
-
function
|
|
3699
|
-
let [r, i] =
|
|
3700
|
-
return
|
|
3970
|
+
function Mi(e, t, n) {
|
|
3971
|
+
let [r, i] = M(n);
|
|
3972
|
+
return k(() => {
|
|
3701
3973
|
if (!e) return;
|
|
3702
3974
|
let n = !0, r = null;
|
|
3703
3975
|
return e.reactiveRegistry.subscribe(t, (e) => {
|
|
@@ -3713,9 +3985,9 @@ function ai(e, t, n) {
|
|
|
3713
3985
|
}
|
|
3714
3986
|
//#endregion
|
|
3715
3987
|
//#region src/hooks/use-reactive.ts
|
|
3716
|
-
function
|
|
3717
|
-
let [r, i] =
|
|
3718
|
-
return
|
|
3988
|
+
function Ni(e, t, n) {
|
|
3989
|
+
let [r, i] = M(null);
|
|
3990
|
+
return k(() => {
|
|
3719
3991
|
if (!e) return;
|
|
3720
3992
|
let n = !0;
|
|
3721
3993
|
return e.call("Ikon.Reactive.GetStableIdByName", [t]).then((e) => {
|
|
@@ -3725,56 +3997,56 @@ function oi(e, t, n) {
|
|
|
3725
3997
|
}), () => {
|
|
3726
3998
|
n = !1;
|
|
3727
3999
|
};
|
|
3728
|
-
}, [e, t]),
|
|
4000
|
+
}, [e, t]), Mi(r ? e : null, r ?? "", n);
|
|
3729
4001
|
}
|
|
3730
4002
|
//#endregion
|
|
3731
4003
|
//#region src/app/use-ikon-debug.ts
|
|
3732
|
-
var
|
|
4004
|
+
var Pi = v("IkonDebug"), Fi = {
|
|
3733
4005
|
Digit1: "connecting",
|
|
3734
4006
|
Digit2: "connected",
|
|
3735
4007
|
Digit3: "reconnecting",
|
|
3736
4008
|
Digit4: "offline",
|
|
3737
4009
|
Digit5: "offline",
|
|
3738
4010
|
Digit0: "clear"
|
|
3739
|
-
},
|
|
3740
|
-
function
|
|
3741
|
-
let t = oe(), [n, r] =
|
|
3742
|
-
return
|
|
4011
|
+
}, Ii = "Digit5", Li = "Digit6", Ri = "Synthetic debug error (Ctrl+Shift+5)", zi = "Synthetic debug access-denied (Ctrl+Shift+6)", Bi = 5e3;
|
|
4012
|
+
function Vi(e) {
|
|
4013
|
+
let t = oe(), [n, r] = M(null), [i, a] = M(!1), [o, s] = M(null), [c, l] = M(null), [u, d] = M(!1), [f, p] = M(!1), [m, h] = M(!1);
|
|
4014
|
+
return k(() => {
|
|
3743
4015
|
if (!t) return;
|
|
3744
4016
|
let e = (e) => {
|
|
3745
4017
|
if (!e.ctrlKey || !e.shiftKey) return;
|
|
3746
4018
|
if (e.code === "KeyE") {
|
|
3747
|
-
e.preventDefault(), d((e) => (
|
|
4019
|
+
e.preventDefault(), d((e) => (Pi.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
|
|
3748
4020
|
return;
|
|
3749
4021
|
}
|
|
3750
4022
|
if (e.code === "Digit7") {
|
|
3751
|
-
e.preventDefault(), p((e) => (
|
|
4023
|
+
e.preventDefault(), p((e) => (Pi.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
|
|
3752
4024
|
return;
|
|
3753
4025
|
}
|
|
3754
4026
|
if (e.code === "Digit8") {
|
|
3755
|
-
e.preventDefault(), h((e) => (
|
|
4027
|
+
e.preventDefault(), h((e) => (Pi.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
|
|
3756
4028
|
return;
|
|
3757
4029
|
}
|
|
3758
|
-
if (e.code ===
|
|
3759
|
-
e.preventDefault(), l(
|
|
4030
|
+
if (e.code === Li) {
|
|
4031
|
+
e.preventDefault(), l(zi), r(null), s(null), Pi.warn("Forced access denied");
|
|
3760
4032
|
return;
|
|
3761
4033
|
}
|
|
3762
|
-
let t =
|
|
4034
|
+
let t = Fi[e.code];
|
|
3763
4035
|
if (t === void 0) return;
|
|
3764
4036
|
if (e.preventDefault(), t === "clear") {
|
|
3765
|
-
r(null), s(null), l(null),
|
|
4037
|
+
r(null), s(null), l(null), Pi.warn("Cleared forced state");
|
|
3766
4038
|
return;
|
|
3767
4039
|
}
|
|
3768
|
-
let n = e.code ===
|
|
3769
|
-
r(t), s(n ?
|
|
4040
|
+
let n = e.code === Ii;
|
|
4041
|
+
r(t), s(n ? Ri : null), l(null), Pi.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
|
|
3770
4042
|
};
|
|
3771
4043
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
3772
|
-
}, [t]),
|
|
4044
|
+
}, [t]), k(() => {
|
|
3773
4045
|
if (n !== "connecting") {
|
|
3774
4046
|
a(!1);
|
|
3775
4047
|
return;
|
|
3776
4048
|
}
|
|
3777
|
-
let e = setTimeout(() => a(!0),
|
|
4049
|
+
let e = setTimeout(() => a(!0), Bi);
|
|
3778
4050
|
return () => clearTimeout(e);
|
|
3779
4051
|
}, [n]), !t || n === null && !u && c === null && !f && !m ? {
|
|
3780
4052
|
app: e,
|
|
@@ -3805,64 +4077,64 @@ function mi(e) {
|
|
|
3805
4077
|
}
|
|
3806
4078
|
//#endregion
|
|
3807
4079
|
//#region src/app/ikon-app.tsx
|
|
3808
|
-
function
|
|
4080
|
+
function Hi(e, t) {
|
|
3809
4081
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
3810
4082
|
}
|
|
3811
|
-
function
|
|
4083
|
+
function Ui(e) {
|
|
3812
4084
|
return e === void 0 ? null : typeof e == "function" ? e() : e;
|
|
3813
4085
|
}
|
|
3814
|
-
function
|
|
4086
|
+
function Wi(e, t) {
|
|
3815
4087
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
3816
4088
|
}
|
|
3817
|
-
function
|
|
4089
|
+
function Gi(e, t) {
|
|
3818
4090
|
return e === void 0 ? null : typeof e == "function" ? e(t) : e;
|
|
3819
4091
|
}
|
|
3820
|
-
function
|
|
3821
|
-
let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o =
|
|
4092
|
+
function Ki(e) {
|
|
4093
|
+
let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = Vi(a), { app: s } = o, { connectionState: c, isConnectingSlow: l, stores: u, registry: d, client: f, onAction: p, isReady: m, error: h, accessDeniedReason: g, brandingRequired: _ } = s, v = _ || o.forcedBranding, y = j(null);
|
|
3822
4094
|
u && d && (m || u.size > 0) && (y.current = {
|
|
3823
4095
|
stores: u,
|
|
3824
4096
|
registry: d,
|
|
3825
4097
|
client: f
|
|
3826
4098
|
});
|
|
3827
|
-
let
|
|
3828
|
-
if (
|
|
3829
|
-
!
|
|
3830
|
-
}, [
|
|
3831
|
-
let
|
|
4099
|
+
let b = y.current != null || !!g;
|
|
4100
|
+
if (_e(() => {
|
|
4101
|
+
!b || typeof document > "u" || document.querySelectorAll("[data-ikon-prerender]").forEach((e) => e.remove());
|
|
4102
|
+
}, [b]), g) return Gi(i, g);
|
|
4103
|
+
let x = y.current, S;
|
|
3832
4104
|
switch (c) {
|
|
3833
4105
|
case "waitingForExternalConnectUrl":
|
|
3834
4106
|
case "connecting":
|
|
3835
|
-
|
|
4107
|
+
S = Hi(t, l);
|
|
3836
4108
|
break;
|
|
3837
4109
|
case "reconnecting":
|
|
3838
|
-
|
|
4110
|
+
S = Ui(n);
|
|
3839
4111
|
break;
|
|
3840
4112
|
case "offline":
|
|
3841
|
-
|
|
4113
|
+
S = Wi(r, h);
|
|
3842
4114
|
break;
|
|
3843
|
-
default:
|
|
4115
|
+
default: S = null;
|
|
3844
4116
|
}
|
|
3845
|
-
return /* @__PURE__ */ F(
|
|
3846
|
-
|
|
3847
|
-
stores:
|
|
3848
|
-
registry:
|
|
3849
|
-
client:
|
|
4117
|
+
return /* @__PURE__ */ F(ye, { children: [
|
|
4118
|
+
x && /* @__PURE__ */ P(Be, {
|
|
4119
|
+
stores: x.stores,
|
|
4120
|
+
registry: x.registry,
|
|
4121
|
+
client: x.client,
|
|
3850
4122
|
onAction: p
|
|
3851
4123
|
}),
|
|
3852
|
-
|
|
3853
|
-
v && /* @__PURE__ */ P(
|
|
3854
|
-
/* @__PURE__ */ P(
|
|
3855
|
-
/* @__PURE__ */ P(
|
|
4124
|
+
S,
|
|
4125
|
+
v && /* @__PURE__ */ P(Ji, {}),
|
|
4126
|
+
/* @__PURE__ */ P(Yi, {}),
|
|
4127
|
+
/* @__PURE__ */ P(Si, {
|
|
3856
4128
|
state: c,
|
|
3857
4129
|
forceVisible: o.forcedDebugOverlay
|
|
3858
4130
|
})
|
|
3859
4131
|
] });
|
|
3860
4132
|
}
|
|
3861
|
-
var
|
|
3862
|
-
function
|
|
4133
|
+
var qi = "https://ikonai.com";
|
|
4134
|
+
function Ji() {
|
|
3863
4135
|
return /* @__PURE__ */ F("a", {
|
|
3864
4136
|
className: "ikon-branding-banner",
|
|
3865
|
-
href:
|
|
4137
|
+
href: qi,
|
|
3866
4138
|
target: "_blank",
|
|
3867
4139
|
rel: "noopener noreferrer",
|
|
3868
4140
|
style: {
|
|
@@ -3892,17 +4164,17 @@ function xi() {
|
|
|
3892
4164
|
})]
|
|
3893
4165
|
});
|
|
3894
4166
|
}
|
|
3895
|
-
function
|
|
3896
|
-
let { toasts: e, dismissToast: t } =
|
|
4167
|
+
function Yi() {
|
|
4168
|
+
let { toasts: e, dismissToast: t } = ji();
|
|
3897
4169
|
return e.length === 0 ? null : /* @__PURE__ */ P("div", {
|
|
3898
4170
|
className: "ikon-toast-overlay",
|
|
3899
|
-
children: e.map((e) => /* @__PURE__ */ P(
|
|
4171
|
+
children: e.map((e) => /* @__PURE__ */ P(Xi, {
|
|
3900
4172
|
toast: e,
|
|
3901
4173
|
onDismiss: t
|
|
3902
4174
|
}, e.id))
|
|
3903
4175
|
});
|
|
3904
4176
|
}
|
|
3905
|
-
function
|
|
4177
|
+
function Xi({ toast: e, onDismiss: t }) {
|
|
3906
4178
|
return /* @__PURE__ */ F("div", {
|
|
3907
4179
|
className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${e.level}`,
|
|
3908
4180
|
onClick: () => t(e.id),
|
|
@@ -3928,37 +4200,37 @@ function Ci({ toast: e, onDismiss: t }) {
|
|
|
3928
4200
|
}
|
|
3929
4201
|
//#endregion
|
|
3930
4202
|
//#region src/i18n/i18n.tsx
|
|
3931
|
-
var
|
|
3932
|
-
function
|
|
4203
|
+
var Zi = he(null);
|
|
4204
|
+
function Qi(e, t) {
|
|
3933
4205
|
return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] ?? `{${n}}`) : e;
|
|
3934
4206
|
}
|
|
3935
|
-
function
|
|
4207
|
+
function $i(e, t) {
|
|
3936
4208
|
let n = ne();
|
|
3937
4209
|
if (n && e.includes(n)) return n;
|
|
3938
4210
|
let r = navigator.language.split("-")[0];
|
|
3939
4211
|
return e.includes(r) ? r : t && e.includes(t) ? t : "en";
|
|
3940
4212
|
}
|
|
3941
|
-
function
|
|
3942
|
-
return t ?
|
|
4213
|
+
function ea(e, t, n) {
|
|
4214
|
+
return t ? $i(e, n) : n && e.includes(n) ? n : "en";
|
|
3943
4215
|
}
|
|
3944
|
-
function
|
|
3945
|
-
let i =
|
|
4216
|
+
function ta({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
|
|
4217
|
+
let i = ea(Object.keys(t), r, n), a = t[i] ?? t.en, o = A(() => ({
|
|
3946
4218
|
t: (e, t) => {
|
|
3947
4219
|
let n = a[e];
|
|
3948
|
-
return
|
|
4220
|
+
return Qi(n, t);
|
|
3949
4221
|
},
|
|
3950
4222
|
locale: i,
|
|
3951
4223
|
translations: a
|
|
3952
4224
|
}), [a, i]);
|
|
3953
|
-
return /* @__PURE__ */ P(
|
|
4225
|
+
return /* @__PURE__ */ P(Zi, {
|
|
3954
4226
|
value: o,
|
|
3955
4227
|
children: e
|
|
3956
4228
|
});
|
|
3957
4229
|
}
|
|
3958
|
-
function
|
|
3959
|
-
let e =
|
|
4230
|
+
function na() {
|
|
4231
|
+
let e = ge(Zi);
|
|
3960
4232
|
if (!e) throw Error("useI18n must be used within an I18nProvider");
|
|
3961
4233
|
return e;
|
|
3962
4234
|
}
|
|
3963
4235
|
//#endregion
|
|
3964
|
-
export {
|
|
4236
|
+
export { $r as AuthProvider, Ci as ConnectionStateRenderer, fi as DEBUG_OVERLAY_ENABLED, Si as DebugOverlay, ta as I18nProvider, at as IKON_UI_BASE_MODULE, Et as IKON_UI_MEDIA_MODULE, Wt as IKON_UI_SHADERTOY_MODULE, Ht as IKON_UI_SHADERTOY_TYPE, Re as IKON_UI_STREAM_CATEGORY, bt as IKON_UI_VIDEO_CANVAS_TYPE, xt as IKON_UI_VIDEO_URL_PLAYER_TYPE, Ki as IkonApp, Ve as IkonUi, Jt as IkonUiRegistry, Be as IkonUiSurface, Le as InspectOverlay, $t as ParallaxView, Pe as UiComponentRegistry, Ne as UiRenderer, n as UiStreamStore, vr as authenticateAnonymous, Ar as buildOAuthRedirectUrl, ur as clearAuthSession, kr as clearOAuthParams, it as createBaseResolvers, Fe as createComponentLibrary, Yt as createIkonUiRegistry, Ct as createMediaResolvers, Ut as createShadertoyRendererResolver, ze as isIkonUiCategoryMatch, rr as loadAuthSession, ot as loadBaseModule, Dt as loadMediaModule, Gt as loadShadertoyModule, xr as parseOAuthCallback, Tr as parseOAuthError, T as randomUuid, st as registerBaseModule, Ot as registerMediaModule, Kt as registerShadertoyModule, je as renderChildren, vn as renderMotionLetters, q as saveAuthSession, yr as sendLoginCode, J as sessionToUser, ei as useAuth, di as useAuthGuard, ti as useAuthOptional, na as useI18n, ki as useIkonApp, Vi as useIkonDebug, Mi as useIkonReactive, un as useIkonStyles, fn as useIkonUiStores, Ni as useReactive, ji as useToasts, I as useUiNode, Ie as useUiStore, br as verifyLoginCode };
|