@ikonai/sdk-react-ui 1.11.3 → 1.12.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,10 +1,10 @@
1
1
  import { n as e, t } from "./shadertoy-type-Cs2WeCWV.js";
2
2
  import { IKON_PLATFORM_STREAM_CATEGORY as n, IKON_PLATFORM_STREAM_CATEGORY as r, IKON_UI_STREAM_CATEGORY as i, IKON_UI_STREAM_CATEGORY as a, IkonUiCore as o, LiveSnapshotCache as s, UiStreamStore as c, UiStreamStore as l, isPrerenderVisible as u, prefetchBootSnapshot as d, seedStreamCategory as f } from "@ikonai/sdk-ui";
3
- import { AccessDeniedError as p, AppStartupFailedError as m, AuthenticationError as h, DEFAULT_LOCAL_SERVER_HOST as g, DEFAULT_LOCAL_SERVER_PORT as _, DEFAULT_SLOW_CONNECTION_THRESHOLD_MS as v, FEEDBACK_OPEN_FUNCTION_NAME as ee, IKON_CAPTURE_EXCLUDE_ATTRIBUTE as y, IKON_INSPECT_MODE_CHANGED_EVENT as b, IKON_INSPECT_OUTLINE_ATTRIBUTE as x, IKON_PARAM_OAUTH_CODE as te, IKON_PARAM_OAUTH_PKCE as S, IKON_PARAM_OAUTH_PROVIDER as C, IKON_PARAM_OAUTH_TOKEN as w, IkonClient as ne, LogLevel as re, ProvisioningTimeoutError as ie, SSO_PROVIDER_PREFIX as T, ServerFullError as ae, ServerUnavailableError as oe, SessionNotFoundError as se, SsoRequiredError as ce, USER_REMOVAL_GRACE_DAYS as le, abortSignalTimeout as E, adoptPkceVerifierFromUrl as ue, buildOAuthStartUrl as de, cancelOwnRemoval as fe, captureViewAtTap as pe, clearFeedbackParam as me, clearLoginPrompt as he, consentFor as ge, createLogger as D, createPkceChallenge as _e, deriveAuthUrl as O, deriveBackendType as ve, deriveCrossOriginAuthUrl as ye, extractUserIdFromToken as be, getCurrentUser as xe, getDebugOverlayParam as Se, getFeedbackParam as Ce, getLangParam as we, getLoginPromptState as Te, getOrCreateDeviceId as Ee, getSameOriginAuthUrl as De, getSignedOutParam as Oe, getTestLinkParam as ke, getUrlWithoutSession as k, grantConsent as Ae, isCloudEnvironment as je, isConsentGranted as Me, isDebugModeEnabled as Ne, isEmbedded as Pe, isInspectModeEnabled as Fe, onEmbeddedOAuthResult as Ie, parseUrlParams as Le, randomUuid as Re, readConsent as ze, reportConnectTimeline as Be, requestOwnRemoval as Ve, restorePkceVerifier as He, revokeConsent as Ue, setLoginPromptRequired as We, startEmbeddedOAuthSignIn as Ge, subscribeLoginPrompt as Ke, subscribeToLogEvents as qe, takePkceVerifier as Je } from "@ikonai/sdk";
4
- import { Fragment as Ye, Suspense as Xe, createContext as Ze, createElement as Qe, lazy as A, memo as j, use as $e, useCallback as M, useEffect as N, useLayoutEffect as et, useMemo as P, useReducer as tt, useRef as F, useState as I, useSyncExternalStore as nt } from "react";
5
- import { Fragment as rt, jsx as L, jsxs as R } from "react/jsx-runtime";
3
+ import { AccessDeniedError as p, AppStartupFailedError as m, AuthenticationError as h, DEFAULT_LOCAL_SERVER_HOST as g, DEFAULT_LOCAL_SERVER_PORT as _, DEFAULT_SLOW_CONNECTION_THRESHOLD_MS as v, FEEDBACK_OPEN_FUNCTION_NAME as ee, IKON_CAPTURE_EXCLUDE_ATTRIBUTE as y, IKON_INSPECT_MODE_CHANGED_EVENT as b, IKON_INSPECT_OUTLINE_ATTRIBUTE as x, IKON_PARAM_OAUTH_CODE as S, IKON_PARAM_OAUTH_PKCE as C, IKON_PARAM_OAUTH_PROVIDER as w, IKON_PARAM_OAUTH_TOKEN as T, IkonClient as te, LogLevel as ne, ProvisioningTimeoutError as re, SSO_PROVIDER_PREFIX as E, ServerFullError as ie, ServerUnavailableError as ae, SessionNotFoundError as oe, SsoRequiredError as se, USER_REMOVAL_GRACE_DAYS as ce, abortSignalTimeout as D, adoptPkceVerifierFromUrl as le, buildOAuthStartUrl as ue, cancelOwnRemoval as de, captureViewAtTap as fe, clearFeedbackParam as pe, clearLoginPrompt as me, consentFor as he, createLogger as O, createPkceChallenge as ge, deriveAuthUrl as k, deriveBackendType as _e, deriveCrossOriginAuthUrl as ve, extractUserIdFromToken as ye, getCurrentUser as be, getDebugOverlayParam as xe, getFeedbackParam as Se, getLangParam as Ce, getLoginPromptState as we, getOrCreateDeviceId as Te, getSameOriginAuthUrl as Ee, getSignedOutParam as De, getTestLinkParam as Oe, getUrlWithoutSession as A, grantConsent as ke, isCloudEnvironment as Ae, isConsentGranted as je, isDebugModeEnabled as Me, isEmbedded as Ne, isInspectModeEnabled as Pe, onEmbeddedOAuthResult as Fe, parseUrlParams as Ie, randomUuid as Le, readConsent as Re, reportConnectTimeline as ze, requestOwnRemoval as Be, restorePkceVerifier as Ve, revokeConsent as He, setLoginPromptRequired as Ue, startEmbeddedOAuthSignIn as We, subscribeLoginPrompt as Ge, subscribeToLogEvents as Ke, takePkceVerifier as qe } from "@ikonai/sdk";
4
+ import { Fragment as Je, Suspense as Ye, createContext as Xe, createElement as Ze, lazy as j, memo as M, use as Qe, useCallback as N, useEffect as P, useLayoutEffect as $e, useMemo as F, useReducer as et, useRef as I, useState as L, useSyncExternalStore as tt } from "react";
5
+ import { Fragment as nt, jsx as R, jsxs as z } from "react/jsx-runtime";
6
6
  //#region src/ikon-ui.ts
7
- var it = class {
7
+ var rt = class {
8
8
  core;
9
9
  ownsCore;
10
10
  stores = /* @__PURE__ */ new Map();
@@ -93,7 +93,7 @@ var it = class {
93
93
  notify(e) {
94
94
  for (let t of this.listeners) t(e);
95
95
  }
96
- }, z = 500, at = 500, ot = 150, st = 7e3, ct = "data-ikon-live-announcer", B = [], V = null, H = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), W = 0;
96
+ }, it = 500, at = 500, ot = 150, st = 7e3, ct = "data-ikon-live-announcer", B = [], V = null, H = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), W = 0;
97
97
  function dt(e) {
98
98
  wt();
99
99
  let t = {
@@ -195,8 +195,8 @@ function yt(e, t, n) {
195
195
  return e ? e.text && n.length > e.text.length && n.startsWith(e.text) ? n.slice(e.text.length).trim() : n === e.text && t === e.hintKey ? "" : n : n;
196
196
  }
197
197
  function bt(e) {
198
- if (e.length <= z) return e;
199
- let t = e.length - z, n = e.indexOf(" ", t);
198
+ if (e.length <= it) return e;
199
+ let t = e.length - it, n = e.indexOf(" ", t);
200
200
  return `…${e.slice(n >= 0 && n < e.length - 1 ? n + 1 : t)}`;
201
201
  }
202
202
  function xt(e, t) {
@@ -424,9 +424,9 @@ function Jt(e) {
424
424
  }
425
425
  }
426
426
  function Yt() {
427
- let t = j(function({ nodeId: t, context: n }) {
428
- let r = e(n.store, t), i = F(null), a = Et(r?.props?.targetViewId), o = r?.props?.focusOnly === !0, s = Et(r?.props?.priority), c = Kt(r?.props?.ranking), l = Math.max(0, Kt(r?.props?.cooldownMs)), u = Et(r?.props?.key), d = r?.props?.preciseGeneratedAt;
429
- return N(() => {
427
+ let t = M(function({ nodeId: t, context: n }) {
428
+ let r = e(n.store, t), i = I(null), a = Et(r?.props?.targetViewId), o = r?.props?.focusOnly === !0, s = Et(r?.props?.priority), c = Kt(r?.props?.ranking), l = Math.max(0, Kt(r?.props?.cooldownMs)), u = Et(r?.props?.key), d = r?.props?.preciseGeneratedAt;
429
+ return P(() => {
430
430
  if (typeof document > "u") return;
431
431
  let e = i.current;
432
432
  if (!e || a && e.closest("[data-ikon-view-id]")?.getAttribute("data-ikon-view-id") !== a) return;
@@ -449,7 +449,7 @@ function Yt() {
449
449
  a,
450
450
  u,
451
451
  d
452
- ]), r ? /* @__PURE__ */ L("span", {
452
+ ]), r ? /* @__PURE__ */ R("span", {
453
453
  ref: i,
454
454
  "data-ikon-node-id": r.id,
455
455
  "data-ikon-source": r.sourceMarker,
@@ -468,15 +468,15 @@ function Yt() {
468
468
  };
469
469
  }
470
470
  function Xt() {
471
- let t = j(function({ nodeId: t, context: n, className: r }) {
472
- let i = e(n.store, t), a = Tt(i?.props?.onInvokeId), o = M(() => {
471
+ let t = M(function({ nodeId: t, context: n, className: r }) {
472
+ let i = e(n.store, t), a = Tt(i?.props?.onInvokeId), o = N(() => {
473
473
  a && n.dispatchAction(a);
474
474
  }, [a, n]);
475
475
  if (!i) return null;
476
476
  let s = Mt(i.props);
477
477
  delete s.onInvokeId;
478
478
  let c = Dt(Et(i.props?.className), r), l = i.children?.length ? n.renderChildren(i.children) : void 0;
479
- return /* @__PURE__ */ L("div", {
479
+ return /* @__PURE__ */ R("div", {
480
480
  ...s,
481
481
  "data-ikon-node-id": i.id,
482
482
  "data-ikon-source": i.sourceMarker,
@@ -496,11 +496,11 @@ function Xt() {
496
496
  };
497
497
  }
498
498
  function Zt() {
499
- let t = j(function({ nodeId: t, context: n, className: r }) {
499
+ let t = M(function({ nodeId: t, context: n, className: r }) {
500
500
  let i = e(n.store, t);
501
501
  if (!i) return null;
502
502
  let a = Mt(i.props), o = Dt("relative", Et(i.props?.className), r), s = i.children?.length ? n.renderChildren(i.children) : void 0;
503
- return /* @__PURE__ */ L("div", {
503
+ return /* @__PURE__ */ R("div", {
504
504
  ...a,
505
505
  "data-ikon-node-id": i.id,
506
506
  "data-ikon-source": i.sourceMarker,
@@ -513,11 +513,11 @@ function Zt() {
513
513
  };
514
514
  }
515
515
  function Qt() {
516
- let t = j(function({ nodeId: t, context: n, className: r }) {
516
+ let t = M(function({ nodeId: t, context: n, className: r }) {
517
517
  let i = e(n.store, t);
518
518
  if (!i) return null;
519
519
  let a = Mt(i.props), o = Dt("absolute", Et(i.props?.className), r), s = i.children?.length ? n.renderChildren(i.children) : void 0;
520
- return /* @__PURE__ */ L("div", {
520
+ return /* @__PURE__ */ R("div", {
521
521
  ...a,
522
522
  "data-ikon-node-id": i.id,
523
523
  "data-ikon-source": i.sourceMarker,
@@ -574,13 +574,13 @@ function sn(e) {
574
574
  }
575
575
  }
576
576
  function cn() {
577
- let t = j(function({ nodeId: t, context: n, className: r }) {
578
- let i = e(n.store, t), a = F(null), o = i ? sn(i.props?.autoplay) : void 0, s = i ? on(i.props?.src) : void 0;
579
- if (N(() => {
577
+ let t = M(function({ nodeId: t, context: n, className: r }) {
578
+ let i = e(n.store, t), a = I(null), o = i ? sn(i.props?.autoplay) : void 0, s = i ? on(i.props?.src) : void 0;
579
+ if (P(() => {
580
580
  o && a.current && a.current.play().catch(() => {});
581
581
  }, [o, s]), !i) return null;
582
582
  let c = an(rn(i.props?.className), r), l = on(i.props?.preload), u = sn(i.props?.controls), d = sn(i.props?.loop), f = sn(i.props?.muted);
583
- return /* @__PURE__ */ L("audio", {
583
+ return /* @__PURE__ */ R("audio", {
584
584
  ref: a,
585
585
  src: s,
586
586
  ...l === void 0 ? {} : { preload: l },
@@ -599,15 +599,15 @@ function cn() {
599
599
  }
600
600
  //#endregion
601
601
  //#region src/media/video-stream-view.tsx
602
- var ln = D("IkonVideoStreamView"), un = j(function({ client: e, streamId: t, className: n, style: r, width: i, height: a, attributes: o, getPlayback: s }) {
603
- let c = F(null), l = F(null), [, u] = I(0);
604
- N(() => {
602
+ var ln = O("IkonVideoStreamView"), un = M(function({ client: e, streamId: t, className: n, style: r, width: i, height: a, attributes: o, getPlayback: s }) {
603
+ let c = I(null), l = I(null), [, u] = L(0);
604
+ P(() => {
605
605
  if (e?.isWebRtcEnabled) return e.addWebRtcTrackMapListener((e) => {
606
606
  e.kind === "video" && u((e) => e + 1);
607
607
  });
608
608
  }, [e]);
609
609
  let d = e?.isWebRtcEnabled && t ? e.getWebRtcVideoStreamByStreamId(t) : null;
610
- N(() => {
610
+ P(() => {
611
611
  let n = c.current;
612
612
  if (!n || !t || d) return;
613
613
  let r = !1, i, a = 0, o = !1, l = () => s ? s() : e?.media?.video, u = () => {
@@ -637,7 +637,7 @@ var ln = D("IkonVideoStreamView"), un = j(function({ client: e, streamId: t, cla
637
637
  t,
638
638
  d,
639
639
  s
640
- ]), N(() => {
640
+ ]), P(() => {
641
641
  let e = l.current;
642
642
  if (!(!e || !d)) return e.srcObject = d, () => {
643
643
  e.srcObject = null;
@@ -651,13 +651,13 @@ var ln = D("IkonVideoStreamView"), un = j(function({ client: e, streamId: t, cla
651
651
  ...i ? { width: i } : {},
652
652
  ...a ? { height: a } : {}
653
653
  };
654
- return d ? /* @__PURE__ */ L("video", {
654
+ return d ? /* @__PURE__ */ R("video", {
655
655
  ref: l,
656
656
  autoPlay: !0,
657
657
  playsInline: !0,
658
658
  muted: !0,
659
659
  ...f
660
- }, t) : /* @__PURE__ */ L("canvas", {
660
+ }, t) : /* @__PURE__ */ R("canvas", {
661
661
  ref: c,
662
662
  ...f
663
663
  }, t);
@@ -693,8 +693,8 @@ function mn(e) {
693
693
  }
694
694
  var hn = "std.video-canvas", gn = "std.video-url-player";
695
695
  function _n() {
696
- let t = j(function({ nodeId: t, context: n, className: r }) {
697
- let i = e(n.store, t), a = i ? mn(i.props?.streamId) : void 0, o = i ? mn(i.props?.onTapId) : void 0, s = i ? pn(i.props?.width) : void 0, c = i ? pn(i.props?.height) : void 0, l = i ? fn(dn(i.props?.className), r) : r, u = M(() => n.video ?? n.client?.media?.video, [n]), d = M((e) => {
696
+ let t = M(function({ nodeId: t, context: n, className: r }) {
697
+ let i = e(n.store, t), a = i ? mn(i.props?.streamId) : void 0, o = i ? mn(i.props?.onTapId) : void 0, s = i ? pn(i.props?.width) : void 0, c = i ? pn(i.props?.height) : void 0, l = i ? fn(dn(i.props?.className), r) : r, u = N(() => n.video ?? n.client?.media?.video, [n]), d = N((e) => {
698
698
  if (!o) return;
699
699
  let t = e.target.getBoundingClientRect();
700
700
  t.width <= 0 || t.height <= 0 || n.dispatchAction(o, {
@@ -703,7 +703,7 @@ function _n() {
703
703
  });
704
704
  }, [o, n]);
705
705
  if (!i) return null;
706
- let f = /* @__PURE__ */ L(un, {
706
+ let f = /* @__PURE__ */ R(un, {
707
707
  client: n.client,
708
708
  streamId: a,
709
709
  className: l,
@@ -715,7 +715,7 @@ function _n() {
715
715
  ...i.sourceMarker ? { "data-ikon-source": i.sourceMarker } : {}
716
716
  }
717
717
  });
718
- return o ? /* @__PURE__ */ L("div", {
718
+ return o ? /* @__PURE__ */ R("div", {
719
719
  style: {
720
720
  display: "contents",
721
721
  cursor: "pointer"
@@ -744,13 +744,13 @@ function yn(e) {
744
744
  }
745
745
  }
746
746
  function bn() {
747
- let t = j(function({ nodeId: t, context: n, className: r }) {
748
- let i = e(n.store, t), a = F(null), o = i ? yn(i.props?.autoplay) : void 0, s = i ? mn(i.props?.src) : void 0;
749
- if (N(() => {
747
+ let t = M(function({ nodeId: t, context: n, className: r }) {
748
+ let i = e(n.store, t), a = I(null), o = i ? yn(i.props?.autoplay) : void 0, s = i ? mn(i.props?.src) : void 0;
749
+ if (P(() => {
750
750
  o && a.current && a.current.play().catch(() => {});
751
751
  }, [o, s]), !i) return null;
752
752
  let c = fn(dn(i.props?.className), r), l = mn(i.props?.poster), u = yn(i.props?.controls), d = yn(i.props?.loop), f = yn(i.props?.muted), p = yn(i.props?.playsInline), m = pn(i.props?.width), h = pn(i.props?.height), g = i.children?.length ? n.renderChildren(i.children) : void 0;
753
- return /* @__PURE__ */ L("video", {
753
+ return /* @__PURE__ */ R("video", {
754
754
  ref: a,
755
755
  src: s,
756
756
  poster: l,
@@ -781,7 +781,7 @@ function Cn(e) {
781
781
  //#region src/renderer/lazy-resolver.ts
782
782
  var wn = () => null;
783
783
  function Tn(e, t, n) {
784
- let r = A(async () => ({ default: n(await t())()({ type: e }) ?? wn })), i = (e) => Qe(Xe, { fallback: null }, Qe(r, e));
784
+ let r = j(async () => ({ default: n(await t())()({ type: e }) ?? wn })), i = (e) => Ze(Ye, { fallback: null }, Ze(r, e));
785
785
  return (t) => t.type === e ? i : void 0;
786
786
  }
787
787
  //#endregion
@@ -796,7 +796,7 @@ function kn(e) {
796
796
  }
797
797
  //#endregion
798
798
  //#region src/ikon-ui-registry.ts
799
- var An = D("UIRegistry"), jn = class {
799
+ var An = O("UIRegistry"), jn = class {
800
800
  baseResolvers = [];
801
801
  moduleLoaders = /* @__PURE__ */ new Map();
802
802
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -870,14 +870,14 @@ function Fn(e, t) {
870
870
  //#endregion
871
871
  //#region src/renderer/use-root-view.ts
872
872
  function In(e, t) {
873
- let n = nt((t) => e.subscribe(t), () => {
873
+ let n = tt((t) => e.subscribe(t), () => {
874
874
  let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
875
875
  return `${r ?? ""}:${i?.id ?? ""}`;
876
876
  }, () => {
877
877
  let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
878
878
  return `${r ?? ""}:${i?.id ?? ""}`;
879
879
  });
880
- return P(() => {
880
+ return F(() => {
881
881
  let [e, t] = n.split(":");
882
882
  return {
883
883
  rootViewId: e || void 0,
@@ -887,7 +887,7 @@ function In(e, t) {
887
887
  }
888
888
  //#endregion
889
889
  //#region src/renderer/ui-renderer.tsx
890
- var Ln = D("UIRenderer");
890
+ var Ln = O("UIRenderer");
891
891
  function Rn(e) {
892
892
  if (e === void 0) return "{}";
893
893
  if (typeof e == "string") return e;
@@ -903,33 +903,33 @@ function zn(e) {
903
903
  }
904
904
  var Bn = 1500, Vn = 8e3;
905
905
  function Hn(e) {
906
- let [t, n] = I(0);
907
- return N(() => {
906
+ let [t, n] = L(0);
907
+ return P(() => {
908
908
  if (e.subscribe) return e.subscribe(() => n((e) => e + 1));
909
909
  }, [e]), t;
910
910
  }
911
911
  function Un({ nodeType: t, nodeId: n, context: r, className: i }) {
912
- let [a, o] = I(!1), [s, c] = I(!1), l = e(r.store, n), u = Hn(r.library), d = P(() => l ? r.library.resolve(l) : void 0, [
912
+ let [a, o] = L(!1), [s, c] = L(!1), l = e(r.store, n), u = Hn(r.library), d = F(() => l ? r.library.resolve(l) : void 0, [
913
913
  r.library,
914
914
  l,
915
915
  u
916
916
  ]);
917
- return N(() => {
917
+ return P(() => {
918
918
  let e = setTimeout(() => o(!0), Bn), t = setTimeout(() => c(!0), Vn);
919
919
  return () => {
920
920
  clearTimeout(e), clearTimeout(t);
921
921
  };
922
- }, [t]), N(() => {
922
+ }, [t]), P(() => {
923
923
  !s || d || Ln.error(`No React resolver is registered for node type '${t}', so it renders as an error placeholder instead of the component you expected. A custom node needs all four parts: (1) the React component, (2) a resolver that matches '${t}', (3) a registerModule(...) call for it in app.tsx, and (4) the C# view.AddNode("${t}", ...) extension. Prefer native view.* components where they fit.`);
924
924
  }, [
925
925
  s,
926
926
  d,
927
927
  t
928
- ]), d ? /* @__PURE__ */ L(d, {
928
+ ]), d ? /* @__PURE__ */ R(d, {
929
929
  nodeId: n,
930
930
  context: r,
931
931
  className: i
932
- }) : a ? /* @__PURE__ */ L("div", {
932
+ }) : a ? /* @__PURE__ */ R("div", {
933
933
  "data-ikon-node-id": n,
934
934
  "data-ikon-unresolved-node": t,
935
935
  role: "alert",
@@ -960,19 +960,19 @@ function Kn(e) {
960
960
  for (let n = 1; n < e.length; n++) t += "," + e[n].id;
961
961
  return t;
962
962
  }
963
- var qn = j(function t({ nodeId: n, context: r }) {
964
- let i = e(r.store, n), a = i ? Wn(i) : [], o = Kn(a), s = P(() => a.length === 0 ? null : a.map((e) => /* @__PURE__ */ L(t, {
963
+ var qn = M(function t({ nodeId: n, context: r }) {
964
+ let i = e(r.store, n), a = i ? Wn(i) : [], o = Kn(a), s = F(() => a.length === 0 ? null : a.map((e) => /* @__PURE__ */ R(t, {
965
965
  nodeId: e.id,
966
966
  context: r
967
967
  }, e.id)), [o, r]);
968
968
  if (!i) return null;
969
- if (i.type === "root") return /* @__PURE__ */ L(Ye, { children: s }, i.id);
969
+ if (i.type === "root") return /* @__PURE__ */ R(Je, { children: s }, i.id);
970
970
  let c = zn(i), l = c.length > 0 ? c.join(" ") : void 0, u = r.library.resolve(i);
971
- return u ? /* @__PURE__ */ L(u, {
971
+ return u ? /* @__PURE__ */ R(u, {
972
972
  nodeId: n,
973
973
  context: r,
974
974
  className: l
975
- }) : /* @__PURE__ */ L(Un, {
975
+ }) : /* @__PURE__ */ R(Un, {
976
976
  nodeType: i.type,
977
977
  nodeId: i.id,
978
978
  context: r,
@@ -980,7 +980,7 @@ var qn = j(function t({ nodeId: n, context: r }) {
980
980
  });
981
981
  }, Gn);
982
982
  function Jn(e, t) {
983
- return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ L(qn, {
983
+ return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ R(qn, {
984
984
  nodeId: e.id,
985
985
  context: t
986
986
  }, e.id));
@@ -988,18 +988,18 @@ function Jn(e, t) {
988
988
  function Yn(e, t) {
989
989
  return e.store === t.store && e.library === t.library && e.viewId === t.viewId && e.emptyFallback === t.emptyFallback;
990
990
  }
991
- var Xn = j(function({ store: e, library: t, viewId: n, emptyFallback: r = null, onAction: i, client: a, video: o }) {
992
- let { rootViewId: s, rootNodeId: c } = In(e, n), l = F(i);
991
+ var Xn = M(function({ store: e, library: t, viewId: n, emptyFallback: r = null, onAction: i, client: a, video: o }) {
992
+ let { rootViewId: s, rootNodeId: c } = In(e, n), l = I(i);
993
993
  l.current = i;
994
- let u = F(a);
994
+ let u = I(a);
995
995
  u.current = a;
996
- let d = F(o);
996
+ let d = I(o);
997
997
  d.current = o;
998
- let f = M((e, t, n) => {
998
+ let f = N((e, t, n) => {
999
999
  if (!e) return;
1000
1000
  let r = Rn(t);
1001
1001
  l.current?.(e, r, n);
1002
- }, []), p = P(() => {
1002
+ }, []), p = F(() => {
1003
1003
  let n = {
1004
1004
  store: e,
1005
1005
  library: t,
@@ -1008,7 +1008,7 @@ var Xn = j(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
1008
1008
  renderChildren: (e) => Jn(e, n),
1009
1009
  renderView: (t) => {
1010
1010
  let r = e.getSnapshot().views.get(t);
1011
- return r ? /* @__PURE__ */ L(qn, {
1011
+ return r ? /* @__PURE__ */ R(qn, {
1012
1012
  nodeId: r.id,
1013
1013
  context: n
1014
1014
  }) : null;
@@ -1027,10 +1027,10 @@ var Xn = j(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
1027
1027
  t,
1028
1028
  f
1029
1029
  ]);
1030
- return !s || !c ? r : /* @__PURE__ */ L("div", {
1030
+ return !s || !c ? r : /* @__PURE__ */ R("div", {
1031
1031
  "data-ikon-view-id": s,
1032
1032
  style: { display: "contents" },
1033
- children: /* @__PURE__ */ L(qn, {
1033
+ children: /* @__PURE__ */ R(qn, {
1034
1034
  nodeId: c,
1035
1035
  context: p
1036
1036
  })
@@ -1066,7 +1066,7 @@ function Qn(e, t) {
1066
1066
  //#endregion
1067
1067
  //#region src/renderer/use-ui-store.ts
1068
1068
  function $n(e) {
1069
- return nt((t) => e.subscribe(t), () => e.getSnapshot(), () => e.getSnapshot());
1069
+ return tt((t) => e.subscribe(t), () => e.getSnapshot(), () => e.getSnapshot());
1070
1070
  }
1071
1071
  //#endregion
1072
1072
  //#region src/inspect/inspect-overlay.tsx
@@ -1077,18 +1077,18 @@ function tr(e) {
1077
1077
  e.style.outline = "", e.style.outlineOffset = "", e.removeAttribute(x);
1078
1078
  }
1079
1079
  function nr() {
1080
- let [e, t] = I(Fe), n = F(!1);
1081
- return N(() => {
1080
+ let [e, t] = L(Pe), n = I(!1);
1081
+ return P(() => {
1082
1082
  if (e) return;
1083
1083
  let r = () => {
1084
- Fe() && t(!0);
1084
+ Pe() && t(!0);
1085
1085
  }, i = (e) => {
1086
1086
  e.data?.type === "ikon-inspect-mode" && e.data.enabled && (n.current = !0, t(!0));
1087
1087
  };
1088
1088
  return window.addEventListener(b, r), window.addEventListener("message", i), () => {
1089
1089
  window.removeEventListener(b, r), window.removeEventListener("message", i);
1090
1090
  };
1091
- }, [e]), N(() => {
1091
+ }, [e]), P(() => {
1092
1092
  if (!e) return;
1093
1093
  let t = window.parent === window || n.current, r = null, i = [], a = document.createElement("div");
1094
1094
  a.setAttribute(y, ""), a.style.cssText = "position:fixed;z-index:99999;pointer-events:none;padding:2px 6px;background:#1e1e2e;color:#cdd6f4;font-size:11px;border-radius:4px;border:1px solid #45475a;white-space:nowrap;display:none;font-family:monospace;", document.body.appendChild(a);
@@ -1216,16 +1216,16 @@ function nr() {
1216
1216
  }
1217
1217
  //#endregion
1218
1218
  //#region src/surface.tsx
1219
- var rr = D("IkonUiSurface");
1219
+ var rr = O("IkonUiSurface");
1220
1220
  function ir(e, t) {
1221
1221
  return e === t;
1222
1222
  }
1223
- var ar = j(function({ stores: e, registry: t, category: n = a, onAction: r, client: i, inspect: o = !0 }) {
1224
- let s = P(() => Array.from(e.keys()).sort().join(","), [e]), c = F(r);
1223
+ var ar = M(function({ stores: e, registry: t, category: n = a, onAction: r, client: i, inspect: o = !0 }) {
1224
+ let s = F(() => Array.from(e.keys()).sort().join(","), [e]), c = I(r);
1225
1225
  c.current = r;
1226
- let l = F(i);
1226
+ let l = I(i);
1227
1227
  l.current = i;
1228
- let u = P(() => {
1228
+ let u = F(() => {
1229
1229
  let t = [];
1230
1230
  for (let [r, i] of e) {
1231
1231
  let e = i.store.getSnapshot();
@@ -1239,10 +1239,10 @@ var ar = j(function({ stores: e, registry: t, category: n = a, onAction: r, clie
1239
1239
  e,
1240
1240
  n,
1241
1241
  s
1242
- ]), d = F(!1), f = u.length > 0;
1243
- return N(() => {
1242
+ ]), d = I(!1), f = u.length > 0;
1243
+ return P(() => {
1244
1244
  f && !d.current && (d.current = !0, rr.debug("First UI render"));
1245
- }, [f]), f ? /* @__PURE__ */ R(rt, { children: [o && /* @__PURE__ */ L(nr, {}), u.map(({ key: e, store: n }) => /* @__PURE__ */ L(Xn, {
1245
+ }, [f]), f ? /* @__PURE__ */ z(nt, { children: [o && /* @__PURE__ */ R(nr, {}), u.map(({ key: e, store: n }) => /* @__PURE__ */ R(Xn, {
1246
1246
  store: n,
1247
1247
  library: t,
1248
1248
  onAction: c.current,
@@ -1253,7 +1253,7 @@ var ar = j(function({ stores: e, registry: t, category: n = a, onAction: r, clie
1253
1253
  //#endregion
1254
1254
  //#region src/parallax-view.tsx
1255
1255
  function or({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
1256
- return /* @__PURE__ */ L(ar, {
1256
+ return /* @__PURE__ */ R(ar, {
1257
1257
  stores: t,
1258
1258
  registry: n,
1259
1259
  category: e,
@@ -1263,7 +1263,7 @@ function or({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
1263
1263
  }
1264
1264
  //#endregion
1265
1265
  //#region src/motion/motion-controller.ts
1266
- var sr = D("MotionController"), cr = {
1266
+ var sr = O("MotionController"), cr = {
1267
1267
  ease: [
1268
1268
  .25,
1269
1269
  .1,
@@ -1754,7 +1754,7 @@ var hr = new class {
1754
1754
  //#endregion
1755
1755
  //#region src/use-ikon-styles.ts
1756
1756
  function gr(e) {
1757
- let t = F(/* @__PURE__ */ new Map()), n = M(({ styleId: e, css: n, common: r }) => {
1757
+ let t = I(/* @__PURE__ */ new Map()), n = N(({ styleId: e, css: n, common: r }) => {
1758
1758
  if (!(!e || typeof document > "u")) {
1759
1759
  if (n) {
1760
1760
  let r = t.current.get(e);
@@ -1762,19 +1762,19 @@ function gr(e) {
1762
1762
  }
1763
1763
  hr.registerStyle(e, r);
1764
1764
  }
1765
- }, []), r = M((e) => {
1765
+ }, []), r = N((e) => {
1766
1766
  if (!(typeof document > "u")) for (let n of e) {
1767
1767
  let e = t.current.get(n);
1768
1768
  e && (e.remove(), t.current.delete(n)), hr.unregisterStyle(n);
1769
1769
  }
1770
- }, []), i = M(() => {
1770
+ }, []), i = N(() => {
1771
1771
  if (typeof document < "u") {
1772
1772
  for (let e of t.current.values()) e.remove();
1773
1773
  t.current.clear();
1774
1774
  }
1775
1775
  hr.reset();
1776
1776
  }, []);
1777
- return N(() => {
1777
+ return P(() => {
1778
1778
  if (!e) return;
1779
1779
  for (let t of e.getUiStyles()) n(t);
1780
1780
  let t = e.subscribeToStyles(n), a = e.subscribeToStyleDeletes?.(r);
@@ -1786,7 +1786,7 @@ function gr(e) {
1786
1786
  i,
1787
1787
  n,
1788
1788
  r
1789
- ]), N(() => () => i(), [i]), {
1789
+ ]), P(() => () => i(), [i]), {
1790
1790
  setStyle: n,
1791
1791
  deleteStyles: r,
1792
1792
  reset: i
@@ -1803,8 +1803,8 @@ function _r(e) {
1803
1803
  return t.sort(), t.join(",");
1804
1804
  }
1805
1805
  function vr(e) {
1806
- let [t, n] = I(), r = F("");
1807
- return N(() => {
1806
+ let [t, n] = L(), r = I("");
1807
+ return P(() => {
1808
1808
  if (!e) {
1809
1809
  n(void 0), r.current = "";
1810
1810
  return;
@@ -1818,17 +1818,18 @@ function vr(e) {
1818
1818
  }
1819
1819
  //#endregion
1820
1820
  //#region src/media/use-sibling-client.ts
1821
- function yr(e, t, n) {
1822
- let [r, i] = I(null), [a, o] = I(null), s = F(n);
1821
+ var yr = O("useSiblingClient");
1822
+ function br(e, t, n) {
1823
+ let [r, i] = L(null), [a, o] = L(null), s = I(n);
1823
1824
  s.current = n;
1824
1825
  let c = t ? JSON.stringify(Object.entries(t).sort(([e], [t]) => e < t ? -1 : +(e > t))) : null;
1825
- return N(() => {
1826
+ return P(() => {
1826
1827
  if (!e || c === null) return;
1827
1828
  let t = Object.fromEntries(JSON.parse(c)), n = e.createSibling(t, s.current), r = !1;
1828
1829
  return o(null), n.connect().then(() => {
1829
1830
  r || i(n);
1830
1831
  }).catch((e) => {
1831
- r || o(e instanceof Error ? e : Error(String(e)));
1832
+ r || (yr.error("Sibling connection failed:", e), o(e instanceof Error ? e : Error(String(e))));
1832
1833
  }), () => {
1833
1834
  r = !0, i(null), n.disconnect();
1834
1835
  };
@@ -1839,10 +1840,10 @@ function yr(e, t, n) {
1839
1840
  }
1840
1841
  //#endregion
1841
1842
  //#region src/media/use-media-capture.ts
1842
- var br = D("IkonMediaCaptureHooks");
1843
- function xr(e, t, n, r) {
1844
- let [i, a] = I(null), o = F(r);
1845
- return o.current = r, N(() => {
1843
+ var xr = O("IkonMediaCaptureHooks");
1844
+ function Sr(e, t, n, r) {
1845
+ let [i, a] = L(null), o = I(r);
1846
+ return o.current = r, P(() => {
1846
1847
  if (!e || !t) return;
1847
1848
  let r = !1, i = null;
1848
1849
  return a(null), (async () => {
@@ -1855,7 +1856,7 @@ function xr(e, t, n, r) {
1855
1856
  try {
1856
1857
  i = await o.current(t);
1857
1858
  } catch (e) {
1858
- r || (br.error(`${n} capture start failed: ${String(e)}`), a(e instanceof Error ? e : Error(String(e))));
1859
+ r || (xr.error(`${n} capture start failed: ${String(e)}`), a(e instanceof Error ? e : Error(String(e))));
1859
1860
  return;
1860
1861
  }
1861
1862
  r && i.stop();
@@ -1869,17 +1870,17 @@ function xr(e, t, n, r) {
1869
1870
  n
1870
1871
  ]), { error: i };
1871
1872
  }
1872
- function Sr(e, t, n) {
1873
- let r = F(n);
1874
- return r.current = n, xr(e, t, "microphone", M((e) => e.audio.startMic(r.current ?? {}), []));
1875
- }
1876
1873
  function Cr(e, t, n) {
1877
- let r = F(n);
1878
- return r.current = n, xr(e, t, "camera", M((e) => e.video.startCamera(r.current), []));
1874
+ let r = I(n);
1875
+ return r.current = n, Sr(e, t, "microphone", N((e) => e.audio.startMic(r.current ?? {}), []));
1879
1876
  }
1880
1877
  function wr(e, t, n) {
1881
- let r = F(n);
1882
- return r.current = n, xr(e, t, "screen", M((e) => e.video.startScreen(r.current), []));
1878
+ let r = I(n);
1879
+ return r.current = n, Sr(e, t, "camera", N((e) => e.video.startCamera(r.current), []));
1880
+ }
1881
+ function Tr(e, t, n) {
1882
+ let r = I(n);
1883
+ return r.current = n, Sr(e, t, "screen", N((e) => e.video.startScreen(r.current), []));
1883
1884
  }
1884
1885
  //#endregion
1885
1886
  //#region src/shared/render-motion-letters.tsx
@@ -1893,7 +1894,7 @@ var K = {
1893
1894
  LetterReverse: 32,
1894
1895
  WordReverse: 64,
1895
1896
  LineReverse: 128
1896
- }, Tr = [
1897
+ }, Er = [
1897
1898
  {
1898
1899
  flag: K.Letter,
1899
1900
  hints: [
@@ -1942,7 +1943,7 @@ var K = {
1942
1943
  "[data-emoji]"
1943
1944
  ]
1944
1945
  }
1945
- ], Er = [
1946
+ ], Dr = [
1946
1947
  {
1947
1948
  flag: K.LetterReverse,
1948
1949
  hint: "[data-motion-letter]"
@@ -1955,8 +1956,8 @@ var K = {
1955
1956
  flag: K.LineReverse,
1956
1957
  hint: "[data-motion-line]"
1957
1958
  }
1958
- ], Dr = ":nth-last-child(", Or = K.Letter | K.Word | K.Line | K.Paragraph | K.Emoji | K.LetterReverse | K.WordReverse | K.LineReverse, kr = K.LetterReverse | K.WordReverse | K.LineReverse, Ar = K.Letter | K.Word | K.Line | K.Paragraph, jr = /* @__PURE__ */ new Map(), Mr = 16384;
1959
- function Nr(e) {
1959
+ ], Or = ":nth-last-child(", kr = K.Letter | K.Word | K.Line | K.Paragraph | K.Emoji | K.LetterReverse | K.WordReverse | K.LineReverse, Ar = K.LetterReverse | K.WordReverse | K.LineReverse, jr = K.Letter | K.Word | K.Line | K.Paragraph, Mr = /* @__PURE__ */ new Map(), Nr = 16384;
1960
+ function Pr(e) {
1960
1961
  return {
1961
1962
  letter: 0,
1962
1963
  word: 0,
@@ -1967,119 +1968,119 @@ function Nr(e) {
1967
1968
  reverseTotals: e
1968
1969
  };
1969
1970
  }
1970
- function Pr(e, t, n) {
1971
+ function Fr(e, t, n) {
1971
1972
  let r = e.reverseTotals?.[t];
1972
1973
  return r === void 0 ? n : r - 1 - n;
1973
1974
  }
1974
- function Fr(e, t) {
1975
- if (!e || e.length > Mr) return e;
1976
- let n = di(t), r = q(n, K.Emoji), i = n & Ar;
1975
+ function Ir(e, t) {
1976
+ if (!e || e.length > Nr) return e;
1977
+ let n = fi(t), r = q(n, K.Emoji), i = n & jr;
1977
1978
  if (i === K.None && !r) return e;
1978
1979
  let a = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
1979
- if (i === K.None) return li(a);
1980
- let o = oi(a);
1981
- return o.length === 0 ? r ? li(a) : e : Ir(si(o), n, Nr(Lr(o, n)));
1980
+ if (i === K.None) return ui(a);
1981
+ let o = si(a);
1982
+ return o.length === 0 ? r ? ui(a) : e : Lr(ci(o), n, Pr(Rr(o, n)));
1982
1983
  }
1983
- function Ir(e, t, n) {
1984
+ function Lr(e, t, n) {
1984
1985
  let r = [];
1985
- for (let i of e) r.push(...Rr(i, t, n));
1986
+ for (let i of e) r.push(...zr(i, t, n));
1986
1987
  return r;
1987
1988
  }
1988
- function Lr(e, t) {
1989
- if ((t & kr) === K.None) return;
1989
+ function Rr(e, t) {
1990
+ if ((t & Ar) === K.None) return;
1990
1991
  let n = q(t, K.LetterReverse), r = q(t, K.WordReverse), i = 0, a = 0;
1991
- if (n || r) for (let t of e) for (let e of t.text.split(/\s+/)) e && (a += 1, n && (i += Wr(e).length));
1992
+ if (n || r) for (let t of e) for (let e of t.text.split(/\s+/)) e && (a += 1, n && (i += Gr(e).length));
1992
1993
  return {
1993
1994
  letter: n ? i : void 0,
1994
1995
  word: r ? a : void 0,
1995
1996
  line: q(t, K.LineReverse) ? e.length : void 0
1996
1997
  };
1997
1998
  }
1998
- function Rr(e, t, n) {
1999
+ function zr(e, t, n) {
1999
2000
  let r = [];
2000
2001
  for (let i of e) {
2001
- let e = zr(i, t, n);
2002
+ let e = Br(i, t, n);
2002
2003
  r.push(...e);
2003
2004
  }
2004
2005
  if (q(t, K.Paragraph)) {
2005
2006
  let e = n.paragraph++;
2006
- return [/* @__PURE__ */ L("span", {
2007
+ return [/* @__PURE__ */ R("span", {
2007
2008
  "data-motion-paragraph": !0,
2008
- style: ci(e),
2009
+ style: li(e),
2009
2010
  children: r
2010
2011
  }, `motion-paragraph-${e}`)];
2011
2012
  }
2012
2013
  return r;
2013
2014
  }
2014
- function zr(e, t, n) {
2015
- let r = Br(e.text, t, n), i = [];
2015
+ function Br(e, t, n) {
2016
+ let r = Vr(e.text, t, n), i = [];
2016
2017
  if (q(t, K.Line)) {
2017
2018
  let e = n.line++;
2018
- i.push(/* @__PURE__ */ L("span", {
2019
+ i.push(/* @__PURE__ */ R("span", {
2019
2020
  "data-motion-line": !0,
2020
- style: ci(Pr(n, "line", e)),
2021
+ style: li(Fr(n, "line", e)),
2021
2022
  children: r
2022
2023
  }, `motion-line-${e}`));
2023
2024
  } else i.push(...r);
2024
- for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */ L("br", {}, `motion-break-${n.br++}`));
2025
+ for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */ R("br", {}, `motion-break-${n.br++}`));
2025
2026
  return i;
2026
2027
  }
2027
- function Br(e, t, n) {
2028
+ function Vr(e, t, n) {
2028
2029
  if (!e) return [];
2029
2030
  let r = q(t, K.Word), i = [], a = /(\s+)/g, o = 0, s;
2030
2031
  for (; (s = a.exec(e)) !== null;) {
2031
2032
  if (s.index > o) {
2032
2033
  let a = e.slice(o, s.index);
2033
- i.push(Vr(a, n, t, r));
2034
+ i.push(Hr(a, n, t, r));
2034
2035
  }
2035
2036
  i.push(s[0]), o = s.index + s[0].length;
2036
2037
  }
2037
2038
  if (o < e.length) {
2038
2039
  let a = e.slice(o);
2039
- i.push(Vr(a, n, t, r));
2040
+ i.push(Hr(a, n, t, r));
2040
2041
  }
2041
2042
  return i;
2042
2043
  }
2043
- function Vr(e, t, n, r) {
2044
- let i = t.word++, a = Ur(e, n, t), o = `motion-word-${i}`, s = Hr(Pr(t, "word", i), r);
2045
- return r ? /* @__PURE__ */ L("span", {
2044
+ function Hr(e, t, n, r) {
2045
+ let i = t.word++, a = Wr(e, n, t), o = `motion-word-${i}`, s = Ur(Fr(t, "word", i), r);
2046
+ return r ? /* @__PURE__ */ R("span", {
2046
2047
  "data-motion-word": !0,
2047
2048
  style: s,
2048
2049
  children: a
2049
- }, o) : /* @__PURE__ */ L("span", {
2050
+ }, o) : /* @__PURE__ */ R("span", {
2050
2051
  style: s,
2051
2052
  children: a
2052
2053
  }, o);
2053
2054
  }
2054
- function Hr(e, t) {
2055
+ function Ur(e, t) {
2055
2056
  return t ? {
2056
- ...ci(e),
2057
+ ...li(e),
2057
2058
  whiteSpace: "nowrap"
2058
2059
  } : { whiteSpace: "nowrap" };
2059
2060
  }
2060
- function Ur(e, t, n) {
2061
+ function Wr(e, t, n) {
2061
2062
  if (!e) return [];
2062
2063
  let r = q(t, K.Letter), i = q(t, K.Emoji);
2063
2064
  if (!r) {
2064
2065
  if (!i) return [e];
2065
- let t = Wr(e);
2066
+ let t = Gr(e);
2066
2067
  if (t.length === 0) return [e];
2067
- let { nodes: r } = ui(t, n);
2068
+ let { nodes: r } = di(t, n);
2068
2069
  return r;
2069
2070
  }
2070
- let a = [], o = Wr(e);
2071
+ let a = [], o = Gr(e);
2071
2072
  for (let e of o) {
2072
- let t = n.letter++, r = `motion-letter-${t}`, o = ci(Pr(n, "letter", t));
2073
+ let t = n.letter++, r = `motion-letter-${t}`, o = li(Fr(n, "letter", t));
2073
2074
  if (e === "\n") {
2074
- a.push(/* @__PURE__ */ L("span", {
2075
+ a.push(/* @__PURE__ */ R("span", {
2075
2076
  "data-motion-letter": !0,
2076
2077
  style: o,
2077
- children: /* @__PURE__ */ L("br", {})
2078
+ children: /* @__PURE__ */ R("br", {})
2078
2079
  }, r));
2079
2080
  continue;
2080
2081
  }
2081
- let s = i && ri(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
2082
- a.push(/* @__PURE__ */ L("span", {
2082
+ let s = i && ii(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
2083
+ a.push(/* @__PURE__ */ R("span", {
2083
2084
  "data-motion-letter": !0,
2084
2085
  style: o,
2085
2086
  ...s,
@@ -2088,46 +2089,46 @@ function Ur(e, t, n) {
2088
2089
  }
2089
2090
  return a;
2090
2091
  }
2091
- function Wr(e) {
2092
+ function Gr(e) {
2092
2093
  if (!e) return [];
2093
- let t = Kr();
2094
- return t ? Array.from(t.segment(e), (e) => e.segment) : qr(e);
2094
+ let t = qr();
2095
+ return t ? Array.from(t.segment(e), (e) => e.segment) : Jr(e);
2095
2096
  }
2096
- var Gr;
2097
- function Kr() {
2098
- return Gr === void 0 && (Gr = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), Gr;
2097
+ var Kr;
2098
+ function qr() {
2099
+ return Kr === void 0 && (Kr = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), Kr;
2099
2100
  }
2100
- function qr(e) {
2101
+ function Jr(e) {
2101
2102
  let t = [], n = Array.from(e), r = "";
2102
2103
  for (let e = 0; e < n.length; e++) {
2103
2104
  let i = n[e], a = n[e + 1];
2104
- r += i, !(a && Jr(i, a)) && (t.push(r), r = "");
2105
+ r += i, !(a && Yr(i, a)) && (t.push(r), r = "");
2105
2106
  }
2106
2107
  return r && t.push(r), t;
2107
2108
  }
2108
- function Jr(e, t) {
2109
- return t ? !!(Yr(e) || Yr(t) || ei(t) || Xr(t) || Zr(t) || Qr(e) && Qr(t)) : !1;
2109
+ function Yr(e, t) {
2110
+ return t ? !!(Xr(e) || Xr(t) || ti(t) || Zr(t) || Qr(t) || $r(e) && $r(t)) : !1;
2110
2111
  }
2111
- function Yr(e) {
2112
+ function Xr(e) {
2112
2113
  return e.codePointAt(0) === 8205;
2113
2114
  }
2114
- function Xr(e) {
2115
+ function Zr(e) {
2115
2116
  let t = e.codePointAt(0);
2116
2117
  return t === void 0 ? !1 : t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999;
2117
2118
  }
2118
- function Zr(e) {
2119
+ function Qr(e) {
2119
2120
  let t = e.codePointAt(0);
2120
2121
  return t !== void 0 && t >= 127995 && t <= 127999;
2121
2122
  }
2122
- function Qr(e) {
2123
+ function $r(e) {
2123
2124
  let t = e.codePointAt(0);
2124
2125
  return t !== void 0 && t >= 127462 && t <= 127487;
2125
2126
  }
2126
- var $r;
2127
- function ei(e) {
2128
- return e ? ($r ||= ti(), $r(e)) : !1;
2127
+ var ei;
2128
+ function ti(e) {
2129
+ return e ? (ei ||= ni(), ei(e)) : !1;
2129
2130
  }
2130
- function ti() {
2131
+ function ni() {
2131
2132
  try {
2132
2133
  let e = /\p{Mark}/u;
2133
2134
  return (t) => e.test(t);
@@ -2138,19 +2139,19 @@ function ti() {
2138
2139
  };
2139
2140
  }
2140
2141
  }
2141
- var ni;
2142
- function ri(e) {
2143
- return e ? (ni ||= ii(), ni(e)) : !1;
2142
+ var ri;
2143
+ function ii(e) {
2144
+ return e ? (ri ||= ai(), ri(e)) : !1;
2144
2145
  }
2145
- function ii() {
2146
+ function ai() {
2146
2147
  try {
2147
2148
  let e = /\p{Extended_Pictographic}/u;
2148
2149
  return (t) => e.test(t);
2149
2150
  } catch {
2150
- return ai;
2151
+ return oi;
2151
2152
  }
2152
2153
  }
2153
- function ai(e) {
2154
+ function oi(e) {
2154
2155
  if (!e) return !1;
2155
2156
  for (let t of Array.from(e)) {
2156
2157
  let e = t.codePointAt(0);
@@ -2158,7 +2159,7 @@ function ai(e) {
2158
2159
  }
2159
2160
  return !1;
2160
2161
  }
2161
- function oi(e) {
2162
+ function si(e) {
2162
2163
  let t = [], n = "", r = 0;
2163
2164
  for (let i = 0; i < e.length; i++) {
2164
2165
  let a = e[i];
@@ -2176,7 +2177,7 @@ function oi(e) {
2176
2177
  breaks: r
2177
2178
  }), t;
2178
2179
  }
2179
- function si(e) {
2180
+ function ci(e) {
2180
2181
  if (e.length === 0) return [];
2181
2182
  let t = [], n = [];
2182
2183
  for (let r of e) n.push(r), r.breaks >= 2 && (t.push(n), n = []);
@@ -2185,7 +2186,7 @@ function si(e) {
2185
2186
  function q(e, t) {
2186
2187
  return (e & t) === t;
2187
2188
  }
2188
- function ci(e) {
2189
+ function li(e) {
2189
2190
  return {
2190
2191
  "--tw-motion-seq-index": e.toString(),
2191
2192
  backgroundColor: "inherit",
@@ -2202,22 +2203,22 @@ function ci(e) {
2202
2203
  WebkitTextFillColor: "inherit"
2203
2204
  };
2204
2205
  }
2205
- function li(e) {
2206
+ function ui(e) {
2206
2207
  if (!e) return e;
2207
- let t = Wr(e);
2208
+ let t = Gr(e);
2208
2209
  if (t.length === 0) return e;
2209
- let { nodes: n, sawEmoji: r } = ui(t);
2210
+ let { nodes: n, sawEmoji: r } = di(t);
2210
2211
  return r ? n.length === 1 ? n[0] ?? e : n : e;
2211
2212
  }
2212
- function ui(e, t) {
2213
+ function di(e, t) {
2213
2214
  let n = [], r = "", i = !1, a = t?.emoji ?? 0, o = () => {
2214
2215
  r &&= (n.push(r), "");
2215
2216
  };
2216
2217
  for (let s of e) {
2217
- if (ri(s)) {
2218
+ if (ii(s)) {
2218
2219
  i = !0, o();
2219
2220
  let e = `motion-emoji-${t ? t.emoji++ : a++}`;
2220
- n.push(/* @__PURE__ */ L("span", {
2221
+ n.push(/* @__PURE__ */ R("span", {
2221
2222
  "data-motion-emoji": !0,
2222
2223
  children: s
2223
2224
  }, e));
@@ -2233,16 +2234,16 @@ function ui(e, t) {
2233
2234
  sawEmoji: !1
2234
2235
  };
2235
2236
  }
2236
- function di(e) {
2237
+ function fi(e) {
2237
2238
  if (!e) return K.None;
2238
2239
  let t = e.trim();
2239
2240
  if (!t) return K.None;
2240
- let n = jr.get(t);
2241
+ let n = Mr.get(t);
2241
2242
  if (typeof n == "number") return n;
2242
2243
  if (typeof document > "u") return K.None;
2243
2244
  let r = t.split(/\s+/).filter(Boolean);
2244
2245
  if (r.length === 0) return K.None;
2245
- let i = r.map((e) => `.${hi(e)}`), a = i.map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${gi(e)}(?![a-zA-Z0-9_-])`)), o = K.None, s = !1;
2246
+ let i = r.map((e) => `.${gi(e)}`), a = i.map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${_i(e)}(?![a-zA-Z0-9_-])`)), o = K.None, s = !1;
2246
2247
  for (let e of Array.from(document.styleSheets)) {
2247
2248
  let t;
2248
2249
  try {
@@ -2250,13 +2251,13 @@ function di(e) {
2250
2251
  } catch {
2251
2252
  continue;
2252
2253
  }
2253
- let n = fi(t, a, i, !1);
2254
- if (n.mask && (o |= n.mask, o === Or)) break;
2254
+ let n = pi(t, a, i, !1);
2255
+ if (n.mask && (o |= n.mask, o === kr)) break;
2255
2256
  s ||= n.sawStyleRule;
2256
2257
  }
2257
- return (o !== K.None || s) && jr.set(t, o), o;
2258
+ return (o !== K.None || s) && Mr.set(t, o), o;
2258
2259
  }
2259
- function fi(e, t, n, r) {
2260
+ function pi(e, t, n, r) {
2260
2261
  if (!e) return {
2261
2262
  mask: K.None,
2262
2263
  sawStyleRule: !1
@@ -2269,15 +2270,15 @@ function fi(e, t, n, r) {
2269
2270
  let e = s.selectorText ?? "";
2270
2271
  if (!e || !t.some((t) => t.test(e))) continue;
2271
2272
  a = !0;
2272
- for (let t of Tr) t.hints.some((t) => e.includes(t)) && (i |= t.flag);
2273
- if (!r && e.includes(Dr) && pi(e, n)) for (let t of Er) e.includes(t.hint) && (i |= t.flag);
2274
- if (i === Or) return {
2273
+ for (let t of Er) t.hints.some((t) => e.includes(t)) && (i |= t.flag);
2274
+ if (!r && e.includes(Or) && mi(e, n)) for (let t of Dr) e.includes(t.hint) && (i |= t.flag);
2275
+ if (i === kr) return {
2275
2276
  mask: i,
2276
2277
  sawStyleRule: !0
2277
2278
  };
2278
2279
  } else if ("cssRules" in s) {
2279
- let e = fi(s.cssRules, t, n, r || !mi(s));
2280
- if (e.mask && (i |= e.mask, i === Or)) return {
2280
+ let e = pi(s.cssRules, t, n, r || !hi(s));
2281
+ if (e.mask && (i |= e.mask, i === kr)) return {
2281
2282
  mask: i,
2282
2283
  sawStyleRule: !0
2283
2284
  };
@@ -2290,23 +2291,23 @@ function fi(e, t, n, r) {
2290
2291
  sawStyleRule: a
2291
2292
  };
2292
2293
  }
2293
- function pi(e, t) {
2294
+ function mi(e, t) {
2294
2295
  let n = e.trimStart().split(/\s/, 1)[0] ?? "";
2295
2296
  return t.includes(n);
2296
2297
  }
2297
- function mi(e) {
2298
+ function hi(e) {
2298
2299
  return typeof CSSLayerBlockRule < "u" && e instanceof CSSLayerBlockRule;
2299
2300
  }
2300
- function hi(e) {
2301
+ function gi(e) {
2301
2302
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2302
2303
  }
2303
- function gi(e) {
2304
+ function _i(e) {
2304
2305
  return e.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2305
2306
  }
2306
2307
  //#endregion
2307
2308
  //#region src/auth/storage.ts
2308
- var _i = "ikon-auth-session", vi = "ikon-auth-refreshable", yi = "ikon-auth-auto-login-attempted-run", bi = 6048e5, xi = 6e4;
2309
- function Si(e) {
2309
+ var vi = "ikon-auth-session", yi = "ikon-auth-refreshable", bi = "ikon-auth-auto-login-attempted-run", xi = 6048e5, Si = 6e4;
2310
+ function Ci(e) {
2310
2311
  try {
2311
2312
  let t = e.split(".");
2312
2313
  if (t.length !== 3) return;
@@ -2316,100 +2317,100 @@ function Si(e) {
2316
2317
  return;
2317
2318
  }
2318
2319
  }
2319
- function Ci(e) {
2320
- let t = Si(e);
2321
- return !t || typeof t.exp == "number" && Date.now() >= t.exp * 1e3 - xi;
2322
- }
2323
2320
  function wi(e) {
2324
- let t = Si(e)?.exp;
2321
+ let t = Ci(e);
2322
+ return !t || typeof t.exp == "number" && Date.now() >= t.exp * 1e3 - Si;
2323
+ }
2324
+ function Ti(e) {
2325
+ let t = Ci(e)?.exp;
2325
2326
  return typeof t == "number" ? (/* @__PURE__ */ new Date(t * 1e3)).toISOString() : void 0;
2326
2327
  }
2327
2328
  function J(e) {
2328
2329
  try {
2329
- localStorage.setItem(_i, JSON.stringify(e));
2330
+ localStorage.setItem(vi, JSON.stringify(e));
2330
2331
  } catch {
2331
2332
  console.warn("Failed to save auth session to localStorage");
2332
2333
  }
2333
2334
  }
2334
- function Ti() {
2335
+ function Ei() {
2335
2336
  try {
2336
- let e = localStorage.getItem(_i);
2337
+ let e = localStorage.getItem(vi);
2337
2338
  if (!e) return null;
2338
2339
  let t = JSON.parse(e);
2339
- return Date.now() - t.authenticatedAt > bi || Ci(t.token) ? (Ni(), null) : t;
2340
+ return Date.now() - t.authenticatedAt > xi || wi(t.token) ? (Pi(), null) : t;
2340
2341
  } catch {
2341
2342
  return console.warn("Failed to load auth session from localStorage"), null;
2342
2343
  }
2343
2344
  }
2344
- function Ei() {
2345
+ function Di() {
2345
2346
  try {
2346
- let e = localStorage.getItem(_i);
2347
+ let e = localStorage.getItem(vi);
2347
2348
  if (!e) return !1;
2348
2349
  let t = JSON.parse(e);
2349
- return t.provider === "dev" && Ci(t.token);
2350
+ return t.provider === "dev" && wi(t.token);
2350
2351
  } catch {
2351
2352
  return !1;
2352
2353
  }
2353
2354
  }
2354
- function Di(e) {
2355
+ function Oi(e) {
2355
2356
  try {
2356
- localStorage.removeItem(_i), localStorage.setItem(vi, JSON.stringify(e));
2357
+ localStorage.removeItem(vi), localStorage.setItem(yi, JSON.stringify(e));
2357
2358
  } catch {
2358
2359
  console.warn("Failed to save the auth session marker to localStorage");
2359
2360
  }
2360
2361
  }
2361
- function Oi() {
2362
+ function ki() {
2362
2363
  try {
2363
- let e = localStorage.getItem(vi);
2364
+ let e = localStorage.getItem(yi);
2364
2365
  if (!e) return null;
2365
2366
  let t = JSON.parse(e);
2366
- return Date.now() - t.renewedAt > bi ? (Ai(), null) : t;
2367
+ return Date.now() - t.renewedAt > xi ? (ji(), null) : t;
2367
2368
  } catch {
2368
2369
  return console.warn("Failed to load the auth session marker from localStorage"), null;
2369
2370
  }
2370
2371
  }
2371
- function ki() {
2372
- let e = Oi();
2373
- e && Di({
2372
+ function Ai() {
2373
+ let e = ki();
2374
+ e && Oi({
2374
2375
  ...e,
2375
2376
  renewedAt: Date.now()
2376
2377
  });
2377
2378
  }
2378
- function Ai() {
2379
+ function ji() {
2379
2380
  try {
2380
- localStorage.removeItem(vi);
2381
+ localStorage.removeItem(yi);
2381
2382
  } catch {
2382
2383
  console.warn("Failed to clear the auth session marker from localStorage");
2383
2384
  }
2384
2385
  }
2385
- function ji() {
2386
- Ti()?.provider === "anonymous" && Ni(), Oi()?.provider === "anonymous" && Ai();
2387
- }
2388
2386
  function Mi() {
2387
+ Ei()?.provider === "anonymous" && Pi(), ki()?.provider === "anonymous" && ji();
2388
+ }
2389
+ function Ni() {
2389
2390
  try {
2390
2391
  let e = typeof window < "u" ? new URLSearchParams(window.location.search) : void 0;
2391
2392
  if (e?.get("ikon_token") || e?.get("ikon_code")) return !0;
2392
2393
  } catch {}
2393
- let e = Ti()?.provider ?? Oi()?.provider;
2394
+ let e = Ei()?.provider ?? ki()?.provider;
2394
2395
  return e !== void 0 && e !== "anonymous";
2395
2396
  }
2396
- function Ni() {
2397
+ function Pi() {
2397
2398
  try {
2398
- localStorage.removeItem(_i);
2399
+ localStorage.removeItem(vi);
2399
2400
  } catch {
2400
2401
  console.warn("Failed to clear auth session from localStorage");
2401
2402
  }
2402
2403
  }
2403
- function Pi(e) {
2404
+ function Fi(e) {
2404
2405
  if (e) try {
2405
- sessionStorage.setItem(yi, e);
2406
+ sessionStorage.setItem(bi, e);
2406
2407
  } catch {
2407
2408
  console.warn("Failed to record auto-login attempt in sessionStorage");
2408
2409
  }
2409
2410
  }
2410
- function Fi() {
2411
+ function Ii() {
2411
2412
  try {
2412
- return sessionStorage.getItem(yi);
2413
+ return sessionStorage.getItem(bi);
2413
2414
  } catch {
2414
2415
  return null;
2415
2416
  }
@@ -2425,8 +2426,8 @@ function Y(e) {
2425
2426
  }
2426
2427
  //#endregion
2427
2428
  //#region src/auth/auth-service.ts
2428
- var Ii = 15e3, Li = 15e3, X = D("AuthService");
2429
- async function Ri(e) {
2429
+ var Li = 15e3, Ri = 15e3, X = O("AuthService");
2430
+ async function zi(e) {
2430
2431
  try {
2431
2432
  return await fetch(e, {
2432
2433
  method: "GET",
@@ -2436,34 +2437,34 @@ async function Ri(e) {
2436
2437
  return `no-cors probe ALSO FAILED (${e instanceof Error ? e.name : "Error"}) → origin is unreachable: TLS handshake / certificate, DNS, or network (old browser may not trust this host's cert)`;
2437
2438
  }
2438
2439
  }
2439
- var zi = "x-ikon-auth-service";
2440
- function Bi(e) {
2441
- if (e.headers.get(zi) !== null) return !1;
2440
+ var Bi = "x-ikon-auth-service";
2441
+ function Vi(e) {
2442
+ if (e.headers.get(Bi) !== null) return !1;
2442
2443
  if (e.status === 404 || e.status === 405) return !0;
2443
2444
  let t = e.headers.get("content-type") ?? "";
2444
2445
  return e.status === 200 && t.includes("text/html");
2445
2446
  }
2446
2447
  async function Z(e, t, n) {
2447
- let r = `${e}${t}`, i = De(), a = i !== null && e === i, o = a ? await ye() : i, s = o !== null && o !== e ? `${o}${t}` : null, c;
2448
+ let r = `${e}${t}`, i = Ee(), a = i !== null && e === i, o = a ? await ve() : i, s = o !== null && o !== e ? `${o}${t}` : null, c;
2448
2449
  try {
2449
2450
  c = await fetch(r, n);
2450
2451
  } catch (i) {
2451
2452
  let a = i instanceof Error ? `${i.name}: ${i.message}` : String(i);
2452
2453
  if (!s) {
2453
- let n = await Ri(e);
2454
+ let n = await zi(e);
2454
2455
  throw X.error(`Auth request ${t} could not reach ${r} — ${a}. ${n}`), Error(`Auth request could not reach ${r} (${a}). ${n}`, { cause: i });
2455
2456
  }
2456
2457
  X.warn(`Auth request ${t} could not reach ${r} (${a}); falling back to ${s}`);
2457
2458
  try {
2458
2459
  return await fetch(s, n);
2459
2460
  } catch (n) {
2460
- let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await Ri(e);
2461
+ let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await zi(e);
2461
2462
  throw X.error(`Auth request ${t} failed on both ${r} (${a}) and ${s} (${i}). ${o}`), Error(`Auth request unreachable: ${r} (${a}) and ${s} (${i})`, { cause: n });
2462
2463
  }
2463
2464
  }
2464
- return a && s !== null && Bi(c) ? (X.warn(`Auth request ${t} got a non-auth-service answer from ${r} (${c.status}); this LB has no /ikon/auth route, falling back to ${s}`), fetch(s, n)) : c;
2465
+ return a && s !== null && Vi(c) ? (X.warn(`Auth request ${t} got a non-auth-service answer from ${r} (${c.status}); this LB has no /ikon/auth route, falling back to ${s}`), fetch(s, n)) : c;
2465
2466
  }
2466
- async function Vi(e, t) {
2467
+ async function Hi(e, t) {
2467
2468
  let n;
2468
2469
  try {
2469
2470
  n = await e.json();
@@ -2476,15 +2477,15 @@ async function Vi(e, t) {
2476
2477
  ...typeof n.expiresAt == "string" && n.expiresAt.length > 0 ? { expiresAt: n.expiresAt } : {}
2477
2478
  };
2478
2479
  }
2479
- async function Hi(e, t, n) {
2480
- let r = Ee(), i = n === "guest" ? "anonymous" : n, a = {
2480
+ async function Ui(e, t, n) {
2481
+ let r = Te(), i = n === "guest" ? "anonymous" : n, a = {
2481
2482
  method: "POST",
2482
2483
  headers: { "Content-Type": "application/json" },
2483
2484
  body: JSON.stringify({
2484
2485
  deviceId: r,
2485
2486
  space: e,
2486
2487
  ...i ? { method: i } : {},
2487
- testLink: ke() ?? void 0
2488
+ testLink: Oe() ?? void 0
2488
2489
  })
2489
2490
  }, o = typeof window < "u" ? window.location.origin : "?";
2490
2491
  X.debug(`Anonymous auth: POST ${t}/anonymous (space=${e}, origin=${o})`);
@@ -2493,14 +2494,14 @@ async function Hi(e, t, n) {
2493
2494
  let e = await s.text().catch(() => "Unknown error");
2494
2495
  throw X.error(`Anonymous auth HTTP ${s.status} from ${s.url}: ${e}`), Error(`Anonymous auth failed: ${s.status} ${e}`);
2495
2496
  }
2496
- let { token: c } = await Vi(s, `Anonymous auth for space ${e}`), l = {
2497
+ let { token: c } = await Hi(s, `Anonymous auth for space ${e}`), l = {
2497
2498
  token: c,
2498
2499
  provider: "anonymous",
2499
2500
  authenticatedAt: Date.now()
2500
2501
  };
2501
2502
  return J(l), l;
2502
2503
  }
2503
- async function Ui({ email: e, spaceId: t, authUrl: n }) {
2504
+ async function Wi({ email: e, spaceId: t, authUrl: n }) {
2504
2505
  let r = await Z(n, "/email/send", {
2505
2506
  method: "POST",
2506
2507
  headers: { "Content-Type": "application/json" },
@@ -2508,14 +2509,14 @@ async function Ui({ email: e, spaceId: t, authUrl: n }) {
2508
2509
  email: e.trim(),
2509
2510
  space: t
2510
2511
  }),
2511
- signal: E(Ii)
2512
+ signal: D(Li)
2512
2513
  });
2513
2514
  if (!r.ok) {
2514
2515
  let e = await r.text().catch(() => "Failed to send login code");
2515
2516
  throw Error(e);
2516
2517
  }
2517
2518
  }
2518
- async function Wi({ email: e, code: t, authUrl: n }) {
2519
+ async function Gi({ email: e, code: t, authUrl: n }) {
2519
2520
  let r = await Z(n, "/email/code", {
2520
2521
  method: "POST",
2521
2522
  headers: { "Content-Type": "application/json" },
@@ -2523,37 +2524,37 @@ async function Wi({ email: e, code: t, authUrl: n }) {
2523
2524
  email: e.trim(),
2524
2525
  code: t.trim()
2525
2526
  }),
2526
- signal: E(Ii)
2527
+ signal: D(Li)
2527
2528
  });
2528
2529
  if (!r.ok) {
2529
2530
  let e = await r.text().catch(() => "Invalid code");
2530
2531
  throw Error(e);
2531
2532
  }
2532
- let { token: i } = await Vi(r, "Login-code verification"), a = {
2533
+ let { token: i } = await Hi(r, "Login-code verification"), a = {
2533
2534
  token: i,
2534
2535
  provider: "email",
2535
2536
  authenticatedAt: Date.now()
2536
2537
  };
2537
2538
  return J(a), a;
2538
2539
  }
2539
- function Gi() {
2540
- let e = new URLSearchParams(window.location.search), t = e.get(w), n = e.get(C);
2540
+ function Ki() {
2541
+ let e = new URLSearchParams(window.location.search), t = e.get(T), n = e.get(w);
2541
2542
  return t && n ? {
2542
2543
  token: t,
2543
2544
  provider: n
2544
2545
  } : null;
2545
2546
  }
2546
- function Ki() {
2547
- let e = new URLSearchParams(window.location.search), t = e.get(te), n = e.get(C);
2547
+ function qi() {
2548
+ let e = new URLSearchParams(window.location.search), t = e.get(S), n = e.get(w);
2548
2549
  return t && n ? {
2549
2550
  code: t,
2550
2551
  provider: n
2551
2552
  } : null;
2552
2553
  }
2553
- async function qi(e, t, n) {
2554
- let r = Je();
2554
+ async function Ji(e, t, n) {
2555
+ let r = qe();
2555
2556
  if (!r) throw Error("This sign-in was started in a different browser or tab");
2556
- let i = await Z(await O(n), "/oauth/exchange", {
2557
+ let i = await Z(await k(n), "/oauth/exchange", {
2557
2558
  method: "POST",
2558
2559
  headers: { "Content-Type": "application/json" },
2559
2560
  body: JSON.stringify({
@@ -2561,29 +2562,29 @@ async function qi(e, t, n) {
2561
2562
  codeVerifier: r,
2562
2563
  supportsRefresh: !0
2563
2564
  }),
2564
- signal: E(Ii)
2565
+ signal: D(Li)
2565
2566
  });
2566
2567
  if (!i.ok) throw Error("Could not complete the sign-in");
2567
- let { token: a, expiresAt: o } = await Vi(i, `OAuth code exchange for ${t}`), s = {
2568
+ let { token: a, expiresAt: o } = await Hi(i, `OAuth code exchange for ${t}`), s = {
2568
2569
  token: a,
2569
2570
  provider: t,
2570
2571
  authenticatedAt: Date.now(),
2571
2572
  expiresAt: o
2572
2573
  };
2573
- return o ? Di({
2574
+ return o ? Oi({
2574
2575
  provider: t,
2575
2576
  authenticatedAt: s.authenticatedAt,
2576
2577
  renewedAt: s.authenticatedAt
2577
2578
  }) : J(s), s;
2578
2579
  }
2579
- async function Ji(e) {
2580
- let t = De();
2580
+ async function Yi(e) {
2581
+ let t = Ee();
2581
2582
  if (t === null) return null;
2582
2583
  let n;
2583
2584
  try {
2584
2585
  n = await fetch(`${t}/session/refresh`, {
2585
2586
  method: "POST",
2586
- signal: E(Li)
2587
+ signal: D(Ri)
2587
2588
  });
2588
2589
  } catch (e) {
2589
2590
  let n = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
@@ -2591,7 +2592,7 @@ async function Ji(e) {
2591
2592
  }
2592
2593
  if (n.status === 401) return null;
2593
2594
  if (!n.ok) throw Error(`Session renewal failed: ${n.status}`);
2594
- let { token: r, expiresAt: i } = await Vi(n, "Session renewal");
2595
+ let { token: r, expiresAt: i } = await Hi(n, "Session renewal");
2595
2596
  if (!i) throw Error("Session renewal returned a token with no expiry");
2596
2597
  return {
2597
2598
  token: r,
@@ -2600,17 +2601,17 @@ async function Ji(e) {
2600
2601
  expiresAt: i
2601
2602
  };
2602
2603
  }
2603
- function Yi() {
2604
+ function Xi() {
2604
2605
  let e = new URLSearchParams(window.location.search), t = e.get("error");
2605
2606
  return t ? {
2606
2607
  code: t,
2607
- provider: e.get(C)
2608
+ provider: e.get(w)
2608
2609
  } : null;
2609
2610
  }
2610
- function Xi() {
2611
- return Oe();
2611
+ function Zi() {
2612
+ return De();
2612
2613
  }
2613
- var Zi = {
2614
+ var Qi = {
2614
2615
  google: "Google",
2615
2616
  facebook: "Facebook",
2616
2617
  apple: "Apple",
@@ -2618,8 +2619,8 @@ var Zi = {
2618
2619
  signicat: "eID",
2619
2620
  sso: "organisation"
2620
2621
  };
2621
- function Qi(e, t, n) {
2622
- let r = t ? Zi[t] ?? t : "this provider";
2622
+ function $i(e, t, n) {
2623
+ let r = t ? Qi[t] ?? t : "this provider";
2623
2624
  switch (e) {
2624
2625
  case "account_exists_unverified_email": {
2625
2626
  let e = `This email address already has an account on this app that uses a different sign-in method. For security, ${r} sign-in can't be connected to it automatically.`;
@@ -2640,21 +2641,21 @@ function Qi(e, t, n) {
2640
2641
  default: return e;
2641
2642
  }
2642
2643
  }
2643
- function $i() {
2644
+ function ea() {
2644
2645
  let e = new URLSearchParams(window.location.search);
2645
2646
  for (let t of [
2647
+ T,
2648
+ S,
2646
2649
  w,
2647
- te,
2648
- C,
2649
2650
  "error",
2650
- S
2651
+ C
2651
2652
  ]) e.delete(t);
2652
2653
  let t = e.toString();
2653
2654
  window.history.replaceState({}, "", t.length > 0 ? `${window.location.pathname}?${t}` : window.location.pathname);
2654
2655
  }
2655
- async function ea(e, t, n, r) {
2656
- let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await _e();
2657
- return de({
2656
+ async function ta(e, t, n, r) {
2657
+ let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await ge();
2658
+ return ue({
2658
2659
  authUrl: n,
2659
2660
  provider: e,
2660
2661
  spaceId: t,
@@ -2662,20 +2663,20 @@ async function ea(e, t, n, r) {
2662
2663
  codeChallenge: a ?? void 0
2663
2664
  });
2664
2665
  }
2665
- async function ta(e, t, n, r = {}) {
2666
- let i = await _e();
2666
+ async function na(e, t, n, r = {}) {
2667
+ let i = await ge();
2667
2668
  if (!i) return null;
2668
- let a = r.returnUrl ?? window.location.origin + window.location.pathname + window.location.search, o = r.linkSessionToken ? await ia(n, r.linkSessionToken, e, i) : void 0;
2669
- return de({
2669
+ let a = r.returnUrl ?? window.location.origin + window.location.pathname + window.location.search, o = r.linkSessionToken ? await aa(n, r.linkSessionToken, e, i) : void 0;
2670
+ return ue({
2670
2671
  authUrl: n,
2671
- provider: `${T}${e}`,
2672
+ provider: `${E}${e}`,
2672
2673
  spaceId: t,
2673
2674
  returnUrl: a,
2674
2675
  codeChallenge: i,
2675
2676
  linkTicket: o
2676
2677
  });
2677
2678
  }
2678
- async function na(e, t) {
2679
+ async function ra(e, t) {
2679
2680
  try {
2680
2681
  let n = await Z(e, `/sso/connections?host=${encodeURIComponent(t)}`, { method: "GET" });
2681
2682
  return n.ok ? await n.json() : [];
@@ -2683,7 +2684,7 @@ async function na(e, t) {
2683
2684
  return X.warn(`Could not look up the SSO connections of ${t}: ${e instanceof Error ? e.message : String(e)}`), [];
2684
2685
  }
2685
2686
  }
2686
- async function ra(e, t, n) {
2687
+ async function ia(e, t, n) {
2687
2688
  let r = await Z(e, "/sso/discover", {
2688
2689
  method: "POST",
2689
2690
  headers: { "Content-Type": "application/json" },
@@ -2695,7 +2696,7 @@ async function ra(e, t, n) {
2695
2696
  if (!r.ok) throw Error(r.status === 429 ? "Too many attempts. Please wait a minute and try again." : "Could not look up your organisation sign-in.");
2696
2697
  return (await r.json()).connection ?? null;
2697
2698
  }
2698
- async function ia(e, t, n, r) {
2699
+ async function aa(e, t, n, r) {
2699
2700
  try {
2700
2701
  let i = await Z(e, "/oauth/sso/link-intent", {
2701
2702
  method: "POST",
@@ -2714,7 +2715,7 @@ async function ia(e, t, n, r) {
2714
2715
  return;
2715
2716
  }
2716
2717
  }
2717
- async function aa(e) {
2718
+ async function oa(e) {
2718
2719
  let t = await Z(e, "/passkey/registration/options", {
2719
2720
  method: "POST",
2720
2721
  headers: { "Content-Type": "application/json" }
@@ -2725,7 +2726,7 @@ async function aa(e) {
2725
2726
  }
2726
2727
  return t.json();
2727
2728
  }
2728
- async function oa(e, t, n) {
2729
+ async function sa(e, t, n) {
2729
2730
  let r = await Z(e, "/passkey/registration/verify", {
2730
2731
  method: "POST",
2731
2732
  headers: { "Content-Type": "application/json" },
@@ -2738,14 +2739,14 @@ async function oa(e, t, n) {
2738
2739
  let e = await r.text().catch(() => "Registration verification failed");
2739
2740
  throw Error(e);
2740
2741
  }
2741
- let { token: i } = await Vi(r, "Passkey registration verification"), a = {
2742
+ let { token: i } = await Hi(r, "Passkey registration verification"), a = {
2742
2743
  token: i,
2743
2744
  provider: "passkey",
2744
2745
  authenticatedAt: Date.now()
2745
2746
  };
2746
2747
  return J(a), a;
2747
2748
  }
2748
- async function sa(e, t) {
2749
+ async function ca(e, t) {
2749
2750
  let n = await Z(e, "/passkey/authentication/options", {
2750
2751
  method: "POST",
2751
2752
  headers: { "Content-Type": "application/json" },
@@ -2757,7 +2758,7 @@ async function sa(e, t) {
2757
2758
  }
2758
2759
  return n.json();
2759
2760
  }
2760
- async function ca(e, t) {
2761
+ async function la(e, t) {
2761
2762
  let n = await Z(e, "/passkey/authentication/verify", {
2762
2763
  method: "POST",
2763
2764
  headers: { "Content-Type": "application/json" },
@@ -2767,19 +2768,19 @@ async function ca(e, t) {
2767
2768
  let e = await n.text().catch(() => "Authentication verification failed");
2768
2769
  throw Error(e);
2769
2770
  }
2770
- let { token: r } = await Vi(n, "Passkey authentication verification"), i = {
2771
+ let { token: r } = await Hi(n, "Passkey authentication verification"), i = {
2771
2772
  token: r,
2772
2773
  provider: "passkey",
2773
2774
  authenticatedAt: Date.now()
2774
2775
  };
2775
2776
  return J(i), i;
2776
2777
  }
2777
- async function la(e, t) {
2778
+ async function ua(e, t) {
2778
2779
  try {
2779
- await Z(await O(t), "/logout", {
2780
+ await Z(await k(t), "/logout", {
2780
2781
  method: "POST",
2781
2782
  headers: { Authorization: `Bearer ${e}` },
2782
- signal: E(Ii)
2783
+ signal: D(Li)
2783
2784
  });
2784
2785
  } catch {}
2785
2786
  }
@@ -2792,31 +2793,31 @@ function Q(e) {
2792
2793
  }
2793
2794
  //#endregion
2794
2795
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js
2795
- function ua(e) {
2796
+ function da(e) {
2796
2797
  let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = (4 - t.length % 4) % 4, r = t.padEnd(t.length + n, "="), i = atob(r), a = new ArrayBuffer(i.length), o = new Uint8Array(a);
2797
2798
  for (let e = 0; e < i.length; e++) o[e] = i.charCodeAt(e);
2798
2799
  return a;
2799
2800
  }
2800
2801
  //#endregion
2801
2802
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js
2802
- function da() {
2803
- return fa.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2803
+ function fa() {
2804
+ return pa.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2804
2805
  }
2805
- var fa = { stubThis: (e) => e };
2806
+ var pa = { stubThis: (e) => e };
2806
2807
  //#endregion
2807
2808
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js
2808
- function pa(e) {
2809
+ function ma(e) {
2809
2810
  let { id: t } = e;
2810
2811
  return {
2811
2812
  ...e,
2812
- id: ua(t),
2813
+ id: da(t),
2813
2814
  transports: e.transports,
2814
2815
  type: e.type
2815
2816
  };
2816
2817
  }
2817
2818
  //#endregion
2818
2819
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js
2819
- function ma(e) {
2820
+ function ha(e) {
2820
2821
  return e === "localhost" || /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e);
2821
2822
  }
2822
2823
  //#endregion
@@ -2833,7 +2834,7 @@ var $ = class extends Error {
2833
2834
  };
2834
2835
  //#endregion
2835
2836
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js
2836
- function ha({ error: e, options: t }) {
2837
+ function ga({ error: e, options: t }) {
2837
2838
  let { publicKey: n } = t;
2838
2839
  if (!n) throw Error("options was missing required publicKey property");
2839
2840
  if (e.name === "AbortError") {
@@ -2879,7 +2880,7 @@ function ha({ error: e, options: t }) {
2879
2880
  });
2880
2881
  else if (e.name === "SecurityError") {
2881
2882
  let t = globalThis.location.hostname;
2882
- if (!ma(t)) return new $({
2883
+ if (!ha(t)) return new $({
2883
2884
  message: `${globalThis.location.hostname} is an invalid domain`,
2884
2885
  code: "ERROR_INVALID_DOMAIN",
2885
2886
  cause: e
@@ -2902,7 +2903,7 @@ function ha({ error: e, options: t }) {
2902
2903
  });
2903
2904
  return e;
2904
2905
  }
2905
- var ga = new class {
2906
+ var _a = new class {
2906
2907
  constructor() {
2907
2908
  Object.defineProperty(this, "controller", {
2908
2909
  enumerable: !0,
@@ -2925,31 +2926,31 @@ var ga = new class {
2925
2926
  e.name = "AbortError", this.controller.abort(e), this.controller = void 0;
2926
2927
  }
2927
2928
  }
2928
- }(), _a = ["cross-platform", "platform"];
2929
- function va(e) {
2930
- if (e && !(_a.indexOf(e) < 0)) return e;
2929
+ }(), va = ["cross-platform", "platform"];
2930
+ function ya(e) {
2931
+ if (e && !(va.indexOf(e) < 0)) return e;
2931
2932
  }
2932
2933
  //#endregion
2933
2934
  //#region ../../node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js
2934
- async function ya(e) {
2935
+ async function ba(e) {
2935
2936
  !e.optionsJSON && e.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
2936
2937
  let { optionsJSON: t, useAutoRegister: n = !1 } = e;
2937
- if (!da()) throw Error("WebAuthn is not supported in this browser");
2938
+ if (!fa()) throw Error("WebAuthn is not supported in this browser");
2938
2939
  let r = {
2939
2940
  ...t,
2940
- challenge: ua(t.challenge),
2941
+ challenge: da(t.challenge),
2941
2942
  user: {
2942
2943
  ...t.user,
2943
- id: ua(t.user.id)
2944
+ id: da(t.user.id)
2944
2945
  },
2945
- excludeCredentials: t.excludeCredentials?.map(pa)
2946
+ excludeCredentials: t.excludeCredentials?.map(ma)
2946
2947
  }, i = {};
2947
- n && (i.mediation = "conditional"), i.publicKey = r, i.signal = ga.createNewAbortSignal();
2948
+ n && (i.mediation = "conditional"), i.publicKey = r, i.signal = _a.createNewAbortSignal();
2948
2949
  let a;
2949
2950
  try {
2950
2951
  a = await navigator.credentials.create(i);
2951
2952
  } catch (e) {
2952
- throw ha({
2953
+ throw ga({
2953
2954
  error: e,
2954
2955
  options: i
2955
2956
  });
@@ -2961,20 +2962,20 @@ async function ya(e) {
2961
2962
  if (typeof c.getPublicKeyAlgorithm == "function") try {
2962
2963
  d = c.getPublicKeyAlgorithm();
2963
2964
  } catch (e) {
2964
- ba("getPublicKeyAlgorithm()", e);
2965
+ xa("getPublicKeyAlgorithm()", e);
2965
2966
  }
2966
2967
  let f;
2967
2968
  if (typeof c.getPublicKey == "function") try {
2968
2969
  let e = c.getPublicKey();
2969
2970
  e !== null && (f = Q(e));
2970
2971
  } catch (e) {
2971
- ba("getPublicKey()", e);
2972
+ xa("getPublicKey()", e);
2972
2973
  }
2973
2974
  let p;
2974
2975
  if (typeof c.getAuthenticatorData == "function") try {
2975
2976
  p = Q(c.getAuthenticatorData());
2976
2977
  } catch (e) {
2977
- ba("getAuthenticatorData()", e);
2978
+ xa("getAuthenticatorData()", e);
2978
2979
  }
2979
2980
  return {
2980
2981
  id: o,
@@ -2989,23 +2990,23 @@ async function ya(e) {
2989
2990
  },
2990
2991
  type: l,
2991
2992
  clientExtensionResults: a.getClientExtensionResults(),
2992
- authenticatorAttachment: va(a.authenticatorAttachment)
2993
+ authenticatorAttachment: ya(a.authenticatorAttachment)
2993
2994
  };
2994
2995
  }
2995
- function ba(e, t) {
2996
+ function xa(e, t) {
2996
2997
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`, t);
2997
2998
  }
2998
2999
  //#endregion
2999
3000
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js
3000
- function xa() {
3001
- if (!da()) return Sa.stubThis(new Promise((e) => e(!1)));
3001
+ function Sa() {
3002
+ if (!fa()) return Ca.stubThis(new Promise((e) => e(!1)));
3002
3003
  let e = globalThis.PublicKeyCredential;
3003
- return e?.isConditionalMediationAvailable === void 0 ? Sa.stubThis(new Promise((e) => e(!1))) : Sa.stubThis(e.isConditionalMediationAvailable());
3004
+ return e?.isConditionalMediationAvailable === void 0 ? Ca.stubThis(new Promise((e) => e(!1))) : Ca.stubThis(e.isConditionalMediationAvailable());
3004
3005
  }
3005
- var Sa = { stubThis: (e) => e };
3006
+ var Ca = { stubThis: (e) => e };
3006
3007
  //#endregion
3007
3008
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js
3008
- function Ca({ error: e, options: t }) {
3009
+ function wa({ error: e, options: t }) {
3009
3010
  let { publicKey: n } = t;
3010
3011
  if (!n) throw Error("options was missing required publicKey property");
3011
3012
  if (e.name === "AbortError") {
@@ -3021,7 +3022,7 @@ function Ca({ error: e, options: t }) {
3021
3022
  });
3022
3023
  else if (e.name === "SecurityError") {
3023
3024
  let t = globalThis.location.hostname;
3024
- if (!ma(t)) return new $({
3025
+ if (!ha(t)) return new $({
3025
3026
  message: `${globalThis.location.hostname} is an invalid domain`,
3026
3027
  code: "ERROR_INVALID_DOMAIN",
3027
3028
  cause: e
@@ -3040,28 +3041,28 @@ function Ca({ error: e, options: t }) {
3040
3041
  }
3041
3042
  //#endregion
3042
3043
  //#region ../../node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js
3043
- async function wa(e) {
3044
+ async function Ta(e) {
3044
3045
  !e.optionsJSON && e.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
3045
3046
  let { optionsJSON: t, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = e;
3046
- if (!da()) throw Error("WebAuthn is not supported in this browser");
3047
+ if (!fa()) throw Error("WebAuthn is not supported in this browser");
3047
3048
  let i;
3048
- t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(pa));
3049
+ t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(ma));
3049
3050
  let a = {
3050
3051
  ...t,
3051
- challenge: ua(t.challenge),
3052
+ challenge: da(t.challenge),
3052
3053
  allowCredentials: i
3053
3054
  }, o = {};
3054
3055
  if (n) {
3055
- if (!await xa()) throw Error("Browser does not support WebAuthn autofill");
3056
+ if (!await Sa()) throw Error("Browser does not support WebAuthn autofill");
3056
3057
  if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r) throw Error("No <input> with \"webauthn\" as the only or last value in its `autocomplete` attribute was detected");
3057
3058
  o.mediation = "conditional", a.allowCredentials = [];
3058
3059
  }
3059
- o.publicKey = a, o.signal = ga.createNewAbortSignal();
3060
+ o.publicKey = a, o.signal = _a.createNewAbortSignal();
3060
3061
  let s;
3061
3062
  try {
3062
3063
  s = await navigator.credentials.get(o);
3063
3064
  } catch (e) {
3064
- throw Ca({
3065
+ throw wa({
3065
3066
  error: e,
3066
3067
  options: o
3067
3068
  });
@@ -3079,38 +3080,38 @@ async function wa(e) {
3079
3080
  },
3080
3081
  type: d,
3081
3082
  clientExtensionResults: s.getClientExtensionResults(),
3082
- authenticatorAttachment: va(s.authenticatorAttachment)
3083
+ authenticatorAttachment: ya(s.authenticatorAttachment)
3083
3084
  };
3084
3085
  }
3085
3086
  //#endregion
3086
3087
  //#region src/auth/auth-context.tsx
3087
- var Ta = "/dev-login-token", Ea = "X-Ikon-Dev-Login-Run";
3088
- async function Da(e) {
3088
+ var Ea = "/dev-login-token", Da = "X-Ikon-Dev-Login-Run";
3089
+ async function Oa(e) {
3089
3090
  let t = typeof window < "u" ? window.__IKON_LOCAL_IKON_SERVER_CONFIG__ : void 0;
3090
3091
  if (!(!t?.enabled || !t.host || !t.port)) try {
3091
- let n = await fetch(`https://${t.host}:${t.port}${Ta}`, {
3092
+ let n = await fetch(`https://${t.host}:${t.port}${Ea}`, {
3092
3093
  cache: "no-store",
3093
- headers: { [Ea]: e }
3094
+ headers: { [Da]: e }
3094
3095
  });
3095
3096
  return n.ok && (await n.json()).token || void 0;
3096
3097
  } catch {
3097
3098
  return;
3098
3099
  }
3099
3100
  }
3100
- var Oa = Ze(null), ka = 12e4, Aa = 6e4;
3101
- function ja({ children: e, config: t }) {
3102
- let [n, r] = I({
3101
+ var ka = Xe(null), Aa = 12e4, ja = 6e4;
3102
+ function Ma({ children: e, config: t }) {
3103
+ let [n, r] = L({
3103
3104
  isAuthenticated: !1,
3104
3105
  isLoading: !0,
3105
3106
  user: null,
3106
3107
  error: null
3107
- }), i = t.methods.includes("email"), a = ke() !== null, o = !t.requireSignIn || t.methods.includes("guest") || t.methods.includes("global") || a, c = F(!1), l = F(!1), u = M(async (e) => {
3108
+ }), i = t.methods.includes("email"), a = Oe() !== null, o = !t.requireSignIn || t.methods.includes("guest") || t.methods.includes("global") || a, c = I(!1), l = I(!1), u = N(async (e) => {
3108
3109
  if (!l.current) {
3109
3110
  l.current = !0;
3110
3111
  try {
3111
- let t = await Ji(e);
3112
+ let t = await Yi(e);
3112
3113
  if (t === null) {
3113
- Ai(), r({
3114
+ ji(), r({
3114
3115
  isAuthenticated: !1,
3115
3116
  isLoading: !1,
3116
3117
  user: null,
@@ -3118,7 +3119,7 @@ function ja({ children: e, config: t }) {
3118
3119
  });
3119
3120
  return;
3120
3121
  }
3121
- ki(), r({
3122
+ Ai(), r({
3122
3123
  isAuthenticated: !0,
3123
3124
  isLoading: !1,
3124
3125
  user: Y(t),
@@ -3129,27 +3130,27 @@ function ja({ children: e, config: t }) {
3129
3130
  }
3130
3131
  }
3131
3132
  }, []);
3132
- N(() => {
3133
+ P(() => {
3133
3134
  (() => {
3134
3135
  if (c.current) return;
3135
- let e = t.devLoginRunId, n = !!e && Fi() === e && !Ei();
3136
- e && !Xi() && Pi(e);
3137
- let s = !!t.devLoginToken && !!e && !n && !Xi();
3138
- o || ji();
3139
- let l = Yi();
3136
+ let e = t.devLoginRunId, n = !!e && Ii() === e && !Di();
3137
+ e && !Zi() && Fi(e);
3138
+ let s = !!t.devLoginToken && !!e && !n && !Zi();
3139
+ o || Mi();
3140
+ let l = Xi();
3140
3141
  if (l) {
3141
- $i(), r({
3142
+ ea(), r({
3142
3143
  isAuthenticated: !1,
3143
3144
  isLoading: !1,
3144
3145
  user: null,
3145
- error: Qi(l.code, l.provider, { emailSignInAvailable: i })
3146
+ error: $i(l.code, l.provider, { emailSignInAvailable: i })
3146
3147
  });
3147
3148
  return;
3148
3149
  }
3149
- ue();
3150
- let u = Ki();
3150
+ le();
3151
+ let u = qi();
3151
3152
  if (u) {
3152
- c.current = !0, $i(), qi(u.code, u.provider, t.authUrl).then((e) => {
3153
+ c.current = !0, ea(), Ji(u.code, u.provider, t.authUrl).then((e) => {
3153
3154
  r({
3154
3155
  isAuthenticated: !0,
3155
3156
  isLoading: !1,
@@ -3166,14 +3167,14 @@ function ja({ children: e, config: t }) {
3166
3167
  });
3167
3168
  return;
3168
3169
  }
3169
- let d = Gi();
3170
+ let d = Ki();
3170
3171
  if (d) {
3171
3172
  let e = {
3172
3173
  token: d.token,
3173
3174
  provider: d.provider,
3174
3175
  authenticatedAt: Date.now()
3175
3176
  };
3176
- J(e), $i(), r({
3177
+ J(e), ea(), r({
3177
3178
  isAuthenticated: !0,
3178
3179
  isLoading: !1,
3179
3180
  user: Y(e),
@@ -3181,11 +3182,11 @@ function ja({ children: e, config: t }) {
3181
3182
  });
3182
3183
  return;
3183
3184
  }
3184
- let f = Oi();
3185
+ let f = ki();
3185
3186
  if (f) {
3186
- c.current = !0, Ji(f).then((e) => {
3187
+ c.current = !0, Yi(f).then((e) => {
3187
3188
  if (e === null) {
3188
- Ai(), r({
3189
+ ji(), r({
3189
3190
  isAuthenticated: !1,
3190
3191
  isLoading: !1,
3191
3192
  user: null,
@@ -3193,7 +3194,7 @@ function ja({ children: e, config: t }) {
3193
3194
  });
3194
3195
  return;
3195
3196
  }
3196
- ki(), r({
3197
+ Ai(), r({
3197
3198
  isAuthenticated: !0,
3198
3199
  isLoading: !1,
3199
3200
  user: Y(e),
@@ -3209,7 +3210,7 @@ function ja({ children: e, config: t }) {
3209
3210
  });
3210
3211
  return;
3211
3212
  }
3212
- let p = Ti();
3213
+ let p = Ei();
3213
3214
  if (p && !(s && p.provider === "anonymous")) {
3214
3215
  r({
3215
3216
  isAuthenticated: !0,
@@ -3225,7 +3226,7 @@ function ja({ children: e, config: t }) {
3225
3226
  token: e,
3226
3227
  provider: "dev",
3227
3228
  authenticatedAt: Date.now(),
3228
- expiresAt: wi(e)
3229
+ expiresAt: Ti(e)
3229
3230
  };
3230
3231
  J(t), r({
3231
3232
  isAuthenticated: !0,
@@ -3234,12 +3235,12 @@ function ja({ children: e, config: t }) {
3234
3235
  error: null
3235
3236
  });
3236
3237
  };
3237
- if (!Ci(t.devLoginToken)) {
3238
+ if (!wi(t.devLoginToken)) {
3238
3239
  n(t.devLoginToken);
3239
3240
  return;
3240
3241
  }
3241
- Da(e).then((e) => {
3242
- if (e && !Ci(e)) {
3242
+ Oa(e).then((e) => {
3243
+ if (e && !wi(e)) {
3243
3244
  n(e);
3244
3245
  return;
3245
3246
  }
@@ -3254,7 +3255,7 @@ function ja({ children: e, config: t }) {
3254
3255
  }
3255
3256
  if (a && t.spaceId) {
3256
3257
  let e = t.spaceId;
3257
- O(t.authUrl).then((t) => Hi(e, t, "guest")).then((e) => r({
3258
+ k(t.authUrl).then((t) => Ui(e, t, "guest")).then((e) => r({
3258
3259
  isAuthenticated: !0,
3259
3260
  isLoading: !1,
3260
3261
  user: Y(e),
@@ -3282,9 +3283,9 @@ function ja({ children: e, config: t }) {
3282
3283
  i,
3283
3284
  o,
3284
3285
  a
3285
- ]), N(() => {
3286
- if (t.spaceId) return Ie(t.spaceId, (e) => {
3287
- c.current = !0, e.codeVerifier && He(e.codeVerifier), qi(e.code, e.provider, t.authUrl).then((e) => {
3286
+ ]), P(() => {
3287
+ if (t.spaceId) return Fe(t.spaceId, (e) => {
3288
+ c.current = !0, e.codeVerifier && Ve(e.codeVerifier), Ji(e.code, e.provider, t.authUrl).then((e) => {
3288
3289
  r({
3289
3290
  isAuthenticated: !0,
3290
3291
  isLoading: !1,
@@ -3300,12 +3301,12 @@ function ja({ children: e, config: t }) {
3300
3301
  });
3301
3302
  });
3302
3303
  });
3303
- }, [t.spaceId, t.authUrl]), N(() => {
3304
+ }, [t.spaceId, t.authUrl]), P(() => {
3304
3305
  let e = n.user?.expiresAt;
3305
3306
  if (!e || n.user?.provider === "dev") return;
3306
- let t = Oi();
3307
+ let t = ki();
3307
3308
  if (!t) return;
3308
- let r = Date.parse(e) - ka, i = setTimeout(() => void u(t), Math.max(0, r - Date.now())), a = () => {
3309
+ let r = Date.parse(e) - Aa, i = setTimeout(() => void u(t), Math.max(0, r - Date.now())), a = () => {
3309
3310
  document.visibilityState === "visible" && Date.now() >= r && u(t);
3310
3311
  };
3311
3312
  return document.addEventListener("visibilitychange", a), () => {
@@ -3315,26 +3316,26 @@ function ja({ children: e, config: t }) {
3315
3316
  n.user?.expiresAt,
3316
3317
  n.user?.provider,
3317
3318
  u
3318
- ]), N(() => {
3319
+ ]), P(() => {
3319
3320
  if (n.user?.provider !== "dev") return;
3320
3321
  let e = t.devLoginRunId;
3321
3322
  if (!e) return;
3322
3323
  let i = n.user.expiresAt;
3323
3324
  if (!i) return;
3324
- let a = n.user.token, o = Date.parse(i) - ka, s, c = !1, l = !1, u = async () => {
3325
+ let a = n.user.token, o = Date.parse(i) - Aa, s, c = !1, l = !1, u = async () => {
3325
3326
  if (c || l) return;
3326
3327
  l = !0;
3327
- let t = await Da(e);
3328
+ let t = await Oa(e);
3328
3329
  if (l = !1, c) return;
3329
- if (!t || t === a || Ci(t)) {
3330
- s = setTimeout(() => void u(), Aa);
3330
+ if (!t || t === a || wi(t)) {
3331
+ s = setTimeout(() => void u(), ja);
3331
3332
  return;
3332
3333
  }
3333
3334
  let n = {
3334
3335
  token: t,
3335
3336
  provider: "dev",
3336
3337
  authenticatedAt: Date.now(),
3337
- expiresAt: wi(t)
3338
+ expiresAt: Ti(t)
3338
3339
  };
3339
3340
  J(n), r({
3340
3341
  isAuthenticated: !0,
@@ -3356,7 +3357,7 @@ function ja({ children: e, config: t }) {
3356
3357
  n.user?.expiresAt,
3357
3358
  n.user?.token
3358
3359
  ]);
3359
- let d = M(async (e) => {
3360
+ let d = N(async (e) => {
3360
3361
  if (!t.spaceId) {
3361
3362
  r((e) => ({
3362
3363
  ...e,
@@ -3366,7 +3367,7 @@ function ja({ children: e, config: t }) {
3366
3367
  }
3367
3368
  let n;
3368
3369
  try {
3369
- n = await O(t.authUrl);
3370
+ n = await k(t.authUrl);
3370
3371
  } catch (e) {
3371
3372
  r((t) => ({
3372
3373
  ...t,
@@ -3381,7 +3382,7 @@ function ja({ children: e, config: t }) {
3381
3382
  isLoading: !0
3382
3383
  }));
3383
3384
  try {
3384
- let i = await Hi(t.spaceId, n, e);
3385
+ let i = await Ui(t.spaceId, n, e);
3385
3386
  r({
3386
3387
  isAuthenticated: !0,
3387
3388
  isLoading: !1,
@@ -3404,7 +3405,7 @@ function ja({ children: e, config: t }) {
3404
3405
  error: null
3405
3406
  }));
3406
3407
  try {
3407
- let e = await wa({ optionsJSON: await sa(n) }), t = await ca(n, e);
3408
+ let e = await Ta({ optionsJSON: await ca(n) }), t = await la(n, e);
3408
3409
  r({
3409
3410
  isAuthenticated: !0,
3410
3411
  isLoading: !1,
@@ -3421,16 +3422,16 @@ function ja({ children: e, config: t }) {
3421
3422
  return;
3422
3423
  }
3423
3424
  if (e === "email") throw Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
3424
- if (Pe()) {
3425
- await Ge(e, t.spaceId) || r((e) => ({
3425
+ if (Ne()) {
3426
+ await We(e, t.spaceId) || r((e) => ({
3426
3427
  ...e,
3427
3428
  isLoading: !1,
3428
3429
  error: "The sign-in window did not complete. Allow pop-ups for this site and try again."
3429
3430
  }));
3430
3431
  return;
3431
3432
  }
3432
- window.location.href = await ea(e, t.spaceId, n);
3433
- }, [t.authUrl, t.spaceId]), f = M(async (e, n = {}) => {
3433
+ window.location.href = await ta(e, t.spaceId, n);
3434
+ }, [t.authUrl, t.spaceId]), f = N(async (e, n = {}) => {
3434
3435
  if (!t.spaceId) {
3435
3436
  r((e) => ({
3436
3437
  ...e,
@@ -3438,7 +3439,7 @@ function ja({ children: e, config: t }) {
3438
3439
  }));
3439
3440
  return;
3440
3441
  }
3441
- if (Pe()) {
3442
+ if (Ne()) {
3442
3443
  r((e) => ({
3443
3444
  ...e,
3444
3445
  isLoading: !1,
@@ -3447,7 +3448,7 @@ function ja({ children: e, config: t }) {
3447
3448
  return;
3448
3449
  }
3449
3450
  try {
3450
- let i = await O(t.authUrl), a = await ta(e, t.spaceId, i, { linkSessionToken: n.linkSessionToken });
3451
+ let i = await k(t.authUrl), a = await na(e, t.spaceId, i, { linkSessionToken: n.linkSessionToken });
3451
3452
  if (!a) {
3452
3453
  r((e) => ({
3453
3454
  ...e,
@@ -3464,28 +3465,28 @@ function ja({ children: e, config: t }) {
3464
3465
  error: e instanceof Error ? e.message : "Organisation sign-in failed"
3465
3466
  }));
3466
3467
  }
3467
- }, [t.authUrl, t.spaceId]), p = M(async (e) => {
3468
+ }, [t.authUrl, t.spaceId]), p = N(async (e) => {
3468
3469
  if (!t.spaceId) throw r((e) => ({
3469
3470
  ...e,
3470
3471
  error: "Space ID is not configured"
3471
3472
  })), Error("Space ID is not configured");
3472
- let n = await O(t.authUrl);
3473
- await Ui({
3473
+ let n = await k(t.authUrl);
3474
+ await Wi({
3474
3475
  email: e,
3475
3476
  spaceId: t.spaceId,
3476
3477
  authUrl: n
3477
3478
  });
3478
- }, [t.authUrl, t.spaceId]), m = M(async (e, n) => {
3479
+ }, [t.authUrl, t.spaceId]), m = N(async (e, n) => {
3479
3480
  r((e) => ({
3480
3481
  ...e,
3481
3482
  isLoading: !0,
3482
3483
  error: null
3483
3484
  }));
3484
3485
  try {
3485
- let i = await Wi({
3486
+ let i = await Gi({
3486
3487
  email: e,
3487
3488
  code: n,
3488
- authUrl: await O(t.authUrl)
3489
+ authUrl: await k(t.authUrl)
3489
3490
  });
3490
3491
  r({
3491
3492
  isAuthenticated: !0,
@@ -3501,23 +3502,23 @@ function ja({ children: e, config: t }) {
3501
3502
  error: t
3502
3503
  })), e;
3503
3504
  }
3504
- }, [t.authUrl]), h = M(() => {
3505
+ }, [t.authUrl]), h = N(() => {
3505
3506
  let e = n.user?.token;
3506
- e && la(e, t.authUrl), Ni(), Ai(), s.clearAll(), r({
3507
+ e && ua(e, t.authUrl), Pi(), ji(), s.clearAll(), r({
3507
3508
  isAuthenticated: !1,
3508
3509
  isLoading: !1,
3509
3510
  user: null,
3510
3511
  error: null
3511
3512
  });
3512
- }, [n.user?.token, t.authUrl]), g = M(async (e) => {
3513
- let n = await O(t.authUrl);
3513
+ }, [n.user?.token, t.authUrl]), g = N(async (e) => {
3514
+ let n = await k(t.authUrl);
3514
3515
  r((e) => ({
3515
3516
  ...e,
3516
3517
  isLoading: !0,
3517
3518
  error: null
3518
3519
  }));
3519
3520
  try {
3520
- let t = await oa(n, await ya({ optionsJSON: await aa(n) }), e);
3521
+ let t = await sa(n, await ba({ optionsJSON: await oa(n) }), e);
3521
3522
  r({
3522
3523
  isAuthenticated: !0,
3523
3524
  isLoading: !1,
@@ -3531,7 +3532,7 @@ function ja({ children: e, config: t }) {
3531
3532
  error: e instanceof Error ? e.message : "Passkey registration failed"
3532
3533
  }));
3533
3534
  }
3534
- }, [t.authUrl]), _ = M(() => n.user?.token ?? null, [n.user]), v = P(() => ({
3535
+ }, [t.authUrl]), _ = N(() => n.user?.token ?? null, [n.user]), v = F(() => ({
3535
3536
  state: n,
3536
3537
  login: d,
3537
3538
  loginWithSso: f,
@@ -3550,38 +3551,38 @@ function ja({ children: e, config: t }) {
3550
3551
  p,
3551
3552
  m
3552
3553
  ]);
3553
- return /* @__PURE__ */ L(Oa, {
3554
+ return /* @__PURE__ */ R(ka, {
3554
3555
  value: v,
3555
3556
  children: e
3556
3557
  });
3557
3558
  }
3558
- function Ma() {
3559
- let e = $e(Oa);
3559
+ function Na() {
3560
+ let e = Qe(ka);
3560
3561
  if (!e) throw Error("useAuth must be used within an AuthProvider");
3561
3562
  return e;
3562
3563
  }
3563
- function Na() {
3564
- return $e(Oa);
3564
+ function Pa() {
3565
+ return Qe(ka);
3565
3566
  }
3566
3567
  //#endregion
3567
3568
  //#region src/auth/oauth-continuation.ts
3568
- var Pa = "ikon-oauth", Fa = "ikon-oauth-continue", Ia = "ikon-oauth-continue-attempts", La = 5, Ra = 6e5;
3569
- function za() {
3570
- if (typeof window > "u") return !1;
3571
- let e = new URL(window.location.href).searchParams.get(Pa);
3572
- return e ? (qa(e), !0) : Ka() !== null;
3573
- }
3569
+ var Fa = "ikon-oauth", Ia = "ikon-oauth-continue", La = "ikon-oauth-continue-attempts", Ra = 5, za = 6e5;
3574
3570
  function Ba() {
3575
- return Va() !== null;
3571
+ if (typeof window > "u") return !1;
3572
+ let e = new URL(window.location.href).searchParams.get(Fa);
3573
+ return e ? (Ja(e), !0) : qa() !== null;
3576
3574
  }
3577
3575
  function Va() {
3578
- return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? Ka();
3576
+ return Ha() !== null;
3577
+ }
3578
+ function Ha() {
3579
+ return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? qa();
3579
3580
  }
3580
- var Ha = "You are not allowed to connect an application to this app with this account.";
3581
- async function Ua(e) {
3582
- let t = Va();
3581
+ var Ua = "You are not allowed to connect an application to this app with this account.";
3582
+ async function Wa(e) {
3583
+ let t = Ha();
3583
3584
  if (!t) return { status: "pending" };
3584
- if (!e) return Ga() < La ? (console.warn("[ikon] Waiting for the signed-in session before continuing the authorization that sent you here."), { status: "pending" }) : (Ja(), console.warn("[ikon] Gave up continuing the authorization that sent you here: no signed-in session became readable. Start the connection again from the application."), { status: "pending" });
3585
+ if (!e) return Ka() < Ra ? (console.warn("[ikon] Waiting for the signed-in session before continuing the authorization that sent you here."), { status: "pending" }) : (Ya(), console.warn("[ikon] Gave up continuing the authorization that sent you here: no signed-in session became readable. Start the connection again from the application."), { status: "pending" });
3585
3586
  try {
3586
3587
  let n = await fetch("/ikon/oauth/continue", {
3587
3588
  method: "POST",
@@ -3592,8 +3593,8 @@ async function Ua(e) {
3592
3593
  body: JSON.stringify({ continueId: t })
3593
3594
  });
3594
3595
  if (!n.ok) {
3595
- if (Ja(), n.status === 403) {
3596
- let e = await Wa(n);
3596
+ if (Ya(), n.status === 403) {
3597
+ let e = await Ga(n);
3597
3598
  return console.warn(`[ikon] The authorization that sent you here was refused: ${e}`), {
3598
3599
  status: "refused",
3599
3600
  message: e
@@ -3602,72 +3603,72 @@ async function Ua(e) {
3602
3603
  return console.warn(`[ikon] Could not continue the authorization that sent you here (${n.status}). Start the connection again from the application.`), { status: "pending" };
3603
3604
  }
3604
3605
  let { consentUrl: r } = await n.json();
3605
- return r ? (Ja(), window.location.href = r, { status: "handed-off" }) : (Ja(), console.warn("[ikon] The authorization that sent you here returned no consent step. Start the connection again from the application."), { status: "pending" });
3606
+ return r ? (Ya(), window.location.href = r, { status: "handed-off" }) : (Ya(), console.warn("[ikon] The authorization that sent you here returned no consent step. Start the connection again from the application."), { status: "pending" });
3606
3607
  } catch {
3607
3608
  return { status: "pending" };
3608
3609
  }
3609
3610
  }
3610
- async function Wa(e) {
3611
+ async function Ga(e) {
3611
3612
  try {
3612
3613
  let t = await e.json(), n = Array.isArray(t?.message) ? t.message.join(", ") : t?.message;
3613
- return typeof n == "string" && n.trim().length > 0 ? n : Ha;
3614
+ return typeof n == "string" && n.trim().length > 0 ? n : Ua;
3614
3615
  } catch {
3615
- return Ha;
3616
+ return Ua;
3616
3617
  }
3617
3618
  }
3618
- function Ga() {
3619
+ function Ka() {
3619
3620
  try {
3620
- let e = Number(sessionStorage.getItem(Ia) ?? "0") + 1;
3621
- return sessionStorage.setItem(Ia, String(e)), e;
3621
+ let e = Number(sessionStorage.getItem(La) ?? "0") + 1;
3622
+ return sessionStorage.setItem(La, String(e)), e;
3622
3623
  } catch {
3623
- return La;
3624
+ return Ra;
3624
3625
  }
3625
3626
  }
3626
- function Ka() {
3627
+ function qa() {
3627
3628
  try {
3628
- let e = sessionStorage.getItem(Fa);
3629
+ let e = sessionStorage.getItem(Ia);
3629
3630
  if (!e) return null;
3630
3631
  let { id: t, at: n } = JSON.parse(e);
3631
- return !t || typeof n != "number" || Date.now() - n > Ra ? (Ja(), null) : t;
3632
+ return !t || typeof n != "number" || Date.now() - n > za ? (Ya(), null) : t;
3632
3633
  } catch {
3633
- return Ja(), null;
3634
+ return Ya(), null;
3634
3635
  }
3635
3636
  }
3636
- function qa(e) {
3637
+ function Ja(e) {
3637
3638
  try {
3638
- sessionStorage.setItem(Fa, JSON.stringify({
3639
+ sessionStorage.setItem(Ia, JSON.stringify({
3639
3640
  id: e,
3640
3641
  at: Date.now()
3641
3642
  }));
3642
3643
  } catch {}
3643
3644
  }
3644
- function Ja() {
3645
+ function Ya() {
3645
3646
  try {
3646
- sessionStorage.removeItem(Fa), sessionStorage.removeItem(Ia);
3647
+ sessionStorage.removeItem(Ia), sessionStorage.removeItem(La);
3647
3648
  } catch {}
3648
3649
  try {
3649
3650
  let e = new URL(window.location.href);
3650
- e.searchParams.has("ikon-oauth") && (e.searchParams.delete(Pa), window.history.replaceState(null, "", e.toString()));
3651
+ e.searchParams.has("ikon-oauth") && (e.searchParams.delete(Fa), window.history.replaceState(null, "", e.toString()));
3651
3652
  } catch {}
3652
3653
  }
3653
3654
  //#endregion
3654
3655
  //#region src/auth/use-auth-guard.ts
3655
- function Ya(e) {
3656
- let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } = Ma(), o = F(!1), s = F(!1), c = F(null), l = nt(Ke, Te, Te), u = l.required;
3657
- N(() => {
3658
- za() && We("An application is asking to act as you. Sign in to review what it wants.");
3659
- }, []), N(() => {
3656
+ function Xa(e) {
3657
+ let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } = Na(), o = I(!1), s = I(!1), c = I(null), l = tt(Ge, we, we), u = l.required;
3658
+ P(() => {
3659
+ Ba() && Ue("An application is asking to act as you. Sign in to review what it wants.");
3660
+ }, []), P(() => {
3660
3661
  if (!(!u || !r.isAuthenticated || !r.user || r.user.provider === "anonymous")) {
3661
- if (!Ba()) {
3662
- c.current || he();
3662
+ if (!Va()) {
3663
+ c.current || me();
3663
3664
  return;
3664
3665
  }
3665
- s.current || (s.current = !0, Ua(a()).then((e) => {
3666
+ s.current || (s.current = !0, Wa(a()).then((e) => {
3666
3667
  if (e.status === "refused") {
3667
- c.current = e.message, We(e.message);
3668
+ c.current = e.message, Ue(e.message);
3668
3669
  return;
3669
3670
  }
3670
- (e.status === "handed-off" || !Ba()) && he();
3671
+ (e.status === "handed-off" || !Va()) && me();
3671
3672
  }).finally(() => {
3672
3673
  s.current = !1;
3673
3674
  }));
@@ -3677,12 +3678,12 @@ function Ya(e) {
3677
3678
  r.isAuthenticated,
3678
3679
  r.user,
3679
3680
  a
3680
- ]), N(() => {
3681
+ ]), P(() => {
3681
3682
  if (!n || r.isAuthenticated || r.isLoading || o.current) return;
3682
3683
  let e = t.methods.includes("global") ? "global" : t.methods.includes("guest") ? "guest" : null;
3683
3684
  if (!e) return;
3684
3685
  let a = new URLSearchParams(window.location.search), s = a.get(n);
3685
- if (s === "true" || s === "1" || s === "" || Xi()) {
3686
+ if (s === "true" || s === "1" || s === "" || Zi()) {
3686
3687
  a.delete(n);
3687
3688
  let t = a.toString(), r = window.location.pathname + (t ? `?${t}` : "");
3688
3689
  window.history.replaceState({}, "", r), o.current = !0, i(e);
@@ -3701,32 +3702,32 @@ function Ya(e) {
3701
3702
  isAuthenticated: r.isAuthenticated,
3702
3703
  error: r.error,
3703
3704
  isLoginPrompt: u && !p,
3704
- dismissLoginPrompt: he,
3705
+ dismissLoginPrompt: me,
3705
3706
  loginPromptReason: u ? l.reason : null
3706
3707
  };
3707
3708
  }
3708
3709
  //#endregion
3709
3710
  //#region src/auth/use-sso-sign-in.ts
3710
- function Xa(e) {
3711
- let { loginWithSso: t } = Ma(), n = e.methods.includes("sso"), [r, i] = I([]), [a, o] = I(!1), [s, c] = I(null);
3712
- N(() => {
3711
+ function Za(e) {
3712
+ let { loginWithSso: t } = Na(), n = e.methods.includes("sso"), [r, i] = L([]), [a, o] = L(!1), [s, c] = L(null);
3713
+ P(() => {
3713
3714
  if (!n || typeof window > "u") return;
3714
3715
  let t = !1;
3715
- return O(e.authUrl).then((e) => na(e, window.location.host)).then((e) => {
3716
+ return k(e.authUrl).then((e) => ra(e, window.location.host)).then((e) => {
3716
3717
  t || i(e);
3717
3718
  }).catch(() => void 0), () => {
3718
3719
  t = !0;
3719
3720
  };
3720
3721
  }, [n, e.authUrl]);
3721
- let l = M((e) => t(e), [t]);
3722
+ let l = N((e) => t(e), [t]);
3722
3723
  return {
3723
3724
  hostConnections: r,
3724
3725
  isDiscovering: a,
3725
3726
  discoverError: s,
3726
- discover: M(async (n) => {
3727
+ discover: N(async (n) => {
3727
3728
  c(null), o(!0);
3728
3729
  try {
3729
- let r = await ra(await O(e.authUrl), e.spaceId, n.trim());
3730
+ let r = await ia(await k(e.authUrl), e.spaceId, n.trim());
3730
3731
  if (!r) {
3731
3732
  c("There is no organisation sign-in for this address. Choose another way to sign in.");
3732
3733
  return;
@@ -3747,17 +3748,17 @@ function Xa(e) {
3747
3748
  }
3748
3749
  //#endregion
3749
3750
  //#region src/debug/debug-overlay.tsx
3750
- var Za = (() => {
3751
+ var Qa = (() => {
3751
3752
  try {
3752
- return Se();
3753
+ return xe();
3753
3754
  } catch {
3754
3755
  return !1;
3755
3756
  }
3756
- })(), Qa = Date.now(), $a = [], eo = 300;
3757
- function to(e) {
3758
- $a.push(`[+${((Date.now() - Qa) / 1e3).toFixed(1)}s] ${e}`), $a.length > eo && $a.shift();
3759
- }
3757
+ })(), $a = Date.now(), eo = [], to = 300;
3760
3758
  function no(e) {
3759
+ eo.push(`[+${((Date.now() - $a) / 1e3).toFixed(1)}s] ${e}`), eo.length > to && eo.shift();
3760
+ }
3761
+ function ro(e) {
3761
3762
  if (typeof e == "string") return e;
3762
3763
  if (e instanceof Error) return `${e.name}: ${e.message}`;
3763
3764
  try {
@@ -3766,10 +3767,10 @@ function no(e) {
3766
3767
  return String(e);
3767
3768
  }
3768
3769
  }
3769
- var ro = !1;
3770
- function io() {
3771
- if (ro || typeof window > "u") return;
3772
- ro = !0, window.addEventListener("error", (e) => to(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => to(`unhandledRejection: ${no(e.reason)}`));
3770
+ var io = !1;
3771
+ function ao() {
3772
+ if (io || typeof window > "u") return;
3773
+ io = !0, window.addEventListener("error", (e) => no(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => no(`unhandledRejection: ${ro(e.reason)}`));
3773
3774
  let e = console;
3774
3775
  for (let t of [
3775
3776
  "error",
@@ -3780,17 +3781,17 @@ function io() {
3780
3781
  let n = e[t]?.bind(console) ?? (() => void 0);
3781
3782
  e[t] = (...e) => {
3782
3783
  try {
3783
- to(`console.${t}: ${e.map(no).join(" ")}`);
3784
+ no(`console.${t}: ${e.map(ro).join(" ")}`);
3784
3785
  } catch {}
3785
3786
  n(...e);
3786
3787
  };
3787
3788
  }
3788
3789
  try {
3789
- qe((e) => to(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: re.DEBUG });
3790
+ Ke((e) => no(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: ne.DEBUG });
3790
3791
  } catch {}
3791
3792
  }
3792
- Za && io();
3793
- function ao() {
3793
+ Qa && ao();
3794
+ function oo() {
3794
3795
  let e = !1;
3795
3796
  try {
3796
3797
  let t = URL.createObjectURL(new Blob([""]));
@@ -3800,11 +3801,11 @@ function ao() {
3800
3801
  } catch {}
3801
3802
  return e;
3802
3803
  }
3803
- function oo() {
3804
+ function so() {
3804
3805
  let e = globalThis;
3805
3806
  return [
3806
3807
  `Worker=${typeof Worker < "u"}`,
3807
- `moduleWorker=${ao()}`,
3808
+ `moduleWorker=${oo()}`,
3808
3809
  `WebSocket=${typeof WebSocket < "u"}`,
3809
3810
  `WebTransport=${e.WebTransport !== void 0}`,
3810
3811
  `RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
@@ -3817,17 +3818,17 @@ function oo() {
3817
3818
  `online=${typeof navigator < "u" ? navigator.onLine : "?"}`
3818
3819
  ].join(" ");
3819
3820
  }
3820
- function so(e) {
3821
+ function co(e) {
3821
3822
  return /ERROR|error:|Rejection/.test(e) ? "#f88" : /WARN|warn:/.test(e) ? "#fc6" : "#9d9";
3822
3823
  }
3823
- function co({ state: e = "", forceVisible: t = !1 }) {
3824
- let n = Za || t, r = e === "connected" || e === "reconnecting", [, i] = tt((e) => e + 1, 0), [a, o] = I(!0);
3825
- return N(() => {
3824
+ function lo({ state: e = "", forceVisible: t = !1 }) {
3825
+ let n = Qa || t, r = e === "connected" || e === "reconnecting", [, i] = et((e) => e + 1, 0), [a, o] = L(!0);
3826
+ return P(() => {
3826
3827
  if (!n) return;
3827
- io();
3828
+ ao();
3828
3829
  let e = setInterval(i, 1e3);
3829
3830
  return () => clearInterval(e);
3830
- }, [n]), n ? r && a ? /* @__PURE__ */ R("button", {
3831
+ }, [n]), n ? r && a ? /* @__PURE__ */ z("button", {
3831
3832
  type: "button",
3832
3833
  onClick: () => o(!1),
3833
3834
  style: {
@@ -3844,10 +3845,10 @@ function co({ state: e = "", forceVisible: t = !1 }) {
3844
3845
  },
3845
3846
  children: [
3846
3847
  "🐞 debug (",
3847
- $a.length,
3848
+ eo.length,
3848
3849
  ")"
3849
3850
  ]
3850
- }) : /* @__PURE__ */ R("div", {
3851
+ }) : /* @__PURE__ */ z("div", {
3851
3852
  style: {
3852
3853
  ...r ? {
3853
3854
  position: "fixed",
@@ -3868,7 +3869,7 @@ function co({ state: e = "", forceVisible: t = !1 }) {
3868
3869
  zIndex: 2147483647
3869
3870
  },
3870
3871
  children: [
3871
- /* @__PURE__ */ R("div", {
3872
+ /* @__PURE__ */ z("div", {
3872
3873
  style: {
3873
3874
  color: "#fff",
3874
3875
  fontSize: "18px",
@@ -3878,11 +3879,11 @@ function co({ state: e = "", forceVisible: t = !1 }) {
3878
3879
  "Ikon debug overlay — state: ",
3879
3880
  e || "?",
3880
3881
  ", +",
3881
- Math.round((Date.now() - Qa) / 1e3),
3882
+ Math.round((Date.now() - $a) / 1e3),
3882
3883
  "s, ",
3883
- $a.length,
3884
+ eo.length,
3884
3885
  " entries",
3885
- r && /* @__PURE__ */ L("button", {
3886
+ r && /* @__PURE__ */ R("button", {
3886
3887
  type: "button",
3887
3888
  onClick: () => o(!0),
3888
3889
  style: {
@@ -3898,7 +3899,7 @@ function co({ state: e = "", forceVisible: t = !1 }) {
3898
3899
  })
3899
3900
  ]
3900
3901
  }),
3901
- /* @__PURE__ */ L("div", {
3902
+ /* @__PURE__ */ R("div", {
3902
3903
  style: {
3903
3904
  color: "#9cf",
3904
3905
  wordBreak: "break-all",
@@ -3906,7 +3907,7 @@ function co({ state: e = "", forceVisible: t = !1 }) {
3906
3907
  },
3907
3908
  children: typeof window < "u" ? window.location.href : ""
3908
3909
  }),
3909
- /* @__PURE__ */ L("div", {
3910
+ /* @__PURE__ */ R("div", {
3910
3911
  style: {
3911
3912
  color: "#ff0",
3912
3913
  wordBreak: "break-all",
@@ -3914,23 +3915,23 @@ function co({ state: e = "", forceVisible: t = !1 }) {
3914
3915
  },
3915
3916
  children: typeof navigator < "u" ? navigator.userAgent : "no navigator"
3916
3917
  }),
3917
- /* @__PURE__ */ L("div", {
3918
+ /* @__PURE__ */ R("div", {
3918
3919
  style: {
3919
3920
  color: "#8cf",
3920
3921
  marginBottom: "4px"
3921
3922
  },
3922
- children: oo()
3923
+ children: so()
3923
3924
  }),
3924
- /* @__PURE__ */ L("div", {
3925
+ /* @__PURE__ */ R("div", {
3925
3926
  style: {
3926
3927
  color: "#8cf",
3927
3928
  marginBottom: "10px"
3928
3929
  },
3929
3930
  children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : ""
3930
3931
  }),
3931
- /* @__PURE__ */ L("div", { children: $a.length === 0 ? "(nothing captured yet)" : $a.map((e, t) => /* @__PURE__ */ L("div", {
3932
+ /* @__PURE__ */ R("div", { children: eo.length === 0 ? "(nothing captured yet)" : eo.map((e, t) => /* @__PURE__ */ R("div", {
3932
3933
  style: {
3933
- color: so(e),
3934
+ color: co(e),
3934
3935
  wordBreak: "break-all"
3935
3936
  },
3936
3937
  children: e
@@ -3940,8 +3941,8 @@ function co({ state: e = "", forceVisible: t = !1 }) {
3940
3941
  }
3941
3942
  //#endregion
3942
3943
  //#region src/app/connection-state-renderer.tsx
3943
- function lo({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, stores: i, registry: a, client: o, onAction: s, renderIdle: c, renderConnecting: l, renderConnectingSlow: u, renderConnected: d, renderOffline: f, renderError: p }) {
3944
- let m = F(!1), h = (() => {
3944
+ function uo({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, stores: i, registry: a, client: o, onAction: s, renderIdle: c, renderConnecting: l, renderConnectingSlow: u, renderConnected: d, renderOffline: f, renderError: p }) {
3945
+ let m = I(!1), h = (() => {
3945
3946
  switch (e) {
3946
3947
  case "waitingForExternalConnectUrl":
3947
3948
  case "connecting": return r ? u() : l();
@@ -3966,286 +3967,286 @@ function lo({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, sto
3966
3967
  default: return null;
3967
3968
  }
3968
3969
  })();
3969
- return /* @__PURE__ */ R(rt, { children: [h, /* @__PURE__ */ L(co, { state: e })] });
3970
+ return /* @__PURE__ */ z(nt, { children: [h, /* @__PURE__ */ R(lo, { state: e })] });
3970
3971
  }
3971
3972
  //#endregion
3972
3973
  //#region src/app/boot-snapshot-variant.ts
3973
- function uo(e, t) {
3974
+ function fo(e, t) {
3974
3975
  return e === !1 ? !1 : t ? "signed-in" : "guest";
3975
3976
  }
3976
3977
  //#endregion
3977
3978
  //#region src/app/use-ikon-app.ts
3978
- var fo = D("useIkonApp");
3979
- function po() {
3979
+ var po = O("useIkonApp");
3980
+ function mo() {
3980
3981
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__) return window.__IKON_AUTH_CONFIG__;
3981
3982
  }
3982
- function mo() {
3983
+ function ho() {
3983
3984
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__) return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
3984
3985
  }
3985
- function ho(e, t) {
3986
+ function go(e, t) {
3986
3987
  return {
3987
3988
  ...e,
3988
3989
  ...t ?? {}
3989
3990
  };
3990
3991
  }
3991
- var go = "ikon-sso-required-redirect:", _o = 3e5;
3992
- function vo(e, t = Date.now()) {
3992
+ var _o = "ikon-sso-required-redirect:", vo = 3e5;
3993
+ function yo(e, t = Date.now()) {
3993
3994
  try {
3994
- let n = `${go}${e}`;
3995
- return t - Number(window.sessionStorage.getItem(n) ?? 0) < _o ? !1 : (window.sessionStorage.setItem(n, String(t)), !0);
3995
+ let n = `${_o}${e}`;
3996
+ return t - Number(window.sessionStorage.getItem(n) ?? 0) < vo ? !1 : (window.sessionStorage.setItem(n, String(t)), !0);
3996
3997
  } catch {
3997
3998
  return !1;
3998
3999
  }
3999
4000
  }
4000
- function yo() {
4001
+ function bo() {
4001
4002
  try {
4002
4003
  let e = [];
4003
4004
  for (let t = 0; t < window.sessionStorage.length; t++) {
4004
4005
  let n = window.sessionStorage.key(t);
4005
- n?.startsWith(go) && e.push(n);
4006
+ n?.startsWith(_o) && e.push(n);
4006
4007
  }
4007
4008
  for (let t of e) window.sessionStorage.removeItem(t);
4008
4009
  } catch {}
4009
4010
  }
4010
- function bo(e) {
4011
- return e?.token ? `${e.provider}:${be(e.token) ?? e.token}` : null;
4012
- }
4013
4011
  function xo(e) {
4014
- let { authConfig: t, modules: n, parameters: r, timeouts: i, backgroundAudio: a, disableBrowserFunctions: o, disableSoundFunctions: c, webRtc: l, audio: f, video: ee, websocket: y, webtransport: b, httpstream: x, proxy: te, liveSnapshot: S, bootSnapshot: C } = e, w = t === void 0 ? po() ?? null : t, re = mo(), T = Na(), le = !!T && T.state.isLoading, E = F(null), ue = F(null), de = F(null), fe = F(!1), pe = F(!1), me = F(a), he = F(o), ge = F(c), D = F(i), _e = F(l), ye = F(f), xe = F(ee), Se = F(y), Ce = F(b), we = F(x), Te = F(te), Ee = F(S), De = F(C), Oe = F("local"), ke = F(void 0);
4015
- me.current = a, he.current = o, ge.current = c, D.current = i, _e.current = l, ye.current = f, xe.current = ee, Se.current = y, Ce.current = b, we.current = x, Te.current = te, Ee.current = S, De.current = C;
4016
- let [k, Ae] = I("connecting"), [Me, Ne] = I(!1), [Fe, Ie] = I(!1), [Re, ze] = I(null), [Ve, He] = I(null), [Ue, We] = I(null), [Ge, Ke] = I(!1), [qe, Je] = I(!1), [Ye, Xe] = I(!1), [Ze, Qe] = I(null), [A, j] = I(null), [$e, et] = I(!1), tt = F(!1), [nt, rt] = I(0), [L, R] = I(0), z = P(() => {
4012
+ return e?.token ? `${e.provider}:${ye(e.token) ?? e.token}` : null;
4013
+ }
4014
+ function So(e) {
4015
+ let { authConfig: t, modules: n, parameters: r, timeouts: i, backgroundAudio: a, disableBrowserFunctions: o, disableSoundFunctions: c, webRtc: l, audio: f, video: ee, websocket: y, webtransport: b, httpstream: x, proxy: S, liveSnapshot: C, bootSnapshot: w } = e, T = t === void 0 ? mo() ?? null : t, ne = ho(), E = Pa(), ce = !!E && E.state.isLoading, D = I(null), le = I(null), ue = I(null), de = I(!1), fe = I(!1), pe = I(a), me = I(o), he = I(c), O = I(i), ge = I(l), ve = I(f), be = I(ee), xe = I(y), Se = I(b), Ce = I(x), we = I(S), Te = I(C), Ee = I(w), De = I("local"), Oe = I(void 0);
4016
+ pe.current = a, me.current = o, he.current = c, O.current = i, ge.current = l, ve.current = f, be.current = ee, xe.current = y, Se.current = b, Ce.current = x, we.current = S, Te.current = C, Ee.current = w;
4017
+ let [A, ke] = L("connecting"), [je, Me] = L(!1), [Pe, Fe] = L(!1), [Le, Re] = L(null), [Be, Ve] = L(null), [He, Ue] = L(null), [We, Ge] = L(!1), [Ke, qe] = L(!1), [Je, Ye] = L(!1), [Xe, Ze] = L(null), [j, M] = L(null), [Qe, $e] = L(!1), et = I(!1), [tt, nt] = L(0), [R, z] = L(0), it = F(() => {
4017
4018
  try {
4018
- return Le();
4019
+ return Ie();
4019
4020
  } catch {
4020
4021
  return { parameters: {} };
4021
4022
  }
4022
- }, []), at = JSON.stringify(r ?? {}), ot = P(() => ho(z.parameters, r), [z.parameters, at]), st = (w?.methods?.length ?? 0) > 0, ct = uo(C, st && Mi());
4023
+ }, []), at = JSON.stringify(r ?? {}), ot = F(() => go(it.parameters, r), [it.parameters, at]), st = (T?.methods?.length ?? 0) > 0, ct = fo(w, st && Ni());
4023
4024
  ct !== !1 && !u() && d(ct);
4024
- let B = P(() => {
4025
- if (!w?.spaceId) return null;
4026
- let e = T?.state.user;
4025
+ let B = F(() => {
4026
+ if (!T?.spaceId) return null;
4027
+ let e = E?.state.user;
4027
4028
  return e ? {
4028
4029
  token: e.token,
4029
4030
  provider: e.provider,
4030
4031
  authenticatedAt: e.authenticatedAt
4031
- } : Ti();
4032
+ } : Ei();
4032
4033
  }, [
4033
- w?.spaceId,
4034
- nt,
4035
- T?.state.isLoading,
4036
- T?.state.isAuthenticated,
4037
- T?.state.user?.token
4038
- ]), V = re?.enabled ?? !1, H = re?.host ?? g, lt = re?.port ?? _, U = !le && !!w && !B && !w.requireSignIn && !!w.spaceId && (je() || V);
4039
- U && !A && !$e && !tt.current && (tt.current = !0, O(w.authUrl).then((e) => Hi(w.spaceId, e)).then((e) => {
4040
- j(e.token), et(!0);
4034
+ T?.spaceId,
4035
+ tt,
4036
+ E?.state.isLoading,
4037
+ E?.state.isAuthenticated,
4038
+ E?.state.user?.token
4039
+ ]), V = ne?.enabled ?? !1, H = ne?.host ?? g, lt = ne?.port ?? _, U = !ce && !!T && !B && !T.requireSignIn && !!T.spaceId && (Ae() || V);
4040
+ U && !j && !Qe && !et.current && (et.current = !0, k(T.authUrl).then((e) => Ui(T.spaceId, e)).then((e) => {
4041
+ M(e.token), $e(!0);
4041
4042
  }).catch((e) => {
4042
- fo.error("Anonymous auth failed:", e), tt.current = !1, V ? et(!0) : He(e instanceof Error ? e.message : "Anonymous auth failed");
4043
+ po.error("Anonymous auth failed:", e), et.current = !1, V ? $e(!0) : Ve(e instanceof Error ? e.message : "Anonymous auth failed");
4043
4044
  }));
4044
- let ut = bo(B), W = F(void 0);
4045
+ let ut = xo(B), W = I(void 0);
4045
4046
  W.current = B?.token ?? void 0;
4046
- let dt = P(() => {
4047
- if (le) return null;
4047
+ let dt = F(() => {
4048
+ if (ce) return null;
4048
4049
  if (V) {
4049
- if (U && !$e) return null;
4050
- let e = W.current ?? A ?? void 0, t = e ? be(e) ?? void 0 : void 0;
4050
+ if (U && !Qe) return null;
4051
+ let e = W.current ?? j ?? void 0, t = e ? ye(e) ?? void 0 : void 0;
4051
4052
  return { local: {
4052
4053
  host: H,
4053
4054
  httpsPort: lt,
4054
4055
  userId: t,
4055
4056
  token: W.current,
4056
4057
  identityToken: e,
4057
- spaceId: w?.spaceId,
4058
- backendUrl: w?.backendUrl,
4059
- authUrl: w?.authUrl,
4058
+ spaceId: T?.spaceId,
4059
+ backendUrl: T?.backendUrl,
4060
+ authUrl: T?.authUrl,
4060
4061
  parameters: ot
4061
4062
  } };
4062
4063
  }
4063
- return W.current && w?.spaceId ? { sessionToken: {
4064
+ return W.current && T?.spaceId ? { sessionToken: {
4064
4065
  token: W.current,
4065
- spaceId: w.spaceId,
4066
- backendType: ve(),
4067
- sessionIdentityHash: z.sessionIdentityHash,
4066
+ spaceId: T.spaceId,
4067
+ backendType: _e(),
4068
+ sessionIdentityHash: it.sessionIdentityHash,
4068
4069
  parameters: ot
4069
- } } : A && w?.spaceId ? { sessionToken: {
4070
- token: A,
4071
- spaceId: w.spaceId,
4072
- backendType: ve(),
4073
- sessionIdentityHash: z.sessionIdentityHash,
4070
+ } } : j && T?.spaceId ? { sessionToken: {
4071
+ token: j,
4072
+ spaceId: T.spaceId,
4073
+ backendType: _e(),
4074
+ sessionIdentityHash: it.sessionIdentityHash,
4074
4075
  parameters: ot
4075
- } } : je() ? null : { local: {
4076
+ } } : Ae() ? null : { local: {
4076
4077
  host: H,
4077
4078
  httpsPort: lt,
4078
- spaceId: w?.spaceId,
4079
- backendUrl: w?.backendUrl,
4080
- authUrl: w?.authUrl,
4079
+ spaceId: T?.spaceId,
4080
+ backendUrl: T?.backendUrl,
4081
+ authUrl: T?.authUrl,
4081
4082
  parameters: ot
4082
4083
  } };
4083
4084
  }, [
4084
- le,
4085
+ ce,
4085
4086
  V,
4086
4087
  H,
4087
4088
  lt,
4088
4089
  ut,
4089
- w?.spaceId,
4090
- w?.backendUrl,
4091
- w?.authUrl,
4092
- A,
4090
+ T?.spaceId,
4091
+ T?.backendUrl,
4092
+ T?.authUrl,
4093
+ j,
4093
4094
  U,
4094
- $e,
4095
- z.sessionIdentityHash,
4095
+ Qe,
4096
+ it.sessionIdentityHash,
4096
4097
  ot
4097
4098
  ]);
4098
- Oe.current = w?.spaceId ?? "local", ke.current = B?.token ?? A ?? void 0, gr(Ze);
4099
- let ft = vr(Ze);
4100
- N(() => {
4101
- if (!fe.current) {
4102
- if (fe.current = !0, de.current = Mn(), n) for (let e of n) e(de.current);
4103
- de.current.loadRegisteredModules().catch((e) => {
4104
- fo.error("Failed to load UI modules", e);
4099
+ De.current = T?.spaceId ?? "local", Oe.current = B?.token ?? j ?? void 0, gr(Xe);
4100
+ let ft = vr(Xe);
4101
+ P(() => {
4102
+ if (!de.current) {
4103
+ if (de.current = !0, ue.current = Mn(), n) for (let e of n) e(ue.current);
4104
+ ue.current.loadRegisteredModules().catch((e) => {
4105
+ po.error("Failed to load UI modules", e);
4105
4106
  });
4106
4107
  }
4107
- }, []), N(() => {
4108
+ }, []), P(() => {
4108
4109
  if (!dt) return;
4109
- let e = new ne({
4110
+ let e = new te({
4110
4111
  ...dt,
4111
- timeouts: D.current,
4112
- disableBrowserFunctions: he.current,
4113
- disableSoundFunctions: ge.current,
4114
- audio: ye.current !== void 0 || me.current ? {
4115
- enabled: ye.current,
4116
- ...me.current ? { background: {
4112
+ timeouts: O.current,
4113
+ disableBrowserFunctions: me.current,
4114
+ disableSoundFunctions: he.current,
4115
+ audio: ve.current !== void 0 || pe.current ? {
4116
+ enabled: ve.current,
4117
+ ...pe.current ? { background: {
4117
4118
  allowOnDesktop: !0,
4118
4119
  allowOnMobile: !0
4119
4120
  } } : {}
4120
4121
  } : void 0,
4121
- video: xe.current === void 0 ? void 0 : { enabled: xe.current },
4122
+ video: be.current === void 0 ? void 0 : { enabled: be.current },
4122
4123
  mediaSession: {
4123
4124
  title: document.title || void 0,
4124
4125
  artist: document.title || void 0
4125
4126
  },
4126
- webRtc: _e.current === !1 ? { enabled: !1 } : void 0,
4127
- websocket: Se.current,
4128
- webtransport: Ce.current,
4129
- httpstream: we.current,
4130
- proxy: Te.current,
4127
+ webRtc: ge.current === !1 ? { enabled: !1 } : void 0,
4128
+ websocket: xe.current,
4129
+ webtransport: Se.current,
4130
+ httpstream: Ce.current,
4131
+ proxy: we.current,
4131
4132
  onConnectionStateChange: (e) => {
4132
- Ae(e);
4133
+ ke(e);
4133
4134
  },
4134
4135
  onError: (e) => {
4135
- He(e.message);
4136
+ Ve(e.message);
4136
4137
  }
4137
4138
  });
4138
- E.current = e;
4139
- let t = Ee.current ?? !0, n = ke.current, r = n ? be(n) ?? null : null, i = t && r ? {
4139
+ D.current = e;
4140
+ let t = Te.current ?? !0, n = Oe.current, r = n ? ye(n) ?? null : null, i = t && r ? {
4140
4141
  enabled: !0,
4141
- appId: Oe.current,
4142
+ appId: De.current,
4142
4143
  userId: r
4143
- } : void 0, a = B != null && B.provider !== "anonymous", o = st && (a || Mi()), c = new it({
4144
+ } : void 0, a = B != null && B.provider !== "anonymous", o = st && (a || Ni()), c = new rt({
4144
4145
  client: e,
4145
4146
  liveSnapshot: i,
4146
- bootSnapshot: uo(De.current, o)
4147
+ bootSnapshot: fo(Ee.current, o)
4147
4148
  });
4148
- ue.current = c, Qe(c), Ie(!1), ze(e.feedback);
4149
- let l = e.subscribeToFeedback(ze), u = c.subscribeToUiUpdates(() => {
4150
- Ie(!0), Be();
4149
+ le.current = c, Ze(c), Fe(!1), Re(e.feedback);
4150
+ let l = e.subscribeToFeedback(Re), u = c.subscribeToUiUpdates(() => {
4151
+ Fe(!0), ze();
4151
4152
  });
4152
- return e.connect().then(yo, (e) => {
4153
- if (fo.error("Connection failed:", e), e instanceof ce && w?.spaceId && !Pe() && vo(e.connectionId)) {
4154
- let t = w.spaceId, n = W.current;
4155
- O(w.authUrl).then(async (r) => {
4156
- let i = await ta(e.connectionId, t, r, { linkSessionToken: n ?? void 0 });
4153
+ return e.connect().then(bo, (e) => {
4154
+ if (po.error("Connection failed:", e), e instanceof se && T?.spaceId && !Ne() && yo(e.connectionId)) {
4155
+ let t = T.spaceId, n = W.current;
4156
+ k(T.authUrl).then(async (r) => {
4157
+ let i = await na(e.connectionId, t, r, { linkSessionToken: n ?? void 0 });
4157
4158
  if (!i) {
4158
- We(e.reason);
4159
+ Ue(e.reason);
4159
4160
  return;
4160
4161
  }
4161
4162
  window.location.href = i;
4162
- }).catch(() => We(e.reason));
4163
+ }).catch(() => Ue(e.reason));
4163
4164
  return;
4164
4165
  }
4165
4166
  if (e instanceof p) {
4166
- We(e.reason);
4167
+ Ue(e.reason);
4167
4168
  return;
4168
4169
  }
4169
- if (e instanceof ae) {
4170
- Ke(!0);
4170
+ if (e instanceof ie) {
4171
+ Ge(!0);
4171
4172
  return;
4172
4173
  }
4173
- if (e instanceof se) {
4174
- Je(!0);
4174
+ if (e instanceof oe) {
4175
+ qe(!0);
4175
4176
  return;
4176
4177
  }
4177
- if (!(e instanceof oe)) {
4178
+ if (!(e instanceof ae)) {
4178
4179
  if (e instanceof m) {
4179
- Xe(!0);
4180
+ Ye(!0);
4180
4181
  return;
4181
4182
  }
4182
- e instanceof ie || e instanceof h && !pe.current && (pe.current = !0, fo.warn("Auth session appears stale, clearing and retrying"), s.clearAll(), T ? T.logout() : (Ni(), rt((e) => e + 1)));
4183
+ e instanceof re || e instanceof h && !fe.current && (fe.current = !0, po.warn("Auth session appears stale, clearing and retrying"), s.clearAll(), E ? E.logout() : (Pi(), nt((e) => e + 1)));
4183
4184
  }
4184
4185
  }), () => {
4185
- u(), l(), e.disconnect(), E.current = null, c.dispose(), ue.current = null;
4186
+ u(), l(), e.disconnect(), D.current = null, c.dispose(), le.current = null;
4186
4187
  };
4187
- }, [dt, L]), N(() => {
4188
- let e = B?.token, t = E.current;
4188
+ }, [dt, R]), P(() => {
4189
+ let e = B?.token, t = D.current;
4189
4190
  if (!(!e || !t)) {
4190
4191
  if (t.connectionState === "offline" && !t.serverStopped) {
4191
- R((e) => e + 1);
4192
+ z((e) => e + 1);
4192
4193
  return;
4193
4194
  }
4194
4195
  t.updateAuthToken(e);
4195
4196
  }
4196
4197
  }, [B?.token]);
4197
- let pt = M((e, t, n) => {
4198
+ let pt = N((e, t, n) => {
4198
4199
  let r = typeof t == "string" ? t : JSON.stringify(t ?? {});
4199
- E.current?.sendActionCall(e, r, n);
4200
+ D.current?.sendActionCall(e, r, n);
4200
4201
  }, []);
4201
- N(() => {
4202
- if (k !== "connecting" && k !== "waitingForExternalConnectUrl") {
4203
- Ne(!1);
4202
+ P(() => {
4203
+ if (A !== "connecting" && A !== "waitingForExternalConnectUrl") {
4204
+ Me(!1);
4204
4205
  return;
4205
4206
  }
4206
- let e = E.current?.slowConnectionThresholdMs ?? v, t = setTimeout(() => Ne(!0), e);
4207
+ let e = D.current?.slowConnectionThresholdMs ?? v, t = setTimeout(() => Me(!0), e);
4207
4208
  return () => clearTimeout(t);
4208
- }, [k]);
4209
- let mt = k === "connected" || k === "reconnecting", ht = Fe && k !== "offline";
4210
- return N(() => {
4209
+ }, [A]);
4210
+ let mt = A === "connected" || A === "reconnecting", ht = Pe && A !== "offline";
4211
+ return P(() => {
4211
4212
  typeof document > "u" || (document.documentElement.dataset.ikonLive = String(ht));
4212
4213
  }, [ht]), {
4213
- connectionState: k,
4214
- error: Ve,
4215
- accessDeniedReason: Ue,
4216
- isServerFull: Ge,
4217
- isSessionExpired: qe,
4218
- isStartupFailed: Ye,
4214
+ connectionState: A,
4215
+ error: Be,
4216
+ accessDeniedReason: He,
4217
+ isServerFull: We,
4218
+ isSessionExpired: Ke,
4219
+ isStartupFailed: Je,
4219
4220
  stores: ft,
4220
- client: E.current,
4221
- registry: de.current,
4222
- clientRef: E,
4223
- uiRef: ue,
4224
- registryRef: de,
4221
+ client: D.current,
4222
+ registry: ue.current,
4223
+ clientRef: D,
4224
+ uiRef: le,
4225
+ registryRef: ue,
4225
4226
  onAction: pt,
4226
4227
  isReady: mt,
4227
4228
  isLive: ht,
4228
- brandingRequired: E.current?.brandingRequired ?? !1,
4229
- feedback: Re,
4230
- isConnectingSlow: Me,
4231
- webRtcVideoStreams: E.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
4232
- webRtcTrackMap: E.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
4229
+ brandingRequired: D.current?.brandingRequired ?? !1,
4230
+ feedback: Le,
4231
+ isConnectingSlow: je,
4232
+ webRtcVideoStreams: D.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
4233
+ webRtcTrackMap: D.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
4233
4234
  };
4234
4235
  }
4235
4236
  //#endregion
4236
4237
  //#region src/hooks/use-toasts.ts
4237
- var So = 0;
4238
- function Co(e = 5, t = 5e3) {
4239
- let [n, r] = I([]), i = F(/* @__PURE__ */ new Map()), a = M((e) => {
4238
+ var Co = 0;
4239
+ function wo(e = 5, t = 5e3) {
4240
+ let [n, r] = L([]), i = I(/* @__PURE__ */ new Map()), a = N((e) => {
4240
4241
  let t = i.current.get(e);
4241
4242
  t && (clearTimeout(t), i.current.delete(e)), r((t) => t.filter((t) => t.id !== e));
4242
4243
  }, []);
4243
- return N(() => {
4244
- let n = i.current, o = qe((i) => {
4245
- if (!Ne()) return;
4246
- let o = `toast-${++So}`, s = {
4244
+ return P(() => {
4245
+ let n = i.current, o = Ke((i) => {
4246
+ if (!Me()) return;
4247
+ let o = `toast-${++Co}`, s = {
4247
4248
  id: o,
4248
- level: i.level === re.ERROR ? "error" : "warn",
4249
+ level: i.level === ne.ERROR ? "error" : "warn",
4249
4250
  message: i.message,
4250
4251
  component: i.component
4251
4252
  };
@@ -4254,7 +4255,7 @@ function Co(e = 5, t = 5e3) {
4254
4255
  a(o);
4255
4256
  }, t);
4256
4257
  n.set(o, c);
4257
- }, { minLevel: re.WARN });
4258
+ }, { minLevel: ne.WARN });
4258
4259
  return () => {
4259
4260
  o();
4260
4261
  for (let e of n.values()) clearTimeout(e);
@@ -4271,9 +4272,9 @@ function Co(e = 5, t = 5e3) {
4271
4272
  }
4272
4273
  //#endregion
4273
4274
  //#region src/hooks/use-ikon-reactive.ts
4274
- function wo(e, t, n) {
4275
- let [r, i] = I(n);
4276
- return N(() => {
4275
+ function To(e, t, n) {
4276
+ let [r, i] = L(n);
4277
+ return P(() => {
4277
4278
  if (!e) return;
4278
4279
  let n = !0, r = null;
4279
4280
  return e.reactiveRegistry.subscribe(t, (e) => {
@@ -4289,9 +4290,9 @@ function wo(e, t, n) {
4289
4290
  }
4290
4291
  //#endregion
4291
4292
  //#region src/hooks/use-reactive.ts
4292
- function To(e, t, n) {
4293
- let [r, i] = I(null);
4294
- return N(() => {
4293
+ function Eo(e, t, n) {
4294
+ let [r, i] = L(null);
4295
+ return P(() => {
4295
4296
  if (!e) return;
4296
4297
  let n = !0;
4297
4298
  return e.call("Ikon.Reactive.GetStableIdByName", [t]).then((e) => {
@@ -4301,56 +4302,56 @@ function To(e, t, n) {
4301
4302
  }), () => {
4302
4303
  n = !1;
4303
4304
  };
4304
- }, [e, t]), wo(r ? e : null, r ?? "", n);
4305
+ }, [e, t]), To(r ? e : null, r ?? "", n);
4305
4306
  }
4306
4307
  //#endregion
4307
4308
  //#region src/app/use-ikon-debug.ts
4308
- var Eo = D("IkonDebug"), Do = {
4309
+ var Do = O("IkonDebug"), Oo = {
4309
4310
  Digit1: "connecting",
4310
4311
  Digit2: "connected",
4311
4312
  Digit3: "reconnecting",
4312
4313
  Digit4: "offline",
4313
4314
  Digit5: "offline",
4314
4315
  Digit0: "clear"
4315
- }, Oo = "Digit5", ko = "Digit6", Ao = "Synthetic debug error (Ctrl+Shift+5)", jo = "Synthetic debug access-denied (Ctrl+Shift+6)", Mo = 5e3;
4316
- function No(e) {
4317
- let t = Ne(), [n, r] = I(null), [i, a] = I(!1), [o, s] = I(null), [c, l] = I(null), [u, d] = I(!1), [f, p] = I(!1), [m, h] = I(!1);
4318
- return N(() => {
4316
+ }, ko = "Digit5", Ao = "Digit6", jo = "Synthetic debug error (Ctrl+Shift+5)", Mo = "Synthetic debug access-denied (Ctrl+Shift+6)", No = 5e3;
4317
+ function Po(e) {
4318
+ let t = Me(), [n, r] = L(null), [i, a] = L(!1), [o, s] = L(null), [c, l] = L(null), [u, d] = L(!1), [f, p] = L(!1), [m, h] = L(!1);
4319
+ return P(() => {
4319
4320
  if (!t) return;
4320
4321
  let e = (e) => {
4321
4322
  if (!e.ctrlKey || !e.shiftKey) return;
4322
4323
  if (e.code === "KeyE") {
4323
- e.preventDefault(), d((e) => (Eo.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
4324
+ e.preventDefault(), d((e) => (Do.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
4324
4325
  return;
4325
4326
  }
4326
4327
  if (e.code === "Digit7") {
4327
- e.preventDefault(), p((e) => (Eo.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
4328
+ e.preventDefault(), p((e) => (Do.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
4328
4329
  return;
4329
4330
  }
4330
4331
  if (e.code === "Digit8") {
4331
- e.preventDefault(), h((e) => (Eo.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
4332
+ e.preventDefault(), h((e) => (Do.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
4332
4333
  return;
4333
4334
  }
4334
- if (e.code === ko) {
4335
- e.preventDefault(), l(jo), r(null), s(null), Eo.warn("Forced access denied");
4335
+ if (e.code === Ao) {
4336
+ e.preventDefault(), l(Mo), r(null), s(null), Do.warn("Forced access denied");
4336
4337
  return;
4337
4338
  }
4338
- let t = Do[e.code];
4339
+ let t = Oo[e.code];
4339
4340
  if (t === void 0) return;
4340
4341
  if (e.preventDefault(), t === "clear") {
4341
- r(null), s(null), l(null), Eo.warn("Cleared forced state");
4342
+ r(null), s(null), l(null), Do.warn("Cleared forced state");
4342
4343
  return;
4343
4344
  }
4344
- let n = e.code === Oo;
4345
- r(t), s(n ? Ao : null), l(null), Eo.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
4345
+ let n = e.code === ko;
4346
+ r(t), s(n ? jo : null), l(null), Do.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
4346
4347
  };
4347
4348
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
4348
- }, [t]), N(() => {
4349
+ }, [t]), P(() => {
4349
4350
  if (n !== "connecting") {
4350
4351
  a(!1);
4351
4352
  return;
4352
4353
  }
4353
- let e = setTimeout(() => a(!0), Mo);
4354
+ let e = setTimeout(() => a(!0), No);
4354
4355
  return () => clearTimeout(e);
4355
4356
  }, [n]), !t || n === null && !u && c === null && !f && !m ? {
4356
4357
  app: e,
@@ -4381,112 +4382,112 @@ function No(e) {
4381
4382
  }
4382
4383
  //#endregion
4383
4384
  //#region src/app/feedback/feedback-controls.tsx
4384
- var Po = D("FeedbackControls"), Fo = null;
4385
- function Io() {
4386
- return import("./feedback-form-BSy2olwD.js").then((e) => Fo = e);
4387
- }
4388
- var Lo = 4e3, Ro = 1e4, zo = 16, Bo = 52, Vo = "ikon-feedback-control", Ho = `.${Vo}:focus-visible{outline:2px solid var(--ikon-focus-ring,#f5277f);outline-offset:2px}`;
4389
- function Uo({ client: e, feedback: t, connectionState: n, isLive: r, sheetOpen: i, brandingShown: a }) {
4390
- let [o, s] = I(null), [c, l] = I(Fo), u = F(null), d = F(i), f = F(!1), p = F(!1), m = F(!1), h = F(null), g = F(!1);
4391
- p.current = o !== null, N(() => {
4385
+ var Fo = O("FeedbackControls"), Io = null;
4386
+ function Lo() {
4387
+ return import("./feedback-form-BSy2olwD.js").then((e) => Io = e);
4388
+ }
4389
+ var Ro = 4e3, zo = 1e4, Bo = 16, Vo = 52, Ho = "ikon-feedback-control", Uo = `.${Ho}:focus-visible{outline:2px solid var(--ikon-focus-ring,#f5277f);outline-offset:2px}`;
4390
+ function Wo({ client: e, feedback: t, connectionState: n, isLive: r, sheetOpen: i, brandingShown: a }) {
4391
+ let [o, s] = L(null), [c, l] = L(Io), u = I(null), d = I(i), f = I(!1), p = I(!1), m = I(!1), h = I(null), g = I(!1);
4392
+ p.current = o !== null, P(() => {
4392
4393
  if (!o || c) return;
4393
4394
  let e = !1;
4394
- return Io().then((t) => {
4395
+ return Lo().then((t) => {
4395
4396
  e || l(t);
4396
4397
  }).catch((e) => {
4397
- Po.error("Loading the feedback form failed, feedback cannot be sent from this page:", e);
4398
+ Fo.error("Loading the feedback form failed, feedback cannot be sent from this page:", e);
4398
4399
  }), () => {
4399
4400
  e = !0;
4400
4401
  };
4401
4402
  }, [o, c]);
4402
- let _ = M(() => {
4403
+ let _ = N(() => {
4403
4404
  u.current &&= (clearTimeout(u.current.timer), null);
4404
- }, []), v = M((e) => {
4405
+ }, []), v = N((e) => {
4405
4406
  _(), f.current = !1, s({ screenshot: e });
4406
4407
  }, [_]);
4407
- N(() => {
4408
+ P(() => {
4408
4409
  d.current = i, i && (_(), p.current && !f.current && s(null));
4409
- }, [i, _]), N(() => _, [_]);
4410
- let b = M(() => {
4410
+ }, [i, _]), P(() => _, [_]);
4411
+ let b = N(() => {
4411
4412
  if (u.current || p.current || d.current) return;
4412
- Io().catch((e) => {
4413
- Po.debug("Preloading the feedback form failed:", e);
4413
+ Lo().catch((e) => {
4414
+ Fo.debug("Preloading the feedback form failed:", e);
4414
4415
  });
4415
- let t = pe();
4416
+ let t = fe();
4416
4417
  if (t.catch((e) => {
4417
- Po.warn("Capturing the view for a feedback report failed, the report goes without a screenshot:", e);
4418
+ Fo.warn("Capturing the view for a feedback report failed, the report goes without a screenshot:", e);
4418
4419
  }), !e || e.connectionState !== "connected") {
4419
4420
  v(t);
4420
4421
  return;
4421
4422
  }
4422
4423
  let n = { timer: setTimeout(() => {
4423
- u.current === n && !d.current && (Po.warn(`The feedback sheet did not open within ${Lo} ms, showing the built-in form`), v(t));
4424
- }, Lo) };
4424
+ u.current === n && !d.current && (Fo.warn(`The feedback sheet did not open within ${Ro} ms, showing the built-in form`), v(t));
4425
+ }, Ro) };
4425
4426
  u.current = n, e.call(ee, [""]).then((e) => {
4426
- e !== !0 && u.current === n && (Po.warn(`The app declined ${ee}, showing the built-in form`), v(t));
4427
+ e !== !0 && u.current === n && (Fo.warn(`The app declined ${ee}, showing the built-in form`), v(t));
4427
4428
  }, (e) => {
4428
- u.current === n && (Po.warn(`Calling ${ee} failed, showing the built-in form:`, e), v(t));
4429
+ u.current === n && (Fo.warn(`Calling ${ee} failed, showing the built-in form:`, e), v(t));
4429
4430
  });
4430
4431
  }, [e, v]);
4431
- N(() => {
4432
- m.current || !t || !r || n !== "connected" || !Ce() || (m.current = !0, me(), b());
4432
+ P(() => {
4433
+ m.current || !t || !r || n !== "connected" || !Se() || (m.current = !0, pe(), b());
4433
4434
  }, [
4434
4435
  t,
4435
4436
  r,
4436
4437
  n,
4437
4438
  b
4438
4439
  ]);
4439
- let x = M(() => {
4440
+ let x = N(() => {
4440
4441
  g.current = !0, s(null);
4441
4442
  }, []);
4442
- N(() => {
4443
+ P(() => {
4443
4444
  o || !g.current || (g.current = !1, h.current?.focus());
4444
4445
  }, [o]);
4445
- let te = M((e) => {
4446
+ let S = N((e) => {
4446
4447
  f.current = e;
4447
4448
  }, []);
4448
- if (N(() => {
4449
+ if (P(() => {
4449
4450
  if (!(!e || !t)) return e.setFeedbackRequestHandler(b);
4450
4451
  }, [
4451
4452
  e,
4452
4453
  t,
4453
4454
  b
4454
4455
  ]), !t) return null;
4455
- let S = { [y]: "" }, C = `calc(${a ? Bo : zo}px + env(safe-area-inset-bottom, 0px))`, w = t.showButton && !i && !o;
4456
- return /* @__PURE__ */ R(rt, { children: [w && /* @__PURE__ */ R("div", {
4457
- ...S,
4456
+ let C = { [y]: "" }, w = `calc(${a ? Vo : Bo}px + env(safe-area-inset-bottom, 0px))`, T = t.showButton && !i && !o;
4457
+ return /* @__PURE__ */ z(nt, { children: [T && /* @__PURE__ */ z("div", {
4458
+ ...C,
4458
4459
  "data-ikon-feedback-controls": "",
4459
4460
  style: {
4460
- ...Ko.dock,
4461
- bottom: C
4461
+ ...qo.dock,
4462
+ bottom: w
4462
4463
  },
4463
- children: [/* @__PURE__ */ L("style", { children: Ho }), /* @__PURE__ */ L(Wo, {
4464
+ children: [/* @__PURE__ */ R("style", { children: Uo }), /* @__PURE__ */ R(Go, {
4464
4465
  buttonRef: h,
4465
4466
  onPress: b
4466
4467
  })]
4467
- }), o && c && /* @__PURE__ */ L(c.FeedbackForm, {
4468
+ }), o && c && /* @__PURE__ */ R(c.FeedbackForm, {
4468
4469
  access: e?.backendAccess ?? null,
4469
4470
  screenshot: o.screenshot,
4470
4471
  appSession: e?.appSessionId,
4471
4472
  clientSession: e?.sessionId === void 0 ? void 0 : String(e.sessionId),
4472
4473
  onClose: x,
4473
- onDirtyChange: te
4474
+ onDirtyChange: S
4474
4475
  })] });
4475
4476
  }
4476
- function Wo({ buttonRef: e, onPress: t }) {
4477
- return /* @__PURE__ */ L("button", {
4477
+ function Go({ buttonRef: e, onPress: t }) {
4478
+ return /* @__PURE__ */ R("button", {
4478
4479
  ref: e,
4479
4480
  type: "button",
4480
- className: Vo,
4481
+ className: Ho,
4481
4482
  "aria-label": "Send feedback",
4482
4483
  title: "Send feedback",
4483
- style: Ko.feedbackButton,
4484
+ style: qo.feedbackButton,
4484
4485
  onClick: t,
4485
- children: /* @__PURE__ */ L(Go, {})
4486
+ children: /* @__PURE__ */ R(Ko, {})
4486
4487
  });
4487
4488
  }
4488
- function Go() {
4489
- return /* @__PURE__ */ R("svg", {
4489
+ function Ko() {
4490
+ return /* @__PURE__ */ z("svg", {
4490
4491
  width: "22",
4491
4492
  height: "22",
4492
4493
  viewBox: "0 0 24 24",
@@ -4497,14 +4498,14 @@ function Go() {
4497
4498
  strokeLinejoin: "round",
4498
4499
  "aria-hidden": "true",
4499
4500
  focusable: "false",
4500
- children: [/* @__PURE__ */ L("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }), /* @__PURE__ */ L("path", { d: "M8 9h8M8 13h5" })]
4501
+ children: [/* @__PURE__ */ R("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }), /* @__PURE__ */ R("path", { d: "M8 9h8M8 13h5" })]
4501
4502
  });
4502
4503
  }
4503
- var Ko = {
4504
+ var qo = {
4504
4505
  dock: {
4505
4506
  position: "fixed",
4506
4507
  right: "max(16px, env(safe-area-inset-right, 0px))",
4507
- zIndex: Ro,
4508
+ zIndex: zo,
4508
4509
  display: "flex",
4509
4510
  alignItems: "center",
4510
4511
  font: "14px/1.4 var(--ikon-font-body, system-ui, -apple-system, \"Segoe UI\", sans-serif)"
@@ -4526,31 +4527,31 @@ var Ko = {
4526
4527
  WebkitTouchCallout: "none",
4527
4528
  userSelect: "none"
4528
4529
  }
4529
- }, qo = 9990, Jo = "ikon-platform-layer", Yo = `.${Jo}>*{pointer-events:auto}`;
4530
- function Xo(e) {
4530
+ }, Jo = 9990, Yo = "ikon-platform-layer", Xo = `.${Yo}>*{pointer-events:auto}`;
4531
+ function Zo(e) {
4531
4532
  if (!e) return !1;
4532
- for (let t of e.values()) if (t.category === r && Qo(t.store)?.children.some((e) => e.children.length > 0)) return !0;
4533
+ for (let t of e.values()) if (t.category === r && $o(t.store)?.children.some((e) => e.children.length > 0)) return !0;
4533
4534
  return !1;
4534
4535
  }
4535
- function Zo(e) {
4536
- let [t, n] = I(() => Xo(e));
4537
- return N(() => {
4538
- let t = () => n(Xo(e));
4536
+ function Qo(e) {
4537
+ let [t, n] = L(() => Zo(e));
4538
+ return P(() => {
4539
+ let t = () => n(Zo(e));
4539
4540
  if (t(), !e) return;
4540
4541
  let i = [];
4541
- for (let n of e.values()) n.category === r && i.push($o(n.store, t));
4542
+ for (let n of e.values()) n.category === r && i.push(es(n.store, t));
4542
4543
  return () => {
4543
4544
  for (let e of i) e();
4544
4545
  };
4545
4546
  }, [e]), t;
4546
4547
  }
4547
- function Qo(e) {
4548
+ function $o(e) {
4548
4549
  let t = e.getSnapshot();
4549
4550
  return t.rootViewId ? t.views.get(t.rootViewId) : void 0;
4550
4551
  }
4551
- function $o(e, t) {
4552
+ function es(e, t) {
4552
4553
  let n = /* @__PURE__ */ new Map(), r = () => {
4553
- let t = Qo(e), r = new Set(t ? [t.id, ...t.children.map((e) => e.id)] : []);
4554
+ let t = $o(e), r = new Set(t ? [t.id, ...t.children.map((e) => e.id)] : []);
4554
4555
  for (let [e, t] of n) r.has(e) || (t(), n.delete(e));
4555
4556
  for (let t of r) n.has(t) || n.set(t, e.subscribeNode(t, i));
4556
4557
  };
@@ -4564,10 +4565,10 @@ function $o(e, t) {
4564
4565
  n.clear(), a();
4565
4566
  };
4566
4567
  }
4567
- function es({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4568
- return /* @__PURE__ */ R("div", {
4568
+ function ts({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4569
+ return /* @__PURE__ */ z("div", {
4569
4570
  [y]: "",
4570
- className: Jo,
4571
+ className: Yo,
4571
4572
  "data-ikon-platform-layer": "",
4572
4573
  style: {
4573
4574
  position: "fixed",
@@ -4575,11 +4576,11 @@ function es({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4575
4576
  right: 0,
4576
4577
  bottom: 0,
4577
4578
  left: 0,
4578
- zIndex: qo,
4579
+ zIndex: Jo,
4579
4580
  pointerEvents: "none",
4580
4581
  display: a ? "block" : "none"
4581
4582
  },
4582
- children: [/* @__PURE__ */ L("style", { children: Yo }), /* @__PURE__ */ L(ar, {
4583
+ children: [/* @__PURE__ */ R("style", { children: Xo }), /* @__PURE__ */ R(ar, {
4583
4584
  stores: e,
4584
4585
  registry: t,
4585
4586
  client: n,
@@ -4591,89 +4592,89 @@ function es({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4591
4592
  }
4592
4593
  //#endregion
4593
4594
  //#region src/app/ikon-app.tsx
4594
- var ts = { [y]: "" };
4595
- function ns(e, t) {
4595
+ var ns = { [y]: "" };
4596
+ function rs(e, t) {
4596
4597
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4597
4598
  }
4598
- function rs(e) {
4599
+ function is(e) {
4599
4600
  return e === void 0 ? null : typeof e == "function" ? e() : e;
4600
4601
  }
4601
- function is(e, t) {
4602
+ function as(e, t) {
4602
4603
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4603
4604
  }
4604
- function as(e, t) {
4605
+ function os(e, t) {
4605
4606
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4606
4607
  }
4607
- function os(e) {
4608
- let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = No(a), { app: s } = o, { connectionState: c, isConnectingSlow: l, stores: u, registry: d, client: f, onAction: p, isReady: m, isLive: h, error: g, accessDeniedReason: _, brandingRequired: v, feedback: ee } = s, y = v || o.forcedBranding, b = F(null);
4608
+ function ss(e) {
4609
+ let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = Po(a), { app: s } = o, { connectionState: c, isConnectingSlow: l, stores: u, registry: d, client: f, onAction: p, isReady: m, isLive: h, error: g, accessDeniedReason: _, brandingRequired: v, feedback: ee } = s, y = v || o.forcedBranding, b = I(null);
4609
4610
  u && d && (m || u.size > 0) && (b.current = {
4610
4611
  stores: u,
4611
4612
  registry: d,
4612
4613
  client: f
4613
4614
  });
4614
- let x = b.current != null || !!_, te = Zo(b.current?.stores) && c === "connected";
4615
- if (et(() => {
4615
+ let x = b.current != null || !!_, S = Qo(b.current?.stores) && c === "connected";
4616
+ if ($e(() => {
4616
4617
  !x || typeof document > "u" || document.querySelectorAll("[data-ikon-prerender]").forEach((e) => e.remove());
4617
- }, [x]), _) return as(i, _);
4618
- let S = b.current, C;
4618
+ }, [x]), _) return os(i, _);
4619
+ let C = b.current, w;
4619
4620
  switch (c) {
4620
4621
  case "waitingForExternalConnectUrl":
4621
4622
  case "connecting":
4622
- C = ns(t, l);
4623
+ w = rs(t, l);
4623
4624
  break;
4624
4625
  case "reconnecting":
4625
- C = rs(n);
4626
+ w = is(n);
4626
4627
  break;
4627
4628
  case "offline":
4628
- C = is(r, g);
4629
+ w = as(r, g);
4629
4630
  break;
4630
- default: C = null;
4631
+ default: w = null;
4631
4632
  }
4632
- return /* @__PURE__ */ R(rt, { children: [
4633
- S && /* @__PURE__ */ L(ar, {
4634
- stores: S.stores,
4635
- registry: S.registry,
4636
- client: S.client,
4633
+ return /* @__PURE__ */ z(nt, { children: [
4634
+ C && /* @__PURE__ */ R(ar, {
4635
+ stores: C.stores,
4636
+ registry: C.registry,
4637
+ client: C.client,
4637
4638
  onAction: p
4638
4639
  }),
4639
- S && /* @__PURE__ */ L(es, {
4640
- stores: S.stores,
4641
- registry: S.registry,
4642
- client: S.client,
4640
+ C && /* @__PURE__ */ R(ts, {
4641
+ stores: C.stores,
4642
+ registry: C.registry,
4643
+ client: C.client,
4643
4644
  onAction: p,
4644
- open: te
4645
+ open: S
4645
4646
  }),
4646
- C != null && /* @__PURE__ */ L("div", {
4647
- ...ts,
4647
+ w != null && /* @__PURE__ */ R("div", {
4648
+ ...ns,
4648
4649
  style: { display: "contents" },
4649
- children: C
4650
+ children: w
4650
4651
  }),
4651
- y && /* @__PURE__ */ L(cs, {}),
4652
- /* @__PURE__ */ L(Uo, {
4652
+ y && /* @__PURE__ */ R(ls, {}),
4653
+ /* @__PURE__ */ R(Wo, {
4653
4654
  client: f,
4654
4655
  feedback: ee,
4655
4656
  connectionState: c,
4656
4657
  isLive: h,
4657
- sheetOpen: te,
4658
+ sheetOpen: S,
4658
4659
  brandingShown: y
4659
4660
  }),
4660
- /* @__PURE__ */ L(ls, {}),
4661
- /* @__PURE__ */ L("div", {
4662
- ...ts,
4661
+ /* @__PURE__ */ R(us, {}),
4662
+ /* @__PURE__ */ R("div", {
4663
+ ...ns,
4663
4664
  style: { display: "contents" },
4664
- children: /* @__PURE__ */ L(co, {
4665
+ children: /* @__PURE__ */ R(lo, {
4665
4666
  state: c,
4666
4667
  forceVisible: o.forcedDebugOverlay
4667
4668
  })
4668
4669
  })
4669
4670
  ] });
4670
4671
  }
4671
- var ss = "https://ikonai.com";
4672
- function cs() {
4673
- return /* @__PURE__ */ R("a", {
4674
- ...ts,
4672
+ var cs = "https://ikonai.com";
4673
+ function ls() {
4674
+ return /* @__PURE__ */ z("a", {
4675
+ ...ns,
4675
4676
  className: "ikon-branding-banner",
4676
- href: ss,
4677
+ href: cs,
4677
4678
  target: "_blank",
4678
4679
  rel: "noopener noreferrer",
4679
4680
  style: {
@@ -4694,44 +4695,44 @@ function cs() {
4694
4695
  boxShadow: "0 -1px 8px rgba(0, 0, 0, 0.25)",
4695
4696
  pointerEvents: "auto"
4696
4697
  },
4697
- children: [/* @__PURE__ */ L("span", {
4698
+ children: [/* @__PURE__ */ R("span", {
4698
4699
  style: { opacity: .75 },
4699
4700
  children: "Powered by"
4700
- }), /* @__PURE__ */ L("span", {
4701
+ }), /* @__PURE__ */ R("span", {
4701
4702
  style: { fontWeight: 700 },
4702
4703
  children: "Ikon"
4703
4704
  })]
4704
4705
  });
4705
4706
  }
4706
- function ls() {
4707
- let { toasts: e, dismissToast: t } = Co();
4708
- return e.length === 0 ? null : /* @__PURE__ */ L("div", {
4709
- ...ts,
4707
+ function us() {
4708
+ let { toasts: e, dismissToast: t } = wo();
4709
+ return e.length === 0 ? null : /* @__PURE__ */ R("div", {
4710
+ ...ns,
4710
4711
  className: "ikon-toast-overlay",
4711
- children: e.map((e) => /* @__PURE__ */ L(us, {
4712
+ children: e.map((e) => /* @__PURE__ */ R(ds, {
4712
4713
  toast: e,
4713
4714
  onDismiss: t
4714
4715
  }, e.id))
4715
4716
  });
4716
4717
  }
4717
- function us({ toast: e, onDismiss: t }) {
4718
- return /* @__PURE__ */ R("div", {
4718
+ function ds({ toast: e, onDismiss: t }) {
4719
+ return /* @__PURE__ */ z("div", {
4719
4720
  className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${e.level}`,
4720
4721
  onClick: () => t(e.id),
4721
4722
  role: "alert",
4722
- children: [/* @__PURE__ */ L("span", {
4723
+ children: [/* @__PURE__ */ R("span", {
4723
4724
  className: "ikon-toast-overlay-icon",
4724
4725
  children: e.level === "error" ? "🚨" : "⚠️"
4725
- }), /* @__PURE__ */ R("div", {
4726
+ }), /* @__PURE__ */ z("div", {
4726
4727
  className: "ikon-toast-overlay-content",
4727
- children: [/* @__PURE__ */ R("span", {
4728
+ children: [/* @__PURE__ */ z("span", {
4728
4729
  className: "ikon-toast-overlay-component",
4729
4730
  children: [
4730
4731
  "[",
4731
4732
  e.component,
4732
4733
  "]"
4733
4734
  ]
4734
- }), /* @__PURE__ */ L("span", {
4735
+ }), /* @__PURE__ */ R("span", {
4735
4736
  className: "ikon-toast-overlay-message",
4736
4737
  children: e.message
4737
4738
  })]
@@ -4740,19 +4741,19 @@ function us({ toast: e, onDismiss: t }) {
4740
4741
  }
4741
4742
  //#endregion
4742
4743
  //#region src/app/feedback/use-ikon-feedback.ts
4743
- function ds(e) {
4744
- let t = M((t) => e?.subscribeToFeedback(t) ?? fs, [e]);
4744
+ function fs(e) {
4745
+ let t = N((t) => e?.subscribeToFeedback(t) ?? ps, [e]);
4745
4746
  return {
4746
- available: nt(t, () => e?.feedback != null, () => !1),
4747
- open: M(() => e?.requestFeedback() ?? !1, [e])
4747
+ available: tt(t, () => e?.feedback != null, () => !1),
4748
+ open: N(() => e?.requestFeedback() ?? !1, [e])
4748
4749
  };
4749
4750
  }
4750
- function fs() {}
4751
+ function ps() {}
4751
4752
  //#endregion
4752
4753
  //#region src/app/connection-recovery.ts
4753
- function ps({ isSessionExpired: e }) {
4754
+ function ms({ isSessionExpired: e }) {
4754
4755
  if (e) {
4755
- let e = k();
4756
+ let e = A();
4756
4757
  if (e) return {
4757
4758
  kind: "freshSession",
4758
4759
  run: () => {
@@ -4769,31 +4770,31 @@ function ps({ isSessionExpired: e }) {
4769
4770
  }
4770
4771
  //#endregion
4771
4772
  //#region src/account/use-account-removal.ts
4772
- function ms(e) {
4773
+ function hs(e) {
4773
4774
  return e instanceof Error && e.message ? e.message : String(e);
4774
4775
  }
4775
- function hs(e = {}) {
4776
- let { backendUrl: t, loadOnMount: n = !0 } = e, { state: r, getToken: i } = Ma(), [a, o] = I(null), [s, c] = I(!1), [l, u] = I(!1), [d, f] = I(null), p = F(!0);
4777
- N(() => (p.current = !0, () => {
4776
+ function gs(e = {}) {
4777
+ let { backendUrl: t, loadOnMount: n = !0 } = e, { state: r, getToken: i } = Na(), [a, o] = L(null), [s, c] = L(!1), [l, u] = L(!1), [d, f] = L(null), p = I(!0);
4778
+ P(() => (p.current = !0, () => {
4778
4779
  p.current = !1;
4779
4780
  }), []);
4780
- let m = r.isAuthenticated && r.user !== null && r.user.provider !== "anonymous" && r.user.provider !== "dev", h = M(async () => {
4781
+ let m = r.isAuthenticated && r.user !== null && r.user.provider !== "anonymous" && r.user.provider !== "dev", h = N(async () => {
4781
4782
  let e = i();
4782
4783
  if (e) {
4783
4784
  c(!0), f(null);
4784
4785
  try {
4785
- let n = await xe({
4786
+ let n = await be({
4786
4787
  authToken: e,
4787
4788
  backendUrl: t
4788
4789
  });
4789
4790
  p.current && o(n.removal ?? null);
4790
4791
  } catch (e) {
4791
- p.current && f(ms(e));
4792
+ p.current && f(hs(e));
4792
4793
  } finally {
4793
4794
  p.current && c(!1);
4794
4795
  }
4795
4796
  }
4796
- }, [t, i]), g = M(async (e) => {
4797
+ }, [t, i]), g = N(async (e) => {
4797
4798
  let n = i();
4798
4799
  if (!n) {
4799
4800
  f("You are not signed in");
@@ -4807,12 +4808,12 @@ function hs(e = {}) {
4807
4808
  });
4808
4809
  p.current && o(r.removal ?? null);
4809
4810
  } catch (e) {
4810
- p.current && f(ms(e));
4811
+ p.current && f(hs(e));
4811
4812
  } finally {
4812
4813
  p.current && u(!1);
4813
4814
  }
4814
- }, [t, i]), _ = M(() => g(Ve), [g]), v = M(() => g(fe), [g]);
4815
- return N(() => {
4815
+ }, [t, i]), _ = N(() => g(Be), [g]), v = N(() => g(de), [g]);
4816
+ return P(() => {
4816
4817
  !n || !m || h();
4817
4818
  }, [
4818
4819
  n,
@@ -4824,7 +4825,7 @@ function hs(e = {}) {
4824
4825
  isSubmittingRemoval: l,
4825
4826
  removalError: d,
4826
4827
  canRequestRemoval: m,
4827
- removalGraceDays: le,
4828
+ removalGraceDays: ce,
4828
4829
  requestAccountRemoval: _,
4829
4830
  cancelAccountRemoval: v,
4830
4831
  reloadAccountRemoval: h
@@ -4832,27 +4833,27 @@ function hs(e = {}) {
4832
4833
  }
4833
4834
  //#endregion
4834
4835
  //#region src/consent/use-consent.ts
4835
- function gs(e) {
4836
+ function _s(e) {
4836
4837
  return e instanceof Error && e.message ? e.message : String(e);
4837
4838
  }
4838
- function _s({ client: e, purposes: t }) {
4839
- let [n, r] = I({}), [i, a] = I(!1), [o, s] = I(!1), [c, l] = I(null), u = F(!0);
4840
- N(() => (u.current = !0, () => {
4839
+ function vs({ client: e, purposes: t }) {
4840
+ let [n, r] = L({}), [i, a] = L(!1), [o, s] = L(!1), [c, l] = L(null), u = I(!0);
4841
+ P(() => (u.current = !0, () => {
4841
4842
  u.current = !1;
4842
4843
  }), []);
4843
- let d = M(async () => {
4844
+ let d = N(async () => {
4844
4845
  if (e) {
4845
4846
  a(!0), l(null);
4846
4847
  try {
4847
- let t = await ze(e);
4848
+ let t = await Re(e);
4848
4849
  u.current && r(t);
4849
4850
  } catch (e) {
4850
- u.current && l(gs(e));
4851
+ u.current && l(_s(e));
4851
4852
  } finally {
4852
4853
  u.current && a(!1);
4853
4854
  }
4854
4855
  }
4855
- }, [e]), f = M(async (t, n) => {
4856
+ }, [e]), f = N(async (t, n) => {
4856
4857
  if (!e) {
4857
4858
  l("The app is not connected, so your answer was not recorded");
4858
4859
  return;
@@ -4865,20 +4866,20 @@ function _s({ client: e, purposes: t }) {
4865
4866
  [i.purpose]: i
4866
4867
  }));
4867
4868
  } catch (e) {
4868
- u.current && l(gs(e));
4869
+ u.current && l(_s(e));
4869
4870
  } finally {
4870
4871
  u.current && s(!1);
4871
4872
  }
4872
- }, [e]), p = M((e) => f(e, Ae), [f]), m = M((e) => f(e, Ue), [f]), h = t.join("\0");
4873
- return N(() => {
4873
+ }, [e]), p = N((e) => f(e, ke), [f]), m = N((e) => f(e, He), [f]), h = t.join("\0");
4874
+ return P(() => {
4874
4875
  d();
4875
4876
  }, [d, h]), {
4876
4877
  answers: n,
4877
4878
  isLoading: i,
4878
4879
  isSubmitting: o,
4879
4880
  error: c,
4880
- consentFor: (e) => ge(n, e),
4881
- isGranted: (e) => Me(n, e),
4881
+ consentFor: (e) => he(n, e),
4882
+ isGranted: (e) => je(n, e),
4882
4883
  grant: p,
4883
4884
  revoke: m,
4884
4885
  reload: d
@@ -4886,37 +4887,37 @@ function _s({ client: e, purposes: t }) {
4886
4887
  }
4887
4888
  //#endregion
4888
4889
  //#region src/i18n/i18n.tsx
4889
- var vs = Ze(null);
4890
- function ys(e, t) {
4890
+ var ys = Xe(null);
4891
+ function bs(e, t) {
4891
4892
  return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] ?? `{${n}}`) : e;
4892
4893
  }
4893
- function bs(e, t) {
4894
- let n = we();
4894
+ function xs(e, t) {
4895
+ let n = Ce();
4895
4896
  if (n && e.includes(n)) return n;
4896
4897
  let r = navigator.language.split("-")[0];
4897
4898
  return e.includes(r) ? r : t && e.includes(t) ? t : "en";
4898
4899
  }
4899
- function xs(e, t, n) {
4900
- return t ? bs(e, n) : n && e.includes(n) ? n : "en";
4900
+ function Ss(e, t, n) {
4901
+ return t ? xs(e, n) : n && e.includes(n) ? n : "en";
4901
4902
  }
4902
- function Ss({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
4903
- let i = xs(Object.keys(t), r, n), a = t[i] ?? t.en, o = P(() => ({
4903
+ function Cs({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
4904
+ let i = Ss(Object.keys(t), r, n), a = t[i] ?? t.en, o = F(() => ({
4904
4905
  t: (e, t) => {
4905
4906
  let n = a[e];
4906
- return ys(n, t);
4907
+ return bs(n, t);
4907
4908
  },
4908
4909
  locale: i,
4909
4910
  translations: a
4910
4911
  }), [a, i]);
4911
- return /* @__PURE__ */ L(vs, {
4912
+ return /* @__PURE__ */ R(ys, {
4912
4913
  value: o,
4913
4914
  children: e
4914
4915
  });
4915
4916
  }
4916
- function Cs() {
4917
- let e = $e(vs);
4917
+ function ws() {
4918
+ let e = Qe(ys);
4918
4919
  if (!e) throw Error("useI18n must be used within an I18nProvider");
4919
4920
  return e;
4920
4921
  }
4921
4922
  //#endregion
4922
- export { ja as AuthProvider, lo as ConnectionStateRenderer, Za as DEBUG_OVERLAY_ENABLED, co as DebugOverlay, Ss as I18nProvider, n as IKON_PLATFORM_STREAM_CATEGORY, en as IKON_UI_BASE_MODULE, xn as IKON_UI_MEDIA_MODULE, En as IKON_UI_SHADERTOY_MODULE, t as IKON_UI_SHADERTOY_TYPE, i as IKON_UI_STREAM_CATEGORY, hn as IKON_UI_VIDEO_CANVAS_TYPE, gn as IKON_UI_VIDEO_URL_PLAYER_TYPE, os as IkonApp, it as IkonUi, jn as IkonUiRegistry, ar as IkonUiSurface, nr as InspectOverlay, or as ParallaxView, Zn as UiComponentRegistry, Xn as UiRenderer, c as UiStreamStore, un as VideoStreamView, Hi as authenticateAnonymous, ea as buildOAuthRedirectUrl, ta as buildSsoRedirectUrl, Ni as clearAuthSession, $i as clearOAuthParams, $t as createBaseResolvers, Qn as createComponentLibrary, Mn as createIkonUiRegistry, Tn as createLazyResolver, vn as createMediaResolvers, Dn as createShadertoyRendererResolver, ra as discoverSsoConnection, na as findSsoConnectionsForHost, ps as getConnectionRecovery, ir as isIkonUiCategoryMatch, Ti as loadAuthSession, tn as loadBaseModule, Sn as loadMediaModule, On as loadShadertoyModule, Gi as parseOAuthCallback, Yi as parseOAuthError, Re as randomUuid, nn as registerBaseModule, Cn as registerMediaModule, kn as registerShadertoyModule, Jn as renderChildren, Fr as renderMotionLetters, ia as requestSsoLinkTicket, J as saveAuthSession, Ui as sendLoginCode, Y as sessionToUser, hs as useAccountRemoval, Ma as useAuth, Ya as useAuthGuard, Na as useAuthOptional, Cr as useCameraCapture, _s as useConsent, Cs as useI18n, xo as useIkonApp, No as useIkonDebug, ds as useIkonFeedback, wo as useIkonReactive, gr as useIkonStyles, vr as useIkonUiStores, Sr as useMicrophoneCapture, To as useReactive, wr as useScreenCapture, yr as useSiblingClient, Xa as useSsoSignIn, Co as useToasts, e as useUiNode, $n as useUiStore, Wi as verifyLoginCode };
4923
+ export { Ma as AuthProvider, uo as ConnectionStateRenderer, Qa as DEBUG_OVERLAY_ENABLED, lo as DebugOverlay, Cs as I18nProvider, n as IKON_PLATFORM_STREAM_CATEGORY, en as IKON_UI_BASE_MODULE, xn as IKON_UI_MEDIA_MODULE, En as IKON_UI_SHADERTOY_MODULE, t as IKON_UI_SHADERTOY_TYPE, i as IKON_UI_STREAM_CATEGORY, hn as IKON_UI_VIDEO_CANVAS_TYPE, gn as IKON_UI_VIDEO_URL_PLAYER_TYPE, ss as IkonApp, rt as IkonUi, jn as IkonUiRegistry, ar as IkonUiSurface, nr as InspectOverlay, or as ParallaxView, Zn as UiComponentRegistry, Xn as UiRenderer, c as UiStreamStore, un as VideoStreamView, Ui as authenticateAnonymous, ta as buildOAuthRedirectUrl, na as buildSsoRedirectUrl, Pi as clearAuthSession, ea as clearOAuthParams, $t as createBaseResolvers, Qn as createComponentLibrary, Mn as createIkonUiRegistry, Tn as createLazyResolver, vn as createMediaResolvers, Dn as createShadertoyRendererResolver, ia as discoverSsoConnection, ra as findSsoConnectionsForHost, ms as getConnectionRecovery, ir as isIkonUiCategoryMatch, Ei as loadAuthSession, tn as loadBaseModule, Sn as loadMediaModule, On as loadShadertoyModule, Ki as parseOAuthCallback, Xi as parseOAuthError, Le as randomUuid, nn as registerBaseModule, Cn as registerMediaModule, kn as registerShadertoyModule, Jn as renderChildren, Ir as renderMotionLetters, aa as requestSsoLinkTicket, J as saveAuthSession, Wi as sendLoginCode, Y as sessionToUser, gs as useAccountRemoval, Na as useAuth, Xa as useAuthGuard, Pa as useAuthOptional, wr as useCameraCapture, vs as useConsent, ws as useI18n, So as useIkonApp, Po as useIkonDebug, fs as useIkonFeedback, To as useIkonReactive, gr as useIkonStyles, vr as useIkonUiStores, Cr as useMicrophoneCapture, Eo as useReactive, Tr as useScreenCapture, br as useSiblingClient, Za as useSsoSignIn, wo as useToasts, e as useUiNode, $n as useUiStore, Gi as verifyLoginCode };