@ikonai/sdk-react-ui 1.0.17 → 1.0.19

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,8 +1,8 @@
1
- import { IkonUiCore as Lt, UiStreamStore as Mt } from "@ikonai/sdk-ui";
2
- import { UiStreamStore as Lo } from "@ikonai/sdk-ui";
3
- import Ut, { useSyncExternalStore as Ve, useMemo as W, memo as q, useRef as w, useCallback as D, Fragment as xt, useEffect as M, useState as z, createContext as gt, use as Ke } from "react";
4
- import { createLogger as Ee, getOrCreateDeviceId as be, deriveAuthUrl as Me, parseUrlParams as Dt, clearSessionParamsFromUrl as Ft, isCloudEnvironment as He, extractUserIdFromToken as Bt, deriveBackendType as Je, IkonClient as $t, subscribeToLogEvents as Vt, isDebugModeEnabled as Kt, LogLevel as Xe } from "@ikonai/sdk";
5
- var ye = { exports: {} }, ae = {};
1
+ import { IkonUiCore as Ct, UiStreamStore as It } from "@ikonai/sdk-ui";
2
+ import { UiStreamStore as Co } from "@ikonai/sdk-ui";
3
+ import Ot, { useSyncExternalStore as xe, useMemo as K, memo as z, useRef as A, useCallback as x, Fragment as _t, useEffect as M, useState as Y, createContext as dt, use as De } from "react";
4
+ import { createLogger as ye, getOrCreateDeviceId as he, deriveAuthUrl as _e, parseUrlParams as Nt, clearSessionParamsFromUrl as Pt, isCloudEnvironment as We, extractUserIdFromToken as jt, deriveBackendType as Ye, IkonClient as Lt, subscribeToLogEvents as Mt, isDebugModeEnabled as Ut, LogLevel as ze } from "@ikonai/sdk";
5
+ var de = { exports: {} }, oe = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,10 +12,10 @@ var ye = { exports: {} }, ae = {};
12
12
  * This source code is licensed under the MIT license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
- var Ze;
16
- function Wt() {
17
- if (Ze) return ae;
18
- Ze = 1;
15
+ var qe;
16
+ function xt() {
17
+ if (qe) return oe;
18
+ qe = 1;
19
19
  var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
20
20
  function r(n, o, s) {
21
21
  var i = null;
@@ -32,9 +32,9 @@ function Wt() {
32
32
  props: s
33
33
  };
34
34
  }
35
- return ae.Fragment = e, ae.jsx = r, ae.jsxs = r, ae;
35
+ return oe.Fragment = e, oe.jsx = r, oe.jsxs = r, oe;
36
36
  }
37
- var ce = {};
37
+ var se = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,26 +44,26 @@ var ce = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var Qe;
48
- function Yt() {
49
- return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
47
+ var Ge;
48
+ function Dt() {
49
+ return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
50
50
  function t(l) {
51
51
  if (l == null) return null;
52
52
  if (typeof l == "function")
53
- return l.$$typeof === L ? null : l.displayName || l.name || null;
53
+ return l.$$typeof === U ? null : l.displayName || l.name || null;
54
54
  if (typeof l == "string") return l;
55
55
  switch (l) {
56
56
  case S:
57
57
  return "Fragment";
58
- case m:
59
- return "Profiler";
60
58
  case p:
59
+ return "Profiler";
60
+ case m:
61
61
  return "StrictMode";
62
- case U:
62
+ case D:
63
63
  return "Suspense";
64
- case X:
64
+ case G:
65
65
  return "SuspenseList";
66
- case N:
66
+ case P:
67
67
  return "Activity";
68
68
  }
69
69
  if (typeof l == "object")
@@ -72,16 +72,16 @@ function Yt() {
72
72
  ), l.$$typeof) {
73
73
  case y:
74
74
  return "Portal";
75
- case A:
75
+ case T:
76
76
  return (l.displayName || "Context") + ".Provider";
77
- case v:
77
+ case w:
78
78
  return (l._context.displayName || "Context") + ".Consumer";
79
79
  case _:
80
80
  var b = l.render;
81
81
  return l = l.displayName, l || (l = b.displayName || b.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
82
- case Q:
82
+ case Z:
83
83
  return b = l.displayName || null, b !== null ? b : t(l.type) || "Memo";
84
- case k:
84
+ case C:
85
85
  b = l._payload, l = l._init;
86
86
  try {
87
87
  return t(l(b));
@@ -102,17 +102,17 @@ function Yt() {
102
102
  }
103
103
  if (b) {
104
104
  b = console;
105
- var T = b.error, C = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
106
- return T.call(
105
+ var k = b.error, N = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
106
+ return k.call(
107
107
  b,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- C
109
+ N
110
110
  ), e(l);
111
111
  }
112
112
  }
113
113
  function n(l) {
114
114
  if (l === S) return "<>";
115
- if (typeof l == "object" && l !== null && l.$$typeof === k)
115
+ if (typeof l == "object" && l !== null && l.$$typeof === C)
116
116
  return "<...>";
117
117
  try {
118
118
  var b = t(l);
@@ -122,7 +122,7 @@ function Yt() {
122
122
  }
123
123
  }
124
124
  function o() {
125
- var l = P.A;
125
+ var l = O.A;
126
126
  return l === null ? null : l.getOwner();
127
127
  }
128
128
  function s() {
@@ -136,31 +136,31 @@ function Yt() {
136
136
  return l.key !== void 0;
137
137
  }
138
138
  function a(l, b) {
139
- function T() {
140
- oe || (oe = !0, console.error(
139
+ function k() {
140
+ B || (B = !0, console.error(
141
141
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
142
  b
143
143
  ));
144
144
  }
145
- T.isReactWarning = !0, Object.defineProperty(l, "key", {
146
- get: T,
145
+ k.isReactWarning = !0, Object.defineProperty(l, "key", {
146
+ get: k,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
150
  function c() {
151
151
  var l = t(this.type);
152
- return me[l] || (me[l] = !0, console.error(
152
+ return J[l] || (J[l] = !0, console.error(
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
154
  )), l = this.props.ref, l !== void 0 ? l : null;
155
155
  }
156
- function d(l, b, T, C, H, $, re, x) {
157
- return T = $.ref, l = {
158
- $$typeof: h,
156
+ function f(l, b, k, N, E, I, V, we) {
157
+ return k = I.ref, l = {
158
+ $$typeof: g,
159
159
  type: l,
160
160
  key: b,
161
- props: $,
162
- _owner: H
163
- }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(l, "ref", {
161
+ props: I,
162
+ _owner: E
163
+ }, (k !== void 0 ? k : null) !== null ? Object.defineProperty(l, "ref", {
164
164
  enumerable: !1,
165
165
  get: c
166
166
  }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
@@ -177,68 +177,68 @@ function Yt() {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
- value: re
180
+ value: V
181
181
  }), Object.defineProperty(l, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
184
184
  writable: !0,
185
- value: x
185
+ value: we
186
186
  }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
187
187
  }
188
- function f(l, b, T, C, H, $, re, x) {
189
- var I = b.children;
190
- if (I !== void 0)
191
- if (C)
192
- if (G(I)) {
193
- for (C = 0; C < I.length; C++)
194
- g(I[C]);
195
- Object.freeze && Object.freeze(I);
188
+ function d(l, b, k, N, E, I, V, we) {
189
+ var L = b.children;
190
+ if (L !== void 0)
191
+ if (N)
192
+ if (W(L)) {
193
+ for (N = 0; N < L.length; N++)
194
+ h(L[N]);
195
+ Object.freeze && Object.freeze(L);
196
196
  } else
197
197
  console.error(
198
198
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
199
199
  );
200
- else g(I);
200
+ else h(L);
201
201
  if (F.call(b, "key")) {
202
- I = t(l);
203
- var Y = Object.keys(b).filter(function(ie) {
204
- return ie !== "key";
202
+ L = t(l);
203
+ var re = Object.keys(b).filter(function(kt) {
204
+ return kt !== "key";
205
205
  });
206
- C = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ge[I + C] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ N = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", te[L + N] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
207
207
  `A props object containing a "key" prop is being spread into JSX:
208
208
  let props = %s;
209
209
  <%s {...props} />
210
210
  React keys must be passed directly to JSX without using spread:
211
211
  let props = %s;
212
212
  <%s key={someKey} {...props} />`,
213
- C,
214
- I,
215
- Y,
216
- I
217
- ), ge[I + C] = !0);
213
+ N,
214
+ L,
215
+ re,
216
+ L
217
+ ), te[L + N] = !0);
218
218
  }
219
- if (I = null, T !== void 0 && (r(T), I = "" + T), i(b) && (r(b.key), I = "" + b.key), "key" in b) {
220
- T = {};
221
- for (var ee in b)
222
- ee !== "key" && (T[ee] = b[ee]);
223
- } else T = b;
224
- return I && a(
225
- T,
219
+ if (L = null, k !== void 0 && (r(k), L = "" + k), i(b) && (r(b.key), L = "" + b.key), "key" in b) {
220
+ k = {};
221
+ for (var ve in b)
222
+ ve !== "key" && (k[ve] = b[ve]);
223
+ } else k = b;
224
+ return L && a(
225
+ k,
226
226
  typeof l == "function" ? l.displayName || l.name || "Unknown" : l
227
- ), d(
227
+ ), f(
228
228
  l,
229
+ L,
229
230
  I,
230
- $,
231
- H,
231
+ E,
232
232
  o(),
233
- T,
234
- re,
235
- x
233
+ k,
234
+ V,
235
+ we
236
236
  );
237
237
  }
238
- function g(l) {
239
- typeof l == "object" && l !== null && l.$$typeof === h && l._store && (l._store.validated = 1);
238
+ function h(l) {
239
+ typeof l == "object" && l !== null && l.$$typeof === g && l._store && (l._store.validated = 1);
240
240
  }
241
- var u = Ut, h = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), A = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), U = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), P = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, G = Array.isArray, te = console.createTask ? console.createTask : function() {
241
+ var u = Ot, g = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), O = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, W = Array.isArray, Q = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
244
  u = {
@@ -246,44 +246,44 @@ React keys must be passed directly to JSX without using spread:
246
246
  return l();
247
247
  }
248
248
  };
249
- var oe, me = {}, pe = u["react-stack-bottom-frame"].bind(
249
+ var B, J = {}, X = u["react-stack-bottom-frame"].bind(
250
250
  u,
251
251
  s
252
- )(), se = te(n(s)), ge = {};
253
- ce.Fragment = S, ce.jsx = function(l, b, T, C, H) {
254
- var $ = 1e4 > P.recentlyCreatedOwnerStacks++;
255
- return f(
252
+ )(), ee = Q(n(s)), te = {};
253
+ se.Fragment = S, se.jsx = function(l, b, k, N, E) {
254
+ var I = 1e4 > O.recentlyCreatedOwnerStacks++;
255
+ return d(
256
256
  l,
257
257
  b,
258
- T,
258
+ k,
259
259
  !1,
260
- C,
261
- H,
262
- $ ? Error("react-stack-top-frame") : pe,
263
- $ ? te(n(l)) : se
260
+ N,
261
+ E,
262
+ I ? Error("react-stack-top-frame") : X,
263
+ I ? Q(n(l)) : ee
264
264
  );
265
- }, ce.jsxs = function(l, b, T, C, H) {
266
- var $ = 1e4 > P.recentlyCreatedOwnerStacks++;
267
- return f(
265
+ }, se.jsxs = function(l, b, k, N, E) {
266
+ var I = 1e4 > O.recentlyCreatedOwnerStacks++;
267
+ return d(
268
268
  l,
269
269
  b,
270
- T,
270
+ k,
271
271
  !0,
272
- C,
273
- H,
274
- $ ? Error("react-stack-top-frame") : pe,
275
- $ ? te(n(l)) : se
272
+ N,
273
+ E,
274
+ I ? Error("react-stack-top-frame") : X,
275
+ I ? Q(n(l)) : ee
276
276
  );
277
277
  };
278
- }()), ce;
278
+ }()), se;
279
279
  }
280
- var et;
281
- function zt() {
282
- return et || (et = 1, process.env.NODE_ENV === "production" ? ye.exports = Wt() : ye.exports = Yt()), ye.exports;
280
+ var He;
281
+ function Ft() {
282
+ return He || (He = 1, process.env.NODE_ENV === "production" ? de.exports = xt() : de.exports = Dt()), de.exports;
283
283
  }
284
- var E = zt();
285
- function qt(t, e) {
286
- const r = Ve(
284
+ var R = Ft();
285
+ function Bt(t, e) {
286
+ const r = xe(
287
287
  (n) => t.subscribe(n),
288
288
  () => {
289
289
  const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
@@ -294,7 +294,7 @@ function qt(t, e) {
294
294
  return `${o ?? ""}:${s?.id ?? ""}`;
295
295
  }
296
296
  );
297
- return W(() => {
297
+ return K(() => {
298
298
  const [n, o] = r.split(":");
299
299
  return {
300
300
  rootViewId: n || void 0,
@@ -302,16 +302,16 @@ function qt(t, e) {
302
302
  };
303
303
  }, [r]);
304
304
  }
305
- function Z(t, e) {
306
- const r = Ve(
305
+ function H(t, e) {
306
+ const r = xe(
307
307
  (n) => t.subscribeNode(e, n),
308
308
  () => t.getNodeVersion(e),
309
309
  () => t.getNodeVersion(e)
310
310
  );
311
- return W(() => t.getNode(e), [t, e, r]);
311
+ return K(() => t.getNode(e), [t, e, r]);
312
312
  }
313
- const Gt = Ee("UIRenderer");
314
- function Ht(t) {
313
+ const $t = ye("UIRenderer");
314
+ function Vt(t) {
315
315
  if (t === void 0)
316
316
  return "{}";
317
317
  if (typeof t == "string")
@@ -322,18 +322,18 @@ function Ht(t) {
322
322
  return "{}";
323
323
  }
324
324
  }
325
- function Jt(t) {
325
+ function Kt(t) {
326
326
  const e = t.styleIds;
327
327
  return Array.isArray(e) ? e : [];
328
328
  }
329
- function Xt(t) {
329
+ function Wt(t) {
330
330
  const e = t.children;
331
331
  return Array.isArray(e) ? e : [];
332
332
  }
333
- function Zt(t, e) {
333
+ function Yt(t, e) {
334
334
  return t.nodeId === e.nodeId && t.context === e.context;
335
335
  }
336
- function Qt(t) {
336
+ function zt(t) {
337
337
  if (t.length === 0) return "";
338
338
  if (t.length === 1) return t[0].id;
339
339
  let e = t[0].id;
@@ -341,66 +341,66 @@ function Qt(t) {
341
341
  e += "," + t[r].id;
342
342
  return e;
343
343
  }
344
- const Ue = q(function t({ nodeId: e, context: r }) {
345
- const n = Z(r.store, e), o = n ? Xt(n) : [], s = Qt(o), i = W(
346
- () => o.length === 0 ? null : o.map((g) => /* @__PURE__ */ E.jsx(t, { nodeId: g.id, context: r }, g.id)),
344
+ const Ne = z(function t({ nodeId: e, context: r }) {
345
+ const n = H(r.store, e), o = n ? Wt(n) : [], s = zt(o), i = K(
346
+ () => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ R.jsx(t, { nodeId: h.id, context: r }, h.id)),
347
347
  // eslint-disable-next-line react-hooks/exhaustive-deps
348
348
  [s, r]
349
349
  );
350
350
  if (!n)
351
351
  return null;
352
352
  if (n.type === "root")
353
- return /* @__PURE__ */ E.jsx(xt, { children: i }, n.id);
353
+ return /* @__PURE__ */ R.jsx(_t, { children: i }, n.id);
354
354
  const a = r.library.resolve(n);
355
355
  if (!a)
356
- return Gt.warn(`No renderer for node type ${n.type}`), null;
357
- const c = Jt(n), d = c.length > 0 ? c.join(" ") : void 0, f = a;
358
- return /* @__PURE__ */ E.jsx(f, { nodeId: e, context: r, className: d });
359
- }, Zt);
360
- function er(t, e) {
361
- return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ E.jsx(Ue, { nodeId: r.id, context: e }, r.id));
362
- }
363
- function tr(t, e) {
356
+ return $t.warn(`No renderer for node type ${n.type}`), null;
357
+ const c = Kt(n), f = c.length > 0 ? c.join(" ") : void 0, d = a;
358
+ return /* @__PURE__ */ R.jsx(d, { nodeId: e, context: r, className: f });
359
+ }, Yt);
360
+ function qt(t, e) {
361
+ return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(Ne, { nodeId: r.id, context: e }, r.id));
362
+ }
363
+ function Gt(t, e) {
364
364
  return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
365
365
  }
366
- const rr = q(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
- const { rootViewId: c, rootNodeId: d } = qt(e, n), f = w(s);
368
- f.current = s;
369
- const g = w(i);
370
- g.current = i;
371
- const u = w(a);
366
+ const Ht = z(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
+ const { rootViewId: c, rootNodeId: f } = Bt(e, n), d = A(s);
368
+ d.current = s;
369
+ const h = A(i);
370
+ h.current = i;
371
+ const u = A(a);
372
372
  u.current = a;
373
- const h = D((S, p) => {
373
+ const g = x((S, m) => {
374
374
  if (!S)
375
375
  return;
376
- const m = Ht(p);
377
- f.current?.(S, m);
378
- }, []), y = W(() => {
376
+ const p = Vt(m);
377
+ d.current?.(S, p);
378
+ }, []), y = K(() => {
379
379
  const S = {
380
380
  store: e,
381
381
  library: r,
382
382
  handlerCache: e.handlerCache,
383
383
  // Access payloads from store at call time, not captured snapshot
384
- getPayload: (p) => e.getSnapshot().payloads.get(p),
385
- renderChildren: (p) => er(p, S),
386
- renderView: (p) => {
387
- const m = e.getSnapshot().views.get(p);
388
- return m ? /* @__PURE__ */ E.jsx(Ue, { nodeId: m.id, context: S }) : null;
384
+ getPayload: (m) => e.getSnapshot().payloads.get(m),
385
+ renderChildren: (m) => qt(m, S),
386
+ renderView: (m) => {
387
+ const p = e.getSnapshot().views.get(m);
388
+ return p ? /* @__PURE__ */ R.jsx(Ne, { nodeId: p.id, context: S }) : null;
389
389
  },
390
- dispatchAction: h,
390
+ dispatchAction: g,
391
391
  // Access client/video via refs to avoid context recreation
392
392
  get client() {
393
- return g.current;
393
+ return h.current;
394
394
  },
395
395
  get video() {
396
396
  return u.current;
397
397
  }
398
398
  };
399
399
  return S;
400
- }, [e, r, h]);
401
- return !c || !d ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(Ue, { nodeId: d, context: y }) });
402
- }, tr);
403
- class nr {
400
+ }, [e, r, g]);
401
+ return !c || !f ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(Ne, { nodeId: f, context: y }) });
402
+ }, Gt);
403
+ class Jt {
404
404
  constructor(e, r) {
405
405
  if (this.fallback = r, e)
406
406
  for (const [n, o] of e)
@@ -417,41 +417,41 @@ class nr {
417
417
  return this.renderers.get(e.type) ?? this.fallback;
418
418
  }
419
419
  }
420
- function po(t, e) {
420
+ function ao(t, e) {
421
421
  const r = Object.entries(t);
422
- return new nr(r, e);
422
+ return new Jt(r, e);
423
423
  }
424
- function go(t) {
425
- return Ve(
424
+ function co(t) {
425
+ return xe(
426
426
  (e) => t.subscribe(e),
427
427
  () => t.getSnapshot(),
428
428
  () => t.getSnapshot()
429
429
  );
430
430
  }
431
- const xe = "ikon-ui";
432
- function or(t, e) {
431
+ const Pe = "ikon-ui";
432
+ function Xt(t, e) {
433
433
  return t === e;
434
434
  }
435
- const yo = q(function({ stores: e, registry: r, category: n = xe, onAction: o, client: s }) {
436
- const i = W(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
435
+ const uo = z(function({ stores: e, registry: r, category: n = Pe, onAction: o, client: s }) {
436
+ const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = A(o);
437
437
  a.current = o;
438
- const c = w(s);
438
+ const c = A(s);
439
439
  c.current = s;
440
- const d = W(
440
+ const f = K(
441
441
  () => {
442
- const f = [];
443
- for (const [g, u] of e) {
444
- const h = u.store.getSnapshot();
445
- or(u.category, n) && (!h.rootViewId || !h.views.has(h.rootViewId) || f.push({ key: g, store: u.store }));
442
+ const d = [];
443
+ for (const [h, u] of e) {
444
+ const g = u.store.getSnapshot();
445
+ Xt(u.category, n) && (!g.rootViewId || !g.views.has(g.rootViewId) || d.push({ key: h, store: u.store }));
446
446
  }
447
- return f;
447
+ return d;
448
448
  },
449
449
  // eslint-disable-next-line react-hooks/exhaustive-deps
450
450
  [e, n, i]
451
451
  );
452
- return d.length === 0 ? null : /* @__PURE__ */ E.jsx(E.Fragment, { children: d.map(({ key: f, store: g }) => /* @__PURE__ */ E.jsx(rr, { store: g, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, f)) });
452
+ return f.length === 0 ? null : /* @__PURE__ */ R.jsx(R.Fragment, { children: f.map(({ key: d, store: h }) => /* @__PURE__ */ R.jsx(Ht, { store: h, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, d)) });
453
453
  });
454
- class sr {
454
+ class Zt {
455
455
  core;
456
456
  ownsCore;
457
457
  stores = /* @__PURE__ */ new Map();
@@ -459,7 +459,7 @@ class sr {
459
459
  unsubscribeClears;
460
460
  unsubscribeStoreChanges;
461
461
  constructor(e) {
462
- this.core = e?.core ?? new Lt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
462
+ this.core = e?.core ?? new Ct({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
463
463
  }
464
464
  dispose() {
465
465
  this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
@@ -509,8 +509,8 @@ class sr {
509
509
  if (r)
510
510
  return r;
511
511
  const n = {
512
- category: xe,
513
- store: new Mt()
512
+ category: Pe,
513
+ store: new It()
514
514
  };
515
515
  return this.stores.set(e, n), n;
516
516
  }
@@ -518,7 +518,7 @@ class sr {
518
518
  const n = this.stores.get(e);
519
519
  if (!n)
520
520
  return !1;
521
- const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? xe;
521
+ const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Pe;
522
522
  return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
523
523
  }
524
524
  notify(e) {
@@ -526,13 +526,13 @@ class sr {
526
526
  r(e);
527
527
  }
528
528
  }
529
- function ir(t) {
529
+ function Qt(t) {
530
530
  if (typeof t == "string") {
531
531
  const e = t.trim();
532
532
  return e.length > 0 ? e : void 0;
533
533
  }
534
534
  }
535
- function he(t) {
535
+ function le(t) {
536
536
  if (typeof t == "string") {
537
537
  const e = t.trim();
538
538
  return e.length > 0 ? e : void 0;
@@ -542,7 +542,7 @@ function he(t) {
542
542
  return e.length > 0 ? e.join(" ") : void 0;
543
543
  }
544
544
  }
545
- function We(...t) {
545
+ function Fe(...t) {
546
546
  let e = "";
547
547
  for (const r of t)
548
548
  if (r) {
@@ -551,42 +551,42 @@ function We(...t) {
551
551
  }
552
552
  return e || void 0;
553
553
  }
554
- const tt = /* @__PURE__ */ new WeakMap(), ar = {};
555
- function Ye(t) {
554
+ const Je = /* @__PURE__ */ new WeakMap(), er = {};
555
+ function Be(t) {
556
556
  if (!t)
557
- return ar;
558
- const e = tt.get(t);
557
+ return er;
558
+ const e = Je.get(t);
559
559
  if (e)
560
560
  return e;
561
561
  const r = {};
562
562
  for (const [n, o] of Object.entries(t))
563
563
  o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
564
- return tt.set(t, r), r;
564
+ return Je.set(t, r), r;
565
565
  }
566
- function cr() {
567
- const t = q(function({ nodeId: r, context: n }) {
568
- const o = Z(n.store, r), s = w(null), i = he(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, d = he(o?.props?.key), f = o?.props?.preciseGeneratedAt;
566
+ function tr() {
567
+ const t = z(function({ nodeId: r, context: n }) {
568
+ const o = H(n.store, r), s = A(null), i = le(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, f = le(o?.props?.key), d = o?.props?.preciseGeneratedAt;
569
569
  return M(() => {
570
570
  if (typeof document > "u")
571
571
  return;
572
572
  const u = s.current;
573
573
  if (!u || i && u.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
574
574
  return;
575
- const h = c !== !0;
576
- if (h) {
577
- const m = ((v) => {
578
- let A = v.parentElement;
579
- for (; A; ) {
580
- const U = window.getComputedStyle(A).overflowY;
581
- if (U === "auto" || U === "scroll" || A.hasAttribute("data-radix-scroll-area-viewport"))
582
- return A;
583
- A = A.parentElement;
575
+ const g = c !== !0;
576
+ if (g) {
577
+ const p = ((w) => {
578
+ let T = w.parentElement;
579
+ for (; T; ) {
580
+ const D = window.getComputedStyle(T).overflowY;
581
+ if (D === "auto" || D === "scroll" || T.hasAttribute("data-radix-scroll-area-viewport"))
582
+ return T;
583
+ T = T.parentElement;
584
584
  }
585
585
  return null;
586
586
  })(u);
587
- m ? requestAnimationFrame(() => {
588
- const v = m.getBoundingClientRect(), A = u.getBoundingClientRect(), _ = m.scrollTop + (A.bottom - v.bottom) + 16;
589
- "scrollBehavior" in document.documentElement.style ? m.scrollTo({ top: _, behavior: "smooth" }) : m.scrollTop = _;
587
+ p ? requestAnimationFrame(() => {
588
+ const w = p.getBoundingClientRect(), T = u.getBoundingClientRect(), _ = p.scrollTop + (T.bottom - w.bottom) + 16;
589
+ "scrollBehavior" in document.documentElement.style ? p.scrollTo({ top: _, behavior: "smooth" }) : p.scrollTop = _;
590
590
  }) : typeof u.scrollIntoView == "function" && requestAnimationFrame(() => {
591
591
  try {
592
592
  u.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
@@ -598,11 +598,11 @@ function cr() {
598
598
  const y = document.activeElement;
599
599
  if (!(y instanceof HTMLInputElement || y instanceof HTMLTextAreaElement || y?.getAttribute("contenteditable") === "true") && typeof u.focus == "function")
600
600
  try {
601
- u.focus({ preventScroll: !h });
601
+ u.focus({ preventScroll: !g });
602
602
  } catch {
603
603
  u.focus();
604
604
  }
605
- }, [c, i, d, f]), o ? /* @__PURE__ */ E.jsx(
605
+ }, [c, i, f, d]), o ? /* @__PURE__ */ R.jsx(
606
606
  "span",
607
607
  {
608
608
  ref: s,
@@ -619,25 +619,25 @@ function cr() {
619
619
  return t;
620
620
  };
621
621
  }
622
- function ur() {
623
- const t = q(function({ nodeId: r, context: n, className: o }) {
624
- const s = Z(n.store, r), i = ir(s?.props?.onInvokeId), a = D(() => {
622
+ function rr() {
623
+ const t = z(function({ nodeId: r, context: n, className: o }) {
624
+ const s = H(n.store, r), i = Qt(s?.props?.onInvokeId), a = x(() => {
625
625
  i && n.dispatchAction(i);
626
626
  }, [i, n]);
627
627
  if (!s)
628
628
  return null;
629
- const c = Ye(s.props);
629
+ const c = Be(s.props);
630
630
  delete c.onInvokeId;
631
- const d = We(he(s.props?.className), o), f = s.children?.length ? n.renderChildren(s.children) : void 0;
632
- return /* @__PURE__ */ E.jsx(
631
+ const f = Fe(le(s.props?.className), o), d = s.children?.length ? n.renderChildren(s.children) : void 0;
632
+ return /* @__PURE__ */ R.jsx(
633
633
  "div",
634
634
  {
635
635
  ...c,
636
636
  "data-ikon-node-id": s.id,
637
- className: d,
637
+ className: f,
638
638
  onClick: i ? a : void 0,
639
639
  style: i ? { cursor: "pointer" } : void 0,
640
- children: f
640
+ children: d
641
641
  }
642
642
  );
643
643
  });
@@ -646,45 +646,45 @@ function ur() {
646
646
  return t;
647
647
  };
648
648
  }
649
- function lr() {
650
- const t = q(function({ nodeId: r, context: n, className: o }) {
651
- const s = Z(n.store, r);
649
+ function nr() {
650
+ const t = z(function({ nodeId: r, context: n, className: o }) {
651
+ const s = H(n.store, r);
652
652
  if (!s)
653
653
  return null;
654
- const i = Ye(s.props), a = We("relative", he(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
655
- return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
654
+ const i = Be(s.props), a = Fe("relative", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
655
+ return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
656
656
  });
657
657
  return ({ type: e }) => {
658
658
  if (e === "std.stack")
659
659
  return t;
660
660
  };
661
661
  }
662
- function dr() {
663
- const t = q(function({ nodeId: r, context: n, className: o }) {
664
- const s = Z(n.store, r);
662
+ function or() {
663
+ const t = z(function({ nodeId: r, context: n, className: o }) {
664
+ const s = H(n.store, r);
665
665
  if (!s)
666
666
  return null;
667
- const i = Ye(s.props), a = We("absolute", he(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
668
- return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
667
+ const i = Be(s.props), a = Fe("absolute", le(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
668
+ return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
669
669
  });
670
670
  return ({ type: e }) => {
671
671
  if (e === "std.layer")
672
672
  return t;
673
673
  };
674
674
  }
675
- function fr() {
675
+ function sr() {
676
676
  return [
677
- ur(),
678
- lr(),
679
- dr(),
680
- cr()
677
+ rr(),
678
+ nr(),
679
+ or(),
680
+ tr()
681
681
  ];
682
682
  }
683
- const hr = "base", mr = async () => fr();
684
- function pr(t) {
685
- t.registerModule(hr, mr);
683
+ const ir = "base", ar = async () => sr();
684
+ function cr(t) {
685
+ t.registerModule(ir, ar);
686
686
  }
687
- function gr(t) {
687
+ function ur(t) {
688
688
  if (typeof t == "string") {
689
689
  const e = t.trim();
690
690
  return e.length > 0 ? e : void 0;
@@ -694,19 +694,19 @@ function gr(t) {
694
694
  return e.length > 0 ? e.join(" ") : void 0;
695
695
  }
696
696
  }
697
- function yr(...t) {
697
+ function lr(...t) {
698
698
  const e = [];
699
699
  for (const r of t)
700
700
  r && r.trim() && e.push(r.trim());
701
701
  return e.length > 0 ? e.join(" ") : void 0;
702
702
  }
703
- function rt(t) {
703
+ function Xe(t) {
704
704
  if (typeof t != "string")
705
705
  return;
706
706
  const e = t.trim();
707
707
  return e.length > 0 ? e : void 0;
708
708
  }
709
- function Se(t) {
709
+ function fe(t) {
710
710
  if (typeof t == "boolean")
711
711
  return t;
712
712
  if (typeof t == "string") {
@@ -715,25 +715,25 @@ function Se(t) {
715
715
  if (e === "false") return !1;
716
716
  }
717
717
  }
718
- const Sr = "std.audio-url-player";
719
- function br() {
720
- const t = q(function({
718
+ const dr = "std.audio-url-player";
719
+ function fr() {
720
+ const t = z(function({
721
721
  nodeId: r,
722
722
  context: n,
723
723
  className: o
724
724
  }) {
725
- const s = Z(n.store, r);
725
+ const s = H(n.store, r);
726
726
  if (!s)
727
727
  return null;
728
- const i = yr(gr(s.props?.className), o), a = rt(s.props?.src), c = rt(s.props?.preload), d = Se(s.props?.controls), f = Se(s.props?.autoplay), g = Se(s.props?.loop), u = Se(s.props?.muted);
729
- return /* @__PURE__ */ E.jsx(
728
+ const i = lr(ur(s.props?.className), o), a = Xe(s.props?.src), c = Xe(s.props?.preload), f = fe(s.props?.controls), d = fe(s.props?.autoplay), h = fe(s.props?.loop), u = fe(s.props?.muted);
729
+ return /* @__PURE__ */ R.jsx(
730
730
  "audio",
731
731
  {
732
732
  src: a,
733
733
  ...c !== void 0 ? { preload: c } : {},
734
- ...d !== void 0 ? { controls: d } : {},
735
- ...f !== void 0 ? { autoPlay: f } : {},
736
- ...g !== void 0 ? { loop: g } : {},
734
+ ...f !== void 0 ? { controls: f } : {},
735
+ ...d !== void 0 ? { autoPlay: d } : {},
736
+ ...h !== void 0 ? { loop: h } : {},
737
737
  ...u !== void 0 ? { muted: u } : {},
738
738
  "data-ikon-node-id": s.id,
739
739
  className: i
@@ -741,11 +741,11 @@ function br() {
741
741
  );
742
742
  });
743
743
  return ({ type: e }) => {
744
- if (e === Sr)
744
+ if (e === dr)
745
745
  return t;
746
746
  };
747
747
  }
748
- function yt(t) {
748
+ function ft(t) {
749
749
  if (typeof t == "string") {
750
750
  const e = t.trim();
751
751
  return e.length > 0 ? e : void 0;
@@ -755,13 +755,13 @@ function yt(t) {
755
755
  return e.length > 0 ? e.join(" ") : void 0;
756
756
  }
757
757
  }
758
- function St(...t) {
758
+ function ht(...t) {
759
759
  const e = [];
760
760
  for (const r of t)
761
761
  r && r.trim() && e.push(r.trim());
762
762
  return e.length > 0 ? e.join(" ") : void 0;
763
763
  }
764
- function we(t) {
764
+ function me(t) {
765
765
  if (typeof t == "number" && Number.isFinite(t))
766
766
  return Math.floor(t);
767
767
  if (typeof t == "string" && t.trim().length > 0) {
@@ -770,29 +770,29 @@ function we(t) {
770
770
  return Math.floor(e);
771
771
  }
772
772
  }
773
- function De(t) {
773
+ function je(t) {
774
774
  if (typeof t != "string")
775
775
  return;
776
776
  const e = t.trim();
777
777
  return e.length > 0 ? e : void 0;
778
778
  }
779
- const wr = "std.video-canvas", vr = "std.video-url-player";
780
- function Rr() {
781
- const t = q(function({ nodeId: r, context: n, className: o }) {
782
- const s = Z(n.store, r), i = w(null), a = w(null), c = n.video, d = n.client, f = d?.isWebRtcEnabled ? d.webRtcVideoStream : null, g = d?.isWebRtcEnabled ? d.webRtcScreenStream : null, u = s ? De(s.props?.streamId) : void 0, h = s ? we(s.props?.width) : void 0, y = s ? we(s.props?.height) : void 0, S = s ? St(yt(s.props?.className), o) : o, p = u?.includes("screen") ? g : f;
779
+ const hr = "std.video-canvas", mr = "std.video-url-player";
780
+ function pr() {
781
+ const t = z(function({ nodeId: r, context: n, className: o }) {
782
+ const s = H(n.store, r), i = A(null), a = A(null), c = n.video, f = n.client, d = f?.isWebRtcEnabled ? f.webRtcVideoStream : null, h = f?.isWebRtcEnabled ? f.webRtcScreenStream : null, u = s ? je(s.props?.streamId) : void 0, g = s ? me(s.props?.width) : void 0, y = s ? me(s.props?.height) : void 0, S = s ? ht(ft(s.props?.className), o) : o, m = u?.includes("screen") ? h : d;
783
783
  return M(() => {
784
- const m = i.current;
785
- if (!(!c || !m || !u || p))
786
- return c.attachCanvas(u, m), () => {
784
+ const p = i.current;
785
+ if (!(!c || !p || !u || m))
786
+ return c.attachCanvas(u, p), () => {
787
787
  c.detachCanvas(u);
788
788
  };
789
- }, [c, u, p]), M(() => {
790
- const m = a.current;
791
- if (!(!m || !p))
792
- return m.srcObject = p, () => {
793
- m.srcObject = null;
789
+ }, [c, u, m]), M(() => {
790
+ const p = a.current;
791
+ if (!(!p || !m))
792
+ return p.srcObject = m, () => {
793
+ p.srcObject = null;
794
794
  };
795
- }, [p]), s ? p ? /* @__PURE__ */ E.jsx(
795
+ }, [m]), s ? m ? /* @__PURE__ */ R.jsx(
796
796
  "video",
797
797
  {
798
798
  ref: a,
@@ -802,32 +802,32 @@ function Rr() {
802
802
  "data-ikon-node-id": s.id,
803
803
  "data-ikon-video-stream-id": u,
804
804
  className: S,
805
- ...h ? { width: h } : {},
805
+ ...g ? { width: g } : {},
806
806
  ...y ? { height: y } : {}
807
807
  },
808
808
  u
809
- ) : /* @__PURE__ */ E.jsx(
809
+ ) : /* @__PURE__ */ R.jsx(
810
810
  "canvas",
811
811
  {
812
812
  ref: i,
813
813
  "data-ikon-node-id": s.id,
814
814
  "data-ikon-video-stream-id": u,
815
815
  className: S,
816
- ...h ? { width: h } : {},
816
+ ...g ? { width: g } : {},
817
817
  ...y ? { height: y } : {}
818
818
  },
819
819
  u
820
820
  ) : null;
821
821
  });
822
822
  return ({ type: e }) => {
823
- if (e === wr)
823
+ if (e === hr)
824
824
  return t;
825
825
  };
826
826
  }
827
- function Er() {
828
- return [Rr(), Ar(), br()];
827
+ function gr() {
828
+ return [pr(), yr(), fr()];
829
829
  }
830
- function ue(t) {
830
+ function ie(t) {
831
831
  if (typeof t == "boolean")
832
832
  return t;
833
833
  if (typeof t == "string") {
@@ -836,56 +836,56 @@ function ue(t) {
836
836
  if (e === "false") return !1;
837
837
  }
838
838
  }
839
- function Ar() {
840
- const t = q(function({
839
+ function yr() {
840
+ const t = z(function({
841
841
  nodeId: r,
842
842
  context: n,
843
843
  className: o
844
844
  }) {
845
- const s = Z(n.store, r);
845
+ const s = H(n.store, r);
846
846
  if (!s)
847
847
  return null;
848
- const i = St(yt(s.props?.className), o), a = De(s.props?.src), c = De(s.props?.poster), d = ue(s.props?.controls), f = ue(s.props?.autoplay), g = ue(s.props?.loop), u = ue(s.props?.muted), h = ue(s.props?.playsInline), y = we(s.props?.width), S = we(s.props?.height), p = s.children?.length ? n.renderChildren(s.children) : void 0;
849
- return /* @__PURE__ */ E.jsx(
848
+ const i = ht(ft(s.props?.className), o), a = je(s.props?.src), c = je(s.props?.poster), f = ie(s.props?.controls), d = ie(s.props?.autoplay), h = ie(s.props?.loop), u = ie(s.props?.muted), g = ie(s.props?.playsInline), y = me(s.props?.width), S = me(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
849
+ return /* @__PURE__ */ R.jsx(
850
850
  "video",
851
851
  {
852
852
  src: a,
853
853
  poster: c,
854
- ...d !== void 0 ? { controls: d } : {},
855
- ...f !== void 0 ? { autoPlay: f } : {},
856
- ...g !== void 0 ? { loop: g } : {},
854
+ ...f !== void 0 ? { controls: f } : {},
855
+ ...d !== void 0 ? { autoPlay: d } : {},
856
+ ...h !== void 0 ? { loop: h } : {},
857
857
  ...u !== void 0 ? { muted: u } : {},
858
- ...h !== void 0 ? { playsInline: h } : {},
858
+ ...g !== void 0 ? { playsInline: g } : {},
859
859
  ...y ? { width: y } : {},
860
860
  ...S ? { height: S } : {},
861
861
  "data-ikon-node-id": s.id,
862
862
  className: i,
863
- children: p
863
+ children: m
864
864
  }
865
865
  );
866
866
  });
867
867
  return ({ type: e }) => {
868
- if (e === vr)
868
+ if (e === mr)
869
869
  return t;
870
870
  };
871
871
  }
872
- const Tr = "media", kr = async () => Er();
873
- function Cr(t) {
874
- t.registerModule(Tr, kr);
872
+ const Sr = "media", br = async () => gr();
873
+ function wr(t) {
874
+ t.registerModule(Sr, br);
875
875
  }
876
- const Ir = `#version 300 es
876
+ const vr = `#version 300 es
877
877
  in vec4 a_position;
878
878
  void main() {
879
879
  gl_Position = a_position;
880
880
  }
881
881
  `;
882
- function Or(t, e) {
882
+ function Rr(t, e) {
883
883
  return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
884
884
  }
885
- function _r(t, e) {
885
+ function Er(t, e) {
886
886
  const r = [];
887
887
  for (const [n, o] of Object.entries(e)) {
888
- if (Or(t, n))
888
+ if (Rr(t, n))
889
889
  continue;
890
890
  let s;
891
891
  switch (o.type) {
@@ -938,7 +938,7 @@ void main() {
938
938
  }
939
939
  `;
940
940
  }
941
- class Nr {
941
+ class Ar {
942
942
  gl;
943
943
  program = null;
944
944
  positionBuffer = null;
@@ -974,10 +974,10 @@ class Nr {
974
974
  }
975
975
  compile(e, r = {}) {
976
976
  this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
977
- const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, Ir);
977
+ const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, vr);
978
978
  if (!o)
979
979
  return !1;
980
- const s = _r(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
980
+ const s = Er(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
981
981
  if (!i)
982
982
  return n.deleteShader(o), !1;
983
983
  const a = n.createProgram();
@@ -1015,46 +1015,46 @@ class Nr {
1015
1015
  this.lastFrameTime = s, this.frameCount++, e.clearColor(0, 0, 0, 1), e.clear(e.COLOR_BUFFER_BIT), e.useProgram(this.program), e.bindVertexArray(this.vao);
1016
1016
  const c = this.uniformLocations.get("iResolution");
1017
1017
  c && e.uniform3f(c, n, o, 1);
1018
- const d = this.uniformLocations.get("iTime");
1019
- d && e.uniform1f(d, i);
1020
- const f = this.uniformLocations.get("iTimeDelta");
1021
- f && e.uniform1f(f, a);
1022
- const g = this.uniformLocations.get("iFrame");
1023
- g && e.uniform1i(g, this.frameCount);
1018
+ const f = this.uniformLocations.get("iTime");
1019
+ f && e.uniform1f(f, i);
1020
+ const d = this.uniformLocations.get("iTimeDelta");
1021
+ d && e.uniform1f(d, a);
1022
+ const h = this.uniformLocations.get("iFrame");
1023
+ h && e.uniform1i(h, this.frameCount);
1024
1024
  const u = this.uniformLocations.get("iMouse");
1025
1025
  u && e.uniform4f(u, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
1026
- const h = this.uniformLocations.get("iDate");
1027
- if (h) {
1026
+ const g = this.uniformLocations.get("iDate");
1027
+ if (g) {
1028
1028
  const y = /* @__PURE__ */ new Date();
1029
- e.uniform4f(h, y.getFullYear(), y.getMonth(), y.getDate(), y.getHours() * 3600 + y.getMinutes() * 60 + y.getSeconds() + y.getMilliseconds() / 1e3);
1029
+ e.uniform4f(g, y.getFullYear(), y.getMonth(), y.getDate(), y.getHours() * 3600 + y.getMinutes() * 60 + y.getSeconds() + y.getMilliseconds() / 1e3);
1030
1030
  }
1031
1031
  for (const [y, S] of Object.entries(this.customUniforms)) {
1032
- const p = this.uniformLocations.get(y);
1033
- if (p)
1032
+ const m = this.uniformLocations.get(y);
1033
+ if (m)
1034
1034
  switch (S.type) {
1035
1035
  case "float":
1036
- e.uniform1f(p, S.value);
1036
+ e.uniform1f(m, S.value);
1037
1037
  break;
1038
1038
  case "vec2": {
1039
- const m = S.value;
1040
- e.uniform2f(p, m[0], m[1]);
1039
+ const p = S.value;
1040
+ e.uniform2f(m, p[0], p[1]);
1041
1041
  break;
1042
1042
  }
1043
1043
  case "vec3": {
1044
- const m = S.value;
1045
- e.uniform3f(p, m[0], m[1], m[2]);
1044
+ const p = S.value;
1045
+ e.uniform3f(m, p[0], p[1], p[2]);
1046
1046
  break;
1047
1047
  }
1048
1048
  case "vec4": {
1049
- const m = S.value;
1050
- e.uniform4f(p, m[0], m[1], m[2], m[3]);
1049
+ const p = S.value;
1050
+ e.uniform4f(m, p[0], p[1], p[2], p[3]);
1051
1051
  break;
1052
1052
  }
1053
1053
  case "int":
1054
- e.uniform1i(p, S.value);
1054
+ e.uniform1i(m, S.value);
1055
1055
  break;
1056
1056
  case "bool":
1057
- e.uniform1i(p, S.value ? 1 : 0);
1057
+ e.uniform1i(m, S.value ? 1 : 0);
1058
1058
  break;
1059
1059
  }
1060
1060
  }
@@ -1068,7 +1068,7 @@ class Nr {
1068
1068
  this.program && (e.deleteProgram(this.program), this.program = null), this.positionBuffer && (e.deleteBuffer(this.positionBuffer), this.positionBuffer = null), this.vao && (e.deleteVertexArray(this.vao), this.vao = null), this.uniformLocations.clear();
1069
1069
  }
1070
1070
  }
1071
- function Pr(t) {
1071
+ function Tr(t) {
1072
1072
  if (typeof t == "string") {
1073
1073
  const e = t.trim();
1074
1074
  return e.length > 0 ? e : void 0;
@@ -1078,13 +1078,13 @@ function Pr(t) {
1078
1078
  return e.length > 0 ? e.join(" ") : void 0;
1079
1079
  }
1080
1080
  }
1081
- function jr(...t) {
1081
+ function kr(...t) {
1082
1082
  const e = [];
1083
1083
  for (const r of t)
1084
1084
  r && r.trim() && e.push(r.trim());
1085
1085
  return e.length > 0 ? e.join(" ") : void 0;
1086
1086
  }
1087
- function Ce(t) {
1087
+ function Re(t) {
1088
1088
  if (typeof t == "number" && Number.isFinite(t))
1089
1089
  return Math.floor(t);
1090
1090
  if (typeof t == "string" && t.trim().length > 0) {
@@ -1093,10 +1093,10 @@ function Ce(t) {
1093
1093
  return Math.floor(e);
1094
1094
  }
1095
1095
  }
1096
- function Lr(t) {
1096
+ function Cr(t) {
1097
1097
  return typeof t == "string" ? t : "";
1098
1098
  }
1099
- function Mr(t) {
1099
+ function Ir(t) {
1100
1100
  if (typeof t == "boolean")
1101
1101
  return t;
1102
1102
  if (typeof t == "string") {
@@ -1105,7 +1105,7 @@ function Mr(t) {
1105
1105
  if (e === "false") return !1;
1106
1106
  }
1107
1107
  }
1108
- function Ur(t) {
1108
+ function Or(t) {
1109
1109
  if (!t || typeof t != "object")
1110
1110
  return {};
1111
1111
  const e = {}, r = t;
@@ -1120,7 +1120,7 @@ function Ur(t) {
1120
1120
  }
1121
1121
  return e;
1122
1122
  }
1123
- function xr(t, e) {
1123
+ function _r(t, e) {
1124
1124
  const r = Object.keys(t), n = Object.keys(e);
1125
1125
  if (r.length !== n.length)
1126
1126
  return !1;
@@ -1141,99 +1141,99 @@ function xr(t, e) {
1141
1141
  }
1142
1142
  return !0;
1143
1143
  }
1144
- const Dr = "std.shader-canvas";
1145
- function Fr() {
1146
- const t = q(function({ nodeId: r, context: n, className: o }) {
1147
- const s = Z(n.store, r), i = w(null), a = w(null), c = w(null), d = w(0), f = w(""), g = w({}), u = w({
1144
+ const Nr = "std.shader-canvas";
1145
+ function Pr() {
1146
+ const t = z(function({ nodeId: r, context: n, className: o }) {
1147
+ const s = H(n.store, r), i = A(null), a = A(null), c = A(null), f = A(0), d = A(""), h = A({}), u = A({
1148
1148
  x: 0,
1149
1149
  y: 0,
1150
1150
  clickX: 0,
1151
1151
  clickY: 0,
1152
1152
  isDown: !1
1153
- }), h = s ? Lr(s.props?.shaderSource) : "", y = s ? Ce(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, p = W(() => Ur(S), [S]), m = s ? Mr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ce(s.props?.width) : void 0, A = s ? Ce(s.props?.height) : void 0, _ = s ? jr(Pr(s.props?.className), o) : o;
1153
+ }), g = s ? Cr(s.props?.shaderSource) : "", y = s ? Re(s.props?.fps) ?? 60 : 60, S = s?.props?.uniforms, m = K(() => Or(S), [S]), p = s ? Ir(s.props?.enableMouse) ?? !0 : !0, w = s ? Re(s.props?.width) : void 0, T = s ? Re(s.props?.height) : void 0, _ = s ? kr(Tr(s.props?.className), o) : o;
1154
1154
  M(() => {
1155
- const k = i.current;
1156
- if (k) {
1155
+ const C = i.current;
1156
+ if (C) {
1157
1157
  try {
1158
- const N = new Nr(k);
1159
- a.current = N;
1160
- } catch (N) {
1161
- console.error("[ShaderRenderer] Failed to create WebGL2 context:", N);
1158
+ const P = new Ar(C);
1159
+ a.current = P;
1160
+ } catch (P) {
1161
+ console.error("[ShaderRenderer] Failed to create WebGL2 context:", P);
1162
1162
  }
1163
1163
  return () => {
1164
1164
  a.current && (a.current.destroy(), a.current = null);
1165
1165
  };
1166
1166
  }
1167
1167
  }, []), M(() => {
1168
- const k = a.current;
1169
- if (!(!k || !h) && f.current !== h)
1170
- if (k.compile(h, p))
1171
- f.current = h, g.current = p;
1168
+ const C = a.current;
1169
+ if (!(!C || !g) && d.current !== g)
1170
+ if (C.compile(g, m))
1171
+ d.current = g, h.current = m;
1172
1172
  else {
1173
- const L = k.getError();
1174
- console.error("[ShaderRenderer] Shader compilation failed:", L);
1173
+ const U = C.getError();
1174
+ console.error("[ShaderRenderer] Shader compilation failed:", U);
1175
1175
  }
1176
- }, [h, p]), M(() => {
1177
- const k = a.current;
1178
- !k || !f.current || xr(g.current, p) || (k.setCustomUniforms(p), g.current = p);
1179
- }, [p]), M(() => {
1180
- const k = a.current;
1181
- if (!k || !f.current) return;
1182
- const N = 1e3 / y, L = (P) => {
1183
- const F = P - d.current;
1184
- F >= N && (d.current = P - F % N, k.draw()), c.current = requestAnimationFrame(L);
1176
+ }, [g, m]), M(() => {
1177
+ const C = a.current;
1178
+ !C || !d.current || _r(h.current, m) || (C.setCustomUniforms(m), h.current = m);
1179
+ }, [m]), M(() => {
1180
+ const C = a.current;
1181
+ if (!C || !d.current) return;
1182
+ const P = 1e3 / y, U = (O) => {
1183
+ const F = O - f.current;
1184
+ F >= P && (f.current = O - F % P, C.draw()), c.current = requestAnimationFrame(U);
1185
1185
  };
1186
- return c.current = requestAnimationFrame(L), () => {
1186
+ return c.current = requestAnimationFrame(U), () => {
1187
1187
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
1188
1188
  };
1189
1189
  }, [y]);
1190
- const U = D(
1191
- (k) => {
1192
- if (!m) return;
1193
- const N = i.current, L = a.current;
1194
- if (!N || !L) return;
1195
- const P = N.getBoundingClientRect(), F = k.clientX - P.left, G = P.height - (k.clientY - P.top);
1196
- u.current.x = F, u.current.y = G, L.setMouse(F, G, u.current.clickX, u.current.clickY);
1190
+ const D = x(
1191
+ (C) => {
1192
+ if (!p) return;
1193
+ const P = i.current, U = a.current;
1194
+ if (!P || !U) return;
1195
+ const O = P.getBoundingClientRect(), F = C.clientX - O.left, W = O.height - (C.clientY - O.top);
1196
+ u.current.x = F, u.current.y = W, U.setMouse(F, W, u.current.clickX, u.current.clickY);
1197
1197
  },
1198
- [m]
1199
- ), X = D(
1200
- (k) => {
1201
- if (!m) return;
1202
- const N = i.current, L = a.current;
1203
- if (!N || !L) return;
1204
- const P = N.getBoundingClientRect(), F = k.clientX - P.left, G = P.height - (k.clientY - P.top);
1205
- u.current.isDown = !0, u.current.clickX = F, u.current.clickY = G, L.setMouse(F, G, F, G);
1198
+ [p]
1199
+ ), G = x(
1200
+ (C) => {
1201
+ if (!p) return;
1202
+ const P = i.current, U = a.current;
1203
+ if (!P || !U) return;
1204
+ const O = P.getBoundingClientRect(), F = C.clientX - O.left, W = O.height - (C.clientY - O.top);
1205
+ u.current.isDown = !0, u.current.clickX = F, u.current.clickY = W, U.setMouse(F, W, F, W);
1206
1206
  },
1207
- [m]
1208
- ), Q = D(() => {
1209
- m && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
1210
- }, [m]);
1211
- return s ? /* @__PURE__ */ E.jsx(
1207
+ [p]
1208
+ ), Z = x(() => {
1209
+ p && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
1210
+ }, [p]);
1211
+ return s ? /* @__PURE__ */ R.jsx(
1212
1212
  "canvas",
1213
1213
  {
1214
1214
  ref: i,
1215
1215
  "data-ikon-node-id": s.id,
1216
1216
  className: _,
1217
- ...v ? { width: v } : {},
1218
- ...A ? { height: A } : {},
1219
- onMouseMove: U,
1220
- onMouseDown: X,
1221
- onMouseUp: Q,
1222
- onMouseLeave: Q
1217
+ ...w ? { width: w } : {},
1218
+ ...T ? { height: T } : {},
1219
+ onMouseMove: D,
1220
+ onMouseDown: G,
1221
+ onMouseUp: Z,
1222
+ onMouseLeave: Z
1223
1223
  }
1224
1224
  ) : null;
1225
1225
  });
1226
1226
  return ({ type: e }) => {
1227
- if (e === Dr)
1227
+ if (e === Nr)
1228
1228
  return t;
1229
1229
  };
1230
1230
  }
1231
- const Br = "shader", $r = async () => Fr();
1232
- function Vr(t) {
1233
- t.registerModule(Br, $r);
1231
+ const jr = "shader", Lr = async () => Pr();
1232
+ function Mr(t) {
1233
+ t.registerModule(jr, Lr);
1234
1234
  }
1235
- const nt = Ee("UIRegistry");
1236
- class Kr {
1235
+ const Ze = ye("UIRegistry");
1236
+ class Ur {
1237
1237
  baseResolvers = [];
1238
1238
  moduleLoaders = /* @__PURE__ */ new Map();
1239
1239
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -1255,15 +1255,15 @@ class Kr {
1255
1255
  for (const [n, o] of this.moduleLoaders.entries())
1256
1256
  if (!this.moduleResolvers.has(n))
1257
1257
  try {
1258
- const s = await o(), i = zr(s);
1258
+ const s = await o(), i = Fr(s);
1259
1259
  this.moduleResolvers.set(n, i), e = !0;
1260
1260
  } catch (s) {
1261
- nt.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
1261
+ Ze.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
1262
1262
  }
1263
1263
  const r = [];
1264
1264
  for (const n of this.moduleLoaders.keys())
1265
1265
  this.moduleResolvers.has(n) && r.push(n);
1266
- return qr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
1266
+ return Br(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
1267
1267
  }
1268
1268
  resolve(e) {
1269
1269
  for (const r of this.baseResolvers) {
@@ -1273,7 +1273,7 @@ class Kr {
1273
1273
  for (const r of this.activeModuleOrder) {
1274
1274
  const n = this.moduleResolvers.get(r);
1275
1275
  if (!n) {
1276
- nt.warn(`Missing resolvers for module ${r}`);
1276
+ Ze.warn(`Missing resolvers for module ${r}`);
1277
1277
  continue;
1278
1278
  }
1279
1279
  for (const o of n) {
@@ -1283,17 +1283,17 @@ class Kr {
1283
1283
  }
1284
1284
  }
1285
1285
  }
1286
- function Wr() {
1287
- const t = new Kr();
1288
- return pr(t), Cr(t), Vr(t), t.loadRegisteredModules(), t;
1286
+ function xr() {
1287
+ const t = new Ur();
1288
+ return cr(t), wr(t), Mr(t), t.loadRegisteredModules(), t;
1289
1289
  }
1290
- function Yr(t) {
1290
+ function Dr(t) {
1291
1291
  return Array.isArray(t) ? t : [t];
1292
1292
  }
1293
- function zr(t) {
1294
- return t ? Yr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1293
+ function Fr(t) {
1294
+ return t ? Dr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1295
1295
  }
1296
- function qr(t, e) {
1296
+ function Br(t, e) {
1297
1297
  if (t.length !== e.length)
1298
1298
  return !1;
1299
1299
  for (let r = 0; r < t.length; r += 1)
@@ -1301,7 +1301,7 @@ function qr(t, e) {
1301
1301
  return !1;
1302
1302
  return !0;
1303
1303
  }
1304
- const Ie = Ee("MotionController"), ot = {
1304
+ const Ee = ye("MotionController"), Qe = {
1305
1305
  ease: [0.25, 0.1, 0.25, 1],
1306
1306
  "ease-in": [0.42, 0, 1, 1],
1307
1307
  "ease-out": [0, 0, 0.58, 1],
@@ -1331,88 +1331,88 @@ const Ie = Ee("MotionController"), ot = {
1331
1331
  "ease-out-back": [0.175, 0.885, 0.32, 1.275],
1332
1332
  "ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
1333
1333
  };
1334
- function B(t) {
1334
+ function $(t) {
1335
1335
  return t <= 0 ? 0 : t >= 1 ? 1 : t;
1336
1336
  }
1337
- function st(t) {
1337
+ function et(t) {
1338
1338
  if (t == null) return;
1339
1339
  const e = `${t}`.trim();
1340
1340
  if (!e) return;
1341
1341
  const r = Number.parseFloat(e);
1342
1342
  return Number.isFinite(r) ? r : void 0;
1343
1343
  }
1344
- function it(t) {
1344
+ function tt(t) {
1345
1345
  return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1346
1346
  }
1347
- function at(t, e, r, n) {
1348
- const f = new Float32Array(11);
1349
- function g(p, m, v) {
1350
- return ((3 * m - 3 * v + 1) * p + (3 * v - 6 * m)) * p * p + 3 * m * p;
1351
- }
1352
- function u(p, m, v) {
1353
- return 3 * (3 * m - 3 * v + 1) * p * p + 2 * (3 * v - 6 * m) * p + 3 * m;
1354
- }
1355
- function h(p, m) {
1356
- for (let v = 0; v < 4; v += 1) {
1357
- const A = u(m, t, r);
1358
- if (A === 0)
1359
- return m;
1360
- const _ = g(m, t, r) - p;
1361
- m -= _ / A;
1347
+ function rt(t, e, r, n) {
1348
+ const d = new Float32Array(11);
1349
+ function h(m, p, w) {
1350
+ return ((3 * p - 3 * w + 1) * m + (3 * w - 6 * p)) * m * m + 3 * p * m;
1351
+ }
1352
+ function u(m, p, w) {
1353
+ return 3 * (3 * p - 3 * w + 1) * m * m + 2 * (3 * w - 6 * p) * m + 3 * p;
1354
+ }
1355
+ function g(m, p) {
1356
+ for (let w = 0; w < 4; w += 1) {
1357
+ const T = u(p, t, r);
1358
+ if (T === 0)
1359
+ return p;
1360
+ const _ = h(p, t, r) - m;
1361
+ p -= _ / T;
1362
1362
  }
1363
- return m;
1363
+ return p;
1364
1364
  }
1365
- function y(p, m, v) {
1366
- let A = 0, _ = 0, U = 0;
1365
+ function y(m, p, w) {
1366
+ let T = 0, _ = 0, D = 0;
1367
1367
  do
1368
- _ = m + (v - m) / 2, A = g(_, t, r) - p, A > 0 ? v = _ : m = _;
1369
- while (Math.abs(A) > 1e-7 && ++U < 10);
1368
+ _ = p + (w - p) / 2, T = h(_, t, r) - m, T > 0 ? w = _ : p = _;
1369
+ while (Math.abs(T) > 1e-7 && ++D < 10);
1370
1370
  return _;
1371
1371
  }
1372
- function S(p) {
1373
- let m = 0, v = 1;
1374
- const A = 10;
1375
- for (; v !== A && f[v] <= p; v += 1)
1376
- m += 0.1;
1377
- v -= 1;
1378
- const _ = (p - f[v]) / (f[v + 1] - f[v]), U = m + _ * 0.1, X = u(U, t, r);
1379
- return X >= 1e-3 ? h(p, U) : X === 0 ? U : y(p, m, m + 0.1);
1372
+ function S(m) {
1373
+ let p = 0, w = 1;
1374
+ const T = 10;
1375
+ for (; w !== T && d[w] <= m; w += 1)
1376
+ p += 0.1;
1377
+ w -= 1;
1378
+ const _ = (m - d[w]) / (d[w + 1] - d[w]), D = p + _ * 0.1, G = u(D, t, r);
1379
+ return G >= 1e-3 ? g(m, D) : G === 0 ? D : y(m, p, p + 0.1);
1380
1380
  }
1381
- for (let p = 0; p < 11; p += 1)
1382
- f[p] = g(p * 0.1, t, r);
1383
- return (p) => p <= 0 ? 0 : p >= 1 ? 1 : g(S(p), e, n);
1381
+ for (let m = 0; m < 11; m += 1)
1382
+ d[m] = h(m * 0.1, t, r);
1383
+ return (m) => m <= 0 ? 0 : m >= 1 ? 1 : h(S(m), e, n);
1384
1384
  }
1385
- function Gr(t) {
1385
+ function $r(t) {
1386
1386
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
1387
1387
  if (!e)
1388
- return (o) => B(o);
1388
+ return (o) => $(o);
1389
1389
  const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
1390
- return n === "start" || n === "jump-start" ? (o) => B(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => B(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => B((Math.floor(o * r) + 0.5) / r) : (o) => B(Math.floor(o * r) / r);
1390
+ return n === "start" || n === "jump-start" ? (o) => $(Math.ceil(o * r) / r) : n === "none" || n === "jump-none" ? (o) => $(Math.round(o * r) / r) : n === "both" || n === "jump-both" ? (o) => $((Math.floor(o * r) + 0.5) / r) : (o) => $(Math.floor(o * r) / r);
1391
1391
  }
1392
- function Hr(t) {
1392
+ function Vr(t) {
1393
1393
  if (!t)
1394
- return (r) => B(r);
1394
+ return (r) => $(r);
1395
1395
  const e = t.trim().toLowerCase();
1396
1396
  if (!e || e === "linear")
1397
- return (r) => B(r);
1398
- if (ot[e]) {
1399
- const [r, n, o, s] = ot[e], i = at(r, n, o, s);
1400
- return (a) => B(i(B(a)));
1397
+ return (r) => $(r);
1398
+ if (Qe[e]) {
1399
+ const [r, n, o, s] = Qe[e], i = rt(r, n, o, s);
1400
+ return (a) => $(i($(a)));
1401
1401
  }
1402
1402
  if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
1403
1403
  const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
1404
1404
  if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
1405
- const [o, s, i, a] = n, c = at(o, s, i, a);
1406
- return (d) => B(c(B(d)));
1405
+ const [o, s, i, a] = n, c = rt(o, s, i, a);
1406
+ return (f) => $(c($(f)));
1407
1407
  }
1408
1408
  }
1409
1409
  if (e.startsWith("steps(") && e.endsWith(")")) {
1410
- const r = Gr(e);
1411
- return (n) => r(B(n));
1410
+ const r = $r(e);
1411
+ return (n) => r($(n));
1412
1412
  }
1413
- return (r) => B(r);
1413
+ return (r) => $(r);
1414
1414
  }
1415
- function Jr(t) {
1415
+ function Kr(t) {
1416
1416
  if (!t)
1417
1417
  return;
1418
1418
  const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
@@ -1422,7 +1422,7 @@ function Jr(t) {
1422
1422
  if (![r, n, o, s].some((i) => !Number.isFinite(i)))
1423
1423
  return { inStart: r, inEnd: n, outStart: o, outEnd: s };
1424
1424
  }
1425
- class Xr {
1425
+ class Wr {
1426
1426
  bindingsByStyle = /* @__PURE__ */ new Map();
1427
1427
  observer;
1428
1428
  observeScheduled = !1;
@@ -1449,7 +1449,7 @@ class Xr {
1449
1449
  try {
1450
1450
  e();
1451
1451
  } catch (r) {
1452
- Ie.warn("Failed to cleanup binding listener", r);
1452
+ Ee.warn("Failed to cleanup binding listener", r);
1453
1453
  }
1454
1454
  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);
1455
1455
  }
@@ -1459,7 +1459,7 @@ class Xr {
1459
1459
  const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
1460
1460
  return n.length === 0 ? void 0 : { bindings: n };
1461
1461
  } catch (r) {
1462
- Ie.warn("Failed to parse motion metadata", r);
1462
+ Ee.warn("Failed to parse motion metadata", r);
1463
1463
  return;
1464
1464
  }
1465
1465
  }
@@ -1467,7 +1467,7 @@ class Xr {
1467
1467
  const r = e.source?.trim();
1468
1468
  if (!r)
1469
1469
  return;
1470
- const n = st(e.min) ?? 0, o = st(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Hr(e.ease), d = Jr(e.map), f = e.targetId?.trim() || void 0;
1470
+ const n = et(e.min) ?? 0, o = et(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Vr(e.ease), f = Kr(e.map), d = e.targetId?.trim() || void 0;
1471
1471
  return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
1472
1472
  source: r.toLowerCase(),
1473
1473
  min: n,
@@ -1475,8 +1475,8 @@ class Xr {
1475
1475
  clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
1476
1476
  reverse: a,
1477
1477
  ease: c,
1478
- map: d,
1479
- targetId: f
1478
+ map: f,
1479
+ targetId: d
1480
1480
  };
1481
1481
  }
1482
1482
  ensureObserver() {
@@ -1525,7 +1525,7 @@ class Xr {
1525
1525
  const r = this.bindingsByStyle.get(e);
1526
1526
  if (!r || typeof document > "u")
1527
1527
  return;
1528
- const n = `.${it(e)}`;
1528
+ const n = `.${tt(e)}`;
1529
1529
  document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
1530
1530
  }
1531
1531
  applyStyleToElement(e, r, n) {
@@ -1565,7 +1565,7 @@ class Xr {
1565
1565
  }
1566
1566
  resolveScrollContainer(e, r) {
1567
1567
  if (r.targetId) {
1568
- const n = `[data-ikon-motion-source="${it(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
1568
+ const n = `[data-ikon-motion-source="${tt(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
1569
1569
  if (o)
1570
1570
  return o;
1571
1571
  }
@@ -1575,10 +1575,10 @@ class Xr {
1575
1575
  const o = r.max - r.min, s = o === 0 ? n > r.min ? 1 : 0 : (n - r.min) / o;
1576
1576
  let i = this.applyClamp(s, r.clamp);
1577
1577
  r.reverse && (i = 1 - i);
1578
- const a = r.ease(i), c = Number.isFinite(a) ? a : 0, d = c * 100;
1579
- if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), r.map) {
1580
- const f = this.applyMap(d, r.map);
1581
- f !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${f}`);
1578
+ const a = r.ease(i), c = Number.isFinite(a) ? a : 0, f = c * 100;
1579
+ if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${f}`), r.map) {
1580
+ const d = this.applyMap(f, r.map);
1581
+ d !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${d}`);
1582
1582
  } else
1583
1583
  e.style.removeProperty("--tw-motion-bind-value");
1584
1584
  }
@@ -1593,7 +1593,7 @@ class Xr {
1593
1593
  case "unclamped":
1594
1594
  return e;
1595
1595
  default:
1596
- return B(e);
1596
+ return $(e);
1597
1597
  }
1598
1598
  }
1599
1599
  applyMap(e, r) {
@@ -1635,7 +1635,7 @@ class Xr {
1635
1635
  try {
1636
1636
  i();
1637
1637
  } catch (a) {
1638
- Ie.warn("Failed to cleanup listener", a);
1638
+ Ee.warn("Failed to cleanup listener", a);
1639
1639
  }
1640
1640
  this.globalCleanups.delete(i);
1641
1641
  }
@@ -1680,29 +1680,29 @@ class Xr {
1680
1680
  }
1681
1681
  }
1682
1682
  }
1683
- const Oe = new Xr();
1684
- function Zr(t) {
1685
- const e = w(/* @__PURE__ */ new Map()), r = D(({ styleId: s, css: i, common: a }) => {
1683
+ const Ae = new Wr();
1684
+ function Yr(t) {
1685
+ const e = A(/* @__PURE__ */ new Map()), r = x(({ styleId: s, css: i, common: a }) => {
1686
1686
  if (!(!s || typeof document > "u")) {
1687
1687
  if (i) {
1688
1688
  let c = e.current.get(s);
1689
1689
  c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
1690
1690
  }
1691
- Oe.registerStyle(s, a);
1691
+ Ae.registerStyle(s, a);
1692
1692
  }
1693
- }, []), n = D((s) => {
1693
+ }, []), n = x((s) => {
1694
1694
  if (!(typeof document > "u"))
1695
1695
  for (const i of s) {
1696
1696
  const a = e.current.get(i);
1697
- a && (a.remove(), e.current.delete(i)), Oe.unregisterStyle(i);
1697
+ a && (a.remove(), e.current.delete(i)), Ae.unregisterStyle(i);
1698
1698
  }
1699
- }, []), o = D(() => {
1699
+ }, []), o = x(() => {
1700
1700
  if (typeof document < "u") {
1701
1701
  for (const s of e.current.values())
1702
1702
  s.remove();
1703
1703
  e.current.clear();
1704
1704
  }
1705
- Oe.reset();
1705
+ Ae.reset();
1706
1706
  }, []);
1707
1707
  return M(() => {
1708
1708
  if (!t) return;
@@ -1714,7 +1714,7 @@ function Zr(t) {
1714
1714
  };
1715
1715
  }, [t, o, r, n]), M(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
1716
1716
  }
1717
- function Qr(t) {
1717
+ function zr(t) {
1718
1718
  const e = [];
1719
1719
  for (const [r, n] of t) {
1720
1720
  const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
@@ -1722,62 +1722,62 @@ function Qr(t) {
1722
1722
  }
1723
1723
  return e.sort(), e.join(",");
1724
1724
  }
1725
- function en(t) {
1726
- const [e, r] = z(), n = w("");
1725
+ function qr(t) {
1726
+ const [e, r] = Y(), n = A("");
1727
1727
  return M(() => {
1728
1728
  if (!t) {
1729
1729
  r(void 0), n.current = "";
1730
1730
  return;
1731
1731
  }
1732
1732
  const o = () => {
1733
- const s = t.getStores(), i = Qr(s);
1733
+ const s = t.getStores(), i = zr(s);
1734
1734
  i !== n.current && (n.current = i, r(s));
1735
1735
  };
1736
1736
  return o(), t.subscribe(o);
1737
1737
  }, [t]), e;
1738
1738
  }
1739
- var tn = typeof global == "object" && global && global.Object === Object && global, rn = typeof self == "object" && self && self.Object === Object && self, nn = tn || rn || Function("return this")(), ve = nn.Symbol, bt = Object.prototype, on = bt.hasOwnProperty, sn = bt.toString, le = ve ? ve.toStringTag : void 0;
1740
- function an(t) {
1741
- var e = on.call(t, le), r = t[le];
1739
+ var Gr = typeof global == "object" && global && global.Object === Object && global, Hr = typeof self == "object" && self && self.Object === Object && self, Jr = Gr || Hr || Function("return this")(), pe = Jr.Symbol, mt = Object.prototype, Xr = mt.hasOwnProperty, Zr = mt.toString, ae = pe ? pe.toStringTag : void 0;
1740
+ function Qr(t) {
1741
+ var e = Xr.call(t, ae), r = t[ae];
1742
1742
  try {
1743
- t[le] = void 0;
1743
+ t[ae] = void 0;
1744
1744
  var n = !0;
1745
1745
  } catch {
1746
1746
  }
1747
- var o = sn.call(t);
1748
- return n && (e ? t[le] = r : delete t[le]), o;
1747
+ var o = Zr.call(t);
1748
+ return n && (e ? t[ae] = r : delete t[ae]), o;
1749
1749
  }
1750
- var cn = Object.prototype, un = cn.toString;
1751
- function ln(t) {
1752
- return un.call(t);
1750
+ var en = Object.prototype, tn = en.toString;
1751
+ function rn(t) {
1752
+ return tn.call(t);
1753
1753
  }
1754
- var dn = "[object Null]", fn = "[object Undefined]", ct = ve ? ve.toStringTag : void 0;
1755
- function hn(t) {
1756
- return t == null ? t === void 0 ? fn : dn : ct && ct in Object(t) ? an(t) : ln(t);
1754
+ var nn = "[object Null]", on = "[object Undefined]", nt = pe ? pe.toStringTag : void 0;
1755
+ function sn(t) {
1756
+ return t == null ? t === void 0 ? on : nn : nt && nt in Object(t) ? Qr(t) : rn(t);
1757
1757
  }
1758
- function mn(t) {
1758
+ function an(t) {
1759
1759
  return t != null && typeof t == "object";
1760
1760
  }
1761
- var pn = Array.isArray, gn = "[object String]";
1762
- function yn(t) {
1763
- return typeof t == "string" || !pn(t) && mn(t) && hn(t) == gn;
1761
+ var cn = Array.isArray, un = "[object String]";
1762
+ function ln(t) {
1763
+ return typeof t == "string" || !cn(t) && an(t) && sn(t) == un;
1764
1764
  }
1765
- const ut = "ikonUiModules";
1766
- function Fe(t) {
1765
+ const ot = "ikonUiModules";
1766
+ function Le(t) {
1767
1767
  return typeof t == "object" && t !== null && !Array.isArray(t);
1768
1768
  }
1769
- function Sn(t) {
1769
+ function dn(t) {
1770
1770
  if (!Array.isArray(t))
1771
1771
  return;
1772
1772
  const e = /* @__PURE__ */ new Set();
1773
1773
  for (const r of t) {
1774
- if (!yn(r)) continue;
1774
+ if (!ln(r)) continue;
1775
1775
  const n = r.trim();
1776
1776
  n && (e.has(n) || e.add(n));
1777
1777
  }
1778
1778
  return Array.from(e);
1779
1779
  }
1780
- function So(t, e) {
1780
+ function lo(t, e) {
1781
1781
  if (t === e)
1782
1782
  return !0;
1783
1783
  if (!t || !e)
@@ -1789,19 +1789,19 @@ function So(t, e) {
1789
1789
  return !1;
1790
1790
  return !0;
1791
1791
  }
1792
- function bn(t) {
1793
- if (!(!Fe(t) || !Object.prototype.hasOwnProperty.call(t, ut)))
1794
- return Sn(t[ut]);
1792
+ function fn(t) {
1793
+ if (!(!Le(t) || !Object.prototype.hasOwnProperty.call(t, ot)))
1794
+ return dn(t[ot]);
1795
1795
  }
1796
- function bo(...t) {
1796
+ function fo(...t) {
1797
1797
  for (const e of t) {
1798
- const r = bn(e);
1798
+ const r = fn(e);
1799
1799
  if (r !== void 0)
1800
1800
  return r;
1801
1801
  }
1802
1802
  }
1803
- function wo(t) {
1804
- if (!Fe(t))
1803
+ function ho(t) {
1804
+ if (!Le(t))
1805
1805
  return;
1806
1806
  const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
1807
1807
  if (!r)
@@ -1820,38 +1820,38 @@ function wo(t) {
1820
1820
  o.push(S), i.add(S);
1821
1821
  continue;
1822
1822
  }
1823
- if (!Fe(c))
1823
+ if (!Le(c))
1824
1824
  continue;
1825
- const d = c, f = Object.keys(d).find((S) => S.toLowerCase() === "name");
1826
- if (!f)
1825
+ const f = c, d = Object.keys(f).find((S) => S.toLowerCase() === "name");
1826
+ if (!d)
1827
1827
  continue;
1828
- const g = d[f];
1829
- if (typeof g != "string")
1828
+ const h = f[d];
1829
+ if (typeof h != "string")
1830
1830
  continue;
1831
- const u = g.trim();
1831
+ const u = h.trim();
1832
1832
  if (!u)
1833
1833
  continue;
1834
- const h = Object.keys(d).find((S) => S.toLowerCase() === "javascript"), y = h ? d[h] : void 0;
1834
+ const g = Object.keys(f).find((S) => S.toLowerCase() === "javascript"), y = g ? f[g] : void 0;
1835
1835
  typeof y == "string" && s.set(u, y), i.has(u) || (o.push(u), i.add(u));
1836
1836
  }
1837
1837
  if (!o.length && s.size === 0)
1838
1838
  return { modules: [] };
1839
- const a = Array.from(s.entries()).map(([c, d]) => ({
1839
+ const a = Array.from(s.entries()).map(([c, f]) => ({
1840
1840
  name: c,
1841
- javascript: d
1841
+ javascript: f
1842
1842
  }));
1843
1843
  return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
1844
1844
  }
1845
- const R = {
1845
+ const v = {
1846
1846
  None: 0,
1847
1847
  Letter: 1,
1848
1848
  Word: 2,
1849
1849
  Line: 4,
1850
1850
  Paragraph: 8,
1851
1851
  Emoji: 16
1852
- }, wn = [
1852
+ }, hn = [
1853
1853
  {
1854
- flag: R.Letter,
1854
+ flag: v.Letter,
1855
1855
  hints: [
1856
1856
  "[data-motion-letter]",
1857
1857
  "[data-letter]",
@@ -1860,7 +1860,7 @@ const R = {
1860
1860
  ]
1861
1861
  },
1862
1862
  {
1863
- flag: R.Word,
1863
+ flag: v.Word,
1864
1864
  hints: [
1865
1865
  "[data-motion-word]",
1866
1866
  "[data-word]",
@@ -1869,7 +1869,7 @@ const R = {
1869
1869
  ]
1870
1870
  },
1871
1871
  {
1872
- flag: R.Line,
1872
+ flag: v.Line,
1873
1873
  hints: [
1874
1874
  "[data-motion-line]",
1875
1875
  "[data-line]",
@@ -1878,7 +1878,7 @@ const R = {
1878
1878
  ]
1879
1879
  },
1880
1880
  {
1881
- flag: R.Paragraph,
1881
+ flag: v.Paragraph,
1882
1882
  hints: [
1883
1883
  "[data-motion-paragraph]",
1884
1884
  "[data-paragraph]",
@@ -1889,7 +1889,7 @@ const R = {
1889
1889
  ]
1890
1890
  },
1891
1891
  {
1892
- flag: R.Emoji,
1892
+ flag: v.Emoji,
1893
1893
  hints: [
1894
1894
  ":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
1895
1895
  "[data-motion-emoji]",
@@ -1898,42 +1898,42 @@ const R = {
1898
1898
  "[data-emoji]"
1899
1899
  ]
1900
1900
  }
1901
- ], Be = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, vn = R.Letter | R.Word | R.Line | R.Paragraph, lt = /* @__PURE__ */ new Map(), Rn = 16384;
1902
- function vo(t, e) {
1903
- if (!t || t.length > Rn)
1901
+ ], Me = v.Letter | v.Word | v.Line | v.Paragraph | v.Emoji, mn = v.Letter | v.Word | v.Line | v.Paragraph, st = /* @__PURE__ */ new Map(), pn = 16384;
1902
+ function mo(t, e) {
1903
+ if (!t || t.length > pn)
1904
1904
  return t;
1905
- const r = Fn(e), n = ne(r, R.Emoji), o = r & vn;
1906
- if (o === R.None && !n)
1905
+ const r = Pn(e), n = ne(r, v.Emoji), o = r & mn;
1906
+ if (o === v.None && !n)
1907
1907
  return t;
1908
1908
  const s = t.replace(/\r\n/g, `
1909
1909
  `).replace(/\r/g, `
1910
1910
  `);
1911
- if (o === R.None)
1912
- return mt(s);
1913
- const i = xn(s);
1911
+ if (o === v.None)
1912
+ return ut(s);
1913
+ const i = _n(s);
1914
1914
  if (i.length === 0)
1915
- return n ? mt(s) : t;
1916
- const a = Dn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
1917
- for (const f of a) {
1918
- const g = En(f, r, c);
1919
- d.push(...g);
1915
+ return n ? ut(s) : t;
1916
+ const a = Nn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, f = [];
1917
+ for (const d of a) {
1918
+ const h = gn(d, r, c);
1919
+ f.push(...h);
1920
1920
  }
1921
- return d;
1921
+ return f;
1922
1922
  }
1923
- function En(t, e, r) {
1923
+ function gn(t, e, r) {
1924
1924
  const n = [];
1925
1925
  for (const o of t) {
1926
- const s = An(o, e, r);
1926
+ const s = yn(o, e, r);
1927
1927
  n.push(...s);
1928
1928
  }
1929
- if (ne(e, R.Paragraph)) {
1929
+ if (ne(e, v.Paragraph)) {
1930
1930
  const o = r.paragraph++;
1931
1931
  return [
1932
- /* @__PURE__ */ E.jsx(
1932
+ /* @__PURE__ */ R.jsx(
1933
1933
  "span",
1934
1934
  {
1935
1935
  "data-motion-paragraph": !0,
1936
- style: Ae(o),
1936
+ style: Se(o),
1937
1937
  children: n
1938
1938
  },
1939
1939
  `motion-paragraph-${o}`
@@ -1942,116 +1942,116 @@ function En(t, e, r) {
1942
1942
  }
1943
1943
  return n;
1944
1944
  }
1945
- function An(t, e, r) {
1946
- const n = Tn(t.text, e, r), o = [];
1947
- if (ne(e, R.Line)) {
1945
+ function yn(t, e, r) {
1946
+ const n = Sn(t.text, e, r), o = [];
1947
+ if (ne(e, v.Line)) {
1948
1948
  const s = r.line++;
1949
1949
  o.push(
1950
- /* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ae(s), children: n }, `motion-line-${s}`)
1950
+ /* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style: Se(s), children: n }, `motion-line-${s}`)
1951
1951
  );
1952
1952
  } else
1953
1953
  o.push(...n);
1954
1954
  for (let s = 0; s < t.breaks; s++)
1955
- o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${r.br++}`));
1955
+ o.push(/* @__PURE__ */ R.jsx("br", {}, `motion-break-${r.br++}`));
1956
1956
  return o;
1957
1957
  }
1958
- function Tn(t, e, r) {
1958
+ function Sn(t, e, r) {
1959
1959
  if (!t)
1960
1960
  return [];
1961
- const n = ne(e, R.Word), o = [], s = /(\s+)/g;
1961
+ const n = ne(e, v.Word), o = [], s = /(\s+)/g;
1962
1962
  let i = 0, a;
1963
1963
  for (; (a = s.exec(t)) !== null; ) {
1964
1964
  if (a.index > i) {
1965
1965
  const c = t.slice(i, a.index);
1966
- o.push(dt(c, r, e, n));
1966
+ o.push(it(c, r, e, n));
1967
1967
  }
1968
1968
  o.push(a[0]), i = a.index + a[0].length;
1969
1969
  }
1970
1970
  if (i < t.length) {
1971
1971
  const c = t.slice(i);
1972
- o.push(dt(c, r, e, n));
1972
+ o.push(it(c, r, e, n));
1973
1973
  }
1974
1974
  return o;
1975
1975
  }
1976
- function dt(t, e, r, n) {
1977
- const o = e.word++, s = Cn(t, r, e), i = `motion-word-${o}`, a = kn(o, n);
1978
- return n ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
1976
+ function it(t, e, r, n) {
1977
+ const o = e.word++, s = wn(t, r, e), i = `motion-word-${o}`, a = bn(o, n);
1978
+ return n ? /* @__PURE__ */ R.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ R.jsx("span", { style: a, children: s }, i);
1979
1979
  }
1980
- function kn(t, e) {
1981
- return e ? { ...Ae(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
1980
+ function bn(t, e) {
1981
+ return e ? { ...Se(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
1982
1982
  }
1983
- function Cn(t, e, r) {
1983
+ function wn(t, e, r) {
1984
1984
  if (!t)
1985
1985
  return [];
1986
- const n = ne(e, R.Letter), o = ne(e, R.Emoji);
1986
+ const n = ne(e, v.Letter), o = ne(e, v.Emoji);
1987
1987
  if (!n) {
1988
1988
  if (!o)
1989
1989
  return [t];
1990
- const a = $e(t);
1990
+ const a = Ue(t);
1991
1991
  if (a.length === 0)
1992
1992
  return [t];
1993
- const { nodes: c } = vt(a, r);
1993
+ const { nodes: c } = gt(a, r);
1994
1994
  return c;
1995
1995
  }
1996
- const s = [], i = $e(t);
1996
+ const s = [], i = Ue(t);
1997
1997
  for (const a of i) {
1998
- const c = r.letter++, d = `motion-letter-${c}`, f = Ae(c);
1998
+ const c = r.letter++, f = `motion-letter-${c}`, d = Se(c);
1999
1999
  if (a === `
2000
2000
  `) {
2001
2001
  s.push(
2002
- /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, children: /* @__PURE__ */ E.jsx("br", {}) }, d)
2002
+ /* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, children: /* @__PURE__ */ R.jsx("br", {}) }, f)
2003
2003
  );
2004
2004
  continue;
2005
2005
  }
2006
- const u = o && wt(a) ? { "data-motion-emoji": !0 } : void 0, h = a === " " ? " " : a;
2006
+ const u = o && pt(a) ? { "data-motion-emoji": !0 } : void 0, g = a === " " ? " " : a;
2007
2007
  s.push(
2008
- /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, ...u, children: h }, d)
2008
+ /* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, ...u, children: g }, f)
2009
2009
  );
2010
2010
  }
2011
2011
  return s;
2012
2012
  }
2013
- function $e(t) {
2013
+ function Ue(t) {
2014
2014
  if (!t)
2015
2015
  return [];
2016
- const e = In();
2017
- return e ? Array.from(e.segment(t), (r) => r.segment) : On(t);
2016
+ const e = vn();
2017
+ return e ? Array.from(e.segment(t), (r) => r.segment) : Rn(t);
2018
2018
  }
2019
- let de;
2020
- function In() {
2021
- return de !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? de = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : de = null), de;
2019
+ let ce;
2020
+ function vn() {
2021
+ return ce !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? ce = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : ce = null), ce;
2022
2022
  }
2023
- function On(t) {
2023
+ function Rn(t) {
2024
2024
  const e = [], r = Array.from(t);
2025
2025
  let n = "";
2026
2026
  for (let o = 0; o < r.length; o++) {
2027
2027
  const s = r[o], i = r[o + 1];
2028
- n += s, !(i && _n(s, i)) && (e.push(n), n = "");
2028
+ n += s, !(i && En(s, i)) && (e.push(n), n = "");
2029
2029
  }
2030
2030
  return n && e.push(n), e;
2031
2031
  }
2032
- function _n(t, e) {
2033
- return e ? !!(ft(t) || ft(e) || jn(e) || Nn(e) || Pn(e) || ht(t) && ht(e)) : !1;
2032
+ function En(t, e) {
2033
+ return e ? !!(at(t) || at(e) || kn(e) || An(e) || Tn(e) || ct(t) && ct(e)) : !1;
2034
2034
  }
2035
- function ft(t) {
2035
+ function at(t) {
2036
2036
  return t.codePointAt(0) === 8205;
2037
2037
  }
2038
- function Nn(t) {
2038
+ function An(t) {
2039
2039
  const e = t.codePointAt(0);
2040
2040
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
2041
2041
  }
2042
- function Pn(t) {
2042
+ function Tn(t) {
2043
2043
  const e = t.codePointAt(0);
2044
2044
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
2045
2045
  }
2046
- function ht(t) {
2046
+ function ct(t) {
2047
2047
  const e = t.codePointAt(0);
2048
2048
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
2049
2049
  }
2050
- let _e;
2051
- function jn(t) {
2052
- return t ? (_e || (_e = Ln()), _e(t)) : !1;
2050
+ let Te;
2051
+ function kn(t) {
2052
+ return t ? (Te || (Te = Cn()), Te(t)) : !1;
2053
2053
  }
2054
- function Ln() {
2054
+ function Cn() {
2055
2055
  try {
2056
2056
  const t = new RegExp("\\p{Mark}", "u");
2057
2057
  return (e) => t.test(e);
@@ -2062,19 +2062,19 @@ function Ln() {
2062
2062
  };
2063
2063
  }
2064
2064
  }
2065
- let Ne;
2066
- function wt(t) {
2067
- return t ? (Ne || (Ne = Mn()), Ne(t)) : !1;
2065
+ let ke;
2066
+ function pt(t) {
2067
+ return t ? (ke || (ke = In()), ke(t)) : !1;
2068
2068
  }
2069
- function Mn() {
2069
+ function In() {
2070
2070
  try {
2071
2071
  const t = new RegExp("\\p{Extended_Pictographic}", "u");
2072
2072
  return (e) => t.test(e);
2073
2073
  } catch {
2074
- return Un;
2074
+ return On;
2075
2075
  }
2076
2076
  }
2077
- function Un(t) {
2077
+ function On(t) {
2078
2078
  if (!t)
2079
2079
  return !1;
2080
2080
  for (const e of Array.from(t)) {
@@ -2084,7 +2084,7 @@ function Un(t) {
2084
2084
  }
2085
2085
  return !1;
2086
2086
  }
2087
- function xn(t) {
2087
+ function _n(t) {
2088
2088
  const e = [];
2089
2089
  let r = "", n = 0;
2090
2090
  for (let o = 0; o < t.length; o++) {
@@ -2098,7 +2098,7 @@ function xn(t) {
2098
2098
  }
2099
2099
  return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
2100
2100
  }
2101
- function Dn(t) {
2101
+ function Nn(t) {
2102
2102
  if (t.length === 0)
2103
2103
  return [];
2104
2104
  const e = [];
@@ -2110,7 +2110,7 @@ function Dn(t) {
2110
2110
  function ne(t, e) {
2111
2111
  return (t & e) === e;
2112
2112
  }
2113
- function Ae(t) {
2113
+ function Se(t) {
2114
2114
  return {
2115
2115
  "--tw-motion-seq-index": t.toString(),
2116
2116
  backgroundColor: "inherit",
@@ -2127,27 +2127,27 @@ function Ae(t) {
2127
2127
  WebkitTextFillColor: "inherit"
2128
2128
  };
2129
2129
  }
2130
- function mt(t) {
2130
+ function ut(t) {
2131
2131
  if (!t)
2132
2132
  return t;
2133
- const e = $e(t);
2133
+ const e = Ue(t);
2134
2134
  if (e.length === 0)
2135
2135
  return t;
2136
- const { nodes: r, sawEmoji: n } = vt(e);
2136
+ const { nodes: r, sawEmoji: n } = gt(e);
2137
2137
  return n ? r.length === 1 ? r[0] ?? t : r : t;
2138
2138
  }
2139
- function vt(t, e) {
2139
+ function gt(t, e) {
2140
2140
  const r = [];
2141
2141
  let n = "", o = !1, s = e?.emoji ?? 0;
2142
2142
  const i = () => {
2143
2143
  n && (r.push(n), n = "");
2144
2144
  };
2145
2145
  for (const a of t) {
2146
- if (wt(a)) {
2146
+ if (pt(a)) {
2147
2147
  o = !0, i();
2148
- const d = `motion-emoji-${e ? e.emoji++ : s++}`;
2148
+ const f = `motion-emoji-${e ? e.emoji++ : s++}`;
2149
2149
  r.push(
2150
- /* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, d)
2150
+ /* @__PURE__ */ R.jsx("span", { "data-motion-emoji": !0, children: a }, f)
2151
2151
  );
2152
2152
  continue;
2153
2153
  }
@@ -2155,56 +2155,56 @@ function vt(t, e) {
2155
2155
  }
2156
2156
  return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
2157
2157
  }
2158
- function Fn(t) {
2158
+ function Pn(t) {
2159
2159
  if (!t)
2160
- return R.None;
2160
+ return v.None;
2161
2161
  const e = t.trim();
2162
2162
  if (!e)
2163
- return R.None;
2164
- const r = lt.get(e);
2163
+ return v.None;
2164
+ const r = st.get(e);
2165
2165
  if (typeof r == "number")
2166
2166
  return r;
2167
2167
  if (typeof document > "u")
2168
- return R.None;
2168
+ return v.None;
2169
2169
  const n = e.split(/\s+/).filter(Boolean);
2170
2170
  if (n.length === 0)
2171
- return R.None;
2172
- const s = n.map((c) => `.${Bn(c)}`).map(
2173
- (c) => new RegExp(`(^|[^a-zA-Z0-9_-])${$n(c)}(?![a-zA-Z0-9_-])`)
2171
+ return v.None;
2172
+ const s = n.map((c) => `.${jn(c)}`).map(
2173
+ (c) => new RegExp(`(^|[^a-zA-Z0-9_-])${Ln(c)}(?![a-zA-Z0-9_-])`)
2174
2174
  );
2175
- let i = R.None, a = !1;
2175
+ let i = v.None, a = !1;
2176
2176
  for (const c of Array.from(document.styleSheets)) {
2177
- let d;
2177
+ let f;
2178
2178
  try {
2179
- d = c.cssRules;
2179
+ f = c.cssRules;
2180
2180
  } catch {
2181
2181
  continue;
2182
2182
  }
2183
- const f = Rt(d, s);
2184
- if (f.mask && (i |= f.mask, i === Be))
2183
+ const d = yt(f, s);
2184
+ if (d.mask && (i |= d.mask, i === Me))
2185
2185
  break;
2186
- a ||= f.sawStyleRule;
2186
+ a ||= d.sawStyleRule;
2187
2187
  }
2188
- return (i !== R.None || a) && lt.set(e, i), i;
2188
+ return (i !== v.None || a) && st.set(e, i), i;
2189
2189
  }
2190
- function Rt(t, e) {
2190
+ function yt(t, e) {
2191
2191
  if (!t)
2192
- return { mask: R.None, sawStyleRule: !1 };
2193
- let r = R.None, n = !1;
2192
+ return { mask: v.None, sawStyleRule: !1 };
2193
+ let r = v.None, n = !1;
2194
2194
  for (let o = 0; o < t.length; o++) {
2195
2195
  const s = t[o];
2196
2196
  if (s) {
2197
2197
  if (s.type === CSSRule.STYLE_RULE) {
2198
2198
  const a = s.selectorText ?? "";
2199
- if (!a || !e.some((d) => d.test(a))) continue;
2199
+ if (!a || !e.some((f) => f.test(a))) continue;
2200
2200
  n = !0;
2201
- for (const d of wn)
2202
- d.hints.some((f) => a.includes(f)) && (r |= d.flag);
2203
- if (r === Be)
2201
+ for (const f of hn)
2202
+ f.hints.some((d) => a.includes(d)) && (r |= f.flag);
2203
+ if (r === Me)
2204
2204
  return { mask: r, sawStyleRule: !0 };
2205
2205
  } else if ("cssRules" in s) {
2206
- const i = Rt(s.cssRules, e);
2207
- if (i.mask && (r |= i.mask, r === Be))
2206
+ const i = yt(s.cssRules, e);
2207
+ if (i.mask && (r |= i.mask, r === Me))
2208
2208
  return { mask: r, sawStyleRule: !0 };
2209
2209
  n ||= i.sawStyleRule;
2210
2210
  }
@@ -2212,38 +2212,38 @@ function Rt(t, e) {
2212
2212
  }
2213
2213
  return { mask: r, sawStyleRule: n };
2214
2214
  }
2215
- function Bn(t) {
2215
+ function jn(t) {
2216
2216
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2217
2217
  }
2218
- function $n(t) {
2218
+ function Ln(t) {
2219
2219
  return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2220
2220
  }
2221
- const ze = "ikon_auth_session", Vn = 7 * 24 * 60 * 60 * 1e3;
2222
- function Te(t) {
2221
+ const $e = "ikon_auth_session", Mn = 7 * 24 * 60 * 60 * 1e3;
2222
+ function be(t) {
2223
2223
  try {
2224
- localStorage.setItem(ze, JSON.stringify(t));
2224
+ localStorage.setItem($e, JSON.stringify(t));
2225
2225
  } catch {
2226
2226
  console.warn("Failed to save auth session to localStorage");
2227
2227
  }
2228
2228
  }
2229
- function Et() {
2229
+ function St() {
2230
2230
  try {
2231
- const t = localStorage.getItem(ze);
2231
+ const t = localStorage.getItem($e);
2232
2232
  if (!t) return null;
2233
2233
  const e = JSON.parse(t);
2234
- return Date.now() - e.authenticatedAt > Vn ? (At(), null) : e;
2234
+ return Date.now() - e.authenticatedAt > Mn ? (bt(), null) : e;
2235
2235
  } catch {
2236
2236
  return console.warn("Failed to load auth session from localStorage"), null;
2237
2237
  }
2238
2238
  }
2239
- function At() {
2239
+ function bt() {
2240
2240
  try {
2241
- localStorage.removeItem(ze);
2241
+ localStorage.removeItem($e);
2242
2242
  } catch {
2243
2243
  console.warn("Failed to clear auth session from localStorage");
2244
2244
  }
2245
2245
  }
2246
- function fe(t) {
2246
+ function ue(t) {
2247
2247
  return {
2248
2248
  id: "",
2249
2249
  provider: t.provider,
@@ -2251,8 +2251,8 @@ function fe(t) {
2251
2251
  authenticatedAt: t.authenticatedAt
2252
2252
  };
2253
2253
  }
2254
- async function Tt(t, e) {
2255
- const r = be(), n = await fetch(`${e}/anonymous`, {
2254
+ async function wt(t, e) {
2255
+ const r = he(), n = await fetch(`${e}/anonymous`, {
2256
2256
  method: "POST",
2257
2257
  headers: { "Content-Type": "application/json" },
2258
2258
  body: JSON.stringify({ deviceId: r, space: t })
@@ -2266,9 +2266,9 @@ async function Tt(t, e) {
2266
2266
  provider: "anonymous",
2267
2267
  authenticatedAt: Date.now()
2268
2268
  };
2269
- return Te(s), s;
2269
+ return be(s), s;
2270
2270
  }
2271
- async function Ro(t) {
2271
+ async function po(t) {
2272
2272
  const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
2273
2273
  method: "POST",
2274
2274
  headers: { "Content-Type": "application/json" },
@@ -2283,22 +2283,22 @@ async function Ro(t) {
2283
2283
  throw new Error(i);
2284
2284
  }
2285
2285
  }
2286
- function Kn() {
2286
+ function Un() {
2287
2287
  const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
2288
2288
  return e && r ? { token: e, provider: r } : null;
2289
2289
  }
2290
- function Wn() {
2290
+ function xn() {
2291
2291
  const e = new URLSearchParams(window.location.search).get("error");
2292
2292
  return e ? decodeURIComponent(e) : null;
2293
2293
  }
2294
- function pt() {
2294
+ function lt() {
2295
2295
  window.history.replaceState({}, "", window.location.pathname);
2296
2296
  }
2297
- function Yn(t, e, r, n) {
2297
+ function Dn(t, e, r, n) {
2298
2298
  const o = n ?? window.location.origin + window.location.pathname + window.location.search;
2299
2299
  return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
2300
2300
  }
2301
- async function zn(t) {
2301
+ async function Fn(t) {
2302
2302
  const e = await fetch(`${t}/passkey/registration/options`, {
2303
2303
  method: "POST",
2304
2304
  headers: { "Content-Type": "application/json" }
@@ -2309,7 +2309,7 @@ async function zn(t) {
2309
2309
  }
2310
2310
  return e.json();
2311
2311
  }
2312
- async function qn(t, e, r) {
2312
+ async function Bn(t, e, r) {
2313
2313
  const n = await fetch(`${t}/passkey/registration/verify`, {
2314
2314
  method: "POST",
2315
2315
  headers: { "Content-Type": "application/json" },
@@ -2324,9 +2324,9 @@ async function qn(t, e, r) {
2324
2324
  provider: "passkey",
2325
2325
  authenticatedAt: Date.now()
2326
2326
  };
2327
- return Te(s), s;
2327
+ return be(s), s;
2328
2328
  }
2329
- async function Gn(t, e) {
2329
+ async function $n(t, e) {
2330
2330
  const r = await fetch(`${t}/passkey/authentication/options`, {
2331
2331
  method: "POST",
2332
2332
  headers: { "Content-Type": "application/json" },
@@ -2338,7 +2338,7 @@ async function Gn(t, e) {
2338
2338
  }
2339
2339
  return r.json();
2340
2340
  }
2341
- async function Hn(t, e) {
2341
+ async function Vn(t, e) {
2342
2342
  const r = await fetch(`${t}/passkey/authentication/verify`, {
2343
2343
  method: "POST",
2344
2344
  headers: { "Content-Type": "application/json" },
@@ -2353,32 +2353,32 @@ async function Hn(t, e) {
2353
2353
  provider: "passkey",
2354
2354
  authenticatedAt: Date.now()
2355
2355
  };
2356
- return Te(o), o;
2356
+ return be(o), o;
2357
2357
  }
2358
- function J(t) {
2358
+ function q(t) {
2359
2359
  const e = new Uint8Array(t);
2360
2360
  let r = "";
2361
2361
  for (const o of e)
2362
2362
  r += String.fromCharCode(o);
2363
2363
  return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2364
2364
  }
2365
- function Re(t) {
2365
+ function ge(t) {
2366
2366
  const e = t.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - e.length % 4) % 4, n = e.padEnd(e.length + r, "="), o = atob(n), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
2367
2367
  for (let a = 0; a < o.length; a++)
2368
2368
  i[a] = o.charCodeAt(a);
2369
2369
  return s;
2370
2370
  }
2371
- function qe() {
2372
- return Jn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2371
+ function Ve() {
2372
+ return Kn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2373
2373
  }
2374
- const Jn = {
2374
+ const Kn = {
2375
2375
  stubThis: (t) => t
2376
2376
  };
2377
- function kt(t) {
2377
+ function vt(t) {
2378
2378
  const { id: e } = t;
2379
2379
  return {
2380
2380
  ...t,
2381
- id: Re(e),
2381
+ id: ge(e),
2382
2382
  /**
2383
2383
  * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
2384
2384
  * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
@@ -2387,7 +2387,7 @@ function kt(t) {
2387
2387
  transports: t.transports
2388
2388
  };
2389
2389
  }
2390
- function Ct(t) {
2390
+ function Rt(t) {
2391
2391
  return (
2392
2392
  // Consider localhost valid as well since it's okay wrt Secure Contexts
2393
2393
  t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
@@ -2403,7 +2403,7 @@ class j extends Error {
2403
2403
  }), this.name = o ?? n.name, this.code = r;
2404
2404
  }
2405
2405
  }
2406
- function Xn({ error: t, options: e }) {
2406
+ function Wn({ error: t, options: e }) {
2407
2407
  const { publicKey: r } = e;
2408
2408
  if (!r)
2409
2409
  throw Error("options was missing required publicKey property");
@@ -2461,7 +2461,7 @@ function Xn({ error: t, options: e }) {
2461
2461
  });
2462
2462
  if (t.name === "SecurityError") {
2463
2463
  const n = globalThis.location.hostname;
2464
- if (Ct(n)) {
2464
+ if (Rt(n)) {
2465
2465
  if (r.rp.id !== n)
2466
2466
  return new j({
2467
2467
  message: `The RP ID "${r.rp.id}" is invalid for this domain`,
@@ -2489,7 +2489,7 @@ function Xn({ error: t, options: e }) {
2489
2489
  }
2490
2490
  return t;
2491
2491
  }
2492
- class Zn {
2492
+ class Yn {
2493
2493
  constructor() {
2494
2494
  Object.defineProperty(this, "controller", {
2495
2495
  enumerable: !0,
@@ -2513,89 +2513,89 @@ class Zn {
2513
2513
  }
2514
2514
  }
2515
2515
  }
2516
- const It = new Zn(), Qn = ["cross-platform", "platform"];
2517
- function Ot(t) {
2518
- if (t && !(Qn.indexOf(t) < 0))
2516
+ const Et = new Yn(), zn = ["cross-platform", "platform"];
2517
+ function At(t) {
2518
+ if (t && !(zn.indexOf(t) < 0))
2519
2519
  return t;
2520
2520
  }
2521
- async function eo(t) {
2521
+ async function qn(t) {
2522
2522
  !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 });
2523
2523
  const { optionsJSON: e, useAutoRegister: r = !1 } = t;
2524
- if (!qe())
2524
+ if (!Ve())
2525
2525
  throw new Error("WebAuthn is not supported in this browser");
2526
2526
  const n = {
2527
2527
  ...e,
2528
- challenge: Re(e.challenge),
2528
+ challenge: ge(e.challenge),
2529
2529
  user: {
2530
2530
  ...e.user,
2531
- id: Re(e.user.id)
2531
+ id: ge(e.user.id)
2532
2532
  },
2533
- excludeCredentials: e.excludeCredentials?.map(kt)
2533
+ excludeCredentials: e.excludeCredentials?.map(vt)
2534
2534
  }, o = {};
2535
- r && (o.mediation = "conditional"), o.publicKey = n, o.signal = It.createNewAbortSignal();
2535
+ r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Et.createNewAbortSignal();
2536
2536
  let s;
2537
2537
  try {
2538
2538
  s = await navigator.credentials.create(o);
2539
2539
  } catch (y) {
2540
- throw Xn({ error: y, options: o });
2540
+ throw Wn({ error: y, options: o });
2541
2541
  }
2542
2542
  if (!s)
2543
2543
  throw new Error("Registration was not completed");
2544
- const { id: i, rawId: a, response: c, type: d } = s;
2545
- let f;
2546
- typeof c.getTransports == "function" && (f = c.getTransports());
2547
- let g;
2544
+ const { id: i, rawId: a, response: c, type: f } = s;
2545
+ let d;
2546
+ typeof c.getTransports == "function" && (d = c.getTransports());
2547
+ let h;
2548
2548
  if (typeof c.getPublicKeyAlgorithm == "function")
2549
2549
  try {
2550
- g = c.getPublicKeyAlgorithm();
2550
+ h = c.getPublicKeyAlgorithm();
2551
2551
  } catch (y) {
2552
- Pe("getPublicKeyAlgorithm()", y);
2552
+ Ce("getPublicKeyAlgorithm()", y);
2553
2553
  }
2554
2554
  let u;
2555
2555
  if (typeof c.getPublicKey == "function")
2556
2556
  try {
2557
2557
  const y = c.getPublicKey();
2558
- y !== null && (u = J(y));
2558
+ y !== null && (u = q(y));
2559
2559
  } catch (y) {
2560
- Pe("getPublicKey()", y);
2560
+ Ce("getPublicKey()", y);
2561
2561
  }
2562
- let h;
2562
+ let g;
2563
2563
  if (typeof c.getAuthenticatorData == "function")
2564
2564
  try {
2565
- h = J(c.getAuthenticatorData());
2565
+ g = q(c.getAuthenticatorData());
2566
2566
  } catch (y) {
2567
- Pe("getAuthenticatorData()", y);
2567
+ Ce("getAuthenticatorData()", y);
2568
2568
  }
2569
2569
  return {
2570
2570
  id: i,
2571
- rawId: J(a),
2571
+ rawId: q(a),
2572
2572
  response: {
2573
- attestationObject: J(c.attestationObject),
2574
- clientDataJSON: J(c.clientDataJSON),
2575
- transports: f,
2576
- publicKeyAlgorithm: g,
2573
+ attestationObject: q(c.attestationObject),
2574
+ clientDataJSON: q(c.clientDataJSON),
2575
+ transports: d,
2576
+ publicKeyAlgorithm: h,
2577
2577
  publicKey: u,
2578
- authenticatorData: h
2578
+ authenticatorData: g
2579
2579
  },
2580
- type: d,
2580
+ type: f,
2581
2581
  clientExtensionResults: s.getClientExtensionResults(),
2582
- authenticatorAttachment: Ot(s.authenticatorAttachment)
2582
+ authenticatorAttachment: At(s.authenticatorAttachment)
2583
2583
  };
2584
2584
  }
2585
- function Pe(t, e) {
2585
+ function Ce(t, e) {
2586
2586
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
2587
2587
  `, e);
2588
2588
  }
2589
- function to() {
2590
- if (!qe())
2591
- return je.stubThis(new Promise((e) => e(!1)));
2589
+ function Gn() {
2590
+ if (!Ve())
2591
+ return Ie.stubThis(new Promise((e) => e(!1)));
2592
2592
  const t = globalThis.PublicKeyCredential;
2593
- return t?.isConditionalMediationAvailable === void 0 ? je.stubThis(new Promise((e) => e(!1))) : je.stubThis(t.isConditionalMediationAvailable());
2593
+ return t?.isConditionalMediationAvailable === void 0 ? Ie.stubThis(new Promise((e) => e(!1))) : Ie.stubThis(t.isConditionalMediationAvailable());
2594
2594
  }
2595
- const je = {
2595
+ const Ie = {
2596
2596
  stubThis: (t) => t
2597
2597
  };
2598
- function ro({ error: t, options: e }) {
2598
+ function Hn({ error: t, options: e }) {
2599
2599
  const { publicKey: r } = e;
2600
2600
  if (!r)
2601
2601
  throw Error("options was missing required publicKey property");
@@ -2615,7 +2615,7 @@ function ro({ error: t, options: e }) {
2615
2615
  });
2616
2616
  if (t.name === "SecurityError") {
2617
2617
  const n = globalThis.location.hostname;
2618
- if (Ct(n)) {
2618
+ if (Rt(n)) {
2619
2619
  if (r.rpId !== n)
2620
2620
  return new j({
2621
2621
  message: `The RP ID "${r.rpId}" is invalid for this domain`,
@@ -2636,53 +2636,53 @@ function ro({ error: t, options: e }) {
2636
2636
  }
2637
2637
  return t;
2638
2638
  }
2639
- async function no(t) {
2639
+ async function Jn(t) {
2640
2640
  !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 });
2641
2641
  const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
2642
- if (!qe())
2642
+ if (!Ve())
2643
2643
  throw new Error("WebAuthn is not supported in this browser");
2644
2644
  let o;
2645
- e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(kt));
2645
+ e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(vt));
2646
2646
  const s = {
2647
2647
  ...e,
2648
- challenge: Re(e.challenge),
2648
+ challenge: ge(e.challenge),
2649
2649
  allowCredentials: o
2650
2650
  }, i = {};
2651
2651
  if (r) {
2652
- if (!await to())
2652
+ if (!await Gn())
2653
2653
  throw Error("Browser does not support WebAuthn autofill");
2654
2654
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
2655
2655
  throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
2656
2656
  i.mediation = "conditional", s.allowCredentials = [];
2657
2657
  }
2658
- i.publicKey = s, i.signal = It.createNewAbortSignal();
2658
+ i.publicKey = s, i.signal = Et.createNewAbortSignal();
2659
2659
  let a;
2660
2660
  try {
2661
2661
  a = await navigator.credentials.get(i);
2662
- } catch (h) {
2663
- throw ro({ error: h, options: i });
2662
+ } catch (g) {
2663
+ throw Hn({ error: g, options: i });
2664
2664
  }
2665
2665
  if (!a)
2666
2666
  throw new Error("Authentication was not completed");
2667
- const { id: c, rawId: d, response: f, type: g } = a;
2667
+ const { id: c, rawId: f, response: d, type: h } = a;
2668
2668
  let u;
2669
- return f.userHandle && (u = J(f.userHandle)), {
2669
+ return d.userHandle && (u = q(d.userHandle)), {
2670
2670
  id: c,
2671
- rawId: J(d),
2671
+ rawId: q(f),
2672
2672
  response: {
2673
- authenticatorData: J(f.authenticatorData),
2674
- clientDataJSON: J(f.clientDataJSON),
2675
- signature: J(f.signature),
2673
+ authenticatorData: q(d.authenticatorData),
2674
+ clientDataJSON: q(d.clientDataJSON),
2675
+ signature: q(d.signature),
2676
2676
  userHandle: u
2677
2677
  },
2678
- type: g,
2678
+ type: h,
2679
2679
  clientExtensionResults: a.getClientExtensionResults(),
2680
- authenticatorAttachment: Ot(a.authenticatorAttachment)
2680
+ authenticatorAttachment: At(a.authenticatorAttachment)
2681
2681
  };
2682
2682
  }
2683
- const Ge = gt(null);
2684
- function Eo({ children: t, config: e }) {
2685
- const [r, n] = z({
2683
+ const Ke = dt(null);
2684
+ function go({ children: t, config: e }) {
2685
+ const [r, n] = Y({
2686
2686
  isAuthenticated: !1,
2687
2687
  isLoading: !0,
2688
2688
  user: null,
@@ -2690,37 +2690,37 @@ function Eo({ children: t, config: e }) {
2690
2690
  });
2691
2691
  M(() => {
2692
2692
  (() => {
2693
- const f = Wn();
2694
- if (f) {
2695
- pt(), n({
2693
+ const d = xn();
2694
+ if (d) {
2695
+ lt(), n({
2696
2696
  isAuthenticated: !1,
2697
2697
  isLoading: !1,
2698
2698
  user: null,
2699
- error: f
2699
+ error: d
2700
2700
  });
2701
2701
  return;
2702
2702
  }
2703
- const g = Kn();
2704
- if (g) {
2705
- const h = {
2706
- token: g.token,
2707
- provider: g.provider,
2703
+ const h = Un();
2704
+ if (h) {
2705
+ const g = {
2706
+ token: h.token,
2707
+ provider: h.provider,
2708
2708
  authenticatedAt: Date.now()
2709
2709
  };
2710
- Te(h), pt(), n({
2710
+ be(g), lt(), n({
2711
2711
  isAuthenticated: !0,
2712
2712
  isLoading: !1,
2713
- user: fe(h),
2713
+ user: ue(g),
2714
2714
  error: null
2715
2715
  });
2716
2716
  return;
2717
2717
  }
2718
- const u = Et();
2718
+ const u = St();
2719
2719
  if (u) {
2720
2720
  n({
2721
2721
  isAuthenticated: !0,
2722
2722
  isLoading: !1,
2723
- user: fe(u),
2723
+ user: ue(u),
2724
2724
  error: null
2725
2725
  });
2726
2726
  return;
@@ -2733,8 +2733,8 @@ function Eo({ children: t, config: e }) {
2733
2733
  });
2734
2734
  })();
2735
2735
  }, []);
2736
- const o = D(
2737
- async (d) => {
2736
+ const o = x(
2737
+ async (f) => {
2738
2738
  if (!e.spaceId) {
2739
2739
  n((u) => ({
2740
2740
  ...u,
@@ -2742,78 +2742,78 @@ function Eo({ children: t, config: e }) {
2742
2742
  }));
2743
2743
  return;
2744
2744
  }
2745
- const f = e.authUrl ?? Me();
2746
- if (d === "guest") {
2745
+ const d = e.authUrl ?? _e();
2746
+ if (f === "guest") {
2747
2747
  n((u) => ({ ...u, isLoading: !0 }));
2748
2748
  try {
2749
- const u = await Tt(e.spaceId, f);
2749
+ const u = await wt(e.spaceId, d);
2750
2750
  n({
2751
2751
  isAuthenticated: !0,
2752
2752
  isLoading: !1,
2753
- user: fe(u),
2753
+ user: ue(u),
2754
2754
  error: null
2755
2755
  });
2756
2756
  } catch (u) {
2757
- n((h) => ({
2758
- ...h,
2757
+ n((g) => ({
2758
+ ...g,
2759
2759
  isLoading: !1,
2760
2760
  error: u instanceof Error ? u.message : "Guest login failed"
2761
2761
  }));
2762
2762
  }
2763
2763
  return;
2764
2764
  }
2765
- if (d === "passkey") {
2765
+ if (f === "passkey") {
2766
2766
  n((u) => ({ ...u, isLoading: !0, error: null }));
2767
2767
  try {
2768
- const u = await Gn(f), h = await no({ optionsJSON: u }), y = await Hn(f, h);
2768
+ const u = await $n(d), g = await Jn({ optionsJSON: u }), y = await Vn(d, g);
2769
2769
  n({
2770
2770
  isAuthenticated: !0,
2771
2771
  isLoading: !1,
2772
- user: fe(y),
2772
+ user: ue(y),
2773
2773
  error: null
2774
2774
  });
2775
2775
  } catch (u) {
2776
- n((h) => ({
2777
- ...h,
2776
+ n((g) => ({
2777
+ ...g,
2778
2778
  isLoading: !1,
2779
2779
  error: u instanceof Error ? u.message : "Passkey login failed"
2780
2780
  }));
2781
2781
  }
2782
2782
  return;
2783
2783
  }
2784
- const g = Yn(d, e.spaceId, f);
2785
- window.location.href = g;
2784
+ const h = Dn(f, e.spaceId, d);
2785
+ window.location.href = h;
2786
2786
  },
2787
2787
  [e.authUrl, e.spaceId]
2788
- ), s = D(() => {
2789
- At(), n({
2788
+ ), s = x(() => {
2789
+ bt(), n({
2790
2790
  isAuthenticated: !1,
2791
2791
  isLoading: !1,
2792
2792
  user: null,
2793
2793
  error: null
2794
2794
  });
2795
- }, []), i = D(
2796
- async (d) => {
2797
- const f = e.authUrl ?? Me();
2798
- n((g) => ({ ...g, isLoading: !0, error: null }));
2795
+ }, []), i = x(
2796
+ async (f) => {
2797
+ const d = e.authUrl ?? _e();
2798
+ n((h) => ({ ...h, isLoading: !0, error: null }));
2799
2799
  try {
2800
- const g = await zn(f), u = await eo({ optionsJSON: g }), h = await qn(f, u, d);
2800
+ const h = await Fn(d), u = await qn({ optionsJSON: h }), g = await Bn(d, u, f);
2801
2801
  n({
2802
2802
  isAuthenticated: !0,
2803
2803
  isLoading: !1,
2804
- user: fe(h),
2804
+ user: ue(g),
2805
2805
  error: null
2806
2806
  });
2807
- } catch (g) {
2807
+ } catch (h) {
2808
2808
  n((u) => ({
2809
2809
  ...u,
2810
2810
  isLoading: !1,
2811
- error: g instanceof Error ? g.message : "Passkey registration failed"
2811
+ error: h instanceof Error ? h.message : "Passkey registration failed"
2812
2812
  }));
2813
2813
  }
2814
2814
  },
2815
2815
  [e.authUrl]
2816
- ), a = D(() => r.user?.token ?? null, [r.user]), c = W(
2816
+ ), a = x(() => r.user?.token ?? null, [r.user]), c = K(
2817
2817
  () => ({
2818
2818
  state: r,
2819
2819
  login: o,
@@ -2823,27 +2823,27 @@ function Eo({ children: t, config: e }) {
2823
2823
  }),
2824
2824
  [r, o, s, a, i]
2825
2825
  );
2826
- return /* @__PURE__ */ E.jsx(Ge, { value: c, children: t });
2826
+ return /* @__PURE__ */ R.jsx(Ke, { value: c, children: t });
2827
2827
  }
2828
- function oo() {
2829
- const t = Ke(Ge);
2828
+ function Xn() {
2829
+ const t = De(Ke);
2830
2830
  if (!t)
2831
2831
  throw new Error("useAuth must be used within an AuthProvider");
2832
2832
  return t;
2833
2833
  }
2834
- function Ao() {
2835
- return Ke(Ge);
2834
+ function yo() {
2835
+ return De(Ke);
2836
2836
  }
2837
- function To(t) {
2838
- const { config: e, guestUrlParam: r } = t, { state: n, login: o } = oo(), s = w(!1);
2837
+ function So(t) {
2838
+ const { config: e, guestUrlParam: r } = t, { state: n, login: o } = Xn(), s = A(!1);
2839
2839
  return M(() => {
2840
2840
  if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
2841
2841
  return;
2842
2842
  const i = new URLSearchParams(window.location.search), a = i.get(r);
2843
2843
  if (a === "true" || a === "1" || a === "") {
2844
2844
  i.delete(r);
2845
- const c = i.toString(), d = window.location.pathname + (c ? `?${c}` : "");
2846
- window.history.replaceState({}, "", d), s.current = !0, o("guest");
2845
+ const c = i.toString(), f = window.location.pathname + (c ? `?${c}` : "");
2846
+ window.history.replaceState({}, "", f), s.current = !0, o("guest");
2847
2847
  }
2848
2848
  }, [r, n.isAuthenticated, n.isLoading, e.methods, o]), {
2849
2849
  shouldRenderChildren: n.isAuthenticated,
@@ -2852,7 +2852,7 @@ function To(t) {
2852
2852
  error: n.error
2853
2853
  };
2854
2854
  }
2855
- function ko({
2855
+ function bo({
2856
2856
  connectionState: t,
2857
2857
  error: e,
2858
2858
  isReady: r,
@@ -2862,9 +2862,9 @@ function ko({
2862
2862
  onAction: i,
2863
2863
  renderIdle: a,
2864
2864
  renderConnecting: c,
2865
- renderConnectingSlow: d,
2866
- renderConnected: f,
2867
- renderOffline: g,
2865
+ renderConnectingSlow: f,
2866
+ renderConnected: d,
2867
+ renderOffline: h,
2868
2868
  renderError: u
2869
2869
  }) {
2870
2870
  switch (t) {
@@ -2873,10 +2873,10 @@ function ko({
2873
2873
  case "connecting":
2874
2874
  return c();
2875
2875
  case "connectingSlow":
2876
- return d();
2876
+ return f();
2877
2877
  case "connected":
2878
2878
  case "reconnecting":
2879
- return !r || !n || !o ? null : f({
2879
+ return !r || !n || !o ? null : d({
2880
2880
  stores: n,
2881
2881
  registry: o,
2882
2882
  client: s,
@@ -2884,173 +2884,168 @@ function ko({
2884
2884
  isReconnecting: t === "reconnecting"
2885
2885
  });
2886
2886
  case "offline":
2887
- return g();
2887
+ return h();
2888
2888
  case "offlineError":
2889
2889
  return u(e ?? s?.lastError?.message ?? null);
2890
2890
  default:
2891
2891
  return null;
2892
2892
  }
2893
2893
  }
2894
- const Le = Ee("useIkonApp");
2895
- function so() {
2894
+ const Oe = ye("useIkonApp");
2895
+ function Zn() {
2896
2896
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
2897
2897
  return window.__IKON_AUTH_CONFIG__;
2898
2898
  }
2899
- function io() {
2899
+ function Qn() {
2900
2900
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
2901
2901
  return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
2902
2902
  }
2903
- function Co(t) {
2904
- const { authConfig: e, localServer: r, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, timeouts: c, audio: d, video: f, mediaSession: g, webRtc: u } = t, h = e === void 0 ? so() ?? null : e, y = r ?? io(), S = w(null), p = w(null), m = w(null), v = w(!1), A = w(d), _ = w(f), U = w(g), X = w(c), Q = w(i), k = w(a), N = w(s), L = w(u);
2905
- A.current = d, _.current = f, U.current = g, X.current = c, Q.current = i, k.current = a, N.current = s, L.current = u;
2906
- const [P, F] = z("idle"), [G, te] = z(null), [oe, me] = z(null), [pe, se] = z(null), [ge, l] = z(null), [b, T] = z(null), [C, H] = z(null), [$, re] = z(!1), x = W(() => {
2903
+ function wo(t) {
2904
+ const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s } = t, i = e === void 0 ? Zn() ?? null : e, a = Qn(), c = A(null), f = A(null), d = A(null), h = A(!1), u = A(o), g = A(n), y = A(s);
2905
+ u.current = o, g.current = n, y.current = s;
2906
+ const [S, m] = Y("idle"), [p, w] = Y(null), [T, _] = Y(null), [D, G] = Y(null), [Z, C] = Y(null), [P, U] = Y(null), [O, F] = Y(null), [W, Q] = Y(!1), B = K(() => {
2907
2907
  try {
2908
- const O = Dt();
2909
- return (O.sessionId || O.channelKey) && Ft(), O;
2908
+ const E = Nt();
2909
+ return (E.sessionId || E.channelKey) && Pt(), E;
2910
2910
  } catch {
2911
2911
  return { parameters: {} };
2912
2912
  }
2913
- }, []), I = W(() => h?.enabled ? Et() : null, [h?.enabled]), Y = y?.enabled ?? !1, ee = y?.host ?? "localhost", ie = y?.port ?? 8443;
2913
+ }, []), J = K(() => i?.enabled ? St() : null, [i?.enabled]), X = a?.enabled ?? !1, ee = a?.host ?? "localhost", te = a?.port ?? 8443;
2914
2914
  M(() => {
2915
- !Y && He() && h && !h.enabled && h.spaceId && !C && !$ && (re(!0), Tt(h.spaceId, h.authUrl ?? Me()).then((V) => {
2916
- H(V.token);
2917
- }).catch((V) => {
2918
- Le.error("Anonymous auth failed:", V), te(V instanceof Error ? V.message : "Anonymous auth failed");
2915
+ !X && We() && i && !i.enabled && i.spaceId && !O && !W && (Q(!0), wt(i.spaceId, i.authUrl ?? _e()).then((I) => {
2916
+ F(I.token);
2917
+ }).catch((I) => {
2918
+ Oe.error("Anonymous auth failed:", I), w(I instanceof Error ? I.message : "Anonymous auth failed");
2919
2919
  }).finally(() => {
2920
- re(!1);
2920
+ Q(!1);
2921
2921
  }));
2922
- }, [Y, h, C, $]);
2923
- const ke = W(() => {
2924
- if (Y) {
2925
- const O = I?.token ? Bt(I.token) ?? be() : be();
2922
+ }, [X, i, O, W]);
2923
+ const l = K(() => {
2924
+ if (X) {
2925
+ const E = J?.token ? jt(J.token) ?? he() : he();
2926
2926
  return {
2927
2927
  local: {
2928
2928
  host: ee,
2929
- httpsPort: ie,
2930
- userId: O,
2931
- parameters: x.parameters
2929
+ httpsPort: te,
2930
+ userId: E,
2931
+ parameters: B.parameters
2932
2932
  }
2933
2933
  };
2934
2934
  }
2935
- return I?.token && h?.spaceId ? {
2935
+ return J?.token && i?.spaceId ? {
2936
2936
  sessionToken: {
2937
- token: I.token,
2938
- spaceId: h.spaceId,
2939
- backendType: Je(),
2940
- sessionId: x.sessionId,
2941
- channelKey: x.channelKey,
2942
- parameters: x.parameters
2937
+ token: J.token,
2938
+ spaceId: i.spaceId,
2939
+ backendType: Ye(),
2940
+ sessionId: B.sessionId,
2941
+ channelKey: B.channelKey,
2942
+ parameters: B.parameters
2943
2943
  }
2944
- } : C && h?.spaceId ? {
2944
+ } : O && i?.spaceId ? {
2945
2945
  sessionToken: {
2946
- token: C,
2947
- spaceId: h.spaceId,
2948
- backendType: Je(),
2949
- sessionId: x.sessionId,
2950
- channelKey: x.channelKey,
2951
- parameters: x.parameters
2946
+ token: O,
2947
+ spaceId: i.spaceId,
2948
+ backendType: Ye(),
2949
+ sessionId: B.sessionId,
2950
+ channelKey: B.channelKey,
2951
+ parameters: B.parameters
2952
2952
  }
2953
- } : He() ? null : {
2953
+ } : We() ? null : {
2954
2954
  local: {
2955
2955
  host: ee,
2956
- httpsPort: ie,
2957
- userId: be(),
2958
- parameters: x.parameters
2956
+ httpsPort: te,
2957
+ userId: he(),
2958
+ parameters: B.parameters
2959
2959
  }
2960
2960
  };
2961
- }, [Y, ee, ie, I?.token, h?.spaceId, C, x.sessionId, x.channelKey, x.parameters]);
2962
- Zr(oe);
2963
- const Nt = en(oe);
2961
+ }, [X, ee, te, J?.token, i?.spaceId, O, B.sessionId, B.channelKey, B.parameters]);
2962
+ Yr(T);
2963
+ const b = qr(T);
2964
2964
  M(() => {
2965
- if (!v.current) {
2966
- if (v.current = !0, m.current = Wr(), n)
2967
- for (const O of n)
2968
- O(m.current);
2969
- o?.(m.current), m.current.loadRegisteredModules().catch((O) => {
2970
- Le.error("Failed to load UI modules", O);
2965
+ if (!h.current) {
2966
+ if (h.current = !0, d.current = xr(), r)
2967
+ for (const E of r)
2968
+ E(d.current);
2969
+ d.current.loadRegisteredModules().catch((E) => {
2970
+ Oe.error("Failed to load UI modules", E);
2971
2971
  });
2972
2972
  }
2973
2973
  }, []), M(() => {
2974
- if (!ke) return;
2975
- const O = new $t({
2976
- ...ke,
2977
- timeouts: X.current,
2978
- audio: A.current,
2979
- video: _.current,
2980
- mediaSession: U.current,
2981
- webRtc: L.current ? { enabled: !0 } : void 0,
2982
- onConnectionStateChange: (K) => {
2983
- F(K), Q.current?.(K), L.current && K === "connected" && (se(O.webRtcAudioStream), l(O.webRtcVideoStream), T(O.webRtcScreenStream));
2984
- },
2985
- onError: (K) => {
2986
- te(K.message), k.current?.(K);
2974
+ if (!l) return;
2975
+ const E = new Lt({
2976
+ ...l,
2977
+ timeouts: g.current,
2978
+ audio: u.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : void 0,
2979
+ mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
2980
+ webRtc: y.current ? { enabled: !0 } : void 0,
2981
+ onConnectionStateChange: (V) => {
2982
+ m(V), y.current && V === "connected" && (G(E.webRtcAudioStream), C(E.webRtcVideoStream), U(E.webRtcScreenStream));
2987
2983
  },
2988
- onJoined: () => {
2989
- const K = O.globalState?.SessionId;
2990
- N.current?.(K);
2984
+ onError: (V) => {
2985
+ w(V.message);
2991
2986
  }
2992
2987
  });
2993
- S.current = O;
2994
- const V = new sr({ client: O });
2995
- return p.current = V, me(V), O.connect().catch((K) => {
2996
- Le.error("Connection failed:", K);
2988
+ c.current = E;
2989
+ const I = new Zt({ client: E });
2990
+ return f.current = I, _(I), E.connect().catch((V) => {
2991
+ Oe.error("Connection failed:", V);
2997
2992
  }), () => {
2998
- O.disconnect(), S.current = null, V.dispose(), p.current = null, se(null), l(null), T(null);
2993
+ E.disconnect(), c.current = null, I.dispose(), f.current = null, G(null), C(null), U(null);
2999
2994
  };
3000
- }, [ke]);
3001
- const Pt = D((O, V) => {
3002
- const K = typeof V == "string" ? V : JSON.stringify(V ?? {});
3003
- S.current?.sendActionCall(O, K);
3004
- }, []), jt = P === "connected" || P === "reconnecting";
2995
+ }, [l]);
2996
+ const k = x((E, I) => {
2997
+ const V = typeof I == "string" ? I : JSON.stringify(I ?? {});
2998
+ c.current?.sendActionCall(E, V);
2999
+ }, []), N = S === "connected" || S === "reconnecting";
3005
3000
  return {
3006
- connectionState: P,
3007
- error: G,
3008
- stores: Nt,
3009
- client: S.current,
3010
- registry: m.current,
3011
- clientRef: S,
3012
- uiRef: p,
3013
- registryRef: m,
3014
- onAction: Pt,
3015
- isReady: jt,
3016
- webRtcAudioStream: pe,
3017
- webRtcVideoStream: ge,
3018
- webRtcScreenStream: b
3001
+ connectionState: S,
3002
+ error: p,
3003
+ stores: b,
3004
+ client: c.current,
3005
+ registry: d.current,
3006
+ clientRef: c,
3007
+ uiRef: f,
3008
+ registryRef: d,
3009
+ onAction: k,
3010
+ isReady: N,
3011
+ webRtcAudioStream: D,
3012
+ webRtcVideoStream: Z,
3013
+ webRtcScreenStream: P
3019
3014
  };
3020
3015
  }
3021
- function Io(t) {
3022
- const e = w(!1);
3023
- return D(() => {
3016
+ function vo(t) {
3017
+ const e = A(!1);
3018
+ return x(() => {
3024
3019
  if (e.current) return;
3025
3020
  e.current = !0;
3026
3021
  const r = document.createElement("link");
3027
3022
  r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
3028
3023
  }, [t]);
3029
3024
  }
3030
- let ao = 0;
3031
- function Oo(t = 5, e = 5e3) {
3032
- const [r, n] = z([]), o = w(/* @__PURE__ */ new Map()), s = D((i) => {
3025
+ let eo = 0;
3026
+ function Ro(t = 5, e = 5e3) {
3027
+ const [r, n] = Y([]), o = A(/* @__PURE__ */ new Map()), s = x((i) => {
3033
3028
  const a = o.current.get(i);
3034
- a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((d) => d.id !== i));
3029
+ a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((f) => f.id !== i));
3035
3030
  }, []);
3036
3031
  return M(() => {
3037
- const i = o.current, a = Vt(
3032
+ const i = o.current, a = Mt(
3038
3033
  (c) => {
3039
- if (!Kt())
3034
+ if (!Ut())
3040
3035
  return;
3041
- const d = `toast-${++ao}`, f = c.level === Xe.ERROR ? "error" : "warn", g = {
3042
- id: d,
3043
- level: f,
3036
+ const f = `toast-${++eo}`, d = c.level === ze.ERROR ? "error" : "warn", h = {
3037
+ id: f,
3038
+ level: d,
3044
3039
  message: c.message,
3045
3040
  component: c.component
3046
3041
  };
3047
- n((h) => [...h, g].slice(-t));
3042
+ n((g) => [...g, h].slice(-t));
3048
3043
  const u = setTimeout(() => {
3049
- s(d);
3044
+ s(f);
3050
3045
  }, e);
3051
- i.set(d, u);
3046
+ i.set(f, u);
3052
3047
  },
3053
- { minLevel: Xe.WARN }
3048
+ { minLevel: ze.WARN }
3054
3049
  );
3055
3050
  return () => {
3056
3051
  a();
@@ -3060,100 +3055,100 @@ function Oo(t = 5, e = 5e3) {
3060
3055
  };
3061
3056
  }, [t, e, s]), { toasts: r, dismissToast: s };
3062
3057
  }
3063
- const _t = gt(null);
3064
- function co(t, e) {
3058
+ const Tt = dt(null);
3059
+ function to(t, e) {
3065
3060
  return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
3066
3061
  }
3067
- function uo(t, e) {
3062
+ function ro(t, e) {
3068
3063
  const n = new URLSearchParams(window.location.search).get("lang");
3069
3064
  if (n && t.includes(n))
3070
3065
  return n;
3071
3066
  const o = navigator.language.split("-")[0];
3072
3067
  return t.includes(o) ? o : e && t.includes(e) ? e : "en";
3073
3068
  }
3074
- function lo(t, e, r) {
3075
- return e ? uo(t, r) : r && t.includes(r) ? r : "en";
3069
+ function no(t, e, r) {
3070
+ return e ? ro(t, r) : r && t.includes(r) ? r : "en";
3076
3071
  }
3077
- function _o({
3072
+ function Eo({
3078
3073
  children: t,
3079
3074
  translations: e,
3080
3075
  defaultLanguage: r,
3081
3076
  detectLanguage: n = !1
3082
3077
  }) {
3083
- const o = Object.keys(e), s = lo(o, n, r), i = e[s] ?? e.en, a = W(
3078
+ const o = Object.keys(e), s = no(o, n, r), i = e[s] ?? e.en, a = K(
3084
3079
  () => ({
3085
- t: (c, d) => {
3086
- const f = i[c];
3087
- return co(f, d);
3080
+ t: (c, f) => {
3081
+ const d = i[c];
3082
+ return to(d, f);
3088
3083
  },
3089
3084
  locale: s,
3090
3085
  translations: i
3091
3086
  }),
3092
3087
  [i, s]
3093
3088
  );
3094
- return /* @__PURE__ */ E.jsx(_t, { value: a, children: t });
3089
+ return /* @__PURE__ */ R.jsx(Tt, { value: a, children: t });
3095
3090
  }
3096
- function No() {
3097
- const t = Ke(_t);
3091
+ function Ao() {
3092
+ const t = De(Tt);
3098
3093
  if (!t)
3099
3094
  throw new Error("useI18n must be used within an I18nProvider");
3100
3095
  return t;
3101
3096
  }
3102
3097
  export {
3103
- Eo as AuthProvider,
3104
- ko as ConnectionStateRenderer,
3105
- _o as I18nProvider,
3106
- hr as IKON_UI_BASE_MODULE,
3107
- Tr as IKON_UI_MEDIA_MODULE,
3108
- Br as IKON_UI_SHADER_MODULE,
3109
- Dr as IKON_UI_SHADER_TYPE,
3110
- xe as IKON_UI_STREAM_CATEGORY,
3111
- wr as IKON_UI_VIDEO_CANVAS_TYPE,
3112
- vr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3113
- sr as IkonUi,
3114
- Kr as IkonUiRegistry,
3115
- yo as IkonUiSurface,
3116
- nr as UiComponentRegistry,
3117
- rr as UiRenderer,
3118
- Lo as UiStreamStore,
3119
- So as areIkonUiModuleListsEqual,
3120
- Tt as authenticateAnonymous,
3121
- Yn as buildOAuthRedirectUrl,
3122
- At as clearAuthSession,
3123
- pt as clearOAuthParams,
3124
- fr as createBaseResolvers,
3125
- po as createComponentLibrary,
3126
- Wr as createIkonUiRegistry,
3127
- Er as createMediaResolvers,
3128
- Fr as createShaderRendererResolver,
3129
- or as isIkonUiCategoryMatch,
3130
- Et as loadAuthSession,
3131
- mr as loadBaseModule,
3132
- kr as loadMediaModule,
3133
- $r as loadShaderModule,
3134
- Sn as normalizeIkonUiModuleList,
3135
- wo as parseIkonUiInitPayload,
3136
- Kn as parseOAuthCallback,
3137
- Wn as parseOAuthError,
3138
- bn as readIkonUiModules,
3139
- bo as readIkonUiModulesFromSources,
3140
- pr as registerBaseModule,
3141
- Cr as registerMediaModule,
3142
- Vr as registerShaderModule,
3143
- er as renderChildren,
3144
- vo as renderMotionLetters,
3145
- Te as saveAuthSession,
3146
- Ro as sendMagicLink,
3147
- fe as sessionToUser,
3148
- oo as useAuth,
3149
- To as useAuthGuard,
3150
- Ao as useAuthOptional,
3151
- No as useI18n,
3152
- Co as useIkonApp,
3153
- Zr as useIkonStyles,
3154
- en as useIkonUiStores,
3155
- Io as useLazyFont,
3156
- Oo as useToasts,
3157
- Z as useUiNode,
3158
- go as useUiStore
3098
+ go as AuthProvider,
3099
+ bo as ConnectionStateRenderer,
3100
+ Eo as I18nProvider,
3101
+ ir as IKON_UI_BASE_MODULE,
3102
+ Sr as IKON_UI_MEDIA_MODULE,
3103
+ jr as IKON_UI_SHADER_MODULE,
3104
+ Nr as IKON_UI_SHADER_TYPE,
3105
+ Pe as IKON_UI_STREAM_CATEGORY,
3106
+ hr as IKON_UI_VIDEO_CANVAS_TYPE,
3107
+ mr as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3108
+ Zt as IkonUi,
3109
+ Ur as IkonUiRegistry,
3110
+ uo as IkonUiSurface,
3111
+ Jt as UiComponentRegistry,
3112
+ Ht as UiRenderer,
3113
+ Co as UiStreamStore,
3114
+ lo as areIkonUiModuleListsEqual,
3115
+ wt as authenticateAnonymous,
3116
+ Dn as buildOAuthRedirectUrl,
3117
+ bt as clearAuthSession,
3118
+ lt as clearOAuthParams,
3119
+ sr as createBaseResolvers,
3120
+ ao as createComponentLibrary,
3121
+ xr as createIkonUiRegistry,
3122
+ gr as createMediaResolvers,
3123
+ Pr as createShaderRendererResolver,
3124
+ Xt as isIkonUiCategoryMatch,
3125
+ St as loadAuthSession,
3126
+ ar as loadBaseModule,
3127
+ br as loadMediaModule,
3128
+ Lr as loadShaderModule,
3129
+ dn as normalizeIkonUiModuleList,
3130
+ ho as parseIkonUiInitPayload,
3131
+ Un as parseOAuthCallback,
3132
+ xn as parseOAuthError,
3133
+ fn as readIkonUiModules,
3134
+ fo as readIkonUiModulesFromSources,
3135
+ cr as registerBaseModule,
3136
+ wr as registerMediaModule,
3137
+ Mr as registerShaderModule,
3138
+ qt as renderChildren,
3139
+ mo as renderMotionLetters,
3140
+ be as saveAuthSession,
3141
+ po as sendMagicLink,
3142
+ ue as sessionToUser,
3143
+ Xn as useAuth,
3144
+ So as useAuthGuard,
3145
+ yo as useAuthOptional,
3146
+ Ao as useI18n,
3147
+ wo as useIkonApp,
3148
+ Yr as useIkonStyles,
3149
+ qr as useIkonUiStores,
3150
+ vo as useLazyFont,
3151
+ Ro as useToasts,
3152
+ H as useUiNode,
3153
+ co as useUiStore
3159
3154
  };