webim-adapter 0.25.0 → 0.27.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.
@@ -2049,7 +2049,7 @@ function ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2049
2049
  display: A === "success" ? "none" : "flex"
2050
2050
  },
2051
2051
  children: f && s ? /* @__PURE__ */ d(l, { children: [
2052
- P && /* @__PURE__ */ u(Rt, {
2052
+ P && /* @__PURE__ */ u(Ht, {
2053
2053
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
2054
2054
  active: F + 1,
2055
2055
  style: { marginBottom: 8 }
@@ -2873,7 +2873,118 @@ function Ft({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2873
2873
  children: Nt(m)
2874
2874
  });
2875
2875
  }
2876
- var It = {
2876
+ function It(e) {
2877
+ let t = e?.parentElement;
2878
+ for (; t && t !== document.body;) {
2879
+ let e = getComputedStyle(t).overflowY;
2880
+ if ((e === "auto" || e === "scroll") && t.scrollHeight > t.clientHeight) return t;
2881
+ t = t.parentElement;
2882
+ }
2883
+ return window;
2884
+ }
2885
+ var Lt = (e) => e === window ? window.scrollY : e.scrollTop, Rt = {
2886
+ "bottom-right": (e) => ({
2887
+ right: e,
2888
+ bottom: e
2889
+ }),
2890
+ "bottom-left": (e) => ({
2891
+ left: e,
2892
+ bottom: e
2893
+ }),
2894
+ "bottom-center": (e) => ({
2895
+ left: "50%",
2896
+ bottom: e,
2897
+ transform: "translateX(-50%)"
2898
+ })
2899
+ };
2900
+ function zt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h }) {
2901
+ let [g, _] = c(!!m), [v, y] = c(null), b = (e) => {
2902
+ y(e), typeof p == "function" && p(e);
2903
+ };
2904
+ i(() => {
2905
+ if (m || !v) return;
2906
+ let e = It(v), t = Number(a) >= 0 ? Number(a) : 300, n = () => _(Lt(e) > t);
2907
+ return n(), e.addEventListener("scroll", n, { passive: !0 }), () => e.removeEventListener("scroll", n);
2908
+ }, [
2909
+ m,
2910
+ v,
2911
+ a
2912
+ ]);
2913
+ let x = () => {
2914
+ if (m) return;
2915
+ let e = It(v), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
2916
+ e === window ? window.scrollTo({
2917
+ top: 0,
2918
+ behavior: n
2919
+ }) : e.scrollTo({
2920
+ top: 0,
2921
+ behavior: n
2922
+ });
2923
+ }, S = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Rt[n] ? n : "bottom-right", D = h ? {
2924
+ position: "fixed",
2925
+ zIndex: 5,
2926
+ bottom: (h.bottom ?? 0) + S,
2927
+ ...E === "bottom-left" ? { left: (h.left ?? 0) + S } : null,
2928
+ ...E === "bottom-right" ? { right: (h.right ?? 0) + S } : null,
2929
+ ...E === "bottom-center" ? {
2930
+ left: (h.left ?? 0) + (h.width ?? 0) / 2,
2931
+ transform: "translateX(-50%)"
2932
+ } : null
2933
+ } : {
2934
+ position: "fixed",
2935
+ zIndex: 2147482e3,
2936
+ ...Rt[E](S)
2937
+ };
2938
+ return /* @__PURE__ */ d("button", {
2939
+ ref: b,
2940
+ type: "button",
2941
+ title: T,
2942
+ "aria-label": T,
2943
+ "aria-hidden": !g,
2944
+ tabIndex: g ? 0 : -1,
2945
+ onClick: x,
2946
+ style: {
2947
+ display: "inline-flex",
2948
+ alignItems: "center",
2949
+ justifyContent: "center",
2950
+ gap: w ? 8 : 0,
2951
+ appearance: "none",
2952
+ font: "inherit",
2953
+ fontSize: 14,
2954
+ fontWeight: 600,
2955
+ width: w ? "auto" : 44,
2956
+ height: 44,
2957
+ padding: w ? "0 18px" : 0,
2958
+ borderRadius: 999,
2959
+ border: "1px solid transparent",
2960
+ background: s || "var(--page-accent, #111827)",
2961
+ color: l || "var(--page-accent-text, #ffffff)",
2962
+ boxShadow: "0 6px 20px rgba(15, 23, 42, 0.25)",
2963
+ cursor: m ? "default" : "pointer",
2964
+ opacity: +!!g,
2965
+ pointerEvents: g ? "auto" : "none",
2966
+ transition: "opacity 160ms ease, transform 160ms ease",
2967
+ ...D,
2968
+ ...C(f),
2969
+ ...D.transform ? { transform: D.transform } : null
2970
+ },
2971
+ children: [/* @__PURE__ */ u("svg", {
2972
+ width: "18",
2973
+ height: "18",
2974
+ viewBox: "0 0 24 24",
2975
+ fill: "none",
2976
+ "aria-hidden": "true",
2977
+ children: /* @__PURE__ */ u("path", {
2978
+ d: "M12 19V5M12 5l-7 7M12 5l7 7",
2979
+ stroke: "currentColor",
2980
+ strokeWidth: "2",
2981
+ strokeLinecap: "round",
2982
+ strokeLinejoin: "round"
2983
+ })
2984
+ }), w ? /* @__PURE__ */ u("span", { children: T }) : null]
2985
+ });
2986
+ }
2987
+ var Bt = {
2877
2988
  facebook: {
2878
2989
  label: "Facebook",
2879
2990
  color: "#1877f2",
@@ -2940,8 +3051,8 @@ var It = {
2940
3051
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
2941
3052
  }
2942
3053
  };
2943
- function Lt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
2944
- let l = Array.isArray(e) ? e.filter((e) => e && It[e.network]) : [];
3054
+ function Vt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3055
+ let l = Array.isArray(e) ? e.filter((e) => e && Bt[e.network]) : [];
2945
3056
  if (!l.length) return null;
2946
3057
  let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
2947
3058
  return /* @__PURE__ */ u("div", {
@@ -2954,7 +3065,7 @@ function Lt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
2954
3065
  ...C(o)
2955
3066
  },
2956
3067
  children: l.map((e, r) => {
2957
- let i = It[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
3068
+ let i = Bt[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
2958
3069
  return /* @__PURE__ */ u("a", {
2959
3070
  href: e.url || "#",
2960
3071
  onClick: h,
@@ -2988,7 +3099,7 @@ function Lt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
2988
3099
  })
2989
3100
  });
2990
3101
  }
2991
- function Rt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3102
+ function Ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2992
3103
  if (!t.length) return null;
2993
3104
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2994
3105
  width: 32,
@@ -3066,7 +3177,7 @@ function Rt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3066
3177
  })
3067
3178
  });
3068
3179
  }
3069
- var zt = {
3180
+ var Ut = {
3070
3181
  small: {
3071
3182
  w: 132,
3072
3183
  h: 46,
@@ -3088,10 +3199,10 @@ var zt = {
3088
3199
  title: 12.5,
3089
3200
  avatar: 46
3090
3201
  }
3091
- }, Bt = (e) => zt[e] ?? zt.medium;
3092
- zt.medium.w, zt.medium.h;
3093
- function Vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3094
- let r = Bt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
3202
+ }, Wt = (e) => Ut[e] ?? Ut.medium;
3203
+ Ut.medium.w, Ut.medium.h;
3204
+ function Gt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3205
+ let r = Wt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
3095
3206
  for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
3096
3207
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
3097
3208
  if (t.has(e.id)) return 0;
@@ -3143,18 +3254,18 @@ function Vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3143
3254
  horizontal: n
3144
3255
  };
3145
3256
  }
3146
- var Ht = (e, t) => {
3257
+ var Kt = (e, t) => {
3147
3258
  let n = String(e ?? "");
3148
3259
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3149
- }, Ut = (e) => {
3260
+ }, qt = (e) => {
3150
3261
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3151
3262
  if (!t) return "#ffffff";
3152
3263
  let n = t[1];
3153
3264
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3154
3265
  let r = parseInt(n, 16);
3155
3266
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3156
- }, Wt = (e) => !!(e?.cv?.trim?.() || e?.photo);
3157
- function Gt(e, t = {}) {
3267
+ }, Jt = (e) => !!(e?.cv?.trim?.() || e?.photo);
3268
+ function Yt(e, t = {}) {
3158
3269
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : q(e);
3159
3270
  return n.map((e) => {
3160
3271
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -3169,11 +3280,11 @@ function Gt(e, t = {}) {
3169
3280
  };
3170
3281
  });
3171
3282
  }
3172
- var Kt = {
3283
+ var Xt = {
3173
3284
  size: 36,
3174
3285
  pad: 10
3175
3286
  };
3176
- function qt({ node: e, onClose: t }) {
3287
+ function Zt({ node: e, onClose: t }) {
3177
3288
  return i(() => {
3178
3289
  let e = (e) => e.key === "Escape" && t();
3179
3290
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -3294,7 +3405,7 @@ function qt({ node: e, onClose: t }) {
3294
3405
  })
3295
3406
  });
3296
3407
  }
3297
- function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
3408
+ function Qt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
3298
3409
  let b = a(), [x, S] = c(null), { tenant: w, apiUrl: T } = r(U), E = r(W)?.[t], [D, O] = c(null);
3299
3410
  i(() => {
3300
3411
  if (!t || E) return;
@@ -3311,14 +3422,14 @@ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3311
3422
  T,
3312
3423
  E
3313
3424
  ]);
3314
- let k = t ? Gt(E ?? D ?? [], {
3425
+ let k = t ? Yt(E ?? D ?? [], {
3315
3426
  nameField: n,
3316
3427
  titleField: o,
3317
3428
  photoField: s,
3318
3429
  parentField: f,
3319
3430
  cvField: p,
3320
3431
  hrefField: m
3321
- }) : e, A = Bt(h), { boxes: j, links: M, width: N, height: P } = Vt(k, {
3432
+ }) : e, A = Wt(h), { boxes: j, links: M, width: N, height: P } = Gt(k, {
3322
3433
  size: h,
3323
3434
  horizontal: g
3324
3435
  });
@@ -3364,7 +3475,7 @@ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3364
3475
  stroke: "rgba(148, 163, 184, 0.7)",
3365
3476
  strokeWidth: "1.5"
3366
3477
  }, t)), j.map(({ node: e, x: t, y: n }) => {
3367
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Ut(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ut(e.color2) : s, f = y && (Wt(e) || e.href), p = () => Wt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Kt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
3478
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? qt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? qt(e.color2) : s, f = y && (Jt(e) || e.href), p = () => Jt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Xt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
3368
3479
  return /* @__PURE__ */ d("g", {
3369
3480
  onClick: f ? p : void 0,
3370
3481
  style: f ? { cursor: "pointer" } : void 0,
@@ -3428,13 +3539,13 @@ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3428
3539
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
3429
3540
  id: `${b}-${e.id}`,
3430
3541
  children: /* @__PURE__ */ u("circle", {
3431
- cx: t + Kt.pad + A.avatar / 2,
3542
+ cx: t + Xt.pad + A.avatar / 2,
3432
3543
  cy: n + A.h / 2,
3433
3544
  r: A.avatar / 2
3434
3545
  })
3435
3546
  }), /* @__PURE__ */ u("image", {
3436
3547
  href: e.photo,
3437
- x: t + Kt.pad,
3548
+ x: t + Xt.pad,
3438
3549
  y: n + (A.h - A.avatar) / 2,
3439
3550
  width: A.avatar,
3440
3551
  height: A.avatar,
@@ -3448,7 +3559,7 @@ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3448
3559
  fontSize: A.title,
3449
3560
  fontWeight: "600",
3450
3561
  fill: s,
3451
- children: Ht(e.title, g + 4)
3562
+ children: Kt(e.title, g + 4)
3452
3563
  }), e.name && /* @__PURE__ */ u("text", {
3453
3564
  x: m,
3454
3565
  y: n + _ + _ / 2 + A.name * .35,
@@ -3456,7 +3567,7 @@ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3456
3567
  fontSize: A.name,
3457
3568
  fontWeight: "600",
3458
3569
  fill: c,
3459
- children: Ht(e.name, g)
3570
+ children: Kt(e.name, g)
3460
3571
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
3461
3572
  x: m,
3462
3573
  y: n + (v[1] ? A.h * .43 : A.h * .57),
@@ -3464,7 +3575,7 @@ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3464
3575
  fontSize: A.name,
3465
3576
  fontWeight: "600",
3466
3577
  fill: s,
3467
- children: Ht(v[0], g)
3578
+ children: Kt(v[0], g)
3468
3579
  }), v[1] && /* @__PURE__ */ u("text", {
3469
3580
  x: m,
3470
3581
  y: n + A.h * .73,
@@ -3472,18 +3583,18 @@ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3472
3583
  fontSize: A.title,
3473
3584
  opacity: "0.7",
3474
3585
  fill: s,
3475
- children: Ht(v[1], g + 4)
3586
+ children: Kt(v[1], g + 4)
3476
3587
  })] })
3477
3588
  ]
3478
3589
  }, e.id);
3479
3590
  })]
3480
- }), x && /* @__PURE__ */ u(qt, {
3591
+ }), x && /* @__PURE__ */ u(Zt, {
3481
3592
  node: x,
3482
3593
  onClose: () => S(null)
3483
3594
  })]
3484
3595
  });
3485
3596
  }
3486
- function Yt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: h }) {
3597
+ function $t({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: h }) {
3487
3598
  let { tenant: g, apiUrl: _ } = r(U), v = r(W), y = v?.[n], b = f ? G(v) : 1, [x, S] = c(null);
3488
3599
  if (i(() => {
3489
3600
  if (!n || y) return;
@@ -3549,7 +3660,7 @@ function Yt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
3549
3660
  })
3550
3661
  });
3551
3662
  }
3552
- var Xt = {
3663
+ var en = {
3553
3664
  PageRoot: Ce,
3554
3665
  Section: we,
3555
3666
  Container: Te,
@@ -3567,11 +3678,12 @@ var Xt = {
3567
3678
  CollectionSearch: Ot,
3568
3679
  BreadcrumbsBlock: kt,
3569
3680
  PaginationBlock: At,
3570
- StepperBlock: Rt,
3571
- SocialLinksBlock: Lt,
3681
+ StepperBlock: Ht,
3682
+ SocialLinksBlock: Vt,
3572
3683
  ThemeModeBlock: Ft,
3573
- OrgChartBlock: Jt,
3574
- TableBlock: Yt,
3684
+ ScrollTopBlock: zt,
3685
+ OrgChartBlock: Qt,
3686
+ TableBlock: $t,
3575
3687
  MasonryBlock: nt,
3576
3688
  AccordionBlock: st,
3577
3689
  NavbarBlock: at,
@@ -3601,26 +3713,26 @@ var Xt = {
3601
3713
  FormFile: wt,
3602
3714
  FormRecaptcha: vt,
3603
3715
  FormSubmit: Tt
3604
- }, Zt = {
3716
+ }, tn = {
3605
3717
  id: "auth",
3606
3718
  label: "Accounts",
3607
3719
  category: "Apps",
3608
3720
  keys: ["SiteLoginForm", "SiteAccountMenu"],
3609
3721
  ssr: "shell",
3610
3722
  settings: ["site.authRedirect"]
3611
- }, Qt = t({
3723
+ }, nn = t({
3612
3724
  user: null,
3613
3725
  status: "idle",
3614
3726
  ensure: () => {},
3615
3727
  refresh: () => {},
3616
3728
  signOut: () => {}
3617
- }), $t = () => {
3618
- let e = r(Qt);
3729
+ }), rn = () => {
3730
+ let e = r(nn);
3619
3731
  return i(() => {
3620
3732
  e.ensure();
3621
3733
  }, [e]), e;
3622
3734
  };
3623
- function en({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
3735
+ function an({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
3624
3736
  let d = r(U), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
3625
3737
  ...t,
3626
3738
  credentials: "include",
@@ -3653,18 +3765,18 @@ function en({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
3653
3765
  b,
3654
3766
  x
3655
3767
  ]);
3656
- return /* @__PURE__ */ u(Qt.Provider, {
3768
+ return /* @__PURE__ */ u(nn.Provider, {
3657
3769
  value: C,
3658
3770
  children: e
3659
3771
  });
3660
3772
  }
3661
- function tn({ when: e, children: t }) {
3662
- let { status: n } = $t();
3773
+ function on({ when: e, children: t }) {
3774
+ let { status: n } = rn();
3663
3775
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
3664
3776
  }
3665
3777
  //#endregion
3666
3778
  //#region ../ui/src/components/builder/apps/auth/views.jsx
3667
- function nn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
3779
+ function sn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
3668
3780
  let { tenant: h, apiUrl: g, settings: _ } = r(U), [v, y] = c("form"), [b, x] = c(""), [S, w] = c(!1), T = e === "register", E = f ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3669
3781
  if (e.preventDefault(), f) return;
3670
3782
  let n = new FormData(e.currentTarget);
@@ -3788,8 +3900,8 @@ function nn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3788
3900
  ]
3789
3901
  });
3790
3902
  }
3791
- function rn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3792
- let { user: c, status: l, signOut: f } = $t(), p = a ? s || "user" : l, m = a ? {
3903
+ function cn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3904
+ let { user: c, status: l, signOut: f } = rn(), p = a ? s || "user" : l, m = a ? {
3793
3905
  name: "Ada Lovelace",
3794
3906
  email: "ada@example.com"
3795
3907
  } : c;
@@ -3853,43 +3965,310 @@ function rn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3853
3965
  });
3854
3966
  }
3855
3967
  //#endregion
3968
+ //#region ../ui/src/components/builder/apps/consent/manifest.js
3969
+ var ln = {
3970
+ id: "consent",
3971
+ label: "Cookie consent",
3972
+ category: "Apps",
3973
+ keys: ["CookieConsent"],
3974
+ ssr: "shell",
3975
+ settings: []
3976
+ }, un = "webim.cookie_consent";
3977
+ function dn() {
3978
+ try {
3979
+ let e = window.localStorage.getItem(un), t = e ? JSON.parse(e) : null;
3980
+ return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
3981
+ } catch {
3982
+ return "";
3983
+ }
3984
+ }
3985
+ function fn(e) {
3986
+ try {
3987
+ document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
3988
+ } catch {}
3989
+ }
3990
+ function pn(e) {
3991
+ try {
3992
+ window.localStorage.setItem(un, JSON.stringify({
3993
+ choice: e,
3994
+ at: (/* @__PURE__ */ new Date()).toISOString()
3995
+ }));
3996
+ } catch {}
3997
+ fn(e);
3998
+ try {
3999
+ window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
4000
+ } catch {}
4001
+ }
4002
+ var mn = {
4003
+ bottom: {
4004
+ left: 0,
4005
+ right: 0,
4006
+ bottom: 0
4007
+ },
4008
+ top: {
4009
+ left: 0,
4010
+ right: 0,
4011
+ top: 0
4012
+ },
4013
+ "bottom-left": {
4014
+ left: 16,
4015
+ bottom: 16,
4016
+ maxWidth: 400
4017
+ },
4018
+ "bottom-right": {
4019
+ right: 16,
4020
+ bottom: 16,
4021
+ maxWidth: 400
4022
+ }
4023
+ };
4024
+ function hn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
4025
+ let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
4026
+ y(e), typeof m == "function" && m(e);
4027
+ };
4028
+ if (i(() => {
4029
+ if (h) return;
4030
+ let e = dn();
4031
+ if (e) {
4032
+ let t = v?.closest?.(".webim-page");
4033
+ t && t.setAttribute("data-webim-consent", e);
4034
+ } else _(!0);
4035
+ }, [h, v]), !g) return null;
4036
+ let x = (e) => () => {
4037
+ h || (pn(e, v), _(!1));
4038
+ }, S = mn[s] ?? mn.bottom, w = {
4039
+ appearance: "none",
4040
+ font: "inherit",
4041
+ fontSize: 14,
4042
+ fontWeight: 600,
4043
+ padding: "8px 16px",
4044
+ borderRadius: 8,
4045
+ cursor: h ? "default" : "pointer",
4046
+ whiteSpace: "nowrap"
4047
+ };
4048
+ return /* @__PURE__ */ d("div", {
4049
+ ref: b,
4050
+ role: "region",
4051
+ "aria-label": "Cookie consent",
4052
+ style: {
4053
+ ...h ? { position: "relative" } : {
4054
+ position: "fixed",
4055
+ zIndex: 2147483e3,
4056
+ ...S
4057
+ },
4058
+ display: "flex",
4059
+ flexWrap: "wrap",
4060
+ alignItems: "center",
4061
+ gap: 12,
4062
+ padding: 16,
4063
+ background: "var(--page-surface, #f2f2f2)",
4064
+ color: "var(--page-text, #111827)",
4065
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.4))",
4066
+ borderRadius: s === "bottom" || s === "top" ? 0 : 12,
4067
+ boxShadow: "0 8px 30px rgba(15, 23, 42, 0.18)",
4068
+ fontSize: 14,
4069
+ lineHeight: 1.5,
4070
+ ...C(p)
4071
+ },
4072
+ children: [/* @__PURE__ */ d("div", {
4073
+ style: {
4074
+ flex: "1 1 260px",
4075
+ minWidth: 0
4076
+ },
4077
+ children: [f?.content ?? (e || "We use cookies to run this site and to understand how it is used."), a && o ? /* @__PURE__ */ d(l, { children: [" ", /* @__PURE__ */ u("a", {
4078
+ href: o,
4079
+ onClick: h ? (e) => e.preventDefault() : void 0,
4080
+ style: {
4081
+ color: "var(--page-accent, inherit)",
4082
+ textDecoration: "underline"
4083
+ },
4084
+ children: a
4085
+ })] }) : null]
4086
+ }), /* @__PURE__ */ d("div", {
4087
+ style: {
4088
+ display: "flex",
4089
+ gap: 8,
4090
+ flexShrink: 0
4091
+ },
4092
+ children: [r === !1 ? null : /* @__PURE__ */ u("button", {
4093
+ type: "button",
4094
+ onClick: x("declined"),
4095
+ style: {
4096
+ ...w,
4097
+ background: "transparent",
4098
+ color: "inherit",
4099
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.6))"
4100
+ },
4101
+ children: n || "Decline"
4102
+ }), /* @__PURE__ */ u("button", {
4103
+ type: "button",
4104
+ onClick: x("accepted"),
4105
+ style: {
4106
+ ...w,
4107
+ background: "var(--page-accent, #111827)",
4108
+ color: "var(--page-accent-text, #ffffff)",
4109
+ border: "1px solid transparent"
4110
+ },
4111
+ children: t || "Accept"
4112
+ })]
4113
+ })]
4114
+ });
4115
+ }
4116
+ //#endregion
4117
+ //#region ../ui/src/components/builder/apps/language/manifest.js
4118
+ var gn = {
4119
+ id: "language",
4120
+ label: "Language",
4121
+ category: "Apps",
4122
+ keys: ["SiteLanguagePicker"],
4123
+ ssr: "prefetch",
4124
+ settings: ["locales"]
4125
+ };
4126
+ //#endregion
4127
+ //#region ../ui/src/components/builder/apps/language/views.jsx
4128
+ function _n(e) {
4129
+ let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
4130
+ return [...new Set(n.map((e) => e.trim()))];
4131
+ }
4132
+ var vn = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
4133
+ function yn(e, t) {
4134
+ let n = String(e ?? "").toUpperCase();
4135
+ if (t === "code") return n;
4136
+ let r = "";
4137
+ try {
4138
+ r = vn(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
4139
+ } catch {}
4140
+ return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
4141
+ }
4142
+ function bn(e, t) {
4143
+ let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
4144
+ if (typeof window > "u") return n || "?";
4145
+ try {
4146
+ let n = new URL(window.location.href);
4147
+ return t ? n.searchParams.delete("locale") : n.searchParams.set("locale", e), n.searchParams.delete("page"), `${n.pathname}${n.search}${n.hash}`;
4148
+ } catch {
4149
+ return n || "/";
4150
+ }
4151
+ }
4152
+ function xn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
4153
+ let c = r(U), l = _n(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
4154
+ display: "inline-flex",
4155
+ alignItems: "center",
4156
+ gap: 8,
4157
+ ...C(a)
4158
+ };
4159
+ if (l.length < 2) return s ? /* @__PURE__ */ u("div", {
4160
+ ref: o,
4161
+ style: {
4162
+ ...m,
4163
+ padding: "8px 12px",
4164
+ border: "1px dashed rgba(100, 116, 139, 0.45)",
4165
+ borderRadius: 6,
4166
+ color: "rgba(100, 116, 139, 0.8)",
4167
+ fontSize: 12
4168
+ },
4169
+ children: "Add site languages in Settings → Languages"
4170
+ }) : null;
4171
+ let h = i ? /* @__PURE__ */ u("span", {
4172
+ style: { opacity: .7 },
4173
+ children: i
4174
+ }) : null;
4175
+ return e === "inline" ? /* @__PURE__ */ d("div", {
4176
+ ref: o,
4177
+ style: m,
4178
+ children: [h, l.map((e, r) => /* @__PURE__ */ d("span", {
4179
+ style: {
4180
+ display: "inline-flex",
4181
+ alignItems: "center",
4182
+ gap: 8
4183
+ },
4184
+ children: [r > 0 && /* @__PURE__ */ u("span", {
4185
+ style: { opacity: .4 },
4186
+ children: n ?? "·"
4187
+ }), /* @__PURE__ */ u("a", {
4188
+ href: bn(e, e === f),
4189
+ hrefLang: e,
4190
+ "aria-current": e === p ? "true" : void 0,
4191
+ onClick: s ? (e) => e.preventDefault() : void 0,
4192
+ style: {
4193
+ color: e === p ? "var(--page-accent, inherit)" : "inherit",
4194
+ fontWeight: e === p ? 600 : 400,
4195
+ textDecoration: "none",
4196
+ cursor: s ? "default" : "pointer"
4197
+ },
4198
+ children: yn(e, t)
4199
+ })]
4200
+ }, e))]
4201
+ }) : /* @__PURE__ */ d("div", {
4202
+ ref: o,
4203
+ style: m,
4204
+ children: [h, /* @__PURE__ */ u("select", {
4205
+ "aria-label": i || "Language",
4206
+ value: p,
4207
+ onChange: s ? void 0 : (e) => {
4208
+ let t = e.target.value;
4209
+ window.location.assign(bn(t, t === f));
4210
+ },
4211
+ onKeyDown: s ? (e) => e.preventDefault() : void 0,
4212
+ style: {
4213
+ font: "inherit",
4214
+ color: "inherit",
4215
+ background: "var(--page-surface, transparent)",
4216
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.4))",
4217
+ borderRadius: 6,
4218
+ padding: "4px 8px",
4219
+ cursor: s ? "default" : "pointer"
4220
+ },
4221
+ children: l.map((e) => /* @__PURE__ */ u("option", {
4222
+ value: e,
4223
+ children: yn(e, t)
4224
+ }, e))
4225
+ })]
4226
+ });
4227
+ }
4228
+ //#endregion
3856
4229
  //#region ../ui/src/components/builder/apps/index.js
3857
- var an = [Zt], on = {
3858
- SiteLoginForm: nn,
3859
- SiteAccountMenu: rn
4230
+ var Sn = [
4231
+ tn,
4232
+ gn,
4233
+ ln
4234
+ ], Cn = {
4235
+ SiteLoginForm: sn,
4236
+ SiteAccountMenu: cn,
4237
+ SiteLanguagePicker: xn,
4238
+ CookieConsent: hn
3860
4239
  };
3861
- new Set(an.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
4240
+ new Set(Sn.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3862
4241
  //#endregion
3863
4242
  //#region ../ui/src/components/builder/plugins/runtime.js
3864
- var sn = /* @__PURE__ */ new Map();
3865
- function cn(e) {
3866
- if (sn.has(e)) return sn.get(e);
4243
+ var wn = /* @__PURE__ */ new Map();
4244
+ function Tn(e) {
4245
+ if (wn.has(e)) return wn.get(e);
3867
4246
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
3868
4247
  /* @vite-ignore */
3869
4248
  /* webpackIgnore: true */
3870
4249
  t
3871
4250
  ).finally(() => URL.revokeObjectURL(t));
3872
- return sn.set(e, n), n;
4251
+ return wn.set(e, n), n;
3873
4252
  }
3874
- function ln(e) {
4253
+ function En(e) {
3875
4254
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
3876
4255
  return n && typeof n == "object" ? n : {};
3877
4256
  }
3878
4257
  //#endregion
3879
4258
  //#region ../ui/src/components/builder/plugins/view.jsx
3880
- async function un(e, t) {
3881
- let n = await cn(e);
4259
+ async function Dn(e, t) {
4260
+ let n = await Tn(e);
3882
4261
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
3883
4262
  }
3884
- var dn = {
4263
+ var On = {
3885
4264
  padding: "10px 12px",
3886
4265
  border: "1px dashed rgba(148, 163, 184, 0.5)",
3887
4266
  borderRadius: 8,
3888
4267
  fontSize: 12,
3889
4268
  opacity: .6
3890
4269
  };
3891
- function fn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3892
- let c = r(U), l = ln(c?.settings)[e], f = s(null), p = s(null), m = {
4270
+ function kn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
4271
+ let c = r(U), l = En(c?.settings)[e], f = s(null), p = s(null), m = {
3893
4272
  tenant: c?.tenant ?? "",
3894
4273
  apiUrl: c?.apiUrl ?? "/api",
3895
4274
  locale: c?.locale ?? "",
@@ -3901,7 +4280,7 @@ function fn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3901
4280
  let e = f.current;
3902
4281
  if (!l?.code || !e) return;
3903
4282
  let n = !0;
3904
- return un(l.code, t).then((e) => {
4283
+ return Dn(l.code, t).then((e) => {
3905
4284
  if (!(!n || !e || !f.current)) {
3906
4285
  p.current = e;
3907
4286
  try {
@@ -3931,7 +4310,7 @@ function fn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3931
4310
  }) : /* @__PURE__ */ d("div", {
3932
4311
  ref: o,
3933
4312
  style: {
3934
- ...dn,
4313
+ ...On,
3935
4314
  ...C(a)
3936
4315
  },
3937
4316
  children: [
@@ -3943,12 +4322,12 @@ function fn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3943
4322
  }
3944
4323
  //#endregion
3945
4324
  //#region ../ui/src/components/builder/render.jsx
3946
- var pn = {
3947
- ...Xt,
3948
- ...on,
3949
- PluginBlock: fn
4325
+ var An = {
4326
+ ...en,
4327
+ ...Cn,
4328
+ PluginBlock: kn
3950
4329
  };
3951
- function mn(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
4330
+ function jn(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3952
4331
  let o = n[t];
3953
4332
  if (!o || o.hidden) return null;
3954
4333
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -3956,11 +4335,11 @@ function mn(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3956
4335
  let n = o.props?.componentId, s = r?.[n];
3957
4336
  if (!s?.template || i.has(n)) return null;
3958
4337
  let c = new Set(i).add(n);
3959
- return /* @__PURE__ */ u(e, { children: mn(s.template.rootId, s.template.nodes, r, c, a) }, t);
4338
+ return /* @__PURE__ */ u(e, { children: jn(s.template.rootId, s.template.nodes, r, c, a) }, t);
3960
4339
  }
3961
- let l = pn[s];
4340
+ let l = An[s];
3962
4341
  if (!l) return null;
3963
- let d = (o.nodes ?? []).map((e) => mn(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, mn(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
4342
+ let d = (o.nodes ?? []).map((e) => jn(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, jn(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
3964
4343
  ...c,
3965
4344
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
3966
4345
  linked: p,
@@ -3969,16 +4348,16 @@ function mn(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3969
4348
  },
3970
4349
  children: d.length ? d : void 0
3971
4350
  }, t);
3972
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(tn, {
4351
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(on, {
3973
4352
  when: c.when,
3974
4353
  children: m
3975
4354
  }, t) : m;
3976
4355
  }
3977
4356
  //#endregion
3978
4357
  //#region ../ui/src/components/builder/PageRenderer.jsx
3979
- var hn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), gn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
4358
+ var Mn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Nn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
3980
4359
  .webim-page[data-webim-mode="dark"] { ${Object.entries(V(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
3981
- function _n({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: _ }) {
4360
+ function Pn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: _ }) {
3982
4361
  let v = s?.js?.trim();
3983
4362
  if (i(() => {
3984
4363
  if (!v) return;
@@ -3992,11 +4371,11 @@ function _n({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3992
4371
  minHeight: "100%",
3993
4372
  display: "flex",
3994
4373
  flexDirection: "column"
3995
- }, C = mn("ROOT", e, n), w = o(() => ({ render: (t, r) => mn(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = F(e, n), E = P(e, n), D = s?.css?.trim(), O = B(t), k = [O.font, O.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !z[e]), A = [.../* @__PURE__ */ new Set([...y(e, n), ...k])].map((e) => /* @__PURE__ */ u("link", {
4374
+ }, C = jn("ROOT", e, n), w = o(() => ({ render: (t, r) => jn(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = F(e, n), E = P(e, n), D = s?.css?.trim(), O = B(t), k = [O.font, O.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !z[e]), A = [.../* @__PURE__ */ new Set([...y(e, n), ...k])].map((e) => /* @__PURE__ */ u("link", {
3996
4375
  rel: "stylesheet",
3997
4376
  precedence: "default",
3998
4377
  href: g(e)
3999
- }, e)), j = gn(O);
4378
+ }, e)), j = Nn(O);
4000
4379
  return r === "auto" ? /* @__PURE__ */ u(U.Provider, {
4001
4380
  value: {
4002
4381
  tenant: c || "",
@@ -4004,7 +4383,7 @@ function _n({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
4004
4383
  locale: p || "",
4005
4384
  settings: h ?? null
4006
4385
  },
4007
- children: /* @__PURE__ */ u(en, {
4386
+ children: /* @__PURE__ */ u(an, {
4008
4387
  initialUser: _,
4009
4388
  children: /* @__PURE__ */ u(W.Provider, {
4010
4389
  value: f ?? null,
@@ -4019,8 +4398,8 @@ function _n({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
4019
4398
  ...a
4020
4399
  },
4021
4400
  children: [
4022
- /* @__PURE__ */ u("style", { children: `.webim-page { ${hn(V(O.light))} }
4023
- @media (prefers-color-scheme: dark) { .webim-page { ${hn(V(O.dark))} } }` }),
4401
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${Mn(V(O.light))} }
4402
+ @media (prefers-color-scheme: dark) { .webim-page { ${Mn(V(O.dark))} } }` }),
4024
4403
  /* @__PURE__ */ u("style", { children: j }),
4025
4404
  A,
4026
4405
  /* @__PURE__ */ u("style", { children: x }),
@@ -4040,7 +4419,7 @@ function _n({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
4040
4419
  locale: p || "",
4041
4420
  settings: h ?? null
4042
4421
  },
4043
- children: /* @__PURE__ */ u(en, {
4422
+ children: /* @__PURE__ */ u(an, {
4044
4423
  initialUser: _,
4045
4424
  children: /* @__PURE__ */ u(W.Provider, {
4046
4425
  value: f ?? null,
@@ -4071,8 +4450,8 @@ function _n({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
4071
4450
  }
4072
4451
  //#endregion
4073
4452
  //#region src/WebimContent.jsx
4074
- function vn({ bundle: e, mode: t = "auto", style: n }) {
4075
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(_n, {
4453
+ function Fn({ bundle: e, mode: t = "auto", style: n }) {
4454
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(Pn, {
4076
4455
  blocks: e.blocks,
4077
4456
  theme: e.theme,
4078
4457
  components: e.components,
@@ -4089,7 +4468,7 @@ function vn({ bundle: e, mode: t = "auto", style: n }) {
4089
4468
  }
4090
4469
  //#endregion
4091
4470
  //#region src/WebimPage.jsx
4092
- function yn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
4471
+ function In({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
4093
4472
  let [g, _] = c({ status: "loading" }), v = s({
4094
4473
  onLoad: m,
4095
4474
  onError: h
@@ -4126,11 +4505,11 @@ function yn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
4126
4505
  r,
4127
4506
  a,
4128
4507
  o
4129
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(vn, {
4508
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Fn, {
4130
4509
  bundle: g.bundle,
4131
4510
  mode: l,
4132
4511
  style: d
4133
4512
  });
4134
4513
  }
4135
4514
  //#endregion
4136
- export { _n as PageRenderer, vn as WebimContent, yn as WebimPage, se as fetchPage, Me as renderRichContent, ie as resolveTheme };
4515
+ export { Pn as PageRenderer, Fn as WebimContent, In as WebimPage, se as fetchPage, Me as renderRichContent, ie as resolveTheme };