webim-adapter 0.5.0 → 0.7.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, useMemo as i, useRef as a, useState as o } from "react";
2
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
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";
3
3
  //#region ../ui/src/components/builder/styles.js
4
- var u = /* @__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.top.right.bottom.left".split(".")), d = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, f = [
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 = [
5
5
  "borderWidth",
6
6
  "borderStyle",
7
7
  "borderColor",
8
8
  "borderRadius",
9
9
  "gap"
10
10
  ];
11
- function p(e) {
11
+ function m(e) {
12
12
  let t = {};
13
- for (let n of f) {
13
+ for (let n of p) {
14
14
  let r = e?.[n];
15
- r != null && r !== "" && (t[n] = u.has(n) ? d(r) : r);
15
+ r != null && r !== "" && (t[n] = d.has(n) ? f(r) : r);
16
16
  }
17
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || f.includes(n) || (t[n] = u.has(n) ? d(r) : r);
17
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || p.includes(n) || (t[n] = d.has(n) ? f(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
- let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: p } = t;
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) => `${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
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)"}`);
23
23
  [
24
24
  s,
25
25
  c,
26
26
  l,
27
- p
28
- ].some((e) => e !== void 0) && m.push(`${d(s ?? 0)} ${d(c ?? 0)} ${d(l ?? 0)} ${p || "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(${d(e.x ?? 0)}, ${d(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;
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;
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(${d(v ?? 0)}, ${d(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 " : ""}${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${d(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(${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;
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 p(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(${d(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: z, filterBrightness: ee, filterContrast: te, filterSaturate: ne } = t;
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;
52
52
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
53
  let B = F(I);
54
- R !== void 0 && B.push(`blur(${d(R)})`), z !== void 0 && B.push(`grayscale(${z}%)`), ee !== void 0 && B.push(`brightness(${ee}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
- let V = F(L);
56
- V.length && (t.backdropFilter = V.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
- let { textStrokeWidth: H, textStrokeColor: U } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (H !== void 0 || U !== void 0) && (t.WebkitTextStroke = `${d(H ?? 1)} ${U || "currentColor"}`);
59
- let { clipText: re } = t;
60
- delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: W, transitionDuration: ie, transitionEasing: G, transitionProperty: ae } = t, K = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
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;
62
62
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
63
- let q = (Array.isArray(W) ? W : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${K(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (ie !== void 0 && q.push(`${ae || "all"} ${K(ie)} ${G || "ease"}`), q.length && (t.transition = q.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
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) {
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: J, overlayOpacity: oe } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, J) {
71
- let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
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})`;
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: se } = t;
75
+ let { backgroundLayers: q } = t;
76
76
  delete t.backgroundLayers;
77
- let Y = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
78
- if (Y.length) {
77
+ let J = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
78
+ if (J.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
- for (let t of Y) 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 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");
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" ? `${d(t.w ?? "auto")} ${d(t.h ?? "auto")}` : t.size || "cover"), r.push(`${d(t.posX ?? 0)} ${d(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" ? `${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");
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 m = {
90
+ var h = {
91
91
  hover: ":hover",
92
92
  pressed: ":active",
93
93
  focused: ":focus"
94
- }, h = /* @__PURE__ */ new Set([
94
+ }, g = /* @__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
- ]), g = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !h.has(e.toLowerCase());
102
- function _(e, t, n = []) {
101
+ ]), _ = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !g.has(e.toLowerCase());
102
+ function v(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
- g(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
108
+ _(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
109
109
  }
110
110
  return r;
111
111
  }
112
- var v = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
- function y(e, t, n, r = !1) {
114
- let i = Object.entries(p(t)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
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(" ");
115
115
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
116
116
  }
117
- function b(e, t, n) {
118
- return Object.entries(m).map(([r, i]) => y(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
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");
119
119
  }
120
- var x = [
120
+ var S = [
121
121
  {
122
122
  key: "tablet",
123
123
  max: 991
@@ -130,17 +130,17 @@ var x = [
130
130
  key: "mobile",
131
131
  max: 478
132
132
  }
133
- ], S = (e) => Object.entries(p(e)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
134
- function C(e, t) {
135
- return x.map(({ key: n, max: r }) => {
136
- let i = t?.[n] ? S(t[n]) : "";
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]) : "";
137
137
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
138
138
  }).filter(Boolean).join("\n");
139
139
  }
140
- function w(e, t) {
140
+ function T(e, t) {
141
141
  let n = [], r = (e) => {
142
142
  for (let [t, r] of Object.entries(e || {})) {
143
- let e = C(t, r.props);
143
+ let e = w(t, r.props);
144
144
  e && n.push(e);
145
145
  }
146
146
  };
@@ -148,10 +148,10 @@ function w(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 T(e, t) {
151
+ function E(e, t) {
152
152
  let n = [], r = (e) => {
153
153
  for (let [t, r] of Object.entries(e || {})) {
154
- let e = b(t, r.props);
154
+ let e = x(t, r.props);
155
155
  e && n.push(e);
156
156
  }
157
157
  };
@@ -159,7 +159,7 @@ function T(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 E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", D = {
162
+ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", O = {
163
163
  light: {
164
164
  background: "#ffffff",
165
165
  text: "#111827",
@@ -196,23 +196,23 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
196
196
  contrastText: "#052e2b"
197
197
  }
198
198
  }
199
- }, O = {
199
+ }, k = {
200
200
  font: "system",
201
201
  headingFont: "inherit",
202
- light: D.light,
203
- dark: D.dark
204
- }, k = {
202
+ light: O.light,
203
+ dark: O.dark
204
+ }, A = {
205
205
  system: {
206
206
  label: "System",
207
- value: E
207
+ value: D
208
208
  },
209
209
  inter: {
210
210
  label: "Inter",
211
- value: `"Inter", ${E}`
211
+ value: `"Inter", ${D}`
212
212
  },
213
213
  outfit: {
214
214
  label: "Outfit",
215
- value: `"Outfit", ${E}`
215
+ value: `"Outfit", ${D}`
216
216
  },
217
217
  serif: {
218
218
  label: "Serif",
@@ -222,7 +222,7 @@ var E = "-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
- }, A = (e, t) => k[e]?.value ?? t, j = (e, ...t) => {
225
+ }, j = (e, t) => A[e]?.value ?? t, M = (e, ...t) => {
226
226
  let n = Object.assign({}, e, ...t);
227
227
  return n.primary = {
228
228
  ...e.primary,
@@ -238,16 +238,16 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
238
238
  }), {})
239
239
  }, n;
240
240
  };
241
- function M(e) {
241
+ function N(e) {
242
242
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
243
243
  return {
244
- font: r ?? O.font,
245
- headingFont: i ?? O.headingFont,
246
- light: j(D.light, a, t),
247
- dark: j(D.dark, n)
244
+ font: r ?? k.font,
245
+ headingFont: i ?? k.headingFont,
246
+ light: M(O.light, a, t),
247
+ dark: M(O.dark, n)
248
248
  };
249
249
  }
250
- function N(e) {
250
+ function P(e) {
251
251
  return {
252
252
  "--page-bg": e.background,
253
253
  "--page-text": e.text,
@@ -263,28 +263,28 @@ function N(e) {
263
263
  "--page-secondary-contrast": e.secondary.contrastText
264
264
  };
265
265
  }
266
- function P(e) {
267
- let t = M(e);
266
+ function F(e) {
267
+ let t = N(e);
268
268
  return {
269
269
  backgroundColor: "var(--page-bg)",
270
270
  color: "var(--page-text)",
271
- fontFamily: A(t.font, E),
272
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : A(t.headingFont, "inherit")
271
+ fontFamily: j(t.font, D),
272
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : j(t.headingFont, "inherit")
273
273
  };
274
274
  }
275
- function F(e, t = "light") {
276
- let n = M(e);
275
+ function I(e, t = "light") {
276
+ let n = N(e);
277
277
  return {
278
- ...P(e),
279
- ...N(n[t] ?? n.light)
278
+ ...F(e),
279
+ ...P(n[t] ?? n.light)
280
280
  };
281
281
  }
282
- function I(e, t) {
282
+ function L(e, t) {
283
283
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
284
  }
285
285
  //#endregion
286
286
  //#region src/bundle.js
287
- function L({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
287
+ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
288
288
  let a = {
289
289
  ...t?.global ?? {},
290
290
  ...t?.tenant ?? {}
@@ -294,10 +294,12 @@ function L({ 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: I(o, a.builder_themes?.themes),
297
+ theme: L(o, a.builder_themes?.themes),
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
301
+ direction: o.direction,
302
+ locale: i || a.locales?.default,
301
303
  locales: a.locales,
302
304
  tenant: n ?? "",
303
305
  apiUrl: r ?? ""
@@ -310,21 +312,24 @@ var R = async (e) => {
310
312
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
311
313
  return t?.payload ?? t;
312
314
  };
313
- async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
315
+ async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
314
316
  if (!e) throw Error("fetchPage: apiUrl is required");
315
317
  if (!n) throw Error("fetchPage: slug is required");
316
- let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(R), o(`${s}/settings/public`, { headers: c }).then(R)]), d = L({
317
- page: l,
318
- settings: u,
318
+ let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
319
+ ...t ? { "x-tenant": t } : {},
320
+ ...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
+ page: u,
323
+ settings: d,
319
324
  tenant: t,
320
- apiUrl: s,
325
+ apiUrl: c,
321
326
  locale: r
322
- }), f = [...new Set(Object.values(d.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" ? e.props?.source : null).filter(Boolean))];
323
- if (f.length) {
324
- let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(R).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
325
- d.datasets = Object.fromEntries(t);
327
+ }), 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
+ 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
+ f.datasets = Object.fromEntries(t);
326
331
  }
327
- return d;
332
+ return f;
328
333
  }
329
334
  new Map([
330
335
  {
@@ -432,14 +437,14 @@ new Map([
432
437
  fallback: "sans-serif"
433
438
  }
434
439
  ].map((e) => [e.family, e]));
435
- function ee(e) {
440
+ function te(e) {
436
441
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
437
442
  }
438
- var te = (e) => ee([e]), ne = (e) => {
443
+ var ne = (e) => te([e]), B = (e) => {
439
444
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
440
445
  return t ? t[1] : null;
441
446
  };
442
- function B(e, t) {
447
+ function re(e, t) {
443
448
  let n = /* @__PURE__ */ new Set(), r = (e) => {
444
449
  for (let t of Object.values(e || {})) for (let e of [
445
450
  "style",
@@ -447,7 +452,7 @@ function B(e, t) {
447
452
  "pressed",
448
453
  "focused"
449
454
  ]) {
450
- let r = ne(t.props?.[e]?.fontFamily);
455
+ let r = B(t.props?.[e]?.fontFamily);
451
456
  r && n.add(r);
452
457
  }
453
458
  };
@@ -456,15 +461,26 @@ function B(e, t) {
456
461
  return [...n].sort();
457
462
  }
458
463
  //#endregion
459
- //#region ../ui/src/components/builder/views.jsx
460
- var V = t({
464
+ //#region ../ui/src/components/builder/locale.js
465
+ var ie = /* @__PURE__ */ new Set([
466
+ "ar",
467
+ "he",
468
+ "fa",
469
+ "ur",
470
+ "ps",
471
+ "sd",
472
+ "ug",
473
+ "yi",
474
+ "dv",
475
+ "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({
461
477
  tenant: "",
462
478
  apiUrl: "/api"
463
- }), H = t(null), U = t(null), re = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
479
+ }), H = t(null), U = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
464
480
  function W(e, t) {
465
481
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
466
482
  }
467
- var ie = (e) => {
483
+ var G = (e) => {
468
484
  let t = [];
469
485
  for (let [n, r] of Object.entries(e ?? {})) {
470
486
  if (!/^[\w-]+$/.test(n)) continue;
@@ -474,36 +490,36 @@ var ie = (e) => {
474
490
  }
475
491
  return t;
476
492
  };
477
- function G(e) {
478
- return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : 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(" ") : "").filter(Boolean).join(" ") : "";
493
+ 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(" ") : "";
479
495
  }
480
- function ae(e, t) {
481
- let n = t?.data ?? {}, r = ie(n);
496
+ function ce(e, t) {
497
+ let n = t?.data ?? {}, r = G(n);
482
498
  if (!r.length) return e;
483
- let i = RegExp(`:(${r.map(re).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => G(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;
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;
484
500
  return a(e);
485
501
  }
486
- var K = {
502
+ var q = {
487
503
  margin: 0,
488
504
  fontWeight: 700,
489
505
  lineHeight: 1.2,
490
506
  fontFamily: "var(--page-heading-font, inherit)"
491
- }, q = { margin: 0 }, J = {
507
+ }, J = { margin: 0 }, Y = {
492
508
  display: "inline-block",
493
509
  textDecoration: "none",
494
510
  cursor: "pointer",
495
511
  backgroundColor: "var(--page-accent, #111827)",
496
512
  color: "var(--page-accent-text, #ffffff)"
497
- }, oe = {
513
+ }, le = {
498
514
  flexGrow: 1,
499
515
  display: "flex",
500
516
  flexDirection: "column",
501
517
  position: "relative"
502
- }, se = {
518
+ }, ue = {
503
519
  display: "flex",
504
520
  flexDirection: "column"
505
521
  };
506
- function Y({ style: e }) {
522
+ function de({ style: e }) {
507
523
  let t = e?.backgroundVideo;
508
524
  if (!t) return null;
509
525
  let n = {
@@ -514,7 +530,7 @@ function Y({ style: e }) {
514
530
  zIndex: -1,
515
531
  pointerEvents: "none"
516
532
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
517
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("video", {
533
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("video", {
518
534
  src: t,
519
535
  autoPlay: !0,
520
536
  muted: !0,
@@ -524,73 +540,73 @@ function Y({ style: e }) {
524
540
  ...n,
525
541
  objectFit: "cover"
526
542
  }
527
- }), r && /* @__PURE__ */ c("div", { style: {
543
+ }), r && /* @__PURE__ */ l("div", { style: {
528
544
  ...n,
529
545
  background: r
530
546
  } })] });
531
547
  }
532
- var ce = (e, t) => e?.backgroundVideo ? {
548
+ var fe = (e, t) => e?.backgroundVideo ? {
533
549
  position: "relative",
534
550
  ...t,
535
- ...p(e)
551
+ ...m(e)
536
552
  } : {
537
553
  ...t,
538
- ...p(e)
554
+ ...m(e)
539
555
  };
540
- function le({ style: e, nodeRef: t, children: n }) {
541
- return /* @__PURE__ */ l("div", {
556
+ function pe({ style: e, nodeRef: t, children: n }) {
557
+ return /* @__PURE__ */ u("div", {
542
558
  ref: t,
543
559
  style: {
544
- ...oe,
545
- ...p(e)
560
+ ...le,
561
+ ...m(e)
546
562
  },
547
- children: [/* @__PURE__ */ c(Y, { style: e }), n]
563
+ children: [/* @__PURE__ */ l(de, { style: e }), n]
548
564
  });
549
565
  }
550
- function ue({ style: e, nodeRef: t, children: n }) {
551
- return /* @__PURE__ */ l("section", {
566
+ function me({ style: e, nodeRef: t, children: n }) {
567
+ return /* @__PURE__ */ u("section", {
552
568
  ref: t,
553
- style: ce(e, se),
554
- children: [/* @__PURE__ */ c(Y, { style: e }), n]
569
+ style: fe(e, ue),
570
+ children: [/* @__PURE__ */ l(de, { style: e }), n]
555
571
  });
556
572
  }
557
- function de({ style: e, freeLayout: t, nodeRef: n, children: r }) {
573
+ function he({ style: e, freeLayout: t, nodeRef: n, children: r }) {
558
574
  let i = t ? {
559
575
  position: "relative",
560
576
  minHeight: 240
561
577
  } : null;
562
- return /* @__PURE__ */ l("div", {
578
+ return /* @__PURE__ */ u("div", {
563
579
  ref: n,
564
580
  style: i ? {
565
581
  ...i,
566
- ...ce(e)
567
- } : ce(e),
568
- children: [/* @__PURE__ */ c(Y, { style: e }), r]
582
+ ...fe(e)
583
+ } : fe(e),
584
+ children: [/* @__PURE__ */ l(de, { style: e }), r]
569
585
  });
570
586
  }
571
- function fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
572
- return /* @__PURE__ */ c(n, {
587
+ function ge({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
588
+ return /* @__PURE__ */ l(n, {
573
589
  ref: a,
574
590
  style: {
575
- ...K,
576
- ...p(r)
591
+ ...q,
592
+ ...m(r)
577
593
  },
578
594
  children: X(t, e, i)
579
595
  });
580
596
  }
581
- var pe = {
582
- fontFamily: k.mono.value,
597
+ var _e = {
598
+ fontFamily: A.mono.value,
583
599
  background: "rgba(148, 163, 184, 0.18)",
584
600
  padding: "1px 5px",
585
601
  borderRadius: 4,
586
602
  fontSize: "0.9em"
587
603
  };
588
- function me(e, t = [], n, r) {
604
+ function ve(e, t = [], n, r) {
589
605
  let i = e;
590
- return t.includes("sup") ? i = /* @__PURE__ */ c("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ c("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ c("code", {
591
- style: pe,
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,
592
608
  children: i
593
- })), t.includes("strike") && (i = /* @__PURE__ */ c("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ c("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ c("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ c("strong", { children: i })), n && (i = /* @__PURE__ */ c("a", {
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", {
594
610
  href: n,
595
611
  target: r || void 0,
596
612
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
@@ -600,34 +616,34 @@ function me(e, t = [], n, r) {
600
616
  }
601
617
  function X(t, n, r) {
602
618
  return t?.length ? t.map((t, n) => {
603
- if (t.slot) return /* @__PURE__ */ c(e, { children: r?.[t.slot] ?? null }, n);
604
- if (t.parts) return /* @__PURE__ */ c(e, { children: X(t.parts, "", r) }, 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);
605
621
  let i = t.text;
606
- return t.sup ? i = /* @__PURE__ */ c("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ c("sub", { children: i })), t.code && (i = /* @__PURE__ */ c("code", {
607
- style: pe,
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,
608
624
  children: i
609
- })), t.strike && (i = /* @__PURE__ */ c("s", { children: i })), t.underline && (i = /* @__PURE__ */ c("u", { children: i })), t.italic && (i = /* @__PURE__ */ c("em", { children: i })), t.bold && (i = /* @__PURE__ */ c("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ c("span", {
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", {
610
626
  style: {
611
627
  ...t.color && { color: t.color },
612
628
  ...t.background && { backgroundColor: t.background }
613
629
  },
614
630
  children: i
615
- })), t.href && (i = /* @__PURE__ */ c("a", {
631
+ })), t.href && (i = /* @__PURE__ */ l("a", {
616
632
  href: t.href,
617
633
  target: t.target || void 0,
618
634
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
619
635
  style: { color: t.color ?? "inherit" },
620
636
  children: i
621
- })), /* @__PURE__ */ c(e, { children: i }, n);
637
+ })), /* @__PURE__ */ l(e, { children: i }, n);
622
638
  }) : n;
623
639
  }
624
- function he({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
625
- return /* @__PURE__ */ c("span", {
626
- style: p(a),
627
- children: e?.length ? X(e, t) : me(t, n, r, i)
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)
628
644
  });
629
645
  }
630
- var ge = {
646
+ var be = {
631
647
  h1: 40,
632
648
  h2: 32,
633
649
  h3: 26,
@@ -635,7 +651,7 @@ var ge = {
635
651
  h5: 19,
636
652
  h6: 16
637
653
  };
638
- function _e({ align: e = "center", width: t, wrap: n } = {}) {
654
+ function xe({ align: e = "center", width: t, wrap: n } = {}) {
639
655
  let r = t ? `${t}%` : void 0;
640
656
  if (e === "full") return { width: "100%" };
641
657
  let i = e === "left" || e === "right";
@@ -669,7 +685,7 @@ function _e({ align: e = "center", width: t, wrap: n } = {}) {
669
685
  marginRight: "auto"
670
686
  };
671
687
  }
672
- function ve(e = [], t, n) {
688
+ function Se(e = [], t, n) {
673
689
  let r = n ?? ((e, n) => X(e, n, t));
674
690
  return e.map((t, n) => {
675
691
  let i = {
@@ -678,7 +694,7 @@ function ve(e = [], t, n) {
678
694
  };
679
695
  if (t.type === "image") {
680
696
  if (!t.src) return null;
681
- let e = /* @__PURE__ */ c("img", {
697
+ let e = /* @__PURE__ */ l("img", {
682
698
  src: t.src,
683
699
  alt: t.alt || "",
684
700
  style: {
@@ -687,20 +703,20 @@ function ve(e = [], t, n) {
687
703
  borderRadius: 6
688
704
  }
689
705
  });
690
- return /* @__PURE__ */ l("figure", {
706
+ return /* @__PURE__ */ u("figure", {
691
707
  style: {
692
708
  marginLeft: 0,
693
709
  marginRight: 0,
694
710
  ...i,
695
- ..._e(t)
711
+ ...xe(t)
696
712
  },
697
- children: [t.href ? /* @__PURE__ */ c("a", {
713
+ children: [t.href ? /* @__PURE__ */ l("a", {
698
714
  href: t.href,
699
715
  target: t.target || void 0,
700
716
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
701
717
  style: { display: "block" },
702
718
  children: e
703
- }) : e, t.caption && /* @__PURE__ */ c("figcaption", {
719
+ }) : e, t.caption && /* @__PURE__ */ l("figcaption", {
704
720
  style: {
705
721
  fontSize: 13,
706
722
  opacity: .65,
@@ -711,16 +727,16 @@ function ve(e = [], t, n) {
711
727
  })]
712
728
  }, n);
713
729
  }
714
- if (t.type === "video") return ke(t.url) ? /* @__PURE__ */ c("div", {
730
+ if (t.type === "video") return Ne(t.url) ? /* @__PURE__ */ l("div", {
715
731
  style: {
716
732
  ...i,
717
- ..._e({
733
+ ...xe({
718
734
  align: t.align,
719
735
  wrap: t.wrap,
720
736
  width: t.width ?? 100
721
737
  })
722
738
  },
723
- children: /* @__PURE__ */ c(Ae, {
739
+ children: /* @__PURE__ */ l(Pe, {
724
740
  url: t.url,
725
741
  autoplay: t.autoplay,
726
742
  muted: t.muted,
@@ -729,146 +745,146 @@ function ve(e = [], t, n) {
729
745
  start: t.start
730
746
  })
731
747
  }, n) : null;
732
- if (t.type === "divider") return /* @__PURE__ */ c("hr", { style: {
748
+ if (t.type === "divider") return /* @__PURE__ */ l("hr", { style: {
733
749
  ...i,
734
750
  border: 0,
735
751
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
736
752
  } }, n);
737
753
  if (t.type === "ul" || t.type === "ol") {
738
754
  let e = t.type;
739
- return /* @__PURE__ */ c(e, {
755
+ return /* @__PURE__ */ l(e, {
740
756
  style: {
741
757
  ...i,
742
758
  paddingLeft: 24
743
759
  },
744
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ c("li", {
760
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ l("li", {
745
761
  style: { marginBottom: 4 },
746
762
  children: r(e.parts, e.text)
747
763
  }, t))
748
764
  }, n);
749
765
  }
750
- if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
766
+ if (t.type === "quote") return /* @__PURE__ */ l("blockquote", {
751
767
  style: {
752
- ...be,
768
+ ...we,
753
769
  ...i
754
770
  },
755
771
  children: r(t.parts, t.text)
756
772
  }, n);
757
- if (ge[t.type]) {
773
+ if (be[t.type]) {
758
774
  let e = t.type;
759
- return /* @__PURE__ */ c(e, {
775
+ return /* @__PURE__ */ l(e, {
760
776
  style: {
761
- ...K,
762
- fontSize: ge[t.type],
777
+ ...q,
778
+ fontSize: be[t.type],
763
779
  ...i
764
780
  },
765
781
  children: r(t.parts, t.text)
766
782
  }, n);
767
783
  }
768
- return /* @__PURE__ */ c("p", {
784
+ return /* @__PURE__ */ l("p", {
769
785
  style: {
770
- ...q,
786
+ ...J,
771
787
  ...i
772
788
  },
773
789
  children: r(t.parts, t.text)
774
790
  }, n);
775
791
  });
776
792
  }
777
- function ye({ content: e, style: t, linked: n, nodeRef: r }) {
778
- return /* @__PURE__ */ c("div", {
793
+ function Ce({ content: e, style: t, linked: n, nodeRef: r }) {
794
+ return /* @__PURE__ */ l("div", {
779
795
  ref: r,
780
796
  style: {
781
797
  display: "flow-root",
782
- ...p(t)
798
+ ...m(t)
783
799
  },
784
- children: ve(e, n)
800
+ children: Se(e, n)
785
801
  });
786
802
  }
787
- var be = {
803
+ var we = {
788
804
  margin: 0,
789
805
  padding: "8px 0 8px 20px",
790
806
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
791
807
  };
792
- function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
793
- return /* @__PURE__ */ c("blockquote", {
808
+ function Te({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
809
+ return /* @__PURE__ */ l("blockquote", {
794
810
  ref: i,
795
811
  style: {
796
- ...be,
797
- ...p(n)
812
+ ...we,
813
+ ...m(n)
798
814
  },
799
815
  children: X(t, e, r)
800
816
  });
801
817
  }
802
- function Se({ ordered: e, items: t = [], style: n, nodeRef: r }) {
803
- return /* @__PURE__ */ c(e ? "ol" : "ul", {
818
+ function Ee({ ordered: e, items: t = [], style: n, nodeRef: r }) {
819
+ return /* @__PURE__ */ l(e ? "ol" : "ul", {
804
820
  ref: r,
805
821
  style: {
806
822
  margin: 0,
807
823
  paddingLeft: 24,
808
- ...p(n)
824
+ ...m(n)
809
825
  },
810
- children: t.map((e, t) => /* @__PURE__ */ c("li", {
826
+ children: t.map((e, t) => /* @__PURE__ */ l("li", {
811
827
  style: { marginBottom: 4 },
812
828
  children: X(e.parts, e.text)
813
829
  }, t))
814
830
  });
815
831
  }
816
- function Ce({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
817
- return /* @__PURE__ */ c("p", {
832
+ function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
833
+ return /* @__PURE__ */ l("p", {
818
834
  ref: i,
819
835
  style: {
820
- ...q,
821
- ...p(n)
836
+ ...J,
837
+ ...m(n)
822
838
  },
823
839
  children: X(t, e, r)
824
840
  });
825
841
  }
826
- var we = {
842
+ var Oe = {
827
843
  color: "var(--page-accent, inherit)",
828
844
  textDecoration: "underline",
829
845
  textUnderlineOffset: 3,
830
846
  cursor: "pointer"
831
847
  };
832
- function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
833
- return /* @__PURE__ */ c("a", {
848
+ function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
849
+ return /* @__PURE__ */ l("a", {
834
850
  ref: o,
835
851
  href: n || "#",
836
852
  target: r || void 0,
837
853
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
838
854
  style: {
839
- ...we,
840
- ...p(i)
855
+ ...Oe,
856
+ ...m(i)
841
857
  },
842
858
  children: X(t, e, a)
843
859
  });
844
860
  }
845
- function Ee({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
846
- return /* @__PURE__ */ c("a", {
861
+ function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
862
+ return /* @__PURE__ */ l("a", {
847
863
  ref: o,
848
864
  href: n || "#",
849
865
  target: r || void 0,
850
866
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
851
867
  style: {
852
- ...J,
853
- ...p(i)
868
+ ...Y,
869
+ ...m(i)
854
870
  },
855
871
  children: X(t, e, a)
856
872
  });
857
873
  }
858
- function De({ src: e, alt: t, style: n, nodeRef: r }) {
859
- return e ? /* @__PURE__ */ c("img", {
874
+ function je({ src: e, alt: t, style: n, nodeRef: r }) {
875
+ return e ? /* @__PURE__ */ l("img", {
860
876
  ref: r,
861
877
  src: e,
862
878
  alt: t || "",
863
879
  style: {
864
880
  display: "block",
865
881
  maxWidth: "100%",
866
- ...p(n)
882
+ ...m(n)
867
883
  }
868
884
  }) : null;
869
885
  }
870
- function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
871
- return e ? /* @__PURE__ */ c("video", {
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", {
872
888
  ref: s,
873
889
  src: e,
874
890
  poster: t || void 0,
@@ -881,25 +897,25 @@ function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
881
897
  display: "block",
882
898
  width: "100%",
883
899
  maxWidth: "100%",
884
- ...p(o)
900
+ ...m(o)
885
901
  }
886
902
  }) : null;
887
903
  }
888
- var ke = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
889
- function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
890
- let l = ke(e);
891
- if (!l) return null;
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
+ if (!c) return null;
892
908
  let u = new URLSearchParams({ rel: "0" });
893
- 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", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ c("div", {
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", {
894
910
  ref: s,
895
911
  style: {
896
912
  position: "relative",
897
913
  width: "100%",
898
914
  paddingTop: "56.25%",
899
- ...p(o)
915
+ ...m(o)
900
916
  },
901
- children: /* @__PURE__ */ c("iframe", {
902
- src: `https://www.youtube-nocookie.com/embed/${l}?${u}`,
917
+ children: /* @__PURE__ */ l("iframe", {
918
+ src: `https://www.youtube-nocookie.com/embed/${c}?${u}`,
903
919
  title: "YouTube video",
904
920
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
905
921
  allowFullScreen: !0,
@@ -913,8 +929,8 @@ function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
913
929
  })
914
930
  });
915
931
  }
916
- function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
917
- return e ? /* @__PURE__ */ c("iframe", {
932
+ function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
933
+ return e ? /* @__PURE__ */ l("iframe", {
918
934
  ref: i,
919
935
  src: e,
920
936
  title: t || "Embedded frame",
@@ -925,12 +941,12 @@ function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
925
941
  width: "100%",
926
942
  height: 300,
927
943
  border: 0,
928
- ...p(r)
944
+ ...m(r)
929
945
  }
930
946
  }) : null;
931
947
  }
932
- function Me({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
933
- let [a, s] = o(null);
948
+ function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
949
+ let [a, o] = s(null);
934
950
  return r(() => {
935
951
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
936
952
  let t = document.createElement("script");
@@ -941,15 +957,15 @@ function Me({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
941
957
  a,
942
958
  e,
943
959
  t
944
- ]), /* @__PURE__ */ c("div", {
960
+ ]), /* @__PURE__ */ l("div", {
945
961
  ref: (e) => {
946
- s(e), i && i(e);
962
+ o(e), i && i(e);
947
963
  },
948
- style: p(n)
964
+ style: m(n)
949
965
  });
950
966
  }
951
- function Ne({ height: e, nodeRef: t }) {
952
- return /* @__PURE__ */ c("div", {
967
+ function Le({ height: e, nodeRef: t }) {
968
+ return /* @__PURE__ */ l("div", {
953
969
  ref: t,
954
970
  style: {
955
971
  height: e || 32,
@@ -958,18 +974,18 @@ function Ne({ height: e, nodeRef: t }) {
958
974
  }
959
975
  });
960
976
  }
961
- function Pe({ style: e, nodeRef: t }) {
962
- return /* @__PURE__ */ c("div", {
977
+ function Re({ style: e, nodeRef: t }) {
978
+ return /* @__PURE__ */ l("div", {
963
979
  ref: t,
964
980
  style: {
965
981
  height: 1,
966
982
  alignSelf: "stretch",
967
983
  flexShrink: 0,
968
- ...p(e)
984
+ ...m(e)
969
985
  }
970
986
  });
971
987
  }
972
- var Fe = {
988
+ var ze = {
973
989
  position: "absolute",
974
990
  top: "50%",
975
991
  transform: "translateY(-50%)",
@@ -986,7 +1002,7 @@ var Fe = {
986
1002
  alignItems: "center",
987
1003
  justifyContent: "center",
988
1004
  padding: 0
989
- }, Ie = {
1005
+ }, Be = {
990
1006
  bottom: {
991
1007
  inset: "auto 0 0 0",
992
1008
  padding: "40px 24px 20px",
@@ -1005,9 +1021,9 @@ var Fe = {
1005
1021
  padding: 24,
1006
1022
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1007
1023
  }
1008
- }, Le = 48;
1009
- function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
1010
- let [m, h] = o(0), [g, _] = o(!1), [v, y] = o(null), b = e ? Math.min(m, e - 1) : 0;
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;
1011
1027
  if (r(() => {
1012
1028
  if (!n || g || v || e < 2) return;
1013
1029
  let t = setInterval(() => h((t) => (t + 1) % e), Math.max(2, Number(i) || 5) * 1e3);
@@ -1022,13 +1038,13 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1022
1038
  let x = (t) => h((t + e) % e), S = () => {
1023
1039
  if (!v) return;
1024
1040
  let { dx: e } = v;
1025
- y(null), e < -48 ? x(b + 1) : e > Le && x(b - 1);
1041
+ y(null), e < -48 ? x(b + 1) : e > Ve && x(b - 1);
1026
1042
  };
1027
- return /* @__PURE__ */ l("div", {
1043
+ return /* @__PURE__ */ u("div", {
1028
1044
  ref: f,
1029
1045
  onMouseEnter: () => _(!0),
1030
1046
  onMouseLeave: () => _(!1),
1031
- onPointerDown: u && e > 1 ? (e) => {
1047
+ onPointerDown: o && e > 1 ? (e) => {
1032
1048
  e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), y({
1033
1049
  startX: e.clientX,
1034
1050
  dx: 0
@@ -1047,16 +1063,16 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1047
1063
  touchAction: "pan-y",
1048
1064
  userSelect: v ? "none" : void 0,
1049
1065
  cursor: v ? "grabbing" : void 0,
1050
- ...p(d)
1066
+ ...m(d)
1051
1067
  },
1052
- children: [/* @__PURE__ */ c("div", {
1068
+ children: [/* @__PURE__ */ l("div", {
1053
1069
  style: {
1054
1070
  display: "flex",
1055
1071
  height: a,
1056
1072
  transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
1057
1073
  transition: v ? "none" : "transform 450ms ease"
1058
1074
  },
1059
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ c("div", {
1075
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ l("div", {
1060
1076
  style: {
1061
1077
  position: "relative",
1062
1078
  width: "100%",
@@ -1065,28 +1081,28 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1065
1081
  },
1066
1082
  children: t(n)
1067
1083
  }, n))
1068
- }), e > 1 && /* @__PURE__ */ l(s, { children: [
1069
- /* @__PURE__ */ c("button", {
1084
+ }), e > 1 && /* @__PURE__ */ u(c, { children: [
1085
+ /* @__PURE__ */ l("button", {
1070
1086
  type: "button",
1071
1087
  "aria-label": "Previous slide",
1072
1088
  style: {
1073
- ...Fe,
1089
+ ...ze,
1074
1090
  left: 12
1075
1091
  },
1076
1092
  onClick: () => x(b - 1),
1077
1093
  children: "‹"
1078
1094
  }),
1079
- /* @__PURE__ */ c("button", {
1095
+ /* @__PURE__ */ l("button", {
1080
1096
  type: "button",
1081
1097
  "aria-label": "Next slide",
1082
1098
  style: {
1083
- ...Fe,
1099
+ ...ze,
1084
1100
  right: 12
1085
1101
  },
1086
1102
  onClick: () => x(b + 1),
1087
1103
  children: "›"
1088
1104
  }),
1089
- /* @__PURE__ */ c("div", {
1105
+ /* @__PURE__ */ l("div", {
1090
1106
  style: {
1091
1107
  position: "absolute",
1092
1108
  bottom: 10,
@@ -1096,7 +1112,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1096
1112
  justifyContent: "center",
1097
1113
  gap: 6
1098
1114
  },
1099
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ c("button", {
1115
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ l("button", {
1100
1116
  type: "button",
1101
1117
  "aria-label": `Go to slide ${t + 1}`,
1102
1118
  onClick: () => x(t),
@@ -1114,7 +1130,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1114
1130
  ] })]
1115
1131
  });
1116
1132
  }
1117
- var ze = (e, t) => ({
1133
+ var Ue = (e, t) => ({
1118
1134
  position: "absolute",
1119
1135
  inset: 0,
1120
1136
  backgroundImage: e ? `url(${e})` : "none",
@@ -1122,26 +1138,26 @@ var ze = (e, t) => ({
1122
1138
  backgroundSize: "cover",
1123
1139
  backgroundPosition: "center"
1124
1140
  });
1125
- function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1126
- return e.length ? /* @__PURE__ */ c(Re, {
1141
+ function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1142
+ return e.length ? /* @__PURE__ */ l(He, {
1127
1143
  ...r,
1128
1144
  count: e.length,
1129
1145
  renderSlide: (r) => {
1130
1146
  let i = e[r];
1131
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1147
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(i.image) }), (i.title || i.text) && /* @__PURE__ */ u("div", {
1132
1148
  style: {
1133
1149
  position: "absolute",
1134
1150
  color: "#fff",
1135
1151
  textAlign: n,
1136
- ...Ie[t] ?? Ie.bottom
1152
+ ...Be[t] ?? Be.bottom
1137
1153
  },
1138
- children: [i.title && /* @__PURE__ */ c("div", {
1154
+ children: [i.title && /* @__PURE__ */ l("div", {
1139
1155
  style: {
1140
1156
  fontSize: 22,
1141
1157
  fontWeight: 700
1142
1158
  },
1143
1159
  children: i.title
1144
- }), i.text && /* @__PURE__ */ c("div", {
1160
+ }), i.text && /* @__PURE__ */ l("div", {
1145
1161
  style: {
1146
1162
  fontSize: 14,
1147
1163
  opacity: .9,
@@ -1153,13 +1169,13 @@ function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1153
1169
  }
1154
1170
  }) : null;
1155
1171
  }
1156
- function Ve({ slides: e = [], linked: t, ...n }) {
1157
- return e.length ? /* @__PURE__ */ c(Re, {
1172
+ function Ge({ slides: e = [], linked: t, ...n }) {
1173
+ return e.length ? /* @__PURE__ */ l(He, {
1158
1174
  ...n,
1159
1175
  count: e.length,
1160
1176
  renderSlide: (n) => {
1161
1177
  let r = e[n];
1162
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(r.image, r.color) }), /* @__PURE__ */ c("div", {
1178
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(r.image, r.color) }), /* @__PURE__ */ l("div", {
1163
1179
  style: {
1164
1180
  position: "absolute",
1165
1181
  inset: 0,
@@ -1176,28 +1192,28 @@ var Z = {
1176
1192
  textDecoration: "none",
1177
1193
  fontSize: 14,
1178
1194
  opacity: .85
1179
- }, He = {
1195
+ }, Ke = {
1180
1196
  background: "var(--page-bg, #ffffff)",
1181
1197
  color: "var(--page-text, #111827)",
1182
1198
  border: "1px solid rgba(148, 163, 184, 0.25)",
1183
1199
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1184
1200
  zIndex: 60
1185
1201
  };
1186
- function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1187
- let [f, m] = o(null), [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(null);
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);
1188
1204
  r(() => {
1189
1205
  if (!f) return;
1190
1206
  let e = new ResizeObserver(() => g(f.offsetWidth < d));
1191
1207
  return e.observe(f), () => e.disconnect();
1192
1208
  }, [f, d]);
1193
- let x = u === "hamburger" || u === "auto" && h, S = (e, t) => /* @__PURE__ */ l("a", {
1209
+ let x = c === "hamburger" || c === "auto" && h, S = (e, t) => /* @__PURE__ */ u("a", {
1194
1210
  href: e.href || "#",
1195
1211
  style: {
1196
1212
  ...Z,
1197
1213
  display: "block",
1198
1214
  ...t
1199
1215
  },
1200
- children: [e.label, e.desc && /* @__PURE__ */ c("span", {
1216
+ children: [e.label, e.desc && /* @__PURE__ */ l("span", {
1201
1217
  style: {
1202
1218
  display: "block",
1203
1219
  fontSize: 12,
@@ -1207,9 +1223,9 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1207
1223
  children: e.desc
1208
1224
  })]
1209
1225
  }, e.key);
1210
- return /* @__PURE__ */ l("nav", {
1226
+ return /* @__PURE__ */ u("nav", {
1211
1227
  ref: (e) => {
1212
- m(e), s && s(e);
1228
+ p(e), o && o(e);
1213
1229
  },
1214
1230
  style: {
1215
1231
  display: "flex",
@@ -1219,10 +1235,10 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1219
1235
  padding: "14px 24px",
1220
1236
  width: "100%",
1221
1237
  position: "relative",
1222
- ...p(a)
1238
+ ...m(a)
1223
1239
  },
1224
1240
  children: [
1225
- n && /* @__PURE__ */ c("img", {
1241
+ n && /* @__PURE__ */ l("img", {
1226
1242
  src: n,
1227
1243
  alt: t || "Logo",
1228
1244
  style: {
@@ -1230,7 +1246,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1230
1246
  display: "block"
1231
1247
  }
1232
1248
  }),
1233
- t && /* @__PURE__ */ c("div", {
1249
+ t && /* @__PURE__ */ l("div", {
1234
1250
  style: {
1235
1251
  fontWeight: 700,
1236
1252
  fontSize: 18,
@@ -1238,8 +1254,8 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1238
1254
  },
1239
1255
  children: t
1240
1256
  }),
1241
- /* @__PURE__ */ c("div", { style: { flexGrow: 1 } }),
1242
- x ? /* @__PURE__ */ c("button", {
1257
+ /* @__PURE__ */ l("div", { style: { flexGrow: 1 } }),
1258
+ x ? /* @__PURE__ */ l("button", {
1243
1259
  type: "button",
1244
1260
  "aria-label": _ ? "Close menu" : "Open menu",
1245
1261
  onClick: () => v(!_),
@@ -1253,7 +1269,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1253
1269
  padding: 4
1254
1270
  },
1255
1271
  children: _ ? "✕" : "☰"
1256
- }) : /* @__PURE__ */ c("div", {
1272
+ }) : /* @__PURE__ */ l("div", {
1257
1273
  style: {
1258
1274
  display: "flex",
1259
1275
  gap: 20,
@@ -1262,20 +1278,20 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1262
1278
  },
1263
1279
  children: i.map((e) => {
1264
1280
  let t = e.children ?? [];
1265
- if (!t.length) return /* @__PURE__ */ c("a", {
1281
+ if (!t.length) return /* @__PURE__ */ l("a", {
1266
1282
  href: e.href || "#",
1267
1283
  style: Z,
1268
1284
  children: e.label
1269
1285
  }, e.key);
1270
1286
  let n = e.type === "mega";
1271
- return /* @__PURE__ */ l("span", {
1287
+ return /* @__PURE__ */ u("span", {
1272
1288
  style: {
1273
1289
  position: n ? "static" : "relative",
1274
1290
  display: "inline-flex"
1275
1291
  },
1276
1292
  onMouseEnter: () => b(e.key),
1277
1293
  onMouseLeave: () => b(null),
1278
- children: [/* @__PURE__ */ l("a", {
1294
+ children: [/* @__PURE__ */ u("a", {
1279
1295
  href: e.href || "#",
1280
1296
  style: {
1281
1297
  ...Z,
@@ -1284,7 +1300,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1284
1300
  children: [
1285
1301
  e.label,
1286
1302
  " ",
1287
- /* @__PURE__ */ c("span", {
1303
+ /* @__PURE__ */ l("span", {
1288
1304
  style: {
1289
1305
  fontSize: 9,
1290
1306
  opacity: .6
@@ -1292,9 +1308,9 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1292
1308
  children: "▼"
1293
1309
  })
1294
1310
  ]
1295
- }), y === e.key && (n ? /* @__PURE__ */ c("div", {
1311
+ }), y === e.key && (n ? /* @__PURE__ */ l("div", {
1296
1312
  style: {
1297
- ...He,
1313
+ ...Ke,
1298
1314
  position: "absolute",
1299
1315
  left: 0,
1300
1316
  right: 0,
@@ -1308,9 +1324,9 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1308
1324
  padding: "6px 8px",
1309
1325
  borderRadius: 6
1310
1326
  }))
1311
- }) : /* @__PURE__ */ c("div", {
1327
+ }) : /* @__PURE__ */ l("div", {
1312
1328
  style: {
1313
- ...He,
1329
+ ...Ke,
1314
1330
  position: "absolute",
1315
1331
  top: "100%",
1316
1332
  left: 0,
@@ -1328,7 +1344,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1328
1344
  }, e.key);
1329
1345
  })
1330
1346
  }),
1331
- x && _ && /* @__PURE__ */ c("div", {
1347
+ x && _ && /* @__PURE__ */ l("div", {
1332
1348
  style: {
1333
1349
  flexBasis: "100%",
1334
1350
  width: "100%",
@@ -1336,7 +1352,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1336
1352
  flexDirection: "column",
1337
1353
  paddingTop: 10
1338
1354
  },
1339
- children: i.map((t) => /* @__PURE__ */ l(e, { children: [/* @__PURE__ */ c("a", {
1355
+ children: i.map((t) => /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l("a", {
1340
1356
  href: t.href || "#",
1341
1357
  style: {
1342
1358
  ...Z,
@@ -1350,21 +1366,21 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1350
1366
  ]
1351
1367
  });
1352
1368
  }
1353
- function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1354
- let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1355
- return e.length ? /* @__PURE__ */ l("div", {
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", {
1356
1372
  ref: r,
1357
1373
  style: {
1358
1374
  width: "100%",
1359
- ...p(n)
1375
+ ...m(n)
1360
1376
  },
1361
- children: [/* @__PURE__ */ c("div", {
1377
+ children: [/* @__PURE__ */ l("div", {
1362
1378
  style: {
1363
1379
  display: "flex",
1364
1380
  gap: 4,
1365
1381
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1366
1382
  },
1367
- children: e.map((e, t) => /* @__PURE__ */ c("button", {
1383
+ children: e.map((e, t) => /* @__PURE__ */ l("button", {
1368
1384
  type: "button",
1369
1385
  onClick: () => a(t),
1370
1386
  style: {
@@ -1375,41 +1391,41 @@ function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1375
1391
  fontFamily: "inherit",
1376
1392
  color: "inherit",
1377
1393
  cursor: "pointer",
1378
- opacity: t === s ? 1 : .6,
1379
- fontWeight: t === s ? 600 : 500,
1380
- boxShadow: t === s ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1394
+ opacity: t === o ? 1 : .6,
1395
+ fontWeight: t === o ? 600 : 500,
1396
+ boxShadow: t === o ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1381
1397
  },
1382
1398
  children: e.label || `Tab ${t + 1}`
1383
1399
  }, e.key))
1384
- }), e.map((e, n) => /* @__PURE__ */ c("div", {
1400
+ }), e.map((e, n) => /* @__PURE__ */ l("div", {
1385
1401
  style: {
1386
- display: n === s ? "flex" : "none",
1402
+ display: n === o ? "flex" : "none",
1387
1403
  flexDirection: "column"
1388
1404
  },
1389
1405
  children: t?.[e.key] ?? null
1390
1406
  }, e.key))]
1391
1407
  }) : null;
1392
1408
  }
1393
- function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1394
- let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
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] : []));
1395
1411
  if (!e.length) return null;
1396
- let u = (e) => s((t) => {
1412
+ let c = (e) => o((t) => {
1397
1413
  let r = new Set(n ? t : []);
1398
1414
  return t.has(e) ? r.delete(e) : r.add(e), r;
1399
1415
  });
1400
- return /* @__PURE__ */ c("div", {
1416
+ return /* @__PURE__ */ l("div", {
1401
1417
  ref: i,
1402
1418
  style: {
1403
1419
  width: "100%",
1404
- ...p(r)
1420
+ ...m(r)
1405
1421
  },
1406
1422
  children: e.map((n, r) => {
1407
1423
  let i = a.has(n.key);
1408
- return /* @__PURE__ */ l("div", {
1424
+ return /* @__PURE__ */ u("div", {
1409
1425
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1410
- children: [/* @__PURE__ */ l("button", {
1426
+ children: [/* @__PURE__ */ u("button", {
1411
1427
  type: "button",
1412
- onClick: () => u(n.key),
1428
+ onClick: () => c(n.key),
1413
1429
  style: {
1414
1430
  width: "100%",
1415
1431
  display: "flex",
@@ -1426,7 +1442,7 @@ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1426
1442
  textAlign: "left",
1427
1443
  cursor: "pointer"
1428
1444
  },
1429
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ c("span", {
1445
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ l("span", {
1430
1446
  "aria-hidden": !0,
1431
1447
  style: {
1432
1448
  fontSize: 12,
@@ -1436,7 +1452,7 @@ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1436
1452
  },
1437
1453
  children: "▼"
1438
1454
  })]
1439
- }), /* @__PURE__ */ c("div", {
1455
+ }), /* @__PURE__ */ l("div", {
1440
1456
  style: {
1441
1457
  display: i ? "flex" : "none",
1442
1458
  flexDirection: "column"
@@ -1447,11 +1463,11 @@ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1447
1463
  })
1448
1464
  });
1449
1465
  }
1450
- var Ke = {
1466
+ var Xe = {
1451
1467
  display: "flex",
1452
1468
  flexDirection: "column",
1453
1469
  gap: "12px"
1454
- }, qe = {
1470
+ }, Ze = {
1455
1471
  fontSize: "14px",
1456
1472
  fontWeight: 500,
1457
1473
  color: "var(--page-text, #111827)"
@@ -1465,18 +1481,18 @@ var Ke = {
1465
1481
  boxSizing: "border-box",
1466
1482
  backgroundColor: "#ffffff",
1467
1483
  color: "#111827"
1468
- }, Je = {
1484
+ }, Qe = {
1469
1485
  display: "flex",
1470
1486
  alignItems: "center",
1471
1487
  gap: "8px",
1472
1488
  fontSize: "14px",
1473
1489
  color: "var(--page-text, #111827)"
1474
- }, Ye = (e) => e ? {
1490
+ }, $e = (e) => e ? {
1475
1491
  readOnly: !0,
1476
1492
  tabIndex: -1,
1477
1493
  onMouseDown: (e) => e.preventDefault()
1478
1494
  } : {};
1479
- function Xe(e, t) {
1495
+ function et(e, t) {
1480
1496
  if (!e) return !0;
1481
1497
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1482
1498
  switch (e.op) {
@@ -1490,11 +1506,11 @@ function Xe(e, t) {
1490
1506
  default: return !1;
1491
1507
  }
1492
1508
  }
1493
- var Ze = {
1509
+ var tt = {
1494
1510
  display: "flex",
1495
1511
  flexDirection: "column",
1496
1512
  gap: 6
1497
- }, Qe = {
1513
+ }, nt = {
1498
1514
  font: "inherit",
1499
1515
  fontSize: 15,
1500
1516
  padding: "10px 12px",
@@ -1505,10 +1521,10 @@ var Ze = {
1505
1521
  width: "100%",
1506
1522
  boxSizing: "border-box"
1507
1523
  };
1508
- function $e({ field: e, value: t, onChange: n, inert: r }) {
1509
- let i = /* @__PURE__ */ l("span", {
1524
+ function rt({ field: e, value: t, onChange: n, inert: r }) {
1525
+ let i = /* @__PURE__ */ u("span", {
1510
1526
  style: {
1511
- ...qe,
1527
+ ...Ze,
1512
1528
  fontSize: 14
1513
1529
  },
1514
1530
  children: [e.label, e.required ? " *" : ""]
@@ -1517,11 +1533,11 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1517
1533
  required: e.required || void 0,
1518
1534
  placeholder: e.placeholder || void 0,
1519
1535
  disabled: r || void 0,
1520
- style: Qe,
1536
+ style: nt,
1521
1537
  value: t ?? "",
1522
1538
  onChange: (t) => n(e.name, t.target.value)
1523
1539
  };
1524
- return e.type === "display" ? /* @__PURE__ */ c(e.variant && e.variant !== "p" ? e.variant : "p", {
1540
+ return e.type === "display" ? /* @__PURE__ */ l(e.variant && e.variant !== "p" ? e.variant : "p", {
1525
1541
  style: {
1526
1542
  margin: 0,
1527
1543
  color: e.color || "inherit",
@@ -1538,7 +1554,7 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1538
1554
  lineHeight: 1.35
1539
1555
  },
1540
1556
  children: e.label
1541
- }) : e.type === "image" ? e.src ? /* @__PURE__ */ c("img", {
1557
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ l("img", {
1542
1558
  src: e.src,
1543
1559
  alt: e.label ?? "",
1544
1560
  style: {
@@ -1546,10 +1562,10 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1546
1562
  borderRadius: 8,
1547
1563
  display: "block"
1548
1564
  }
1549
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(Ae, {
1565
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ l(Pe, {
1550
1566
  url: e.src,
1551
1567
  style: { width: "100%" }
1552
- }) : /* @__PURE__ */ c("video", {
1568
+ }) : /* @__PURE__ */ l("video", {
1553
1569
  src: e.src,
1554
1570
  controls: !0,
1555
1571
  style: {
@@ -1557,27 +1573,27 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1557
1573
  borderRadius: 8,
1558
1574
  display: "block"
1559
1575
  }
1560
- }) : null : /* @__PURE__ */ l("label", {
1561
- style: Ze,
1576
+ }) : null : /* @__PURE__ */ u("label", {
1577
+ style: tt,
1562
1578
  children: [
1563
1579
  i,
1564
- e.type === "textarea" || e.multiline ? /* @__PURE__ */ c("textarea", {
1580
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ l("textarea", {
1565
1581
  ...a,
1566
1582
  rows: 4,
1567
1583
  style: {
1568
- ...Qe,
1584
+ ...nt,
1569
1585
  resize: "vertical"
1570
1586
  }
1571
- }) : e.type === "select" ? /* @__PURE__ */ l("select", {
1587
+ }) : e.type === "select" ? /* @__PURE__ */ u("select", {
1572
1588
  ...a,
1573
- children: [/* @__PURE__ */ c("option", {
1589
+ children: [/* @__PURE__ */ l("option", {
1574
1590
  value: "",
1575
1591
  children: e.placeholder || "—"
1576
- }), (e.options ?? []).map((e, t) => /* @__PURE__ */ c("option", {
1592
+ }), (e.options ?? []).map((e, t) => /* @__PURE__ */ l("option", {
1577
1593
  value: typeof e == "string" ? e : e.value,
1578
1594
  children: typeof e == "string" ? e : e.label ?? e.value
1579
1595
  }, t))]
1580
- }) : e.type === "checkbox" ? /* @__PURE__ */ c("input", {
1596
+ }) : e.type === "checkbox" ? /* @__PURE__ */ l("input", {
1581
1597
  type: "checkbox",
1582
1598
  name: e.name,
1583
1599
  required: e.required || void 0,
@@ -1588,7 +1604,7 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1588
1604
  width: 18,
1589
1605
  height: 18
1590
1606
  }
1591
- }) : e.type === "upload" ? /* @__PURE__ */ c("input", {
1607
+ }) : e.type === "upload" ? /* @__PURE__ */ l("input", {
1592
1608
  type: "file",
1593
1609
  name: e.name,
1594
1610
  accept: e.accept || void 0,
@@ -1599,7 +1615,7 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1599
1615
  font: "inherit",
1600
1616
  fontSize: 14
1601
1617
  }
1602
- }) : /* @__PURE__ */ c("input", {
1618
+ }) : /* @__PURE__ */ l("input", {
1603
1619
  ...a,
1604
1620
  type: {
1605
1621
  email: "email",
@@ -1610,7 +1626,7 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1610
1626
  link: "url"
1611
1627
  }[e.type] ?? "text"
1612
1628
  }),
1613
- e.help && /* @__PURE__ */ c("span", {
1629
+ e.help && /* @__PURE__ */ l("span", {
1614
1630
  style: {
1615
1631
  fontSize: 12,
1616
1632
  opacity: .65
@@ -1620,12 +1636,12 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1620
1636
  ]
1621
1637
  });
1622
1638
  }
1623
- function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d, auto: f, submitLabel: m, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
1624
- let { tenant: b, apiUrl: x } = n(V), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = g ? y || "form" : S;
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;
1625
1641
  r(() => {
1626
1642
  if (!f || !d) return;
1627
1643
  let e = !0;
1628
- return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload ?? null)).catch(() => e && T(null)), () => {
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)), () => {
1629
1645
  e = !1;
1630
1646
  };
1631
1647
  }, [
@@ -1638,29 +1654,29 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1638
1654
  section: null,
1639
1655
  fields: []
1640
1656
  }];
1641
- for (let e of w?.fields ?? []) e.type === "section" ? j.push({
1657
+ for (let e of Array.isArray(w?.fields) ? w.fields : []) e.type === "section" ? j.push({
1642
1658
  section: e,
1643
1659
  fields: []
1644
1660
  }) : j[j.length - 1].fields.push(e);
1645
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Xe(e.section.condition, E)).map((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) => ({
1646
1662
  ...e,
1647
- fields: e.fields.filter((e) => Xe(e.condition, E))
1663
+ fields: e.fields.filter((e) => et(e.condition, E))
1648
1664
  })), 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) => {
1649
1665
  let t = E[e.name];
1650
1666
  return e.required && (t == null || t === "" || t === !1);
1651
- }), R = F >= N.length - 1, z = (e, t) => D((n) => ({
1667
+ }), ee = F >= N.length - 1, R = (e, t) => D((n) => ({
1652
1668
  ...n,
1653
1669
  [e]: t
1654
1670
  }));
1655
- return /* @__PURE__ */ l("div", {
1671
+ return /* @__PURE__ */ u("div", {
1656
1672
  ref: h,
1657
- style: p(e),
1673
+ style: m(e),
1658
1674
  children: [
1659
- /* @__PURE__ */ c("form", {
1675
+ /* @__PURE__ */ l("form", {
1660
1676
  action: t || void 0,
1661
1677
  method: i || "post",
1662
1678
  name: a || void 0,
1663
- encType: u || void 0,
1679
+ encType: o || void 0,
1664
1680
  onSubmit: async (e) => {
1665
1681
  if (e.preventDefault(), !g) {
1666
1682
  if (d) {
@@ -1698,16 +1714,16 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1698
1714
  }
1699
1715
  },
1700
1716
  style: {
1701
- ...Ke,
1717
+ ...Xe,
1702
1718
  display: A === "success" ? "none" : "flex"
1703
1719
  },
1704
- children: f && d ? /* @__PURE__ */ l(s, { children: [
1705
- P && /* @__PURE__ */ c(ft, {
1720
+ children: f && d ? /* @__PURE__ */ u(c, { children: [
1721
+ P && /* @__PURE__ */ l(gt, {
1706
1722
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1707
1723
  active: F + 1,
1708
1724
  style: { marginBottom: 8 }
1709
1725
  }),
1710
- P && N[F]?.section?.help && /* @__PURE__ */ c("p", {
1726
+ P && N[F]?.section?.help && /* @__PURE__ */ l("p", {
1711
1727
  style: {
1712
1728
  margin: 0,
1713
1729
  fontSize: 14,
@@ -1715,25 +1731,25 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1715
1731
  },
1716
1732
  children: N[F].section.help
1717
1733
  }),
1718
- I.map((e) => /* @__PURE__ */ c($e, {
1734
+ I.map((e) => /* @__PURE__ */ l(rt, {
1719
1735
  field: e,
1720
1736
  value: E[e.name],
1721
- onChange: z,
1737
+ onChange: R,
1722
1738
  inert: g
1723
1739
  }, e.name)),
1724
- /* @__PURE__ */ l("div", {
1740
+ /* @__PURE__ */ u("div", {
1725
1741
  style: {
1726
1742
  display: "flex",
1727
1743
  gap: 10,
1728
1744
  alignItems: "center",
1729
1745
  marginTop: 4
1730
1746
  },
1731
- children: [P && F > 0 && /* @__PURE__ */ c("button", {
1747
+ children: [P && F > 0 && /* @__PURE__ */ l("button", {
1732
1748
  type: "button",
1733
1749
  disabled: g || void 0,
1734
1750
  onClick: () => k(F - 1),
1735
1751
  style: {
1736
- ...J,
1752
+ ...Y,
1737
1753
  background: "transparent",
1738
1754
  color: "inherit",
1739
1755
  border: 0,
@@ -1741,12 +1757,12 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1741
1757
  cursor: "pointer"
1742
1758
  },
1743
1759
  children: "Back"
1744
- }), P && !R ? /* @__PURE__ */ c("button", {
1760
+ }), P && !ee ? /* @__PURE__ */ l("button", {
1745
1761
  type: "button",
1746
1762
  disabled: g || L.length > 0,
1747
1763
  onClick: () => k(F + 1),
1748
1764
  style: {
1749
- ...J,
1765
+ ...Y,
1750
1766
  border: 0,
1751
1767
  padding: "10px 22px",
1752
1768
  borderRadius: 8,
@@ -1756,11 +1772,11 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1756
1772
  opacity: L.length ? .5 : 1
1757
1773
  },
1758
1774
  children: "Next"
1759
- }) : /* @__PURE__ */ c("button", {
1775
+ }) : /* @__PURE__ */ l("button", {
1760
1776
  type: "submit",
1761
1777
  disabled: g || void 0,
1762
1778
  style: {
1763
- ...J,
1779
+ ...Y,
1764
1780
  border: 0,
1765
1781
  padding: "10px 22px",
1766
1782
  borderRadius: 8,
@@ -1768,16 +1784,16 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1768
1784
  fontWeight: 600,
1769
1785
  cursor: "pointer"
1770
1786
  },
1771
- children: m || "Submit"
1787
+ children: p || "Submit"
1772
1788
  })]
1773
1789
  })
1774
1790
  ] }) : _
1775
1791
  }),
1776
- /* @__PURE__ */ c("div", {
1792
+ /* @__PURE__ */ l("div", {
1777
1793
  style: { display: A === "success" ? "block" : "none" },
1778
1794
  children: v?.success ?? null
1779
1795
  }),
1780
- /* @__PURE__ */ c("div", {
1796
+ /* @__PURE__ */ l("div", {
1781
1797
  style: {
1782
1798
  display: A === "error" ? "block" : "none",
1783
1799
  marginTop: 12
@@ -1787,18 +1803,18 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1787
1803
  ]
1788
1804
  });
1789
1805
  }
1790
- function tt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1791
- return /* @__PURE__ */ c("label", {
1806
+ function at({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1807
+ return /* @__PURE__ */ l("label", {
1792
1808
  ref: r,
1793
1809
  style: {
1794
- ...qe,
1795
- ...p(n)
1810
+ ...Ze,
1811
+ ...m(n)
1796
1812
  },
1797
1813
  children: X(t, e, i)
1798
1814
  });
1799
1815
  }
1800
- function nt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1801
- return /* @__PURE__ */ c("input", {
1816
+ function ot({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1817
+ return /* @__PURE__ */ l("input", {
1802
1818
  ref: a,
1803
1819
  type: e,
1804
1820
  name: t || void 0,
@@ -1806,13 +1822,13 @@ function nt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1806
1822
  required: !o && !!r,
1807
1823
  style: {
1808
1824
  ...Q,
1809
- ...p(i)
1825
+ ...m(i)
1810
1826
  },
1811
- ...Ye(o)
1827
+ ...$e(o)
1812
1828
  });
1813
1829
  }
1814
- function rt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1815
- return /* @__PURE__ */ c("textarea", {
1830
+ function st({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1831
+ return /* @__PURE__ */ l("textarea", {
1816
1832
  ref: a,
1817
1833
  name: e || void 0,
1818
1834
  placeholder: t,
@@ -1821,19 +1837,19 @@ function rt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1821
1837
  style: {
1822
1838
  ...Q,
1823
1839
  resize: "vertical",
1824
- ...p(i)
1840
+ ...m(i)
1825
1841
  },
1826
- ...Ye(o)
1842
+ ...$e(o)
1827
1843
  });
1828
1844
  }
1829
- function it({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1830
- return /* @__PURE__ */ l("label", {
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", {
1831
1847
  ref: o,
1832
1848
  style: {
1833
- ...Je,
1834
- ...p(a)
1849
+ ...Qe,
1850
+ ...m(a)
1835
1851
  },
1836
- children: [/* @__PURE__ */ c("input", {
1852
+ children: [/* @__PURE__ */ l("input", {
1837
1853
  type: e,
1838
1854
  name: n || void 0,
1839
1855
  value: r || void 0,
@@ -1847,8 +1863,8 @@ function it({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1847
1863
  }), t]
1848
1864
  });
1849
1865
  }
1850
- function at({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1851
- return /* @__PURE__ */ l("select", {
1866
+ function lt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1867
+ return /* @__PURE__ */ u("select", {
1852
1868
  ref: a,
1853
1869
  name: e || void 0,
1854
1870
  required: !o && !!r,
@@ -1858,56 +1874,56 @@ function at({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1858
1874
  style: {
1859
1875
  ...Q,
1860
1876
  appearance: "auto",
1861
- ...p(i)
1877
+ ...m(i)
1862
1878
  },
1863
- children: [t !== "" && /* @__PURE__ */ c("option", {
1879
+ children: [t !== "" && /* @__PURE__ */ l("option", {
1864
1880
  value: "",
1865
1881
  disabled: !0,
1866
1882
  children: t ?? "Select…"
1867
- }), n.map((e, t) => /* @__PURE__ */ c("option", {
1883
+ }), n.map((e, t) => /* @__PURE__ */ l("option", {
1868
1884
  value: e,
1869
1885
  children: e
1870
1886
  }, t))]
1871
1887
  });
1872
1888
  }
1873
- function ot({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1874
- let [u, d] = o(null);
1875
- return /* @__PURE__ */ l("label", {
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", {
1876
1892
  ref: a,
1877
1893
  style: {
1878
1894
  ...Q,
1879
1895
  display: "flex",
1880
1896
  alignItems: "center",
1881
1897
  gap: "8px",
1882
- cursor: s ? "default" : "pointer",
1898
+ cursor: o ? "default" : "pointer",
1883
1899
  borderStyle: "dashed",
1884
- color: u ? "#111827" : "#6b7280",
1885
- ...p(i)
1900
+ color: c ? "#111827" : "#6b7280",
1901
+ ...m(i)
1886
1902
  },
1887
1903
  children: [
1888
- /* @__PURE__ */ c("input", {
1904
+ /* @__PURE__ */ l("input", {
1889
1905
  type: "file",
1890
1906
  name: e || void 0,
1891
1907
  accept: t || void 0,
1892
- required: !s && !!n,
1893
- disabled: !!s,
1908
+ required: !o && !!n,
1909
+ disabled: !!o,
1894
1910
  onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1895
1911
  style: { display: "none" }
1896
1912
  }),
1897
- /* @__PURE__ */ c("span", {
1913
+ /* @__PURE__ */ l("span", {
1898
1914
  "aria-hidden": !0,
1899
1915
  children: "📎"
1900
1916
  }),
1901
- u ?? r
1917
+ c ?? r
1902
1918
  ]
1903
1919
  });
1904
1920
  }
1905
- function st({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1906
- return /* @__PURE__ */ c("button", {
1921
+ function dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1922
+ return /* @__PURE__ */ l("button", {
1907
1923
  ref: n,
1908
1924
  type: r ? "button" : "submit",
1909
1925
  style: {
1910
- ...J,
1926
+ ...Y,
1911
1927
  border: 0,
1912
1928
  cursor: "pointer",
1913
1929
  alignSelf: "flex-start",
@@ -1917,34 +1933,34 @@ function st({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1917
1933
  fontWeight: 600,
1918
1934
  lineHeight: 1.4,
1919
1935
  fontFamily: "inherit",
1920
- ...p(t)
1936
+ ...m(t)
1921
1937
  },
1922
1938
  children: e
1923
1939
  });
1924
1940
  }
1925
- function ct({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1941
+ function ft({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1926
1942
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1927
- return /* @__PURE__ */ c("div", {
1943
+ return /* @__PURE__ */ l("div", {
1928
1944
  ref: r,
1929
1945
  style: {
1930
1946
  display: "grid",
1931
1947
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1932
1948
  gap: 16,
1933
1949
  width: "100%",
1934
- ...p(n)
1950
+ ...m(n)
1935
1951
  },
1936
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ c("div", {
1952
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ l("div", {
1937
1953
  style: { minWidth: 0 },
1938
1954
  children: i?.[`cell-${t}`] ?? null
1939
1955
  }, t))
1940
1956
  });
1941
1957
  }
1942
- function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: m, style: h, nodeRef: g }) {
1943
- let { tenant: _, apiUrl: v } = n(V), y = n(U), b = n(H)?.[e], [x, S] = o(null);
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);
1944
1960
  if (r(() => {
1945
1961
  if (!e || b) return;
1946
1962
  let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
1947
- return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload : [])).catch(() => t && S([])), () => {
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([])), () => {
1948
1964
  t = !1;
1949
1965
  };
1950
1966
  }, [
@@ -1962,27 +1978,27 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
1962
1978
  gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
1963
1979
  gap: 24
1964
1980
  };
1965
- return f && m && y?.render ? /* @__PURE__ */ c("div", {
1981
+ return f && p && y?.render ? /* @__PURE__ */ l("div", {
1966
1982
  ref: g,
1967
1983
  style: {
1968
1984
  width: "100%",
1969
1985
  ...T,
1970
- ...p(h)
1986
+ ...m(h)
1971
1987
  },
1972
- children: C.map((e) => /* @__PURE__ */ c("div", {
1988
+ children: C.map((e) => /* @__PURE__ */ l("div", {
1973
1989
  style: { minWidth: 0 },
1974
- children: y.render(m, (t) => ae(t, e))
1990
+ children: y.render(p, (t) => ce(t, e))
1975
1991
  }, e.id ?? e?.data?.slug))
1976
- }) : /* @__PURE__ */ c("div", {
1992
+ }) : /* @__PURE__ */ l("div", {
1977
1993
  ref: g,
1978
1994
  style: {
1979
1995
  width: "100%",
1980
1996
  ...T,
1981
- ...p(h)
1997
+ ...m(h)
1982
1998
  },
1983
1999
  children: C.map((e) => {
1984
- let t = s ? W(e?.data, s) : null, n = u ? G(W(e?.data, u)) : null, r = d ? W(e?.data, d) : null, a = Array.isArray(r) ? r : null, o = a || r == null ? null : G(r), f = i === "list";
1985
- return /* @__PURE__ */ l("div", {
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", {
1986
2002
  style: {
1987
2003
  display: "flex",
1988
2004
  flexDirection: f ? "row" : "column",
@@ -1990,7 +2006,7 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
1990
2006
  alignItems: f ? "center" : "stretch",
1991
2007
  minWidth: 0
1992
2008
  },
1993
- children: [t && /* @__PURE__ */ c("img", {
2009
+ children: [t && /* @__PURE__ */ l("img", {
1994
2010
  src: t,
1995
2011
  alt: n ?? "",
1996
2012
  style: {
@@ -2001,10 +2017,10 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2001
2017
  flexShrink: 0,
2002
2018
  display: "block"
2003
2019
  }
2004
- }), /* @__PURE__ */ l("div", {
2020
+ }), /* @__PURE__ */ u("div", {
2005
2021
  style: { minWidth: 0 },
2006
2022
  children: [
2007
- n && /* @__PURE__ */ c("h3", {
2023
+ n && /* @__PURE__ */ l("h3", {
2008
2024
  style: {
2009
2025
  margin: 0,
2010
2026
  fontSize: 18,
@@ -2012,23 +2028,23 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2012
2028
  },
2013
2029
  children: n
2014
2030
  }),
2015
- o && /* @__PURE__ */ c("p", {
2031
+ s && /* @__PURE__ */ l("p", {
2016
2032
  style: {
2017
2033
  margin: "6px 0 0",
2018
2034
  fontSize: 14,
2019
2035
  lineHeight: 1.55,
2020
2036
  opacity: .75
2021
2037
  },
2022
- children: o
2038
+ children: s
2023
2039
  }),
2024
- a && /* @__PURE__ */ c("div", {
2040
+ a && /* @__PURE__ */ l("div", {
2025
2041
  style: {
2026
2042
  marginTop: 6,
2027
2043
  fontSize: 14,
2028
2044
  lineHeight: 1.55,
2029
2045
  opacity: .85
2030
2046
  },
2031
- children: ve(a)
2047
+ children: Se(a)
2032
2048
  })
2033
2049
  ]
2034
2050
  })]
@@ -2036,12 +2052,12 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2036
2052
  })
2037
2053
  });
2038
2054
  }
2039
- function ut({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2040
- return e.length ? /* @__PURE__ */ c("nav", {
2055
+ function mt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2056
+ return e.length ? /* @__PURE__ */ l("nav", {
2041
2057
  ref: r,
2042
2058
  "aria-label": "Breadcrumb",
2043
- style: { ...p(n) },
2044
- children: /* @__PURE__ */ c("ol", {
2059
+ style: { ...m(n) },
2060
+ children: /* @__PURE__ */ l("ol", {
2045
2061
  style: {
2046
2062
  display: "flex",
2047
2063
  flexWrap: "wrap",
@@ -2054,25 +2070,25 @@ function ut({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2054
2070
  },
2055
2071
  children: e.map((n, r) => {
2056
2072
  let i = r === e.length - 1;
2057
- return /* @__PURE__ */ l("li", {
2073
+ return /* @__PURE__ */ u("li", {
2058
2074
  style: {
2059
2075
  display: "flex",
2060
2076
  alignItems: "center",
2061
2077
  gap: 8,
2062
2078
  minWidth: 0
2063
2079
  },
2064
- children: [r > 0 && /* @__PURE__ */ c("span", {
2080
+ children: [r > 0 && /* @__PURE__ */ l("span", {
2065
2081
  style: { opacity: .4 },
2066
2082
  "aria-hidden": !0,
2067
2083
  children: t
2068
- }), i || !n.href ? /* @__PURE__ */ c("span", {
2084
+ }), i || !n.href ? /* @__PURE__ */ l("span", {
2069
2085
  style: {
2070
2086
  fontWeight: i ? 600 : 400,
2071
2087
  opacity: i ? 1 : .7
2072
2088
  },
2073
2089
  "aria-current": i ? "page" : void 0,
2074
2090
  children: n.label
2075
- }) : /* @__PURE__ */ c("a", {
2091
+ }) : /* @__PURE__ */ l("a", {
2076
2092
  href: n.href,
2077
2093
  style: {
2078
2094
  color: "inherit",
@@ -2086,8 +2102,8 @@ function ut({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2086
2102
  })
2087
2103
  }) : null;
2088
2104
  }
2089
- function dt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2090
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), u = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
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) => ({
2091
2107
  display: "inline-flex",
2092
2108
  alignItems: "center",
2093
2109
  justifyContent: "center",
@@ -2101,7 +2117,7 @@ function dt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2101
2117
  background: e ? "var(--page-accent, #111827)" : "transparent",
2102
2118
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2103
2119
  });
2104
- return /* @__PURE__ */ l("nav", {
2120
+ return /* @__PURE__ */ u("nav", {
2105
2121
  ref: a,
2106
2122
  "aria-label": "Pagination",
2107
2123
  style: {
@@ -2109,11 +2125,11 @@ function dt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2109
2125
  flexWrap: "wrap",
2110
2126
  gap: 8,
2111
2127
  alignItems: "center",
2112
- ...p(i)
2128
+ ...m(i)
2113
2129
  },
2114
2130
  children: [
2115
- n && /* @__PURE__ */ c("a", {
2116
- href: s > 1 ? u(s - 1) : "#",
2131
+ n && /* @__PURE__ */ l("a", {
2132
+ href: s > 1 ? c(s - 1) : "#",
2117
2133
  "aria-label": "Previous",
2118
2134
  style: {
2119
2135
  ...d(!1),
@@ -2121,14 +2137,14 @@ function dt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2121
2137
  },
2122
2138
  children: "‹"
2123
2139
  }),
2124
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ c("a", {
2125
- href: u(e),
2140
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("a", {
2141
+ href: c(e),
2126
2142
  "aria-current": e === s ? "page" : void 0,
2127
2143
  style: d(e === s),
2128
2144
  children: e
2129
2145
  }, e)),
2130
- n && /* @__PURE__ */ c("a", {
2131
- href: s < o ? u(s + 1) : "#",
2146
+ n && /* @__PURE__ */ l("a", {
2147
+ href: s < o ? c(s + 1) : "#",
2132
2148
  "aria-label": "Next",
2133
2149
  style: {
2134
2150
  ...d(!1),
@@ -2139,7 +2155,7 @@ function dt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2139
2155
  ]
2140
2156
  });
2141
2157
  }
2142
- function ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2158
+ function gt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2143
2159
  if (!t.length) return null;
2144
2160
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2145
2161
  width: 32,
@@ -2156,7 +2172,7 @@ function ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2156
2172
  border: e === "todo" ? "1px solid rgba(148, 163, 184, 0.5)" : "1px solid transparent",
2157
2173
  opacity: e === "todo" ? .6 : 1,
2158
2174
  boxShadow: e === "active" ? "0 0 0 4px rgba(99, 102, 241, 0.2)" : "none"
2159
- }), u = (e) => ({
2175
+ }), c = (e) => ({
2160
2176
  flexGrow: 1,
2161
2177
  alignSelf: "center",
2162
2178
  background: e ? "var(--page-accent, #111827)" : "rgba(148, 163, 184, 0.4)",
@@ -2170,21 +2186,21 @@ function ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2170
2186
  minWidth: 24
2171
2187
  }
2172
2188
  });
2173
- return /* @__PURE__ */ c("div", {
2189
+ return /* @__PURE__ */ l("div", {
2174
2190
  ref: a,
2175
2191
  style: {
2176
2192
  display: "flex",
2177
2193
  flexDirection: r ? "column" : "row",
2178
2194
  alignItems: r ? "stretch" : "flex-start",
2179
2195
  gap: r ? 4 : 8,
2180
- ...p(i)
2196
+ ...m(i)
2181
2197
  },
2182
2198
  children: t.map((t, n) => {
2183
2199
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
2184
- return /* @__PURE__ */ l(e, { children: [n > 0 && /* @__PURE__ */ c("div", {
2185
- style: u(i <= o),
2200
+ return /* @__PURE__ */ u(e, { children: [n > 0 && /* @__PURE__ */ l("div", {
2201
+ style: c(i <= o),
2186
2202
  "aria-hidden": !0
2187
- }), /* @__PURE__ */ l("div", {
2203
+ }), /* @__PURE__ */ u("div", {
2188
2204
  style: {
2189
2205
  display: "flex",
2190
2206
  flexDirection: r ? "row" : "column",
@@ -2193,19 +2209,19 @@ function ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2193
2209
  minWidth: 0,
2194
2210
  textAlign: r ? "left" : "center"
2195
2211
  },
2196
- children: [/* @__PURE__ */ c("div", {
2212
+ children: [/* @__PURE__ */ l("div", {
2197
2213
  style: s(a),
2198
2214
  children: a === "done" ? "✓" : i
2199
- }), /* @__PURE__ */ l("div", {
2215
+ }), /* @__PURE__ */ u("div", {
2200
2216
  style: { minWidth: 0 },
2201
- children: [/* @__PURE__ */ c("div", {
2217
+ children: [/* @__PURE__ */ l("div", {
2202
2218
  style: {
2203
2219
  fontSize: 13,
2204
2220
  fontWeight: a === "active" ? 700 : 500,
2205
2221
  opacity: a === "todo" ? .6 : 1
2206
2222
  },
2207
2223
  children: t.label
2208
- }), t.description && /* @__PURE__ */ c("div", {
2224
+ }), t.description && /* @__PURE__ */ l("div", {
2209
2225
  style: {
2210
2226
  fontSize: 12,
2211
2227
  opacity: .6
@@ -2217,8 +2233,422 @@ function ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2217
2233
  })
2218
2234
  });
2219
2235
  }
2220
- function pt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: m }) {
2221
- let { tenant: h, apiUrl: g } = n(V), _ = n(H)?.[i], [v, y] = o(null);
2236
+ var _t = {
2237
+ small: {
2238
+ w: 132,
2239
+ h: 46,
2240
+ name: 11.5,
2241
+ title: 10,
2242
+ avatar: 28
2243
+ },
2244
+ medium: {
2245
+ w: 168,
2246
+ h: 56,
2247
+ name: 13,
2248
+ title: 11,
2249
+ avatar: 36
2250
+ },
2251
+ large: {
2252
+ w: 210,
2253
+ h: 70,
2254
+ name: 15.5,
2255
+ title: 12.5,
2256
+ avatar: 46
2257
+ }
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 = [];
2262
+ 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
+ let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2264
+ if (t.has(e.id)) return 0;
2265
+ t.add(e.id);
2266
+ let n = (l.get(e.id) ?? []).reduce((e, n, r) => e + f(n, t) + (r ? a : 0), 0), r = Math.max(i, n);
2267
+ return d.set(e.id, r), r;
2268
+ };
2269
+ u.forEach((e) => f(e, /* @__PURE__ */ new Set()));
2270
+ let p = [], m = [], h = 0, g = (e, t, s, c) => {
2271
+ if (c.has(e.id)) return;
2272
+ c.add(e.id);
2273
+ let u = t + ((d.get(e.id) ?? i) - i) / 2, f = s * o, _ = n ? f : u, v = n ? u : f;
2274
+ p.push({
2275
+ node: e,
2276
+ x: _,
2277
+ y: v
2278
+ }), h = Math.max(h, f + (n ? r.w : r.h));
2279
+ let y = t;
2280
+ for (let t of l.get(e.id) ?? []) {
2281
+ let e = y + ((d.get(t.id) ?? i) - i) / 2 + i / 2, l = (s + 1) * o;
2282
+ m.push(n ? {
2283
+ from: {
2284
+ x: f + r.w,
2285
+ y: u + r.h / 2
2286
+ },
2287
+ to: {
2288
+ x: l,
2289
+ y: e
2290
+ }
2291
+ } : {
2292
+ from: {
2293
+ x: u + r.w / 2,
2294
+ y: f + r.h
2295
+ },
2296
+ to: {
2297
+ x: e,
2298
+ y: l
2299
+ }
2300
+ }), g(t, y, s + 1, c), y += (d.get(t.id) ?? i) + a;
2301
+ }
2302
+ }, _ = 0, v = /* @__PURE__ */ new Set();
2303
+ for (let e of u) g(e, _, 0, v), _ += (d.get(e.id) ?? i) + a;
2304
+ let y = Math.max(_ - a, i);
2305
+ return {
2306
+ boxes: p,
2307
+ links: m,
2308
+ width: n ? Math.max(h, r.w) : y,
2309
+ height: n ? y : Math.max(h, r.h),
2310
+ horizontal: n
2311
+ };
2312
+ }
2313
+ var bt = (e, t) => {
2314
+ let n = String(e ?? "");
2315
+ return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2316
+ }, xt = (e) => {
2317
+ let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2318
+ if (!t) return "#ffffff";
2319
+ let n = t[1];
2320
+ n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2321
+ let r = parseInt(n, 16);
2322
+ 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 = {}) {
2325
+ 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
+ return n.map((e) => {
2327
+ let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
2328
+ return {
2329
+ id: e.id,
2330
+ name: i(n[t.nameField || "name"]) || i(n.name) || "Untitled",
2331
+ title: t.titleField ? i(n[t.titleField]) : "",
2332
+ photo: t.photoField && r(n[t.photoField]) || "",
2333
+ parent: t.parentField ? o : null,
2334
+ cv: t.cvField ? i(n[t.cvField]) : "",
2335
+ href: t.hrefField ? i(n[t.hrefField]) : ""
2336
+ };
2337
+ });
2338
+ }
2339
+ var wt = {
2340
+ size: 36,
2341
+ pad: 10
2342
+ };
2343
+ function Tt({ node: e, onClose: t }) {
2344
+ return r(() => {
2345
+ let e = (e) => e.key === "Escape" && t();
2346
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2347
+ }, [t]), /* @__PURE__ */ l("div", {
2348
+ onClick: t,
2349
+ role: "dialog",
2350
+ "aria-modal": "true",
2351
+ "aria-label": e.name,
2352
+ style: {
2353
+ position: "fixed",
2354
+ inset: 0,
2355
+ zIndex: 1e3,
2356
+ background: "rgba(15, 23, 42, 0.55)",
2357
+ display: "flex",
2358
+ alignItems: "center",
2359
+ justifyContent: "center",
2360
+ padding: 16
2361
+ },
2362
+ children: /* @__PURE__ */ u("div", {
2363
+ onClick: (e) => e.stopPropagation(),
2364
+ style: {
2365
+ background: "var(--page-bg, #ffffff)",
2366
+ color: "var(--page-text, #111827)",
2367
+ borderRadius: 14,
2368
+ maxWidth: 420,
2369
+ width: "100%",
2370
+ maxHeight: "80vh",
2371
+ overflowY: "auto",
2372
+ padding: 24,
2373
+ position: "relative",
2374
+ boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
2375
+ },
2376
+ children: [
2377
+ /* @__PURE__ */ l("button", {
2378
+ type: "button",
2379
+ "aria-label": "Close",
2380
+ onClick: t,
2381
+ style: {
2382
+ position: "absolute",
2383
+ top: 10,
2384
+ right: 10,
2385
+ width: 30,
2386
+ height: 30,
2387
+ border: 0,
2388
+ borderRadius: 8,
2389
+ background: "transparent",
2390
+ color: "inherit",
2391
+ fontSize: 18,
2392
+ lineHeight: 1,
2393
+ cursor: "pointer",
2394
+ opacity: .6
2395
+ },
2396
+ children: "×"
2397
+ }),
2398
+ /* @__PURE__ */ u("div", {
2399
+ style: {
2400
+ display: "flex",
2401
+ alignItems: "center",
2402
+ gap: 14,
2403
+ marginBottom: e.cv ? 14 : 0
2404
+ },
2405
+ children: [e.photo && /* @__PURE__ */ l("img", {
2406
+ src: e.photo,
2407
+ alt: "",
2408
+ style: {
2409
+ width: 72,
2410
+ height: 72,
2411
+ borderRadius: "50%",
2412
+ objectFit: "cover",
2413
+ flexShrink: 0
2414
+ }
2415
+ }), /* @__PURE__ */ u("div", {
2416
+ style: { minWidth: 0 },
2417
+ children: [/* @__PURE__ */ l("div", {
2418
+ style: {
2419
+ fontSize: 18,
2420
+ fontWeight: 700
2421
+ },
2422
+ children: e.name
2423
+ }), e.title && /* @__PURE__ */ l("div", {
2424
+ style: {
2425
+ fontSize: 13,
2426
+ opacity: .65
2427
+ },
2428
+ children: e.title
2429
+ })]
2430
+ })]
2431
+ }),
2432
+ e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ l("p", {
2433
+ style: {
2434
+ fontSize: 14,
2435
+ lineHeight: 1.6,
2436
+ margin: "0 0 10px"
2437
+ },
2438
+ children: e
2439
+ }, t)),
2440
+ e.href && /* @__PURE__ */ l("a", {
2441
+ href: e.href,
2442
+ target: "_blank",
2443
+ rel: "noopener noreferrer",
2444
+ style: {
2445
+ display: "inline-block",
2446
+ marginTop: 6,
2447
+ padding: "8px 14px",
2448
+ borderRadius: 8,
2449
+ fontSize: 13,
2450
+ fontWeight: 600,
2451
+ textDecoration: "none",
2452
+ background: "var(--page-accent, #4f46e5)",
2453
+ color: "var(--page-accent-text, #ffffff)"
2454
+ },
2455
+ children: "Open profile ↗"
2456
+ })
2457
+ ]
2458
+ })
2459
+ });
2460
+ }
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(() => {
2464
+ if (!t || E) return;
2465
+ let e = !0;
2466
+ return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
2467
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
2468
+ e && O(n);
2469
+ }).catch(() => e && O([])), () => {
2470
+ e = !1;
2471
+ };
2472
+ }, [
2473
+ t,
2474
+ w,
2475
+ T,
2476
+ E
2477
+ ]);
2478
+ let k = t ? Ct(E ?? D ?? [], {
2479
+ nameField: a,
2480
+ titleField: o,
2481
+ photoField: d,
2482
+ parentField: f,
2483
+ cvField: p,
2484
+ hrefField: h
2485
+ }) : e, A = vt(g), { boxes: j, links: M, width: N, height: P } = yt(k, {
2486
+ size: g,
2487
+ horizontal: _
2488
+ });
2489
+ if (!j.length) return !b && t ? /* @__PURE__ */ u("div", {
2490
+ ref: y,
2491
+ style: {
2492
+ padding: 18,
2493
+ border: "1px dashed rgba(148, 163, 184, 0.6)",
2494
+ borderRadius: 10,
2495
+ fontSize: 13,
2496
+ opacity: .7,
2497
+ textAlign: "center",
2498
+ ...m(v)
2499
+ },
2500
+ children: [
2501
+ "Org Chart — no published entries in “",
2502
+ t,
2503
+ "” yet"
2504
+ ]
2505
+ }) : null;
2506
+ let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
2507
+ return /* @__PURE__ */ u("div", {
2508
+ ref: y,
2509
+ style: {
2510
+ maxWidth: "100%",
2511
+ overflowX: "auto",
2512
+ ...m(v)
2513
+ },
2514
+ children: [/* @__PURE__ */ u("svg", {
2515
+ viewBox: `0 0 ${N} ${P}`,
2516
+ role: "img",
2517
+ "aria-label": "Organization chart",
2518
+ style: {
2519
+ display: "block",
2520
+ width: "100%",
2521
+ maxWidth: N,
2522
+ height: "auto",
2523
+ margin: "0 auto"
2524
+ },
2525
+ children: [M.map((e, t) => /* @__PURE__ */ l("path", {
2526
+ 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
+ fill: "none",
2528
+ stroke: "rgba(148, 163, 184, 0.7)",
2529
+ strokeWidth: "1.5"
2530
+ }, 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", {
2533
+ onClick: f ? p : void 0,
2534
+ style: f ? { cursor: "pointer" } : void 0,
2535
+ role: f ? "button" : void 0,
2536
+ "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
2537
+ children: [
2538
+ i && e.gradient ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("linearGradient", {
2539
+ id: `${x}-${e.id}-grad`,
2540
+ x1: "0",
2541
+ y1: "0",
2542
+ x2: "0",
2543
+ y2: "1",
2544
+ children: [/* @__PURE__ */ l("stop", {
2545
+ offset: "0%",
2546
+ stopColor: e.color || "var(--page-accent, #4f46e5)"
2547
+ }), /* @__PURE__ */ l("stop", {
2548
+ offset: "100%",
2549
+ stopColor: e.color2
2550
+ })]
2551
+ }), /* @__PURE__ */ l("rect", {
2552
+ x: t,
2553
+ y: n,
2554
+ width: A.w,
2555
+ height: A.h,
2556
+ rx: "10",
2557
+ fill: `url(#${x}-${e.id}-grad)`
2558
+ })] }) : i ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2559
+ id: `${x}-${e.id}-box`,
2560
+ children: /* @__PURE__ */ l("rect", {
2561
+ x: t,
2562
+ y: n,
2563
+ width: A.w,
2564
+ height: A.h,
2565
+ rx: "10"
2566
+ })
2567
+ }), /* @__PURE__ */ u("g", {
2568
+ clipPath: `url(#${x}-${e.id}-box)`,
2569
+ children: [/* @__PURE__ */ l("rect", {
2570
+ x: t,
2571
+ y: n,
2572
+ width: A.w,
2573
+ height: _,
2574
+ fill: o
2575
+ }), /* @__PURE__ */ l("rect", {
2576
+ x: t,
2577
+ y: n + _,
2578
+ width: A.w,
2579
+ height: A.h - _,
2580
+ fill: e.color2
2581
+ })]
2582
+ })] }) : /* @__PURE__ */ l("rect", {
2583
+ x: t,
2584
+ y: n,
2585
+ width: A.w,
2586
+ height: A.h,
2587
+ rx: "10",
2588
+ fill: o,
2589
+ stroke: a ? "none" : "var(--page-accent, #4f46e5)",
2590
+ strokeWidth: a ? 0 : 1.5
2591
+ }),
2592
+ e.photo && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2593
+ id: `${x}-${e.id}`,
2594
+ children: /* @__PURE__ */ l("circle", {
2595
+ cx: t + wt.pad + A.avatar / 2,
2596
+ cy: n + A.h / 2,
2597
+ r: A.avatar / 2
2598
+ })
2599
+ }), /* @__PURE__ */ l("image", {
2600
+ href: e.photo,
2601
+ x: t + wt.pad,
2602
+ y: n + (A.h - A.avatar) / 2,
2603
+ width: A.avatar,
2604
+ height: A.avatar,
2605
+ preserveAspectRatio: "xMidYMid slice",
2606
+ clipPath: `url(#${x}-${e.id})`
2607
+ })] }),
2608
+ i && !e.gradient ? /* @__PURE__ */ u(c, { children: [e.title && /* @__PURE__ */ l("text", {
2609
+ x: m,
2610
+ y: n + _ / 2 + A.title * .35,
2611
+ textAnchor: h,
2612
+ fontSize: A.title,
2613
+ fontWeight: "600",
2614
+ fill: s,
2615
+ children: bt(e.title, g + 4)
2616
+ }), e.name && /* @__PURE__ */ l("text", {
2617
+ x: m,
2618
+ y: n + _ + _ / 2 + A.name * .35,
2619
+ textAnchor: h,
2620
+ fontSize: A.name,
2621
+ fontWeight: "600",
2622
+ fill: d,
2623
+ children: bt(e.name, g)
2624
+ })] }) : /* @__PURE__ */ u(c, { children: [v[0] && /* @__PURE__ */ l("text", {
2625
+ x: m,
2626
+ y: n + (v[1] ? A.h * .43 : A.h * .57),
2627
+ textAnchor: h,
2628
+ fontSize: A.name,
2629
+ fontWeight: "600",
2630
+ fill: s,
2631
+ children: bt(v[0], g)
2632
+ }), v[1] && /* @__PURE__ */ l("text", {
2633
+ x: m,
2634
+ y: n + A.h * .73,
2635
+ textAnchor: h,
2636
+ fontSize: A.title,
2637
+ opacity: "0.7",
2638
+ fill: s,
2639
+ children: bt(v[1], g + 4)
2640
+ })] })
2641
+ ]
2642
+ }, e.id);
2643
+ })]
2644
+ }), S && /* @__PURE__ */ l(Tt, {
2645
+ node: S,
2646
+ onClose: () => C(null)
2647
+ })]
2648
+ });
2649
+ }
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);
2222
2652
  if (r(() => {
2223
2653
  if (!i || _) return;
2224
2654
  let e = !0, t = i.startsWith("api:") ? `${g}/data/${encodeURIComponent(i.slice(4))}` : `${g}/dynamic/${encodeURIComponent(i)}`;
@@ -2231,22 +2661,22 @@ function pt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2231
2661
  g,
2232
2662
  _
2233
2663
  ]), !e.length) return null;
2234
- let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => G(W(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = u ? { border: C } : { borderBottom: C };
2235
- return /* @__PURE__ */ c("div", {
2236
- ref: m,
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", {
2666
+ ref: p,
2237
2667
  style: {
2238
2668
  width: "100%",
2239
2669
  overflowX: "auto",
2240
- ...p(f)
2670
+ ...m(f)
2241
2671
  },
2242
- children: /* @__PURE__ */ l("table", {
2672
+ children: /* @__PURE__ */ u("table", {
2243
2673
  style: {
2244
2674
  width: "100%",
2245
2675
  borderCollapse: "collapse",
2246
2676
  fontSize: 14,
2247
- ...u ? { border: C } : {}
2677
+ ...c ? { border: C } : {}
2248
2678
  },
2249
- children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
2679
+ children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((e, t) => /* @__PURE__ */ l("th", {
2250
2680
  style: {
2251
2681
  textAlign: "left",
2252
2682
  fontWeight: 600,
@@ -2255,9 +2685,9 @@ function pt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2255
2685
  ...w
2256
2686
  },
2257
2687
  children: e.label ?? e
2258
- }, t)) }) }), /* @__PURE__ */ c("tbody", { children: x.map((t, n) => /* @__PURE__ */ c("tr", {
2259
- style: s && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2260
- children: e.map((e, n) => /* @__PURE__ */ c("td", {
2688
+ }, t)) }) }), /* @__PURE__ */ l("tbody", { children: x.map((t, n) => /* @__PURE__ */ l("tr", {
2689
+ style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2690
+ children: e.map((e, n) => /* @__PURE__ */ l("td", {
2261
2691
  style: {
2262
2692
  padding: S,
2263
2693
  ...w
@@ -2268,148 +2698,154 @@ function pt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2268
2698
  })
2269
2699
  });
2270
2700
  }
2271
- var mt = {
2272
- PageRoot: le,
2273
- Section: ue,
2274
- Container: de,
2275
- Heading: fe,
2276
- TextBlock: Ce,
2277
- ButtonBlock: Ee,
2278
- ImageBlock: De,
2279
- Spacer: Ne,
2280
- Divider: Pe,
2281
- SliderBlock: Be,
2282
- CanvasSlider: Ve,
2283
- TabsBlock: We,
2284
- QuickStack: ct,
2285
- CollectionList: lt,
2286
- BreadcrumbsBlock: ut,
2287
- PaginationBlock: dt,
2288
- StepperBlock: ft,
2289
- TableBlock: pt,
2290
- AccordionBlock: Ge,
2291
- NavbarBlock: Ue,
2292
- ListBlock: Se,
2293
- TextSpan: he,
2294
- QuoteBlock: xe,
2295
- TextLink: Te,
2296
- RichTextBlock: ye,
2297
- RichContentBlock: ye,
2298
- VideoBlock: Oe,
2299
- YouTubeBlock: Ae,
2300
- IframeBlock: je,
2301
- EmbedBlock: Me,
2302
- FormBlock: et,
2303
- FormLabel: tt,
2304
- FormInput: nt,
2305
- FormTextarea: rt,
2306
- FormCheckbox: (e) => /* @__PURE__ */ c(it, {
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, {
2307
2738
  kind: "checkbox",
2308
2739
  ...e
2309
2740
  }),
2310
- FormRadio: (e) => /* @__PURE__ */ c(it, {
2741
+ FormRadio: (e) => /* @__PURE__ */ l(ct, {
2311
2742
  kind: "radio",
2312
2743
  ...e
2313
2744
  }),
2314
- FormSelect: at,
2315
- FormFile: ot,
2316
- FormSubmit: st
2745
+ FormSelect: lt,
2746
+ FormFile: ut,
2747
+ FormSubmit: dt
2317
2748
  };
2318
2749
  //#endregion
2319
2750
  //#region ../ui/src/components/builder/render.jsx
2320
2751
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2321
2752
  let o = n[t];
2322
2753
  if (!o || o.hidden) return null;
2323
- let s = o.type?.resolvedName, l = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2754
+ let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2324
2755
  if (s === "ComponentInstance") {
2325
2756
  let n = o.props?.componentId, s = r?.[n];
2326
2757
  if (!s?.template || i.has(n)) return null;
2327
- let l = new Set(i).add(n);
2328
- return /* @__PURE__ */ c(e, { children: $(s.template.rootId, s.template.nodes, r, l, a) }, t);
2758
+ let c = new Set(i).add(n);
2759
+ return /* @__PURE__ */ l(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
2329
2760
  }
2330
- let u = mt[s];
2761
+ let u = Ot[s];
2331
2762
  if (!u) return null;
2332
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;
2333
- return /* @__PURE__ */ c(u, {
2334
- ...l,
2764
+ return /* @__PURE__ */ l(u, {
2765
+ ...c,
2335
2766
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2336
2767
  linked: p,
2337
2768
  nodeRef: (e) => {
2338
- e && (e.setAttribute("data-wb", t), _(e, l));
2769
+ e && (e.setAttribute("data-wb", t), v(e, c));
2339
2770
  },
2340
2771
  children: d.length ? d : void 0
2341
2772
  }, t);
2342
2773
  }
2343
2774
  //#endregion
2344
2775
  //#region ../ui/src/components/builder/PageRenderer.jsx
2345
- var ht = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2346
- function gt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: f }) {
2347
- let p = s?.js?.trim();
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();
2348
2779
  if (r(() => {
2349
- if (!p) return;
2780
+ if (!h) return;
2350
2781
  let e = document.createElement("script");
2351
- return e.text = p, document.body.appendChild(e), () => e.remove();
2352
- }, [p]), !e?.ROOT) return null;
2353
- let m = {
2782
+ return e.text = h, document.body.appendChild(e), () => e.remove();
2783
+ }, [h]), !e?.ROOT) return null;
2784
+ let g = {
2785
+ lang: p || void 0,
2786
+ dir: oe(m, p)
2787
+ }, _ = {
2354
2788
  minHeight: "100%",
2355
2789
  display: "flex",
2356
2790
  flexDirection: "column"
2357
- }, h = $("ROOT", e, n), g = i(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), _ = T(e, n), v = w(e, n), y = s?.css?.trim(), b = B(e, n).map((e) => /* @__PURE__ */ c("link", {
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", {
2358
2792
  rel: "stylesheet",
2359
2793
  precedence: "default",
2360
- href: te(e)
2794
+ href: ne(e)
2361
2795
  }, e));
2362
- if (a !== "auto") return /* @__PURE__ */ c(V.Provider, {
2796
+ if (i !== "auto") return /* @__PURE__ */ l(V.Provider, {
2363
2797
  value: {
2364
- tenant: u || "",
2798
+ tenant: c || "",
2365
2799
  apiUrl: d || "/api"
2366
2800
  },
2367
- children: /* @__PURE__ */ c(H.Provider, {
2801
+ children: /* @__PURE__ */ l(H.Provider, {
2368
2802
  value: f ?? null,
2369
- children: /* @__PURE__ */ c(U.Provider, {
2370
- value: g,
2371
- children: /* @__PURE__ */ l("div", {
2803
+ children: /* @__PURE__ */ l(U.Provider, {
2804
+ value: y,
2805
+ children: /* @__PURE__ */ u("div", {
2806
+ ...g,
2372
2807
  style: {
2373
- ...m,
2374
- ...F(t, a),
2808
+ ..._,
2809
+ ...I(t, i),
2375
2810
  ...o
2376
2811
  },
2377
2812
  children: [
2378
- b,
2379
- _ && /* @__PURE__ */ c("style", { children: _ }),
2380
- v && /* @__PURE__ */ c("style", { children: v }),
2381
- y && /* @__PURE__ */ c("style", { children: y }),
2382
- h
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
2383
2818
  ]
2384
2819
  })
2385
2820
  })
2386
2821
  })
2387
2822
  });
2388
- let x = M(t);
2389
- return /* @__PURE__ */ c(V.Provider, {
2823
+ let w = N(t);
2824
+ return /* @__PURE__ */ l(V.Provider, {
2390
2825
  value: {
2391
- tenant: u || "",
2826
+ tenant: c || "",
2392
2827
  apiUrl: d || "/api"
2393
2828
  },
2394
- children: /* @__PURE__ */ c(H.Provider, {
2829
+ children: /* @__PURE__ */ l(H.Provider, {
2395
2830
  value: f ?? null,
2396
- children: /* @__PURE__ */ c(U.Provider, {
2397
- value: g,
2398
- children: /* @__PURE__ */ l("div", {
2831
+ children: /* @__PURE__ */ l(U.Provider, {
2832
+ value: y,
2833
+ children: /* @__PURE__ */ u("div", {
2834
+ ...g,
2399
2835
  className: "webim-page",
2400
2836
  style: {
2401
- ...m,
2402
- ...P(t),
2837
+ ..._,
2838
+ ...F(t),
2403
2839
  ...o
2404
2840
  },
2405
2841
  children: [
2406
- /* @__PURE__ */ c("style", { children: `.webim-page { ${ht(N(x.light))} }
2407
- @media (prefers-color-scheme: dark) { .webim-page { ${ht(N(x.dark))} } }` }),
2408
- b,
2409
- _ && /* @__PURE__ */ c("style", { children: _ }),
2410
- v && /* @__PURE__ */ c("style", { children: v }),
2411
- y && /* @__PURE__ */ c("style", { children: y }),
2412
- h
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
2413
2849
  ]
2414
2850
  })
2415
2851
  })
@@ -2418,8 +2854,8 @@ function gt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, cu
2418
2854
  }
2419
2855
  //#endregion
2420
2856
  //#region src/WebimContent.jsx
2421
- function _t({ bundle: e, mode: t = "auto", style: n }) {
2422
- return e?.blocks?.ROOT ? /* @__PURE__ */ c(gt, {
2857
+ function jt({ bundle: e, mode: t = "auto", style: n }) {
2858
+ return e?.blocks?.ROOT ? /* @__PURE__ */ l(At, {
2423
2859
  blocks: e.blocks,
2424
2860
  theme: e.theme,
2425
2861
  components: e.components,
@@ -2427,38 +2863,41 @@ function _t({ bundle: e, mode: t = "auto", style: n }) {
2427
2863
  tenant: e.tenant,
2428
2864
  apiUrl: e.apiUrl,
2429
2865
  datasets: e.datasets,
2866
+ locale: e.locale,
2867
+ direction: e.direction,
2430
2868
  mode: t,
2431
2869
  style: n
2432
2870
  }) : null;
2433
2871
  }
2434
2872
  //#endregion
2435
2873
  //#region src/WebimPage.jsx
2436
- function vt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "auto", style: u, fallback: d = null, errorFallback: f = null, onLoad: p, onError: m }) {
2437
- let [h, g] = o({ status: "loading" }), _ = a({
2438
- onLoad: p,
2439
- onError: m
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({
2876
+ onLoad: m,
2877
+ onError: h
2440
2878
  });
2441
- return _.current = {
2442
- onLoad: p,
2443
- onError: m
2879
+ return v.current = {
2880
+ onLoad: m,
2881
+ onError: h
2444
2882
  }, r(() => {
2445
2883
  let r = !0;
2446
- return g({ status: "loading" }), z({
2884
+ return _({ status: "loading" }), z({
2447
2885
  apiUrl: e,
2448
2886
  tenant: t,
2449
2887
  slug: n,
2450
2888
  locale: i,
2451
- preview: s
2889
+ preview: a,
2890
+ token: c
2452
2891
  }).then((e) => {
2453
- r && (g({
2892
+ r && (_({
2454
2893
  status: "ready",
2455
2894
  bundle: e
2456
- }), _.current.onLoad?.(e));
2895
+ }), v.current.onLoad?.(e));
2457
2896
  }).catch((e) => {
2458
- r && (g({
2897
+ r && (_({
2459
2898
  status: "error",
2460
2899
  error: e
2461
- }), _.current.onError?.(e));
2900
+ }), v.current.onError?.(e));
2462
2901
  }), () => {
2463
2902
  r = !1;
2464
2903
  };
@@ -2467,12 +2906,13 @@ function vt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "a
2467
2906
  t,
2468
2907
  n,
2469
2908
  i,
2470
- s
2471
- ]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ c(_t, {
2472
- bundle: h.bundle,
2473
- mode: l,
2474
- style: u
2909
+ a,
2910
+ c
2911
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ l(jt, {
2912
+ bundle: g.bundle,
2913
+ mode: u,
2914
+ style: d
2475
2915
  });
2476
2916
  }
2477
2917
  //#endregion
2478
- export { gt as PageRenderer, _t as WebimContent, vt as WebimPage, z as fetchPage, ve as renderRichContent, I as resolveTheme };
2918
+ export { At as PageRenderer, jt as WebimContent, Mt as WebimPage, z as fetchPage, Se as renderRichContent, L as resolveTheme };