webim-adapter 0.7.0 → 0.9.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.
@@ -1,36 +1,36 @@
1
- import { Fragment as e, createContext as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
2
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
1
+ import { Fragment as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
2
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
3
3
  //#region ../ui/src/components/builder/styles.js
4
- var d = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), f = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, p = [
4
+ var f = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), p = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, m = [
5
5
  "borderWidth",
6
6
  "borderStyle",
7
7
  "borderColor",
8
8
  "borderRadius",
9
9
  "gap"
10
10
  ];
11
- function m(e) {
11
+ function h(e) {
12
12
  let t = {};
13
- for (let n of p) {
13
+ for (let n of m) {
14
14
  let r = e?.[n];
15
- r != null && r !== "" && (t[n] = d.has(n) ? f(r) : r);
15
+ r != null && r !== "" && (t[n] = f.has(n) ? p(r) : r);
16
16
  }
17
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || p.includes(n) || (t[n] = d.has(n) ? f(r) : r);
17
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || m.includes(n) || (t[n] = f.has(n) ? p(r) : r);
18
18
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
19
19
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
20
20
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
21
21
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
22
- let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
22
+ let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
23
23
  [
24
24
  s,
25
25
  c,
26
26
  l,
27
27
  u
28
- ].some((e) => e !== void 0) && m.push(`${f(s ?? 0)} ${f(c ?? 0)} ${f(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
29
- let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
28
+ ].some((e) => e !== void 0) && d.push(`${p(s ?? 0)} ${p(c ?? 0)} ${p(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
29
+ let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${p(e.x ?? 0)}, ${p(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
30
30
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
31
31
  let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
32
- (v !== void 0 || y !== void 0) && w.push(`translate(${f(v ?? 0)}, ${f(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
33
- let T = (e) => `${e.inset ? "inset " : ""}${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${f(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
32
+ (v !== void 0 || y !== void 0) && w.push(`translate(${p(v ?? 0)}, ${p(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
33
+ let T = (e) => `${e.inset ? "inset " : ""}${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${p(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
34
34
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
35
35
  let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
36
36
  [
@@ -48,76 +48,76 @@ function m(e) {
48
48
  color: j,
49
49
  inset: M
50
50
  })), N.length && (t.boxShadow = N.join(", "));
51
- let P = (e) => e.type === "blur" ? `blur(${f(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: ee, filterGrayscale: R, filterBrightness: z, filterContrast: te, filterSaturate: ne } = t;
51
+ let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: ee, filterBrightness: z, filterContrast: B, filterSaturate: te } = t;
52
52
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
- let B = F(I);
54
- ee !== void 0 && B.push(`blur(${f(ee)})`), R !== void 0 && B.push(`grayscale(${R}%)`), z !== void 0 && B.push(`brightness(${z}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
- let re = F(L);
56
- re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
- let { textStrokeWidth: ie, textStrokeColor: ae } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (ie !== void 0 || ae !== void 0) && (t.WebkitTextStroke = `${f(ie ?? 1)} ${ae || "currentColor"}`);
59
- let { clipText: oe } = t;
60
- delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: V, transitionDuration: H, transitionEasing: U, transitionProperty: se } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
53
+ let V = F(I);
54
+ R !== void 0 && V.push(`blur(${p(R)})`), ee !== void 0 && V.push(`grayscale(${ee}%)`), z !== void 0 && V.push(`brightness(${z}%)`), B !== void 0 && V.push(`contrast(${B}%)`), te !== void 0 && V.push(`saturate(${te}%)`), V.length && (t.filter = V.join(" "));
55
+ let ne = F(L);
56
+ ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
+ let { textStrokeWidth: re, textStrokeColor: ie } = t;
58
+ delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${p(re ?? 1)} ${ie || "currentColor"}`);
59
+ let { clipText: ae } = t;
60
+ delete t.clipText, ae && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
+ let { transitions: oe, transitionDuration: H, transitionEasing: U, transitionProperty: W } = t, se = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
62
62
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
63
- let G = (Array.isArray(V) ? V : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (H !== void 0 && G.push(`${se || "all"} ${W(H)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
63
+ let G = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${se(e.duration ?? 200)} ${e.easing || "ease"}`);
64
+ if (H !== void 0 && G.push(`${W || "all"} ${se(H)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
65
65
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
66
66
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
67
67
  }
68
68
  delete t.backgroundVideo;
69
- let { overlayColor: K, overlayOpacity: ce } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, K) {
71
- let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
69
+ let { overlayColor: ce, overlayOpacity: K } = t;
70
+ if (delete t.overlayColor, delete t.overlayOpacity, ce) {
71
+ let e = `color-mix(in srgb, ${ce} ${K ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
72
72
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
73
73
  }
74
74
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
75
- let { backgroundLayers: q } = t;
75
+ let { backgroundLayers: le } = t;
76
76
  delete t.backgroundLayers;
77
- let J = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
78
- if (J.length) {
77
+ let q = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
78
+ if (q.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
- for (let t of J) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
80
+ for (let t of q) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
81
81
  else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
82
82
  else {
83
83
  if (!t.src) continue;
84
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${f(t.w ?? "auto")} ${f(t.h ?? "auto")}` : t.size || "cover"), r.push(`${f(t.posX ?? 0)} ${f(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
84
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${p(t.w ?? "auto")} ${p(t.h ?? "auto")}` : t.size || "cover"), r.push(`${p(t.posX ?? 0)} ${p(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
85
85
  }
86
86
  e.length && (t.backgroundImage && (e.push(t.backgroundImage), n.push(t.backgroundSize || "cover"), r.push(t.backgroundPosition || "center"), i.push(t.backgroundRepeat || "no-repeat"), a.push("scroll")), t.backgroundImage = e.join(", "), t.backgroundSize = n.join(", "), t.backgroundPosition = r.join(", "), t.backgroundRepeat = i.join(", "), t.backgroundAttachment = a.join(", "));
87
87
  }
88
88
  return t;
89
89
  }
90
- var h = {
90
+ var g = {
91
91
  hover: ":hover",
92
92
  pressed: ":active",
93
93
  focused: ":focus"
94
- }, g = /* @__PURE__ */ new Set([
94
+ }, _ = /* @__PURE__ */ new Set([
95
95
  "style",
96
96
  "class",
97
97
  "id",
98
98
  "data-wb",
99
99
  "data-wb-class",
100
100
  "data-slot"
101
- ]), _ = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !g.has(e.toLowerCase());
102
- function v(e, t, n = []) {
101
+ ]), v = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !_.has(e.toLowerCase());
102
+ function y(e, t, n = []) {
103
103
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
104
104
  for (let t of n) e.removeAttribute(t);
105
105
  let r = [];
106
106
  for (let n of t.attributes ?? []) {
107
107
  let t = String(n?.name ?? "").trim();
108
- _(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
108
+ v(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
109
109
  }
110
110
  return r;
111
111
  }
112
- var y = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
- function b(e, t, n, r = !1) {
114
- let i = Object.entries(m(t)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
112
+ var b = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
+ function x(e, t, n, r = !1) {
114
+ let i = Object.entries(h(t)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
115
115
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
116
116
  }
117
- function x(e, t, n) {
118
- return Object.entries(h).map(([r, i]) => b(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
117
+ function S(e, t, n) {
118
+ return Object.entries(g).map(([r, i]) => x(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
119
119
  }
120
- var S = [
120
+ var C = [
121
121
  {
122
122
  key: "tablet",
123
123
  max: 991
@@ -130,17 +130,17 @@ var S = [
130
130
  key: "mobile",
131
131
  max: 478
132
132
  }
133
- ], C = (e) => Object.entries(m(e)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
134
- function w(e, t) {
135
- return S.map(({ key: n, max: r }) => {
136
- let i = t?.[n] ? C(t[n]) : "";
133
+ ], w = (e) => Object.entries(h(e)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
134
+ function T(e, t) {
135
+ return C.map(({ key: n, max: r }) => {
136
+ let i = t?.[n] ? w(t[n]) : "";
137
137
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
138
138
  }).filter(Boolean).join("\n");
139
139
  }
140
- function T(e, t) {
140
+ function E(e, t) {
141
141
  let n = [], r = (e) => {
142
142
  for (let [t, r] of Object.entries(e || {})) {
143
- let e = w(t, r.props);
143
+ let e = T(t, r.props);
144
144
  e && n.push(e);
145
145
  }
146
146
  };
@@ -148,10 +148,10 @@ function T(e, t) {
148
148
  for (let e of Object.values(t || {})) r(e.template?.nodes);
149
149
  return n.join("\n");
150
150
  }
151
- function E(e, t) {
151
+ function D(e, t) {
152
152
  let n = [], r = (e) => {
153
153
  for (let [t, r] of Object.entries(e || {})) {
154
- let e = x(t, r.props);
154
+ let e = S(t, r.props);
155
155
  e && n.push(e);
156
156
  }
157
157
  };
@@ -159,7 +159,7 @@ function E(e, t) {
159
159
  for (let e of Object.values(t || {})) r(e.template?.nodes);
160
160
  return n.join("\n");
161
161
  }
162
- var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", O = {
162
+ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", k = {
163
163
  light: {
164
164
  background: "#ffffff",
165
165
  text: "#111827",
@@ -196,23 +196,23 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
196
196
  contrastText: "#052e2b"
197
197
  }
198
198
  }
199
- }, k = {
199
+ }, A = {
200
200
  font: "system",
201
201
  headingFont: "inherit",
202
- light: O.light,
203
- dark: O.dark
204
- }, A = {
202
+ light: k.light,
203
+ dark: k.dark
204
+ }, j = {
205
205
  system: {
206
206
  label: "System",
207
- value: D
207
+ value: O
208
208
  },
209
209
  inter: {
210
210
  label: "Inter",
211
- value: `"Inter", ${D}`
211
+ value: `"Inter", ${O}`
212
212
  },
213
213
  outfit: {
214
214
  label: "Outfit",
215
- value: `"Outfit", ${D}`
215
+ value: `"Outfit", ${O}`
216
216
  },
217
217
  serif: {
218
218
  label: "Serif",
@@ -222,7 +222,7 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
222
222
  label: "Mono",
223
223
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
224
224
  }
225
- }, j = (e, t) => A[e]?.value ?? t, M = (e, ...t) => {
225
+ }, M = (e, t) => j[e]?.value ?? t, N = (e, ...t) => {
226
226
  let n = Object.assign({}, e, ...t);
227
227
  return n.primary = {
228
228
  ...e.primary,
@@ -238,16 +238,16 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
238
238
  }), {})
239
239
  }, n;
240
240
  };
241
- function N(e) {
241
+ function P(e) {
242
242
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
243
243
  return {
244
- font: r ?? k.font,
245
- headingFont: i ?? k.headingFont,
246
- light: M(O.light, a, t),
247
- dark: M(O.dark, n)
244
+ font: r ?? A.font,
245
+ headingFont: i ?? A.headingFont,
246
+ light: N(k.light, a, t),
247
+ dark: N(k.dark, n)
248
248
  };
249
249
  }
250
- function P(e) {
250
+ function F(e) {
251
251
  return {
252
252
  "--page-bg": e.background,
253
253
  "--page-text": e.text,
@@ -263,23 +263,23 @@ function P(e) {
263
263
  "--page-secondary-contrast": e.secondary.contrastText
264
264
  };
265
265
  }
266
- function F(e) {
267
- let t = N(e);
266
+ function I(e) {
267
+ let t = P(e);
268
268
  return {
269
269
  backgroundColor: "var(--page-bg)",
270
270
  color: "var(--page-text)",
271
- fontFamily: j(t.font, D),
272
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : j(t.headingFont, "inherit")
271
+ fontFamily: M(t.font, O),
272
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : M(t.headingFont, "inherit")
273
273
  };
274
274
  }
275
- function I(e, t = "light") {
276
- let n = N(e);
275
+ function L(e, t = "light") {
276
+ let n = P(e);
277
277
  return {
278
- ...F(e),
279
- ...P(n[t] ?? n.light)
278
+ ...I(e),
279
+ ...F(n[t] ?? n.light)
280
280
  };
281
281
  }
282
- function L(e, t) {
282
+ function R(e, t) {
283
283
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
284
  }
285
285
  //#endregion
@@ -294,7 +294,7 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
294
294
  title: e.title,
295
295
  slug: e.slug,
296
296
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
297
- theme: L(o, a.builder_themes?.themes),
297
+ theme: R(o, a.builder_themes?.themes),
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
@@ -302,23 +302,24 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
302
302
  locale: i || a.locales?.default,
303
303
  locales: a.locales,
304
304
  tenant: n ?? "",
305
- apiUrl: r ?? ""
305
+ apiUrl: r ?? "",
306
+ settings: a
306
307
  };
307
308
  }
308
309
  //#endregion
309
310
  //#region src/fetchPage.js
310
- var R = async (e) => {
311
+ var z = async (e) => {
311
312
  let t = await e.json().catch(() => null);
312
313
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
313
314
  return t?.payload ?? t;
314
315
  };
315
- async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
316
+ async function B({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
316
317
  if (!e) throw Error("fetchPage: apiUrl is required");
317
318
  if (!n) throw Error("fetchPage: slug is required");
318
319
  let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
319
320
  ...t ? { "x-tenant": t } : {},
320
321
  ...a ? { authorization: `Bearer ${a}` } : {}
321
- }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(R), s(`${c}/settings/public`, { headers: l }).then(R)]), f = ee({
322
+ }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(z), s(`${c}/settings/public`, { headers: l }).then(z)]), f = ee({
322
323
  page: u,
323
324
  settings: d,
324
325
  tenant: t,
@@ -326,7 +327,7 @@ async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
326
327
  locale: r
327
328
  }), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
328
329
  if (p.length) {
329
- let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(R).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
330
+ let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(z).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
330
331
  f.datasets = Object.fromEntries(t);
331
332
  }
332
333
  return f;
@@ -440,7 +441,7 @@ new Map([
440
441
  function te(e) {
441
442
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
442
443
  }
443
- var ne = (e) => te([e]), B = (e) => {
444
+ var V = (e) => te([e]), ne = (e) => {
444
445
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
445
446
  return t ? t[1] : null;
446
447
  };
@@ -452,7 +453,7 @@ function re(e, t) {
452
453
  "pressed",
453
454
  "focused"
454
455
  ]) {
455
- let r = B(t.props?.[e]?.fontFamily);
456
+ let r = ne(t.props?.[e]?.fontFamily);
456
457
  r && n.add(r);
457
458
  }
458
459
  };
@@ -473,14 +474,16 @@ var ie = /* @__PURE__ */ new Set([
473
474
  "yi",
474
475
  "dv",
475
476
  "ckb"
476
- ]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, V = t({
477
+ ]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, H = t({
477
478
  tenant: "",
478
- apiUrl: "/api"
479
- }), H = t(null), U = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
480
- function W(e, t) {
479
+ apiUrl: "/api",
480
+ locale: "",
481
+ settings: null
482
+ }), U = t(null), W = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
483
+ function G(e, t) {
481
484
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
482
485
  }
483
- var G = (e) => {
486
+ var ce = (e) => {
484
487
  let t = [];
485
488
  for (let [n, r] of Object.entries(e ?? {})) {
486
489
  if (!/^[\w-]+$/.test(n)) continue;
@@ -491,12 +494,12 @@ var G = (e) => {
491
494
  return t;
492
495
  };
493
496
  function K(e) {
494
- return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("name" in e || "slug" in e) ? String(e.name ?? e.slug ?? "") : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.name != null || e.slug != null) ? String(e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
497
+ return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
495
498
  }
496
- function ce(e, t) {
497
- let n = t?.data ?? {}, r = G(n);
499
+ function le(e, t) {
500
+ let n = t?.data ?? {}, r = ce(n);
498
501
  if (!r.length) return e;
499
- let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(W(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
502
+ let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
500
503
  return a(e);
501
504
  }
502
505
  var q = {
@@ -504,22 +507,22 @@ var q = {
504
507
  fontWeight: 700,
505
508
  lineHeight: 1.2,
506
509
  fontFamily: "var(--page-heading-font, inherit)"
507
- }, J = { margin: 0 }, Y = {
510
+ }, ue = { margin: 0 }, J = {
508
511
  display: "inline-block",
509
512
  textDecoration: "none",
510
513
  cursor: "pointer",
511
514
  backgroundColor: "var(--page-accent, #111827)",
512
515
  color: "var(--page-accent-text, #ffffff)"
513
- }, le = {
516
+ }, de = {
514
517
  flexGrow: 1,
515
518
  display: "flex",
516
519
  flexDirection: "column",
517
520
  position: "relative"
518
- }, ue = {
521
+ }, fe = {
519
522
  display: "flex",
520
523
  flexDirection: "column"
521
524
  };
522
- function de({ style: e }) {
525
+ function pe({ style: e }) {
523
526
  let t = e?.backgroundVideo;
524
527
  if (!t) return null;
525
528
  let n = {
@@ -530,7 +533,7 @@ function de({ style: e }) {
530
533
  zIndex: -1,
531
534
  pointerEvents: "none"
532
535
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
533
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("video", {
536
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("video", {
534
537
  src: t,
535
538
  autoPlay: !0,
536
539
  muted: !0,
@@ -540,73 +543,73 @@ function de({ style: e }) {
540
543
  ...n,
541
544
  objectFit: "cover"
542
545
  }
543
- }), r && /* @__PURE__ */ l("div", { style: {
546
+ }), r && /* @__PURE__ */ u("div", { style: {
544
547
  ...n,
545
548
  background: r
546
549
  } })] });
547
550
  }
548
- var fe = (e, t) => e?.backgroundVideo ? {
551
+ var me = (e, t) => e?.backgroundVideo ? {
549
552
  position: "relative",
550
553
  ...t,
551
- ...m(e)
554
+ ...h(e)
552
555
  } : {
553
556
  ...t,
554
- ...m(e)
557
+ ...h(e)
555
558
  };
556
- function pe({ style: e, nodeRef: t, children: n }) {
557
- return /* @__PURE__ */ u("div", {
559
+ function he({ style: e, nodeRef: t, children: n }) {
560
+ return /* @__PURE__ */ d("div", {
558
561
  ref: t,
559
562
  style: {
560
- ...le,
561
- ...m(e)
563
+ ...de,
564
+ ...h(e)
562
565
  },
563
- children: [/* @__PURE__ */ l(de, { style: e }), n]
566
+ children: [/* @__PURE__ */ u(pe, { style: e }), n]
564
567
  });
565
568
  }
566
- function me({ style: e, nodeRef: t, children: n }) {
567
- return /* @__PURE__ */ u("section", {
569
+ function ge({ style: e, nodeRef: t, children: n }) {
570
+ return /* @__PURE__ */ d("section", {
568
571
  ref: t,
569
- style: fe(e, ue),
570
- children: [/* @__PURE__ */ l(de, { style: e }), n]
572
+ style: me(e, fe),
573
+ children: [/* @__PURE__ */ u(pe, { style: e }), n]
571
574
  });
572
575
  }
573
- function he({ style: e, freeLayout: t, nodeRef: n, children: r }) {
576
+ function _e({ style: e, freeLayout: t, nodeRef: n, children: r }) {
574
577
  let i = t ? {
575
578
  position: "relative",
576
579
  minHeight: 240
577
580
  } : null;
578
- return /* @__PURE__ */ u("div", {
581
+ return /* @__PURE__ */ d("div", {
579
582
  ref: n,
580
583
  style: i ? {
581
584
  ...i,
582
- ...fe(e)
583
- } : fe(e),
584
- children: [/* @__PURE__ */ l(de, { style: e }), r]
585
+ ...me(e)
586
+ } : me(e),
587
+ children: [/* @__PURE__ */ u(pe, { style: e }), r]
585
588
  });
586
589
  }
587
- function ge({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
588
- return /* @__PURE__ */ l(n, {
590
+ function ve({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
591
+ return /* @__PURE__ */ u(n, {
589
592
  ref: a,
590
593
  style: {
591
594
  ...q,
592
- ...m(r)
595
+ ...h(r)
593
596
  },
594
- children: X(t, e, i)
597
+ children: Y(t, e, i)
595
598
  });
596
599
  }
597
- var _e = {
598
- fontFamily: A.mono.value,
600
+ var ye = {
601
+ fontFamily: j.mono.value,
599
602
  background: "rgba(148, 163, 184, 0.18)",
600
603
  padding: "1px 5px",
601
604
  borderRadius: 4,
602
605
  fontSize: "0.9em"
603
606
  };
604
- function ve(e, t = [], n, r) {
607
+ function be(e, t = [], n, r) {
605
608
  let i = e;
606
- return t.includes("sup") ? i = /* @__PURE__ */ l("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ l("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ l("code", {
607
- style: _e,
609
+ return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
610
+ style: ye,
608
611
  children: i
609
- })), t.includes("strike") && (i = /* @__PURE__ */ l("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ l("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ l("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ l("strong", { children: i })), n && (i = /* @__PURE__ */ l("a", {
612
+ })), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
610
613
  href: n,
611
614
  target: r || void 0,
612
615
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
@@ -614,36 +617,36 @@ function ve(e, t = [], n, r) {
614
617
  children: i
615
618
  })), i;
616
619
  }
617
- function X(t, n, r) {
620
+ function Y(t, n, r) {
618
621
  return t?.length ? t.map((t, n) => {
619
- if (t.slot) return /* @__PURE__ */ l(e, { children: r?.[t.slot] ?? null }, n);
620
- if (t.parts) return /* @__PURE__ */ l(e, { children: X(t.parts, "", r) }, n);
622
+ if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
623
+ if (t.parts) return /* @__PURE__ */ u(e, { children: Y(t.parts, "", r) }, n);
621
624
  let i = t.text;
622
- return t.sup ? i = /* @__PURE__ */ l("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ l("sub", { children: i })), t.code && (i = /* @__PURE__ */ l("code", {
623
- style: _e,
625
+ return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
626
+ style: ye,
624
627
  children: i
625
- })), t.strike && (i = /* @__PURE__ */ l("s", { children: i })), t.underline && (i = /* @__PURE__ */ l("u", { children: i })), t.italic && (i = /* @__PURE__ */ l("em", { children: i })), t.bold && (i = /* @__PURE__ */ l("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ l("span", {
628
+ })), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
626
629
  style: {
627
630
  ...t.color && { color: t.color },
628
631
  ...t.background && { backgroundColor: t.background }
629
632
  },
630
633
  children: i
631
- })), t.href && (i = /* @__PURE__ */ l("a", {
634
+ })), t.href && (i = /* @__PURE__ */ u("a", {
632
635
  href: t.href,
633
636
  target: t.target || void 0,
634
637
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
635
638
  style: { color: t.color ?? "inherit" },
636
639
  children: i
637
- })), /* @__PURE__ */ l(e, { children: i }, n);
640
+ })), /* @__PURE__ */ u(e, { children: i }, n);
638
641
  }) : n;
639
642
  }
640
- function ye({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
641
- return /* @__PURE__ */ l("span", {
642
- style: m(a),
643
- children: e?.length ? X(e, t) : ve(t, n, r, i)
643
+ function xe({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
644
+ return /* @__PURE__ */ u("span", {
645
+ style: h(a),
646
+ children: e?.length ? Y(e, t) : be(t, n, r, i)
644
647
  });
645
648
  }
646
- var be = {
649
+ var Se = {
647
650
  h1: 40,
648
651
  h2: 32,
649
652
  h3: 26,
@@ -651,7 +654,7 @@ var be = {
651
654
  h5: 19,
652
655
  h6: 16
653
656
  };
654
- function xe({ align: e = "center", width: t, wrap: n } = {}) {
657
+ function Ce({ align: e = "center", width: t, wrap: n } = {}) {
655
658
  let r = t ? `${t}%` : void 0;
656
659
  if (e === "full") return { width: "100%" };
657
660
  let i = e === "left" || e === "right";
@@ -685,8 +688,8 @@ function xe({ align: e = "center", width: t, wrap: n } = {}) {
685
688
  marginRight: "auto"
686
689
  };
687
690
  }
688
- function Se(e = [], t, n) {
689
- let r = n ?? ((e, n) => X(e, n, t));
691
+ function we(e = [], t, n) {
692
+ let r = n ?? ((e, n) => Y(e, n, t));
690
693
  return e.map((t, n) => {
691
694
  let i = {
692
695
  marginTop: 0,
@@ -694,7 +697,7 @@ function Se(e = [], t, n) {
694
697
  };
695
698
  if (t.type === "image") {
696
699
  if (!t.src) return null;
697
- let e = /* @__PURE__ */ l("img", {
700
+ let e = /* @__PURE__ */ u("img", {
698
701
  src: t.src,
699
702
  alt: t.alt || "",
700
703
  style: {
@@ -703,20 +706,20 @@ function Se(e = [], t, n) {
703
706
  borderRadius: 6
704
707
  }
705
708
  });
706
- return /* @__PURE__ */ u("figure", {
709
+ return /* @__PURE__ */ d("figure", {
707
710
  style: {
708
711
  marginLeft: 0,
709
712
  marginRight: 0,
710
713
  ...i,
711
- ...xe(t)
714
+ ...Ce(t)
712
715
  },
713
- children: [t.href ? /* @__PURE__ */ l("a", {
716
+ children: [t.href ? /* @__PURE__ */ u("a", {
714
717
  href: t.href,
715
718
  target: t.target || void 0,
716
719
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
717
720
  style: { display: "block" },
718
721
  children: e
719
- }) : e, t.caption && /* @__PURE__ */ l("figcaption", {
722
+ }) : e, t.caption && /* @__PURE__ */ u("figcaption", {
720
723
  style: {
721
724
  fontSize: 13,
722
725
  opacity: .65,
@@ -727,16 +730,16 @@ function Se(e = [], t, n) {
727
730
  })]
728
731
  }, n);
729
732
  }
730
- if (t.type === "video") return Ne(t.url) ? /* @__PURE__ */ l("div", {
733
+ if (t.type === "video") return Fe(t.url) ? /* @__PURE__ */ u("div", {
731
734
  style: {
732
735
  ...i,
733
- ...xe({
736
+ ...Ce({
734
737
  align: t.align,
735
738
  wrap: t.wrap,
736
739
  width: t.width ?? 100
737
740
  })
738
741
  },
739
- children: /* @__PURE__ */ l(Pe, {
742
+ children: /* @__PURE__ */ u(Ie, {
740
743
  url: t.url,
741
744
  autoplay: t.autoplay,
742
745
  muted: t.muted,
@@ -745,146 +748,146 @@ function Se(e = [], t, n) {
745
748
  start: t.start
746
749
  })
747
750
  }, n) : null;
748
- if (t.type === "divider") return /* @__PURE__ */ l("hr", { style: {
751
+ if (t.type === "divider") return /* @__PURE__ */ u("hr", { style: {
749
752
  ...i,
750
753
  border: 0,
751
754
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
752
755
  } }, n);
753
756
  if (t.type === "ul" || t.type === "ol") {
754
757
  let e = t.type;
755
- return /* @__PURE__ */ l(e, {
758
+ return /* @__PURE__ */ u(e, {
756
759
  style: {
757
760
  ...i,
758
761
  paddingLeft: 24
759
762
  },
760
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ l("li", {
763
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ u("li", {
761
764
  style: { marginBottom: 4 },
762
765
  children: r(e.parts, e.text)
763
766
  }, t))
764
767
  }, n);
765
768
  }
766
- if (t.type === "quote") return /* @__PURE__ */ l("blockquote", {
769
+ if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
767
770
  style: {
768
- ...we,
771
+ ...Ee,
769
772
  ...i
770
773
  },
771
774
  children: r(t.parts, t.text)
772
775
  }, n);
773
- if (be[t.type]) {
776
+ if (Se[t.type]) {
774
777
  let e = t.type;
775
- return /* @__PURE__ */ l(e, {
778
+ return /* @__PURE__ */ u(e, {
776
779
  style: {
777
780
  ...q,
778
- fontSize: be[t.type],
781
+ fontSize: Se[t.type],
779
782
  ...i
780
783
  },
781
784
  children: r(t.parts, t.text)
782
785
  }, n);
783
786
  }
784
- return /* @__PURE__ */ l("p", {
787
+ return /* @__PURE__ */ u("p", {
785
788
  style: {
786
- ...J,
789
+ ...ue,
787
790
  ...i
788
791
  },
789
792
  children: r(t.parts, t.text)
790
793
  }, n);
791
794
  });
792
795
  }
793
- function Ce({ content: e, style: t, linked: n, nodeRef: r }) {
794
- return /* @__PURE__ */ l("div", {
796
+ function Te({ content: e, style: t, linked: n, nodeRef: r }) {
797
+ return /* @__PURE__ */ u("div", {
795
798
  ref: r,
796
799
  style: {
797
800
  display: "flow-root",
798
- ...m(t)
801
+ ...h(t)
799
802
  },
800
- children: Se(e, n)
803
+ children: we(e, n)
801
804
  });
802
805
  }
803
- var we = {
806
+ var Ee = {
804
807
  margin: 0,
805
808
  padding: "8px 0 8px 20px",
806
809
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
807
810
  };
808
- function Te({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
809
- return /* @__PURE__ */ l("blockquote", {
811
+ function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
812
+ return /* @__PURE__ */ u("blockquote", {
810
813
  ref: i,
811
814
  style: {
812
- ...we,
813
- ...m(n)
815
+ ...Ee,
816
+ ...h(n)
814
817
  },
815
- children: X(t, e, r)
818
+ children: Y(t, e, r)
816
819
  });
817
820
  }
818
- function Ee({ ordered: e, items: t = [], style: n, nodeRef: r }) {
819
- return /* @__PURE__ */ l(e ? "ol" : "ul", {
821
+ function Oe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
822
+ return /* @__PURE__ */ u(e ? "ol" : "ul", {
820
823
  ref: r,
821
824
  style: {
822
825
  margin: 0,
823
826
  paddingLeft: 24,
824
- ...m(n)
827
+ ...h(n)
825
828
  },
826
- children: t.map((e, t) => /* @__PURE__ */ l("li", {
829
+ children: t.map((e, t) => /* @__PURE__ */ u("li", {
827
830
  style: { marginBottom: 4 },
828
- children: X(e.parts, e.text)
831
+ children: Y(e.parts, e.text)
829
832
  }, t))
830
833
  });
831
834
  }
832
- function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
833
- return /* @__PURE__ */ l("p", {
835
+ function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
836
+ return /* @__PURE__ */ u("p", {
834
837
  ref: i,
835
838
  style: {
836
- ...J,
837
- ...m(n)
839
+ ...ue,
840
+ ...h(n)
838
841
  },
839
- children: X(t, e, r)
842
+ children: Y(t, e, r)
840
843
  });
841
844
  }
842
- var Oe = {
845
+ var Ae = {
843
846
  color: "var(--page-accent, inherit)",
844
847
  textDecoration: "underline",
845
848
  textUnderlineOffset: 3,
846
849
  cursor: "pointer"
847
850
  };
848
- function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
849
- return /* @__PURE__ */ l("a", {
851
+ function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
852
+ return /* @__PURE__ */ u("a", {
850
853
  ref: o,
851
854
  href: n || "#",
852
855
  target: r || void 0,
853
856
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
854
857
  style: {
855
- ...Oe,
856
- ...m(i)
858
+ ...Ae,
859
+ ...h(i)
857
860
  },
858
- children: X(t, e, a)
861
+ children: Y(t, e, a)
859
862
  });
860
863
  }
861
- function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
862
- return /* @__PURE__ */ l("a", {
864
+ function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
865
+ return /* @__PURE__ */ u("a", {
863
866
  ref: o,
864
867
  href: n || "#",
865
868
  target: r || void 0,
866
869
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
867
870
  style: {
868
- ...Y,
869
- ...m(i)
871
+ ...J,
872
+ ...h(i)
870
873
  },
871
- children: X(t, e, a)
874
+ children: Y(t, e, a)
872
875
  });
873
876
  }
874
- function je({ src: e, alt: t, style: n, nodeRef: r }) {
875
- return e ? /* @__PURE__ */ l("img", {
877
+ function Ne({ src: e, alt: t, style: n, nodeRef: r }) {
878
+ return e ? /* @__PURE__ */ u("img", {
876
879
  ref: r,
877
880
  src: e,
878
881
  alt: t || "",
879
882
  style: {
880
883
  display: "block",
881
884
  maxWidth: "100%",
882
- ...m(n)
885
+ ...h(n)
883
886
  }
884
887
  }) : null;
885
888
  }
886
- function Me({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
887
- return e ? /* @__PURE__ */ l("video", {
889
+ function Pe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
890
+ return e ? /* @__PURE__ */ u("video", {
888
891
  ref: s,
889
892
  src: e,
890
893
  poster: t || void 0,
@@ -897,25 +900,25 @@ function Me({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
897
900
  display: "block",
898
901
  width: "100%",
899
902
  maxWidth: "100%",
900
- ...m(o)
903
+ ...h(o)
901
904
  }
902
905
  }) : null;
903
906
  }
904
- var Ne = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
905
- function Pe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
906
- let c = Ne(e);
907
+ var Fe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
908
+ function Ie({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
909
+ let c = Fe(e);
907
910
  if (!c) return null;
908
- let u = new URLSearchParams({ rel: "0" });
909
- return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", c)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ l("div", {
911
+ let l = new URLSearchParams({ rel: "0" });
912
+ return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
910
913
  ref: s,
911
914
  style: {
912
915
  position: "relative",
913
916
  width: "100%",
914
917
  paddingTop: "56.25%",
915
- ...m(o)
918
+ ...h(o)
916
919
  },
917
- children: /* @__PURE__ */ l("iframe", {
918
- src: `https://www.youtube-nocookie.com/embed/${c}?${u}`,
920
+ children: /* @__PURE__ */ u("iframe", {
921
+ src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
919
922
  title: "YouTube video",
920
923
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
921
924
  allowFullScreen: !0,
@@ -929,8 +932,8 @@ function Pe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
929
932
  })
930
933
  });
931
934
  }
932
- function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
933
- return e ? /* @__PURE__ */ l("iframe", {
935
+ function Le({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
936
+ return e ? /* @__PURE__ */ u("iframe", {
934
937
  ref: i,
935
938
  src: e,
936
939
  title: t || "Embedded frame",
@@ -941,13 +944,13 @@ function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
941
944
  width: "100%",
942
945
  height: 300,
943
946
  border: 0,
944
- ...m(r)
947
+ ...h(r)
945
948
  }
946
949
  }) : null;
947
950
  }
948
- function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
949
- let [a, o] = s(null);
950
- return r(() => {
951
+ function Re({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
952
+ let [a, o] = c(null);
953
+ return i(() => {
951
954
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
952
955
  let t = document.createElement("script");
953
956
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
@@ -957,15 +960,15 @@ function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
957
960
  a,
958
961
  e,
959
962
  t
960
- ]), /* @__PURE__ */ l("div", {
963
+ ]), /* @__PURE__ */ u("div", {
961
964
  ref: (e) => {
962
- o(e), i && i(e);
965
+ o(e), r && r(e);
963
966
  },
964
- style: m(n)
967
+ style: h(n)
965
968
  });
966
969
  }
967
- function Le({ height: e, nodeRef: t }) {
968
- return /* @__PURE__ */ l("div", {
970
+ function ze({ height: e, nodeRef: t }) {
971
+ return /* @__PURE__ */ u("div", {
969
972
  ref: t,
970
973
  style: {
971
974
  height: e || 32,
@@ -974,18 +977,18 @@ function Le({ height: e, nodeRef: t }) {
974
977
  }
975
978
  });
976
979
  }
977
- function Re({ style: e, nodeRef: t }) {
978
- return /* @__PURE__ */ l("div", {
980
+ function Be({ style: e, nodeRef: t }) {
981
+ return /* @__PURE__ */ u("div", {
979
982
  ref: t,
980
983
  style: {
981
984
  height: 1,
982
985
  alignSelf: "stretch",
983
986
  flexShrink: 0,
984
- ...m(e)
987
+ ...h(e)
985
988
  }
986
989
  });
987
990
  }
988
- var ze = {
991
+ var Ve = {
989
992
  position: "absolute",
990
993
  top: "50%",
991
994
  transform: "translateY(-50%)",
@@ -1002,7 +1005,7 @@ var ze = {
1002
1005
  alignItems: "center",
1003
1006
  justifyContent: "center",
1004
1007
  padding: 0
1005
- }, Be = {
1008
+ }, He = {
1006
1009
  bottom: {
1007
1010
  inset: "auto 0 0 0",
1008
1011
  padding: "40px 24px 20px",
@@ -1021,26 +1024,26 @@ var ze = {
1021
1024
  padding: 24,
1022
1025
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1023
1026
  }
1024
- }, Ve = 48;
1025
- function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: o = !0, style: d, nodeRef: f }) {
1026
- let [p, h] = s(0), [g, _] = s(!1), [v, y] = s(null), b = e ? Math.min(p, e - 1) : 0;
1027
- if (r(() => {
1027
+ }, Ue = 48;
1028
+ function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1029
+ let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
1030
+ if (i(() => {
1028
1031
  if (!n || g || v || e < 2) return;
1029
- let t = setInterval(() => h((t) => (t + 1) % e), Math.max(2, Number(i) || 5) * 1e3);
1032
+ let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
1030
1033
  return () => clearInterval(t);
1031
1034
  }, [
1032
1035
  n,
1033
1036
  g,
1034
1037
  v,
1035
- i,
1038
+ r,
1036
1039
  e
1037
1040
  ]), !e) return null;
1038
- let x = (t) => h((t + e) % e), S = () => {
1041
+ let x = (t) => m((t + e) % e), S = () => {
1039
1042
  if (!v) return;
1040
1043
  let { dx: e } = v;
1041
- y(null), e < -48 ? x(b + 1) : e > Ve && x(b - 1);
1044
+ y(null), e < -48 ? x(b + 1) : e > Ue && x(b - 1);
1042
1045
  };
1043
- return /* @__PURE__ */ u("div", {
1046
+ return /* @__PURE__ */ d("div", {
1044
1047
  ref: f,
1045
1048
  onMouseEnter: () => _(!0),
1046
1049
  onMouseLeave: () => _(!1),
@@ -1063,16 +1066,16 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1063
1066
  touchAction: "pan-y",
1064
1067
  userSelect: v ? "none" : void 0,
1065
1068
  cursor: v ? "grabbing" : void 0,
1066
- ...m(d)
1069
+ ...h(s)
1067
1070
  },
1068
- children: [/* @__PURE__ */ l("div", {
1071
+ children: [/* @__PURE__ */ u("div", {
1069
1072
  style: {
1070
1073
  display: "flex",
1071
1074
  height: a,
1072
1075
  transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
1073
1076
  transition: v ? "none" : "transform 450ms ease"
1074
1077
  },
1075
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ l("div", {
1078
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ u("div", {
1076
1079
  style: {
1077
1080
  position: "relative",
1078
1081
  width: "100%",
@@ -1081,28 +1084,28 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1081
1084
  },
1082
1085
  children: t(n)
1083
1086
  }, n))
1084
- }), e > 1 && /* @__PURE__ */ u(c, { children: [
1085
- /* @__PURE__ */ l("button", {
1087
+ }), e > 1 && /* @__PURE__ */ d(l, { children: [
1088
+ /* @__PURE__ */ u("button", {
1086
1089
  type: "button",
1087
1090
  "aria-label": "Previous slide",
1088
1091
  style: {
1089
- ...ze,
1092
+ ...Ve,
1090
1093
  left: 12
1091
1094
  },
1092
1095
  onClick: () => x(b - 1),
1093
1096
  children: "‹"
1094
1097
  }),
1095
- /* @__PURE__ */ l("button", {
1098
+ /* @__PURE__ */ u("button", {
1096
1099
  type: "button",
1097
1100
  "aria-label": "Next slide",
1098
1101
  style: {
1099
- ...ze,
1102
+ ...Ve,
1100
1103
  right: 12
1101
1104
  },
1102
1105
  onClick: () => x(b + 1),
1103
1106
  children: "›"
1104
1107
  }),
1105
- /* @__PURE__ */ l("div", {
1108
+ /* @__PURE__ */ u("div", {
1106
1109
  style: {
1107
1110
  position: "absolute",
1108
1111
  bottom: 10,
@@ -1112,7 +1115,7 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1112
1115
  justifyContent: "center",
1113
1116
  gap: 6
1114
1117
  },
1115
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ l("button", {
1118
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u("button", {
1116
1119
  type: "button",
1117
1120
  "aria-label": `Go to slide ${t + 1}`,
1118
1121
  onClick: () => x(t),
@@ -1130,7 +1133,7 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1130
1133
  ] })]
1131
1134
  });
1132
1135
  }
1133
- var Ue = (e, t) => ({
1136
+ var Ge = (e, t) => ({
1134
1137
  position: "absolute",
1135
1138
  inset: 0,
1136
1139
  backgroundImage: e ? `url(${e})` : "none",
@@ -1138,26 +1141,26 @@ var Ue = (e, t) => ({
1138
1141
  backgroundSize: "cover",
1139
1142
  backgroundPosition: "center"
1140
1143
  });
1141
- function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1142
- return e.length ? /* @__PURE__ */ l(He, {
1144
+ function Ke({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1145
+ return e.length ? /* @__PURE__ */ u(We, {
1143
1146
  ...r,
1144
1147
  count: e.length,
1145
1148
  renderSlide: (r) => {
1146
1149
  let i = e[r];
1147
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(i.image) }), (i.title || i.text) && /* @__PURE__ */ u("div", {
1150
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1148
1151
  style: {
1149
1152
  position: "absolute",
1150
1153
  color: "#fff",
1151
1154
  textAlign: n,
1152
- ...Be[t] ?? Be.bottom
1155
+ ...He[t] ?? He.bottom
1153
1156
  },
1154
- children: [i.title && /* @__PURE__ */ l("div", {
1157
+ children: [i.title && /* @__PURE__ */ u("div", {
1155
1158
  style: {
1156
1159
  fontSize: 22,
1157
1160
  fontWeight: 700
1158
1161
  },
1159
1162
  children: i.title
1160
- }), i.text && /* @__PURE__ */ l("div", {
1163
+ }), i.text && /* @__PURE__ */ u("div", {
1161
1164
  style: {
1162
1165
  fontSize: 14,
1163
1166
  opacity: .9,
@@ -1169,13 +1172,13 @@ function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1169
1172
  }
1170
1173
  }) : null;
1171
1174
  }
1172
- function Ge({ slides: e = [], linked: t, ...n }) {
1173
- return e.length ? /* @__PURE__ */ l(He, {
1175
+ function qe({ slides: e = [], linked: t, ...n }) {
1176
+ return e.length ? /* @__PURE__ */ u(We, {
1174
1177
  ...n,
1175
1178
  count: e.length,
1176
1179
  renderSlide: (n) => {
1177
1180
  let r = e[n];
1178
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(r.image, r.color) }), /* @__PURE__ */ l("div", {
1181
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(r.image, r.color) }), /* @__PURE__ */ u("div", {
1179
1182
  style: {
1180
1183
  position: "absolute",
1181
1184
  inset: 0,
@@ -1187,33 +1190,33 @@ function Ge({ slides: e = [], linked: t, ...n }) {
1187
1190
  }
1188
1191
  }) : null;
1189
1192
  }
1190
- var Z = {
1193
+ var Je = {
1191
1194
  color: "inherit",
1192
1195
  textDecoration: "none",
1193
1196
  fontSize: 14,
1194
1197
  opacity: .85
1195
- }, Ke = {
1198
+ }, Ye = {
1196
1199
  background: "var(--page-bg, #ffffff)",
1197
1200
  color: "var(--page-text, #111827)",
1198
1201
  border: "1px solid rgba(148, 163, 184, 0.25)",
1199
1202
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1200
1203
  zIndex: 60
1201
1204
  };
1202
- function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c = "auto", breakpoint: d = 768 }) {
1203
- let [f, p] = s(null), [h, g] = s(!1), [_, v] = s(!1), [y, b] = s(null);
1204
- r(() => {
1205
+ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s = "auto", breakpoint: l = 768 }) {
1206
+ let [f, p] = c(null), [m, g] = c(!1), [_, v] = c(!1), [y, b] = c(null);
1207
+ i(() => {
1205
1208
  if (!f) return;
1206
- let e = new ResizeObserver(() => g(f.offsetWidth < d));
1209
+ let e = new ResizeObserver(() => g(f.offsetWidth < l));
1207
1210
  return e.observe(f), () => e.disconnect();
1208
- }, [f, d]);
1209
- let x = c === "hamburger" || c === "auto" && h, S = (e, t) => /* @__PURE__ */ u("a", {
1211
+ }, [f, l]);
1212
+ let x = s === "hamburger" || s === "auto" && m, S = (e, t) => /* @__PURE__ */ d("a", {
1210
1213
  href: e.href || "#",
1211
1214
  style: {
1212
- ...Z,
1215
+ ...Je,
1213
1216
  display: "block",
1214
1217
  ...t
1215
1218
  },
1216
- children: [e.label, e.desc && /* @__PURE__ */ l("span", {
1219
+ children: [e.label, e.desc && /* @__PURE__ */ u("span", {
1217
1220
  style: {
1218
1221
  display: "block",
1219
1222
  fontSize: 12,
@@ -1223,7 +1226,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1223
1226
  children: e.desc
1224
1227
  })]
1225
1228
  }, e.key);
1226
- return /* @__PURE__ */ u("nav", {
1229
+ return /* @__PURE__ */ d("nav", {
1227
1230
  ref: (e) => {
1228
1231
  p(e), o && o(e);
1229
1232
  },
@@ -1235,10 +1238,10 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1235
1238
  padding: "14px 24px",
1236
1239
  width: "100%",
1237
1240
  position: "relative",
1238
- ...m(a)
1241
+ ...h(a)
1239
1242
  },
1240
1243
  children: [
1241
- n && /* @__PURE__ */ l("img", {
1244
+ n && /* @__PURE__ */ u("img", {
1242
1245
  src: n,
1243
1246
  alt: t || "Logo",
1244
1247
  style: {
@@ -1246,7 +1249,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1246
1249
  display: "block"
1247
1250
  }
1248
1251
  }),
1249
- t && /* @__PURE__ */ l("div", {
1252
+ t && /* @__PURE__ */ u("div", {
1250
1253
  style: {
1251
1254
  fontWeight: 700,
1252
1255
  fontSize: 18,
@@ -1254,8 +1257,8 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1254
1257
  },
1255
1258
  children: t
1256
1259
  }),
1257
- /* @__PURE__ */ l("div", { style: { flexGrow: 1 } }),
1258
- x ? /* @__PURE__ */ l("button", {
1260
+ /* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
1261
+ x ? /* @__PURE__ */ u("button", {
1259
1262
  type: "button",
1260
1263
  "aria-label": _ ? "Close menu" : "Open menu",
1261
1264
  onClick: () => v(!_),
@@ -1269,38 +1272,38 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1269
1272
  padding: 4
1270
1273
  },
1271
1274
  children: _ ? "✕" : "☰"
1272
- }) : /* @__PURE__ */ l("div", {
1275
+ }) : /* @__PURE__ */ u("div", {
1273
1276
  style: {
1274
1277
  display: "flex",
1275
1278
  gap: 20,
1276
1279
  alignItems: "center",
1277
1280
  flexWrap: "wrap"
1278
1281
  },
1279
- children: i.map((e) => {
1282
+ children: r.map((e) => {
1280
1283
  let t = e.children ?? [];
1281
- if (!t.length) return /* @__PURE__ */ l("a", {
1284
+ if (!t.length) return /* @__PURE__ */ u("a", {
1282
1285
  href: e.href || "#",
1283
- style: Z,
1286
+ style: Je,
1284
1287
  children: e.label
1285
1288
  }, e.key);
1286
1289
  let n = e.type === "mega";
1287
- return /* @__PURE__ */ u("span", {
1290
+ return /* @__PURE__ */ d("span", {
1288
1291
  style: {
1289
1292
  position: n ? "static" : "relative",
1290
1293
  display: "inline-flex"
1291
1294
  },
1292
1295
  onMouseEnter: () => b(e.key),
1293
1296
  onMouseLeave: () => b(null),
1294
- children: [/* @__PURE__ */ u("a", {
1297
+ children: [/* @__PURE__ */ d("a", {
1295
1298
  href: e.href || "#",
1296
1299
  style: {
1297
- ...Z,
1300
+ ...Je,
1298
1301
  cursor: "pointer"
1299
1302
  },
1300
1303
  children: [
1301
1304
  e.label,
1302
1305
  " ",
1303
- /* @__PURE__ */ l("span", {
1306
+ /* @__PURE__ */ u("span", {
1304
1307
  style: {
1305
1308
  fontSize: 9,
1306
1309
  opacity: .6
@@ -1308,9 +1311,9 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1308
1311
  children: "▼"
1309
1312
  })
1310
1313
  ]
1311
- }), y === e.key && (n ? /* @__PURE__ */ l("div", {
1314
+ }), y === e.key && (n ? /* @__PURE__ */ u("div", {
1312
1315
  style: {
1313
- ...Ke,
1316
+ ...Ye,
1314
1317
  position: "absolute",
1315
1318
  left: 0,
1316
1319
  right: 0,
@@ -1324,9 +1327,9 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1324
1327
  padding: "6px 8px",
1325
1328
  borderRadius: 6
1326
1329
  }))
1327
- }) : /* @__PURE__ */ l("div", {
1330
+ }) : /* @__PURE__ */ u("div", {
1328
1331
  style: {
1329
- ...Ke,
1332
+ ...Ye,
1330
1333
  position: "absolute",
1331
1334
  top: "100%",
1332
1335
  left: 0,
@@ -1344,7 +1347,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1344
1347
  }, e.key);
1345
1348
  })
1346
1349
  }),
1347
- x && _ && /* @__PURE__ */ l("div", {
1350
+ x && _ && /* @__PURE__ */ u("div", {
1348
1351
  style: {
1349
1352
  flexBasis: "100%",
1350
1353
  width: "100%",
@@ -1352,10 +1355,10 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1352
1355
  flexDirection: "column",
1353
1356
  paddingTop: 10
1354
1357
  },
1355
- children: i.map((t) => /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l("a", {
1358
+ children: r.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1356
1359
  href: t.href || "#",
1357
1360
  style: {
1358
- ...Z,
1361
+ ...Je,
1359
1362
  padding: "10px 4px",
1360
1363
  fontWeight: (t.children ?? []).length ? 600 : 400,
1361
1364
  opacity: 1
@@ -1366,21 +1369,21 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1366
1369
  ]
1367
1370
  });
1368
1371
  }
1369
- function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1370
- let [i, a] = s(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1371
- return e.length ? /* @__PURE__ */ u("div", {
1372
+ function Ze({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1373
+ let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1374
+ return e.length ? /* @__PURE__ */ d("div", {
1372
1375
  ref: r,
1373
1376
  style: {
1374
1377
  width: "100%",
1375
- ...m(n)
1378
+ ...h(n)
1376
1379
  },
1377
- children: [/* @__PURE__ */ l("div", {
1380
+ children: [/* @__PURE__ */ u("div", {
1378
1381
  style: {
1379
1382
  display: "flex",
1380
1383
  gap: 4,
1381
1384
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1382
1385
  },
1383
- children: e.map((e, t) => /* @__PURE__ */ l("button", {
1386
+ children: e.map((e, t) => /* @__PURE__ */ u("button", {
1384
1387
  type: "button",
1385
1388
  onClick: () => a(t),
1386
1389
  style: {
@@ -1397,7 +1400,7 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1397
1400
  },
1398
1401
  children: e.label || `Tab ${t + 1}`
1399
1402
  }, e.key))
1400
- }), e.map((e, n) => /* @__PURE__ */ l("div", {
1403
+ }), e.map((e, n) => /* @__PURE__ */ u("div", {
1401
1404
  style: {
1402
1405
  display: n === o ? "flex" : "none",
1403
1406
  flexDirection: "column"
@@ -1406,26 +1409,26 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1406
1409
  }, e.key))]
1407
1410
  }) : null;
1408
1411
  }
1409
- function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1410
- let [a, o] = s(() => new Set(e.length ? [e[0].key] : []));
1412
+ function Qe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1413
+ let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
1411
1414
  if (!e.length) return null;
1412
- let c = (e) => o((t) => {
1415
+ let s = (e) => o((t) => {
1413
1416
  let r = new Set(n ? t : []);
1414
1417
  return t.has(e) ? r.delete(e) : r.add(e), r;
1415
1418
  });
1416
- return /* @__PURE__ */ l("div", {
1419
+ return /* @__PURE__ */ u("div", {
1417
1420
  ref: i,
1418
1421
  style: {
1419
1422
  width: "100%",
1420
- ...m(r)
1423
+ ...h(r)
1421
1424
  },
1422
1425
  children: e.map((n, r) => {
1423
1426
  let i = a.has(n.key);
1424
- return /* @__PURE__ */ u("div", {
1427
+ return /* @__PURE__ */ d("div", {
1425
1428
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1426
- children: [/* @__PURE__ */ u("button", {
1429
+ children: [/* @__PURE__ */ d("button", {
1427
1430
  type: "button",
1428
- onClick: () => c(n.key),
1431
+ onClick: () => s(n.key),
1429
1432
  style: {
1430
1433
  width: "100%",
1431
1434
  display: "flex",
@@ -1442,7 +1445,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1442
1445
  textAlign: "left",
1443
1446
  cursor: "pointer"
1444
1447
  },
1445
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ l("span", {
1448
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ u("span", {
1446
1449
  "aria-hidden": !0,
1447
1450
  style: {
1448
1451
  fontSize: 12,
@@ -1452,7 +1455,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1452
1455
  },
1453
1456
  children: "▼"
1454
1457
  })]
1455
- }), /* @__PURE__ */ l("div", {
1458
+ }), /* @__PURE__ */ u("div", {
1456
1459
  style: {
1457
1460
  display: i ? "flex" : "none",
1458
1461
  flexDirection: "column"
@@ -1463,15 +1466,15 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1463
1466
  })
1464
1467
  });
1465
1468
  }
1466
- var Xe = {
1469
+ var $e = {
1467
1470
  display: "flex",
1468
1471
  flexDirection: "column",
1469
1472
  gap: "12px"
1470
- }, Ze = {
1473
+ }, X = {
1471
1474
  fontSize: "14px",
1472
1475
  fontWeight: 500,
1473
1476
  color: "var(--page-text, #111827)"
1474
- }, Q = {
1477
+ }, Z = {
1475
1478
  padding: "10px 12px",
1476
1479
  border: "1px solid #d1d5db",
1477
1480
  borderRadius: "6px",
@@ -1481,18 +1484,18 @@ var Xe = {
1481
1484
  boxSizing: "border-box",
1482
1485
  backgroundColor: "#ffffff",
1483
1486
  color: "#111827"
1484
- }, Qe = {
1487
+ }, et = {
1485
1488
  display: "flex",
1486
1489
  alignItems: "center",
1487
1490
  gap: "8px",
1488
1491
  fontSize: "14px",
1489
1492
  color: "var(--page-text, #111827)"
1490
- }, $e = (e) => e ? {
1493
+ }, Q = (e) => e ? {
1491
1494
  readOnly: !0,
1492
1495
  tabIndex: -1,
1493
1496
  onMouseDown: (e) => e.preventDefault()
1494
1497
  } : {};
1495
- function et(e, t) {
1498
+ function tt(e, t) {
1496
1499
  if (!e) return !0;
1497
1500
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1498
1501
  switch (e.op) {
@@ -1506,11 +1509,11 @@ function et(e, t) {
1506
1509
  default: return !1;
1507
1510
  }
1508
1511
  }
1509
- var tt = {
1512
+ var nt = {
1510
1513
  display: "flex",
1511
1514
  flexDirection: "column",
1512
1515
  gap: 6
1513
- }, nt = {
1516
+ }, rt = {
1514
1517
  font: "inherit",
1515
1518
  fontSize: 15,
1516
1519
  padding: "10px 12px",
@@ -1521,23 +1524,29 @@ var tt = {
1521
1524
  width: "100%",
1522
1525
  boxSizing: "border-box"
1523
1526
  };
1524
- function rt({ field: e, value: t, onChange: n, inert: r }) {
1525
- let i = /* @__PURE__ */ u("span", {
1527
+ function it(e, t) {
1528
+ let n = Array.isArray(e?.options) ? e.options : [];
1529
+ if (!e?.parentField) return n;
1530
+ let r = t?.[e.parentField];
1531
+ return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1532
+ }
1533
+ function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1534
+ let a = /* @__PURE__ */ d("span", {
1526
1535
  style: {
1527
- ...Ze,
1536
+ ...X,
1528
1537
  fontSize: 14
1529
1538
  },
1530
1539
  children: [e.label, e.required ? " *" : ""]
1531
- }), a = {
1540
+ }), o = {
1532
1541
  name: e.name,
1533
1542
  required: e.required || void 0,
1534
1543
  placeholder: e.placeholder || void 0,
1535
1544
  disabled: r || void 0,
1536
- style: nt,
1545
+ style: rt,
1537
1546
  value: t ?? "",
1538
1547
  onChange: (t) => n(e.name, t.target.value)
1539
1548
  };
1540
- return e.type === "display" ? /* @__PURE__ */ l(e.variant && e.variant !== "p" ? e.variant : "p", {
1549
+ return e.type === "display" ? /* @__PURE__ */ u(e.variant && e.variant !== "p" ? e.variant : "p", {
1541
1550
  style: {
1542
1551
  margin: 0,
1543
1552
  color: e.color || "inherit",
@@ -1554,7 +1563,7 @@ function rt({ field: e, value: t, onChange: n, inert: r }) {
1554
1563
  lineHeight: 1.35
1555
1564
  },
1556
1565
  children: e.label
1557
- }) : e.type === "image" ? e.src ? /* @__PURE__ */ l("img", {
1566
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ u("img", {
1558
1567
  src: e.src,
1559
1568
  alt: e.label ?? "",
1560
1569
  style: {
@@ -1562,10 +1571,10 @@ function rt({ field: e, value: t, onChange: n, inert: r }) {
1562
1571
  borderRadius: 8,
1563
1572
  display: "block"
1564
1573
  }
1565
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ l(Pe, {
1574
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ie, {
1566
1575
  url: e.src,
1567
1576
  style: { width: "100%" }
1568
- }) : /* @__PURE__ */ l("video", {
1577
+ }) : /* @__PURE__ */ u("video", {
1569
1578
  src: e.src,
1570
1579
  controls: !0,
1571
1580
  style: {
@@ -1573,27 +1582,28 @@ function rt({ field: e, value: t, onChange: n, inert: r }) {
1573
1582
  borderRadius: 8,
1574
1583
  display: "block"
1575
1584
  }
1576
- }) : null : /* @__PURE__ */ u("label", {
1577
- style: tt,
1585
+ }) : null : /* @__PURE__ */ d("label", {
1586
+ style: nt,
1578
1587
  children: [
1579
- i,
1580
- e.type === "textarea" || e.multiline ? /* @__PURE__ */ l("textarea", {
1581
- ...a,
1588
+ a,
1589
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
1590
+ ...o,
1582
1591
  rows: 4,
1583
1592
  style: {
1584
- ...nt,
1593
+ ...rt,
1585
1594
  resize: "vertical"
1586
1595
  }
1587
- }) : e.type === "select" ? /* @__PURE__ */ u("select", {
1588
- ...a,
1589
- children: [/* @__PURE__ */ l("option", {
1596
+ }) : e.type === "select" ? /* @__PURE__ */ d("select", {
1597
+ ...o,
1598
+ disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
1599
+ children: [/* @__PURE__ */ u("option", {
1590
1600
  value: "",
1591
1601
  children: e.placeholder || "—"
1592
- }), (e.options ?? []).map((e, t) => /* @__PURE__ */ l("option", {
1602
+ }), it(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1593
1603
  value: typeof e == "string" ? e : e.value,
1594
1604
  children: typeof e == "string" ? e : e.label ?? e.value
1595
1605
  }, t))]
1596
- }) : e.type === "checkbox" ? /* @__PURE__ */ l("input", {
1606
+ }) : e.type === "checkbox" ? /* @__PURE__ */ u("input", {
1597
1607
  type: "checkbox",
1598
1608
  name: e.name,
1599
1609
  required: e.required || void 0,
@@ -1604,7 +1614,7 @@ function rt({ field: e, value: t, onChange: n, inert: r }) {
1604
1614
  width: 18,
1605
1615
  height: 18
1606
1616
  }
1607
- }) : e.type === "upload" ? /* @__PURE__ */ l("input", {
1617
+ }) : e.type === "upload" ? /* @__PURE__ */ u("input", {
1608
1618
  type: "file",
1609
1619
  name: e.name,
1610
1620
  accept: e.accept || void 0,
@@ -1615,8 +1625,8 @@ function rt({ field: e, value: t, onChange: n, inert: r }) {
1615
1625
  font: "inherit",
1616
1626
  fontSize: 14
1617
1627
  }
1618
- }) : /* @__PURE__ */ l("input", {
1619
- ...a,
1628
+ }) : /* @__PURE__ */ u("input", {
1629
+ ...o,
1620
1630
  type: {
1621
1631
  email: "email",
1622
1632
  number: "number",
@@ -1626,7 +1636,7 @@ function rt({ field: e, value: t, onChange: n, inert: r }) {
1626
1636
  link: "url"
1627
1637
  }[e.type] ?? "text"
1628
1638
  }),
1629
- e.help && /* @__PURE__ */ l("span", {
1639
+ e.help && /* @__PURE__ */ u("span", {
1630
1640
  style: {
1631
1641
  fontSize: 12,
1632
1642
  opacity: .65
@@ -1636,17 +1646,17 @@ function rt({ field: e, value: t, onChange: n, inert: r }) {
1636
1646
  ]
1637
1647
  });
1638
1648
  }
1639
- function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d, auto: f, submitLabel: p, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
1640
- let { tenant: b, apiUrl: x } = n(V), [S, C] = s("form"), [w, T] = s(null), [E, D] = s({}), [O, k] = s(0), A = g ? y || "form" : S;
1641
- r(() => {
1642
- if (!f || !d) return;
1649
+ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
1650
+ let { tenant: b, apiUrl: x } = r(H), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
1651
+ i(() => {
1652
+ if (!f || !s) return;
1643
1653
  let e = !0;
1644
- return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1654
+ return fetch(`${x || "/api"}/forms/${encodeURIComponent(s)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1645
1655
  e = !1;
1646
1656
  };
1647
1657
  }, [
1648
1658
  f,
1649
- d,
1659
+ s,
1650
1660
  b,
1651
1661
  x
1652
1662
  ]);
@@ -1658,33 +1668,37 @@ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1658
1668
  section: e,
1659
1669
  fields: []
1660
1670
  }) : j[j.length - 1].fields.push(e);
1661
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || et(e.section.condition, E)).map((e) => ({
1671
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || tt(e.section.condition, E)).map((e) => ({
1662
1672
  ...e,
1663
- fields: e.fields.filter((e) => et(e.condition, E))
1673
+ fields: e.fields.filter((e) => tt(e.condition, E))
1664
1674
  })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
1665
1675
  let t = E[e.name];
1666
1676
  return e.required && (t == null || t === "" || t === !1);
1667
- }), ee = F >= N.length - 1, R = (e, t) => D((n) => ({
1668
- ...n,
1669
- [e]: t
1670
- }));
1671
- return /* @__PURE__ */ u("div", {
1672
- ref: h,
1673
- style: m(e),
1677
+ }), R = F >= N.length - 1, ee = (e, t) => D((n) => {
1678
+ let r = {
1679
+ ...n,
1680
+ [e]: t
1681
+ };
1682
+ for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
1683
+ return r;
1684
+ });
1685
+ return /* @__PURE__ */ d("div", {
1686
+ ref: m,
1687
+ style: h(e),
1674
1688
  children: [
1675
- /* @__PURE__ */ l("form", {
1689
+ /* @__PURE__ */ u("form", {
1676
1690
  action: t || void 0,
1677
- method: i || "post",
1691
+ method: n || "post",
1678
1692
  name: a || void 0,
1679
1693
  encType: o || void 0,
1680
1694
  onSubmit: async (e) => {
1681
1695
  if (e.preventDefault(), !g) {
1682
- if (d) {
1696
+ if (s) {
1683
1697
  let t = {};
1684
1698
  if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1685
1699
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1686
1700
  try {
1687
- let e = await fetch(`${x || "/api"}/forms/${d}/submit`, {
1701
+ let e = await fetch(`${x || "/api"}/forms/${s}/submit`, {
1688
1702
  method: "post",
1689
1703
  headers: {
1690
1704
  "content-type": "application/json",
@@ -1703,27 +1717,27 @@ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1703
1717
  return;
1704
1718
  }
1705
1719
  try {
1706
- let n = await fetch(t, {
1707
- method: i || "post",
1720
+ let r = await fetch(t, {
1721
+ method: n || "post",
1708
1722
  body: new FormData(e.currentTarget)
1709
1723
  });
1710
- C(n.ok ? "success" : "error");
1724
+ C(r.ok ? "success" : "error");
1711
1725
  } catch {
1712
1726
  C("error");
1713
1727
  }
1714
1728
  }
1715
1729
  },
1716
1730
  style: {
1717
- ...Xe,
1731
+ ...$e,
1718
1732
  display: A === "success" ? "none" : "flex"
1719
1733
  },
1720
- children: f && d ? /* @__PURE__ */ u(c, { children: [
1721
- P && /* @__PURE__ */ l(gt, {
1734
+ children: f && s ? /* @__PURE__ */ d(l, { children: [
1735
+ P && /* @__PURE__ */ u(vt, {
1722
1736
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1723
1737
  active: F + 1,
1724
1738
  style: { marginBottom: 8 }
1725
1739
  }),
1726
- P && N[F]?.section?.help && /* @__PURE__ */ l("p", {
1740
+ P && N[F]?.section?.help && /* @__PURE__ */ u("p", {
1727
1741
  style: {
1728
1742
  margin: 0,
1729
1743
  fontSize: 14,
@@ -1731,25 +1745,26 @@ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1731
1745
  },
1732
1746
  children: N[F].section.help
1733
1747
  }),
1734
- I.map((e) => /* @__PURE__ */ l(rt, {
1748
+ I.map((e) => /* @__PURE__ */ u(at, {
1735
1749
  field: e,
1736
1750
  value: E[e.name],
1737
- onChange: R,
1751
+ values: E,
1752
+ onChange: ee,
1738
1753
  inert: g
1739
1754
  }, e.name)),
1740
- /* @__PURE__ */ u("div", {
1755
+ /* @__PURE__ */ d("div", {
1741
1756
  style: {
1742
1757
  display: "flex",
1743
1758
  gap: 10,
1744
1759
  alignItems: "center",
1745
1760
  marginTop: 4
1746
1761
  },
1747
- children: [P && F > 0 && /* @__PURE__ */ l("button", {
1762
+ children: [P && F > 0 && /* @__PURE__ */ u("button", {
1748
1763
  type: "button",
1749
1764
  disabled: g || void 0,
1750
1765
  onClick: () => k(F - 1),
1751
1766
  style: {
1752
- ...Y,
1767
+ ...J,
1753
1768
  background: "transparent",
1754
1769
  color: "inherit",
1755
1770
  border: 0,
@@ -1757,12 +1772,12 @@ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1757
1772
  cursor: "pointer"
1758
1773
  },
1759
1774
  children: "Back"
1760
- }), P && !ee ? /* @__PURE__ */ l("button", {
1775
+ }), P && !R ? /* @__PURE__ */ u("button", {
1761
1776
  type: "button",
1762
1777
  disabled: g || L.length > 0,
1763
1778
  onClick: () => k(F + 1),
1764
1779
  style: {
1765
- ...Y,
1780
+ ...J,
1766
1781
  border: 0,
1767
1782
  padding: "10px 22px",
1768
1783
  borderRadius: 8,
@@ -1772,11 +1787,11 @@ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1772
1787
  opacity: L.length ? .5 : 1
1773
1788
  },
1774
1789
  children: "Next"
1775
- }) : /* @__PURE__ */ l("button", {
1790
+ }) : /* @__PURE__ */ u("button", {
1776
1791
  type: "submit",
1777
1792
  disabled: g || void 0,
1778
1793
  style: {
1779
- ...Y,
1794
+ ...J,
1780
1795
  border: 0,
1781
1796
  padding: "10px 22px",
1782
1797
  borderRadius: 8,
@@ -1789,11 +1804,11 @@ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1789
1804
  })
1790
1805
  ] }) : _
1791
1806
  }),
1792
- /* @__PURE__ */ l("div", {
1807
+ /* @__PURE__ */ u("div", {
1793
1808
  style: { display: A === "success" ? "block" : "none" },
1794
1809
  children: v?.success ?? null
1795
1810
  }),
1796
- /* @__PURE__ */ l("div", {
1811
+ /* @__PURE__ */ u("div", {
1797
1812
  style: {
1798
1813
  display: A === "error" ? "block" : "none",
1799
1814
  marginTop: 12
@@ -1803,53 +1818,53 @@ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1803
1818
  ]
1804
1819
  });
1805
1820
  }
1806
- function at({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1807
- return /* @__PURE__ */ l("label", {
1821
+ function st({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1822
+ return /* @__PURE__ */ u("label", {
1808
1823
  ref: r,
1809
1824
  style: {
1810
- ...Ze,
1811
- ...m(n)
1825
+ ...X,
1826
+ ...h(n)
1812
1827
  },
1813
- children: X(t, e, i)
1828
+ children: Y(t, e, i)
1814
1829
  });
1815
1830
  }
1816
- function ot({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1817
- return /* @__PURE__ */ l("input", {
1831
+ function ct({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1832
+ return /* @__PURE__ */ u("input", {
1818
1833
  ref: a,
1819
1834
  type: e,
1820
1835
  name: t || void 0,
1821
1836
  placeholder: n,
1822
1837
  required: !o && !!r,
1823
1838
  style: {
1824
- ...Q,
1825
- ...m(i)
1839
+ ...Z,
1840
+ ...h(i)
1826
1841
  },
1827
- ...$e(o)
1842
+ ...Q(o)
1828
1843
  });
1829
1844
  }
1830
- function st({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1831
- return /* @__PURE__ */ l("textarea", {
1845
+ function lt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1846
+ return /* @__PURE__ */ u("textarea", {
1832
1847
  ref: a,
1833
1848
  name: e || void 0,
1834
1849
  placeholder: t,
1835
1850
  rows: n,
1836
1851
  required: !o && !!r,
1837
1852
  style: {
1838
- ...Q,
1853
+ ...Z,
1839
1854
  resize: "vertical",
1840
- ...m(i)
1855
+ ...h(i)
1841
1856
  },
1842
- ...$e(o)
1857
+ ...Q(o)
1843
1858
  });
1844
1859
  }
1845
- function ct({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1846
- return /* @__PURE__ */ u("label", {
1860
+ function ut({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1861
+ return /* @__PURE__ */ d("label", {
1847
1862
  ref: o,
1848
1863
  style: {
1849
- ...Qe,
1850
- ...m(a)
1864
+ ...et,
1865
+ ...h(a)
1851
1866
  },
1852
- children: [/* @__PURE__ */ l("input", {
1867
+ children: [/* @__PURE__ */ u("input", {
1853
1868
  type: e,
1854
1869
  name: n || void 0,
1855
1870
  value: r || void 0,
@@ -1863,8 +1878,8 @@ function ct({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1863
1878
  }), t]
1864
1879
  });
1865
1880
  }
1866
- function lt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1867
- return /* @__PURE__ */ u("select", {
1881
+ function dt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1882
+ return /* @__PURE__ */ d("select", {
1868
1883
  ref: a,
1869
1884
  name: e || void 0,
1870
1885
  required: !o && !!r,
@@ -1872,58 +1887,58 @@ function lt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1872
1887
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1873
1888
  tabIndex: o ? -1 : void 0,
1874
1889
  style: {
1875
- ...Q,
1890
+ ...Z,
1876
1891
  appearance: "auto",
1877
- ...m(i)
1892
+ ...h(i)
1878
1893
  },
1879
- children: [t !== "" && /* @__PURE__ */ l("option", {
1894
+ children: [t !== "" && /* @__PURE__ */ u("option", {
1880
1895
  value: "",
1881
1896
  disabled: !0,
1882
1897
  children: t ?? "Select…"
1883
- }), n.map((e, t) => /* @__PURE__ */ l("option", {
1898
+ }), n.map((e, t) => /* @__PURE__ */ u("option", {
1884
1899
  value: e,
1885
1900
  children: e
1886
1901
  }, t))]
1887
1902
  });
1888
1903
  }
1889
- function ut({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1890
- let [c, d] = s(null);
1891
- return /* @__PURE__ */ u("label", {
1904
+ function ft({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1905
+ let [s, l] = c(null);
1906
+ return /* @__PURE__ */ d("label", {
1892
1907
  ref: a,
1893
1908
  style: {
1894
- ...Q,
1909
+ ...Z,
1895
1910
  display: "flex",
1896
1911
  alignItems: "center",
1897
1912
  gap: "8px",
1898
1913
  cursor: o ? "default" : "pointer",
1899
1914
  borderStyle: "dashed",
1900
- color: c ? "#111827" : "#6b7280",
1901
- ...m(i)
1915
+ color: s ? "#111827" : "#6b7280",
1916
+ ...h(i)
1902
1917
  },
1903
1918
  children: [
1904
- /* @__PURE__ */ l("input", {
1919
+ /* @__PURE__ */ u("input", {
1905
1920
  type: "file",
1906
1921
  name: e || void 0,
1907
1922
  accept: t || void 0,
1908
1923
  required: !o && !!n,
1909
1924
  disabled: !!o,
1910
- onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1925
+ onChange: (e) => l(e.target.files?.[0]?.name ?? null),
1911
1926
  style: { display: "none" }
1912
1927
  }),
1913
- /* @__PURE__ */ l("span", {
1928
+ /* @__PURE__ */ u("span", {
1914
1929
  "aria-hidden": !0,
1915
1930
  children: "📎"
1916
1931
  }),
1917
- c ?? r
1932
+ s ?? r
1918
1933
  ]
1919
1934
  });
1920
1935
  }
1921
- function dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1922
- return /* @__PURE__ */ l("button", {
1936
+ function pt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1937
+ return /* @__PURE__ */ u("button", {
1923
1938
  ref: n,
1924
1939
  type: r ? "button" : "submit",
1925
1940
  style: {
1926
- ...Y,
1941
+ ...J,
1927
1942
  border: 0,
1928
1943
  cursor: "pointer",
1929
1944
  alignSelf: "flex-start",
@@ -1933,72 +1948,76 @@ function dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1933
1948
  fontWeight: 600,
1934
1949
  lineHeight: 1.4,
1935
1950
  fontFamily: "inherit",
1936
- ...m(t)
1951
+ ...h(t)
1937
1952
  },
1938
1953
  children: e
1939
1954
  });
1940
1955
  }
1941
- function ft({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1956
+ function mt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1942
1957
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1943
- return /* @__PURE__ */ l("div", {
1958
+ return /* @__PURE__ */ u("div", {
1944
1959
  ref: r,
1945
1960
  style: {
1946
1961
  display: "grid",
1947
1962
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1948
1963
  gap: 16,
1949
1964
  width: "100%",
1950
- ...m(n)
1965
+ ...h(n)
1951
1966
  },
1952
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ l("div", {
1967
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
1953
1968
  style: { minWidth: 0 },
1954
1969
  children: i?.[`cell-${t}`] ?? null
1955
1970
  }, t))
1956
1971
  });
1957
1972
  }
1958
- function pt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: o, titleField: c = "name", textField: d, custom: f, templateId: p, style: h, nodeRef: g }) {
1959
- let { tenant: _, apiUrl: v } = n(V), y = n(U), b = n(H)?.[e], [x, S] = s(null);
1960
- if (r(() => {
1961
- if (!e || b) return;
1962
- let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
1963
- return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload.filter((e) => e && typeof e == "object") : [])).catch(() => t && S([])), () => {
1973
+ function ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, style: m, nodeRef: g }) {
1974
+ let { tenant: _, apiUrl: v, locale: y } = r(H), b = r(W), x = r(U)?.[e], [S, C] = c(null);
1975
+ if (i(() => {
1976
+ if (!e || x) return;
1977
+ let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${y ? `?locale=${encodeURIComponent(y)}` : ""}`;
1978
+ return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
1979
+ let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
1980
+ return t && C(n.filter((e) => e && typeof e == "object"));
1981
+ }).catch(() => t && C([])), () => {
1964
1982
  t = !1;
1965
1983
  };
1966
1984
  }, [
1967
1985
  e,
1968
1986
  _,
1969
1987
  v,
1970
- b
1988
+ y,
1989
+ x
1971
1990
  ]), !e) return null;
1972
- let C = (b ?? x ?? []).slice(0, Math.max(1, Number(t) || 6)), w = Math.min(Math.max(Number(a) || 3, 1), 6), T = i === "list" ? {
1991
+ let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = n === "list" ? {
1973
1992
  display: "flex",
1974
1993
  flexDirection: "column",
1975
1994
  gap: 20
1976
1995
  } : {
1977
1996
  display: "grid",
1978
- gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
1997
+ gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
1979
1998
  gap: 24
1980
1999
  };
1981
- return f && p && y?.render ? /* @__PURE__ */ l("div", {
2000
+ return f && p && b?.render ? /* @__PURE__ */ u("div", {
1982
2001
  ref: g,
1983
2002
  style: {
1984
2003
  width: "100%",
1985
- ...T,
1986
- ...m(h)
2004
+ ...E,
2005
+ ...h(m)
1987
2006
  },
1988
- children: C.map((e) => /* @__PURE__ */ l("div", {
2007
+ children: w.map((e) => /* @__PURE__ */ u("div", {
1989
2008
  style: { minWidth: 0 },
1990
- children: y.render(p, (t) => ce(t, e))
2009
+ children: b.render(p, (t) => le(t, e))
1991
2010
  }, e.id ?? e?.data?.slug))
1992
- }) : /* @__PURE__ */ l("div", {
2011
+ }) : /* @__PURE__ */ u("div", {
1993
2012
  ref: g,
1994
2013
  style: {
1995
2014
  width: "100%",
1996
- ...T,
1997
- ...m(h)
2015
+ ...E,
2016
+ ...h(m)
1998
2017
  },
1999
- children: C.map((e) => {
2000
- let t = o ? W(e?.data, o) : null, n = c ? K(W(e?.data, c)) : null, r = d ? W(e?.data, d) : null, a = Array.isArray(r) ? r : null, s = a || r == null ? null : K(r), f = i === "list";
2001
- return /* @__PURE__ */ u("div", {
2018
+ children: w.map((e) => {
2019
+ let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = l ? G(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : K(i), f = n === "list";
2020
+ return /* @__PURE__ */ d("div", {
2002
2021
  style: {
2003
2022
  display: "flex",
2004
2023
  flexDirection: f ? "row" : "column",
@@ -2006,9 +2025,9 @@ function pt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2006
2025
  alignItems: f ? "center" : "stretch",
2007
2026
  minWidth: 0
2008
2027
  },
2009
- children: [t && /* @__PURE__ */ l("img", {
2028
+ children: [t && /* @__PURE__ */ u("img", {
2010
2029
  src: t,
2011
- alt: n ?? "",
2030
+ alt: r ?? "",
2012
2031
  style: {
2013
2032
  width: f ? 160 : "100%",
2014
2033
  aspectRatio: "3 / 2",
@@ -2017,34 +2036,34 @@ function pt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2017
2036
  flexShrink: 0,
2018
2037
  display: "block"
2019
2038
  }
2020
- }), /* @__PURE__ */ u("div", {
2039
+ }), /* @__PURE__ */ d("div", {
2021
2040
  style: { minWidth: 0 },
2022
2041
  children: [
2023
- n && /* @__PURE__ */ l("h3", {
2042
+ r && /* @__PURE__ */ u("h3", {
2024
2043
  style: {
2025
2044
  margin: 0,
2026
2045
  fontSize: 18,
2027
2046
  fontWeight: 700
2028
2047
  },
2029
- children: n
2048
+ children: r
2030
2049
  }),
2031
- s && /* @__PURE__ */ l("p", {
2050
+ c && /* @__PURE__ */ u("p", {
2032
2051
  style: {
2033
2052
  margin: "6px 0 0",
2034
2053
  fontSize: 14,
2035
2054
  lineHeight: 1.55,
2036
2055
  opacity: .75
2037
2056
  },
2038
- children: s
2057
+ children: c
2039
2058
  }),
2040
- a && /* @__PURE__ */ l("div", {
2059
+ a && /* @__PURE__ */ u("div", {
2041
2060
  style: {
2042
2061
  marginTop: 6,
2043
2062
  fontSize: 14,
2044
2063
  lineHeight: 1.55,
2045
2064
  opacity: .85
2046
2065
  },
2047
- children: Se(a)
2066
+ children: we(a)
2048
2067
  })
2049
2068
  ]
2050
2069
  })]
@@ -2052,12 +2071,12 @@ function pt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2052
2071
  })
2053
2072
  });
2054
2073
  }
2055
- function mt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2056
- return e.length ? /* @__PURE__ */ l("nav", {
2074
+ function gt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2075
+ return e.length ? /* @__PURE__ */ u("nav", {
2057
2076
  ref: r,
2058
2077
  "aria-label": "Breadcrumb",
2059
- style: { ...m(n) },
2060
- children: /* @__PURE__ */ l("ol", {
2078
+ style: { ...h(n) },
2079
+ children: /* @__PURE__ */ u("ol", {
2061
2080
  style: {
2062
2081
  display: "flex",
2063
2082
  flexWrap: "wrap",
@@ -2070,25 +2089,25 @@ function mt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2070
2089
  },
2071
2090
  children: e.map((n, r) => {
2072
2091
  let i = r === e.length - 1;
2073
- return /* @__PURE__ */ u("li", {
2092
+ return /* @__PURE__ */ d("li", {
2074
2093
  style: {
2075
2094
  display: "flex",
2076
2095
  alignItems: "center",
2077
2096
  gap: 8,
2078
2097
  minWidth: 0
2079
2098
  },
2080
- children: [r > 0 && /* @__PURE__ */ l("span", {
2099
+ children: [r > 0 && /* @__PURE__ */ u("span", {
2081
2100
  style: { opacity: .4 },
2082
2101
  "aria-hidden": !0,
2083
2102
  children: t
2084
- }), i || !n.href ? /* @__PURE__ */ l("span", {
2103
+ }), i || !n.href ? /* @__PURE__ */ u("span", {
2085
2104
  style: {
2086
2105
  fontWeight: i ? 600 : 400,
2087
2106
  opacity: i ? 1 : .7
2088
2107
  },
2089
2108
  "aria-current": i ? "page" : void 0,
2090
2109
  children: n.label
2091
- }) : /* @__PURE__ */ l("a", {
2110
+ }) : /* @__PURE__ */ u("a", {
2092
2111
  href: n.href,
2093
2112
  style: {
2094
2113
  color: "inherit",
@@ -2102,8 +2121,8 @@ function mt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2102
2121
  })
2103
2122
  }) : null;
2104
2123
  }
2105
- function ht({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2106
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
2124
+ function _t({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2125
+ let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
2107
2126
  display: "inline-flex",
2108
2127
  alignItems: "center",
2109
2128
  justifyContent: "center",
@@ -2117,7 +2136,7 @@ function ht({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2117
2136
  background: e ? "var(--page-accent, #111827)" : "transparent",
2118
2137
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2119
2138
  });
2120
- return /* @__PURE__ */ u("nav", {
2139
+ return /* @__PURE__ */ d("nav", {
2121
2140
  ref: a,
2122
2141
  "aria-label": "Pagination",
2123
2142
  style: {
@@ -2125,29 +2144,29 @@ function ht({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2125
2144
  flexWrap: "wrap",
2126
2145
  gap: 8,
2127
2146
  alignItems: "center",
2128
- ...m(i)
2147
+ ...h(i)
2129
2148
  },
2130
2149
  children: [
2131
- n && /* @__PURE__ */ l("a", {
2150
+ n && /* @__PURE__ */ u("a", {
2132
2151
  href: s > 1 ? c(s - 1) : "#",
2133
2152
  "aria-label": "Previous",
2134
2153
  style: {
2135
- ...d(!1),
2154
+ ...l(!1),
2136
2155
  opacity: s > 1 ? 1 : .4
2137
2156
  },
2138
2157
  children: "‹"
2139
2158
  }),
2140
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("a", {
2159
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2141
2160
  href: c(e),
2142
2161
  "aria-current": e === s ? "page" : void 0,
2143
- style: d(e === s),
2162
+ style: l(e === s),
2144
2163
  children: e
2145
2164
  }, e)),
2146
- n && /* @__PURE__ */ l("a", {
2165
+ n && /* @__PURE__ */ u("a", {
2147
2166
  href: s < o ? c(s + 1) : "#",
2148
2167
  "aria-label": "Next",
2149
2168
  style: {
2150
- ...d(!1),
2169
+ ...l(!1),
2151
2170
  opacity: s < o ? 1 : .4
2152
2171
  },
2153
2172
  children: "›"
@@ -2155,7 +2174,7 @@ function ht({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2155
2174
  ]
2156
2175
  });
2157
2176
  }
2158
- function gt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2177
+ function vt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2159
2178
  if (!t.length) return null;
2160
2179
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2161
2180
  width: 32,
@@ -2186,21 +2205,21 @@ function gt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2186
2205
  minWidth: 24
2187
2206
  }
2188
2207
  });
2189
- return /* @__PURE__ */ l("div", {
2208
+ return /* @__PURE__ */ u("div", {
2190
2209
  ref: a,
2191
2210
  style: {
2192
2211
  display: "flex",
2193
2212
  flexDirection: r ? "column" : "row",
2194
2213
  alignItems: r ? "stretch" : "flex-start",
2195
2214
  gap: r ? 4 : 8,
2196
- ...m(i)
2215
+ ...h(i)
2197
2216
  },
2198
2217
  children: t.map((t, n) => {
2199
2218
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
2200
- return /* @__PURE__ */ u(e, { children: [n > 0 && /* @__PURE__ */ l("div", {
2219
+ return /* @__PURE__ */ d(e, { children: [n > 0 && /* @__PURE__ */ u("div", {
2201
2220
  style: c(i <= o),
2202
2221
  "aria-hidden": !0
2203
- }), /* @__PURE__ */ u("div", {
2222
+ }), /* @__PURE__ */ d("div", {
2204
2223
  style: {
2205
2224
  display: "flex",
2206
2225
  flexDirection: r ? "row" : "column",
@@ -2209,19 +2228,19 @@ function gt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2209
2228
  minWidth: 0,
2210
2229
  textAlign: r ? "left" : "center"
2211
2230
  },
2212
- children: [/* @__PURE__ */ l("div", {
2231
+ children: [/* @__PURE__ */ u("div", {
2213
2232
  style: s(a),
2214
2233
  children: a === "done" ? "✓" : i
2215
- }), /* @__PURE__ */ u("div", {
2234
+ }), /* @__PURE__ */ d("div", {
2216
2235
  style: { minWidth: 0 },
2217
- children: [/* @__PURE__ */ l("div", {
2236
+ children: [/* @__PURE__ */ u("div", {
2218
2237
  style: {
2219
2238
  fontSize: 13,
2220
2239
  fontWeight: a === "active" ? 700 : 500,
2221
2240
  opacity: a === "todo" ? .6 : 1
2222
2241
  },
2223
2242
  children: t.label
2224
- }), t.description && /* @__PURE__ */ l("div", {
2243
+ }), t.description && /* @__PURE__ */ u("div", {
2225
2244
  style: {
2226
2245
  fontSize: 12,
2227
2246
  opacity: .6
@@ -2233,7 +2252,7 @@ function gt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2233
2252
  })
2234
2253
  });
2235
2254
  }
2236
- var _t = {
2255
+ var yt = {
2237
2256
  small: {
2238
2257
  w: 132,
2239
2258
  h: 46,
@@ -2255,10 +2274,10 @@ var _t = {
2255
2274
  title: 12.5,
2256
2275
  avatar: 46
2257
2276
  }
2258
- }, vt = (e) => _t[e] ?? _t.medium;
2259
- _t.medium.w, _t.medium.h;
2260
- function yt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2261
- let r = vt(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 = [];
2277
+ }, bt = (e) => yt[e] ?? yt.medium;
2278
+ yt.medium.w, yt.medium.h;
2279
+ function xt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2280
+ 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 = [];
2262
2281
  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);
2263
2282
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2264
2283
  if (t.has(e.id)) return 0;
@@ -2310,18 +2329,18 @@ function yt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2310
2329
  horizontal: n
2311
2330
  };
2312
2331
  }
2313
- var bt = (e, t) => {
2332
+ var St = (e, t) => {
2314
2333
  let n = String(e ?? "");
2315
2334
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2316
- }, xt = (e) => {
2335
+ }, Ct = (e) => {
2317
2336
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2318
2337
  if (!t) return "#ffffff";
2319
2338
  let n = t[1];
2320
2339
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2321
2340
  let r = parseInt(n, 16);
2322
2341
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2323
- }, St = (e) => !!(e?.cv?.trim?.() || e?.photo);
2324
- function Ct(e, t = {}) {
2342
+ }, wt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2343
+ function Tt(e, t = {}) {
2325
2344
  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 ? "" : K(e);
2326
2345
  return n.map((e) => {
2327
2346
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -2336,15 +2355,15 @@ function Ct(e, t = {}) {
2336
2355
  };
2337
2356
  });
2338
2357
  }
2339
- var wt = {
2358
+ var Et = {
2340
2359
  size: 36,
2341
2360
  pad: 10
2342
2361
  };
2343
- function Tt({ node: e, onClose: t }) {
2344
- return r(() => {
2362
+ function Dt({ node: e, onClose: t }) {
2363
+ return i(() => {
2345
2364
  let e = (e) => e.key === "Escape" && t();
2346
2365
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2347
- }, [t]), /* @__PURE__ */ l("div", {
2366
+ }, [t]), /* @__PURE__ */ u("div", {
2348
2367
  onClick: t,
2349
2368
  role: "dialog",
2350
2369
  "aria-modal": "true",
@@ -2359,7 +2378,7 @@ function Tt({ node: e, onClose: t }) {
2359
2378
  justifyContent: "center",
2360
2379
  padding: 16
2361
2380
  },
2362
- children: /* @__PURE__ */ u("div", {
2381
+ children: /* @__PURE__ */ d("div", {
2363
2382
  onClick: (e) => e.stopPropagation(),
2364
2383
  style: {
2365
2384
  background: "var(--page-bg, #ffffff)",
@@ -2374,7 +2393,7 @@ function Tt({ node: e, onClose: t }) {
2374
2393
  boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
2375
2394
  },
2376
2395
  children: [
2377
- /* @__PURE__ */ l("button", {
2396
+ /* @__PURE__ */ u("button", {
2378
2397
  type: "button",
2379
2398
  "aria-label": "Close",
2380
2399
  onClick: t,
@@ -2395,14 +2414,14 @@ function Tt({ node: e, onClose: t }) {
2395
2414
  },
2396
2415
  children: "×"
2397
2416
  }),
2398
- /* @__PURE__ */ u("div", {
2417
+ /* @__PURE__ */ d("div", {
2399
2418
  style: {
2400
2419
  display: "flex",
2401
2420
  alignItems: "center",
2402
2421
  gap: 14,
2403
2422
  marginBottom: e.cv ? 14 : 0
2404
2423
  },
2405
- children: [e.photo && /* @__PURE__ */ l("img", {
2424
+ children: [e.photo && /* @__PURE__ */ u("img", {
2406
2425
  src: e.photo,
2407
2426
  alt: "",
2408
2427
  style: {
@@ -2412,15 +2431,15 @@ function Tt({ node: e, onClose: t }) {
2412
2431
  objectFit: "cover",
2413
2432
  flexShrink: 0
2414
2433
  }
2415
- }), /* @__PURE__ */ u("div", {
2434
+ }), /* @__PURE__ */ d("div", {
2416
2435
  style: { minWidth: 0 },
2417
- children: [/* @__PURE__ */ l("div", {
2436
+ children: [/* @__PURE__ */ u("div", {
2418
2437
  style: {
2419
2438
  fontSize: 18,
2420
2439
  fontWeight: 700
2421
2440
  },
2422
2441
  children: e.name
2423
- }), e.title && /* @__PURE__ */ l("div", {
2442
+ }), e.title && /* @__PURE__ */ u("div", {
2424
2443
  style: {
2425
2444
  fontSize: 13,
2426
2445
  opacity: .65
@@ -2429,7 +2448,7 @@ function Tt({ node: e, onClose: t }) {
2429
2448
  })]
2430
2449
  })]
2431
2450
  }),
2432
- e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ l("p", {
2451
+ e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ u("p", {
2433
2452
  style: {
2434
2453
  fontSize: 14,
2435
2454
  lineHeight: 1.6,
@@ -2437,7 +2456,7 @@ function Tt({ node: e, onClose: t }) {
2437
2456
  },
2438
2457
  children: e
2439
2458
  }, t)),
2440
- e.href && /* @__PURE__ */ l("a", {
2459
+ e.href && /* @__PURE__ */ u("a", {
2441
2460
  href: e.href,
2442
2461
  target: "_blank",
2443
2462
  rel: "noopener noreferrer",
@@ -2458,9 +2477,9 @@ function Tt({ node: e, onClose: t }) {
2458
2477
  })
2459
2478
  });
2460
2479
  }
2461
- function Et({ nodes: e = [], source: t, nameField: a, titleField: o, photoField: d, parentField: f, cvField: p, hrefField: h, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2462
- let x = i(), [S, C] = s(null), { tenant: w, apiUrl: T } = n(V), E = n(H)?.[t], [D, O] = s(null);
2463
- r(() => {
2480
+ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2481
+ let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(H), E = r(U)?.[t], [D, O] = c(null);
2482
+ i(() => {
2464
2483
  if (!t || E) return;
2465
2484
  let e = !0;
2466
2485
  return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
@@ -2475,18 +2494,18 @@ function Et({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2475
2494
  T,
2476
2495
  E
2477
2496
  ]);
2478
- let k = t ? Ct(E ?? D ?? [], {
2479
- nameField: a,
2497
+ let k = t ? Tt(E ?? D ?? [], {
2498
+ nameField: n,
2480
2499
  titleField: o,
2481
- photoField: d,
2500
+ photoField: s,
2482
2501
  parentField: f,
2483
2502
  cvField: p,
2484
- hrefField: h
2485
- }) : e, A = vt(g), { boxes: j, links: M, width: N, height: P } = yt(k, {
2503
+ hrefField: m
2504
+ }) : e, A = bt(g), { boxes: j, links: M, width: N, height: P } = xt(k, {
2486
2505
  size: g,
2487
2506
  horizontal: _
2488
2507
  });
2489
- if (!j.length) return !b && t ? /* @__PURE__ */ u("div", {
2508
+ if (!j.length) return !b && t ? /* @__PURE__ */ d("div", {
2490
2509
  ref: y,
2491
2510
  style: {
2492
2511
  padding: 18,
@@ -2495,7 +2514,7 @@ function Et({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2495
2514
  fontSize: 13,
2496
2515
  opacity: .7,
2497
2516
  textAlign: "center",
2498
- ...m(v)
2517
+ ...h(v)
2499
2518
  },
2500
2519
  children: [
2501
2520
  "Org Chart — no published entries in “",
@@ -2504,14 +2523,14 @@ function Et({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2504
2523
  ]
2505
2524
  }) : null;
2506
2525
  let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
2507
- return /* @__PURE__ */ u("div", {
2526
+ return /* @__PURE__ */ d("div", {
2508
2527
  ref: y,
2509
2528
  style: {
2510
2529
  maxWidth: "100%",
2511
2530
  overflowX: "auto",
2512
- ...m(v)
2531
+ ...h(v)
2513
2532
  },
2514
- children: [/* @__PURE__ */ u("svg", {
2533
+ children: [/* @__PURE__ */ d("svg", {
2515
2534
  viewBox: `0 0 ${N} ${P}`,
2516
2535
  role: "img",
2517
2536
  "aria-label": "Organization chart",
@@ -2522,64 +2541,64 @@ function Et({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2522
2541
  height: "auto",
2523
2542
  margin: "0 auto"
2524
2543
  },
2525
- children: [M.map((e, t) => /* @__PURE__ */ l("path", {
2544
+ children: [M.map((e, t) => /* @__PURE__ */ u("path", {
2526
2545
  d: _ ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
2527
2546
  fill: "none",
2528
2547
  stroke: "rgba(148, 163, 184, 0.7)",
2529
2548
  strokeWidth: "1.5"
2530
2549
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2531
- 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 ? xt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", d = i ? xt(e.color2) : s, f = b && (St(e) || e.href), p = () => St(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + wt.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);
2532
- return /* @__PURE__ */ u("g", {
2550
+ 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 ? Ct(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ct(e.color2) : s, f = b && (wt(e) || e.href), p = () => wt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Et.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);
2551
+ return /* @__PURE__ */ d("g", {
2533
2552
  onClick: f ? p : void 0,
2534
2553
  style: f ? { cursor: "pointer" } : void 0,
2535
2554
  role: f ? "button" : void 0,
2536
2555
  "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
2537
2556
  children: [
2538
- i && e.gradient ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("linearGradient", {
2557
+ i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
2539
2558
  id: `${x}-${e.id}-grad`,
2540
2559
  x1: "0",
2541
2560
  y1: "0",
2542
2561
  x2: "0",
2543
2562
  y2: "1",
2544
- children: [/* @__PURE__ */ l("stop", {
2563
+ children: [/* @__PURE__ */ u("stop", {
2545
2564
  offset: "0%",
2546
2565
  stopColor: e.color || "var(--page-accent, #4f46e5)"
2547
- }), /* @__PURE__ */ l("stop", {
2566
+ }), /* @__PURE__ */ u("stop", {
2548
2567
  offset: "100%",
2549
2568
  stopColor: e.color2
2550
2569
  })]
2551
- }), /* @__PURE__ */ l("rect", {
2570
+ }), /* @__PURE__ */ u("rect", {
2552
2571
  x: t,
2553
2572
  y: n,
2554
2573
  width: A.w,
2555
2574
  height: A.h,
2556
2575
  rx: "10",
2557
2576
  fill: `url(#${x}-${e.id}-grad)`
2558
- })] }) : i ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2577
+ })] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2559
2578
  id: `${x}-${e.id}-box`,
2560
- children: /* @__PURE__ */ l("rect", {
2579
+ children: /* @__PURE__ */ u("rect", {
2561
2580
  x: t,
2562
2581
  y: n,
2563
2582
  width: A.w,
2564
2583
  height: A.h,
2565
2584
  rx: "10"
2566
2585
  })
2567
- }), /* @__PURE__ */ u("g", {
2586
+ }), /* @__PURE__ */ d("g", {
2568
2587
  clipPath: `url(#${x}-${e.id}-box)`,
2569
- children: [/* @__PURE__ */ l("rect", {
2588
+ children: [/* @__PURE__ */ u("rect", {
2570
2589
  x: t,
2571
2590
  y: n,
2572
2591
  width: A.w,
2573
2592
  height: _,
2574
2593
  fill: o
2575
- }), /* @__PURE__ */ l("rect", {
2594
+ }), /* @__PURE__ */ u("rect", {
2576
2595
  x: t,
2577
2596
  y: n + _,
2578
2597
  width: A.w,
2579
2598
  height: A.h - _,
2580
2599
  fill: e.color2
2581
2600
  })]
2582
- })] }) : /* @__PURE__ */ l("rect", {
2601
+ })] }) : /* @__PURE__ */ u("rect", {
2583
2602
  x: t,
2584
2603
  y: n,
2585
2604
  width: A.w,
@@ -2589,94 +2608,94 @@ function Et({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2589
2608
  stroke: a ? "none" : "var(--page-accent, #4f46e5)",
2590
2609
  strokeWidth: a ? 0 : 1.5
2591
2610
  }),
2592
- e.photo && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2611
+ e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2593
2612
  id: `${x}-${e.id}`,
2594
- children: /* @__PURE__ */ l("circle", {
2595
- cx: t + wt.pad + A.avatar / 2,
2613
+ children: /* @__PURE__ */ u("circle", {
2614
+ cx: t + Et.pad + A.avatar / 2,
2596
2615
  cy: n + A.h / 2,
2597
2616
  r: A.avatar / 2
2598
2617
  })
2599
- }), /* @__PURE__ */ l("image", {
2618
+ }), /* @__PURE__ */ u("image", {
2600
2619
  href: e.photo,
2601
- x: t + wt.pad,
2620
+ x: t + Et.pad,
2602
2621
  y: n + (A.h - A.avatar) / 2,
2603
2622
  width: A.avatar,
2604
2623
  height: A.avatar,
2605
2624
  preserveAspectRatio: "xMidYMid slice",
2606
2625
  clipPath: `url(#${x}-${e.id})`
2607
2626
  })] }),
2608
- i && !e.gradient ? /* @__PURE__ */ u(c, { children: [e.title && /* @__PURE__ */ l("text", {
2627
+ i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
2609
2628
  x: m,
2610
2629
  y: n + _ / 2 + A.title * .35,
2611
2630
  textAnchor: h,
2612
2631
  fontSize: A.title,
2613
2632
  fontWeight: "600",
2614
2633
  fill: s,
2615
- children: bt(e.title, g + 4)
2616
- }), e.name && /* @__PURE__ */ l("text", {
2634
+ children: St(e.title, g + 4)
2635
+ }), e.name && /* @__PURE__ */ u("text", {
2617
2636
  x: m,
2618
2637
  y: n + _ + _ / 2 + A.name * .35,
2619
2638
  textAnchor: h,
2620
2639
  fontSize: A.name,
2621
2640
  fontWeight: "600",
2622
- fill: d,
2623
- children: bt(e.name, g)
2624
- })] }) : /* @__PURE__ */ u(c, { children: [v[0] && /* @__PURE__ */ l("text", {
2641
+ fill: c,
2642
+ children: St(e.name, g)
2643
+ })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
2625
2644
  x: m,
2626
2645
  y: n + (v[1] ? A.h * .43 : A.h * .57),
2627
2646
  textAnchor: h,
2628
2647
  fontSize: A.name,
2629
2648
  fontWeight: "600",
2630
2649
  fill: s,
2631
- children: bt(v[0], g)
2632
- }), v[1] && /* @__PURE__ */ l("text", {
2650
+ children: St(v[0], g)
2651
+ }), v[1] && /* @__PURE__ */ u("text", {
2633
2652
  x: m,
2634
2653
  y: n + A.h * .73,
2635
2654
  textAnchor: h,
2636
2655
  fontSize: A.title,
2637
2656
  opacity: "0.7",
2638
2657
  fill: s,
2639
- children: bt(v[1], g + 4)
2658
+ children: St(v[1], g + 4)
2640
2659
  })] })
2641
2660
  ]
2642
2661
  }, e.id);
2643
2662
  })]
2644
- }), S && /* @__PURE__ */ l(Tt, {
2663
+ }), S && /* @__PURE__ */ u(Dt, {
2645
2664
  node: S,
2646
2665
  onClose: () => C(null)
2647
2666
  })]
2648
2667
  });
2649
2668
  }
2650
- function Dt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: o = !0, bordered: c = !1, compact: d = !1, style: f, nodeRef: p }) {
2651
- let { tenant: h, apiUrl: g } = n(V), _ = n(H)?.[i], [v, y] = s(null);
2652
- if (r(() => {
2653
- if (!i || _) return;
2654
- let e = !0, t = i.startsWith("api:") ? `${g}/data/${encodeURIComponent(i.slice(4))}` : `${g}/dynamic/${encodeURIComponent(i)}`;
2655
- return fetch(t, { headers: h ? { "x-tenant": h } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
2669
+ function kt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, style: f, nodeRef: p }) {
2670
+ let { tenant: m, apiUrl: g } = r(H), _ = r(U)?.[n], [v, y] = c(null);
2671
+ if (i(() => {
2672
+ if (!n || _) return;
2673
+ let e = !0, t = n.startsWith("api:") ? `${g}/data/${encodeURIComponent(n.slice(4))}` : `${g}/dynamic/${encodeURIComponent(n)}`;
2674
+ return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
2656
2675
  e = !1;
2657
2676
  };
2658
2677
  }, [
2659
- i,
2660
- h,
2678
+ n,
2679
+ m,
2661
2680
  g,
2662
2681
  _
2663
2682
  ]), !e.length) return null;
2664
- let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(W(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = c ? { border: C } : { borderBottom: C };
2665
- return /* @__PURE__ */ l("div", {
2683
+ let b = n ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, S = l ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: C } : { borderBottom: C };
2684
+ return /* @__PURE__ */ u("div", {
2666
2685
  ref: p,
2667
2686
  style: {
2668
2687
  width: "100%",
2669
2688
  overflowX: "auto",
2670
- ...m(f)
2689
+ ...h(f)
2671
2690
  },
2672
- children: /* @__PURE__ */ u("table", {
2691
+ children: /* @__PURE__ */ d("table", {
2673
2692
  style: {
2674
2693
  width: "100%",
2675
2694
  borderCollapse: "collapse",
2676
2695
  fontSize: 14,
2677
- ...c ? { border: C } : {}
2696
+ ...s ? { border: C } : {}
2678
2697
  },
2679
- children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((e, t) => /* @__PURE__ */ l("th", {
2698
+ children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
2680
2699
  style: {
2681
2700
  textAlign: "left",
2682
2701
  fontWeight: 600,
@@ -2685,9 +2704,9 @@ function Dt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2685
2704
  ...w
2686
2705
  },
2687
2706
  children: e.label ?? e
2688
- }, t)) }) }), /* @__PURE__ */ l("tbody", { children: x.map((t, n) => /* @__PURE__ */ l("tr", {
2707
+ }, t)) }) }), /* @__PURE__ */ u("tbody", { children: x.map((t, n) => /* @__PURE__ */ u("tr", {
2689
2708
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2690
- children: e.map((e, n) => /* @__PURE__ */ l("td", {
2709
+ children: e.map((e, n) => /* @__PURE__ */ u("td", {
2691
2710
  style: {
2692
2711
  padding: S,
2693
2712
  ...w
@@ -2698,56 +2717,311 @@ function Dt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2698
2717
  })
2699
2718
  });
2700
2719
  }
2701
- var Ot = {
2702
- PageRoot: pe,
2703
- Section: me,
2704
- Container: he,
2705
- Heading: ge,
2706
- TextBlock: De,
2707
- ButtonBlock: Ae,
2708
- ImageBlock: je,
2709
- Spacer: Le,
2710
- Divider: Re,
2711
- SliderBlock: We,
2712
- CanvasSlider: Ge,
2713
- TabsBlock: Je,
2714
- QuickStack: ft,
2715
- CollectionList: pt,
2716
- BreadcrumbsBlock: mt,
2717
- PaginationBlock: ht,
2718
- StepperBlock: gt,
2719
- OrgChartBlock: Et,
2720
- TableBlock: Dt,
2721
- AccordionBlock: Ye,
2722
- NavbarBlock: qe,
2723
- ListBlock: Ee,
2724
- TextSpan: ye,
2725
- QuoteBlock: Te,
2726
- TextLink: ke,
2727
- RichTextBlock: Ce,
2728
- RichContentBlock: Ce,
2729
- VideoBlock: Me,
2730
- YouTubeBlock: Pe,
2731
- IframeBlock: Fe,
2732
- EmbedBlock: Ie,
2733
- FormBlock: it,
2734
- FormLabel: at,
2735
- FormInput: ot,
2736
- FormTextarea: st,
2737
- FormCheckbox: (e) => /* @__PURE__ */ l(ct, {
2720
+ var At = {
2721
+ PageRoot: he,
2722
+ Section: ge,
2723
+ Container: _e,
2724
+ Heading: ve,
2725
+ TextBlock: ke,
2726
+ ButtonBlock: Me,
2727
+ ImageBlock: Ne,
2728
+ Spacer: ze,
2729
+ Divider: Be,
2730
+ SliderBlock: Ke,
2731
+ CanvasSlider: qe,
2732
+ TabsBlock: Ze,
2733
+ QuickStack: mt,
2734
+ CollectionList: ht,
2735
+ BreadcrumbsBlock: gt,
2736
+ PaginationBlock: _t,
2737
+ StepperBlock: vt,
2738
+ OrgChartBlock: Ot,
2739
+ TableBlock: kt,
2740
+ AccordionBlock: Qe,
2741
+ NavbarBlock: Xe,
2742
+ ListBlock: Oe,
2743
+ TextSpan: xe,
2744
+ QuoteBlock: De,
2745
+ TextLink: je,
2746
+ RichTextBlock: Te,
2747
+ RichContentBlock: Te,
2748
+ VideoBlock: Pe,
2749
+ YouTubeBlock: Ie,
2750
+ IframeBlock: Le,
2751
+ EmbedBlock: Re,
2752
+ FormBlock: ot,
2753
+ FormLabel: st,
2754
+ FormInput: ct,
2755
+ FormTextarea: lt,
2756
+ FormCheckbox: (e) => /* @__PURE__ */ u(ut, {
2738
2757
  kind: "checkbox",
2739
2758
  ...e
2740
2759
  }),
2741
- FormRadio: (e) => /* @__PURE__ */ l(ct, {
2760
+ FormRadio: (e) => /* @__PURE__ */ u(ut, {
2742
2761
  kind: "radio",
2743
2762
  ...e
2744
2763
  }),
2745
- FormSelect: lt,
2746
- FormFile: ut,
2747
- FormSubmit: dt
2764
+ FormSelect: dt,
2765
+ FormFile: ft,
2766
+ FormSubmit: pt
2767
+ }, jt = {
2768
+ id: "auth",
2769
+ label: "Accounts",
2770
+ category: "Apps",
2771
+ keys: ["SiteLoginForm", "SiteAccountMenu"],
2772
+ ssr: "shell",
2773
+ settings: ["apps.auth.redirect"]
2774
+ }, Mt = t({
2775
+ user: null,
2776
+ status: "loading",
2777
+ refresh: () => {},
2778
+ signOut: () => {}
2779
+ }), Nt = () => r(Mt);
2780
+ function Pt({ children: e, initialUser: t, disabled: a, apiUrl: s, tenant: l }) {
2781
+ let d = r(H), f = s || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : a ? "guest" : "loading"), v = n((e, t) => fetch(`${f}${e}`, {
2782
+ ...t,
2783
+ credentials: "include",
2784
+ headers: {
2785
+ "content-type": "application/json",
2786
+ ...p ? { "x-tenant": p } : {},
2787
+ ...t?.headers
2788
+ }
2789
+ }), [f, p]), y = n(() => a ? Promise.resolve(null) : v("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
2790
+ let t = e?.payload ?? null;
2791
+ return h(t), _(t ? "user" : "guest"), t;
2792
+ }).catch(() => (h(null), _("guest"), null)), [v, a]), b = n(() => v("/site/logout", { method: "post" }).catch(() => {}).then(() => {
2793
+ h(null), _("guest");
2794
+ }), [v]);
2795
+ i(() => {
2796
+ a || t || y();
2797
+ }, [
2798
+ a,
2799
+ t,
2800
+ y
2801
+ ]);
2802
+ let x = o(() => ({
2803
+ user: m,
2804
+ status: g,
2805
+ refresh: y,
2806
+ signOut: b
2807
+ }), [
2808
+ m,
2809
+ g,
2810
+ y,
2811
+ b
2812
+ ]);
2813
+ return /* @__PURE__ */ u(Mt.Provider, {
2814
+ value: x,
2815
+ children: e
2816
+ });
2817
+ }
2818
+ function Ft({ when: e, children: t }) {
2819
+ let { status: n } = Nt();
2820
+ return !e || e === "always" ? t : n === "loading" ? null : e === "user" == (n === "user") ? t : null;
2821
+ }
2822
+ //#endregion
2823
+ //#region ../ui/src/components/builder/apps/auth/views.jsx
2824
+ function It({ 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 }) {
2825
+ let { tenant: g, apiUrl: _, settings: v } = r(H), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
2826
+ if (e.preventDefault(), f) return;
2827
+ let n = new FormData(e.currentTarget);
2828
+ w(!0), S("");
2829
+ try {
2830
+ let e = await fetch(`${_ || "/api"}/site/${T ? "register" : "login"}`, {
2831
+ method: "post",
2832
+ headers: {
2833
+ "content-type": "application/json",
2834
+ ...g ? { "x-tenant": g } : {}
2835
+ },
2836
+ credentials: "same-origin",
2837
+ body: JSON.stringify({
2838
+ email: n.get("email"),
2839
+ password: n.get("password"),
2840
+ ...T ? { name: n.get("name") || "" } : {}
2841
+ })
2842
+ }), r = await e.json().catch(() => null);
2843
+ if (!e.ok || r?.success === !1) {
2844
+ S(r?.error?.message || "Sign-in failed"), b("error"), w(!1);
2845
+ return;
2846
+ }
2847
+ if (b("success"), typeof window < "u") {
2848
+ let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(v?.["apps.auth.redirect"]) || "/";
2849
+ window.location.assign(e);
2850
+ }
2851
+ } catch {
2852
+ S("Sign-in failed"), b("error"), w(!1);
2853
+ }
2854
+ };
2855
+ return /* @__PURE__ */ d("div", {
2856
+ ref: l,
2857
+ style: {
2858
+ display: "grid",
2859
+ gap: 12,
2860
+ maxWidth: 360,
2861
+ ...h(s)
2862
+ },
2863
+ children: [
2864
+ /* @__PURE__ */ d("form", {
2865
+ onSubmit: O,
2866
+ style: {
2867
+ display: E === "form" ? "grid" : "none",
2868
+ gap: 10
2869
+ },
2870
+ children: [
2871
+ T ? /* @__PURE__ */ d("label", {
2872
+ style: {
2873
+ ...X,
2874
+ display: "grid",
2875
+ gap: 6
2876
+ },
2877
+ children: [a, /* @__PURE__ */ u("input", {
2878
+ name: "name",
2879
+ type: "text",
2880
+ style: Z,
2881
+ ...Q(f)
2882
+ })]
2883
+ }) : null,
2884
+ /* @__PURE__ */ d("label", {
2885
+ style: {
2886
+ ...X,
2887
+ display: "grid",
2888
+ gap: 6
2889
+ },
2890
+ children: [n, /* @__PURE__ */ u("input", {
2891
+ name: "email",
2892
+ type: "email",
2893
+ required: !f,
2894
+ style: Z,
2895
+ ...Q(f)
2896
+ })]
2897
+ }),
2898
+ /* @__PURE__ */ d("label", {
2899
+ style: {
2900
+ ...X,
2901
+ display: "grid",
2902
+ gap: 6
2903
+ },
2904
+ children: [i, /* @__PURE__ */ u("input", {
2905
+ name: "password",
2906
+ type: "password",
2907
+ required: !f,
2908
+ style: Z,
2909
+ ...Q(f)
2910
+ })]
2911
+ }),
2912
+ /* @__PURE__ */ u("button", {
2913
+ type: f ? "button" : "submit",
2914
+ disabled: C || void 0,
2915
+ style: {
2916
+ ...J,
2917
+ border: 0,
2918
+ padding: "10px 22px",
2919
+ borderRadius: 8,
2920
+ fontSize: 15,
2921
+ fontWeight: 600,
2922
+ cursor: "pointer",
2923
+ opacity: C ? .6 : 1
2924
+ },
2925
+ children: o || (T ? "Create account" : "Sign in")
2926
+ }),
2927
+ x ? /* @__PURE__ */ u("p", {
2928
+ style: {
2929
+ margin: 0,
2930
+ fontSize: 14,
2931
+ color: "#dc2626"
2932
+ },
2933
+ children: x
2934
+ }) : null
2935
+ ]
2936
+ }),
2937
+ /* @__PURE__ */ u("div", {
2938
+ style: { display: E === "success" ? "block" : "none" },
2939
+ children: p?.success ?? null
2940
+ }),
2941
+ /* @__PURE__ */ u("div", {
2942
+ style: { display: E === "error" ? "block" : "none" },
2943
+ children: p?.error ?? null
2944
+ })
2945
+ ]
2946
+ });
2947
+ }
2948
+ function Lt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
2949
+ let { user: c, status: l, signOut: f } = Nt(), p = a ? s || "user" : l, m = a ? {
2950
+ name: "Ada Lovelace",
2951
+ email: "ada@example.com"
2952
+ } : c;
2953
+ return p === "loading" ? /* @__PURE__ */ u("div", {
2954
+ ref: i,
2955
+ style: {
2956
+ minHeight: 24,
2957
+ ...h(r)
2958
+ }
2959
+ }) : p === "user" ? /* @__PURE__ */ d("div", {
2960
+ ref: i,
2961
+ style: {
2962
+ display: "flex",
2963
+ alignItems: "center",
2964
+ gap: 10,
2965
+ ...h(r)
2966
+ },
2967
+ children: [
2968
+ /* @__PURE__ */ d("span", {
2969
+ style: {
2970
+ ...X,
2971
+ fontWeight: 600
2972
+ },
2973
+ children: [
2974
+ e,
2975
+ " ",
2976
+ m?.name || m?.email || ""
2977
+ ]
2978
+ }),
2979
+ n && m?.email ? /* @__PURE__ */ u("span", {
2980
+ style: {
2981
+ ...X,
2982
+ opacity: .7
2983
+ },
2984
+ children: m.email
2985
+ }) : null,
2986
+ /* @__PURE__ */ u("button", {
2987
+ type: "button",
2988
+ onClick: a ? void 0 : f,
2989
+ style: {
2990
+ ...J,
2991
+ border: 0,
2992
+ padding: "8px 16px",
2993
+ borderRadius: 8,
2994
+ fontSize: 14,
2995
+ cursor: a ? "default" : "pointer"
2996
+ },
2997
+ ...Q(a),
2998
+ children: t
2999
+ })
3000
+ ]
3001
+ }) : /* @__PURE__ */ u("div", {
3002
+ ref: i,
3003
+ style: {
3004
+ display: "flex",
3005
+ alignItems: "center",
3006
+ gap: 10,
3007
+ ...h(r)
3008
+ },
3009
+ children: o?.signedOut ?? null
3010
+ });
3011
+ }
3012
+ //#endregion
3013
+ //#region ../ui/src/components/builder/apps/index.js
3014
+ var Rt = [jt], zt = {
3015
+ SiteLoginForm: It,
3016
+ SiteAccountMenu: Lt
2748
3017
  };
3018
+ new Set(Rt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
2749
3019
  //#endregion
2750
3020
  //#region ../ui/src/components/builder/render.jsx
3021
+ var Bt = {
3022
+ ...At,
3023
+ ...zt
3024
+ };
2751
3025
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2752
3026
  let o = n[t];
2753
3027
  if (!o || o.hidden) return null;
@@ -2756,97 +3030,110 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2756
3030
  let n = o.props?.componentId, s = r?.[n];
2757
3031
  if (!s?.template || i.has(n)) return null;
2758
3032
  let c = new Set(i).add(n);
2759
- return /* @__PURE__ */ l(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
3033
+ return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
2760
3034
  }
2761
- let u = Ot[s];
2762
- if (!u) return null;
2763
- let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0;
2764
- return /* @__PURE__ */ l(u, {
3035
+ let l = Bt[s];
3036
+ if (!l) return null;
3037
+ let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
2765
3038
  ...c,
2766
3039
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2767
3040
  linked: p,
2768
3041
  nodeRef: (e) => {
2769
- e && (e.setAttribute("data-wb", t), v(e, c));
3042
+ e && (e.setAttribute("data-wb", t), y(e, c));
2770
3043
  },
2771
3044
  children: d.length ? d : void 0
2772
3045
  }, t);
3046
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(Ft, {
3047
+ when: c.when,
3048
+ children: m
3049
+ }, t) : m;
2773
3050
  }
2774
3051
  //#endregion
2775
3052
  //#region ../ui/src/components/builder/PageRenderer.jsx
2776
- var kt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2777
- function At({ blocks: e, theme: t, components: n, mode: i = "auto", style: o, custom: s, tenant: c, apiUrl: d, datasets: f, locale: p, direction: m }) {
2778
- let h = s?.js?.trim();
2779
- if (r(() => {
2780
- if (!h) return;
3053
+ var Vt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3054
+ function Ht({ 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: g }) {
3055
+ let _ = s?.js?.trim();
3056
+ if (i(() => {
3057
+ if (!_) return;
2781
3058
  let e = document.createElement("script");
2782
- return e.text = h, document.body.appendChild(e), () => e.remove();
2783
- }, [h]), !e?.ROOT) return null;
2784
- let g = {
3059
+ return e.text = _, document.body.appendChild(e), () => e.remove();
3060
+ }, [_]), !e?.ROOT) return null;
3061
+ let v = {
2785
3062
  lang: p || void 0,
2786
3063
  dir: oe(m, p)
2787
- }, _ = {
3064
+ }, y = {
2788
3065
  minHeight: "100%",
2789
3066
  display: "flex",
2790
3067
  flexDirection: "column"
2791
- }, v = $("ROOT", e, n), y = a(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), b = E(e, n), x = T(e, n), S = s?.css?.trim(), C = re(e, n).map((e) => /* @__PURE__ */ l("link", {
3068
+ }, b = $("ROOT", e, n), x = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), S = D(e, n), C = E(e, n), w = s?.css?.trim(), T = re(e, n).map((e) => /* @__PURE__ */ u("link", {
2792
3069
  rel: "stylesheet",
2793
3070
  precedence: "default",
2794
- href: ne(e)
3071
+ href: V(e)
2795
3072
  }, e));
2796
- if (i !== "auto") return /* @__PURE__ */ l(V.Provider, {
3073
+ if (r !== "auto") return /* @__PURE__ */ u(H.Provider, {
2797
3074
  value: {
2798
3075
  tenant: c || "",
2799
- apiUrl: d || "/api"
3076
+ apiUrl: l || "/api",
3077
+ locale: p || "",
3078
+ settings: h ?? null
2800
3079
  },
2801
- children: /* @__PURE__ */ l(H.Provider, {
2802
- value: f ?? null,
2803
- children: /* @__PURE__ */ l(U.Provider, {
2804
- value: y,
2805
- children: /* @__PURE__ */ u("div", {
2806
- ...g,
2807
- style: {
2808
- ..._,
2809
- ...I(t, i),
2810
- ...o
2811
- },
2812
- children: [
2813
- C,
2814
- b && /* @__PURE__ */ l("style", { children: b }),
2815
- x && /* @__PURE__ */ l("style", { children: x }),
2816
- S && /* @__PURE__ */ l("style", { children: S }),
2817
- v
2818
- ]
3080
+ children: /* @__PURE__ */ u(Pt, {
3081
+ initialUser: g,
3082
+ children: /* @__PURE__ */ u(U.Provider, {
3083
+ value: f ?? null,
3084
+ children: /* @__PURE__ */ u(W.Provider, {
3085
+ value: x,
3086
+ children: /* @__PURE__ */ d("div", {
3087
+ ...v,
3088
+ style: {
3089
+ ...y,
3090
+ ...L(t, r),
3091
+ ...a
3092
+ },
3093
+ children: [
3094
+ T,
3095
+ S && /* @__PURE__ */ u("style", { children: S }),
3096
+ C && /* @__PURE__ */ u("style", { children: C }),
3097
+ w && /* @__PURE__ */ u("style", { children: w }),
3098
+ b
3099
+ ]
3100
+ })
2819
3101
  })
2820
3102
  })
2821
3103
  })
2822
3104
  });
2823
- let w = N(t);
2824
- return /* @__PURE__ */ l(V.Provider, {
3105
+ let O = P(t);
3106
+ return /* @__PURE__ */ u(H.Provider, {
2825
3107
  value: {
2826
3108
  tenant: c || "",
2827
- apiUrl: d || "/api"
3109
+ apiUrl: l || "/api",
3110
+ locale: p || "",
3111
+ settings: h ?? null
2828
3112
  },
2829
- children: /* @__PURE__ */ l(H.Provider, {
2830
- value: f ?? null,
2831
- children: /* @__PURE__ */ l(U.Provider, {
2832
- value: y,
2833
- children: /* @__PURE__ */ u("div", {
2834
- ...g,
2835
- className: "webim-page",
2836
- style: {
2837
- ..._,
2838
- ...F(t),
2839
- ...o
2840
- },
2841
- children: [
2842
- /* @__PURE__ */ l("style", { children: `.webim-page { ${kt(P(w.light))} }
2843
- @media (prefers-color-scheme: dark) { .webim-page { ${kt(P(w.dark))} } }` }),
2844
- C,
2845
- b && /* @__PURE__ */ l("style", { children: b }),
2846
- x && /* @__PURE__ */ l("style", { children: x }),
2847
- S && /* @__PURE__ */ l("style", { children: S }),
2848
- v
2849
- ]
3113
+ children: /* @__PURE__ */ u(Pt, {
3114
+ initialUser: g,
3115
+ children: /* @__PURE__ */ u(U.Provider, {
3116
+ value: f ?? null,
3117
+ children: /* @__PURE__ */ u(W.Provider, {
3118
+ value: x,
3119
+ children: /* @__PURE__ */ d("div", {
3120
+ ...v,
3121
+ className: "webim-page",
3122
+ style: {
3123
+ ...y,
3124
+ ...I(t),
3125
+ ...a
3126
+ },
3127
+ children: [
3128
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${Vt(F(O.light))} }
3129
+ @media (prefers-color-scheme: dark) { .webim-page { ${Vt(F(O.dark))} } }` }),
3130
+ T,
3131
+ S && /* @__PURE__ */ u("style", { children: S }),
3132
+ C && /* @__PURE__ */ u("style", { children: C }),
3133
+ w && /* @__PURE__ */ u("style", { children: w }),
3134
+ b
3135
+ ]
3136
+ })
2850
3137
  })
2851
3138
  })
2852
3139
  })
@@ -2854,8 +3141,8 @@ function At({ blocks: e, theme: t, components: n, mode: i = "auto", style: o, cu
2854
3141
  }
2855
3142
  //#endregion
2856
3143
  //#region src/WebimContent.jsx
2857
- function jt({ bundle: e, mode: t = "auto", style: n }) {
2858
- return e?.blocks?.ROOT ? /* @__PURE__ */ l(At, {
3144
+ function Ut({ bundle: e, mode: t = "auto", style: n }) {
3145
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(Ht, {
2859
3146
  blocks: e.blocks,
2860
3147
  theme: e.theme,
2861
3148
  components: e.components,
@@ -2865,54 +3152,55 @@ function jt({ bundle: e, mode: t = "auto", style: n }) {
2865
3152
  datasets: e.datasets,
2866
3153
  locale: e.locale,
2867
3154
  direction: e.direction,
3155
+ settings: e.settings,
2868
3156
  mode: t,
2869
3157
  style: n
2870
3158
  }) : null;
2871
3159
  }
2872
3160
  //#endregion
2873
3161
  //#region src/WebimPage.jsx
2874
- function Mt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: a, token: c, mode: u = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
2875
- let [g, _] = s({ status: "loading" }), v = o({
3162
+ function Wt({ 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 }) {
3163
+ let [g, _] = c({ status: "loading" }), v = s({
2876
3164
  onLoad: m,
2877
3165
  onError: h
2878
3166
  });
2879
3167
  return v.current = {
2880
3168
  onLoad: m,
2881
3169
  onError: h
2882
- }, r(() => {
2883
- let r = !0;
2884
- return _({ status: "loading" }), z({
3170
+ }, i(() => {
3171
+ let i = !0;
3172
+ return _({ status: "loading" }), B({
2885
3173
  apiUrl: e,
2886
3174
  tenant: t,
2887
3175
  slug: n,
2888
- locale: i,
3176
+ locale: r,
2889
3177
  preview: a,
2890
- token: c
3178
+ token: o
2891
3179
  }).then((e) => {
2892
- r && (_({
3180
+ i && (_({
2893
3181
  status: "ready",
2894
3182
  bundle: e
2895
3183
  }), v.current.onLoad?.(e));
2896
3184
  }).catch((e) => {
2897
- r && (_({
3185
+ i && (_({
2898
3186
  status: "error",
2899
3187
  error: e
2900
3188
  }), v.current.onError?.(e));
2901
3189
  }), () => {
2902
- r = !1;
3190
+ i = !1;
2903
3191
  };
2904
3192
  }, [
2905
3193
  e,
2906
3194
  t,
2907
3195
  n,
2908
- i,
3196
+ r,
2909
3197
  a,
2910
- c
2911
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ l(jt, {
3198
+ o
3199
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ut, {
2912
3200
  bundle: g.bundle,
2913
- mode: u,
3201
+ mode: l,
2914
3202
  style: d
2915
3203
  });
2916
3204
  }
2917
3205
  //#endregion
2918
- export { At as PageRenderer, jt as WebimContent, Mt as WebimPage, z as fetchPage, Se as renderRichContent, L as resolveTheme };
3206
+ export { Ht as PageRenderer, Ut as WebimContent, Wt as WebimPage, B as fetchPage, we as renderRichContent, R as resolveTheme };