webim-adapter 0.7.0 → 0.9.0

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