@ikonai/sdk-react-ui 0.0.42 → 1.0.0

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 gt } from "@ikonai/sdk-ui";
2
- import { UiStreamStore as On } from "@ikonai/sdk-ui";
3
- import yt, { useSyncExternalStore as _e, useMemo as L, memo as U, useRef as E, useCallback as z, Fragment as St, useEffect as $, useState as Y, createContext as nt, use as Me } from "react";
4
- import { createLogger as ye, getOrCreateDeviceId as me, deriveAuthUrl as Ne, parseUrlParams as bt, isCloudEnvironment as xe, extractUserIdFromToken as vt, deriveBackendType as $e, IkonClient as wt } from "@ikonai/sdk";
5
- var he = { exports: {} }, ee = {};
1
+ import { IkonUICore as At, UiStreamStore as kt } from "@ikonai/sdk-ui";
2
+ import { UiStreamStore as Zr } from "@ikonai/sdk-ui";
3
+ import Tt, { useSyncExternalStore as $e, useMemo as U, memo as x, useRef as A, useCallback as F, Fragment as It, useEffect as B, useState as Y, createContext as ut, use as Fe } from "react";
4
+ import { createLogger as Ee, getOrCreateDeviceId as ye, deriveAuthUrl as _e, parseUrlParams as Ct, isCloudEnvironment as ze, extractUserIdFromToken as Nt, deriveBackendType as We, IkonClient as Ot } from "@ikonai/sdk";
5
+ var ge = { exports: {} }, ne = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,12 +12,12 @@ var he = { exports: {} }, ee = {};
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 Fe;
16
- function Et() {
17
- if (Fe) return ee;
18
- Fe = 1;
19
- var r = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
20
- function t(n, o, s) {
15
+ var qe;
16
+ function Pt() {
17
+ if (qe) return ne;
18
+ qe = 1;
19
+ var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
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 = {};
@@ -25,16 +25,16 @@ function Et() {
25
25
  a !== "key" && (s[a] = o[a]);
26
26
  } else s = o;
27
27
  return o = s.ref, {
28
- $$typeof: r,
29
- type: n,
28
+ $$typeof: t,
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 ee.Fragment = e, ee.jsx = t, ee.jsxs = t, ee;
35
+ return ne.Fragment = e, ne.jsx = n, ne.jsxs = n, ne;
36
36
  }
37
- var te = {};
37
+ var re = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,371 +44,371 @@ var te = {};
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 Be;
48
- function kt() {
49
- return Be || (Be = 1, process.env.NODE_ENV !== "production" && function() {
50
- function r(c) {
51
- if (c == null) return null;
52
- if (typeof c == "function")
53
- return c.$$typeof === ue ? null : c.displayName || c.name || null;
54
- if (typeof c == "string") return c;
55
- switch (c) {
56
- case v:
47
+ var Je;
48
+ function _t() {
49
+ return Je || (Je = 1, process.env.NODE_ENV !== "production" && function() {
50
+ function t(u) {
51
+ if (u == null) return null;
52
+ if (typeof u == "function")
53
+ return u.$$typeof === fe ? null : u.displayName || u.name || null;
54
+ if (typeof u == "string") return u;
55
+ switch (u) {
56
+ case R:
57
57
  return "Fragment";
58
- case g:
58
+ case y:
59
59
  return "Profiler";
60
60
  case m:
61
61
  return "StrictMode";
62
- case x:
63
- return "Suspense";
64
62
  case D:
63
+ return "Suspense";
64
+ case W:
65
65
  return "SuspenseList";
66
- case ce:
66
+ case de:
67
67
  return "Activity";
68
68
  }
69
- if (typeof c == "object")
70
- switch (typeof c.tag == "number" && console.error(
69
+ if (typeof u == "object")
70
+ switch (typeof u.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
- ), c.$$typeof) {
73
- case C:
72
+ ), u.$$typeof) {
73
+ case S:
74
74
  return "Portal";
75
- case P:
76
- return (c.displayName || "Context") + ".Provider";
77
- case w:
78
- return (c._context.displayName || "Context") + ".Consumer";
79
- case T:
80
- var h = c.render;
81
- return c = c.displayName, c || (c = h.displayName || h.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
82
- case ae:
83
- return h = c.displayName || null, h !== null ? h : r(c.type) || "Memo";
84
- case H:
85
- h = c._payload, c = c._init;
75
+ case j:
76
+ return (u.displayName || "Context") + ".Provider";
77
+ case v:
78
+ return (u._context.displayName || "Context") + ".Consumer";
79
+ case O:
80
+ var p = u.render;
81
+ return u = u.displayName, u || (u = p.displayName || p.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
82
+ case le:
83
+ return p = u.displayName || null, p !== null ? p : t(u.type) || "Memo";
84
+ case Z:
85
+ p = u._payload, u = u._init;
86
86
  try {
87
- return r(c(h));
87
+ return t(u(p));
88
88
  } catch {
89
89
  }
90
90
  }
91
91
  return null;
92
92
  }
93
- function e(c) {
94
- return "" + c;
93
+ function e(u) {
94
+ return "" + u;
95
95
  }
96
- function t(c) {
96
+ function n(u) {
97
97
  try {
98
- e(c);
99
- var h = !1;
98
+ e(u);
99
+ var p = !1;
100
100
  } catch {
101
- h = !0;
101
+ p = !0;
102
102
  }
103
- if (h) {
104
- h = console;
105
- var S = h.error, R = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
106
- return S.call(
107
- h,
103
+ if (p) {
104
+ p = console;
105
+ var w = p.error, k = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
106
+ return w.call(
107
+ p,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- R
110
- ), e(c);
109
+ k
110
+ ), e(u);
111
111
  }
112
112
  }
113
- function n(c) {
114
- if (c === v) return "<>";
115
- if (typeof c == "object" && c !== null && c.$$typeof === H)
113
+ function r(u) {
114
+ if (u === R) return "<>";
115
+ if (typeof u == "object" && u !== null && u.$$typeof === Z)
116
116
  return "<...>";
117
117
  try {
118
- var h = r(c);
119
- return h ? "<" + h + ">" : "<...>";
118
+ var p = t(u);
119
+ return p ? "<" + p + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
123
123
  }
124
124
  function o() {
125
- var c = q.A;
126
- return c === null ? null : c.getOwner();
125
+ var u = q.A;
126
+ return u === null ? null : u.getOwner();
127
127
  }
128
128
  function s() {
129
129
  return Error("react-stack-top-frame");
130
130
  }
131
- function i(c) {
132
- if (le.call(c, "key")) {
133
- var h = Object.getOwnPropertyDescriptor(c, "key").get;
134
- if (h && h.isReactWarning) return !1;
131
+ function i(u) {
132
+ if (he.call(u, "key")) {
133
+ var p = Object.getOwnPropertyDescriptor(u, "key").get;
134
+ if (p && p.isReactWarning) return !1;
135
135
  }
136
- return c.key !== void 0;
136
+ return u.key !== void 0;
137
137
  }
138
- function a(c, h) {
139
- function S() {
140
- X || (X = !0, console.error(
138
+ function a(u, p) {
139
+ function w() {
140
+ Q || (Q = !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
- h
142
+ p
143
143
  ));
144
144
  }
145
- S.isReactWarning = !0, Object.defineProperty(c, "key", {
146
- get: S,
145
+ w.isReactWarning = !0, Object.defineProperty(u, "key", {
146
+ get: w,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
- function u() {
151
- var c = r(this.type);
152
- return de[c] || (de[c] = !0, console.error(
150
+ function c() {
151
+ var u = t(this.type);
152
+ return pe[u] || (pe[u] = !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
- )), c = this.props.ref, c !== void 0 ? c : null;
154
+ )), u = this.props.ref, u !== void 0 ? u : null;
155
155
  }
156
- function d(c, h, S, R, M, j, W, Q) {
157
- return S = j.ref, c = {
158
- $$typeof: k,
159
- type: c,
160
- key: h,
161
- props: j,
162
- _owner: M
163
- }, (S !== void 0 ? S : null) !== null ? Object.defineProperty(c, "ref", {
156
+ function d(u, p, w, k, L, P, J, te) {
157
+ return w = P.ref, u = {
158
+ $$typeof: g,
159
+ type: u,
160
+ key: p,
161
+ props: P,
162
+ _owner: L
163
+ }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(u, "ref", {
164
164
  enumerable: !1,
165
- get: u
166
- }) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
165
+ get: c
166
+ }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
169
169
  writable: !0,
170
170
  value: 0
171
- }), Object.defineProperty(c, "_debugInfo", {
171
+ }), Object.defineProperty(u, "_debugInfo", {
172
172
  configurable: !1,
173
173
  enumerable: !1,
174
174
  writable: !0,
175
175
  value: null
176
- }), Object.defineProperty(c, "_debugStack", {
176
+ }), Object.defineProperty(u, "_debugStack", {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
- value: W
181
- }), Object.defineProperty(c, "_debugTask", {
180
+ value: J
181
+ }), Object.defineProperty(u, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
184
184
  writable: !0,
185
- value: Q
186
- }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
185
+ value: te
186
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
187
187
  }
188
- function l(c, h, S, R, M, j, W, Q) {
189
- var A = h.children;
190
- if (A !== void 0)
191
- if (R)
192
- if (be(A)) {
193
- for (R = 0; R < A.length; R++)
194
- f(A[R]);
195
- Object.freeze && Object.freeze(A);
188
+ function l(u, p, w, k, L, P, J, te) {
189
+ var T = p.children;
190
+ if (T !== void 0)
191
+ if (k)
192
+ if (Ae(T)) {
193
+ for (k = 0; k < T.length; k++)
194
+ h(T[k]);
195
+ Object.freeze && Object.freeze(T);
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 f(A);
201
- if (le.call(h, "key")) {
202
- A = r(c);
203
- var V = Object.keys(h).filter(function(I) {
204
- return I !== "key";
200
+ else h(T);
201
+ if (he.call(p, "key")) {
202
+ T = t(u);
203
+ var z = Object.keys(p).filter(function(N) {
204
+ return N !== "key";
205
205
  });
206
- R = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", Z[A + R] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ k = 0 < z.length ? "{key: someKey, " + z.join(": ..., ") + ": ...}" : "{key: someKey}", ee[T + k] || (z = 0 < z.length ? "{" + z.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
- R,
214
- A,
215
- V,
216
- A
217
- ), Z[A + R] = !0);
213
+ k,
214
+ T,
215
+ z,
216
+ T
217
+ ), ee[T + k] = !0);
218
218
  }
219
- if (A = null, S !== void 0 && (t(S), A = "" + S), i(h) && (t(h.key), A = "" + h.key), "key" in h) {
220
- S = {};
221
- for (var N in h)
222
- N !== "key" && (S[N] = h[N]);
223
- } else S = h;
224
- return A && a(
225
- S,
226
- typeof c == "function" ? c.displayName || c.name || "Unknown" : c
219
+ if (T = null, w !== void 0 && (n(w), T = "" + w), i(p) && (n(p.key), T = "" + p.key), "key" in p) {
220
+ w = {};
221
+ for (var I in p)
222
+ I !== "key" && (w[I] = p[I]);
223
+ } else w = p;
224
+ return T && a(
225
+ w,
226
+ typeof u == "function" ? u.displayName || u.name || "Unknown" : u
227
227
  ), d(
228
- c,
229
- A,
230
- j,
231
- M,
228
+ u,
229
+ T,
230
+ P,
231
+ L,
232
232
  o(),
233
- S,
234
- W,
235
- Q
233
+ w,
234
+ J,
235
+ te
236
236
  );
237
237
  }
238
- function f(c) {
239
- typeof c == "object" && c !== null && c.$$typeof === k && c._store && (c._store.validated = 1);
238
+ function h(u) {
239
+ typeof u == "object" && u !== null && u.$$typeof === g && u._store && (u._store.validated = 1);
240
240
  }
241
- var p = yt, k = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), P = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), ce = Symbol.for("react.activity"), ue = Symbol.for("react.client.reference"), q = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, le = Object.prototype.hasOwnProperty, be = Array.isArray, J = console.createTask ? console.createTask : function() {
241
+ var f = Tt, g = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), j = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), le = Symbol.for("react.memo"), Z = Symbol.for("react.lazy"), de = Symbol.for("react.activity"), fe = Symbol.for("react.client.reference"), q = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, he = Object.prototype.hasOwnProperty, Ae = Array.isArray, G = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- p = {
245
- "react-stack-bottom-frame": function(c) {
246
- return c();
244
+ f = {
245
+ "react-stack-bottom-frame": function(u) {
246
+ return u();
247
247
  }
248
248
  };
249
- var X, de = {}, B = p["react-stack-bottom-frame"].bind(
250
- p,
249
+ var Q, pe = {}, K = f["react-stack-bottom-frame"].bind(
250
+ f,
251
251
  s
252
- )(), fe = J(n(s)), Z = {};
253
- te.Fragment = v, te.jsx = function(c, h, S, R, M) {
254
- var j = 1e4 > q.recentlyCreatedOwnerStacks++;
252
+ )(), me = G(r(s)), ee = {};
253
+ re.Fragment = R, re.jsx = function(u, p, w, k, L) {
254
+ var P = 1e4 > q.recentlyCreatedOwnerStacks++;
255
255
  return l(
256
- c,
257
- h,
258
- S,
256
+ u,
257
+ p,
258
+ w,
259
259
  !1,
260
- R,
261
- M,
262
- j ? Error("react-stack-top-frame") : B,
263
- j ? J(n(c)) : fe
260
+ k,
261
+ L,
262
+ P ? Error("react-stack-top-frame") : K,
263
+ P ? G(r(u)) : me
264
264
  );
265
- }, te.jsxs = function(c, h, S, R, M) {
266
- var j = 1e4 > q.recentlyCreatedOwnerStacks++;
265
+ }, re.jsxs = function(u, p, w, k, L) {
266
+ var P = 1e4 > q.recentlyCreatedOwnerStacks++;
267
267
  return l(
268
- c,
269
- h,
270
- S,
268
+ u,
269
+ p,
270
+ w,
271
271
  !0,
272
- R,
273
- M,
274
- j ? Error("react-stack-top-frame") : B,
275
- j ? J(n(c)) : fe
272
+ k,
273
+ L,
274
+ P ? Error("react-stack-top-frame") : K,
275
+ P ? G(r(u)) : me
276
276
  );
277
277
  };
278
- }()), te;
278
+ }()), re;
279
279
  }
280
- var Ve;
281
- function Rt() {
282
- return Ve || (Ve = 1, process.env.NODE_ENV === "production" ? he.exports = Et() : he.exports = kt()), he.exports;
280
+ var Ye;
281
+ function jt() {
282
+ return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? ge.exports = Pt() : ge.exports = _t()), ge.exports;
283
283
  }
284
- var b = Rt();
285
- function At(r, e) {
286
- const t = _e(
287
- (n) => r.subscribe(n),
284
+ var E = jt();
285
+ function Mt(t, e) {
286
+ const n = $e(
287
+ (r) => t.subscribe(r),
288
288
  () => {
289
- const n = r.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 = r.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 L(() => {
298
- const [n, o] = t.split(":");
297
+ return U(() => {
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
- }, [t]);
303
+ }, [n]);
304
304
  }
305
- function F(r, e) {
306
- const t = _e(
307
- (n) => r.subscribeNode(e, n),
308
- () => r.getNodeVersion(e),
309
- () => r.getNodeVersion(e)
305
+ function V(t, e) {
306
+ const n = $e(
307
+ (r) => t.subscribeNode(e, r),
308
+ () => t.getNodeVersion(e),
309
+ () => t.getNodeVersion(e)
310
310
  );
311
- return L(() => r.getNode(e), [r, e, t]);
311
+ return U(() => t.getNode(e), [t, e, n]);
312
312
  }
313
- const Nt = ye("UIRenderer");
314
- function Ct(r) {
315
- if (r === void 0)
313
+ const Lt = Ee("UIRenderer");
314
+ function Ut(t) {
315
+ if (t === void 0)
316
316
  return "{}";
317
- if (typeof r == "string")
318
- return r;
317
+ if (typeof t == "string")
318
+ return t;
319
319
  try {
320
- return JSON.stringify(r);
320
+ return JSON.stringify(t);
321
321
  } catch {
322
322
  return "{}";
323
323
  }
324
324
  }
325
- function It(r) {
326
- const e = r.styleIds;
325
+ function xt(t) {
326
+ const e = t.styleIds;
327
327
  return Array.isArray(e) ? e : [];
328
328
  }
329
- function Tt(r) {
330
- const e = r.children;
329
+ function Dt(t) {
330
+ const e = t.children;
331
331
  return Array.isArray(e) ? e : [];
332
332
  }
333
- function jt(r, e) {
334
- return r.nodeId === e.nodeId && r.context === e.context;
333
+ function $t(t, e) {
334
+ return t.nodeId === e.nodeId && t.context === e.context;
335
335
  }
336
- function Ot(r) {
337
- if (r.length === 0) return "";
338
- if (r.length === 1) return r[0].id;
339
- let e = r[0].id;
340
- for (let t = 1; t < r.length; t++)
341
- e += "," + r[t].id;
336
+ function Ft(t) {
337
+ if (t.length === 0) return "";
338
+ if (t.length === 1) return t[0].id;
339
+ let e = t[0].id;
340
+ for (let n = 1; n < t.length; n++)
341
+ e += "," + t[n].id;
342
342
  return e;
343
343
  }
344
- const Ce = U(function r({ nodeId: e, context: t }) {
345
- const n = F(t.store, e), o = n ? Tt(n) : [], s = Ot(o), i = L(
346
- () => o.length === 0 ? null : o.map((f) => /* @__PURE__ */ b.jsx(r, { nodeId: f.id, context: t }, f.id)),
344
+ const je = x(function t({ nodeId: e, context: n }) {
345
+ const r = V(n.store, e), o = r ? Dt(r) : [], s = Ft(o), i = U(
346
+ () => o.length === 0 ? null : o.map((h) => /* @__PURE__ */ E.jsx(t, { nodeId: h.id, context: n }, h.id)),
347
347
  // eslint-disable-next-line react-hooks/exhaustive-deps
348
- [s, t]
348
+ [s, n]
349
349
  );
350
- if (!n)
350
+ if (!r)
351
351
  return null;
352
- if (n.type === "root")
353
- return /* @__PURE__ */ b.jsx(St, { children: i }, n.id);
354
- const a = t.library.resolve(n);
352
+ if (r.type === "root")
353
+ return /* @__PURE__ */ E.jsx(It, { children: i }, r.id);
354
+ const a = n.library.resolve(r);
355
355
  if (!a)
356
- return Nt.warn(`No renderer for node type ${n.type}`), null;
357
- const u = It(n), d = u.length > 0 ? u.join(" ") : void 0, l = a;
358
- return /* @__PURE__ */ b.jsx(l, { nodeId: e, context: t, className: d });
359
- }, jt);
360
- function Pt(r, e) {
361
- return !Array.isArray(r) || r.length === 0 ? null : r.map((t) => /* @__PURE__ */ b.jsx(Ce, { nodeId: t.id, context: e }, t.id));
362
- }
363
- function _t(r, e) {
364
- return r.store === e.store && r.library === e.library && r.viewId === e.viewId && r.emptyFallback === e.emptyFallback;
365
- }
366
- const Mt = U(function({ store: e, library: t, viewId: n, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
- const { rootViewId: u, rootNodeId: d } = At(e, n), l = E(s);
356
+ return Lt.warn(`No renderer for node type ${r.type}`), null;
357
+ const c = xt(r), d = c.length > 0 ? c.join(" ") : void 0, l = a;
358
+ return /* @__PURE__ */ E.jsx(l, { nodeId: e, context: n, className: d });
359
+ }, $t);
360
+ function Bt(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 Vt(t, e) {
364
+ return t.store === e.store && t.library === e.library && t.viewId === e.viewId && t.emptyFallback === e.emptyFallback;
365
+ }
366
+ const Kt = x(function({ store: e, library: n, viewId: r, emptyFallback: o = null, onAction: s, client: i, video: a }) {
367
+ const { rootViewId: c, rootNodeId: d } = Mt(e, r), l = A(s);
368
368
  l.current = s;
369
- const f = E(i);
370
- f.current = i;
371
- const p = E(a);
372
- p.current = a;
373
- const k = z((v, m) => {
374
- if (!v)
369
+ const h = A(i);
370
+ h.current = i;
371
+ const f = A(a);
372
+ f.current = a;
373
+ const g = F((R, m) => {
374
+ if (!R)
375
375
  return;
376
- const g = Ct(m);
377
- l.current?.(v, g);
378
- }, []), C = L(() => {
379
- const v = {
376
+ const y = Ut(m);
377
+ l.current?.(R, y);
378
+ }, []), S = U(() => {
379
+ const R = {
380
380
  store: e,
381
- library: t,
381
+ library: n,
382
382
  handlerCache: e.handlerCache,
383
383
  // Access payloads from store at call time, not captured snapshot
384
384
  getPayload: (m) => e.getSnapshot().payloads.get(m),
385
- renderChildren: (m) => Pt(m, v),
385
+ renderChildren: (m) => Bt(m, R),
386
386
  renderView: (m) => {
387
- const g = e.getSnapshot().views.get(m);
388
- return g ? /* @__PURE__ */ b.jsx(Ce, { nodeId: g.id, context: v }) : null;
387
+ const y = e.getSnapshot().views.get(m);
388
+ return y ? /* @__PURE__ */ E.jsx(je, { nodeId: y.id, context: R }) : null;
389
389
  },
390
- dispatchAction: k,
390
+ dispatchAction: g,
391
391
  // Access client/video via refs to avoid context recreation
392
392
  get client() {
393
- return f.current;
393
+ return h.current;
394
394
  },
395
395
  get video() {
396
- return p.current;
396
+ return f.current;
397
397
  }
398
398
  };
399
- return v;
400
- }, [e, t, k]);
401
- return !u || !d ? o : /* @__PURE__ */ b.jsx("div", { "data-ikon-view-id": u, style: { display: "contents" }, children: /* @__PURE__ */ b.jsx(Ce, { nodeId: d, context: C }) });
402
- }, _t);
403
- class Lt {
404
- constructor(e, t) {
405
- if (this.fallback = t, e)
406
- for (const [n, o] of e)
407
- this.renderers.set(n, o);
399
+ return R;
400
+ }, [e, n, g]);
401
+ return !c || !d ? o : /* @__PURE__ */ E.jsx("div", { "data-ikon-view-id": c, style: { display: "contents" }, children: /* @__PURE__ */ E.jsx(je, { nodeId: d, context: S }) });
402
+ }, Vt);
403
+ class zt {
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, t) {
411
- this.renderers.set(e, t);
410
+ register(e, n) {
411
+ this.renderers.set(e, n);
412
412
  }
413
413
  setFallback(e) {
414
414
  this.fallback = e;
@@ -417,41 +417,41 @@ class Lt {
417
417
  return this.renderers.get(e.type) ?? this.fallback;
418
418
  }
419
419
  }
420
- function hn(r, e) {
421
- const t = Object.entries(r);
422
- return new Lt(t, e);
420
+ function Mr(t, e) {
421
+ const n = Object.entries(t);
422
+ return new zt(n, e);
423
423
  }
424
- function mn(r) {
425
- return _e(
426
- (e) => r.subscribe(e),
427
- () => r.getSnapshot(),
428
- () => r.getSnapshot()
424
+ function Lr(t) {
425
+ return $e(
426
+ (e) => t.subscribe(e),
427
+ () => t.getSnapshot(),
428
+ () => t.getSnapshot()
429
429
  );
430
430
  }
431
- const Ie = "ikon-ui";
432
- function Ut(r, e) {
433
- return r === e;
431
+ const Me = "ikon-ui";
432
+ function Wt(t, e) {
433
+ return t === e;
434
434
  }
435
- const pn = U(function({ stores: e, registry: t, category: n = Ie, onAction: o, client: s }) {
436
- const i = L(() => Array.from(e.keys()).sort().join(","), [e]), a = E(o);
435
+ const Ur = x(function({ stores: e, registry: n, category: r = Me, onAction: o, client: s }) {
436
+ const i = U(() => Array.from(e.keys()).sort().join(","), [e]), a = A(o);
437
437
  a.current = o;
438
- const u = E(s);
439
- u.current = s;
440
- const d = L(
438
+ const c = A(s);
439
+ c.current = s;
440
+ const d = U(
441
441
  () => {
442
442
  const l = [];
443
- for (const [f, p] of e) {
444
- const k = p.store.getSnapshot();
445
- Ut(p.category, n) && (!k.rootViewId || !k.views.has(k.rootViewId) || l.push({ key: f, store: p.store }));
443
+ for (const [h, f] of e) {
444
+ const g = f.store.getSnapshot();
445
+ Wt(f.category, r) && (!g.rootViewId || !g.views.has(g.rootViewId) || l.push({ key: h, store: f.store }));
446
446
  }
447
447
  return l;
448
448
  },
449
449
  // eslint-disable-next-line react-hooks/exhaustive-deps
450
- [e, n, i]
450
+ [e, r, i]
451
451
  );
452
- return d.length === 0 ? null : /* @__PURE__ */ b.jsx(b.Fragment, { children: d.map(({ key: l, store: f }) => /* @__PURE__ */ b.jsx(Mt, { store: f, library: t, onAction: a.current, client: u.current, video: u.current?.media?.video }, l)) });
452
+ return d.length === 0 ? null : /* @__PURE__ */ E.jsx(E.Fragment, { children: d.map(({ key: l, store: h }) => /* @__PURE__ */ E.jsx(Kt, { store: h, library: n, onAction: a.current, client: c.current, video: c.current?.media?.video }, l)) });
453
453
  });
454
- class xt {
454
+ class qt {
455
455
  core;
456
456
  ownsCore;
457
457
  stores = /* @__PURE__ */ new Map();
@@ -459,7 +459,7 @@ class xt {
459
459
  unsubscribeClears;
460
460
  unsubscribeStoreChanges;
461
461
  constructor(e) {
462
- 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();
462
+ this.core = e?.core ?? new At({ client: e?.client }), this.ownsCore = !e?.core, this.unsubscribeClears = this.core.subscribeToUiStreamCleared(this.handleUiStreamCleared), this.unsubscribeStoreChanges = this.core.uiStore.subscribe(this.syncStreamSnapshot), this.syncAllStreams();
463
463
  }
464
464
  dispose() {
465
465
  this.unsubscribeClears(), this.unsubscribeStoreChanges(), this.ownsCore && this.core.dispose(), this.listeners.clear(), this.stores.clear();
@@ -478,93 +478,96 @@ class xt {
478
478
  subscribeToStyles(e) {
479
479
  return this.core.subscribeToUiStyles(e);
480
480
  }
481
+ subscribeToStyleDeletes(e) {
482
+ return this.core.subscribeToUiStyleDeletes(e);
483
+ }
481
484
  handleUiStreamCleared = (e) => {
482
485
  this.stores.delete(e) && this.notify(e);
483
486
  };
484
487
  syncStreamSnapshot = (e) => {
485
- const t = this.core.uiStore.getSnapshot(e);
486
- if (!t || !t.rootViewId) {
488
+ const n = this.core.uiStore.getSnapshot(e);
489
+ if (!n || !n.rootViewId) {
487
490
  this.handleUiStreamCleared(e);
488
491
  return;
489
492
  }
490
- if (!t.views.get(t.rootViewId)) {
493
+ if (!n.views.get(n.rootViewId)) {
491
494
  this.handleUiStreamCleared(e);
492
495
  return;
493
496
  }
494
- const s = this.ensureStoreEntry(e).store.replaceSnapshot(t), i = this.updateCategory(e, t.category);
497
+ const s = this.ensureStoreEntry(e).store.replaceSnapshot(n), i = this.updateCategory(e, n.category);
495
498
  (s || i) && this.notify(e);
496
499
  };
497
500
  syncAllStreams() {
498
- const e = this.core.uiStore.getSnapshots(), t = /* @__PURE__ */ new Set();
499
- for (const n of e)
500
- this.syncStreamSnapshot(n.streamId), t.add(n.streamId);
501
- for (const n of this.stores.keys())
502
- t.has(n) || (this.stores.delete(n), this.notify(n));
501
+ const e = this.core.uiStore.getSnapshots(), n = /* @__PURE__ */ new Set();
502
+ for (const r of e)
503
+ this.syncStreamSnapshot(r.streamId), n.add(r.streamId);
504
+ for (const r of this.stores.keys())
505
+ n.has(r) || (this.stores.delete(r), this.notify(r));
503
506
  }
504
507
  ensureStoreEntry(e) {
505
- const t = this.stores.get(e);
506
- if (t)
507
- return t;
508
- const n = {
509
- category: Ie,
510
- store: new gt()
508
+ const n = this.stores.get(e);
509
+ if (n)
510
+ return n;
511
+ const r = {
512
+ category: Me,
513
+ store: new kt()
511
514
  };
512
- return this.stores.set(e, n), n;
515
+ return this.stores.set(e, r), r;
513
516
  }
514
- updateCategory(e, t) {
515
- const n = this.stores.get(e);
516
- if (!n)
517
+ updateCategory(e, n) {
518
+ const r = this.stores.get(e);
519
+ if (!r)
517
520
  return !1;
518
- const o = t ?? this.core.uiStore.getSnapshot(e)?.category ?? Ie;
519
- return n.category === o ? !1 : (this.stores.set(e, { ...n, category: o }), !0);
521
+ const o = n ?? this.core.uiStore.getSnapshot(e)?.category ?? Me;
522
+ return r.category === o ? !1 : (this.stores.set(e, { ...r, category: o }), !0);
520
523
  }
521
524
  notify(e) {
522
- for (const t of this.listeners)
523
- t(e);
525
+ for (const n of this.listeners)
526
+ n(e);
524
527
  }
525
528
  }
526
- function G(r) {
527
- if (typeof r == "string") {
528
- const e = r.trim();
529
+ function X(t) {
530
+ if (typeof t == "string") {
531
+ const e = t.trim();
529
532
  return e.length > 0 ? e : void 0;
530
533
  }
531
- if (Array.isArray(r)) {
532
- const e = r.filter((t) => typeof t == "string").map((t) => t.trim()).filter(Boolean);
534
+ if (Array.isArray(t)) {
535
+ const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
533
536
  return e.length > 0 ? e.join(" ") : void 0;
534
537
  }
535
538
  }
536
- function se(...r) {
539
+ function ce(...t) {
537
540
  let e = "";
538
- for (const t of r)
539
- if (t) {
540
- const n = t.trim();
541
- n && (e = e ? e + " " + n : n);
541
+ for (const n of t)
542
+ if (n) {
543
+ const r = n.trim();
544
+ r && (e = e ? e + " " + r : r);
542
545
  }
543
546
  return e || void 0;
544
547
  }
545
- const ze = /* @__PURE__ */ new WeakMap(), $t = {};
546
- function ie(r) {
547
- if (!r)
548
- return $t;
549
- const e = ze.get(r);
548
+ const Ge = /* @__PURE__ */ new WeakMap(), Jt = {};
549
+ function ue(t) {
550
+ if (!t)
551
+ return Jt;
552
+ const e = Ge.get(t);
550
553
  if (e)
551
554
  return e;
552
- const t = {};
553
- for (const [n, o] of Object.entries(r))
554
- o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (t[n] = o);
555
- return ze.set(r, t), t;
556
- }
557
- function Ft() {
558
- const r = U(function({ nodeId: t, context: n }) {
559
- const o = F(n.store, t), s = E(null), i = G(o?.props?.targetViewId), a = o?.props?.focusOnly, u = typeof a == "boolean" ? a : void 0;
560
- return $(() => {
555
+ const n = {};
556
+ for (const [r, o] of Object.entries(t))
557
+ o != null && (typeof o == "string" || typeof o == "number" || typeof o == "boolean") && (n[r] = o);
558
+ return Ge.set(t, n), n;
559
+ }
560
+ function Yt() {
561
+ const t = x(function({ nodeId: n, context: r }) {
562
+ const o = V(r.store, n), s = A(null), i = X(o?.props?.targetViewId), a = o?.props?.focusOnly, c = typeof a == "boolean" ? a : void 0;
563
+ return B(() => {
561
564
  if (typeof document > "u")
562
565
  return;
563
566
  const l = s.current;
564
567
  if (!l || i && l.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== i)
565
568
  return;
566
- const f = u !== !0;
567
- if (f && typeof l.scrollIntoView == "function")
569
+ const h = c !== !0;
570
+ if (h && typeof l.scrollIntoView == "function")
568
571
  try {
569
572
  l.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
570
573
  } catch {
@@ -572,11 +575,11 @@ function Ft() {
572
575
  }
573
576
  if (typeof l.focus == "function")
574
577
  try {
575
- l.focus({ preventScroll: !f });
578
+ l.focus({ preventScroll: !h });
576
579
  } catch {
577
580
  l.focus();
578
581
  }
579
- }, [u, i]), o ? /* @__PURE__ */ b.jsx(
582
+ }, [c, i]), o ? /* @__PURE__ */ E.jsx(
580
583
  "span",
581
584
  {
582
585
  ref: s,
@@ -590,51 +593,51 @@ function Ft() {
590
593
  });
591
594
  return ({ type: e }) => {
592
595
  if (e === "common.focus-hint")
593
- return r;
596
+ return t;
594
597
  };
595
598
  }
596
- function Bt() {
597
- const r = U(function({ nodeId: t, context: n, className: o }) {
598
- const s = F(n.store, t);
599
+ function Gt() {
600
+ const t = x(function({ nodeId: n, context: r, className: o }) {
601
+ const s = V(r.store, n);
599
602
  if (!s)
600
603
  return null;
601
- const i = ie(s.props), a = se(G(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
602
- return /* @__PURE__ */ b.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: u });
604
+ const i = ue(s.props), a = ce(X(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
605
+ return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
603
606
  });
604
607
  return ({ type: e }) => {
605
608
  if (e === "common.div")
606
- return r;
609
+ return t;
607
610
  };
608
611
  }
609
- function Vt() {
610
- const r = U(function({ nodeId: t, context: n, className: o }) {
611
- const s = F(n.store, t);
612
+ function Ht() {
613
+ const t = x(function({ nodeId: n, context: r, className: o }) {
614
+ const s = V(r.store, n);
612
615
  if (!s)
613
616
  return null;
614
- const i = ie(s.props), a = se(G(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
615
- return /* @__PURE__ */ b.jsx(
617
+ const i = ue(s.props), a = ce(X(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
618
+ return /* @__PURE__ */ E.jsx(
616
619
  "form",
617
620
  {
618
621
  ...i,
619
622
  "data-ikon-node-id": s.id,
620
623
  className: a,
621
624
  onSubmit: (d) => d.preventDefault(),
622
- children: u
625
+ children: c
623
626
  }
624
627
  );
625
628
  });
626
629
  return ({ type: e }) => {
627
630
  if (e === "common.form")
628
- return r;
631
+ return t;
629
632
  };
630
633
  }
631
- function zt() {
632
- const r = U(function({ nodeId: t, context: n, className: o }) {
633
- const s = F(n.store, t);
634
+ function Xt() {
635
+ const t = x(function({ nodeId: n, context: r, className: o }) {
636
+ const s = V(r.store, n);
634
637
  if (!s)
635
638
  return null;
636
- const i = ie(s.props), a = se(G(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
637
- return /* @__PURE__ */ b.jsx(
639
+ const i = ue(s.props), a = ce(X(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
640
+ return /* @__PURE__ */ E.jsx(
638
641
  "div",
639
642
  {
640
643
  ...i,
@@ -642,147 +645,148 @@ function zt() {
642
645
  "data-ikon-view-type": "scroll-view",
643
646
  "data-ikon-scroll-container": "true",
644
647
  className: a,
645
- children: u
648
+ children: c
646
649
  }
647
650
  );
648
651
  });
649
652
  return ({ type: e }) => {
650
653
  if (e === "common.scroll-view")
651
- return r;
654
+ return t;
652
655
  };
653
656
  }
654
- function Dt() {
655
- const r = U(function({ nodeId: t, context: n, className: o }) {
656
- const s = F(n.store, t);
657
+ function Zt() {
658
+ const t = x(function({ nodeId: n, context: r, className: o }) {
659
+ const s = V(r.store, n);
657
660
  if (!s)
658
661
  return null;
659
- const i = ie(s.props), a = se("relative", G(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
660
- return /* @__PURE__ */ b.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: u });
662
+ const i = ue(s.props), a = ce("relative", X(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
663
+ return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
661
664
  });
662
665
  return ({ type: e }) => {
663
666
  if (e === "common.stack")
664
- return r;
667
+ return t;
665
668
  };
666
669
  }
667
- function qt() {
668
- const r = U(function({ nodeId: t, context: n, className: o }) {
669
- const s = F(n.store, t);
670
+ function Qt() {
671
+ const t = x(function({ nodeId: n, context: r, className: o }) {
672
+ const s = V(r.store, n);
670
673
  if (!s)
671
674
  return null;
672
- const i = ie(s.props), a = se("absolute", G(s.props?.className), o), u = s.children?.length ? n.renderChildren(s.children) : void 0;
673
- return /* @__PURE__ */ b.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: u });
675
+ const i = ue(s.props), a = ce("absolute", X(s.props?.className), o), c = s.children?.length ? r.renderChildren(s.children) : void 0;
676
+ return /* @__PURE__ */ E.jsx("div", { ...i, "data-ikon-node-id": s.id, className: a, children: c });
674
677
  });
675
678
  return ({ type: e }) => {
676
679
  if (e === "common.layer")
677
- return r;
680
+ return t;
678
681
  };
679
682
  }
680
- function Wt() {
683
+ function en() {
681
684
  return [
682
- Bt(),
683
- Vt(),
684
- zt(),
685
- Dt(),
686
- qt(),
687
- Ft()
685
+ Gt(),
686
+ Ht(),
687
+ Xt(),
688
+ Zt(),
689
+ Qt(),
690
+ Yt()
688
691
  ];
689
692
  }
690
- const Yt = "base", Jt = async () => Wt();
691
- function Kt(r) {
692
- r.registerModule(Yt, Jt);
693
+ const tn = "base", nn = async () => en();
694
+ function rn(t) {
695
+ t.registerModule(tn, nn);
693
696
  }
694
- function ot(r) {
695
- if (typeof r == "string") {
696
- const e = r.trim();
697
+ function lt(t) {
698
+ if (typeof t == "string") {
699
+ const e = t.trim();
697
700
  return e.length > 0 ? e : void 0;
698
701
  }
699
- if (Array.isArray(r)) {
700
- const e = r.filter((t) => typeof t == "string").map((t) => t.trim()).filter(Boolean);
702
+ if (Array.isArray(t)) {
703
+ const e = t.filter((n) => typeof n == "string").map((n) => n.trim()).filter(Boolean);
701
704
  return e.length > 0 ? e.join(" ") : void 0;
702
705
  }
703
706
  }
704
- function st(...r) {
707
+ function dt(...t) {
705
708
  const e = [];
706
- for (const t of r)
707
- t && t.trim() && e.push(t.trim());
709
+ for (const n of t)
710
+ n && n.trim() && e.push(n.trim());
708
711
  return e.length > 0 ? e.join(" ") : void 0;
709
712
  }
710
- function pe(r) {
711
- if (typeof r == "number" && Number.isFinite(r))
712
- return Math.floor(r);
713
- if (typeof r == "string" && r.trim().length > 0) {
714
- const e = Number(r);
713
+ function Se(t) {
714
+ if (typeof t == "number" && Number.isFinite(t))
715
+ return Math.floor(t);
716
+ if (typeof t == "string" && t.trim().length > 0) {
717
+ const e = Number(t);
715
718
  if (Number.isFinite(e))
716
719
  return Math.floor(e);
717
720
  }
718
721
  }
719
- function Te(r) {
720
- if (typeof r != "string")
722
+ function Le(t) {
723
+ if (typeof t != "string")
721
724
  return;
722
- const e = r.trim();
725
+ const e = t.trim();
723
726
  return e.length > 0 ? e : void 0;
724
727
  }
725
- const Gt = "media.video-canvas", Ht = "media.video-url-player";
726
- function Xt() {
727
- const r = U(function({ nodeId: t, context: n, className: o }) {
728
- const s = F(n.store, t), i = E(null), a = n.video, u = s ? Te(s.props?.streamId) : void 0, d = s ? pe(s.props?.width) : void 0, l = s ? pe(s.props?.height) : void 0, f = s ? st(ot(s.props?.className), o) : o;
729
- return $(() => {
730
- const p = i.current;
731
- if (!(!a || !p || !u))
732
- return a.attachCanvas(u, p), () => {
733
- a.detachCanvas(u);
728
+ const on = "media.video-canvas", sn = "media.video-url-player";
729
+ function an() {
730
+ const t = x(function({ nodeId: n, context: r, className: o }) {
731
+ const s = V(r.store, n), i = A(null), a = r.video, c = s ? Le(s.props?.streamId) : void 0, d = s ? Se(s.props?.width) : void 0, l = s ? Se(s.props?.height) : void 0, h = s ? dt(lt(s.props?.className), o) : o;
732
+ return B(() => {
733
+ const f = i.current;
734
+ if (!(!a || !f || !c))
735
+ return a.attachCanvas(c, f), () => {
736
+ a.detachCanvas(c);
734
737
  };
735
- }, [a, u]), s ? /* @__PURE__ */ b.jsx(
738
+ }, [a, c]), s ? /* @__PURE__ */ E.jsx(
736
739
  "canvas",
737
740
  {
738
741
  ref: i,
739
742
  "data-ikon-node-id": s.id,
740
- "data-ikon-video-stream-id": u,
741
- className: f,
743
+ "data-ikon-video-stream-id": c,
744
+ className: h,
742
745
  ...d ? { width: d } : {},
743
746
  ...l ? { height: l } : {}
744
- }
747
+ },
748
+ c
745
749
  ) : null;
746
750
  });
747
751
  return ({ type: e }) => {
748
- if (e === Gt)
749
- return r;
752
+ if (e === on)
753
+ return t;
750
754
  };
751
755
  }
752
- function Zt() {
753
- return [Xt(), Qt()];
756
+ function cn() {
757
+ return [an(), un()];
754
758
  }
755
- function re(r) {
756
- if (typeof r == "boolean")
757
- return r;
758
- if (typeof r == "string") {
759
- const e = r.trim().toLowerCase();
759
+ function oe(t) {
760
+ if (typeof t == "boolean")
761
+ return t;
762
+ if (typeof t == "string") {
763
+ const e = t.trim().toLowerCase();
760
764
  if (e === "true") return !0;
761
765
  if (e === "false") return !1;
762
766
  }
763
767
  }
764
- function Qt() {
765
- const r = U(function({
766
- nodeId: t,
767
- context: n,
768
+ function un() {
769
+ const t = x(function({
770
+ nodeId: n,
771
+ context: r,
768
772
  className: o
769
773
  }) {
770
- const s = F(n.store, t);
774
+ const s = V(r.store, n);
771
775
  if (!s)
772
776
  return null;
773
- const i = st(ot(s.props?.className), o), a = Te(s.props?.src), u = Te(s.props?.poster), d = re(s.props?.controls), l = re(s.props?.autoplay), f = re(s.props?.loop), p = re(s.props?.muted), k = re(s.props?.playsInline), C = pe(s.props?.width), v = pe(s.props?.height), m = s.children?.length ? n.renderChildren(s.children) : void 0;
774
- return /* @__PURE__ */ b.jsx(
777
+ const i = dt(lt(s.props?.className), o), a = Le(s.props?.src), c = Le(s.props?.poster), d = oe(s.props?.controls), l = oe(s.props?.autoplay), h = oe(s.props?.loop), f = oe(s.props?.muted), g = oe(s.props?.playsInline), S = Se(s.props?.width), R = Se(s.props?.height), m = s.children?.length ? r.renderChildren(s.children) : void 0;
778
+ return /* @__PURE__ */ E.jsx(
775
779
  "video",
776
780
  {
777
781
  src: a,
778
- poster: u,
782
+ poster: c,
779
783
  ...d !== void 0 ? { controls: d } : {},
780
784
  ...l !== void 0 ? { autoPlay: l } : {},
781
- ...f !== void 0 ? { loop: f } : {},
782
- ...p !== void 0 ? { muted: p } : {},
783
- ...k !== void 0 ? { playsInline: k } : {},
784
- ...C ? { width: C } : {},
785
- ...v ? { height: v } : {},
785
+ ...h !== void 0 ? { loop: h } : {},
786
+ ...f !== void 0 ? { muted: f } : {},
787
+ ...g !== void 0 ? { playsInline: g } : {},
788
+ ...S ? { width: S } : {},
789
+ ...R ? { height: R } : {},
786
790
  "data-ikon-node-id": s.id,
787
791
  className: i,
788
792
  children: m
@@ -790,84 +794,84 @@ function Qt() {
790
794
  );
791
795
  });
792
796
  return ({ type: e }) => {
793
- if (e === Ht)
794
- return r;
797
+ if (e === sn)
798
+ return t;
795
799
  };
796
800
  }
797
- const er = "media", tr = async () => Zt();
798
- function rr(r) {
799
- r.registerModule(er, tr);
801
+ const ln = "media", dn = async () => cn();
802
+ function fn(t) {
803
+ t.registerModule(ln, dn);
800
804
  }
801
- const De = ye("UIRegistry");
802
- class nr {
805
+ const He = Ee("UIRegistry");
806
+ class hn {
803
807
  baseResolvers = [];
804
808
  moduleLoaders = /* @__PURE__ */ new Map();
805
809
  moduleResolvers = /* @__PURE__ */ new Map();
806
810
  activeModuleOrder = [];
807
811
  registerResolvers(e) {
808
- const t = Array.isArray(e) ? e : [e];
809
- this.baseResolvers.push(...t.filter(Boolean));
812
+ const n = Array.isArray(e) ? e : [e];
813
+ this.baseResolvers.push(...n.filter(Boolean));
810
814
  }
811
- registerModule(e, t) {
812
- const n = this.moduleLoaders.get(e);
813
- if (!n) {
814
- this.moduleLoaders.set(e, t);
815
+ registerModule(e, n) {
816
+ const r = this.moduleLoaders.get(e);
817
+ if (!r) {
818
+ this.moduleLoaders.set(e, n);
815
819
  return;
816
820
  }
817
- n !== t && (this.moduleLoaders.set(e, t), this.moduleResolvers.delete(e));
821
+ r !== n && (this.moduleLoaders.set(e, n), this.moduleResolvers.delete(e));
818
822
  }
819
823
  async loadRegisteredModules() {
820
824
  let e = !1;
821
- for (const [n, o] of this.moduleLoaders.entries())
822
- if (!this.moduleResolvers.has(n))
825
+ for (const [r, o] of this.moduleLoaders.entries())
826
+ if (!this.moduleResolvers.has(r))
823
827
  try {
824
- const s = await o(), i = ir(s);
825
- this.moduleResolvers.set(n, i), e = !0;
828
+ const s = await o(), i = gn(s);
829
+ this.moduleResolvers.set(r, i), e = !0;
826
830
  } catch (s) {
827
- De.error(`[IkonUiRegistry] Failed to load module '${n}'.`, s);
831
+ He.error(`[IkonUiRegistry] Failed to load module '${r}'.`, s);
828
832
  }
829
- const t = [];
830
- for (const n of this.moduleLoaders.keys())
831
- this.moduleResolvers.has(n) && t.push(n);
832
- return ar(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e;
833
+ const n = [];
834
+ for (const r of this.moduleLoaders.keys())
835
+ this.moduleResolvers.has(r) && n.push(r);
836
+ return yn(n, this.activeModuleOrder) || (this.activeModuleOrder = n, e = !0), e;
833
837
  }
834
838
  resolve(e) {
835
- for (const t of this.baseResolvers) {
836
- const n = t(e);
837
- if (n) return n;
839
+ for (const n of this.baseResolvers) {
840
+ const r = n(e);
841
+ if (r) return r;
838
842
  }
839
- for (const t of this.activeModuleOrder) {
840
- const n = this.moduleResolvers.get(t);
841
- if (!n) {
842
- De.warn(`Missing resolvers for module ${t}`);
843
+ for (const n of this.activeModuleOrder) {
844
+ const r = this.moduleResolvers.get(n);
845
+ if (!r) {
846
+ He.warn(`Missing resolvers for module ${n}`);
843
847
  continue;
844
848
  }
845
- for (const o of n) {
849
+ for (const o of r) {
846
850
  const s = o(e);
847
851
  if (s) return s;
848
852
  }
849
853
  }
850
854
  }
851
855
  }
852
- function or() {
853
- const r = new nr();
854
- return Kt(r), rr(r), r.loadRegisteredModules(), r;
856
+ function pn() {
857
+ const t = new hn();
858
+ return rn(t), fn(t), t.loadRegisteredModules(), t;
855
859
  }
856
- function sr(r) {
857
- return Array.isArray(r) ? r : [r];
860
+ function mn(t) {
861
+ return Array.isArray(t) ? t : [t];
858
862
  }
859
- function ir(r) {
860
- return r ? sr(r).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
863
+ function gn(t) {
864
+ return t ? mn(t).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
861
865
  }
862
- function ar(r, e) {
863
- if (r.length !== e.length)
866
+ function yn(t, e) {
867
+ if (t.length !== e.length)
864
868
  return !1;
865
- for (let t = 0; t < r.length; t += 1)
866
- if (r[t] !== e[t])
869
+ for (let n = 0; n < t.length; n += 1)
870
+ if (t[n] !== e[n])
867
871
  return !1;
868
872
  return !0;
869
873
  }
870
- const ve = ye("MotionController"), qe = {
874
+ const ke = Ee("MotionController"), Xe = {
871
875
  ease: [0.25, 0.1, 0.25, 1],
872
876
  "ease-in": [0.42, 0, 1, 1],
873
877
  "ease-out": [0, 0, 0.58, 1],
@@ -897,98 +901,98 @@ const ve = ye("MotionController"), qe = {
897
901
  "ease-out-back": [0.175, 0.885, 0.32, 1.275],
898
902
  "ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
899
903
  };
900
- function O(r) {
901
- return r <= 0 ? 0 : r >= 1 ? 1 : r;
904
+ function _(t) {
905
+ return t <= 0 ? 0 : t >= 1 ? 1 : t;
902
906
  }
903
- function We(r) {
904
- if (r == null) return;
905
- const e = `${r}`.trim();
907
+ function Ze(t) {
908
+ if (t == null) return;
909
+ const e = `${t}`.trim();
906
910
  if (!e) return;
907
- const t = Number.parseFloat(e);
908
- return Number.isFinite(t) ? t : void 0;
911
+ const n = Number.parseFloat(e);
912
+ return Number.isFinite(n) ? n : void 0;
909
913
  }
910
- function Ye(r) {
911
- return typeof CSS < "u" && CSS.escape ? CSS.escape(r) : r.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
914
+ function Qe(t) {
915
+ return typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
912
916
  }
913
- function Je(r, e, t, n) {
917
+ function et(t, e, n, r) {
914
918
  const l = new Float32Array(11);
915
- function f(m, g, w) {
916
- return ((3 * g - 3 * w + 1) * m + (3 * w - 6 * g)) * m * m + 3 * g * m;
917
- }
918
- function p(m, g, w) {
919
- return 3 * (3 * g - 3 * w + 1) * m * m + 2 * (3 * w - 6 * g) * m + 3 * g;
920
- }
921
- function k(m, g) {
922
- for (let w = 0; w < 4; w += 1) {
923
- const P = p(g, r, t);
924
- if (P === 0)
925
- return g;
926
- const T = f(g, r, t) - m;
927
- g -= T / P;
919
+ function h(m, y, v) {
920
+ return ((3 * y - 3 * v + 1) * m + (3 * v - 6 * y)) * m * m + 3 * y * m;
921
+ }
922
+ function f(m, y, v) {
923
+ return 3 * (3 * y - 3 * v + 1) * m * m + 2 * (3 * v - 6 * y) * m + 3 * y;
924
+ }
925
+ function g(m, y) {
926
+ for (let v = 0; v < 4; v += 1) {
927
+ const j = f(y, t, n);
928
+ if (j === 0)
929
+ return y;
930
+ const O = h(y, t, n) - m;
931
+ y -= O / j;
928
932
  }
929
- return g;
933
+ return y;
930
934
  }
931
- function C(m, g, w) {
932
- let P = 0, T = 0, x = 0;
935
+ function S(m, y, v) {
936
+ let j = 0, O = 0, D = 0;
933
937
  do
934
- T = g + (w - g) / 2, P = f(T, r, t) - m, P > 0 ? w = T : g = T;
935
- while (Math.abs(P) > 1e-7 && ++x < 10);
936
- return T;
937
- }
938
- function v(m) {
939
- let g = 0, w = 1;
940
- const P = 10;
941
- for (; w !== P && l[w] <= m; w += 1)
942
- g += 0.1;
943
- w -= 1;
944
- const T = (m - l[w]) / (l[w + 1] - l[w]), x = g + T * 0.1, D = p(x, r, t);
945
- return D >= 1e-3 ? k(m, x) : D === 0 ? x : C(m, g, g + 0.1);
938
+ O = y + (v - y) / 2, j = h(O, t, n) - m, j > 0 ? v = O : y = O;
939
+ while (Math.abs(j) > 1e-7 && ++D < 10);
940
+ return O;
941
+ }
942
+ function R(m) {
943
+ let y = 0, v = 1;
944
+ const j = 10;
945
+ for (; v !== j && l[v] <= m; v += 1)
946
+ y += 0.1;
947
+ v -= 1;
948
+ const O = (m - l[v]) / (l[v + 1] - l[v]), D = y + O * 0.1, W = f(D, t, n);
949
+ return W >= 1e-3 ? g(m, D) : W === 0 ? D : S(m, y, y + 0.1);
946
950
  }
947
951
  for (let m = 0; m < 11; m += 1)
948
- l[m] = f(m * 0.1, r, t);
949
- return (m) => m <= 0 ? 0 : m >= 1 ? 1 : f(v(m), e, n);
952
+ l[m] = h(m * 0.1, t, n);
953
+ return (m) => m <= 0 ? 0 : m >= 1 ? 1 : h(R(m), e, r);
950
954
  }
951
- function cr(r) {
952
- const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(r);
955
+ function Sn(t) {
956
+ const e = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(t);
953
957
  if (!e)
954
- return (o) => O(o);
955
- const t = Math.max(1, parseInt(e[1], 10)), n = (e[2] ?? "end").toLowerCase();
956
- return n === "start" || n === "jump-start" ? (o) => O(Math.ceil(o * t) / t) : n === "none" || n === "jump-none" ? (o) => O(Math.round(o * t) / t) : n === "both" || n === "jump-both" ? (o) => O((Math.floor(o * t) + 0.5) / t) : (o) => O(Math.floor(o * t) / t);
958
+ return (o) => _(o);
959
+ const n = Math.max(1, parseInt(e[1], 10)), r = (e[2] ?? "end").toLowerCase();
960
+ 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);
957
961
  }
958
- function ur(r) {
959
- if (!r)
960
- return (t) => O(t);
961
- const e = r.trim().toLowerCase();
962
+ function bn(t) {
963
+ if (!t)
964
+ return (n) => _(n);
965
+ const e = t.trim().toLowerCase();
962
966
  if (!e || e === "linear")
963
- return (t) => O(t);
964
- if (qe[e]) {
965
- const [t, n, o, s] = qe[e], i = Je(t, n, o, s);
966
- return (a) => O(i(O(a)));
967
+ return (n) => _(n);
968
+ if (Xe[e]) {
969
+ const [n, r, o, s] = Xe[e], i = et(n, r, o, s);
970
+ return (a) => _(i(_(a)));
967
971
  }
968
972
  if (e.startsWith("cubic-bezier(") && e.endsWith(")")) {
969
- const n = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
970
- if (n.length === 4 && n.every((o) => Number.isFinite(o))) {
971
- const [o, s, i, a] = n, u = Je(o, s, i, a);
972
- return (d) => O(u(O(d)));
973
+ const r = e.slice(13, -1).split(",").map((o) => Number.parseFloat(o.trim()));
974
+ if (r.length === 4 && r.every((o) => Number.isFinite(o))) {
975
+ const [o, s, i, a] = r, c = et(o, s, i, a);
976
+ return (d) => _(c(_(d)));
973
977
  }
974
978
  }
975
979
  if (e.startsWith("steps(") && e.endsWith(")")) {
976
- const t = cr(e);
977
- return (n) => t(O(n));
980
+ const n = Sn(e);
981
+ return (r) => n(_(r));
978
982
  }
979
- return (t) => O(t);
983
+ return (n) => _(n);
980
984
  }
981
- function lr(r) {
982
- if (!r)
985
+ function wn(t) {
986
+ if (!t)
983
987
  return;
984
- const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(r);
988
+ const e = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(t);
985
989
  if (!e)
986
990
  return;
987
- const [t, n, o, s] = e.slice(1).map((i) => Number.parseFloat(i));
988
- if (![t, n, o, s].some((i) => !Number.isFinite(i)))
989
- return { inStart: t, inEnd: n, outStart: o, outEnd: s };
991
+ const [n, r, o, s] = e.slice(1).map((i) => Number.parseFloat(i));
992
+ if (![n, r, o, s].some((i) => !Number.isFinite(i)))
993
+ return { inStart: n, inEnd: r, outStart: o, outEnd: s };
990
994
  }
991
- class dr {
995
+ class En {
992
996
  bindingsByStyle = /* @__PURE__ */ new Map();
993
997
  observer;
994
998
  observeScheduled = !1;
@@ -997,47 +1001,50 @@ class dr {
997
1001
  elementStates = /* @__PURE__ */ new Map();
998
1002
  styleToElements = /* @__PURE__ */ new Map();
999
1003
  globalCleanups = /* @__PURE__ */ new Set();
1000
- registerStyle(e, t) {
1004
+ registerStyle(e, n) {
1001
1005
  if (!e)
1002
1006
  return;
1003
- const n = this.parseMetadata(t);
1004
- if (!n) {
1007
+ const r = this.parseMetadata(n);
1008
+ if (!r) {
1005
1009
  this.bindingsByStyle.delete(e), this.cleanupStyle(e);
1006
1010
  return;
1007
1011
  }
1008
- this.bindingsByStyle.set(e, n), this.cleanupStyle(e), this.ensureObserver(), this.scheduleScan(e);
1012
+ this.bindingsByStyle.set(e, r), this.cleanupStyle(e), this.ensureObserver(), this.scheduleScan(e);
1013
+ }
1014
+ unregisterStyle(e) {
1015
+ e && (this.bindingsByStyle.delete(e), this.cleanupStyle(e), this.pendingScanStyles.delete(e));
1009
1016
  }
1010
1017
  reset() {
1011
1018
  for (const e of Array.from(this.globalCleanups))
1012
1019
  try {
1013
1020
  e();
1014
- } catch (t) {
1015
- ve.warn("Failed to cleanup binding listener", t);
1021
+ } catch (n) {
1022
+ ke.warn("Failed to cleanup binding listener", n);
1016
1023
  }
1017
1024
  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);
1018
1025
  }
1019
1026
  parseMetadata(e) {
1020
1027
  if (e)
1021
1028
  try {
1022
- const n = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
1023
- return n.length === 0 ? void 0 : { bindings: n };
1024
- } catch (t) {
1025
- ve.warn("Failed to parse motion metadata", t);
1029
+ const r = (JSON.parse(e).motionBindings ?? []).map((o) => this.parseBinding(o)).filter((o) => o !== void 0);
1030
+ return r.length === 0 ? void 0 : { bindings: r };
1031
+ } catch (n) {
1032
+ ke.warn("Failed to parse motion metadata", n);
1026
1033
  return;
1027
1034
  }
1028
1035
  }
1029
1036
  parseBinding(e) {
1030
- const t = e.source?.trim();
1031
- if (!t)
1037
+ const n = e.source?.trim();
1038
+ if (!n)
1032
1039
  return;
1033
- const n = We(e.min) ?? 0, o = We(e.max), s = o === void 0 ? n + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, u = ur(e.ease), d = lr(e.map), l = e.targetId?.trim() || void 0;
1034
- return Number.isNaN(n) || Number.isNaN(s) ? void 0 : {
1035
- source: t.toLowerCase(),
1036
- min: n,
1040
+ const r = Ze(e.min) ?? 0, o = Ze(e.max), s = o === void 0 ? r + 100 : o, i = (e.clamp ?? "clamp").trim().toLowerCase(), a = !!e.reverse, c = bn(e.ease), d = wn(e.map), l = e.targetId?.trim() || void 0;
1041
+ return Number.isNaN(r) || Number.isNaN(s) ? void 0 : {
1042
+ source: n.toLowerCase(),
1043
+ min: r,
1037
1044
  max: s,
1038
1045
  clamp: i === "freeze-start" || i === "freeze-end" || i === "unclamped" ? i : "clamp",
1039
1046
  reverse: a,
1040
- ease: u,
1047
+ ease: c,
1041
1048
  map: d,
1042
1049
  targetId: l
1043
1050
  };
@@ -1046,7 +1053,7 @@ class dr {
1046
1053
  if (typeof document > "u" || this.observer)
1047
1054
  return;
1048
1055
  const e = () => {
1049
- this.observer || typeof document > "u" || (this.observer = new MutationObserver((t) => this.handleMutations(t)), this.observer.observe(document.body, {
1056
+ this.observer || typeof document > "u" || (this.observer = new MutationObserver((n) => this.handleMutations(n)), this.observer.observe(document.body, {
1050
1057
  childList: !0,
1051
1058
  subtree: !0,
1052
1059
  attributes: !0,
@@ -1064,7 +1071,7 @@ class dr {
1064
1071
  scheduleScan(e) {
1065
1072
  if (typeof document > "u" || (this.pendingScanStyles.add(e), this.scanScheduled))
1066
1073
  return;
1067
- const t = () => {
1074
+ const n = () => {
1068
1075
  if (this.pendingScanStyles.size === 0) {
1069
1076
  this.scanScheduled = !1;
1070
1077
  return;
@@ -1073,82 +1080,82 @@ class dr {
1073
1080
  this.pendingScanStyles.clear(), this.scanScheduled = !1;
1074
1081
  for (const s of o)
1075
1082
  this.scanExistingNodes(s);
1076
- }, n = () => {
1077
- this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(t) : setTimeout(t, 0);
1083
+ }, r = () => {
1084
+ this.scanScheduled = !0, typeof queueMicrotask == "function" ? queueMicrotask(n) : setTimeout(n, 0);
1078
1085
  };
1079
1086
  document.readyState === "loading" ? document.addEventListener(
1080
1087
  "DOMContentLoaded",
1081
1088
  () => {
1082
- n();
1089
+ r();
1083
1090
  },
1084
1091
  { once: !0 }
1085
- ) : n();
1092
+ ) : r();
1086
1093
  }
1087
1094
  scanExistingNodes(e) {
1088
- const t = this.bindingsByStyle.get(e);
1089
- if (!t || typeof document > "u")
1095
+ const n = this.bindingsByStyle.get(e);
1096
+ if (!n || typeof document > "u")
1090
1097
  return;
1091
- const n = `.${Ye(e)}`;
1092
- document.querySelectorAll(n).forEach((s) => this.applyStyleToElement(s, e, t));
1098
+ const r = `.${Qe(e)}`;
1099
+ document.querySelectorAll(r).forEach((s) => this.applyStyleToElement(s, e, n));
1093
1100
  }
1094
- applyStyleToElement(e, t, n) {
1095
- this.ensureStyleState(e, t) && this.attachBindings(e, t, n);
1101
+ applyStyleToElement(e, n, r) {
1102
+ this.ensureStyleState(e, n) && this.attachBindings(e, n, r);
1096
1103
  }
1097
- ensureStyleState(e, t) {
1098
- let n = this.elementStates.get(e);
1099
- if (n || (n = /* @__PURE__ */ new Map(), this.elementStates.set(e, n)), n.has(t))
1104
+ ensureStyleState(e, n) {
1105
+ let r = this.elementStates.get(e);
1106
+ if (r || (r = /* @__PURE__ */ new Map(), this.elementStates.set(e, r)), r.has(n))
1100
1107
  return !1;
1101
- n.set(t, /* @__PURE__ */ new Set());
1102
- let o = this.styleToElements.get(t);
1103
- return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(t, o)), o.add(e), !0;
1108
+ r.set(n, /* @__PURE__ */ new Set());
1109
+ let o = this.styleToElements.get(n);
1110
+ return o || (o = /* @__PURE__ */ new Set(), this.styleToElements.set(n, o)), o.add(e), !0;
1104
1111
  }
1105
- attachBindings(e, t, n) {
1106
- for (const o of n.bindings)
1107
- this.attachBinding(e, t, o);
1112
+ attachBindings(e, n, r) {
1113
+ for (const o of r.bindings)
1114
+ this.attachBinding(e, n, o);
1108
1115
  }
1109
- attachBinding(e, t, n) {
1110
- switch (n.source) {
1116
+ attachBinding(e, n, r) {
1117
+ switch (r.source) {
1111
1118
  case "scrolly":
1112
- this.attachScrollBinding(e, t, n);
1119
+ this.attachScrollBinding(e, n, r);
1113
1120
  break;
1114
1121
  }
1115
1122
  }
1116
- attachScrollBinding(e, t, n) {
1117
- const o = this.resolveScrollContainer(e, n);
1123
+ attachScrollBinding(e, n, r) {
1124
+ const o = this.resolveScrollContainer(e, r);
1118
1125
  if (!o)
1119
1126
  return;
1120
1127
  const s = () => {
1121
- this.applyBindingValues(e, n, o.scrollTop);
1128
+ this.applyBindingValues(e, r, o.scrollTop);
1122
1129
  };
1123
1130
  s();
1124
1131
  const i = new AbortController();
1125
- o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e, t, () => i.abort());
1132
+ o.addEventListener("scroll", s, { passive: !0, signal: i.signal }), this.registerCleanup(e, n, () => i.abort());
1126
1133
  const a = () => s();
1127
- window.addEventListener("resize", a), this.registerCleanup(e, t, () => window.removeEventListener("resize", a));
1134
+ window.addEventListener("resize", a), this.registerCleanup(e, n, () => window.removeEventListener("resize", a));
1128
1135
  }
1129
- resolveScrollContainer(e, t) {
1130
- if (t.targetId) {
1131
- const n = `[data-ikon-motion-source="${Ye(t.targetId)}"]`, o = typeof document < "u" ? document.querySelector(n) : null;
1136
+ resolveScrollContainer(e, n) {
1137
+ if (n.targetId) {
1138
+ const r = `[data-ikon-motion-source="${Qe(n.targetId)}"]`, o = typeof document < "u" ? document.querySelector(r) : null;
1132
1139
  if (o)
1133
1140
  return o;
1134
1141
  }
1135
1142
  return e.closest('[data-ikon-view-type="scroll-view"]');
1136
1143
  }
1137
- applyBindingValues(e, t, n) {
1138
- const o = t.max - t.min, s = o === 0 ? n > t.min ? 1 : 0 : (n - t.min) / o;
1139
- let i = this.applyClamp(s, t.clamp);
1140
- t.reverse && (i = 1 - i);
1141
- const a = t.ease(i), u = Number.isFinite(a) ? a : 0, d = u * 100;
1142
- if (e.style.setProperty("--tw-motion-bind-source-value", `${n}`), e.style.setProperty("--tw-motion-bind-progress-ratio", `${u}`), e.style.setProperty("--tw-motion-bind-progress", `${d}`), t.map) {
1143
- const l = this.applyMap(d, t.map);
1144
+ applyBindingValues(e, n, r) {
1145
+ const o = n.max - n.min, s = o === 0 ? r > n.min ? 1 : 0 : (r - n.min) / o;
1146
+ let i = this.applyClamp(s, n.clamp);
1147
+ n.reverse && (i = 1 - i);
1148
+ const a = n.ease(i), c = Number.isFinite(a) ? a : 0, d = c * 100;
1149
+ 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", `${d}`), n.map) {
1150
+ const l = this.applyMap(d, n.map);
1144
1151
  l !== void 0 && e.style.setProperty("--tw-motion-bind-value", `${l}`);
1145
1152
  } else
1146
1153
  e.style.removeProperty("--tw-motion-bind-value");
1147
1154
  }
1148
- applyClamp(e, t) {
1155
+ applyClamp(e, n) {
1149
1156
  if (!Number.isFinite(e))
1150
1157
  return 0;
1151
- switch (t) {
1158
+ switch (n) {
1152
1159
  case "freeze-start":
1153
1160
  return e < 0 ? 0 : e;
1154
1161
  case "freeze-end":
@@ -1156,250 +1163,265 @@ class dr {
1156
1163
  case "unclamped":
1157
1164
  return e;
1158
1165
  default:
1159
- return O(e);
1166
+ return _(e);
1160
1167
  }
1161
1168
  }
1162
- applyMap(e, t) {
1163
- const n = t.inEnd - t.inStart;
1164
- if (n === 0)
1165
- return t.outEnd;
1166
- const o = (e - t.inStart) / n;
1167
- return t.outStart + o * (t.outEnd - t.outStart);
1169
+ applyMap(e, n) {
1170
+ const r = n.inEnd - n.inStart;
1171
+ if (r === 0)
1172
+ return n.outEnd;
1173
+ const o = (e - n.inStart) / r;
1174
+ return n.outStart + o * (n.outEnd - n.outStart);
1168
1175
  }
1169
- registerCleanup(e, t, n) {
1170
- const s = this.elementStates.get(e)?.get(t);
1171
- s && (s.add(n), this.globalCleanups.add(n));
1176
+ registerCleanup(e, n, r) {
1177
+ const s = this.elementStates.get(e)?.get(n);
1178
+ s && (s.add(r), this.globalCleanups.add(r));
1172
1179
  }
1173
1180
  cleanupStyle(e) {
1174
- const t = this.styleToElements.get(e);
1175
- if (!t)
1181
+ const n = this.styleToElements.get(e);
1182
+ if (!n)
1176
1183
  return;
1177
- const n = Array.from(t);
1178
- for (const o of n)
1184
+ const r = Array.from(n);
1185
+ for (const o of r)
1179
1186
  this.cleanupElementStyle(o, e);
1180
1187
  this.styleToElements.delete(e);
1181
1188
  }
1182
1189
  cleanupElement(e) {
1183
- const t = this.elementStates.get(e);
1184
- if (!t)
1190
+ const n = this.elementStates.get(e);
1191
+ if (!n)
1185
1192
  return;
1186
- const n = Array.from(t.keys());
1187
- for (const o of n)
1193
+ const r = Array.from(n.keys());
1194
+ for (const o of r)
1188
1195
  this.cleanupElementStyle(e, o);
1189
1196
  }
1190
- cleanupElementStyle(e, t) {
1191
- const n = this.elementStates.get(e);
1192
- if (!n)
1197
+ cleanupElementStyle(e, n) {
1198
+ const r = this.elementStates.get(e);
1199
+ if (!r)
1193
1200
  return;
1194
- const o = n.get(t);
1201
+ const o = r.get(n);
1195
1202
  if (!o)
1196
1203
  return;
1197
1204
  for (const i of o) {
1198
1205
  try {
1199
1206
  i();
1200
1207
  } catch (a) {
1201
- ve.warn("Failed to cleanup listener", a);
1208
+ ke.warn("Failed to cleanup listener", a);
1202
1209
  }
1203
1210
  this.globalCleanups.delete(i);
1204
1211
  }
1205
- o.clear(), n.delete(t);
1206
- const s = this.styleToElements.get(t);
1207
- s && (s.delete(e), s.size === 0 && this.styleToElements.delete(t)), n.size === 0 && (this.elementStates.delete(e), this.clearBindingProperties(e));
1212
+ o.clear(), r.delete(n);
1213
+ const s = this.styleToElements.get(n);
1214
+ s && (s.delete(e), s.size === 0 && this.styleToElements.delete(n)), r.size === 0 && (this.elementStates.delete(e), this.clearBindingProperties(e));
1208
1215
  }
1209
1216
  clearBindingProperties(e) {
1210
1217
  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");
1211
1218
  }
1212
1219
  handleMutations(e) {
1213
- for (const t of e)
1214
- t.type === "childList" ? (t.addedNodes.forEach((n) => this.scanNode(n)), t.removedNodes.forEach((n) => this.cleanupNode(n))) : t.type === "attributes" && t.target instanceof HTMLElement && this.handleClassMutation(t.target);
1220
+ for (const n of e)
1221
+ 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);
1215
1222
  }
1216
1223
  handleClassMutation(e) {
1217
- const t = this.elementStates.get(e);
1218
- if (!t) {
1224
+ const n = this.elementStates.get(e);
1225
+ if (!n) {
1219
1226
  this.processElement(e);
1220
1227
  return;
1221
1228
  }
1222
- for (const n of t.keys())
1223
- e.classList.contains(n) || this.cleanupElementStyle(e, n);
1229
+ for (const r of n.keys())
1230
+ e.classList.contains(r) || this.cleanupElementStyle(e, r);
1224
1231
  this.processElement(e);
1225
1232
  }
1226
1233
  scanNode(e) {
1227
1234
  if (!(e instanceof HTMLElement))
1228
1235
  return;
1229
- this.processElement(e), e.querySelectorAll("[class]").forEach((n) => this.processElement(n));
1236
+ this.processElement(e), e.querySelectorAll("[class]").forEach((r) => this.processElement(r));
1230
1237
  }
1231
1238
  cleanupNode(e) {
1232
1239
  if (!(e instanceof HTMLElement))
1233
1240
  return;
1234
- this.cleanupElement(e), e.querySelectorAll("[class]").forEach((n) => this.cleanupElement(n));
1241
+ this.cleanupElement(e), e.querySelectorAll("[class]").forEach((r) => this.cleanupElement(r));
1235
1242
  }
1236
1243
  processElement(e) {
1237
1244
  if (!e.classList || e.classList.length === 0)
1238
1245
  return;
1239
- const t = e.classList;
1240
- for (let n = 0; n < t.length; n++) {
1241
- const o = t[n], s = this.bindingsByStyle.get(o);
1246
+ const n = e.classList;
1247
+ for (let r = 0; r < n.length; r++) {
1248
+ const o = n[r], s = this.bindingsByStyle.get(o);
1242
1249
  s && this.ensureStyleState(e, o) && this.attachBindings(e, o, s);
1243
1250
  }
1244
1251
  }
1245
1252
  }
1246
- const Ke = new dr(), we = "ikon-ds";
1247
- function fr(r) {
1248
- const e = z(({ styleId: n, css: o, common: s }) => {
1249
- if (!n || typeof document > "u") return;
1250
- let i = document.getElementById(we);
1251
- i || (i = document.createElement("style"), i.id = we, document.head.appendChild(i)), o && (i.innerHTML += o), Ke.registerStyle(n, s);
1252
- }, []), t = z(() => {
1253
- typeof document < "u" && document.getElementById(we)?.remove(), Ke.reset();
1253
+ const Te = new En();
1254
+ function Rn(t) {
1255
+ const e = A(/* @__PURE__ */ new Map()), n = F(({ styleId: s, css: i, common: a }) => {
1256
+ if (!(!s || typeof document > "u")) {
1257
+ if (i) {
1258
+ let c = e.current.get(s);
1259
+ c || (c = document.createElement("style"), c.setAttribute("data-ikon-style-id", s), document.head.appendChild(c), e.current.set(s, c)), c.textContent = i;
1260
+ }
1261
+ Te.registerStyle(s, a);
1262
+ }
1263
+ }, []), r = F((s) => {
1264
+ if (!(typeof document > "u"))
1265
+ for (const i of s) {
1266
+ const a = e.current.get(i);
1267
+ a && (a.remove(), e.current.delete(i)), Te.unregisterStyle(i);
1268
+ }
1269
+ }, []), o = F(() => {
1270
+ if (typeof document < "u") {
1271
+ for (const s of e.current.values())
1272
+ s.remove();
1273
+ e.current.clear();
1274
+ }
1275
+ Te.reset();
1254
1276
  }, []);
1255
- return $(() => {
1256
- if (!r) return;
1257
- for (const o of r.getUiStyles())
1258
- e(o);
1259
- const n = r.subscribeToStyles(e);
1277
+ return B(() => {
1278
+ if (!t) return;
1279
+ for (const a of t.getUiStyles())
1280
+ n(a);
1281
+ const s = t.subscribeToStyles(n), i = t.subscribeToStyleDeletes?.(r);
1260
1282
  return () => {
1261
- n?.(), t();
1283
+ s?.(), i?.(), o();
1262
1284
  };
1263
- }, [r, t, e]), $(() => () => t(), [t]), { setStyle: e, reset: t };
1285
+ }, [t, o, n, r]), B(() => () => o(), [o]), { setStyle: n, deleteStyles: r, reset: o };
1264
1286
  }
1265
- function hr(r) {
1287
+ function vn(t) {
1266
1288
  const e = [];
1267
- for (const [t, n] of r) {
1268
- const o = n.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
1269
- e.push(`${t}:${s ? "1" : "0"}`);
1289
+ for (const [n, r] of t) {
1290
+ const o = r.store.getSnapshot(), s = o.rootViewId && o.views.has(o.rootViewId);
1291
+ e.push(`${n}:${s ? "1" : "0"}`);
1270
1292
  }
1271
1293
  return e.sort(), e.join(",");
1272
1294
  }
1273
- function mr(r) {
1274
- const [e, t] = Y(), n = E("");
1275
- return $(() => {
1276
- if (!r) {
1277
- t(void 0), n.current = "";
1295
+ function An(t) {
1296
+ const [e, n] = Y(), r = A("");
1297
+ return B(() => {
1298
+ if (!t) {
1299
+ n(void 0), r.current = "";
1278
1300
  return;
1279
1301
  }
1280
1302
  const o = () => {
1281
- const s = r.getStores(), i = hr(s);
1282
- i !== n.current && (n.current = i, t(s));
1303
+ const s = t.getStores(), i = vn(s);
1304
+ i !== r.current && (r.current = i, n(s));
1283
1305
  };
1284
- return o(), r.subscribe(o);
1285
- }, [r]), e;
1306
+ return o(), t.subscribe(o);
1307
+ }, [t]), e;
1286
1308
  }
1287
- var pr = typeof global == "object" && global && global.Object === Object && global, gr = typeof self == "object" && self && self.Object === Object && self, yr = pr || gr || Function("return this")(), ge = yr.Symbol, it = Object.prototype, Sr = it.hasOwnProperty, br = it.toString, ne = ge ? ge.toStringTag : void 0;
1288
- function vr(r) {
1289
- var e = Sr.call(r, ne), t = r[ne];
1309
+ var kn = typeof global == "object" && global && global.Object === Object && global, Tn = typeof self == "object" && self && self.Object === Object && self, In = kn || Tn || Function("return this")(), be = In.Symbol, ft = Object.prototype, Cn = ft.hasOwnProperty, Nn = ft.toString, se = be ? be.toStringTag : void 0;
1310
+ function On(t) {
1311
+ var e = Cn.call(t, se), n = t[se];
1290
1312
  try {
1291
- r[ne] = void 0;
1292
- var n = !0;
1313
+ t[se] = void 0;
1314
+ var r = !0;
1293
1315
  } catch {
1294
1316
  }
1295
- var o = br.call(r);
1296
- return n && (e ? r[ne] = t : delete r[ne]), o;
1317
+ var o = Nn.call(t);
1318
+ return r && (e ? t[se] = n : delete t[se]), o;
1297
1319
  }
1298
- var wr = Object.prototype, Er = wr.toString;
1299
- function kr(r) {
1300
- return Er.call(r);
1320
+ var Pn = Object.prototype, _n = Pn.toString;
1321
+ function jn(t) {
1322
+ return _n.call(t);
1301
1323
  }
1302
- var Rr = "[object Null]", Ar = "[object Undefined]", Ge = ge ? ge.toStringTag : void 0;
1303
- function Nr(r) {
1304
- return r == null ? r === void 0 ? Ar : Rr : Ge && Ge in Object(r) ? vr(r) : kr(r);
1324
+ var Mn = "[object Null]", Ln = "[object Undefined]", tt = be ? be.toStringTag : void 0;
1325
+ function Un(t) {
1326
+ return t == null ? t === void 0 ? Ln : Mn : tt && tt in Object(t) ? On(t) : jn(t);
1305
1327
  }
1306
- function Cr(r) {
1307
- return r != null && typeof r == "object";
1328
+ function xn(t) {
1329
+ return t != null && typeof t == "object";
1308
1330
  }
1309
- var Ir = Array.isArray, Tr = "[object String]";
1310
- function jr(r) {
1311
- return typeof r == "string" || !Ir(r) && Cr(r) && Nr(r) == Tr;
1331
+ var Dn = Array.isArray, $n = "[object String]";
1332
+ function Fn(t) {
1333
+ return typeof t == "string" || !Dn(t) && xn(t) && Un(t) == $n;
1312
1334
  }
1313
- const He = "ikonUiModules";
1314
- function je(r) {
1315
- return typeof r == "object" && r !== null && !Array.isArray(r);
1335
+ const nt = "ikonUiModules";
1336
+ function Ue(t) {
1337
+ return typeof t == "object" && t !== null && !Array.isArray(t);
1316
1338
  }
1317
- function Or(r) {
1318
- if (!Array.isArray(r))
1339
+ function Bn(t) {
1340
+ if (!Array.isArray(t))
1319
1341
  return;
1320
1342
  const e = /* @__PURE__ */ new Set();
1321
- for (const t of r) {
1322
- if (!jr(t)) continue;
1323
- const n = t.trim();
1324
- n && (e.has(n) || e.add(n));
1343
+ for (const n of t) {
1344
+ if (!Fn(n)) continue;
1345
+ const r = n.trim();
1346
+ r && (e.has(r) || e.add(r));
1325
1347
  }
1326
1348
  return Array.from(e);
1327
1349
  }
1328
- function gn(r, e) {
1329
- if (r === e)
1350
+ function xr(t, e) {
1351
+ if (t === e)
1330
1352
  return !0;
1331
- if (!r || !e)
1332
- return !r && !e;
1333
- if (r.length !== e.length)
1353
+ if (!t || !e)
1354
+ return !t && !e;
1355
+ if (t.length !== e.length)
1334
1356
  return !1;
1335
- for (let t = 0; t < r.length; t += 1)
1336
- if (r[t] !== e[t])
1357
+ for (let n = 0; n < t.length; n += 1)
1358
+ if (t[n] !== e[n])
1337
1359
  return !1;
1338
1360
  return !0;
1339
1361
  }
1340
- function Pr(r) {
1341
- if (!(!je(r) || !Object.prototype.hasOwnProperty.call(r, He)))
1342
- return Or(r[He]);
1362
+ function Vn(t) {
1363
+ if (!(!Ue(t) || !Object.prototype.hasOwnProperty.call(t, nt)))
1364
+ return Bn(t[nt]);
1343
1365
  }
1344
- function yn(...r) {
1345
- for (const e of r) {
1346
- const t = Pr(e);
1347
- if (t !== void 0)
1348
- return t;
1366
+ function Dr(...t) {
1367
+ for (const e of t) {
1368
+ const n = Vn(e);
1369
+ if (n !== void 0)
1370
+ return n;
1349
1371
  }
1350
1372
  }
1351
- function Sn(r) {
1352
- if (!je(r))
1373
+ function $r(t) {
1374
+ if (!Ue(t))
1353
1375
  return;
1354
- const e = r, t = Object.keys(e).find((u) => u.toLowerCase() === "modules");
1355
- if (!t)
1376
+ const e = t, n = Object.keys(e).find((c) => c.toLowerCase() === "modules");
1377
+ if (!n)
1356
1378
  return;
1357
- const n = e[t];
1358
- if (n === null)
1379
+ const r = e[n];
1380
+ if (r === null)
1359
1381
  return { resetToDefault: !0 };
1360
- if (!Array.isArray(n))
1382
+ if (!Array.isArray(r))
1361
1383
  return;
1362
1384
  const o = [], s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
1363
- for (const u of n) {
1364
- if (typeof u == "string") {
1365
- const v = u.trim();
1366
- if (!v || i.has(v))
1385
+ for (const c of r) {
1386
+ if (typeof c == "string") {
1387
+ const R = c.trim();
1388
+ if (!R || i.has(R))
1367
1389
  continue;
1368
- o.push(v), i.add(v);
1390
+ o.push(R), i.add(R);
1369
1391
  continue;
1370
1392
  }
1371
- if (!je(u))
1393
+ if (!Ue(c))
1372
1394
  continue;
1373
- const d = u, l = Object.keys(d).find((v) => v.toLowerCase() === "name");
1395
+ const d = c, l = Object.keys(d).find((R) => R.toLowerCase() === "name");
1374
1396
  if (!l)
1375
1397
  continue;
1376
- const f = d[l];
1377
- if (typeof f != "string")
1398
+ const h = d[l];
1399
+ if (typeof h != "string")
1378
1400
  continue;
1379
- const p = f.trim();
1380
- if (!p)
1401
+ const f = h.trim();
1402
+ if (!f)
1381
1403
  continue;
1382
- const k = Object.keys(d).find((v) => v.toLowerCase() === "javascript"), C = k ? d[k] : void 0;
1383
- typeof C == "string" && s.set(p, C), i.has(p) || (o.push(p), i.add(p));
1404
+ const g = Object.keys(d).find((R) => R.toLowerCase() === "javascript"), S = g ? d[g] : void 0;
1405
+ typeof S == "string" && s.set(f, S), i.has(f) || (o.push(f), i.add(f));
1384
1406
  }
1385
1407
  if (!o.length && s.size === 0)
1386
1408
  return { modules: [] };
1387
- const a = Array.from(s.entries()).map(([u, d]) => ({
1388
- name: u,
1409
+ const a = Array.from(s.entries()).map(([c, d]) => ({
1410
+ name: c,
1389
1411
  javascript: d
1390
1412
  }));
1391
1413
  return a.length > 0 ? { modules: o, inlineModules: a } : { modules: o };
1392
1414
  }
1393
- const y = {
1415
+ const b = {
1394
1416
  None: 0,
1395
1417
  Letter: 1,
1396
1418
  Word: 2,
1397
1419
  Line: 4,
1398
1420
  Paragraph: 8,
1399
1421
  Emoji: 16
1400
- }, _r = [
1422
+ }, Kn = [
1401
1423
  {
1402
- flag: y.Letter,
1424
+ flag: b.Letter,
1403
1425
  hints: [
1404
1426
  "[data-motion-letter]",
1405
1427
  "[data-letter]",
@@ -1408,7 +1430,7 @@ const y = {
1408
1430
  ]
1409
1431
  },
1410
1432
  {
1411
- flag: y.Word,
1433
+ flag: b.Word,
1412
1434
  hints: [
1413
1435
  "[data-motion-word]",
1414
1436
  "[data-word]",
@@ -1417,7 +1439,7 @@ const y = {
1417
1439
  ]
1418
1440
  },
1419
1441
  {
1420
- flag: y.Line,
1442
+ flag: b.Line,
1421
1443
  hints: [
1422
1444
  "[data-motion-line]",
1423
1445
  "[data-line]",
@@ -1426,7 +1448,7 @@ const y = {
1426
1448
  ]
1427
1449
  },
1428
1450
  {
1429
- flag: y.Paragraph,
1451
+ flag: b.Paragraph,
1430
1452
  hints: [
1431
1453
  "[data-motion-paragraph]",
1432
1454
  "[data-paragraph]",
@@ -1437,7 +1459,7 @@ const y = {
1437
1459
  ]
1438
1460
  },
1439
1461
  {
1440
- flag: y.Emoji,
1462
+ flag: b.Emoji,
1441
1463
  hints: [
1442
1464
  ":is([data-motion-emoji],[data-emoji],.tw-motion-emoji,.tw-emoji)",
1443
1465
  "[data-motion-emoji]",
@@ -1446,221 +1468,221 @@ const y = {
1446
1468
  "[data-emoji]"
1447
1469
  ]
1448
1470
  }
1449
- ], Oe = y.Letter | y.Word | y.Line | y.Paragraph | y.Emoji, Mr = y.Letter | y.Word | y.Line | y.Paragraph, Xe = /* @__PURE__ */ new Map(), Lr = 16384;
1450
- function bn(r, e) {
1451
- if (!r || r.length > Lr)
1452
- return r;
1453
- const t = Zr(e), n = K(t, y.Emoji), o = t & Mr;
1454
- if (o === y.None && !n)
1455
- return r;
1456
- const s = r.replace(/\r\n/g, `
1471
+ ], xe = b.Letter | b.Word | b.Line | b.Paragraph | b.Emoji, zn = b.Letter | b.Word | b.Line | b.Paragraph, rt = /* @__PURE__ */ new Map(), Wn = 16384;
1472
+ function Fr(t, e) {
1473
+ if (!t || t.length > Wn)
1474
+ return t;
1475
+ const n = cr(e), r = H(n, b.Emoji), o = n & zn;
1476
+ if (o === b.None && !r)
1477
+ return t;
1478
+ const s = t.replace(/\r\n/g, `
1457
1479
  `).replace(/\r/g, `
1458
1480
  `);
1459
- if (o === y.None)
1460
- return tt(s);
1461
- const i = Hr(s);
1481
+ if (o === b.None)
1482
+ return at(s);
1483
+ const i = ir(s);
1462
1484
  if (i.length === 0)
1463
- return n ? tt(s) : r;
1464
- const a = Xr(i), u = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
1485
+ return r ? at(s) : t;
1486
+ const a = ar(i), c = { letter: 0, word: 0, line: 0, paragraph: 0, br: 0, emoji: 0 }, d = [];
1465
1487
  for (const l of a) {
1466
- const f = Ur(l, t, u);
1467
- d.push(...f);
1488
+ const h = qn(l, n, c);
1489
+ d.push(...h);
1468
1490
  }
1469
1491
  return d;
1470
1492
  }
1471
- function Ur(r, e, t) {
1472
- const n = [];
1473
- for (const o of r) {
1474
- const s = xr(o, e, t);
1475
- n.push(...s);
1493
+ function qn(t, e, n) {
1494
+ const r = [];
1495
+ for (const o of t) {
1496
+ const s = Jn(o, e, n);
1497
+ r.push(...s);
1476
1498
  }
1477
- if (K(e, y.Paragraph)) {
1478
- const o = t.paragraph++;
1499
+ if (H(e, b.Paragraph)) {
1500
+ const o = n.paragraph++;
1479
1501
  return [
1480
- /* @__PURE__ */ b.jsx(
1502
+ /* @__PURE__ */ E.jsx(
1481
1503
  "span",
1482
1504
  {
1483
1505
  "data-motion-paragraph": !0,
1484
- style: Se(o),
1485
- children: n
1506
+ style: Re(o),
1507
+ children: r
1486
1508
  },
1487
1509
  `motion-paragraph-${o}`
1488
1510
  )
1489
1511
  ];
1490
1512
  }
1491
- return n;
1513
+ return r;
1492
1514
  }
1493
- function xr(r, e, t) {
1494
- const n = $r(r.text, e, t), o = [];
1495
- if (K(e, y.Line)) {
1496
- const s = t.line++;
1515
+ function Jn(t, e, n) {
1516
+ const r = Yn(t.text, e, n), o = [];
1517
+ if (H(e, b.Line)) {
1518
+ const s = n.line++;
1497
1519
  o.push(
1498
- /* @__PURE__ */ b.jsx("span", { "data-motion-line": !0, style: Se(s), children: n }, `motion-line-${s}`)
1520
+ /* @__PURE__ */ E.jsx("span", { "data-motion-line": !0, style: Re(s), children: r }, `motion-line-${s}`)
1499
1521
  );
1500
1522
  } else
1501
- o.push(...n);
1502
- for (let s = 0; s < r.breaks; s++)
1503
- o.push(/* @__PURE__ */ b.jsx("br", {}, `motion-break-${t.br++}`));
1523
+ o.push(...r);
1524
+ for (let s = 0; s < t.breaks; s++)
1525
+ o.push(/* @__PURE__ */ E.jsx("br", {}, `motion-break-${n.br++}`));
1504
1526
  return o;
1505
1527
  }
1506
- function $r(r, e, t) {
1507
- if (!r)
1528
+ function Yn(t, e, n) {
1529
+ if (!t)
1508
1530
  return [];
1509
- const n = K(e, y.Word), o = [], s = /(\s+)/g;
1531
+ const r = H(e, b.Word), o = [], s = /(\s+)/g;
1510
1532
  let i = 0, a;
1511
- for (; (a = s.exec(r)) !== null; ) {
1533
+ for (; (a = s.exec(t)) !== null; ) {
1512
1534
  if (a.index > i) {
1513
- const u = r.slice(i, a.index);
1514
- o.push(Ze(u, t, e, n));
1535
+ const c = t.slice(i, a.index);
1536
+ o.push(ot(c, n, e, r));
1515
1537
  }
1516
1538
  o.push(a[0]), i = a.index + a[0].length;
1517
1539
  }
1518
- if (i < r.length) {
1519
- const u = r.slice(i);
1520
- o.push(Ze(u, t, e, n));
1540
+ if (i < t.length) {
1541
+ const c = t.slice(i);
1542
+ o.push(ot(c, n, e, r));
1521
1543
  }
1522
1544
  return o;
1523
1545
  }
1524
- function Ze(r, e, t, n) {
1525
- const o = e.word++, s = Br(r, t, e), i = `motion-word-${o}`, a = Fr(o, n);
1526
- return n ? /* @__PURE__ */ b.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ b.jsx("span", { style: a, children: s }, i);
1546
+ function ot(t, e, n, r) {
1547
+ const o = e.word++, s = Hn(t, n, e), i = `motion-word-${o}`, a = Gn(o, r);
1548
+ return r ? /* @__PURE__ */ E.jsx("span", { "data-motion-word": !0, style: a, children: s }, i) : /* @__PURE__ */ E.jsx("span", { style: a, children: s }, i);
1527
1549
  }
1528
- function Fr(r, e) {
1529
- return e ? { ...Se(r), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
1550
+ function Gn(t, e) {
1551
+ return e ? { ...Re(t), whiteSpace: "nowrap" } : { whiteSpace: "nowrap" };
1530
1552
  }
1531
- function Br(r, e, t) {
1532
- if (!r)
1553
+ function Hn(t, e, n) {
1554
+ if (!t)
1533
1555
  return [];
1534
- const n = K(e, y.Letter), o = K(e, y.Emoji);
1535
- if (!n) {
1556
+ const r = H(e, b.Letter), o = H(e, b.Emoji);
1557
+ if (!r) {
1536
1558
  if (!o)
1537
- return [r];
1538
- const a = Pe(r);
1559
+ return [t];
1560
+ const a = De(t);
1539
1561
  if (a.length === 0)
1540
- return [r];
1541
- const { nodes: u } = ct(a, t);
1542
- return u;
1562
+ return [t];
1563
+ const { nodes: c } = pt(a, n);
1564
+ return c;
1543
1565
  }
1544
- const s = [], i = Pe(r);
1566
+ const s = [], i = De(t);
1545
1567
  for (const a of i) {
1546
- const u = t.letter++, d = `motion-letter-${u}`, l = Se(u);
1568
+ const c = n.letter++, d = `motion-letter-${c}`, l = Re(c);
1547
1569
  if (a === `
1548
1570
  `) {
1549
1571
  s.push(
1550
- /* @__PURE__ */ b.jsx("span", { "data-motion-letter": !0, style: l, children: /* @__PURE__ */ b.jsx("br", {}) }, d)
1572
+ /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, children: /* @__PURE__ */ E.jsx("br", {}) }, d)
1551
1573
  );
1552
1574
  continue;
1553
1575
  }
1554
- const p = o && at(a) ? { "data-motion-emoji": !0 } : void 0, k = a === " " ? " " : a;
1576
+ const f = o && ht(a) ? { "data-motion-emoji": !0 } : void 0, g = a === " " ? " " : a;
1555
1577
  s.push(
1556
- /* @__PURE__ */ b.jsx("span", { "data-motion-letter": !0, style: l, ...p, children: k }, d)
1578
+ /* @__PURE__ */ E.jsx("span", { "data-motion-letter": !0, style: l, ...f, children: g }, d)
1557
1579
  );
1558
1580
  }
1559
1581
  return s;
1560
1582
  }
1561
- function Pe(r) {
1562
- if (!r)
1583
+ function De(t) {
1584
+ if (!t)
1563
1585
  return [];
1564
- const e = Vr();
1565
- return e ? Array.from(e.segment(r), (t) => t.segment) : zr(r);
1586
+ const e = Xn();
1587
+ return e ? Array.from(e.segment(t), (n) => n.segment) : Zn(t);
1566
1588
  }
1567
- let oe;
1568
- function Vr() {
1569
- return oe !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? oe = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : oe = null), oe;
1589
+ let ie;
1590
+ function Xn() {
1591
+ return ie !== void 0 || (typeof Intl < "u" && typeof Intl.Segmenter == "function" ? ie = new Intl.Segmenter(void 0, { granularity: "grapheme" }) : ie = null), ie;
1570
1592
  }
1571
- function zr(r) {
1572
- const e = [], t = Array.from(r);
1573
- let n = "";
1574
- for (let o = 0; o < t.length; o++) {
1575
- const s = t[o], i = t[o + 1];
1576
- n += s, !(i && Dr(s, i)) && (e.push(n), n = "");
1593
+ function Zn(t) {
1594
+ const e = [], n = Array.from(t);
1595
+ let r = "";
1596
+ for (let o = 0; o < n.length; o++) {
1597
+ const s = n[o], i = n[o + 1];
1598
+ r += s, !(i && Qn(s, i)) && (e.push(r), r = "");
1577
1599
  }
1578
- return n && e.push(n), e;
1600
+ return r && e.push(r), e;
1579
1601
  }
1580
- function Dr(r, e) {
1581
- return e ? !!(Qe(r) || Qe(e) || Yr(e) || qr(e) || Wr(e) || et(r) && et(e)) : !1;
1602
+ function Qn(t, e) {
1603
+ return e ? !!(st(t) || st(e) || nr(e) || er(e) || tr(e) || it(t) && it(e)) : !1;
1582
1604
  }
1583
- function Qe(r) {
1584
- return r.codePointAt(0) === 8205;
1605
+ function st(t) {
1606
+ return t.codePointAt(0) === 8205;
1585
1607
  }
1586
- function qr(r) {
1587
- const e = r.codePointAt(0);
1608
+ function er(t) {
1609
+ const e = t.codePointAt(0);
1588
1610
  return e === void 0 ? !1 : e >= 65024 && e <= 65039 || e >= 917760 && e <= 917999;
1589
1611
  }
1590
- function Wr(r) {
1591
- const e = r.codePointAt(0);
1612
+ function tr(t) {
1613
+ const e = t.codePointAt(0);
1592
1614
  return e === void 0 ? !1 : e >= 127995 && e <= 127999;
1593
1615
  }
1594
- function et(r) {
1595
- const e = r.codePointAt(0);
1616
+ function it(t) {
1617
+ const e = t.codePointAt(0);
1596
1618
  return e === void 0 ? !1 : e >= 127462 && e <= 127487;
1597
1619
  }
1598
- let Ee;
1599
- function Yr(r) {
1600
- return r ? (Ee || (Ee = Jr()), Ee(r)) : !1;
1620
+ let Ie;
1621
+ function nr(t) {
1622
+ return t ? (Ie || (Ie = rr()), Ie(t)) : !1;
1601
1623
  }
1602
- function Jr() {
1624
+ function rr() {
1603
1625
  try {
1604
- const r = new RegExp("\\p{Mark}", "u");
1605
- return (e) => r.test(e);
1626
+ const t = new RegExp("\\p{Mark}", "u");
1627
+ return (e) => t.test(e);
1606
1628
  } catch {
1607
- return (r) => {
1608
- const e = r.codePointAt(0);
1629
+ return (t) => {
1630
+ const e = t.codePointAt(0);
1609
1631
  return e === void 0 ? !1 : e >= 768 && e <= 879 || e >= 6832 && e <= 6911 || e >= 7616 && e <= 7679 || e >= 8400 && e <= 8447 || e >= 12441 && e <= 12442 || e >= 65056 && e <= 65071;
1610
1632
  };
1611
1633
  }
1612
1634
  }
1613
- let ke;
1614
- function at(r) {
1615
- return r ? (ke || (ke = Kr()), ke(r)) : !1;
1635
+ let Ce;
1636
+ function ht(t) {
1637
+ return t ? (Ce || (Ce = or()), Ce(t)) : !1;
1616
1638
  }
1617
- function Kr() {
1639
+ function or() {
1618
1640
  try {
1619
- const r = new RegExp("\\p{Extended_Pictographic}", "u");
1620
- return (e) => r.test(e);
1641
+ const t = new RegExp("\\p{Extended_Pictographic}", "u");
1642
+ return (e) => t.test(e);
1621
1643
  } catch {
1622
- return Gr;
1644
+ return sr;
1623
1645
  }
1624
1646
  }
1625
- function Gr(r) {
1626
- if (!r)
1647
+ function sr(t) {
1648
+ if (!t)
1627
1649
  return !1;
1628
- for (const e of Array.from(r)) {
1629
- const t = e.codePointAt(0);
1630
- if (t !== void 0 && (t >= 126976 && t <= 127231 || t >= 127232 && t <= 127487 || t >= 127488 && t <= 127743 || t >= 127744 && t <= 128511 || t >= 128512 && t <= 128591 || t >= 128640 && t <= 128767 || t >= 128768 && t <= 128895 || t >= 128896 && t <= 129023 || t >= 129024 && t <= 129279 || t >= 129280 && t <= 129535 || t >= 129536 && t <= 129791 || t >= 9728 && t <= 9983 || t >= 9984 && t <= 10175 || t === 8205 || t === 65039 || t === 8419))
1650
+ for (const e of Array.from(t)) {
1651
+ const n = e.codePointAt(0);
1652
+ 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))
1631
1653
  return !0;
1632
1654
  }
1633
1655
  return !1;
1634
1656
  }
1635
- function Hr(r) {
1657
+ function ir(t) {
1636
1658
  const e = [];
1637
- let t = "", n = 0;
1638
- for (let o = 0; o < r.length; o++) {
1639
- const s = r[o];
1659
+ let n = "", r = 0;
1660
+ for (let o = 0; o < t.length; o++) {
1661
+ const s = t[o];
1640
1662
  if (s === `
1641
1663
  `) {
1642
- n += 1;
1664
+ r += 1;
1643
1665
  continue;
1644
1666
  }
1645
- n > 0 && (e.push({ text: t, breaks: n }), t = "", n = 0), t += s;
1667
+ r > 0 && (e.push({ text: n, breaks: r }), n = "", r = 0), n += s;
1646
1668
  }
1647
- return (n > 0 || t.length > 0) && e.push({ text: t, breaks: n }), e;
1669
+ return (r > 0 || n.length > 0) && e.push({ text: n, breaks: r }), e;
1648
1670
  }
1649
- function Xr(r) {
1650
- if (r.length === 0)
1671
+ function ar(t) {
1672
+ if (t.length === 0)
1651
1673
  return [];
1652
1674
  const e = [];
1653
- let t = [];
1654
- for (const n of r)
1655
- t.push(n), n.breaks >= 2 && (e.push(t), t = []);
1656
- return t.length > 0 && e.push(t), e;
1675
+ let n = [];
1676
+ for (const r of t)
1677
+ n.push(r), r.breaks >= 2 && (e.push(n), n = []);
1678
+ return n.length > 0 && e.push(n), e;
1657
1679
  }
1658
- function K(r, e) {
1659
- return (r & e) === e;
1680
+ function H(t, e) {
1681
+ return (t & e) === e;
1660
1682
  }
1661
- function Se(r) {
1683
+ function Re(t) {
1662
1684
  return {
1663
- "--tw-motion-seq-index": r.toString(),
1685
+ "--tw-motion-seq-index": t.toString(),
1664
1686
  backgroundColor: "inherit",
1665
1687
  backgroundImage: "inherit",
1666
1688
  backgroundClip: "inherit",
@@ -1675,154 +1697,154 @@ function Se(r) {
1675
1697
  WebkitTextFillColor: "inherit"
1676
1698
  };
1677
1699
  }
1678
- function tt(r) {
1679
- if (!r)
1680
- return r;
1681
- const e = Pe(r);
1700
+ function at(t) {
1701
+ if (!t)
1702
+ return t;
1703
+ const e = De(t);
1682
1704
  if (e.length === 0)
1683
- return r;
1684
- const { nodes: t, sawEmoji: n } = ct(e);
1685
- return n ? t.length === 1 ? t[0] ?? r : t : r;
1705
+ return t;
1706
+ const { nodes: n, sawEmoji: r } = pt(e);
1707
+ return r ? n.length === 1 ? n[0] ?? t : n : t;
1686
1708
  }
1687
- function ct(r, e) {
1688
- const t = [];
1689
- let n = "", o = !1, s = e?.emoji ?? 0;
1709
+ function pt(t, e) {
1710
+ const n = [];
1711
+ let r = "", o = !1, s = e?.emoji ?? 0;
1690
1712
  const i = () => {
1691
- n && (t.push(n), n = "");
1713
+ r && (n.push(r), r = "");
1692
1714
  };
1693
- for (const a of r) {
1694
- if (at(a)) {
1715
+ for (const a of t) {
1716
+ if (ht(a)) {
1695
1717
  o = !0, i();
1696
1718
  const d = `motion-emoji-${e ? e.emoji++ : s++}`;
1697
- t.push(
1698
- /* @__PURE__ */ b.jsx("span", { "data-motion-emoji": !0, children: a }, d)
1719
+ n.push(
1720
+ /* @__PURE__ */ E.jsx("span", { "data-motion-emoji": !0, children: a }, d)
1699
1721
  );
1700
1722
  continue;
1701
1723
  }
1702
- n += a;
1724
+ r += a;
1703
1725
  }
1704
- return i(), o ? { nodes: t, sawEmoji: !0 } : { nodes: [r.join("")], sawEmoji: !1 };
1726
+ return i(), o ? { nodes: n, sawEmoji: !0 } : { nodes: [t.join("")], sawEmoji: !1 };
1705
1727
  }
1706
- function Zr(r) {
1707
- if (!r)
1708
- return y.None;
1709
- const e = r.trim();
1728
+ function cr(t) {
1729
+ if (!t)
1730
+ return b.None;
1731
+ const e = t.trim();
1710
1732
  if (!e)
1711
- return y.None;
1712
- const t = Xe.get(e);
1713
- if (typeof t == "number")
1714
- return t;
1733
+ return b.None;
1734
+ const n = rt.get(e);
1735
+ if (typeof n == "number")
1736
+ return n;
1715
1737
  if (typeof document > "u")
1716
- return y.None;
1717
- const n = e.split(/\s+/).filter(Boolean);
1718
- if (n.length === 0)
1719
- return y.None;
1720
- const s = n.map((u) => `.${Qr(u)}`).map(
1721
- (u) => new RegExp(`(^|[^a-zA-Z0-9_-])${en(u)}(?![a-zA-Z0-9_-])`)
1738
+ return b.None;
1739
+ const r = e.split(/\s+/).filter(Boolean);
1740
+ if (r.length === 0)
1741
+ return b.None;
1742
+ const s = r.map((c) => `.${ur(c)}`).map(
1743
+ (c) => new RegExp(`(^|[^a-zA-Z0-9_-])${lr(c)}(?![a-zA-Z0-9_-])`)
1722
1744
  );
1723
- let i = y.None, a = !1;
1724
- for (const u of Array.from(document.styleSheets)) {
1745
+ let i = b.None, a = !1;
1746
+ for (const c of Array.from(document.styleSheets)) {
1725
1747
  let d;
1726
1748
  try {
1727
- d = u.cssRules;
1749
+ d = c.cssRules;
1728
1750
  } catch {
1729
1751
  continue;
1730
1752
  }
1731
- const l = ut(d, s);
1732
- if (l.mask && (i |= l.mask, i === Oe))
1753
+ const l = mt(d, s);
1754
+ if (l.mask && (i |= l.mask, i === xe))
1733
1755
  break;
1734
1756
  a ||= l.sawStyleRule;
1735
1757
  }
1736
- return (i !== y.None || a) && Xe.set(e, i), i;
1758
+ return (i !== b.None || a) && rt.set(e, i), i;
1737
1759
  }
1738
- function ut(r, e) {
1739
- if (!r)
1740
- return { mask: y.None, sawStyleRule: !1 };
1741
- let t = y.None, n = !1;
1742
- for (let o = 0; o < r.length; o++) {
1743
- const s = r[o];
1760
+ function mt(t, e) {
1761
+ if (!t)
1762
+ return { mask: b.None, sawStyleRule: !1 };
1763
+ let n = b.None, r = !1;
1764
+ for (let o = 0; o < t.length; o++) {
1765
+ const s = t[o];
1744
1766
  if (s) {
1745
1767
  if (s.type === CSSRule.STYLE_RULE) {
1746
1768
  const a = s.selectorText ?? "";
1747
1769
  if (!a || !e.some((d) => d.test(a))) continue;
1748
- n = !0;
1749
- for (const d of _r)
1750
- d.hints.some((l) => a.includes(l)) && (t |= d.flag);
1751
- if (t === Oe)
1752
- return { mask: t, sawStyleRule: !0 };
1770
+ r = !0;
1771
+ for (const d of Kn)
1772
+ d.hints.some((l) => a.includes(l)) && (n |= d.flag);
1773
+ if (n === xe)
1774
+ return { mask: n, sawStyleRule: !0 };
1753
1775
  } else if ("cssRules" in s) {
1754
- const i = ut(s.cssRules, e);
1755
- if (i.mask && (t |= i.mask, t === Oe))
1756
- return { mask: t, sawStyleRule: !0 };
1757
- n ||= i.sawStyleRule;
1776
+ const i = mt(s.cssRules, e);
1777
+ if (i.mask && (n |= i.mask, n === xe))
1778
+ return { mask: n, sawStyleRule: !0 };
1779
+ r ||= i.sawStyleRule;
1758
1780
  }
1759
1781
  }
1760
1782
  }
1761
- return { mask: t, sawStyleRule: n };
1783
+ return { mask: n, sawStyleRule: r };
1762
1784
  }
1763
- function Qr(r) {
1764
- return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(r) : r.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1785
+ function ur(t) {
1786
+ return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(t) : t.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1765
1787
  }
1766
- function en(r) {
1767
- return r.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
1788
+ function lr(t) {
1789
+ return t.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
1768
1790
  }
1769
- const Le = "ikon_auth_session", tn = 7 * 24 * 60 * 60 * 1e3;
1770
- function lt(r) {
1791
+ const Be = "ikon_auth_session", dr = 7 * 24 * 60 * 60 * 1e3;
1792
+ function ve(t) {
1771
1793
  try {
1772
- localStorage.setItem(Le, JSON.stringify(r));
1794
+ localStorage.setItem(Be, JSON.stringify(t));
1773
1795
  } catch {
1774
1796
  console.warn("Failed to save auth session to localStorage");
1775
1797
  }
1776
1798
  }
1777
- function dt() {
1799
+ function gt() {
1778
1800
  try {
1779
- const r = localStorage.getItem(Le);
1780
- if (!r) return null;
1781
- const e = JSON.parse(r);
1782
- return Date.now() - e.authenticatedAt > tn ? (ft(), null) : e;
1801
+ const t = localStorage.getItem(Be);
1802
+ if (!t) return null;
1803
+ const e = JSON.parse(t);
1804
+ return Date.now() - e.authenticatedAt > dr ? (yt(), null) : e;
1783
1805
  } catch {
1784
1806
  return console.warn("Failed to load auth session from localStorage"), null;
1785
1807
  }
1786
1808
  }
1787
- function ft() {
1809
+ function yt() {
1788
1810
  try {
1789
- localStorage.removeItem(Le);
1811
+ localStorage.removeItem(Be);
1790
1812
  } catch {
1791
1813
  console.warn("Failed to clear auth session from localStorage");
1792
1814
  }
1793
1815
  }
1794
- function Re(r) {
1816
+ function ae(t) {
1795
1817
  return {
1796
1818
  id: "",
1797
- provider: r.provider,
1798
- token: r.token,
1799
- authenticatedAt: r.authenticatedAt
1819
+ provider: t.provider,
1820
+ token: t.token,
1821
+ authenticatedAt: t.authenticatedAt
1800
1822
  };
1801
1823
  }
1802
- async function ht(r, e) {
1803
- const t = me(), n = await fetch(`${e}/anonymous`, {
1824
+ async function St(t, e) {
1825
+ const n = ye(), r = await fetch(`${e}/anonymous`, {
1804
1826
  method: "POST",
1805
1827
  headers: { "Content-Type": "application/json" },
1806
- body: JSON.stringify({ deviceId: t, space: r })
1828
+ body: JSON.stringify({ deviceId: n, space: t })
1807
1829
  });
1808
- if (!n.ok) {
1809
- const i = await n.text().catch(() => "Unknown error");
1810
- throw new Error(`Anonymous auth failed: ${n.status} ${i}`);
1830
+ if (!r.ok) {
1831
+ const i = await r.text().catch(() => "Unknown error");
1832
+ throw new Error(`Anonymous auth failed: ${r.status} ${i}`);
1811
1833
  }
1812
- const { token: o } = await n.json(), s = {
1834
+ const { token: o } = await r.json(), s = {
1813
1835
  token: o,
1814
1836
  provider: "anonymous",
1815
1837
  authenticatedAt: Date.now()
1816
1838
  };
1817
- return lt(s), s;
1839
+ return ve(s), s;
1818
1840
  }
1819
- async function vn(r) {
1820
- const { email: e, spaceId: t, authUrl: n, returnUrl: o = window.location.origin + window.location.pathname } = r, s = await fetch(`${n}/email/send`, {
1841
+ async function Br(t) {
1842
+ const { email: e, spaceId: n, authUrl: r, returnUrl: o = window.location.origin + window.location.pathname } = t, s = await fetch(`${r}/email/send`, {
1821
1843
  method: "POST",
1822
1844
  headers: { "Content-Type": "application/json" },
1823
1845
  body: JSON.stringify({
1824
1846
  email: e.trim(),
1825
- space: t,
1847
+ space: n,
1826
1848
  return: o
1827
1849
  })
1828
1850
  });
@@ -1831,67 +1853,449 @@ async function vn(r) {
1831
1853
  throw new Error(i);
1832
1854
  }
1833
1855
  }
1834
- function rn() {
1835
- const r = new URLSearchParams(window.location.search), e = r.get("ikon_token"), t = r.get("ikon_provider");
1836
- return e && t ? { token: e, provider: t } : null;
1856
+ function fr() {
1857
+ const t = new URLSearchParams(window.location.search), e = t.get("ikon_token"), n = t.get("ikon_provider");
1858
+ return e && n ? { token: e, provider: n } : null;
1837
1859
  }
1838
- function nn() {
1860
+ function hr() {
1839
1861
  const e = new URLSearchParams(window.location.search).get("error");
1840
1862
  return e ? decodeURIComponent(e) : null;
1841
1863
  }
1842
- function rt() {
1864
+ function ct() {
1843
1865
  window.history.replaceState({}, "", window.location.pathname);
1844
1866
  }
1845
- function on(r, e, t, n) {
1846
- const o = n ?? window.location.origin + window.location.pathname + window.location.search;
1847
- return `${t}/oauth/${r}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
1867
+ function pr(t, e, n, r) {
1868
+ const o = r ?? window.location.origin + window.location.pathname + window.location.search;
1869
+ return `${n}/oauth/${t}?space=${encodeURIComponent(e)}&return=${encodeURIComponent(o)}`;
1870
+ }
1871
+ async function mr(t) {
1872
+ const e = await fetch(`${t}/passkey/registration/options`, {
1873
+ method: "POST",
1874
+ headers: { "Content-Type": "application/json" }
1875
+ });
1876
+ if (!e.ok) {
1877
+ const n = await e.text().catch(() => "Failed to get registration options");
1878
+ throw new Error(n);
1879
+ }
1880
+ return e.json();
1848
1881
  }
1849
- const Ue = nt(null);
1850
- function wn({ children: r, config: e }) {
1851
- const [t, n] = Y({
1882
+ async function gr(t, e, n) {
1883
+ const r = await fetch(`${t}/passkey/registration/verify`, {
1884
+ method: "POST",
1885
+ headers: { "Content-Type": "application/json" },
1886
+ body: JSON.stringify({ response: e, name: n })
1887
+ });
1888
+ if (!r.ok) {
1889
+ const i = await r.text().catch(() => "Registration verification failed");
1890
+ throw new Error(i);
1891
+ }
1892
+ const { token: o } = await r.json(), s = {
1893
+ token: o,
1894
+ provider: "passkey",
1895
+ authenticatedAt: Date.now()
1896
+ };
1897
+ return ve(s), s;
1898
+ }
1899
+ async function yr(t, e) {
1900
+ const n = await fetch(`${t}/passkey/authentication/options`, {
1901
+ method: "POST",
1902
+ headers: { "Content-Type": "application/json" },
1903
+ body: JSON.stringify({ email: e })
1904
+ });
1905
+ if (!n.ok) {
1906
+ const r = await n.text().catch(() => "Failed to get authentication options");
1907
+ throw new Error(r);
1908
+ }
1909
+ return n.json();
1910
+ }
1911
+ async function Sr(t, e) {
1912
+ const n = await fetch(`${t}/passkey/authentication/verify`, {
1913
+ method: "POST",
1914
+ headers: { "Content-Type": "application/json" },
1915
+ body: JSON.stringify({ response: e })
1916
+ });
1917
+ if (!n.ok) {
1918
+ const s = await n.text().catch(() => "Authentication verification failed");
1919
+ throw new Error(s);
1920
+ }
1921
+ const { token: r } = await n.json(), o = {
1922
+ token: r,
1923
+ provider: "passkey",
1924
+ authenticatedAt: Date.now()
1925
+ };
1926
+ return ve(o), o;
1927
+ }
1928
+ function $(t) {
1929
+ const e = new Uint8Array(t);
1930
+ let n = "";
1931
+ for (const o of e)
1932
+ n += String.fromCharCode(o);
1933
+ return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
1934
+ }
1935
+ function we(t) {
1936
+ 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);
1937
+ for (let a = 0; a < o.length; a++)
1938
+ i[a] = o.charCodeAt(a);
1939
+ return s;
1940
+ }
1941
+ function Ve() {
1942
+ return br.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
1943
+ }
1944
+ const br = {
1945
+ stubThis: (t) => t
1946
+ };
1947
+ function bt(t) {
1948
+ const { id: e } = t;
1949
+ return {
1950
+ ...t,
1951
+ id: we(e),
1952
+ /**
1953
+ * `descriptor.transports` is an array of our `AuthenticatorTransportFuture` that includes newer
1954
+ * transports that TypeScript's DOM lib is ignorant of. Convince TS that our list of transports
1955
+ * are fine to pass to WebAuthn since browsers will recognize the new value.
1956
+ */
1957
+ transports: t.transports
1958
+ };
1959
+ }
1960
+ function wt(t) {
1961
+ return (
1962
+ // Consider localhost valid as well since it's okay wrt Secure Contexts
1963
+ t === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)
1964
+ );
1965
+ }
1966
+ class C extends Error {
1967
+ constructor({ message: e, code: n, cause: r, name: o }) {
1968
+ super(e, { cause: r }), Object.defineProperty(this, "code", {
1969
+ enumerable: !0,
1970
+ configurable: !0,
1971
+ writable: !0,
1972
+ value: void 0
1973
+ }), this.name = o ?? r.name, this.code = n;
1974
+ }
1975
+ }
1976
+ function wr({ error: t, options: e }) {
1977
+ const { publicKey: n } = e;
1978
+ if (!n)
1979
+ throw Error("options was missing required publicKey property");
1980
+ if (t.name === "AbortError") {
1981
+ if (e.signal instanceof AbortSignal)
1982
+ return new C({
1983
+ message: "Registration ceremony was sent an abort signal",
1984
+ code: "ERROR_CEREMONY_ABORTED",
1985
+ cause: t
1986
+ });
1987
+ } else if (t.name === "ConstraintError") {
1988
+ if (n.authenticatorSelection?.requireResidentKey === !0)
1989
+ return new C({
1990
+ message: "Discoverable credentials were required but no available authenticator supported it",
1991
+ code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
1992
+ cause: t
1993
+ });
1994
+ if (
1995
+ // @ts-ignore: `mediation` doesn't yet exist on CredentialCreationOptions but it's possible as of Sept 2024
1996
+ e.mediation === "conditional" && n.authenticatorSelection?.userVerification === "required"
1997
+ )
1998
+ return new C({
1999
+ message: "User verification was required during automatic registration but it could not be performed",
2000
+ code: "ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",
2001
+ cause: t
2002
+ });
2003
+ if (n.authenticatorSelection?.userVerification === "required")
2004
+ return new C({
2005
+ message: "User verification was required but no available authenticator supported it",
2006
+ code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
2007
+ cause: t
2008
+ });
2009
+ } else {
2010
+ if (t.name === "InvalidStateError")
2011
+ return new C({
2012
+ message: "The authenticator was previously registered",
2013
+ code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
2014
+ cause: t
2015
+ });
2016
+ if (t.name === "NotAllowedError")
2017
+ return new C({
2018
+ message: t.message,
2019
+ code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
2020
+ cause: t
2021
+ });
2022
+ if (t.name === "NotSupportedError")
2023
+ return n.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new C({
2024
+ message: 'No entry in pubKeyCredParams was of type "public-key"',
2025
+ code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
2026
+ cause: t
2027
+ }) : new C({
2028
+ message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
2029
+ code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
2030
+ cause: t
2031
+ });
2032
+ if (t.name === "SecurityError") {
2033
+ const r = globalThis.location.hostname;
2034
+ if (wt(r)) {
2035
+ if (n.rp.id !== r)
2036
+ return new C({
2037
+ message: `The RP ID "${n.rp.id}" is invalid for this domain`,
2038
+ code: "ERROR_INVALID_RP_ID",
2039
+ cause: t
2040
+ });
2041
+ } else return new C({
2042
+ message: `${globalThis.location.hostname} is an invalid domain`,
2043
+ code: "ERROR_INVALID_DOMAIN",
2044
+ cause: t
2045
+ });
2046
+ } else if (t.name === "TypeError") {
2047
+ if (n.user.id.byteLength < 1 || n.user.id.byteLength > 64)
2048
+ return new C({
2049
+ message: "User ID was not between 1 and 64 characters",
2050
+ code: "ERROR_INVALID_USER_ID_LENGTH",
2051
+ cause: t
2052
+ });
2053
+ } else if (t.name === "UnknownError")
2054
+ return new C({
2055
+ message: "The authenticator was unable to process the specified options, or could not create a new credential",
2056
+ code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
2057
+ cause: t
2058
+ });
2059
+ }
2060
+ return t;
2061
+ }
2062
+ class Er {
2063
+ constructor() {
2064
+ Object.defineProperty(this, "controller", {
2065
+ enumerable: !0,
2066
+ configurable: !0,
2067
+ writable: !0,
2068
+ value: void 0
2069
+ });
2070
+ }
2071
+ createNewAbortSignal() {
2072
+ if (this.controller) {
2073
+ const n = new Error("Cancelling existing WebAuthn API call for new one");
2074
+ n.name = "AbortError", this.controller.abort(n);
2075
+ }
2076
+ const e = new AbortController();
2077
+ return this.controller = e, e.signal;
2078
+ }
2079
+ cancelCeremony() {
2080
+ if (this.controller) {
2081
+ const e = new Error("Manually cancelling existing WebAuthn API call");
2082
+ e.name = "AbortError", this.controller.abort(e), this.controller = void 0;
2083
+ }
2084
+ }
2085
+ }
2086
+ const Et = new Er(), Rr = ["cross-platform", "platform"];
2087
+ function Rt(t) {
2088
+ if (t && !(Rr.indexOf(t) < 0))
2089
+ return t;
2090
+ }
2091
+ async function vr(t) {
2092
+ !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 });
2093
+ const { optionsJSON: e, useAutoRegister: n = !1 } = t;
2094
+ if (!Ve())
2095
+ throw new Error("WebAuthn is not supported in this browser");
2096
+ const r = {
2097
+ ...e,
2098
+ challenge: we(e.challenge),
2099
+ user: {
2100
+ ...e.user,
2101
+ id: we(e.user.id)
2102
+ },
2103
+ excludeCredentials: e.excludeCredentials?.map(bt)
2104
+ }, o = {};
2105
+ n && (o.mediation = "conditional"), o.publicKey = r, o.signal = Et.createNewAbortSignal();
2106
+ let s;
2107
+ try {
2108
+ s = await navigator.credentials.create(o);
2109
+ } catch (S) {
2110
+ throw wr({ error: S, options: o });
2111
+ }
2112
+ if (!s)
2113
+ throw new Error("Registration was not completed");
2114
+ const { id: i, rawId: a, response: c, type: d } = s;
2115
+ let l;
2116
+ typeof c.getTransports == "function" && (l = c.getTransports());
2117
+ let h;
2118
+ if (typeof c.getPublicKeyAlgorithm == "function")
2119
+ try {
2120
+ h = c.getPublicKeyAlgorithm();
2121
+ } catch (S) {
2122
+ Ne("getPublicKeyAlgorithm()", S);
2123
+ }
2124
+ let f;
2125
+ if (typeof c.getPublicKey == "function")
2126
+ try {
2127
+ const S = c.getPublicKey();
2128
+ S !== null && (f = $(S));
2129
+ } catch (S) {
2130
+ Ne("getPublicKey()", S);
2131
+ }
2132
+ let g;
2133
+ if (typeof c.getAuthenticatorData == "function")
2134
+ try {
2135
+ g = $(c.getAuthenticatorData());
2136
+ } catch (S) {
2137
+ Ne("getAuthenticatorData()", S);
2138
+ }
2139
+ return {
2140
+ id: i,
2141
+ rawId: $(a),
2142
+ response: {
2143
+ attestationObject: $(c.attestationObject),
2144
+ clientDataJSON: $(c.clientDataJSON),
2145
+ transports: l,
2146
+ publicKeyAlgorithm: h,
2147
+ publicKey: f,
2148
+ authenticatorData: g
2149
+ },
2150
+ type: d,
2151
+ clientExtensionResults: s.getClientExtensionResults(),
2152
+ authenticatorAttachment: Rt(s.authenticatorAttachment)
2153
+ };
2154
+ }
2155
+ function Ne(t, e) {
2156
+ console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
2157
+ `, e);
2158
+ }
2159
+ function Ar() {
2160
+ if (!Ve())
2161
+ return Oe.stubThis(new Promise((e) => e(!1)));
2162
+ const t = globalThis.PublicKeyCredential;
2163
+ return t?.isConditionalMediationAvailable === void 0 ? Oe.stubThis(new Promise((e) => e(!1))) : Oe.stubThis(t.isConditionalMediationAvailable());
2164
+ }
2165
+ const Oe = {
2166
+ stubThis: (t) => t
2167
+ };
2168
+ function kr({ error: t, options: e }) {
2169
+ const { publicKey: n } = e;
2170
+ if (!n)
2171
+ throw Error("options was missing required publicKey property");
2172
+ if (t.name === "AbortError") {
2173
+ if (e.signal instanceof AbortSignal)
2174
+ return new C({
2175
+ message: "Authentication ceremony was sent an abort signal",
2176
+ code: "ERROR_CEREMONY_ABORTED",
2177
+ cause: t
2178
+ });
2179
+ } else {
2180
+ if (t.name === "NotAllowedError")
2181
+ return new C({
2182
+ message: t.message,
2183
+ code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
2184
+ cause: t
2185
+ });
2186
+ if (t.name === "SecurityError") {
2187
+ const r = globalThis.location.hostname;
2188
+ if (wt(r)) {
2189
+ if (n.rpId !== r)
2190
+ return new C({
2191
+ message: `The RP ID "${n.rpId}" is invalid for this domain`,
2192
+ code: "ERROR_INVALID_RP_ID",
2193
+ cause: t
2194
+ });
2195
+ } else return new C({
2196
+ message: `${globalThis.location.hostname} is an invalid domain`,
2197
+ code: "ERROR_INVALID_DOMAIN",
2198
+ cause: t
2199
+ });
2200
+ } else if (t.name === "UnknownError")
2201
+ return new C({
2202
+ message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
2203
+ code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
2204
+ cause: t
2205
+ });
2206
+ }
2207
+ return t;
2208
+ }
2209
+ async function Tr(t) {
2210
+ !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 });
2211
+ const { optionsJSON: e, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = t;
2212
+ if (!Ve())
2213
+ throw new Error("WebAuthn is not supported in this browser");
2214
+ let o;
2215
+ e.allowCredentials?.length !== 0 && (o = e.allowCredentials?.map(bt));
2216
+ const s = {
2217
+ ...e,
2218
+ challenge: we(e.challenge),
2219
+ allowCredentials: o
2220
+ }, i = {};
2221
+ if (n) {
2222
+ if (!await Ar())
2223
+ throw Error("Browser does not support WebAuthn autofill");
2224
+ if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
2225
+ throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
2226
+ i.mediation = "conditional", s.allowCredentials = [];
2227
+ }
2228
+ i.publicKey = s, i.signal = Et.createNewAbortSignal();
2229
+ let a;
2230
+ try {
2231
+ a = await navigator.credentials.get(i);
2232
+ } catch (g) {
2233
+ throw kr({ error: g, options: i });
2234
+ }
2235
+ if (!a)
2236
+ throw new Error("Authentication was not completed");
2237
+ const { id: c, rawId: d, response: l, type: h } = a;
2238
+ let f;
2239
+ return l.userHandle && (f = $(l.userHandle)), {
2240
+ id: c,
2241
+ rawId: $(d),
2242
+ response: {
2243
+ authenticatorData: $(l.authenticatorData),
2244
+ clientDataJSON: $(l.clientDataJSON),
2245
+ signature: $(l.signature),
2246
+ userHandle: f
2247
+ },
2248
+ type: h,
2249
+ clientExtensionResults: a.getClientExtensionResults(),
2250
+ authenticatorAttachment: Rt(a.authenticatorAttachment)
2251
+ };
2252
+ }
2253
+ const Ke = ut(null);
2254
+ function Vr({ children: t, config: e }) {
2255
+ const [n, r] = Y({
1852
2256
  isAuthenticated: !1,
1853
2257
  isLoading: !0,
1854
2258
  user: null,
1855
2259
  error: null
1856
2260
  });
1857
- $(() => {
2261
+ B(() => {
1858
2262
  (() => {
1859
- const d = nn();
1860
- if (d) {
1861
- rt(), n({
2263
+ const l = hr();
2264
+ if (l) {
2265
+ ct(), r({
1862
2266
  isAuthenticated: !1,
1863
2267
  isLoading: !1,
1864
2268
  user: null,
1865
- error: d
2269
+ error: l
1866
2270
  });
1867
2271
  return;
1868
2272
  }
1869
- const l = rn();
1870
- if (l) {
1871
- const p = {
1872
- token: l.token,
1873
- provider: l.provider,
2273
+ const h = fr();
2274
+ if (h) {
2275
+ const g = {
2276
+ token: h.token,
2277
+ provider: h.provider,
1874
2278
  authenticatedAt: Date.now()
1875
2279
  };
1876
- lt(p), rt(), n({
2280
+ ve(g), ct(), r({
1877
2281
  isAuthenticated: !0,
1878
2282
  isLoading: !1,
1879
- user: Re(p),
2283
+ user: ae(g),
1880
2284
  error: null
1881
2285
  });
1882
2286
  return;
1883
2287
  }
1884
- const f = dt();
2288
+ const f = gt();
1885
2289
  if (f) {
1886
- n({
2290
+ r({
1887
2291
  isAuthenticated: !0,
1888
2292
  isLoading: !1,
1889
- user: Re(f),
2293
+ user: ae(f),
1890
2294
  error: null
1891
2295
  });
1892
2296
  return;
1893
2297
  }
1894
- n({
2298
+ r({
1895
2299
  isAuthenticated: !1,
1896
2300
  isLoading: !1,
1897
2301
  user: null,
@@ -1899,332 +2303,376 @@ function wn({ children: r, config: e }) {
1899
2303
  });
1900
2304
  })();
1901
2305
  }, []);
1902
- const o = z(
1903
- async (u) => {
2306
+ const o = F(
2307
+ async (d) => {
1904
2308
  if (!e.spaceId) {
1905
- n((f) => ({
2309
+ r((f) => ({
1906
2310
  ...f,
1907
2311
  error: "Space ID is not configured"
1908
2312
  }));
1909
2313
  return;
1910
2314
  }
1911
- if (u === "guest") {
1912
- n((f) => ({ ...f, isLoading: !0 }));
2315
+ const l = e.authUrl ?? _e();
2316
+ if (d === "guest") {
2317
+ r((f) => ({ ...f, isLoading: !0 }));
1913
2318
  try {
1914
- const f = e.authUrl ?? Ne(), p = await ht(e.spaceId, f);
1915
- n({
2319
+ const f = await St(e.spaceId, l);
2320
+ r({
1916
2321
  isAuthenticated: !0,
1917
2322
  isLoading: !1,
1918
- user: Re(p),
2323
+ user: ae(f),
1919
2324
  error: null
1920
2325
  });
1921
2326
  } catch (f) {
1922
- n((p) => ({
1923
- ...p,
2327
+ r((g) => ({
2328
+ ...g,
1924
2329
  isLoading: !1,
1925
2330
  error: f instanceof Error ? f.message : "Guest login failed"
1926
2331
  }));
1927
2332
  }
1928
2333
  return;
1929
2334
  }
1930
- const d = e.authUrl ?? Ne(), l = on(u, e.spaceId, d);
1931
- window.location.href = l;
2335
+ if (d === "passkey") {
2336
+ r((f) => ({ ...f, isLoading: !0, error: null }));
2337
+ try {
2338
+ const f = await yr(l), g = await Tr({ optionsJSON: f }), S = await Sr(l, g);
2339
+ r({
2340
+ isAuthenticated: !0,
2341
+ isLoading: !1,
2342
+ user: ae(S),
2343
+ error: null
2344
+ });
2345
+ } catch (f) {
2346
+ r((g) => ({
2347
+ ...g,
2348
+ isLoading: !1,
2349
+ error: f instanceof Error ? f.message : "Passkey login failed"
2350
+ }));
2351
+ }
2352
+ return;
2353
+ }
2354
+ const h = pr(d, e.spaceId, l);
2355
+ window.location.href = h;
1932
2356
  },
1933
2357
  [e.authUrl, e.spaceId]
1934
- ), s = z(() => {
1935
- ft(), n({
2358
+ ), s = F(() => {
2359
+ yt(), r({
1936
2360
  isAuthenticated: !1,
1937
2361
  isLoading: !1,
1938
2362
  user: null,
1939
2363
  error: null
1940
2364
  });
1941
- }, []), i = z(() => t.user?.token ?? null, [t.user]), a = L(
2365
+ }, []), i = F(
2366
+ async (d) => {
2367
+ const l = e.authUrl ?? _e();
2368
+ r((h) => ({ ...h, isLoading: !0, error: null }));
2369
+ try {
2370
+ const h = await mr(l), f = await vr({ optionsJSON: h }), g = await gr(l, f, d);
2371
+ r({
2372
+ isAuthenticated: !0,
2373
+ isLoading: !1,
2374
+ user: ae(g),
2375
+ error: null
2376
+ });
2377
+ } catch (h) {
2378
+ r((f) => ({
2379
+ ...f,
2380
+ isLoading: !1,
2381
+ error: h instanceof Error ? h.message : "Passkey registration failed"
2382
+ }));
2383
+ }
2384
+ },
2385
+ [e.authUrl]
2386
+ ), a = F(() => n.user?.token ?? null, [n.user]), c = U(
1942
2387
  () => ({
1943
- state: t,
2388
+ state: n,
1944
2389
  login: o,
1945
2390
  logout: s,
1946
- getToken: i
2391
+ getToken: a,
2392
+ registerPasskey: i
1947
2393
  }),
1948
- [t, o, s, i]
2394
+ [n, o, s, a, i]
1949
2395
  );
1950
- return /* @__PURE__ */ b.jsx(Ue, { value: a, children: r });
2396
+ return /* @__PURE__ */ E.jsx(Ke, { value: c, children: t });
1951
2397
  }
1952
- function sn() {
1953
- const r = Me(Ue);
1954
- if (!r)
2398
+ function Ir() {
2399
+ const t = Fe(Ke);
2400
+ if (!t)
1955
2401
  throw new Error("useAuth must be used within an AuthProvider");
1956
- return r;
2402
+ return t;
1957
2403
  }
1958
- function En() {
1959
- return Me(Ue);
2404
+ function Kr() {
2405
+ return Fe(Ke);
1960
2406
  }
1961
- function kn(r) {
1962
- const { config: e, guestUrlParam: t } = r, { state: n, login: o } = sn(), s = E(!1);
1963
- return $(() => {
1964
- if (!t || n.isAuthenticated || n.isLoading || s.current || !e.methods.includes("guest"))
2407
+ function zr(t) {
2408
+ const { config: e, guestUrlParam: n } = t, { state: r, login: o } = Ir(), s = A(!1);
2409
+ return B(() => {
2410
+ if (!n || r.isAuthenticated || r.isLoading || s.current || !e.methods.includes("guest"))
1965
2411
  return;
1966
- const i = new URLSearchParams(window.location.search), a = i.get(t);
2412
+ const i = new URLSearchParams(window.location.search), a = i.get(n);
1967
2413
  if (a === "true" || a === "1" || a === "") {
1968
- i.delete(t);
1969
- const u = i.toString(), d = window.location.pathname + (u ? `?${u}` : "");
2414
+ i.delete(n);
2415
+ const c = i.toString(), d = window.location.pathname + (c ? `?${c}` : "");
1970
2416
  window.history.replaceState({}, "", d), s.current = !0, o("guest");
1971
2417
  }
1972
- }, [t, n.isAuthenticated, n.isLoading, e.methods, o]), {
1973
- shouldRenderChildren: n.isAuthenticated,
1974
- isCheckingAuth: n.isLoading,
1975
- isAuthenticated: n.isAuthenticated,
1976
- error: n.error
2418
+ }, [n, r.isAuthenticated, r.isLoading, e.methods, o]), {
2419
+ shouldRenderChildren: r.isAuthenticated,
2420
+ isCheckingAuth: r.isLoading,
2421
+ isAuthenticated: r.isAuthenticated,
2422
+ error: r.error
1977
2423
  };
1978
2424
  }
1979
- function Rn({
1980
- connectionState: r,
2425
+ function Wr({
2426
+ connectionState: t,
1981
2427
  error: e,
1982
- isReady: t,
1983
- stores: n,
2428
+ isReady: n,
2429
+ stores: r,
1984
2430
  registry: o,
1985
2431
  client: s,
1986
2432
  onAction: i,
1987
2433
  renderIdle: a,
1988
- renderConnecting: u,
2434
+ renderConnecting: c,
1989
2435
  renderConnectingSlow: d,
1990
2436
  renderConnected: l,
1991
- renderOffline: f,
1992
- renderError: p
2437
+ renderOffline: h,
2438
+ renderError: f
1993
2439
  }) {
1994
- switch (r) {
2440
+ switch (t) {
1995
2441
  case "idle":
1996
2442
  return a();
1997
2443
  case "connecting":
1998
- return u();
2444
+ return c();
1999
2445
  case "connectingSlow":
2000
2446
  return d();
2001
2447
  case "connected":
2002
2448
  case "reconnecting":
2003
- return !t || !n || !o ? null : l({
2004
- stores: n,
2449
+ return !n || !r || !o ? null : l({
2450
+ stores: r,
2005
2451
  registry: o,
2006
2452
  client: s,
2007
2453
  onAction: i,
2008
- isReconnecting: r === "reconnecting"
2454
+ isReconnecting: t === "reconnecting"
2009
2455
  });
2010
2456
  case "offline":
2011
- return f();
2457
+ return h();
2012
2458
  case "offlineError":
2013
- return p(e ?? s?.lastError?.message ?? null);
2459
+ return f(e ?? s?.lastError?.message ?? null);
2014
2460
  default:
2015
2461
  return null;
2016
2462
  }
2017
2463
  }
2018
- const Ae = ye("useIkonApp");
2019
- function An(r) {
2020
- const { authConfig: e, localServer: t, modules: n, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: u = !0, timeouts: d, audio: l, video: f, mediaSession: p, debug: k } = r, C = E(null), v = E(null), m = E(null), g = E(!1), w = E(l), P = E(f), T = E(p), x = E(k), D = E(d), ae = E(i), H = E(a), ce = E(s), ue = E(u);
2021
- w.current = l, P.current = f, T.current = p, x.current = k, D.current = d, ae.current = i, H.current = a, ce.current = s, ue.current = u;
2022
- const [q, le] = Y("idle"), [be, J] = Y(null), [X, de] = Y(null), [B, fe] = Y(null), [Z, c] = Y(!1), h = L(() => {
2464
+ const Pe = Ee("useIkonApp");
2465
+ function qr(t) {
2466
+ const { authConfig: e, localServer: n, modules: r, registerModules: o, onJoined: s, onConnectionStateChange: i, onError: a, updateUrlOnJoin: c = !0, timeouts: d, audio: l, video: h, mediaSession: f, debug: g } = t, S = A(null), R = A(null), m = A(null), y = A(!1), v = A(l), j = A(h), O = A(f), D = A(g), W = A(d), le = A(i), Z = A(a), de = A(s), fe = A(c);
2467
+ v.current = l, j.current = h, O.current = f, D.current = g, W.current = d, le.current = i, Z.current = a, de.current = s, fe.current = c;
2468
+ const [q, he] = Y("idle"), [Ae, G] = Y(null), [Q, pe] = Y(null), [K, me] = Y(null), [ee, u] = Y(!1), p = U(() => {
2023
2469
  try {
2024
- return bt();
2470
+ return Ct();
2025
2471
  } catch {
2026
2472
  return { parameters: {} };
2027
2473
  }
2028
- }, []), S = L(() => e?.enabled ? dt() : null, [e?.enabled]), R = t?.enabled ?? !1, M = t?.host ?? "localhost", j = t?.httpsPort ?? 8443;
2029
- $(() => {
2030
- !R && xe() && e && !e.enabled && e.spaceId && !B && !Z && (c(!0), ht(e.spaceId, e.authUrl ?? Ne()).then((I) => {
2031
- fe(I.token);
2032
- }).catch((I) => {
2033
- Ae.error("Anonymous auth failed:", I), J(I instanceof Error ? I.message : "Anonymous auth failed");
2474
+ }, []), w = U(() => e?.enabled ? gt() : null, [e?.enabled]), k = n?.enabled ?? !1, L = n?.host ?? "localhost", P = n?.httpsPort ?? 8443;
2475
+ B(() => {
2476
+ !k && ze() && e && !e.enabled && e.spaceId && !K && !ee && (u(!0), St(e.spaceId, e.authUrl ?? _e()).then((N) => {
2477
+ me(N.token);
2478
+ }).catch((N) => {
2479
+ Pe.error("Anonymous auth failed:", N), G(N instanceof Error ? N.message : "Anonymous auth failed");
2034
2480
  }).finally(() => {
2035
- c(!1);
2481
+ u(!1);
2036
2482
  }));
2037
- }, [R, e, B, Z]);
2038
- const W = L(() => {
2039
- if (R) {
2040
- const N = S?.token ? vt(S.token) ?? me() : me();
2483
+ }, [k, e, K, ee]);
2484
+ const J = U(() => {
2485
+ if (k) {
2486
+ const I = w?.token ? Nt(w.token) ?? ye() : ye();
2041
2487
  return {
2042
2488
  local: {
2043
- host: M,
2044
- httpsPort: j,
2045
- userId: N
2489
+ host: L,
2490
+ httpsPort: P,
2491
+ userId: I,
2492
+ parameters: p.parameters
2046
2493
  }
2047
2494
  };
2048
2495
  }
2049
- return S?.token && e?.spaceId ? {
2496
+ return w?.token && e?.spaceId ? {
2050
2497
  sessionToken: {
2051
- token: S.token,
2498
+ token: w.token,
2052
2499
  spaceId: e.spaceId,
2053
- backendType: $e(),
2054
- sessionId: h.sessionId,
2055
- channelKey: h.channelKey,
2056
- parameters: h.parameters
2500
+ backendType: We(),
2501
+ sessionId: p.sessionId,
2502
+ channelKey: p.channelKey,
2503
+ parameters: p.parameters
2057
2504
  }
2058
- } : B && e?.spaceId ? {
2505
+ } : K && e?.spaceId ? {
2059
2506
  sessionToken: {
2060
- token: B,
2507
+ token: K,
2061
2508
  spaceId: e.spaceId,
2062
- backendType: $e(),
2063
- sessionId: h.sessionId,
2064
- channelKey: h.channelKey,
2065
- parameters: h.parameters
2509
+ backendType: We(),
2510
+ sessionId: p.sessionId,
2511
+ channelKey: p.channelKey,
2512
+ parameters: p.parameters
2066
2513
  }
2067
- } : xe() ? null : {
2514
+ } : ze() ? null : {
2068
2515
  local: {
2069
- host: M,
2070
- httpsPort: j,
2071
- userId: me()
2516
+ host: L,
2517
+ httpsPort: P,
2518
+ userId: ye(),
2519
+ parameters: p.parameters
2072
2520
  }
2073
2521
  };
2074
- }, [R, M, j, S?.token, e?.spaceId, B, h.sessionId, h.channelKey, h.parameters]);
2075
- fr(X);
2076
- const Q = mr(X);
2077
- $(() => {
2078
- if (!g.current) {
2079
- if (g.current = !0, m.current = or(), n)
2080
- for (const N of n)
2081
- N(m.current);
2082
- o?.(m.current), m.current.loadRegisteredModules().catch((N) => {
2083
- Ae.error("Failed to load UI modules", N);
2522
+ }, [k, L, P, w?.token, e?.spaceId, K, p.sessionId, p.channelKey, p.parameters]);
2523
+ Rn(Q);
2524
+ const te = An(Q);
2525
+ B(() => {
2526
+ if (!y.current) {
2527
+ if (y.current = !0, m.current = pn(), r)
2528
+ for (const I of r)
2529
+ I(m.current);
2530
+ o?.(m.current), m.current.loadRegisteredModules().catch((I) => {
2531
+ Pe.error("Failed to load UI modules", I);
2084
2532
  });
2085
2533
  }
2086
- }, []), $(() => {
2087
- if (!W) return;
2088
- const N = new wt({
2089
- ...W,
2090
- debug: x.current,
2091
- timeouts: D.current,
2092
- audio: w.current,
2093
- video: P.current,
2094
- mediaSession: T.current,
2095
- onConnectionStateChange: (_) => {
2096
- le(_), ae.current?.(_);
2534
+ }, []), B(() => {
2535
+ if (!J) return;
2536
+ const I = new Ot({
2537
+ ...J,
2538
+ debug: D.current,
2539
+ timeouts: W.current,
2540
+ audio: v.current,
2541
+ video: j.current,
2542
+ mediaSession: O.current,
2543
+ onConnectionStateChange: (M) => {
2544
+ he(M), le.current?.(M);
2097
2545
  },
2098
- onError: (_) => {
2099
- J(_.message), H.current?.(_);
2546
+ onError: (M) => {
2547
+ G(M.message), Z.current?.(M);
2100
2548
  },
2101
2549
  onJoined: () => {
2102
- const _ = N.globalState?.SessionId;
2103
- ue.current && _ && window.history.replaceState(null, "", `/s/${_}${window.location.search}`), ce.current?.(_);
2550
+ const M = I.globalState?.SessionId;
2551
+ fe.current && M && window.history.replaceState(null, "", `/s/${M}${window.location.search}`), de.current?.(M);
2104
2552
  }
2105
2553
  });
2106
- C.current = N;
2107
- const I = new xt({ client: N });
2108
- return v.current = I, de(I), N.connect().catch((_) => {
2109
- Ae.error("Connection failed:", _);
2554
+ S.current = I;
2555
+ const N = new qt({ client: I });
2556
+ return R.current = N, pe(N), I.connect().catch((M) => {
2557
+ Pe.error("Connection failed:", M);
2110
2558
  }), () => {
2111
- N.disconnect(), C.current = null, I.dispose(), v.current = null;
2559
+ I.disconnect(), S.current = null, N.dispose(), R.current = null;
2112
2560
  };
2113
- }, [W]);
2114
- const A = z((N, I) => {
2115
- const _ = typeof I == "string" ? I : JSON.stringify(I ?? {});
2116
- C.current?.sendActionCall(N, _);
2117
- }, []), V = q === "connected" || q === "reconnecting";
2561
+ }, [J]);
2562
+ const T = F((I, N) => {
2563
+ const M = typeof N == "string" ? N : JSON.stringify(N ?? {});
2564
+ S.current?.sendActionCall(I, M);
2565
+ }, []), z = q === "connected" || q === "reconnecting";
2118
2566
  return {
2119
2567
  connectionState: q,
2120
- error: be,
2121
- stores: Q,
2122
- client: C.current,
2568
+ error: Ae,
2569
+ stores: te,
2570
+ client: S.current,
2123
2571
  registry: m.current,
2124
- clientRef: C,
2125
- uiRef: v,
2572
+ clientRef: S,
2573
+ uiRef: R,
2126
2574
  registryRef: m,
2127
- onAction: A,
2128
- isReady: V
2575
+ onAction: T,
2576
+ isReady: z
2129
2577
  };
2130
2578
  }
2131
- function Nn(r) {
2132
- const e = E(!1);
2133
- return z(() => {
2579
+ function Jr(t) {
2580
+ const e = A(!1);
2581
+ return F(() => {
2134
2582
  if (e.current) return;
2135
2583
  e.current = !0;
2136
- const t = document.createElement("link");
2137
- t.rel = "stylesheet", t.href = r, document.head.appendChild(t);
2138
- }, [r]);
2584
+ const n = document.createElement("link");
2585
+ n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
2586
+ }, [t]);
2139
2587
  }
2140
- const mt = nt(null);
2141
- function an(r, e) {
2142
- return e ? r.replace(/\{(\w+)\}/g, (t, n) => e[n] ?? `{${n}}`) : r;
2588
+ const vt = ut(null);
2589
+ function Cr(t, e) {
2590
+ return e ? t.replace(/\{(\w+)\}/g, (n, r) => e[r] ?? `{${r}}`) : t;
2143
2591
  }
2144
- function cn(r, e) {
2145
- const n = new URLSearchParams(window.location.search).get("lang");
2146
- if (n && r.includes(n))
2147
- return n;
2592
+ function Nr(t, e) {
2593
+ const r = new URLSearchParams(window.location.search).get("lang");
2594
+ if (r && t.includes(r))
2595
+ return r;
2148
2596
  const o = navigator.language.split("-")[0];
2149
- return r.includes(o) ? o : e && r.includes(e) ? e : "en";
2597
+ return t.includes(o) ? o : e && t.includes(e) ? e : "en";
2150
2598
  }
2151
- function un(r, e, t) {
2152
- return e ? cn(r, t) : t && r.includes(t) ? t : "en";
2599
+ function Or(t, e, n) {
2600
+ return e ? Nr(t, n) : n && t.includes(n) ? n : "en";
2153
2601
  }
2154
- function Cn({
2155
- children: r,
2602
+ function Yr({
2603
+ children: t,
2156
2604
  translations: e,
2157
- defaultLanguage: t,
2158
- detectLanguage: n = !1
2605
+ defaultLanguage: n,
2606
+ detectLanguage: r = !1
2159
2607
  }) {
2160
- const o = Object.keys(e), s = un(o, n, t), i = e[s] ?? e.en, a = L(
2608
+ const o = Object.keys(e), s = Or(o, r, n), i = e[s] ?? e.en, a = U(
2161
2609
  () => ({
2162
- t: (u, d) => {
2163
- const l = i[u];
2164
- return an(l, d);
2610
+ t: (c, d) => {
2611
+ const l = i[c];
2612
+ return Cr(l, d);
2165
2613
  },
2166
2614
  locale: s,
2167
2615
  translations: i
2168
2616
  }),
2169
2617
  [i, s]
2170
2618
  );
2171
- return /* @__PURE__ */ b.jsx(mt, { value: a, children: r });
2619
+ return /* @__PURE__ */ E.jsx(vt, { value: a, children: t });
2172
2620
  }
2173
- function In() {
2174
- const r = Me(mt);
2175
- if (!r)
2621
+ function Gr() {
2622
+ const t = Fe(vt);
2623
+ if (!t)
2176
2624
  throw new Error("useI18n must be used within an I18nProvider");
2177
- return r;
2625
+ return t;
2178
2626
  }
2179
2627
  export {
2180
- wn as AuthProvider,
2181
- Rn as ConnectionStateRenderer,
2182
- Cn as I18nProvider,
2183
- Yt as IKON_UI_BASE_MODULE,
2184
- er as IKON_UI_MEDIA_MODULE,
2185
- Ie as IKON_UI_STREAM_CATEGORY,
2186
- Gt as IKON_UI_VIDEO_CANVAS_TYPE,
2187
- Ht as IKON_UI_VIDEO_URL_PLAYER_TYPE,
2188
- xt as IkonUi,
2189
- nr as IkonUiRegistry,
2190
- pn as IkonUiSurface,
2191
- Lt as UiComponentRegistry,
2192
- Mt as UiRenderer,
2193
- On as UiStreamStore,
2194
- gn as areIkonUiModuleListsEqual,
2195
- ht as authenticateAnonymous,
2196
- on as buildOAuthRedirectUrl,
2197
- ft as clearAuthSession,
2198
- rt as clearOAuthParams,
2199
- Wt as createBaseResolvers,
2200
- hn as createComponentLibrary,
2201
- or as createIkonUiRegistry,
2202
- Zt as createMediaResolvers,
2203
- Ut as isIkonUiCategoryMatch,
2204
- dt as loadAuthSession,
2205
- Jt as loadBaseModule,
2206
- tr as loadMediaModule,
2207
- Or as normalizeIkonUiModuleList,
2208
- Sn as parseIkonUiInitPayload,
2209
- rn as parseOAuthCallback,
2210
- nn as parseOAuthError,
2211
- Pr as readIkonUiModules,
2212
- yn as readIkonUiModulesFromSources,
2213
- Kt as registerBaseModule,
2214
- rr as registerMediaModule,
2215
- Pt as renderChildren,
2216
- bn as renderMotionLetters,
2217
- lt as saveAuthSession,
2218
- vn as sendMagicLink,
2219
- Re as sessionToUser,
2220
- sn as useAuth,
2221
- kn as useAuthGuard,
2222
- En as useAuthOptional,
2223
- In as useI18n,
2224
- An as useIkonApp,
2225
- fr as useIkonStyles,
2226
- mr as useIkonUiStores,
2227
- Nn as useLazyFont,
2228
- F as useUiNode,
2229
- mn as useUiStore
2628
+ Vr as AuthProvider,
2629
+ Wr as ConnectionStateRenderer,
2630
+ Yr as I18nProvider,
2631
+ tn as IKON_UI_BASE_MODULE,
2632
+ ln as IKON_UI_MEDIA_MODULE,
2633
+ Me as IKON_UI_STREAM_CATEGORY,
2634
+ on as IKON_UI_VIDEO_CANVAS_TYPE,
2635
+ sn as IKON_UI_VIDEO_URL_PLAYER_TYPE,
2636
+ qt as IkonUi,
2637
+ hn as IkonUiRegistry,
2638
+ Ur as IkonUiSurface,
2639
+ zt as UiComponentRegistry,
2640
+ Kt as UiRenderer,
2641
+ Zr as UiStreamStore,
2642
+ xr as areIkonUiModuleListsEqual,
2643
+ St as authenticateAnonymous,
2644
+ pr as buildOAuthRedirectUrl,
2645
+ yt as clearAuthSession,
2646
+ ct as clearOAuthParams,
2647
+ en as createBaseResolvers,
2648
+ Mr as createComponentLibrary,
2649
+ pn as createIkonUiRegistry,
2650
+ cn as createMediaResolvers,
2651
+ Wt as isIkonUiCategoryMatch,
2652
+ gt as loadAuthSession,
2653
+ nn as loadBaseModule,
2654
+ dn as loadMediaModule,
2655
+ Bn as normalizeIkonUiModuleList,
2656
+ $r as parseIkonUiInitPayload,
2657
+ fr as parseOAuthCallback,
2658
+ hr as parseOAuthError,
2659
+ Vn as readIkonUiModules,
2660
+ Dr as readIkonUiModulesFromSources,
2661
+ rn as registerBaseModule,
2662
+ fn as registerMediaModule,
2663
+ Bt as renderChildren,
2664
+ Fr as renderMotionLetters,
2665
+ ve as saveAuthSession,
2666
+ Br as sendMagicLink,
2667
+ ae as sessionToUser,
2668
+ Ir as useAuth,
2669
+ zr as useAuthGuard,
2670
+ Kr as useAuthOptional,
2671
+ Gr as useI18n,
2672
+ qr as useIkonApp,
2673
+ Rn as useIkonStyles,
2674
+ An as useIkonUiStores,
2675
+ Jr as useLazyFont,
2676
+ V as useUiNode,
2677
+ Lr as useUiStore
2230
2678
  };