@ikonai/sdk-react-ui 1.0.41 → 1.0.42

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 Pt, UiStreamStore as Mt } from "@ikonai/sdk-ui";
2
- import { UiStreamStore as Bo } from "@ikonai/sdk-ui";
3
- import Lt, { useSyncExternalStore as $e, useMemo as V, memo as Y, useRef as w, useCallback as D, Fragment as jt, useEffect as U, useState as J, createContext as mt, use as Ve } from "react";
4
- import { createLogger as Re, isInspectModeEnabled as Ut, getOrCreateDeviceId as xt, deriveAuthUrl as Le, parseUrlParams as Dt, clearSessionParamsFromUrl as Ft, isCloudEnvironment as Ge, extractUserIdFromToken as Bt, deriveBackendType as He, IkonClient as $t, AccessDeniedError as Vt, AuthenticationError as Kt, subscribeToLogEvents as Yt, isDebugModeEnabled as zt, LogLevel as Je, getLangParam as Wt } from "@ikonai/sdk";
5
- var ge = { exports: {} }, ie = {};
1
+ import { IkonUiCore as jt, UiStreamStore as Ut } from "@ikonai/sdk-ui";
2
+ import { UiStreamStore as Jo } from "@ikonai/sdk-ui";
3
+ import Dt, { useSyncExternalStore as Ke, useMemo as K, memo as z, useRef as v, useCallback as D, Fragment as Bt, useEffect as N, useState as Y, createContext as yt, use as Ye } from "react";
4
+ import { createLogger as ke, isInspectModeEnabled as Ft, getOrCreateDeviceId as $t, deriveAuthUrl as xe, parseUrlParams as Vt, clearSessionParamsFromUrl as Kt, isCloudEnvironment as Je, extractUserIdFromToken as Yt, deriveBackendType as Xe, IkonClient as zt, AccessDeniedError as Wt, AuthenticationError as qt, subscribeToLogEvents as Ht, isDebugModeEnabled as Gt, LogLevel as Ze, getLangParam as Jt } from "@ikonai/sdk";
5
+ var ge = { exports: {} }, ae = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,12 +12,12 @@ var ge = { exports: {} }, ie = {};
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 Xe;
16
- function qt() {
17
- if (Xe) return ie;
18
- Xe = 1;
15
+ var Qe;
16
+ function Xt() {
17
+ if (Qe) return ae;
18
+ Qe = 1;
19
19
  var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
20
- function r(n, o, s) {
20
+ function n(r, o, s) {
21
21
  var i = null;
22
22
  if (s !== void 0 && (i = "" + s), o.key !== void 0 && (i = "" + o.key), "key" in o) {
23
23
  s = {};
@@ -26,15 +26,15 @@ function qt() {
26
26
  } else s = o;
27
27
  return o = s.ref, {
28
28
  $$typeof: t,
29
- type: n,
29
+ type: r,
30
30
  key: i,
31
31
  ref: o !== void 0 ? o : null,
32
32
  props: s
33
33
  };
34
34
  }
35
- return ie.Fragment = e, ie.jsx = r, ie.jsxs = r, ie;
35
+ return ae.Fragment = e, ae.jsx = n, ae.jsxs = n, ae;
36
36
  }
37
- var ae = {};
37
+ var ce = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,274 +44,274 @@ var ae = {};
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 Ze;
48
- function Gt() {
49
- return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
50
- function t(f) {
51
- if (f == null) return null;
52
- if (typeof f == "function")
53
- return f.$$typeof === x ? null : f.displayName || f.name || null;
54
- if (typeof f == "string") return f;
55
- switch (f) {
47
+ var et;
48
+ function Zt() {
49
+ return et || (et = 1, process.env.NODE_ENV !== "production" && function() {
50
+ function t(h) {
51
+ if (h == null) return null;
52
+ if (typeof h == "function")
53
+ return h.$$typeof === U ? null : h.displayName || h.name || null;
54
+ if (typeof h == "string") return h;
55
+ switch (h) {
56
56
  case b:
57
57
  return "Fragment";
58
58
  case y:
59
59
  return "Profiler";
60
60
  case g:
61
61
  return "StrictMode";
62
- case O:
62
+ case _:
63
63
  return "Suspense";
64
- case K:
64
+ case B:
65
65
  return "SuspenseList";
66
- case _:
66
+ case P:
67
67
  return "Activity";
68
68
  }
69
- if (typeof f == "object")
70
- switch (typeof f.tag == "number" && console.error(
69
+ if (typeof h == "object")
70
+ switch (typeof h.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
- ), f.$$typeof) {
72
+ ), h.$$typeof) {
73
73
  case m:
74
74
  return "Portal";
75
- case E:
76
- return (f.displayName || "Context") + ".Provider";
77
- case v:
78
- return (f._context.displayName || "Context") + ".Consumer";
79
75
  case T:
80
- var S = f.render;
81
- return f = f.displayName, f || (f = S.displayName || S.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
82
- case Q:
83
- return S = f.displayName || null, S !== null ? S : t(f.type) || "Memo";
76
+ return (h.displayName || "Context") + ".Provider";
77
+ case w:
78
+ return (h._context.displayName || "Context") + ".Consumer";
84
79
  case C:
85
- S = f._payload, f = f._init;
80
+ var S = h.render;
81
+ return h = h.displayName, h || (h = S.displayName || S.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
82
+ case Q:
83
+ return S = h.displayName || null, S !== null ? S : t(h.type) || "Memo";
84
+ case A:
85
+ S = h._payload, h = h._init;
86
86
  try {
87
- return t(f(S));
87
+ return t(h(S));
88
88
  } catch {
89
89
  }
90
90
  }
91
91
  return null;
92
92
  }
93
- function e(f) {
94
- return "" + f;
93
+ function e(h) {
94
+ return "" + h;
95
95
  }
96
- function r(f) {
96
+ function n(h) {
97
97
  try {
98
- e(f);
98
+ e(h);
99
99
  var S = !1;
100
100
  } catch {
101
101
  S = !0;
102
102
  }
103
103
  if (S) {
104
104
  S = console;
105
- var A = S.error, M = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
106
- return A.call(
105
+ var k = S.error, L = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
106
+ return k.call(
107
107
  S,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- M
110
- ), e(f);
109
+ L
110
+ ), e(h);
111
111
  }
112
112
  }
113
- function n(f) {
114
- if (f === b) return "<>";
115
- if (typeof f == "object" && f !== null && f.$$typeof === C)
113
+ function r(h) {
114
+ if (h === b) return "<>";
115
+ if (typeof h == "object" && h !== null && h.$$typeof === A)
116
116
  return "<...>";
117
117
  try {
118
- var S = t(f);
118
+ var S = t(h);
119
119
  return S ? "<" + S + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
123
123
  }
124
124
  function o() {
125
- var f = P.A;
126
- return f === null ? null : f.getOwner();
125
+ var h = M.A;
126
+ return h === null ? null : h.getOwner();
127
127
  }
128
128
  function s() {
129
129
  return Error("react-stack-top-frame");
130
130
  }
131
- function i(f) {
132
- if (F.call(f, "key")) {
133
- var S = Object.getOwnPropertyDescriptor(f, "key").get;
131
+ function i(h) {
132
+ if (F.call(h, "key")) {
133
+ var S = Object.getOwnPropertyDescriptor(h, "key").get;
134
134
  if (S && S.isReactWarning) return !1;
135
135
  }
136
- return f.key !== void 0;
136
+ return h.key !== void 0;
137
137
  }
138
- function a(f, S) {
139
- function A() {
140
- he || (he = !0, console.error(
138
+ function a(h, S) {
139
+ function k() {
140
+ pe || (pe = !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
  S
143
143
  ));
144
144
  }
145
- A.isReactWarning = !0, Object.defineProperty(f, "key", {
146
- get: A,
145
+ k.isReactWarning = !0, Object.defineProperty(h, "key", {
146
+ get: k,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
150
  function c() {
151
- var f = t(this.type);
152
- return pe[f] || (pe[f] = !0, console.error(
151
+ var h = t(this.type);
152
+ return he[h] || (he[h] = !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
- )), f = this.props.ref, f !== void 0 ? f : null;
154
+ )), h = this.props.ref, h !== void 0 ? h : null;
155
155
  }
156
- function h(f, S, A, M, W, I, q, te) {
157
- return A = I.ref, f = {
158
- $$typeof: p,
159
- type: f,
156
+ function p(h, S, k, L, q, I, H, te) {
157
+ return k = I.ref, h = {
158
+ $$typeof: d,
159
+ type: h,
160
160
  key: S,
161
161
  props: I,
162
- _owner: W
163
- }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(f, "ref", {
162
+ _owner: q
163
+ }, (k !== void 0 ? k : null) !== null ? Object.defineProperty(h, "ref", {
164
164
  enumerable: !1,
165
165
  get: c
166
- }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
166
+ }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
169
169
  writable: !0,
170
170
  value: 0
171
- }), Object.defineProperty(f, "_debugInfo", {
171
+ }), Object.defineProperty(h, "_debugInfo", {
172
172
  configurable: !1,
173
173
  enumerable: !1,
174
174
  writable: !0,
175
175
  value: null
176
- }), Object.defineProperty(f, "_debugStack", {
176
+ }), Object.defineProperty(h, "_debugStack", {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
- value: q
181
- }), Object.defineProperty(f, "_debugTask", {
180
+ value: H
181
+ }), Object.defineProperty(h, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
184
184
  writable: !0,
185
185
  value: te
186
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
186
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
187
187
  }
188
- function d(f, S, A, M, W, I, q, te) {
189
- var N = S.children;
190
- if (N !== void 0)
191
- if (M)
192
- if (z(N)) {
193
- for (M = 0; M < N.length; M++)
194
- l(N[M]);
195
- Object.freeze && Object.freeze(N);
188
+ function f(h, S, k, L, q, I, H, te) {
189
+ var O = S.children;
190
+ if (O !== void 0)
191
+ if (L)
192
+ if (W(O)) {
193
+ for (L = 0; L < O.length; L++)
194
+ l(O[L]);
195
+ Object.freeze && Object.freeze(O);
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 l(N);
200
+ else l(O);
201
201
  if (F.call(S, "key")) {
202
- N = t(f);
203
- var G = Object.keys(S).filter(function(Te) {
204
- return Te !== "key";
202
+ O = t(h);
203
+ var G = Object.keys(S).filter(function(Ce) {
204
+ return Ce !== "key";
205
205
  });
206
- M = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", ee[N + M] || (G = 0 < G.length ? "{" + G.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ L = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", ee[O + L] || (G = 0 < G.length ? "{" + G.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
- M,
214
- N,
213
+ L,
214
+ O,
215
215
  G,
216
- N
217
- ), ee[N + M] = !0);
216
+ O
217
+ ), ee[O + L] = !0);
218
218
  }
219
- if (N = null, A !== void 0 && (r(A), N = "" + A), i(S) && (r(S.key), N = "" + S.key), "key" in S) {
220
- A = {};
221
- for (var re in S)
222
- re !== "key" && (A[re] = S[re]);
223
- } else A = S;
224
- return N && a(
225
- A,
226
- typeof f == "function" ? f.displayName || f.name || "Unknown" : f
227
- ), h(
228
- f,
229
- N,
219
+ if (O = null, k !== void 0 && (n(k), O = "" + k), i(S) && (n(S.key), O = "" + S.key), "key" in S) {
220
+ k = {};
221
+ for (var ne in S)
222
+ ne !== "key" && (k[ne] = S[ne]);
223
+ } else k = S;
224
+ return O && a(
225
+ k,
226
+ typeof h == "function" ? h.displayName || h.name || "Unknown" : h
227
+ ), p(
228
+ h,
229
+ O,
230
230
  I,
231
- W,
232
- o(),
233
- A,
234
231
  q,
232
+ o(),
233
+ k,
234
+ H,
235
235
  te
236
236
  );
237
237
  }
238
- function l(f) {
239
- typeof f == "object" && f !== null && f.$$typeof === p && f._store && (f._store.validated = 1);
238
+ function l(h) {
239
+ typeof h == "object" && h !== null && h.$$typeof === d && h._store && (h._store.validated = 1);
240
240
  }
241
- var u = Lt, p = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), E = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), K = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), x = Symbol.for("react.client.reference"), P = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, z = Array.isArray, ne = console.createTask ? console.createTask : function() {
241
+ var u = Dt, d = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), T = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), M = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, W = Array.isArray, re = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
244
  u = {
245
- "react-stack-bottom-frame": function(f) {
246
- return f();
245
+ "react-stack-bottom-frame": function(h) {
246
+ return h();
247
247
  }
248
248
  };
249
- var he, pe = {}, se = u["react-stack-bottom-frame"].bind(
249
+ var pe, he = {}, ie = u["react-stack-bottom-frame"].bind(
250
250
  u,
251
251
  s
252
- )(), me = ne(n(s)), ee = {};
253
- ae.Fragment = b, ae.jsx = function(f, S, A, M, W) {
254
- var I = 1e4 > P.recentlyCreatedOwnerStacks++;
255
- return d(
256
- f,
252
+ )(), me = re(r(s)), ee = {};
253
+ ce.Fragment = b, ce.jsx = function(h, S, k, L, q) {
254
+ var I = 1e4 > M.recentlyCreatedOwnerStacks++;
255
+ return f(
256
+ h,
257
257
  S,
258
- A,
258
+ k,
259
259
  !1,
260
- M,
261
- W,
262
- I ? Error("react-stack-top-frame") : se,
263
- I ? ne(n(f)) : me
260
+ L,
261
+ q,
262
+ I ? Error("react-stack-top-frame") : ie,
263
+ I ? re(r(h)) : me
264
264
  );
265
- }, ae.jsxs = function(f, S, A, M, W) {
266
- var I = 1e4 > P.recentlyCreatedOwnerStacks++;
267
- return d(
268
- f,
265
+ }, ce.jsxs = function(h, S, k, L, q) {
266
+ var I = 1e4 > M.recentlyCreatedOwnerStacks++;
267
+ return f(
268
+ h,
269
269
  S,
270
- A,
270
+ k,
271
271
  !0,
272
- M,
273
- W,
274
- I ? Error("react-stack-top-frame") : se,
275
- I ? ne(n(f)) : me
272
+ L,
273
+ q,
274
+ I ? Error("react-stack-top-frame") : ie,
275
+ I ? re(r(h)) : me
276
276
  );
277
277
  };
278
- }()), ae;
278
+ }()), ce;
279
279
  }
280
- var Qe;
281
- function Ht() {
282
- return Qe || (Qe = 1, process.env.NODE_ENV === "production" ? ge.exports = qt() : ge.exports = Gt()), ge.exports;
280
+ var tt;
281
+ function Qt() {
282
+ return tt || (tt = 1, process.env.NODE_ENV === "production" ? ge.exports = Xt() : ge.exports = Zt()), ge.exports;
283
283
  }
284
- var R = Ht();
285
- function Jt(t, e) {
286
- const r = $e(
287
- (n) => t.subscribe(n),
284
+ var E = Qt();
285
+ function en(t, e) {
286
+ const n = Ke(
287
+ (r) => t.subscribe(r),
288
288
  () => {
289
- const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
289
+ const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
290
290
  return `${o ?? ""}:${s?.id ?? ""}`;
291
291
  },
292
292
  () => {
293
- const n = t.getSnapshot(), o = e ?? n.rootViewId, s = o ? n.views.get(o) : void 0;
293
+ const r = t.getSnapshot(), o = e ?? r.rootViewId, s = o ? r.views.get(o) : void 0;
294
294
  return `${o ?? ""}:${s?.id ?? ""}`;
295
295
  }
296
296
  );
297
- return V(() => {
298
- const [n, o] = r.split(":");
297
+ return K(() => {
298
+ const [r, o] = n.split(":");
299
299
  return {
300
- rootViewId: n || void 0,
300
+ rootViewId: r || void 0,
301
301
  rootNodeId: o || void 0
302
302
  };
303
- }, [r]);
303
+ }, [n]);
304
304
  }
305
305
  function Z(t, e) {
306
- const r = $e(
307
- (n) => t.subscribeNode(e, n),
306
+ const n = Ke(
307
+ (r) => t.subscribeNode(e, r),
308
308
  () => t.getNodeVersion(e),
309
309
  () => t.getNodeVersion(e)
310
310
  );
311
- return V(() => t.getNode(e), [t, e, r]);
311
+ return K(() => t.getNode(e), [t, e, n]);
312
312
  }
313
- const Xt = Re("UIRenderer");
314
- function Zt(t) {
313
+ const tn = ke("UIRenderer");
314
+ function nn(t) {
315
315
  if (t === void 0)
316
316
  return "{}";
317
317
  if (typeof t == "string")
@@ -322,72 +322,72 @@ function Zt(t) {
322
322
  return "{}";
323
323
  }
324
324
  }
325
- function Qt(t) {
325
+ function rn(t) {
326
326
  const e = t.styleIds;
327
327
  return Array.isArray(e) ? e : [];
328
328
  }
329
- function er(t) {
329
+ function on(t) {
330
330
  const e = t.children;
331
331
  return Array.isArray(e) ? e : [];
332
332
  }
333
- function tr(t, e) {
333
+ function sn(t, e) {
334
334
  return t.nodeId === e.nodeId && t.context === e.context;
335
335
  }
336
- function rr(t) {
336
+ function an(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;
340
- for (let r = 1; r < t.length; r++)
341
- e += "," + t[r].id;
340
+ for (let n = 1; n < t.length; n++)
341
+ e += "," + t[n].id;
342
342
  return e;
343
343
  }
344
- const je = Y(function t({ nodeId: e, context: r }) {
345
- const n = Z(r.store, e), o = n ? er(n) : [], s = rr(o), i = V(
346
- () => o.length === 0 ? null : o.map((l) => /* @__PURE__ */ R.jsx(t, { nodeId: l.id, context: r }, l.id)),
344
+ const je = z(function t({ nodeId: e, context: n }) {
345
+ const r = Z(n.store, e), o = r ? on(r) : [], s = an(o), i = K(
346
+ () => o.length === 0 ? null : o.map((l) => /* @__PURE__ */ E.jsx(t, { nodeId: l.id, context: n }, l.id)),
347
347
  // eslint-disable-next-line react-hooks/exhaustive-deps
348
- [s, r]
348
+ [s, n]
349
349
  );
350
- if (!n)
350
+ if (!r)
351
351
  return null;
352
- if (n.type === "root")
353
- return /* @__PURE__ */ R.jsx(jt, { children: i }, n.id);
354
- const a = r.library.resolve(n);
352
+ if (r.type === "root")
353
+ return /* @__PURE__ */ E.jsx(Bt, { children: i }, r.id);
354
+ const a = n.library.resolve(r);
355
355
  if (!a)
356
- return Xt.warn(`No renderer for node type ${n.type}`), null;
357
- const c = Qt(n), h = c.length > 0 ? c.join(" ") : void 0, d = a;
358
- return /* @__PURE__ */ R.jsx(d, { nodeId: e, context: r, className: h });
359
- }, tr);
360
- function nr(t, e) {
361
- return !Array.isArray(t) || t.length === 0 ? null : t.map((r) => /* @__PURE__ */ R.jsx(je, { nodeId: r.id, context: e }, r.id));
362
- }
363
- function or(t, e) {
356
+ return tn.warn(`No renderer for node type ${r.type}`), null;
357
+ const c = rn(r), p = c.length > 0 ? c.join(" ") : void 0, f = a;
358
+ return /* @__PURE__ */ E.jsx(f, { nodeId: e, context: n, className: p });
359
+ }, sn);
360
+ function cn(t, e) {
361
+ return !Array.isArray(t) || t.length === 0 ? null : t.map((n) => /* @__PURE__ */ E.jsx(je, { nodeId: n.id, context: e }, n.id));
362
+ }
363
+ function un(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 sr = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
- const { rootViewId: c, rootNodeId: h } = Jt(e, n), d = w(s);
368
- d.current = s;
369
- const l = w(i);
366
+ const ln = z(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
+ const { rootViewId: c, rootNodeId: p } = en(e, r), f = v(s);
368
+ f.current = s;
369
+ const l = v(i);
370
370
  l.current = i;
371
- const u = w(a);
371
+ const u = v(a);
372
372
  u.current = a;
373
- const p = D((b, g) => {
373
+ const d = D((b, g) => {
374
374
  if (!b)
375
375
  return;
376
- const y = Zt(g);
377
- d.current?.(b, y);
378
- }, []), m = V(() => {
376
+ const y = nn(g);
377
+ f.current?.(b, y);
378
+ }, []), m = K(() => {
379
379
  const b = {
380
380
  store: e,
381
- library: r,
381
+ library: n,
382
382
  handlerCache: e.handlerCache,
383
383
  // Access payloads from store at call time, not captured snapshot
384
384
  getPayload: (g) => e.getSnapshot().payloads.get(g),
385
- renderChildren: (g) => nr(g, b),
385
+ renderChildren: (g) => cn(g, b),
386
386
  renderView: (g) => {
387
387
  const y = e.getSnapshot().views.get(g);
388
- return y ? /* @__PURE__ */ R.jsx(je, { nodeId: y.id, context: b }) : null;
388
+ return y ? /* @__PURE__ */ E.jsx(je, { nodeId: y.id, context: b }) : null;
389
389
  },
390
- dispatchAction: p,
390
+ dispatchAction: d,
391
391
  // Access client/video via refs to avoid context recreation
392
392
  get client() {
393
393
  return l.current;
@@ -397,18 +397,18 @@ const sr = Y(function({ store: e, library: r, viewId: n, emptyFallback: o = null
397
397
  }
398
398
  };
399
399
  return b;
400
- }, [e, r, p]);
401
- return !c || !h ? o : /* @__PURE__ */ R.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ R.jsx(je, { nodeId: h, context: m }) });
402
- }, or);
403
- class ir {
404
- constructor(e, r) {
405
- if (this.fallback = r, e)
406
- for (const [n, o] of e)
407
- this.renderers.set(n, o);
400
+ }, [e, n, d]);
401
+ return !c || !p ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(je, { nodeId: p, context: m }) });
402
+ }, un);
403
+ class dn {
404
+ constructor(e, n) {
405
+ if (this.fallback = n, e)
406
+ for (const [r, o] of e)
407
+ this.renderers.set(r, o);
408
408
  }
409
409
  renderers = /* @__PURE__ */ new Map();
410
- register(e, r) {
411
- this.renderers.set(e, r);
410
+ register(e, n) {
411
+ this.renderers.set(e, n);
412
412
  }
413
413
  setFallback(e) {
414
414
  this.fallback = e;
@@ -417,103 +417,103 @@ class ir {
417
417
  return this.renderers.get(e.type) ?? this.fallback;
418
418
  }
419
419
  }
420
- function Eo(t, e) {
421
- const r = Object.entries(t);
422
- return new ir(r, e);
420
+ function Po(t, e) {
421
+ const n = Object.entries(t);
422
+ return new dn(n, e);
423
423
  }
424
- function Ro(t) {
425
- return $e(
424
+ function Mo(t) {
425
+ return Ke(
426
426
  (e) => t.subscribe(e),
427
427
  () => t.getSnapshot(),
428
428
  () => t.getSnapshot()
429
429
  );
430
430
  }
431
- function ar() {
432
- const t = Ut();
433
- return U(() => {
431
+ function fn() {
432
+ const t = Ft();
433
+ return N(() => {
434
434
  if (!t)
435
435
  return;
436
- let e = null, r = [];
437
- const n = document.createElement("div");
438
- n.style.cssText = "position:fixed;z-index:99999;pointer-events:none;padding:2px 6px;background:#1e1e2e;color:#cdd6f4;font-size:11px;border-radius:4px;border:1px solid #45475a;white-space:nowrap;display:none;font-family:monospace;", document.body.appendChild(n);
436
+ let e = null, n = [];
437
+ const r = document.createElement("div");
438
+ r.style.cssText = "position:fixed;z-index:99999;pointer-events:none;padding:2px 6px;background:#1e1e2e;color:#cdd6f4;font-size:11px;border-radius:4px;border:1px solid #45475a;white-space:nowrap;display:none;font-family:monospace;", document.body.appendChild(r);
439
439
  function o() {
440
- e && !r.includes(e) && (e.style.outline = "", e.style.outlineOffset = ""), e = null, n.style.display = "none";
440
+ e && !n.includes(e) && (e.style.outline = "", e.style.outlineOffset = ""), e = null, r.style.display = "none";
441
441
  }
442
442
  function s(u) {
443
- for (const m of r)
443
+ for (const m of n)
444
444
  m !== e && (m.style.outline = "", m.style.outlineOffset = "");
445
- r = [];
446
- const p = new Set(u);
445
+ n = [];
446
+ const d = new Set(u);
447
447
  for (const m of document.querySelectorAll("[data-ikon-source]")) {
448
448
  const b = m.getAttribute("data-ikon-source") ?? "";
449
- p.has(b) && (m.style.outline = "2px solid #a6e3a1", m.style.outlineOffset = "1px", r.push(m));
449
+ d.has(b) && (m.style.outline = "2px solid #a6e3a1", m.style.outlineOffset = "1px", n.push(m));
450
450
  }
451
451
  }
452
452
  function i(u) {
453
- const p = u.target.closest?.("[data-ikon-source]");
454
- if (!p || p === e)
453
+ const d = u.target.closest?.("[data-ikon-source]");
454
+ if (!d || d === e)
455
455
  return;
456
- o(), e = p, e.style.outline = "2px solid #89b4fa", e.style.outlineOffset = "1px";
457
- const m = p.getAttribute("data-ikon-source") ?? "";
458
- n.textContent = m, n.style.display = "block";
459
- const b = p.getBoundingClientRect();
460
- n.style.left = `${b.left}px`, n.style.top = `${Math.max(0, b.top - 24)}px`;
456
+ o(), e = d, e.style.outline = "2px solid #89b4fa", e.style.outlineOffset = "1px";
457
+ const m = d.getAttribute("data-ikon-source") ?? "";
458
+ r.textContent = m, r.style.display = "block";
459
+ const b = d.getBoundingClientRect();
460
+ r.style.left = `${b.left}px`, r.style.top = `${Math.max(0, b.top - 24)}px`;
461
461
  }
462
462
  function a(u) {
463
463
  u.relatedTarget?.closest?.("[data-ikon-source]") !== e && o();
464
464
  }
465
465
  function c(u) {
466
- const p = u.target.closest?.("[data-ikon-source]");
467
- if (!p)
466
+ const d = u.target.closest?.("[data-ikon-source]");
467
+ if (!d)
468
468
  return;
469
469
  u.preventDefault(), u.stopPropagation();
470
470
  const m = {
471
- sourceMarker: p.getAttribute("data-ikon-source") ?? "",
472
- tagName: p.tagName.toLowerCase(),
473
- textContent: (p.textContent ?? "").trim().substring(0, 200)
471
+ sourceMarker: d.getAttribute("data-ikon-source") ?? "",
472
+ tagName: d.tagName.toLowerCase(),
473
+ textContent: (d.textContent ?? "").trim().substring(0, 200)
474
474
  };
475
475
  window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
476
476
  }
477
- function h(u, p) {
478
- return document.elementFromPoint(u, p)?.closest?.("[data-ikon-source]");
477
+ function p(u, d) {
478
+ return document.elementFromPoint(u, d)?.closest?.("[data-ikon-source]");
479
479
  }
480
- function d(u) {
480
+ function f(u) {
481
481
  if (u === e || (o(), !u))
482
482
  return;
483
- e = u, e.style.outline = `2px solid ${r.includes(u) ? "#a6e3a1" : "#89b4fa"}`, e.style.outlineOffset = "1px";
484
- const p = u.getAttribute("data-ikon-source") ?? "";
485
- n.textContent = p, n.style.display = "block";
483
+ e = u, e.style.outline = `2px solid ${n.includes(u) ? "#a6e3a1" : "#89b4fa"}`, e.style.outlineOffset = "1px";
484
+ const d = u.getAttribute("data-ikon-source") ?? "";
485
+ r.textContent = d, r.style.display = "block";
486
486
  const m = u.getBoundingClientRect();
487
- n.style.left = `${m.left}px`, n.style.top = `${Math.max(0, m.top - 24)}px`;
487
+ r.style.left = `${m.left}px`, r.style.top = `${Math.max(0, m.top - 24)}px`;
488
488
  }
489
489
  function l(u) {
490
490
  if (u.data?.type === "ikon-inspect-at") {
491
- const p = h(u.data.x, u.data.y);
492
- d(p);
493
- const m = p?.getAttribute("data-ikon-source") ?? "";
491
+ const d = p(u.data.x, u.data.y);
492
+ f(d);
493
+ const m = d?.getAttribute("data-ikon-source") ?? "";
494
494
  window.parent.postMessage({
495
495
  type: "ikon-inspect-hover-result",
496
496
  payload: { sourceMarker: m }
497
497
  }, "*");
498
498
  }
499
499
  if (u.data?.type === "ikon-inspect-click") {
500
- const p = h(u.data.x, u.data.y);
501
- if (p) {
500
+ const d = p(u.data.x, u.data.y);
501
+ if (d) {
502
502
  const m = {
503
- sourceMarker: p.getAttribute("data-ikon-source") ?? "",
504
- tagName: p.tagName.toLowerCase(),
505
- textContent: (p.textContent ?? "").trim().substring(0, 200)
503
+ sourceMarker: d.getAttribute("data-ikon-source") ?? "",
504
+ tagName: d.tagName.toLowerCase(),
505
+ textContent: (d.textContent ?? "").trim().substring(0, 200)
506
506
  };
507
507
  window.dispatchEvent(new CustomEvent("ikon-inspect-select", { detail: m })), window.parent.postMessage({ type: "ikon-element-selected", payload: m }, "*");
508
508
  }
509
509
  }
510
510
  if (u.data?.type === "ikon-inspect-click-add") {
511
- const p = h(u.data.x, u.data.y);
512
- if (p) {
511
+ const d = p(u.data.x, u.data.y);
512
+ if (d) {
513
513
  const m = {
514
- sourceMarker: p.getAttribute("data-ikon-source") ?? "",
515
- tagName: p.tagName.toLowerCase(),
516
- textContent: (p.textContent ?? "").trim().substring(0, 200)
514
+ sourceMarker: d.getAttribute("data-ikon-source") ?? "",
515
+ tagName: d.tagName.toLowerCase(),
516
+ textContent: (d.textContent ?? "").trim().substring(0, 200)
517
517
  };
518
518
  window.parent.postMessage({
519
519
  type: "ikon-inspect-rect-result",
@@ -522,54 +522,54 @@ function ar() {
522
522
  }
523
523
  }
524
524
  if (u.data?.type === "ikon-inspect-rect") {
525
- const { x1: p, y1: m, x2: b, y2: g, append: y } = u.data, v = document.querySelectorAll("[data-ikon-source]"), E = [];
526
- for (const T of v) {
527
- const O = T.getBoundingClientRect();
528
- O.right > p && O.left < b && O.bottom > m && O.top < g && E.push({
529
- sourceMarker: T.getAttribute("data-ikon-source") ?? "",
530
- tagName: T.tagName.toLowerCase(),
531
- textContent: (T.textContent ?? "").trim().substring(0, 200)
525
+ const { x1: d, y1: m, x2: b, y2: g, append: y } = u.data, w = document.querySelectorAll("[data-ikon-source]"), T = [];
526
+ for (const C of w) {
527
+ const _ = C.getBoundingClientRect();
528
+ _.right > d && _.left < b && _.bottom > m && _.top < g && T.push({
529
+ sourceMarker: C.getAttribute("data-ikon-source") ?? "",
530
+ tagName: C.tagName.toLowerCase(),
531
+ textContent: (C.textContent ?? "").trim().substring(0, 200)
532
532
  });
533
533
  }
534
- E.length > 0 && window.parent.postMessage({
534
+ T.length > 0 && window.parent.postMessage({
535
535
  type: "ikon-inspect-rect-result",
536
- payload: { elements: E, append: y ?? !1 }
536
+ payload: { elements: T, append: y ?? !1 }
537
537
  }, "*");
538
538
  }
539
539
  u.data?.type === "ikon-inspect-highlight" && s(u.data.markers ?? []), u.data?.type === "ikon-inspect-clear" && o();
540
540
  }
541
541
  return document.addEventListener("mouseover", i, !0), document.addEventListener("mouseout", a, !0), document.addEventListener("click", c, !0), window.addEventListener("message", l), () => {
542
- document.removeEventListener("mouseover", i, !0), document.removeEventListener("mouseout", a, !0), document.removeEventListener("click", c, !0), window.removeEventListener("message", l), o(), s([]), n.remove();
542
+ document.removeEventListener("mouseover", i, !0), document.removeEventListener("mouseout", a, !0), document.removeEventListener("click", c, !0), window.removeEventListener("message", l), o(), s([]), r.remove();
543
543
  };
544
544
  }, [t]), null;
545
545
  }
546
546
  const Ue = "ikon-ui";
547
- function cr(t, e) {
547
+ function pn(t, e) {
548
548
  return t === e;
549
549
  }
550
- const ko = Y(function({ stores: e, registry: r, category: n = Ue, onAction: o, client: s }) {
551
- const i = V(() => Array.from(e.keys()).sort().join(","), [e]), a = w(o);
550
+ const Lo = z(function({ stores: e, registry: n, category: r = Ue, onAction: o, client: s }) {
551
+ const i = K(() => Array.from(e.keys()).sort().join(","), [e]), a = v(o);
552
552
  a.current = o;
553
- const c = w(s);
553
+ const c = v(s);
554
554
  c.current = s;
555
- const h = V(
555
+ const p = K(
556
556
  () => {
557
- const d = [];
557
+ const f = [];
558
558
  for (const [l, u] of e) {
559
- const p = u.store.getSnapshot();
560
- cr(u.category, n) && (!p.rootViewId || !p.views.has(p.rootViewId) || d.push({ key: l, store: u.store }));
559
+ const d = u.store.getSnapshot();
560
+ pn(u.category, r) && (!d.rootViewId || !d.views.has(d.rootViewId) || f.push({ key: l, store: u.store }));
561
561
  }
562
- return d;
562
+ return f;
563
563
  },
564
564
  // eslint-disable-next-line react-hooks/exhaustive-deps
565
- [e, n, i]
565
+ [e, r, i]
566
566
  );
567
- return h.length === 0 ? null : /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
568
- /* @__PURE__ */ R.jsx(ar, {}),
569
- h.map(({ key: d, store: l }) => /* @__PURE__ */ R.jsx(sr, { store: l, library: r, onAction: a.current, client: c.current, video: c.current?.media?.video }, d))
567
+ return p.length === 0 ? null : /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
568
+ /* @__PURE__ */ E.jsx(fn, {}),
569
+ p.map(({ key: f, store: l }) => /* @__PURE__ */ E.jsx(ln, { store: l, library: n, onAction: a.current, client: c.current, video: c.current?.media?.video }, f))
570
570
  ] });
571
571
  });
572
- class ur {
572
+ class hn {
573
573
  core;
574
574
  ownsCore;
575
575
  stores = /* @__PURE__ */ new Map();
@@ -577,7 +577,7 @@ class ur {
577
577
  unsubscribeClears;
578
578
  unsubscribeStoreChanges;
579
579
  constructor(e) {
580
- this.core = e?.core ?? new Pt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
580
+ this.core = e?.core ?? new jt({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
581
581
  }
582
582
  dispose() {
583
583
  this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
@@ -603,123 +603,195 @@ class ur {
603
603
  this.stores.delete(e) && this.notify(e);
604
604
  };
605
605
  syncStreamSnapshot = (e) => {
606
- const r = this.core.uiStore.getSnapshot(e);
607
- if (!r || !r.rootViewId) {
606
+ const n = this.core.uiStore.getSnapshot(e);
607
+ if (!n || !n.rootViewId) {
608
608
  this.handleUiStreamCleared(e);
609
609
  return;
610
610
  }
611
- if (!r.views.get(r.rootViewId)) {
611
+ if (!n.views.get(n.rootViewId)) {
612
612
  this.handleUiStreamCleared(e);
613
613
  return;
614
614
  }
615
- const s = this.ensureStoreEntry(e).store.replaceSnapshot(r), i = this.updateCategory(e, r.category);
615
+ const s = this.ensureStoreEntry(e).store.replaceSnapshot(n), i = this.updateCategory(e, n.category);
616
616
  (s || i) && this.notify(e);
617
617
  };
618
618
  syncAllStreams() {
619
- const e = this.core.uiStore.getSnapshots(), r = /* @__PURE__ */ new Set();
620
- for (const n of e)
621
- this.syncStreamSnapshot(n.streamId), r.add(n.streamId);
622
- for (const n of this.stores.keys())
623
- r.has(n) || (this.stores.delete(n), this.notify(n));
619
+ const e = this.core.uiStore.getSnapshots(), n = /* @__PURE__ */ new Set();
620
+ for (const r of e)
621
+ this.syncStreamSnapshot(r.streamId), n.add(r.streamId);
622
+ for (const r of this.stores.keys())
623
+ n.has(r) || (this.stores.delete(r), this.notify(r));
624
624
  }
625
625
  ensureStoreEntry(e) {
626
- const r = this.stores.get(e);
627
- if (r)
628
- return r;
629
- const n = {
626
+ const n = this.stores.get(e);
627
+ if (n)
628
+ return n;
629
+ const r = {
630
630
  category: Ue,
631
- store: new Mt()
631
+ store: new Ut()
632
632
  };
633
- return this.stores.set(e, n), n;
633
+ return this.stores.set(e, r), r;
634
634
  }
635
- updateCategory(e, r) {
636
- const n = this.stores.get(e);
637
- if (!n)
635
+ updateCategory(e, n) {
636
+ const r = this.stores.get(e);
637
+ if (!r)
638
638
  return !1;
639
- const o = r ?? this.core.uiStore.getSnapshot(e)?.category ?? Ue;
640
- return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
639
+ const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? Ue;
640
+ return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
641
641
  }
642
642
  notify(e) {
643
- for (const r of this.listeners)
644
- r(e);
643
+ for (const n of this.listeners)
644
+ n(e);
645
645
  }
646
646
  }
647
- function lr(t) {
647
+ function mn(t) {
648
648
  if (typeof t == "string") {
649
649
  const e = t.trim();
650
650
  return e.length > 0 ? e : void 0;
651
651
  }
652
652
  }
653
- function fe(t) {
653
+ function oe(t) {
654
654
  if (typeof t == "string") {
655
655
  const e = t.trim();
656
656
  return e.length > 0 ? e : void 0;
657
657
  }
658
658
  if (Array.isArray(t)) {
659
- const e = t.filter((r) => typeof r == "string").map((r) => r.trim()).filter(Boolean);
659
+ const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
660
660
  return e.length > 0 ? e.join(" ") : void 0;
661
661
  }
662
662
  }
663
- function Ke(...t) {
663
+ function ze(...t) {
664
664
  let e = "";
665
- for (const r of t)
666
- if (r) {
667
- const n = r.trim();
668
- n && (e = e ? e + " " + n : n);
665
+ for (const n of t)
666
+ if (n) {
667
+ const r = n.trim();
668
+ r && (e = e ? e + " " + r : r);
669
669
  }
670
670
  return e || void 0;
671
671
  }
672
- const et = /* @__PURE__ */ new WeakMap(), dr = {};
673
- function Ye(t) {
672
+ const nt = /* @__PURE__ */ new WeakMap(), gn = {};
673
+ function We(t) {
674
674
  if (!t)
675
- return dr;
676
- const e = et.get(t);
675
+ return gn;
676
+ const e = nt.get(t);
677
677
  if (e)
678
678
  return e;
679
- const r = {};
680
- for (const [n, o] of Object.entries(t))
681
- o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (r[n] = o);
682
- return et.set(t, r), r;
683
- }
684
- function fr() {
685
- const t = Y(function({ nodeId: r, context: n }) {
686
- const o = Z(n.store, r), s = w(null), i = fe(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, h = fe(o?.props?.key), d = o?.props?.preciseGeneratedAt;
687
- return U(() => {
679
+ const n = {};
680
+ for (const [r, o] of Object.entries(t))
681
+ o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
682
+ return nt.set(t, n), n;
683
+ }
684
+ function yn(t) {
685
+ let e = t.parentElement;
686
+ for (; e; ) {
687
+ const r = window.getComputedStyle(e).overflowY;
688
+ if (r === "auto" || r === "scroll" || e.hasAttribute("data-radix-scroll-area-viewport"))
689
+ return e;
690
+ e = e.parentElement;
691
+ }
692
+ return null;
693
+ }
694
+ function bt(t, e) {
695
+ requestAnimationFrame(() => {
696
+ const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), o = t.scrollTop + (r.bottom - n.bottom) + 16;
697
+ "scrollBehavior" in document.documentElement.style ? t.scrollTo({ top: o, behavior: "smooth" }) : t.scrollTop = o;
698
+ });
699
+ }
700
+ const De = "data-ikon-scroll-indicator", bn = 0.15, Se = "data-ikon-at-bottom";
701
+ function St(t) {
702
+ return Math.max(t.clientHeight * bn, 20);
703
+ }
704
+ function Sn(t) {
705
+ return t.getAttribute(Se) !== "false";
706
+ }
707
+ function wn(t) {
708
+ t.getAttribute(Se) === null && (t.setAttribute(Se, "true"), t.addEventListener("scroll", () => {
709
+ const { scrollTop: e, scrollHeight: n, clientHeight: r } = t, s = n - e - r <= St(t);
710
+ t.setAttribute(Se, s ? "true" : "false");
711
+ }, { passive: !0 }));
712
+ }
713
+ function vn(t) {
714
+ const e = t.parentElement ?? t, n = e.querySelector(`[${De}]`);
715
+ if (n)
716
+ return n;
717
+ const r = document.createElement("button");
718
+ return r.setAttribute(De, "true"), r.setAttribute("aria-label", "Scroll to latest"), r.textContent = "↓", Object.assign(r.style, {
719
+ position: "absolute",
720
+ bottom: "12px",
721
+ left: "50%",
722
+ transform: "translateX(-50%)",
723
+ zIndex: "10",
724
+ width: "32px",
725
+ height: "32px",
726
+ borderRadius: "50%",
727
+ border: "1px solid var(--border-primary, #e5e5e5)",
728
+ backgroundColor: "var(--bg-primary, #ffffff)",
729
+ color: "var(--fg-primary, #0c0e12)",
730
+ cursor: "pointer",
731
+ display: "none",
732
+ alignItems: "center",
733
+ justifyContent: "center",
734
+ fontSize: "16px",
735
+ lineHeight: "1",
736
+ boxShadow: "0 2px 8px rgba(0,0,0,0.25)",
737
+ transition: "opacity 150ms",
738
+ opacity: "1",
739
+ padding: "0"
740
+ }), r.addEventListener("mouseenter", () => {
741
+ r.style.opacity = "1";
742
+ }), r.addEventListener("mouseleave", () => {
743
+ r.style.opacity = "0.9";
744
+ }), e.appendChild(r), r;
745
+ }
746
+ function En(t, e) {
747
+ const n = vn(t);
748
+ n.style.display = "flex";
749
+ const r = () => {
750
+ bt(t, e), n.style.display = "none";
751
+ }, o = () => {
752
+ const { scrollTop: s, scrollHeight: i, clientHeight: a } = t;
753
+ i - s - a <= St(t) && (n.style.display = "none");
754
+ };
755
+ return n.addEventListener("click", r), t.addEventListener("scroll", o, { passive: !0 }), () => {
756
+ n.removeEventListener("click", r), t.removeEventListener("scroll", o);
757
+ };
758
+ }
759
+ function Rn() {
760
+ const t = z(function({ nodeId: n, context: r }) {
761
+ const o = Z(r.store, n), s = v(null), i = oe(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0, p = oe(o?.props?.priority), f = oe(o?.props?.key), l = o?.props?.preciseGeneratedAt;
762
+ return N(() => {
688
763
  if (typeof document > "u")
689
764
  return;
690
- const u = s.current;
691
- if (!u || i && u.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
765
+ const d = s.current;
766
+ if (!d || i && d.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
692
767
  return;
768
+ let m;
693
769
  if (c !== !0) {
694
- const y = ((v) => {
695
- let E = v.parentElement;
696
- for (; E; ) {
697
- const O = window.getComputedStyle(E).overflowY;
698
- if (O === "auto" || O === "scroll" || E.hasAttribute("data-radix-scroll-area-viewport"))
699
- return E;
700
- E = E.parentElement;
770
+ const w = yn(d);
771
+ if (w)
772
+ if (wn(w), p === "Polite" && !Sn(w))
773
+ m = En(w, d);
774
+ else {
775
+ const B = (w.parentElement ?? w).querySelector(`[${De}]`);
776
+ B && (B.style.display = "none"), bt(w, d);
701
777
  }
702
- return null;
703
- })(u);
704
- y ? requestAnimationFrame(() => {
705
- const v = y.getBoundingClientRect(), E = u.getBoundingClientRect(), T = y.scrollTop + (E.bottom - v.bottom) + 16;
706
- "scrollBehavior" in document.documentElement.style ? y.scrollTo({ top: T, behavior: "smooth" }) : y.scrollTop = T;
707
- }) : typeof u.scrollIntoView == "function" && requestAnimationFrame(() => {
778
+ else typeof d.scrollIntoView == "function" && requestAnimationFrame(() => {
708
779
  try {
709
- u.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
780
+ d.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" });
710
781
  } catch {
711
- u.scrollIntoView(!1);
782
+ d.scrollIntoView(!1);
712
783
  }
713
784
  });
714
785
  }
715
- const m = document.activeElement;
716
- if (!(m instanceof HTMLInputElement || m instanceof HTMLTextAreaElement || m?.getAttribute("contenteditable") === "true") && typeof u.focus == "function")
786
+ const g = document.activeElement;
787
+ if (!(g instanceof HTMLInputElement || g instanceof HTMLTextAreaElement || g?.getAttribute("contenteditable") === "true") && typeof d.focus == "function")
717
788
  try {
718
- u.focus({ preventScroll: !0 });
789
+ d.focus({ preventScroll: !0 });
719
790
  } catch {
720
- u.focus();
791
+ d.focus();
721
792
  }
722
- }, [c, i, h, d]), o ? /* @__PURE__ */ R.jsx(
793
+ return m;
794
+ }, [c, p, i, f, l]), o ? /* @__PURE__ */ E.jsx(
723
795
  "span",
724
796
  {
725
797
  ref: s,
@@ -737,26 +809,26 @@ function fr() {
737
809
  return t;
738
810
  };
739
811
  }
740
- function hr() {
741
- const t = Y(function({ nodeId: r, context: n, className: o }) {
742
- const s = Z(n.store, r), i = lr(s?.props?.onInvokeId), a = D(() => {
743
- i && n.dispatchAction(i);
744
- }, [i, n]);
812
+ function kn() {
813
+ const t = z(function({ nodeId: n, context: r, className: o }) {
814
+ const s = Z(r.store, n), i = mn(s?.props?.onInvokeId), a = D(() => {
815
+ i && r.dispatchAction(i);
816
+ }, [i, r]);
745
817
  if (!s)
746
818
  return null;
747
- const c = Ye(s.props);
819
+ const c = We(s.props);
748
820
  delete c.onInvokeId;
749
- const h = Ke(fe(s.props?.className), o), d = s.children?.length ? n.renderChildren(s.children) : void 0;
750
- return /* @__PURE__ */ R.jsx(
821
+ const p = ze(oe(s.props?.className), o), f = s.children?.length ? r.renderChildren(s.children) : void 0;
822
+ return /* @__PURE__ */ E.jsx(
751
823
  "div",
752
824
  {
753
825
  ...c,
754
826
  "data-ikon-node-id": s.id,
755
827
  "data-ikon-source": s.sourceMarker,
756
- className: h,
828
+ className: p,
757
829
  onClick: i ? a : void 0,
758
830
  style: i ? { cursor: "pointer" } : void 0,
759
- children: d
831
+ children: f
760
832
  }
761
833
  );
762
834
  });
@@ -765,61 +837,61 @@ function hr() {
765
837
  return t;
766
838
  };
767
839
  }
768
- function pr() {
769
- const t = Y(function({ nodeId: r, context: n, className: o }) {
770
- const s = Z(n.store, r);
840
+ function An() {
841
+ const t = z(function({ nodeId: n, context: r, className: o }) {
842
+ const s = Z(r.store, n);
771
843
  if (!s)
772
844
  return null;
773
- const i = Ye(s.props), a = Ke("relative", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
774
- return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
845
+ const i = We(s.props), a = ze("relative", oe(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
846
+ return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
775
847
  });
776
848
  return ({ type: e }) => {
777
849
  if (e === "std.stack")
778
850
  return t;
779
851
  };
780
852
  }
781
- function mr() {
782
- const t = Y(function({ nodeId: r, context: n, className: o }) {
783
- const s = Z(n.store, r);
853
+ function Tn() {
854
+ const t = z(function({ nodeId: n, context: r, className: o }) {
855
+ const s = Z(r.store, n);
784
856
  if (!s)
785
857
  return null;
786
- const i = Ye(s.props), a = Ke("absolute", fe(s.props?.className), o), c = s.children?.length ? n.renderChildren(s.children) : void 0;
787
- return /* @__PURE__ */ R.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
858
+ const i = We(s.props), a = ze("absolute", oe(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
859
+ return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, "data-ikon-source": s.sourceMarker, className: a, children: c });
788
860
  });
789
861
  return ({ type: e }) => {
790
862
  if (e === "std.layer")
791
863
  return t;
792
864
  };
793
865
  }
794
- function gr() {
866
+ function Cn() {
795
867
  return [
796
- hr(),
797
- pr(),
798
- mr(),
799
- fr()
868
+ kn(),
869
+ An(),
870
+ Tn(),
871
+ Rn()
800
872
  ];
801
873
  }
802
- const yr = "base", br = async () => gr();
803
- function Sr(t) {
804
- t.registerModule(yr, br);
874
+ const In = "base", On = async () => Cn();
875
+ function Nn(t) {
876
+ t.registerModule(In, On);
805
877
  }
806
- function wr(t) {
878
+ function _n(t) {
807
879
  if (typeof t == "string") {
808
880
  const e = t.trim();
809
881
  return e.length > 0 ? e : void 0;
810
882
  }
811
883
  if (Array.isArray(t)) {
812
- const e = t.filter((r) => typeof r == "string").map((r) => r.trim()).filter(Boolean);
884
+ const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
813
885
  return e.length > 0 ? e.join(" ") : void 0;
814
886
  }
815
887
  }
816
- function vr(...t) {
888
+ function Pn(...t) {
817
889
  const e = [];
818
- for (const r of t)
819
- r && r.trim() && e.push(r.trim());
890
+ for (const n of t)
891
+ n && n.trim() && e.push(n.trim());
820
892
  return e.length > 0 ? e.join(" ") : void 0;
821
893
  }
822
- function tt(t) {
894
+ function rt(t) {
823
895
  if (typeof t != "string")
824
896
  return;
825
897
  const e = t.trim();
@@ -834,54 +906,58 @@ function ye(t) {
834
906
  if (e === "false") return !1;
835
907
  }
836
908
  }
837
- const Er = "std.audio-url-player";
838
- function Rr() {
839
- const t = Y(function({
840
- nodeId: r,
841
- context: n,
909
+ const Mn = "std.audio-url-player";
910
+ function Ln() {
911
+ const t = z(function({
912
+ nodeId: n,
913
+ context: r,
842
914
  className: o
843
915
  }) {
844
- const s = Z(n.store, r);
845
- if (!s)
916
+ const s = Z(r.store, n), i = v(null), a = s ? ye(s.props?.autoplay) : void 0, c = s ? rt(s.props?.src) : void 0;
917
+ if (N(() => {
918
+ a && i.current && i.current.play().catch(() => {
919
+ });
920
+ }, [a, c]), !s)
846
921
  return null;
847
- const i = vr(wr(s.props?.className), o), a = tt(s.props?.src), c = tt(s.props?.preload), h = ye(s.props?.controls), d = ye(s.props?.autoplay), l = ye(s.props?.loop), u = ye(s.props?.muted);
848
- return /* @__PURE__ */ R.jsx(
922
+ const p = Pn(_n(s.props?.className), o), f = rt(s.props?.preload), l = ye(s.props?.controls), u = ye(s.props?.loop), d = ye(s.props?.muted);
923
+ return /* @__PURE__ */ E.jsx(
849
924
  "audio",
850
925
  {
851
- src: a,
852
- ...c !== void 0 ? { preload: c } : {},
853
- ...h !== void 0 ? { controls: h } : {},
854
- ...d !== void 0 ? { autoPlay: d } : {},
855
- ...l !== void 0 ? { loop: l } : {},
856
- ...u !== void 0 ? { muted: u } : {},
926
+ ref: i,
927
+ src: c,
928
+ ...f !== void 0 ? { preload: f } : {},
929
+ ...l !== void 0 ? { controls: l } : {},
930
+ ...a !== void 0 ? { autoPlay: a } : {},
931
+ ...u !== void 0 ? { loop: u } : {},
932
+ ...d !== void 0 ? { muted: d } : {},
857
933
  "data-ikon-node-id": s.id,
858
934
  "data-ikon-source": s.sourceMarker,
859
- className: i
935
+ className: p
860
936
  }
861
937
  );
862
938
  });
863
939
  return ({ type: e }) => {
864
- if (e === Er)
940
+ if (e === Mn)
865
941
  return t;
866
942
  };
867
943
  }
868
- function gt(t) {
944
+ function wt(t) {
869
945
  if (typeof t == "string") {
870
946
  const e = t.trim();
871
947
  return e.length > 0 ? e : void 0;
872
948
  }
873
949
  if (Array.isArray(t)) {
874
- const e = t.filter((r) => typeof r == "string").map((r) => r.trim()).filter(Boolean);
950
+ const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
875
951
  return e.length > 0 ? e.join(" ") : void 0;
876
952
  }
877
953
  }
878
- function yt(...t) {
954
+ function vt(...t) {
879
955
  const e = [];
880
- for (const r of t)
881
- r && r.trim() && e.push(r.trim());
956
+ for (const n of t)
957
+ n && n.trim() && e.push(n.trim());
882
958
  return e.length > 0 ? e.join(" ") : void 0;
883
959
  }
884
- function Se(t) {
960
+ function we(t) {
885
961
  if (typeof t == "number" && Number.isFinite(t))
886
962
  return Math.floor(t);
887
963
  if (typeof t == "string" && t.trim().length > 0) {
@@ -890,29 +966,39 @@ function Se(t) {
890
966
  return Math.floor(e);
891
967
  }
892
968
  }
893
- function xe(t) {
969
+ function Be(t) {
894
970
  if (typeof t != "string")
895
971
  return;
896
972
  const e = t.trim();
897
973
  return e.length > 0 ? e : void 0;
898
974
  }
899
- const kr = "std.video-canvas", Ar = "std.video-url-player";
900
- function Tr() {
901
- const t = Y(function({ nodeId: r, context: n, className: o }) {
902
- const s = Z(n.store, r), i = w(null), a = w(null), c = n.video, h = n.client, d = s ? xe(s.props?.streamId) : void 0, l = s ? Se(s.props?.width) : void 0, u = s ? Se(s.props?.height) : void 0, p = s ? yt(gt(s.props?.className), o) : o, m = h?.isWebRtcEnabled && d ? h.getWebRtcVideoStreamByStreamId(d) : null;
903
- return U(() => {
904
- const b = i.current;
905
- if (!(!c || !b || !d || m))
906
- return c.attachCanvas(d, b), () => {
907
- c.detachCanvas(d);
975
+ const xn = "std.video-canvas", jn = "std.video-url-player";
976
+ function Un() {
977
+ const t = z(function({ nodeId: n, context: r, className: o }) {
978
+ const s = Z(r.store, n), i = v(null), a = v(null), c = r.video, p = r.client, f = s ? Be(s.props?.streamId) : void 0, l = s ? we(s.props?.width) : void 0, u = s ? we(s.props?.height) : void 0, d = s ? vt(wt(s.props?.className), o) : o, [, m] = Y(0);
979
+ N(() => {
980
+ if (!p?.isWebRtcEnabled) return;
981
+ const g = p.onWebRtcTrackMapChanged;
982
+ return p.onWebRtcTrackMapChanged = (y) => {
983
+ g?.(y), y.kind === "video" && m((w) => w + 1);
984
+ }, () => {
985
+ p.onWebRtcTrackMapChanged = g;
986
+ };
987
+ }, [p]);
988
+ const b = p?.isWebRtcEnabled && f ? p.getWebRtcVideoStreamByStreamId(f) : null;
989
+ return N(() => {
990
+ const g = i.current;
991
+ if (!(!c || !g || !f || b))
992
+ return c.attachCanvas(f, g), () => {
993
+ c.detachCanvas(f);
908
994
  };
909
- }, [c, d, m]), U(() => {
910
- const b = a.current;
911
- if (!(!b || !m))
912
- return b.srcObject = m, () => {
913
- b.srcObject = null;
995
+ }, [c, f, b]), N(() => {
996
+ const g = a.current;
997
+ if (!(!g || !b))
998
+ return g.srcObject = b, () => {
999
+ g.srcObject = null;
914
1000
  };
915
- }, [m]), s ? m ? /* @__PURE__ */ R.jsx(
1001
+ }, [b]), s ? b ? /* @__PURE__ */ E.jsx(
916
1002
  "video",
917
1003
  {
918
1004
  ref: a,
@@ -921,35 +1007,35 @@ function Tr() {
921
1007
  muted: !0,
922
1008
  "data-ikon-node-id": s.id,
923
1009
  "data-ikon-source": s.sourceMarker,
924
- "data-ikon-video-stream-id": d,
925
- className: p,
1010
+ "data-ikon-video-stream-id": f,
1011
+ className: d,
926
1012
  ...l ? { width: l } : {},
927
1013
  ...u ? { height: u } : {}
928
1014
  },
929
- d
930
- ) : /* @__PURE__ */ R.jsx(
1015
+ f
1016
+ ) : /* @__PURE__ */ E.jsx(
931
1017
  "canvas",
932
1018
  {
933
1019
  ref: i,
934
1020
  "data-ikon-node-id": s.id,
935
1021
  "data-ikon-source": s.sourceMarker,
936
- "data-ikon-video-stream-id": d,
937
- className: p,
1022
+ "data-ikon-video-stream-id": f,
1023
+ className: d,
938
1024
  ...l ? { width: l } : {},
939
1025
  ...u ? { height: u } : {}
940
1026
  },
941
- d
1027
+ f
942
1028
  ) : null;
943
1029
  });
944
1030
  return ({ type: e }) => {
945
- if (e === kr)
1031
+ if (e === xn)
946
1032
  return t;
947
1033
  };
948
1034
  }
949
- function Cr() {
950
- return [Tr(), Ir(), Rr()];
1035
+ function Dn() {
1036
+ return [Un(), Bn(), Ln()];
951
1037
  }
952
- function ce(t) {
1038
+ function ue(t) {
953
1039
  if (typeof t == "boolean")
954
1040
  return t;
955
1041
  if (typeof t == "string") {
@@ -958,57 +1044,61 @@ function ce(t) {
958
1044
  if (e === "false") return !1;
959
1045
  }
960
1046
  }
961
- function Ir() {
962
- const t = Y(function({
963
- nodeId: r,
964
- context: n,
1047
+ function Bn() {
1048
+ const t = z(function({
1049
+ nodeId: n,
1050
+ context: r,
965
1051
  className: o
966
1052
  }) {
967
- const s = Z(n.store, r);
968
- if (!s)
1053
+ const s = Z(r.store, n), i = v(null), a = s ? ue(s.props?.autoplay) : void 0, c = s ? Be(s.props?.src) : void 0;
1054
+ if (N(() => {
1055
+ a && i.current && i.current.play().catch(() => {
1056
+ });
1057
+ }, [a, c]), !s)
969
1058
  return null;
970
- const i = yt(gt(s.props?.className), o), a = xe(s.props?.src), c = xe(s.props?.poster), h = ce(s.props?.controls), d = ce(s.props?.autoplay), l = ce(s.props?.loop), u = ce(s.props?.muted), p = ce(s.props?.playsInline), m = Se(s.props?.width), b = Se(s.props?.height), g = s.children?.length ? n.renderChildren(s.children) : void 0;
971
- return /* @__PURE__ */ R.jsx(
1059
+ const p = vt(wt(s.props?.className), o), f = Be(s.props?.poster), l = ue(s.props?.controls), u = ue(s.props?.loop), d = ue(s.props?.muted), m = ue(s.props?.playsInline), b = we(s.props?.width), g = we(s.props?.height), y = s.children?.length ? r.renderChildren(s.children) : void 0;
1060
+ return /* @__PURE__ */ E.jsx(
972
1061
  "video",
973
1062
  {
974
- src: a,
975
- poster: c,
976
- ...h !== void 0 ? { controls: h } : {},
977
- ...d !== void 0 ? { autoPlay: d } : {},
978
- ...l !== void 0 ? { loop: l } : {},
979
- ...u !== void 0 ? { muted: u } : {},
980
- ...p !== void 0 ? { playsInline: p } : {},
981
- ...m ? { width: m } : {},
982
- ...b ? { height: b } : {},
1063
+ ref: i,
1064
+ src: c,
1065
+ poster: f,
1066
+ ...l !== void 0 ? { controls: l } : {},
1067
+ ...a !== void 0 ? { autoPlay: a } : {},
1068
+ ...u !== void 0 ? { loop: u } : {},
1069
+ ...d !== void 0 ? { muted: d } : {},
1070
+ ...m !== void 0 ? { playsInline: m } : {},
1071
+ ...b ? { width: b } : {},
1072
+ ...g ? { height: g } : {},
983
1073
  "data-ikon-node-id": s.id,
984
1074
  "data-ikon-source": s.sourceMarker,
985
- className: i,
986
- children: g
1075
+ className: p,
1076
+ children: y
987
1077
  }
988
1078
  );
989
1079
  });
990
1080
  return ({ type: e }) => {
991
- if (e === Ar)
1081
+ if (e === jn)
992
1082
  return t;
993
1083
  };
994
1084
  }
995
- const Or = "media", Nr = async () => Cr();
996
- function _r(t) {
997
- t.registerModule(Or, Nr);
1085
+ const Fn = "media", $n = async () => Dn();
1086
+ function Vn(t) {
1087
+ t.registerModule(Fn, $n);
998
1088
  }
999
- const Pr = `#version 300 es
1089
+ const Kn = `#version 300 es
1000
1090
  in vec4 a_position;
1001
1091
  void main() {
1002
1092
  gl_Position = a_position;
1003
1093
  }
1004
1094
  `;
1005
- function Mr(t, e) {
1095
+ function Yn(t, e) {
1006
1096
  return new RegExp(`\\buniform\\s+\\w+\\s+${e}\\s*;`, "g").test(t);
1007
1097
  }
1008
- function Lr(t, e) {
1009
- const r = [];
1010
- for (const [n, o] of Object.entries(e)) {
1011
- if (Mr(t, n))
1098
+ function zn(t, e) {
1099
+ const n = [];
1100
+ for (const [r, o] of Object.entries(e)) {
1101
+ if (Yn(t, r))
1012
1102
  continue;
1013
1103
  let s;
1014
1104
  switch (o.type) {
@@ -1033,7 +1123,7 @@ function Lr(t, e) {
1033
1123
  default:
1034
1124
  s = "float";
1035
1125
  }
1036
- r.push(`uniform ${s} ${n};`);
1126
+ n.push(`uniform ${s} ${r};`);
1037
1127
  }
1038
1128
  return `#version 300 es
1039
1129
  precision highp float;
@@ -1047,7 +1137,7 @@ uniform vec4 iMouse;
1047
1137
  uniform vec4 iDate;
1048
1138
 
1049
1139
  // Custom uniforms
1050
- ${r.join(`
1140
+ ${n.join(`
1051
1141
  `)}
1052
1142
 
1053
1143
  out vec4 frag_out_color;
@@ -1061,7 +1151,7 @@ void main() {
1061
1151
  }
1062
1152
  `;
1063
1153
  }
1064
- class jr {
1154
+ class Wn {
1065
1155
  gl;
1066
1156
  program = null;
1067
1157
  positionBuffer = null;
@@ -1078,78 +1168,78 @@ class jr {
1078
1168
  lastError = null;
1079
1169
  currentShaderSource = "";
1080
1170
  constructor(e) {
1081
- const r = e.getContext("webgl2", {
1171
+ const n = e.getContext("webgl2", {
1082
1172
  alpha: !1,
1083
1173
  antialias: !1,
1084
1174
  depth: !1,
1085
1175
  stencil: !1,
1086
1176
  preserveDrawingBuffer: !1
1087
1177
  });
1088
- if (!r)
1178
+ if (!n)
1089
1179
  throw new Error("WebGL2 is not supported");
1090
- this.gl = r, this.initializeGeometry();
1180
+ this.gl = n, this.initializeGeometry();
1091
1181
  }
1092
1182
  initializeGeometry() {
1093
1183
  const e = this.gl;
1094
1184
  this.vao = e.createVertexArray(), e.bindVertexArray(this.vao), this.positionBuffer = e.createBuffer(), e.bindBuffer(e.ARRAY_BUFFER, this.positionBuffer);
1095
- const r = new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]);
1096
- e.bufferData(e.ARRAY_BUFFER, r, e.STATIC_DRAW), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
1185
+ const n = new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]);
1186
+ e.bufferData(e.ARRAY_BUFFER, n, e.STATIC_DRAW), e.enableVertexAttribArray(0), e.vertexAttribPointer(0, 2, e.FLOAT, !1, 0, 0), e.bindVertexArray(null);
1097
1187
  }
1098
- compile(e, r = {}) {
1099
- this.lastError = null, this.customUniforms = r, this.currentShaderSource = e;
1100
- const n = this.gl, o = this.compileShader(n.VERTEX_SHADER, Pr);
1188
+ compile(e, n = {}) {
1189
+ this.lastError = null, this.customUniforms = n, this.currentShaderSource = e;
1190
+ const r = this.gl, o = this.compileShader(r.VERTEX_SHADER, Kn);
1101
1191
  if (!o)
1102
1192
  return !1;
1103
- const s = Lr(e, r), i = this.compileShader(n.FRAGMENT_SHADER, s);
1193
+ const s = zn(e, n), i = this.compileShader(r.FRAGMENT_SHADER, s);
1104
1194
  if (!i)
1105
- return n.deleteShader(o), !1;
1106
- const a = n.createProgram();
1107
- return a ? (n.attachShader(a, o), n.attachShader(a, i), n.linkProgram(a), n.deleteShader(o), n.deleteShader(i), n.getProgramParameter(a, n.LINK_STATUS) ? (this.program && n.deleteProgram(this.program), this.program = a, this.cacheUniformLocations(), !0) : (this.lastError = n.getProgramInfoLog(a) || "Program link failed", n.deleteProgram(a), !1)) : (this.lastError = "Failed to create program", n.deleteShader(o), n.deleteShader(i), !1);
1195
+ return r.deleteShader(o), !1;
1196
+ const a = r.createProgram();
1197
+ return a ? (r.attachShader(a, o), r.attachShader(a, i), r.linkProgram(a), r.deleteShader(o), r.deleteShader(i), r.getProgramParameter(a, r.LINK_STATUS) ? (this.program && r.deleteProgram(this.program), this.program = a, this.cacheUniformLocations(), !0) : (this.lastError = r.getProgramInfoLog(a) || "Program link failed", r.deleteProgram(a), !1)) : (this.lastError = "Failed to create program", r.deleteShader(o), r.deleteShader(i), !1);
1108
1198
  }
1109
1199
  recompileWithUniforms(e) {
1110
1200
  return this.currentShaderSource ? this.compile(this.currentShaderSource, e) : !1;
1111
1201
  }
1112
- compileShader(e, r) {
1113
- const n = this.gl, o = n.createShader(e);
1114
- return o ? (n.shaderSource(o, r), n.compileShader(o), n.getShaderParameter(o, n.COMPILE_STATUS) ? o : (this.lastError = n.getShaderInfoLog(o) || "Shader compilation failed", n.deleteShader(o), null)) : (this.lastError = "Failed to create shader", null);
1202
+ compileShader(e, n) {
1203
+ const r = this.gl, o = r.createShader(e);
1204
+ return o ? (r.shaderSource(o, n), r.compileShader(o), r.getShaderParameter(o, r.COMPILE_STATUS) ? o : (this.lastError = r.getShaderInfoLog(o) || "Shader compilation failed", r.deleteShader(o), null)) : (this.lastError = "Failed to create shader", null);
1115
1205
  }
1116
1206
  cacheUniformLocations() {
1117
1207
  if (!this.program) return;
1118
1208
  const e = this.gl;
1119
1209
  this.uniformLocations.clear();
1120
- const r = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
1121
- for (const n of r)
1122
- this.uniformLocations.set(n, e.getUniformLocation(this.program, n));
1123
- for (const n of Object.keys(this.customUniforms))
1124
- this.uniformLocations.set(n, e.getUniformLocation(this.program, n));
1210
+ const n = ["iResolution", "iTime", "iTimeDelta", "iFrame", "iMouse", "iDate"];
1211
+ for (const r of n)
1212
+ this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
1213
+ for (const r of Object.keys(this.customUniforms))
1214
+ this.uniformLocations.set(r, e.getUniformLocation(this.program, r));
1125
1215
  }
1126
1216
  setCustomUniforms(e) {
1127
- const r = Object.keys(e).some((o) => !(o in this.customUniforms)), n = Object.keys(this.customUniforms).some((o) => !(o in e));
1128
- r || n ? this.recompileWithUniforms(e) : this.customUniforms = e;
1217
+ const n = Object.keys(e).some((o) => !(o in this.customUniforms)), r = Object.keys(this.customUniforms).some((o) => !(o in e));
1218
+ n || r ? this.recompileWithUniforms(e) : this.customUniforms = e;
1129
1219
  }
1130
- setMouse(e, r, n, o) {
1131
- this.mouseX = e, this.mouseY = r, this.mouseClickX = n, this.mouseClickY = o;
1220
+ setMouse(e, n, r, o) {
1221
+ this.mouseX = e, this.mouseY = n, this.mouseClickX = r, this.mouseClickY = o;
1132
1222
  }
1133
1223
  draw() {
1134
1224
  if (!this.program) return;
1135
- const e = this.gl, r = e.canvas, n = r.clientWidth, o = r.clientHeight;
1136
- (r.width !== n || r.height !== o) && (r.width = n, r.height = o, e.viewport(0, 0, n, o));
1225
+ const e = this.gl, n = e.canvas, r = n.clientWidth, o = n.clientHeight;
1226
+ (n.width !== r || n.height !== o) && (n.width = r, n.height = o, e.viewport(0, 0, r, o));
1137
1227
  const s = performance.now(), i = (s - this.startTime) / 1e3, a = (s - this.lastFrameTime) / 1e3;
1138
1228
  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);
1139
1229
  const c = this.uniformLocations.get("iResolution");
1140
- c && e.uniform3f(c, n, o, 1);
1141
- const h = this.uniformLocations.get("iTime");
1142
- h && e.uniform1f(h, i);
1143
- const d = this.uniformLocations.get("iTimeDelta");
1144
- d && e.uniform1f(d, a);
1230
+ c && e.uniform3f(c, r, o, 1);
1231
+ const p = this.uniformLocations.get("iTime");
1232
+ p && e.uniform1f(p, i);
1233
+ const f = this.uniformLocations.get("iTimeDelta");
1234
+ f && e.uniform1f(f, a);
1145
1235
  const l = this.uniformLocations.get("iFrame");
1146
1236
  l && e.uniform1i(l, this.frameCount);
1147
1237
  const u = this.uniformLocations.get("iMouse");
1148
1238
  u && e.uniform4f(u, this.mouseX, this.mouseY, this.mouseClickX, this.mouseClickY);
1149
- const p = this.uniformLocations.get("iDate");
1150
- if (p) {
1239
+ const d = this.uniformLocations.get("iDate");
1240
+ if (d) {
1151
1241
  const m = /* @__PURE__ */ new Date();
1152
- e.uniform4f(p, m.getFullYear(), m.getMonth(), m.getDate(), m.getHours() * 3600 + m.getMinutes() * 60 + m.getSeconds() + m.getMilliseconds() / 1e3);
1242
+ e.uniform4f(d, m.getFullYear(), m.getMonth(), m.getDate(), m.getHours() * 3600 + m.getMinutes() * 60 + m.getSeconds() + m.getMilliseconds() / 1e3);
1153
1243
  }
1154
1244
  for (const [m, b] of Object.entries(this.customUniforms)) {
1155
1245
  const g = this.uniformLocations.get(m);
@@ -1191,23 +1281,23 @@ class jr {
1191
1281
  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();
1192
1282
  }
1193
1283
  }
1194
- function Ur(t) {
1284
+ function qn(t) {
1195
1285
  if (typeof t == "string") {
1196
1286
  const e = t.trim();
1197
1287
  return e.length > 0 ? e : void 0;
1198
1288
  }
1199
1289
  if (Array.isArray(t)) {
1200
- const e = t.filter((r) => typeof r == "string").map((r) => r.trim()).filter(Boolean);
1290
+ const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
1201
1291
  return e.length > 0 ? e.join(" ") : void 0;
1202
1292
  }
1203
1293
  }
1204
- function xr(...t) {
1294
+ function Hn(...t) {
1205
1295
  const e = [];
1206
- for (const r of t)
1207
- r && r.trim() && e.push(r.trim());
1296
+ for (const n of t)
1297
+ n && n.trim() && e.push(n.trim());
1208
1298
  return e.length > 0 ? e.join(" ") : void 0;
1209
1299
  }
1210
- function Ce(t) {
1300
+ function Ie(t) {
1211
1301
  if (typeof t == "number" && Number.isFinite(t))
1212
1302
  return Math.floor(t);
1213
1303
  if (typeof t == "string" && t.trim().length > 0) {
@@ -1216,10 +1306,10 @@ function Ce(t) {
1216
1306
  return Math.floor(e);
1217
1307
  }
1218
1308
  }
1219
- function Dr(t) {
1309
+ function Gn(t) {
1220
1310
  return typeof t == "string" ? t : "";
1221
1311
  }
1222
- function Fr(t) {
1312
+ function Jn(t) {
1223
1313
  if (typeof t == "boolean")
1224
1314
  return t;
1225
1315
  if (typeof t == "string") {
@@ -1228,26 +1318,26 @@ function Fr(t) {
1228
1318
  if (e === "false") return !1;
1229
1319
  }
1230
1320
  }
1231
- function Br(t) {
1321
+ function Xn(t) {
1232
1322
  if (!t || typeof t != "object")
1233
1323
  return {};
1234
- const e = {}, r = t;
1235
- for (const [n, o] of Object.entries(r)) {
1324
+ const e = {}, n = t;
1325
+ for (const [r, o] of Object.entries(n)) {
1236
1326
  if (!o || typeof o != "object")
1237
1327
  continue;
1238
1328
  const s = o, i = s.value, a = s.type;
1239
- i === void 0 || typeof a != "string" || !["float", "vec2", "vec3", "vec4", "int", "bool"].includes(a) || (e[n] = {
1329
+ i === void 0 || typeof a != "string" || !["float", "vec2", "vec3", "vec4", "int", "bool"].includes(a) || (e[r] = {
1240
1330
  value: i,
1241
1331
  type: a
1242
1332
  });
1243
1333
  }
1244
1334
  return e;
1245
1335
  }
1246
- function $r(t, e) {
1247
- const r = Object.keys(t), n = Object.keys(e);
1248
- if (r.length !== n.length)
1336
+ function Zn(t, e) {
1337
+ const n = Object.keys(t), r = Object.keys(e);
1338
+ if (n.length !== r.length)
1249
1339
  return !1;
1250
- for (const o of r) {
1340
+ for (const o of n) {
1251
1341
  if (!(o in e))
1252
1342
  return !1;
1253
1343
  const s = t[o], i = e[o];
@@ -1264,168 +1354,168 @@ function $r(t, e) {
1264
1354
  }
1265
1355
  return !0;
1266
1356
  }
1267
- const Vr = "std.shadertoy-canvas";
1268
- function Kr() {
1269
- const t = Y(function({ nodeId: r, context: n, className: o }) {
1270
- const s = Z(n.store, r), i = w(null), a = w(null), c = w(null), h = w(0), d = w(""), l = w({}), u = w({
1357
+ const Qn = "std.shadertoy-canvas";
1358
+ function er() {
1359
+ const t = z(function({ nodeId: n, context: r, className: o }) {
1360
+ const s = Z(r.store, n), i = v(null), a = v(null), c = v(null), p = v(0), f = v(""), l = v({}), u = v({
1271
1361
  x: 0,
1272
1362
  y: 0,
1273
1363
  clickX: 0,
1274
1364
  clickY: 0,
1275
1365
  isDown: !1
1276
- }), p = s ? Dr(s.props?.shaderSource) : "", m = s ? Ce(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, g = V(() => Br(b), [b]), y = s ? Fr(s.props?.enableMouse) ?? !0 : !0, v = s ? Ce(s.props?.width) : void 0, E = s ? Ce(s.props?.height) : void 0, T = s ? xr(Ur(s.props?.className), o) : o;
1277
- U(() => {
1278
- const C = i.current;
1279
- if (C) {
1366
+ }), d = s ? Gn(s.props?.shaderSource) : "", m = s ? Ie(s.props?.fps) ?? 60 : 60, b = s?.props?.uniforms, g = K(() => Xn(b), [b]), y = s ? Jn(s.props?.enableMouse) ?? !0 : !0, w = s ? Ie(s.props?.width) : void 0, T = s ? Ie(s.props?.height) : void 0, C = s ? Hn(qn(s.props?.className), o) : o;
1367
+ N(() => {
1368
+ const A = i.current;
1369
+ if (A) {
1280
1370
  try {
1281
- const _ = new jr(C);
1282
- a.current = _;
1283
- } catch (_) {
1284
- console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", _);
1371
+ const P = new Wn(A);
1372
+ a.current = P;
1373
+ } catch (P) {
1374
+ console.error("[ShadertoyRenderer] Failed to create WebGL2 context:", P);
1285
1375
  }
1286
1376
  return () => {
1287
1377
  a.current && (a.current.destroy(), a.current = null);
1288
1378
  };
1289
1379
  }
1290
- }, []), U(() => {
1291
- const C = a.current;
1292
- if (!(!C || !p) && d.current !== p)
1293
- if (C.compile(p, g))
1294
- d.current = p, l.current = g;
1380
+ }, []), N(() => {
1381
+ const A = a.current;
1382
+ if (!(!A || !d) && f.current !== d)
1383
+ if (A.compile(d, g))
1384
+ f.current = d, l.current = g;
1295
1385
  else {
1296
- const x = C.getError();
1297
- console.error("[ShadertoyRenderer] Shader compilation failed:", x);
1386
+ const U = A.getError();
1387
+ console.error("[ShadertoyRenderer] Shader compilation failed:", U);
1298
1388
  }
1299
- }, [p, g]), U(() => {
1300
- const C = a.current;
1301
- !C || !d.current || $r(l.current, g) || (C.setCustomUniforms(g), l.current = g);
1302
- }, [g]), U(() => {
1303
- const C = a.current;
1304
- if (!C || !d.current) return;
1305
- const _ = 1e3 / m, x = (P) => {
1306
- const F = P - h.current;
1307
- F >= _ && (h.current = P - F % _, C.draw()), c.current = requestAnimationFrame(x);
1389
+ }, [d, g]), N(() => {
1390
+ const A = a.current;
1391
+ !A || !f.current || Zn(l.current, g) || (A.setCustomUniforms(g), l.current = g);
1392
+ }, [g]), N(() => {
1393
+ const A = a.current;
1394
+ if (!A || !f.current) return;
1395
+ const P = 1e3 / m, U = (M) => {
1396
+ const F = M - p.current;
1397
+ F >= P && (p.current = M - F % P, A.draw()), c.current = requestAnimationFrame(U);
1308
1398
  };
1309
- return c.current = requestAnimationFrame(x), () => {
1399
+ return c.current = requestAnimationFrame(U), () => {
1310
1400
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
1311
1401
  };
1312
1402
  }, [m]);
1313
- const O = D(
1314
- (C) => {
1403
+ const _ = D(
1404
+ (A) => {
1315
1405
  if (!y) return;
1316
- const _ = i.current, x = a.current;
1317
- if (!_ || !x) return;
1318
- const P = _.getBoundingClientRect(), F = C.clientX - P.left, z = P.height - (C.clientY - P.top);
1319
- u.current.x = F, u.current.y = z, x.setMouse(F, z, u.current.clickX, u.current.clickY);
1406
+ const P = i.current, U = a.current;
1407
+ if (!P || !U) return;
1408
+ const M = P.getBoundingClientRect(), F = A.clientX - M.left, W = M.height - (A.clientY - M.top);
1409
+ u.current.x = F, u.current.y = W, U.setMouse(F, W, u.current.clickX, u.current.clickY);
1320
1410
  },
1321
1411
  [y]
1322
- ), K = D(
1323
- (C) => {
1412
+ ), B = D(
1413
+ (A) => {
1324
1414
  if (!y) return;
1325
- const _ = i.current, x = a.current;
1326
- if (!_ || !x) return;
1327
- const P = _.getBoundingClientRect(), F = C.clientX - P.left, z = P.height - (C.clientY - P.top);
1328
- u.current.isDown = !0, u.current.clickX = F, u.current.clickY = z, x.setMouse(F, z, F, z);
1415
+ const P = i.current, U = a.current;
1416
+ if (!P || !U) return;
1417
+ const M = P.getBoundingClientRect(), F = A.clientX - M.left, W = M.height - (A.clientY - M.top);
1418
+ u.current.isDown = !0, u.current.clickX = F, u.current.clickY = W, U.setMouse(F, W, F, W);
1329
1419
  },
1330
1420
  [y]
1331
1421
  ), Q = D(() => {
1332
1422
  y && (u.current.isDown = !1, u.current.clickX = -Math.abs(u.current.clickX));
1333
1423
  }, [y]);
1334
- return s ? /* @__PURE__ */ R.jsx(
1424
+ return s ? /* @__PURE__ */ E.jsx(
1335
1425
  "canvas",
1336
1426
  {
1337
1427
  ref: i,
1338
1428
  "data-ikon-node-id": s.id,
1339
1429
  "data-ikon-source": s.sourceMarker,
1340
- className: T,
1341
- ...v ? { width: v } : {},
1342
- ...E ? { height: E } : {},
1343
- onMouseMove: O,
1344
- onMouseDown: K,
1430
+ className: C,
1431
+ ...w ? { width: w } : {},
1432
+ ...T ? { height: T } : {},
1433
+ onMouseMove: _,
1434
+ onMouseDown: B,
1345
1435
  onMouseUp: Q,
1346
1436
  onMouseLeave: Q
1347
1437
  }
1348
1438
  ) : null;
1349
1439
  });
1350
1440
  return ({ type: e }) => {
1351
- if (e === Vr)
1441
+ if (e === Qn)
1352
1442
  return t;
1353
1443
  };
1354
1444
  }
1355
- const Yr = "shadertoy", zr = async () => Kr();
1356
- function Wr(t) {
1357
- t.registerModule(Yr, zr);
1445
+ const tr = "shadertoy", nr = async () => er();
1446
+ function rr(t) {
1447
+ t.registerModule(tr, nr);
1358
1448
  }
1359
- const rt = Re("UIRegistry");
1360
- class qr {
1449
+ const ot = ke("UIRegistry");
1450
+ class or {
1361
1451
  baseResolvers = [];
1362
1452
  moduleLoaders = /* @__PURE__ */ new Map();
1363
1453
  moduleResolvers = /* @__PURE__ */ new Map();
1364
1454
  activeModuleOrder = [];
1365
1455
  registerResolvers(e) {
1366
- const r = Array.isArray(e) ? e : [e];
1367
- this.baseResolvers.push(...r.filter(Boolean));
1456
+ const n = Array.isArray(e) ? e : [e];
1457
+ this.baseResolvers.push(...n.filter(Boolean));
1368
1458
  }
1369
- registerModule(e, r) {
1370
- const n = this.moduleLoaders.get(e);
1371
- if (!n) {
1372
- this.moduleLoaders.set(e, r);
1459
+ registerModule(e, n) {
1460
+ const r = this.moduleLoaders.get(e);
1461
+ if (!r) {
1462
+ this.moduleLoaders.set(e, n);
1373
1463
  return;
1374
1464
  }
1375
- n !== r && (this.moduleLoaders.set(e, r), this.moduleResolvers.delete(e));
1465
+ r !== n && (this.moduleLoaders.set(e, n), this.moduleResolvers.delete(e));
1376
1466
  }
1377
1467
  async loadRegisteredModules() {
1378
1468
  let e = !1;
1379
- for (const [n, o] of this.moduleLoaders.entries())
1380
- if (!this.moduleResolvers.has(n))
1469
+ for (const [r, o] of this.moduleLoaders.entries())
1470
+ if (!this.moduleResolvers.has(r))
1381
1471
  try {
1382
- const s = await o(), i = Jr(s);
1383
- this.moduleResolvers.set(n, i), e = !0;
1472
+ const s = await o(), i = ar(s);
1473
+ this.moduleResolvers.set(r, i), e = !0;
1384
1474
  } catch (s) {
1385
- rt.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
1475
+ ot.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
1386
1476
  }
1387
- const r = [];
1388
- for (const n of this.moduleLoaders.keys())
1389
- this.moduleResolvers.has(n) && r.push(n);
1390
- return Xr(r, this.activeModuleOrder) || (this.activeModuleOrder = r, e = !0), e;
1477
+ const n = [];
1478
+ for (const r of this.moduleLoaders.keys())
1479
+ this.moduleResolvers.has(r) && n.push(r);
1480
+ return cr(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
1391
1481
  }
1392
1482
  resolve(e) {
1393
- for (const r of this.baseResolvers) {
1394
- const n = r(e);
1395
- if (n) return n;
1483
+ for (const n of this.baseResolvers) {
1484
+ const r = n(e);
1485
+ if (r) return r;
1396
1486
  }
1397
- for (const r of this.activeModuleOrder) {
1398
- const n = this.moduleResolvers.get(r);
1399
- if (!n) {
1400
- rt.warn(`Missing resolvers for module ${r}`);
1487
+ for (const n of this.activeModuleOrder) {
1488
+ const r = this.moduleResolvers.get(n);
1489
+ if (!r) {
1490
+ ot.warn(`Missing resolvers for module ${n}`);
1401
1491
  continue;
1402
1492
  }
1403
- for (const o of n) {
1493
+ for (const o of r) {
1404
1494
  const s = o(e);
1405
1495
  if (s) return s;
1406
1496
  }
1407
1497
  }
1408
1498
  }
1409
1499
  }
1410
- function Gr() {
1411
- const t = new qr();
1412
- return Sr(t), _r(t), Wr(t), t.loadRegisteredModules(), t;
1500
+ function sr() {
1501
+ const t = new or();
1502
+ return Nn(t), Vn(t), rr(t), t.loadRegisteredModules(), t;
1413
1503
  }
1414
- function Hr(t) {
1504
+ function ir(t) {
1415
1505
  return Array.isArray(t) ? t : [t];
1416
1506
  }
1417
- function Jr(t) {
1418
- return t ? Hr(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1507
+ function ar(t) {
1508
+ return t ? ir(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
1419
1509
  }
1420
- function Xr(t, e) {
1510
+ function cr(t, e) {
1421
1511
  if (t.length !== e.length)
1422
1512
  return !1;
1423
- for (let r = 0; r < t.length; r += 1)
1424
- if (t[r] !== e[r])
1513
+ for (let n = 0; n < t.length; n += 1)
1514
+ if (t[n] !== e[n])
1425
1515
  return !1;
1426
1516
  return !0;
1427
1517
  }
1428
- const Ie = Re("MotionController"), nt = {
1518
+ const Oe = ke("MotionController"), st = {
1429
1519
  ease: [0.25, 0.1, 0.25, 1],
1430
1520
  "ease-in": [0.42, 0, 1, 1],
1431
1521
  "ease-out": [0, 0, 0.58, 1],
@@ -1455,98 +1545,98 @@ const Ie = Re("MotionController"), nt = {
1455
1545
  "ease-out-back": [0.175, 0.885, 0.32, 1.275],
1456
1546
  "ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
1457
1547
  };
1458
- function B(t) {
1548
+ function $(t) {
1459
1549
  return t <= 0 ? 0 : t >= 1 ? 1 : t;
1460
1550
  }
1461
- function ot(t) {
1551
+ function it(t) {
1462
1552
  if (t == null) return;
1463
1553
  const e = `${t}`.trim();
1464
1554
  if (!e) return;
1465
- const r = Number.parseFloat(e);
1466
- return Number.isFinite(r) ? r : void 0;
1555
+ const n = Number.parseFloat(e);
1556
+ return Number.isFinite(n) ? n : void 0;
1467
1557
  }
1468
- function st(t) {
1558
+ function at(t) {
1469
1559
  return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1470
1560
  }
1471
- function it(t, e, r, n) {
1472
- const d = new Float32Array(11);
1473
- function l(g, y, v) {
1474
- return ((3 * y - 3 * v + 1) * g + (3 * v - 6 * y)) * g * g + 3 * y * g;
1561
+ function ct(t, e, n, r) {
1562
+ const f = new Float32Array(11);
1563
+ function l(g, y, w) {
1564
+ return ((3 * y - 3 * w + 1) * g + (3 * w - 6 * y)) * g * g + 3 * y * g;
1475
1565
  }
1476
- function u(g, y, v) {
1477
- return 3 * (3 * y - 3 * v + 1) * g * g + 2 * (3 * v - 6 * y) * g + 3 * y;
1566
+ function u(g, y, w) {
1567
+ return 3 * (3 * y - 3 * w + 1) * g * g + 2 * (3 * w - 6 * y) * g + 3 * y;
1478
1568
  }
1479
- function p(g, y) {
1480
- for (let v = 0; v < 4; v += 1) {
1481
- const E = u(y, t, r);
1482
- if (E === 0)
1569
+ function d(g, y) {
1570
+ for (let w = 0; w < 4; w += 1) {
1571
+ const T = u(y, t, n);
1572
+ if (T === 0)
1483
1573
  return y;
1484
- const T = l(y, t, r) - g;
1485
- y -= T / E;
1574
+ const C = l(y, t, n) - g;
1575
+ y -= C / T;
1486
1576
  }
1487
1577
  return y;
1488
1578
  }
1489
- function m(g, y, v) {
1490
- let E = 0, T = 0, O = 0;
1579
+ function m(g, y, w) {
1580
+ let T = 0, C = 0, _ = 0;
1491
1581
  do
1492
- T = y + (v - y) / 2, E = l(T, t, r) - g, E > 0 ? v = T : y = T;
1493
- while (Math.abs(E) > 1e-7 && ++O < 10);
1494
- return T;
1582
+ C = y + (w - y) / 2, T = l(C, t, n) - g, T > 0 ? w = C : y = C;
1583
+ while (Math.abs(T) > 1e-7 && ++_ < 10);
1584
+ return C;
1495
1585
  }
1496
1586
  function b(g) {
1497
- let y = 0, v = 1;
1498
- const E = 10;
1499
- for (; v !== E && d[v] <= g; v += 1)
1587
+ let y = 0, w = 1;
1588
+ const T = 10;
1589
+ for (; w !== T && f[w] <= g; w += 1)
1500
1590
  y += 0.1;
1501
- v -= 1;
1502
- const T = (g - d[v]) / (d[v + 1] - d[v]), O = y + T * 0.1, K = u(O, t, r);
1503
- return K >= 1e-3 ? p(g, O) : K === 0 ? O : m(g, y, y + 0.1);
1591
+ w -= 1;
1592
+ const C = (g - f[w]) / (f[w + 1] - f[w]), _ = y + C * 0.1, B = u(_, t, n);
1593
+ return B >= 1e-3 ? d(g, _) : B === 0 ? _ : m(g, y, y + 0.1);
1504
1594
  }
1505
1595
  for (let g = 0; g < 11; g += 1)
1506
- d[g] = l(g * 0.1, t, r);
1507
- return (g) => g <= 0 ? 0 : g >= 1 ? 1 : l(b(g), e, n);
1596
+ f[g] = l(g * 0.1, t, n);
1597
+ return (g) => g <= 0 ? 0 : g >= 1 ? 1 : l(b(g), e, r);
1508
1598
  }
1509
- function Zr(t) {
1599
+ function ur(t) {
1510
1600
  const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
1511
1601
  if (!e)
1512
- return (o) => B(o);
1513
- const r = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
1514
- 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);
1602
+ return (o) => $(o);
1603
+ const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
1604
+ return r === "start" || r === "jump-start" ? (o) => $(Math.ceil(o * n) / n) : r === "none" || r === "jump-none" ? (o) => $(Math.round(o * n) / n) : r === "both" || r === "jump-both" ? (o) => $((Math.floor(o * n) + 0.5) / n) : (o) => $(Math.floor(o * n) / n);
1515
1605
  }
1516
- function Qr(t) {
1606
+ function lr(t) {
1517
1607
  if (!t)
1518
- return (r) => B(r);
1608
+ return (n) => $(n);
1519
1609
  const e = t.trim().toLowerCase();
1520
1610
  if (!e || e === "linear")
1521
- return (r) => B(r);
1522
- if (nt[e]) {
1523
- const [r, n, o, s] = nt[e], i = it(r, n, o, s);
1524
- return (a) => B(i(B(a)));
1611
+ return (n) => $(n);
1612
+ if (st[e]) {
1613
+ const [n, r, o, s] = st[e], i = ct(n, r, o, s);
1614
+ return (a) => $(i($(a)));
1525
1615
  }
1526
1616
  if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
1527
- const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
1528
- if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
1529
- const [o, s, i, a] = n, c = it(o, s, i, a);
1530
- return (h) => B(c(B(h)));
1617
+ const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
1618
+ if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
1619
+ const [o, s, i, a] = r, c = ct(o, s, i, a);
1620
+ return (p) => $(c($(p)));
1531
1621
  }
1532
1622
  }
1533
1623
  if (e.startsWith("steps(") && e.endsWith(")")) {
1534
- const r = Zr(e);
1535
- return (n) => r(B(n));
1624
+ const n = ur(e);
1625
+ return (r) => n($(r));
1536
1626
  }
1537
- return (r) => B(r);
1627
+ return (n) => $(n);
1538
1628
  }
1539
- function en(t) {
1629
+ function dr(t) {
1540
1630
  if (!t)
1541
1631
  return;
1542
1632
  const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
1543
1633
  if (!e)
1544
1634
  return;
1545
- const [r, n, o, s] = e.slice(1).map((i) => Number.parseFloat(i));
1546
- if (![r, n, o, s].some((i) => !Number.isFinite(i)))
1547
- return { inStart: r, inEnd: n, outStart: o, outEnd: s };
1635
+ const [n, r, o, s] = e.slice(1).map((i) => Number.parseFloat(i));
1636
+ if (![n, r, o, s].some((i) => !Number.isFinite(i)))
1637
+ return { inStart: n, inEnd: r, outStart: o, outEnd: s };
1548
1638
  }
1549
- class tn {
1639
+ class fr {
1550
1640
  bindingsByStyle = /* @__PURE__ */ new Map();
1551
1641
  observer;
1552
1642
  observeScheduled = !1;
@@ -1555,15 +1645,15 @@ class tn {
1555
1645
  elementStates = /* @__PURE__ */ new Map();
1556
1646
  styleToElements = /* @__PURE__ */ new Map();
1557
1647
  globalCleanups = /* @__PURE__ */ new Set();
1558
- registerStyle(e, r) {
1648
+ registerStyle(e, n) {
1559
1649
  if (!e)
1560
1650
  return;
1561
- const n = this.parseMetadata(r);
1562
- if (!n) {
1651
+ const r = this.parseMetadata(n);
1652
+ if (!r) {
1563
1653
  this.bindingsByStyle.delete(e), this.cleanupStyle(e);
1564
1654
  return;
1565
1655
  }
1566
- this.bindingsByStyle.set(e, n), this.cleanupStyle(e), this.ensureObserver(), this.scheduleScan(e);
1656
+ this.bindingsByStyle.set(e, r), this.cleanupStyle(e), this.ensureObserver(), this.scheduleScan(e);
1567
1657
  }
1568
1658
  unregisterStyle(e) {
1569
1659
  e && (this.bindingsByStyle.delete(e), this.cleanupStyle(e), this.pendingScanStyles.delete(e));
@@ -1572,42 +1662,42 @@ class tn {
1572
1662
  for (const e of Array.from(this.globalCleanups))
1573
1663
  try {
1574
1664
  e();
1575
- } catch (r) {
1576
- Ie.warn("Failed to cleanup binding listener", r);
1665
+ } catch (n) {
1666
+ Oe.warn("Failed to cleanup binding listener", n);
1577
1667
  }
1578
1668
  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);
1579
1669
  }
1580
1670
  parseMetadata(e) {
1581
1671
  if (e)
1582
1672
  try {
1583
- const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
1584
- return n.length === 0 ? void 0 : { bindings: n };
1585
- } catch (r) {
1586
- Ie.warn("Failed to parse motion metadata", r);
1673
+ const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
1674
+ return r.length === 0 ? void 0 : { bindings: r };
1675
+ } catch (n) {
1676
+ Oe.warn("Failed to parse motion metadata", n);
1587
1677
  return;
1588
1678
  }
1589
1679
  }
1590
1680
  parseBinding(e) {
1591
- const r = e.source?.trim();
1592
- if (!r)
1681
+ const n = e.source?.trim();
1682
+ if (!n)
1593
1683
  return;
1594
- const n = ot(e.min) ?? 0, o = ot(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = Qr(e.ease), h = en(e.map), d = e.targetId?.trim() || void 0;
1595
- return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
1596
- source: r.toLowerCase(),
1597
- min: n,
1684
+ const r = it(e.min) ?? 0, o = it(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = lr(e.ease), p = dr(e.map), f = e.targetId?.trim() || void 0;
1685
+ return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
1686
+ source: n.toLowerCase(),
1687
+ min: r,
1598
1688
  max: s,
1599
1689
  clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
1600
1690
  reverse: a,
1601
1691
  ease: c,
1602
- map: h,
1603
- targetId: d
1692
+ map: p,
1693
+ targetId: f
1604
1694
  };
1605
1695
  }
1606
1696
  ensureObserver() {
1607
1697
  if (typeof document > "u" || this.observer)
1608
1698
  return;
1609
1699
  const e = () => {
1610
- this.observer || typeof document > "u" || (this.observer = new MutationObserver((r) => this.handleMutations(r)), this.observer.observe(document.body, {
1700
+ this.observer || typeof document > "u" || (this.observer = new MutationObserver((n) => this.handleMutations(n)), this.observer.observe(document.body, {
1611
1701
  childList: !0,
1612
1702
  subtree: !0,
1613
1703
  attributes: !0,
@@ -1625,7 +1715,7 @@ class tn {
1625
1715
  scheduleScan(e) {
1626
1716
  if (typeof document > "u" || (this.pendingScanStyles.add(e), this.scanScheduled))
1627
1717
  return;
1628
- const r = () => {
1718
+ const n = () => {
1629
1719
  if (this.pendingScanStyles.size === 0) {
1630
1720
  this.scanScheduled = !1;
1631
1721
  return;
@@ -1634,82 +1724,82 @@ class tn {
1634
1724
  this.pendingScanStyles.clear(), this.scanScheduled = !1;
1635
1725
  for (const s of o)
1636
1726
  this.scanExistingNodes(s);
1637
- }, n = () => {
1638
- this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(r) : setTimeout(r, 0);
1727
+ }, r = () => {
1728
+ this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(n) : setTimeout(n, 0);
1639
1729
  };
1640
1730
  document.readyState === "loading" ? document.addEventListener(
1641
1731
  "DOMContentLoaded",
1642
1732
  () => {
1643
- n();
1733
+ r();
1644
1734
  },
1645
1735
  { once: !0 }
1646
- ) : n();
1736
+ ) : r();
1647
1737
  }
1648
1738
  scanExistingNodes(e) {
1649
- const r = this.bindingsByStyle.get(e);
1650
- if (!r || typeof document > "u")
1739
+ const n = this.bindingsByStyle.get(e);
1740
+ if (!n || typeof document > "u")
1651
1741
  return;
1652
- const n = `.${st(e)}`;
1653
- document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, r));
1742
+ const r = `.${at(e)}`;
1743
+ document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
1654
1744
  }
1655
- applyStyleToElement(e, r, n) {
1656
- this.ensureStyleState(e, r) && this.attachBindings(e, r, n);
1745
+ applyStyleToElement(e, n, r) {
1746
+ this.ensureStyleState(e, n) && this.attachBindings(e, n, r);
1657
1747
  }
1658
- ensureStyleState(e, r) {
1659
- let n = this.elementStates.get(e);
1660
- if (n || (n = /* @__PURE__ */ new Map(), this.elementStates.set(e, n)), n.has(r))
1748
+ ensureStyleState(e, n) {
1749
+ let r = this.elementStates.get(e);
1750
+ if (r || (r = /* @__PURE__ */ new Map(), this.elementStates.set(e, r)), r.has(n))
1661
1751
  return !1;
1662
- n.set(r, /* @__PURE__ */ new Set());
1663
- let o = this.styleToElements.get(r);
1664
- return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(r, o)), o.add(e), !0;
1752
+ r.set(n, /* @__PURE__ */ new Set());
1753
+ let o = this.styleToElements.get(n);
1754
+ return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(n, o)), o.add(e), !0;
1665
1755
  }
1666
- attachBindings(e, r, n) {
1667
- for (const o of n.bindings)
1668
- this.attachBinding(e, r, o);
1756
+ attachBindings(e, n, r) {
1757
+ for (const o of r.bindings)
1758
+ this.attachBinding(e, n, o);
1669
1759
  }
1670
- attachBinding(e, r, n) {
1671
- switch (n.source) {
1760
+ attachBinding(e, n, r) {
1761
+ switch (r.source) {
1672
1762
  case "scrolly":
1673
- this.attachScrollBinding(e, r, n);
1763
+ this.attachScrollBinding(e, n, r);
1674
1764
  break;
1675
1765
  }
1676
1766
  }
1677
- attachScrollBinding(e, r, n) {
1678
- const o = this.resolveScrollContainer(e, n);
1767
+ attachScrollBinding(e, n, r) {
1768
+ const o = this.resolveScrollContainer(e, r);
1679
1769
  if (!o)
1680
1770
  return;
1681
1771
  const s = () => {
1682
- this.applyBindingValues(e, n, o.scrollTop);
1772
+ this.applyBindingValues(e, r, o.scrollTop);
1683
1773
  };
1684
1774
  s();
1685
1775
  const i = new AbortController();
1686
- o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e, r, () => i.abort());
1776
+ o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e, n, () => i.abort());
1687
1777
  const a = () => s();
1688
- window.addEventListener("resize", a), this.registerCleanup(e, r, () => window.removeEventListener("resize", a));
1778
+ window.addEventListener("resize", a), this.registerCleanup(e, n, () => window.removeEventListener("resize", a));
1689
1779
  }
1690
- resolveScrollContainer(e, r) {
1691
- if (r.targetId) {
1692
- const n = `[data-ikon-motion-source="${st(r.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
1780
+ resolveScrollContainer(e, n) {
1781
+ if (n.targetId) {
1782
+ const r = `[data-ikon-motion-source="${at(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
1693
1783
  if (o)
1694
1784
  return o;
1695
1785
  }
1696
1786
  return e.closest('[data-ikon-view-type="scroll-view"]');
1697
1787
  }
1698
- applyBindingValues(e, r, n) {
1699
- const o = r.max - r.min, s = o === 0 ? n > r.min ? 1 : 0 : (n - r.min) / o;
1700
- let i = this.applyClamp(s, r.clamp);
1701
- r.reverse && (i = 1 - i);
1702
- const a = r.ease(i), c = Number.isFinite(a) ? a : 0, h = c * 100;
1703
- 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", `${h}`), r.map) {
1704
- const d = this.applyMap(h, r.map);
1705
- d !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${d}`);
1788
+ applyBindingValues(e, n, r) {
1789
+ const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
1790
+ let i = this.applyClamp(s, n.clamp);
1791
+ n.reverse && (i = 1 - i);
1792
+ const a = n.ease(i), c = Number.isFinite(a) ? a : 0, p = c * 100;
1793
+ if (e.style.setProperty("--tw-motion-bind-source-value", `${r}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${c}`), e.style.setProperty("--tw-motion-bind-progress", `${p}`), n.map) {
1794
+ const f = this.applyMap(p, n.map);
1795
+ f !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${f}`);
1706
1796
  } else
1707
1797
  e.style.removeProperty("--tw-motion-bind-value");
1708
1798
  }
1709
- applyClamp(e, r) {
1799
+ applyClamp(e, n) {
1710
1800
  if (!Number.isFinite(e))
1711
1801
  return 0;
1712
- switch (r) {
1802
+ switch (n) {
1713
1803
  case "freeze-start":
1714
1804
  return e < 0 ? 0 : e;
1715
1805
  case "freeze-end":
@@ -1717,108 +1807,108 @@ class tn {
1717
1807
  case "unclamped":
1718
1808
  return e;
1719
1809
  default:
1720
- return B(e);
1810
+ return $(e);
1721
1811
  }
1722
1812
  }
1723
- applyMap(e, r) {
1724
- const n = r.inEnd - r.inStart;
1725
- if (n === 0)
1726
- return r.outEnd;
1727
- const o = (e - r.inStart) / n;
1728
- return r.outStart + o * (r.outEnd - r.outStart);
1813
+ applyMap(e, n) {
1814
+ const r = n.inEnd - n.inStart;
1815
+ if (r === 0)
1816
+ return n.outEnd;
1817
+ const o = (e - n.inStart) / r;
1818
+ return n.outStart + o * (n.outEnd - n.outStart);
1729
1819
  }
1730
- registerCleanup(e, r, n) {
1731
- const s = this.elementStates.get(e)?.get(r);
1732
- s && (s.add(n), this.globalCleanups.add(n));
1820
+ registerCleanup(e, n, r) {
1821
+ const s = this.elementStates.get(e)?.get(n);
1822
+ s && (s.add(r), this.globalCleanups.add(r));
1733
1823
  }
1734
1824
  cleanupStyle(e) {
1735
- const r = this.styleToElements.get(e);
1736
- if (!r)
1825
+ const n = this.styleToElements.get(e);
1826
+ if (!n)
1737
1827
  return;
1738
- const n = Array.from(r);
1739
- for (const o of n)
1828
+ const r = Array.from(n);
1829
+ for (const o of r)
1740
1830
  this.cleanupElementStyle(o, e);
1741
1831
  this.styleToElements.delete(e);
1742
1832
  }
1743
1833
  cleanupElement(e) {
1744
- const r = this.elementStates.get(e);
1745
- if (!r)
1834
+ const n = this.elementStates.get(e);
1835
+ if (!n)
1746
1836
  return;
1747
- const n = Array.from(r.keys());
1748
- for (const o of n)
1837
+ const r = Array.from(n.keys());
1838
+ for (const o of r)
1749
1839
  this.cleanupElementStyle(e, o);
1750
1840
  }
1751
- cleanupElementStyle(e, r) {
1752
- const n = this.elementStates.get(e);
1753
- if (!n)
1841
+ cleanupElementStyle(e, n) {
1842
+ const r = this.elementStates.get(e);
1843
+ if (!r)
1754
1844
  return;
1755
- const o = n.get(r);
1845
+ const o = r.get(n);
1756
1846
  if (!o)
1757
1847
  return;
1758
1848
  for (const i of o) {
1759
1849
  try {
1760
1850
  i();
1761
1851
  } catch (a) {
1762
- Ie.warn("Failed to cleanup listener", a);
1852
+ Oe.warn("Failed to cleanup listener", a);
1763
1853
  }
1764
1854
  this.globalCleanups.delete(i);
1765
1855
  }
1766
- o.clear(), n.delete(r);
1767
- const s = this.styleToElements.get(r);
1768
- s && (s.delete(e), s.size === 0 && this.styleToElements.delete(r)), n.size === 0 && (this.elementStates.delete(e), this.clearBindingProperties(e));
1856
+ o.clear(), r.delete(n);
1857
+ const s = this.styleToElements.get(n);
1858
+ s && (s.delete(e), s.size === 0 && this.styleToElements.delete(n)), r.size === 0 && (this.elementStates.delete(e), this.clearBindingProperties(e));
1769
1859
  }
1770
1860
  clearBindingProperties(e) {
1771
1861
  e.style.removeProperty("--tw-motion-bind-source-value"), e.style.removeProperty("--tw-motion-bind-progress"), e.style.removeProperty("--tw-motion-bind-progress-ratio"), e.style.removeProperty("--tw-motion-bind-value");
1772
1862
  }
1773
1863
  handleMutations(e) {
1774
- for (const r of e)
1775
- r.type === "childList" ? (r.addedNodes.forEach((n) => this.scanNode(n)), r.removedNodes.forEach((n) => this.cleanupNode(n))) : r.type === "attributes" && r.target instanceof HTMLElement && this.handleClassMutation(r.target);
1864
+ for (const n of e)
1865
+ n.type === "childList" ? (n.addedNodes.forEach((r) => this.scanNode(r)), n.removedNodes.forEach((r) => this.cleanupNode(r))) : n.type === "attributes" && n.target instanceof HTMLElement && this.handleClassMutation(n.target);
1776
1866
  }
1777
1867
  handleClassMutation(e) {
1778
- const r = this.elementStates.get(e);
1779
- if (!r) {
1868
+ const n = this.elementStates.get(e);
1869
+ if (!n) {
1780
1870
  this.processElement(e);
1781
1871
  return;
1782
1872
  }
1783
- for (const n of r.keys())
1784
- e.classList.contains(n) || this.cleanupElementStyle(e, n);
1873
+ for (const r of n.keys())
1874
+ e.classList.contains(r) || this.cleanupElementStyle(e, r);
1785
1875
  this.processElement(e);
1786
1876
  }
1787
1877
  scanNode(e) {
1788
1878
  if (!(e instanceof HTMLElement))
1789
1879
  return;
1790
- this.processElement(e), e.querySelectorAll("[class]").forEach((n) => this.processElement(n));
1880
+ this.processElement(e), e.querySelectorAll("[class]").forEach((r) => this.processElement(r));
1791
1881
  }
1792
1882
  cleanupNode(e) {
1793
1883
  if (!(e instanceof HTMLElement))
1794
1884
  return;
1795
- this.cleanupElement(e), e.querySelectorAll("[class]").forEach((n) => this.cleanupElement(n));
1885
+ this.cleanupElement(e), e.querySelectorAll("[class]").forEach((r) => this.cleanupElement(r));
1796
1886
  }
1797
1887
  processElement(e) {
1798
1888
  if (!e.classList || e.classList.length === 0)
1799
1889
  return;
1800
- const r = e.classList;
1801
- for (let n = 0; n < r.length; n++) {
1802
- const o = r[n], s = this.bindingsByStyle.get(o);
1890
+ const n = e.classList;
1891
+ for (let r = 0; r < n.length; r++) {
1892
+ const o = n[r], s = this.bindingsByStyle.get(o);
1803
1893
  s && this.ensureStyleState(e, o) && this.attachBindings(e, o, s);
1804
1894
  }
1805
1895
  }
1806
1896
  }
1807
- const Oe = new tn();
1808
- function rn(t) {
1809
- const e = w(/* @__PURE__ */ new Map()), r = D(({ styleId: s, css: i, common: a }) => {
1897
+ const Ne = new fr();
1898
+ function pr(t) {
1899
+ const e = v(/* @__PURE__ */ new Map()), n = D(({ styleId: s, css: i, common: a }) => {
1810
1900
  if (!(!s || typeof document > "u")) {
1811
1901
  if (i) {
1812
1902
  let c = e.current.get(s);
1813
1903
  c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
1814
1904
  }
1815
- Oe.registerStyle(s, a);
1905
+ Ne.registerStyle(s, a);
1816
1906
  }
1817
- }, []), n = D((s) => {
1907
+ }, []), r = D((s) => {
1818
1908
  if (!(typeof document > "u"))
1819
1909
  for (const i of s) {
1820
1910
  const a = e.current.get(i);
1821
- a && (a.remove(), e.current.delete(i)), Oe.unregisterStyle(i);
1911
+ a && (a.remove(), e.current.delete(i)), Ne.unregisterStyle(i);
1822
1912
  }
1823
1913
  }, []), o = D(() => {
1824
1914
  if (typeof document < "u") {
@@ -1826,117 +1916,117 @@ function rn(t) {
1826
1916
  s.remove();
1827
1917
  e.current.clear();
1828
1918
  }
1829
- Oe.reset();
1919
+ Ne.reset();
1830
1920
  }, []);
1831
- return U(() => {
1921
+ return N(() => {
1832
1922
  if (!t) return;
1833
1923
  for (const a of t.getUiStyles())
1834
- r(a);
1835
- const s = t.subscribeToStyles(r), i = t.subscribeToStyleDeletes?.(n);
1924
+ n(a);
1925
+ const s = t.subscribeToStyles(n), i = t.subscribeToStyleDeletes?.(r);
1836
1926
  return () => {
1837
1927
  s?.(), i?.(), o();
1838
1928
  };
1839
- }, [t, o, r, n]), U(() => () => o(), [o]), { setStyle: r, deleteStyles: n, reset: o };
1929
+ }, [t, o, n, r]), N(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
1840
1930
  }
1841
- function nn(t) {
1931
+ function hr(t) {
1842
1932
  const e = [];
1843
- for (const [r, n] of t) {
1844
- const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
1845
- e.push(`${r}:${s ? "1" : "0"}`);
1933
+ for (const [n, r] of t) {
1934
+ const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
1935
+ e.push(`${n}:${s ? "1" : "0"}`);
1846
1936
  }
1847
1937
  return e.sort(), e.join(",");
1848
1938
  }
1849
- function on(t) {
1850
- const [e, r] = J(), n = w("");
1851
- return U(() => {
1939
+ function mr(t) {
1940
+ const [e, n] = Y(), r = v("");
1941
+ return N(() => {
1852
1942
  if (!t) {
1853
- r(void 0), n.current = "";
1943
+ n(void 0), r.current = "";
1854
1944
  return;
1855
1945
  }
1856
1946
  const o = () => {
1857
- const s = t.getStores(), i = nn(s);
1858
- i !== n.current && (n.current = i, r(s));
1947
+ const s = t.getStores(), i = hr(s);
1948
+ i !== r.current && (r.current = i, n(s));
1859
1949
  };
1860
1950
  return o(), t.subscribe(o);
1861
1951
  }, [t]), e;
1862
1952
  }
1863
- var sn = typeof global == "object" && global && global.Object === Object && global, an = typeof self == "object" && self && self.Object === Object && self, cn = sn || an || Function("return this")(), we = cn.Symbol, bt = Object.prototype, un = bt.hasOwnProperty, ln = bt.toString, ue = we ? we.toStringTag : void 0;
1864
- function dn(t) {
1865
- var e = un.call(t, ue), r = t[ue];
1953
+ var gr = typeof global == "object" && global && global.Object === Object && global, yr = typeof self == "object" && self && self.Object === Object && self, br = gr || yr || Function("return this")(), ve = br.Symbol, Et = Object.prototype, Sr = Et.hasOwnProperty, wr = Et.toString, le = ve ? ve.toStringTag : void 0;
1954
+ function vr(t) {
1955
+ var e = Sr.call(t, le), n = t[le];
1866
1956
  try {
1867
- t[ue] = void 0;
1868
- var n = !0;
1957
+ t[le] = void 0;
1958
+ var r = !0;
1869
1959
  } catch {
1870
1960
  }
1871
- var o = ln.call(t);
1872
- return n && (e ? t[ue] = r : delete t[ue]), o;
1961
+ var o = wr.call(t);
1962
+ return r && (e ? t[le] = n : delete t[le]), o;
1873
1963
  }
1874
- var fn = Object.prototype, hn = fn.toString;
1875
- function pn(t) {
1876
- return hn.call(t);
1964
+ var Er = Object.prototype, Rr = Er.toString;
1965
+ function kr(t) {
1966
+ return Rr.call(t);
1877
1967
  }
1878
- var mn = "[object Null]", gn = "[object Undefined]", at = we ? we.toStringTag : void 0;
1879
- function yn(t) {
1880
- return t == null ? t === void 0 ? gn : mn : at && at in Object(t) ? dn(t) : pn(t);
1968
+ var Ar = "[object Null]", Tr = "[object Undefined]", ut = ve ? ve.toStringTag : void 0;
1969
+ function Cr(t) {
1970
+ return t == null ? t === void 0 ? Tr : Ar : ut && ut in Object(t) ? vr(t) : kr(t);
1881
1971
  }
1882
- function bn(t) {
1972
+ function Ir(t) {
1883
1973
  return t != null && typeof t == "object";
1884
1974
  }
1885
- var Sn = Array.isArray, wn = "[object String]";
1886
- function vn(t) {
1887
- return typeof t == "string" || !Sn(t) && bn(t) && yn(t) == wn;
1975
+ var Or = Array.isArray, Nr = "[object String]";
1976
+ function _r(t) {
1977
+ return typeof t == "string" || !Or(t) && Ir(t) && Cr(t) == Nr;
1888
1978
  }
1889
- const ct = "ikonUiModules";
1890
- function De(t) {
1979
+ const lt = "ikonUiModules";
1980
+ function Fe(t) {
1891
1981
  return typeof t == "object" && t !== null && !Array.isArray(t);
1892
1982
  }
1893
- function En(t) {
1983
+ function Pr(t) {
1894
1984
  if (!Array.isArray(t))
1895
1985
  return;
1896
1986
  const e = /* @__PURE__ */ new Set();
1897
- for (const r of t) {
1898
- if (!vn(r)) continue;
1899
- const n = r.trim();
1900
- n && (e.has(n) || e.add(n));
1987
+ for (const n of t) {
1988
+ if (!_r(n)) continue;
1989
+ const r = n.trim();
1990
+ r && (e.has(r) || e.add(r));
1901
1991
  }
1902
1992
  return Array.from(e);
1903
1993
  }
1904
- function Ao(t, e) {
1994
+ function xo(t, e) {
1905
1995
  if (t === e)
1906
1996
  return !0;
1907
1997
  if (!t || !e)
1908
1998
  return !t && !e;
1909
1999
  if (t.length !== e.length)
1910
2000
  return !1;
1911
- for (let r = 0; r < t.length; r += 1)
1912
- if (t[r] !== e[r])
2001
+ for (let n = 0; n < t.length; n += 1)
2002
+ if (t[n] !== e[n])
1913
2003
  return !1;
1914
2004
  return !0;
1915
2005
  }
1916
- function Rn(t) {
1917
- if (!(!De(t) || !Object.prototype.hasOwnProperty.call(t, ct)))
1918
- return En(t[ct]);
2006
+ function Mr(t) {
2007
+ if (!(!Fe(t) || !Object.prototype.hasOwnProperty.call(t, lt)))
2008
+ return Pr(t[lt]);
1919
2009
  }
1920
- function To(...t) {
2010
+ function jo(...t) {
1921
2011
  for (const e of t) {
1922
- const r = Rn(e);
1923
- if (r !== void 0)
1924
- return r;
2012
+ const n = Mr(e);
2013
+ if (n !== void 0)
2014
+ return n;
1925
2015
  }
1926
2016
  }
1927
- function Co(t) {
1928
- if (!De(t))
2017
+ function Uo(t) {
2018
+ if (!Fe(t))
1929
2019
  return;
1930
- const e = t, r = Object.keys(e).find((c) => c.toLowerCase() === "modules");
1931
- if (!r)
2020
+ const e = t, n = Object.keys(e).find((c) => c.toLowerCase() === "modules");
2021
+ if (!n)
1932
2022
  return;
1933
- const n = e[r];
1934
- if (n === null)
2023
+ const r = e[n];
2024
+ if (r === null)
1935
2025
  return { resetToDefault: !0 };
1936
- if (!Array.isArray(n))
2026
+ if (!Array.isArray(r))
1937
2027
  return;
1938
2028
  const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
1939
- for (const c of n) {
2029
+ for (const c of r) {
1940
2030
  if (typeof c == "string") {
1941
2031
  const b = c.trim();
1942
2032
  if (!b || i.has(b))
@@ -1944,38 +2034,38 @@ function Co(t) {
1944
2034
  o.push(b), i.add(b);
1945
2035
  continue;
1946
2036
  }
1947
- if (!De(c))
2037
+ if (!Fe(c))
1948
2038
  continue;
1949
- const h = c, d = Object.keys(h).find((b) => b.toLowerCase() === "name");
1950
- if (!d)
2039
+ const p = c, f = Object.keys(p).find((b) => b.toLowerCase() === "name");
2040
+ if (!f)
1951
2041
  continue;
1952
- const l = h[d];
2042
+ const l = p[f];
1953
2043
  if (typeof l != "string")
1954
2044
  continue;
1955
2045
  const u = l.trim();
1956
2046
  if (!u)
1957
2047
  continue;
1958
- const p = Object.keys(h).find((b) => b.toLowerCase() === "javascript"), m = p ? h[p] : void 0;
2048
+ const d = Object.keys(p).find((b) => b.toLowerCase() === "javascript"), m = d ? p[d] : void 0;
1959
2049
  typeof m == "string" && s.set(u, m), i.has(u) || (o.push(u), i.add(u));
1960
2050
  }
1961
2051
  if (!o.length && s.size === 0)
1962
2052
  return { modules: [] };
1963
- const a = Array.from(s.entries()).map(([c, h]) => ({
2053
+ const a = Array.from(s.entries()).map(([c, p]) => ({
1964
2054
  name: c,
1965
- javascript: h
2055
+ javascript: p
1966
2056
  }));
1967
2057
  return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
1968
2058
  }
1969
- const k = {
2059
+ const R = {
1970
2060
  None: 0,
1971
2061
  Letter: 1,
1972
2062
  Word: 2,
1973
2063
  Line: 4,
1974
2064
  Paragraph: 8,
1975
2065
  Emoji: 16
1976
- }, kn = [
2066
+ }, Lr = [
1977
2067
  {
1978
- flag: k.Letter,
2068
+ flag: R.Letter,
1979
2069
  hints: [
1980
2070
  "[data-motion-letter]",
1981
2071
  "[data-letter]",
@@ -1984,7 +2074,7 @@ const k = {
1984
2074
  ]
1985
2075
  },
1986
2076
  {
1987
- flag: k.Word,
2077
+ flag: R.Word,
1988
2078
  hints: [
1989
2079
  "[data-motion-word]",
1990
2080
  "[data-word]",
@@ -1993,7 +2083,7 @@ const k = {
1993
2083
  ]
1994
2084
  },
1995
2085
  {
1996
- flag: k.Line,
2086
+ flag: R.Line,
1997
2087
  hints: [
1998
2088
  "[data-motion-line]",
1999
2089
  "[data-line]",
@@ -2002,7 +2092,7 @@ const k = {
2002
2092
  ]
2003
2093
  },
2004
2094
  {
2005
- flag: k.Paragraph,
2095
+ flag: R.Paragraph,
2006
2096
  hints: [
2007
2097
  "[data-motion-paragraph]",
2008
2098
  "[data-paragraph]",
@@ -2013,7 +2103,7 @@ const k = {
2013
2103
  ]
2014
2104
  },
2015
2105
  {
2016
- flag: k.Emoji,
2106
+ flag: R.Emoji,
2017
2107
  hints: [
2018
2108
  ":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
2019
2109
  "[data-motion-emoji]",
@@ -2022,160 +2112,160 @@ const k = {
2022
2112
  "[data-emoji]"
2023
2113
  ]
2024
2114
  }
2025
- ], Fe = k.Letter | k.Word | k.Line | k.Paragraph | k.Emoji, An = k.Letter | k.Word | k.Line | k.Paragraph, ut = /* @__PURE__ */ new Map(), Tn = 16384;
2026
- function Io(t, e) {
2027
- if (!t || t.length > Tn)
2115
+ ], $e = R.Letter | R.Word | R.Line | R.Paragraph | R.Emoji, xr = R.Letter | R.Word | R.Line | R.Paragraph, dt = /* @__PURE__ */ new Map(), jr = 16384;
2116
+ function Do(t, e) {
2117
+ if (!t || t.length > jr)
2028
2118
  return t;
2029
- const r = Kn(e), n = oe(r, k.Emoji), o = r & An;
2030
- if (o === k.None && !n)
2119
+ const n = Qr(e), r = se(n, R.Emoji), o = n & xr;
2120
+ if (o === R.None && !r)
2031
2121
  return t;
2032
2122
  const s = t.replace(/\r\n/g, `
2033
2123
  `).replace(/\r/g, `
2034
2124
  `);
2035
- if (o === k.None)
2036
- return ht(s);
2037
- const i = $n(s);
2125
+ if (o === R.None)
2126
+ return mt(s);
2127
+ const i = Xr(s);
2038
2128
  if (i.length === 0)
2039
- return n ? ht(s) : t;
2040
- const a = Vn(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, h = [];
2041
- for (const d of a) {
2042
- const l = Cn(d, r, c);
2043
- h.push(...l);
2129
+ return r ? mt(s) : t;
2130
+ const a = Zr(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, p = [];
2131
+ for (const f of a) {
2132
+ const l = Ur(f, n, c);
2133
+ p.push(...l);
2044
2134
  }
2045
- return h;
2135
+ return p;
2046
2136
  }
2047
- function Cn(t, e, r) {
2048
- const n = [];
2137
+ function Ur(t, e, n) {
2138
+ const r = [];
2049
2139
  for (const o of t) {
2050
- const s = In(o, e, r);
2051
- n.push(...s);
2140
+ const s = Dr(o, e, n);
2141
+ r.push(...s);
2052
2142
  }
2053
- if (oe(e, k.Paragraph)) {
2054
- const o = r.paragraph++;
2143
+ if (se(e, R.Paragraph)) {
2144
+ const o = n.paragraph++;
2055
2145
  return [
2056
- /* @__PURE__ */ R.jsx(
2146
+ /* @__PURE__ */ E.jsx(
2057
2147
  "span",
2058
2148
  {
2059
2149
  "data-motion-paragraph": !0,
2060
- style: ke(o),
2061
- children: n
2150
+ style: Ae(o),
2151
+ children: r
2062
2152
  },
2063
2153
  `motion-paragraph-${o}`
2064
2154
  )
2065
2155
  ];
2066
2156
  }
2067
- return n;
2157
+ return r;
2068
2158
  }
2069
- function In(t, e, r) {
2070
- const n = On(t.text, e, r), o = [];
2071
- if (oe(e, k.Line)) {
2072
- const s = r.line++;
2159
+ function Dr(t, e, n) {
2160
+ const r = Br(t.text, e, n), o = [];
2161
+ if (se(e, R.Line)) {
2162
+ const s = n.line++;
2073
2163
  o.push(
2074
- /* @__PURE__ */ R.jsx("span", { "data-motion-line": !0, style: ke(s), children: n }, `motion-line-${s}`)
2164
+ /* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Ae(s), children: r }, `motion-line-${s}`)
2075
2165
  );
2076
2166
  } else
2077
- o.push(...n);
2167
+ o.push(...r);
2078
2168
  for (let s = 0; s < t.breaks; s++)
2079
- o.push(/* @__PURE__ */ R.jsx("br", {}, `motion-break-${r.br++}`));
2169
+ o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${n.br++}`));
2080
2170
  return o;
2081
2171
  }
2082
- function On(t, e, r) {
2172
+ function Br(t, e, n) {
2083
2173
  if (!t)
2084
2174
  return [];
2085
- const n = oe(e, k.Word), o = [], s = /(\s+)/g;
2175
+ const r = se(e, R.Word), o = [], s = /(\s+)/g;
2086
2176
  let i = 0, a;
2087
2177
  for (; (a = s.exec(t)) !== null; ) {
2088
2178
  if (a.index > i) {
2089
2179
  const c = t.slice(i, a.index);
2090
- o.push(lt(c, r, e, n));
2180
+ o.push(ft(c, n, e, r));
2091
2181
  }
2092
2182
  o.push(a[0]), i = a.index + a[0].length;
2093
2183
  }
2094
2184
  if (i < t.length) {
2095
2185
  const c = t.slice(i);
2096
- o.push(lt(c, r, e, n));
2186
+ o.push(ft(c, n, e, r));
2097
2187
  }
2098
2188
  return o;
2099
2189
  }
2100
- function lt(t, e, r, n) {
2101
- const o = e.word++, s = _n(t, r, e), i = `motion-word-${o}`, a = Nn(o, n);
2102
- return n ? /* @__PURE__ */ R.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ R.jsx("span", { style: a, children: s }, i);
2190
+ function ft(t, e, n, r) {
2191
+ const o = e.word++, s = $r(t, n, e), i = `motion-word-${o}`, a = Fr(o, r);
2192
+ return r ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
2103
2193
  }
2104
- function Nn(t, e) {
2105
- return e ? { ...ke(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2194
+ function Fr(t, e) {
2195
+ return e ? { ...Ae(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
2106
2196
  }
2107
- function _n(t, e, r) {
2197
+ function $r(t, e, n) {
2108
2198
  if (!t)
2109
2199
  return [];
2110
- const n = oe(e, k.Letter), o = oe(e, k.Emoji);
2111
- if (!n) {
2200
+ const r = se(e, R.Letter), o = se(e, R.Emoji);
2201
+ if (!r) {
2112
2202
  if (!o)
2113
2203
  return [t];
2114
- const a = Be(t);
2204
+ const a = Ve(t);
2115
2205
  if (a.length === 0)
2116
2206
  return [t];
2117
- const { nodes: c } = wt(a, r);
2207
+ const { nodes: c } = kt(a, n);
2118
2208
  return c;
2119
2209
  }
2120
- const s = [], i = Be(t);
2210
+ const s = [], i = Ve(t);
2121
2211
  for (const a of i) {
2122
- const c = r.letter++, h = `motion-letter-${c}`, d = ke(c);
2212
+ const c = n.letter++, p = `motion-letter-${c}`, f = Ae(c);
2123
2213
  if (a === `
2124
2214
  `) {
2125
2215
  s.push(
2126
- /* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, children: /* @__PURE__ */ R.jsx("br", {}) }, h)
2216
+ /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, children: /* @__PURE__ */ E.jsx("br", {}) }, p)
2127
2217
  );
2128
2218
  continue;
2129
2219
  }
2130
- const u = o && St(a) ? { "data-motion-emoji": !0 } : void 0, p = a === " " ? " " : a;
2220
+ const u = o && Rt(a) ? { "data-motion-emoji": !0 } : void 0, d = a === " " ? " " : a;
2131
2221
  s.push(
2132
- /* @__PURE__ */ R.jsx("span", { "data-motion-letter": !0, style: d, ...u, children: p }, h)
2222
+ /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: f, ...u, children: d }, p)
2133
2223
  );
2134
2224
  }
2135
2225
  return s;
2136
2226
  }
2137
- function Be(t) {
2227
+ function Ve(t) {
2138
2228
  if (!t)
2139
2229
  return [];
2140
- const e = Pn();
2141
- return e ? Array.from(e.segment(t), (r) => r.segment) : Mn(t);
2230
+ const e = Vr();
2231
+ return e ? Array.from(e.segment(t), (n) => n.segment) : Kr(t);
2142
2232
  }
2143
- let le;
2144
- function Pn() {
2145
- return le !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? le = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : le = null), le;
2233
+ let de;
2234
+ function Vr() {
2235
+ return de !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? de = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : de = null), de;
2146
2236
  }
2147
- function Mn(t) {
2148
- const e = [], r = Array.from(t);
2149
- let n = "";
2150
- for (let o = 0; o < r.length; o++) {
2151
- const s = r[o], i = r[o + 1];
2152
- n += s, !(i && Ln(s, i)) && (e.push(n), n = "");
2237
+ function Kr(t) {
2238
+ const e = [], n = Array.from(t);
2239
+ let r = "";
2240
+ for (let o = 0; o < n.length; o++) {
2241
+ const s = n[o], i = n[o + 1];
2242
+ r += s, !(i && Yr(s, i)) && (e.push(r), r = "");
2153
2243
  }
2154
- return n && e.push(n), e;
2244
+ return r && e.push(r), e;
2155
2245
  }
2156
- function Ln(t, e) {
2157
- return e ? !!(dt(t) || dt(e) || xn(e) || jn(e) || Un(e) || ft(t) && ft(e)) : !1;
2246
+ function Yr(t, e) {
2247
+ return e ? !!(pt(t) || pt(e) || qr(e) || zr(e) || Wr(e) || ht(t) && ht(e)) : !1;
2158
2248
  }
2159
- function dt(t) {
2249
+ function pt(t) {
2160
2250
  return t.codePointAt(0) === 8205;
2161
2251
  }
2162
- function jn(t) {
2252
+ function zr(t) {
2163
2253
  const e = t.codePointAt(0);
2164
2254
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
2165
2255
  }
2166
- function Un(t) {
2256
+ function Wr(t) {
2167
2257
  const e = t.codePointAt(0);
2168
2258
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
2169
2259
  }
2170
- function ft(t) {
2260
+ function ht(t) {
2171
2261
  const e = t.codePointAt(0);
2172
2262
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
2173
2263
  }
2174
- let Ne;
2175
- function xn(t) {
2176
- return t ? (Ne || (Ne = Dn()), Ne(t)) : !1;
2264
+ let _e;
2265
+ function qr(t) {
2266
+ return t ? (_e || (_e = Hr()), _e(t)) : !1;
2177
2267
  }
2178
- function Dn() {
2268
+ function Hr() {
2179
2269
  try {
2180
2270
  const t = new RegExp("\\p{Mark}", "u");
2181
2271
  return (e) => t.test(e);
@@ -2186,55 +2276,55 @@ function Dn() {
2186
2276
  };
2187
2277
  }
2188
2278
  }
2189
- let _e;
2190
- function St(t) {
2191
- return t ? (_e || (_e = Fn()), _e(t)) : !1;
2279
+ let Pe;
2280
+ function Rt(t) {
2281
+ return t ? (Pe || (Pe = Gr()), Pe(t)) : !1;
2192
2282
  }
2193
- function Fn() {
2283
+ function Gr() {
2194
2284
  try {
2195
2285
  const t = new RegExp("\\p{Extended_Pictographic}", "u");
2196
2286
  return (e) => t.test(e);
2197
2287
  } catch {
2198
- return Bn;
2288
+ return Jr;
2199
2289
  }
2200
2290
  }
2201
- function Bn(t) {
2291
+ function Jr(t) {
2202
2292
  if (!t)
2203
2293
  return !1;
2204
2294
  for (const e of Array.from(t)) {
2205
- const r = e.codePointAt(0);
2206
- if (r !== void 0 && (r >= 126976 && r <= 127231 || r >= 127232 && r <= 127487 || r >= 127488 && r <= 127743 || r >= 127744 && r <= 128511 || r >= 128512 && r <= 128591 || r >= 128640 && r <= 128767 || r >= 128768 && r <= 128895 || r >= 128896 && r <= 129023 || r >= 129024 && r <= 129279 || r >= 129280 && r <= 129535 || r >= 129536 && r <= 129791 || r >= 9728 && r <= 9983 || r >= 9984 && r <= 10175 || r === 8205 || r === 65039 || r === 8419))
2295
+ const n = e.codePointAt(0);
2296
+ if (n !== void 0 && (n >= 126976 && n <= 127231 || n >= 127232 && n <= 127487 || n >= 127488 && n <= 127743 || n >= 127744 && n <= 128511 || n >= 128512 && n <= 128591 || n >= 128640 && n <= 128767 || n >= 128768 && n <= 128895 || n >= 128896 && n <= 129023 || n >= 129024 && n <= 129279 || n >= 129280 && n <= 129535 || n >= 129536 && n <= 129791 || n >= 9728 && n <= 9983 || n >= 9984 && n <= 10175 || n === 8205 || n === 65039 || n === 8419))
2207
2297
  return !0;
2208
2298
  }
2209
2299
  return !1;
2210
2300
  }
2211
- function $n(t) {
2301
+ function Xr(t) {
2212
2302
  const e = [];
2213
- let r = "", n = 0;
2303
+ let n = "", r = 0;
2214
2304
  for (let o = 0; o < t.length; o++) {
2215
2305
  const s = t[o];
2216
2306
  if (s === `
2217
2307
  `) {
2218
- n += 1;
2308
+ r += 1;
2219
2309
  continue;
2220
2310
  }
2221
- n > 0 && (e.push({ text: r, breaks: n }), r = "", n = 0), r += s;
2311
+ r > 0 && (e.push({ text: n, breaks: r }), n = "", r = 0), n += s;
2222
2312
  }
2223
- return (n > 0 || r.length > 0) && e.push({ text: r, breaks: n }), e;
2313
+ return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
2224
2314
  }
2225
- function Vn(t) {
2315
+ function Zr(t) {
2226
2316
  if (t.length === 0)
2227
2317
  return [];
2228
2318
  const e = [];
2229
- let r = [];
2230
- for (const n of t)
2231
- r.push(n), n.breaks >= 2 && (e.push(r), r = []);
2232
- return r.length > 0 && e.push(r), e;
2319
+ let n = [];
2320
+ for (const r of t)
2321
+ n.push(r), r.breaks >= 2 && (e.push(n), n = []);
2322
+ return n.length > 0 && e.push(n), e;
2233
2323
  }
2234
- function oe(t, e) {
2324
+ function se(t, e) {
2235
2325
  return (t & e) === e;
2236
2326
  }
2237
- function ke(t) {
2327
+ function Ae(t) {
2238
2328
  return {
2239
2329
  "--tw-motion-seq-index": t.toString(),
2240
2330
  backgroundColor: "inherit",
@@ -2251,133 +2341,133 @@ function ke(t) {
2251
2341
  WebkitTextFillColor: "inherit"
2252
2342
  };
2253
2343
  }
2254
- function ht(t) {
2344
+ function mt(t) {
2255
2345
  if (!t)
2256
2346
  return t;
2257
- const e = Be(t);
2347
+ const e = Ve(t);
2258
2348
  if (e.length === 0)
2259
2349
  return t;
2260
- const { nodes: r, sawEmoji: n } = wt(e);
2261
- return n ? r.length === 1 ? r[0] ?? t : r : t;
2350
+ const { nodes: n, sawEmoji: r } = kt(e);
2351
+ return r ? n.length === 1 ? n[0] ?? t : n : t;
2262
2352
  }
2263
- function wt(t, e) {
2264
- const r = [];
2265
- let n = "", o = !1, s = e?.emoji ?? 0;
2353
+ function kt(t, e) {
2354
+ const n = [];
2355
+ let r = "", o = !1, s = e?.emoji ?? 0;
2266
2356
  const i = () => {
2267
- n && (r.push(n), n = "");
2357
+ r && (n.push(r), r = "");
2268
2358
  };
2269
2359
  for (const a of t) {
2270
- if (St(a)) {
2360
+ if (Rt(a)) {
2271
2361
  o = !0, i();
2272
- const h = `motion-emoji-${e ? e.emoji++ : s++}`;
2273
- r.push(
2274
- /* @__PURE__ */ R.jsx("span", { "data-motion-emoji": !0, children: a }, h)
2362
+ const p = `motion-emoji-${e ? e.emoji++ : s++}`;
2363
+ n.push(
2364
+ /* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, p)
2275
2365
  );
2276
2366
  continue;
2277
2367
  }
2278
- n += a;
2368
+ r += a;
2279
2369
  }
2280
- return i(), o ? { nodes: r, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
2370
+ return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
2281
2371
  }
2282
- function Kn(t) {
2372
+ function Qr(t) {
2283
2373
  if (!t)
2284
- return k.None;
2374
+ return R.None;
2285
2375
  const e = t.trim();
2286
2376
  if (!e)
2287
- return k.None;
2288
- const r = ut.get(e);
2289
- if (typeof r == "number")
2290
- return r;
2377
+ return R.None;
2378
+ const n = dt.get(e);
2379
+ if (typeof n == "number")
2380
+ return n;
2291
2381
  if (typeof document > "u")
2292
- return k.None;
2293
- const n = e.split(/\s+/).filter(Boolean);
2294
- if (n.length === 0)
2295
- return k.None;
2296
- const s = n.map((c) => `.${Yn(c)}`).map(
2297
- (c) => new RegExp(`(^|[^a-zA-Z0-9_-])${zn(c)}(?![a-zA-Z0-9_-])`)
2382
+ return R.None;
2383
+ const r = e.split(/\s+/).filter(Boolean);
2384
+ if (r.length === 0)
2385
+ return R.None;
2386
+ const s = r.map((c) => `.${eo(c)}`).map(
2387
+ (c) => new RegExp(`(^|[^a-zA-Z0-9_-])${to(c)}(?![a-zA-Z0-9_-])`)
2298
2388
  );
2299
- let i = k.None, a = !1;
2389
+ let i = R.None, a = !1;
2300
2390
  for (const c of Array.from(document.styleSheets)) {
2301
- let h;
2391
+ let p;
2302
2392
  try {
2303
- h = c.cssRules;
2393
+ p = c.cssRules;
2304
2394
  } catch {
2305
2395
  continue;
2306
2396
  }
2307
- const d = vt(h, s);
2308
- if (d.mask && (i |= d.mask, i === Fe))
2397
+ const f = At(p, s);
2398
+ if (f.mask && (i |= f.mask, i === $e))
2309
2399
  break;
2310
- a ||= d.sawStyleRule;
2400
+ a ||= f.sawStyleRule;
2311
2401
  }
2312
- return (i !== k.None || a) && ut.set(e, i), i;
2402
+ return (i !== R.None || a) && dt.set(e, i), i;
2313
2403
  }
2314
- function vt(t, e) {
2404
+ function At(t, e) {
2315
2405
  if (!t)
2316
- return { mask: k.None, sawStyleRule: !1 };
2317
- let r = k.None, n = !1;
2406
+ return { mask: R.None, sawStyleRule: !1 };
2407
+ let n = R.None, r = !1;
2318
2408
  for (let o = 0; o < t.length; o++) {
2319
2409
  const s = t[o];
2320
2410
  if (s) {
2321
2411
  if (s.type === CSSRule.STYLE_RULE) {
2322
2412
  const a = s.selectorText ?? "";
2323
- if (!a || !e.some((h) => h.test(a))) continue;
2324
- n = !0;
2325
- for (const h of kn)
2326
- h.hints.some((d) => a.includes(d)) && (r |= h.flag);
2327
- if (r === Fe)
2328
- return { mask: r, sawStyleRule: !0 };
2413
+ if (!a || !e.some((p) => p.test(a))) continue;
2414
+ r = !0;
2415
+ for (const p of Lr)
2416
+ p.hints.some((f) => a.includes(f)) && (n |= p.flag);
2417
+ if (n === $e)
2418
+ return { mask: n, sawStyleRule: !0 };
2329
2419
  } else if ("cssRules" in s) {
2330
- const i = vt(s.cssRules, e);
2331
- if (i.mask && (r |= i.mask, r === Fe))
2332
- return { mask: r, sawStyleRule: !0 };
2333
- n ||= i.sawStyleRule;
2420
+ const i = At(s.cssRules, e);
2421
+ if (i.mask && (n |= i.mask, n === $e))
2422
+ return { mask: n, sawStyleRule: !0 };
2423
+ r ||= i.sawStyleRule;
2334
2424
  }
2335
2425
  }
2336
2426
  }
2337
- return { mask: r, sawStyleRule: n };
2427
+ return { mask: n, sawStyleRule: r };
2338
2428
  }
2339
- function Yn(t) {
2429
+ function eo(t) {
2340
2430
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2341
2431
  }
2342
- function zn(t) {
2432
+ function to(t) {
2343
2433
  return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2344
2434
  }
2345
- const ze = "ikon_auth_session", Wn = 7 * 24 * 60 * 60 * 1e3, qn = 60 * 1e3;
2346
- function Gn(t) {
2435
+ const qe = "ikon_auth_session", no = 7 * 24 * 60 * 60 * 1e3, ro = 60 * 1e3;
2436
+ function oo(t) {
2347
2437
  try {
2348
2438
  const e = t.split(".");
2349
2439
  if (e.length !== 3) return !0;
2350
- const r = JSON.parse(atob(e[1]));
2351
- return typeof r.exp != "number" ? !1 : Date.now() >= r.exp * 1e3 - qn;
2440
+ const n = JSON.parse(atob(e[1]));
2441
+ return typeof n.exp != "number" ? !1 : Date.now() >= n.exp * 1e3 - ro;
2352
2442
  } catch {
2353
2443
  return !0;
2354
2444
  }
2355
2445
  }
2356
- function Ae(t) {
2446
+ function Te(t) {
2357
2447
  try {
2358
- localStorage.setItem(ze, JSON.stringify(t));
2448
+ localStorage.setItem(qe, JSON.stringify(t));
2359
2449
  } catch {
2360
2450
  console.warn("Failed to save auth session to localStorage");
2361
2451
  }
2362
2452
  }
2363
- function Et() {
2453
+ function Tt() {
2364
2454
  try {
2365
- const t = localStorage.getItem(ze);
2455
+ const t = localStorage.getItem(qe);
2366
2456
  if (!t) return null;
2367
2457
  const e = JSON.parse(t);
2368
- return Date.now() - e.authenticatedAt > Wn || Gn(e.token) ? (ve(), null) : e;
2458
+ return Date.now() - e.authenticatedAt > no || oo(e.token) ? (Ee(), null) : e;
2369
2459
  } catch {
2370
2460
  return console.warn("Failed to load auth session from localStorage"), null;
2371
2461
  }
2372
2462
  }
2373
- function ve() {
2463
+ function Ee() {
2374
2464
  try {
2375
- localStorage.removeItem(ze);
2465
+ localStorage.removeItem(qe);
2376
2466
  } catch {
2377
2467
  console.warn("Failed to clear auth session from localStorage");
2378
2468
  }
2379
2469
  }
2380
- function de(t) {
2470
+ function fe(t) {
2381
2471
  return {
2382
2472
  id: "",
2383
2473
  provider: t.provider,
@@ -2385,30 +2475,30 @@ function de(t) {
2385
2475
  authenticatedAt: t.authenticatedAt
2386
2476
  };
2387
2477
  }
2388
- async function Rt(t, e) {
2389
- const r = xt(), n = await fetch(`${e}/anonymous`, {
2478
+ async function Ct(t, e) {
2479
+ const n = $t(), r = await fetch(`${e}/anonymous`, {
2390
2480
  method: "POST",
2391
2481
  headers: { "Content-Type": "application/json" },
2392
- body: JSON.stringify({ deviceId: r, space: t })
2482
+ body: JSON.stringify({ deviceId: n, space: t })
2393
2483
  });
2394
- if (!n.ok) {
2395
- const i = await n.text().catch(() => "Unknown error");
2396
- throw new Error(`Anonymous auth failed: ${n.status} ${i}`);
2484
+ if (!r.ok) {
2485
+ const i = await r.text().catch(() => "Unknown error");
2486
+ throw new Error(`Anonymous auth failed: ${r.status} ${i}`);
2397
2487
  }
2398
- const { token: o } = await n.json(), s = {
2488
+ const { token: o } = await r.json(), s = {
2399
2489
  token: o,
2400
2490
  provider: "anonymous",
2401
2491
  authenticatedAt: Date.now()
2402
2492
  };
2403
- return Ae(s), s;
2493
+ return Te(s), s;
2404
2494
  }
2405
- async function Oo(t) {
2406
- const { email: e, spaceId: r, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${n}/email/send`, {
2495
+ async function Bo(t) {
2496
+ const { email: e, spaceId: n, authUrl: r, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${r}/email/send`, {
2407
2497
  method: "POST",
2408
2498
  headers: { "Content-Type": "application/json" },
2409
2499
  body: JSON.stringify({
2410
2500
  email: e.trim(),
2411
- space: r,
2501
+ space: n,
2412
2502
  return: o
2413
2503
  })
2414
2504
  });
@@ -2417,102 +2507,102 @@ async function Oo(t) {
2417
2507
  throw new Error(i);
2418
2508
  }
2419
2509
  }
2420
- function Hn() {
2421
- const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), r = t.get("ikon_provider");
2422
- return e && r ? { token: e, provider: r } : null;
2510
+ function so() {
2511
+ const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
2512
+ return e && n ? { token: e, provider: n } : null;
2423
2513
  }
2424
- function Jn() {
2514
+ function io() {
2425
2515
  const e = new URLSearchParams(window.location.search).get("error");
2426
2516
  return e ? decodeURIComponent(e) : null;
2427
2517
  }
2428
- function pt() {
2518
+ function gt() {
2429
2519
  window.history.replaceState({}, "", window.location.pathname);
2430
2520
  }
2431
- function Xn(t, e, r, n) {
2432
- const o = n ?? window.location.origin + window.location.pathname + window.location.search;
2433
- return `${r}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
2521
+ function ao(t, e, n, r) {
2522
+ const o = r ?? window.location.origin + window.location.pathname + window.location.search;
2523
+ return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
2434
2524
  }
2435
- async function Zn(t) {
2525
+ async function co(t) {
2436
2526
  const e = await fetch(`${t}/passkey/registration/options`, {
2437
2527
  method: "POST",
2438
2528
  headers: { "Content-Type": "application/json" }
2439
2529
  });
2440
2530
  if (!e.ok) {
2441
- const r = await e.text().catch(() => "Failed to get registration options");
2442
- throw new Error(r);
2531
+ const n = await e.text().catch(() => "Failed to get registration options");
2532
+ throw new Error(n);
2443
2533
  }
2444
2534
  return e.json();
2445
2535
  }
2446
- async function Qn(t, e, r) {
2447
- const n = await fetch(`${t}/passkey/registration/verify`, {
2536
+ async function uo(t, e, n) {
2537
+ const r = await fetch(`${t}/passkey/registration/verify`, {
2448
2538
  method: "POST",
2449
2539
  headers: { "Content-Type": "application/json" },
2450
- body: JSON.stringify({ response: e, name: r })
2540
+ body: JSON.stringify({ response: e, name: n })
2451
2541
  });
2452
- if (!n.ok) {
2453
- const i = await n.text().catch(() => "Registration verification failed");
2542
+ if (!r.ok) {
2543
+ const i = await r.text().catch(() => "Registration verification failed");
2454
2544
  throw new Error(i);
2455
2545
  }
2456
- const { token: o } = await n.json(), s = {
2546
+ const { token: o } = await r.json(), s = {
2457
2547
  token: o,
2458
2548
  provider: "passkey",
2459
2549
  authenticatedAt: Date.now()
2460
2550
  };
2461
- return Ae(s), s;
2551
+ return Te(s), s;
2462
2552
  }
2463
- async function eo(t, e) {
2464
- const r = await fetch(`${t}/passkey/authentication/options`, {
2553
+ async function lo(t, e) {
2554
+ const n = await fetch(`${t}/passkey/authentication/options`, {
2465
2555
  method: "POST",
2466
2556
  headers: { "Content-Type": "application/json" },
2467
2557
  body: JSON.stringify({ email: e })
2468
2558
  });
2469
- if (!r.ok) {
2470
- const n = await r.text().catch(() => "Failed to get authentication options");
2471
- throw new Error(n);
2559
+ if (!n.ok) {
2560
+ const r = await n.text().catch(() => "Failed to get authentication options");
2561
+ throw new Error(r);
2472
2562
  }
2473
- return r.json();
2563
+ return n.json();
2474
2564
  }
2475
- async function to(t, e) {
2476
- const r = await fetch(`${t}/passkey/authentication/verify`, {
2565
+ async function fo(t, e) {
2566
+ const n = await fetch(`${t}/passkey/authentication/verify`, {
2477
2567
  method: "POST",
2478
2568
  headers: { "Content-Type": "application/json" },
2479
2569
  body: JSON.stringify({ response: e })
2480
2570
  });
2481
- if (!r.ok) {
2482
- const s = await r.text().catch(() => "Authentication verification failed");
2571
+ if (!n.ok) {
2572
+ const s = await n.text().catch(() => "Authentication verification failed");
2483
2573
  throw new Error(s);
2484
2574
  }
2485
- const { token: n } = await r.json(), o = {
2486
- token: n,
2575
+ const { token: r } = await n.json(), o = {
2576
+ token: r,
2487
2577
  provider: "passkey",
2488
2578
  authenticatedAt: Date.now()
2489
2579
  };
2490
- return Ae(o), o;
2580
+ return Te(o), o;
2491
2581
  }
2492
2582
  function X(t) {
2493
2583
  const e = new Uint8Array(t);
2494
- let r = "";
2584
+ let n = "";
2495
2585
  for (const o of e)
2496
- r += String.fromCharCode(o);
2497
- return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2586
+ n += String.fromCharCode(o);
2587
+ return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2498
2588
  }
2499
- function Ee(t) {
2500
- 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);
2589
+ function Re(t) {
2590
+ const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - e.length % 4) % 4, r = e.padEnd(e.length + n, "="), o = atob(r), s = new ArrayBuffer(o.length), i = new Uint8Array(s);
2501
2591
  for (let a = 0; a < o.length; a++)
2502
2592
  i[a] = o.charCodeAt(a);
2503
2593
  return s;
2504
2594
  }
2505
- function We() {
2506
- return ro.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2595
+ function He() {
2596
+ return po.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2507
2597
  }
2508
- const ro = {
2598
+ const po = {
2509
2599
  stubThis: (t) => t
2510
2600
  };
2511
- function kt(t) {
2601
+ function It(t) {
2512
2602
  const { id: e } = t;
2513
2603
  return {
2514
2604
  ...t,
2515
- id: Ee(e),
2605
+ id: Re(e),
2516
2606
  /**
2517
2607
  * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
2518
2608
  * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
@@ -2521,25 +2611,25 @@ function kt(t) {
2521
2611
  transports: t.transports
2522
2612
  };
2523
2613
  }
2524
- function At(t) {
2614
+ function Ot(t) {
2525
2615
  return (
2526
2616
  // Consider localhost valid as well since it's okay wrt Secure Contexts
2527
2617
  t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
2528
2618
  );
2529
2619
  }
2530
2620
  class j extends Error {
2531
- constructor({ message: e, code: r, cause: n, name: o }) {
2532
- super(e, { cause: n }), Object.defineProperty(this, "code", {
2621
+ constructor({ message: e, code: n, cause: r, name: o }) {
2622
+ super(e, { cause: r }), Object.defineProperty(this, "code", {
2533
2623
  enumerable: !0,
2534
2624
  configurable: !0,
2535
2625
  writable: !0,
2536
2626
  value: void 0
2537
- }), this.name = o ?? n.name, this.code = r;
2627
+ }), this.name = o ?? r.name, this.code = n;
2538
2628
  }
2539
2629
  }
2540
- function no({ error: t, options: e }) {
2541
- const { publicKey: r } = e;
2542
- if (!r)
2630
+ function ho({ error: t, options: e }) {
2631
+ const { publicKey: n } = e;
2632
+ if (!n)
2543
2633
  throw Error("options was missing required publicKey property");
2544
2634
  if (t.name === "AbortError") {
2545
2635
  if (e.signal instanceof AbortSignal)
@@ -2549,7 +2639,7 @@ function no({ error: t, options: e }) {
2549
2639
  cause: t
2550
2640
  });
2551
2641
  } else if (t.name === "ConstraintError") {
2552
- if (r.authenticatorSelection?.requireResidentKey === !0)
2642
+ if (n.authenticatorSelection?.requireResidentKey === !0)
2553
2643
  return new j({
2554
2644
  message: "Discoverable credentials were required but no available authenticator supported it",
2555
2645
  code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
@@ -2557,14 +2647,14 @@ function no({ error: t, options: e }) {
2557
2647
  });
2558
2648
  if (
2559
2649
  // @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
2560
- e.mediation === "conditional" && r.authenticatorSelection?.userVerification === "required"
2650
+ e.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required"
2561
2651
  )
2562
2652
  return new j({
2563
2653
  message: "User verification was required during automatic registration but it could not be performed",
2564
2654
  code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
2565
2655
  cause: t
2566
2656
  });
2567
- if (r.authenticatorSelection?.userVerification === "required")
2657
+ if (n.authenticatorSelection?.userVerification === "required")
2568
2658
  return new j({
2569
2659
  message: "User verification was required but no available authenticator supported it",
2570
2660
  code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
@@ -2584,7 +2674,7 @@ function no({ error: t, options: e }) {
2584
2674
  cause: t
2585
2675
  });
2586
2676
  if (t.name === "NotSupportedError")
2587
- return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new j({
2677
+ return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new j({
2588
2678
  message: 'No entry in pubKeyCredParams was of type "public-key"',
2589
2679
  code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
2590
2680
  cause: t
@@ -2594,11 +2684,11 @@ function no({ error: t, options: e }) {
2594
2684
  cause: t
2595
2685
  });
2596
2686
  if (t.name === "SecurityError") {
2597
- const n = globalThis.location.hostname;
2598
- if (At(n)) {
2599
- if (r.rp.id !== n)
2687
+ const r = globalThis.location.hostname;
2688
+ if (Ot(r)) {
2689
+ if (n.rp.id !== r)
2600
2690
  return new j({
2601
- message: `The RP ID "${r.rp.id}" is invalid for this domain`,
2691
+ message: `The RP ID "${n.rp.id}" is invalid for this domain`,
2602
2692
  code: "ERROR_INVALID_RP_ID",
2603
2693
  cause: t
2604
2694
  });
@@ -2608,7 +2698,7 @@ function no({ error: t, options: e }) {
2608
2698
  cause: t
2609
2699
  });
2610
2700
  } else if (t.name === "TypeError") {
2611
- if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
2701
+ if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
2612
2702
  return new j({
2613
2703
  message: "User ID was not between 1 and 64 characters",
2614
2704
  code: "ERROR_INVALID_USER_ID_LENGTH",
@@ -2623,7 +2713,7 @@ function no({ error: t, options: e }) {
2623
2713
  }
2624
2714
  return t;
2625
2715
  }
2626
- class oo {
2716
+ class mo {
2627
2717
  constructor() {
2628
2718
  Object.defineProperty(this, "controller", {
2629
2719
  enumerable: !0,
@@ -2634,8 +2724,8 @@ class oo {
2634
2724
  }
2635
2725
  createNewAbortSignal() {
2636
2726
  if (this.controller) {
2637
- const r = new Error("Cancelling existing WebAuthn API call for new one");
2638
- r.name = "AbortError", this.controller.abort(r);
2727
+ const n = new Error("Cancelling existing WebAuthn API call for new one");
2728
+ n.name = "AbortError", this.controller.abort(n);
2639
2729
  }
2640
2730
  const e = new AbortController();
2641
2731
  return this.controller = e, e.signal;
@@ -2647,43 +2737,43 @@ class oo {
2647
2737
  }
2648
2738
  }
2649
2739
  }
2650
- const Tt = new oo(), so = ["cross-platform", "platform"];
2651
- function Ct(t) {
2652
- if (t && !(so.indexOf(t) < 0))
2740
+ const Nt = new mo(), go = ["cross-platform", "platform"];
2741
+ function _t(t) {
2742
+ if (t && !(go.indexOf(t) < 0))
2653
2743
  return t;
2654
2744
  }
2655
- async function io(t) {
2745
+ async function yo(t) {
2656
2746
  !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 });
2657
- const { optionsJSON: e, useAutoRegister: r = !1 } = t;
2658
- if (!We())
2747
+ const { optionsJSON: e, useAutoRegister: n = !1 } = t;
2748
+ if (!He())
2659
2749
  throw new Error("WebAuthn is not supported in this browser");
2660
- const n = {
2750
+ const r = {
2661
2751
  ...e,
2662
- challenge: Ee(e.challenge),
2752
+ challenge: Re(e.challenge),
2663
2753
  user: {
2664
2754
  ...e.user,
2665
- id: Ee(e.user.id)
2755
+ id: Re(e.user.id)
2666
2756
  },
2667
- excludeCredentials: e.excludeCredentials?.map(kt)
2757
+ excludeCredentials: e.excludeCredentials?.map(It)
2668
2758
  }, o = {};
2669
- r && (o.mediation = "conditional"), o.publicKey = n, o.signal = Tt.createNewAbortSignal();
2759
+ n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Nt.createNewAbortSignal();
2670
2760
  let s;
2671
2761
  try {
2672
2762
  s = await navigator.credentials.create(o);
2673
2763
  } catch (m) {
2674
- throw no({ error: m, options: o });
2764
+ throw ho({ error: m, options: o });
2675
2765
  }
2676
2766
  if (!s)
2677
2767
  throw new Error("Registration was not completed");
2678
- const { id: i, rawId: a, response: c, type: h } = s;
2679
- let d;
2680
- typeof c.getTransports == "function" && (d = c.getTransports());
2768
+ const { id: i, rawId: a, response: c, type: p } = s;
2769
+ let f;
2770
+ typeof c.getTransports == "function" && (f = c.getTransports());
2681
2771
  let l;
2682
2772
  if (typeof c.getPublicKeyAlgorithm == "function")
2683
2773
  try {
2684
2774
  l = c.getPublicKeyAlgorithm();
2685
2775
  } catch (m) {
2686
- Pe("getPublicKeyAlgorithm()", m);
2776
+ Me("getPublicKeyAlgorithm()", m);
2687
2777
  }
2688
2778
  let u;
2689
2779
  if (typeof c.getPublicKey == "function")
@@ -2691,14 +2781,14 @@ async function io(t) {
2691
2781
  const m = c.getPublicKey();
2692
2782
  m !== null && (u = X(m));
2693
2783
  } catch (m) {
2694
- Pe("getPublicKey()", m);
2784
+ Me("getPublicKey()", m);
2695
2785
  }
2696
- let p;
2786
+ let d;
2697
2787
  if (typeof c.getAuthenticatorData == "function")
2698
2788
  try {
2699
- p = X(c.getAuthenticatorData());
2789
+ d = X(c.getAuthenticatorData());
2700
2790
  } catch (m) {
2701
- Pe("getAuthenticatorData()", m);
2791
+ Me("getAuthenticatorData()", m);
2702
2792
  }
2703
2793
  return {
2704
2794
  id: i,
@@ -2706,32 +2796,32 @@ async function io(t) {
2706
2796
  response: {
2707
2797
  attestationObject: X(c.attestationObject),
2708
2798
  clientDataJSON: X(c.clientDataJSON),
2709
- transports: d,
2799
+ transports: f,
2710
2800
  publicKeyAlgorithm: l,
2711
2801
  publicKey: u,
2712
- authenticatorData: p
2802
+ authenticatorData: d
2713
2803
  },
2714
- type: h,
2804
+ type: p,
2715
2805
  clientExtensionResults: s.getClientExtensionResults(),
2716
- authenticatorAttachment: Ct(s.authenticatorAttachment)
2806
+ authenticatorAttachment: _t(s.authenticatorAttachment)
2717
2807
  };
2718
2808
  }
2719
- function Pe(t, e) {
2809
+ function Me(t, e) {
2720
2810
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
2721
2811
  `, e);
2722
2812
  }
2723
- function ao() {
2724
- if (!We())
2725
- return Me.stubThis(new Promise((e) => e(!1)));
2813
+ function bo() {
2814
+ if (!He())
2815
+ return Le.stubThis(new Promise((e) => e(!1)));
2726
2816
  const t = globalThis.PublicKeyCredential;
2727
- return t?.isConditionalMediationAvailable === void 0 ? Me.stubThis(new Promise((e) => e(!1))) : Me.stubThis(t.isConditionalMediationAvailable());
2817
+ return t?.isConditionalMediationAvailable === void 0 ? Le.stubThis(new Promise((e) => e(!1))) : Le.stubThis(t.isConditionalMediationAvailable());
2728
2818
  }
2729
- const Me = {
2819
+ const Le = {
2730
2820
  stubThis: (t) => t
2731
2821
  };
2732
- function co({ error: t, options: e }) {
2733
- const { publicKey: r } = e;
2734
- if (!r)
2822
+ function So({ error: t, options: e }) {
2823
+ const { publicKey: n } = e;
2824
+ if (!n)
2735
2825
  throw Error("options was missing required publicKey property");
2736
2826
  if (t.name === "AbortError") {
2737
2827
  if (e.signal instanceof AbortSignal)
@@ -2748,11 +2838,11 @@ function co({ error: t, options: e }) {
2748
2838
  cause: t
2749
2839
  });
2750
2840
  if (t.name === "SecurityError") {
2751
- const n = globalThis.location.hostname;
2752
- if (At(n)) {
2753
- if (r.rpId !== n)
2841
+ const r = globalThis.location.hostname;
2842
+ if (Ot(r)) {
2843
+ if (n.rpId !== r)
2754
2844
  return new j({
2755
- message: `The RP ID "${r.rpId}" is invalid for this domain`,
2845
+ message: `The RP ID "${n.rpId}" is invalid for this domain`,
2756
2846
  code: "ERROR_INVALID_RP_ID",
2757
2847
  cause: t
2758
2848
  });
@@ -2770,96 +2860,96 @@ function co({ error: t, options: e }) {
2770
2860
  }
2771
2861
  return t;
2772
2862
  }
2773
- async function uo(t) {
2863
+ async function wo(t) {
2774
2864
  !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 });
2775
- const { optionsJSON: e, useBrowserAutofill: r = !1, verifyBrowserAutofillInput: n = !0 } = t;
2776
- if (!We())
2865
+ const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
2866
+ if (!He())
2777
2867
  throw new Error("WebAuthn is not supported in this browser");
2778
2868
  let o;
2779
- e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(kt));
2869
+ e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(It));
2780
2870
  const s = {
2781
2871
  ...e,
2782
- challenge: Ee(e.challenge),
2872
+ challenge: Re(e.challenge),
2783
2873
  allowCredentials: o
2784
2874
  }, i = {};
2785
- if (r) {
2786
- if (!await ao())
2875
+ if (n) {
2876
+ if (!await bo())
2787
2877
  throw Error("Browser does not support WebAuthn autofill");
2788
- if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && n)
2878
+ if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
2789
2879
  throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
2790
2880
  i.mediation = "conditional", s.allowCredentials = [];
2791
2881
  }
2792
- i.publicKey = s, i.signal = Tt.createNewAbortSignal();
2882
+ i.publicKey = s, i.signal = Nt.createNewAbortSignal();
2793
2883
  let a;
2794
2884
  try {
2795
2885
  a = await navigator.credentials.get(i);
2796
- } catch (p) {
2797
- throw co({ error: p, options: i });
2886
+ } catch (d) {
2887
+ throw So({ error: d, options: i });
2798
2888
  }
2799
2889
  if (!a)
2800
2890
  throw new Error("Authentication was not completed");
2801
- const { id: c, rawId: h, response: d, type: l } = a;
2891
+ const { id: c, rawId: p, response: f, type: l } = a;
2802
2892
  let u;
2803
- return d.userHandle && (u = X(d.userHandle)), {
2893
+ return f.userHandle && (u = X(f.userHandle)), {
2804
2894
  id: c,
2805
- rawId: X(h),
2895
+ rawId: X(p),
2806
2896
  response: {
2807
- authenticatorData: X(d.authenticatorData),
2808
- clientDataJSON: X(d.clientDataJSON),
2809
- signature: X(d.signature),
2897
+ authenticatorData: X(f.authenticatorData),
2898
+ clientDataJSON: X(f.clientDataJSON),
2899
+ signature: X(f.signature),
2810
2900
  userHandle: u
2811
2901
  },
2812
2902
  type: l,
2813
2903
  clientExtensionResults: a.getClientExtensionResults(),
2814
- authenticatorAttachment: Ct(a.authenticatorAttachment)
2904
+ authenticatorAttachment: _t(a.authenticatorAttachment)
2815
2905
  };
2816
2906
  }
2817
- const qe = mt(null);
2818
- function No({ children: t, config: e }) {
2819
- const [r, n] = J({
2907
+ const Ge = yt(null);
2908
+ function Fo({ children: t, config: e }) {
2909
+ const [n, r] = Y({
2820
2910
  isAuthenticated: !1,
2821
2911
  isLoading: !0,
2822
2912
  user: null,
2823
2913
  error: null
2824
2914
  });
2825
- U(() => {
2915
+ N(() => {
2826
2916
  (() => {
2827
- const d = Jn();
2828
- if (d) {
2829
- pt(), n({
2917
+ const f = io();
2918
+ if (f) {
2919
+ gt(), r({
2830
2920
  isAuthenticated: !1,
2831
2921
  isLoading: !1,
2832
2922
  user: null,
2833
- error: d
2923
+ error: f
2834
2924
  });
2835
2925
  return;
2836
2926
  }
2837
- const l = Hn();
2927
+ const l = so();
2838
2928
  if (l) {
2839
- const p = {
2929
+ const d = {
2840
2930
  token: l.token,
2841
2931
  provider: l.provider,
2842
2932
  authenticatedAt: Date.now()
2843
2933
  };
2844
- Ae(p), pt(), n({
2934
+ Te(d), gt(), r({
2845
2935
  isAuthenticated: !0,
2846
2936
  isLoading: !1,
2847
- user: de(p),
2937
+ user: fe(d),
2848
2938
  error: null
2849
2939
  });
2850
2940
  return;
2851
2941
  }
2852
- const u = Et();
2942
+ const u = Tt();
2853
2943
  if (u) {
2854
- n({
2944
+ r({
2855
2945
  isAuthenticated: !0,
2856
2946
  isLoading: !1,
2857
- user: de(u),
2947
+ user: fe(u),
2858
2948
  error: null
2859
2949
  });
2860
2950
  return;
2861
2951
  }
2862
- n({
2952
+ r({
2863
2953
  isAuthenticated: !1,
2864
2954
  isLoading: !1,
2865
2955
  user: null,
@@ -2868,27 +2958,27 @@ function No({ children: t, config: e }) {
2868
2958
  })();
2869
2959
  }, []);
2870
2960
  const o = D(
2871
- async (h) => {
2961
+ async (p) => {
2872
2962
  if (!e.spaceId) {
2873
- n((l) => ({
2963
+ r((l) => ({
2874
2964
  ...l,
2875
2965
  error: "Space ID is not configured"
2876
2966
  }));
2877
2967
  return;
2878
2968
  }
2879
- const d = Le(e.authUrl);
2880
- if (h === "guest") {
2881
- n((l) => ({ ...l, isLoading: !0 }));
2969
+ const f = xe(e.authUrl);
2970
+ if (p === "guest") {
2971
+ r((l) => ({ ...l, isLoading: !0 }));
2882
2972
  try {
2883
- const l = await Rt(e.spaceId, d);
2884
- n({
2973
+ const l = await Ct(e.spaceId, f);
2974
+ r({
2885
2975
  isAuthenticated: !0,
2886
2976
  isLoading: !1,
2887
- user: de(l),
2977
+ user: fe(l),
2888
2978
  error: null
2889
2979
  });
2890
2980
  } catch (l) {
2891
- n((u) => ({
2981
+ r((u) => ({
2892
2982
  ...u,
2893
2983
  isLoading: !1,
2894
2984
  error: l instanceof Error ? l.message : "Guest login failed"
@@ -2896,18 +2986,18 @@ function No({ children: t, config: e }) {
2896
2986
  }
2897
2987
  return;
2898
2988
  }
2899
- if (h === "passkey") {
2900
- n((l) => ({ ...l, isLoading: !0, error: null }));
2989
+ if (p === "passkey") {
2990
+ r((l) => ({ ...l, isLoading: !0, error: null }));
2901
2991
  try {
2902
- const l = await eo(d), u = await uo({ optionsJSON: l }), p = await to(d, u);
2903
- n({
2992
+ const l = await lo(f), u = await wo({ optionsJSON: l }), d = await fo(f, u);
2993
+ r({
2904
2994
  isAuthenticated: !0,
2905
2995
  isLoading: !1,
2906
- user: de(p),
2996
+ user: fe(d),
2907
2997
  error: null
2908
2998
  });
2909
2999
  } catch (l) {
2910
- n((u) => ({
3000
+ r((u) => ({
2911
3001
  ...u,
2912
3002
  isLoading: !1,
2913
3003
  error: l instanceof Error ? l.message : "Passkey login failed"
@@ -2915,30 +3005,30 @@ function No({ children: t, config: e }) {
2915
3005
  }
2916
3006
  return;
2917
3007
  }
2918
- window.location.href = Xn(h, e.spaceId, d);
3008
+ window.location.href = ao(p, e.spaceId, f);
2919
3009
  },
2920
3010
  [e.authUrl, e.spaceId]
2921
3011
  ), s = D(() => {
2922
- ve(), n({
3012
+ Ee(), r({
2923
3013
  isAuthenticated: !1,
2924
3014
  isLoading: !1,
2925
3015
  user: null,
2926
3016
  error: null
2927
3017
  });
2928
3018
  }, []), i = D(
2929
- async (h) => {
2930
- const d = Le(e.authUrl);
2931
- n((l) => ({ ...l, isLoading: !0, error: null }));
3019
+ async (p) => {
3020
+ const f = xe(e.authUrl);
3021
+ r((l) => ({ ...l, isLoading: !0, error: null }));
2932
3022
  try {
2933
- const l = await Zn(d), u = await io({ optionsJSON: l }), p = await Qn(d, u, h);
2934
- n({
3023
+ const l = await co(f), u = await yo({ optionsJSON: l }), d = await uo(f, u, p);
3024
+ r({
2935
3025
  isAuthenticated: !0,
2936
3026
  isLoading: !1,
2937
- user: de(p),
3027
+ user: fe(d),
2938
3028
  error: null
2939
3029
  });
2940
3030
  } catch (l) {
2941
- n((u) => ({
3031
+ r((u) => ({
2942
3032
  ...u,
2943
3033
  isLoading: !1,
2944
3034
  error: l instanceof Error ? l.message : "Passkey registration failed"
@@ -2946,127 +3036,127 @@ function No({ children: t, config: e }) {
2946
3036
  }
2947
3037
  },
2948
3038
  [e.authUrl]
2949
- ), a = D(() => r.user?.token ?? null, [r.user]), c = V(
3039
+ ), a = D(() => n.user?.token ?? null, [n.user]), c = K(
2950
3040
  () => ({
2951
- state: r,
3041
+ state: n,
2952
3042
  login: o,
2953
3043
  logout: s,
2954
3044
  getToken: a,
2955
3045
  registerPasskey: i
2956
3046
  }),
2957
- [r, o, s, a, i]
3047
+ [n, o, s, a, i]
2958
3048
  );
2959
- return /* @__PURE__ */ R.jsx(qe, { value: c, children: t });
3049
+ return /* @__PURE__ */ E.jsx(Ge, { value: c, children: t });
2960
3050
  }
2961
- function lo() {
2962
- const t = Ve(qe);
3051
+ function vo() {
3052
+ const t = Ye(Ge);
2963
3053
  if (!t)
2964
3054
  throw new Error("useAuth must be used within an AuthProvider");
2965
3055
  return t;
2966
3056
  }
2967
- function fo() {
2968
- return Ve(qe);
3057
+ function Eo() {
3058
+ return Ye(Ge);
2969
3059
  }
2970
- function _o(t) {
2971
- const { config: e, guestUrlParam: r } = t, { state: n, login: o } = lo(), s = w(!1);
2972
- return U(() => {
2973
- if (!r || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
3060
+ function $o(t) {
3061
+ const { config: e, guestUrlParam: n } = t, { state: r, login: o } = vo(), s = v(!1);
3062
+ return N(() => {
3063
+ if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
2974
3064
  return;
2975
- const i = new URLSearchParams(window.location.search), a = i.get(r);
3065
+ const i = new URLSearchParams(window.location.search), a = i.get(n);
2976
3066
  if (a === "true" || a === "1" || a === "") {
2977
- i.delete(r);
2978
- const c = i.toString(), h = window.location.pathname + (c ? `?${c}` : "");
2979
- window.history.replaceState({}, "", h), s.current = !0, o("guest");
3067
+ i.delete(n);
3068
+ const c = i.toString(), p = window.location.pathname + (c ? `?${c}` : "");
3069
+ window.history.replaceState({}, "", p), s.current = !0, o("guest");
2980
3070
  }
2981
- }, [r, n.isAuthenticated, n.isLoading, e.methods, o]), {
2982
- shouldRenderChildren: n.isAuthenticated,
2983
- isCheckingAuth: n.isLoading,
2984
- isAuthenticated: n.isAuthenticated,
2985
- error: n.error
3071
+ }, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
3072
+ shouldRenderChildren: r.isAuthenticated,
3073
+ isCheckingAuth: r.isLoading,
3074
+ isAuthenticated: r.isAuthenticated,
3075
+ error: r.error
2986
3076
  };
2987
3077
  }
2988
- function Po({
3078
+ function Vo({
2989
3079
  connectionState: t,
2990
3080
  error: e,
2991
- isReady: r,
2992
- stores: n,
3081
+ isReady: n,
3082
+ stores: r,
2993
3083
  registry: o,
2994
3084
  client: s,
2995
3085
  onAction: i,
2996
3086
  renderIdle: a,
2997
3087
  renderConnecting: c,
2998
- renderConnectingSlow: h,
2999
- renderConnected: d,
3088
+ renderConnectingSlow: p,
3089
+ renderConnected: f,
3000
3090
  renderOffline: l,
3001
3091
  renderError: u
3002
3092
  }) {
3003
- const p = w(!1);
3093
+ const d = v(!1);
3004
3094
  switch (t) {
3005
3095
  case "idle":
3006
3096
  return a();
3007
3097
  case "connecting":
3008
3098
  return c();
3009
3099
  case "connectingSlow":
3010
- return h();
3100
+ return p();
3011
3101
  case "connected":
3012
3102
  case "reconnecting": {
3013
- if (!r || !n || !o) return null;
3014
- t === "reconnecting" && (p.current = !0);
3015
- const m = n.size > 0;
3016
- return m && (p.current = !1), d({
3017
- stores: n,
3103
+ if (!n || !r || !o) return null;
3104
+ t === "reconnecting" && (d.current = !0);
3105
+ const m = r.size > 0;
3106
+ return m && (d.current = !1), f({
3107
+ stores: r,
3018
3108
  registry: o,
3019
3109
  client: s,
3020
3110
  onAction: i,
3021
- isReconnecting: t === "reconnecting" || p.current && !m
3111
+ isReconnecting: t === "reconnecting" || d.current && !m
3022
3112
  });
3023
3113
  }
3024
3114
  case "offline":
3025
- return p.current = !1, l();
3115
+ return d.current = !1, l();
3026
3116
  case "offlineError":
3027
- return p.current = !1, u(e ?? s?.lastError?.message ?? null);
3117
+ return d.current = !1, u(e ?? s?.lastError?.message ?? null);
3028
3118
  default:
3029
3119
  return null;
3030
3120
  }
3031
3121
  }
3032
- const be = Re("useIkonApp");
3033
- function ho() {
3122
+ const be = ke("useIkonApp");
3123
+ function Ro() {
3034
3124
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__)
3035
3125
  return window.__IKON_AUTH_CONFIG__;
3036
3126
  }
3037
- function po() {
3127
+ function ko() {
3038
3128
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__)
3039
3129
  return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
3040
3130
  }
3041
- function Mo(t) {
3042
- const { authConfig: e, modules: r, timeouts: n, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: h, proxy: d } = t, l = e === void 0 ? ho() ?? null : e, u = po(), p = fo(), m = w(null), b = w(null), g = w(null), y = w(!1), v = w(!1), E = w(o), T = w(n), O = w(s), K = w(i), Q = w(a), C = w(c), _ = w(h), x = w(d);
3043
- E.current = o, T.current = n, O.current = s, K.current = i, Q.current = a, C.current = c, _.current = h, x.current = d;
3044
- const [P, F] = J("idle"), [z, ne] = J(null), [he, pe] = J(null), [se, me] = J(null), [ee, f] = J(null), [S, A] = J(!1), [M, W] = J(0), I = V(() => {
3131
+ function Ko(t) {
3132
+ const { authConfig: e, modules: n, timeouts: r, backgroundAudio: o, webRtc: s, audio: i, video: a, websocket: c, webtransport: p, proxy: f } = t, l = e === void 0 ? Ro() ?? null : e, u = ko(), d = Eo(), m = v(null), b = v(null), g = v(null), y = v(!1), w = v(!1), T = v(o), C = v(r), _ = v(s), B = v(i), Q = v(a), A = v(c), P = v(p), U = v(f);
3133
+ T.current = o, C.current = r, _.current = s, B.current = i, Q.current = a, A.current = c, P.current = p, U.current = f;
3134
+ const [M, F] = Y("idle"), [W, re] = Y(null), [pe, he] = Y(null), [ie, me] = Y(null), [ee, h] = Y(null), [S, k] = Y(!1), [L, q] = Y(0), I = K(() => {
3045
3135
  try {
3046
- const L = Dt();
3047
- return (L.sessionId || L.channelKey) && Ft(), L;
3136
+ const x = Vt();
3137
+ return (x.sessionId || x.channelKey) && Kt(), x;
3048
3138
  } catch {
3049
3139
  return { parameters: {} };
3050
3140
  }
3051
- }, []), q = V(() => l?.enabled ? Et() : null, [l?.enabled, M]), te = u?.enabled ?? !1, N = u?.host ?? "localhost", G = u?.port ?? 8443;
3052
- U(() => {
3053
- !te && Ge() && l && !l.enabled && l.spaceId && !ee && !S && (A(!0), Rt(l.spaceId, Le(l.authUrl)).then(($) => {
3054
- f($.token);
3055
- }).catch(($) => {
3056
- be.error("Anonymous auth failed:", $), ne($ instanceof Error ? $.message : "Anonymous auth failed");
3141
+ }, []), H = K(() => l?.enabled ? Tt() : null, [l?.enabled, L]), te = u?.enabled ?? !1, O = u?.host ?? "localhost", G = u?.port ?? 8443;
3142
+ N(() => {
3143
+ !te && Je() && l && !l.enabled && l.spaceId && !ee && !S && (k(!0), Ct(l.spaceId, xe(l.authUrl)).then((V) => {
3144
+ h(V.token);
3145
+ }).catch((V) => {
3146
+ be.error("Anonymous auth failed:", V), re(V instanceof Error ? V.message : "Anonymous auth failed");
3057
3147
  }).finally(() => {
3058
- A(!1);
3148
+ k(!1);
3059
3149
  }));
3060
3150
  }, [te, l, ee, S]);
3061
- const re = V(() => {
3151
+ const ne = K(() => {
3062
3152
  if (te) {
3063
- const L = q?.token ? Bt(q.token) ?? void 0 : void 0;
3153
+ const x = H?.token ? Yt(H.token) ?? void 0 : void 0;
3064
3154
  return {
3065
3155
  local: {
3066
- host: N,
3156
+ host: O,
3067
3157
  httpsPort: G,
3068
- userId: L,
3069
- token: q?.token ?? void 0,
3158
+ userId: x,
3159
+ token: H?.token ?? void 0,
3070
3160
  spaceId: l?.spaceId,
3071
3161
  backendUrl: l?.backendUrl,
3072
3162
  authUrl: l?.authUrl,
@@ -3074,11 +3164,11 @@ function Mo(t) {
3074
3164
  }
3075
3165
  };
3076
3166
  }
3077
- return q?.token && l?.spaceId ? {
3167
+ return H?.token && l?.spaceId ? {
3078
3168
  sessionToken: {
3079
- token: q.token,
3169
+ token: H.token,
3080
3170
  spaceId: l.spaceId,
3081
- backendType: He(),
3171
+ backendType: Xe(),
3082
3172
  sessionId: I.sessionId,
3083
3173
  channelKey: I.channelKey,
3084
3174
  parameters: I.parameters
@@ -3087,14 +3177,14 @@ function Mo(t) {
3087
3177
  sessionToken: {
3088
3178
  token: ee,
3089
3179
  spaceId: l.spaceId,
3090
- backendType: He(),
3180
+ backendType: Xe(),
3091
3181
  sessionId: I.sessionId,
3092
3182
  channelKey: I.channelKey,
3093
3183
  parameters: I.parameters
3094
3184
  }
3095
- } : Ge() ? null : {
3185
+ } : Je() ? null : {
3096
3186
  local: {
3097
- host: N,
3187
+ host: O,
3098
3188
  httpsPort: G,
3099
3189
  spaceId: l?.spaceId,
3100
3190
  backendUrl: l?.backendUrl,
@@ -3102,105 +3192,105 @@ function Mo(t) {
3102
3192
  parameters: I.parameters
3103
3193
  }
3104
3194
  };
3105
- }, [te, N, G, q?.token, l?.spaceId, l?.backendUrl, l?.authUrl, ee, I.sessionId, I.channelKey, I.parameters]);
3106
- rn(se);
3107
- const Te = on(se);
3108
- U(() => {
3195
+ }, [te, O, G, H?.token, l?.spaceId, l?.backendUrl, l?.authUrl, ee, I.sessionId, I.channelKey, I.parameters]);
3196
+ pr(ie);
3197
+ const Ce = mr(ie);
3198
+ N(() => {
3109
3199
  if (!y.current) {
3110
- if (y.current = !0, g.current = Gr(), r)
3111
- for (const L of r)
3112
- L(g.current);
3113
- g.current.loadRegisteredModules().catch((L) => {
3114
- be.error("Failed to load UI modules", L);
3200
+ if (y.current = !0, g.current = sr(), n)
3201
+ for (const x of n)
3202
+ x(g.current);
3203
+ g.current.loadRegisteredModules().catch((x) => {
3204
+ be.error("Failed to load UI modules", x);
3115
3205
  });
3116
3206
  }
3117
- }, []), U(() => {
3118
- if (!re) return;
3119
- const L = new $t({
3120
- ...re,
3121
- timeouts: T.current,
3122
- audio: K.current !== void 0 || E.current ? {
3123
- enabled: K.current,
3124
- ...E.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
3207
+ }, []), N(() => {
3208
+ if (!ne) return;
3209
+ const x = new zt({
3210
+ ...ne,
3211
+ timeouts: C.current,
3212
+ audio: B.current !== void 0 || T.current ? {
3213
+ enabled: B.current,
3214
+ ...T.current ? { background: { allowOnDesktop: !0, allowOnMobile: !0 } } : {}
3125
3215
  } : void 0,
3126
3216
  video: Q.current !== void 0 ? { enabled: Q.current } : void 0,
3127
3217
  mediaSession: { title: document.title || void 0, artist: document.title || void 0 },
3128
- webRtc: O.current ? { enabled: !0 } : void 0,
3129
- websocket: C.current,
3130
- webtransport: _.current,
3131
- proxy: x.current,
3132
- onConnectionStateChange: (H) => {
3133
- F(H);
3218
+ webRtc: _.current === !1 ? { enabled: !1 } : void 0,
3219
+ websocket: A.current,
3220
+ webtransport: P.current,
3221
+ proxy: U.current,
3222
+ onConnectionStateChange: (J) => {
3223
+ F(J);
3134
3224
  },
3135
- onError: (H) => {
3136
- ne(H.message);
3225
+ onError: (J) => {
3226
+ re(J.message);
3137
3227
  }
3138
3228
  });
3139
- m.current = L;
3140
- const $ = new ur({ client: L });
3141
- return b.current = $, me($), L.connect().catch((H) => {
3142
- if (be.error("Connection failed:", H), H instanceof Vt) {
3143
- pe(H.reason);
3229
+ m.current = x;
3230
+ const V = new hn({ client: x });
3231
+ return b.current = V, me(V), x.connect().catch((J) => {
3232
+ if (be.error("Connection failed:", J), J instanceof Wt) {
3233
+ he(J.reason);
3144
3234
  return;
3145
3235
  }
3146
- H instanceof Kt && !v.current && (v.current = !0, be.warn("Auth session appears stale, clearing and retrying"), p ? p.logout() : (ve(), W((_t) => _t + 1)));
3236
+ J instanceof qt && !w.current && (w.current = !0, be.warn("Auth session appears stale, clearing and retrying"), d ? d.logout() : (Ee(), q((xt) => xt + 1)));
3147
3237
  }), () => {
3148
- L.disconnect(), m.current = null, $.dispose(), b.current = null;
3238
+ x.disconnect(), m.current = null, V.dispose(), b.current = null;
3149
3239
  };
3150
- }, [re]);
3151
- const Ot = D((L, $) => {
3152
- const H = typeof $ == "string" ? $ : JSON.stringify($ ?? {});
3153
- m.current?.sendActionCall(L, H);
3154
- }, []), Nt = P === "connected" || P === "reconnecting";
3240
+ }, [ne]);
3241
+ const Mt = D((x, V) => {
3242
+ const J = typeof V == "string" ? V : JSON.stringify(V ?? {});
3243
+ m.current?.sendActionCall(x, J);
3244
+ }, []), Lt = M === "connected" || M === "reconnecting";
3155
3245
  return {
3156
- connectionState: P,
3157
- error: z,
3158
- accessDeniedReason: he,
3159
- stores: Te,
3246
+ connectionState: M,
3247
+ error: W,
3248
+ accessDeniedReason: pe,
3249
+ stores: Ce,
3160
3250
  client: m.current,
3161
3251
  registry: g.current,
3162
3252
  clientRef: m,
3163
3253
  uiRef: b,
3164
3254
  registryRef: g,
3165
- onAction: Ot,
3166
- isReady: Nt,
3255
+ onAction: Mt,
3256
+ isReady: Lt,
3167
3257
  webRtcVideoStreams: m.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
3168
3258
  webRtcTrackMap: m.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
3169
3259
  };
3170
3260
  }
3171
- function Lo(t) {
3172
- const e = w(!1);
3261
+ function Yo(t) {
3262
+ const e = v(!1);
3173
3263
  return D(() => {
3174
3264
  if (e.current) return;
3175
3265
  e.current = !0;
3176
- const r = document.createElement("link");
3177
- r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
3266
+ const n = document.createElement("link");
3267
+ n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
3178
3268
  }, [t]);
3179
3269
  }
3180
- let mo = 0;
3181
- function jo(t = 5, e = 5e3) {
3182
- const [r, n] = J([]), o = w(/* @__PURE__ */ new Map()), s = D((i) => {
3270
+ let Ao = 0;
3271
+ function zo(t = 5, e = 5e3) {
3272
+ const [n, r] = Y([]), o = v(/* @__PURE__ */ new Map()), s = D((i) => {
3183
3273
  const a = o.current.get(i);
3184
- a && (clearTimeout(a), o.current.delete(i)), n((c) => c.filter((h) => h.id !== i));
3274
+ a && (clearTimeout(a), o.current.delete(i)), r((c) => c.filter((p) => p.id !== i));
3185
3275
  }, []);
3186
- return U(() => {
3187
- const i = o.current, a = Yt(
3276
+ return N(() => {
3277
+ const i = o.current, a = Ht(
3188
3278
  (c) => {
3189
- if (!zt())
3279
+ if (!Gt())
3190
3280
  return;
3191
- const h = `toast-${++mo}`, d = c.level === Je.ERROR ? "error" : "warn", l = {
3192
- id: h,
3193
- level: d,
3281
+ const p = `toast-${++Ao}`, f = c.level === Ze.ERROR ? "error" : "warn", l = {
3282
+ id: p,
3283
+ level: f,
3194
3284
  message: c.message,
3195
3285
  component: c.component
3196
3286
  };
3197
- n((p) => [...p, l].slice(-t));
3287
+ r((d) => [...d, l].slice(-t));
3198
3288
  const u = setTimeout(() => {
3199
- s(h);
3289
+ s(p);
3200
3290
  }, e);
3201
- i.set(h, u);
3291
+ i.set(p, u);
3202
3292
  },
3203
- { minLevel: Je.WARN }
3293
+ { minLevel: Ze.WARN }
3204
3294
  );
3205
3295
  return () => {
3206
3296
  a();
@@ -3208,103 +3298,103 @@ function jo(t = 5, e = 5e3) {
3208
3298
  clearTimeout(c);
3209
3299
  i.clear();
3210
3300
  };
3211
- }, [t, e, s]), { toasts: r, dismissToast: s };
3301
+ }, [t, e, s]), { toasts: n, dismissToast: s };
3212
3302
  }
3213
- const It = mt(null);
3214
- function go(t, e) {
3215
- return e ? t.replace(/\{(\w+)\}/g, (r, n) => e[n] ?? `{${n}}`) : t;
3303
+ const Pt = yt(null);
3304
+ function To(t, e) {
3305
+ return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
3216
3306
  }
3217
- function yo(t, e) {
3218
- const r = Wt();
3219
- if (r && t.includes(r))
3220
- return r;
3221
- const n = navigator.language.split("-")[0];
3222
- return t.includes(n) ? n : e && t.includes(e) ? e : "en";
3307
+ function Co(t, e) {
3308
+ const n = Jt();
3309
+ if (n && t.includes(n))
3310
+ return n;
3311
+ const r = navigator.language.split("-")[0];
3312
+ return t.includes(r) ? r : e && t.includes(e) ? e : "en";
3223
3313
  }
3224
- function bo(t, e, r) {
3225
- return e ? yo(t, r) : r && t.includes(r) ? r : "en";
3314
+ function Io(t, e, n) {
3315
+ return e ? Co(t, n) : n && t.includes(n) ? n : "en";
3226
3316
  }
3227
- function Uo({
3317
+ function Wo({
3228
3318
  children: t,
3229
3319
  translations: e,
3230
- defaultLanguage: r,
3231
- detectLanguage: n = !1
3320
+ defaultLanguage: n,
3321
+ detectLanguage: r = !1
3232
3322
  }) {
3233
- const o = Object.keys(e), s = bo(o, n, r), i = e[s] ?? e.en, a = V(
3323
+ const o = Object.keys(e), s = Io(o, r, n), i = e[s] ?? e.en, a = K(
3234
3324
  () => ({
3235
- t: (c, h) => {
3236
- const d = i[c];
3237
- return go(d, h);
3325
+ t: (c, p) => {
3326
+ const f = i[c];
3327
+ return To(f, p);
3238
3328
  },
3239
3329
  locale: s,
3240
3330
  translations: i
3241
3331
  }),
3242
3332
  [i, s]
3243
3333
  );
3244
- return /* @__PURE__ */ R.jsx(It, { value: a, children: t });
3334
+ return /* @__PURE__ */ E.jsx(Pt, { value: a, children: t });
3245
3335
  }
3246
- function xo() {
3247
- const t = Ve(It);
3336
+ function qo() {
3337
+ const t = Ye(Pt);
3248
3338
  if (!t)
3249
3339
  throw new Error("useI18n must be used within an I18nProvider");
3250
3340
  return t;
3251
3341
  }
3252
3342
  export {
3253
- No as AuthProvider,
3254
- Po as ConnectionStateRenderer,
3255
- Uo as I18nProvider,
3256
- yr as IKON_UI_BASE_MODULE,
3257
- Or as IKON_UI_MEDIA_MODULE,
3258
- Yr as IKON_UI_SHADERTOY_MODULE,
3259
- Vr as IKON_UI_SHADERTOY_TYPE,
3343
+ Fo as AuthProvider,
3344
+ Vo as ConnectionStateRenderer,
3345
+ Wo as I18nProvider,
3346
+ In as IKON_UI_BASE_MODULE,
3347
+ Fn as IKON_UI_MEDIA_MODULE,
3348
+ tr as IKON_UI_SHADERTOY_MODULE,
3349
+ Qn as IKON_UI_SHADERTOY_TYPE,
3260
3350
  Ue as IKON_UI_STREAM_CATEGORY,
3261
- kr as IKON_UI_VIDEO_CANVAS_TYPE,
3262
- Ar as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3263
- ur as IkonUi,
3264
- qr as IkonUiRegistry,
3265
- ko as IkonUiSurface,
3266
- ar as InspectOverlay,
3267
- ir as UiComponentRegistry,
3268
- sr as UiRenderer,
3269
- Bo as UiStreamStore,
3270
- Ao as areIkonUiModuleListsEqual,
3271
- Rt as authenticateAnonymous,
3272
- Xn as buildOAuthRedirectUrl,
3273
- ve as clearAuthSession,
3274
- pt as clearOAuthParams,
3275
- gr as createBaseResolvers,
3276
- Eo as createComponentLibrary,
3277
- Gr as createIkonUiRegistry,
3278
- Cr as createMediaResolvers,
3279
- Kr as createShadertoyRendererResolver,
3280
- cr as isIkonUiCategoryMatch,
3281
- Et as loadAuthSession,
3282
- br as loadBaseModule,
3283
- Nr as loadMediaModule,
3284
- zr as loadShadertoyModule,
3285
- En as normalizeIkonUiModuleList,
3286
- Co as parseIkonUiInitPayload,
3287
- Hn as parseOAuthCallback,
3288
- Jn as parseOAuthError,
3289
- Rn as readIkonUiModules,
3290
- To as readIkonUiModulesFromSources,
3291
- Sr as registerBaseModule,
3292
- _r as registerMediaModule,
3293
- Wr as registerShadertoyModule,
3294
- nr as renderChildren,
3295
- Io as renderMotionLetters,
3296
- Ae as saveAuthSession,
3297
- Oo as sendMagicLink,
3298
- de as sessionToUser,
3299
- lo as useAuth,
3300
- _o as useAuthGuard,
3301
- fo as useAuthOptional,
3302
- xo as useI18n,
3303
- Mo as useIkonApp,
3304
- rn as useIkonStyles,
3305
- on as useIkonUiStores,
3306
- Lo as useLazyFont,
3307
- jo as useToasts,
3351
+ xn as IKON_UI_VIDEO_CANVAS_TYPE,
3352
+ jn as IKON_UI_VIDEO_URL_PLAYER_TYPE,
3353
+ hn as IkonUi,
3354
+ or as IkonUiRegistry,
3355
+ Lo as IkonUiSurface,
3356
+ fn as InspectOverlay,
3357
+ dn as UiComponentRegistry,
3358
+ ln as UiRenderer,
3359
+ Jo as UiStreamStore,
3360
+ xo as areIkonUiModuleListsEqual,
3361
+ Ct as authenticateAnonymous,
3362
+ ao as buildOAuthRedirectUrl,
3363
+ Ee as clearAuthSession,
3364
+ gt as clearOAuthParams,
3365
+ Cn as createBaseResolvers,
3366
+ Po as createComponentLibrary,
3367
+ sr as createIkonUiRegistry,
3368
+ Dn as createMediaResolvers,
3369
+ er as createShadertoyRendererResolver,
3370
+ pn as isIkonUiCategoryMatch,
3371
+ Tt as loadAuthSession,
3372
+ On as loadBaseModule,
3373
+ $n as loadMediaModule,
3374
+ nr as loadShadertoyModule,
3375
+ Pr as normalizeIkonUiModuleList,
3376
+ Uo as parseIkonUiInitPayload,
3377
+ so as parseOAuthCallback,
3378
+ io as parseOAuthError,
3379
+ Mr as readIkonUiModules,
3380
+ jo as readIkonUiModulesFromSources,
3381
+ Nn as registerBaseModule,
3382
+ Vn as registerMediaModule,
3383
+ rr as registerShadertoyModule,
3384
+ cn as renderChildren,
3385
+ Do as renderMotionLetters,
3386
+ Te as saveAuthSession,
3387
+ Bo as sendMagicLink,
3388
+ fe as sessionToUser,
3389
+ vo as useAuth,
3390
+ $o as useAuthGuard,
3391
+ Eo as useAuthOptional,
3392
+ qo as useI18n,
3393
+ Ko as useIkonApp,
3394
+ pr as useIkonStyles,
3395
+ mr as useIkonUiStores,
3396
+ Yo as useLazyFont,
3397
+ zo as useToasts,
3308
3398
  Z as useUiNode,
3309
- Ro as useUiStore
3399
+ Mo as useUiStore
3310
3400
  };