webim-adapter 0.3.0 → 0.4.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.
@@ -161,54 +161,54 @@ function _(e) {
161
161
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
162
162
  let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
163
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: ee, boxShadowBlur: O, boxShadowSpread: k, boxShadowColor: A, boxShadowInset: j } = t;
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;
165
165
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
166
- let M = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
166
+ let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
167
167
  [
168
168
  D,
169
- ee,
170
169
  O,
171
170
  k,
172
171
  A,
173
- j
174
- ].some((e) => e !== void 0) && M.push(T({
172
+ j,
173
+ M
174
+ ].some((e) => e !== void 0) && N.push(T({
175
175
  x: D,
176
- y: ee,
177
- blur: O,
178
- spread: k,
179
- color: A,
180
- inset: j
181
- })), M.length && (t.boxShadow = M.join(", "));
182
- let te = (e) => e.type === "blur" ? `blur(${h(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, N = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(te), { filters: P, backdropFilters: F, filterBlur: I, filterGrayscale: L, filterBrightness: R, filterContrast: z, filterSaturate: B } = t;
176
+ y: O,
177
+ blur: k,
178
+ spread: A,
179
+ color: j,
180
+ inset: M
181
+ })), 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;
183
183
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
184
- let V = N(P);
185
- I !== void 0 && V.push(`blur(${h(I)})`), L !== void 0 && V.push(`grayscale(${L}%)`), R !== void 0 && V.push(`brightness(${R}%)`), z !== void 0 && V.push(`contrast(${z}%)`), B !== void 0 && V.push(`saturate(${B}%)`), V.length && (t.filter = V.join(" "));
186
- let H = N(F);
187
- H.length && (t.backdropFilter = H.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
184
+ 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
188
  let { textStrokeWidth: U, textStrokeColor: ne } = t;
189
189
  delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${h(U ?? 1)} ${ne || "currentColor"}`);
190
190
  let { clipText: W } = t;
191
191
  delete t.clipText, W && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
192
- let { transitions: re, transitionDuration: G, transitionEasing: ie, transitionProperty: ae } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
192
+ let { transitions: re, transitionDuration: G, transitionEasing: ie, transitionProperty: K } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
193
193
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
194
- let K = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
195
- if (G !== void 0 && K.push(`${ae || "all"} ${oe(G)} ${ie || "ease"}`), K.length && (t.transition = K.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
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) {
196
196
  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
197
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
198
198
  }
199
199
  delete t.backgroundVideo;
200
- let { overlayColor: q, overlayOpacity: J } = t;
201
- if (delete t.overlayColor, delete t.overlayOpacity, q) {
202
- let e = `color-mix(in srgb, ${q} ${J ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
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})`;
203
203
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
204
204
  }
205
205
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
206
- let { backgroundLayers: se } = t;
206
+ let { backgroundLayers: oe } = t;
207
207
  delete t.backgroundLayers;
208
- let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
209
- if (ce.length) {
208
+ let se = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1);
209
+ if (se.length) {
210
210
  let e = [], n = [], r = [], i = [], a = [];
211
- 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");
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");
212
212
  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
213
  else {
214
214
  if (!t.src) continue;
@@ -268,7 +268,7 @@ function D(e, t) {
268
268
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
269
269
  }).filter(Boolean).join("\n");
270
270
  }
271
- function ee(e, t) {
271
+ function O(e, t) {
272
272
  let n = [], r = (e) => {
273
273
  for (let [t, r] of Object.entries(e || {})) {
274
274
  let e = D(t, r.props);
@@ -279,7 +279,7 @@ function ee(e, t) {
279
279
  for (let e of Object.values(t || {})) r(e.template?.nodes);
280
280
  return n.join("\n");
281
281
  }
282
- function O(e, t) {
282
+ function k(e, t) {
283
283
  let n = [], r = (e) => {
284
284
  for (let [t, r] of Object.entries(e || {})) {
285
285
  let e = w(t, r.props);
@@ -290,7 +290,7 @@ function O(e, t) {
290
290
  for (let e of Object.values(t || {})) r(e.template?.nodes);
291
291
  return n.join("\n");
292
292
  }
293
- var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", A = {
293
+ var A = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", j = {
294
294
  light: {
295
295
  background: "#ffffff",
296
296
  text: "#111827",
@@ -327,23 +327,23 @@ var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
327
327
  contrastText: "#052e2b"
328
328
  }
329
329
  }
330
- }, j = {
330
+ }, M = {
331
331
  font: "system",
332
332
  headingFont: "inherit",
333
- light: A.light,
334
- dark: A.dark
335
- }, M = {
333
+ light: j.light,
334
+ dark: j.dark
335
+ }, N = {
336
336
  system: {
337
337
  label: "System",
338
- value: k
338
+ value: A
339
339
  },
340
340
  inter: {
341
341
  label: "Inter",
342
- value: `"Inter", ${k}`
342
+ value: `"Inter", ${A}`
343
343
  },
344
344
  outfit: {
345
345
  label: "Outfit",
346
- value: `"Outfit", ${k}`
346
+ value: `"Outfit", ${A}`
347
347
  },
348
348
  serif: {
349
349
  label: "Serif",
@@ -353,7 +353,7 @@ var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
353
353
  label: "Mono",
354
354
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
355
355
  }
356
- }, te = (e, t) => M[e]?.value ?? t, N = (e, ...t) => {
356
+ }, P = (e, t) => N[e]?.value ?? t, F = (e, ...t) => {
357
357
  let n = Object.assign({}, e, ...t);
358
358
  return n.primary = {
359
359
  ...e.primary,
@@ -369,16 +369,16 @@ var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
369
369
  }), {})
370
370
  }, n;
371
371
  };
372
- function P(e) {
372
+ function I(e) {
373
373
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
374
374
  return {
375
- font: r ?? j.font,
376
- headingFont: i ?? j.headingFont,
377
- light: N(A.light, a, t),
378
- dark: N(A.dark, n)
375
+ font: r ?? M.font,
376
+ headingFont: i ?? M.headingFont,
377
+ light: F(j.light, a, t),
378
+ dark: F(j.dark, n)
379
379
  };
380
380
  }
381
- function F(e) {
381
+ function L(e) {
382
382
  return {
383
383
  "--page-bg": e.background,
384
384
  "--page-text": e.text,
@@ -394,31 +394,31 @@ function F(e) {
394
394
  "--page-secondary-contrast": e.secondary.contrastText
395
395
  };
396
396
  }
397
- function I(e) {
398
- let t = P(e);
397
+ function R(e) {
398
+ let t = I(e);
399
399
  return {
400
400
  backgroundColor: "var(--page-bg)",
401
401
  color: "var(--page-text)",
402
- fontFamily: te(t.font, k),
403
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : te(t.headingFont, "inherit")
402
+ fontFamily: P(t.font, A),
403
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : P(t.headingFont, "inherit")
404
404
  };
405
405
  }
406
- function L(e, t = "light") {
407
- let n = P(e);
406
+ function z(e, t = "light") {
407
+ let n = I(e);
408
408
  return {
409
- ...I(e),
410
- ...F(n[t] ?? n.light)
409
+ ...R(e),
410
+ ...L(n[t] ?? n.light)
411
411
  };
412
412
  }
413
- function R(e, t) {
413
+ function ee(e, t) {
414
414
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
415
415
  }
416
416
  //#endregion
417
417
  //#region ../ui/src/components/builder/views.jsx
418
- var z = n({
418
+ var B = n({
419
419
  tenant: "",
420
420
  apiUrl: "/api"
421
- }), B = n(null), V = n(null), H = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
421
+ }), V = n(null), H = n(null), te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
422
422
  function U(e, t) {
423
423
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
424
424
  }
@@ -438,7 +438,7 @@ function W(e) {
438
438
  function re(e, t) {
439
439
  let n = t?.data ?? {}, r = ne(n);
440
440
  if (!r.length) return e;
441
- let i = RegExp(`:(${r.map(H).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;
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;
442
442
  return a(e);
443
443
  }
444
444
  var G = {
@@ -446,22 +446,22 @@ var G = {
446
446
  fontWeight: 700,
447
447
  lineHeight: 1.2,
448
448
  fontFamily: "var(--page-heading-font, inherit)"
449
- }, ie = { margin: 0 }, ae = {
449
+ }, ie = { margin: 0 }, K = {
450
450
  display: "inline-block",
451
451
  textDecoration: "none",
452
452
  cursor: "pointer",
453
453
  backgroundColor: "var(--page-accent, #111827)",
454
454
  color: "var(--page-accent-text, #ffffff)"
455
- }, oe = {
455
+ }, ae = {
456
456
  flexGrow: 1,
457
457
  display: "flex",
458
458
  flexDirection: "column",
459
459
  position: "relative"
460
- }, K = {
460
+ }, q = {
461
461
  display: "flex",
462
462
  flexDirection: "column"
463
463
  };
464
- function q({ style: e }) {
464
+ function J({ style: e }) {
465
465
  let t = e?.backgroundVideo;
466
466
  if (!t) return null;
467
467
  let n = {
@@ -487,7 +487,7 @@ function q({ style: e }) {
487
487
  background: r
488
488
  } })] });
489
489
  }
490
- var J = (e, t) => e?.backgroundVideo ? {
490
+ var Y = (e, t) => e?.backgroundVideo ? {
491
491
  position: "relative",
492
492
  ...t,
493
493
  ..._(e)
@@ -495,24 +495,24 @@ var J = (e, t) => e?.backgroundVideo ? {
495
495
  ...t,
496
496
  ..._(e)
497
497
  };
498
- function se({ style: e, nodeRef: t, children: n }) {
498
+ function oe({ style: e, nodeRef: t, children: n }) {
499
499
  return /* @__PURE__ */ l("div", {
500
500
  ref: t,
501
501
  style: {
502
- ...oe,
502
+ ...ae,
503
503
  ..._(e)
504
504
  },
505
- children: [/* @__PURE__ */ c(q, { style: e }), n]
505
+ children: [/* @__PURE__ */ c(J, { style: e }), n]
506
506
  });
507
507
  }
508
- function ce({ style: e, nodeRef: t, children: n }) {
508
+ function se({ style: e, nodeRef: t, children: n }) {
509
509
  return /* @__PURE__ */ l("section", {
510
510
  ref: t,
511
- style: J(e, K),
512
- children: [/* @__PURE__ */ c(q, { style: e }), n]
511
+ style: Y(e, q),
512
+ children: [/* @__PURE__ */ c(J, { style: e }), n]
513
513
  });
514
514
  }
515
- function le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
515
+ function ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
516
516
  let i = t ? {
517
517
  position: "relative",
518
518
  minHeight: 240
@@ -521,32 +521,32 @@ function le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
521
521
  ref: n,
522
522
  style: i ? {
523
523
  ...i,
524
- ...J(e)
525
- } : J(e),
526
- children: [/* @__PURE__ */ c(q, { style: e }), r]
524
+ ...Y(e)
525
+ } : Y(e),
526
+ children: [/* @__PURE__ */ c(J, { style: e }), r]
527
527
  });
528
528
  }
529
- function ue({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
529
+ function le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
530
530
  return /* @__PURE__ */ c(n, {
531
531
  ref: a,
532
532
  style: {
533
533
  ...G,
534
534
  ..._(r)
535
535
  },
536
- children: Y(t, e, i)
536
+ children: X(t, e, i)
537
537
  });
538
538
  }
539
- var de = {
540
- fontFamily: M.mono.value,
539
+ var ue = {
540
+ fontFamily: N.mono.value,
541
541
  background: "rgba(148, 163, 184, 0.18)",
542
542
  padding: "1px 5px",
543
543
  borderRadius: 4,
544
544
  fontSize: "0.9em"
545
545
  };
546
- function fe(e, t = [], n) {
546
+ function de(e, t = [], n) {
547
547
  let r = e;
548
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: de,
549
+ style: ue,
550
550
  children: r
551
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", {
552
552
  href: n,
@@ -554,13 +554,13 @@ function fe(e, t = [], n) {
554
554
  children: r
555
555
  })), r;
556
556
  }
557
- function Y(e, n, r) {
557
+ function X(e, n, r) {
558
558
  return e?.length ? e.map((e, n) => {
559
559
  if (e.slot) return /* @__PURE__ */ c(t, { children: r?.[e.slot] ?? null }, n);
560
- if (e.parts) return /* @__PURE__ */ c(t, { children: Y(e.parts, "", r) }, n);
560
+ if (e.parts) return /* @__PURE__ */ c(t, { children: X(e.parts, "", r) }, n);
561
561
  let i = e.text;
562
562
  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: de,
563
+ style: ue,
564
564
  children: i
565
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", {
566
566
  href: e.href,
@@ -569,13 +569,13 @@ function Y(e, n, r) {
569
569
  })), /* @__PURE__ */ c(t, { children: i }, n);
570
570
  }) : n;
571
571
  }
572
- function pe({ parts: e, text: t, marks: n, href: r, style: i }) {
572
+ function fe({ parts: e, text: t, marks: n, href: r, style: i }) {
573
573
  return /* @__PURE__ */ c("span", {
574
574
  style: _(i),
575
- children: e?.length ? Y(e, t) : fe(t, n, r)
575
+ children: e?.length ? X(e, t) : de(t, n, r)
576
576
  });
577
577
  }
578
- var me = {
578
+ var pe = {
579
579
  h1: 40,
580
580
  h2: 32,
581
581
  h3: 26,
@@ -583,7 +583,7 @@ var me = {
583
583
  h5: 19,
584
584
  h6: 16
585
585
  };
586
- function he({ align: e = "center", width: t } = {}) {
586
+ function me({ align: e = "center", width: t } = {}) {
587
587
  let n = t ? `${t}%` : void 0;
588
588
  return e === "full" ? { width: "100%" } : e === "left" ? {
589
589
  float: "left",
@@ -606,8 +606,8 @@ function he({ align: e = "center", width: t } = {}) {
606
606
  marginRight: "auto"
607
607
  };
608
608
  }
609
- function ge(e = [], t, n) {
610
- let r = n ?? ((e, n) => Y(e, n, t));
609
+ function he(e = [], t, n) {
610
+ let r = n ?? ((e, n) => X(e, n, t));
611
611
  return e.map((t, n) => {
612
612
  let i = {
613
613
  marginTop: 0,
@@ -629,7 +629,7 @@ function ge(e = [], t, n) {
629
629
  marginLeft: 0,
630
630
  marginRight: 0,
631
631
  ...i,
632
- ...he(t)
632
+ ...me(t)
633
633
  },
634
634
  children: [t.href ? /* @__PURE__ */ c("a", {
635
635
  href: t.href,
@@ -646,15 +646,15 @@ function ge(e = [], t, n) {
646
646
  })]
647
647
  }, n);
648
648
  }
649
- if (t.type === "video") return De(t.url) ? /* @__PURE__ */ c("div", {
649
+ if (t.type === "video") return Ee(t.url) ? /* @__PURE__ */ c("div", {
650
650
  style: {
651
651
  ...i,
652
- ...he({
652
+ ...me({
653
653
  align: t.align,
654
654
  width: t.width ?? 100
655
655
  })
656
656
  },
657
- children: /* @__PURE__ */ c(Oe, {
657
+ children: /* @__PURE__ */ c(De, {
658
658
  url: t.url,
659
659
  autoplay: t.autoplay,
660
660
  muted: t.muted,
@@ -683,17 +683,17 @@ function ge(e = [], t, n) {
683
683
  }
684
684
  if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
685
685
  style: {
686
- ...ve,
686
+ ..._e,
687
687
  ...i
688
688
  },
689
689
  children: r(t.parts, t.text)
690
690
  }, n);
691
- if (me[t.type]) {
691
+ if (pe[t.type]) {
692
692
  let e = t.type;
693
693
  return /* @__PURE__ */ c(e, {
694
694
  style: {
695
695
  ...G,
696
- fontSize: me[t.type],
696
+ fontSize: pe[t.type],
697
697
  ...i
698
698
  },
699
699
  children: r(t.parts, t.text)
@@ -708,32 +708,32 @@ function ge(e = [], t, n) {
708
708
  }, n);
709
709
  });
710
710
  }
711
- function _e({ content: e, style: t, linked: n, nodeRef: r }) {
711
+ function ge({ content: e, style: t, linked: n, nodeRef: r }) {
712
712
  return /* @__PURE__ */ c("div", {
713
713
  ref: r,
714
714
  style: {
715
715
  display: "flow-root",
716
716
  ..._(t)
717
717
  },
718
- children: ge(e, n)
718
+ children: he(e, n)
719
719
  });
720
720
  }
721
- var ve = {
721
+ var _e = {
722
722
  margin: 0,
723
723
  padding: "8px 0 8px 20px",
724
724
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
725
725
  };
726
- function ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
726
+ function ve({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
727
727
  return /* @__PURE__ */ c("blockquote", {
728
728
  ref: i,
729
729
  style: {
730
- ...ve,
730
+ ..._e,
731
731
  ..._(n)
732
732
  },
733
- children: Y(t, e, r)
733
+ children: X(t, e, r)
734
734
  });
735
735
  }
736
- function be({ ordered: e, items: t = [], style: n, nodeRef: r }) {
736
+ function ye({ ordered: e, items: t = [], style: n, nodeRef: r }) {
737
737
  return /* @__PURE__ */ c(e ? "ol" : "ul", {
738
738
  ref: r,
739
739
  style: {
@@ -743,53 +743,53 @@ function be({ ordered: e, items: t = [], style: n, nodeRef: r }) {
743
743
  },
744
744
  children: t.map((e, t) => /* @__PURE__ */ c("li", {
745
745
  style: { marginBottom: 4 },
746
- children: Y(e.parts, e.text)
746
+ children: X(e.parts, e.text)
747
747
  }, t))
748
748
  });
749
749
  }
750
- function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
750
+ function be({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
751
751
  return /* @__PURE__ */ c("p", {
752
752
  ref: i,
753
753
  style: {
754
754
  ...ie,
755
755
  ..._(n)
756
756
  },
757
- children: Y(t, e, r)
757
+ children: X(t, e, r)
758
758
  });
759
759
  }
760
- var Se = {
760
+ var xe = {
761
761
  color: "var(--page-accent, inherit)",
762
762
  textDecoration: "underline",
763
763
  textUnderlineOffset: 3,
764
764
  cursor: "pointer"
765
765
  };
766
- function Ce({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
766
+ function Se({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
767
767
  return /* @__PURE__ */ c("a", {
768
768
  ref: o,
769
769
  href: n || "#",
770
770
  target: r || void 0,
771
771
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
772
772
  style: {
773
- ...Se,
773
+ ...xe,
774
774
  ..._(i)
775
775
  },
776
- children: Y(t, e, a)
776
+ children: X(t, e, a)
777
777
  });
778
778
  }
779
- function we({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
779
+ function Ce({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
780
780
  return /* @__PURE__ */ c("a", {
781
781
  ref: o,
782
782
  href: n || "#",
783
783
  target: r || void 0,
784
784
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
785
785
  style: {
786
- ...ae,
786
+ ...K,
787
787
  ..._(i)
788
788
  },
789
- children: Y(t, e, a)
789
+ children: X(t, e, a)
790
790
  });
791
791
  }
792
- function Te({ src: e, alt: t, style: n, nodeRef: r }) {
792
+ function we({ src: e, alt: t, style: n, nodeRef: r }) {
793
793
  return e ? /* @__PURE__ */ c("img", {
794
794
  ref: r,
795
795
  src: e,
@@ -801,7 +801,7 @@ function Te({ src: e, alt: t, style: n, nodeRef: r }) {
801
801
  }
802
802
  }) : null;
803
803
  }
804
- function Ee({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
804
+ function Te({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
805
805
  return e ? /* @__PURE__ */ c("video", {
806
806
  ref: s,
807
807
  src: e,
@@ -819,9 +819,9 @@ function Ee({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
819
819
  }
820
820
  }) : null;
821
821
  }
822
- var De = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
823
- function Oe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
824
- let l = De(e);
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);
825
825
  if (!l) return null;
826
826
  let u = new URLSearchParams({ rel: "0" });
827
827
  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", {
@@ -847,7 +847,7 @@ function Oe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
847
847
  })
848
848
  });
849
849
  }
850
- function ke({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
850
+ function Oe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
851
851
  return e ? /* @__PURE__ */ c("iframe", {
852
852
  ref: i,
853
853
  src: e,
@@ -863,7 +863,7 @@ function ke({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
863
863
  }
864
864
  }) : null;
865
865
  }
866
- function Ae({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
866
+ function ke({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
867
867
  let [a, s] = o(null);
868
868
  return i(() => {
869
869
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -882,7 +882,7 @@ function Ae({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
882
882
  style: _(n)
883
883
  });
884
884
  }
885
- function je({ height: e, nodeRef: t }) {
885
+ function Ae({ height: e, nodeRef: t }) {
886
886
  return /* @__PURE__ */ c("div", {
887
887
  ref: t,
888
888
  style: {
@@ -892,7 +892,7 @@ function je({ height: e, nodeRef: t }) {
892
892
  }
893
893
  });
894
894
  }
895
- function Me({ style: e, nodeRef: t }) {
895
+ function je({ style: e, nodeRef: t }) {
896
896
  return /* @__PURE__ */ c("div", {
897
897
  ref: t,
898
898
  style: {
@@ -903,7 +903,7 @@ function Me({ style: e, nodeRef: t }) {
903
903
  }
904
904
  });
905
905
  }
906
- var Ne = {
906
+ var Me = {
907
907
  position: "absolute",
908
908
  top: "50%",
909
909
  transform: "translateY(-50%)",
@@ -920,7 +920,7 @@ var Ne = {
920
920
  alignItems: "center",
921
921
  justifyContent: "center",
922
922
  padding: 0
923
- }, Pe = {
923
+ }, Ne = {
924
924
  bottom: {
925
925
  inset: "auto 0 0 0",
926
926
  padding: "40px 24px 20px",
@@ -939,8 +939,8 @@ var Ne = {
939
939
  padding: 24,
940
940
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
941
941
  }
942
- }, Fe = 48;
943
- function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
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
944
  let [p, m] = o(0), [h, g] = o(!1), [v, y] = o(null), b = e ? Math.min(p, e - 1) : 0;
945
945
  if (i(() => {
946
946
  if (!n || h || v || e < 2) return;
@@ -956,7 +956,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
956
956
  let x = (t) => m((t + e) % e), S = () => {
957
957
  if (!v) return;
958
958
  let { dx: e } = v;
959
- y(null), e < -48 ? x(b + 1) : e > Fe && x(b - 1);
959
+ y(null), e < -48 ? x(b + 1) : e > Pe && x(b - 1);
960
960
  };
961
961
  return /* @__PURE__ */ l("div", {
962
962
  ref: f,
@@ -1004,7 +1004,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1004
1004
  type: "button",
1005
1005
  "aria-label": "Previous slide",
1006
1006
  style: {
1007
- ...Ne,
1007
+ ...Me,
1008
1008
  left: 12
1009
1009
  },
1010
1010
  onClick: () => x(b - 1),
@@ -1014,7 +1014,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1014
1014
  type: "button",
1015
1015
  "aria-label": "Next slide",
1016
1016
  style: {
1017
- ...Ne,
1017
+ ...Me,
1018
1018
  right: 12
1019
1019
  },
1020
1020
  onClick: () => x(b + 1),
@@ -1048,7 +1048,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1048
1048
  ] })]
1049
1049
  });
1050
1050
  }
1051
- var Le = (e, t) => ({
1051
+ var Ie = (e, t) => ({
1052
1052
  position: "absolute",
1053
1053
  inset: 0,
1054
1054
  backgroundImage: e ? `url(${e})` : "none",
@@ -1056,18 +1056,18 @@ var Le = (e, t) => ({
1056
1056
  backgroundSize: "cover",
1057
1057
  backgroundPosition: "center"
1058
1058
  });
1059
- function Re({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1060
- return e.length ? /* @__PURE__ */ c(Ie, {
1059
+ function Le({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1060
+ return e.length ? /* @__PURE__ */ c(Fe, {
1061
1061
  ...r,
1062
1062
  count: e.length,
1063
1063
  renderSlide: (r) => {
1064
1064
  let i = e[r];
1065
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Le(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1065
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Ie(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1066
1066
  style: {
1067
1067
  position: "absolute",
1068
1068
  color: "#fff",
1069
1069
  textAlign: n,
1070
- ...Pe[t] ?? Pe.bottom
1070
+ ...Ne[t] ?? Ne.bottom
1071
1071
  },
1072
1072
  children: [i.title && /* @__PURE__ */ c("div", {
1073
1073
  style: {
@@ -1087,13 +1087,13 @@ function Re({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1087
1087
  }
1088
1088
  }) : null;
1089
1089
  }
1090
- function ze({ slides: e = [], linked: t, ...n }) {
1091
- return e.length ? /* @__PURE__ */ c(Ie, {
1090
+ function Re({ slides: e = [], linked: t, ...n }) {
1091
+ return e.length ? /* @__PURE__ */ c(Fe, {
1092
1092
  ...n,
1093
1093
  count: e.length,
1094
1094
  renderSlide: (n) => {
1095
1095
  let r = e[n];
1096
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Le(r.image, r.color) }), /* @__PURE__ */ c("div", {
1096
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Ie(r.image, r.color) }), /* @__PURE__ */ c("div", {
1097
1097
  style: {
1098
1098
  position: "absolute",
1099
1099
  inset: 0,
@@ -1105,19 +1105,19 @@ function ze({ slides: e = [], linked: t, ...n }) {
1105
1105
  }
1106
1106
  }) : null;
1107
1107
  }
1108
- var X = {
1108
+ var Z = {
1109
1109
  color: "inherit",
1110
1110
  textDecoration: "none",
1111
1111
  fontSize: 14,
1112
1112
  opacity: .85
1113
- }, Be = {
1113
+ }, ze = {
1114
1114
  background: "var(--page-bg, #ffffff)",
1115
1115
  color: "var(--page-text, #111827)",
1116
1116
  border: "1px solid rgba(148, 163, 184, 0.25)",
1117
1117
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1118
1118
  zIndex: 60
1119
1119
  };
1120
- function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1120
+ function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1121
1121
  let [f, p] = o(null), [m, h] = o(!1), [g, v] = o(!1), [y, b] = o(null);
1122
1122
  i(() => {
1123
1123
  if (!f) return;
@@ -1127,7 +1127,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1127
1127
  let x = u === "hamburger" || u === "auto" && m, S = (e, t) => /* @__PURE__ */ l("a", {
1128
1128
  href: e.href || "#",
1129
1129
  style: {
1130
- ...X,
1130
+ ...Z,
1131
1131
  display: "block",
1132
1132
  ...t
1133
1133
  },
@@ -1198,7 +1198,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1198
1198
  let t = e.children ?? [];
1199
1199
  if (!t.length) return /* @__PURE__ */ c("a", {
1200
1200
  href: e.href || "#",
1201
- style: X,
1201
+ style: Z,
1202
1202
  children: e.label
1203
1203
  }, e.key);
1204
1204
  let n = e.type === "mega";
@@ -1212,7 +1212,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1212
1212
  children: [/* @__PURE__ */ l("a", {
1213
1213
  href: e.href || "#",
1214
1214
  style: {
1215
- ...X,
1215
+ ...Z,
1216
1216
  cursor: "pointer"
1217
1217
  },
1218
1218
  children: [
@@ -1228,7 +1228,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1228
1228
  ]
1229
1229
  }), y === e.key && (n ? /* @__PURE__ */ c("div", {
1230
1230
  style: {
1231
- ...Be,
1231
+ ...ze,
1232
1232
  position: "absolute",
1233
1233
  left: 0,
1234
1234
  right: 0,
@@ -1244,7 +1244,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1244
1244
  }))
1245
1245
  }) : /* @__PURE__ */ c("div", {
1246
1246
  style: {
1247
- ...Be,
1247
+ ...ze,
1248
1248
  position: "absolute",
1249
1249
  top: "100%",
1250
1250
  left: 0,
@@ -1273,7 +1273,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1273
1273
  children: r.map((e) => /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c("a", {
1274
1274
  href: e.href || "#",
1275
1275
  style: {
1276
- ...X,
1276
+ ...Z,
1277
1277
  padding: "10px 4px",
1278
1278
  fontWeight: (e.children ?? []).length ? 600 : 400,
1279
1279
  opacity: 1
@@ -1284,7 +1284,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1284
1284
  ]
1285
1285
  });
1286
1286
  }
1287
- function He({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1287
+ function Ve({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1288
1288
  let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1289
1289
  return e.length ? /* @__PURE__ */ l("div", {
1290
1290
  ref: r,
@@ -1324,7 +1324,7 @@ function He({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1324
1324
  }, e.key))]
1325
1325
  }) : null;
1326
1326
  }
1327
- function Ue({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1327
+ function He({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1328
1328
  let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
1329
1329
  if (!e.length) return null;
1330
1330
  let u = (e) => s((t) => {
@@ -1381,15 +1381,15 @@ function Ue({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1381
1381
  })
1382
1382
  });
1383
1383
  }
1384
- var We = {
1384
+ var Ue = {
1385
1385
  display: "flex",
1386
1386
  flexDirection: "column",
1387
1387
  gap: "12px"
1388
- }, Ge = {
1388
+ }, We = {
1389
1389
  fontSize: "14px",
1390
1390
  fontWeight: 500,
1391
1391
  color: "var(--page-text, #111827)"
1392
- }, Z = {
1392
+ }, Ge = {
1393
1393
  padding: "10px 12px",
1394
1394
  border: "1px solid #d1d5db",
1395
1395
  borderRadius: "6px",
@@ -1410,39 +1410,214 @@ var We = {
1410
1410
  tabIndex: -1,
1411
1411
  onMouseDown: (e) => e.preventDefault()
1412
1412
  } : {};
1413
- function Je({ style: e, action: t, method: n, name: i, enctype: a, formSlug: s, nodeRef: u, inert: d, children: f, linked: p, show: m }) {
1414
- let { tenant: h, apiUrl: g } = r(z), [v, y] = o("form"), b = d ? m || "form" : v;
1413
+ function Je(e, t) {
1414
+ if (!e) return !0;
1415
+ let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1416
+ switch (e.op) {
1417
+ case "eq": return r === i;
1418
+ case "neq": return r !== i;
1419
+ case "contains": return r.toLowerCase().includes(i.toLowerCase());
1420
+ case "gt": return Number(r) > Number(i);
1421
+ case "lt": return Number(r) < Number(i);
1422
+ case "empty": return r === "";
1423
+ case "notEmpty": return r !== "";
1424
+ default: return !1;
1425
+ }
1426
+ }
1427
+ var Ye = {
1428
+ display: "flex",
1429
+ flexDirection: "column",
1430
+ gap: 6
1431
+ }, Xe = {
1432
+ font: "inherit",
1433
+ fontSize: 15,
1434
+ padding: "10px 12px",
1435
+ borderRadius: 8,
1436
+ border: "1px solid rgba(148, 163, 184, 0.55)",
1437
+ background: "transparent",
1438
+ color: "inherit",
1439
+ width: "100%",
1440
+ boxSizing: "border-box"
1441
+ };
1442
+ function Ze({ field: e, value: t, onChange: n, inert: r }) {
1443
+ let i = /* @__PURE__ */ l("span", {
1444
+ style: {
1445
+ ...We,
1446
+ fontSize: 14
1447
+ },
1448
+ children: [e.label, e.required ? " *" : ""]
1449
+ }), a = {
1450
+ name: e.name,
1451
+ required: e.required || void 0,
1452
+ placeholder: e.placeholder || void 0,
1453
+ disabled: r || void 0,
1454
+ style: Xe,
1455
+ value: t ?? "",
1456
+ onChange: (t) => n(e.name, t.target.value)
1457
+ };
1458
+ return e.type === "display" ? /* @__PURE__ */ c(e.variant && e.variant !== "p" ? e.variant : "p", {
1459
+ style: {
1460
+ margin: 0,
1461
+ color: e.color || "inherit",
1462
+ fontSize: {
1463
+ h1: 32,
1464
+ h2: 26,
1465
+ h3: 21,
1466
+ h4: 18,
1467
+ h5: 16,
1468
+ h6: 14,
1469
+ p: 15
1470
+ }[e.variant] ?? 16,
1471
+ fontWeight: e.variant === "p" ? 400 : 700,
1472
+ lineHeight: 1.35
1473
+ },
1474
+ children: e.label
1475
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ c("img", {
1476
+ src: e.src,
1477
+ alt: e.label ?? "",
1478
+ style: {
1479
+ width: "100%",
1480
+ borderRadius: 8,
1481
+ display: "block"
1482
+ }
1483
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(De, {
1484
+ url: e.src,
1485
+ style: { width: "100%" }
1486
+ }) : /* @__PURE__ */ c("video", {
1487
+ src: e.src,
1488
+ controls: !0,
1489
+ style: {
1490
+ width: "100%",
1491
+ borderRadius: 8,
1492
+ display: "block"
1493
+ }
1494
+ }) : null : /* @__PURE__ */ l("label", {
1495
+ style: Ye,
1496
+ children: [
1497
+ i,
1498
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ c("textarea", {
1499
+ ...a,
1500
+ rows: 4,
1501
+ style: {
1502
+ ...Xe,
1503
+ resize: "vertical"
1504
+ }
1505
+ }) : e.type === "select" ? /* @__PURE__ */ l("select", {
1506
+ ...a,
1507
+ children: [/* @__PURE__ */ c("option", {
1508
+ value: "",
1509
+ children: e.placeholder || "—"
1510
+ }), (e.options ?? []).map((e, t) => /* @__PURE__ */ c("option", {
1511
+ value: typeof e == "string" ? e : e.value,
1512
+ children: typeof e == "string" ? e : e.label ?? e.value
1513
+ }, t))]
1514
+ }) : e.type === "checkbox" ? /* @__PURE__ */ c("input", {
1515
+ type: "checkbox",
1516
+ name: e.name,
1517
+ required: e.required || void 0,
1518
+ disabled: r || void 0,
1519
+ checked: !!t,
1520
+ onChange: (t) => n(e.name, t.target.checked),
1521
+ style: {
1522
+ width: 18,
1523
+ height: 18
1524
+ }
1525
+ }) : e.type === "upload" ? /* @__PURE__ */ c("input", {
1526
+ type: "file",
1527
+ name: e.name,
1528
+ accept: e.accept || void 0,
1529
+ required: e.required || void 0,
1530
+ disabled: r || void 0,
1531
+ onChange: (t) => n(e.name, t.target.files?.[0]?.name ?? ""),
1532
+ style: {
1533
+ font: "inherit",
1534
+ fontSize: 14
1535
+ }
1536
+ }) : /* @__PURE__ */ c("input", {
1537
+ ...a,
1538
+ type: {
1539
+ email: "email",
1540
+ number: "number",
1541
+ date: "date",
1542
+ datetime: "datetime-local",
1543
+ phone: "tel",
1544
+ link: "url"
1545
+ }[e.type] ?? "text"
1546
+ }),
1547
+ e.help && /* @__PURE__ */ c("span", {
1548
+ style: {
1549
+ fontSize: 12,
1550
+ opacity: .65
1551
+ },
1552
+ children: e.help
1553
+ })
1554
+ ]
1555
+ });
1556
+ }
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;
1559
+ i(() => {
1560
+ if (!f || !d) return;
1561
+ 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)), () => {
1563
+ e = !1;
1564
+ };
1565
+ }, [
1566
+ f,
1567
+ d,
1568
+ b,
1569
+ x
1570
+ ]);
1571
+ let j = [{
1572
+ section: null,
1573
+ fields: []
1574
+ }];
1575
+ for (let e of w?.fields ?? []) e.type === "section" ? j.push({
1576
+ section: e,
1577
+ fields: []
1578
+ }) : 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) => ({
1580
+ ...e,
1581
+ fields: e.fields.filter((e) => Je(e.condition, E))
1582
+ })), 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
+ let t = E[e.name];
1584
+ return e.required && (t == null || t === "" || t === !1);
1585
+ }), R = F >= N.length - 1, z = (e, t) => D((n) => ({
1586
+ ...n,
1587
+ [e]: t
1588
+ }));
1415
1589
  return /* @__PURE__ */ l("div", {
1416
- ref: u,
1590
+ ref: m,
1417
1591
  style: _(e),
1418
1592
  children: [
1419
1593
  /* @__PURE__ */ c("form", {
1420
1594
  action: t || void 0,
1421
1595
  method: n || "post",
1422
- name: i || void 0,
1423
- encType: a || void 0,
1596
+ name: a || void 0,
1597
+ encType: u || void 0,
1424
1598
  onSubmit: async (e) => {
1425
- if (e.preventDefault(), !d) {
1426
- if (s) {
1599
+ if (e.preventDefault(), !h) {
1600
+ if (d) {
1427
1601
  let t = {};
1428
- for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1602
+ if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1603
+ else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1429
1604
  try {
1430
- let e = await fetch(`${g || "/api"}/forms/${s}/submit`, {
1605
+ let e = await fetch(`${x || "/api"}/forms/${d}/submit`, {
1431
1606
  method: "post",
1432
1607
  headers: {
1433
1608
  "content-type": "application/json",
1434
- ...h ? { "x-tenant": h } : {}
1609
+ ...b ? { "x-tenant": b } : {}
1435
1610
  },
1436
1611
  body: JSON.stringify(t)
1437
1612
  }), n = await e.json().catch(() => null);
1438
- y(e.ok && n?.success !== !1 ? "success" : "error");
1613
+ C(e.ok && n?.success !== !1 ? "success" : "error");
1439
1614
  } catch {
1440
- y("error");
1615
+ C("error");
1441
1616
  }
1442
1617
  return;
1443
1618
  }
1444
1619
  if (!t) {
1445
- y("success");
1620
+ C("success");
1446
1621
  return;
1447
1622
  }
1448
1623
  try {
@@ -1450,43 +1625,113 @@ function Je({ style: e, action: t, method: n, name: i, enctype: a, formSlug: s,
1450
1625
  method: n || "post",
1451
1626
  body: new FormData(e.currentTarget)
1452
1627
  });
1453
- y(r.ok ? "success" : "error");
1628
+ C(r.ok ? "success" : "error");
1454
1629
  } catch {
1455
- y("error");
1630
+ C("error");
1456
1631
  }
1457
1632
  }
1458
1633
  },
1459
1634
  style: {
1460
- ...We,
1461
- display: b === "success" ? "none" : "flex"
1635
+ ...Ue,
1636
+ display: A === "success" ? "none" : "flex"
1462
1637
  },
1463
- children: f
1638
+ children: f && d ? /* @__PURE__ */ l(s, { children: [
1639
+ P && /* @__PURE__ */ c(ut, {
1640
+ steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1641
+ active: F + 1,
1642
+ style: { marginBottom: 8 }
1643
+ }),
1644
+ P && N[F]?.section?.help && /* @__PURE__ */ c("p", {
1645
+ style: {
1646
+ margin: 0,
1647
+ fontSize: 14,
1648
+ opacity: .7
1649
+ },
1650
+ children: N[F].section.help
1651
+ }),
1652
+ I.map((e) => /* @__PURE__ */ c(Ze, {
1653
+ field: e,
1654
+ value: E[e.name],
1655
+ onChange: z,
1656
+ inert: h
1657
+ }, e.name)),
1658
+ /* @__PURE__ */ l("div", {
1659
+ style: {
1660
+ display: "flex",
1661
+ gap: 10,
1662
+ alignItems: "center",
1663
+ marginTop: 4
1664
+ },
1665
+ children: [P && F > 0 && /* @__PURE__ */ c("button", {
1666
+ type: "button",
1667
+ disabled: h || void 0,
1668
+ onClick: () => k(F - 1),
1669
+ style: {
1670
+ ...K,
1671
+ background: "transparent",
1672
+ color: "inherit",
1673
+ border: 0,
1674
+ padding: "10px 16px",
1675
+ cursor: "pointer"
1676
+ },
1677
+ children: "Back"
1678
+ }), P && !R ? /* @__PURE__ */ c("button", {
1679
+ type: "button",
1680
+ disabled: h || L.length > 0,
1681
+ onClick: () => k(F + 1),
1682
+ style: {
1683
+ ...K,
1684
+ border: 0,
1685
+ padding: "10px 22px",
1686
+ borderRadius: 8,
1687
+ fontSize: 15,
1688
+ fontWeight: 600,
1689
+ cursor: "pointer",
1690
+ opacity: L.length ? .5 : 1
1691
+ },
1692
+ children: "Next"
1693
+ }) : /* @__PURE__ */ c("button", {
1694
+ type: "submit",
1695
+ disabled: h || void 0,
1696
+ style: {
1697
+ ...K,
1698
+ border: 0,
1699
+ padding: "10px 22px",
1700
+ borderRadius: 8,
1701
+ fontSize: 15,
1702
+ fontWeight: 600,
1703
+ cursor: "pointer"
1704
+ },
1705
+ children: p || "Submit"
1706
+ })]
1707
+ })
1708
+ ] }) : g
1464
1709
  }),
1465
1710
  /* @__PURE__ */ c("div", {
1466
- style: { display: b === "success" ? "block" : "none" },
1467
- children: p?.success ?? null
1711
+ style: { display: A === "success" ? "block" : "none" },
1712
+ children: v?.success ?? null
1468
1713
  }),
1469
1714
  /* @__PURE__ */ c("div", {
1470
1715
  style: {
1471
- display: b === "error" ? "block" : "none",
1716
+ display: A === "error" ? "block" : "none",
1472
1717
  marginTop: 12
1473
1718
  },
1474
- children: p?.error ?? null
1719
+ children: v?.error ?? null
1475
1720
  })
1476
1721
  ]
1477
1722
  });
1478
1723
  }
1479
- function Ye({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1724
+ function $e({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1480
1725
  return /* @__PURE__ */ c("label", {
1481
1726
  ref: r,
1482
1727
  style: {
1483
- ...Ge,
1728
+ ...We,
1484
1729
  ..._(n)
1485
1730
  },
1486
- children: Y(t, e, i)
1731
+ children: X(t, e, i)
1487
1732
  });
1488
1733
  }
1489
- function Xe({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1734
+ function et({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1490
1735
  return /* @__PURE__ */ c("input", {
1491
1736
  ref: a,
1492
1737
  type: e,
@@ -1494,13 +1739,13 @@ function Xe({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1494
1739
  placeholder: n,
1495
1740
  required: !o && !!r,
1496
1741
  style: {
1497
- ...Z,
1742
+ ...Ge,
1498
1743
  ..._(i)
1499
1744
  },
1500
1745
  ...qe(o)
1501
1746
  });
1502
1747
  }
1503
- function Ze({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1748
+ function tt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1504
1749
  return /* @__PURE__ */ c("textarea", {
1505
1750
  ref: a,
1506
1751
  name: e || void 0,
@@ -1508,14 +1753,14 @@ function Ze({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1508
1753
  rows: n,
1509
1754
  required: !o && !!r,
1510
1755
  style: {
1511
- ...Z,
1756
+ ...Ge,
1512
1757
  resize: "vertical",
1513
1758
  ..._(i)
1514
1759
  },
1515
1760
  ...qe(o)
1516
1761
  });
1517
1762
  }
1518
- function Qe({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1763
+ function nt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1519
1764
  return /* @__PURE__ */ l("label", {
1520
1765
  ref: o,
1521
1766
  style: {
@@ -1536,7 +1781,7 @@ function Qe({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1536
1781
  }), t]
1537
1782
  });
1538
1783
  }
1539
- function $e({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1784
+ function rt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1540
1785
  return /* @__PURE__ */ l("select", {
1541
1786
  ref: a,
1542
1787
  name: e || void 0,
@@ -1545,7 +1790,7 @@ function $e({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1545
1790
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1546
1791
  tabIndex: o ? -1 : void 0,
1547
1792
  style: {
1548
- ...Z,
1793
+ ...Ge,
1549
1794
  appearance: "auto",
1550
1795
  ..._(i)
1551
1796
  },
@@ -1559,12 +1804,12 @@ function $e({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1559
1804
  }, t))]
1560
1805
  });
1561
1806
  }
1562
- function et({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1807
+ function it({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1563
1808
  let [u, d] = o(null);
1564
1809
  return /* @__PURE__ */ l("label", {
1565
1810
  ref: a,
1566
1811
  style: {
1567
- ...Z,
1812
+ ...Ge,
1568
1813
  display: "flex",
1569
1814
  alignItems: "center",
1570
1815
  gap: "8px",
@@ -1591,12 +1836,12 @@ function et({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
1591
1836
  ]
1592
1837
  });
1593
1838
  }
1594
- function tt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1839
+ function at({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1595
1840
  return /* @__PURE__ */ c("button", {
1596
1841
  ref: n,
1597
1842
  type: r ? "button" : "submit",
1598
1843
  style: {
1599
- ...ae,
1844
+ ...K,
1600
1845
  border: 0,
1601
1846
  cursor: "pointer",
1602
1847
  alignSelf: "flex-start",
@@ -1611,7 +1856,7 @@ function tt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1611
1856
  children: e
1612
1857
  });
1613
1858
  }
1614
- function nt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1859
+ function ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1615
1860
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1616
1861
  return /* @__PURE__ */ c("div", {
1617
1862
  ref: r,
@@ -1628,8 +1873,8 @@ function nt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1628
1873
  }, t))
1629
1874
  });
1630
1875
  }
1631
- function rt({ 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 }) {
1632
- let { tenant: g, apiUrl: v } = r(z), y = r(V), b = r(B)?.[e], [x, S] = o(null);
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);
1633
1878
  if (i(() => {
1634
1879
  if (!e || b) return;
1635
1880
  let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
@@ -1717,7 +1962,7 @@ function rt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1717
1962
  lineHeight: 1.55,
1718
1963
  opacity: .85
1719
1964
  },
1720
- children: ge(a)
1965
+ children: he(a)
1721
1966
  })
1722
1967
  ]
1723
1968
  })]
@@ -1725,7 +1970,7 @@ function rt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1725
1970
  })
1726
1971
  });
1727
1972
  }
1728
- function it({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
1973
+ function ct({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
1729
1974
  return e.length ? /* @__PURE__ */ c("nav", {
1730
1975
  ref: r,
1731
1976
  "aria-label": "Breadcrumb",
@@ -1775,7 +2020,7 @@ function it({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
1775
2020
  })
1776
2021
  }) : null;
1777
2022
  }
1778
- function at({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2023
+ function lt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
1779
2024
  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) => ({
1780
2025
  display: "inline-flex",
1781
2026
  alignItems: "center",
@@ -1828,7 +2073,7 @@ function at({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
1828
2073
  ]
1829
2074
  });
1830
2075
  }
1831
- function ot({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2076
+ function ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
1832
2077
  if (!e.length) return null;
1833
2078
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
1834
2079
  width: 32,
@@ -1906,91 +2151,103 @@ function ot({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
1906
2151
  })
1907
2152
  });
1908
2153
  }
1909
- function st({ columns: e = [], rows: t = [], striped: n = !0, bordered: r = !1, compact: i = !1, style: a, nodeRef: o }) {
1910
- if (!e.length) return null;
1911
- let s = i ? "6px 10px" : "10px 14px", u = "1px solid rgba(148, 163, 184, 0.35)", d = r ? { border: u } : { borderBottom: u };
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);
2156
+ if (i(() => {
2157
+ if (!n || g) return;
2158
+ 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([])), () => {
2160
+ e = !1;
2161
+ };
2162
+ }, [
2163
+ n,
2164
+ m,
2165
+ h,
2166
+ g
2167
+ ]), !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 };
1912
2169
  return /* @__PURE__ */ c("div", {
1913
- ref: o,
2170
+ ref: p,
1914
2171
  style: {
1915
2172
  width: "100%",
1916
2173
  overflowX: "auto",
1917
- ..._(a)
2174
+ ..._(f)
1918
2175
  },
1919
2176
  children: /* @__PURE__ */ l("table", {
1920
2177
  style: {
1921
2178
  width: "100%",
1922
2179
  borderCollapse: "collapse",
1923
2180
  fontSize: 14,
1924
- ...r ? { border: u } : {}
2181
+ ...u ? { border: C } : {}
1925
2182
  },
1926
2183
  children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
1927
2184
  style: {
1928
2185
  textAlign: "left",
1929
2186
  fontWeight: 600,
1930
- padding: s,
2187
+ padding: S,
1931
2188
  background: "rgba(148, 163, 184, 0.12)",
1932
- ...d
2189
+ ...w
1933
2190
  },
1934
2191
  children: e.label ?? e
1935
- }, t)) }) }), /* @__PURE__ */ c("tbody", { children: t.map((t, r) => /* @__PURE__ */ c("tr", {
1936
- style: n && r % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2192
+ }, t)) }) }), /* @__PURE__ */ c("tbody", { children: x.map((t, n) => /* @__PURE__ */ c("tr", {
2193
+ style: s && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
1937
2194
  children: e.map((e, n) => /* @__PURE__ */ c("td", {
1938
2195
  style: {
1939
- padding: s,
1940
- ...d
2196
+ padding: S,
2197
+ ...w
1941
2198
  },
1942
2199
  children: t?.[n] ?? ""
1943
2200
  }, n))
1944
- }, r)) })]
2201
+ }, n)) })]
1945
2202
  })
1946
2203
  });
1947
2204
  }
1948
- var ct = {
1949
- PageRoot: se,
1950
- Section: ce,
1951
- Container: le,
1952
- Heading: ue,
1953
- TextBlock: xe,
1954
- ButtonBlock: we,
1955
- ImageBlock: Te,
1956
- Spacer: je,
1957
- Divider: Me,
1958
- SliderBlock: Re,
1959
- CanvasSlider: ze,
1960
- TabsBlock: He,
1961
- QuickStack: nt,
1962
- CollectionList: rt,
1963
- BreadcrumbsBlock: it,
1964
- PaginationBlock: at,
1965
- StepperBlock: ot,
1966
- TableBlock: st,
1967
- AccordionBlock: Ue,
1968
- NavbarBlock: Ve,
1969
- ListBlock: be,
1970
- TextSpan: pe,
1971
- QuoteBlock: ye,
1972
- TextLink: Ce,
1973
- RichTextBlock: _e,
1974
- RichContentBlock: _e,
1975
- VideoBlock: Ee,
1976
- YouTubeBlock: Oe,
1977
- IframeBlock: ke,
1978
- EmbedBlock: Ae,
1979
- FormBlock: Je,
1980
- FormLabel: Ye,
1981
- FormInput: Xe,
1982
- FormTextarea: Ze,
1983
- FormCheckbox: (e) => /* @__PURE__ */ c(Qe, {
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, {
1984
2241
  kind: "checkbox",
1985
2242
  ...e
1986
2243
  }),
1987
- FormRadio: (e) => /* @__PURE__ */ c(Qe, {
2244
+ FormRadio: (e) => /* @__PURE__ */ c(nt, {
1988
2245
  kind: "radio",
1989
2246
  ...e
1990
2247
  }),
1991
- FormSelect: $e,
1992
- FormFile: et,
1993
- FormSubmit: tt
2248
+ FormSelect: rt,
2249
+ FormFile: it,
2250
+ FormSubmit: at
1994
2251
  };
1995
2252
  //#endregion
1996
2253
  //#region ../ui/src/components/builder/render.jsx
@@ -2004,7 +2261,7 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2004
2261
  let l = new Set(i).add(n);
2005
2262
  return /* @__PURE__ */ c(t, { children: Q(s.template.rootId, s.template.nodes, r, l, a) }, e);
2006
2263
  }
2007
- let u = ct[s];
2264
+ let u = ft[s];
2008
2265
  if (!u) return null;
2009
2266
  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;
2010
2267
  return /* @__PURE__ */ c(u, {
@@ -2019,8 +2276,8 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2019
2276
  }
2020
2277
  //#endregion
2021
2278
  //#region ../ui/src/components/builder/PageRenderer.jsx
2022
- var lt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2023
- function ut({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, custom: s, tenant: u, apiUrl: f, datasets: m }) {
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 }) {
2024
2281
  let h = s?.js?.trim();
2025
2282
  if (i(() => {
2026
2283
  if (!h) return;
@@ -2031,24 +2288,24 @@ function ut({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
2031
2288
  minHeight: "100%",
2032
2289
  display: "flex",
2033
2290
  flexDirection: "column"
2034
- }, _ = Q("ROOT", e, n), v = a(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), y = O(e, n), b = ee(e, n), x = s?.css?.trim(), S = p(e, n).map((e) => /* @__PURE__ */ c("link", {
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", {
2035
2292
  rel: "stylesheet",
2036
2293
  precedence: "default",
2037
2294
  href: d(e)
2038
2295
  }, e));
2039
- if (r !== "auto") return /* @__PURE__ */ c(z.Provider, {
2296
+ if (r !== "auto") return /* @__PURE__ */ c(B.Provider, {
2040
2297
  value: {
2041
2298
  tenant: u || "",
2042
2299
  apiUrl: f || "/api"
2043
2300
  },
2044
- children: /* @__PURE__ */ c(B.Provider, {
2301
+ children: /* @__PURE__ */ c(V.Provider, {
2045
2302
  value: m ?? null,
2046
- children: /* @__PURE__ */ c(V.Provider, {
2303
+ children: /* @__PURE__ */ c(H.Provider, {
2047
2304
  value: v,
2048
2305
  children: /* @__PURE__ */ l("div", {
2049
2306
  style: {
2050
2307
  ...g,
2051
- ...L(t, r),
2308
+ ...z(t, r),
2052
2309
  ...o
2053
2310
  },
2054
2311
  children: [
@@ -2062,26 +2319,26 @@ function ut({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
2062
2319
  })
2063
2320
  })
2064
2321
  });
2065
- let C = P(t);
2066
- return /* @__PURE__ */ c(z.Provider, {
2322
+ let C = I(t);
2323
+ return /* @__PURE__ */ c(B.Provider, {
2067
2324
  value: {
2068
2325
  tenant: u || "",
2069
2326
  apiUrl: f || "/api"
2070
2327
  },
2071
- children: /* @__PURE__ */ c(B.Provider, {
2328
+ children: /* @__PURE__ */ c(V.Provider, {
2072
2329
  value: m ?? null,
2073
- children: /* @__PURE__ */ c(V.Provider, {
2330
+ children: /* @__PURE__ */ c(H.Provider, {
2074
2331
  value: v,
2075
2332
  children: /* @__PURE__ */ l("div", {
2076
2333
  className: "webim-page",
2077
2334
  style: {
2078
2335
  ...g,
2079
- ...I(t),
2336
+ ...R(t),
2080
2337
  ...o
2081
2338
  },
2082
2339
  children: [
2083
- /* @__PURE__ */ c("style", { children: `.webim-page { ${lt(F(C.light))} }
2084
- @media (prefers-color-scheme: dark) { .webim-page { ${lt(F(C.dark))} } }` }),
2340
+ /* @__PURE__ */ c("style", { children: `.webim-page { ${pt(L(C.light))} }
2341
+ @media (prefers-color-scheme: dark) { .webim-page { ${pt(L(C.dark))} } }` }),
2085
2342
  S,
2086
2343
  y && /* @__PURE__ */ c("style", { children: y }),
2087
2344
  b && /* @__PURE__ */ c("style", { children: b }),
@@ -2095,8 +2352,8 @@ function ut({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
2095
2352
  }
2096
2353
  //#endregion
2097
2354
  //#region src/WebimContent.jsx
2098
- function dt({ bundle: e, mode: t = "auto", style: n }) {
2099
- return e?.blocks?.ROOT ? /* @__PURE__ */ c(ut, {
2355
+ function ht({ bundle: e, mode: t = "auto", style: n }) {
2356
+ return e?.blocks?.ROOT ? /* @__PURE__ */ c(mt, {
2100
2357
  blocks: e.blocks,
2101
2358
  theme: e.theme,
2102
2359
  components: e.components,
@@ -2110,7 +2367,7 @@ function dt({ bundle: e, mode: t = "auto", style: n }) {
2110
2367
  }
2111
2368
  //#endregion
2112
2369
  //#region src/bundle.js
2113
- function ft({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2370
+ function gt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2114
2371
  let a = {
2115
2372
  ...t?.global ?? {},
2116
2373
  ...t?.tenant ?? {}
@@ -2120,7 +2377,7 @@ function ft({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2120
2377
  title: e.title,
2121
2378
  slug: e.slug,
2122
2379
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
2123
- theme: R(o, a.builder_themes?.themes),
2380
+ theme: ee(o, a.builder_themes?.themes),
2124
2381
  components: a.builder_components?.components ?? {},
2125
2382
  custom: o.custom,
2126
2383
  seo: o.seo,
@@ -2131,23 +2388,23 @@ function ft({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2131
2388
  }
2132
2389
  //#endregion
2133
2390
  //#region src/fetchPage.js
2134
- var pt = async (e) => {
2391
+ var _t = async (e) => {
2135
2392
  let t = await e.json().catch(() => null);
2136
2393
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
2137
2394
  return t?.payload ?? t;
2138
2395
  };
2139
- async function mt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
2396
+ async function vt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
2140
2397
  if (!e) throw Error("fetchPage: apiUrl is required");
2141
2398
  if (!n) throw Error("fetchPage: slug is required");
2142
- 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(pt), o(`${s}/settings/public`, { headers: c }).then(pt)]), d = ft({
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({
2143
2400
  page: l,
2144
2401
  settings: u,
2145
2402
  tenant: t,
2146
2403
  apiUrl: s,
2147
2404
  locale: r
2148
- }), f = [...new Set(Object.values(d.blocks ?? {}).filter((e) => e?.type?.resolvedName === "CollectionList" && e.props?.collection).map((e) => e.props.collection))];
2405
+ }), 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))];
2149
2406
  if (f.length) {
2150
- 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(pt).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
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, []])));
2151
2408
  d.datasets = Object.fromEntries(t);
2152
2409
  }
2153
2410
  return d;
@@ -2160,14 +2417,14 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
2160
2417
  ">": "&gt;",
2161
2418
  "\"": "&quot;"
2162
2419
  })[e]);
2163
- function ht(t, { mode: n = "auto", style: r } = {}) {
2164
- return e(/* @__PURE__ */ c(dt, {
2420
+ function yt(t, { mode: n = "auto", style: r } = {}) {
2421
+ return e(/* @__PURE__ */ c(ht, {
2165
2422
  bundle: t,
2166
2423
  mode: n,
2167
2424
  style: r
2168
2425
  }));
2169
2426
  }
2170
- function gt(e, { mode: t = "auto", lang: n = "en" } = {}) {
2427
+ function bt(e, { mode: t = "auto", lang: n = "en" } = {}) {
2171
2428
  let r = e.seo ?? {}, i = r.title || e.title || e.slug || "Page", a = e.custom?.js?.trim(), o = [
2172
2429
  "<meta charset=\"utf-8\"/>",
2173
2430
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
@@ -2184,10 +2441,10 @@ function gt(e, { mode: t = "auto", lang: n = "en" } = {}) {
2184
2441
  ${o}
2185
2442
  </head>
2186
2443
  <body>
2187
- ${ht(e, { mode: t })}
2444
+ ${yt(e, { mode: t })}
2188
2445
  ${a ? `<script>${a.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
2189
2446
  </body>
2190
2447
  </html>`;
2191
2448
  }
2192
2449
  //#endregion
2193
- export { ft as assembleBundle, mt as fetchPage, ht as renderBundleHtml, gt as renderPageDocument };
2450
+ export { gt as assembleBundle, vt as fetchPage, yt as renderBundleHtml, bt as renderPageDocument };