@ikonai/sdk-react-ui 1.0.67 → 1.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { IkonUiCore as fn, UiStreamStore as hn, prefetchBootSnapshot as pn } from "@ikonai/sdk-ui";
2
- import { UiStreamStore as Qs } from "@ikonai/sdk-ui";
3
- import mn, { useSyncExternalStore as nt, useMemo as W, memo as Y, useRef as v, useCallback as D, Fragment as gn, useEffect as C, useState as x, use as rt, createContext as Pt, useReducer as yn } from "react";
4
- import { createLogger as se, isInspectModeEnabled as bn, getOrCreateDeviceId as wn, getSameOriginAuthUrl as Sn, abortSignalTimeout as Lt, deriveAuthUrl as Se, getDebugOverlayParam as En, subscribeToLogEvents as Mt, LogLevel as Xe, parseUrlParams as vn, clearSessionParamsFromUrl as Rn, isCloudEnvironment as lt, extractUserIdFromToken as ut, deriveBackendType as dt, IkonClient as An, AccessDeniedError as Tn, ServerFullError as kn, AuthenticationError as Cn, isDebugModeEnabled as Ut, getLangParam as _n } from "@ikonai/sdk";
5
- import { randomUuid as ti } from "@ikonai/sdk";
6
- var Te = { exports: {} }, pe = {};
1
+ import { IkonUiCore as Rn, UiStreamStore as An, LiveSnapshotCache as Bt, prefetchBootSnapshot as Tn } from "@ikonai/sdk-ui";
2
+ import { UiStreamStore as ui } from "@ikonai/sdk-ui";
3
+ import kn, { useSyncExternalStore as at, useMemo as W, memo as Y, useRef as E, useCallback as D, Fragment as Cn, useEffect as C, useState as N, use as ct, createContext as Ft, useReducer as In } from "react";
4
+ import { createLogger as re, isInspectModeEnabled as _n, getOrCreateDeviceId as On, getSameOriginAuthUrl as Nn, abortSignalTimeout as Vt, deriveAuthUrl as ve, getDebugOverlayParam as xn, subscribeToLogEvents as Wt, LogLevel as Qe, parseUrlParams as Pn, clearSessionParamsFromUrl as Ln, isCloudEnvironment as gt, extractUserIdFromToken as yt, deriveBackendType as bt, IkonClient as Un, AccessDeniedError as Mn, ServerFullError as jn, AuthenticationError as Dn, isDebugModeEnabled as Kt, getLangParam as $n } from "@ikonai/sdk";
5
+ import { randomUuid as fi } from "@ikonai/sdk";
6
+ var Ie = { exports: {} }, me = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,10 +13,10 @@ var Te = { exports: {} }, pe = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var ft;
17
- function In() {
18
- if (ft) return pe;
19
- ft = 1;
16
+ var St;
17
+ function Bn() {
18
+ if (St) return me;
19
+ St = 1;
20
20
  var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
21
21
  function n(r, o, s) {
22
22
  var i = null;
@@ -33,9 +33,9 @@ function In() {
33
33
  props: s
34
34
  };
35
35
  }
36
- return pe.Fragment = e, pe.jsx = n, pe.jsxs = n, pe;
36
+ return me.Fragment = e, me.jsx = n, me.jsxs = n, me;
37
37
  }
38
- var me = {};
38
+ var ge = {};
39
39
  /**
40
40
  * @license React
41
41
  * react-jsx-runtime.development.js
@@ -45,244 +45,244 @@ var me = {};
45
45
  * This source code is licensed under the MIT license found in the
46
46
  * LICENSE file in the root directory of this source tree.
47
47
  */
48
- var ht;
49
- function On() {
50
- return ht || (ht = 1, process.env.NODE_ENV !== "production" && (function() {
51
- function t(h) {
52
- if (h == null) return null;
53
- if (typeof h == "function")
54
- return h.$$typeof === L ? null : h.displayName || h.name || null;
55
- if (typeof h == "string") return h;
56
- switch (h) {
57
- case g:
48
+ var wt;
49
+ function Fn() {
50
+ return wt || (wt = 1, process.env.NODE_ENV !== "production" && (function() {
51
+ function t(f) {
52
+ if (f == null) return null;
53
+ if (typeof f == "function")
54
+ return f.$$typeof === L ? null : f.displayName || f.name || null;
55
+ if (typeof f == "string") return f;
56
+ switch (f) {
57
+ case p:
58
58
  return "Fragment";
59
- case w:
60
- return "Profiler";
61
59
  case b:
60
+ return "Profiler";
61
+ case S:
62
62
  return "StrictMode";
63
- case M:
63
+ case U:
64
64
  return "Suspense";
65
- case J:
65
+ case ee:
66
66
  return "SuspenseList";
67
67
  case _:
68
68
  return "Activity";
69
69
  }
70
- if (typeof h == "object")
71
- switch (typeof h.tag == "number" && console.error(
70
+ if (typeof f == "object")
71
+ switch (typeof f.tag == "number" && console.error(
72
72
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
73
- ), h.$$typeof) {
74
- case m:
73
+ ), f.$$typeof) {
74
+ case g:
75
75
  return "Portal";
76
- case E:
77
- return h.displayName || "Context";
76
+ case v:
77
+ return f.displayName || "Context";
78
78
  case R:
79
- return (h._context.displayName || "Context") + ".Consumer";
79
+ return (f._context.displayName || "Context") + ".Consumer";
80
80
  case T:
81
- var A = h.render;
82
- return h = h.displayName, h || (h = A.displayName || A.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
83
- case Q:
84
- return A = h.displayName || null, A !== null ? A : t(h.type) || "Memo";
85
- case X:
86
- A = h._payload, h = h._init;
81
+ var A = f.render;
82
+ return f = f.displayName, f || (f = A.displayName || A.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
83
+ case te:
84
+ return A = f.displayName || null, A !== null ? A : t(f.type) || "Memo";
85
+ case z:
86
+ A = f._payload, f = f._init;
87
87
  try {
88
- return t(h(A));
88
+ return t(f(A));
89
89
  } catch {
90
90
  }
91
91
  }
92
92
  return null;
93
93
  }
94
- function e(h) {
95
- return "" + h;
94
+ function e(f) {
95
+ return "" + f;
96
96
  }
97
- function n(h) {
97
+ function n(f) {
98
98
  try {
99
- e(h);
99
+ e(f);
100
100
  var A = !1;
101
101
  } catch {
102
102
  A = !0;
103
103
  }
104
104
  if (A) {
105
105
  A = console;
106
- var N = A.error, P = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
107
- return N.call(
106
+ var O = A.error, x = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
107
+ return O.call(
108
108
  A,
109
109
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
110
- P
111
- ), e(h);
110
+ x
111
+ ), e(f);
112
112
  }
113
113
  }
114
- function r(h) {
115
- if (h === g) return "<>";
116
- if (typeof h == "object" && h !== null && h.$$typeof === X)
114
+ function r(f) {
115
+ if (f === p) return "<>";
116
+ if (typeof f == "object" && f !== null && f.$$typeof === z)
117
117
  return "<...>";
118
118
  try {
119
- var A = t(h);
119
+ var A = t(f);
120
120
  return A ? "<" + A + ">" : "<...>";
121
121
  } catch {
122
122
  return "<...>";
123
123
  }
124
124
  }
125
125
  function o() {
126
- var h = U.A;
127
- return h === null ? null : h.getOwner();
126
+ var f = M.A;
127
+ return f === null ? null : f.getOwner();
128
128
  }
129
129
  function s() {
130
130
  return Error("react-stack-top-frame");
131
131
  }
132
- function i(h) {
133
- if (F.call(h, "key")) {
134
- var A = Object.getOwnPropertyDescriptor(h, "key").get;
132
+ function i(f) {
133
+ if (B.call(f, "key")) {
134
+ var A = Object.getOwnPropertyDescriptor(f, "key").get;
135
135
  if (A && A.isReactWarning) return !1;
136
136
  }
137
- return h.key !== void 0;
137
+ return f.key !== void 0;
138
138
  }
139
- function a(h, A) {
140
- function N() {
139
+ function a(f, A) {
140
+ function O() {
141
141
  K || (K = !0, console.error(
142
142
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
143
143
  A
144
144
  ));
145
145
  }
146
- N.isReactWarning = !0, Object.defineProperty(h, "key", {
147
- get: N,
146
+ O.isReactWarning = !0, Object.defineProperty(f, "key", {
147
+ get: O,
148
148
  configurable: !0
149
149
  });
150
150
  }
151
151
  function l() {
152
- var h = t(this.type);
153
- return ve[h] || (ve[h] = !0, console.error(
152
+ var f = t(this.type);
153
+ return H[f] || (H[f] = !0, console.error(
154
154
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
155
- )), h = this.props.ref, h !== void 0 ? h : null;
155
+ )), f = this.props.ref, f !== void 0 ? f : null;
156
156
  }
157
- function f(h, A, N, P, ee, he) {
158
- var O = N.ref;
159
- return h = {
160
- $$typeof: d,
161
- type: h,
157
+ function d(f, A, O, x, oe, pe) {
158
+ var P = O.ref;
159
+ return f = {
160
+ $$typeof: u,
161
+ type: f,
162
162
  key: A,
163
- props: N,
164
- _owner: P
165
- }, (O !== void 0 ? O : null) !== null ? Object.defineProperty(h, "ref", {
163
+ props: O,
164
+ _owner: x
165
+ }, (P !== void 0 ? P : null) !== null ? Object.defineProperty(f, "ref", {
166
166
  enumerable: !1,
167
167
  get: l
168
- }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
168
+ }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
169
169
  configurable: !1,
170
170
  enumerable: !1,
171
171
  writable: !0,
172
172
  value: 0
173
- }), Object.defineProperty(h, "_debugInfo", {
173
+ }), Object.defineProperty(f, "_debugInfo", {
174
174
  configurable: !1,
175
175
  enumerable: !1,
176
176
  writable: !0,
177
177
  value: null
178
- }), Object.defineProperty(h, "_debugStack", {
178
+ }), Object.defineProperty(f, "_debugStack", {
179
179
  configurable: !1,
180
180
  enumerable: !1,
181
181
  writable: !0,
182
- value: ee
183
- }), Object.defineProperty(h, "_debugTask", {
182
+ value: oe
183
+ }), Object.defineProperty(f, "_debugTask", {
184
184
  configurable: !1,
185
185
  enumerable: !1,
186
186
  writable: !0,
187
- value: he
188
- }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
189
- }
190
- function p(h, A, N, P, ee, he) {
191
- var O = A.children;
192
- if (O !== void 0)
193
- if (P)
194
- if (B(O)) {
195
- for (P = 0; P < O.length; P++)
196
- y(O[P]);
197
- Object.freeze && Object.freeze(O);
187
+ value: pe
188
+ }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
189
+ }
190
+ function h(f, A, O, x, oe, pe) {
191
+ var P = A.children;
192
+ if (P !== void 0)
193
+ if (x)
194
+ if ($(P)) {
195
+ for (x = 0; x < P.length; x++)
196
+ y(P[x]);
197
+ Object.freeze && Object.freeze(P);
198
198
  } else
199
199
  console.error(
200
200
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
201
  );
202
- else y(O);
203
- if (F.call(A, "key")) {
204
- O = t(h);
205
- var Z = Object.keys(A).filter(function(Me) {
206
- return Me !== "key";
202
+ else y(P);
203
+ if (B.call(A, "key")) {
204
+ P = t(f);
205
+ var Q = Object.keys(A).filter(function(De) {
206
+ return De !== "key";
207
207
  });
208
- P = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", fe[O + P] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ x = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", he[P + x] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
209
209
  `A props object containing a "key" prop is being spread into JSX:
210
210
  let props = %s;
211
211
  <%s {...props} />
212
212
  React keys must be passed directly to JSX without using spread:
213
213
  let props = %s;
214
214
  <%s key={someKey} {...props} />`,
215
+ x,
215
216
  P,
216
- O,
217
- Z,
218
- O
219
- ), fe[O + P] = !0);
217
+ Q,
218
+ P
219
+ ), he[P + x] = !0);
220
220
  }
221
- if (O = null, N !== void 0 && (n(N), O = "" + N), i(A) && (n(A.key), O = "" + A.key), "key" in A) {
222
- N = {};
223
- for (var te in A)
224
- te !== "key" && (N[te] = A[te]);
225
- } else N = A;
226
- return O && a(
227
- N,
228
- typeof h == "function" ? h.displayName || h.name || "Unknown" : h
229
- ), f(
230
- h,
221
+ if (P = null, O !== void 0 && (n(O), P = "" + O), i(A) && (n(A.key), P = "" + A.key), "key" in A) {
222
+ O = {};
223
+ for (var se in A)
224
+ se !== "key" && (O[se] = A[se]);
225
+ } else O = A;
226
+ return P && a(
227
+ O,
228
+ typeof f == "function" ? f.displayName || f.name || "Unknown" : f
229
+ ), d(
230
+ f,
231
+ P,
231
232
  O,
232
- N,
233
233
  o(),
234
- ee,
235
- he
234
+ oe,
235
+ pe
236
236
  );
237
237
  }
238
- function y(h) {
239
- u(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === X && (h._payload.status === "fulfilled" ? u(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
238
+ function y(f) {
239
+ m(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === z && (f._payload.status === "fulfilled" ? m(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
240
240
  }
241
- function u(h) {
242
- return typeof h == "object" && h !== null && h.$$typeof === d;
241
+ function m(f) {
242
+ return typeof f == "object" && f !== null && f.$$typeof === u;
243
243
  }
244
- var c = mn, d = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), E = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), X = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), U = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, B = Array.isArray, $ = console.createTask ? console.createTask : function() {
244
+ var c = kn, u = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), R = Symbol.for("react.consumer"), v = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), M = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, $ = Array.isArray, V = console.createTask ? console.createTask : function() {
245
245
  return null;
246
246
  };
247
247
  c = {
248
- react_stack_bottom_frame: function(h) {
249
- return h();
248
+ react_stack_bottom_frame: function(f) {
249
+ return f();
250
250
  }
251
251
  };
252
- var K, ve = {}, de = c.react_stack_bottom_frame.bind(
252
+ var K, H = {}, Re = c.react_stack_bottom_frame.bind(
253
253
  c,
254
254
  s
255
- )(), Re = $(r(s)), fe = {};
256
- me.Fragment = g, me.jsx = function(h, A, N) {
257
- var P = 1e4 > U.recentlyCreatedOwnerStacks++;
258
- return p(
259
- h,
255
+ )(), Ae = V(r(s)), he = {};
256
+ ge.Fragment = p, ge.jsx = function(f, A, O) {
257
+ var x = 1e4 > M.recentlyCreatedOwnerStacks++;
258
+ return h(
259
+ f,
260
260
  A,
261
- N,
261
+ O,
262
262
  !1,
263
- P ? Error("react-stack-top-frame") : de,
264
- P ? $(r(h)) : Re
263
+ x ? Error("react-stack-top-frame") : Re,
264
+ x ? V(r(f)) : Ae
265
265
  );
266
- }, me.jsxs = function(h, A, N) {
267
- var P = 1e4 > U.recentlyCreatedOwnerStacks++;
268
- return p(
269
- h,
266
+ }, ge.jsxs = function(f, A, O) {
267
+ var x = 1e4 > M.recentlyCreatedOwnerStacks++;
268
+ return h(
269
+ f,
270
270
  A,
271
- N,
271
+ O,
272
272
  !0,
273
- P ? Error("react-stack-top-frame") : de,
274
- P ? $(r(h)) : Re
273
+ x ? Error("react-stack-top-frame") : Re,
274
+ x ? V(r(f)) : Ae
275
275
  );
276
276
  };
277
- })()), me;
277
+ })()), ge;
278
278
  }
279
- var pt;
280
- function Nn() {
281
- return pt || (pt = 1, process.env.NODE_ENV === "production" ? Te.exports = In() : Te.exports = On()), Te.exports;
279
+ var vt;
280
+ function Vn() {
281
+ return vt || (vt = 1, process.env.NODE_ENV === "production" ? Ie.exports = Bn() : Ie.exports = Fn()), Ie.exports;
282
282
  }
283
- var S = Nn();
284
- function xn(t, e) {
285
- const n = nt(
283
+ var w = Vn();
284
+ function Wn(t, e) {
285
+ const n = at(
286
286
  (r) => t.subscribe(r),
287
287
  () => {
288
288
  const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
@@ -301,16 +301,16 @@ function xn(t, e) {
301
301
  };
302
302
  }, [n]);
303
303
  }
304
- function q(t, e) {
305
- const n = nt(
304
+ function Z(t, e) {
305
+ const n = at(
306
306
  (r) => t.subscribeNode(e, r),
307
307
  () => t.getNodeVersion(e),
308
308
  () => t.getNodeVersion(e)
309
309
  );
310
310
  return W(() => t.getNode(e), [t, e, n]);
311
311
  }
312
- const Pn = se("UIRenderer");
313
- function Ln(t) {
312
+ const Kn = re("UIRenderer");
313
+ function Gn(t) {
314
314
  if (t === void 0)
315
315
  return "{}";
316
316
  if (typeof t == "string")
@@ -321,18 +321,18 @@ function Ln(t) {
321
321
  return "{}";
322
322
  }
323
323
  }
324
- function Mn(t) {
324
+ function Yn(t) {
325
325
  const e = t.styleIds;
326
326
  return Array.isArray(e) ? e : [];
327
327
  }
328
- function Un(t) {
328
+ function zn(t) {
329
329
  const e = t.children;
330
330
  return Array.isArray(e) ? e : [];
331
331
  }
332
- function jn(t, e) {
332
+ function Xn(t, e) {
333
333
  return t.nodeId === e.nodeId && t.context === e.context;
334
334
  }
335
- function Dn(t) {
335
+ function Hn(t) {
336
336
  if (t.length === 0) return "";
337
337
  if (t.length === 1) return t[0].id;
338
338
  let e = t[0].id;
@@ -340,51 +340,51 @@ function Dn(t) {
340
340
  e += "," + t[n].id;
341
341
  return e;
342
342
  }
343
- const He = Y(function t({ nodeId: e, context: n }) {
344
- const r = q(n.store, e), o = r ? Un(r) : [], s = Dn(o), i = W(
345
- () => o.length === 0 ? null : o.map((y) => /* @__PURE__ */ S.jsx(t, { nodeId: y.id, context: n }, y.id)),
343
+ const et = Y(function t({ nodeId: e, context: n }) {
344
+ const r = Z(n.store, e), o = r ? zn(r) : [], s = Hn(o), i = W(
345
+ () => o.length === 0 ? null : o.map((y) => /* @__PURE__ */ w.jsx(t, { nodeId: y.id, context: n }, y.id)),
346
346
  // eslint-disable-next-line react-hooks/exhaustive-deps
347
347
  [s, n]
348
348
  );
349
349
  if (!r)
350
350
  return null;
351
351
  if (r.type === "root")
352
- return /* @__PURE__ */ S.jsx(gn, { children: i }, r.id);
352
+ return /* @__PURE__ */ w.jsx(Cn, { children: i }, r.id);
353
353
  const a = n.library.resolve(r);
354
354
  if (!a)
355
- return Pn.warn(`No renderer for node type ${r.type}`), null;
356
- const l = Mn(r), f = l.length > 0 ? l.join(" ") : void 0, p = a;
357
- return /* @__PURE__ */ S.jsx(p, { nodeId: e, context: n, className: f });
358
- }, jn);
359
- function $n(t, e) {
360
- return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ S.jsx(He, { nodeId: n.id, context: e }, n.id));
361
- }
362
- function Bn(t, e) {
355
+ return Kn.warn(`No renderer for node type ${r.type}`), null;
356
+ const l = Yn(r), d = l.length > 0 ? l.join(" ") : void 0, h = a;
357
+ return /* @__PURE__ */ w.jsx(h, { nodeId: e, context: n, className: d });
358
+ }, Xn);
359
+ function qn(t, e) {
360
+ return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ w.jsx(et, { nodeId: n.id, context: e }, n.id));
361
+ }
362
+ function Jn(t, e) {
363
363
  return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
364
364
  }
365
- const Fn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
366
- const { rootViewId: l, rootNodeId: f } = xn(e, r), p = v(s);
367
- p.current = s;
368
- const y = v(i);
365
+ const Zn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
366
+ const { rootViewId: l, rootNodeId: d } = Wn(e, r), h = E(s);
367
+ h.current = s;
368
+ const y = E(i);
369
369
  y.current = i;
370
- const u = v(a);
371
- u.current = a;
372
- const c = D((m, g) => {
373
- if (!m)
370
+ const m = E(a);
371
+ m.current = a;
372
+ const c = D((g, p) => {
373
+ if (!g)
374
374
  return;
375
- const b = Ln(g);
376
- p.current?.(m, b);
377
- }, []), d = W(() => {
378
- const m = {
375
+ const S = Gn(p);
376
+ h.current?.(g, S);
377
+ }, []), u = W(() => {
378
+ const g = {
379
379
  store: e,
380
380
  library: n,
381
381
  handlerCache: e.handlerCache,
382
382
  // Access payloads from store at call time, not captured snapshot
383
- getPayload: (g) => e.getSnapshot().payloads.get(g),
384
- renderChildren: (g) => $n(g, m),
385
- renderView: (g) => {
386
- const b = e.getSnapshot().views.get(g);
387
- return b ? /* @__PURE__ */ S.jsx(He, { nodeId: b.id, context: m }) : null;
383
+ getPayload: (p) => e.getSnapshot().payloads.get(p),
384
+ renderChildren: (p) => qn(p, g),
385
+ renderView: (p) => {
386
+ const S = e.getSnapshot().views.get(p);
387
+ return S ? /* @__PURE__ */ w.jsx(et, { nodeId: S.id, context: g }) : null;
388
388
  },
389
389
  dispatchAction: c,
390
390
  // Access client/video via refs to avoid context recreation
@@ -392,14 +392,14 @@ const Fn = Y(function({ store: e, library: n, viewId: r, emptyFallback: o = null
392
392
  return y.current;
393
393
  },
394
394
  get video() {
395
- return u.current;
395
+ return m.current;
396
396
  }
397
397
  };
398
- return m;
398
+ return g;
399
399
  }, [e, n, c]);
400
- return !l || !f ? o : /* @__PURE__ */ S.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ S.jsx(He, { nodeId: f, context: d }) });
401
- }, Bn);
402
- class Vn {
400
+ return !l || !d ? o : /* @__PURE__ */ w.jsx("div", { "data-ikon-view-id": l, style: { display: "contents" }, children: /* @__PURE__ */ w.jsx(et, { nodeId: d, context: u }) });
401
+ }, Jn);
402
+ class Qn {
403
403
  constructor(e, n) {
404
404
  if (this.fallback = n, e)
405
405
  for (const [r, o] of e)
@@ -416,19 +416,19 @@ class Vn {
416
416
  return this.renderers.get(e.type) ?? this.fallback;
417
417
  }
418
418
  }
419
- function Ms(t, e) {
419
+ function Ys(t, e) {
420
420
  const n = Object.entries(t);
421
- return new Vn(n, e);
421
+ return new Qn(n, e);
422
422
  }
423
- function Us(t) {
424
- return nt(
423
+ function zs(t) {
424
+ return at(
425
425
  (e) => t.subscribe(e),
426
426
  () => t.getSnapshot(),
427
427
  () => t.getSnapshot()
428
428
  );
429
429
  }
430
- function Wn() {
431
- const t = bn();
430
+ function er() {
431
+ const t = _n();
432
432
  return C(() => {
433
433
  if (!t)
434
434
  return;
@@ -439,149 +439,149 @@ function Wn() {
439
439
  n && !r.includes(n) && (n.style.outline = "", n.style.outlineOffset = ""), n = null, o.style.display = "none";
440
440
  }
441
441
  function i(c) {
442
- for (const m of r)
443
- m !== n && (m.style.outline = "", m.style.outlineOffset = "");
442
+ for (const g of r)
443
+ g !== n && (g.style.outline = "", g.style.outlineOffset = "");
444
444
  r = [];
445
- const d = new Set(c);
446
- for (const m of Array.from(document.querySelectorAll("[data-ikon-source]"))) {
447
- const g = m.getAttribute("data-ikon-source") ?? "";
448
- d.has(g) && (m.style.outline = "2px solid #a6e3a1", m.style.outlineOffset = "1px", r.push(m));
445
+ const u = new Set(c);
446
+ for (const g of Array.from(document.querySelectorAll("[data-ikon-source]"))) {
447
+ const p = g.getAttribute("data-ikon-source") ?? "";
448
+ u.has(p) && (g.style.outline = "2px solid #a6e3a1", g.style.outlineOffset = "1px", r.push(g));
449
449
  }
450
450
  }
451
451
  function a(c) {
452
452
  if (!e)
453
453
  return;
454
- const d = c.target.closest?.("[data-ikon-source]");
455
- if (!d || d === n)
454
+ const u = c.target.closest?.("[data-ikon-source]");
455
+ if (!u || u === n)
456
456
  return;
457
- s(), n = d, n.style.outline = "2px solid #89b4fa", n.style.outlineOffset = "1px";
458
- const m = d.getAttribute("data-ikon-source") ?? "";
459
- o.textContent = m, o.style.display = "block";
460
- const g = d.getBoundingClientRect();
461
- o.style.left = `${g.left}px`, o.style.top = `${Math.max(0, g.top - 24)}px`;
457
+ s(), n = u, n.style.outline = "2px solid #89b4fa", n.style.outlineOffset = "1px";
458
+ const g = u.getAttribute("data-ikon-source") ?? "";
459
+ o.textContent = g, o.style.display = "block";
460
+ const p = u.getBoundingClientRect();
461
+ o.style.left = `${p.left}px`, o.style.top = `${Math.max(0, p.top - 24)}px`;
462
462
  }
463
463
  function l(c) {
464
464
  if (!e)
465
465
  return;
466
466
  c.relatedTarget?.closest?.("[data-ikon-source]") !== n && s();
467
467
  }
468
- function f(c) {
468
+ function d(c) {
469
469
  if (!e)
470
470
  return;
471
- const d = c.target.closest?.("[data-ikon-source]");
472
- if (!d)
471
+ const u = c.target.closest?.("[data-ikon-source]");
472
+ if (!u)
473
473
  return;
474
474
  c.preventDefault(), c.stopPropagation();
475
- const m = {
476
- sourceMarker: d.getAttribute("data-ikon-source") ?? "",
477
- tagName: d.tagName.toLowerCase(),
478
- textContent: (d.textContent ?? "").trim().substring(0, 200)
475
+ const g = {
476
+ sourceMarker: u.getAttribute("data-ikon-source") ?? "",
477
+ tagName: u.tagName.toLowerCase(),
478
+ textContent: (u.textContent ?? "").trim().substring(0, 200)
479
479
  };
480
- window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
480
+ window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: g })), window.parent.postMessage({ type: "ikon-element-selected", payload: g }, "*");
481
481
  }
482
- function p(c, d) {
483
- return document.elementFromPoint(c, d)?.closest?.("[data-ikon-source]");
482
+ function h(c, u) {
483
+ return document.elementFromPoint(c, u)?.closest?.("[data-ikon-source]");
484
484
  }
485
485
  function y(c) {
486
486
  if (c === n || (s(), !c))
487
487
  return;
488
488
  n = c, n.style.outline = `2px solid ${r.includes(c) ? "#a6e3a1" : "#89b4fa"}`, n.style.outlineOffset = "1px";
489
- const d = c.getAttribute("data-ikon-source") ?? "";
490
- o.textContent = d, o.style.display = "block";
491
- const m = c.getBoundingClientRect();
492
- o.style.left = `${m.left}px`, o.style.top = `${Math.max(0, m.top - 24)}px`;
489
+ const u = c.getAttribute("data-ikon-source") ?? "";
490
+ o.textContent = u, o.style.display = "block";
491
+ const g = c.getBoundingClientRect();
492
+ o.style.left = `${g.left}px`, o.style.top = `${Math.max(0, g.top - 24)}px`;
493
493
  }
494
- function u(c) {
494
+ function m(c) {
495
495
  if (c.data?.type === "ikon-inspect-mode") {
496
- const d = !!c.data.enabled;
497
- !d && e && s(), e = d;
496
+ const u = !!c.data.enabled;
497
+ !u && e && s(), e = u;
498
498
  return;
499
499
  }
500
500
  if (c.data?.type === "ikon-inspect-at") {
501
- const d = p(c.data.x, c.data.y);
502
- y(d);
503
- const m = d?.getAttribute("data-ikon-source") ?? "";
501
+ const u = h(c.data.x, c.data.y);
502
+ y(u);
503
+ const g = u?.getAttribute("data-ikon-source") ?? "";
504
504
  window.parent.postMessage({
505
505
  type: "ikon-inspect-hover-result",
506
- payload: { sourceMarker: m }
506
+ payload: { sourceMarker: g }
507
507
  }, "*");
508
508
  }
509
509
  if (c.data?.type === "ikon-inspect-click") {
510
- const d = p(c.data.x, c.data.y);
511
- if (d) {
512
- const m = {
513
- sourceMarker: d.getAttribute("data-ikon-source") ?? "",
514
- tagName: d.tagName.toLowerCase(),
515
- textContent: (d.textContent ?? "").trim().substring(0, 200)
510
+ const u = h(c.data.x, c.data.y);
511
+ if (u) {
512
+ const g = {
513
+ sourceMarker: u.getAttribute("data-ikon-source") ?? "",
514
+ tagName: u.tagName.toLowerCase(),
515
+ textContent: (u.textContent ?? "").trim().substring(0, 200)
516
516
  };
517
- window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
517
+ window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: g })), window.parent.postMessage({ type: "ikon-element-selected", payload: g }, "*");
518
518
  }
519
519
  }
520
520
  if (c.data?.type === "ikon-inspect-click-add") {
521
- const d = p(c.data.x, c.data.y);
522
- if (d) {
523
- const m = {
524
- sourceMarker: d.getAttribute("data-ikon-source") ?? "",
525
- tagName: d.tagName.toLowerCase(),
526
- textContent: (d.textContent ?? "").trim().substring(0, 200)
521
+ const u = h(c.data.x, c.data.y);
522
+ if (u) {
523
+ const g = {
524
+ sourceMarker: u.getAttribute("data-ikon-source") ?? "",
525
+ tagName: u.tagName.toLowerCase(),
526
+ textContent: (u.textContent ?? "").trim().substring(0, 200)
527
527
  };
528
528
  window.parent.postMessage({
529
529
  type: "ikon-inspect-rect-result",
530
- payload: { elements: [m], append: !0 }
530
+ payload: { elements: [g], append: !0 }
531
531
  }, "*");
532
532
  }
533
533
  }
534
534
  if (c.data?.type === "ikon-inspect-rect") {
535
- const { x1: d, y1: m, x2: g, y2: b, append: w } = c.data, R = document.querySelectorAll("[data-ikon-source]"), E = [];
535
+ const { x1: u, y1: g, x2: p, y2: S, append: b } = c.data, R = document.querySelectorAll("[data-ikon-source]"), v = [];
536
536
  for (const T of Array.from(R)) {
537
- const M = T.getBoundingClientRect();
538
- M.right > d && M.left < g && M.bottom > m && M.top < b && E.push({
537
+ const U = T.getBoundingClientRect();
538
+ U.right > u && U.left < p && U.bottom > g && U.top < S && v.push({
539
539
  sourceMarker: T.getAttribute("data-ikon-source") ?? "",
540
540
  tagName: T.tagName.toLowerCase(),
541
541
  textContent: (T.textContent ?? "").trim().substring(0, 200)
542
542
  });
543
543
  }
544
- E.length > 0 && window.parent.postMessage({
544
+ v.length > 0 && window.parent.postMessage({
545
545
  type: "ikon-inspect-rect-result",
546
- payload: { elements: E, append: w ?? !1 }
546
+ payload: { elements: v, append: b ?? !1 }
547
547
  }, "*");
548
548
  }
549
549
  c.data?.type === "ikon-inspect-highlight" && i(c.data.markers ?? []), c.data?.type === "ikon-inspect-clear" && s();
550
550
  }
551
- return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", f, !0), window.addEventListener("message", u), () => {
552
- document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", f, !0), window.removeEventListener("message", u), s(), i([]), o.remove();
551
+ return document.addEventListener("mouseover", a, !0), document.addEventListener("mouseout", l, !0), document.addEventListener("click", d, !0), window.addEventListener("message", m), () => {
552
+ document.removeEventListener("mouseover", a, !0), document.removeEventListener("mouseout", l, !0), document.removeEventListener("click", d, !0), window.removeEventListener("message", m), s(), i([]), o.remove();
553
553
  };
554
554
  }, [t]), null;
555
555
  }
556
- const Kn = se("IkonUiSurface"), qe = "ikon-ui";
557
- function Gn(t, e) {
556
+ const tr = re("IkonUiSurface"), tt = "ikon-ui";
557
+ function nr(t, e) {
558
558
  return t === e;
559
559
  }
560
- const jt = Y(function({ stores: e, registry: n, category: r = qe, onAction: o, client: s }) {
561
- const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
560
+ const Gt = Y(function({ stores: e, registry: n, category: r = tt, onAction: o, client: s }) {
561
+ const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
562
562
  a.current = o;
563
- const l = v(s);
563
+ const l = E(s);
564
564
  l.current = s;
565
- const f = W(
565
+ const d = W(
566
566
  () => {
567
- const u = [];
568
- for (const [c, d] of e) {
569
- const m = d.store.getSnapshot();
570
- Gn(d.category, r) && (!m.rootViewId || !m.views.has(m.rootViewId) || u.push({ key: c, store: d.store }));
567
+ const m = [];
568
+ for (const [c, u] of e) {
569
+ const g = u.store.getSnapshot();
570
+ nr(u.category, r) && (!g.rootViewId || !g.views.has(g.rootViewId) || m.push({ key: c, store: u.store }));
571
571
  }
572
- return u;
572
+ return m;
573
573
  },
574
574
  // eslint-disable-next-line react-hooks/exhaustive-deps
575
575
  [e, r, i]
576
- ), p = v(!1), y = f.length > 0;
576
+ ), h = E(!1), y = d.length > 0;
577
577
  return C(() => {
578
- y && !p.current && (p.current = !0, Kn.debug("First UI render"));
579
- }, [y]), y ? /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
580
- /* @__PURE__ */ S.jsx(Wn, {}),
581
- f.map(({ key: u, store: c }) => /* @__PURE__ */ S.jsx(Fn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, u))
578
+ y && !h.current && (h.current = !0, tr.debug("First UI render"));
579
+ }, [y]), y ? /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
580
+ /* @__PURE__ */ w.jsx(er, {}),
581
+ d.map(({ key: m, store: c }) => /* @__PURE__ */ w.jsx(Zn, { store: c, library: n, onAction: a.current, client: l.current, video: l.current?.media?.video }, m))
582
582
  ] }) : null;
583
583
  });
584
- class Yn {
584
+ class rr {
585
585
  core;
586
586
  ownsCore;
587
587
  stores = /* @__PURE__ */ new Map();
@@ -589,7 +589,7 @@ class Yn {
589
589
  unsubscribeClears;
590
590
  unsubscribeStoreChanges;
591
591
  constructor(e) {
592
- this.core = e?.core ?? new fn({ client: e?.client, cache: e?.cache }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
592
+ this.core = e?.core ?? new Rn({ client: e?.client, liveSnapshot: e?.liveSnapshot, bootSnapshot: e?.bootSnapshot }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
593
593
  }
594
594
  dispose() {
595
595
  this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
@@ -605,6 +605,12 @@ class Yn {
605
605
  this.listeners.delete(e);
606
606
  };
607
607
  }
608
+ // Fires only for live server UI updates, never for the seeded boot snapshot or live snapshot
609
+ // (those bypass the update pipeline). The first call therefore marks the moment the live tree
610
+ // supersedes the pre-rendered one.
611
+ subscribeToUiUpdates(e) {
612
+ return this.core.subscribeToUiUpdates(e);
613
+ }
608
614
  subscribeToStyles(e) {
609
615
  return this.core.subscribeToUiStyles(e);
610
616
  }
@@ -639,8 +645,8 @@ class Yn {
639
645
  if (n)
640
646
  return n;
641
647
  const r = {
642
- category: qe,
643
- store: new hn()
648
+ category: tt,
649
+ store: new An()
644
650
  };
645
651
  return this.stores.set(e, r), r;
646
652
  }
@@ -648,7 +654,7 @@ class Yn {
648
654
  const r = this.stores.get(e);
649
655
  if (!r)
650
656
  return !1;
651
- const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? qe;
657
+ const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? tt;
652
658
  return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
653
659
  }
654
660
  notify(e) {
@@ -656,13 +662,13 @@ class Yn {
656
662
  n(e);
657
663
  }
658
664
  }
659
- function zn(t) {
665
+ function or(t) {
660
666
  if (typeof t == "string") {
661
667
  const e = t.trim();
662
668
  return e.length > 0 ? e : void 0;
663
669
  }
664
670
  }
665
- function le(t) {
671
+ function de(t) {
666
672
  if (typeof t == "string") {
667
673
  const e = t.trim();
668
674
  return e.length > 0 ? e : void 0;
@@ -672,7 +678,7 @@ function le(t) {
672
678
  return e.length > 0 ? e.join(" ") : void 0;
673
679
  }
674
680
  }
675
- function ot(...t) {
681
+ function lt(...t) {
676
682
  let e = "";
677
683
  for (const n of t)
678
684
  if (n) {
@@ -681,19 +687,19 @@ function ot(...t) {
681
687
  }
682
688
  return e || void 0;
683
689
  }
684
- const mt = /* @__PURE__ */ new WeakMap(), Xn = {};
685
- function st(t) {
690
+ const Et = /* @__PURE__ */ new WeakMap(), sr = {};
691
+ function ut(t) {
686
692
  if (!t)
687
- return Xn;
688
- const e = mt.get(t);
693
+ return sr;
694
+ const e = Et.get(t);
689
695
  if (e)
690
696
  return e;
691
697
  const n = {};
692
698
  for (const [r, o] of Object.entries(t))
693
699
  o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
694
- return mt.set(t, n), n;
700
+ return Et.set(t, n), n;
695
701
  }
696
- function Hn(t) {
702
+ function ir(t) {
697
703
  let e = t.parentElement;
698
704
  for (; e; ) {
699
705
  const r = window.getComputedStyle(e).overflowY;
@@ -703,32 +709,32 @@ function Hn(t) {
703
709
  }
704
710
  return null;
705
711
  }
706
- const Dt = 1.5;
707
- function $t(t, e) {
712
+ const Yt = 1.5;
713
+ function zt(t, e) {
708
714
  requestAnimationFrame(() => {
709
- const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * Dt ? "auto" : "smooth";
715
+ const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16, i = Math.abs(o - t.scrollTop) > t.clientHeight * Yt ? "auto" : "smooth";
710
716
  "scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: i }) : t.scrollTop = o;
711
717
  });
712
718
  }
713
- const Je = "data-ikon-scroll-indicator", qn = 0.15, Ie = "data-ikon-at-bottom";
714
- function Bt(t) {
715
- return Math.max(t.clientHeight * qn, 20);
719
+ const nt = "data-ikon-scroll-indicator", ar = 0.15, xe = "data-ikon-at-bottom";
720
+ function Xt(t) {
721
+ return Math.max(t.clientHeight * ar, 20);
716
722
  }
717
- function Jn(t) {
718
- return t.getAttribute(Ie) !== "false";
723
+ function cr(t) {
724
+ return t.getAttribute(xe) !== "false";
719
725
  }
720
- function Zn(t) {
721
- t.getAttribute(Ie) === null && (t.setAttribute(Ie, "true"), t.addEventListener("scroll", () => {
722
- const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Bt(t);
723
- t.setAttribute(Ie, s ? "true" : "false");
726
+ function lr(t) {
727
+ t.getAttribute(xe) === null && (t.setAttribute(xe, "true"), t.addEventListener("scroll", () => {
728
+ const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= Xt(t);
729
+ t.setAttribute(xe, s ? "true" : "false");
724
730
  }, { passive: !0 }));
725
731
  }
726
- function Qn(t) {
727
- const e = t.parentElement ?? t, n = e.querySelector(`[${Je}]`);
732
+ function ur(t) {
733
+ const e = t.parentElement ?? t, n = e.querySelector(`[${nt}]`);
728
734
  if (n)
729
735
  return n;
730
736
  const r = document.createElement("button");
731
- return r.setAttribute(Je, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
737
+ return r.setAttribute(nt, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
732
738
  position: "absolute",
733
739
  bottom: "12px",
734
740
  left: "50%",
@@ -756,40 +762,40 @@ function Qn(t) {
756
762
  r.style.opacity = "0.9";
757
763
  }), e.appendChild(r), r;
758
764
  }
759
- function er(t, e) {
760
- const n = Qn(t);
765
+ function dr(t, e) {
766
+ const n = ur(t);
761
767
  n.style.display = "flex";
762
768
  const r = () => {
763
- $t(t, e), n.style.display = "none";
769
+ zt(t, e), n.style.display = "none";
764
770
  }, o = () => {
765
771
  const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
766
- i - s - a <= Bt(t) && (n.style.display = "none");
772
+ i - s - a <= Xt(t) && (n.style.display = "none");
767
773
  };
768
774
  return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
769
775
  n.removeEventListener("click", r), t.removeEventListener("scroll", o);
770
776
  };
771
777
  }
772
- function tr() {
778
+ function fr() {
773
779
  const t = Y(function({ nodeId: n, context: r }) {
774
- const o = q(r.store, n), s = v(null), i = le(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, f = le(o?.props?.priority), p = le(o?.props?.key), y = o?.props?.preciseGeneratedAt;
780
+ const o = Z(r.store, n), s = E(null), i = de(o?.props?.targetViewId), a = o?.props?.focusOnly, l = typeof a == "boolean" ? a : void 0, d = de(o?.props?.priority), h = de(o?.props?.key), y = o?.props?.preciseGeneratedAt;
775
781
  return C(() => {
776
782
  if (typeof document > "u")
777
783
  return;
778
784
  const c = s.current;
779
785
  if (!c || i && c.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
780
786
  return;
781
- let d;
787
+ let u;
782
788
  if (l !== !0) {
783
- const w = Hn(c);
784
- if (w)
785
- if (Zn(w), f === "Polite" && !Jn(w))
786
- d = er(w, c);
789
+ const b = ir(c);
790
+ if (b)
791
+ if (lr(b), d === "Polite" && !cr(b))
792
+ u = dr(b, c);
787
793
  else {
788
- const M = (w.parentElement ?? w).querySelector(`[${Je}]`);
789
- M && (M.style.display = "none"), $t(w, c);
794
+ const U = (b.parentElement ?? b).querySelector(`[${nt}]`);
795
+ U && (U.style.display = "none"), zt(b, c);
790
796
  }
791
797
  else typeof c.scrollIntoView == "function" && requestAnimationFrame(() => {
792
- const R = c.getBoundingClientRect().top, E = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > E * Dt ? "auto" : "smooth";
798
+ const R = c.getBoundingClientRect().top, v = typeof window < "u" ? window.innerHeight : 0, T = Math.abs(R) > v * Yt ? "auto" : "smooth";
793
799
  try {
794
800
  c.scrollIntoView({ behavior: T, block: "end", inline: "nearest" });
795
801
  } catch {
@@ -797,15 +803,15 @@ function tr() {
797
803
  }
798
804
  });
799
805
  }
800
- const g = document.activeElement;
801
- if (!(g instanceof HTMLInputElement || g instanceof HTMLTextAreaElement || g?.getAttribute("contenteditable") === "true") && typeof c.focus == "function")
806
+ const p = document.activeElement;
807
+ if (!(p instanceof HTMLInputElement || p instanceof HTMLTextAreaElement || p?.getAttribute("contenteditable") === "true") && typeof c.focus == "function")
802
808
  try {
803
809
  c.focus({ preventScroll: !0 });
804
810
  } catch {
805
811
  c.focus();
806
812
  }
807
- return d;
808
- }, [l, f, i, p, y]), o ? /* @__PURE__ */ S.jsx(
813
+ return u;
814
+ }, [l, d, i, h, y]), o ? /* @__PURE__ */ w.jsx(
809
815
  "span",
810
816
  {
811
817
  ref: s,
@@ -822,26 +828,26 @@ function tr() {
822
828
  return t;
823
829
  };
824
830
  }
825
- function nr() {
831
+ function hr() {
826
832
  const t = Y(function({ nodeId: n, context: r, className: o }) {
827
- const s = q(r.store, n), i = zn(s?.props?.onInvokeId), a = D(() => {
833
+ const s = Z(r.store, n), i = or(s?.props?.onInvokeId), a = D(() => {
828
834
  i && r.dispatchAction(i);
829
835
  }, [i, r]);
830
836
  if (!s)
831
837
  return null;
832
- const l = st(s.props);
838
+ const l = ut(s.props);
833
839
  delete l.onInvokeId;
834
- const f = ot(le(s.props?.className), o), p = s.children?.length ? r.renderChildren(s.children) : void 0;
835
- return /* @__PURE__ */ S.jsx(
840
+ const d = lt(de(s.props?.className), o), h = s.children?.length ? r.renderChildren(s.children) : void 0;
841
+ return /* @__PURE__ */ w.jsx(
836
842
  "div",
837
843
  {
838
844
  ...l,
839
845
  "data-ikon-node-id": s.id,
840
846
  "data-ikon-source": s.sourceMarker,
841
- className: f,
847
+ className: d,
842
848
  onClick: i ? a : void 0,
843
849
  style: i ? { cursor: "pointer" } : void 0,
844
- children: p
850
+ children: h
845
851
  }
846
852
  );
847
853
  });
@@ -850,45 +856,45 @@ function nr() {
850
856
  return t;
851
857
  };
852
858
  }
853
- function rr() {
859
+ function pr() {
854
860
  const t = Y(function({ nodeId: n, context: r, className: o }) {
855
- const s = q(r.store, n);
861
+ const s = Z(r.store, n);
856
862
  if (!s)
857
863
  return null;
858
- const i = st(s.props), a = ot("relative", le(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
859
- return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
864
+ const i = ut(s.props), a = lt("relative", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
865
+ return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
860
866
  });
861
867
  return ({ type: e }) => {
862
868
  if (e === "std.stack")
863
869
  return t;
864
870
  };
865
871
  }
866
- function or() {
872
+ function mr() {
867
873
  const t = Y(function({ nodeId: n, context: r, className: o }) {
868
- const s = q(r.store, n);
874
+ const s = Z(r.store, n);
869
875
  if (!s)
870
876
  return null;
871
- const i = st(s.props), a = ot("absolute", le(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
872
- return /* @__PURE__ */ S.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
877
+ const i = ut(s.props), a = lt("absolute", de(s.props?.className), o), l = s.children?.length ? r.renderChildren(s.children) : void 0;
878
+ return /* @__PURE__ */ w.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: l });
873
879
  });
874
880
  return ({ type: e }) => {
875
881
  if (e === "std.layer")
876
882
  return t;
877
883
  };
878
884
  }
879
- function sr() {
885
+ function gr() {
880
886
  return [
881
- nr(),
882
- rr(),
883
- or(),
884
- tr()
887
+ hr(),
888
+ pr(),
889
+ mr(),
890
+ fr()
885
891
  ];
886
892
  }
887
- const ir = "base", ar = async () => sr();
888
- function cr(t) {
889
- t.registerModule(ir, ar);
893
+ const yr = "base", br = async () => gr();
894
+ function Sr(t) {
895
+ t.registerModule(yr, br);
890
896
  }
891
- function lr(t) {
897
+ function wr(t) {
892
898
  if (typeof t == "string") {
893
899
  const e = t.trim();
894
900
  return e.length > 0 ? e : void 0;
@@ -898,19 +904,19 @@ function lr(t) {
898
904
  return e.length > 0 ? e.join(" ") : void 0;
899
905
  }
900
906
  }
901
- function ur(...t) {
907
+ function vr(...t) {
902
908
  const e = [];
903
909
  for (const n of t)
904
910
  n && n.trim() && e.push(n.trim());
905
911
  return e.length > 0 ? e.join(" ") : void 0;
906
912
  }
907
- function gt(t) {
913
+ function Rt(t) {
908
914
  if (typeof t != "string")
909
915
  return;
910
916
  const e = t.trim();
911
917
  return e.length > 0 ? e : void 0;
912
918
  }
913
- function ke(t) {
919
+ function _e(t) {
914
920
  if (typeof t == "boolean")
915
921
  return t;
916
922
  if (typeof t == "string") {
@@ -919,42 +925,42 @@ function ke(t) {
919
925
  if (e === "false") return !1;
920
926
  }
921
927
  }
922
- const dr = "std.audio-url-player";
923
- function fr() {
928
+ const Er = "std.audio-url-player";
929
+ function Rr() {
924
930
  const t = Y(function({
925
931
  nodeId: n,
926
932
  context: r,
927
933
  className: o
928
934
  }) {
929
- const s = q(r.store, n), i = v(null), a = s ? ke(s.props?.autoplay) : void 0, l = s ? gt(s.props?.src) : void 0;
935
+ const s = Z(r.store, n), i = E(null), a = s ? _e(s.props?.autoplay) : void 0, l = s ? Rt(s.props?.src) : void 0;
930
936
  if (C(() => {
931
937
  a && i.current && i.current.play().catch(() => {
932
938
  });
933
939
  }, [a, l]), !s)
934
940
  return null;
935
- const f = ur(lr(s.props?.className), o), p = gt(s.props?.preload), y = ke(s.props?.controls), u = ke(s.props?.loop), c = ke(s.props?.muted);
936
- return /* @__PURE__ */ S.jsx(
941
+ const d = vr(wr(s.props?.className), o), h = Rt(s.props?.preload), y = _e(s.props?.controls), m = _e(s.props?.loop), c = _e(s.props?.muted);
942
+ return /* @__PURE__ */ w.jsx(
937
943
  "audio",
938
944
  {
939
945
  ref: i,
940
946
  src: l,
941
- ...p !== void 0 ? { preload: p } : {},
947
+ ...h !== void 0 ? { preload: h } : {},
942
948
  ...y !== void 0 ? { controls: y } : {},
943
949
  ...a !== void 0 ? { autoPlay: a } : {},
944
- ...u !== void 0 ? { loop: u } : {},
950
+ ...m !== void 0 ? { loop: m } : {},
945
951
  ...c !== void 0 ? { muted: c } : {},
946
952
  "data-ikon-node-id": s.id,
947
953
  "data-ikon-source": s.sourceMarker,
948
- className: f
954
+ className: d
949
955
  }
950
956
  );
951
957
  });
952
958
  return ({ type: e }) => {
953
- if (e === dr)
959
+ if (e === Er)
954
960
  return t;
955
961
  };
956
962
  }
957
- function Ft(t) {
963
+ function Ht(t) {
958
964
  if (typeof t == "string") {
959
965
  const e = t.trim();
960
966
  return e.length > 0 ? e : void 0;
@@ -964,13 +970,13 @@ function Ft(t) {
964
970
  return e.length > 0 ? e.join(" ") : void 0;
965
971
  }
966
972
  }
967
- function Vt(...t) {
973
+ function qt(...t) {
968
974
  const e = [];
969
975
  for (const n of t)
970
976
  n && n.trim() && e.push(n.trim());
971
977
  return e.length > 0 ? e.join(" ") : void 0;
972
978
  }
973
- function Oe(t) {
979
+ function Pe(t) {
974
980
  if (typeof t == "number" && Number.isFinite(t))
975
981
  return Math.floor(t);
976
982
  if (typeof t == "string" && t.trim().length > 0) {
@@ -979,39 +985,39 @@ function Oe(t) {
979
985
  return Math.floor(e);
980
986
  }
981
987
  }
982
- function Ze(t) {
988
+ function rt(t) {
983
989
  if (typeof t != "string")
984
990
  return;
985
991
  const e = t.trim();
986
992
  return e.length > 0 ? e : void 0;
987
993
  }
988
- const hr = "std.video-canvas", pr = "std.video-url-player";
989
- function mr() {
994
+ const Ar = "std.video-canvas", Tr = "std.video-url-player";
995
+ function kr() {
990
996
  const t = Y(function({ nodeId: n, context: r, className: o }) {
991
- const s = q(r.store, n), i = v(null), a = v(null), l = r.video, f = r.client, p = s ? Ze(s.props?.streamId) : void 0, y = s ? Oe(s.props?.width) : void 0, u = s ? Oe(s.props?.height) : void 0, c = s ? Vt(Ft(s.props?.className), o) : o, [, d] = x(0);
997
+ const s = Z(r.store, n), i = E(null), a = E(null), l = r.video, d = r.client, h = s ? rt(s.props?.streamId) : void 0, y = s ? Pe(s.props?.width) : void 0, m = s ? Pe(s.props?.height) : void 0, c = s ? qt(Ht(s.props?.className), o) : o, [, u] = N(0);
992
998
  C(() => {
993
- if (!f?.isWebRtcEnabled) return;
994
- const g = f.onWebRtcTrackMapChanged;
995
- return f.onWebRtcTrackMapChanged = (b) => {
996
- g?.(b), b.kind === "video" && d((w) => w + 1);
999
+ if (!d?.isWebRtcEnabled) return;
1000
+ const p = d.onWebRtcTrackMapChanged;
1001
+ return d.onWebRtcTrackMapChanged = (S) => {
1002
+ p?.(S), S.kind === "video" && u((b) => b + 1);
997
1003
  }, () => {
998
- f.onWebRtcTrackMapChanged = g;
1004
+ d.onWebRtcTrackMapChanged = p;
999
1005
  };
1000
- }, [f]);
1001
- const m = f?.isWebRtcEnabled && p ? f.getWebRtcVideoStreamByStreamId(p) : null;
1006
+ }, [d]);
1007
+ const g = d?.isWebRtcEnabled && h ? d.getWebRtcVideoStreamByStreamId(h) : null;
1002
1008
  return C(() => {
1003
- const g = i.current;
1004
- if (!(!l || !g || !p || m))
1005
- return l.attachCanvas(p, g), () => {
1006
- l.detachCanvas(p);
1009
+ const p = i.current;
1010
+ if (!(!l || !p || !h || g))
1011
+ return l.attachCanvas(h, p), () => {
1012
+ l.detachCanvas(h);
1007
1013
  };
1008
- }, [l, p, m]), C(() => {
1009
- const g = a.current;
1010
- if (!(!g || !m))
1011
- return g.srcObject = m, () => {
1012
- g.srcObject = null;
1014
+ }, [l, h, g]), C(() => {
1015
+ const p = a.current;
1016
+ if (!(!p || !g))
1017
+ return p.srcObject = g, () => {
1018
+ p.srcObject = null;
1013
1019
  };
1014
- }, [m]), s ? m ? /* @__PURE__ */ S.jsx(
1020
+ }, [g]), s ? g ? /* @__PURE__ */ w.jsx(
1015
1021
  "video",
1016
1022
  {
1017
1023
  ref: a,
@@ -1020,35 +1026,35 @@ function mr() {
1020
1026
  muted: !0,
1021
1027
  "data-ikon-node-id": s.id,
1022
1028
  "data-ikon-source": s.sourceMarker,
1023
- "data-ikon-video-stream-id": p,
1029
+ "data-ikon-video-stream-id": h,
1024
1030
  className: c,
1025
1031
  ...y ? { width: y } : {},
1026
- ...u ? { height: u } : {}
1032
+ ...m ? { height: m } : {}
1027
1033
  },
1028
- p
1029
- ) : /* @__PURE__ */ S.jsx(
1034
+ h
1035
+ ) : /* @__PURE__ */ w.jsx(
1030
1036
  "canvas",
1031
1037
  {
1032
1038
  ref: i,
1033
1039
  "data-ikon-node-id": s.id,
1034
1040
  "data-ikon-source": s.sourceMarker,
1035
- "data-ikon-video-stream-id": p,
1041
+ "data-ikon-video-stream-id": h,
1036
1042
  className: c,
1037
1043
  ...y ? { width: y } : {},
1038
- ...u ? { height: u } : {}
1044
+ ...m ? { height: m } : {}
1039
1045
  },
1040
- p
1046
+ h
1041
1047
  ) : null;
1042
1048
  });
1043
1049
  return ({ type: e }) => {
1044
- if (e === hr)
1050
+ if (e === Ar)
1045
1051
  return t;
1046
1052
  };
1047
1053
  }
1048
- function gr() {
1049
- return [mr(), yr(), fr()];
1054
+ function Cr() {
1055
+ return [kr(), Ir(), Rr()];
1050
1056
  }
1051
- function ge(t) {
1057
+ function ye(t) {
1052
1058
  if (typeof t == "boolean")
1053
1059
  return t;
1054
1060
  if (typeof t == "string") {
@@ -1057,61 +1063,61 @@ function ge(t) {
1057
1063
  if (e === "false") return !1;
1058
1064
  }
1059
1065
  }
1060
- function yr() {
1066
+ function Ir() {
1061
1067
  const t = Y(function({
1062
1068
  nodeId: n,
1063
1069
  context: r,
1064
1070
  className: o
1065
1071
  }) {
1066
- const s = q(r.store, n), i = v(null), a = s ? ge(s.props?.autoplay) : void 0, l = s ? Ze(s.props?.src) : void 0;
1072
+ const s = Z(r.store, n), i = E(null), a = s ? ye(s.props?.autoplay) : void 0, l = s ? rt(s.props?.src) : void 0;
1067
1073
  if (C(() => {
1068
1074
  a && i.current && i.current.play().catch(() => {
1069
1075
  });
1070
1076
  }, [a, l]), !s)
1071
1077
  return null;
1072
- const f = Vt(Ft(s.props?.className), o), p = Ze(s.props?.poster), y = ge(s.props?.controls), u = ge(s.props?.loop), c = ge(s.props?.muted), d = ge(s.props?.playsInline), m = Oe(s.props?.width), g = Oe(s.props?.height), b = s.children?.length ? r.renderChildren(s.children) : void 0;
1073
- return /* @__PURE__ */ S.jsx(
1078
+ const d = qt(Ht(s.props?.className), o), h = rt(s.props?.poster), y = ye(s.props?.controls), m = ye(s.props?.loop), c = ye(s.props?.muted), u = ye(s.props?.playsInline), g = Pe(s.props?.width), p = Pe(s.props?.height), S = s.children?.length ? r.renderChildren(s.children) : void 0;
1079
+ return /* @__PURE__ */ w.jsx(
1074
1080
  "video",
1075
1081
  {
1076
1082
  ref: i,
1077
1083
  src: l,
1078
- poster: p,
1084
+ poster: h,
1079
1085
  ...y !== void 0 ? { controls: y } : {},
1080
1086
  ...a !== void 0 ? { autoPlay: a } : {},
1081
- ...u !== void 0 ? { loop: u } : {},
1087
+ ...m !== void 0 ? { loop: m } : {},
1082
1088
  ...c !== void 0 ? { muted: c } : {},
1083
- ...d !== void 0 ? { playsInline: d } : {},
1084
- ...m ? { width: m } : {},
1085
- ...g ? { height: g } : {},
1089
+ ...u !== void 0 ? { playsInline: u } : {},
1090
+ ...g ? { width: g } : {},
1091
+ ...p ? { height: p } : {},
1086
1092
  "data-ikon-node-id": s.id,
1087
1093
  "data-ikon-source": s.sourceMarker,
1088
- className: f,
1089
- children: b
1094
+ className: d,
1095
+ children: S
1090
1096
  }
1091
1097
  );
1092
1098
  });
1093
1099
  return ({ type: e }) => {
1094
- if (e === pr)
1100
+ if (e === Tr)
1095
1101
  return t;
1096
1102
  };
1097
1103
  }
1098
- const br = "media", wr = async () => gr();
1099
- function Sr(t) {
1100
- t.registerModule(br, wr);
1104
+ const _r = "media", Or = async () => Cr();
1105
+ function Nr(t) {
1106
+ t.registerModule(_r, Or);
1101
1107
  }
1102
- const Er = `#version 300 es
1108
+ const xr = `#version 300 es
1103
1109
  in vec4 a_position;
1104
1110
  void main() {
1105
1111
  gl_Position = a_position;
1106
1112
  }
1107
- `, ie = 4;
1108
- function vr(t, e) {
1113
+ `, ce = 4;
1114
+ function Pr(t, e) {
1109
1115
  return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
1110
1116
  }
1111
- function Rr(t, e) {
1117
+ function Lr(t, e) {
1112
1118
  const n = [];
1113
1119
  for (const [r, o] of Object.entries(e)) {
1114
- if (vr(t, r))
1120
+ if (Pr(t, r))
1115
1121
  continue;
1116
1122
  let s;
1117
1123
  switch (o.type) {
@@ -1172,7 +1178,7 @@ void main() {
1172
1178
  }
1173
1179
  `;
1174
1180
  }
1175
- class Ar {
1181
+ class Ur {
1176
1182
  gl;
1177
1183
  program = null;
1178
1184
  positionBuffer = null;
@@ -1187,8 +1193,8 @@ class Ar {
1187
1193
  mouseClickX = 0;
1188
1194
  mouseClickY = 0;
1189
1195
  channels = [];
1190
- channelResolution = new Float32Array(ie * 3);
1191
- channelTime = new Float32Array(ie);
1196
+ channelResolution = new Float32Array(ce * 3);
1197
+ channelTime = new Float32Array(ce);
1192
1198
  lastError = null;
1193
1199
  currentShaderSource = "";
1194
1200
  constructor(e) {
@@ -1211,7 +1217,7 @@ class Ar {
1211
1217
  }
1212
1218
  initializeChannels() {
1213
1219
  const e = this.gl;
1214
- for (let n = 0; n < ie; n++) {
1220
+ for (let n = 0; n < ce; n++) {
1215
1221
  const r = e.createTexture();
1216
1222
  e.bindTexture(e.TEXTURE_2D, r), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, new Uint8Array([0, 0, 0, 255])), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), this.channels.push({ texture: r, width: 0, height: 0, url: null });
1217
1223
  }
@@ -1221,7 +1227,7 @@ class Ar {
1221
1227
  // settings (vflip on, repeat wrap, mipmap filtering) so copy-pasted ShaderToy texture shaders render
1222
1228
  // the same way. Only channels whose URL changed are reloaded.
1223
1229
  setChannels(e) {
1224
- for (let n = 0; n < ie; n++) {
1230
+ for (let n = 0; n < ce; n++) {
1225
1231
  const r = e[n] ?? null, o = this.channels[n];
1226
1232
  if (o.url !== r) {
1227
1233
  if (o.url = r, !r) {
@@ -1247,10 +1253,10 @@ class Ar {
1247
1253
  }
1248
1254
  compile(e, n = {}) {
1249
1255
  this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
1250
- const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Er);
1256
+ const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, xr);
1251
1257
  if (!o)
1252
1258
  return !1;
1253
- const s = Rr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
1259
+ const s = Lr(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
1254
1260
  if (!i)
1255
1261
  return r.deleteShader(o), !1;
1256
1262
  const a = r.createProgram();
@@ -1270,7 +1276,7 @@ class Ar {
1270
1276
  const n = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
1271
1277
  for (const r of n)
1272
1278
  this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
1273
- for (let r = 0; r < ie; r++)
1279
+ for (let r = 0; r < ce; r++)
1274
1280
  this.uniformLocations.set(`iChannel${r}`, e.getUniformLocation(this.program, `iChannel${r}`));
1275
1281
  this.uniformLocations.set("iChannelResolution", e.getUniformLocation(this.program, "iChannelResolution[0]")), this.uniformLocations.set("iChannelTime", e.getUniformLocation(this.program, "iChannelTime[0]"));
1276
1282
  for (const r of Object.keys(this.customUniforms))
@@ -1289,57 +1295,57 @@ class Ar {
1289
1295
  (n.width !== o || n.height !== s) && (n.width = o, n.height = s, e.viewport(0, 0, o, s));
1290
1296
  const i = performance.now(), a = (i - this.startTime) / 1e3, l = (i - this.lastFrameTime) / 1e3;
1291
1297
  this.lastFrameTime = i, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
1292
- const f = this.uniformLocations.get("iResolution");
1293
- f && e.uniform3f(f, o, s, 1);
1294
- const p = this.uniformLocations.get("iTime");
1295
- p && e.uniform1f(p, a);
1298
+ const d = this.uniformLocations.get("iResolution");
1299
+ d && e.uniform3f(d, o, s, 1);
1300
+ const h = this.uniformLocations.get("iTime");
1301
+ h && e.uniform1f(h, a);
1296
1302
  const y = this.uniformLocations.get("iTimeDelta");
1297
1303
  y && e.uniform1f(y, l);
1298
- const u = this.uniformLocations.get("iFrame");
1299
- u && e.uniform1i(u, this.frameCount);
1304
+ const m = this.uniformLocations.get("iFrame");
1305
+ m && e.uniform1i(m, this.frameCount);
1300
1306
  const c = this.uniformLocations.get("iMouse");
1301
1307
  c && e.uniform4f(c, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
1302
- const d = this.uniformLocations.get("iDate");
1303
- if (d) {
1304
- const b = /* @__PURE__ */ new Date();
1305
- e.uniform4f(d, b.getFullYear(), b.getMonth(), b.getDate(), b.getHours() * 3600 + b.getMinutes() * 60 + b.getSeconds() + b.getMilliseconds() / 1e3);
1306
- }
1307
- for (let b = 0; b < ie; b++) {
1308
- e.activeTexture(e.TEXTURE0 + b), e.bindTexture(e.TEXTURE_2D, this.channels[b].texture);
1309
- const w = this.uniformLocations.get(`iChannel${b}`);
1310
- w && e.uniform1i(w, b);
1311
- }
1312
- const m = this.uniformLocations.get("iChannelResolution");
1313
- m && e.uniform3fv(m, this.channelResolution);
1314
- const g = this.uniformLocations.get("iChannelTime");
1315
- g && e.uniform1fv(g, this.channelTime);
1316
- for (const [b, w] of Object.entries(this.customUniforms)) {
1317
- const R = this.uniformLocations.get(b);
1308
+ const u = this.uniformLocations.get("iDate");
1309
+ if (u) {
1310
+ const S = /* @__PURE__ */ new Date();
1311
+ e.uniform4f(u, S.getFullYear(), S.getMonth(), S.getDate(), S.getHours() * 3600 + S.getMinutes() * 60 + S.getSeconds() + S.getMilliseconds() / 1e3);
1312
+ }
1313
+ for (let S = 0; S < ce; S++) {
1314
+ e.activeTexture(e.TEXTURE0 + S), e.bindTexture(e.TEXTURE_2D, this.channels[S].texture);
1315
+ const b = this.uniformLocations.get(`iChannel${S}`);
1316
+ b && e.uniform1i(b, S);
1317
+ }
1318
+ const g = this.uniformLocations.get("iChannelResolution");
1319
+ g && e.uniform3fv(g, this.channelResolution);
1320
+ const p = this.uniformLocations.get("iChannelTime");
1321
+ p && e.uniform1fv(p, this.channelTime);
1322
+ for (const [S, b] of Object.entries(this.customUniforms)) {
1323
+ const R = this.uniformLocations.get(S);
1318
1324
  if (R)
1319
- switch (w.type) {
1325
+ switch (b.type) {
1320
1326
  case "float":
1321
- e.uniform1f(R, w.value);
1327
+ e.uniform1f(R, b.value);
1322
1328
  break;
1323
1329
  case "vec2": {
1324
- const E = w.value;
1325
- e.uniform2f(R, E[0], E[1]);
1330
+ const v = b.value;
1331
+ e.uniform2f(R, v[0], v[1]);
1326
1332
  break;
1327
1333
  }
1328
1334
  case "vec3": {
1329
- const E = w.value;
1330
- e.uniform3f(R, E[0], E[1], E[2]);
1335
+ const v = b.value;
1336
+ e.uniform3f(R, v[0], v[1], v[2]);
1331
1337
  break;
1332
1338
  }
1333
1339
  case "vec4": {
1334
- const E = w.value;
1335
- e.uniform4f(R, E[0], E[1], E[2], E[3]);
1340
+ const v = b.value;
1341
+ e.uniform4f(R, v[0], v[1], v[2], v[3]);
1336
1342
  break;
1337
1343
  }
1338
1344
  case "int":
1339
- e.uniform1i(R, w.value);
1345
+ e.uniform1i(R, b.value);
1340
1346
  break;
1341
1347
  case "bool":
1342
- e.uniform1i(R, w.value ? 1 : 0);
1348
+ e.uniform1i(R, b.value ? 1 : 0);
1343
1349
  break;
1344
1350
  }
1345
1351
  }
@@ -1356,7 +1362,7 @@ class Ar {
1356
1362
  this.channels = [], this.uniformLocations.clear();
1357
1363
  }
1358
1364
  }
1359
- function Tr(t) {
1365
+ function Mr(t) {
1360
1366
  if (typeof t == "string") {
1361
1367
  const e = t.trim();
1362
1368
  return e.length > 0 ? e : void 0;
@@ -1366,13 +1372,13 @@ function Tr(t) {
1366
1372
  return e.length > 0 ? e.join(" ") : void 0;
1367
1373
  }
1368
1374
  }
1369
- function kr(...t) {
1375
+ function jr(...t) {
1370
1376
  const e = [];
1371
1377
  for (const n of t)
1372
1378
  n && n.trim() && e.push(n.trim());
1373
1379
  return e.length > 0 ? e.join(" ") : void 0;
1374
1380
  }
1375
- function Fe(t) {
1381
+ function Ye(t) {
1376
1382
  if (typeof t == "number" && Number.isFinite(t))
1377
1383
  return Math.floor(t);
1378
1384
  if (typeof t == "string" && t.trim().length > 0) {
@@ -1381,10 +1387,10 @@ function Fe(t) {
1381
1387
  return Math.floor(e);
1382
1388
  }
1383
1389
  }
1384
- function Cr(t) {
1390
+ function Dr(t) {
1385
1391
  return typeof t == "string" ? t : "";
1386
1392
  }
1387
- function _r(t) {
1393
+ function $r(t) {
1388
1394
  if (typeof t == "boolean")
1389
1395
  return t;
1390
1396
  if (typeof t == "string") {
@@ -1393,7 +1399,7 @@ function _r(t) {
1393
1399
  if (e === "false") return !1;
1394
1400
  }
1395
1401
  }
1396
- function Ir(t) {
1402
+ function Br(t) {
1397
1403
  if (!t || typeof t != "object")
1398
1404
  return {};
1399
1405
  const e = {}, n = t;
@@ -1408,10 +1414,10 @@ function Ir(t) {
1408
1414
  }
1409
1415
  return e;
1410
1416
  }
1411
- function Or(t) {
1417
+ function Fr(t) {
1412
1418
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : null) : [];
1413
1419
  }
1414
- function Nr(t, e) {
1420
+ function Vr(t, e) {
1415
1421
  const n = Object.keys(t), r = Object.keys(e);
1416
1422
  if (n.length !== r.length)
1417
1423
  return !1;
@@ -1432,21 +1438,21 @@ function Nr(t, e) {
1432
1438
  }
1433
1439
  return !0;
1434
1440
  }
1435
- const xr = "std.shadertoy-canvas";
1436
- function Pr() {
1441
+ const Wr = "std.shadertoy-canvas";
1442
+ function Kr() {
1437
1443
  const t = Y(function({ nodeId: n, context: r, className: o }) {
1438
- const s = q(r.store, n), i = v(null), a = v(null), l = v(null), f = v(0), p = v(""), y = v({}), u = v({
1444
+ const s = Z(r.store, n), i = E(null), a = E(null), l = E(null), d = E(0), h = E(""), y = E({}), m = E({
1439
1445
  x: 0,
1440
1446
  y: 0,
1441
1447
  clickX: 0,
1442
1448
  clickY: 0,
1443
1449
  isDown: !1
1444
- }), c = s ? Cr(s.props?.shaderSource) : "", d = s ? Fe(s.props?.fps) ?? 60 : 60, m = s?.props?.uniforms, g = W(() => Ir(m), [m]), b = s?.props?.channels, w = W(() => Or(b), [b]), R = s ? _r(s.props?.enableMouse) ?? !0 : !0, E = s ? Fe(s.props?.width) : void 0, T = s ? Fe(s.props?.height) : void 0, M = s ? kr(Tr(s.props?.className), o) : o;
1450
+ }), c = s ? Dr(s.props?.shaderSource) : "", u = s ? Ye(s.props?.fps) ?? 60 : 60, g = s?.props?.uniforms, p = W(() => Br(g), [g]), S = s?.props?.channels, b = W(() => Fr(S), [S]), R = s ? $r(s.props?.enableMouse) ?? !0 : !0, v = s ? Ye(s.props?.width) : void 0, T = s ? Ye(s.props?.height) : void 0, U = s ? jr(Mr(s.props?.className), o) : o;
1445
1451
  C(() => {
1446
1452
  const _ = i.current;
1447
1453
  if (_) {
1448
1454
  try {
1449
- const L = new Ar(_);
1455
+ const L = new Ur(_);
1450
1456
  a.current = L;
1451
1457
  } catch (L) {
1452
1458
  console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", L);
@@ -1457,78 +1463,78 @@ function Pr() {
1457
1463
  }
1458
1464
  }, []), C(() => {
1459
1465
  const _ = a.current;
1460
- if (!(!_ || !c) && p.current !== c)
1461
- if (_.compile(c, g))
1462
- p.current = c, y.current = g;
1466
+ if (!(!_ || !c) && h.current !== c)
1467
+ if (_.compile(c, p))
1468
+ h.current = c, y.current = p;
1463
1469
  else {
1464
- const U = _.getError();
1465
- console.error("[ShadertoyRenderer] Shader compilation failed:", U);
1470
+ const M = _.getError();
1471
+ console.error("[ShadertoyRenderer] Shader compilation failed:", M);
1466
1472
  }
1467
- }, [c, g]), C(() => {
1473
+ }, [c, p]), C(() => {
1468
1474
  const _ = a.current;
1469
- !_ || !p.current || Nr(y.current, g) || (_.setCustomUniforms(g), y.current = g);
1470
- }, [g]), C(() => {
1475
+ !_ || !h.current || Vr(y.current, p) || (_.setCustomUniforms(p), y.current = p);
1476
+ }, [p]), C(() => {
1471
1477
  const _ = a.current;
1472
- _ && _.setChannels(w);
1473
- }, [w]), C(() => {
1478
+ _ && _.setChannels(b);
1479
+ }, [b]), C(() => {
1474
1480
  const _ = a.current;
1475
- if (!_ || !p.current) return;
1476
- const L = 1e3 / d, U = (F) => {
1477
- const B = F - f.current;
1478
- B >= L && (f.current = F - B % L, _.draw()), l.current = requestAnimationFrame(U);
1481
+ if (!_ || !h.current) return;
1482
+ const L = 1e3 / u, M = (B) => {
1483
+ const $ = B - d.current;
1484
+ $ >= L && (d.current = B - $ % L, _.draw()), l.current = requestAnimationFrame(M);
1479
1485
  };
1480
- return l.current = requestAnimationFrame(U), () => {
1486
+ return l.current = requestAnimationFrame(M), () => {
1481
1487
  l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
1482
1488
  };
1483
- }, [d]);
1484
- const J = D(
1489
+ }, [u]);
1490
+ const ee = D(
1485
1491
  (_) => {
1486
1492
  if (!R) return;
1487
- const L = i.current, U = a.current;
1488
- if (!L || !U) return;
1489
- const F = window.devicePixelRatio || 1, B = L.getBoundingClientRect(), $ = (_.clientX - B.left) * F, K = (B.height - (_.clientY - B.top)) * F;
1490
- u.current.x = $, u.current.y = K, U.setMouse($, K, u.current.clickX, u.current.clickY);
1493
+ const L = i.current, M = a.current;
1494
+ if (!L || !M) return;
1495
+ const B = window.devicePixelRatio || 1, $ = L.getBoundingClientRect(), V = (_.clientX - $.left) * B, K = ($.height - (_.clientY - $.top)) * B;
1496
+ m.current.x = V, m.current.y = K, M.setMouse(V, K, m.current.clickX, m.current.clickY);
1491
1497
  },
1492
1498
  [R]
1493
- ), Q = D(
1499
+ ), te = D(
1494
1500
  (_) => {
1495
1501
  if (!R) return;
1496
- const L = i.current, U = a.current;
1497
- if (!L || !U) return;
1498
- const F = window.devicePixelRatio || 1, B = L.getBoundingClientRect(), $ = (_.clientX - B.left) * F, K = (B.height - (_.clientY - B.top)) * F;
1499
- u.current.isDown = !0, u.current.clickX = $, u.current.clickY = K, U.setMouse($, K, $, K);
1502
+ const L = i.current, M = a.current;
1503
+ if (!L || !M) return;
1504
+ const B = window.devicePixelRatio || 1, $ = L.getBoundingClientRect(), V = (_.clientX - $.left) * B, K = ($.height - (_.clientY - $.top)) * B;
1505
+ m.current.isDown = !0, m.current.clickX = V, m.current.clickY = K, M.setMouse(V, K, V, K);
1500
1506
  },
1501
1507
  [R]
1502
- ), X = D(() => {
1503
- R && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
1508
+ ), z = D(() => {
1509
+ R && (m.current.isDown = !1, m.current.clickX = -Math.abs(m.current.clickX));
1504
1510
  }, [R]);
1505
- return s ? /* @__PURE__ */ S.jsx(
1511
+ return s ? /* @__PURE__ */ w.jsx(
1506
1512
  "canvas",
1507
1513
  {
1508
1514
  ref: i,
1509
1515
  "data-ikon-node-id": s.id,
1510
1516
  "data-ikon-source": s.sourceMarker,
1511
- className: M,
1512
- ...E ? { width: E } : {},
1517
+ className: U,
1518
+ ...v ? { width: v } : {},
1513
1519
  ...T ? { height: T } : {},
1514
- onMouseMove: J,
1515
- onMouseDown: Q,
1516
- onMouseUp: X,
1517
- onMouseLeave: X
1520
+ onMouseMove: ee,
1521
+ onMouseDown: te,
1522
+ onMouseUp: z,
1523
+ onMouseLeave: z
1518
1524
  }
1519
1525
  ) : null;
1520
1526
  });
1521
1527
  return ({ type: e }) => {
1522
- if (e === xr)
1528
+ if (e === Wr)
1523
1529
  return t;
1524
1530
  };
1525
1531
  }
1526
- const Lr = "shadertoy", Mr = async () => Pr();
1527
- function Ur(t) {
1528
- t.registerModule(Lr, Mr);
1532
+ const Gr = "shadertoy", Yr = async () => Kr();
1533
+ function zr(t) {
1534
+ t.registerModule(Gr, Yr);
1529
1535
  }
1530
- const yt = se("UIRegistry");
1531
- class jr {
1536
+ const At = re("UIRegistry");
1537
+ class Xr {
1532
1538
  baseResolvers = [];
1533
1539
  moduleLoaders = /* @__PURE__ */ new Map();
1534
1540
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -1550,15 +1556,15 @@ class jr {
1550
1556
  for (const [r, o] of this.moduleLoaders.entries())
1551
1557
  if (!this.moduleResolvers.has(r))
1552
1558
  try {
1553
- const s = await o(), i = Br(s);
1559
+ const s = await o(), i = Jr(s);
1554
1560
  this.moduleResolvers.set(r, i), e = !0;
1555
1561
  } catch (s) {
1556
- yt.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
1562
+ At.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
1557
1563
  }
1558
1564
  const n = [];
1559
1565
  for (const r of this.moduleLoaders.keys())
1560
1566
  this.moduleResolvers.has(r) && n.push(r);
1561
- return Fr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
1567
+ return Zr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
1562
1568
  }
1563
1569
  resolve(e) {
1564
1570
  for (const n of this.baseResolvers) {
@@ -1568,7 +1574,7 @@ class jr {
1568
1574
  for (const n of this.activeModuleOrder) {
1569
1575
  const r = this.moduleResolvers.get(n);
1570
1576
  if (!r) {
1571
- yt.warn(`Missing resolvers for module ${n}`);
1577
+ At.warn(`Missing resolvers for module ${n}`);
1572
1578
  continue;
1573
1579
  }
1574
1580
  for (const o of r) {
@@ -1578,17 +1584,17 @@ class jr {
1578
1584
  }
1579
1585
  }
1580
1586
  }
1581
- function Dr() {
1582
- const t = new jr();
1583
- return cr(t), Sr(t), Ur(t), t.loadRegisteredModules(), t;
1587
+ function Hr() {
1588
+ const t = new Xr();
1589
+ return Sr(t), Nr(t), zr(t), t.loadRegisteredModules(), t;
1584
1590
  }
1585
- function $r(t) {
1591
+ function qr(t) {
1586
1592
  return Array.isArray(t) ? t : [t];
1587
1593
  }
1588
- function Br(t) {
1589
- return t ? $r(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1594
+ function Jr(t) {
1595
+ return t ? qr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1590
1596
  }
1591
- function Fr(t, e) {
1597
+ function Zr(t, e) {
1592
1598
  if (t.length !== e.length)
1593
1599
  return !1;
1594
1600
  for (let n = 0; n < t.length; n += 1)
@@ -1596,9 +1602,9 @@ function Fr(t, e) {
1596
1602
  return !1;
1597
1603
  return !0;
1598
1604
  }
1599
- function js({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1600
- return /* @__PURE__ */ S.jsx(
1601
- jt,
1605
+ function Xs({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1606
+ return /* @__PURE__ */ w.jsx(
1607
+ Gt,
1602
1608
  {
1603
1609
  stores: e,
1604
1610
  registry: n,
@@ -1608,7 +1614,7 @@ function js({ mount: t, stores: e, registry: n, client: r, onAction: o }) {
1608
1614
  }
1609
1615
  );
1610
1616
  }
1611
- const Ve = se("MotionController"), bt = {
1617
+ const ze = re("MotionController"), Tt = {
1612
1618
  ease: [0.25, 0.1, 0.25, 1],
1613
1619
  "ease-in": [0.42, 0, 1, 1],
1614
1620
  "ease-out": [0, 0, 0.58, 1],
@@ -1638,88 +1644,88 @@ const Ve = se("MotionController"), bt = {
1638
1644
  "ease-out-back": [0.175, 0.885, 0.32, 1.275],
1639
1645
  "ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
1640
1646
  };
1641
- function V(t) {
1647
+ function F(t) {
1642
1648
  return t <= 0 ? 0 : t >= 1 ? 1 : t;
1643
1649
  }
1644
- function wt(t) {
1650
+ function kt(t) {
1645
1651
  if (t == null) return;
1646
1652
  const e = `${t}`.trim();
1647
1653
  if (!e) return;
1648
1654
  const n = Number.parseFloat(e);
1649
1655
  return Number.isFinite(n) ? n : void 0;
1650
1656
  }
1651
- function St(t) {
1657
+ function Ct(t) {
1652
1658
  return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1653
1659
  }
1654
- function Et(t, e, n, r) {
1655
- const p = new Float32Array(11);
1656
- function y(g, b, w) {
1657
- return ((3 * b - 3 * w + 1) * g + (3 * w - 6 * b)) * g * g + 3 * b * g;
1660
+ function It(t, e, n, r) {
1661
+ const h = new Float32Array(11);
1662
+ function y(p, S, b) {
1663
+ return ((3 * S - 3 * b + 1) * p + (3 * b - 6 * S)) * p * p + 3 * S * p;
1658
1664
  }
1659
- function u(g, b, w) {
1660
- return 3 * (3 * b - 3 * w + 1) * g * g + 2 * (3 * w - 6 * b) * g + 3 * b;
1665
+ function m(p, S, b) {
1666
+ return 3 * (3 * S - 3 * b + 1) * p * p + 2 * (3 * b - 6 * S) * p + 3 * S;
1661
1667
  }
1662
- function c(g, b) {
1663
- for (let w = 0; w < 4; w += 1) {
1664
- const R = u(b, t, n);
1668
+ function c(p, S) {
1669
+ for (let b = 0; b < 4; b += 1) {
1670
+ const R = m(S, t, n);
1665
1671
  if (R === 0)
1666
- return b;
1667
- const E = y(b, t, n) - g;
1668
- b -= E / R;
1672
+ return S;
1673
+ const v = y(S, t, n) - p;
1674
+ S -= v / R;
1669
1675
  }
1670
- return b;
1676
+ return S;
1671
1677
  }
1672
- function d(g, b, w) {
1673
- let R = 0, E = 0, T = 0;
1678
+ function u(p, S, b) {
1679
+ let R = 0, v = 0, T = 0;
1674
1680
  do
1675
- E = b + (w - b) / 2, R = y(E, t, n) - g, R > 0 ? w = E : b = E;
1681
+ v = S + (b - S) / 2, R = y(v, t, n) - p, R > 0 ? b = v : S = v;
1676
1682
  while (Math.abs(R) > 1e-7 && ++T < 10);
1677
- return E;
1683
+ return v;
1678
1684
  }
1679
- function m(g) {
1680
- let b = 0, w = 1;
1685
+ function g(p) {
1686
+ let S = 0, b = 1;
1681
1687
  const R = 10;
1682
- for (; w !== R && p[w] <= g; w += 1)
1683
- b += 0.1;
1684
- w -= 1;
1685
- const E = (g - p[w]) / (p[w + 1] - p[w]), T = b + E * 0.1, M = u(T, t, n);
1686
- return M >= 1e-3 ? c(g, T) : M === 0 ? T : d(g, b, b + 0.1);
1688
+ for (; b !== R && h[b] <= p; b += 1)
1689
+ S += 0.1;
1690
+ b -= 1;
1691
+ const v = (p - h[b]) / (h[b + 1] - h[b]), T = S + v * 0.1, U = m(T, t, n);
1692
+ return U >= 1e-3 ? c(p, T) : U === 0 ? T : u(p, S, S + 0.1);
1687
1693
  }
1688
- for (let g = 0; g < 11; g += 1)
1689
- p[g] = y(g * 0.1, t, n);
1690
- return (g) => g <= 0 ? 0 : g >= 1 ? 1 : y(m(g), e, r);
1694
+ for (let p = 0; p < 11; p += 1)
1695
+ h[p] = y(p * 0.1, t, n);
1696
+ return (p) => p <= 0 ? 0 : p >= 1 ? 1 : y(g(p), e, r);
1691
1697
  }
1692
- function Vr(t) {
1698
+ function Qr(t) {
1693
1699
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
1694
1700
  if (!e)
1695
- return (o) => V(o);
1701
+ return (o) => F(o);
1696
1702
  const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
1697
- return r === "start" || r === "jump-start" ? (o) => V(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => V(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => V((Math.floor(o * n) + 0.5) / n) : (o) => V(Math.floor(o * n) / n);
1703
+ return r === "start" || r === "jump-start" ? (o) => F(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => F(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => F((Math.floor(o * n) + 0.5) / n) : (o) => F(Math.floor(o * n) / n);
1698
1704
  }
1699
- function Wr(t) {
1705
+ function eo(t) {
1700
1706
  if (!t)
1701
- return (n) => V(n);
1707
+ return (n) => F(n);
1702
1708
  const e = t.trim().toLowerCase();
1703
1709
  if (!e || e === "linear")
1704
- return (n) => V(n);
1705
- if (bt[e]) {
1706
- const [n, r, o, s] = bt[e], i = Et(n, r, o, s);
1707
- return (a) => V(i(V(a)));
1710
+ return (n) => F(n);
1711
+ if (Tt[e]) {
1712
+ const [n, r, o, s] = Tt[e], i = It(n, r, o, s);
1713
+ return (a) => F(i(F(a)));
1708
1714
  }
1709
1715
  if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
1710
1716
  const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
1711
1717
  if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
1712
- const [o, s, i, a] = r, l = Et(o, s, i, a);
1713
- return (f) => V(l(V(f)));
1718
+ const [o, s, i, a] = r, l = It(o, s, i, a);
1719
+ return (d) => F(l(F(d)));
1714
1720
  }
1715
1721
  }
1716
1722
  if (e.startsWith("steps(") && e.endsWith(")")) {
1717
- const n = Vr(e);
1718
- return (r) => n(V(r));
1723
+ const n = Qr(e);
1724
+ return (r) => n(F(r));
1719
1725
  }
1720
- return (n) => V(n);
1726
+ return (n) => F(n);
1721
1727
  }
1722
- function Kr(t) {
1728
+ function to(t) {
1723
1729
  if (!t)
1724
1730
  return;
1725
1731
  const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
@@ -1729,7 +1735,7 @@ function Kr(t) {
1729
1735
  if (![n, r, o, s].some((i) => !Number.isFinite(i)))
1730
1736
  return { inStart: n, inEnd: r, outStart: o, outEnd: s };
1731
1737
  }
1732
- class Gr {
1738
+ class no {
1733
1739
  bindingsByStyle = /* @__PURE__ */ new Map();
1734
1740
  observer;
1735
1741
  observeScheduled = !1;
@@ -1756,7 +1762,7 @@ class Gr {
1756
1762
  try {
1757
1763
  e();
1758
1764
  } catch (n) {
1759
- Ve.warn("Failed to cleanup binding listener", n);
1765
+ ze.warn("Failed to cleanup binding listener", n);
1760
1766
  }
1761
1767
  this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer && (this.observer.disconnect(), this.observer = void 0);
1762
1768
  }
@@ -1766,7 +1772,7 @@ class Gr {
1766
1772
  const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
1767
1773
  return r.length === 0 ? void 0 : { bindings: r };
1768
1774
  } catch (n) {
1769
- Ve.warn("Failed to parse motion metadata", n);
1775
+ ze.warn("Failed to parse motion metadata", n);
1770
1776
  return;
1771
1777
  }
1772
1778
  }
@@ -1774,7 +1780,7 @@ class Gr {
1774
1780
  const n = e.source?.trim();
1775
1781
  if (!n)
1776
1782
  return;
1777
- const r = wt(e.min) ?? 0, o = wt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = Wr(e.ease), f = Kr(e.map), p = e.targetId?.trim() || void 0;
1783
+ const r = kt(e.min) ?? 0, o = kt(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, l = eo(e.ease), d = to(e.map), h = e.targetId?.trim() || void 0;
1778
1784
  return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
1779
1785
  source: n.toLowerCase(),
1780
1786
  min: r,
@@ -1782,8 +1788,8 @@ class Gr {
1782
1788
  clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
1783
1789
  reverse: a,
1784
1790
  ease: l,
1785
- map: f,
1786
- targetId: p
1791
+ map: d,
1792
+ targetId: h
1787
1793
  };
1788
1794
  }
1789
1795
  ensureObserver() {
@@ -1832,7 +1838,7 @@ class Gr {
1832
1838
  const n = this.bindingsByStyle.get(e);
1833
1839
  if (!n || typeof document > "u")
1834
1840
  return;
1835
- const r = `.${St(e)}`;
1841
+ const r = `.${Ct(e)}`;
1836
1842
  document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
1837
1843
  }
1838
1844
  applyStyleToElement(e, n, r) {
@@ -1872,7 +1878,7 @@ class Gr {
1872
1878
  }
1873
1879
  resolveScrollContainer(e, n) {
1874
1880
  if (n.targetId) {
1875
- const r = `[data-ikon-motion-source="${St(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
1881
+ const r = `[data-ikon-motion-source="${Ct(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
1876
1882
  if (o)
1877
1883
  return o;
1878
1884
  }
@@ -1882,10 +1888,10 @@ class Gr {
1882
1888
  const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
1883
1889
  let i = this.applyClamp(s, n.clamp);
1884
1890
  n.reverse && (i = 1 - i);
1885
- const a = n.ease(i), l = Number.isFinite(a) ? a : 0, f = l * 100;
1886
- if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${f}`), n.map) {
1887
- const p = this.applyMap(f, n.map);
1888
- p !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${p}`);
1891
+ const a = n.ease(i), l = Number.isFinite(a) ? a : 0, d = l * 100;
1892
+ if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${l}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), n.map) {
1893
+ const h = this.applyMap(d, n.map);
1894
+ h !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${h}`);
1889
1895
  } else
1890
1896
  e.style.removeProperty("--tw-motion-bind-value");
1891
1897
  }
@@ -1900,7 +1906,7 @@ class Gr {
1900
1906
  case "unclamped":
1901
1907
  return e;
1902
1908
  default:
1903
- return V(e);
1909
+ return F(e);
1904
1910
  }
1905
1911
  }
1906
1912
  applyMap(e, n) {
@@ -1942,7 +1948,7 @@ class Gr {
1942
1948
  try {
1943
1949
  i();
1944
1950
  } catch (a) {
1945
- Ve.warn("Failed to cleanup listener", a);
1951
+ ze.warn("Failed to cleanup listener", a);
1946
1952
  }
1947
1953
  this.globalCleanups.delete(i);
1948
1954
  }
@@ -1987,21 +1993,21 @@ class Gr {
1987
1993
  }
1988
1994
  }
1989
1995
  }
1990
- const We = new Gr();
1991
- function Yr(t) {
1992
- const e = v(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
1996
+ const Xe = new no();
1997
+ function ro(t) {
1998
+ const e = E(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
1993
1999
  if (!(!s || typeof document > "u")) {
1994
2000
  if (i) {
1995
2001
  let l = e.current.get(s);
1996
2002
  l || (l = document.createElement("style"), l.setAttribute("data-ikon-style-id", s), document.head.appendChild(l), e.current.set(s, l)), l.textContent = i;
1997
2003
  }
1998
- We.registerStyle(s, a);
2004
+ Xe.registerStyle(s, a);
1999
2005
  }
2000
2006
  }, []), r = D((s) => {
2001
2007
  if (!(typeof document > "u"))
2002
2008
  for (const i of s) {
2003
2009
  const a = e.current.get(i);
2004
- a && (a.remove(), e.current.delete(i)), We.unregisterStyle(i);
2010
+ a && (a.remove(), e.current.delete(i)), Xe.unregisterStyle(i);
2005
2011
  }
2006
2012
  }, []), o = D(() => {
2007
2013
  if (typeof document < "u") {
@@ -2009,7 +2015,7 @@ function Yr(t) {
2009
2015
  s.remove();
2010
2016
  e.current.clear();
2011
2017
  }
2012
- We.reset();
2018
+ Xe.reset();
2013
2019
  }, []);
2014
2020
  return C(() => {
2015
2021
  if (!t) return;
@@ -2021,7 +2027,7 @@ function Yr(t) {
2021
2027
  };
2022
2028
  }, [t, o, n, r]), C(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
2023
2029
  }
2024
- function zr(t) {
2030
+ function oo(t) {
2025
2031
  const e = [];
2026
2032
  for (const [n, r] of t) {
2027
2033
  const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
@@ -2029,62 +2035,62 @@ function zr(t) {
2029
2035
  }
2030
2036
  return e.sort(), e.join(",");
2031
2037
  }
2032
- function Xr(t) {
2033
- const [e, n] = x(), r = v("");
2038
+ function so(t) {
2039
+ const [e, n] = N(), r = E("");
2034
2040
  return C(() => {
2035
2041
  if (!t) {
2036
2042
  n(void 0), r.current = "";
2037
2043
  return;
2038
2044
  }
2039
2045
  const o = () => {
2040
- const s = t.getStores(), i = zr(s);
2046
+ const s = t.getStores(), i = oo(s);
2041
2047
  i !== r.current && (r.current = i, n(s));
2042
2048
  };
2043
2049
  return o(), t.subscribe(o);
2044
2050
  }, [t]), e;
2045
2051
  }
2046
- var Hr = typeof global == "object" && global && global.Object === Object && global, qr = typeof self == "object" && self && self.Object === Object && self, Jr = Hr || qr || Function("return this")(), Ne = Jr.Symbol, Wt = Object.prototype, Zr = Wt.hasOwnProperty, Qr = Wt.toString, ye = Ne ? Ne.toStringTag : void 0;
2047
- function eo(t) {
2048
- var e = Zr.call(t, ye), n = t[ye];
2052
+ var io = typeof global == "object" && global && global.Object === Object && global, ao = typeof self == "object" && self && self.Object === Object && self, co = io || ao || Function("return this")(), Le = co.Symbol, Jt = Object.prototype, lo = Jt.hasOwnProperty, uo = Jt.toString, be = Le ? Le.toStringTag : void 0;
2053
+ function fo(t) {
2054
+ var e = lo.call(t, be), n = t[be];
2049
2055
  try {
2050
- t[ye] = void 0;
2056
+ t[be] = void 0;
2051
2057
  var r = !0;
2052
2058
  } catch {
2053
2059
  }
2054
- var o = Qr.call(t);
2055
- return r && (e ? t[ye] = n : delete t[ye]), o;
2060
+ var o = uo.call(t);
2061
+ return r && (e ? t[be] = n : delete t[be]), o;
2056
2062
  }
2057
- var to = Object.prototype, no = to.toString;
2058
- function ro(t) {
2059
- return no.call(t);
2063
+ var ho = Object.prototype, po = ho.toString;
2064
+ function mo(t) {
2065
+ return po.call(t);
2060
2066
  }
2061
- var oo = "[object Null]", so = "[object Undefined]", vt = Ne ? Ne.toStringTag : void 0;
2062
- function io(t) {
2063
- return t == null ? t === void 0 ? so : oo : vt && vt in Object(t) ? eo(t) : ro(t);
2067
+ var go = "[object Null]", yo = "[object Undefined]", _t = Le ? Le.toStringTag : void 0;
2068
+ function bo(t) {
2069
+ return t == null ? t === void 0 ? yo : go : _t && _t in Object(t) ? fo(t) : mo(t);
2064
2070
  }
2065
- function ao(t) {
2071
+ function So(t) {
2066
2072
  return t != null && typeof t == "object";
2067
2073
  }
2068
- var co = Array.isArray, lo = "[object String]";
2069
- function uo(t) {
2070
- return typeof t == "string" || !co(t) && ao(t) && io(t) == lo;
2074
+ var wo = Array.isArray, vo = "[object String]";
2075
+ function Eo(t) {
2076
+ return typeof t == "string" || !wo(t) && So(t) && bo(t) == vo;
2071
2077
  }
2072
- const Rt = "ikonUiModules";
2073
- function Qe(t) {
2078
+ const Ot = "ikonUiModules";
2079
+ function ot(t) {
2074
2080
  return typeof t == "object" && t !== null && !Array.isArray(t);
2075
2081
  }
2076
- function fo(t) {
2082
+ function Ro(t) {
2077
2083
  if (!Array.isArray(t))
2078
2084
  return;
2079
2085
  const e = /* @__PURE__ */ new Set();
2080
2086
  for (const n of t) {
2081
- if (!uo(n)) continue;
2087
+ if (!Eo(n)) continue;
2082
2088
  const r = n.trim();
2083
2089
  r && (e.has(r) || e.add(r));
2084
2090
  }
2085
2091
  return Array.from(e);
2086
2092
  }
2087
- function Ds(t, e) {
2093
+ function Hs(t, e) {
2088
2094
  if (t === e)
2089
2095
  return !0;
2090
2096
  if (!t || !e)
@@ -2096,19 +2102,19 @@ function Ds(t, e) {
2096
2102
  return !1;
2097
2103
  return !0;
2098
2104
  }
2099
- function ho(t) {
2100
- if (!(!Qe(t) || !Object.prototype.hasOwnProperty.call(t, Rt)))
2101
- return fo(t[Rt]);
2105
+ function Ao(t) {
2106
+ if (!(!ot(t) || !Object.prototype.hasOwnProperty.call(t, Ot)))
2107
+ return Ro(t[Ot]);
2102
2108
  }
2103
- function $s(...t) {
2109
+ function qs(...t) {
2104
2110
  for (const e of t) {
2105
- const n = ho(e);
2111
+ const n = Ao(e);
2106
2112
  if (n !== void 0)
2107
2113
  return n;
2108
2114
  }
2109
2115
  }
2110
- function Bs(t) {
2111
- if (!Qe(t))
2116
+ function Js(t) {
2117
+ if (!ot(t))
2112
2118
  return;
2113
2119
  const e = t, n = Object.keys(e).find((l) => l.toLowerCase() === "modules");
2114
2120
  if (!n)
@@ -2121,31 +2127,31 @@ function Bs(t) {
2121
2127
  const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
2122
2128
  for (const l of r) {
2123
2129
  if (typeof l == "string") {
2124
- const m = l.trim();
2125
- if (!m || i.has(m))
2130
+ const g = l.trim();
2131
+ if (!g || i.has(g))
2126
2132
  continue;
2127
- o.push(m), i.add(m);
2133
+ o.push(g), i.add(g);
2128
2134
  continue;
2129
2135
  }
2130
- if (!Qe(l))
2136
+ if (!ot(l))
2131
2137
  continue;
2132
- const f = l, p = Object.keys(f).find((m) => m.toLowerCase() === "name");
2133
- if (!p)
2138
+ const d = l, h = Object.keys(d).find((g) => g.toLowerCase() === "name");
2139
+ if (!h)
2134
2140
  continue;
2135
- const y = f[p];
2141
+ const y = d[h];
2136
2142
  if (typeof y != "string")
2137
2143
  continue;
2138
- const u = y.trim();
2139
- if (!u)
2144
+ const m = y.trim();
2145
+ if (!m)
2140
2146
  continue;
2141
- const c = Object.keys(f).find((m) => m.toLowerCase() === "javascript"), d = c ? f[c] : void 0;
2142
- typeof d == "string" && s.set(u, d), i.has(u) || (o.push(u), i.add(u));
2147
+ const c = Object.keys(d).find((g) => g.toLowerCase() === "javascript"), u = c ? d[c] : void 0;
2148
+ typeof u == "string" && s.set(m, u), i.has(m) || (o.push(m), i.add(m));
2143
2149
  }
2144
2150
  if (!o.length && s.size === 0)
2145
2151
  return { modules: [] };
2146
- const a = Array.from(s.entries()).map(([l, f]) => ({
2152
+ const a = Array.from(s.entries()).map(([l, d]) => ({
2147
2153
  name: l,
2148
- javascript: f
2154
+ javascript: d
2149
2155
  }));
2150
2156
  return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
2151
2157
  }
@@ -2156,7 +2162,7 @@ const k = {
2156
2162
  Line: 4,
2157
2163
  Paragraph: 8,
2158
2164
  Emoji: 16
2159
- }, po = [
2165
+ }, To = [
2160
2166
  {
2161
2167
  flag: k.Letter,
2162
2168
  hints: [
@@ -2205,42 +2211,42 @@ const k = {
2205
2211
  "[data-emoji]"
2206
2212
  ]
2207
2213
  }
2208
- ], et = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, mo = k.Letter | k.Word | k.Line | k.Paragraph, At = /* @__PURE__ */ new Map(), go = 16384;
2209
- function Fs(t, e) {
2210
- if (!t || t.length > go)
2214
+ ], st = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, ko = k.Letter | k.Word | k.Line | k.Paragraph, Nt = /* @__PURE__ */ new Map(), Co = 16384;
2215
+ function Zs(t, e) {
2216
+ if (!t || t.length > Co)
2211
2217
  return t;
2212
- const n = Po(e), r = ue(n, k.Emoji), o = n & mo;
2218
+ const n = Ko(e), r = fe(n, k.Emoji), o = n & ko;
2213
2219
  if (o === k.None && !r)
2214
2220
  return t;
2215
2221
  const s = t.replace(/\r\n/g, `
2216
2222
  `).replace(/\r/g, `
2217
2223
  `);
2218
2224
  if (o === k.None)
2219
- return _t(s);
2220
- const i = No(s);
2225
+ return Ut(s);
2226
+ const i = Vo(s);
2221
2227
  if (i.length === 0)
2222
- return r ? _t(s) : t;
2223
- const a = xo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
2224
- for (const p of a) {
2225
- const y = yo(p, n, l);
2226
- f.push(...y);
2228
+ return r ? Ut(s) : t;
2229
+ const a = Wo(i), l = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
2230
+ for (const h of a) {
2231
+ const y = Io(h, n, l);
2232
+ d.push(...y);
2227
2233
  }
2228
- return f;
2234
+ return d;
2229
2235
  }
2230
- function yo(t, e, n) {
2236
+ function Io(t, e, n) {
2231
2237
  const r = [];
2232
2238
  for (const o of t) {
2233
- const s = bo(o, e, n);
2239
+ const s = _o(o, e, n);
2234
2240
  r.push(...s);
2235
2241
  }
2236
- if (ue(e, k.Paragraph)) {
2242
+ if (fe(e, k.Paragraph)) {
2237
2243
  const o = n.paragraph++;
2238
2244
  return [
2239
- /* @__PURE__ */ S.jsx(
2245
+ /* @__PURE__ */ w.jsx(
2240
2246
  "span",
2241
2247
  {
2242
2248
  "data-motion-paragraph": !0,
2243
- style: Le(o),
2249
+ style: je(o),
2244
2250
  children: r
2245
2251
  },
2246
2252
  `motion-paragraph-${o}`
@@ -2249,116 +2255,116 @@ function yo(t, e, n) {
2249
2255
  }
2250
2256
  return r;
2251
2257
  }
2252
- function bo(t, e, n) {
2253
- const r = wo(t.text, e, n), o = [];
2254
- if (ue(e, k.Line)) {
2258
+ function _o(t, e, n) {
2259
+ const r = Oo(t.text, e, n), o = [];
2260
+ if (fe(e, k.Line)) {
2255
2261
  const s = n.line++;
2256
2262
  o.push(
2257
- /* @__PURE__ */ S.jsx("span", { "data-motion-line": !0, style: Le(s), children: r }, `motion-line-${s}`)
2263
+ /* @__PURE__ */ w.jsx("span", { "data-motion-line": !0, style: je(s), children: r }, `motion-line-${s}`)
2258
2264
  );
2259
2265
  } else
2260
2266
  o.push(...r);
2261
2267
  for (let s = 0; s < t.breaks; s++)
2262
- o.push(/* @__PURE__ */ S.jsx("br", {}, `motion-break-${n.br++}`));
2268
+ o.push(/* @__PURE__ */ w.jsx("br", {}, `motion-break-${n.br++}`));
2263
2269
  return o;
2264
2270
  }
2265
- function wo(t, e, n) {
2271
+ function Oo(t, e, n) {
2266
2272
  if (!t)
2267
2273
  return [];
2268
- const r = ue(e, k.Word), o = [], s = /(\s+)/g;
2274
+ const r = fe(e, k.Word), o = [], s = /(\s+)/g;
2269
2275
  let i = 0, a;
2270
2276
  for (; (a = s.exec(t)) !== null; ) {
2271
2277
  if (a.index > i) {
2272
2278
  const l = t.slice(i, a.index);
2273
- o.push(Tt(l, n, e, r));
2279
+ o.push(xt(l, n, e, r));
2274
2280
  }
2275
2281
  o.push(a[0]), i = a.index + a[0].length;
2276
2282
  }
2277
2283
  if (i < t.length) {
2278
2284
  const l = t.slice(i);
2279
- o.push(Tt(l, n, e, r));
2285
+ o.push(xt(l, n, e, r));
2280
2286
  }
2281
2287
  return o;
2282
2288
  }
2283
- function Tt(t, e, n, r) {
2284
- const o = e.word++, s = Eo(t, n, e), i = `motion-word-${o}`, a = So(o, r);
2285
- return r ? /* @__PURE__ */ S.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ S.jsx("span", { style: a, children: s }, i);
2289
+ function xt(t, e, n, r) {
2290
+ const o = e.word++, s = xo(t, n, e), i = `motion-word-${o}`, a = No(o, r);
2291
+ return r ? /* @__PURE__ */ w.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ w.jsx("span", { style: a, children: s }, i);
2286
2292
  }
2287
- function So(t, e) {
2288
- return e ? { ...Le(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2293
+ function No(t, e) {
2294
+ return e ? { ...je(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2289
2295
  }
2290
- function Eo(t, e, n) {
2296
+ function xo(t, e, n) {
2291
2297
  if (!t)
2292
2298
  return [];
2293
- const r = ue(e, k.Letter), o = ue(e, k.Emoji);
2299
+ const r = fe(e, k.Letter), o = fe(e, k.Emoji);
2294
2300
  if (!r) {
2295
2301
  if (!o)
2296
2302
  return [t];
2297
- const a = tt(t);
2303
+ const a = it(t);
2298
2304
  if (a.length === 0)
2299
2305
  return [t];
2300
- const { nodes: l } = Gt(a, n);
2306
+ const { nodes: l } = Qt(a, n);
2301
2307
  return l;
2302
2308
  }
2303
- const s = [], i = tt(t);
2309
+ const s = [], i = it(t);
2304
2310
  for (const a of i) {
2305
- const l = n.letter++, f = `motion-letter-${l}`, p = Le(l);
2311
+ const l = n.letter++, d = `motion-letter-${l}`, h = je(l);
2306
2312
  if (a === `
2307
2313
  `) {
2308
2314
  s.push(
2309
- /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: p, children: /* @__PURE__ */ S.jsx("br", {}) }, f)
2315
+ /* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: h, children: /* @__PURE__ */ w.jsx("br", {}) }, d)
2310
2316
  );
2311
2317
  continue;
2312
2318
  }
2313
- const u = o && Kt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
2319
+ const m = o && Zt(a) ? { "data-motion-emoji": !0 } : void 0, c = a === " " ? " " : a;
2314
2320
  s.push(
2315
- /* @__PURE__ */ S.jsx("span", { "data-motion-letter": !0, style: p, ...u, children: c }, f)
2321
+ /* @__PURE__ */ w.jsx("span", { "data-motion-letter": !0, style: h, ...m, children: c }, d)
2316
2322
  );
2317
2323
  }
2318
2324
  return s;
2319
2325
  }
2320
- function tt(t) {
2326
+ function it(t) {
2321
2327
  if (!t)
2322
2328
  return [];
2323
- const e = vo();
2324
- return e ? Array.from(e.segment(t), (n) => n.segment) : Ro(t);
2329
+ const e = Po();
2330
+ return e ? Array.from(e.segment(t), (n) => n.segment) : Lo(t);
2325
2331
  }
2326
- let be;
2327
- function vo() {
2328
- return be !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? be = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : be = null), be;
2332
+ let Se;
2333
+ function Po() {
2334
+ return Se !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? Se = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : Se = null), Se;
2329
2335
  }
2330
- function Ro(t) {
2336
+ function Lo(t) {
2331
2337
  const e = [], n = Array.from(t);
2332
2338
  let r = "";
2333
2339
  for (let o = 0; o < n.length; o++) {
2334
2340
  const s = n[o], i = n[o + 1];
2335
- r += s, !(i && Ao(s, i)) && (e.push(r), r = "");
2341
+ r += s, !(i && Uo(s, i)) && (e.push(r), r = "");
2336
2342
  }
2337
2343
  return r && e.push(r), e;
2338
2344
  }
2339
- function Ao(t, e) {
2340
- return e ? !!(kt(t) || kt(e) || Co(e) || To(e) || ko(e) || Ct(t) && Ct(e)) : !1;
2345
+ function Uo(t, e) {
2346
+ return e ? !!(Pt(t) || Pt(e) || Do(e) || Mo(e) || jo(e) || Lt(t) && Lt(e)) : !1;
2341
2347
  }
2342
- function kt(t) {
2348
+ function Pt(t) {
2343
2349
  return t.codePointAt(0) === 8205;
2344
2350
  }
2345
- function To(t) {
2351
+ function Mo(t) {
2346
2352
  const e = t.codePointAt(0);
2347
2353
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
2348
2354
  }
2349
- function ko(t) {
2355
+ function jo(t) {
2350
2356
  const e = t.codePointAt(0);
2351
2357
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
2352
2358
  }
2353
- function Ct(t) {
2359
+ function Lt(t) {
2354
2360
  const e = t.codePointAt(0);
2355
2361
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
2356
2362
  }
2357
- let Ke;
2358
- function Co(t) {
2359
- return t ? (Ke || (Ke = _o()), Ke(t)) : !1;
2363
+ let He;
2364
+ function Do(t) {
2365
+ return t ? (He || (He = $o()), He(t)) : !1;
2360
2366
  }
2361
- function _o() {
2367
+ function $o() {
2362
2368
  try {
2363
2369
  const t = new RegExp("\\p{Mark}", "u");
2364
2370
  return (e) => t.test(e);
@@ -2369,19 +2375,19 @@ function _o() {
2369
2375
  };
2370
2376
  }
2371
2377
  }
2372
- let Ge;
2373
- function Kt(t) {
2374
- return t ? (Ge || (Ge = Io()), Ge(t)) : !1;
2378
+ let qe;
2379
+ function Zt(t) {
2380
+ return t ? (qe || (qe = Bo()), qe(t)) : !1;
2375
2381
  }
2376
- function Io() {
2382
+ function Bo() {
2377
2383
  try {
2378
2384
  const t = new RegExp("\\p{Extended_Pictographic}", "u");
2379
2385
  return (e) => t.test(e);
2380
2386
  } catch {
2381
- return Oo;
2387
+ return Fo;
2382
2388
  }
2383
2389
  }
2384
- function Oo(t) {
2390
+ function Fo(t) {
2385
2391
  if (!t)
2386
2392
  return !1;
2387
2393
  for (const e of Array.from(t)) {
@@ -2391,7 +2397,7 @@ function Oo(t) {
2391
2397
  }
2392
2398
  return !1;
2393
2399
  }
2394
- function No(t) {
2400
+ function Vo(t) {
2395
2401
  const e = [];
2396
2402
  let n = "", r = 0;
2397
2403
  for (let o = 0; o < t.length; o++) {
@@ -2405,7 +2411,7 @@ function No(t) {
2405
2411
  }
2406
2412
  return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
2407
2413
  }
2408
- function xo(t) {
2414
+ function Wo(t) {
2409
2415
  if (t.length === 0)
2410
2416
  return [];
2411
2417
  const e = [];
@@ -2414,10 +2420,10 @@ function xo(t) {
2414
2420
  n.push(r), r.breaks >= 2 && (e.push(n), n = []);
2415
2421
  return n.length > 0 && e.push(n), e;
2416
2422
  }
2417
- function ue(t, e) {
2423
+ function fe(t, e) {
2418
2424
  return (t & e) === e;
2419
2425
  }
2420
- function Le(t) {
2426
+ function je(t) {
2421
2427
  return {
2422
2428
  "--tw-motion-seq-index": t.toString(),
2423
2429
  backgroundColor: "inherit",
@@ -2434,27 +2440,27 @@ function Le(t) {
2434
2440
  WebkitTextFillColor: "inherit"
2435
2441
  };
2436
2442
  }
2437
- function _t(t) {
2443
+ function Ut(t) {
2438
2444
  if (!t)
2439
2445
  return t;
2440
- const e = tt(t);
2446
+ const e = it(t);
2441
2447
  if (e.length === 0)
2442
2448
  return t;
2443
- const { nodes: n, sawEmoji: r } = Gt(e);
2449
+ const { nodes: n, sawEmoji: r } = Qt(e);
2444
2450
  return r ? n.length === 1 ? n[0] ?? t : n : t;
2445
2451
  }
2446
- function Gt(t, e) {
2452
+ function Qt(t, e) {
2447
2453
  const n = [];
2448
2454
  let r = "", o = !1, s = e?.emoji ?? 0;
2449
2455
  const i = () => {
2450
2456
  r && (n.push(r), r = "");
2451
2457
  };
2452
2458
  for (const a of t) {
2453
- if (Kt(a)) {
2459
+ if (Zt(a)) {
2454
2460
  o = !0, i();
2455
- const f = `motion-emoji-${e ? e.emoji++ : s++}`;
2461
+ const d = `motion-emoji-${e ? e.emoji++ : s++}`;
2456
2462
  n.push(
2457
- /* @__PURE__ */ S.jsx("span", { "data-motion-emoji": !0, children: a }, f)
2463
+ /* @__PURE__ */ w.jsx("span", { "data-motion-emoji": !0, children: a }, d)
2458
2464
  );
2459
2465
  continue;
2460
2466
  }
@@ -2462,13 +2468,13 @@ function Gt(t, e) {
2462
2468
  }
2463
2469
  return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
2464
2470
  }
2465
- function Po(t) {
2471
+ function Ko(t) {
2466
2472
  if (!t)
2467
2473
  return k.None;
2468
2474
  const e = t.trim();
2469
2475
  if (!e)
2470
2476
  return k.None;
2471
- const n = At.get(e);
2477
+ const n = Nt.get(e);
2472
2478
  if (typeof n == "number")
2473
2479
  return n;
2474
2480
  if (typeof document > "u")
@@ -2476,25 +2482,25 @@ function Po(t) {
2476
2482
  const r = e.split(/\s+/).filter(Boolean);
2477
2483
  if (r.length === 0)
2478
2484
  return k.None;
2479
- const s = r.map((l) => `.${Lo(l)}`).map(
2480
- (l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Mo(l)}(?![a-zA-Z0-9_-])`)
2485
+ const s = r.map((l) => `.${Go(l)}`).map(
2486
+ (l) => new RegExp(`(^|[^a-zA-Z0-9_-])${Yo(l)}(?![a-zA-Z0-9_-])`)
2481
2487
  );
2482
2488
  let i = k.None, a = !1;
2483
2489
  for (const l of Array.from(document.styleSheets)) {
2484
- let f;
2490
+ let d;
2485
2491
  try {
2486
- f = l.cssRules;
2492
+ d = l.cssRules;
2487
2493
  } catch {
2488
2494
  continue;
2489
2495
  }
2490
- const p = Yt(f, s);
2491
- if (p.mask && (i |= p.mask, i === et))
2496
+ const h = en(d, s);
2497
+ if (h.mask && (i |= h.mask, i === st))
2492
2498
  break;
2493
- a ||= p.sawStyleRule;
2499
+ a ||= h.sawStyleRule;
2494
2500
  }
2495
- return (i !== k.None || a) && At.set(e, i), i;
2501
+ return (i !== k.None || a) && Nt.set(e, i), i;
2496
2502
  }
2497
- function Yt(t, e) {
2503
+ function en(t, e) {
2498
2504
  if (!t)
2499
2505
  return { mask: k.None, sawStyleRule: !1 };
2500
2506
  let n = k.None, r = !1;
@@ -2503,15 +2509,15 @@ function Yt(t, e) {
2503
2509
  if (s) {
2504
2510
  if (s.type === CSSRule.STYLE_RULE) {
2505
2511
  const a = s.selectorText ?? "";
2506
- if (!a || !e.some((f) => f.test(a))) continue;
2512
+ if (!a || !e.some((d) => d.test(a))) continue;
2507
2513
  r = !0;
2508
- for (const f of po)
2509
- f.hints.some((p) => a.includes(p)) && (n |= f.flag);
2510
- if (n === et)
2514
+ for (const d of To)
2515
+ d.hints.some((h) => a.includes(h)) && (n |= d.flag);
2516
+ if (n === st)
2511
2517
  return { mask: n, sawStyleRule: !0 };
2512
2518
  } else if ("cssRules" in s) {
2513
- const i = Yt(s.cssRules, e);
2514
- if (i.mask && (n |= i.mask, n === et))
2519
+ const i = en(s.cssRules, e);
2520
+ if (i.mask && (n |= i.mask, n === st))
2515
2521
  return { mask: n, sawStyleRule: !0 };
2516
2522
  r ||= i.sawStyleRule;
2517
2523
  }
@@ -2519,48 +2525,48 @@ function Yt(t, e) {
2519
2525
  }
2520
2526
  return { mask: n, sawStyleRule: r };
2521
2527
  }
2522
- function Lo(t) {
2528
+ function Go(t) {
2523
2529
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2524
2530
  }
2525
- function Mo(t) {
2531
+ function Yo(t) {
2526
2532
  return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2527
2533
  }
2528
- const it = "ikon_auth_session", Uo = 10080 * 60 * 1e3, jo = 60 * 1e3;
2529
- function Do(t) {
2534
+ const dt = "ikon_auth_session", zo = 10080 * 60 * 1e3, Xo = 60 * 1e3;
2535
+ function Ho(t) {
2530
2536
  try {
2531
2537
  const e = t.split(".");
2532
2538
  if (e.length !== 3) return !0;
2533
2539
  const n = e[1].replace(/-/g, "+").replace(/_/g, "/"), r = n + "=".repeat((4 - n.length % 4) % 4), o = JSON.parse(atob(r));
2534
- return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - jo;
2540
+ return typeof o.exp != "number" ? !1 : Date.now() >= o.exp * 1e3 - Xo;
2535
2541
  } catch {
2536
2542
  return !0;
2537
2543
  }
2538
2544
  }
2539
2545
  function Ee(t) {
2540
2546
  try {
2541
- localStorage.setItem(it, JSON.stringify(t));
2547
+ localStorage.setItem(dt, JSON.stringify(t));
2542
2548
  } catch {
2543
2549
  console.warn("Failed to save auth session to localStorage");
2544
2550
  }
2545
2551
  }
2546
- function zt() {
2552
+ function tn() {
2547
2553
  try {
2548
- const t = localStorage.getItem(it);
2554
+ const t = localStorage.getItem(dt);
2549
2555
  if (!t) return null;
2550
2556
  const e = JSON.parse(t);
2551
- return Date.now() - e.authenticatedAt > Uo || Do(e.token) ? (xe(), null) : e;
2557
+ return Date.now() - e.authenticatedAt > zo || Ho(e.token) ? (Ue(), null) : e;
2552
2558
  } catch {
2553
2559
  return console.warn("Failed to load auth session from localStorage"), null;
2554
2560
  }
2555
2561
  }
2556
- function xe() {
2562
+ function Ue() {
2557
2563
  try {
2558
- localStorage.removeItem(it);
2564
+ localStorage.removeItem(dt);
2559
2565
  } catch {
2560
2566
  console.warn("Failed to clear auth session from localStorage");
2561
2567
  }
2562
2568
  }
2563
- function ae(t) {
2569
+ function le(t) {
2564
2570
  return {
2565
2571
  id: "",
2566
2572
  provider: t.provider,
@@ -2568,16 +2574,16 @@ function ae(t) {
2568
2574
  authenticatedAt: t.authenticatedAt
2569
2575
  };
2570
2576
  }
2571
- const Xt = 15e3, we = se("AuthService");
2572
- async function It(t) {
2577
+ const nn = 15e3, we = re("AuthService");
2578
+ async function Mt(t) {
2573
2579
  try {
2574
2580
  return await fetch(t, { method: "GET", mode: "no-cors" }), "no-cors probe SUCCEEDED → origin is reachable; the failure is most likely CORS (missing/!allowed Access-Control headers)";
2575
2581
  } catch (e) {
2576
2582
  return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
2577
2583
  }
2578
2584
  }
2579
- async function Ht(t, e) {
2580
- const n = wn(), r = {
2585
+ async function rn(t, e) {
2586
+ const n = On(), r = {
2581
2587
  method: "POST",
2582
2588
  headers: { "Content-Type": "application/json" },
2583
2589
  body: JSON.stringify({ deviceId: n, space: t })
@@ -2586,24 +2592,24 @@ async function Ht(t, e) {
2586
2592
  let i;
2587
2593
  try {
2588
2594
  i = await fetch(s, r);
2589
- } catch (f) {
2590
- const p = f instanceof Error ? `${f.name}: ${f.message}` : String(f), y = Sn(), u = y ? `${y}/anonymous` : null;
2591
- if (u && u !== s) {
2592
- we.warn(`Anonymous auth could not reach ${s} (${p}); falling back to same-origin ${u}`);
2595
+ } catch (d) {
2596
+ const h = d instanceof Error ? `${d.name}: ${d.message}` : String(d), y = Nn(), m = y ? `${y}/anonymous` : null;
2597
+ if (m && m !== s) {
2598
+ we.warn(`Anonymous auth could not reach ${s} (${h}); falling back to same-origin ${m}`);
2593
2599
  try {
2594
- i = await fetch(u, r);
2600
+ i = await fetch(m, r);
2595
2601
  } catch (c) {
2596
- const d = c instanceof Error ? `${c.name}: ${c.message}` : String(c), m = await It(e);
2597
- throw we.error(`Anonymous auth failed on both direct (${s}: ${p}) and same-origin (${u}: ${d}). ${m}`), new Error(`Anonymous auth unreachable: direct ${s} (${p}) and same-origin ${u} (${d})`);
2602
+ const u = c instanceof Error ? `${c.name}: ${c.message}` : String(c), g = await Mt(e);
2603
+ throw we.error(`Anonymous auth failed on both direct (${s}: ${h}) and same-origin (${m}: ${u}). ${g}`), new Error(`Anonymous auth unreachable: direct ${s} (${h}) and same-origin ${m} (${u})`);
2598
2604
  }
2599
2605
  } else {
2600
- const c = await It(e);
2601
- throw we.error(`Anonymous auth fetch threw for ${s} — ${p}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${p}). ${c}`);
2606
+ const c = await Mt(e);
2607
+ throw we.error(`Anonymous auth fetch threw for ${s} — ${h}. ${c}`), new Error(`Anonymous auth could not reach ${s} (${h}). ${c}`);
2602
2608
  }
2603
2609
  }
2604
2610
  if (!i.ok) {
2605
- const f = await i.text().catch(() => "Unknown error");
2606
- throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${f}`), new Error(`Anonymous auth failed: ${i.status} ${f}`);
2611
+ const d = await i.text().catch(() => "Unknown error");
2612
+ throw we.error(`Anonymous auth HTTP ${i.status} from ${i.url}: ${d}`), new Error(`Anonymous auth failed: ${i.status} ${d}`);
2607
2613
  }
2608
2614
  const { token: a } = await i.json(), l = {
2609
2615
  token: a,
@@ -2612,7 +2618,7 @@ async function Ht(t, e) {
2612
2618
  };
2613
2619
  return Ee(l), l;
2614
2620
  }
2615
- async function $o({ email: t, spaceId: e, authUrl: n }) {
2621
+ async function qo({ email: t, spaceId: e, authUrl: n }) {
2616
2622
  const r = await fetch(`${n}/email/send`, {
2617
2623
  method: "POST",
2618
2624
  headers: { "Content-Type": "application/json" },
@@ -2620,14 +2626,14 @@ async function $o({ email: t, spaceId: e, authUrl: n }) {
2620
2626
  email: t.trim(),
2621
2627
  space: e
2622
2628
  }),
2623
- signal: Lt(Xt)
2629
+ signal: Vt(nn)
2624
2630
  });
2625
2631
  if (!r.ok) {
2626
2632
  const o = await r.text().catch(() => "Failed to send login code");
2627
2633
  throw new Error(o);
2628
2634
  }
2629
2635
  }
2630
- async function Bo({ email: t, code: e, authUrl: n }) {
2636
+ async function Jo({ email: t, code: e, authUrl: n }) {
2631
2637
  const r = await fetch(`${n}/email/code`, {
2632
2638
  method: "POST",
2633
2639
  headers: { "Content-Type": "application/json" },
@@ -2635,7 +2641,7 @@ async function Bo({ email: t, code: e, authUrl: n }) {
2635
2641
  email: t.trim(),
2636
2642
  code: e.trim()
2637
2643
  }),
2638
- signal: Lt(Xt)
2644
+ signal: Vt(nn)
2639
2645
  });
2640
2646
  if (!r.ok) {
2641
2647
  const i = await r.text().catch(() => "Invalid code");
@@ -2648,21 +2654,21 @@ async function Bo({ email: t, code: e, authUrl: n }) {
2648
2654
  };
2649
2655
  return Ee(s), s;
2650
2656
  }
2651
- function Fo() {
2657
+ function Zo() {
2652
2658
  const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
2653
2659
  return e && n ? { token: e, provider: n } : null;
2654
2660
  }
2655
- function Vo() {
2661
+ function Qo() {
2656
2662
  return new URLSearchParams(window.location.search).get("error");
2657
2663
  }
2658
- function Ot() {
2664
+ function jt() {
2659
2665
  window.history.replaceState({}, "", window.location.pathname);
2660
2666
  }
2661
- function Wo(t, e, n, r) {
2667
+ function es(t, e, n, r) {
2662
2668
  const o = r ?? window.location.origin + window.location.pathname + window.location.search;
2663
2669
  return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
2664
2670
  }
2665
- async function Ko(t) {
2671
+ async function ts(t) {
2666
2672
  const e = await fetch(`${t}/passkey/registration/options`, {
2667
2673
  method: "POST",
2668
2674
  headers: { "Content-Type": "application/json" }
@@ -2673,7 +2679,7 @@ async function Ko(t) {
2673
2679
  }
2674
2680
  return e.json();
2675
2681
  }
2676
- async function Go(t, e, n) {
2682
+ async function ns(t, e, n) {
2677
2683
  const r = await fetch(`${t}/passkey/registration/verify`, {
2678
2684
  method: "POST",
2679
2685
  headers: { "Content-Type": "application/json" },
@@ -2690,7 +2696,7 @@ async function Go(t, e, n) {
2690
2696
  };
2691
2697
  return Ee(s), s;
2692
2698
  }
2693
- async function Yo(t, e) {
2699
+ async function rs(t, e) {
2694
2700
  const n = await fetch(`${t}/passkey/authentication/options`, {
2695
2701
  method: "POST",
2696
2702
  headers: { "Content-Type": "application/json" },
@@ -2702,7 +2708,7 @@ async function Yo(t, e) {
2702
2708
  }
2703
2709
  return n.json();
2704
2710
  }
2705
- async function zo(t, e) {
2711
+ async function os(t, e) {
2706
2712
  const n = await fetch(`${t}/passkey/authentication/verify`, {
2707
2713
  method: "POST",
2708
2714
  headers: { "Content-Type": "application/json" },
@@ -2719,30 +2725,30 @@ async function zo(t, e) {
2719
2725
  };
2720
2726
  return Ee(o), o;
2721
2727
  }
2722
- function z(t) {
2728
+ function X(t) {
2723
2729
  const e = new Uint8Array(t);
2724
2730
  let n = "";
2725
2731
  for (const o of e)
2726
2732
  n += String.fromCharCode(o);
2727
2733
  return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2728
2734
  }
2729
- function Pe(t) {
2735
+ function Me(t) {
2730
2736
  const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - e.length % 4) % 4, r = e.padEnd(e.length + n, "="), o = atob(r), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
2731
2737
  for (let a = 0; a < o.length; a++)
2732
2738
  i[a] = o.charCodeAt(a);
2733
2739
  return s;
2734
2740
  }
2735
- function at() {
2736
- return Xo.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2741
+ function ft() {
2742
+ return ss.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2737
2743
  }
2738
- const Xo = {
2744
+ const ss = {
2739
2745
  stubThis: (t) => t
2740
2746
  };
2741
- function qt(t) {
2747
+ function on(t) {
2742
2748
  const { id: e } = t;
2743
2749
  return {
2744
2750
  ...t,
2745
- id: Pe(e),
2751
+ id: Me(e),
2746
2752
  /**
2747
2753
  * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
2748
2754
  * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
@@ -2751,7 +2757,7 @@ function qt(t) {
2751
2757
  transports: t.transports
2752
2758
  };
2753
2759
  }
2754
- function Jt(t) {
2760
+ function sn(t) {
2755
2761
  return (
2756
2762
  // Consider localhost valid as well since it's okay wrt Secure Contexts
2757
2763
  t === "localhost" || // Support punycode (ACE) or ascii labels and domains
@@ -2768,7 +2774,7 @@ class j extends Error {
2768
2774
  }), this.name = o ?? r.name, this.code = n;
2769
2775
  }
2770
2776
  }
2771
- function Ho({ error: t, options: e }) {
2777
+ function is({ error: t, options: e }) {
2772
2778
  const { publicKey: n } = e;
2773
2779
  if (!n)
2774
2780
  throw Error("options was missing required publicKey property");
@@ -2826,7 +2832,7 @@ function Ho({ error: t, options: e }) {
2826
2832
  });
2827
2833
  if (t.name === "SecurityError") {
2828
2834
  const r = globalThis.location.hostname;
2829
- if (Jt(r)) {
2835
+ if (sn(r)) {
2830
2836
  if (n.rp.id !== r)
2831
2837
  return new j({
2832
2838
  message: `The RP ID "${n.rp.id}" is invalid for this domain`,
@@ -2854,7 +2860,7 @@ function Ho({ error: t, options: e }) {
2854
2860
  }
2855
2861
  return t;
2856
2862
  }
2857
- class qo {
2863
+ class as {
2858
2864
  constructor() {
2859
2865
  Object.defineProperty(this, "controller", {
2860
2866
  enumerable: !0,
@@ -2878,89 +2884,89 @@ class qo {
2878
2884
  }
2879
2885
  }
2880
2886
  }
2881
- const Zt = new qo(), Jo = ["cross-platform", "platform"];
2882
- function Qt(t) {
2883
- if (t && !(Jo.indexOf(t) < 0))
2887
+ const an = new as(), cs = ["cross-platform", "platform"];
2888
+ function cn(t) {
2889
+ if (t && !(cs.indexOf(t) < 0))
2884
2890
  return t;
2885
2891
  }
2886
- async function Zo(t) {
2892
+ async function ls(t) {
2887
2893
  !t.optionsJSON && t.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
2888
2894
  const { optionsJSON: e, useAutoRegister: n = !1 } = t;
2889
- if (!at())
2895
+ if (!ft())
2890
2896
  throw new Error("WebAuthn is not supported in this browser");
2891
2897
  const r = {
2892
2898
  ...e,
2893
- challenge: Pe(e.challenge),
2899
+ challenge: Me(e.challenge),
2894
2900
  user: {
2895
2901
  ...e.user,
2896
- id: Pe(e.user.id)
2902
+ id: Me(e.user.id)
2897
2903
  },
2898
- excludeCredentials: e.excludeCredentials?.map(qt)
2904
+ excludeCredentials: e.excludeCredentials?.map(on)
2899
2905
  }, o = {};
2900
- n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Zt.createNewAbortSignal();
2906
+ n && (o.mediation = "conditional"), o.publicKey = r, o.signal = an.createNewAbortSignal();
2901
2907
  let s;
2902
2908
  try {
2903
2909
  s = await navigator.credentials.create(o);
2904
- } catch (d) {
2905
- throw Ho({ error: d, options: o });
2910
+ } catch (u) {
2911
+ throw is({ error: u, options: o });
2906
2912
  }
2907
2913
  if (!s)
2908
2914
  throw new Error("Registration was not completed");
2909
- const { id: i, rawId: a, response: l, type: f } = s;
2910
- let p;
2911
- typeof l.getTransports == "function" && (p = l.getTransports());
2915
+ const { id: i, rawId: a, response: l, type: d } = s;
2916
+ let h;
2917
+ typeof l.getTransports == "function" && (h = l.getTransports());
2912
2918
  let y;
2913
2919
  if (typeof l.getPublicKeyAlgorithm == "function")
2914
2920
  try {
2915
2921
  y = l.getPublicKeyAlgorithm();
2916
- } catch (d) {
2917
- Ye("getPublicKeyAlgorithm()", d);
2922
+ } catch (u) {
2923
+ Je("getPublicKeyAlgorithm()", u);
2918
2924
  }
2919
- let u;
2925
+ let m;
2920
2926
  if (typeof l.getPublicKey == "function")
2921
2927
  try {
2922
- const d = l.getPublicKey();
2923
- d !== null && (u = z(d));
2924
- } catch (d) {
2925
- Ye("getPublicKey()", d);
2928
+ const u = l.getPublicKey();
2929
+ u !== null && (m = X(u));
2930
+ } catch (u) {
2931
+ Je("getPublicKey()", u);
2926
2932
  }
2927
2933
  let c;
2928
2934
  if (typeof l.getAuthenticatorData == "function")
2929
2935
  try {
2930
- c = z(l.getAuthenticatorData());
2931
- } catch (d) {
2932
- Ye("getAuthenticatorData()", d);
2936
+ c = X(l.getAuthenticatorData());
2937
+ } catch (u) {
2938
+ Je("getAuthenticatorData()", u);
2933
2939
  }
2934
2940
  return {
2935
2941
  id: i,
2936
- rawId: z(a),
2942
+ rawId: X(a),
2937
2943
  response: {
2938
- attestationObject: z(l.attestationObject),
2939
- clientDataJSON: z(l.clientDataJSON),
2940
- transports: p,
2944
+ attestationObject: X(l.attestationObject),
2945
+ clientDataJSON: X(l.clientDataJSON),
2946
+ transports: h,
2941
2947
  publicKeyAlgorithm: y,
2942
- publicKey: u,
2948
+ publicKey: m,
2943
2949
  authenticatorData: c
2944
2950
  },
2945
- type: f,
2951
+ type: d,
2946
2952
  clientExtensionResults: s.getClientExtensionResults(),
2947
- authenticatorAttachment: Qt(s.authenticatorAttachment)
2953
+ authenticatorAttachment: cn(s.authenticatorAttachment)
2948
2954
  };
2949
2955
  }
2950
- function Ye(t, e) {
2956
+ function Je(t, e) {
2951
2957
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
2952
2958
  `, e);
2953
2959
  }
2954
- function Qo() {
2955
- if (!at())
2956
- return ze.stubThis(new Promise((e) => e(!1)));
2960
+ function us() {
2961
+ if (!ft())
2962
+ return Ze.stubThis(new Promise((e) => e(!1)));
2957
2963
  const t = globalThis.PublicKeyCredential;
2958
- return t?.isConditionalMediationAvailable === void 0 ? ze.stubThis(new Promise((e) => e(!1))) : ze.stubThis(t.isConditionalMediationAvailable());
2964
+ return t?.isConditionalMediationAvailable === void 0 ? Ze.stubThis(new Promise((e) => e(!1))) : Ze.stubThis(t.isConditionalMediationAvailable());
2959
2965
  }
2960
- const ze = {
2966
+ const Ze = {
2961
2967
  stubThis: (t) => t
2962
2968
  };
2963
- function es({ error: t, options: e }) {
2969
+ function ds({ error: t, options: e }) {
2964
2970
  const { publicKey: n } = e;
2965
2971
  if (!n)
2966
2972
  throw Error("options was missing required publicKey property");
@@ -2980,7 +2986,7 @@ function es({ error: t, options: e }) {
2980
2986
  });
2981
2987
  if (t.name === "SecurityError") {
2982
2988
  const r = globalThis.location.hostname;
2983
- if (Jt(r)) {
2989
+ if (sn(r)) {
2984
2990
  if (n.rpId !== r)
2985
2991
  return new j({
2986
2992
  message: `The RP ID "${n.rpId}" is invalid for this domain`,
@@ -3001,53 +3007,53 @@ function es({ error: t, options: e }) {
3001
3007
  }
3002
3008
  return t;
3003
3009
  }
3004
- async function ts(t) {
3010
+ async function fs(t) {
3005
3011
  !t.optionsJSON && t.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), t = { optionsJSON: t });
3006
3012
  const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
3007
- if (!at())
3013
+ if (!ft())
3008
3014
  throw new Error("WebAuthn is not supported in this browser");
3009
3015
  let o;
3010
- e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(qt));
3016
+ e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(on));
3011
3017
  const s = {
3012
3018
  ...e,
3013
- challenge: Pe(e.challenge),
3019
+ challenge: Me(e.challenge),
3014
3020
  allowCredentials: o
3015
3021
  }, i = {};
3016
3022
  if (n) {
3017
- if (!await Qo())
3023
+ if (!await us())
3018
3024
  throw Error("Browser does not support WebAuthn autofill");
3019
3025
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
3020
3026
  throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
3021
3027
  i.mediation = "conditional", s.allowCredentials = [];
3022
3028
  }
3023
- i.publicKey = s, i.signal = Zt.createNewAbortSignal();
3029
+ i.publicKey = s, i.signal = an.createNewAbortSignal();
3024
3030
  let a;
3025
3031
  try {
3026
3032
  a = await navigator.credentials.get(i);
3027
3033
  } catch (c) {
3028
- throw es({ error: c, options: i });
3034
+ throw ds({ error: c, options: i });
3029
3035
  }
3030
3036
  if (!a)
3031
3037
  throw new Error("Authentication was not completed");
3032
- const { id: l, rawId: f, response: p, type: y } = a;
3033
- let u;
3034
- return p.userHandle && (u = z(p.userHandle)), {
3038
+ const { id: l, rawId: d, response: h, type: y } = a;
3039
+ let m;
3040
+ return h.userHandle && (m = X(h.userHandle)), {
3035
3041
  id: l,
3036
- rawId: z(f),
3042
+ rawId: X(d),
3037
3043
  response: {
3038
- authenticatorData: z(p.authenticatorData),
3039
- clientDataJSON: z(p.clientDataJSON),
3040
- signature: z(p.signature),
3041
- userHandle: u
3044
+ authenticatorData: X(h.authenticatorData),
3045
+ clientDataJSON: X(h.clientDataJSON),
3046
+ signature: X(h.signature),
3047
+ userHandle: m
3042
3048
  },
3043
3049
  type: y,
3044
3050
  clientExtensionResults: a.getClientExtensionResults(),
3045
- authenticatorAttachment: Qt(a.authenticatorAttachment)
3051
+ authenticatorAttachment: cn(a.authenticatorAttachment)
3046
3052
  };
3047
3053
  }
3048
- const ct = Pt(null);
3049
- function Vs({ children: t, config: e }) {
3050
- const [n, r] = x({
3054
+ const ht = Ft(null);
3055
+ function Qs({ children: t, config: e }) {
3056
+ const [n, r] = N({
3051
3057
  isAuthenticated: !1,
3052
3058
  isLoading: !0,
3053
3059
  user: null,
@@ -3055,37 +3061,37 @@ function Vs({ children: t, config: e }) {
3055
3061
  });
3056
3062
  C(() => {
3057
3063
  (() => {
3058
- const u = Vo();
3059
- if (u) {
3060
- Ot(), r({
3064
+ const m = Qo();
3065
+ if (m) {
3066
+ jt(), r({
3061
3067
  isAuthenticated: !1,
3062
3068
  isLoading: !1,
3063
3069
  user: null,
3064
- error: u
3070
+ error: m
3065
3071
  });
3066
3072
  return;
3067
3073
  }
3068
- const c = Fo();
3074
+ const c = Zo();
3069
3075
  if (c) {
3070
- const m = {
3076
+ const g = {
3071
3077
  token: c.token,
3072
3078
  provider: c.provider,
3073
3079
  authenticatedAt: Date.now()
3074
3080
  };
3075
- Ee(m), Ot(), r({
3081
+ Ee(g), jt(), r({
3076
3082
  isAuthenticated: !0,
3077
3083
  isLoading: !1,
3078
- user: ae(m),
3084
+ user: le(g),
3079
3085
  error: null
3080
3086
  });
3081
3087
  return;
3082
3088
  }
3083
- const d = zt();
3084
- if (d) {
3089
+ const u = tn();
3090
+ if (u) {
3085
3091
  r({
3086
3092
  isAuthenticated: !0,
3087
3093
  isLoading: !1,
3088
- user: ae(d),
3094
+ user: le(u),
3089
3095
  error: null
3090
3096
  });
3091
3097
  return;
@@ -3107,20 +3113,20 @@ function Vs({ children: t, config: e }) {
3107
3113
  }));
3108
3114
  return;
3109
3115
  }
3110
- const u = await Se(e.authUrl);
3116
+ const m = await ve(e.authUrl);
3111
3117
  if (y === "guest") {
3112
3118
  r((c) => ({ ...c, isLoading: !0 }));
3113
3119
  try {
3114
- const c = await Ht(e.spaceId, u);
3120
+ const c = await rn(e.spaceId, m);
3115
3121
  r({
3116
3122
  isAuthenticated: !0,
3117
3123
  isLoading: !1,
3118
- user: ae(c),
3124
+ user: le(c),
3119
3125
  error: null
3120
3126
  });
3121
3127
  } catch (c) {
3122
- r((d) => ({
3123
- ...d,
3128
+ r((u) => ({
3129
+ ...u,
3124
3130
  isLoading: !1,
3125
3131
  error: c instanceof Error ? c.message : "Guest login failed"
3126
3132
  }));
@@ -3130,16 +3136,16 @@ function Vs({ children: t, config: e }) {
3130
3136
  if (y === "passkey") {
3131
3137
  r((c) => ({ ...c, isLoading: !0, error: null }));
3132
3138
  try {
3133
- const c = await Yo(u), d = await ts({ optionsJSON: c }), m = await zo(u, d);
3139
+ const c = await rs(m), u = await fs({ optionsJSON: c }), g = await os(m, u);
3134
3140
  r({
3135
3141
  isAuthenticated: !0,
3136
3142
  isLoading: !1,
3137
- user: ae(m),
3143
+ user: le(g),
3138
3144
  error: null
3139
3145
  });
3140
3146
  } catch (c) {
3141
- r((d) => ({
3142
- ...d,
3147
+ r((u) => ({
3148
+ ...u,
3143
3149
  isLoading: !1,
3144
3150
  error: c instanceof Error ? c.message : "Passkey login failed"
3145
3151
  }));
@@ -3148,36 +3154,36 @@ function Vs({ children: t, config: e }) {
3148
3154
  }
3149
3155
  if (y === "email")
3150
3156
  throw new Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
3151
- window.location.href = Wo(y, e.spaceId, u);
3157
+ window.location.href = es(y, e.spaceId, m);
3152
3158
  },
3153
3159
  [e.authUrl, e.spaceId]
3154
3160
  ), s = D(
3155
3161
  async (y) => {
3156
3162
  if (!e.spaceId)
3157
3163
  throw r((c) => ({ ...c, error: "Space ID is not configured" })), new Error("Space ID is not configured");
3158
- const u = await Se(e.authUrl);
3159
- await $o({ email: y, spaceId: e.spaceId, authUrl: u });
3164
+ const m = await ve(e.authUrl);
3165
+ await qo({ email: y, spaceId: e.spaceId, authUrl: m });
3160
3166
  },
3161
3167
  [e.authUrl, e.spaceId]
3162
3168
  ), i = D(
3163
- async (y, u) => {
3169
+ async (y, m) => {
3164
3170
  r((c) => ({ ...c, isLoading: !0, error: null }));
3165
3171
  try {
3166
- const c = await Se(e.authUrl), d = await Bo({ email: y, code: u, authUrl: c });
3172
+ const c = await ve(e.authUrl), u = await Jo({ email: y, code: m, authUrl: c });
3167
3173
  r({
3168
3174
  isAuthenticated: !0,
3169
3175
  isLoading: !1,
3170
- user: ae(d),
3176
+ user: le(u),
3171
3177
  error: null
3172
3178
  });
3173
3179
  } catch (c) {
3174
- const d = c instanceof Error ? c.message : "Code verification failed";
3175
- throw r((m) => ({ ...m, isLoading: !1, error: d })), c;
3180
+ const u = c instanceof Error ? c.message : "Code verification failed";
3181
+ throw r((g) => ({ ...g, isLoading: !1, error: u })), c;
3176
3182
  }
3177
3183
  },
3178
3184
  [e.authUrl]
3179
3185
  ), a = D(() => {
3180
- xe(), r({
3186
+ Ue(), Bt.clearAll(), r({
3181
3187
  isAuthenticated: !1,
3182
3188
  isLoading: !1,
3183
3189
  user: null,
@@ -3185,58 +3191,58 @@ function Vs({ children: t, config: e }) {
3185
3191
  });
3186
3192
  }, []), l = D(
3187
3193
  async (y) => {
3188
- const u = await Se(e.authUrl);
3194
+ const m = await ve(e.authUrl);
3189
3195
  r((c) => ({ ...c, isLoading: !0, error: null }));
3190
3196
  try {
3191
- const c = await Ko(u), d = await Zo({ optionsJSON: c }), m = await Go(u, d, y);
3197
+ const c = await ts(m), u = await ls({ optionsJSON: c }), g = await ns(m, u, y);
3192
3198
  r({
3193
3199
  isAuthenticated: !0,
3194
3200
  isLoading: !1,
3195
- user: ae(m),
3201
+ user: le(g),
3196
3202
  error: null
3197
3203
  });
3198
3204
  } catch (c) {
3199
- r((d) => ({
3200
- ...d,
3205
+ r((u) => ({
3206
+ ...u,
3201
3207
  isLoading: !1,
3202
3208
  error: c instanceof Error ? c.message : "Passkey registration failed"
3203
3209
  }));
3204
3210
  }
3205
3211
  },
3206
3212
  [e.authUrl]
3207
- ), f = D(() => n.user?.token ?? null, [n.user]), p = W(
3213
+ ), d = D(() => n.user?.token ?? null, [n.user]), h = W(
3208
3214
  () => ({
3209
3215
  state: n,
3210
3216
  login: o,
3211
3217
  logout: a,
3212
- getToken: f,
3218
+ getToken: d,
3213
3219
  registerPasskey: l,
3214
3220
  requestEmailCode: s,
3215
3221
  submitEmailCode: i
3216
3222
  }),
3217
- [n, o, a, f, l, s, i]
3223
+ [n, o, a, d, l, s, i]
3218
3224
  );
3219
- return /* @__PURE__ */ S.jsx(ct, { value: p, children: t });
3225
+ return /* @__PURE__ */ w.jsx(ht, { value: h, children: t });
3220
3226
  }
3221
- function ns() {
3222
- const t = rt(ct);
3227
+ function hs() {
3228
+ const t = ct(ht);
3223
3229
  if (!t)
3224
3230
  throw new Error("useAuth must be used within an AuthProvider");
3225
3231
  return t;
3226
3232
  }
3227
- function rs() {
3228
- return rt(ct);
3233
+ function ps() {
3234
+ return ct(ht);
3229
3235
  }
3230
- function Ws(t) {
3231
- const { config: e, guestUrlParam: n } = t, { state: r, login: o } = ns(), s = v(!1);
3236
+ function ei(t) {
3237
+ const { config: e, guestUrlParam: n } = t, { state: r, login: o } = hs(), s = E(!1);
3232
3238
  return C(() => {
3233
3239
  if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
3234
3240
  return;
3235
3241
  const i = new URLSearchParams(window.location.search), a = i.get(n);
3236
3242
  if (a === "true" || a === "1" || a === "") {
3237
3243
  i.delete(n);
3238
- const l = i.toString(), f = window.location.pathname + (l ? `?${l}` : "");
3239
- window.history.replaceState({}, "", f), s.current = !0, o("guest");
3244
+ const l = i.toString(), d = window.location.pathname + (l ? `?${l}` : "");
3245
+ window.history.replaceState({}, "", d), s.current = !0, o("guest");
3240
3246
  }
3241
3247
  }, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
3242
3248
  shouldRenderChildren: r.isAuthenticated,
@@ -3245,17 +3251,17 @@ function Ws(t) {
3245
3251
  error: r.error
3246
3252
  };
3247
3253
  }
3248
- const en = (() => {
3254
+ const ln = (() => {
3249
3255
  try {
3250
- return En();
3256
+ return xn();
3251
3257
  } catch {
3252
3258
  return !1;
3253
3259
  }
3254
- })(), tn = Date.now(), oe = [], os = 300;
3255
- function Ce(t) {
3256
- oe.push(`[+${((Date.now() - tn) / 1e3).toFixed(1)}s] ${t}`), oe.length > os && oe.shift();
3260
+ })(), un = Date.now(), ne = [], ms = 300;
3261
+ function Oe(t) {
3262
+ ne.push(`[+${((Date.now() - un) / 1e3).toFixed(1)}s] ${t}`), ne.length > ms && ne.shift();
3257
3263
  }
3258
- function Nt(t) {
3264
+ function Dt(t) {
3259
3265
  if (typeof t == "string")
3260
3266
  return t;
3261
3267
  if (t instanceof Error)
@@ -3266,30 +3272,30 @@ function Nt(t) {
3266
3272
  return String(t);
3267
3273
  }
3268
3274
  }
3269
- let xt = !1;
3270
- function nn() {
3271
- if (xt || typeof window > "u")
3275
+ let $t = !1;
3276
+ function dn() {
3277
+ if ($t || typeof window > "u")
3272
3278
  return;
3273
- xt = !0, window.addEventListener("error", (e) => Ce(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Ce(`unhandledRejection: ${Nt(e.reason)}`));
3279
+ $t = !0, window.addEventListener("error", (e) => Oe(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => Oe(`unhandledRejection: ${Dt(e.reason)}`));
3274
3280
  const t = console;
3275
3281
  for (const e of ["error", "warn", "log", "info"]) {
3276
3282
  const n = t[e]?.bind(console) ?? (() => {
3277
3283
  });
3278
3284
  t[e] = (...r) => {
3279
3285
  try {
3280
- Ce(`console.${e}: ${r.map(Nt).join(" ")}`);
3286
+ Oe(`console.${e}: ${r.map(Dt).join(" ")}`);
3281
3287
  } catch {
3282
3288
  }
3283
3289
  n(...r);
3284
3290
  };
3285
3291
  }
3286
3292
  try {
3287
- Mt((e) => Ce(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: Xe.DEBUG });
3293
+ Wt((e) => Oe(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: Qe.DEBUG });
3288
3294
  } catch {
3289
3295
  }
3290
3296
  }
3291
- en && nn();
3292
- function ss() {
3297
+ ln && dn();
3298
+ function gs() {
3293
3299
  let t = !1;
3294
3300
  try {
3295
3301
  const e = URL.createObjectURL(new Blob([""]));
@@ -3300,11 +3306,11 @@ function ss() {
3300
3306
  }
3301
3307
  return t;
3302
3308
  }
3303
- function is() {
3309
+ function ys() {
3304
3310
  const t = globalThis;
3305
3311
  return [
3306
3312
  `Worker=${typeof Worker < "u"}`,
3307
- `moduleWorker=${ss()}`,
3313
+ `moduleWorker=${gs()}`,
3308
3314
  `WebSocket=${typeof WebSocket < "u"}`,
3309
3315
  `WebTransport=${typeof t.WebTransport < "u"}`,
3310
3316
  `RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
@@ -3317,21 +3323,21 @@ function is() {
3317
3323
  `online=${typeof navigator < "u" ? navigator.onLine : "?"}`
3318
3324
  ].join(" ");
3319
3325
  }
3320
- function as(t) {
3326
+ function bs(t) {
3321
3327
  return /ERROR|error:|Rejection/.test(t) ? "#f88" : /WARN|warn:/.test(t) ? "#fc6" : "#9d9";
3322
3328
  }
3323
- function rn({ state: t = "", forceVisible: e = !1 }) {
3324
- const n = en || e, r = t === "connected" || t === "reconnecting", [, o] = yn((l) => l + 1, 0), [s, i] = x(!0);
3329
+ function fn({ state: t = "", forceVisible: e = !1 }) {
3330
+ const n = ln || e, r = t === "connected" || t === "reconnecting", [, o] = In((l) => l + 1, 0), [s, i] = N(!0);
3325
3331
  if (C(() => {
3326
3332
  if (!n)
3327
3333
  return;
3328
- nn();
3334
+ dn();
3329
3335
  const l = setInterval(o, 1e3);
3330
3336
  return () => clearInterval(l);
3331
3337
  }, [n]), !n)
3332
3338
  return null;
3333
3339
  if (r && s)
3334
- return /* @__PURE__ */ S.jsxs(
3340
+ return /* @__PURE__ */ w.jsxs(
3335
3341
  "button",
3336
3342
  {
3337
3343
  type: "button",
@@ -3339,31 +3345,31 @@ function rn({ state: t = "", forceVisible: e = !1 }) {
3339
3345
  style: { position: "fixed", bottom: 8, left: 8, zIndex: 2147483647, background: "#000", color: "#0f0", font: "13px monospace", padding: "6px 10px", border: "1px solid #0f0", borderRadius: 6 },
3340
3346
  children: [
3341
3347
  "🐞 debug (",
3342
- oe.length,
3348
+ ne.length,
3343
3349
  ")"
3344
3350
  ]
3345
3351
  }
3346
3352
  );
3347
3353
  const a = r ? { position: "fixed", bottom: 0, left: 0, right: 0, maxHeight: "45vh", borderTop: "2px solid #0f0" } : { position: "fixed", inset: 0 };
3348
- return /* @__PURE__ */ S.jsxs("div", { style: { ...a, background: "rgba(0,0,0,0.92)", color: "#0f0", font: "14px/1.45 monospace", padding: "16px", overflow: "auto", zIndex: 2147483647 }, children: [
3349
- /* @__PURE__ */ S.jsxs("div", { style: { color: "#fff", fontSize: "18px", marginBottom: "6px" }, children: [
3354
+ return /* @__PURE__ */ w.jsxs("div", { style: { ...a, background: "rgba(0,0,0,0.92)", color: "#0f0", font: "14px/1.45 monospace", padding: "16px", overflow: "auto", zIndex: 2147483647 }, children: [
3355
+ /* @__PURE__ */ w.jsxs("div", { style: { color: "#fff", fontSize: "18px", marginBottom: "6px" }, children: [
3350
3356
  "Ikon debug overlay — state: ",
3351
3357
  t || "?",
3352
3358
  ", +",
3353
- Math.round((Date.now() - tn) / 1e3),
3359
+ Math.round((Date.now() - un) / 1e3),
3354
3360
  "s, ",
3355
- oe.length,
3361
+ ne.length,
3356
3362
  " entries",
3357
- r && /* @__PURE__ */ S.jsx("button", { type: "button", onClick: () => i(!0), style: { marginLeft: 12, font: "12px monospace", background: "#0f0", color: "#000", border: "none", borderRadius: 4, padding: "2px 8px" }, children: "hide" })
3363
+ r && /* @__PURE__ */ w.jsx("button", { type: "button", onClick: () => i(!0), style: { marginLeft: 12, font: "12px monospace", background: "#0f0", color: "#000", border: "none", borderRadius: 4, padding: "2px 8px" }, children: "hide" })
3358
3364
  ] }),
3359
- /* @__PURE__ */ S.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
3360
- /* @__PURE__ */ S.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
3361
- /* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: is() }),
3362
- /* @__PURE__ */ S.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
3363
- /* @__PURE__ */ S.jsx("div", { children: oe.length === 0 ? "(nothing captured yet)" : oe.map((l, f) => /* @__PURE__ */ S.jsx("div", { style: { color: as(l), wordBreak: "break-all" }, children: l }, f)) })
3365
+ /* @__PURE__ */ w.jsx("div", { style: { color: "#9cf", wordBreak: "break-all", marginBottom: "4px" }, children: typeof window < "u" ? window.location.href : "" }),
3366
+ /* @__PURE__ */ w.jsx("div", { style: { color: "#ff0", wordBreak: "break-all", marginBottom: "4px" }, children: typeof navigator < "u" ? navigator.userAgent : "no navigator" }),
3367
+ /* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "4px" }, children: ys() }),
3368
+ /* @__PURE__ */ w.jsx("div", { style: { color: "#8cf", marginBottom: "10px" }, children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : "" }),
3369
+ /* @__PURE__ */ w.jsx("div", { children: ne.length === 0 ? "(nothing captured yet)" : ne.map((l, d) => /* @__PURE__ */ w.jsx("div", { style: { color: bs(l), wordBreak: "break-all" }, children: l }, d)) })
3364
3370
  ] });
3365
3371
  }
3366
- function Ks({
3372
+ function ti({
3367
3373
  connectionState: t,
3368
3374
  error: e,
3369
3375
  isReady: n,
@@ -3375,34 +3381,34 @@ function Ks({
3375
3381
  // renderIdle prop is intentionally accepted but never invoked — the runtime no longer
3376
3382
  // emits the deprecated 'idle' state. Kept on the props for source compatibility.
3377
3383
  renderIdle: l,
3378
- renderConnecting: f,
3379
- renderConnectingSlow: p,
3384
+ renderConnecting: d,
3385
+ renderConnectingSlow: h,
3380
3386
  renderConnected: y,
3381
- renderOffline: u,
3387
+ renderOffline: m,
3382
3388
  renderError: c
3383
3389
  }) {
3384
- const d = v(!1), m = (() => {
3390
+ const u = E(!1), g = (() => {
3385
3391
  switch (t) {
3386
3392
  case "waitingForExternalConnectUrl":
3387
3393
  case "connecting":
3388
- return r ? p() : f();
3394
+ return r ? h() : d();
3389
3395
  case "connected":
3390
3396
  case "reconnecting": {
3391
3397
  if (!n || !o || !s) return null;
3392
- t === "reconnecting" && (d.current = !0);
3393
- const g = o.size > 0;
3394
- return g && (d.current = !1), y({
3398
+ t === "reconnecting" && (u.current = !0);
3399
+ const p = o.size > 0;
3400
+ return p && (u.current = !1), y({
3395
3401
  stores: o,
3396
3402
  registry: s,
3397
3403
  client: i,
3398
3404
  onAction: a,
3399
- isReconnecting: t === "reconnecting" || d.current && !g
3405
+ isReconnecting: t === "reconnecting" || u.current && !p
3400
3406
  });
3401
3407
  }
3402
3408
  case "offline": {
3403
- d.current = !1;
3404
- const g = e ?? i?.lastError?.message ?? null;
3405
- return g ? c(g) : u();
3409
+ u.current = !1;
3410
+ const p = e ?? i?.lastError?.message ?? null;
3411
+ return p ? c(p) : m();
3406
3412
  }
3407
3413
  // 'idle' / 'connectingSlow' / 'offlineError' remain in the type union for back-compat
3408
3414
  // string-equality checks in caller code but are no longer emitted — no case needed.
@@ -3410,166 +3416,175 @@ function Ks({
3410
3416
  return null;
3411
3417
  }
3412
3418
  })();
3413
- return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
3414
- m,
3415
- /* @__PURE__ */ S.jsx(rn, { state: t })
3419
+ return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
3420
+ g,
3421
+ /* @__PURE__ */ w.jsx(fn, { state: t })
3416
3422
  ] });
3417
3423
  }
3418
- const _e = se("useIkonApp");
3419
- function cs() {
3424
+ const Ne = re("useIkonApp");
3425
+ function Ss() {
3420
3426
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
3421
3427
  return window.__IKON_AUTH_CONFIG__;
3422
3428
  }
3423
- function ls() {
3429
+ function ws() {
3424
3430
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
3425
3431
  return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
3426
3432
  }
3427
- function Gs(t) {
3428
- const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: f, proxy: p, uiCache: y } = t, u = e === void 0 ? cs() ?? null : e, c = ls(), d = rs(), m = v(null), g = v(null), b = v(null), w = v(!1), R = v(!1), E = v(o), T = v(r), M = v(s), J = v(i), Q = v(a), X = v(l), _ = v(f), L = v(p), U = v(y), F = v("local"), B = v(void 0);
3429
- E.current = o, T.current = r, M.current = s, J.current = i, Q.current = a, X.current = l, _.current = f, L.current = p, U.current = y;
3430
- const [$, K] = x("connecting"), [ve, de] = x(!1), [Re, fe] = x(null), [h, A] = x(null), [N, P] = x(!1), [ee, he] = x(null), [O, Z] = x(null), te = v(!1), [Me, sn] = x(0), G = W(() => {
3433
+ function ni(t) {
3434
+ const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: l, webtransport: d, proxy: h, liveSnapshot: y, bootSnapshot: m } = t, c = e === void 0 ? Ss() ?? null : e, u = ws(), g = ps(), p = E(null), S = E(null), b = E(null), R = E(!1), v = E(!1), T = E(o), U = E(r), ee = E(s), te = E(i), z = E(a), _ = E(l), L = E(d), M = E(h), B = E(y), $ = E(m), V = E("local"), K = E(void 0);
3435
+ T.current = o, U.current = r, ee.current = s, te.current = i, z.current = a, _.current = l, L.current = d, M.current = h, B.current = y, $.current = m;
3436
+ const [H, Re] = N("connecting"), [Ae, he] = N(!1), [f, A] = N(!1), [O, x] = N(null), [oe, pe] = N(null), [P, Q] = N(!1), [se, De] = N(null), [ie, pn] = N(null), [$e, pt] = N(!1), Be = E(!1), [mn, gn] = N(0), G = W(() => {
3431
3437
  try {
3432
- const I = vn();
3433
- return (I.sessionId || I.channelKey) && Rn(), I;
3438
+ const I = Pn();
3439
+ return (I.sessionId || I.channelKey) && Ln(), I;
3434
3440
  } catch {
3435
3441
  return { parameters: {} };
3436
3442
  }
3437
3443
  }, []);
3438
- pn();
3439
- const ne = W(() => u?.enabled ? zt() : null, [u?.enabled, Me]), Ue = c?.enabled ?? !1, je = c?.host ?? "localhost", De = c?.port ?? 8443;
3440
- !Ue && lt() && u && !u.enabled && u.spaceId && !O && !te.current && (te.current = !0, Se(u.authUrl).then((I) => Ht(u.spaceId, I)).then((I) => {
3441
- Z(I.token);
3444
+ m !== !1 && Tn();
3445
+ const ae = W(() => c?.enabled ? tn() : null, [c?.enabled, mn]), Te = u?.enabled ?? !1, Fe = u?.host ?? "localhost", Ve = u?.port ?? 8443, We = !!c && !c.enabled && !!c.spaceId && (gt() || Te);
3446
+ We && !ie && !$e && !Be.current && (Be.current = !0, ve(c.authUrl).then((I) => rn(c.spaceId, I)).then((I) => {
3447
+ pn(I.token), pt(!0);
3442
3448
  }).catch((I) => {
3443
- _e.error("Anonymous auth failed:", I), fe(I instanceof Error ? I.message : "Anonymous auth failed"), te.current = !1;
3449
+ Ne.error("Anonymous auth failed:", I), Be.current = !1, Te ? pt(!0) : x(I instanceof Error ? I.message : "Anonymous auth failed");
3444
3450
  }));
3445
- const $e = W(() => {
3446
- if (Ue) {
3447
- const I = ne?.token ? ut(ne.token) ?? void 0 : void 0;
3451
+ const Ke = W(() => {
3452
+ if (Te) {
3453
+ if (We && !$e)
3454
+ return null;
3455
+ const I = ae?.token ?? ie ?? void 0, q = I ? yt(I) ?? void 0 : void 0;
3448
3456
  return {
3449
3457
  local: {
3450
- host: je,
3451
- httpsPort: De,
3452
- userId: I,
3453
- token: ne?.token ?? void 0,
3454
- spaceId: u?.spaceId,
3455
- backendUrl: u?.backendUrl,
3456
- authUrl: u?.authUrl,
3458
+ host: Fe,
3459
+ httpsPort: Ve,
3460
+ userId: q,
3461
+ token: ae?.token ?? void 0,
3462
+ spaceId: c?.spaceId,
3463
+ backendUrl: c?.backendUrl,
3464
+ authUrl: c?.authUrl,
3457
3465
  parameters: G.parameters
3458
3466
  }
3459
3467
  };
3460
3468
  }
3461
- return ne?.token && u?.spaceId ? {
3469
+ return ae?.token && c?.spaceId ? {
3462
3470
  sessionToken: {
3463
- token: ne.token,
3464
- spaceId: u.spaceId,
3465
- backendType: dt(),
3471
+ token: ae.token,
3472
+ spaceId: c.spaceId,
3473
+ backendType: bt(),
3466
3474
  sessionId: G.sessionId,
3467
3475
  channelKey: G.channelKey,
3468
3476
  parameters: G.parameters
3469
3477
  }
3470
- } : O && u?.spaceId ? {
3478
+ } : ie && c?.spaceId ? {
3471
3479
  sessionToken: {
3472
- token: O,
3473
- spaceId: u.spaceId,
3474
- backendType: dt(),
3480
+ token: ie,
3481
+ spaceId: c.spaceId,
3482
+ backendType: bt(),
3475
3483
  sessionId: G.sessionId,
3476
3484
  channelKey: G.channelKey,
3477
3485
  parameters: G.parameters
3478
3486
  }
3479
- } : lt() ? null : {
3487
+ } : gt() ? null : {
3480
3488
  local: {
3481
- host: je,
3482
- httpsPort: De,
3483
- spaceId: u?.spaceId,
3484
- backendUrl: u?.backendUrl,
3485
- authUrl: u?.authUrl,
3489
+ host: Fe,
3490
+ httpsPort: Ve,
3491
+ spaceId: c?.spaceId,
3492
+ backendUrl: c?.backendUrl,
3493
+ authUrl: c?.authUrl,
3486
3494
  parameters: G.parameters
3487
3495
  }
3488
3496
  };
3489
- }, [Ue, je, De, ne?.token, u?.spaceId, u?.backendUrl, u?.authUrl, O, G.sessionId, G.channelKey, G.parameters]);
3490
- F.current = u?.spaceId ?? "local", B.current = ne?.token ?? O ?? void 0, Yr(ee);
3491
- const an = Xr(ee);
3497
+ }, [Te, Fe, Ve, ae?.token, c?.spaceId, c?.backendUrl, c?.authUrl, ie, We, $e, G.sessionId, G.channelKey, G.parameters]);
3498
+ V.current = c?.spaceId ?? "local", K.current = ae?.token ?? ie ?? void 0, ro(se);
3499
+ const yn = so(se);
3492
3500
  C(() => {
3493
- if (!w.current) {
3494
- if (w.current = !0, b.current = Dr(), n)
3501
+ if (!R.current) {
3502
+ if (R.current = !0, b.current = Hr(), n)
3495
3503
  for (const I of n)
3496
3504
  I(b.current);
3497
3505
  b.current.loadRegisteredModules().catch((I) => {
3498
- _e.error("Failed to load UI modules", I);
3506
+ Ne.error("Failed to load UI modules", I);
3499
3507
  });
3500
3508
  }
3501
3509
  }, []), C(() => {
3502
- if (!$e) return;
3503
- const I = new An({
3504
- ...$e,
3505
- timeouts: T.current,
3506
- audio: J.current !== void 0 || E.current ? {
3507
- enabled: J.current,
3508
- ...E.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
3510
+ if (!Ke) return;
3511
+ const I = new Un({
3512
+ ...Ke,
3513
+ timeouts: U.current,
3514
+ audio: te.current !== void 0 || T.current ? {
3515
+ enabled: te.current,
3516
+ ...T.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
3509
3517
  } : void 0,
3510
- video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
3518
+ video: z.current !== void 0 ? { enabled: z.current } : void 0,
3511
3519
  mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
3512
- webRtc: M.current === !1 ? { enabled: !1 } : void 0,
3513
- websocket: X.current,
3514
- webtransport: _.current,
3515
- proxy: L.current,
3516
- onConnectionStateChange: (H) => {
3517
- K(H);
3520
+ webRtc: ee.current === !1 ? { enabled: !1 } : void 0,
3521
+ websocket: _.current,
3522
+ webtransport: L.current,
3523
+ proxy: M.current,
3524
+ onConnectionStateChange: (J) => {
3525
+ Re(J);
3518
3526
  },
3519
- onError: (H) => {
3520
- fe(H.message);
3527
+ onError: (J) => {
3528
+ x(J.message);
3521
3529
  }
3522
3530
  });
3523
- m.current = I;
3524
- const re = U.current ?? !0, Ae = B.current, un = re ? { enabled: !0, appId: F.current, userId: Ae ? ut(Ae) ?? null : null } : void 0, Be = new Yn({ client: I, cache: un });
3525
- return g.current = Be, he(Be), I.connect().catch((H) => {
3526
- if (_e.error("Connection failed:", H), H instanceof Tn) {
3527
- A(H.reason);
3531
+ p.current = I;
3532
+ const q = B.current ?? !0, ke = K.current, mt = ke ? yt(ke) ?? null : null, wn = q && mt ? { enabled: !0, appId: V.current, userId: mt } : void 0, Ce = new rr({ client: I, liveSnapshot: wn, bootSnapshot: $.current });
3533
+ S.current = Ce, De(Ce), A(!1);
3534
+ const vn = Ce.subscribeToUiUpdates(() => {
3535
+ A(!0);
3536
+ });
3537
+ return I.connect().catch((J) => {
3538
+ if (Ne.error("Connection failed:", J), J instanceof Mn) {
3539
+ pe(J.reason);
3528
3540
  return;
3529
3541
  }
3530
- if (H instanceof kn) {
3531
- P(!0);
3542
+ if (J instanceof jn) {
3543
+ Q(!0);
3532
3544
  return;
3533
3545
  }
3534
- H instanceof Cn && !R.current && (R.current = !0, _e.warn("Auth session appears stale, clearing and retrying"), d ? d.logout() : (xe(), sn((dn) => dn + 1)));
3546
+ J instanceof Dn && !v.current && (v.current = !0, Ne.warn("Auth session appears stale, clearing and retrying"), Bt.clearAll(), g ? g.logout() : (Ue(), gn((En) => En + 1)));
3535
3547
  }), () => {
3536
- I.disconnect(), m.current = null, Be.dispose(), g.current = null;
3548
+ vn(), I.disconnect(), p.current = null, Ce.dispose(), S.current = null;
3537
3549
  };
3538
- }, [$e]);
3539
- const cn = D((I, re) => {
3540
- const Ae = typeof re == "string" ? re : JSON.stringify(re ?? {});
3541
- m.current?.sendActionCall(I, Ae);
3550
+ }, [Ke]);
3551
+ const bn = D((I, q) => {
3552
+ const ke = typeof q == "string" ? q : JSON.stringify(q ?? {});
3553
+ p.current?.sendActionCall(I, ke);
3542
3554
  }, []);
3543
3555
  C(() => {
3544
- if ($ !== "connecting") {
3545
- de(!1);
3556
+ if (H !== "connecting") {
3557
+ he(!1);
3546
3558
  return;
3547
3559
  }
3548
- const I = m.current?.slowConnectionThresholdMs ?? 5e3, re = setTimeout(() => de(!0), I);
3549
- return () => clearTimeout(re);
3550
- }, [$]);
3551
- const ln = $ === "connected" || $ === "reconnecting";
3552
- return {
3553
- connectionState: $,
3554
- error: Re,
3555
- accessDeniedReason: h,
3556
- isServerFull: N,
3557
- stores: an,
3558
- client: m.current,
3560
+ const I = p.current?.slowConnectionThresholdMs ?? 5e3, q = setTimeout(() => he(!0), I);
3561
+ return () => clearTimeout(q);
3562
+ }, [H]);
3563
+ const Sn = H === "connected" || H === "reconnecting", Ge = f && H !== "offline";
3564
+ return C(() => {
3565
+ typeof document > "u" || (document.documentElement.dataset.ikonLive = String(Ge));
3566
+ }, [Ge]), {
3567
+ connectionState: H,
3568
+ error: O,
3569
+ accessDeniedReason: oe,
3570
+ isServerFull: P,
3571
+ stores: yn,
3572
+ client: p.current,
3559
3573
  registry: b.current,
3560
- clientRef: m,
3561
- uiRef: g,
3574
+ clientRef: p,
3575
+ uiRef: S,
3562
3576
  registryRef: b,
3563
- onAction: cn,
3564
- isReady: ln,
3565
- brandingRequired: m.current?.brandingRequired ?? !1,
3566
- isConnectingSlow: ve,
3567
- webRtcVideoStreams: m.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3568
- webRtcTrackMap: m.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3577
+ onAction: bn,
3578
+ isReady: Sn,
3579
+ isLive: Ge,
3580
+ brandingRequired: p.current?.brandingRequired ?? !1,
3581
+ isConnectingSlow: Ae,
3582
+ webRtcVideoStreams: p.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3583
+ webRtcTrackMap: p.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3569
3584
  };
3570
3585
  }
3571
- function Ys(t) {
3572
- const e = v(!1);
3586
+ function ri(t) {
3587
+ const e = E(!1);
3573
3588
  return D(() => {
3574
3589
  if (e.current) return;
3575
3590
  e.current = !0;
@@ -3577,30 +3592,30 @@ function Ys(t) {
3577
3592
  n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
3578
3593
  }, [t]);
3579
3594
  }
3580
- let us = 0;
3581
- function ds(t = 5, e = 5e3) {
3582
- const [n, r] = x([]), o = v(/* @__PURE__ */ new Map()), s = D((i) => {
3595
+ let vs = 0;
3596
+ function Es(t = 5, e = 5e3) {
3597
+ const [n, r] = N([]), o = E(/* @__PURE__ */ new Map()), s = D((i) => {
3583
3598
  const a = o.current.get(i);
3584
- a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((f) => f.id !== i));
3599
+ a && (clearTimeout(a), o.current.delete(i)), r((l) => l.filter((d) => d.id !== i));
3585
3600
  }, []);
3586
3601
  return C(() => {
3587
- const i = o.current, a = Mt(
3602
+ const i = o.current, a = Wt(
3588
3603
  (l) => {
3589
- if (!Ut())
3604
+ if (!Kt())
3590
3605
  return;
3591
- const f = `toast-${++us}`, p = l.level === Xe.ERROR ? "error" : "warn", y = {
3592
- id: f,
3593
- level: p,
3606
+ const d = `toast-${++vs}`, h = l.level === Qe.ERROR ? "error" : "warn", y = {
3607
+ id: d,
3608
+ level: h,
3594
3609
  message: l.message,
3595
3610
  component: l.component
3596
3611
  };
3597
3612
  r((c) => [...c, y].slice(-t));
3598
- const u = setTimeout(() => {
3599
- s(f);
3613
+ const m = setTimeout(() => {
3614
+ s(d);
3600
3615
  }, e);
3601
- i.set(f, u);
3616
+ i.set(d, m);
3602
3617
  },
3603
- { minLevel: Xe.WARN }
3618
+ { minLevel: Qe.WARN }
3604
3619
  );
3605
3620
  return () => {
3606
3621
  a();
@@ -3610,8 +3625,8 @@ function ds(t = 5, e = 5e3) {
3610
3625
  };
3611
3626
  }, [t, e, s]), { toasts: n, dismissToast: s };
3612
3627
  }
3613
- function fs(t, e, n) {
3614
- const [r, o] = x(n);
3628
+ function Rs(t, e, n) {
3629
+ const [r, o] = N(n);
3615
3630
  return C(() => {
3616
3631
  if (!t)
3617
3632
  return;
@@ -3627,8 +3642,8 @@ function fs(t, e, n) {
3627
3642
  };
3628
3643
  }, [t, e]), r;
3629
3644
  }
3630
- function zs(t, e, n) {
3631
- const [r, o] = x(null);
3645
+ function oi(t, e, n) {
3646
+ const [r, o] = N(null);
3632
3647
  return C(() => {
3633
3648
  if (!t)
3634
3649
  return;
@@ -3640,122 +3655,122 @@ function zs(t, e, n) {
3640
3655
  }), () => {
3641
3656
  s = !1;
3642
3657
  };
3643
- }, [t, e]), fs(r ? t : null, r ?? "", n);
3658
+ }, [t, e]), Rs(r ? t : null, r ?? "", n);
3644
3659
  }
3645
- const ce = se("IkonDebug"), hs = {
3660
+ const ue = re("IkonDebug"), As = {
3646
3661
  Digit1: "connecting",
3647
3662
  Digit2: "connected",
3648
3663
  Digit3: "reconnecting",
3649
3664
  Digit4: "offline",
3650
3665
  Digit5: "offline",
3651
3666
  Digit0: "clear"
3652
- }, ps = "Digit5", ms = "Digit6", gs = "Synthetic debug error (Ctrl+Shift+5)", ys = "Synthetic debug access-denied (Ctrl+Shift+6)", bs = 5e3;
3653
- function ws(t) {
3654
- const e = Ut(), [n, r] = x(null), [o, s] = x(!1), [i, a] = x(null), [l, f] = x(null), [p, y] = x(!1), [u, c] = x(!1), [d, m] = x(!1);
3667
+ }, Ts = "Digit5", ks = "Digit6", Cs = "Synthetic debug error (Ctrl+Shift+5)", Is = "Synthetic debug access-denied (Ctrl+Shift+6)", _s = 5e3;
3668
+ function Os(t) {
3669
+ const e = Kt(), [n, r] = N(null), [o, s] = N(!1), [i, a] = N(null), [l, d] = N(null), [h, y] = N(!1), [m, c] = N(!1), [u, g] = N(!1);
3655
3670
  return C(() => {
3656
3671
  if (!e)
3657
3672
  return;
3658
- const b = (w) => {
3659
- if (!w.ctrlKey || !w.shiftKey)
3673
+ const S = (b) => {
3674
+ if (!b.ctrlKey || !b.shiftKey)
3660
3675
  return;
3661
- if (w.code === "KeyE") {
3662
- w.preventDefault(), y((T) => (ce.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
3676
+ if (b.code === "KeyE") {
3677
+ b.preventDefault(), y((T) => (ue.warn(`Empty-stores override: ${T ? "off" : "on"}`), !T));
3663
3678
  return;
3664
3679
  }
3665
- if (w.code === "Digit7") {
3666
- w.preventDefault(), c((T) => (ce.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
3680
+ if (b.code === "Digit7") {
3681
+ b.preventDefault(), c((T) => (ue.warn(`Branding-banner override: ${T ? "off" : "on"}`), !T));
3667
3682
  return;
3668
3683
  }
3669
- if (w.code === "Digit8") {
3670
- w.preventDefault(), m((T) => (ce.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
3684
+ if (b.code === "Digit8") {
3685
+ b.preventDefault(), g((T) => (ue.warn(`Debug-overlay override: ${T ? "off" : "on"}`), !T));
3671
3686
  return;
3672
3687
  }
3673
- if (w.code === ms) {
3674
- w.preventDefault(), f(ys), r(null), a(null), ce.warn("Forced access denied");
3688
+ if (b.code === ks) {
3689
+ b.preventDefault(), d(Is), r(null), a(null), ue.warn("Forced access denied");
3675
3690
  return;
3676
3691
  }
3677
- const R = hs[w.code];
3692
+ const R = As[b.code];
3678
3693
  if (R === void 0)
3679
3694
  return;
3680
- if (w.preventDefault(), R === "clear") {
3681
- r(null), a(null), f(null), ce.warn("Cleared forced state");
3695
+ if (b.preventDefault(), R === "clear") {
3696
+ r(null), a(null), d(null), ue.warn("Cleared forced state");
3682
3697
  return;
3683
3698
  }
3684
- const E = w.code === ps;
3685
- r(R), a(E ? gs : null), f(null), ce.warn(`Forced state: ${R}${E ? " (with error)" : ""}`);
3699
+ const v = b.code === Ts;
3700
+ r(R), a(v ? Cs : null), d(null), ue.warn(`Forced state: ${R}${v ? " (with error)" : ""}`);
3686
3701
  };
3687
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
3702
+ return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
3688
3703
  }, [e]), C(() => {
3689
3704
  if (n !== "connecting") {
3690
3705
  s(!1);
3691
3706
  return;
3692
3707
  }
3693
- const b = setTimeout(() => s(!0), bs);
3694
- return () => clearTimeout(b);
3695
- }, [n]), !e || n === null && !p && l === null && !u && !d ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
3708
+ const S = setTimeout(() => s(!0), _s);
3709
+ return () => clearTimeout(S);
3710
+ }, [n]), !e || n === null && !h && l === null && !m && !u ? { app: t, forcedState: null, emptyStores: !1, forcedError: null, forcedAccessDenied: null, forcedBranding: !1, forcedDebugOverlay: !1, debugEnabled: e } : { app: {
3696
3711
  ...t,
3697
3712
  connectionState: n ?? t.connectionState,
3698
3713
  isConnectingSlow: n === "connecting" ? o : t.isConnectingSlow,
3699
3714
  error: n === "offline" && i ? i : n ? null : t.error,
3700
- stores: p ? /* @__PURE__ */ new Map() : t.stores,
3715
+ stores: h ? /* @__PURE__ */ new Map() : t.stores,
3701
3716
  accessDeniedReason: l ?? t.accessDeniedReason
3702
- }, forcedState: n, emptyStores: p, forcedError: i, forcedAccessDenied: l, forcedBranding: u, forcedDebugOverlay: d, debugEnabled: e };
3717
+ }, forcedState: n, emptyStores: h, forcedError: i, forcedAccessDenied: l, forcedBranding: m, forcedDebugOverlay: u, debugEnabled: e };
3703
3718
  }
3704
- function Ss(t, e) {
3719
+ function Ns(t, e) {
3705
3720
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3706
3721
  }
3707
- function Es(t) {
3722
+ function xs(t) {
3708
3723
  return t === void 0 ? null : typeof t == "function" ? t() : t;
3709
3724
  }
3710
- function vs(t, e) {
3725
+ function Ps(t, e) {
3711
3726
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3712
3727
  }
3713
- function Rs(t, e) {
3728
+ function Ls(t, e) {
3714
3729
  return t === void 0 ? null : typeof t == "function" ? t(e) : t;
3715
3730
  }
3716
- function Xs(t) {
3717
- const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = ws(s), { app: a } = i, { connectionState: l, isConnectingSlow: f, stores: p, registry: y, client: u, onAction: c, isReady: d, error: m, accessDeniedReason: g, brandingRequired: b } = a, w = b || i.forcedBranding, R = v(null);
3718
- if (p && y && (d || p.size > 0) && (R.current = { stores: p, registry: y, client: u }), g)
3719
- return Rs(o, g);
3720
- const E = R.current;
3731
+ function si(t) {
3732
+ const { connectingOverlay: e, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: o, ...s } = t, i = Os(s), { app: a } = i, { connectionState: l, isConnectingSlow: d, stores: h, registry: y, client: m, onAction: c, isReady: u, error: g, accessDeniedReason: p, brandingRequired: S } = a, b = S || i.forcedBranding, R = E(null);
3733
+ if (h && y && (u || h.size > 0) && (R.current = { stores: h, registry: y, client: m }), p)
3734
+ return Ls(o, p);
3735
+ const v = R.current;
3721
3736
  let T = null;
3722
3737
  switch (l) {
3723
3738
  case "waitingForExternalConnectUrl":
3724
3739
  case "connecting":
3725
- T = Ss(e, f);
3740
+ T = Ns(e, d);
3726
3741
  break;
3727
3742
  case "reconnecting":
3728
- T = Es(n);
3743
+ T = xs(n);
3729
3744
  break;
3730
3745
  case "offline":
3731
- T = vs(r, m);
3746
+ T = Ps(r, g);
3732
3747
  break;
3733
3748
  default:
3734
3749
  T = null;
3735
3750
  }
3736
- return /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
3737
- E && /* @__PURE__ */ S.jsx(
3738
- jt,
3751
+ return /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
3752
+ v && /* @__PURE__ */ w.jsx(
3753
+ Gt,
3739
3754
  {
3740
- stores: E.stores,
3741
- registry: E.registry,
3742
- client: E.client,
3755
+ stores: v.stores,
3756
+ registry: v.registry,
3757
+ client: v.client,
3743
3758
  onAction: c
3744
3759
  }
3745
3760
  ),
3746
3761
  T,
3747
- w && /* @__PURE__ */ S.jsx(Ts, {}),
3748
- /* @__PURE__ */ S.jsx(ks, {}),
3749
- /* @__PURE__ */ S.jsx(rn, { state: l, forceVisible: i.forcedDebugOverlay })
3762
+ b && /* @__PURE__ */ w.jsx(Ms, {}),
3763
+ /* @__PURE__ */ w.jsx(js, {}),
3764
+ /* @__PURE__ */ w.jsx(fn, { state: l, forceVisible: i.forcedDebugOverlay })
3750
3765
  ] });
3751
3766
  }
3752
- const As = "https://ikonai.com";
3753
- function Ts() {
3754
- return /* @__PURE__ */ S.jsxs(
3767
+ const Us = "https://ikonai.com";
3768
+ function Ms() {
3769
+ return /* @__PURE__ */ w.jsxs(
3755
3770
  "a",
3756
3771
  {
3757
3772
  className: "ikon-branding-banner",
3758
- href: As,
3773
+ href: Us,
3759
3774
  target: "_blank",
3760
3775
  rel: "noopener noreferrer",
3761
3776
  style: {
@@ -3777,141 +3792,141 @@ function Ts() {
3777
3792
  pointerEvents: "auto"
3778
3793
  },
3779
3794
  children: [
3780
- /* @__PURE__ */ S.jsx("span", { style: { opacity: 0.75 }, children: "Powered by" }),
3781
- /* @__PURE__ */ S.jsx("span", { style: { fontWeight: 700 }, children: "Ikon" })
3795
+ /* @__PURE__ */ w.jsx("span", { style: { opacity: 0.75 }, children: "Powered by" }),
3796
+ /* @__PURE__ */ w.jsx("span", { style: { fontWeight: 700 }, children: "Ikon" })
3782
3797
  ]
3783
3798
  }
3784
3799
  );
3785
3800
  }
3786
- function ks() {
3787
- const { toasts: t, dismissToast: e } = ds();
3788
- return t.length === 0 ? null : /* @__PURE__ */ S.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ S.jsx(Cs, { toast: n, onDismiss: e }, n.id)) });
3801
+ function js() {
3802
+ const { toasts: t, dismissToast: e } = Es();
3803
+ return t.length === 0 ? null : /* @__PURE__ */ w.jsx("div", { className: "ikon-toast-overlay", children: t.map((n) => /* @__PURE__ */ w.jsx(Ds, { toast: n, onDismiss: e }, n.id)) });
3789
3804
  }
3790
- function Cs({ toast: t, onDismiss: e }) {
3791
- return /* @__PURE__ */ S.jsxs(
3805
+ function Ds({ toast: t, onDismiss: e }) {
3806
+ return /* @__PURE__ */ w.jsxs(
3792
3807
  "div",
3793
3808
  {
3794
3809
  className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${t.level}`,
3795
3810
  onClick: () => e(t.id),
3796
3811
  role: "alert",
3797
3812
  children: [
3798
- /* @__PURE__ */ S.jsx("span", { className: "ikon-toast-overlay-icon", children: t.level === "error" ? "🚨" : "⚠️" }),
3799
- /* @__PURE__ */ S.jsxs("div", { className: "ikon-toast-overlay-content", children: [
3800
- /* @__PURE__ */ S.jsxs("span", { className: "ikon-toast-overlay-component", children: [
3813
+ /* @__PURE__ */ w.jsx("span", { className: "ikon-toast-overlay-icon", children: t.level === "error" ? "🚨" : "⚠️" }),
3814
+ /* @__PURE__ */ w.jsxs("div", { className: "ikon-toast-overlay-content", children: [
3815
+ /* @__PURE__ */ w.jsxs("span", { className: "ikon-toast-overlay-component", children: [
3801
3816
  "[",
3802
3817
  t.component,
3803
3818
  "]"
3804
3819
  ] }),
3805
- /* @__PURE__ */ S.jsx("span", { className: "ikon-toast-overlay-message", children: t.message })
3820
+ /* @__PURE__ */ w.jsx("span", { className: "ikon-toast-overlay-message", children: t.message })
3806
3821
  ] })
3807
3822
  ]
3808
3823
  }
3809
3824
  );
3810
3825
  }
3811
- const on = Pt(null);
3812
- function _s(t, e) {
3826
+ const hn = Ft(null);
3827
+ function $s(t, e) {
3813
3828
  return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
3814
3829
  }
3815
- function Is(t, e) {
3816
- const n = _n();
3830
+ function Bs(t, e) {
3831
+ const n = $n();
3817
3832
  if (n && t.includes(n))
3818
3833
  return n;
3819
3834
  const r = navigator.language.split("-")[0];
3820
3835
  return t.includes(r) ? r : e && t.includes(e) ? e : "en";
3821
3836
  }
3822
- function Os(t, e, n) {
3823
- return e ? Is(t, n) : n && t.includes(n) ? n : "en";
3837
+ function Fs(t, e, n) {
3838
+ return e ? Bs(t, n) : n && t.includes(n) ? n : "en";
3824
3839
  }
3825
- function Hs({
3840
+ function ii({
3826
3841
  children: t,
3827
3842
  translations: e,
3828
3843
  defaultLanguage: n,
3829
3844
  detectLanguage: r = !1
3830
3845
  }) {
3831
- const o = Object.keys(e), s = Os(o, r, n), i = e[s] ?? e.en, a = W(
3846
+ const o = Object.keys(e), s = Fs(o, r, n), i = e[s] ?? e.en, a = W(
3832
3847
  () => ({
3833
- t: (l, f) => {
3834
- const p = i[l];
3835
- return _s(p, f);
3848
+ t: (l, d) => {
3849
+ const h = i[l];
3850
+ return $s(h, d);
3836
3851
  },
3837
3852
  locale: s,
3838
3853
  translations: i
3839
3854
  }),
3840
3855
  [i, s]
3841
3856
  );
3842
- return /* @__PURE__ */ S.jsx(on, { value: a, children: t });
3857
+ return /* @__PURE__ */ w.jsx(hn, { value: a, children: t });
3843
3858
  }
3844
- function qs() {
3845
- const t = rt(on);
3859
+ function ai() {
3860
+ const t = ct(hn);
3846
3861
  if (!t)
3847
3862
  throw new Error("useI18n must be used within an I18nProvider");
3848
3863
  return t;
3849
3864
  }
3850
3865
  export {
3851
- Vs as AuthProvider,
3852
- Ks as ConnectionStateRenderer,
3853
- en as DEBUG_OVERLAY_ENABLED,
3854
- rn as DebugOverlay,
3855
- Hs as I18nProvider,
3856
- ir as IKON_UI_BASE_MODULE,
3857
- br as IKON_UI_MEDIA_MODULE,
3858
- Lr as IKON_UI_SHADERTOY_MODULE,
3859
- xr as IKON_UI_SHADERTOY_TYPE,
3860
- qe as IKON_UI_STREAM_CATEGORY,
3861
- hr as IKON_UI_VIDEO_CANVAS_TYPE,
3862
- pr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3863
- Xs as IkonApp,
3864
- Yn as IkonUi,
3865
- jr as IkonUiRegistry,
3866
- jt as IkonUiSurface,
3867
- Wn as InspectOverlay,
3868
- js as ParallaxView,
3869
- Vn as UiComponentRegistry,
3870
- Fn as UiRenderer,
3871
- Qs as UiStreamStore,
3872
- Ds as areIkonUiModuleListsEqual,
3873
- Ht as authenticateAnonymous,
3874
- Wo as buildOAuthRedirectUrl,
3875
- xe as clearAuthSession,
3876
- Ot as clearOAuthParams,
3877
- sr as createBaseResolvers,
3878
- Ms as createComponentLibrary,
3879
- Dr as createIkonUiRegistry,
3880
- gr as createMediaResolvers,
3881
- Pr as createShadertoyRendererResolver,
3882
- Gn as isIkonUiCategoryMatch,
3883
- zt as loadAuthSession,
3884
- ar as loadBaseModule,
3885
- wr as loadMediaModule,
3886
- Mr as loadShadertoyModule,
3887
- fo as normalizeIkonUiModuleList,
3888
- Bs as parseIkonUiInitPayload,
3889
- Fo as parseOAuthCallback,
3890
- Vo as parseOAuthError,
3891
- ti as randomUuid,
3892
- ho as readIkonUiModules,
3893
- $s as readIkonUiModulesFromSources,
3894
- cr as registerBaseModule,
3895
- Sr as registerMediaModule,
3896
- Ur as registerShadertoyModule,
3897
- $n as renderChildren,
3898
- Fs as renderMotionLetters,
3866
+ Qs as AuthProvider,
3867
+ ti as ConnectionStateRenderer,
3868
+ ln as DEBUG_OVERLAY_ENABLED,
3869
+ fn as DebugOverlay,
3870
+ ii as I18nProvider,
3871
+ yr as IKON_UI_BASE_MODULE,
3872
+ _r as IKON_UI_MEDIA_MODULE,
3873
+ Gr as IKON_UI_SHADERTOY_MODULE,
3874
+ Wr as IKON_UI_SHADERTOY_TYPE,
3875
+ tt as IKON_UI_STREAM_CATEGORY,
3876
+ Ar as IKON_UI_VIDEO_CANVAS_TYPE,
3877
+ Tr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3878
+ si as IkonApp,
3879
+ rr as IkonUi,
3880
+ Xr as IkonUiRegistry,
3881
+ Gt as IkonUiSurface,
3882
+ er as InspectOverlay,
3883
+ Xs as ParallaxView,
3884
+ Qn as UiComponentRegistry,
3885
+ Zn as UiRenderer,
3886
+ ui as UiStreamStore,
3887
+ Hs as areIkonUiModuleListsEqual,
3888
+ rn as authenticateAnonymous,
3889
+ es as buildOAuthRedirectUrl,
3890
+ Ue as clearAuthSession,
3891
+ jt as clearOAuthParams,
3892
+ gr as createBaseResolvers,
3893
+ Ys as createComponentLibrary,
3894
+ Hr as createIkonUiRegistry,
3895
+ Cr as createMediaResolvers,
3896
+ Kr as createShadertoyRendererResolver,
3897
+ nr as isIkonUiCategoryMatch,
3898
+ tn as loadAuthSession,
3899
+ br as loadBaseModule,
3900
+ Or as loadMediaModule,
3901
+ Yr as loadShadertoyModule,
3902
+ Ro as normalizeIkonUiModuleList,
3903
+ Js as parseIkonUiInitPayload,
3904
+ Zo as parseOAuthCallback,
3905
+ Qo as parseOAuthError,
3906
+ fi as randomUuid,
3907
+ Ao as readIkonUiModules,
3908
+ qs as readIkonUiModulesFromSources,
3909
+ Sr as registerBaseModule,
3910
+ Nr as registerMediaModule,
3911
+ zr as registerShadertoyModule,
3912
+ qn as renderChildren,
3913
+ Zs as renderMotionLetters,
3899
3914
  Ee as saveAuthSession,
3900
- $o as sendLoginCode,
3901
- ae as sessionToUser,
3902
- ns as useAuth,
3903
- Ws as useAuthGuard,
3904
- rs as useAuthOptional,
3905
- qs as useI18n,
3906
- Gs as useIkonApp,
3907
- ws as useIkonDebug,
3908
- fs as useIkonReactive,
3909
- Yr as useIkonStyles,
3910
- Xr as useIkonUiStores,
3911
- Ys as useLazyFont,
3912
- zs as useReactive,
3913
- ds as useToasts,
3914
- q as useUiNode,
3915
- Us as useUiStore,
3916
- Bo as verifyLoginCode
3915
+ qo as sendLoginCode,
3916
+ le as sessionToUser,
3917
+ hs as useAuth,
3918
+ ei as useAuthGuard,
3919
+ ps as useAuthOptional,
3920
+ ai as useI18n,
3921
+ ni as useIkonApp,
3922
+ Os as useIkonDebug,
3923
+ Rs as useIkonReactive,
3924
+ ro as useIkonStyles,
3925
+ so as useIkonUiStores,
3926
+ ri as useLazyFont,
3927
+ oi as useReactive,
3928
+ Es as useToasts,
3929
+ Z as useUiNode,
3930
+ zs as useUiStore,
3931
+ Jo as verifyLoginCode
3917
3932
  };