webim-adapter 0.4.0 → 0.6.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,6 +1,19 @@
1
1
  import { renderToStaticMarkup as e } from "react-dom/server";
2
2
  import { Fragment as t, createContext as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
3
3
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
+ //#region ../ui/src/components/builder/locale.js
5
+ var u = /* @__PURE__ */ new Set([
6
+ "ar",
7
+ "he",
8
+ "fa",
9
+ "ur",
10
+ "ps",
11
+ "sd",
12
+ "ug",
13
+ "yi",
14
+ "dv",
15
+ "ckb"
16
+ ]), d = (e) => u.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", f = (e, t) => e === "ltr" || e === "rtl" ? e : t ? d(t) : void 0;
4
17
  new Map([
5
18
  {
6
19
  family: "Bebas Neue",
@@ -107,14 +120,14 @@ new Map([
107
120
  fallback: "sans-serif"
108
121
  }
109
122
  ].map((e) => [e.family, e]));
110
- function u(e) {
123
+ function p(e) {
111
124
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
112
125
  }
113
- var d = (e) => u([e]), f = (e) => {
126
+ var m = (e) => p([e]), h = (e) => {
114
127
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
115
128
  return t ? t[1] : null;
116
129
  };
117
- function p(e, t) {
130
+ function g(e, t) {
118
131
  let n = /* @__PURE__ */ new Set(), r = (e) => {
119
132
  for (let t of Object.values(e || {})) for (let e of [
120
133
  "style",
@@ -122,7 +135,7 @@ function p(e, t) {
122
135
  "pressed",
123
136
  "focused"
124
137
  ]) {
125
- let r = f(t.props?.[e]?.fontFamily);
138
+ let r = h(t.props?.[e]?.fontFamily);
126
139
  r && n.add(r);
127
140
  }
128
141
  };
@@ -132,36 +145,36 @@ function p(e, t) {
132
145
  }
133
146
  //#endregion
134
147
  //#region ../ui/src/components/builder/styles.js
135
- var m = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.top.right.bottom.left".split(".")), h = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, g = [
148
+ var _ = /* @__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(".")), v = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, y = [
136
149
  "borderWidth",
137
150
  "borderStyle",
138
151
  "borderColor",
139
152
  "borderRadius",
140
153
  "gap"
141
154
  ];
142
- function _(e) {
155
+ function b(e) {
143
156
  let t = {};
144
- for (let n of g) {
157
+ for (let n of y) {
145
158
  let r = e?.[n];
146
- r != null && r !== "" && (t[n] = m.has(n) ? h(r) : r);
159
+ r != null && r !== "" && (t[n] = _.has(n) ? v(r) : r);
147
160
  }
148
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || g.includes(n) || (t[n] = m.has(n) ? h(r) : r);
161
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || y.includes(n) || (t[n] = _.has(n) ? v(r) : r);
149
162
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
150
163
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
151
164
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
152
165
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
153
- let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${h(e.x ?? 0)} ${h(e.y ?? 0)} ${h(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) => `${v(e.x ?? 0)} ${v(e.y ?? 0)} ${v(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
154
167
  [
155
168
  s,
156
169
  c,
157
170
  l,
158
171
  u
159
- ].some((e) => e !== void 0) && d.push(`${h(s ?? 0)} ${h(c ?? 0)} ${h(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
160
- let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${h(e.x ?? 0)}, ${h(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: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
172
+ ].some((e) => e !== void 0) && d.push(`${v(s ?? 0)} ${v(c ?? 0)} ${v(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(${v(e.x ?? 0)}, ${v(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: b, rotate: x, skewX: S, skewY: C } = t;
161
174
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
162
- let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
163
- (v !== void 0 || y !== void 0) && w.push(`translate(${h(v ?? 0)}, ${h(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), 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(" "));
164
- let T = (e) => `${e.inset ? "inset " : ""}${h(e.x ?? 0)} ${h(e.y ?? 0)} ${h(e.blur ?? 0)} ${h(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;
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(${v(h ?? 0)}, ${v(g ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), 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 " : ""}${v(e.x ?? 0)} ${v(e.y ?? 0)} ${v(e.blur ?? 0)} ${v(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;
165
178
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
166
179
  let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
167
180
  [
@@ -179,76 +192,76 @@ function _(e) {
179
192
  color: j,
180
193
  inset: M
181
194
  })), N.length && (t.boxShadow = N.join(", "));
182
- let P = (e) => e.type === "blur" ? `blur(${h(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;
195
+ let P = (e) => e.type === "blur" ? `blur(${v(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;
183
196
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
184
197
  let H = F(I);
185
- R !== void 0 && H.push(`blur(${h(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(" "));
186
- let te = F(L);
187
- te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
188
- let { textStrokeWidth: U, textStrokeColor: ne } = t;
189
- delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${h(U ?? 1)} ${ne || "currentColor"}`);
190
- let { clipText: W } = t;
191
- delete t.clipText, W && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
192
- let { transitions: re, transitionDuration: G, transitionEasing: ie, transitionProperty: K } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
198
+ R !== void 0 && H.push(`blur(${v(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(" "));
199
+ let U = F(L);
200
+ U.length && (t.backdropFilter = U.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
201
+ let { textStrokeWidth: W, textStrokeColor: G } = t;
202
+ delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || G !== void 0) && (t.WebkitTextStroke = `${v(W ?? 1)} ${G || "currentColor"}`);
203
+ let { clipText: te } = t;
204
+ delete t.clipText, te && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
+ let { transitions: K, transitionDuration: ne, transitionEasing: q, transitionProperty: re } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
193
206
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
194
- let q = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
195
- if (G !== void 0 && q.push(`${K || "all"} ${ae(G)} ${ie || "ease"}`), q.length && (t.transition = q.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
207
+ let J = (Array.isArray(K) ? K : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
208
+ if (ne !== void 0 && J.push(`${re || "all"} ${ie(ne)} ${q || "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) {
196
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})`;
197
210
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
198
211
  }
199
212
  delete t.backgroundVideo;
200
- let { overlayColor: J, overlayOpacity: Y } = t;
201
- if (delete t.overlayColor, delete t.overlayOpacity, J) {
202
- let e = `color-mix(in srgb, ${J} ${Y ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
213
+ let { overlayColor: Y, overlayOpacity: ae } = t;
214
+ if (delete t.overlayColor, delete t.overlayOpacity, Y) {
215
+ let e = `color-mix(in srgb, ${Y} ${ae ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
203
216
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
204
217
  }
205
218
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
206
219
  let { backgroundLayers: oe } = t;
207
220
  delete t.backgroundLayers;
208
- let se = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1);
209
- if (se.length) {
221
+ let X = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1);
222
+ if (X.length) {
210
223
  let e = [], n = [], r = [], i = [], a = [];
211
- for (let t of se) 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 X) 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");
212
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");
213
226
  else {
214
227
  if (!t.src) continue;
215
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${h(t.w ?? "auto")} ${h(t.h ?? "auto")}` : t.size || "cover"), r.push(`${h(t.posX ?? 0)} ${h(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" ? `${v(t.w ?? "auto")} ${v(t.h ?? "auto")}` : t.size || "cover"), r.push(`${v(t.posX ?? 0)} ${v(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
216
229
  }
217
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(", "));
218
231
  }
219
232
  return t;
220
233
  }
221
- var v = {
234
+ var x = {
222
235
  hover: ":hover",
223
236
  pressed: ":active",
224
237
  focused: ":focus"
225
- }, y = /* @__PURE__ */ new Set([
238
+ }, S = /* @__PURE__ */ new Set([
226
239
  "style",
227
240
  "class",
228
241
  "id",
229
242
  "data-wb",
230
243
  "data-wb-class",
231
244
  "data-slot"
232
- ]), b = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !y.has(e.toLowerCase());
233
- function x(e, t, n = []) {
245
+ ]), C = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !S.has(e.toLowerCase());
246
+ function w(e, t, n = []) {
234
247
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
235
248
  for (let t of n) e.removeAttribute(t);
236
249
  let r = [];
237
250
  for (let n of t.attributes ?? []) {
238
251
  let t = String(n?.name ?? "").trim();
239
- b(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
252
+ C(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
240
253
  }
241
254
  return r;
242
255
  }
243
- var S = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
244
- function C(e, t, n, r = !1) {
245
- let i = Object.entries(_(t)).map(([e, t]) => `${S(e)}: ${t} !important;`).join(" ");
256
+ var T = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
+ function E(e, t, n, r = !1) {
258
+ let i = Object.entries(b(t)).map(([e, t]) => `${T(e)}: ${t} !important;`).join(" ");
246
259
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
247
260
  }
248
- function w(e, t, n) {
249
- return Object.entries(v).map(([r, i]) => C(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
261
+ function D(e, t, n) {
262
+ return Object.entries(x).map(([r, i]) => E(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
250
263
  }
251
- var T = [
264
+ var O = [
252
265
  {
253
266
  key: "tablet",
254
267
  max: 991
@@ -261,17 +274,17 @@ var T = [
261
274
  key: "mobile",
262
275
  max: 478
263
276
  }
264
- ], E = (e) => Object.entries(_(e)).map(([e, t]) => `${S(e)}: ${t} !important;`).join(" ");
265
- function D(e, t) {
266
- return T.map(({ key: n, max: r }) => {
267
- let i = t?.[n] ? E(t[n]) : "";
277
+ ], k = (e) => Object.entries(b(e)).map(([e, t]) => `${T(e)}: ${t} !important;`).join(" ");
278
+ function A(e, t) {
279
+ return O.map(({ key: n, max: r }) => {
280
+ let i = t?.[n] ? k(t[n]) : "";
268
281
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
269
282
  }).filter(Boolean).join("\n");
270
283
  }
271
- function O(e, t) {
284
+ function j(e, t) {
272
285
  let n = [], r = (e) => {
273
286
  for (let [t, r] of Object.entries(e || {})) {
274
- let e = D(t, r.props);
287
+ let e = A(t, r.props);
275
288
  e && n.push(e);
276
289
  }
277
290
  };
@@ -279,10 +292,10 @@ function O(e, t) {
279
292
  for (let e of Object.values(t || {})) r(e.template?.nodes);
280
293
  return n.join("\n");
281
294
  }
282
- function k(e, t) {
295
+ function M(e, t) {
283
296
  let n = [], r = (e) => {
284
297
  for (let [t, r] of Object.entries(e || {})) {
285
- let e = w(t, r.props);
298
+ let e = D(t, r.props);
286
299
  e && n.push(e);
287
300
  }
288
301
  };
@@ -290,7 +303,7 @@ function k(e, t) {
290
303
  for (let e of Object.values(t || {})) r(e.template?.nodes);
291
304
  return n.join("\n");
292
305
  }
293
- var A = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", j = {
306
+ var N = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", P = {
294
307
  light: {
295
308
  background: "#ffffff",
296
309
  text: "#111827",
@@ -327,23 +340,23 @@ var A = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
327
340
  contrastText: "#052e2b"
328
341
  }
329
342
  }
330
- }, M = {
343
+ }, F = {
331
344
  font: "system",
332
345
  headingFont: "inherit",
333
- light: j.light,
334
- dark: j.dark
335
- }, N = {
346
+ light: P.light,
347
+ dark: P.dark
348
+ }, I = {
336
349
  system: {
337
350
  label: "System",
338
- value: A
351
+ value: N
339
352
  },
340
353
  inter: {
341
354
  label: "Inter",
342
- value: `"Inter", ${A}`
355
+ value: `"Inter", ${N}`
343
356
  },
344
357
  outfit: {
345
358
  label: "Outfit",
346
- value: `"Outfit", ${A}`
359
+ value: `"Outfit", ${N}`
347
360
  },
348
361
  serif: {
349
362
  label: "Serif",
@@ -353,7 +366,7 @@ var A = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
353
366
  label: "Mono",
354
367
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
355
368
  }
356
- }, P = (e, t) => N[e]?.value ?? t, F = (e, ...t) => {
369
+ }, L = (e, t) => I[e]?.value ?? t, R = (e, ...t) => {
357
370
  let n = Object.assign({}, e, ...t);
358
371
  return n.primary = {
359
372
  ...e.primary,
@@ -369,16 +382,16 @@ var A = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
369
382
  }), {})
370
383
  }, n;
371
384
  };
372
- function I(e) {
385
+ function z(e) {
373
386
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
374
387
  return {
375
- font: r ?? M.font,
376
- headingFont: i ?? M.headingFont,
377
- light: F(j.light, a, t),
378
- dark: F(j.dark, n)
388
+ font: r ?? F.font,
389
+ headingFont: i ?? F.headingFont,
390
+ light: R(P.light, a, t),
391
+ dark: R(P.dark, n)
379
392
  };
380
393
  }
381
- function L(e) {
394
+ function B(e) {
382
395
  return {
383
396
  "--page-bg": e.background,
384
397
  "--page-text": e.text,
@@ -394,32 +407,32 @@ function L(e) {
394
407
  "--page-secondary-contrast": e.secondary.contrastText
395
408
  };
396
409
  }
397
- function R(e) {
398
- let t = I(e);
410
+ function V(e) {
411
+ let t = z(e);
399
412
  return {
400
413
  backgroundColor: "var(--page-bg)",
401
414
  color: "var(--page-text)",
402
- fontFamily: P(t.font, A),
403
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : P(t.headingFont, "inherit")
415
+ fontFamily: L(t.font, N),
416
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : L(t.headingFont, "inherit")
404
417
  };
405
418
  }
406
- function z(e, t = "light") {
407
- let n = I(e);
419
+ function ee(e, t = "light") {
420
+ let n = z(e);
408
421
  return {
409
- ...R(e),
410
- ...L(n[t] ?? n.light)
422
+ ...V(e),
423
+ ...B(n[t] ?? n.light)
411
424
  };
412
425
  }
413
- function ee(e, t) {
426
+ function H(e, t) {
414
427
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
415
428
  }
416
429
  //#endregion
417
430
  //#region ../ui/src/components/builder/views.jsx
418
- var B = n({
431
+ var U = n({
419
432
  tenant: "",
420
433
  apiUrl: "/api"
421
- }), V = n(null), H = n(null), te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
422
- function U(e, t) {
434
+ }), W = n(null), G = n(null), te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
435
+ function K(e, t) {
423
436
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
424
437
  }
425
438
  var ne = (e) => {
@@ -432,21 +445,21 @@ var ne = (e) => {
432
445
  }
433
446
  return t;
434
447
  };
435
- function W(e) {
448
+ function q(e) {
436
449
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : "").filter(Boolean).join(" ") : "";
437
450
  }
438
451
  function re(e, t) {
439
452
  let n = t?.data ?? {}, r = ne(n);
440
453
  if (!r.length) return e;
441
- let i = RegExp(`:(${r.map(te).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => W(U(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
454
+ let i = RegExp(`:(${r.map(te).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;
442
455
  return a(e);
443
456
  }
444
- var G = {
457
+ var ie = {
445
458
  margin: 0,
446
459
  fontWeight: 700,
447
460
  lineHeight: 1.2,
448
461
  fontFamily: "var(--page-heading-font, inherit)"
449
- }, ie = { margin: 0 }, K = {
462
+ }, J = { margin: 0 }, Y = {
450
463
  display: "inline-block",
451
464
  textDecoration: "none",
452
465
  cursor: "pointer",
@@ -457,11 +470,11 @@ var G = {
457
470
  display: "flex",
458
471
  flexDirection: "column",
459
472
  position: "relative"
460
- }, q = {
473
+ }, oe = {
461
474
  display: "flex",
462
475
  flexDirection: "column"
463
476
  };
464
- function J({ style: e }) {
477
+ function X({ style: e }) {
465
478
  let t = e?.backgroundVideo;
466
479
  if (!t) return null;
467
480
  let n = {
@@ -487,32 +500,32 @@ function J({ style: e }) {
487
500
  background: r
488
501
  } })] });
489
502
  }
490
- var Y = (e, t) => e?.backgroundVideo ? {
503
+ var se = (e, t) => e?.backgroundVideo ? {
491
504
  position: "relative",
492
505
  ...t,
493
- ..._(e)
506
+ ...b(e)
494
507
  } : {
495
508
  ...t,
496
- ..._(e)
509
+ ...b(e)
497
510
  };
498
- function oe({ style: e, nodeRef: t, children: n }) {
511
+ function ce({ style: e, nodeRef: t, children: n }) {
499
512
  return /* @__PURE__ */ l("div", {
500
513
  ref: t,
501
514
  style: {
502
515
  ...ae,
503
- ..._(e)
516
+ ...b(e)
504
517
  },
505
- children: [/* @__PURE__ */ c(J, { style: e }), n]
518
+ children: [/* @__PURE__ */ c(X, { style: e }), n]
506
519
  });
507
520
  }
508
- function se({ style: e, nodeRef: t, children: n }) {
521
+ function le({ style: e, nodeRef: t, children: n }) {
509
522
  return /* @__PURE__ */ l("section", {
510
523
  ref: t,
511
- style: Y(e, q),
512
- children: [/* @__PURE__ */ c(J, { style: e }), n]
524
+ style: se(e, oe),
525
+ children: [/* @__PURE__ */ c(X, { style: e }), n]
513
526
  });
514
527
  }
515
- function ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
528
+ function ue({ style: e, freeLayout: t, nodeRef: n, children: r }) {
516
529
  let i = t ? {
517
530
  position: "relative",
518
531
  minHeight: 240
@@ -521,61 +534,71 @@ function ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
521
534
  ref: n,
522
535
  style: i ? {
523
536
  ...i,
524
- ...Y(e)
525
- } : Y(e),
526
- children: [/* @__PURE__ */ c(J, { style: e }), r]
537
+ ...se(e)
538
+ } : se(e),
539
+ children: [/* @__PURE__ */ c(X, { style: e }), r]
527
540
  });
528
541
  }
529
- function le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
542
+ function de({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
530
543
  return /* @__PURE__ */ c(n, {
531
544
  ref: a,
532
545
  style: {
533
- ...G,
534
- ..._(r)
546
+ ...ie,
547
+ ...b(r)
535
548
  },
536
- children: X(t, e, i)
549
+ children: Z(t, e, i)
537
550
  });
538
551
  }
539
- var ue = {
540
- fontFamily: N.mono.value,
552
+ var fe = {
553
+ fontFamily: I.mono.value,
541
554
  background: "rgba(148, 163, 184, 0.18)",
542
555
  padding: "1px 5px",
543
556
  borderRadius: 4,
544
557
  fontSize: "0.9em"
545
558
  };
546
- function de(e, t = [], n) {
547
- let r = e;
548
- return t.includes("sup") ? r = /* @__PURE__ */ c("sup", { children: r }) : t.includes("sub") && (r = /* @__PURE__ */ c("sub", { children: r })), t.includes("code") && (r = /* @__PURE__ */ c("code", {
549
- style: ue,
550
- children: r
551
- })), t.includes("strike") && (r = /* @__PURE__ */ c("s", { children: r })), t.includes("underline") && (r = /* @__PURE__ */ c("u", { children: r })), t.includes("italic") && (r = /* @__PURE__ */ c("em", { children: r })), t.includes("bold") && (r = /* @__PURE__ */ c("strong", { children: r })), n && (r = /* @__PURE__ */ c("a", {
559
+ function pe(e, t = [], n, r) {
560
+ let i = e;
561
+ return t.includes("sup") ? i = /* @__PURE__ */ c("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ c("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ c("code", {
562
+ style: fe,
563
+ children: i
564
+ })), t.includes("strike") && (i = /* @__PURE__ */ c("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ c("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ c("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ c("strong", { children: i })), n && (i = /* @__PURE__ */ c("a", {
552
565
  href: n,
566
+ target: r || void 0,
567
+ rel: r === "_blank" ? "noopener noreferrer" : void 0,
553
568
  style: { color: "inherit" },
554
- children: r
555
- })), r;
569
+ children: i
570
+ })), i;
556
571
  }
557
- function X(e, n, r) {
572
+ function Z(e, n, r) {
558
573
  return e?.length ? e.map((e, n) => {
559
574
  if (e.slot) return /* @__PURE__ */ c(t, { children: r?.[e.slot] ?? null }, n);
560
- if (e.parts) return /* @__PURE__ */ c(t, { children: X(e.parts, "", r) }, n);
575
+ if (e.parts) return /* @__PURE__ */ c(t, { children: Z(e.parts, "", r) }, n);
561
576
  let i = e.text;
562
577
  return e.sup ? i = /* @__PURE__ */ c("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ c("sub", { children: i })), e.code && (i = /* @__PURE__ */ c("code", {
563
- style: ue,
578
+ style: fe,
564
579
  children: i
565
- })), e.strike && (i = /* @__PURE__ */ c("s", { children: i })), e.underline && (i = /* @__PURE__ */ c("u", { children: i })), e.italic && (i = /* @__PURE__ */ c("em", { children: i })), e.bold && (i = /* @__PURE__ */ c("strong", { children: i })), e.href && (i = /* @__PURE__ */ c("a", {
580
+ })), e.strike && (i = /* @__PURE__ */ c("s", { children: i })), e.underline && (i = /* @__PURE__ */ c("u", { children: i })), e.italic && (i = /* @__PURE__ */ c("em", { children: i })), e.bold && (i = /* @__PURE__ */ c("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ c("span", {
581
+ style: {
582
+ ...e.color && { color: e.color },
583
+ ...e.background && { backgroundColor: e.background }
584
+ },
585
+ children: i
586
+ })), e.href && (i = /* @__PURE__ */ c("a", {
566
587
  href: e.href,
567
- style: { color: "inherit" },
588
+ target: e.target || void 0,
589
+ rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
590
+ style: { color: e.color ?? "inherit" },
568
591
  children: i
569
592
  })), /* @__PURE__ */ c(t, { children: i }, n);
570
593
  }) : n;
571
594
  }
572
- function fe({ parts: e, text: t, marks: n, href: r, style: i }) {
595
+ function me({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
573
596
  return /* @__PURE__ */ c("span", {
574
- style: _(i),
575
- children: e?.length ? X(e, t) : de(t, n, r)
597
+ style: b(a),
598
+ children: e?.length ? Z(e, t) : pe(t, n, r, i)
576
599
  });
577
600
  }
578
- var pe = {
601
+ var he = {
579
602
  h1: 40,
580
603
  h2: 32,
581
604
  h3: 26,
@@ -583,31 +606,42 @@ var pe = {
583
606
  h5: 19,
584
607
  h6: 16
585
608
  };
586
- function me({ align: e = "center", width: t } = {}) {
587
- let n = t ? `${t}%` : void 0;
588
- return e === "full" ? { width: "100%" } : e === "left" ? {
589
- float: "left",
590
- width: n ?? "50%",
591
- marginTop: 4,
592
- marginRight: 20,
593
- marginBottom: 12,
594
- marginLeft: 0
595
- } : e === "right" ? {
596
- float: "right",
597
- width: n ?? "50%",
598
- marginTop: 4,
599
- marginLeft: 20,
600
- marginBottom: 12,
601
- marginRight: 0
609
+ function ge({ align: e = "center", width: t, wrap: n } = {}) {
610
+ let r = t ? `${t}%` : void 0;
611
+ if (e === "full") return { width: "100%" };
612
+ let i = e === "left" || e === "right";
613
+ return i && (n ?? !0) ? {
614
+ float: e,
615
+ width: r ?? "50%",
616
+ maxWidth: "100%",
617
+ marginTop: "4px",
618
+ marginBottom: "12px",
619
+ ...e === "left" ? {
620
+ marginRight: "20px",
621
+ marginLeft: 0
622
+ } : {
623
+ marginLeft: "20px",
624
+ marginRight: 0
625
+ }
626
+ } : i ? {
627
+ width: r ?? "fit-content",
628
+ maxWidth: "100%",
629
+ ...e === "left" ? {
630
+ marginLeft: 0,
631
+ marginRight: "auto"
632
+ } : {
633
+ marginLeft: "auto",
634
+ marginRight: 0
635
+ }
602
636
  } : {
603
- width: n ?? "fit-content",
637
+ width: r ?? "fit-content",
604
638
  maxWidth: "100%",
605
639
  marginLeft: "auto",
606
640
  marginRight: "auto"
607
641
  };
608
642
  }
609
- function he(e = [], t, n) {
610
- let r = n ?? ((e, n) => X(e, n, t));
643
+ function _e(e = [], t, n) {
644
+ let r = n ?? ((e, n) => Z(e, n, t));
611
645
  return e.map((t, n) => {
612
646
  let i = {
613
647
  marginTop: 0,
@@ -629,10 +663,12 @@ function he(e = [], t, n) {
629
663
  marginLeft: 0,
630
664
  marginRight: 0,
631
665
  ...i,
632
- ...me(t)
666
+ ...ge(t)
633
667
  },
634
668
  children: [t.href ? /* @__PURE__ */ c("a", {
635
669
  href: t.href,
670
+ target: t.target || void 0,
671
+ rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
636
672
  style: { display: "block" },
637
673
  children: e
638
674
  }) : e, t.caption && /* @__PURE__ */ c("figcaption", {
@@ -646,15 +682,16 @@ function he(e = [], t, n) {
646
682
  })]
647
683
  }, n);
648
684
  }
649
- if (t.type === "video") return Ee(t.url) ? /* @__PURE__ */ c("div", {
685
+ if (t.type === "video") return Oe(t.url) ? /* @__PURE__ */ c("div", {
650
686
  style: {
651
687
  ...i,
652
- ...me({
688
+ ...ge({
653
689
  align: t.align,
690
+ wrap: t.wrap,
654
691
  width: t.width ?? 100
655
692
  })
656
693
  },
657
- children: /* @__PURE__ */ c(De, {
694
+ children: /* @__PURE__ */ c(ke, {
658
695
  url: t.url,
659
696
  autoplay: t.autoplay,
660
697
  muted: t.muted,
@@ -683,17 +720,17 @@ function he(e = [], t, n) {
683
720
  }
684
721
  if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
685
722
  style: {
686
- ..._e,
723
+ ...ye,
687
724
  ...i
688
725
  },
689
726
  children: r(t.parts, t.text)
690
727
  }, n);
691
- if (pe[t.type]) {
728
+ if (he[t.type]) {
692
729
  let e = t.type;
693
730
  return /* @__PURE__ */ c(e, {
694
731
  style: {
695
- ...G,
696
- fontSize: pe[t.type],
732
+ ...ie,
733
+ fontSize: he[t.type],
697
734
  ...i
698
735
  },
699
736
  children: r(t.parts, t.text)
@@ -701,95 +738,95 @@ function he(e = [], t, n) {
701
738
  }
702
739
  return /* @__PURE__ */ c("p", {
703
740
  style: {
704
- ...ie,
741
+ ...J,
705
742
  ...i
706
743
  },
707
744
  children: r(t.parts, t.text)
708
745
  }, n);
709
746
  });
710
747
  }
711
- function ge({ content: e, style: t, linked: n, nodeRef: r }) {
748
+ function ve({ content: e, style: t, linked: n, nodeRef: r }) {
712
749
  return /* @__PURE__ */ c("div", {
713
750
  ref: r,
714
751
  style: {
715
752
  display: "flow-root",
716
- ..._(t)
753
+ ...b(t)
717
754
  },
718
- children: he(e, n)
755
+ children: _e(e, n)
719
756
  });
720
757
  }
721
- var _e = {
758
+ var ye = {
722
759
  margin: 0,
723
760
  padding: "8px 0 8px 20px",
724
761
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
725
762
  };
726
- function ve({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
763
+ function be({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
727
764
  return /* @__PURE__ */ c("blockquote", {
728
765
  ref: i,
729
766
  style: {
730
- ..._e,
731
- ..._(n)
767
+ ...ye,
768
+ ...b(n)
732
769
  },
733
- children: X(t, e, r)
770
+ children: Z(t, e, r)
734
771
  });
735
772
  }
736
- function ye({ ordered: e, items: t = [], style: n, nodeRef: r }) {
773
+ function xe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
737
774
  return /* @__PURE__ */ c(e ? "ol" : "ul", {
738
775
  ref: r,
739
776
  style: {
740
777
  margin: 0,
741
778
  paddingLeft: 24,
742
- ..._(n)
779
+ ...b(n)
743
780
  },
744
781
  children: t.map((e, t) => /* @__PURE__ */ c("li", {
745
782
  style: { marginBottom: 4 },
746
- children: X(e.parts, e.text)
783
+ children: Z(e.parts, e.text)
747
784
  }, t))
748
785
  });
749
786
  }
750
- function be({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
787
+ function Se({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
751
788
  return /* @__PURE__ */ c("p", {
752
789
  ref: i,
753
790
  style: {
754
- ...ie,
755
- ..._(n)
791
+ ...J,
792
+ ...b(n)
756
793
  },
757
- children: X(t, e, r)
794
+ children: Z(t, e, r)
758
795
  });
759
796
  }
760
- var xe = {
797
+ var Ce = {
761
798
  color: "var(--page-accent, inherit)",
762
799
  textDecoration: "underline",
763
800
  textUnderlineOffset: 3,
764
801
  cursor: "pointer"
765
802
  };
766
- function Se({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
803
+ function we({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
767
804
  return /* @__PURE__ */ c("a", {
768
805
  ref: o,
769
806
  href: n || "#",
770
807
  target: r || void 0,
771
808
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
772
809
  style: {
773
- ...xe,
774
- ..._(i)
810
+ ...Ce,
811
+ ...b(i)
775
812
  },
776
- children: X(t, e, a)
813
+ children: Z(t, e, a)
777
814
  });
778
815
  }
779
- function Ce({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
816
+ function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
780
817
  return /* @__PURE__ */ c("a", {
781
818
  ref: o,
782
819
  href: n || "#",
783
820
  target: r || void 0,
784
821
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
785
822
  style: {
786
- ...K,
787
- ..._(i)
823
+ ...Y,
824
+ ...b(i)
788
825
  },
789
- children: X(t, e, a)
826
+ children: Z(t, e, a)
790
827
  });
791
828
  }
792
- function we({ src: e, alt: t, style: n, nodeRef: r }) {
829
+ function Ee({ src: e, alt: t, style: n, nodeRef: r }) {
793
830
  return e ? /* @__PURE__ */ c("img", {
794
831
  ref: r,
795
832
  src: e,
@@ -797,11 +834,11 @@ function we({ src: e, alt: t, style: n, nodeRef: r }) {
797
834
  style: {
798
835
  display: "block",
799
836
  maxWidth: "100%",
800
- ..._(n)
837
+ ...b(n)
801
838
  }
802
839
  }) : null;
803
840
  }
804
- function Te({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
841
+ function De({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
805
842
  return e ? /* @__PURE__ */ c("video", {
806
843
  ref: s,
807
844
  src: e,
@@ -815,13 +852,13 @@ function Te({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
815
852
  display: "block",
816
853
  width: "100%",
817
854
  maxWidth: "100%",
818
- ..._(o)
855
+ ...b(o)
819
856
  }
820
857
  }) : null;
821
858
  }
822
- var Ee = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
823
- function De({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
824
- let l = Ee(e);
859
+ var Oe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
860
+ function ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
861
+ let l = Oe(e);
825
862
  if (!l) return null;
826
863
  let u = new URLSearchParams({ rel: "0" });
827
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", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ c("div", {
@@ -830,7 +867,7 @@ function De({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
830
867
  position: "relative",
831
868
  width: "100%",
832
869
  paddingTop: "56.25%",
833
- ..._(o)
870
+ ...b(o)
834
871
  },
835
872
  children: /* @__PURE__ */ c("iframe", {
836
873
  src: `https://www.youtube-nocookie.com/embed/${l}?${u}`,
@@ -847,7 +884,7 @@ function De({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
847
884
  })
848
885
  });
849
886
  }
850
- function Oe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
887
+ function Ae({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
851
888
  return e ? /* @__PURE__ */ c("iframe", {
852
889
  ref: i,
853
890
  src: e,
@@ -859,11 +896,11 @@ function Oe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
859
896
  width: "100%",
860
897
  height: 300,
861
898
  border: 0,
862
- ..._(r)
899
+ ...b(r)
863
900
  }
864
901
  }) : null;
865
902
  }
866
- function ke({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
903
+ function je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
867
904
  let [a, s] = o(null);
868
905
  return i(() => {
869
906
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -879,10 +916,10 @@ function ke({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
879
916
  ref: (e) => {
880
917
  s(e), r && r(e);
881
918
  },
882
- style: _(n)
919
+ style: b(n)
883
920
  });
884
921
  }
885
- function Ae({ height: e, nodeRef: t }) {
922
+ function Me({ height: e, nodeRef: t }) {
886
923
  return /* @__PURE__ */ c("div", {
887
924
  ref: t,
888
925
  style: {
@@ -892,18 +929,18 @@ function Ae({ height: e, nodeRef: t }) {
892
929
  }
893
930
  });
894
931
  }
895
- function je({ style: e, nodeRef: t }) {
932
+ function Ne({ style: e, nodeRef: t }) {
896
933
  return /* @__PURE__ */ c("div", {
897
934
  ref: t,
898
935
  style: {
899
936
  height: 1,
900
937
  alignSelf: "stretch",
901
938
  flexShrink: 0,
902
- ..._(e)
939
+ ...b(e)
903
940
  }
904
941
  });
905
942
  }
906
- var Me = {
943
+ var Pe = {
907
944
  position: "absolute",
908
945
  top: "50%",
909
946
  transform: "translateY(-50%)",
@@ -920,7 +957,7 @@ var Me = {
920
957
  alignItems: "center",
921
958
  justifyContent: "center",
922
959
  padding: 0
923
- }, Ne = {
960
+ }, Fe = {
924
961
  bottom: {
925
962
  inset: "auto 0 0 0",
926
963
  padding: "40px 24px 20px",
@@ -939,36 +976,36 @@ var Me = {
939
976
  padding: 24,
940
977
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
941
978
  }
942
- }, Pe = 48;
943
- function Fe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
944
- let [p, m] = o(0), [h, g] = o(!1), [v, y] = o(null), b = e ? Math.min(p, e - 1) : 0;
979
+ }, Ie = 48;
980
+ function Le({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
981
+ let [p, m] = o(0), [h, g] = o(!1), [_, v] = o(null), y = e ? Math.min(p, e - 1) : 0;
945
982
  if (i(() => {
946
- if (!n || h || v || e < 2) return;
983
+ if (!n || h || _ || e < 2) return;
947
984
  let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
948
985
  return () => clearInterval(t);
949
986
  }, [
950
987
  n,
951
988
  h,
952
- v,
989
+ _,
953
990
  r,
954
991
  e
955
992
  ]), !e) return null;
956
993
  let x = (t) => m((t + e) % e), S = () => {
957
- if (!v) return;
958
- let { dx: e } = v;
959
- y(null), e < -48 ? x(b + 1) : e > Pe && x(b - 1);
994
+ if (!_) return;
995
+ let { dx: e } = _;
996
+ v(null), e < -48 ? x(y + 1) : e > Ie && x(y - 1);
960
997
  };
961
998
  return /* @__PURE__ */ l("div", {
962
999
  ref: f,
963
1000
  onMouseEnter: () => g(!0),
964
1001
  onMouseLeave: () => g(!1),
965
1002
  onPointerDown: u && e > 1 ? (e) => {
966
- e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), y({
1003
+ e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), v({
967
1004
  startX: e.clientX,
968
1005
  dx: 0
969
1006
  }));
970
1007
  } : void 0,
971
- onPointerMove: v ? (e) => y((t) => t && {
1008
+ onPointerMove: _ ? (e) => v((t) => t && {
972
1009
  ...t,
973
1010
  dx: e.clientX - t.startX
974
1011
  }) : void 0,
@@ -979,16 +1016,16 @@ function Fe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
979
1016
  overflow: "hidden",
980
1017
  width: "100%",
981
1018
  touchAction: "pan-y",
982
- userSelect: v ? "none" : void 0,
983
- cursor: v ? "grabbing" : void 0,
984
- ..._(d)
1019
+ userSelect: _ ? "none" : void 0,
1020
+ cursor: _ ? "grabbing" : void 0,
1021
+ ...b(d)
985
1022
  },
986
1023
  children: [/* @__PURE__ */ c("div", {
987
1024
  style: {
988
1025
  display: "flex",
989
1026
  height: a,
990
- transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
991
- transition: v ? "none" : "transform 450ms ease"
1027
+ transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
1028
+ transition: _ ? "none" : "transform 450ms ease"
992
1029
  },
993
1030
  children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ c("div", {
994
1031
  style: {
@@ -1004,20 +1041,20 @@ function Fe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1004
1041
  type: "button",
1005
1042
  "aria-label": "Previous slide",
1006
1043
  style: {
1007
- ...Me,
1044
+ ...Pe,
1008
1045
  left: 12
1009
1046
  },
1010
- onClick: () => x(b - 1),
1047
+ onClick: () => x(y - 1),
1011
1048
  children: "‹"
1012
1049
  }),
1013
1050
  /* @__PURE__ */ c("button", {
1014
1051
  type: "button",
1015
1052
  "aria-label": "Next slide",
1016
1053
  style: {
1017
- ...Me,
1054
+ ...Pe,
1018
1055
  right: 12
1019
1056
  },
1020
- onClick: () => x(b + 1),
1057
+ onClick: () => x(y + 1),
1021
1058
  children: "›"
1022
1059
  }),
1023
1060
  /* @__PURE__ */ c("div", {
@@ -1041,14 +1078,14 @@ function Fe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1041
1078
  border: 0,
1042
1079
  padding: 0,
1043
1080
  cursor: "pointer",
1044
- background: t === b ? "#ffffff" : "rgba(255, 255, 255, 0.45)"
1081
+ background: t === y ? "#ffffff" : "rgba(255, 255, 255, 0.45)"
1045
1082
  }
1046
1083
  }, t))
1047
1084
  })
1048
1085
  ] })]
1049
1086
  });
1050
1087
  }
1051
- var Ie = (e, t) => ({
1088
+ var Re = (e, t) => ({
1052
1089
  position: "absolute",
1053
1090
  inset: 0,
1054
1091
  backgroundImage: e ? `url(${e})` : "none",
@@ -1056,18 +1093,18 @@ var Ie = (e, t) => ({
1056
1093
  backgroundSize: "cover",
1057
1094
  backgroundPosition: "center"
1058
1095
  });
1059
- function Le({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1060
- return e.length ? /* @__PURE__ */ c(Fe, {
1096
+ function ze({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1097
+ return e.length ? /* @__PURE__ */ c(Le, {
1061
1098
  ...r,
1062
1099
  count: e.length,
1063
1100
  renderSlide: (r) => {
1064
1101
  let i = e[r];
1065
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Ie(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1102
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Re(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1066
1103
  style: {
1067
1104
  position: "absolute",
1068
1105
  color: "#fff",
1069
1106
  textAlign: n,
1070
- ...Ne[t] ?? Ne.bottom
1107
+ ...Fe[t] ?? Fe.bottom
1071
1108
  },
1072
1109
  children: [i.title && /* @__PURE__ */ c("div", {
1073
1110
  style: {
@@ -1087,13 +1124,13 @@ function Le({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1087
1124
  }
1088
1125
  }) : null;
1089
1126
  }
1090
- function Re({ slides: e = [], linked: t, ...n }) {
1091
- return e.length ? /* @__PURE__ */ c(Fe, {
1127
+ function Be({ slides: e = [], linked: t, ...n }) {
1128
+ return e.length ? /* @__PURE__ */ c(Le, {
1092
1129
  ...n,
1093
1130
  count: e.length,
1094
1131
  renderSlide: (n) => {
1095
1132
  let r = e[n];
1096
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Ie(r.image, r.color) }), /* @__PURE__ */ c("div", {
1133
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Re(r.image, r.color) }), /* @__PURE__ */ c("div", {
1097
1134
  style: {
1098
1135
  position: "absolute",
1099
1136
  inset: 0,
@@ -1105,20 +1142,20 @@ function Re({ slides: e = [], linked: t, ...n }) {
1105
1142
  }
1106
1143
  }) : null;
1107
1144
  }
1108
- var Z = {
1145
+ var Ve = {
1109
1146
  color: "inherit",
1110
1147
  textDecoration: "none",
1111
1148
  fontSize: 14,
1112
1149
  opacity: .85
1113
- }, ze = {
1150
+ }, He = {
1114
1151
  background: "var(--page-bg, #ffffff)",
1115
1152
  color: "var(--page-text, #111827)",
1116
1153
  border: "1px solid rgba(148, 163, 184, 0.25)",
1117
1154
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1118
1155
  zIndex: 60
1119
1156
  };
1120
- function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1121
- let [f, p] = o(null), [m, h] = o(!1), [g, v] = o(!1), [y, b] = o(null);
1157
+ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1158
+ let [f, p] = o(null), [m, h] = o(!1), [g, _] = o(!1), [v, y] = o(null);
1122
1159
  i(() => {
1123
1160
  if (!f) return;
1124
1161
  let e = new ResizeObserver(() => h(f.offsetWidth < d));
@@ -1127,7 +1164,7 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1127
1164
  let x = u === "hamburger" || u === "auto" && m, S = (e, t) => /* @__PURE__ */ l("a", {
1128
1165
  href: e.href || "#",
1129
1166
  style: {
1130
- ...Z,
1167
+ ...Ve,
1131
1168
  display: "block",
1132
1169
  ...t
1133
1170
  },
@@ -1153,7 +1190,7 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1153
1190
  padding: "14px 24px",
1154
1191
  width: "100%",
1155
1192
  position: "relative",
1156
- ..._(a)
1193
+ ...b(a)
1157
1194
  },
1158
1195
  children: [
1159
1196
  n && /* @__PURE__ */ c("img", {
@@ -1176,7 +1213,7 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1176
1213
  x ? /* @__PURE__ */ c("button", {
1177
1214
  type: "button",
1178
1215
  "aria-label": g ? "Close menu" : "Open menu",
1179
- onClick: () => v(!g),
1216
+ onClick: () => _(!g),
1180
1217
  style: {
1181
1218
  background: "transparent",
1182
1219
  border: 0,
@@ -1198,7 +1235,7 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1198
1235
  let t = e.children ?? [];
1199
1236
  if (!t.length) return /* @__PURE__ */ c("a", {
1200
1237
  href: e.href || "#",
1201
- style: Z,
1238
+ style: Ve,
1202
1239
  children: e.label
1203
1240
  }, e.key);
1204
1241
  let n = e.type === "mega";
@@ -1207,12 +1244,12 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1207
1244
  position: n ? "static" : "relative",
1208
1245
  display: "inline-flex"
1209
1246
  },
1210
- onMouseEnter: () => b(e.key),
1211
- onMouseLeave: () => b(null),
1247
+ onMouseEnter: () => y(e.key),
1248
+ onMouseLeave: () => y(null),
1212
1249
  children: [/* @__PURE__ */ l("a", {
1213
1250
  href: e.href || "#",
1214
1251
  style: {
1215
- ...Z,
1252
+ ...Ve,
1216
1253
  cursor: "pointer"
1217
1254
  },
1218
1255
  children: [
@@ -1226,9 +1263,9 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1226
1263
  children: "▼"
1227
1264
  })
1228
1265
  ]
1229
- }), y === e.key && (n ? /* @__PURE__ */ c("div", {
1266
+ }), v === e.key && (n ? /* @__PURE__ */ c("div", {
1230
1267
  style: {
1231
- ...ze,
1268
+ ...He,
1232
1269
  position: "absolute",
1233
1270
  left: 0,
1234
1271
  right: 0,
@@ -1244,7 +1281,7 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1244
1281
  }))
1245
1282
  }) : /* @__PURE__ */ c("div", {
1246
1283
  style: {
1247
- ...ze,
1284
+ ...He,
1248
1285
  position: "absolute",
1249
1286
  top: "100%",
1250
1287
  left: 0,
@@ -1273,7 +1310,7 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1273
1310
  children: r.map((e) => /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c("a", {
1274
1311
  href: e.href || "#",
1275
1312
  style: {
1276
- ...Z,
1313
+ ...Ve,
1277
1314
  padding: "10px 4px",
1278
1315
  fontWeight: (e.children ?? []).length ? 600 : 400,
1279
1316
  opacity: 1
@@ -1284,13 +1321,13 @@ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1284
1321
  ]
1285
1322
  });
1286
1323
  }
1287
- function Ve({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1324
+ function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1288
1325
  let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1289
1326
  return e.length ? /* @__PURE__ */ l("div", {
1290
1327
  ref: r,
1291
1328
  style: {
1292
1329
  width: "100%",
1293
- ..._(n)
1330
+ ...b(n)
1294
1331
  },
1295
1332
  children: [/* @__PURE__ */ c("div", {
1296
1333
  style: {
@@ -1324,7 +1361,7 @@ function Ve({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1324
1361
  }, e.key))]
1325
1362
  }) : null;
1326
1363
  }
1327
- function He({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1364
+ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1328
1365
  let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
1329
1366
  if (!e.length) return null;
1330
1367
  let u = (e) => s((t) => {
@@ -1335,7 +1372,7 @@ function He({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1335
1372
  ref: i,
1336
1373
  style: {
1337
1374
  width: "100%",
1338
- ..._(r)
1375
+ ...b(r)
1339
1376
  },
1340
1377
  children: e.map((n, r) => {
1341
1378
  let i = a.has(n.key);
@@ -1381,15 +1418,15 @@ function He({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1381
1418
  })
1382
1419
  });
1383
1420
  }
1384
- var Ue = {
1421
+ var Ke = {
1385
1422
  display: "flex",
1386
1423
  flexDirection: "column",
1387
1424
  gap: "12px"
1388
- }, We = {
1425
+ }, qe = {
1389
1426
  fontSize: "14px",
1390
1427
  fontWeight: 500,
1391
1428
  color: "var(--page-text, #111827)"
1392
- }, Ge = {
1429
+ }, Je = {
1393
1430
  padding: "10px 12px",
1394
1431
  border: "1px solid #d1d5db",
1395
1432
  borderRadius: "6px",
@@ -1399,18 +1436,18 @@ var Ue = {
1399
1436
  boxSizing: "border-box",
1400
1437
  backgroundColor: "#ffffff",
1401
1438
  color: "#111827"
1402
- }, Ke = {
1439
+ }, Ye = {
1403
1440
  display: "flex",
1404
1441
  alignItems: "center",
1405
1442
  gap: "8px",
1406
1443
  fontSize: "14px",
1407
1444
  color: "var(--page-text, #111827)"
1408
- }, qe = (e) => e ? {
1445
+ }, Xe = (e) => e ? {
1409
1446
  readOnly: !0,
1410
1447
  tabIndex: -1,
1411
1448
  onMouseDown: (e) => e.preventDefault()
1412
1449
  } : {};
1413
- function Je(e, t) {
1450
+ function Ze(e, t) {
1414
1451
  if (!e) return !0;
1415
1452
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1416
1453
  switch (e.op) {
@@ -1424,11 +1461,11 @@ function Je(e, t) {
1424
1461
  default: return !1;
1425
1462
  }
1426
1463
  }
1427
- var Ye = {
1464
+ var Qe = {
1428
1465
  display: "flex",
1429
1466
  flexDirection: "column",
1430
1467
  gap: 6
1431
- }, Xe = {
1468
+ }, $e = {
1432
1469
  font: "inherit",
1433
1470
  fontSize: 15,
1434
1471
  padding: "10px 12px",
@@ -1439,10 +1476,10 @@ var Ye = {
1439
1476
  width: "100%",
1440
1477
  boxSizing: "border-box"
1441
1478
  };
1442
- function Ze({ field: e, value: t, onChange: n, inert: r }) {
1479
+ function et({ field: e, value: t, onChange: n, inert: r }) {
1443
1480
  let i = /* @__PURE__ */ l("span", {
1444
1481
  style: {
1445
- ...We,
1482
+ ...qe,
1446
1483
  fontSize: 14
1447
1484
  },
1448
1485
  children: [e.label, e.required ? " *" : ""]
@@ -1451,7 +1488,7 @@ function Ze({ field: e, value: t, onChange: n, inert: r }) {
1451
1488
  required: e.required || void 0,
1452
1489
  placeholder: e.placeholder || void 0,
1453
1490
  disabled: r || void 0,
1454
- style: Xe,
1491
+ style: $e,
1455
1492
  value: t ?? "",
1456
1493
  onChange: (t) => n(e.name, t.target.value)
1457
1494
  };
@@ -1480,7 +1517,7 @@ function Ze({ field: e, value: t, onChange: n, inert: r }) {
1480
1517
  borderRadius: 8,
1481
1518
  display: "block"
1482
1519
  }
1483
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(De, {
1520
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(ke, {
1484
1521
  url: e.src,
1485
1522
  style: { width: "100%" }
1486
1523
  }) : /* @__PURE__ */ c("video", {
@@ -1492,14 +1529,14 @@ function Ze({ field: e, value: t, onChange: n, inert: r }) {
1492
1529
  display: "block"
1493
1530
  }
1494
1531
  }) : null : /* @__PURE__ */ l("label", {
1495
- style: Ye,
1532
+ style: Qe,
1496
1533
  children: [
1497
1534
  i,
1498
1535
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ c("textarea", {
1499
1536
  ...a,
1500
1537
  rows: 4,
1501
1538
  style: {
1502
- ...Xe,
1539
+ ...$e,
1503
1540
  resize: "vertical"
1504
1541
  }
1505
1542
  }) : e.type === "select" ? /* @__PURE__ */ l("select", {
@@ -1554,31 +1591,31 @@ function Ze({ field: e, value: t, onChange: n, inert: r }) {
1554
1591
  ]
1555
1592
  });
1556
1593
  }
1557
- function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: v, show: y }) {
1558
- let { tenant: b, apiUrl: x } = r(B), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = h ? y || "form" : S;
1594
+ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1595
+ let { tenant: y, apiUrl: x } = r(U), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = h ? v || "form" : S;
1559
1596
  i(() => {
1560
1597
  if (!f || !d) return;
1561
1598
  let e = !0;
1562
- return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload ?? null)).catch(() => e && T(null)), () => {
1599
+ return fetch(`${x || "/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)), () => {
1563
1600
  e = !1;
1564
1601
  };
1565
1602
  }, [
1566
1603
  f,
1567
1604
  d,
1568
- b,
1605
+ y,
1569
1606
  x
1570
1607
  ]);
1571
1608
  let j = [{
1572
1609
  section: null,
1573
1610
  fields: []
1574
1611
  }];
1575
- for (let e of w?.fields ?? []) e.type === "section" ? j.push({
1612
+ for (let e of Array.isArray(w?.fields) ? w.fields : []) e.type === "section" ? j.push({
1576
1613
  section: e,
1577
1614
  fields: []
1578
1615
  }) : j[j.length - 1].fields.push(e);
1579
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Je(e.section.condition, E)).map((e) => ({
1616
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Ze(e.section.condition, E)).map((e) => ({
1580
1617
  ...e,
1581
- fields: e.fields.filter((e) => Je(e.condition, E))
1618
+ fields: e.fields.filter((e) => Ze(e.condition, E))
1582
1619
  })), 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) => {
1583
1620
  let t = E[e.name];
1584
1621
  return e.required && (t == null || t === "" || t === !1);
@@ -1588,7 +1625,7 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1588
1625
  }));
1589
1626
  return /* @__PURE__ */ l("div", {
1590
1627
  ref: m,
1591
- style: _(e),
1628
+ style: b(e),
1592
1629
  children: [
1593
1630
  /* @__PURE__ */ c("form", {
1594
1631
  action: t || void 0,
@@ -1606,7 +1643,7 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1606
1643
  method: "post",
1607
1644
  headers: {
1608
1645
  "content-type": "application/json",
1609
- ...b ? { "x-tenant": b } : {}
1646
+ ...y ? { "x-tenant": y } : {}
1610
1647
  },
1611
1648
  body: JSON.stringify(t)
1612
1649
  }), n = await e.json().catch(() => null);
@@ -1632,11 +1669,11 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1632
1669
  }
1633
1670
  },
1634
1671
  style: {
1635
- ...Ue,
1672
+ ...Ke,
1636
1673
  display: A === "success" ? "none" : "flex"
1637
1674
  },
1638
1675
  children: f && d ? /* @__PURE__ */ l(s, { children: [
1639
- P && /* @__PURE__ */ c(ut, {
1676
+ P && /* @__PURE__ */ c(pt, {
1640
1677
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1641
1678
  active: F + 1,
1642
1679
  style: { marginBottom: 8 }
@@ -1649,7 +1686,7 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1649
1686
  },
1650
1687
  children: N[F].section.help
1651
1688
  }),
1652
- I.map((e) => /* @__PURE__ */ c(Ze, {
1689
+ I.map((e) => /* @__PURE__ */ c(et, {
1653
1690
  field: e,
1654
1691
  value: E[e.name],
1655
1692
  onChange: z,
@@ -1667,7 +1704,7 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1667
1704
  disabled: h || void 0,
1668
1705
  onClick: () => k(F - 1),
1669
1706
  style: {
1670
- ...K,
1707
+ ...Y,
1671
1708
  background: "transparent",
1672
1709
  color: "inherit",
1673
1710
  border: 0,
@@ -1680,7 +1717,7 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1680
1717
  disabled: h || L.length > 0,
1681
1718
  onClick: () => k(F + 1),
1682
1719
  style: {
1683
- ...K,
1720
+ ...Y,
1684
1721
  border: 0,
1685
1722
  padding: "10px 22px",
1686
1723
  borderRadius: 8,
@@ -1694,7 +1731,7 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1694
1731
  type: "submit",
1695
1732
  disabled: h || void 0,
1696
1733
  style: {
1697
- ...K,
1734
+ ...Y,
1698
1735
  border: 0,
1699
1736
  padding: "10px 22px",
1700
1737
  borderRadius: 8,
@@ -1709,29 +1746,29 @@ function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1709
1746
  }),
1710
1747
  /* @__PURE__ */ c("div", {
1711
1748
  style: { display: A === "success" ? "block" : "none" },
1712
- children: v?.success ?? null
1749
+ children: _?.success ?? null
1713
1750
  }),
1714
1751
  /* @__PURE__ */ c("div", {
1715
1752
  style: {
1716
1753
  display: A === "error" ? "block" : "none",
1717
1754
  marginTop: 12
1718
1755
  },
1719
- children: v?.error ?? null
1756
+ children: _?.error ?? null
1720
1757
  })
1721
1758
  ]
1722
1759
  });
1723
1760
  }
1724
- function $e({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1761
+ function nt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1725
1762
  return /* @__PURE__ */ c("label", {
1726
1763
  ref: r,
1727
1764
  style: {
1728
- ...We,
1729
- ..._(n)
1765
+ ...qe,
1766
+ ...b(n)
1730
1767
  },
1731
- children: X(t, e, i)
1768
+ children: Z(t, e, i)
1732
1769
  });
1733
1770
  }
1734
- function et({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1771
+ function rt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1735
1772
  return /* @__PURE__ */ c("input", {
1736
1773
  ref: a,
1737
1774
  type: e,
@@ -1739,13 +1776,13 @@ function et({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1739
1776
  placeholder: n,
1740
1777
  required: !o && !!r,
1741
1778
  style: {
1742
- ...Ge,
1743
- ..._(i)
1779
+ ...Je,
1780
+ ...b(i)
1744
1781
  },
1745
- ...qe(o)
1782
+ ...Xe(o)
1746
1783
  });
1747
1784
  }
1748
- function tt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1785
+ function it({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1749
1786
  return /* @__PURE__ */ c("textarea", {
1750
1787
  ref: a,
1751
1788
  name: e || void 0,
@@ -1753,19 +1790,19 @@ function tt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1753
1790
  rows: n,
1754
1791
  required: !o && !!r,
1755
1792
  style: {
1756
- ...Ge,
1793
+ ...Je,
1757
1794
  resize: "vertical",
1758
- ..._(i)
1795
+ ...b(i)
1759
1796
  },
1760
- ...qe(o)
1797
+ ...Xe(o)
1761
1798
  });
1762
1799
  }
1763
- function nt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1800
+ function at({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1764
1801
  return /* @__PURE__ */ l("label", {
1765
1802
  ref: o,
1766
1803
  style: {
1767
- ...Ke,
1768
- ..._(a)
1804
+ ...Ye,
1805
+ ...b(a)
1769
1806
  },
1770
1807
  children: [/* @__PURE__ */ c("input", {
1771
1808
  type: e,
@@ -1781,7 +1818,7 @@ function nt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1781
1818
  }), t]
1782
1819
  });
1783
1820
  }
1784
- function rt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1821
+ function ot({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1785
1822
  return /* @__PURE__ */ l("select", {
1786
1823
  ref: a,
1787
1824
  name: e || void 0,
@@ -1790,9 +1827,9 @@ function rt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1790
1827
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1791
1828
  tabIndex: o ? -1 : void 0,
1792
1829
  style: {
1793
- ...Ge,
1830
+ ...Je,
1794
1831
  appearance: "auto",
1795
- ..._(i)
1832
+ ...b(i)
1796
1833
  },
1797
1834
  children: [t !== "" && /* @__PURE__ */ c("option", {
1798
1835
  value: "",
@@ -1804,19 +1841,19 @@ function rt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1804
1841
  }, t))]
1805
1842
  });
1806
1843
  }
1807
- function it({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1844
+ function st({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1808
1845
  let [u, d] = o(null);
1809
1846
  return /* @__PURE__ */ l("label", {
1810
1847
  ref: a,
1811
1848
  style: {
1812
- ...Ge,
1849
+ ...Je,
1813
1850
  display: "flex",
1814
1851
  alignItems: "center",
1815
1852
  gap: "8px",
1816
1853
  cursor: s ? "default" : "pointer",
1817
1854
  borderStyle: "dashed",
1818
1855
  color: u ? "#111827" : "#6b7280",
1819
- ..._(i)
1856
+ ...b(i)
1820
1857
  },
1821
1858
  children: [
1822
1859
  /* @__PURE__ */ c("input", {
@@ -1836,12 +1873,12 @@ function it({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
1836
1873
  ]
1837
1874
  });
1838
1875
  }
1839
- function at({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1876
+ function ct({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1840
1877
  return /* @__PURE__ */ c("button", {
1841
1878
  ref: n,
1842
1879
  type: r ? "button" : "submit",
1843
1880
  style: {
1844
- ...K,
1881
+ ...Y,
1845
1882
  border: 0,
1846
1883
  cursor: "pointer",
1847
1884
  alignSelf: "flex-start",
@@ -1851,12 +1888,12 @@ function at({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1851
1888
  fontWeight: 600,
1852
1889
  lineHeight: 1.4,
1853
1890
  fontFamily: "inherit",
1854
- ..._(t)
1891
+ ...b(t)
1855
1892
  },
1856
1893
  children: e
1857
1894
  });
1858
1895
  }
1859
- function ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1896
+ function lt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1860
1897
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1861
1898
  return /* @__PURE__ */ c("div", {
1862
1899
  ref: r,
@@ -1865,7 +1902,7 @@ function ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1865
1902
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1866
1903
  gap: 16,
1867
1904
  width: "100%",
1868
- ..._(n)
1905
+ ...b(n)
1869
1906
  },
1870
1907
  children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ c("div", {
1871
1908
  style: { minWidth: 0 },
@@ -1873,21 +1910,21 @@ function ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1873
1910
  }, t))
1874
1911
  });
1875
1912
  }
1876
- function st({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: p, style: m, nodeRef: h }) {
1877
- let { tenant: g, apiUrl: v } = r(B), y = r(H), b = r(V)?.[e], [x, S] = o(null);
1913
+ function ut({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: s, titleField: u = "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], [x, S] = o(null);
1878
1915
  if (i(() => {
1879
- if (!e || b) return;
1880
- let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
1881
- return fetch(n, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload : [])).catch(() => t && S([])), () => {
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([])), () => {
1882
1919
  t = !1;
1883
1920
  };
1884
1921
  }, [
1885
1922
  e,
1886
1923
  g,
1887
- v,
1888
- b
1924
+ _,
1925
+ y
1889
1926
  ]), !e) return null;
1890
- let C = (b ?? x ?? []).slice(0, Math.max(1, Number(t) || 6)), w = Math.min(Math.max(Number(a) || 3, 1), 6), T = n === "list" ? {
1927
+ let C = (y ?? x ?? []).slice(0, Math.max(1, Number(t) || 6)), w = Math.min(Math.max(Number(a) || 3, 1), 6), T = n === "list" ? {
1891
1928
  display: "flex",
1892
1929
  flexDirection: "column",
1893
1930
  gap: 20
@@ -1896,26 +1933,26 @@ function st({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1896
1933
  gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
1897
1934
  gap: 24
1898
1935
  };
1899
- return f && p && y?.render ? /* @__PURE__ */ c("div", {
1936
+ return f && p && v?.render ? /* @__PURE__ */ c("div", {
1900
1937
  ref: h,
1901
1938
  style: {
1902
1939
  width: "100%",
1903
1940
  ...T,
1904
- ..._(m)
1941
+ ...b(m)
1905
1942
  },
1906
1943
  children: C.map((e) => /* @__PURE__ */ c("div", {
1907
1944
  style: { minWidth: 0 },
1908
- children: y.render(p, (t) => re(t, e))
1945
+ children: v.render(p, (t) => re(t, e))
1909
1946
  }, e.id ?? e?.data?.slug))
1910
1947
  }) : /* @__PURE__ */ c("div", {
1911
1948
  ref: h,
1912
1949
  style: {
1913
1950
  width: "100%",
1914
1951
  ...T,
1915
- ..._(m)
1952
+ ...b(m)
1916
1953
  },
1917
1954
  children: C.map((e) => {
1918
- let t = s ? U(e?.data, s) : null, r = u ? W(U(e?.data, u)) : null, i = d ? U(e?.data, d) : null, a = Array.isArray(i) ? i : null, o = a || i == null ? null : W(i), f = n === "list";
1955
+ let t = s ? K(e?.data, s) : null, r = u ? q(K(e?.data, u)) : null, i = d ? K(e?.data, d) : null, a = Array.isArray(i) ? i : null, o = a || i == null ? null : q(i), f = n === "list";
1919
1956
  return /* @__PURE__ */ l("div", {
1920
1957
  style: {
1921
1958
  display: "flex",
@@ -1962,7 +1999,7 @@ function st({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1962
1999
  lineHeight: 1.55,
1963
2000
  opacity: .85
1964
2001
  },
1965
- children: he(a)
2002
+ children: _e(a)
1966
2003
  })
1967
2004
  ]
1968
2005
  })]
@@ -1970,11 +2007,11 @@ function st({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1970
2007
  })
1971
2008
  });
1972
2009
  }
1973
- function ct({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2010
+ function dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
1974
2011
  return e.length ? /* @__PURE__ */ c("nav", {
1975
2012
  ref: r,
1976
2013
  "aria-label": "Breadcrumb",
1977
- style: { ..._(n) },
2014
+ style: { ...b(n) },
1978
2015
  children: /* @__PURE__ */ c("ol", {
1979
2016
  style: {
1980
2017
  display: "flex",
@@ -2020,7 +2057,7 @@ function ct({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2020
2057
  })
2021
2058
  }) : null;
2022
2059
  }
2023
- function lt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2060
+ function ft({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2024
2061
  let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), u = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
2025
2062
  display: "inline-flex",
2026
2063
  alignItems: "center",
@@ -2043,7 +2080,7 @@ function lt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2043
2080
  flexWrap: "wrap",
2044
2081
  gap: 8,
2045
2082
  alignItems: "center",
2046
- ..._(i)
2083
+ ...b(i)
2047
2084
  },
2048
2085
  children: [
2049
2086
  n && /* @__PURE__ */ c("a", {
@@ -2073,7 +2110,7 @@ function lt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2073
2110
  ]
2074
2111
  });
2075
2112
  }
2076
- function ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2113
+ function pt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2077
2114
  if (!e.length) return null;
2078
2115
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
2079
2116
  width: 32,
@@ -2111,7 +2148,7 @@ function ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2111
2148
  flexDirection: r ? "column" : "row",
2112
2149
  alignItems: r ? "stretch" : "flex-start",
2113
2150
  gap: r ? 4 : 8,
2114
- ..._(i)
2151
+ ...b(i)
2115
2152
  },
2116
2153
  children: e.map((e, n) => {
2117
2154
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
@@ -2151,12 +2188,12 @@ function ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2151
2188
  })
2152
2189
  });
2153
2190
  }
2154
- function dt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: p }) {
2155
- let { tenant: m, apiUrl: h } = r(B), g = r(V)?.[n], [v, y] = o(null);
2191
+ function mt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: p }) {
2192
+ let { tenant: m, apiUrl: h } = r(U), g = r(W)?.[n], [_, v] = o(null);
2156
2193
  if (i(() => {
2157
2194
  if (!n || g) return;
2158
2195
  let e = !0, t = n.startsWith("api:") ? `${h}/data/${encodeURIComponent(n.slice(4))}` : `${h}/dynamic/${encodeURIComponent(n)}`;
2159
- return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
2196
+ 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([])), () => {
2160
2197
  e = !1;
2161
2198
  };
2162
2199
  }, [
@@ -2165,13 +2202,13 @@ function dt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2165
2202
  h,
2166
2203
  g
2167
2204
  ]), !e.length) return null;
2168
- let b = n ? (g ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => W(U(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = u ? { border: C } : { borderBottom: C };
2205
+ let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = 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 = u ? { border: C } : { borderBottom: C };
2169
2206
  return /* @__PURE__ */ c("div", {
2170
2207
  ref: p,
2171
2208
  style: {
2172
2209
  width: "100%",
2173
2210
  overflowX: "auto",
2174
- ..._(f)
2211
+ ...b(f)
2175
2212
  },
2176
2213
  children: /* @__PURE__ */ l("table", {
2177
2214
  style: {
@@ -2202,52 +2239,52 @@ function dt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2202
2239
  })
2203
2240
  });
2204
2241
  }
2205
- var ft = {
2206
- PageRoot: oe,
2207
- Section: se,
2208
- Container: ce,
2209
- Heading: le,
2210
- TextBlock: be,
2211
- ButtonBlock: Ce,
2212
- ImageBlock: we,
2213
- Spacer: Ae,
2214
- Divider: je,
2215
- SliderBlock: Le,
2216
- CanvasSlider: Re,
2217
- TabsBlock: Ve,
2218
- QuickStack: ot,
2219
- CollectionList: st,
2220
- BreadcrumbsBlock: ct,
2221
- PaginationBlock: lt,
2222
- StepperBlock: ut,
2223
- TableBlock: dt,
2224
- AccordionBlock: He,
2225
- NavbarBlock: Be,
2226
- ListBlock: ye,
2227
- TextSpan: fe,
2228
- QuoteBlock: ve,
2229
- TextLink: Se,
2230
- RichTextBlock: ge,
2231
- RichContentBlock: ge,
2232
- VideoBlock: Te,
2233
- YouTubeBlock: De,
2234
- IframeBlock: Oe,
2235
- EmbedBlock: ke,
2236
- FormBlock: Qe,
2237
- FormLabel: $e,
2238
- FormInput: et,
2239
- FormTextarea: tt,
2240
- FormCheckbox: (e) => /* @__PURE__ */ c(nt, {
2242
+ var ht = {
2243
+ PageRoot: ce,
2244
+ Section: le,
2245
+ Container: ue,
2246
+ Heading: de,
2247
+ TextBlock: Se,
2248
+ ButtonBlock: Te,
2249
+ ImageBlock: Ee,
2250
+ Spacer: Me,
2251
+ Divider: Ne,
2252
+ SliderBlock: ze,
2253
+ CanvasSlider: Be,
2254
+ TabsBlock: We,
2255
+ QuickStack: lt,
2256
+ CollectionList: ut,
2257
+ BreadcrumbsBlock: dt,
2258
+ PaginationBlock: ft,
2259
+ StepperBlock: pt,
2260
+ TableBlock: mt,
2261
+ AccordionBlock: Ge,
2262
+ NavbarBlock: Ue,
2263
+ ListBlock: xe,
2264
+ TextSpan: me,
2265
+ QuoteBlock: be,
2266
+ TextLink: we,
2267
+ RichTextBlock: ve,
2268
+ RichContentBlock: ve,
2269
+ VideoBlock: De,
2270
+ YouTubeBlock: ke,
2271
+ IframeBlock: Ae,
2272
+ EmbedBlock: je,
2273
+ FormBlock: tt,
2274
+ FormLabel: nt,
2275
+ FormInput: rt,
2276
+ FormTextarea: it,
2277
+ FormCheckbox: (e) => /* @__PURE__ */ c(at, {
2241
2278
  kind: "checkbox",
2242
2279
  ...e
2243
2280
  }),
2244
- FormRadio: (e) => /* @__PURE__ */ c(nt, {
2281
+ FormRadio: (e) => /* @__PURE__ */ c(at, {
2245
2282
  kind: "radio",
2246
2283
  ...e
2247
2284
  }),
2248
- FormSelect: rt,
2249
- FormFile: it,
2250
- FormSubmit: at
2285
+ FormSelect: ot,
2286
+ FormFile: st,
2287
+ FormSubmit: ct
2251
2288
  };
2252
2289
  //#endregion
2253
2290
  //#region ../ui/src/components/builder/render.jsx
@@ -2261,7 +2298,7 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2261
2298
  let l = new Set(i).add(n);
2262
2299
  return /* @__PURE__ */ c(t, { children: Q(s.template.rootId, s.template.nodes, r, l, a) }, e);
2263
2300
  }
2264
- let u = ft[s];
2301
+ let u = ht[s];
2265
2302
  if (!u) return null;
2266
2303
  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;
2267
2304
  return /* @__PURE__ */ c(u, {
@@ -2269,81 +2306,86 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2269
2306
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2270
2307
  linked: p,
2271
2308
  nodeRef: (t) => {
2272
- t && (t.setAttribute("data-wb", e), x(t, l));
2309
+ t && (t.setAttribute("data-wb", e), w(t, l));
2273
2310
  },
2274
2311
  children: d.length ? d : void 0
2275
2312
  }, e);
2276
2313
  }
2277
2314
  //#endregion
2278
2315
  //#region ../ui/src/components/builder/PageRenderer.jsx
2279
- var pt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2280
- function mt({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, custom: s, tenant: u, apiUrl: f, datasets: m }) {
2281
- let h = s?.js?.trim();
2316
+ var gt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2317
+ function _t({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: p, locale: h, direction: _ }) {
2318
+ let v = s?.js?.trim();
2282
2319
  if (i(() => {
2283
- if (!h) return;
2320
+ if (!v) return;
2284
2321
  let e = document.createElement("script");
2285
- return e.text = h, document.body.appendChild(e), () => e.remove();
2286
- }, [h]), !e?.ROOT) return null;
2287
- let g = {
2322
+ return e.text = v, document.body.appendChild(e), () => e.remove();
2323
+ }, [v]), !e?.ROOT) return null;
2324
+ let y = {
2325
+ lang: h || void 0,
2326
+ dir: f(_, h)
2327
+ }, b = {
2288
2328
  minHeight: "100%",
2289
2329
  display: "flex",
2290
2330
  flexDirection: "column"
2291
- }, _ = Q("ROOT", e, n), v = a(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), y = k(e, n), b = O(e, n), x = s?.css?.trim(), S = p(e, n).map((e) => /* @__PURE__ */ c("link", {
2331
+ }, x = Q("ROOT", e, n), S = a(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = M(e, n), w = j(e, n), T = s?.css?.trim(), E = g(e, n).map((e) => /* @__PURE__ */ c("link", {
2292
2332
  rel: "stylesheet",
2293
2333
  precedence: "default",
2294
- href: d(e)
2334
+ href: m(e)
2295
2335
  }, e));
2296
- if (r !== "auto") return /* @__PURE__ */ c(B.Provider, {
2336
+ if (r !== "auto") return /* @__PURE__ */ c(U.Provider, {
2297
2337
  value: {
2298
2338
  tenant: u || "",
2299
- apiUrl: f || "/api"
2339
+ apiUrl: d || "/api"
2300
2340
  },
2301
- children: /* @__PURE__ */ c(V.Provider, {
2302
- value: m ?? null,
2303
- children: /* @__PURE__ */ c(H.Provider, {
2304
- value: v,
2341
+ children: /* @__PURE__ */ c(W.Provider, {
2342
+ value: p ?? null,
2343
+ children: /* @__PURE__ */ c(G.Provider, {
2344
+ value: S,
2305
2345
  children: /* @__PURE__ */ l("div", {
2346
+ ...y,
2306
2347
  style: {
2307
- ...g,
2308
- ...z(t, r),
2348
+ ...b,
2349
+ ...ee(t, r),
2309
2350
  ...o
2310
2351
  },
2311
2352
  children: [
2312
- S,
2313
- y && /* @__PURE__ */ c("style", { children: y }),
2314
- b && /* @__PURE__ */ c("style", { children: b }),
2315
- x && /* @__PURE__ */ c("style", { children: x }),
2316
- _
2353
+ E,
2354
+ C && /* @__PURE__ */ c("style", { children: C }),
2355
+ w && /* @__PURE__ */ c("style", { children: w }),
2356
+ T && /* @__PURE__ */ c("style", { children: T }),
2357
+ x
2317
2358
  ]
2318
2359
  })
2319
2360
  })
2320
2361
  })
2321
2362
  });
2322
- let C = I(t);
2323
- return /* @__PURE__ */ c(B.Provider, {
2363
+ let D = z(t);
2364
+ return /* @__PURE__ */ c(U.Provider, {
2324
2365
  value: {
2325
2366
  tenant: u || "",
2326
- apiUrl: f || "/api"
2367
+ apiUrl: d || "/api"
2327
2368
  },
2328
- children: /* @__PURE__ */ c(V.Provider, {
2329
- value: m ?? null,
2330
- children: /* @__PURE__ */ c(H.Provider, {
2331
- value: v,
2369
+ children: /* @__PURE__ */ c(W.Provider, {
2370
+ value: p ?? null,
2371
+ children: /* @__PURE__ */ c(G.Provider, {
2372
+ value: S,
2332
2373
  children: /* @__PURE__ */ l("div", {
2374
+ ...y,
2333
2375
  className: "webim-page",
2334
2376
  style: {
2335
- ...g,
2336
- ...R(t),
2377
+ ...b,
2378
+ ...V(t),
2337
2379
  ...o
2338
2380
  },
2339
2381
  children: [
2340
- /* @__PURE__ */ c("style", { children: `.webim-page { ${pt(L(C.light))} }
2341
- @media (prefers-color-scheme: dark) { .webim-page { ${pt(L(C.dark))} } }` }),
2342
- S,
2343
- y && /* @__PURE__ */ c("style", { children: y }),
2344
- b && /* @__PURE__ */ c("style", { children: b }),
2345
- x && /* @__PURE__ */ c("style", { children: x }),
2346
- _
2382
+ /* @__PURE__ */ c("style", { children: `.webim-page { ${gt(B(D.light))} }
2383
+ @media (prefers-color-scheme: dark) { .webim-page { ${gt(B(D.dark))} } }` }),
2384
+ E,
2385
+ C && /* @__PURE__ */ c("style", { children: C }),
2386
+ w && /* @__PURE__ */ c("style", { children: w }),
2387
+ T && /* @__PURE__ */ c("style", { children: T }),
2388
+ x
2347
2389
  ]
2348
2390
  })
2349
2391
  })
@@ -2352,8 +2394,8 @@ function mt({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
2352
2394
  }
2353
2395
  //#endregion
2354
2396
  //#region src/WebimContent.jsx
2355
- function ht({ bundle: e, mode: t = "auto", style: n }) {
2356
- return e?.blocks?.ROOT ? /* @__PURE__ */ c(mt, {
2397
+ function vt({ bundle: e, mode: t = "auto", style: n }) {
2398
+ return e?.blocks?.ROOT ? /* @__PURE__ */ c(_t, {
2357
2399
  blocks: e.blocks,
2358
2400
  theme: e.theme,
2359
2401
  components: e.components,
@@ -2361,13 +2403,15 @@ function ht({ bundle: e, mode: t = "auto", style: n }) {
2361
2403
  tenant: e.tenant,
2362
2404
  apiUrl: e.apiUrl,
2363
2405
  datasets: e.datasets,
2406
+ locale: e.locale,
2407
+ direction: e.direction,
2364
2408
  mode: t,
2365
2409
  style: n
2366
2410
  }) : null;
2367
2411
  }
2368
2412
  //#endregion
2369
2413
  //#region src/bundle.js
2370
- function gt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2414
+ function yt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2371
2415
  let a = {
2372
2416
  ...t?.global ?? {},
2373
2417
  ...t?.tenant ?? {}
@@ -2377,10 +2421,12 @@ function gt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2377
2421
  title: e.title,
2378
2422
  slug: e.slug,
2379
2423
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
2380
- theme: ee(o, a.builder_themes?.themes),
2424
+ theme: H(o, a.builder_themes?.themes),
2381
2425
  components: a.builder_components?.components ?? {},
2382
2426
  custom: o.custom,
2383
2427
  seo: o.seo,
2428
+ direction: o.direction,
2429
+ locale: i || a.locales?.default,
2384
2430
  locales: a.locales,
2385
2431
  tenant: n ?? "",
2386
2432
  apiUrl: r ?? ""
@@ -2388,15 +2434,15 @@ function gt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2388
2434
  }
2389
2435
  //#endregion
2390
2436
  //#region src/fetchPage.js
2391
- var _t = async (e) => {
2437
+ var bt = async (e) => {
2392
2438
  let t = await e.json().catch(() => null);
2393
2439
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
2394
2440
  return t?.payload ?? t;
2395
2441
  };
2396
- async function vt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
2442
+ async function xt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
2397
2443
  if (!e) throw Error("fetchPage: apiUrl is required");
2398
2444
  if (!n) throw Error("fetchPage: slug is required");
2399
- let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(_t), o(`${s}/settings/public`, { headers: c }).then(_t)]), d = gt({
2445
+ let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(bt), o(`${s}/settings/public`, { headers: c }).then(bt)]), d = yt({
2400
2446
  page: l,
2401
2447
  settings: u,
2402
2448
  tenant: t,
@@ -2404,7 +2450,7 @@ async function vt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch:
2404
2450
  locale: r
2405
2451
  }), f = [...new Set(Object.values(d.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" ? e.props?.source : null).filter(Boolean))];
2406
2452
  if (f.length) {
2407
- let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(_t).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
2453
+ let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(bt).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
2408
2454
  d.datasets = Object.fromEntries(t);
2409
2455
  }
2410
2456
  return d;
@@ -2417,34 +2463,34 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
2417
2463
  ">": "&gt;",
2418
2464
  "\"": "&quot;"
2419
2465
  })[e]);
2420
- function yt(t, { mode: n = "auto", style: r } = {}) {
2421
- return e(/* @__PURE__ */ c(ht, {
2466
+ function St(t, { mode: n = "auto", style: r } = {}) {
2467
+ return e(/* @__PURE__ */ c(vt, {
2422
2468
  bundle: t,
2423
2469
  mode: n,
2424
2470
  style: r
2425
2471
  }));
2426
2472
  }
2427
- function bt(e, { mode: t = "auto", lang: n = "en" } = {}) {
2428
- let r = e.seo ?? {}, i = r.title || e.title || e.slug || "Page", a = e.custom?.js?.trim(), o = [
2473
+ function Ct(e, { mode: t = "auto", lang: n } = {}) {
2474
+ let r = e.seo ?? {}, i = n || e.locale || "en", a = f(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
2429
2475
  "<meta charset=\"utf-8\"/>",
2430
2476
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
2431
- `<title>${$(i)}</title>`,
2477
+ `<title>${$(o)}</title>`,
2432
2478
  r.description && `<meta name="description" content="${$(r.description)}"/>`,
2433
- `<meta property="og:title" content="${$(i)}"/>`,
2479
+ `<meta property="og:title" content="${$(o)}"/>`,
2434
2480
  r.image && `<meta property="og:image" content="${$(r.image)}"/>`,
2435
2481
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
2436
2482
  "<style>html,body{margin:0;height:100%}</style>"
2437
2483
  ].filter(Boolean).join("\n");
2438
2484
  return `<!doctype html>
2439
- <html lang="${$(n)}">
2485
+ <html lang="${$(i)}"${a ? ` dir="${a}"` : ""}>
2440
2486
  <head>
2441
- ${o}
2487
+ ${c}
2442
2488
  </head>
2443
2489
  <body>
2444
- ${yt(e, { mode: t })}
2445
- ${a ? `<script>${a.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
2490
+ ${St(e, { mode: t })}
2491
+ ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
2446
2492
  </body>
2447
2493
  </html>`;
2448
2494
  }
2449
2495
  //#endregion
2450
- export { gt as assembleBundle, vt as fetchPage, yt as renderBundleHtml, bt as renderPageDocument };
2496
+ export { yt as assembleBundle, xt as fetchPage, St as renderBundleHtml, Ct as renderPageDocument };