@ikonai/sdk-react-ui 1.12.0 → 1.13.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,7 +1,7 @@
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 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";
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 y, IKON_CAPTURE_EXCLUDE_ATTRIBUTE as b, IKON_INSPECT_MODE_CHANGED_EVENT as x, IKON_INSPECT_OUTLINE_ATTRIBUTE as S, IKON_PARAM_OAUTH_CODE as C, IKON_PARAM_OAUTH_PKCE as w, IKON_PARAM_OAUTH_PROVIDER as T, IKON_PARAM_OAUTH_TOKEN as E, IkonClient as ee, LogLevel as te, ProvisioningTimeoutError as ne, SSO_PROVIDER_PREFIX as D, ServerFullError as re, ServerUnavailableError as ie, SessionNotFoundError as ae, SsoRequiredError as oe, USER_REMOVAL_GRACE_DAYS as se, abortSignalTimeout as O, adoptPkceVerifierFromUrl as ce, buildOAuthStartUrl as le, cancelOwnRemoval as ue, captureViewAtTap as de, clearFeedbackParam as fe, clearLoginPrompt as pe, consentFor as me, createLogger as k, createPkceChallenge as he, deriveAuthUrl as A, deriveBackendType as ge, deriveCrossOriginAuthUrl as _e, extractUserIdFromToken as ve, getCurrentUser as ye, getDebugOverlayParam as be, getFeedbackParam as xe, getLangParam as Se, getLoginPromptState as Ce, getOrCreateDeviceId as we, getSameOriginAuthUrl as Te, getSignedOutParam as Ee, getTestLinkParam as De, getUrlWithoutSession as j, grantConsent as Oe, isCloudEnvironment as ke, isConsentGranted as Ae, isDebugModeEnabled as je, isEmbedded as Me, isInspectModeEnabled as Ne, onEmbeddedOAuthResult as Pe, parseUrlParams as Fe, randomUuid as Ie, readConsent as Le, reportConnectTimeline as Re, requestOwnRemoval as ze, restorePkceVerifier as Be, revokeConsent as Ve, setLoginPromptRequired as He, startEmbeddedOAuthSignIn as Ue, subscribeLoginPrompt as We, subscribeToLogEvents as Ge, takePkceVerifier as Ke } from "@ikonai/sdk";
4
+ import { Fragment as qe, Suspense as Je, createContext as Ye, createElement as Xe, lazy as Ze, 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
5
  import { Fragment as nt, jsx as R, jsxs as z } from "react/jsx-runtime";
6
6
  //#region src/ikon-ui.ts
7
7
  var rt = class {
@@ -327,7 +327,7 @@ function Lt(e, t) {
327
327
  e.addEventListener("wheel", r, i), e.addEventListener("touchmove", r, i), e.addEventListener("keydown", r, i);
328
328
  let a = e.scrollHeight, o = new ResizeObserver(() => {
329
329
  let r = e.scrollHeight > a;
330
- a = e.scrollHeight, !(!r || n || !Ht(e)) && Ft(e, t, "auto");
330
+ a = e.scrollHeight, r && !n && Ht(e) && Ft(e, t, "auto");
331
331
  });
332
332
  for (let t of Array.from(e.children)) o.observe(t);
333
333
  let s = setTimeout(r, It);
@@ -599,72 +599,117 @@ function cn() {
599
599
  }
600
600
  //#endregion
601
601
  //#region src/media/video-stream-view.tsx
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);
602
+ var ln = k("IkonVideoStreamView"), un = {
603
+ position: "absolute",
604
+ inset: 0,
605
+ display: "flex",
606
+ alignItems: "center",
607
+ justifyContent: "center"
608
+ }, dn = M(function({ client: e, streamId: t, className: n, style: r, width: i, height: a, attributes: o, getPlayback: s, fit: c, localStreamId: l, placeholder: u }) {
609
+ let d = I(null), f = I(null), [p, m] = L(null), [, h] = L(0);
610
+ P(() => {
611
+ if (e && l) return e.addLocalVideoCaptureListener(() => {
612
+ h((e) => e + 1);
613
+ });
614
+ }, [e, l]);
615
+ let [, g] = L(0);
604
616
  P(() => {
605
617
  if (e?.isWebRtcEnabled) return e.addWebRtcTrackMapListener((e) => {
606
- e.kind === "video" && u((e) => e + 1);
618
+ e.kind === "video" && g((e) => e + 1);
607
619
  });
608
620
  }, [e]);
609
- let d = e?.isWebRtcEnabled && t ? e.getWebRtcVideoStreamByStreamId(t) : null;
621
+ let _ = e && l ? e.getLocalVideoCaptureStreamByStreamId(l) : null, v = _ ?? (e?.isWebRtcEnabled && t ? e.getWebRtcVideoStreamByStreamId(t) : null), y = t ? `canvas:${t}` : null, b = u != null && u !== !1;
610
622
  P(() => {
611
- let n = c.current;
612
- if (!n || !t || d) return;
613
- let r = !1, i, a = 0, o = !1, l = () => s ? s() : e?.media?.video, u = () => {
623
+ let n = d.current;
624
+ if (!n || !t || v) return;
625
+ let r = !1, i, a, o = `canvas:${t}`, c = 0, l = !1, u = () => s ? s() : e?.media?.video, f = () => {
614
626
  if (r) return;
615
- let s = l();
627
+ let s = u();
616
628
  if (!s && e?.isWebRtcMediaActive) {
617
- o || (o = !0, ln.debug(`Stream ${t} has no WebRTC track yet; its canvas waits for one or for a fallback to custom playback`)), i = setTimeout(u, 500);
629
+ l || (l = !0, ln.debug(`Stream ${t} has no WebRTC track yet; its canvas waits for one or for a fallback to custom playback`)), i = setTimeout(f, 500);
618
630
  return;
619
631
  }
620
632
  if (!s) {
621
- if (a++ >= 50) {
633
+ if (c++ >= 50) {
622
634
  ln.warn(`Gave up attaching the canvas for stream ${t}: video playback never became available`);
623
635
  return;
624
636
  }
625
- i = setTimeout(u, 100);
637
+ i = setTimeout(f, 100);
626
638
  return;
627
639
  }
628
- s.attachCanvas(t, n).catch((e) => {
640
+ a = s.addStreamListener?.(t, (e) => {
641
+ m((t) => e === "firstFrame" ? o : t === o ? null : t);
642
+ }), s.attachCanvas(t, n).catch((e) => {
629
643
  ln.error(`Failed to attach the canvas for stream ${t}, it will stay blank: ${String(e)}`);
630
644
  });
631
645
  };
632
- return u(), () => {
633
- r = !0, i !== void 0 && clearTimeout(i), l()?.detachCanvas(t);
646
+ return f(), () => {
647
+ r = !0, i !== void 0 && clearTimeout(i), a?.(), u()?.detachCanvas(t), m((e) => e === o ? null : e);
634
648
  };
635
649
  }, [
636
650
  e,
637
651
  t,
638
- d,
639
- s
652
+ v,
653
+ s,
654
+ b
640
655
  ]), P(() => {
641
- let e = l.current;
642
- if (!(!e || !d)) return e.srcObject = d, () => {
656
+ let e = f.current;
657
+ if (e && v) return e.srcObject = v, () => {
643
658
  e.srcObject = null;
644
659
  };
645
- }, [d]);
646
- let f = {
647
- ...o,
648
- ...t ? { "data-ikon-video-stream-id": t } : {},
649
- className: n,
650
- style: r,
651
- ...i ? { width: i } : {},
652
- ...a ? { height: a } : {}
653
- };
654
- return d ? /* @__PURE__ */ R("video", {
655
- ref: l,
660
+ }, [v, b]);
661
+ let x = () => {
662
+ v && m(v);
663
+ }, S = t ? { "data-ikon-video-stream-id": t } : {}, C = (e) => v ? /* @__PURE__ */ R("video", {
664
+ ref: f,
656
665
  autoPlay: !0,
657
666
  playsInline: !0,
658
667
  muted: !0,
659
- ...f
660
- }, t) : /* @__PURE__ */ R("canvas", {
661
- ref: c,
662
- ...f
668
+ onLoadedData: x,
669
+ onPlaying: x,
670
+ ...e
671
+ }, _ ? `local:${l}` : t) : /* @__PURE__ */ R("canvas", {
672
+ ref: d,
673
+ ...e
663
674
  }, t);
675
+ if (!b) return C({
676
+ ...o,
677
+ ...S,
678
+ className: n,
679
+ style: c ? {
680
+ ...r,
681
+ objectFit: c
682
+ } : r,
683
+ ...i ? { width: i } : {},
684
+ ...a ? { height: a } : {}
685
+ });
686
+ let w = p !== null && p === (v ?? y);
687
+ return /* @__PURE__ */ z("div", {
688
+ ...o,
689
+ ...S,
690
+ className: n,
691
+ style: {
692
+ position: "relative",
693
+ ...i ? { width: i } : {},
694
+ ...a ? { height: a } : {},
695
+ ...r
696
+ },
697
+ children: [C({ style: {
698
+ display: "block",
699
+ width: "100%",
700
+ height: "100%",
701
+ ...c ? { objectFit: c } : {},
702
+ ...w ? {} : { visibility: "hidden" }
703
+ } }), w ? null : /* @__PURE__ */ R("div", {
704
+ "data-ikon-video-placeholder": "",
705
+ style: un,
706
+ children: u
707
+ })]
708
+ });
664
709
  });
665
710
  //#endregion
666
711
  //#region src/media/video-canvas.tsx
667
- function dn(e) {
712
+ function fn(e) {
668
713
  if (typeof e == "string") {
669
714
  let t = e.trim();
670
715
  return t.length > 0 ? t : void 0;
@@ -674,42 +719,48 @@ function dn(e) {
674
719
  return t.length > 0 ? t.join(" ") : void 0;
675
720
  }
676
721
  }
677
- function fn(...e) {
722
+ function pn(...e) {
678
723
  let t = [];
679
724
  for (let n of e) n && n.trim() && t.push(n.trim());
680
725
  return t.length > 0 ? t.join(" ") : void 0;
681
726
  }
682
- function pn(e) {
727
+ function mn(e) {
683
728
  if (typeof e == "number" && Number.isFinite(e)) return Math.floor(e);
684
729
  if (typeof e == "string" && e.trim().length > 0) {
685
730
  let t = Number(e);
686
731
  if (Number.isFinite(t)) return Math.floor(t);
687
732
  }
688
733
  }
689
- function mn(e) {
734
+ function hn(e) {
690
735
  if (typeof e != "string") return;
691
736
  let t = e.trim();
692
737
  return t.length > 0 ? t : void 0;
693
738
  }
694
- var hn = "std.video-canvas", gn = "std.video-url-player";
695
- function _n() {
739
+ function gn(e) {
740
+ return e === "contain" || e === "cover" ? e : void 0;
741
+ }
742
+ var _n = "std.video-canvas", vn = "std.video-url-player";
743
+ function yn() {
696
744
  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) => {
745
+ let i = e(n.store, t), a = i ? hn(i.props?.streamId) : void 0, o = i ? hn(i.props?.onTapId) : void 0, s = i ? mn(i.props?.width) : void 0, c = i ? mn(i.props?.height) : void 0, l = i ? pn(fn(i.props?.className), r) : r, u = i ? gn(i.props?.fit) : void 0, d = i ? hn(i.props?.localStreamId) : void 0, f = N(() => n.video ?? n.client?.media?.video, [n]), p = N((e) => {
698
746
  if (!o) return;
699
- let t = e.target.getBoundingClientRect();
700
- t.width <= 0 || t.height <= 0 || n.dispatchAction(o, {
701
- x: Math.min(1, Math.max(0, (e.clientX - t.left) / t.width)),
702
- y: Math.min(1, Math.max(0, (e.clientY - t.top) / t.height))
747
+ let t = e.target, r = (t.closest("[data-ikon-video-stream-id]") ?? t).getBoundingClientRect();
748
+ r.width <= 0 || r.height <= 0 || n.dispatchAction(o, {
749
+ x: Math.min(1, Math.max(0, (e.clientX - r.left) / r.width)),
750
+ y: Math.min(1, Math.max(0, (e.clientY - r.top) / r.height))
703
751
  });
704
752
  }, [o, n]);
705
753
  if (!i) return null;
706
- let f = /* @__PURE__ */ R(un, {
754
+ let m = /* @__PURE__ */ R(dn, {
707
755
  client: n.client,
708
756
  streamId: a,
709
757
  className: l,
710
758
  width: s,
711
759
  height: c,
712
- getPlayback: u,
760
+ getPlayback: f,
761
+ fit: u,
762
+ localStreamId: d,
763
+ placeholder: i.children?.length ? n.renderChildren(i.children) : void 0,
713
764
  attributes: {
714
765
  "data-ikon-node-id": i.id,
715
766
  ...i.sourceMarker ? { "data-ikon-source": i.sourceMarker } : {}
@@ -720,22 +771,22 @@ function _n() {
720
771
  display: "contents",
721
772
  cursor: "pointer"
722
773
  },
723
- onPointerUp: d,
724
- children: f
725
- }) : f;
774
+ onPointerUp: p,
775
+ children: m
776
+ }) : m;
726
777
  });
727
778
  return ({ type: e }) => {
728
779
  if (e === "std.video-canvas") return t;
729
780
  };
730
781
  }
731
- function vn() {
782
+ function bn() {
732
783
  return [
733
- _n(),
734
- bn(),
784
+ yn(),
785
+ Sn(),
735
786
  cn()
736
787
  ];
737
788
  }
738
- function yn(e) {
789
+ function xn(e) {
739
790
  if (typeof e == "boolean") return e;
740
791
  if (typeof e == "string") {
741
792
  let t = e.trim().toLowerCase();
@@ -743,13 +794,13 @@ function yn(e) {
743
794
  if (t === "false") return !1;
744
795
  }
745
796
  }
746
- function bn() {
797
+ function Sn() {
747
798
  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;
799
+ let i = e(n.store, t), a = I(null), o = i ? xn(i.props?.autoplay) : void 0, s = i ? hn(i.props?.src) : void 0;
749
800
  if (P(() => {
750
801
  o && a.current && a.current.play().catch(() => {});
751
802
  }, [o, s]), !i) return null;
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;
803
+ let c = pn(fn(i.props?.className), r), l = hn(i.props?.poster), u = xn(i.props?.controls), d = xn(i.props?.loop), f = xn(i.props?.muted), p = xn(i.props?.playsInline), m = mn(i.props?.width), h = mn(i.props?.height), g = i.children?.length ? n.renderChildren(i.children) : void 0;
753
804
  return /* @__PURE__ */ R("video", {
754
805
  ref: a,
755
806
  src: s,
@@ -773,30 +824,30 @@ function bn() {
773
824
  }
774
825
  //#endregion
775
826
  //#region src/media/media-module.ts
776
- var xn = "media", Sn = async () => vn();
777
- function Cn(e) {
778
- e.registerModule(xn, Sn);
827
+ var Cn = "media", wn = async () => bn();
828
+ function Tn(e) {
829
+ e.registerModule(Cn, wn);
779
830
  }
780
831
  //#endregion
781
832
  //#region src/renderer/lazy-resolver.ts
782
- var wn = () => null;
783
- function Tn(e, t, n) {
784
- let r = j(async () => ({ default: n(await t())()({ type: e }) ?? wn })), i = (e) => Ze(Ye, { fallback: null }, Ze(r, e));
833
+ var En = () => null;
834
+ function Dn(e, t, n) {
835
+ let r = Ze(async () => ({ default: n(await t())()({ type: e }) ?? En })), i = (e) => Xe(Je, { fallback: null }, Xe(r, e));
785
836
  return (t) => t.type === e ? i : void 0;
786
837
  }
787
838
  //#endregion
788
839
  //#region src/shadertoy/shadertoy-module.ts
789
- var En = "shadertoy";
790
- function Dn() {
791
- return Tn(t, () => import("./shadertoy-renderer-Cq1lOXBs.js"), (e) => e.createShadertoyRendererResolver);
840
+ var On = "shadertoy";
841
+ function kn() {
842
+ return Dn(t, () => import("./shadertoy-renderer-Qdk-bdwO.js"), (e) => e.createShadertoyRendererResolver);
792
843
  }
793
- var On = async () => Dn();
794
- function kn(e) {
795
- e.registerModule(En, On);
844
+ var An = async () => kn();
845
+ function jn(e) {
846
+ e.registerModule(On, An);
796
847
  }
797
848
  //#endregion
798
849
  //#region src/ikon-ui-registry.ts
799
- var An = O("UIRegistry"), jn = class {
850
+ var Mn = k("UIRegistry"), Nn = class {
800
851
  baseResolvers = [];
801
852
  moduleLoaders = /* @__PURE__ */ new Map();
802
853
  moduleResolvers = /* @__PURE__ */ new Map();
@@ -822,14 +873,14 @@ var An = O("UIRegistry"), jn = class {
822
873
  async loadRegisteredModules() {
823
874
  let e = !1;
824
875
  for (let [t, n] of this.moduleLoaders.entries()) if (!this.moduleResolvers.has(t)) try {
825
- let r = Pn(await n());
876
+ let r = In(await n());
826
877
  this.moduleResolvers.set(t, r), e = !0;
827
878
  } catch (e) {
828
- An.error(`[IkonUiRegistry] Failed to load module '${t}'.`, e);
879
+ Mn.error(`[IkonUiRegistry] Failed to load module '${t}'.`, e);
829
880
  }
830
881
  let t = [];
831
882
  for (let e of this.moduleLoaders.keys()) this.moduleResolvers.has(e) && t.push(e);
832
- return Fn(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e && this.notify(), e;
883
+ return Ln(t, this.activeModuleOrder) || (this.activeModuleOrder = t, e = !0), e && this.notify(), e;
833
884
  }
834
885
  resolve(e) {
835
886
  for (let t of this.baseResolvers) {
@@ -839,7 +890,7 @@ var An = O("UIRegistry"), jn = class {
839
890
  for (let t of this.activeModuleOrder) {
840
891
  let n = this.moduleResolvers.get(t);
841
892
  if (!n) {
842
- An.warn(`Missing resolvers for module ${t}`);
893
+ Mn.warn(`Missing resolvers for module ${t}`);
843
894
  continue;
844
895
  }
845
896
  for (let t of n) {
@@ -852,24 +903,24 @@ var An = O("UIRegistry"), jn = class {
852
903
  for (let e of this.listeners) e();
853
904
  }
854
905
  };
855
- function Mn() {
856
- let e = new jn();
857
- return nn(e), Cn(e), kn(e), e.loadRegisteredModules(), e;
906
+ function Pn() {
907
+ let e = new Nn();
908
+ return nn(e), Tn(e), jn(e), e.loadRegisteredModules(), e;
858
909
  }
859
- function Nn(e) {
910
+ function Fn(e) {
860
911
  return Array.isArray(e) ? e : [e];
861
912
  }
862
- function Pn(e) {
863
- return e ? Nn(e).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
913
+ function In(e) {
914
+ return e ? Fn(e).flatMap((e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : []) : [];
864
915
  }
865
- function Fn(e, t) {
916
+ function Ln(e, t) {
866
917
  if (e.length !== t.length) return !1;
867
918
  for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
868
919
  return !0;
869
920
  }
870
921
  //#endregion
871
922
  //#region src/renderer/use-root-view.ts
872
- function In(e, t) {
923
+ function Rn(e, t) {
873
924
  let n = tt((t) => e.subscribe(t), () => {
874
925
  let n = e.getSnapshot(), r = t ?? n.rootViewId, i = r ? n.views.get(r) : void 0;
875
926
  return `${r ?? ""}:${i?.id ?? ""}`;
@@ -887,8 +938,8 @@ function In(e, t) {
887
938
  }
888
939
  //#endregion
889
940
  //#region src/renderer/ui-renderer.tsx
890
- var Ln = O("UIRenderer");
891
- function Rn(e) {
941
+ var zn = k("UIRenderer");
942
+ function Bn(e) {
892
943
  if (e === void 0) return "{}";
893
944
  if (typeof e == "string") return e;
894
945
  try {
@@ -897,30 +948,30 @@ function Rn(e) {
897
948
  return "{}";
898
949
  }
899
950
  }
900
- function zn(e) {
951
+ function Vn(e) {
901
952
  let t = e.styleIds;
902
953
  return Array.isArray(t) ? t : [];
903
954
  }
904
- var Bn = 1500, Vn = 8e3;
905
- function Hn(e) {
955
+ var Hn = 1500, Un = 8e3;
956
+ function Wn(e) {
906
957
  let [t, n] = L(0);
907
958
  return P(() => {
908
959
  if (e.subscribe) return e.subscribe(() => n((e) => e + 1));
909
960
  }, [e]), t;
910
961
  }
911
- function Un({ nodeType: t, nodeId: n, context: r, className: i }) {
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, [
962
+ function Gn({ nodeType: t, nodeId: n, context: r, className: i }) {
963
+ let [a, o] = L(!1), [s, c] = L(!1), l = e(r.store, n), u = Wn(r.library), d = F(() => l ? r.library.resolve(l) : void 0, [
913
964
  r.library,
914
965
  l,
915
966
  u
916
967
  ]);
917
968
  return P(() => {
918
- let e = setTimeout(() => o(!0), Bn), t = setTimeout(() => c(!0), Vn);
969
+ let e = setTimeout(() => o(!0), Hn), t = setTimeout(() => c(!0), Un);
919
970
  return () => {
920
971
  clearTimeout(e), clearTimeout(t);
921
972
  };
922
973
  }, [t]), P(() => {
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.`);
974
+ s && !d && zn.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
975
  }, [
925
976
  s,
926
977
  d,
@@ -946,50 +997,50 @@ function Un({ nodeType: t, nodeId: n, context: r, className: i }) {
946
997
  children: `Unregistered node type: ${t}\nNo React resolver is registered for it — register the component's module in app.tsx (see the console for details).`
947
998
  }) : null;
948
999
  }
949
- function Wn(e) {
1000
+ function Kn(e) {
950
1001
  let t = e.children;
951
1002
  return Array.isArray(t) ? t : [];
952
1003
  }
953
- function Gn(e, t) {
1004
+ function qn(e, t) {
954
1005
  return e.nodeId === t.nodeId && e.context === t.context;
955
1006
  }
956
- function Kn(e) {
1007
+ function Jn(e) {
957
1008
  if (e.length === 0) return "";
958
1009
  if (e.length === 1) return e[0].id;
959
1010
  let t = e[0].id;
960
1011
  for (let n = 1; n < e.length; n++) t += "," + e[n].id;
961
1012
  return t;
962
1013
  }
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, {
1014
+ var Yn = M(function t({ nodeId: n, context: r }) {
1015
+ let i = e(r.store, n), a = i ? Kn(i) : [], o = Jn(a), s = F(() => a.length === 0 ? null : a.map((e) => /* @__PURE__ */ R(t, {
965
1016
  nodeId: e.id,
966
1017
  context: r
967
1018
  }, e.id)), [o, r]);
968
1019
  if (!i) return null;
969
- if (i.type === "root") return /* @__PURE__ */ R(Je, { children: s }, i.id);
970
- let c = zn(i), l = c.length > 0 ? c.join(" ") : void 0, u = r.library.resolve(i);
1020
+ if (i.type === "root") return /* @__PURE__ */ R(qe, { children: s }, i.id);
1021
+ let c = Vn(i), l = c.length > 0 ? c.join(" ") : void 0, u = r.library.resolve(i);
971
1022
  return u ? /* @__PURE__ */ R(u, {
972
1023
  nodeId: n,
973
1024
  context: r,
974
1025
  className: l
975
- }) : /* @__PURE__ */ R(Un, {
1026
+ }) : /* @__PURE__ */ R(Gn, {
976
1027
  nodeType: i.type,
977
1028
  nodeId: i.id,
978
1029
  context: r,
979
1030
  className: l
980
1031
  });
981
- }, Gn);
982
- function Jn(e, t) {
983
- return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ R(qn, {
1032
+ }, qn);
1033
+ function Xn(e, t) {
1034
+ return !Array.isArray(e) || e.length === 0 ? null : e.map((e) => /* @__PURE__ */ R(Yn, {
984
1035
  nodeId: e.id,
985
1036
  context: t
986
1037
  }, e.id));
987
1038
  }
988
- function Yn(e, t) {
1039
+ function Zn(e, t) {
989
1040
  return e.store === t.store && e.library === t.library && e.viewId === t.viewId && e.emptyFallback === t.emptyFallback;
990
1041
  }
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);
1042
+ var Qn = M(function({ store: e, library: t, viewId: n, emptyFallback: r = null, onAction: i, client: a, video: o }) {
1043
+ let { rootViewId: s, rootNodeId: c } = Rn(e, n), l = I(i);
993
1044
  l.current = i;
994
1045
  let u = I(a);
995
1046
  u.current = a;
@@ -997,7 +1048,7 @@ var Xn = M(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
997
1048
  d.current = o;
998
1049
  let f = N((e, t, n) => {
999
1050
  if (!e) return;
1000
- let r = Rn(t);
1051
+ let r = Bn(t);
1001
1052
  l.current?.(e, r, n);
1002
1053
  }, []), p = F(() => {
1003
1054
  let n = {
@@ -1005,10 +1056,10 @@ var Xn = M(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
1005
1056
  library: t,
1006
1057
  handlerCache: e.handlerCache,
1007
1058
  getPayload: (t) => e.getSnapshot().payloads.get(t),
1008
- renderChildren: (e) => Jn(e, n),
1059
+ renderChildren: (e) => Xn(e, n),
1009
1060
  renderView: (t) => {
1010
1061
  let r = e.getSnapshot().views.get(t);
1011
- return r ? /* @__PURE__ */ R(qn, {
1062
+ return r ? /* @__PURE__ */ R(Yn, {
1012
1063
  nodeId: r.id,
1013
1064
  context: n
1014
1065
  }) : null;
@@ -1030,12 +1081,12 @@ var Xn = M(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
1030
1081
  return !s || !c ? r : /* @__PURE__ */ R("div", {
1031
1082
  "data-ikon-view-id": s,
1032
1083
  style: { display: "contents" },
1033
- children: /* @__PURE__ */ R(qn, {
1084
+ children: /* @__PURE__ */ R(Yn, {
1034
1085
  nodeId: c,
1035
1086
  context: p
1036
1087
  })
1037
1088
  });
1038
- }, Yn), Zn = class {
1089
+ }, Zn), $n = class {
1039
1090
  fallback;
1040
1091
  renderers = /* @__PURE__ */ new Map();
1041
1092
  listeners = /* @__PURE__ */ new Set();
@@ -1060,55 +1111,55 @@ var Xn = M(function({ store: e, library: t, viewId: n, emptyFallback: r = null,
1060
1111
  for (let e of this.listeners) e();
1061
1112
  }
1062
1113
  };
1063
- function Qn(e, t) {
1064
- return new Zn(Object.entries(e), t);
1114
+ function er(e, t) {
1115
+ return new $n(Object.entries(e), t);
1065
1116
  }
1066
1117
  //#endregion
1067
1118
  //#region src/renderer/use-ui-store.ts
1068
- function $n(e) {
1119
+ function tr(e) {
1069
1120
  return tt((t) => e.subscribe(t), () => e.getSnapshot(), () => e.getSnapshot());
1070
1121
  }
1071
1122
  //#endregion
1072
1123
  //#region src/inspect/inspect-overlay.tsx
1073
- function er(e, t) {
1074
- e.style.outline = `2px solid ${t}`, e.style.outlineOffset = "1px", e.setAttribute(x, "");
1124
+ function nr(e, t) {
1125
+ e.style.outline = `2px solid ${t}`, e.style.outlineOffset = "1px", e.setAttribute(S, "");
1075
1126
  }
1076
- function tr(e) {
1077
- e.style.outline = "", e.style.outlineOffset = "", e.removeAttribute(x);
1127
+ function rr(e) {
1128
+ e.style.outline = "", e.style.outlineOffset = "", e.removeAttribute(S);
1078
1129
  }
1079
- function nr() {
1080
- let [e, t] = L(Pe), n = I(!1);
1130
+ function ir() {
1131
+ let [e, t] = L(Ne), n = I(!1);
1081
1132
  return P(() => {
1082
1133
  if (e) return;
1083
1134
  let r = () => {
1084
- Pe() && t(!0);
1135
+ Ne() && t(!0);
1085
1136
  }, i = (e) => {
1086
1137
  e.data?.type === "ikon-inspect-mode" && e.data.enabled && (n.current = !0, t(!0));
1087
1138
  };
1088
- return window.addEventListener(b, r), window.addEventListener("message", i), () => {
1089
- window.removeEventListener(b, r), window.removeEventListener("message", i);
1139
+ return window.addEventListener(x, r), window.addEventListener("message", i), () => {
1140
+ window.removeEventListener(x, r), window.removeEventListener("message", i);
1090
1141
  };
1091
1142
  }, [e]), P(() => {
1092
1143
  if (!e) return;
1093
1144
  let t = window.parent === window || n.current, r = null, i = [], a = document.createElement("div");
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);
1145
+ a.setAttribute(b, ""), 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);
1095
1146
  function o() {
1096
- r && !i.includes(r) && tr(r), r = null, a.style.display = "none";
1147
+ r && !i.includes(r) && rr(r), r = null, a.style.display = "none";
1097
1148
  }
1098
1149
  function s(e) {
1099
- for (let e of i) e !== r && tr(e);
1150
+ for (let e of i) e !== r && rr(e);
1100
1151
  i = [];
1101
1152
  let t = new Set(e);
1102
1153
  for (let e of Array.from(document.querySelectorAll("[data-ikon-source]"))) {
1103
1154
  let n = e.getAttribute("data-ikon-source") ?? "";
1104
- t.has(n) && (er(e, "#a6e3a1"), i.push(e));
1155
+ t.has(n) && (nr(e, "#a6e3a1"), i.push(e));
1105
1156
  }
1106
1157
  }
1107
1158
  function c(e) {
1108
1159
  if (!t) return;
1109
1160
  let n = e.target.closest?.("[data-ikon-source]");
1110
1161
  if (!n || n === r) return;
1111
- o(), r = n, er(r, "#89b4fa");
1162
+ o(), r = n, nr(r, "#89b4fa");
1112
1163
  let i = n.getAttribute("data-ikon-source") ?? "";
1113
1164
  a.textContent = i, a.style.display = "block";
1114
1165
  let s = n.getBoundingClientRect();
@@ -1137,7 +1188,7 @@ function nr() {
1137
1188
  }
1138
1189
  function f(e) {
1139
1190
  if (e === r || (o(), !e)) return;
1140
- r = e, er(r, i.includes(e) ? "#a6e3a1" : "#89b4fa");
1191
+ r = e, nr(r, i.includes(e) ? "#a6e3a1" : "#89b4fa");
1141
1192
  let t = e.getAttribute("data-ikon-source") ?? "";
1142
1193
  a.textContent = t, a.style.display = "block";
1143
1194
  let n = e.getBoundingClientRect();
@@ -1216,11 +1267,11 @@ function nr() {
1216
1267
  }
1217
1268
  //#endregion
1218
1269
  //#region src/surface.tsx
1219
- var rr = O("IkonUiSurface");
1220
- function ir(e, t) {
1270
+ var ar = k("IkonUiSurface");
1271
+ function or(e, t) {
1221
1272
  return e === t;
1222
1273
  }
1223
- var ar = M(function({ stores: e, registry: t, category: n = a, onAction: r, client: i, inspect: o = !0 }) {
1274
+ var sr = M(function({ stores: e, registry: t, category: n = a, onAction: r, client: i, inspect: o = !0 }) {
1224
1275
  let s = F(() => Array.from(e.keys()).sort().join(","), [e]), c = I(r);
1225
1276
  c.current = r;
1226
1277
  let l = I(i);
@@ -1229,10 +1280,10 @@ var ar = M(function({ stores: e, registry: t, category: n = a, onAction: r, clie
1229
1280
  let t = [];
1230
1281
  for (let [r, i] of e) {
1231
1282
  let e = i.store.getSnapshot();
1232
- ir(i.category, n) && (!e.rootViewId || !e.views.has(e.rootViewId) || t.push({
1283
+ or(i.category, n) && e.rootViewId && e.views.has(e.rootViewId) && t.push({
1233
1284
  key: r,
1234
1285
  store: i.store
1235
- }));
1286
+ });
1236
1287
  }
1237
1288
  return t;
1238
1289
  }, [
@@ -1241,8 +1292,8 @@ var ar = M(function({ stores: e, registry: t, category: n = a, onAction: r, clie
1241
1292
  s
1242
1293
  ]), d = I(!1), f = u.length > 0;
1243
1294
  return P(() => {
1244
- f && !d.current && (d.current = !0, rr.debug("First UI render"));
1245
- }, [f]), f ? /* @__PURE__ */ z(nt, { children: [o && /* @__PURE__ */ R(nr, {}), u.map(({ key: e, store: n }) => /* @__PURE__ */ R(Xn, {
1295
+ f && !d.current && (d.current = !0, ar.debug("First UI render"));
1296
+ }, [f]), f ? /* @__PURE__ */ z(nt, { children: [o && /* @__PURE__ */ R(ir, {}), u.map(({ key: e, store: n }) => /* @__PURE__ */ R(Qn, {
1246
1297
  store: n,
1247
1298
  library: t,
1248
1299
  onAction: c.current,
@@ -1252,8 +1303,8 @@ var ar = M(function({ stores: e, registry: t, category: n = a, onAction: r, clie
1252
1303
  });
1253
1304
  //#endregion
1254
1305
  //#region src/parallax-view.tsx
1255
- function or({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
1256
- return /* @__PURE__ */ R(ar, {
1306
+ function cr({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
1307
+ return /* @__PURE__ */ R(sr, {
1257
1308
  stores: t,
1258
1309
  registry: n,
1259
1310
  category: e,
@@ -1263,7 +1314,7 @@ function or({ mount: e, stores: t, registry: n, client: r, onAction: i }) {
1263
1314
  }
1264
1315
  //#endregion
1265
1316
  //#region src/motion/motion-controller.ts
1266
- var sr = O("MotionController"), cr = {
1317
+ var lr = k("MotionController"), ur = {
1267
1318
  ease: [
1268
1319
  .25,
1269
1320
  .1,
@@ -1436,17 +1487,17 @@ var sr = O("MotionController"), cr = {
1436
1487
  function G(e) {
1437
1488
  return e <= 0 ? 0 : e >= 1 ? 1 : e;
1438
1489
  }
1439
- function lr(e) {
1490
+ function dr(e) {
1440
1491
  if (e == null) return;
1441
1492
  let t = e.trim();
1442
1493
  if (!t) return;
1443
1494
  let n = Number.parseFloat(t);
1444
1495
  return Number.isFinite(n) ? n : void 0;
1445
1496
  }
1446
- function ur(e) {
1497
+ function fr(e) {
1447
1498
  return typeof CSS < "u" && CSS.escape ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
1448
1499
  }
1449
- function dr(e, t, n, r) {
1500
+ function pr(e, t, n, r) {
1450
1501
  let i = 1 / 10, a = /* @__PURE__ */ new Float32Array(11);
1451
1502
  function o(e, t, n) {
1452
1503
  return ((3 * t - 3 * n + 1) * e + (3 * n - 6 * t)) * e * e + 3 * t * e;
@@ -1480,34 +1531,34 @@ function dr(e, t, n, r) {
1480
1531
  for (let t = 0; t < 11; t += 1) a[t] = o(t * i, e, n);
1481
1532
  return (e) => e <= 0 ? 0 : e >= 1 ? 1 : o(u(e), t, r);
1482
1533
  }
1483
- function fr(e) {
1534
+ function mr(e) {
1484
1535
  let t = /steps\(\s*([0-9]+)\s*(?:,\s*([a-z-]+)\s*)?\)/i.exec(e);
1485
1536
  if (!t) return (e) => G(e);
1486
1537
  let n = Math.max(1, parseInt(t[1], 10)), r = (t[2] ?? "end").toLowerCase();
1487
1538
  return r === "start" || r === "jump-start" ? (e) => G(Math.ceil(e * n) / n) : r === "none" || r === "jump-none" ? (e) => G(Math.round(e * n) / n) : r === "both" || r === "jump-both" ? (e) => G((Math.floor(e * n) + .5) / n) : (e) => G(Math.floor(e * n) / n);
1488
1539
  }
1489
- function pr(e) {
1540
+ function hr(e) {
1490
1541
  if (!e) return (e) => G(e);
1491
1542
  let t = e.trim().toLowerCase();
1492
1543
  if (!t || t === "linear") return (e) => G(e);
1493
- if (cr[t]) {
1494
- let [e, n, r, i] = cr[t], a = dr(e, n, r, i);
1544
+ if (ur[t]) {
1545
+ let [e, n, r, i] = ur[t], a = pr(e, n, r, i);
1495
1546
  return (e) => G(a(G(e)));
1496
1547
  }
1497
1548
  if (t.startsWith("cubic-bezier(") && t.endsWith(")")) {
1498
1549
  let e = t.slice(13, -1).split(",").map((e) => Number.parseFloat(e.trim()));
1499
1550
  if (e.length === 4 && e.every((e) => Number.isFinite(e))) {
1500
- let [t, n, r, i] = e, a = dr(t, n, r, i);
1551
+ let [t, n, r, i] = e, a = pr(t, n, r, i);
1501
1552
  return (e) => G(a(G(e)));
1502
1553
  }
1503
1554
  }
1504
1555
  if (t.startsWith("steps(") && t.endsWith(")")) {
1505
- let e = fr(t);
1556
+ let e = mr(t);
1506
1557
  return (t) => e(G(t));
1507
1558
  }
1508
1559
  return (e) => G(e);
1509
1560
  }
1510
- function mr(e) {
1561
+ function gr(e) {
1511
1562
  if (!e) return;
1512
1563
  let t = /(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)\s*->\s*(-?\d+(?:\.\d+)?)\s*\.\.\s*(-?\d+(?:\.\d+)?)/.exec(e);
1513
1564
  if (!t) return;
@@ -1524,7 +1575,7 @@ function mr(e) {
1524
1575
  outEnd: a
1525
1576
  };
1526
1577
  }
1527
- var hr = new class {
1578
+ var _r = new class {
1528
1579
  bindingsByStyle = /* @__PURE__ */ new Map();
1529
1580
  observer;
1530
1581
  observeScheduled = !1;
@@ -1549,7 +1600,7 @@ var hr = new class {
1549
1600
  for (let e of Array.from(this.globalCleanups)) try {
1550
1601
  e();
1551
1602
  } catch (e) {
1552
- sr.warn("Failed to cleanup binding listener", e);
1603
+ lr.warn("Failed to cleanup binding listener", e);
1553
1604
  }
1554
1605
  this.globalCleanups.clear(), this.elementStates.clear(), this.styleToElements.clear(), this.bindingsByStyle.clear(), this.pendingScanStyles.clear(), this.scanScheduled = !1, this.observer &&= (this.observer.disconnect(), void 0);
1555
1606
  }
@@ -1557,24 +1608,24 @@ var hr = new class {
1557
1608
  if (t) try {
1558
1609
  let n = JSON.parse(t).motionBindings ?? [], r = n.map((t) => this.parseBinding(e, t)).filter((e) => e !== void 0);
1559
1610
  if (r.length === 0) {
1560
- n.length > 0 && sr.warn(`Style ${e} declares ${n.length} motion binding(s) but none are usable; it will not animate`);
1611
+ n.length > 0 && lr.warn(`Style ${e} declares ${n.length} motion binding(s) but none are usable; it will not animate`);
1561
1612
  return;
1562
1613
  }
1563
1614
  return { bindings: r };
1564
1615
  } catch (e) {
1565
- sr.warn("Failed to parse motion metadata", e);
1616
+ lr.warn("Failed to parse motion metadata", e);
1566
1617
  return;
1567
1618
  }
1568
1619
  }
1569
1620
  parseBinding(e, t) {
1570
1621
  let n = t.source?.trim();
1571
1622
  if (!n) {
1572
- sr.warn(`Style ${e} has a motion binding with no source; discarding it`);
1623
+ lr.warn(`Style ${e} has a motion binding with no source; discarding it`);
1573
1624
  return;
1574
1625
  }
1575
- let r = lr(t.min) ?? 0, i = lr(t.max), a = i === void 0 ? r + 100 : i, o = (t.clamp ?? "clamp").trim().toLowerCase(), s = !!t.reverse, c = pr(t.ease), l = mr(t.map), u = t.targetId?.trim() || void 0;
1626
+ let r = dr(t.min) ?? 0, i = dr(t.max), a = i === void 0 ? r + 100 : i, o = (t.clamp ?? "clamp").trim().toLowerCase(), s = !!t.reverse, c = hr(t.ease), l = gr(t.map), u = t.targetId?.trim() || void 0;
1576
1627
  if (Number.isNaN(r) || Number.isNaN(a)) {
1577
- sr.warn(`Style ${e} has a motion binding on '${n}' with an unreadable range; discarding it`);
1628
+ lr.warn(`Style ${e} has a motion binding on '${n}' with an unreadable range; discarding it`);
1578
1629
  return;
1579
1630
  }
1580
1631
  return {
@@ -1622,7 +1673,7 @@ var hr = new class {
1622
1673
  scanExistingNodes(e) {
1623
1674
  let t = this.bindingsByStyle.get(e);
1624
1675
  if (!t || typeof document > "u") return;
1625
- let n = `.${ur(e)}`;
1676
+ let n = `.${fr(e)}`;
1626
1677
  document.querySelectorAll(n).forEach((n) => this.applyStyleToElement(n, e, t));
1627
1678
  }
1628
1679
  applyStyleToElement(e, t, n) {
@@ -1658,7 +1709,7 @@ var hr = new class {
1658
1709
  }
1659
1710
  resolveScrollContainer(e, t) {
1660
1711
  if (t.targetId) {
1661
- let e = `[data-ikon-motion-source="${ur(t.targetId)}"]`, n = typeof document < "u" ? document.querySelector(e) : null;
1712
+ let e = `[data-ikon-motion-source="${fr(t.targetId)}"]`, n = typeof document < "u" ? document.querySelector(e) : null;
1662
1713
  if (n) return n;
1663
1714
  }
1664
1715
  return e.closest("[data-ikon-view-type=\"scroll-view\"]");
@@ -1713,7 +1764,7 @@ var hr = new class {
1713
1764
  try {
1714
1765
  e();
1715
1766
  } catch (e) {
1716
- sr.warn("Failed to cleanup listener", e);
1767
+ lr.warn("Failed to cleanup listener", e);
1717
1768
  }
1718
1769
  this.globalCleanups.delete(e);
1719
1770
  }
@@ -1753,26 +1804,26 @@ var hr = new class {
1753
1804
  }();
1754
1805
  //#endregion
1755
1806
  //#region src/use-ikon-styles.ts
1756
- function gr(e) {
1807
+ function vr(e) {
1757
1808
  let t = I(/* @__PURE__ */ new Map()), n = N(({ styleId: e, css: n, common: r }) => {
1758
- if (!(!e || typeof document > "u")) {
1809
+ if (e && typeof document < "u") {
1759
1810
  if (n) {
1760
1811
  let r = t.current.get(e);
1761
1812
  r || (r = document.createElement("style"), r.setAttribute("data-ikon-style-id", e), document.head.appendChild(r), t.current.set(e, r)), r.textContent = n;
1762
1813
  }
1763
- hr.registerStyle(e, r);
1814
+ _r.registerStyle(e, r);
1764
1815
  }
1765
1816
  }, []), r = N((e) => {
1766
- if (!(typeof document > "u")) for (let n of e) {
1817
+ if (typeof document < "u") for (let n of e) {
1767
1818
  let e = t.current.get(n);
1768
- e && (e.remove(), t.current.delete(n)), hr.unregisterStyle(n);
1819
+ e && (e.remove(), t.current.delete(n)), _r.unregisterStyle(n);
1769
1820
  }
1770
1821
  }, []), i = N(() => {
1771
1822
  if (typeof document < "u") {
1772
1823
  for (let e of t.current.values()) e.remove();
1773
1824
  t.current.clear();
1774
1825
  }
1775
- hr.reset();
1826
+ _r.reset();
1776
1827
  }, []);
1777
1828
  return P(() => {
1778
1829
  if (!e) return;
@@ -1794,7 +1845,7 @@ function gr(e) {
1794
1845
  }
1795
1846
  //#endregion
1796
1847
  //#region src/use-ikon-ui-stores.ts
1797
- function _r(e) {
1848
+ function yr(e) {
1798
1849
  let t = [];
1799
1850
  for (let [n, r] of e) {
1800
1851
  let e = r.store.getSnapshot(), i = e.rootViewId && e.views.has(e.rootViewId);
@@ -1802,7 +1853,7 @@ function _r(e) {
1802
1853
  }
1803
1854
  return t.sort(), t.join(",");
1804
1855
  }
1805
- function vr(e) {
1856
+ function br(e) {
1806
1857
  let [t, n] = L(), r = I("");
1807
1858
  return P(() => {
1808
1859
  if (!e) {
@@ -1810,7 +1861,7 @@ function vr(e) {
1810
1861
  return;
1811
1862
  }
1812
1863
  let t = () => {
1813
- let t = e.getStores(), i = _r(t);
1864
+ let t = e.getStores(), i = yr(t);
1814
1865
  i !== r.current && (r.current = i, n(t));
1815
1866
  };
1816
1867
  return t(), e.subscribe(t);
@@ -1818,8 +1869,8 @@ function vr(e) {
1818
1869
  }
1819
1870
  //#endregion
1820
1871
  //#region src/media/use-sibling-client.ts
1821
- var yr = O("useSiblingClient");
1822
- function br(e, t, n) {
1872
+ var xr = k("useSiblingClient");
1873
+ function Sr(e, t, n) {
1823
1874
  let [r, i] = L(null), [a, o] = L(null), s = I(n);
1824
1875
  s.current = n;
1825
1876
  let c = t ? JSON.stringify(Object.entries(t).sort(([e], [t]) => e < t ? -1 : +(e > t))) : null;
@@ -1829,7 +1880,7 @@ function br(e, t, n) {
1829
1880
  return o(null), n.connect().then(() => {
1830
1881
  r || i(n);
1831
1882
  }).catch((e) => {
1832
- r || (yr.error("Sibling connection failed:", e), o(e instanceof Error ? e : Error(String(e))));
1883
+ r || (xr.error("Sibling connection failed:", e), o(e instanceof Error ? e : Error(String(e))));
1833
1884
  }), () => {
1834
1885
  r = !0, i(null), n.disconnect();
1835
1886
  };
@@ -1840,8 +1891,8 @@ function br(e, t, n) {
1840
1891
  }
1841
1892
  //#endregion
1842
1893
  //#region src/media/use-media-capture.ts
1843
- var xr = O("IkonMediaCaptureHooks");
1844
- function Sr(e, t, n, r) {
1894
+ var Cr = k("IkonMediaCaptureHooks");
1895
+ function wr(e, t, n, r) {
1845
1896
  let [i, a] = L(null), o = I(r);
1846
1897
  return o.current = r, P(() => {
1847
1898
  if (!e || !t) return;
@@ -1856,7 +1907,7 @@ function Sr(e, t, n, r) {
1856
1907
  try {
1857
1908
  i = await o.current(t);
1858
1909
  } catch (e) {
1859
- r || (xr.error(`${n} capture start failed: ${String(e)}`), a(e instanceof Error ? e : Error(String(e))));
1910
+ r || (Cr.error(`${n} capture start failed: ${String(e)}`), a(e instanceof Error ? e : Error(String(e))));
1860
1911
  return;
1861
1912
  }
1862
1913
  r && i.stop();
@@ -1870,17 +1921,17 @@ function Sr(e, t, n, r) {
1870
1921
  n
1871
1922
  ]), { error: i };
1872
1923
  }
1873
- function Cr(e, t, n) {
1924
+ function Tr(e, t, n) {
1874
1925
  let r = I(n);
1875
- return r.current = n, Sr(e, t, "microphone", N((e) => e.audio.startMic(r.current ?? {}), []));
1926
+ return r.current = n, wr(e, t, "microphone", N((e) => e.audio.startMic(r.current ?? {}), []));
1876
1927
  }
1877
- function wr(e, t, n) {
1928
+ function Er(e, t, n) {
1878
1929
  let r = I(n);
1879
- return r.current = n, Sr(e, t, "camera", N((e) => e.video.startCamera(r.current), []));
1930
+ return r.current = n, wr(e, t, "camera", N((e) => e.video.startCamera(r.current), []));
1880
1931
  }
1881
- function Tr(e, t, n) {
1932
+ function Dr(e, t, n) {
1882
1933
  let r = I(n);
1883
- return r.current = n, Sr(e, t, "screen", N((e) => e.video.startScreen(r.current), []));
1934
+ return r.current = n, wr(e, t, "screen", N((e) => e.video.startScreen(r.current), []));
1884
1935
  }
1885
1936
  //#endregion
1886
1937
  //#region src/shared/render-motion-letters.tsx
@@ -1894,7 +1945,7 @@ var K = {
1894
1945
  LetterReverse: 32,
1895
1946
  WordReverse: 64,
1896
1947
  LineReverse: 128
1897
- }, Er = [
1948
+ }, Or = [
1898
1949
  {
1899
1950
  flag: K.Letter,
1900
1951
  hints: [
@@ -1943,7 +1994,7 @@ var K = {
1943
1994
  "[data-emoji]"
1944
1995
  ]
1945
1996
  }
1946
- ], Dr = [
1997
+ ], kr = [
1947
1998
  {
1948
1999
  flag: K.LetterReverse,
1949
2000
  hint: "[data-motion-letter]"
@@ -1956,8 +2007,8 @@ var K = {
1956
2007
  flag: K.LineReverse,
1957
2008
  hint: "[data-motion-line]"
1958
2009
  }
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) {
2010
+ ], Ar = ":nth-last-child(", jr = K.Letter | K.Word | K.Line | K.Paragraph | K.Emoji | K.LetterReverse | K.WordReverse | K.LineReverse, Mr = K.LetterReverse | K.WordReverse | K.LineReverse, Nr = K.Letter | K.Word | K.Line | K.Paragraph, Pr = /* @__PURE__ */ new Map(), Fr = 16384;
2011
+ function Ir(e) {
1961
2012
  return {
1962
2013
  letter: 0,
1963
2014
  word: 0,
@@ -1968,81 +2019,81 @@ function Pr(e) {
1968
2019
  reverseTotals: e
1969
2020
  };
1970
2021
  }
1971
- function Fr(e, t, n) {
2022
+ function Lr(e, t, n) {
1972
2023
  let r = e.reverseTotals?.[t];
1973
2024
  return r === void 0 ? n : r - 1 - n;
1974
2025
  }
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;
2026
+ function Rr(e, t) {
2027
+ if (!e || e.length > Fr) return e;
2028
+ let n = mi(t), r = q(n, K.Emoji), i = n & Nr;
1978
2029
  if (i === K.None && !r) return e;
1979
2030
  let a = e.replace(/\r\n/g, "\n").replace(/\r/g, "\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)));
2031
+ if (i === K.None) return fi(a);
2032
+ let o = li(a);
2033
+ return o.length === 0 ? r ? fi(a) : e : zr(ui(o), n, Ir(Br(o, n)));
1983
2034
  }
1984
- function Lr(e, t, n) {
2035
+ function zr(e, t, n) {
1985
2036
  let r = [];
1986
- for (let i of e) r.push(...zr(i, t, n));
2037
+ for (let i of e) r.push(...Vr(i, t, n));
1987
2038
  return r;
1988
2039
  }
1989
- function Rr(e, t) {
1990
- if ((t & Ar) === K.None) return;
2040
+ function Br(e, t) {
2041
+ if ((t & Mr) === K.None) return;
1991
2042
  let n = q(t, K.LetterReverse), r = q(t, K.WordReverse), i = 0, a = 0;
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));
2043
+ if (n || r) for (let t of e) for (let e of t.text.split(/\s+/)) e && (a += 1, n && (i += qr(e).length));
1993
2044
  return {
1994
2045
  letter: n ? i : void 0,
1995
2046
  word: r ? a : void 0,
1996
2047
  line: q(t, K.LineReverse) ? e.length : void 0
1997
2048
  };
1998
2049
  }
1999
- function zr(e, t, n) {
2050
+ function Vr(e, t, n) {
2000
2051
  let r = [];
2001
2052
  for (let i of e) {
2002
- let e = Br(i, t, n);
2053
+ let e = Hr(i, t, n);
2003
2054
  r.push(...e);
2004
2055
  }
2005
2056
  if (q(t, K.Paragraph)) {
2006
2057
  let e = n.paragraph++;
2007
2058
  return [/* @__PURE__ */ R("span", {
2008
2059
  "data-motion-paragraph": !0,
2009
- style: li(e),
2060
+ style: di(e),
2010
2061
  children: r
2011
2062
  }, `motion-paragraph-${e}`)];
2012
2063
  }
2013
2064
  return r;
2014
2065
  }
2015
- function Br(e, t, n) {
2016
- let r = Vr(e.text, t, n), i = [];
2066
+ function Hr(e, t, n) {
2067
+ let r = Ur(e.text, t, n), i = [];
2017
2068
  if (q(t, K.Line)) {
2018
2069
  let e = n.line++;
2019
2070
  i.push(/* @__PURE__ */ R("span", {
2020
2071
  "data-motion-line": !0,
2021
- style: li(Fr(n, "line", e)),
2072
+ style: di(Lr(n, "line", e)),
2022
2073
  children: r
2023
2074
  }, `motion-line-${e}`));
2024
2075
  } else i.push(...r);
2025
2076
  for (let t = 0; t < e.breaks; t++) i.push(/* @__PURE__ */ R("br", {}, `motion-break-${n.br++}`));
2026
2077
  return i;
2027
2078
  }
2028
- function Vr(e, t, n) {
2079
+ function Ur(e, t, n) {
2029
2080
  if (!e) return [];
2030
2081
  let r = q(t, K.Word), i = [], a = /(\s+)/g, o = 0, s;
2031
2082
  for (; (s = a.exec(e)) !== null;) {
2032
2083
  if (s.index > o) {
2033
2084
  let a = e.slice(o, s.index);
2034
- i.push(Hr(a, n, t, r));
2085
+ i.push(Wr(a, n, t, r));
2035
2086
  }
2036
2087
  i.push(s[0]), o = s.index + s[0].length;
2037
2088
  }
2038
2089
  if (o < e.length) {
2039
2090
  let a = e.slice(o);
2040
- i.push(Hr(a, n, t, r));
2091
+ i.push(Wr(a, n, t, r));
2041
2092
  }
2042
2093
  return i;
2043
2094
  }
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);
2095
+ function Wr(e, t, n, r) {
2096
+ let i = t.word++, a = Kr(e, n, t), o = `motion-word-${i}`, s = Gr(Lr(t, "word", i), r);
2046
2097
  return r ? /* @__PURE__ */ R("span", {
2047
2098
  "data-motion-word": !0,
2048
2099
  style: s,
@@ -2052,25 +2103,25 @@ function Hr(e, t, n, r) {
2052
2103
  children: a
2053
2104
  }, o);
2054
2105
  }
2055
- function Ur(e, t) {
2106
+ function Gr(e, t) {
2056
2107
  return t ? {
2057
- ...li(e),
2108
+ ...di(e),
2058
2109
  whiteSpace: "nowrap"
2059
2110
  } : { whiteSpace: "nowrap" };
2060
2111
  }
2061
- function Wr(e, t, n) {
2112
+ function Kr(e, t, n) {
2062
2113
  if (!e) return [];
2063
2114
  let r = q(t, K.Letter), i = q(t, K.Emoji);
2064
2115
  if (!r) {
2065
2116
  if (!i) return [e];
2066
- let t = Gr(e);
2117
+ let t = qr(e);
2067
2118
  if (t.length === 0) return [e];
2068
- let { nodes: r } = di(t, n);
2119
+ let { nodes: r } = pi(t, n);
2069
2120
  return r;
2070
2121
  }
2071
- let a = [], o = Gr(e);
2122
+ let a = [], o = qr(e);
2072
2123
  for (let e of o) {
2073
- let t = n.letter++, r = `motion-letter-${t}`, o = li(Fr(n, "letter", t));
2124
+ let t = n.letter++, r = `motion-letter-${t}`, o = di(Lr(n, "letter", t));
2074
2125
  if (e === "\n") {
2075
2126
  a.push(/* @__PURE__ */ R("span", {
2076
2127
  "data-motion-letter": !0,
@@ -2079,7 +2130,7 @@ function Wr(e, t, n) {
2079
2130
  }, r));
2080
2131
  continue;
2081
2132
  }
2082
- let s = i && ii(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
2133
+ let s = i && oi(e) ? { "data-motion-emoji": !0 } : void 0, c = e === " " ? "\xA0" : e;
2083
2134
  a.push(/* @__PURE__ */ R("span", {
2084
2135
  "data-motion-letter": !0,
2085
2136
  style: o,
@@ -2089,46 +2140,46 @@ function Wr(e, t, n) {
2089
2140
  }
2090
2141
  return a;
2091
2142
  }
2092
- function Gr(e) {
2143
+ function qr(e) {
2093
2144
  if (!e) return [];
2094
- let t = qr();
2095
- return t ? Array.from(t.segment(e), (e) => e.segment) : Jr(e);
2145
+ let t = Yr();
2146
+ return t ? Array.from(t.segment(e), (e) => e.segment) : Xr(e);
2096
2147
  }
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;
2148
+ var Jr;
2149
+ function Yr() {
2150
+ return Jr === void 0 && (Jr = typeof Intl < "u" && typeof Intl.Segmenter == "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null), Jr;
2100
2151
  }
2101
- function Jr(e) {
2152
+ function Xr(e) {
2102
2153
  let t = [], n = Array.from(e), r = "";
2103
2154
  for (let e = 0; e < n.length; e++) {
2104
2155
  let i = n[e], a = n[e + 1];
2105
- r += i, !(a && Yr(i, a)) && (t.push(r), r = "");
2156
+ r += i, !(a && Zr(i, a)) && (t.push(r), r = "");
2106
2157
  }
2107
2158
  return r && t.push(r), t;
2108
2159
  }
2109
- function Yr(e, t) {
2110
- return t ? !!(Xr(e) || Xr(t) || ti(t) || Zr(t) || Qr(t) || $r(e) && $r(t)) : !1;
2160
+ function Zr(e, t) {
2161
+ return t ? !!(Qr(e) || Qr(t) || ri(t) || $r(t) || ei(t) || ti(e) && ti(t)) : !1;
2111
2162
  }
2112
- function Xr(e) {
2163
+ function Qr(e) {
2113
2164
  return e.codePointAt(0) === 8205;
2114
2165
  }
2115
- function Zr(e) {
2166
+ function $r(e) {
2116
2167
  let t = e.codePointAt(0);
2117
2168
  return t === void 0 ? !1 : t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999;
2118
2169
  }
2119
- function Qr(e) {
2170
+ function ei(e) {
2120
2171
  let t = e.codePointAt(0);
2121
2172
  return t !== void 0 && t >= 127995 && t <= 127999;
2122
2173
  }
2123
- function $r(e) {
2174
+ function ti(e) {
2124
2175
  let t = e.codePointAt(0);
2125
2176
  return t !== void 0 && t >= 127462 && t <= 127487;
2126
2177
  }
2127
- var ei;
2128
- function ti(e) {
2129
- return e ? (ei ||= ni(), ei(e)) : !1;
2178
+ var ni;
2179
+ function ri(e) {
2180
+ return e ? (ni ||= ii(), ni(e)) : !1;
2130
2181
  }
2131
- function ni() {
2182
+ function ii() {
2132
2183
  try {
2133
2184
  let e = /\p{Mark}/u;
2134
2185
  return (t) => e.test(t);
@@ -2139,19 +2190,19 @@ function ni() {
2139
2190
  };
2140
2191
  }
2141
2192
  }
2142
- var ri;
2143
- function ii(e) {
2144
- return e ? (ri ||= ai(), ri(e)) : !1;
2193
+ var ai;
2194
+ function oi(e) {
2195
+ return e ? (ai ||= si(), ai(e)) : !1;
2145
2196
  }
2146
- function ai() {
2197
+ function si() {
2147
2198
  try {
2148
2199
  let e = /\p{Extended_Pictographic}/u;
2149
2200
  return (t) => e.test(t);
2150
2201
  } catch {
2151
- return oi;
2202
+ return ci;
2152
2203
  }
2153
2204
  }
2154
- function oi(e) {
2205
+ function ci(e) {
2155
2206
  if (!e) return !1;
2156
2207
  for (let t of Array.from(e)) {
2157
2208
  let e = t.codePointAt(0);
@@ -2159,7 +2210,7 @@ function oi(e) {
2159
2210
  }
2160
2211
  return !1;
2161
2212
  }
2162
- function si(e) {
2213
+ function li(e) {
2163
2214
  let t = [], n = "", r = 0;
2164
2215
  for (let i = 0; i < e.length; i++) {
2165
2216
  let a = e[i];
@@ -2177,7 +2228,7 @@ function si(e) {
2177
2228
  breaks: r
2178
2229
  }), t;
2179
2230
  }
2180
- function ci(e) {
2231
+ function ui(e) {
2181
2232
  if (e.length === 0) return [];
2182
2233
  let t = [], n = [];
2183
2234
  for (let r of e) n.push(r), r.breaks >= 2 && (t.push(n), n = []);
@@ -2186,7 +2237,7 @@ function ci(e) {
2186
2237
  function q(e, t) {
2187
2238
  return (e & t) === t;
2188
2239
  }
2189
- function li(e) {
2240
+ function di(e) {
2190
2241
  return {
2191
2242
  "--tw-motion-seq-index": e.toString(),
2192
2243
  backgroundColor: "inherit",
@@ -2203,19 +2254,19 @@ function li(e) {
2203
2254
  WebkitTextFillColor: "inherit"
2204
2255
  };
2205
2256
  }
2206
- function ui(e) {
2257
+ function fi(e) {
2207
2258
  if (!e) return e;
2208
- let t = Gr(e);
2259
+ let t = qr(e);
2209
2260
  if (t.length === 0) return e;
2210
- let { nodes: n, sawEmoji: r } = di(t);
2261
+ let { nodes: n, sawEmoji: r } = pi(t);
2211
2262
  return r ? n.length === 1 ? n[0] ?? e : n : e;
2212
2263
  }
2213
- function di(e, t) {
2264
+ function pi(e, t) {
2214
2265
  let n = [], r = "", i = !1, a = t?.emoji ?? 0, o = () => {
2215
2266
  r &&= (n.push(r), "");
2216
2267
  };
2217
2268
  for (let s of e) {
2218
- if (ii(s)) {
2269
+ if (oi(s)) {
2219
2270
  i = !0, o();
2220
2271
  let e = `motion-emoji-${t ? t.emoji++ : a++}`;
2221
2272
  n.push(/* @__PURE__ */ R("span", {
@@ -2234,16 +2285,16 @@ function di(e, t) {
2234
2285
  sawEmoji: !1
2235
2286
  };
2236
2287
  }
2237
- function fi(e) {
2288
+ function mi(e) {
2238
2289
  if (!e) return K.None;
2239
2290
  let t = e.trim();
2240
2291
  if (!t) return K.None;
2241
- let n = Mr.get(t);
2292
+ let n = Pr.get(t);
2242
2293
  if (typeof n == "number") return n;
2243
2294
  if (typeof document > "u") return K.None;
2244
2295
  let r = t.split(/\s+/).filter(Boolean);
2245
2296
  if (r.length === 0) return K.None;
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;
2297
+ let i = r.map((e) => `.${vi(e)}`), a = i.map((e) => RegExp(`(^|[^a-zA-Z0-9_-])${yi(e)}(?![a-zA-Z0-9_-])`)), o = K.None, s = !1;
2247
2298
  for (let e of Array.from(document.styleSheets)) {
2248
2299
  let t;
2249
2300
  try {
@@ -2251,13 +2302,13 @@ function fi(e) {
2251
2302
  } catch {
2252
2303
  continue;
2253
2304
  }
2254
- let n = pi(t, a, i, !1);
2255
- if (n.mask && (o |= n.mask, o === kr)) break;
2305
+ let n = hi(t, a, i, !1);
2306
+ if (n.mask && (o |= n.mask, o === jr)) break;
2256
2307
  s ||= n.sawStyleRule;
2257
2308
  }
2258
- return (o !== K.None || s) && Mr.set(t, o), o;
2309
+ return (o !== K.None || s) && Pr.set(t, o), o;
2259
2310
  }
2260
- function pi(e, t, n, r) {
2311
+ function hi(e, t, n, r) {
2261
2312
  if (!e) return {
2262
2313
  mask: K.None,
2263
2314
  sawStyleRule: !1
@@ -2270,15 +2321,15 @@ function pi(e, t, n, r) {
2270
2321
  let e = s.selectorText ?? "";
2271
2322
  if (!e || !t.some((t) => t.test(e))) continue;
2272
2323
  a = !0;
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 {
2324
+ for (let t of Or) t.hints.some((t) => e.includes(t)) && (i |= t.flag);
2325
+ if (!r && e.includes(Ar) && gi(e, n)) for (let t of kr) e.includes(t.hint) && (i |= t.flag);
2326
+ if (i === jr) return {
2276
2327
  mask: i,
2277
2328
  sawStyleRule: !0
2278
2329
  };
2279
2330
  } else if ("cssRules" in s) {
2280
- let e = pi(s.cssRules, t, n, r || !hi(s));
2281
- if (e.mask && (i |= e.mask, i === kr)) return {
2331
+ let e = hi(s.cssRules, t, n, r || !_i(s));
2332
+ if (e.mask && (i |= e.mask, i === jr)) return {
2282
2333
  mask: i,
2283
2334
  sawStyleRule: !0
2284
2335
  };
@@ -2291,23 +2342,23 @@ function pi(e, t, n, r) {
2291
2342
  sawStyleRule: a
2292
2343
  };
2293
2344
  }
2294
- function mi(e, t) {
2345
+ function gi(e, t) {
2295
2346
  let n = e.trimStart().split(/\s/, 1)[0] ?? "";
2296
2347
  return t.includes(n);
2297
2348
  }
2298
- function hi(e) {
2349
+ function _i(e) {
2299
2350
  return typeof CSSLayerBlockRule < "u" && e instanceof CSSLayerBlockRule;
2300
2351
  }
2301
- function gi(e) {
2352
+ function vi(e) {
2302
2353
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
2303
2354
  }
2304
- function _i(e) {
2355
+ function yi(e) {
2305
2356
  return e.replace(/[.*+?^${}()|[\]\\]/g, (e) => `\\${e}`);
2306
2357
  }
2307
2358
  //#endregion
2308
2359
  //#region src/auth/storage.ts
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) {
2360
+ var bi = "ikon-auth-session", xi = "ikon-auth-refreshable", Si = "ikon-auth-auto-login-attempted-run", Ci = 6048e5, wi = 6e4;
2361
+ function Ti(e) {
2311
2362
  try {
2312
2363
  let t = e.split(".");
2313
2364
  if (t.length !== 3) return;
@@ -2317,100 +2368,100 @@ function Ci(e) {
2317
2368
  return;
2318
2369
  }
2319
2370
  }
2320
- function wi(e) {
2321
- let t = Ci(e);
2322
- return !t || typeof t.exp == "number" && Date.now() >= t.exp * 1e3 - Si;
2371
+ function Ei(e) {
2372
+ let t = Ti(e);
2373
+ return !t || typeof t.exp == "number" && Date.now() >= t.exp * 1e3 - wi;
2323
2374
  }
2324
- function Ti(e) {
2325
- let t = Ci(e)?.exp;
2375
+ function Di(e) {
2376
+ let t = Ti(e)?.exp;
2326
2377
  return typeof t == "number" ? (/* @__PURE__ */ new Date(t * 1e3)).toISOString() : void 0;
2327
2378
  }
2328
2379
  function J(e) {
2329
2380
  try {
2330
- localStorage.setItem(vi, JSON.stringify(e));
2381
+ localStorage.setItem(bi, JSON.stringify(e));
2331
2382
  } catch {
2332
2383
  console.warn("Failed to save auth session to localStorage");
2333
2384
  }
2334
2385
  }
2335
- function Ei() {
2386
+ function Oi() {
2336
2387
  try {
2337
- let e = localStorage.getItem(vi);
2388
+ let e = localStorage.getItem(bi);
2338
2389
  if (!e) return null;
2339
2390
  let t = JSON.parse(e);
2340
- return Date.now() - t.authenticatedAt > xi || wi(t.token) ? (Pi(), null) : t;
2391
+ return Date.now() - t.authenticatedAt > Ci || Ei(t.token) ? (Ii(), null) : t;
2341
2392
  } catch {
2342
2393
  return console.warn("Failed to load auth session from localStorage"), null;
2343
2394
  }
2344
2395
  }
2345
- function Di() {
2396
+ function ki() {
2346
2397
  try {
2347
- let e = localStorage.getItem(vi);
2398
+ let e = localStorage.getItem(bi);
2348
2399
  if (!e) return !1;
2349
2400
  let t = JSON.parse(e);
2350
- return t.provider === "dev" && wi(t.token);
2401
+ return t.provider === "dev" && Ei(t.token);
2351
2402
  } catch {
2352
2403
  return !1;
2353
2404
  }
2354
2405
  }
2355
- function Oi(e) {
2406
+ function Ai(e) {
2356
2407
  try {
2357
- localStorage.removeItem(vi), localStorage.setItem(yi, JSON.stringify(e));
2408
+ localStorage.removeItem(bi), localStorage.setItem(xi, JSON.stringify(e));
2358
2409
  } catch {
2359
2410
  console.warn("Failed to save the auth session marker to localStorage");
2360
2411
  }
2361
2412
  }
2362
- function ki() {
2413
+ function ji() {
2363
2414
  try {
2364
- let e = localStorage.getItem(yi);
2415
+ let e = localStorage.getItem(xi);
2365
2416
  if (!e) return null;
2366
2417
  let t = JSON.parse(e);
2367
- return Date.now() - t.renewedAt > xi ? (ji(), null) : t;
2418
+ return Date.now() - t.renewedAt > Ci ? (Ni(), null) : t;
2368
2419
  } catch {
2369
2420
  return console.warn("Failed to load the auth session marker from localStorage"), null;
2370
2421
  }
2371
2422
  }
2372
- function Ai() {
2373
- let e = ki();
2374
- e && Oi({
2423
+ function Mi() {
2424
+ let e = ji();
2425
+ e && Ai({
2375
2426
  ...e,
2376
2427
  renewedAt: Date.now()
2377
2428
  });
2378
2429
  }
2379
- function ji() {
2430
+ function Ni() {
2380
2431
  try {
2381
- localStorage.removeItem(yi);
2432
+ localStorage.removeItem(xi);
2382
2433
  } catch {
2383
2434
  console.warn("Failed to clear the auth session marker from localStorage");
2384
2435
  }
2385
2436
  }
2386
- function Mi() {
2387
- Ei()?.provider === "anonymous" && Pi(), ki()?.provider === "anonymous" && ji();
2437
+ function Pi() {
2438
+ Oi()?.provider === "anonymous" && Ii(), ji()?.provider === "anonymous" && Ni();
2388
2439
  }
2389
- function Ni() {
2440
+ function Fi() {
2390
2441
  try {
2391
2442
  let e = typeof window < "u" ? new URLSearchParams(window.location.search) : void 0;
2392
2443
  if (e?.get("ikon_token") || e?.get("ikon_code")) return !0;
2393
2444
  } catch {}
2394
- let e = Ei()?.provider ?? ki()?.provider;
2445
+ let e = Oi()?.provider ?? ji()?.provider;
2395
2446
  return e !== void 0 && e !== "anonymous";
2396
2447
  }
2397
- function Pi() {
2448
+ function Ii() {
2398
2449
  try {
2399
- localStorage.removeItem(vi);
2450
+ localStorage.removeItem(bi);
2400
2451
  } catch {
2401
2452
  console.warn("Failed to clear auth session from localStorage");
2402
2453
  }
2403
2454
  }
2404
- function Fi(e) {
2455
+ function Li(e) {
2405
2456
  if (e) try {
2406
- sessionStorage.setItem(bi, e);
2457
+ sessionStorage.setItem(Si, e);
2407
2458
  } catch {
2408
2459
  console.warn("Failed to record auto-login attempt in sessionStorage");
2409
2460
  }
2410
2461
  }
2411
- function Ii() {
2462
+ function Ri() {
2412
2463
  try {
2413
- return sessionStorage.getItem(bi);
2464
+ return sessionStorage.getItem(Si);
2414
2465
  } catch {
2415
2466
  return null;
2416
2467
  }
@@ -2426,8 +2477,8 @@ function Y(e) {
2426
2477
  }
2427
2478
  //#endregion
2428
2479
  //#region src/auth/auth-service.ts
2429
- var Li = 15e3, Ri = 15e3, X = O("AuthService");
2430
- async function zi(e) {
2480
+ var zi = 15e3, Bi = 15e3, X = k("AuthService");
2481
+ async function Vi(e) {
2431
2482
  try {
2432
2483
  return await fetch(e, {
2433
2484
  method: "GET",
@@ -2437,34 +2488,34 @@ async function zi(e) {
2437
2488
  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)`;
2438
2489
  }
2439
2490
  }
2440
- var Bi = "x-ikon-auth-service";
2441
- function Vi(e) {
2442
- if (e.headers.get(Bi) !== null) return !1;
2491
+ var Hi = "x-ikon-auth-service";
2492
+ function Ui(e) {
2493
+ if (e.headers.get(Hi) !== null) return !1;
2443
2494
  if (e.status === 404 || e.status === 405) return !0;
2444
2495
  let t = e.headers.get("content-type") ?? "";
2445
2496
  return e.status === 200 && t.includes("text/html");
2446
2497
  }
2447
2498
  async function Z(e, t, n) {
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;
2499
+ let r = `${e}${t}`, i = Te(), a = i !== null && e === i, o = a ? await _e() : i, s = o !== null && o !== e ? `${o}${t}` : null, c;
2449
2500
  try {
2450
2501
  c = await fetch(r, n);
2451
2502
  } catch (i) {
2452
2503
  let a = i instanceof Error ? `${i.name}: ${i.message}` : String(i);
2453
2504
  if (!s) {
2454
- let n = await zi(e);
2505
+ let n = await Vi(e);
2455
2506
  throw X.error(`Auth request ${t} could not reach ${r} — ${a}. ${n}`), Error(`Auth request could not reach ${r} (${a}). ${n}`, { cause: i });
2456
2507
  }
2457
2508
  X.warn(`Auth request ${t} could not reach ${r} (${a}); falling back to ${s}`);
2458
2509
  try {
2459
2510
  return await fetch(s, n);
2460
2511
  } catch (n) {
2461
- let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await zi(e);
2512
+ let i = n instanceof Error ? `${n.name}: ${n.message}` : String(n), o = await Vi(e);
2462
2513
  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 });
2463
2514
  }
2464
2515
  }
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;
2516
+ return a && s !== null && Ui(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;
2466
2517
  }
2467
- async function Hi(e, t) {
2518
+ async function Wi(e, t) {
2468
2519
  let n;
2469
2520
  try {
2470
2521
  n = await e.json();
@@ -2477,15 +2528,15 @@ async function Hi(e, t) {
2477
2528
  ...typeof n.expiresAt == "string" && n.expiresAt.length > 0 ? { expiresAt: n.expiresAt } : {}
2478
2529
  };
2479
2530
  }
2480
- async function Ui(e, t, n) {
2481
- let r = Te(), i = n === "guest" ? "anonymous" : n, a = {
2531
+ async function Gi(e, t, n) {
2532
+ let r = we(), i = n === "guest" ? "anonymous" : n, a = {
2482
2533
  method: "POST",
2483
2534
  headers: { "Content-Type": "application/json" },
2484
2535
  body: JSON.stringify({
2485
2536
  deviceId: r,
2486
2537
  space: e,
2487
2538
  ...i ? { method: i } : {},
2488
- testLink: Oe() ?? void 0
2539
+ testLink: De() ?? void 0
2489
2540
  })
2490
2541
  }, o = typeof window < "u" ? window.location.origin : "?";
2491
2542
  X.debug(`Anonymous auth: POST ${t}/anonymous (space=${e}, origin=${o})`);
@@ -2494,14 +2545,14 @@ async function Ui(e, t, n) {
2494
2545
  let e = await s.text().catch(() => "Unknown error");
2495
2546
  throw X.error(`Anonymous auth HTTP ${s.status} from ${s.url}: ${e}`), Error(`Anonymous auth failed: ${s.status} ${e}`);
2496
2547
  }
2497
- let { token: c } = await Hi(s, `Anonymous auth for space ${e}`), l = {
2548
+ let { token: c } = await Wi(s, `Anonymous auth for space ${e}`), l = {
2498
2549
  token: c,
2499
2550
  provider: "anonymous",
2500
2551
  authenticatedAt: Date.now()
2501
2552
  };
2502
2553
  return J(l), l;
2503
2554
  }
2504
- async function Wi({ email: e, spaceId: t, authUrl: n }) {
2555
+ async function Ki({ email: e, spaceId: t, authUrl: n }) {
2505
2556
  let r = await Z(n, "/email/send", {
2506
2557
  method: "POST",
2507
2558
  headers: { "Content-Type": "application/json" },
@@ -2509,14 +2560,14 @@ async function Wi({ email: e, spaceId: t, authUrl: n }) {
2509
2560
  email: e.trim(),
2510
2561
  space: t
2511
2562
  }),
2512
- signal: D(Li)
2563
+ signal: O(zi)
2513
2564
  });
2514
2565
  if (!r.ok) {
2515
2566
  let e = await r.text().catch(() => "Failed to send login code");
2516
2567
  throw Error(e);
2517
2568
  }
2518
2569
  }
2519
- async function Gi({ email: e, code: t, authUrl: n }) {
2570
+ async function qi({ email: e, code: t, authUrl: n }) {
2520
2571
  let r = await Z(n, "/email/code", {
2521
2572
  method: "POST",
2522
2573
  headers: { "Content-Type": "application/json" },
@@ -2524,37 +2575,37 @@ async function Gi({ email: e, code: t, authUrl: n }) {
2524
2575
  email: e.trim(),
2525
2576
  code: t.trim()
2526
2577
  }),
2527
- signal: D(Li)
2578
+ signal: O(zi)
2528
2579
  });
2529
2580
  if (!r.ok) {
2530
2581
  let e = await r.text().catch(() => "Invalid code");
2531
2582
  throw Error(e);
2532
2583
  }
2533
- let { token: i } = await Hi(r, "Login-code verification"), a = {
2584
+ let { token: i } = await Wi(r, "Login-code verification"), a = {
2534
2585
  token: i,
2535
2586
  provider: "email",
2536
2587
  authenticatedAt: Date.now()
2537
2588
  };
2538
2589
  return J(a), a;
2539
2590
  }
2540
- function Ki() {
2541
- let e = new URLSearchParams(window.location.search), t = e.get(T), n = e.get(w);
2591
+ function Ji() {
2592
+ let e = new URLSearchParams(window.location.search), t = e.get(E), n = e.get(T);
2542
2593
  return t && n ? {
2543
2594
  token: t,
2544
2595
  provider: n
2545
2596
  } : null;
2546
2597
  }
2547
- function qi() {
2548
- let e = new URLSearchParams(window.location.search), t = e.get(S), n = e.get(w);
2598
+ function Yi() {
2599
+ let e = new URLSearchParams(window.location.search), t = e.get(C), n = e.get(T);
2549
2600
  return t && n ? {
2550
2601
  code: t,
2551
2602
  provider: n
2552
2603
  } : null;
2553
2604
  }
2554
- async function Ji(e, t, n) {
2555
- let r = qe();
2605
+ async function Xi(e, t, n) {
2606
+ let r = Ke();
2556
2607
  if (!r) throw Error("This sign-in was started in a different browser or tab");
2557
- let i = await Z(await k(n), "/oauth/exchange", {
2608
+ let i = await Z(await A(n), "/oauth/exchange", {
2558
2609
  method: "POST",
2559
2610
  headers: { "Content-Type": "application/json" },
2560
2611
  body: JSON.stringify({
@@ -2562,29 +2613,29 @@ async function Ji(e, t, n) {
2562
2613
  codeVerifier: r,
2563
2614
  supportsRefresh: !0
2564
2615
  }),
2565
- signal: D(Li)
2616
+ signal: O(zi)
2566
2617
  });
2567
2618
  if (!i.ok) throw Error("Could not complete the sign-in");
2568
- let { token: a, expiresAt: o } = await Hi(i, `OAuth code exchange for ${t}`), s = {
2619
+ let { token: a, expiresAt: o } = await Wi(i, `OAuth code exchange for ${t}`), s = {
2569
2620
  token: a,
2570
2621
  provider: t,
2571
2622
  authenticatedAt: Date.now(),
2572
2623
  expiresAt: o
2573
2624
  };
2574
- return o ? Oi({
2625
+ return o ? Ai({
2575
2626
  provider: t,
2576
2627
  authenticatedAt: s.authenticatedAt,
2577
2628
  renewedAt: s.authenticatedAt
2578
2629
  }) : J(s), s;
2579
2630
  }
2580
- async function Yi(e) {
2581
- let t = Ee();
2631
+ async function Zi(e) {
2632
+ let t = Te();
2582
2633
  if (t === null) return null;
2583
2634
  let n;
2584
2635
  try {
2585
2636
  n = await fetch(`${t}/session/refresh`, {
2586
2637
  method: "POST",
2587
- signal: D(Ri)
2638
+ signal: O(Bi)
2588
2639
  });
2589
2640
  } catch (e) {
2590
2641
  let n = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
@@ -2592,7 +2643,7 @@ async function Yi(e) {
2592
2643
  }
2593
2644
  if (n.status === 401) return null;
2594
2645
  if (!n.ok) throw Error(`Session renewal failed: ${n.status}`);
2595
- let { token: r, expiresAt: i } = await Hi(n, "Session renewal");
2646
+ let { token: r, expiresAt: i } = await Wi(n, "Session renewal");
2596
2647
  if (!i) throw Error("Session renewal returned a token with no expiry");
2597
2648
  return {
2598
2649
  token: r,
@@ -2601,17 +2652,17 @@ async function Yi(e) {
2601
2652
  expiresAt: i
2602
2653
  };
2603
2654
  }
2604
- function Xi() {
2655
+ function Qi() {
2605
2656
  let e = new URLSearchParams(window.location.search), t = e.get("error");
2606
2657
  return t ? {
2607
2658
  code: t,
2608
- provider: e.get(w)
2659
+ provider: e.get(T)
2609
2660
  } : null;
2610
2661
  }
2611
- function Zi() {
2612
- return De();
2662
+ function $i() {
2663
+ return Ee();
2613
2664
  }
2614
- var Qi = {
2665
+ var ea = {
2615
2666
  google: "Google",
2616
2667
  facebook: "Facebook",
2617
2668
  apple: "Apple",
@@ -2619,8 +2670,8 @@ var Qi = {
2619
2670
  signicat: "eID",
2620
2671
  sso: "organisation"
2621
2672
  };
2622
- function $i(e, t, n) {
2623
- let r = t ? Qi[t] ?? t : "this provider";
2673
+ function ta(e, t, n) {
2674
+ let r = t ? ea[t] ?? t : "this provider";
2624
2675
  switch (e) {
2625
2676
  case "account_exists_unverified_email": {
2626
2677
  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.`;
@@ -2641,21 +2692,21 @@ function $i(e, t, n) {
2641
2692
  default: return e;
2642
2693
  }
2643
2694
  }
2644
- function ea() {
2695
+ function na() {
2645
2696
  let e = new URLSearchParams(window.location.search);
2646
2697
  for (let t of [
2698
+ E,
2699
+ C,
2647
2700
  T,
2648
- S,
2649
- w,
2650
2701
  "error",
2651
- C
2702
+ w
2652
2703
  ]) e.delete(t);
2653
2704
  let t = e.toString();
2654
2705
  window.history.replaceState({}, "", t.length > 0 ? `${window.location.pathname}?${t}` : window.location.pathname);
2655
2706
  }
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({
2707
+ async function ra(e, t, n, r) {
2708
+ let i = r ?? window.location.origin + window.location.pathname + window.location.search, a = await he();
2709
+ return le({
2659
2710
  authUrl: n,
2660
2711
  provider: e,
2661
2712
  spaceId: t,
@@ -2663,20 +2714,20 @@ async function ta(e, t, n, r) {
2663
2714
  codeChallenge: a ?? void 0
2664
2715
  });
2665
2716
  }
2666
- async function na(e, t, n, r = {}) {
2667
- let i = await ge();
2717
+ async function ia(e, t, n, r = {}) {
2718
+ let i = await he();
2668
2719
  if (!i) return null;
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({
2720
+ let a = r.returnUrl ?? window.location.origin + window.location.pathname + window.location.search, o = r.linkSessionToken ? await sa(n, r.linkSessionToken, e, i) : void 0;
2721
+ return le({
2671
2722
  authUrl: n,
2672
- provider: `${E}${e}`,
2723
+ provider: `${D}${e}`,
2673
2724
  spaceId: t,
2674
2725
  returnUrl: a,
2675
2726
  codeChallenge: i,
2676
2727
  linkTicket: o
2677
2728
  });
2678
2729
  }
2679
- async function ra(e, t) {
2730
+ async function aa(e, t) {
2680
2731
  try {
2681
2732
  let n = await Z(e, `/sso/connections?host=${encodeURIComponent(t)}`, { method: "GET" });
2682
2733
  return n.ok ? await n.json() : [];
@@ -2684,7 +2735,7 @@ async function ra(e, t) {
2684
2735
  return X.warn(`Could not look up the SSO connections of ${t}: ${e instanceof Error ? e.message : String(e)}`), [];
2685
2736
  }
2686
2737
  }
2687
- async function ia(e, t, n) {
2738
+ async function oa(e, t, n) {
2688
2739
  let r = await Z(e, "/sso/discover", {
2689
2740
  method: "POST",
2690
2741
  headers: { "Content-Type": "application/json" },
@@ -2696,7 +2747,7 @@ async function ia(e, t, n) {
2696
2747
  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.");
2697
2748
  return (await r.json()).connection ?? null;
2698
2749
  }
2699
- async function aa(e, t, n, r) {
2750
+ async function sa(e, t, n, r) {
2700
2751
  try {
2701
2752
  let i = await Z(e, "/oauth/sso/link-intent", {
2702
2753
  method: "POST",
@@ -2715,7 +2766,7 @@ async function aa(e, t, n, r) {
2715
2766
  return;
2716
2767
  }
2717
2768
  }
2718
- async function oa(e) {
2769
+ async function ca(e) {
2719
2770
  let t = await Z(e, "/passkey/registration/options", {
2720
2771
  method: "POST",
2721
2772
  headers: { "Content-Type": "application/json" }
@@ -2726,7 +2777,7 @@ async function oa(e) {
2726
2777
  }
2727
2778
  return t.json();
2728
2779
  }
2729
- async function sa(e, t, n) {
2780
+ async function la(e, t, n) {
2730
2781
  let r = await Z(e, "/passkey/registration/verify", {
2731
2782
  method: "POST",
2732
2783
  headers: { "Content-Type": "application/json" },
@@ -2739,14 +2790,14 @@ async function sa(e, t, n) {
2739
2790
  let e = await r.text().catch(() => "Registration verification failed");
2740
2791
  throw Error(e);
2741
2792
  }
2742
- let { token: i } = await Hi(r, "Passkey registration verification"), a = {
2793
+ let { token: i } = await Wi(r, "Passkey registration verification"), a = {
2743
2794
  token: i,
2744
2795
  provider: "passkey",
2745
2796
  authenticatedAt: Date.now()
2746
2797
  };
2747
2798
  return J(a), a;
2748
2799
  }
2749
- async function ca(e, t) {
2800
+ async function ua(e, t) {
2750
2801
  let n = await Z(e, "/passkey/authentication/options", {
2751
2802
  method: "POST",
2752
2803
  headers: { "Content-Type": "application/json" },
@@ -2758,7 +2809,7 @@ async function ca(e, t) {
2758
2809
  }
2759
2810
  return n.json();
2760
2811
  }
2761
- async function la(e, t) {
2812
+ async function da(e, t) {
2762
2813
  let n = await Z(e, "/passkey/authentication/verify", {
2763
2814
  method: "POST",
2764
2815
  headers: { "Content-Type": "application/json" },
@@ -2768,19 +2819,19 @@ async function la(e, t) {
2768
2819
  let e = await n.text().catch(() => "Authentication verification failed");
2769
2820
  throw Error(e);
2770
2821
  }
2771
- let { token: r } = await Hi(n, "Passkey authentication verification"), i = {
2822
+ let { token: r } = await Wi(n, "Passkey authentication verification"), i = {
2772
2823
  token: r,
2773
2824
  provider: "passkey",
2774
2825
  authenticatedAt: Date.now()
2775
2826
  };
2776
2827
  return J(i), i;
2777
2828
  }
2778
- async function ua(e, t) {
2829
+ async function fa(e, t) {
2779
2830
  try {
2780
- await Z(await k(t), "/logout", {
2831
+ await Z(await A(t), "/logout", {
2781
2832
  method: "POST",
2782
2833
  headers: { Authorization: `Bearer ${e}` },
2783
- signal: D(Li)
2834
+ signal: O(zi)
2784
2835
  });
2785
2836
  } catch {}
2786
2837
  }
@@ -2793,31 +2844,31 @@ function Q(e) {
2793
2844
  }
2794
2845
  //#endregion
2795
2846
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/base64URLStringToBuffer.js
2796
- function da(e) {
2847
+ function pa(e) {
2797
2848
  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);
2798
2849
  for (let e = 0; e < i.length; e++) o[e] = i.charCodeAt(e);
2799
2850
  return a;
2800
2851
  }
2801
2852
  //#endregion
2802
2853
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthn.js
2803
- function fa() {
2804
- return pa.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2854
+ function ma() {
2855
+ return ha.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
2805
2856
  }
2806
- var pa = { stubThis: (e) => e };
2857
+ var ha = { stubThis: (e) => e };
2807
2858
  //#endregion
2808
2859
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/toPublicKeyCredentialDescriptor.js
2809
- function ma(e) {
2860
+ function ga(e) {
2810
2861
  let { id: t } = e;
2811
2862
  return {
2812
2863
  ...e,
2813
- id: da(t),
2864
+ id: pa(t),
2814
2865
  transports: e.transports,
2815
2866
  type: e.type
2816
2867
  };
2817
2868
  }
2818
2869
  //#endregion
2819
2870
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/isValidDomain.js
2820
- function ha(e) {
2871
+ function _a(e) {
2821
2872
  return e === "localhost" || /^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e);
2822
2873
  }
2823
2874
  //#endregion
@@ -2834,7 +2885,7 @@ var $ = class extends Error {
2834
2885
  };
2835
2886
  //#endregion
2836
2887
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyRegistrationError.js
2837
- function ga({ error: e, options: t }) {
2888
+ function va({ error: e, options: t }) {
2838
2889
  let { publicKey: n } = t;
2839
2890
  if (!n) throw Error("options was missing required publicKey property");
2840
2891
  if (e.name === "AbortError") {
@@ -2880,7 +2931,7 @@ function ga({ error: e, options: t }) {
2880
2931
  });
2881
2932
  else if (e.name === "SecurityError") {
2882
2933
  let t = globalThis.location.hostname;
2883
- if (!ha(t)) return new $({
2934
+ if (!_a(t)) return new $({
2884
2935
  message: `${globalThis.location.hostname} is an invalid domain`,
2885
2936
  code: "ERROR_INVALID_DOMAIN",
2886
2937
  cause: e
@@ -2903,7 +2954,7 @@ function ga({ error: e, options: t }) {
2903
2954
  });
2904
2955
  return e;
2905
2956
  }
2906
- var _a = new class {
2957
+ var ya = new class {
2907
2958
  constructor() {
2908
2959
  Object.defineProperty(this, "controller", {
2909
2960
  enumerable: !0,
@@ -2926,31 +2977,31 @@ var _a = new class {
2926
2977
  e.name = "AbortError", this.controller.abort(e), this.controller = void 0;
2927
2978
  }
2928
2979
  }
2929
- }(), va = ["cross-platform", "platform"];
2930
- function ya(e) {
2931
- if (e && !(va.indexOf(e) < 0)) return e;
2980
+ }(), ba = ["cross-platform", "platform"];
2981
+ function xa(e) {
2982
+ if (e && !(ba.indexOf(e) < 0)) return e;
2932
2983
  }
2933
2984
  //#endregion
2934
2985
  //#region ../../node_modules/@simplewebauthn/browser/esm/methods/startRegistration.js
2935
- async function ba(e) {
2986
+ async function Sa(e) {
2936
2987
  !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 });
2937
2988
  let { optionsJSON: t, useAutoRegister: n = !1 } = e;
2938
- if (!fa()) throw Error("WebAuthn is not supported in this browser");
2989
+ if (!ma()) throw Error("WebAuthn is not supported in this browser");
2939
2990
  let r = {
2940
2991
  ...t,
2941
- challenge: da(t.challenge),
2992
+ challenge: pa(t.challenge),
2942
2993
  user: {
2943
2994
  ...t.user,
2944
- id: da(t.user.id)
2995
+ id: pa(t.user.id)
2945
2996
  },
2946
- excludeCredentials: t.excludeCredentials?.map(ma)
2997
+ excludeCredentials: t.excludeCredentials?.map(ga)
2947
2998
  }, i = {};
2948
- n && (i.mediation = "conditional"), i.publicKey = r, i.signal = _a.createNewAbortSignal();
2999
+ n && (i.mediation = "conditional"), i.publicKey = r, i.signal = ya.createNewAbortSignal();
2949
3000
  let a;
2950
3001
  try {
2951
3002
  a = await navigator.credentials.create(i);
2952
3003
  } catch (e) {
2953
- throw ga({
3004
+ throw va({
2954
3005
  error: e,
2955
3006
  options: i
2956
3007
  });
@@ -2962,20 +3013,20 @@ async function ba(e) {
2962
3013
  if (typeof c.getPublicKeyAlgorithm == "function") try {
2963
3014
  d = c.getPublicKeyAlgorithm();
2964
3015
  } catch (e) {
2965
- xa("getPublicKeyAlgorithm()", e);
3016
+ Ca("getPublicKeyAlgorithm()", e);
2966
3017
  }
2967
3018
  let f;
2968
3019
  if (typeof c.getPublicKey == "function") try {
2969
3020
  let e = c.getPublicKey();
2970
3021
  e !== null && (f = Q(e));
2971
3022
  } catch (e) {
2972
- xa("getPublicKey()", e);
3023
+ Ca("getPublicKey()", e);
2973
3024
  }
2974
3025
  let p;
2975
3026
  if (typeof c.getAuthenticatorData == "function") try {
2976
3027
  p = Q(c.getAuthenticatorData());
2977
3028
  } catch (e) {
2978
- xa("getAuthenticatorData()", e);
3029
+ Ca("getAuthenticatorData()", e);
2979
3030
  }
2980
3031
  return {
2981
3032
  id: o,
@@ -2990,23 +3041,23 @@ async function ba(e) {
2990
3041
  },
2991
3042
  type: l,
2992
3043
  clientExtensionResults: a.getClientExtensionResults(),
2993
- authenticatorAttachment: ya(a.authenticatorAttachment)
3044
+ authenticatorAttachment: xa(a.authenticatorAttachment)
2994
3045
  };
2995
3046
  }
2996
- function xa(e, t) {
3047
+ function Ca(e, t) {
2997
3048
  console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`, t);
2998
3049
  }
2999
3050
  //#endregion
3000
3051
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/browserSupportsWebAuthnAutofill.js
3001
- function Sa() {
3002
- if (!fa()) return Ca.stubThis(new Promise((e) => e(!1)));
3052
+ function wa() {
3053
+ if (!ma()) return Ta.stubThis(new Promise((e) => e(!1)));
3003
3054
  let e = globalThis.PublicKeyCredential;
3004
- return e?.isConditionalMediationAvailable === void 0 ? Ca.stubThis(new Promise((e) => e(!1))) : Ca.stubThis(e.isConditionalMediationAvailable());
3055
+ return e?.isConditionalMediationAvailable === void 0 ? Ta.stubThis(new Promise((e) => e(!1))) : Ta.stubThis(e.isConditionalMediationAvailable());
3005
3056
  }
3006
- var Ca = { stubThis: (e) => e };
3057
+ var Ta = { stubThis: (e) => e };
3007
3058
  //#endregion
3008
3059
  //#region ../../node_modules/@simplewebauthn/browser/esm/helpers/identifyAuthenticationError.js
3009
- function wa({ error: e, options: t }) {
3060
+ function Ea({ error: e, options: t }) {
3010
3061
  let { publicKey: n } = t;
3011
3062
  if (!n) throw Error("options was missing required publicKey property");
3012
3063
  if (e.name === "AbortError") {
@@ -3022,7 +3073,7 @@ function wa({ error: e, options: t }) {
3022
3073
  });
3023
3074
  else if (e.name === "SecurityError") {
3024
3075
  let t = globalThis.location.hostname;
3025
- if (!ha(t)) return new $({
3076
+ if (!_a(t)) return new $({
3026
3077
  message: `${globalThis.location.hostname} is an invalid domain`,
3027
3078
  code: "ERROR_INVALID_DOMAIN",
3028
3079
  cause: e
@@ -3041,28 +3092,28 @@ function wa({ error: e, options: t }) {
3041
3092
  }
3042
3093
  //#endregion
3043
3094
  //#region ../../node_modules/@simplewebauthn/browser/esm/methods/startAuthentication.js
3044
- async function Ta(e) {
3095
+ async function Da(e) {
3045
3096
  !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 });
3046
3097
  let { optionsJSON: t, useBrowserAutofill: n = !1, verifyBrowserAutofillInput: r = !0 } = e;
3047
- if (!fa()) throw Error("WebAuthn is not supported in this browser");
3098
+ if (!ma()) throw Error("WebAuthn is not supported in this browser");
3048
3099
  let i;
3049
- t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(ma));
3100
+ t.allowCredentials?.length !== 0 && (i = t.allowCredentials?.map(ga));
3050
3101
  let a = {
3051
3102
  ...t,
3052
- challenge: da(t.challenge),
3103
+ challenge: pa(t.challenge),
3053
3104
  allowCredentials: i
3054
3105
  }, o = {};
3055
3106
  if (n) {
3056
- if (!await Sa()) throw Error("Browser does not support WebAuthn autofill");
3107
+ if (!await wa()) throw Error("Browser does not support WebAuthn autofill");
3057
3108
  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");
3058
3109
  o.mediation = "conditional", a.allowCredentials = [];
3059
3110
  }
3060
- o.publicKey = a, o.signal = _a.createNewAbortSignal();
3111
+ o.publicKey = a, o.signal = ya.createNewAbortSignal();
3061
3112
  let s;
3062
3113
  try {
3063
3114
  s = await navigator.credentials.get(o);
3064
3115
  } catch (e) {
3065
- throw wa({
3116
+ throw Ea({
3066
3117
  error: e,
3067
3118
  options: o
3068
3119
  });
@@ -3080,38 +3131,38 @@ async function Ta(e) {
3080
3131
  },
3081
3132
  type: d,
3082
3133
  clientExtensionResults: s.getClientExtensionResults(),
3083
- authenticatorAttachment: ya(s.authenticatorAttachment)
3134
+ authenticatorAttachment: xa(s.authenticatorAttachment)
3084
3135
  };
3085
3136
  }
3086
3137
  //#endregion
3087
3138
  //#region src/auth/auth-context.tsx
3088
- var Ea = "/dev-login-token", Da = "X-Ikon-Dev-Login-Run";
3089
- async function Oa(e) {
3139
+ var Oa = "/dev-login-token", ka = "X-Ikon-Dev-Login-Run";
3140
+ async function Aa(e) {
3090
3141
  let t = typeof window < "u" ? window.__IKON_LOCAL_IKON_SERVER_CONFIG__ : void 0;
3091
- if (!(!t?.enabled || !t.host || !t.port)) try {
3092
- let n = await fetch(`https://${t.host}:${t.port}${Ea}`, {
3142
+ if (t?.enabled && t.host && t.port) try {
3143
+ let n = await fetch(`https://${t.host}:${t.port}${Oa}`, {
3093
3144
  cache: "no-store",
3094
- headers: { [Da]: e }
3145
+ headers: { [ka]: e }
3095
3146
  });
3096
3147
  return n.ok && (await n.json()).token || void 0;
3097
3148
  } catch {
3098
3149
  return;
3099
3150
  }
3100
3151
  }
3101
- var ka = Xe(null), Aa = 12e4, ja = 6e4;
3102
- function Ma({ children: e, config: t }) {
3152
+ var ja = Ye(null), Ma = 12e4, Na = 6e4;
3153
+ function Pa({ children: e, config: t }) {
3103
3154
  let [n, r] = L({
3104
3155
  isAuthenticated: !1,
3105
3156
  isLoading: !0,
3106
3157
  user: null,
3107
3158
  error: null
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) => {
3159
+ }), i = t.methods.includes("email"), a = De() !== null, o = !t.requireSignIn || t.methods.includes("guest") || t.methods.includes("global") || a, c = I(!1), l = I(!1), u = N(async (e) => {
3109
3160
  if (!l.current) {
3110
3161
  l.current = !0;
3111
3162
  try {
3112
- let t = await Yi(e);
3163
+ let t = await Zi(e);
3113
3164
  if (t === null) {
3114
- ji(), r({
3165
+ Ni(), r({
3115
3166
  isAuthenticated: !1,
3116
3167
  isLoading: !1,
3117
3168
  user: null,
@@ -3119,7 +3170,7 @@ function Ma({ children: e, config: t }) {
3119
3170
  });
3120
3171
  return;
3121
3172
  }
3122
- Ai(), r({
3173
+ Mi(), r({
3123
3174
  isAuthenticated: !0,
3124
3175
  isLoading: !1,
3125
3176
  user: Y(t),
@@ -3133,24 +3184,24 @@ function Ma({ children: e, config: t }) {
3133
3184
  P(() => {
3134
3185
  (() => {
3135
3186
  if (c.current) return;
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();
3187
+ let e = t.devLoginRunId, n = !!e && Ri() === e && !ki();
3188
+ e && !$i() && Li(e);
3189
+ let s = !!t.devLoginToken && !!e && !n && !$i();
3190
+ o || Pi();
3191
+ let l = Qi();
3141
3192
  if (l) {
3142
- ea(), r({
3193
+ na(), r({
3143
3194
  isAuthenticated: !1,
3144
3195
  isLoading: !1,
3145
3196
  user: null,
3146
- error: $i(l.code, l.provider, { emailSignInAvailable: i })
3197
+ error: ta(l.code, l.provider, { emailSignInAvailable: i })
3147
3198
  });
3148
3199
  return;
3149
3200
  }
3150
- le();
3151
- let u = qi();
3201
+ ce();
3202
+ let u = Yi();
3152
3203
  if (u) {
3153
- c.current = !0, ea(), Ji(u.code, u.provider, t.authUrl).then((e) => {
3204
+ c.current = !0, na(), Xi(u.code, u.provider, t.authUrl).then((e) => {
3154
3205
  r({
3155
3206
  isAuthenticated: !0,
3156
3207
  isLoading: !1,
@@ -3167,14 +3218,14 @@ function Ma({ children: e, config: t }) {
3167
3218
  });
3168
3219
  return;
3169
3220
  }
3170
- let d = Ki();
3221
+ let d = Ji();
3171
3222
  if (d) {
3172
3223
  let e = {
3173
3224
  token: d.token,
3174
3225
  provider: d.provider,
3175
3226
  authenticatedAt: Date.now()
3176
3227
  };
3177
- J(e), ea(), r({
3228
+ J(e), na(), r({
3178
3229
  isAuthenticated: !0,
3179
3230
  isLoading: !1,
3180
3231
  user: Y(e),
@@ -3182,11 +3233,11 @@ function Ma({ children: e, config: t }) {
3182
3233
  });
3183
3234
  return;
3184
3235
  }
3185
- let f = ki();
3236
+ let f = ji();
3186
3237
  if (f) {
3187
- c.current = !0, Yi(f).then((e) => {
3238
+ c.current = !0, Zi(f).then((e) => {
3188
3239
  if (e === null) {
3189
- ji(), r({
3240
+ Ni(), r({
3190
3241
  isAuthenticated: !1,
3191
3242
  isLoading: !1,
3192
3243
  user: null,
@@ -3194,7 +3245,7 @@ function Ma({ children: e, config: t }) {
3194
3245
  });
3195
3246
  return;
3196
3247
  }
3197
- Ai(), r({
3248
+ Mi(), r({
3198
3249
  isAuthenticated: !0,
3199
3250
  isLoading: !1,
3200
3251
  user: Y(e),
@@ -3210,7 +3261,7 @@ function Ma({ children: e, config: t }) {
3210
3261
  });
3211
3262
  return;
3212
3263
  }
3213
- let p = Ei();
3264
+ let p = Oi();
3214
3265
  if (p && !(s && p.provider === "anonymous")) {
3215
3266
  r({
3216
3267
  isAuthenticated: !0,
@@ -3226,7 +3277,7 @@ function Ma({ children: e, config: t }) {
3226
3277
  token: e,
3227
3278
  provider: "dev",
3228
3279
  authenticatedAt: Date.now(),
3229
- expiresAt: Ti(e)
3280
+ expiresAt: Di(e)
3230
3281
  };
3231
3282
  J(t), r({
3232
3283
  isAuthenticated: !0,
@@ -3235,12 +3286,12 @@ function Ma({ children: e, config: t }) {
3235
3286
  error: null
3236
3287
  });
3237
3288
  };
3238
- if (!wi(t.devLoginToken)) {
3289
+ if (!Ei(t.devLoginToken)) {
3239
3290
  n(t.devLoginToken);
3240
3291
  return;
3241
3292
  }
3242
- Oa(e).then((e) => {
3243
- if (e && !wi(e)) {
3293
+ Aa(e).then((e) => {
3294
+ if (e && !Ei(e)) {
3244
3295
  n(e);
3245
3296
  return;
3246
3297
  }
@@ -3255,7 +3306,7 @@ function Ma({ children: e, config: t }) {
3255
3306
  }
3256
3307
  if (a && t.spaceId) {
3257
3308
  let e = t.spaceId;
3258
- k(t.authUrl).then((t) => Ui(e, t, "guest")).then((e) => r({
3309
+ A(t.authUrl).then((t) => Gi(e, t, "guest")).then((e) => r({
3259
3310
  isAuthenticated: !0,
3260
3311
  isLoading: !1,
3261
3312
  user: Y(e),
@@ -3284,8 +3335,8 @@ function Ma({ children: e, config: t }) {
3284
3335
  o,
3285
3336
  a
3286
3337
  ]), 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) => {
3338
+ if (t.spaceId) return Pe(t.spaceId, (e) => {
3339
+ c.current = !0, e.codeVerifier && Be(e.codeVerifier), Xi(e.code, e.provider, t.authUrl).then((e) => {
3289
3340
  r({
3290
3341
  isAuthenticated: !0,
3291
3342
  isLoading: !1,
@@ -3304,9 +3355,9 @@ function Ma({ children: e, config: t }) {
3304
3355
  }, [t.spaceId, t.authUrl]), P(() => {
3305
3356
  let e = n.user?.expiresAt;
3306
3357
  if (!e || n.user?.provider === "dev") return;
3307
- let t = ki();
3358
+ let t = ji();
3308
3359
  if (!t) return;
3309
- let r = Date.parse(e) - Aa, i = setTimeout(() => void u(t), Math.max(0, r - Date.now())), a = () => {
3360
+ let r = Date.parse(e) - Ma, i = setTimeout(() => void u(t), Math.max(0, r - Date.now())), a = () => {
3310
3361
  document.visibilityState === "visible" && Date.now() >= r && u(t);
3311
3362
  };
3312
3363
  return document.addEventListener("visibilitychange", a), () => {
@@ -3322,20 +3373,20 @@ function Ma({ children: e, config: t }) {
3322
3373
  if (!e) return;
3323
3374
  let i = n.user.expiresAt;
3324
3375
  if (!i) return;
3325
- let a = n.user.token, o = Date.parse(i) - Aa, s, c = !1, l = !1, u = async () => {
3376
+ let a = n.user.token, o = Date.parse(i) - Ma, s, c = !1, l = !1, u = async () => {
3326
3377
  if (c || l) return;
3327
3378
  l = !0;
3328
- let t = await Oa(e);
3379
+ let t = await Aa(e);
3329
3380
  if (l = !1, c) return;
3330
- if (!t || t === a || wi(t)) {
3331
- s = setTimeout(() => void u(), ja);
3381
+ if (!t || t === a || Ei(t)) {
3382
+ s = setTimeout(() => void u(), Na);
3332
3383
  return;
3333
3384
  }
3334
3385
  let n = {
3335
3386
  token: t,
3336
3387
  provider: "dev",
3337
3388
  authenticatedAt: Date.now(),
3338
- expiresAt: Ti(t)
3389
+ expiresAt: Di(t)
3339
3390
  };
3340
3391
  J(n), r({
3341
3392
  isAuthenticated: !0,
@@ -3367,7 +3418,7 @@ function Ma({ children: e, config: t }) {
3367
3418
  }
3368
3419
  let n;
3369
3420
  try {
3370
- n = await k(t.authUrl);
3421
+ n = await A(t.authUrl);
3371
3422
  } catch (e) {
3372
3423
  r((t) => ({
3373
3424
  ...t,
@@ -3382,7 +3433,7 @@ function Ma({ children: e, config: t }) {
3382
3433
  isLoading: !0
3383
3434
  }));
3384
3435
  try {
3385
- let i = await Ui(t.spaceId, n, e);
3436
+ let i = await Gi(t.spaceId, n, e);
3386
3437
  r({
3387
3438
  isAuthenticated: !0,
3388
3439
  isLoading: !1,
@@ -3405,7 +3456,7 @@ function Ma({ children: e, config: t }) {
3405
3456
  error: null
3406
3457
  }));
3407
3458
  try {
3408
- let e = await Ta({ optionsJSON: await ca(n) }), t = await la(n, e);
3459
+ let e = await Da({ optionsJSON: await ua(n) }), t = await da(n, e);
3409
3460
  r({
3410
3461
  isAuthenticated: !0,
3411
3462
  isLoading: !1,
@@ -3422,15 +3473,15 @@ function Ma({ children: e, config: t }) {
3422
3473
  return;
3423
3474
  }
3424
3475
  if (e === "email") throw Error("login('email') is not supported. Use requestEmailCode()/submitEmailCode() from useAuth() instead.");
3425
- if (Ne()) {
3426
- await We(e, t.spaceId) || r((e) => ({
3476
+ if (Me()) {
3477
+ await Ue(e, t.spaceId) || r((e) => ({
3427
3478
  ...e,
3428
3479
  isLoading: !1,
3429
3480
  error: "The sign-in window did not complete. Allow pop-ups for this site and try again."
3430
3481
  }));
3431
3482
  return;
3432
3483
  }
3433
- window.location.href = await ta(e, t.spaceId, n);
3484
+ window.location.href = await ra(e, t.spaceId, n);
3434
3485
  }, [t.authUrl, t.spaceId]), f = N(async (e, n = {}) => {
3435
3486
  if (!t.spaceId) {
3436
3487
  r((e) => ({
@@ -3439,7 +3490,7 @@ function Ma({ children: e, config: t }) {
3439
3490
  }));
3440
3491
  return;
3441
3492
  }
3442
- if (Ne()) {
3493
+ if (Me()) {
3443
3494
  r((e) => ({
3444
3495
  ...e,
3445
3496
  isLoading: !1,
@@ -3448,7 +3499,7 @@ function Ma({ children: e, config: t }) {
3448
3499
  return;
3449
3500
  }
3450
3501
  try {
3451
- let i = await k(t.authUrl), a = await na(e, t.spaceId, i, { linkSessionToken: n.linkSessionToken });
3502
+ let i = await A(t.authUrl), a = await ia(e, t.spaceId, i, { linkSessionToken: n.linkSessionToken });
3452
3503
  if (!a) {
3453
3504
  r((e) => ({
3454
3505
  ...e,
@@ -3470,8 +3521,8 @@ function Ma({ children: e, config: t }) {
3470
3521
  ...e,
3471
3522
  error: "Space ID is not configured"
3472
3523
  })), Error("Space ID is not configured");
3473
- let n = await k(t.authUrl);
3474
- await Wi({
3524
+ let n = await A(t.authUrl);
3525
+ await Ki({
3475
3526
  email: e,
3476
3527
  spaceId: t.spaceId,
3477
3528
  authUrl: n
@@ -3483,10 +3534,10 @@ function Ma({ children: e, config: t }) {
3483
3534
  error: null
3484
3535
  }));
3485
3536
  try {
3486
- let i = await Gi({
3537
+ let i = await qi({
3487
3538
  email: e,
3488
3539
  code: n,
3489
- authUrl: await k(t.authUrl)
3540
+ authUrl: await A(t.authUrl)
3490
3541
  });
3491
3542
  r({
3492
3543
  isAuthenticated: !0,
@@ -3504,21 +3555,21 @@ function Ma({ children: e, config: t }) {
3504
3555
  }
3505
3556
  }, [t.authUrl]), h = N(() => {
3506
3557
  let e = n.user?.token;
3507
- e && ua(e, t.authUrl), Pi(), ji(), s.clearAll(), r({
3558
+ e && fa(e, t.authUrl), Ii(), Ni(), s.clearAll(), r({
3508
3559
  isAuthenticated: !1,
3509
3560
  isLoading: !1,
3510
3561
  user: null,
3511
3562
  error: null
3512
3563
  });
3513
3564
  }, [n.user?.token, t.authUrl]), g = N(async (e) => {
3514
- let n = await k(t.authUrl);
3565
+ let n = await A(t.authUrl);
3515
3566
  r((e) => ({
3516
3567
  ...e,
3517
3568
  isLoading: !0,
3518
3569
  error: null
3519
3570
  }));
3520
3571
  try {
3521
- let t = await sa(n, await ba({ optionsJSON: await oa(n) }), e);
3572
+ let t = await la(n, await Sa({ optionsJSON: await ca(n) }), e);
3522
3573
  r({
3523
3574
  isAuthenticated: !0,
3524
3575
  isLoading: !1,
@@ -3551,38 +3602,38 @@ function Ma({ children: e, config: t }) {
3551
3602
  p,
3552
3603
  m
3553
3604
  ]);
3554
- return /* @__PURE__ */ R(ka, {
3605
+ return /* @__PURE__ */ R(ja, {
3555
3606
  value: v,
3556
3607
  children: e
3557
3608
  });
3558
3609
  }
3559
- function Na() {
3560
- let e = Qe(ka);
3610
+ function Fa() {
3611
+ let e = Qe(ja);
3561
3612
  if (!e) throw Error("useAuth must be used within an AuthProvider");
3562
3613
  return e;
3563
3614
  }
3564
- function Pa() {
3565
- return Qe(ka);
3615
+ function Ia() {
3616
+ return Qe(ja);
3566
3617
  }
3567
3618
  //#endregion
3568
3619
  //#region src/auth/oauth-continuation.ts
3569
- var Fa = "ikon-oauth", Ia = "ikon-oauth-continue", La = "ikon-oauth-continue-attempts", Ra = 5, za = 6e5;
3570
- function Ba() {
3620
+ var La = "ikon-oauth", Ra = "ikon-oauth-continue", za = "ikon-oauth-continue-attempts", Ba = 5, Va = 6e5;
3621
+ function Ha() {
3571
3622
  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;
3623
+ let e = new URL(window.location.href).searchParams.get(La);
3624
+ return e ? (Xa(e), !0) : Ya() !== null;
3574
3625
  }
3575
- function Va() {
3576
- return Ha() !== null;
3626
+ function Ua() {
3627
+ return Wa() !== null;
3577
3628
  }
3578
- function Ha() {
3579
- return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? qa();
3629
+ function Wa() {
3630
+ return typeof window > "u" ? null : new URL(window.location.href).searchParams.get("ikon-oauth") ?? Ya();
3580
3631
  }
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();
3632
+ var Ga = "You are not allowed to connect an application to this app with this account.";
3633
+ async function Ka(e) {
3634
+ let t = Wa();
3584
3635
  if (!t) return { 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" });
3636
+ if (!e) return Ja() < Ba ? (console.warn("[ikon] Waiting for the signed-in session before continuing the authorization that sent you here."), { status: "pending" }) : (Za(), 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" });
3586
3637
  try {
3587
3638
  let n = await fetch("/ikon/oauth/continue", {
3588
3639
  method: "POST",
@@ -3593,8 +3644,8 @@ async function Wa(e) {
3593
3644
  body: JSON.stringify({ continueId: t })
3594
3645
  });
3595
3646
  if (!n.ok) {
3596
- if (Ya(), n.status === 403) {
3597
- let e = await Ga(n);
3647
+ if (Za(), n.status === 403) {
3648
+ let e = await qa(n);
3598
3649
  return console.warn(`[ikon] The authorization that sent you here was refused: ${e}`), {
3599
3650
  status: "refused",
3600
3651
  message: e
@@ -3603,72 +3654,72 @@ async function Wa(e) {
3603
3654
  return console.warn(`[ikon] Could not continue the authorization that sent you here (${n.status}). Start the connection again from the application.`), { status: "pending" };
3604
3655
  }
3605
3656
  let { consentUrl: r } = await n.json();
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" });
3657
+ return r ? (Za(), window.location.href = r, { status: "handed-off" }) : (Za(), console.warn("[ikon] The authorization that sent you here returned no consent step. Start the connection again from the application."), { status: "pending" });
3607
3658
  } catch {
3608
3659
  return { status: "pending" };
3609
3660
  }
3610
3661
  }
3611
- async function Ga(e) {
3662
+ async function qa(e) {
3612
3663
  try {
3613
3664
  let t = await e.json(), n = Array.isArray(t?.message) ? t.message.join(", ") : t?.message;
3614
- return typeof n == "string" && n.trim().length > 0 ? n : Ua;
3665
+ return typeof n == "string" && n.trim().length > 0 ? n : Ga;
3615
3666
  } catch {
3616
- return Ua;
3667
+ return Ga;
3617
3668
  }
3618
3669
  }
3619
- function Ka() {
3670
+ function Ja() {
3620
3671
  try {
3621
- let e = Number(sessionStorage.getItem(La) ?? "0") + 1;
3622
- return sessionStorage.setItem(La, String(e)), e;
3672
+ let e = Number(sessionStorage.getItem(za) ?? "0") + 1;
3673
+ return sessionStorage.setItem(za, String(e)), e;
3623
3674
  } catch {
3624
- return Ra;
3675
+ return Ba;
3625
3676
  }
3626
3677
  }
3627
- function qa() {
3678
+ function Ya() {
3628
3679
  try {
3629
- let e = sessionStorage.getItem(Ia);
3680
+ let e = sessionStorage.getItem(Ra);
3630
3681
  if (!e) return null;
3631
3682
  let { id: t, at: n } = JSON.parse(e);
3632
- return !t || typeof n != "number" || Date.now() - n > za ? (Ya(), null) : t;
3683
+ return !t || typeof n != "number" || Date.now() - n > Va ? (Za(), null) : t;
3633
3684
  } catch {
3634
- return Ya(), null;
3685
+ return Za(), null;
3635
3686
  }
3636
3687
  }
3637
- function Ja(e) {
3688
+ function Xa(e) {
3638
3689
  try {
3639
- sessionStorage.setItem(Ia, JSON.stringify({
3690
+ sessionStorage.setItem(Ra, JSON.stringify({
3640
3691
  id: e,
3641
3692
  at: Date.now()
3642
3693
  }));
3643
3694
  } catch {}
3644
3695
  }
3645
- function Ya() {
3696
+ function Za() {
3646
3697
  try {
3647
- sessionStorage.removeItem(Ia), sessionStorage.removeItem(La);
3698
+ sessionStorage.removeItem(Ra), sessionStorage.removeItem(za);
3648
3699
  } catch {}
3649
3700
  try {
3650
3701
  let e = new URL(window.location.href);
3651
- e.searchParams.has("ikon-oauth") && (e.searchParams.delete(Fa), window.history.replaceState(null, "", e.toString()));
3702
+ e.searchParams.has("ikon-oauth") && (e.searchParams.delete(La), window.history.replaceState(null, "", e.toString()));
3652
3703
  } catch {}
3653
3704
  }
3654
3705
  //#endregion
3655
3706
  //#region src/auth/use-auth-guard.ts
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;
3707
+ function Qa(e) {
3708
+ let { config: t, guestUrlParam: n } = e, { state: r, login: i, getToken: a } = Fa(), o = I(!1), s = I(!1), c = I(null), l = tt(We, Ce, Ce), u = l.required;
3658
3709
  P(() => {
3659
- Ba() && Ue("An application is asking to act as you. Sign in to review what it wants.");
3710
+ Ha() && He("An application is asking to act as you. Sign in to review what it wants.");
3660
3711
  }, []), P(() => {
3661
- if (!(!u || !r.isAuthenticated || !r.user || r.user.provider === "anonymous")) {
3662
- if (!Va()) {
3663
- c.current || me();
3712
+ if (u && r.isAuthenticated && r.user && r.user.provider !== "anonymous") {
3713
+ if (!Ua()) {
3714
+ c.current || pe();
3664
3715
  return;
3665
3716
  }
3666
- s.current || (s.current = !0, Wa(a()).then((e) => {
3717
+ s.current || (s.current = !0, Ka(a()).then((e) => {
3667
3718
  if (e.status === "refused") {
3668
- c.current = e.message, Ue(e.message);
3719
+ c.current = e.message, He(e.message);
3669
3720
  return;
3670
3721
  }
3671
- (e.status === "handed-off" || !Va()) && me();
3722
+ (e.status === "handed-off" || !Ua()) && pe();
3672
3723
  }).finally(() => {
3673
3724
  s.current = !1;
3674
3725
  }));
@@ -3683,7 +3734,7 @@ function Xa(e) {
3683
3734
  let e = t.methods.includes("global") ? "global" : t.methods.includes("guest") ? "guest" : null;
3684
3735
  if (!e) return;
3685
3736
  let a = new URLSearchParams(window.location.search), s = a.get(n);
3686
- if (s === "true" || s === "1" || s === "" || Zi()) {
3737
+ if (s === "true" || s === "1" || s === "" || $i()) {
3687
3738
  a.delete(n);
3688
3739
  let t = a.toString(), r = window.location.pathname + (t ? `?${t}` : "");
3689
3740
  window.history.replaceState({}, "", r), o.current = !0, i(e);
@@ -3702,18 +3753,18 @@ function Xa(e) {
3702
3753
  isAuthenticated: r.isAuthenticated,
3703
3754
  error: r.error,
3704
3755
  isLoginPrompt: u && !p,
3705
- dismissLoginPrompt: me,
3756
+ dismissLoginPrompt: pe,
3706
3757
  loginPromptReason: u ? l.reason : null
3707
3758
  };
3708
3759
  }
3709
3760
  //#endregion
3710
3761
  //#region src/auth/use-sso-sign-in.ts
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);
3762
+ function $a(e) {
3763
+ let { loginWithSso: t } = Fa(), n = e.methods.includes("sso"), [r, i] = L([]), [a, o] = L(!1), [s, c] = L(null);
3713
3764
  P(() => {
3714
3765
  if (!n || typeof window > "u") return;
3715
3766
  let t = !1;
3716
- return k(e.authUrl).then((e) => ra(e, window.location.host)).then((e) => {
3767
+ return A(e.authUrl).then((e) => aa(e, window.location.host)).then((e) => {
3717
3768
  t || i(e);
3718
3769
  }).catch(() => void 0), () => {
3719
3770
  t = !0;
@@ -3727,7 +3778,7 @@ function Za(e) {
3727
3778
  discover: N(async (n) => {
3728
3779
  c(null), o(!0);
3729
3780
  try {
3730
- let r = await ia(await k(e.authUrl), e.spaceId, n.trim());
3781
+ let r = await oa(await A(e.authUrl), e.spaceId, n.trim());
3731
3782
  if (!r) {
3732
3783
  c("There is no organisation sign-in for this address. Choose another way to sign in.");
3733
3784
  return;
@@ -3748,17 +3799,17 @@ function Za(e) {
3748
3799
  }
3749
3800
  //#endregion
3750
3801
  //#region src/debug/debug-overlay.tsx
3751
- var Qa = (() => {
3802
+ var eo = (() => {
3752
3803
  try {
3753
- return xe();
3804
+ return be();
3754
3805
  } catch {
3755
3806
  return !1;
3756
3807
  }
3757
- })(), $a = Date.now(), eo = [], to = 300;
3758
- function no(e) {
3759
- eo.push(`[+${((Date.now() - $a) / 1e3).toFixed(1)}s] ${e}`), eo.length > to && eo.shift();
3808
+ })(), to = Date.now(), no = [], ro = 300;
3809
+ function io(e) {
3810
+ no.push(`[+${((Date.now() - to) / 1e3).toFixed(1)}s] ${e}`), no.length > ro && no.shift();
3760
3811
  }
3761
- function ro(e) {
3812
+ function ao(e) {
3762
3813
  if (typeof e == "string") return e;
3763
3814
  if (e instanceof Error) return `${e.name}: ${e.message}`;
3764
3815
  try {
@@ -3767,10 +3818,10 @@ function ro(e) {
3767
3818
  return String(e);
3768
3819
  }
3769
3820
  }
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)}`));
3821
+ var oo = !1;
3822
+ function so() {
3823
+ if (oo || typeof window > "u") return;
3824
+ oo = !0, window.addEventListener("error", (e) => io(`window.error: ${e.message} @ ${e.filename ?? "?"}:${e.lineno ?? "?"}:${e.colno ?? "?"}`)), window.addEventListener("unhandledrejection", (e) => io(`unhandledRejection: ${ao(e.reason)}`));
3774
3825
  let e = console;
3775
3826
  for (let t of [
3776
3827
  "error",
@@ -3781,17 +3832,17 @@ function ao() {
3781
3832
  let n = e[t]?.bind(console) ?? (() => void 0);
3782
3833
  e[t] = (...e) => {
3783
3834
  try {
3784
- no(`console.${t}: ${e.map(ro).join(" ")}`);
3835
+ io(`console.${t}: ${e.map(ao).join(" ")}`);
3785
3836
  } catch {}
3786
3837
  n(...e);
3787
3838
  };
3788
3839
  }
3789
3840
  try {
3790
- Ke((e) => no(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: ne.DEBUG });
3841
+ Ge((e) => io(`${e.levelName} [${e.component}] ${e.message}`), { minLevel: te.DEBUG });
3791
3842
  } catch {}
3792
3843
  }
3793
- Qa && ao();
3794
- function oo() {
3844
+ eo && so();
3845
+ function co() {
3795
3846
  let e = !1;
3796
3847
  try {
3797
3848
  let t = URL.createObjectURL(new Blob([""]));
@@ -3801,11 +3852,11 @@ function oo() {
3801
3852
  } catch {}
3802
3853
  return e;
3803
3854
  }
3804
- function so() {
3855
+ function lo() {
3805
3856
  let e = globalThis;
3806
3857
  return [
3807
3858
  `Worker=${typeof Worker < "u"}`,
3808
- `moduleWorker=${oo()}`,
3859
+ `moduleWorker=${co()}`,
3809
3860
  `WebSocket=${typeof WebSocket < "u"}`,
3810
3861
  `WebTransport=${e.WebTransport !== void 0}`,
3811
3862
  `RTCPeerConnection=${typeof RTCPeerConnection < "u"}`,
@@ -3818,14 +3869,14 @@ function so() {
3818
3869
  `online=${typeof navigator < "u" ? navigator.onLine : "?"}`
3819
3870
  ].join(" ");
3820
3871
  }
3821
- function co(e) {
3872
+ function uo(e) {
3822
3873
  return /ERROR|error:|Rejection/.test(e) ? "#f88" : /WARN|warn:/.test(e) ? "#fc6" : "#9d9";
3823
3874
  }
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);
3875
+ function fo({ state: e = "", forceVisible: t = !1 }) {
3876
+ let n = eo || t, r = e === "connected" || e === "reconnecting", [, i] = et((e) => e + 1, 0), [a, o] = L(!0);
3826
3877
  return P(() => {
3827
3878
  if (!n) return;
3828
- ao();
3879
+ so();
3829
3880
  let e = setInterval(i, 1e3);
3830
3881
  return () => clearInterval(e);
3831
3882
  }, [n]), n ? r && a ? /* @__PURE__ */ z("button", {
@@ -3845,7 +3896,7 @@ function lo({ state: e = "", forceVisible: t = !1 }) {
3845
3896
  },
3846
3897
  children: [
3847
3898
  "🐞 debug (",
3848
- eo.length,
3899
+ no.length,
3849
3900
  ")"
3850
3901
  ]
3851
3902
  }) : /* @__PURE__ */ z("div", {
@@ -3879,9 +3930,9 @@ function lo({ state: e = "", forceVisible: t = !1 }) {
3879
3930
  "Ikon debug overlay — state: ",
3880
3931
  e || "?",
3881
3932
  ", +",
3882
- Math.round((Date.now() - $a) / 1e3),
3933
+ Math.round((Date.now() - to) / 1e3),
3883
3934
  "s, ",
3884
- eo.length,
3935
+ no.length,
3885
3936
  " entries",
3886
3937
  r && /* @__PURE__ */ R("button", {
3887
3938
  type: "button",
@@ -3920,7 +3971,7 @@ function lo({ state: e = "", forceVisible: t = !1 }) {
3920
3971
  color: "#8cf",
3921
3972
  marginBottom: "4px"
3922
3973
  },
3923
- children: so()
3974
+ children: lo()
3924
3975
  }),
3925
3976
  /* @__PURE__ */ R("div", {
3926
3977
  style: {
@@ -3929,9 +3980,9 @@ function lo({ state: e = "", forceVisible: t = !1 }) {
3929
3980
  },
3930
3981
  children: typeof window < "u" ? `viewport=${window.innerWidth}x${window.innerHeight} dpr=${window.devicePixelRatio}` : ""
3931
3982
  }),
3932
- /* @__PURE__ */ R("div", { children: eo.length === 0 ? "(nothing captured yet)" : eo.map((e, t) => /* @__PURE__ */ R("div", {
3983
+ /* @__PURE__ */ R("div", { children: no.length === 0 ? "(nothing captured yet)" : no.map((e, t) => /* @__PURE__ */ R("div", {
3933
3984
  style: {
3934
- color: co(e),
3985
+ color: uo(e),
3935
3986
  wordBreak: "break-all"
3936
3987
  },
3937
3988
  children: e
@@ -3941,7 +3992,7 @@ function lo({ state: e = "", forceVisible: t = !1 }) {
3941
3992
  }
3942
3993
  //#endregion
3943
3994
  //#region src/app/connection-state-renderer.tsx
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 }) {
3995
+ function po({ 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
3996
  let m = I(!1), h = (() => {
3946
3997
  switch (e) {
3947
3998
  case "waitingForExternalConnectUrl":
@@ -3967,227 +4018,227 @@ function uo({ connectionState: e, error: t, isReady: n, isConnectingSlow: r, sto
3967
4018
  default: return null;
3968
4019
  }
3969
4020
  })();
3970
- return /* @__PURE__ */ z(nt, { children: [h, /* @__PURE__ */ R(lo, { state: e })] });
4021
+ return /* @__PURE__ */ z(nt, { children: [h, /* @__PURE__ */ R(fo, { state: e })] });
3971
4022
  }
3972
4023
  //#endregion
3973
4024
  //#region src/app/boot-snapshot-variant.ts
3974
- function fo(e, t) {
4025
+ function mo(e, t) {
3975
4026
  return e === !1 ? !1 : t ? "signed-in" : "guest";
3976
4027
  }
3977
4028
  //#endregion
3978
4029
  //#region src/app/use-ikon-app.ts
3979
- var po = O("useIkonApp");
3980
- function mo() {
4030
+ var ho = k("useIkonApp");
4031
+ function go() {
3981
4032
  if (typeof window < "u" && window.__IKON_AUTH_CONFIG__) return window.__IKON_AUTH_CONFIG__;
3982
4033
  }
3983
- function ho() {
4034
+ function _o() {
3984
4035
  if (typeof window < "u" && window.__IKON_LOCAL_IKON_SERVER_CONFIG__) return window.__IKON_LOCAL_IKON_SERVER_CONFIG__;
3985
4036
  }
3986
- function go(e, t) {
4037
+ function vo(e, t) {
3987
4038
  return {
3988
4039
  ...e,
3989
4040
  ...t ?? {}
3990
4041
  };
3991
4042
  }
3992
- var _o = "ikon-sso-required-redirect:", vo = 3e5;
3993
- function yo(e, t = Date.now()) {
4043
+ var yo = "ikon-sso-required-redirect:", bo = 3e5;
4044
+ function xo(e, t = Date.now()) {
3994
4045
  try {
3995
- let n = `${_o}${e}`;
3996
- return t - Number(window.sessionStorage.getItem(n) ?? 0) < vo ? !1 : (window.sessionStorage.setItem(n, String(t)), !0);
4046
+ let n = `${yo}${e}`;
4047
+ return t - Number(window.sessionStorage.getItem(n) ?? 0) < bo ? !1 : (window.sessionStorage.setItem(n, String(t)), !0);
3997
4048
  } catch {
3998
4049
  return !1;
3999
4050
  }
4000
4051
  }
4001
- function bo() {
4052
+ function So() {
4002
4053
  try {
4003
4054
  let e = [];
4004
4055
  for (let t = 0; t < window.sessionStorage.length; t++) {
4005
4056
  let n = window.sessionStorage.key(t);
4006
- n?.startsWith(_o) && e.push(n);
4057
+ n?.startsWith(yo) && e.push(n);
4007
4058
  }
4008
4059
  for (let t of e) window.sessionStorage.removeItem(t);
4009
4060
  } catch {}
4010
4061
  }
4011
- function xo(e) {
4012
- return e?.token ? `${e.provider}:${ye(e.token) ?? e.token}` : null;
4062
+ function Co(e) {
4063
+ return e?.token ? `${e.provider}:${ve(e.token) ?? e.token}` : null;
4013
4064
  }
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(() => {
4065
+ function wo(e) {
4066
+ let { authConfig: t, modules: n, parameters: r, timeouts: i, backgroundAudio: a, disableBrowserFunctions: o, disableSoundFunctions: c, webRtc: l, audio: f, video: y, websocket: b, webtransport: x, httpstream: S, proxy: C, liveSnapshot: w, bootSnapshot: T } = e, E = t === void 0 ? go() ?? null : t, te = _o(), D = Ia(), se = !!D && D.state.isLoading, O = I(null), ce = I(null), le = I(null), ue = I(!1), de = I(!1), fe = I(a), pe = I(o), me = I(c), k = I(i), he = I(l), _e = I(f), ye = I(y), be = I(b), xe = I(x), Se = I(S), Ce = I(C), we = I(w), Te = I(T), Ee = I("local"), De = I(void 0);
4067
+ fe.current = a, pe.current = o, me.current = c, k.current = i, he.current = l, _e.current = f, ye.current = y, be.current = b, xe.current = x, Se.current = S, Ce.current = C, we.current = w, Te.current = T;
4068
+ let [j, Oe] = L("connecting"), [Ae, je] = L(!1), [Ne, Pe] = L(!1), [Ie, Le] = L(null), [ze, Be] = L(null), [Ve, He] = L(null), [Ue, We] = L(!1), [Ge, Ke] = L(!1), [qe, Je] = L(!1), [Ye, Xe] = L(null), [Ze, M] = L(null), [Qe, $e] = L(!1), et = I(!1), [tt, nt] = L(0), [R, z] = L(0), it = F(() => {
4018
4069
  try {
4019
- return Ie();
4070
+ return Fe();
4020
4071
  } catch {
4021
4072
  return { parameters: {} };
4022
4073
  }
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());
4074
+ }, []), at = JSON.stringify(r ?? {}), ot = F(() => vo(it.parameters, r), [it.parameters, at]), st = (E?.methods?.length ?? 0) > 0, ct = mo(T, st && Fi());
4024
4075
  ct !== !1 && !u() && d(ct);
4025
4076
  let B = F(() => {
4026
- if (!T?.spaceId) return null;
4027
- let e = E?.state.user;
4077
+ if (!E?.spaceId) return null;
4078
+ let e = D?.state.user;
4028
4079
  return e ? {
4029
4080
  token: e.token,
4030
4081
  provider: e.provider,
4031
4082
  authenticatedAt: e.authenticatedAt
4032
- } : Ei();
4083
+ } : Oi();
4033
4084
  }, [
4034
- T?.spaceId,
4085
+ E?.spaceId,
4035
4086
  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) => {
4087
+ D?.state.isLoading,
4088
+ D?.state.isAuthenticated,
4089
+ D?.state.user?.token
4090
+ ]), V = te?.enabled ?? !1, H = te?.host ?? g, lt = te?.port ?? _, U = !se && !!E && !B && !E.requireSignIn && !!E.spaceId && (ke() || V);
4091
+ U && !Ze && !Qe && !et.current && (et.current = !0, A(E.authUrl).then((e) => Gi(E.spaceId, e)).then((e) => {
4041
4092
  M(e.token), $e(!0);
4042
4093
  }).catch((e) => {
4043
- po.error("Anonymous auth failed:", e), et.current = !1, V ? $e(!0) : Ve(e instanceof Error ? e.message : "Anonymous auth failed");
4094
+ ho.error("Anonymous auth failed:", e), et.current = !1, V ? $e(!0) : Be(e instanceof Error ? e.message : "Anonymous auth failed");
4044
4095
  }));
4045
- let ut = xo(B), W = I(void 0);
4096
+ let ut = Co(B), W = I(void 0);
4046
4097
  W.current = B?.token ?? void 0;
4047
4098
  let dt = F(() => {
4048
- if (ce) return null;
4099
+ if (se) return null;
4049
4100
  if (V) {
4050
4101
  if (U && !Qe) return null;
4051
- let e = W.current ?? j ?? void 0, t = e ? ye(e) ?? void 0 : void 0;
4102
+ let e = W.current ?? Ze ?? void 0, t = e ? ve(e) ?? void 0 : void 0;
4052
4103
  return { local: {
4053
4104
  host: H,
4054
4105
  httpsPort: lt,
4055
4106
  userId: t,
4056
4107
  token: W.current,
4057
4108
  identityToken: e,
4058
- spaceId: T?.spaceId,
4059
- backendUrl: T?.backendUrl,
4060
- authUrl: T?.authUrl,
4109
+ spaceId: E?.spaceId,
4110
+ backendUrl: E?.backendUrl,
4111
+ authUrl: E?.authUrl,
4061
4112
  parameters: ot
4062
4113
  } };
4063
4114
  }
4064
- return W.current && T?.spaceId ? { sessionToken: {
4115
+ return W.current && E?.spaceId ? { sessionToken: {
4065
4116
  token: W.current,
4066
- spaceId: T.spaceId,
4067
- backendType: _e(),
4117
+ spaceId: E.spaceId,
4118
+ backendType: ge(),
4068
4119
  sessionIdentityHash: it.sessionIdentityHash,
4069
4120
  parameters: ot
4070
- } } : j && T?.spaceId ? { sessionToken: {
4071
- token: j,
4072
- spaceId: T.spaceId,
4073
- backendType: _e(),
4121
+ } } : Ze && E?.spaceId ? { sessionToken: {
4122
+ token: Ze,
4123
+ spaceId: E.spaceId,
4124
+ backendType: ge(),
4074
4125
  sessionIdentityHash: it.sessionIdentityHash,
4075
4126
  parameters: ot
4076
- } } : Ae() ? null : { local: {
4127
+ } } : ke() ? null : { local: {
4077
4128
  host: H,
4078
4129
  httpsPort: lt,
4079
- spaceId: T?.spaceId,
4080
- backendUrl: T?.backendUrl,
4081
- authUrl: T?.authUrl,
4130
+ spaceId: E?.spaceId,
4131
+ backendUrl: E?.backendUrl,
4132
+ authUrl: E?.authUrl,
4082
4133
  parameters: ot
4083
4134
  } };
4084
4135
  }, [
4085
- ce,
4136
+ se,
4086
4137
  V,
4087
4138
  H,
4088
4139
  lt,
4089
4140
  ut,
4090
- T?.spaceId,
4091
- T?.backendUrl,
4092
- T?.authUrl,
4093
- j,
4141
+ E?.spaceId,
4142
+ E?.backendUrl,
4143
+ E?.authUrl,
4144
+ Ze,
4094
4145
  U,
4095
4146
  Qe,
4096
4147
  it.sessionIdentityHash,
4097
4148
  ot
4098
4149
  ]);
4099
- De.current = T?.spaceId ?? "local", Oe.current = B?.token ?? j ?? void 0, gr(Xe);
4100
- let ft = vr(Xe);
4150
+ Ee.current = E?.spaceId ?? "local", De.current = B?.token ?? Ze ?? void 0, vr(Ye);
4151
+ let ft = br(Ye);
4101
4152
  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);
4153
+ if (!ue.current) {
4154
+ if (ue.current = !0, le.current = Pn(), n) for (let e of n) e(le.current);
4155
+ le.current.loadRegisteredModules().catch((e) => {
4156
+ ho.error("Failed to load UI modules", e);
4106
4157
  });
4107
4158
  }
4108
4159
  }, []), P(() => {
4109
4160
  if (!dt) return;
4110
- let e = new te({
4161
+ let e = new ee({
4111
4162
  ...dt,
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: {
4163
+ timeouts: k.current,
4164
+ disableBrowserFunctions: pe.current,
4165
+ disableSoundFunctions: me.current,
4166
+ audio: _e.current !== void 0 || fe.current ? {
4167
+ enabled: _e.current,
4168
+ ...fe.current ? { background: {
4118
4169
  allowOnDesktop: !0,
4119
4170
  allowOnMobile: !0
4120
4171
  } } : {}
4121
4172
  } : void 0,
4122
- video: be.current === void 0 ? void 0 : { enabled: be.current },
4173
+ video: ye.current === void 0 ? void 0 : { enabled: ye.current },
4123
4174
  mediaSession: {
4124
4175
  title: document.title || void 0,
4125
4176
  artist: document.title || void 0
4126
4177
  },
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,
4178
+ webRtc: he.current === !1 ? { enabled: !1 } : void 0,
4179
+ websocket: be.current,
4180
+ webtransport: xe.current,
4181
+ httpstream: Se.current,
4182
+ proxy: Ce.current,
4132
4183
  onConnectionStateChange: (e) => {
4133
- ke(e);
4184
+ Oe(e);
4134
4185
  },
4135
4186
  onError: (e) => {
4136
- Ve(e.message);
4187
+ Be(e.message);
4137
4188
  }
4138
4189
  });
4139
- D.current = e;
4140
- let t = Te.current ?? !0, n = Oe.current, r = n ? ye(n) ?? null : null, i = t && r ? {
4190
+ O.current = e;
4191
+ let t = we.current ?? !0, n = De.current, r = n ? ve(n) ?? null : null, i = t && r ? {
4141
4192
  enabled: !0,
4142
- appId: De.current,
4193
+ appId: Ee.current,
4143
4194
  userId: r
4144
- } : void 0, a = B != null && B.provider !== "anonymous", o = st && (a || Ni()), c = new rt({
4195
+ } : void 0, a = B != null && B.provider !== "anonymous", o = st && (a || Fi()), c = new rt({
4145
4196
  client: e,
4146
4197
  liveSnapshot: i,
4147
- bootSnapshot: fo(Ee.current, o)
4198
+ bootSnapshot: mo(Te.current, o)
4148
4199
  });
4149
- le.current = c, Ze(c), Fe(!1), Re(e.feedback);
4150
- let l = e.subscribeToFeedback(Re), u = c.subscribeToUiUpdates(() => {
4151
- Fe(!0), ze();
4200
+ ce.current = c, Xe(c), Pe(!1), Le(e.feedback);
4201
+ let l = e.subscribeToFeedback(Le), u = c.subscribeToUiUpdates(() => {
4202
+ Pe(!0), Re();
4152
4203
  });
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 });
4204
+ return e.connect().then(So, (e) => {
4205
+ if (ho.error("Connection failed:", e), e instanceof oe && E?.spaceId && !Me() && xo(e.connectionId)) {
4206
+ let t = E.spaceId, n = W.current;
4207
+ A(E.authUrl).then(async (r) => {
4208
+ let i = await ia(e.connectionId, t, r, { linkSessionToken: n ?? void 0 });
4158
4209
  if (!i) {
4159
- Ue(e.reason);
4210
+ He(e.reason);
4160
4211
  return;
4161
4212
  }
4162
4213
  window.location.href = i;
4163
- }).catch(() => Ue(e.reason));
4214
+ }).catch(() => He(e.reason));
4164
4215
  return;
4165
4216
  }
4166
4217
  if (e instanceof p) {
4167
- Ue(e.reason);
4218
+ He(e.reason);
4168
4219
  return;
4169
4220
  }
4170
- if (e instanceof ie) {
4171
- Ge(!0);
4221
+ if (e instanceof re) {
4222
+ We(!0);
4172
4223
  return;
4173
4224
  }
4174
- if (e instanceof oe) {
4175
- qe(!0);
4225
+ if (e instanceof ae) {
4226
+ Ke(!0);
4176
4227
  return;
4177
4228
  }
4178
- if (!(e instanceof ae)) {
4229
+ if (!(e instanceof ie)) {
4179
4230
  if (e instanceof m) {
4180
- Ye(!0);
4231
+ Je(!0);
4181
4232
  return;
4182
4233
  }
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)));
4234
+ e instanceof ne || e instanceof h && !de.current && (de.current = !0, ho.warn("Auth session appears stale, clearing and retrying"), s.clearAll(), D ? D.logout() : (Ii(), nt((e) => e + 1)));
4184
4235
  }
4185
4236
  }), () => {
4186
- u(), l(), e.disconnect(), D.current = null, c.dispose(), le.current = null;
4237
+ u(), l(), e.disconnect(), O.current = null, c.dispose(), ce.current = null;
4187
4238
  };
4188
4239
  }, [dt, R]), P(() => {
4189
- let e = B?.token, t = D.current;
4190
- if (!(!e || !t)) {
4240
+ let e = B?.token, t = O.current;
4241
+ if (e && t) {
4191
4242
  if (t.connectionState === "offline" && !t.serverStopped) {
4192
4243
  z((e) => e + 1);
4193
4244
  return;
@@ -4197,56 +4248,56 @@ function So(e) {
4197
4248
  }, [B?.token]);
4198
4249
  let pt = N((e, t, n) => {
4199
4250
  let r = typeof t == "string" ? t : JSON.stringify(t ?? {});
4200
- D.current?.sendActionCall(e, r, n);
4251
+ O.current?.sendActionCall(e, r, n);
4201
4252
  }, []);
4202
4253
  P(() => {
4203
- if (A !== "connecting" && A !== "waitingForExternalConnectUrl") {
4204
- Me(!1);
4254
+ if (j !== "connecting" && j !== "waitingForExternalConnectUrl") {
4255
+ je(!1);
4205
4256
  return;
4206
4257
  }
4207
- let e = D.current?.slowConnectionThresholdMs ?? v, t = setTimeout(() => Me(!0), e);
4258
+ let e = O.current?.slowConnectionThresholdMs ?? v, t = setTimeout(() => je(!0), e);
4208
4259
  return () => clearTimeout(t);
4209
- }, [A]);
4210
- let mt = A === "connected" || A === "reconnecting", ht = Pe && A !== "offline";
4260
+ }, [j]);
4261
+ let mt = j === "connected" || j === "reconnecting", ht = Ne && j !== "offline";
4211
4262
  return P(() => {
4212
- typeof document > "u" || (document.documentElement.dataset.ikonLive = String(ht));
4263
+ typeof document < "u" && (document.documentElement.dataset.ikonLive = String(ht));
4213
4264
  }, [ht]), {
4214
- connectionState: A,
4215
- error: Be,
4216
- accessDeniedReason: He,
4217
- isServerFull: We,
4218
- isSessionExpired: Ke,
4219
- isStartupFailed: Je,
4265
+ connectionState: j,
4266
+ error: ze,
4267
+ accessDeniedReason: Ve,
4268
+ isServerFull: Ue,
4269
+ isSessionExpired: Ge,
4270
+ isStartupFailed: qe,
4220
4271
  stores: ft,
4221
- client: D.current,
4222
- registry: ue.current,
4223
- clientRef: D,
4224
- uiRef: le,
4225
- registryRef: ue,
4272
+ client: O.current,
4273
+ registry: le.current,
4274
+ clientRef: O,
4275
+ uiRef: ce,
4276
+ registryRef: le,
4226
4277
  onAction: pt,
4227
4278
  isReady: mt,
4228
4279
  isLive: ht,
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()
4280
+ brandingRequired: O.current?.brandingRequired ?? !1,
4281
+ feedback: Ie,
4282
+ isConnectingSlow: Ae,
4283
+ webRtcVideoStreams: O.current?.webRtcVideoStreams ?? /* @__PURE__ */ new Map(),
4284
+ webRtcTrackMap: O.current?.webRtcTrackMap ?? /* @__PURE__ */ new Map()
4234
4285
  };
4235
4286
  }
4236
4287
  //#endregion
4237
4288
  //#region src/hooks/use-toasts.ts
4238
- var Co = 0;
4239
- function wo(e = 5, t = 5e3) {
4289
+ var To = 0;
4290
+ function Eo(e = 5, t = 5e3) {
4240
4291
  let [n, r] = L([]), i = I(/* @__PURE__ */ new Map()), a = N((e) => {
4241
4292
  let t = i.current.get(e);
4242
4293
  t && (clearTimeout(t), i.current.delete(e)), r((t) => t.filter((t) => t.id !== e));
4243
4294
  }, []);
4244
4295
  return P(() => {
4245
- let n = i.current, o = Ke((i) => {
4246
- if (!Me()) return;
4247
- let o = `toast-${++Co}`, s = {
4296
+ let n = i.current, o = Ge((i) => {
4297
+ if (!je()) return;
4298
+ let o = `toast-${++To}`, s = {
4248
4299
  id: o,
4249
- level: i.level === ne.ERROR ? "error" : "warn",
4300
+ level: i.level === te.ERROR ? "error" : "warn",
4250
4301
  message: i.message,
4251
4302
  component: i.component
4252
4303
  };
@@ -4255,7 +4306,7 @@ function wo(e = 5, t = 5e3) {
4255
4306
  a(o);
4256
4307
  }, t);
4257
4308
  n.set(o, c);
4258
- }, { minLevel: ne.WARN });
4309
+ }, { minLevel: te.WARN });
4259
4310
  return () => {
4260
4311
  o();
4261
4312
  for (let e of n.values()) clearTimeout(e);
@@ -4272,7 +4323,7 @@ function wo(e = 5, t = 5e3) {
4272
4323
  }
4273
4324
  //#endregion
4274
4325
  //#region src/hooks/use-ikon-reactive.ts
4275
- function To(e, t, n) {
4326
+ function Do(e, t, n) {
4276
4327
  let [r, i] = L(n);
4277
4328
  return P(() => {
4278
4329
  if (!e) return;
@@ -4290,7 +4341,7 @@ function To(e, t, n) {
4290
4341
  }
4291
4342
  //#endregion
4292
4343
  //#region src/hooks/use-reactive.ts
4293
- function Eo(e, t, n) {
4344
+ function Oo(e, t, n) {
4294
4345
  let [r, i] = L(null);
4295
4346
  return P(() => {
4296
4347
  if (!e) return;
@@ -4302,48 +4353,48 @@ function Eo(e, t, n) {
4302
4353
  }), () => {
4303
4354
  n = !1;
4304
4355
  };
4305
- }, [e, t]), To(r ? e : null, r ?? "", n);
4356
+ }, [e, t]), Do(r ? e : null, r ?? "", n);
4306
4357
  }
4307
4358
  //#endregion
4308
4359
  //#region src/app/use-ikon-debug.ts
4309
- var Do = O("IkonDebug"), Oo = {
4360
+ var ko = k("IkonDebug"), Ao = {
4310
4361
  Digit1: "connecting",
4311
4362
  Digit2: "connected",
4312
4363
  Digit3: "reconnecting",
4313
4364
  Digit4: "offline",
4314
4365
  Digit5: "offline",
4315
4366
  Digit0: "clear"
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);
4367
+ }, jo = "Digit5", Mo = "Digit6", No = "Synthetic debug error (Ctrl+Shift+5)", Po = "Synthetic debug access-denied (Ctrl+Shift+6)", Fo = 5e3;
4368
+ function Io(e) {
4369
+ let t = je(), [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
4370
  return P(() => {
4320
4371
  if (!t) return;
4321
4372
  let e = (e) => {
4322
4373
  if (!e.ctrlKey || !e.shiftKey) return;
4323
4374
  if (e.code === "KeyE") {
4324
- e.preventDefault(), d((e) => (Do.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
4375
+ e.preventDefault(), d((e) => (ko.warn(`Empty-stores override: ${e ? "off" : "on"}`), !e));
4325
4376
  return;
4326
4377
  }
4327
4378
  if (e.code === "Digit7") {
4328
- e.preventDefault(), p((e) => (Do.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
4379
+ e.preventDefault(), p((e) => (ko.warn(`Branding-banner override: ${e ? "off" : "on"}`), !e));
4329
4380
  return;
4330
4381
  }
4331
4382
  if (e.code === "Digit8") {
4332
- e.preventDefault(), h((e) => (Do.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
4383
+ e.preventDefault(), h((e) => (ko.warn(`Debug-overlay override: ${e ? "off" : "on"}`), !e));
4333
4384
  return;
4334
4385
  }
4335
- if (e.code === Ao) {
4336
- e.preventDefault(), l(Mo), r(null), s(null), Do.warn("Forced access denied");
4386
+ if (e.code === Mo) {
4387
+ e.preventDefault(), l(Po), r(null), s(null), ko.warn("Forced access denied");
4337
4388
  return;
4338
4389
  }
4339
- let t = Oo[e.code];
4390
+ let t = Ao[e.code];
4340
4391
  if (t === void 0) return;
4341
4392
  if (e.preventDefault(), t === "clear") {
4342
- r(null), s(null), l(null), Do.warn("Cleared forced state");
4393
+ r(null), s(null), l(null), ko.warn("Cleared forced state");
4343
4394
  return;
4344
4395
  }
4345
- let n = e.code === ko;
4346
- r(t), s(n ? jo : null), l(null), Do.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
4396
+ let n = e.code === jo;
4397
+ r(t), s(n ? No : null), l(null), ko.warn(`Forced state: ${t}${n ? " (with error)" : ""}`);
4347
4398
  };
4348
4399
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
4349
4400
  }, [t]), P(() => {
@@ -4351,7 +4402,7 @@ function Po(e) {
4351
4402
  a(!1);
4352
4403
  return;
4353
4404
  }
4354
- let e = setTimeout(() => a(!0), No);
4405
+ let e = setTimeout(() => a(!0), Fo);
4355
4406
  return () => clearTimeout(e);
4356
4407
  }, [n]), !t || n === null && !u && c === null && !f && !m ? {
4357
4408
  app: e,
@@ -4382,20 +4433,20 @@ function Po(e) {
4382
4433
  }
4383
4434
  //#endregion
4384
4435
  //#region src/app/feedback/feedback-controls.tsx
4385
- var Fo = O("FeedbackControls"), Io = null;
4386
- function Lo() {
4387
- return import("./feedback-form-BSy2olwD.js").then((e) => Io = e);
4436
+ var Lo = k("FeedbackControls"), Ro = null;
4437
+ function zo() {
4438
+ return import("./feedback-form-2zrRPOiE.js").then((e) => Ro = e);
4388
4439
  }
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);
4440
+ var Bo = 4e3, Vo = 1e4, Ho = 16, Uo = 52, Wo = "ikon-feedback-control", Go = `.${Wo}:focus-visible{outline:2px solid var(--ikon-focus-ring,#f5277f);outline-offset:2px}`;
4441
+ function Ko({ client: e, feedback: t, connectionState: n, isLive: r, sheetOpen: i, brandingShown: a }) {
4442
+ let [o, s] = L(null), [c, l] = L(Ro), u = I(null), d = I(i), f = I(!1), p = I(!1), m = I(!1), h = I(null), g = I(!1);
4392
4443
  p.current = o !== null, P(() => {
4393
4444
  if (!o || c) return;
4394
4445
  let e = !1;
4395
- return Lo().then((t) => {
4446
+ return zo().then((t) => {
4396
4447
  e || l(t);
4397
4448
  }).catch((e) => {
4398
- Fo.error("Loading the feedback form failed, feedback cannot be sent from this page:", e);
4449
+ Lo.error("Loading the feedback form failed, feedback cannot be sent from this page:", e);
4399
4450
  }), () => {
4400
4451
  e = !0;
4401
4452
  };
@@ -4408,85 +4459,85 @@ function Wo({ client: e, feedback: t, connectionState: n, isLive: r, sheetOpen:
4408
4459
  P(() => {
4409
4460
  d.current = i, i && (_(), p.current && !f.current && s(null));
4410
4461
  }, [i, _]), P(() => _, [_]);
4411
- let b = N(() => {
4462
+ let x = N(() => {
4412
4463
  if (u.current || p.current || d.current) return;
4413
- Lo().catch((e) => {
4414
- Fo.debug("Preloading the feedback form failed:", e);
4464
+ zo().catch((e) => {
4465
+ Lo.debug("Preloading the feedback form failed:", e);
4415
4466
  });
4416
- let t = fe();
4467
+ let t = de();
4417
4468
  if (t.catch((e) => {
4418
- Fo.warn("Capturing the view for a feedback report failed, the report goes without a screenshot:", e);
4469
+ Lo.warn("Capturing the view for a feedback report failed, the report goes without a screenshot:", e);
4419
4470
  }), !e || e.connectionState !== "connected") {
4420
4471
  v(t);
4421
4472
  return;
4422
4473
  }
4423
4474
  let n = { timer: setTimeout(() => {
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) };
4426
- u.current = n, e.call(ee, [""]).then((e) => {
4427
- e !== !0 && u.current === n && (Fo.warn(`The app declined ${ee}, showing the built-in form`), v(t));
4475
+ u.current === n && !d.current && (Lo.warn(`The feedback sheet did not open within ${Bo} ms, showing the built-in form`), v(t));
4476
+ }, Bo) };
4477
+ u.current = n, e.call(y, [""]).then((e) => {
4478
+ e !== !0 && u.current === n && (Lo.warn(`The app declined ${y}, showing the built-in form`), v(t));
4428
4479
  }, (e) => {
4429
- u.current === n && (Fo.warn(`Calling ${ee} failed, showing the built-in form:`, e), v(t));
4480
+ u.current === n && (Lo.warn(`Calling ${y} failed, showing the built-in form:`, e), v(t));
4430
4481
  });
4431
4482
  }, [e, v]);
4432
4483
  P(() => {
4433
- m.current || !t || !r || n !== "connected" || !Se() || (m.current = !0, pe(), b());
4484
+ !m.current && t && r && n === "connected" && xe() && (m.current = !0, fe(), x());
4434
4485
  }, [
4435
4486
  t,
4436
4487
  r,
4437
4488
  n,
4438
- b
4489
+ x
4439
4490
  ]);
4440
- let x = N(() => {
4491
+ let S = N(() => {
4441
4492
  g.current = !0, s(null);
4442
4493
  }, []);
4443
4494
  P(() => {
4444
- o || !g.current || (g.current = !1, h.current?.focus());
4495
+ !o && g.current && (g.current = !1, h.current?.focus());
4445
4496
  }, [o]);
4446
- let S = N((e) => {
4497
+ let C = N((e) => {
4447
4498
  f.current = e;
4448
4499
  }, []);
4449
4500
  if (P(() => {
4450
- if (!(!e || !t)) return e.setFeedbackRequestHandler(b);
4501
+ if (e && t) return e.setFeedbackRequestHandler(x);
4451
4502
  }, [
4452
4503
  e,
4453
4504
  t,
4454
- b
4505
+ x
4455
4506
  ]), !t) return null;
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,
4507
+ let w = { [b]: "" }, T = `calc(${a ? Uo : Ho}px + env(safe-area-inset-bottom, 0px))`, E = t.showButton && !i && !o;
4508
+ return /* @__PURE__ */ z(nt, { children: [E && /* @__PURE__ */ z("div", {
4509
+ ...w,
4459
4510
  "data-ikon-feedback-controls": "",
4460
4511
  style: {
4461
- ...qo.dock,
4462
- bottom: w
4512
+ ...Yo.dock,
4513
+ bottom: T
4463
4514
  },
4464
- children: [/* @__PURE__ */ R("style", { children: Uo }), /* @__PURE__ */ R(Go, {
4515
+ children: [/* @__PURE__ */ R("style", { children: Go }), /* @__PURE__ */ R(qo, {
4465
4516
  buttonRef: h,
4466
- onPress: b
4517
+ onPress: x
4467
4518
  })]
4468
4519
  }), o && c && /* @__PURE__ */ R(c.FeedbackForm, {
4469
4520
  access: e?.backendAccess ?? null,
4470
4521
  screenshot: o.screenshot,
4471
4522
  appSession: e?.appSessionId,
4472
4523
  clientSession: e?.sessionId === void 0 ? void 0 : String(e.sessionId),
4473
- onClose: x,
4474
- onDirtyChange: S
4524
+ onClose: S,
4525
+ onDirtyChange: C
4475
4526
  })] });
4476
4527
  }
4477
- function Go({ buttonRef: e, onPress: t }) {
4528
+ function qo({ buttonRef: e, onPress: t }) {
4478
4529
  return /* @__PURE__ */ R("button", {
4479
4530
  ref: e,
4480
4531
  type: "button",
4481
- className: Ho,
4532
+ className: Wo,
4482
4533
  "aria-label": "Send feedback",
4483
4534
  title: "Send feedback",
4484
- style: qo.feedbackButton,
4535
+ style: Yo.feedbackButton,
4485
4536
  onClick: t,
4486
- children: /* @__PURE__ */ R(Ko, {})
4537
+ children: /* @__PURE__ */ R(Jo, {})
4487
4538
  });
4488
4539
  }
4489
- function Ko() {
4540
+ function Jo() {
4490
4541
  return /* @__PURE__ */ z("svg", {
4491
4542
  width: "22",
4492
4543
  height: "22",
@@ -4501,11 +4552,11 @@ function Ko() {
4501
4552
  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" })]
4502
4553
  });
4503
4554
  }
4504
- var qo = {
4555
+ var Yo = {
4505
4556
  dock: {
4506
4557
  position: "fixed",
4507
4558
  right: "max(16px, env(safe-area-inset-right, 0px))",
4508
- zIndex: zo,
4559
+ zIndex: Vo,
4509
4560
  display: "flex",
4510
4561
  alignItems: "center",
4511
4562
  font: "14px/1.4 var(--ikon-font-body, system-ui, -apple-system, \"Segoe UI\", sans-serif)"
@@ -4527,31 +4578,31 @@ var qo = {
4527
4578
  WebkitTouchCallout: "none",
4528
4579
  userSelect: "none"
4529
4580
  }
4530
- }, Jo = 9990, Yo = "ikon-platform-layer", Xo = `.${Yo}>*{pointer-events:auto}`;
4531
- function Zo(e) {
4581
+ }, Xo = 9990, Zo = "ikon-platform-layer", Qo = `.${Zo}>*{pointer-events:auto}`;
4582
+ function $o(e) {
4532
4583
  if (!e) return !1;
4533
- for (let t of e.values()) if (t.category === r && $o(t.store)?.children.some((e) => e.children.length > 0)) return !0;
4584
+ for (let t of e.values()) if (t.category === r && ts(t.store)?.children.some((e) => e.children.length > 0)) return !0;
4534
4585
  return !1;
4535
4586
  }
4536
- function Qo(e) {
4537
- let [t, n] = L(() => Zo(e));
4587
+ function es(e) {
4588
+ let [t, n] = L(() => $o(e));
4538
4589
  return P(() => {
4539
- let t = () => n(Zo(e));
4590
+ let t = () => n($o(e));
4540
4591
  if (t(), !e) return;
4541
4592
  let i = [];
4542
- for (let n of e.values()) n.category === r && i.push(es(n.store, t));
4593
+ for (let n of e.values()) n.category === r && i.push(ns(n.store, t));
4543
4594
  return () => {
4544
4595
  for (let e of i) e();
4545
4596
  };
4546
4597
  }, [e]), t;
4547
4598
  }
4548
- function $o(e) {
4599
+ function ts(e) {
4549
4600
  let t = e.getSnapshot();
4550
4601
  return t.rootViewId ? t.views.get(t.rootViewId) : void 0;
4551
4602
  }
4552
- function es(e, t) {
4603
+ function ns(e, t) {
4553
4604
  let n = /* @__PURE__ */ new Map(), r = () => {
4554
- let t = $o(e), r = new Set(t ? [t.id, ...t.children.map((e) => e.id)] : []);
4605
+ let t = ts(e), r = new Set(t ? [t.id, ...t.children.map((e) => e.id)] : []);
4555
4606
  for (let [e, t] of n) r.has(e) || (t(), n.delete(e));
4556
4607
  for (let t of r) n.has(t) || n.set(t, e.subscribeNode(t, i));
4557
4608
  };
@@ -4565,10 +4616,10 @@ function es(e, t) {
4565
4616
  n.clear(), a();
4566
4617
  };
4567
4618
  }
4568
- function ts({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4619
+ function rs({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4569
4620
  return /* @__PURE__ */ z("div", {
4570
- [y]: "",
4571
- className: Yo,
4621
+ [b]: "",
4622
+ className: Zo,
4572
4623
  "data-ikon-platform-layer": "",
4573
4624
  style: {
4574
4625
  position: "fixed",
@@ -4576,11 +4627,11 @@ function ts({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4576
4627
  right: 0,
4577
4628
  bottom: 0,
4578
4629
  left: 0,
4579
- zIndex: Jo,
4630
+ zIndex: Xo,
4580
4631
  pointerEvents: "none",
4581
4632
  display: a ? "block" : "none"
4582
4633
  },
4583
- children: [/* @__PURE__ */ R("style", { children: Xo }), /* @__PURE__ */ R(ar, {
4634
+ children: [/* @__PURE__ */ R("style", { children: Qo }), /* @__PURE__ */ R(sr, {
4584
4635
  stores: e,
4585
4636
  registry: t,
4586
4637
  client: n,
@@ -4592,89 +4643,89 @@ function ts({ stores: e, registry: t, client: n, onAction: i, open: a }) {
4592
4643
  }
4593
4644
  //#endregion
4594
4645
  //#region src/app/ikon-app.tsx
4595
- var ns = { [y]: "" };
4596
- function rs(e, t) {
4646
+ var is = { [b]: "" };
4647
+ function as(e, t) {
4597
4648
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4598
4649
  }
4599
- function is(e) {
4650
+ function os(e) {
4600
4651
  return e === void 0 ? null : typeof e == "function" ? e() : e;
4601
4652
  }
4602
- function as(e, t) {
4653
+ function ss(e, t) {
4603
4654
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4604
4655
  }
4605
- function os(e, t) {
4656
+ function cs(e, t) {
4606
4657
  return e === void 0 ? null : typeof e == "function" ? e(t) : e;
4607
4658
  }
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);
4610
- u && d && (m || u.size > 0) && (b.current = {
4659
+ function ls(e) {
4660
+ let { connectingOverlay: t, reconnectingOverlay: n, offlineOverlay: r, accessDeniedScreen: i, ...a } = e, o = Io(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: y } = s, b = v || o.forcedBranding, x = I(null);
4661
+ u && d && (m || u.size > 0) && (x.current = {
4611
4662
  stores: u,
4612
4663
  registry: d,
4613
4664
  client: f
4614
4665
  });
4615
- let x = b.current != null || !!_, S = Qo(b.current?.stores) && c === "connected";
4666
+ let S = x.current != null || !!_, C = es(x.current?.stores) && c === "connected";
4616
4667
  if ($e(() => {
4617
- !x || typeof document > "u" || document.querySelectorAll("[data-ikon-prerender]").forEach((e) => e.remove());
4618
- }, [x]), _) return os(i, _);
4619
- let C = b.current, w;
4668
+ S && typeof document < "u" && document.querySelectorAll("[data-ikon-prerender]").forEach((e) => e.remove());
4669
+ }, [S]), _) return cs(i, _);
4670
+ let w = x.current, T;
4620
4671
  switch (c) {
4621
4672
  case "waitingForExternalConnectUrl":
4622
4673
  case "connecting":
4623
- w = rs(t, l);
4674
+ T = as(t, l);
4624
4675
  break;
4625
4676
  case "reconnecting":
4626
- w = is(n);
4677
+ T = os(n);
4627
4678
  break;
4628
4679
  case "offline":
4629
- w = as(r, g);
4680
+ T = ss(r, g);
4630
4681
  break;
4631
- default: w = null;
4682
+ default: T = null;
4632
4683
  }
4633
4684
  return /* @__PURE__ */ z(nt, { children: [
4634
- C && /* @__PURE__ */ R(ar, {
4635
- stores: C.stores,
4636
- registry: C.registry,
4637
- client: C.client,
4685
+ w && /* @__PURE__ */ R(sr, {
4686
+ stores: w.stores,
4687
+ registry: w.registry,
4688
+ client: w.client,
4638
4689
  onAction: p
4639
4690
  }),
4640
- C && /* @__PURE__ */ R(ts, {
4641
- stores: C.stores,
4642
- registry: C.registry,
4643
- client: C.client,
4691
+ w && /* @__PURE__ */ R(rs, {
4692
+ stores: w.stores,
4693
+ registry: w.registry,
4694
+ client: w.client,
4644
4695
  onAction: p,
4645
- open: S
4696
+ open: C
4646
4697
  }),
4647
- w != null && /* @__PURE__ */ R("div", {
4648
- ...ns,
4698
+ T != null && /* @__PURE__ */ R("div", {
4699
+ ...is,
4649
4700
  style: { display: "contents" },
4650
- children: w
4701
+ children: T
4651
4702
  }),
4652
- y && /* @__PURE__ */ R(ls, {}),
4653
- /* @__PURE__ */ R(Wo, {
4703
+ b && /* @__PURE__ */ R(ds, {}),
4704
+ /* @__PURE__ */ R(Ko, {
4654
4705
  client: f,
4655
- feedback: ee,
4706
+ feedback: y,
4656
4707
  connectionState: c,
4657
4708
  isLive: h,
4658
- sheetOpen: S,
4659
- brandingShown: y
4709
+ sheetOpen: C,
4710
+ brandingShown: b
4660
4711
  }),
4661
- /* @__PURE__ */ R(us, {}),
4712
+ /* @__PURE__ */ R(fs, {}),
4662
4713
  /* @__PURE__ */ R("div", {
4663
- ...ns,
4714
+ ...is,
4664
4715
  style: { display: "contents" },
4665
- children: /* @__PURE__ */ R(lo, {
4716
+ children: /* @__PURE__ */ R(fo, {
4666
4717
  state: c,
4667
4718
  forceVisible: o.forcedDebugOverlay
4668
4719
  })
4669
4720
  })
4670
4721
  ] });
4671
4722
  }
4672
- var cs = "https://ikonai.com";
4673
- function ls() {
4723
+ var us = "https://ikonai.com";
4724
+ function ds() {
4674
4725
  return /* @__PURE__ */ z("a", {
4675
- ...ns,
4726
+ ...is,
4676
4727
  className: "ikon-branding-banner",
4677
- href: cs,
4728
+ href: us,
4678
4729
  target: "_blank",
4679
4730
  rel: "noopener noreferrer",
4680
4731
  style: {
@@ -4704,18 +4755,18 @@ function ls() {
4704
4755
  })]
4705
4756
  });
4706
4757
  }
4707
- function us() {
4708
- let { toasts: e, dismissToast: t } = wo();
4758
+ function fs() {
4759
+ let { toasts: e, dismissToast: t } = Eo();
4709
4760
  return e.length === 0 ? null : /* @__PURE__ */ R("div", {
4710
- ...ns,
4761
+ ...is,
4711
4762
  className: "ikon-toast-overlay",
4712
- children: e.map((e) => /* @__PURE__ */ R(ds, {
4763
+ children: e.map((e) => /* @__PURE__ */ R(ps, {
4713
4764
  toast: e,
4714
4765
  onDismiss: t
4715
4766
  }, e.id))
4716
4767
  });
4717
4768
  }
4718
- function ds({ toast: e, onDismiss: t }) {
4769
+ function ps({ toast: e, onDismiss: t }) {
4719
4770
  return /* @__PURE__ */ z("div", {
4720
4771
  className: `ikon-toast-overlay-chip ikon-toast-overlay-chip--${e.level}`,
4721
4772
  onClick: () => t(e.id),
@@ -4741,19 +4792,19 @@ function ds({ toast: e, onDismiss: t }) {
4741
4792
  }
4742
4793
  //#endregion
4743
4794
  //#region src/app/feedback/use-ikon-feedback.ts
4744
- function fs(e) {
4745
- let t = N((t) => e?.subscribeToFeedback(t) ?? ps, [e]);
4795
+ function ms(e) {
4796
+ let t = N((t) => e?.subscribeToFeedback(t) ?? hs, [e]);
4746
4797
  return {
4747
4798
  available: tt(t, () => e?.feedback != null, () => !1),
4748
4799
  open: N(() => e?.requestFeedback() ?? !1, [e])
4749
4800
  };
4750
4801
  }
4751
- function ps() {}
4802
+ function hs() {}
4752
4803
  //#endregion
4753
4804
  //#region src/app/connection-recovery.ts
4754
- function ms({ isSessionExpired: e }) {
4805
+ function gs({ isSessionExpired: e }) {
4755
4806
  if (e) {
4756
- let e = A();
4807
+ let e = j();
4757
4808
  if (e) return {
4758
4809
  kind: "freshSession",
4759
4810
  run: () => {
@@ -4770,11 +4821,11 @@ function ms({ isSessionExpired: e }) {
4770
4821
  }
4771
4822
  //#endregion
4772
4823
  //#region src/account/use-account-removal.ts
4773
- function hs(e) {
4824
+ function _s(e) {
4774
4825
  return e instanceof Error && e.message ? e.message : String(e);
4775
4826
  }
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);
4827
+ function vs(e = {}) {
4828
+ let { backendUrl: t, loadOnMount: n = !0 } = e, { state: r, getToken: i } = Fa(), [a, o] = L(null), [s, c] = L(!1), [l, u] = L(!1), [d, f] = L(null), p = I(!0);
4778
4829
  P(() => (p.current = !0, () => {
4779
4830
  p.current = !1;
4780
4831
  }), []);
@@ -4783,13 +4834,13 @@ function gs(e = {}) {
4783
4834
  if (e) {
4784
4835
  c(!0), f(null);
4785
4836
  try {
4786
- let n = await be({
4837
+ let n = await ye({
4787
4838
  authToken: e,
4788
4839
  backendUrl: t
4789
4840
  });
4790
4841
  p.current && o(n.removal ?? null);
4791
4842
  } catch (e) {
4792
- p.current && f(hs(e));
4843
+ p.current && f(_s(e));
4793
4844
  } finally {
4794
4845
  p.current && c(!1);
4795
4846
  }
@@ -4808,13 +4859,13 @@ function gs(e = {}) {
4808
4859
  });
4809
4860
  p.current && o(r.removal ?? null);
4810
4861
  } catch (e) {
4811
- p.current && f(hs(e));
4862
+ p.current && f(_s(e));
4812
4863
  } finally {
4813
4864
  p.current && u(!1);
4814
4865
  }
4815
- }, [t, i]), _ = N(() => g(Be), [g]), v = N(() => g(de), [g]);
4866
+ }, [t, i]), _ = N(() => g(ze), [g]), v = N(() => g(ue), [g]);
4816
4867
  return P(() => {
4817
- !n || !m || h();
4868
+ n && m && h();
4818
4869
  }, [
4819
4870
  n,
4820
4871
  m,
@@ -4825,7 +4876,7 @@ function gs(e = {}) {
4825
4876
  isSubmittingRemoval: l,
4826
4877
  removalError: d,
4827
4878
  canRequestRemoval: m,
4828
- removalGraceDays: ce,
4879
+ removalGraceDays: se,
4829
4880
  requestAccountRemoval: _,
4830
4881
  cancelAccountRemoval: v,
4831
4882
  reloadAccountRemoval: h
@@ -4833,10 +4884,10 @@ function gs(e = {}) {
4833
4884
  }
4834
4885
  //#endregion
4835
4886
  //#region src/consent/use-consent.ts
4836
- function _s(e) {
4887
+ function ys(e) {
4837
4888
  return e instanceof Error && e.message ? e.message : String(e);
4838
4889
  }
4839
- function vs({ client: e, purposes: t }) {
4890
+ function bs({ client: e, purposes: t }) {
4840
4891
  let [n, r] = L({}), [i, a] = L(!1), [o, s] = L(!1), [c, l] = L(null), u = I(!0);
4841
4892
  P(() => (u.current = !0, () => {
4842
4893
  u.current = !1;
@@ -4845,10 +4896,10 @@ function vs({ client: e, purposes: t }) {
4845
4896
  if (e) {
4846
4897
  a(!0), l(null);
4847
4898
  try {
4848
- let t = await Re(e);
4899
+ let t = await Le(e);
4849
4900
  u.current && r(t);
4850
4901
  } catch (e) {
4851
- u.current && l(_s(e));
4902
+ u.current && l(ys(e));
4852
4903
  } finally {
4853
4904
  u.current && a(!1);
4854
4905
  }
@@ -4866,11 +4917,11 @@ function vs({ client: e, purposes: t }) {
4866
4917
  [i.purpose]: i
4867
4918
  }));
4868
4919
  } catch (e) {
4869
- u.current && l(_s(e));
4920
+ u.current && l(ys(e));
4870
4921
  } finally {
4871
4922
  u.current && s(!1);
4872
4923
  }
4873
- }, [e]), p = N((e) => f(e, ke), [f]), m = N((e) => f(e, He), [f]), h = t.join("\0");
4924
+ }, [e]), p = N((e) => f(e, Oe), [f]), m = N((e) => f(e, Ve), [f]), h = t.join("\0");
4874
4925
  return P(() => {
4875
4926
  d();
4876
4927
  }, [d, h]), {
@@ -4878,8 +4929,8 @@ function vs({ client: e, purposes: t }) {
4878
4929
  isLoading: i,
4879
4930
  isSubmitting: o,
4880
4931
  error: c,
4881
- consentFor: (e) => he(n, e),
4882
- isGranted: (e) => je(n, e),
4932
+ consentFor: (e) => me(n, e),
4933
+ isGranted: (e) => Ae(n, e),
4883
4934
  grant: p,
4884
4935
  revoke: m,
4885
4936
  reload: d
@@ -4887,37 +4938,37 @@ function vs({ client: e, purposes: t }) {
4887
4938
  }
4888
4939
  //#endregion
4889
4940
  //#region src/i18n/i18n.tsx
4890
- var ys = Xe(null);
4891
- function bs(e, t) {
4941
+ var xs = Ye(null);
4942
+ function Ss(e, t) {
4892
4943
  return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] ?? `{${n}}`) : e;
4893
4944
  }
4894
- function xs(e, t) {
4895
- let n = Ce();
4945
+ function Cs(e, t) {
4946
+ let n = Se();
4896
4947
  if (n && e.includes(n)) return n;
4897
4948
  let r = navigator.language.split("-")[0];
4898
4949
  return e.includes(r) ? r : t && e.includes(t) ? t : "en";
4899
4950
  }
4900
- function Ss(e, t, n) {
4901
- return t ? xs(e, n) : n && e.includes(n) ? n : "en";
4951
+ function ws(e, t, n) {
4952
+ return t ? Cs(e, n) : n && e.includes(n) ? n : "en";
4902
4953
  }
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(() => ({
4954
+ function Ts({ children: e, translations: t, defaultLanguage: n, detectLanguage: r = !1 }) {
4955
+ let i = ws(Object.keys(t), r, n), a = t[i] ?? t.en, o = F(() => ({
4905
4956
  t: (e, t) => {
4906
4957
  let n = a[e];
4907
- return bs(n, t);
4958
+ return Ss(n, t);
4908
4959
  },
4909
4960
  locale: i,
4910
4961
  translations: a
4911
4962
  }), [a, i]);
4912
- return /* @__PURE__ */ R(ys, {
4963
+ return /* @__PURE__ */ R(xs, {
4913
4964
  value: o,
4914
4965
  children: e
4915
4966
  });
4916
4967
  }
4917
- function ws() {
4918
- let e = Qe(ys);
4968
+ function Es() {
4969
+ let e = Qe(xs);
4919
4970
  if (!e) throw Error("useI18n must be used within an I18nProvider");
4920
4971
  return e;
4921
4972
  }
4922
4973
  //#endregion
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 };
4974
+ export { Pa as AuthProvider, po as ConnectionStateRenderer, eo as DEBUG_OVERLAY_ENABLED, fo as DebugOverlay, Ts as I18nProvider, n as IKON_PLATFORM_STREAM_CATEGORY, en as IKON_UI_BASE_MODULE, Cn as IKON_UI_MEDIA_MODULE, On as IKON_UI_SHADERTOY_MODULE, t as IKON_UI_SHADERTOY_TYPE, i as IKON_UI_STREAM_CATEGORY, _n as IKON_UI_VIDEO_CANVAS_TYPE, vn as IKON_UI_VIDEO_URL_PLAYER_TYPE, ls as IkonApp, rt as IkonUi, Nn as IkonUiRegistry, sr as IkonUiSurface, ir as InspectOverlay, cr as ParallaxView, $n as UiComponentRegistry, Qn as UiRenderer, c as UiStreamStore, dn as VideoStreamView, Gi as authenticateAnonymous, ra as buildOAuthRedirectUrl, ia as buildSsoRedirectUrl, Ii as clearAuthSession, na as clearOAuthParams, $t as createBaseResolvers, er as createComponentLibrary, Pn as createIkonUiRegistry, Dn as createLazyResolver, bn as createMediaResolvers, kn as createShadertoyRendererResolver, oa as discoverSsoConnection, aa as findSsoConnectionsForHost, gs as getConnectionRecovery, or as isIkonUiCategoryMatch, Oi as loadAuthSession, tn as loadBaseModule, wn as loadMediaModule, An as loadShadertoyModule, Ji as parseOAuthCallback, Qi as parseOAuthError, Ie as randomUuid, nn as registerBaseModule, Tn as registerMediaModule, jn as registerShadertoyModule, Xn as renderChildren, Rr as renderMotionLetters, sa as requestSsoLinkTicket, J as saveAuthSession, Ki as sendLoginCode, Y as sessionToUser, vs as useAccountRemoval, Fa as useAuth, Qa as useAuthGuard, Ia as useAuthOptional, Er as useCameraCapture, bs as useConsent, Es as useI18n, wo as useIkonApp, Io as useIkonDebug, ms as useIkonFeedback, Do as useIkonReactive, vr as useIkonStyles, br as useIkonUiStores, Tr as useMicrophoneCapture, Oo as useReactive, Dr as useScreenCapture, Sr as useSiblingClient, $a as useSsoSignIn, Eo as useToasts, e as useUiNode, tr as useUiStore, qi as verifyLoginCode };