webim-adapter 0.2.0 → 0.3.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,6 @@
1
1
  import { renderToStaticMarkup as e } from "react-dom/server";
2
- import { Fragment as t, createContext as n, useContext as r, useEffect as i, useState as a } from "react";
3
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
2
+ import { Fragment as t, createContext as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
3
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
4
  new Map([
5
5
  {
6
6
  family: "Bebas Neue",
@@ -107,14 +107,14 @@ new Map([
107
107
  fallback: "sans-serif"
108
108
  }
109
109
  ].map((e) => [e.family, e]));
110
- function l(e) {
110
+ function u(e) {
111
111
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
112
112
  }
113
- var u = (e) => l([e]), d = (e) => {
113
+ var d = (e) => u([e]), f = (e) => {
114
114
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
115
115
  return t ? t[1] : null;
116
116
  };
117
- function f(e, t) {
117
+ function p(e, t) {
118
118
  let n = /* @__PURE__ */ new Set(), r = (e) => {
119
119
  for (let t of Object.values(e || {})) for (let e of [
120
120
  "style",
@@ -122,7 +122,7 @@ function f(e, t) {
122
122
  "pressed",
123
123
  "focused"
124
124
  ]) {
125
- let r = d(t.props?.[e]?.fontFamily);
125
+ let r = f(t.props?.[e]?.fontFamily);
126
126
  r && n.add(r);
127
127
  }
128
128
  };
@@ -132,123 +132,123 @@ function f(e, t) {
132
132
  }
133
133
  //#endregion
134
134
  //#region ../ui/src/components/builder/styles.js
135
- var p = /* @__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(".")), m = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, h = [
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 = [
136
136
  "borderWidth",
137
137
  "borderStyle",
138
138
  "borderColor",
139
139
  "borderRadius",
140
140
  "gap"
141
141
  ];
142
- function g(e) {
142
+ function _(e) {
143
143
  let t = {};
144
- for (let n of h) {
144
+ for (let n of g) {
145
145
  let r = e?.[n];
146
- r != null && r !== "" && (t[n] = p.has(n) ? m(r) : r);
146
+ r != null && r !== "" && (t[n] = m.has(n) ? h(r) : r);
147
147
  }
148
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || h.includes(n) || (t[n] = p.has(n) ? m(r) : r);
148
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || g.includes(n) || (t[n] = m.has(n) ? h(r) : r);
149
149
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
150
150
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
151
151
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
152
152
  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) => `${m(e.x ?? 0)} ${m(e.y ?? 0)} ${m(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
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)"}`);
154
154
  [
155
155
  s,
156
156
  c,
157
157
  l,
158
158
  u
159
- ].some((e) => e !== void 0) && d.push(`${m(s ?? 0)} ${m(c ?? 0)} ${m(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, g = (e) => e.type === "move" ? `translate(${m(e.x ?? 0)}, ${m(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;
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;
161
161
  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(g).filter(Boolean);
163
- (v !== void 0 || y !== void 0) && w.push(`translate(${m(v ?? 0)}, ${m(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 " : ""}${m(e.x ?? 0)} ${m(e.y ?? 0)} ${m(e.blur ?? 0)} ${m(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: ee, boxShadowX: te, boxShadowY: E, boxShadowBlur: D, boxShadowSpread: O, boxShadowColor: k, boxShadowInset: A } = t;
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: ee, boxShadowBlur: O, boxShadowSpread: k, boxShadowColor: A, boxShadowInset: j } = 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 j = (Array.isArray(ee) ? ee : []).filter((e) => e && e.on !== !1).map(T);
166
+ let M = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
167
167
  [
168
- te,
169
- E,
170
168
  D,
169
+ ee,
171
170
  O,
172
171
  k,
173
- A
174
- ].some((e) => e !== void 0) && j.push(T({
175
- x: te,
176
- y: E,
177
- blur: D,
178
- spread: O,
179
- color: k,
180
- inset: A
181
- })), j.length && (t.boxShadow = j.join(", "));
182
- let M = (e) => e.type === "blur" ? `blur(${m(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(M), { filters: P, backdropFilters: F, filterBlur: I, filterGrayscale: L, filterBrightness: R, filterContrast: z, filterSaturate: B } = t;
172
+ A,
173
+ j
174
+ ].some((e) => e !== void 0) && M.push(T({
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;
183
183
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
184
184
  let V = N(P);
185
- I !== void 0 && V.push(`blur(${m(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(" "));
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
186
  let H = N(F);
187
187
  H.length && (t.backdropFilter = H.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
188
- let { textStrokeWidth: ne, textStrokeColor: U } = t;
189
- delete t.textStrokeWidth, delete t.textStrokeColor, (ne !== void 0 || U !== void 0) && (t.WebkitTextStroke = `${m(ne ?? 1)} ${U || "currentColor"}`);
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
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: ie, transitionEasing: ae, transitionProperty: oe } = t, G = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
192
+ let { transitions: re, transitionDuration: G, transitionEasing: ie, transitionProperty: ae } = t, oe = (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"} ${G(e.duration ?? 200)} ${e.easing || "ease"}`);
195
- if (ie !== void 0 && K.push(`${oe || "all"} ${G(ie)} ${ae || "ease"}`), K.length && (t.transition = K.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
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) {
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: se } = t;
200
+ let { overlayColor: q, overlayOpacity: J } = t;
201
201
  if (delete t.overlayColor, delete t.overlayOpacity, q) {
202
- let e = `color-mix(in srgb, ${q} ${se ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
202
+ let e = `color-mix(in srgb, ${q} ${J ?? 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: J } = t;
206
+ let { backgroundLayers: se } = t;
207
207
  delete t.backgroundLayers;
208
- let Y = (Array.isArray(J) ? J : []).filter((e) => e && e.on !== !1);
209
- if (Y.length) {
208
+ let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
209
+ if (ce.length) {
210
210
  let e = [], n = [], r = [], i = [], a = [];
211
- for (let t of Y) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
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");
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;
215
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${m(t.w ?? "auto")} ${m(t.h ?? "auto")}` : t.size || "cover"), r.push(`${m(t.posX ?? 0)} ${m(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
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");
216
216
  }
217
217
  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
218
  }
219
219
  return t;
220
220
  }
221
- var _ = {
221
+ var v = {
222
222
  hover: ":hover",
223
223
  pressed: ":active",
224
224
  focused: ":focus"
225
- }, v = /* @__PURE__ */ new Set([
225
+ }, y = /* @__PURE__ */ new Set([
226
226
  "style",
227
227
  "class",
228
228
  "id",
229
229
  "data-wb",
230
230
  "data-wb-class",
231
231
  "data-slot"
232
- ]), y = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !v.has(e.toLowerCase());
233
- function b(e, t, n = []) {
232
+ ]), b = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !y.has(e.toLowerCase());
233
+ function x(e, t, n = []) {
234
234
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
235
235
  for (let t of n) e.removeAttribute(t);
236
236
  let r = [];
237
237
  for (let n of t.attributes ?? []) {
238
238
  let t = String(n?.name ?? "").trim();
239
- y(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
239
+ b(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
240
240
  }
241
241
  return r;
242
242
  }
243
- var x = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
244
- function S(e, t, n, r = !1) {
245
- let i = Object.entries(g(t)).map(([e, t]) => `${x(e)}: ${t} !important;`).join(" ");
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(" ");
246
246
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
247
247
  }
248
- function C(e, t, n) {
249
- return Object.entries(_).map(([r, i]) => S(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
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");
250
250
  }
251
- var w = [
251
+ var T = [
252
252
  {
253
253
  key: "tablet",
254
254
  max: 991
@@ -261,17 +261,17 @@ var w = [
261
261
  key: "mobile",
262
262
  max: 478
263
263
  }
264
- ], T = (e) => Object.entries(g(e)).map(([e, t]) => `${x(e)}: ${t} !important;`).join(" ");
265
- function ee(e, t) {
266
- return w.map(({ key: n, max: r }) => {
267
- let i = t?.[n] ? T(t[n]) : "";
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]) : "";
268
268
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
269
269
  }).filter(Boolean).join("\n");
270
270
  }
271
- function te(e, t) {
271
+ function ee(e, t) {
272
272
  let n = [], r = (e) => {
273
273
  for (let [t, r] of Object.entries(e || {})) {
274
- let e = ee(t, r.props);
274
+ let e = D(t, r.props);
275
275
  e && n.push(e);
276
276
  }
277
277
  };
@@ -279,10 +279,10 @@ function te(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 E(e, t) {
282
+ function O(e, t) {
283
283
  let n = [], r = (e) => {
284
284
  for (let [t, r] of Object.entries(e || {})) {
285
- let e = C(t, r.props);
285
+ let e = w(t, r.props);
286
286
  e && n.push(e);
287
287
  }
288
288
  };
@@ -290,7 +290,7 @@ function E(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 D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", O = {
293
+ var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", A = {
294
294
  light: {
295
295
  background: "#ffffff",
296
296
  text: "#111827",
@@ -327,23 +327,23 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
327
327
  contrastText: "#052e2b"
328
328
  }
329
329
  }
330
- }, k = {
330
+ }, j = {
331
331
  font: "system",
332
332
  headingFont: "inherit",
333
- light: O.light,
334
- dark: O.dark
335
- }, A = {
333
+ light: A.light,
334
+ dark: A.dark
335
+ }, M = {
336
336
  system: {
337
337
  label: "System",
338
- value: D
338
+ value: k
339
339
  },
340
340
  inter: {
341
341
  label: "Inter",
342
- value: `"Inter", ${D}`
342
+ value: `"Inter", ${k}`
343
343
  },
344
344
  outfit: {
345
345
  label: "Outfit",
346
- value: `"Outfit", ${D}`
346
+ value: `"Outfit", ${k}`
347
347
  },
348
348
  serif: {
349
349
  label: "Serif",
@@ -353,7 +353,7 @@ var D = "-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
- }, j = (e, t) => A[e]?.value ?? t, M = (e, ...t) => {
356
+ }, te = (e, t) => M[e]?.value ?? t, N = (e, ...t) => {
357
357
  let n = Object.assign({}, e, ...t);
358
358
  return n.primary = {
359
359
  ...e.primary,
@@ -369,16 +369,16 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
369
369
  }), {})
370
370
  }, n;
371
371
  };
372
- function N(e) {
372
+ function P(e) {
373
373
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
374
374
  return {
375
- font: r ?? k.font,
376
- headingFont: i ?? k.headingFont,
377
- light: M(O.light, a, t),
378
- dark: M(O.dark, n)
375
+ font: r ?? j.font,
376
+ headingFont: i ?? j.headingFont,
377
+ light: N(A.light, a, t),
378
+ dark: N(A.dark, n)
379
379
  };
380
380
  }
381
- function P(e) {
381
+ function F(e) {
382
382
  return {
383
383
  "--page-bg": e.background,
384
384
  "--page-text": e.text,
@@ -394,51 +394,74 @@ function P(e) {
394
394
  "--page-secondary-contrast": e.secondary.contrastText
395
395
  };
396
396
  }
397
- function F(e) {
398
- let t = N(e);
397
+ function I(e) {
398
+ let t = P(e);
399
399
  return {
400
400
  backgroundColor: "var(--page-bg)",
401
401
  color: "var(--page-text)",
402
- fontFamily: j(t.font, D),
403
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : j(t.headingFont, "inherit")
402
+ fontFamily: te(t.font, k),
403
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : te(t.headingFont, "inherit")
404
404
  };
405
405
  }
406
- function I(e, t = "light") {
407
- let n = N(e);
406
+ function L(e, t = "light") {
407
+ let n = P(e);
408
408
  return {
409
- ...F(e),
410
- ...P(n[t] ?? n.light)
409
+ ...I(e),
410
+ ...F(n[t] ?? n.light)
411
411
  };
412
412
  }
413
- function L(e, t) {
413
+ function R(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 R = n({
418
+ var z = n({
419
419
  tenant: "",
420
420
  apiUrl: "/api"
421
- }), z = {
421
+ }), B = n(null), V = n(null), H = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
422
+ function U(e, t) {
423
+ if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
424
+ }
425
+ var ne = (e) => {
426
+ let t = [];
427
+ for (let [n, r] of Object.entries(e ?? {})) {
428
+ if (!/^[\w-]+$/.test(n)) continue;
429
+ t.push(n);
430
+ let e = Array.isArray(r) ? r[0] : r, i = Array.isArray(r) ? `${n}.0` : n;
431
+ if (e && typeof e == "object" && !Array.isArray(e)) for (let n of Object.keys(e)) /^[\w-]+$/.test(n) && t.push(`${i}.${n}`);
432
+ }
433
+ return t;
434
+ };
435
+ function W(e) {
436
+ 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
+ }
438
+ function re(e, t) {
439
+ let n = t?.data ?? {}, r = ne(n);
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;
442
+ return a(e);
443
+ }
444
+ var G = {
422
445
  margin: 0,
423
446
  fontWeight: 700,
424
447
  lineHeight: 1.2,
425
448
  fontFamily: "var(--page-heading-font, inherit)"
426
- }, B = { margin: 0 }, V = {
449
+ }, ie = { margin: 0 }, ae = {
427
450
  display: "inline-block",
428
451
  textDecoration: "none",
429
452
  cursor: "pointer",
430
453
  backgroundColor: "var(--page-accent, #111827)",
431
454
  color: "var(--page-accent-text, #ffffff)"
432
- }, H = {
455
+ }, oe = {
433
456
  flexGrow: 1,
434
457
  display: "flex",
435
458
  flexDirection: "column",
436
459
  position: "relative"
437
- }, ne = {
460
+ }, K = {
438
461
  display: "flex",
439
462
  flexDirection: "column"
440
463
  };
441
- function U({ style: e }) {
464
+ function q({ style: e }) {
442
465
  let t = e?.backgroundVideo;
443
466
  if (!t) return null;
444
467
  let n = {
@@ -449,7 +472,7 @@ function U({ style: e }) {
449
472
  zIndex: -1,
450
473
  pointerEvents: "none"
451
474
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
452
- return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("video", {
475
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("video", {
453
476
  src: t,
454
477
  autoPlay: !0,
455
478
  muted: !0,
@@ -459,100 +482,100 @@ function U({ style: e }) {
459
482
  ...n,
460
483
  objectFit: "cover"
461
484
  }
462
- }), r && /* @__PURE__ */ s("div", { style: {
485
+ }), r && /* @__PURE__ */ c("div", { style: {
463
486
  ...n,
464
487
  background: r
465
488
  } })] });
466
489
  }
467
- var W = (e, t) => e?.backgroundVideo ? {
490
+ var J = (e, t) => e?.backgroundVideo ? {
468
491
  position: "relative",
469
492
  ...t,
470
- ...g(e)
493
+ ..._(e)
471
494
  } : {
472
495
  ...t,
473
- ...g(e)
496
+ ..._(e)
474
497
  };
475
- function re({ style: e, nodeRef: t, children: n }) {
476
- return /* @__PURE__ */ c("div", {
498
+ function se({ style: e, nodeRef: t, children: n }) {
499
+ return /* @__PURE__ */ l("div", {
477
500
  ref: t,
478
501
  style: {
479
- ...H,
480
- ...g(e)
502
+ ...oe,
503
+ ..._(e)
481
504
  },
482
- children: [/* @__PURE__ */ s(U, { style: e }), n]
505
+ children: [/* @__PURE__ */ c(q, { style: e }), n]
483
506
  });
484
507
  }
485
- function ie({ style: e, nodeRef: t, children: n }) {
486
- return /* @__PURE__ */ c("section", {
508
+ function ce({ style: e, nodeRef: t, children: n }) {
509
+ return /* @__PURE__ */ l("section", {
487
510
  ref: t,
488
- style: W(e, ne),
489
- children: [/* @__PURE__ */ s(U, { style: e }), n]
511
+ style: J(e, K),
512
+ children: [/* @__PURE__ */ c(q, { style: e }), n]
490
513
  });
491
514
  }
492
- function ae({ style: e, freeLayout: t, nodeRef: n, children: r }) {
515
+ function le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
493
516
  let i = t ? {
494
517
  position: "relative",
495
518
  minHeight: 240
496
519
  } : null;
497
- return /* @__PURE__ */ c("div", {
520
+ return /* @__PURE__ */ l("div", {
498
521
  ref: n,
499
522
  style: i ? {
500
523
  ...i,
501
- ...W(e)
502
- } : W(e),
503
- children: [/* @__PURE__ */ s(U, { style: e }), r]
524
+ ...J(e)
525
+ } : J(e),
526
+ children: [/* @__PURE__ */ c(q, { style: e }), r]
504
527
  });
505
528
  }
506
- function oe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
507
- return /* @__PURE__ */ s(n, {
529
+ function ue({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
530
+ return /* @__PURE__ */ c(n, {
508
531
  ref: a,
509
532
  style: {
510
- ...z,
511
- ...g(r)
533
+ ...G,
534
+ ..._(r)
512
535
  },
513
- children: q(t, e, i)
536
+ children: Y(t, e, i)
514
537
  });
515
538
  }
516
- var G = {
517
- fontFamily: A.mono.value,
539
+ var de = {
540
+ fontFamily: M.mono.value,
518
541
  background: "rgba(148, 163, 184, 0.18)",
519
542
  padding: "1px 5px",
520
543
  borderRadius: 4,
521
544
  fontSize: "0.9em"
522
545
  };
523
- function K(e, t = [], n) {
546
+ function fe(e, t = [], n) {
524
547
  let r = e;
525
- return t.includes("sup") ? r = /* @__PURE__ */ s("sup", { children: r }) : t.includes("sub") && (r = /* @__PURE__ */ s("sub", { children: r })), t.includes("code") && (r = /* @__PURE__ */ s("code", {
526
- style: G,
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,
527
550
  children: r
528
- })), t.includes("strike") && (r = /* @__PURE__ */ s("s", { children: r })), t.includes("underline") && (r = /* @__PURE__ */ s("u", { children: r })), t.includes("italic") && (r = /* @__PURE__ */ s("em", { children: r })), t.includes("bold") && (r = /* @__PURE__ */ s("strong", { children: r })), n && (r = /* @__PURE__ */ s("a", {
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", {
529
552
  href: n,
530
553
  style: { color: "inherit" },
531
554
  children: r
532
555
  })), r;
533
556
  }
534
- function q(e, n, r) {
557
+ function Y(e, n, r) {
535
558
  return e?.length ? e.map((e, n) => {
536
- if (e.slot) return /* @__PURE__ */ s(t, { children: r?.[e.slot] ?? null }, n);
537
- if (e.parts) return /* @__PURE__ */ s(t, { children: q(e.parts, "", r) }, n);
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);
538
561
  let i = e.text;
539
- return e.sup ? i = /* @__PURE__ */ s("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ s("sub", { children: i })), e.code && (i = /* @__PURE__ */ s("code", {
540
- style: G,
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,
541
564
  children: i
542
- })), e.strike && (i = /* @__PURE__ */ s("s", { children: i })), e.underline && (i = /* @__PURE__ */ s("u", { children: i })), e.italic && (i = /* @__PURE__ */ s("em", { children: i })), e.bold && (i = /* @__PURE__ */ s("strong", { children: i })), e.href && (i = /* @__PURE__ */ s("a", {
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", {
543
566
  href: e.href,
544
567
  style: { color: "inherit" },
545
568
  children: i
546
- })), /* @__PURE__ */ s(t, { children: i }, n);
569
+ })), /* @__PURE__ */ c(t, { children: i }, n);
547
570
  }) : n;
548
571
  }
549
- function se({ parts: e, text: t, marks: n, href: r, style: i }) {
550
- return /* @__PURE__ */ s("span", {
551
- style: g(i),
552
- children: e?.length ? q(e, t) : K(t, n, r)
572
+ function pe({ parts: e, text: t, marks: n, href: r, style: i }) {
573
+ return /* @__PURE__ */ c("span", {
574
+ style: _(i),
575
+ children: e?.length ? Y(e, t) : fe(t, n, r)
553
576
  });
554
577
  }
555
- var J = {
578
+ var me = {
556
579
  h1: 40,
557
580
  h2: 32,
558
581
  h3: 26,
@@ -560,7 +583,7 @@ var J = {
560
583
  h5: 19,
561
584
  h6: 16
562
585
  };
563
- function Y({ align: e = "center", width: t } = {}) {
586
+ function he({ align: e = "center", width: t } = {}) {
564
587
  let n = t ? `${t}%` : void 0;
565
588
  return e === "full" ? { width: "100%" } : e === "left" ? {
566
589
  float: "left",
@@ -583,8 +606,8 @@ function Y({ align: e = "center", width: t } = {}) {
583
606
  marginRight: "auto"
584
607
  };
585
608
  }
586
- function ce(e = [], t, n) {
587
- let r = n ?? ((e, n) => q(e, n, t));
609
+ function ge(e = [], t, n) {
610
+ let r = n ?? ((e, n) => Y(e, n, t));
588
611
  return e.map((t, n) => {
589
612
  let i = {
590
613
  marginTop: 0,
@@ -592,7 +615,7 @@ function ce(e = [], t, n) {
592
615
  };
593
616
  if (t.type === "image") {
594
617
  if (!t.src) return null;
595
- let e = /* @__PURE__ */ s("img", {
618
+ let e = /* @__PURE__ */ c("img", {
596
619
  src: t.src,
597
620
  alt: t.alt || "",
598
621
  style: {
@@ -601,18 +624,18 @@ function ce(e = [], t, n) {
601
624
  borderRadius: 6
602
625
  }
603
626
  });
604
- return /* @__PURE__ */ c("figure", {
627
+ return /* @__PURE__ */ l("figure", {
605
628
  style: {
606
629
  marginLeft: 0,
607
630
  marginRight: 0,
608
631
  ...i,
609
- ...Y(t)
632
+ ...he(t)
610
633
  },
611
- children: [t.href ? /* @__PURE__ */ s("a", {
634
+ children: [t.href ? /* @__PURE__ */ c("a", {
612
635
  href: t.href,
613
636
  style: { display: "block" },
614
637
  children: e
615
- }) : e, t.caption && /* @__PURE__ */ s("figcaption", {
638
+ }) : e, t.caption && /* @__PURE__ */ c("figcaption", {
616
639
  style: {
617
640
  fontSize: 13,
618
641
  opacity: .65,
@@ -623,15 +646,15 @@ function ce(e = [], t, n) {
623
646
  })]
624
647
  }, n);
625
648
  }
626
- if (t.type === "video") return ye(t.url) ? /* @__PURE__ */ s("div", {
649
+ if (t.type === "video") return De(t.url) ? /* @__PURE__ */ c("div", {
627
650
  style: {
628
651
  ...i,
629
- ...Y({
652
+ ...he({
630
653
  align: t.align,
631
654
  width: t.width ?? 100
632
655
  })
633
656
  },
634
- children: /* @__PURE__ */ s(be, {
657
+ children: /* @__PURE__ */ c(Oe, {
635
658
  url: t.url,
636
659
  autoplay: t.autoplay,
637
660
  muted: t.muted,
@@ -640,147 +663,147 @@ function ce(e = [], t, n) {
640
663
  start: t.start
641
664
  })
642
665
  }, n) : null;
643
- if (t.type === "divider") return /* @__PURE__ */ s("hr", { style: {
666
+ if (t.type === "divider") return /* @__PURE__ */ c("hr", { style: {
644
667
  ...i,
645
668
  border: 0,
646
669
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
647
670
  } }, n);
648
671
  if (t.type === "ul" || t.type === "ol") {
649
672
  let e = t.type;
650
- return /* @__PURE__ */ s(e, {
673
+ return /* @__PURE__ */ c(e, {
651
674
  style: {
652
675
  ...i,
653
676
  paddingLeft: 24
654
677
  },
655
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ s("li", {
678
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ c("li", {
656
679
  style: { marginBottom: 4 },
657
680
  children: r(e.parts, e.text)
658
681
  }, t))
659
682
  }, n);
660
683
  }
661
- if (t.type === "quote") return /* @__PURE__ */ s("blockquote", {
684
+ if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
662
685
  style: {
663
- ...ue,
686
+ ...ve,
664
687
  ...i
665
688
  },
666
689
  children: r(t.parts, t.text)
667
690
  }, n);
668
- if (J[t.type]) {
691
+ if (me[t.type]) {
669
692
  let e = t.type;
670
- return /* @__PURE__ */ s(e, {
693
+ return /* @__PURE__ */ c(e, {
671
694
  style: {
672
- ...z,
673
- fontSize: J[t.type],
695
+ ...G,
696
+ fontSize: me[t.type],
674
697
  ...i
675
698
  },
676
699
  children: r(t.parts, t.text)
677
700
  }, n);
678
701
  }
679
- return /* @__PURE__ */ s("p", {
702
+ return /* @__PURE__ */ c("p", {
680
703
  style: {
681
- ...B,
704
+ ...ie,
682
705
  ...i
683
706
  },
684
707
  children: r(t.parts, t.text)
685
708
  }, n);
686
709
  });
687
710
  }
688
- function le({ content: e, style: t, linked: n, nodeRef: r }) {
689
- return /* @__PURE__ */ s("div", {
711
+ function _e({ content: e, style: t, linked: n, nodeRef: r }) {
712
+ return /* @__PURE__ */ c("div", {
690
713
  ref: r,
691
714
  style: {
692
715
  display: "flow-root",
693
- ...g(t)
716
+ ..._(t)
694
717
  },
695
- children: ce(e, n)
718
+ children: ge(e, n)
696
719
  });
697
720
  }
698
- var ue = {
721
+ var ve = {
699
722
  margin: 0,
700
723
  padding: "8px 0 8px 20px",
701
724
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
702
725
  };
703
- function de({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
704
- return /* @__PURE__ */ s("blockquote", {
726
+ function ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
727
+ return /* @__PURE__ */ c("blockquote", {
705
728
  ref: i,
706
729
  style: {
707
- ...ue,
708
- ...g(n)
730
+ ...ve,
731
+ ..._(n)
709
732
  },
710
- children: q(t, e, r)
733
+ children: Y(t, e, r)
711
734
  });
712
735
  }
713
- function fe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
714
- return /* @__PURE__ */ s(e ? "ol" : "ul", {
736
+ function be({ ordered: e, items: t = [], style: n, nodeRef: r }) {
737
+ return /* @__PURE__ */ c(e ? "ol" : "ul", {
715
738
  ref: r,
716
739
  style: {
717
740
  margin: 0,
718
741
  paddingLeft: 24,
719
- ...g(n)
742
+ ..._(n)
720
743
  },
721
- children: t.map((e, t) => /* @__PURE__ */ s("li", {
744
+ children: t.map((e, t) => /* @__PURE__ */ c("li", {
722
745
  style: { marginBottom: 4 },
723
- children: q(e.parts, e.text)
746
+ children: Y(e.parts, e.text)
724
747
  }, t))
725
748
  });
726
749
  }
727
- function pe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
728
- return /* @__PURE__ */ s("p", {
750
+ function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
751
+ return /* @__PURE__ */ c("p", {
729
752
  ref: i,
730
753
  style: {
731
- ...B,
732
- ...g(n)
754
+ ...ie,
755
+ ..._(n)
733
756
  },
734
- children: q(t, e, r)
757
+ children: Y(t, e, r)
735
758
  });
736
759
  }
737
- var me = {
760
+ var Se = {
738
761
  color: "var(--page-accent, inherit)",
739
762
  textDecoration: "underline",
740
763
  textUnderlineOffset: 3,
741
764
  cursor: "pointer"
742
765
  };
743
- function he({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
744
- return /* @__PURE__ */ s("a", {
766
+ function Ce({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
767
+ return /* @__PURE__ */ c("a", {
745
768
  ref: o,
746
769
  href: n || "#",
747
770
  target: r || void 0,
748
771
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
749
772
  style: {
750
- ...me,
751
- ...g(i)
773
+ ...Se,
774
+ ..._(i)
752
775
  },
753
- children: q(t, e, a)
776
+ children: Y(t, e, a)
754
777
  });
755
778
  }
756
- function ge({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
757
- return /* @__PURE__ */ s("a", {
779
+ function we({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
780
+ return /* @__PURE__ */ c("a", {
758
781
  ref: o,
759
782
  href: n || "#",
760
783
  target: r || void 0,
761
784
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
762
785
  style: {
763
- ...V,
764
- ...g(i)
786
+ ...ae,
787
+ ..._(i)
765
788
  },
766
- children: q(t, e, a)
789
+ children: Y(t, e, a)
767
790
  });
768
791
  }
769
- function _e({ src: e, alt: t, style: n, nodeRef: r }) {
770
- return e ? /* @__PURE__ */ s("img", {
792
+ function Te({ src: e, alt: t, style: n, nodeRef: r }) {
793
+ return e ? /* @__PURE__ */ c("img", {
771
794
  ref: r,
772
795
  src: e,
773
796
  alt: t || "",
774
797
  style: {
775
798
  display: "block",
776
799
  maxWidth: "100%",
777
- ...g(n)
800
+ ..._(n)
778
801
  }
779
802
  }) : null;
780
803
  }
781
- function ve({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: c }) {
782
- return e ? /* @__PURE__ */ s("video", {
783
- ref: c,
804
+ function Ee({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
805
+ return e ? /* @__PURE__ */ c("video", {
806
+ ref: s,
784
807
  src: e,
785
808
  poster: t || void 0,
786
809
  controls: n,
@@ -792,24 +815,24 @@ function ve({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
792
815
  display: "block",
793
816
  width: "100%",
794
817
  maxWidth: "100%",
795
- ...g(o)
818
+ ..._(o)
796
819
  }
797
820
  }) : null;
798
821
  }
799
- var ye = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
800
- function be({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: c }) {
801
- let l = ye(e);
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);
802
825
  if (!l) return null;
803
826
  let u = new URLSearchParams({ rel: "0" });
804
- 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__ */ s("div", {
805
- ref: c,
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", {
828
+ ref: s,
806
829
  style: {
807
830
  position: "relative",
808
831
  width: "100%",
809
832
  paddingTop: "56.25%",
810
- ...g(o)
833
+ ..._(o)
811
834
  },
812
- children: /* @__PURE__ */ s("iframe", {
835
+ children: /* @__PURE__ */ c("iframe", {
813
836
  src: `https://www.youtube-nocookie.com/embed/${l}?${u}`,
814
837
  title: "YouTube video",
815
838
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
@@ -824,8 +847,8 @@ function be({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
824
847
  })
825
848
  });
826
849
  }
827
- function xe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
828
- return e ? /* @__PURE__ */ s("iframe", {
850
+ function ke({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
851
+ return e ? /* @__PURE__ */ c("iframe", {
829
852
  ref: i,
830
853
  src: e,
831
854
  title: t || "Embedded frame",
@@ -836,31 +859,31 @@ function xe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
836
859
  width: "100%",
837
860
  height: 300,
838
861
  border: 0,
839
- ...g(r)
862
+ ..._(r)
840
863
  }
841
864
  }) : null;
842
865
  }
843
- function Se({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
844
- let [o, c] = a(null);
866
+ function Ae({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
867
+ let [a, s] = o(null);
845
868
  return i(() => {
846
- o && (o.innerHTML = e || "", t && o.querySelectorAll("script").forEach((e) => {
869
+ a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
847
870
  let t = document.createElement("script");
848
871
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
849
872
  t.text = e.textContent, e.replaceWith(t);
850
873
  }));
851
874
  }, [
852
- o,
875
+ a,
853
876
  e,
854
877
  t
855
- ]), /* @__PURE__ */ s("div", {
878
+ ]), /* @__PURE__ */ c("div", {
856
879
  ref: (e) => {
857
- c(e), r && r(e);
880
+ s(e), r && r(e);
858
881
  },
859
- style: g(n)
882
+ style: _(n)
860
883
  });
861
884
  }
862
- function Ce({ height: e, nodeRef: t }) {
863
- return /* @__PURE__ */ s("div", {
885
+ function je({ height: e, nodeRef: t }) {
886
+ return /* @__PURE__ */ c("div", {
864
887
  ref: t,
865
888
  style: {
866
889
  height: e || 32,
@@ -869,18 +892,18 @@ function Ce({ height: e, nodeRef: t }) {
869
892
  }
870
893
  });
871
894
  }
872
- function we({ style: e, nodeRef: t }) {
873
- return /* @__PURE__ */ s("div", {
895
+ function Me({ style: e, nodeRef: t }) {
896
+ return /* @__PURE__ */ c("div", {
874
897
  ref: t,
875
898
  style: {
876
899
  height: 1,
877
900
  alignSelf: "stretch",
878
901
  flexShrink: 0,
879
- ...g(e)
902
+ ..._(e)
880
903
  }
881
904
  });
882
905
  }
883
- var Te = {
906
+ var Ne = {
884
907
  position: "absolute",
885
908
  top: "50%",
886
909
  transform: "translateY(-50%)",
@@ -897,7 +920,7 @@ var Te = {
897
920
  alignItems: "center",
898
921
  justifyContent: "center",
899
922
  padding: 0
900
- }, Ee = {
923
+ }, Pe = {
901
924
  bottom: {
902
925
  inset: "auto 0 0 0",
903
926
  padding: "40px 24px 20px",
@@ -916,9 +939,9 @@ var Te = {
916
939
  padding: 24,
917
940
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
918
941
  }
919
- }, De = 48;
920
- function Oe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: l = 320, swipe: u = !0, style: d, nodeRef: f }) {
921
- let [p, m] = a(0), [h, _] = a(!1), [v, y] = a(null), b = e ? Math.min(p, e - 1) : 0;
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 }) {
944
+ let [p, m] = o(0), [h, g] = o(!1), [v, y] = o(null), b = e ? Math.min(p, e - 1) : 0;
922
945
  if (i(() => {
923
946
  if (!n || h || v || e < 2) return;
924
947
  let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
@@ -933,12 +956,12 @@ function Oe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
933
956
  let x = (t) => m((t + e) % e), S = () => {
934
957
  if (!v) return;
935
958
  let { dx: e } = v;
936
- y(null), e < -48 ? x(b + 1) : e > De && x(b - 1);
959
+ y(null), e < -48 ? x(b + 1) : e > Fe && x(b - 1);
937
960
  };
938
- return /* @__PURE__ */ c("div", {
961
+ return /* @__PURE__ */ l("div", {
939
962
  ref: f,
940
- onMouseEnter: () => _(!0),
941
- onMouseLeave: () => _(!1),
963
+ onMouseEnter: () => g(!0),
964
+ onMouseLeave: () => g(!1),
942
965
  onPointerDown: u && e > 1 ? (e) => {
943
966
  e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), y({
944
967
  startX: e.clientX,
@@ -958,16 +981,16 @@ function Oe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
958
981
  touchAction: "pan-y",
959
982
  userSelect: v ? "none" : void 0,
960
983
  cursor: v ? "grabbing" : void 0,
961
- ...g(d)
984
+ ..._(d)
962
985
  },
963
- children: [/* @__PURE__ */ s("div", {
986
+ children: [/* @__PURE__ */ c("div", {
964
987
  style: {
965
988
  display: "flex",
966
- height: l,
989
+ height: a,
967
990
  transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
968
991
  transition: v ? "none" : "transform 450ms ease"
969
992
  },
970
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ s("div", {
993
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ c("div", {
971
994
  style: {
972
995
  position: "relative",
973
996
  width: "100%",
@@ -976,28 +999,28 @@ function Oe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
976
999
  },
977
1000
  children: t(n)
978
1001
  }, n))
979
- }), e > 1 && /* @__PURE__ */ c(o, { children: [
980
- /* @__PURE__ */ s("button", {
1002
+ }), e > 1 && /* @__PURE__ */ l(s, { children: [
1003
+ /* @__PURE__ */ c("button", {
981
1004
  type: "button",
982
1005
  "aria-label": "Previous slide",
983
1006
  style: {
984
- ...Te,
1007
+ ...Ne,
985
1008
  left: 12
986
1009
  },
987
1010
  onClick: () => x(b - 1),
988
1011
  children: "‹"
989
1012
  }),
990
- /* @__PURE__ */ s("button", {
1013
+ /* @__PURE__ */ c("button", {
991
1014
  type: "button",
992
1015
  "aria-label": "Next slide",
993
1016
  style: {
994
- ...Te,
1017
+ ...Ne,
995
1018
  right: 12
996
1019
  },
997
1020
  onClick: () => x(b + 1),
998
1021
  children: "›"
999
1022
  }),
1000
- /* @__PURE__ */ s("div", {
1023
+ /* @__PURE__ */ c("div", {
1001
1024
  style: {
1002
1025
  position: "absolute",
1003
1026
  bottom: 10,
@@ -1007,7 +1030,7 @@ function Oe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1007
1030
  justifyContent: "center",
1008
1031
  gap: 6
1009
1032
  },
1010
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ s("button", {
1033
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ c("button", {
1011
1034
  type: "button",
1012
1035
  "aria-label": `Go to slide ${t + 1}`,
1013
1036
  onClick: () => x(t),
@@ -1025,7 +1048,7 @@ function Oe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1025
1048
  ] })]
1026
1049
  });
1027
1050
  }
1028
- var ke = (e, t) => ({
1051
+ var Le = (e, t) => ({
1029
1052
  position: "absolute",
1030
1053
  inset: 0,
1031
1054
  backgroundImage: e ? `url(${e})` : "none",
@@ -1033,26 +1056,26 @@ var ke = (e, t) => ({
1033
1056
  backgroundSize: "cover",
1034
1057
  backgroundPosition: "center"
1035
1058
  });
1036
- function Ae({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1037
- return e.length ? /* @__PURE__ */ s(Oe, {
1059
+ function Re({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1060
+ return e.length ? /* @__PURE__ */ c(Ie, {
1038
1061
  ...r,
1039
1062
  count: e.length,
1040
1063
  renderSlide: (r) => {
1041
1064
  let i = e[r];
1042
- return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style: ke(i.image) }), (i.title || i.text) && /* @__PURE__ */ c("div", {
1065
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Le(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1043
1066
  style: {
1044
1067
  position: "absolute",
1045
1068
  color: "#fff",
1046
1069
  textAlign: n,
1047
- ...Ee[t] ?? Ee.bottom
1070
+ ...Pe[t] ?? Pe.bottom
1048
1071
  },
1049
- children: [i.title && /* @__PURE__ */ s("div", {
1072
+ children: [i.title && /* @__PURE__ */ c("div", {
1050
1073
  style: {
1051
1074
  fontSize: 22,
1052
1075
  fontWeight: 700
1053
1076
  },
1054
1077
  children: i.title
1055
- }), i.text && /* @__PURE__ */ s("div", {
1078
+ }), i.text && /* @__PURE__ */ c("div", {
1056
1079
  style: {
1057
1080
  fontSize: 14,
1058
1081
  opacity: .9,
@@ -1064,13 +1087,13 @@ function Ae({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1064
1087
  }
1065
1088
  }) : null;
1066
1089
  }
1067
- function je({ slides: e = [], linked: t, ...n }) {
1068
- return e.length ? /* @__PURE__ */ s(Oe, {
1090
+ function ze({ slides: e = [], linked: t, ...n }) {
1091
+ return e.length ? /* @__PURE__ */ c(Ie, {
1069
1092
  ...n,
1070
1093
  count: e.length,
1071
1094
  renderSlide: (n) => {
1072
1095
  let r = e[n];
1073
- return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style: ke(r.image, r.color) }), /* @__PURE__ */ s("div", {
1096
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Le(r.image, r.color) }), /* @__PURE__ */ c("div", {
1074
1097
  style: {
1075
1098
  position: "absolute",
1076
1099
  inset: 0,
@@ -1087,28 +1110,28 @@ var X = {
1087
1110
  textDecoration: "none",
1088
1111
  fontSize: 14,
1089
1112
  opacity: .85
1090
- }, Me = {
1113
+ }, Be = {
1091
1114
  background: "var(--page-bg, #ffffff)",
1092
1115
  color: "var(--page-text, #111827)",
1093
1116
  border: "1px solid rgba(148, 163, 184, 0.25)",
1094
1117
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1095
1118
  zIndex: 60
1096
1119
  };
1097
- function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u = "auto", breakpoint: d = 768 }) {
1098
- let [f, p] = a(null), [m, h] = a(!1), [_, v] = a(!1), [y, b] = a(null);
1120
+ function Ve({ 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);
1099
1122
  i(() => {
1100
1123
  if (!f) return;
1101
1124
  let e = new ResizeObserver(() => h(f.offsetWidth < d));
1102
1125
  return e.observe(f), () => e.disconnect();
1103
1126
  }, [f, d]);
1104
- let x = u === "hamburger" || u === "auto" && m, S = (e, t) => /* @__PURE__ */ c("a", {
1127
+ let x = u === "hamburger" || u === "auto" && m, S = (e, t) => /* @__PURE__ */ l("a", {
1105
1128
  href: e.href || "#",
1106
1129
  style: {
1107
1130
  ...X,
1108
1131
  display: "block",
1109
1132
  ...t
1110
1133
  },
1111
- children: [e.label, e.desc && /* @__PURE__ */ s("span", {
1134
+ children: [e.label, e.desc && /* @__PURE__ */ c("span", {
1112
1135
  style: {
1113
1136
  display: "block",
1114
1137
  fontSize: 12,
@@ -1118,9 +1141,9 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1118
1141
  children: e.desc
1119
1142
  })]
1120
1143
  }, e.key);
1121
- return /* @__PURE__ */ c("nav", {
1144
+ return /* @__PURE__ */ l("nav", {
1122
1145
  ref: (e) => {
1123
- p(e), l && l(e);
1146
+ p(e), s && s(e);
1124
1147
  },
1125
1148
  style: {
1126
1149
  display: "flex",
@@ -1130,10 +1153,10 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1130
1153
  padding: "14px 24px",
1131
1154
  width: "100%",
1132
1155
  position: "relative",
1133
- ...g(o)
1156
+ ..._(a)
1134
1157
  },
1135
1158
  children: [
1136
- n && /* @__PURE__ */ s("img", {
1159
+ n && /* @__PURE__ */ c("img", {
1137
1160
  src: n,
1138
1161
  alt: e || "Logo",
1139
1162
  style: {
@@ -1141,7 +1164,7 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1141
1164
  display: "block"
1142
1165
  }
1143
1166
  }),
1144
- e && /* @__PURE__ */ s("div", {
1167
+ e && /* @__PURE__ */ c("div", {
1145
1168
  style: {
1146
1169
  fontWeight: 700,
1147
1170
  fontSize: 18,
@@ -1149,11 +1172,11 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1149
1172
  },
1150
1173
  children: e
1151
1174
  }),
1152
- /* @__PURE__ */ s("div", { style: { flexGrow: 1 } }),
1153
- x ? /* @__PURE__ */ s("button", {
1175
+ /* @__PURE__ */ c("div", { style: { flexGrow: 1 } }),
1176
+ x ? /* @__PURE__ */ c("button", {
1154
1177
  type: "button",
1155
- "aria-label": _ ? "Close menu" : "Open menu",
1156
- onClick: () => v(!_),
1178
+ "aria-label": g ? "Close menu" : "Open menu",
1179
+ onClick: () => v(!g),
1157
1180
  style: {
1158
1181
  background: "transparent",
1159
1182
  border: 0,
@@ -1163,8 +1186,8 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1163
1186
  lineHeight: 1,
1164
1187
  padding: 4
1165
1188
  },
1166
- children: _ ? "✕" : "☰"
1167
- }) : /* @__PURE__ */ s("div", {
1189
+ children: g ? "✕" : "☰"
1190
+ }) : /* @__PURE__ */ c("div", {
1168
1191
  style: {
1169
1192
  display: "flex",
1170
1193
  gap: 20,
@@ -1173,20 +1196,20 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1173
1196
  },
1174
1197
  children: r.map((e) => {
1175
1198
  let t = e.children ?? [];
1176
- if (!t.length) return /* @__PURE__ */ s("a", {
1199
+ if (!t.length) return /* @__PURE__ */ c("a", {
1177
1200
  href: e.href || "#",
1178
1201
  style: X,
1179
1202
  children: e.label
1180
1203
  }, e.key);
1181
1204
  let n = e.type === "mega";
1182
- return /* @__PURE__ */ c("span", {
1205
+ return /* @__PURE__ */ l("span", {
1183
1206
  style: {
1184
1207
  position: n ? "static" : "relative",
1185
1208
  display: "inline-flex"
1186
1209
  },
1187
1210
  onMouseEnter: () => b(e.key),
1188
1211
  onMouseLeave: () => b(null),
1189
- children: [/* @__PURE__ */ c("a", {
1212
+ children: [/* @__PURE__ */ l("a", {
1190
1213
  href: e.href || "#",
1191
1214
  style: {
1192
1215
  ...X,
@@ -1195,7 +1218,7 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1195
1218
  children: [
1196
1219
  e.label,
1197
1220
  " ",
1198
- /* @__PURE__ */ s("span", {
1221
+ /* @__PURE__ */ c("span", {
1199
1222
  style: {
1200
1223
  fontSize: 9,
1201
1224
  opacity: .6
@@ -1203,9 +1226,9 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1203
1226
  children: "▼"
1204
1227
  })
1205
1228
  ]
1206
- }), y === e.key && (n ? /* @__PURE__ */ s("div", {
1229
+ }), y === e.key && (n ? /* @__PURE__ */ c("div", {
1207
1230
  style: {
1208
- ...Me,
1231
+ ...Be,
1209
1232
  position: "absolute",
1210
1233
  left: 0,
1211
1234
  right: 0,
@@ -1219,9 +1242,9 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1219
1242
  padding: "6px 8px",
1220
1243
  borderRadius: 6
1221
1244
  }))
1222
- }) : /* @__PURE__ */ s("div", {
1245
+ }) : /* @__PURE__ */ c("div", {
1223
1246
  style: {
1224
- ...Me,
1247
+ ...Be,
1225
1248
  position: "absolute",
1226
1249
  top: "100%",
1227
1250
  left: 0,
@@ -1239,7 +1262,7 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1239
1262
  }, e.key);
1240
1263
  })
1241
1264
  }),
1242
- x && _ && /* @__PURE__ */ s("div", {
1265
+ x && g && /* @__PURE__ */ c("div", {
1243
1266
  style: {
1244
1267
  flexBasis: "100%",
1245
1268
  width: "100%",
@@ -1247,7 +1270,7 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1247
1270
  flexDirection: "column",
1248
1271
  paddingTop: 10
1249
1272
  },
1250
- children: r.map((e) => /* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s("a", {
1273
+ children: r.map((e) => /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c("a", {
1251
1274
  href: e.href || "#",
1252
1275
  style: {
1253
1276
  ...X,
@@ -1261,23 +1284,23 @@ function Ne({ brand: e, logo: n, links: r = [], style: o, nodeRef: l, menu: u =
1261
1284
  ]
1262
1285
  });
1263
1286
  }
1264
- function Pe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1265
- let [i, o] = a(0), l = e.length ? Math.min(i, e.length - 1) : 0;
1266
- return e.length ? /* @__PURE__ */ c("div", {
1287
+ function He({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1288
+ let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1289
+ return e.length ? /* @__PURE__ */ l("div", {
1267
1290
  ref: r,
1268
1291
  style: {
1269
1292
  width: "100%",
1270
- ...g(n)
1293
+ ..._(n)
1271
1294
  },
1272
- children: [/* @__PURE__ */ s("div", {
1295
+ children: [/* @__PURE__ */ c("div", {
1273
1296
  style: {
1274
1297
  display: "flex",
1275
1298
  gap: 4,
1276
1299
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1277
1300
  },
1278
- children: e.map((e, t) => /* @__PURE__ */ s("button", {
1301
+ children: e.map((e, t) => /* @__PURE__ */ c("button", {
1279
1302
  type: "button",
1280
- onClick: () => o(t),
1303
+ onClick: () => a(t),
1281
1304
  style: {
1282
1305
  background: "transparent",
1283
1306
  border: 0,
@@ -1286,39 +1309,39 @@ function Pe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1286
1309
  fontFamily: "inherit",
1287
1310
  color: "inherit",
1288
1311
  cursor: "pointer",
1289
- opacity: t === l ? 1 : .6,
1290
- fontWeight: t === l ? 600 : 500,
1291
- boxShadow: t === l ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1312
+ opacity: t === s ? 1 : .6,
1313
+ fontWeight: t === s ? 600 : 500,
1314
+ boxShadow: t === s ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1292
1315
  },
1293
1316
  children: e.label || `Tab ${t + 1}`
1294
1317
  }, e.key))
1295
- }), e.map((e, n) => /* @__PURE__ */ s("div", {
1318
+ }), e.map((e, n) => /* @__PURE__ */ c("div", {
1296
1319
  style: {
1297
- display: n === l ? "flex" : "none",
1320
+ display: n === s ? "flex" : "none",
1298
1321
  flexDirection: "column"
1299
1322
  },
1300
1323
  children: t?.[e.key] ?? null
1301
1324
  }, e.key))]
1302
1325
  }) : null;
1303
1326
  }
1304
- function Fe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1305
- let [o, l] = a(() => new Set(e.length ? [e[0].key] : []));
1327
+ function Ue({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1328
+ let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
1306
1329
  if (!e.length) return null;
1307
- let u = (e) => l((t) => {
1330
+ let u = (e) => s((t) => {
1308
1331
  let r = new Set(n ? t : []);
1309
1332
  return t.has(e) ? r.delete(e) : r.add(e), r;
1310
1333
  });
1311
- return /* @__PURE__ */ s("div", {
1334
+ return /* @__PURE__ */ c("div", {
1312
1335
  ref: i,
1313
1336
  style: {
1314
1337
  width: "100%",
1315
- ...g(r)
1338
+ ..._(r)
1316
1339
  },
1317
1340
  children: e.map((n, r) => {
1318
- let i = o.has(n.key);
1319
- return /* @__PURE__ */ c("div", {
1341
+ let i = a.has(n.key);
1342
+ return /* @__PURE__ */ l("div", {
1320
1343
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1321
- children: [/* @__PURE__ */ c("button", {
1344
+ children: [/* @__PURE__ */ l("button", {
1322
1345
  type: "button",
1323
1346
  onClick: () => u(n.key),
1324
1347
  style: {
@@ -1337,7 +1360,7 @@ function Fe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1337
1360
  textAlign: "left",
1338
1361
  cursor: "pointer"
1339
1362
  },
1340
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ s("span", {
1363
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ c("span", {
1341
1364
  "aria-hidden": !0,
1342
1365
  style: {
1343
1366
  fontSize: 12,
@@ -1347,7 +1370,7 @@ function Fe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1347
1370
  },
1348
1371
  children: "▼"
1349
1372
  })]
1350
- }), /* @__PURE__ */ s("div", {
1373
+ }), /* @__PURE__ */ c("div", {
1351
1374
  style: {
1352
1375
  display: i ? "flex" : "none",
1353
1376
  flexDirection: "column"
@@ -1358,11 +1381,11 @@ function Fe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1358
1381
  })
1359
1382
  });
1360
1383
  }
1361
- var Ie = {
1384
+ var We = {
1362
1385
  display: "flex",
1363
1386
  flexDirection: "column",
1364
1387
  gap: "12px"
1365
- }, Le = {
1388
+ }, Ge = {
1366
1389
  fontSize: "14px",
1367
1390
  fontWeight: 500,
1368
1391
  color: "var(--page-text, #111827)"
@@ -1376,35 +1399,35 @@ var Ie = {
1376
1399
  boxSizing: "border-box",
1377
1400
  backgroundColor: "#ffffff",
1378
1401
  color: "#111827"
1379
- }, Re = {
1402
+ }, Ke = {
1380
1403
  display: "flex",
1381
1404
  alignItems: "center",
1382
1405
  gap: "8px",
1383
1406
  fontSize: "14px",
1384
1407
  color: "var(--page-text, #111827)"
1385
- }, ze = (e) => e ? {
1408
+ }, qe = (e) => e ? {
1386
1409
  readOnly: !0,
1387
1410
  tabIndex: -1,
1388
1411
  onMouseDown: (e) => e.preventDefault()
1389
1412
  } : {};
1390
- function Be({ style: e, action: t, method: n, name: i, enctype: o, formSlug: l, nodeRef: u, inert: d, children: f, linked: p, show: m }) {
1391
- let { tenant: h, apiUrl: _ } = r(R), [v, y] = a("form"), b = d ? m || "form" : v;
1392
- return /* @__PURE__ */ c("div", {
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;
1415
+ return /* @__PURE__ */ l("div", {
1393
1416
  ref: u,
1394
- style: g(e),
1417
+ style: _(e),
1395
1418
  children: [
1396
- /* @__PURE__ */ s("form", {
1419
+ /* @__PURE__ */ c("form", {
1397
1420
  action: t || void 0,
1398
1421
  method: n || "post",
1399
1422
  name: i || void 0,
1400
- encType: o || void 0,
1423
+ encType: a || void 0,
1401
1424
  onSubmit: async (e) => {
1402
1425
  if (e.preventDefault(), !d) {
1403
- if (l) {
1426
+ if (s) {
1404
1427
  let t = {};
1405
1428
  for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1406
1429
  try {
1407
- let e = await fetch(`${_ || "/api"}/forms/${l}/submit`, {
1430
+ let e = await fetch(`${g || "/api"}/forms/${s}/submit`, {
1408
1431
  method: "post",
1409
1432
  headers: {
1410
1433
  "content-type": "application/json",
@@ -1434,16 +1457,16 @@ function Be({ style: e, action: t, method: n, name: i, enctype: o, formSlug: l,
1434
1457
  }
1435
1458
  },
1436
1459
  style: {
1437
- ...Ie,
1460
+ ...We,
1438
1461
  display: b === "success" ? "none" : "flex"
1439
1462
  },
1440
1463
  children: f
1441
1464
  }),
1442
- /* @__PURE__ */ s("div", {
1465
+ /* @__PURE__ */ c("div", {
1443
1466
  style: { display: b === "success" ? "block" : "none" },
1444
1467
  children: p?.success ?? null
1445
1468
  }),
1446
- /* @__PURE__ */ s("div", {
1469
+ /* @__PURE__ */ c("div", {
1447
1470
  style: {
1448
1471
  display: b === "error" ? "block" : "none",
1449
1472
  marginTop: 12
@@ -1453,18 +1476,18 @@ function Be({ style: e, action: t, method: n, name: i, enctype: o, formSlug: l,
1453
1476
  ]
1454
1477
  });
1455
1478
  }
1456
- function Ve({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1457
- return /* @__PURE__ */ s("label", {
1479
+ function Ye({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1480
+ return /* @__PURE__ */ c("label", {
1458
1481
  ref: r,
1459
1482
  style: {
1460
- ...Le,
1461
- ...g(n)
1483
+ ...Ge,
1484
+ ..._(n)
1462
1485
  },
1463
- children: q(t, e, i)
1486
+ children: Y(t, e, i)
1464
1487
  });
1465
1488
  }
1466
- function He({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1467
- return /* @__PURE__ */ s("input", {
1489
+ function Xe({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1490
+ return /* @__PURE__ */ c("input", {
1468
1491
  ref: a,
1469
1492
  type: e,
1470
1493
  name: t || void 0,
@@ -1472,13 +1495,13 @@ function He({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1472
1495
  required: !o && !!r,
1473
1496
  style: {
1474
1497
  ...Z,
1475
- ...g(i)
1498
+ ..._(i)
1476
1499
  },
1477
- ...ze(o)
1500
+ ...qe(o)
1478
1501
  });
1479
1502
  }
1480
- function Ue({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1481
- return /* @__PURE__ */ s("textarea", {
1503
+ function Ze({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1504
+ return /* @__PURE__ */ c("textarea", {
1482
1505
  ref: a,
1483
1506
  name: e || void 0,
1484
1507
  placeholder: t,
@@ -1487,25 +1510,25 @@ function Ue({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1487
1510
  style: {
1488
1511
  ...Z,
1489
1512
  resize: "vertical",
1490
- ...g(i)
1513
+ ..._(i)
1491
1514
  },
1492
- ...ze(o)
1515
+ ...qe(o)
1493
1516
  });
1494
1517
  }
1495
- function We({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: l }) {
1496
- return /* @__PURE__ */ c("label", {
1518
+ function Qe({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1519
+ return /* @__PURE__ */ l("label", {
1497
1520
  ref: o,
1498
1521
  style: {
1499
- ...Re,
1500
- ...g(a)
1522
+ ...Ke,
1523
+ ..._(a)
1501
1524
  },
1502
- children: [/* @__PURE__ */ s("input", {
1525
+ children: [/* @__PURE__ */ c("input", {
1503
1526
  type: e,
1504
1527
  name: n || void 0,
1505
1528
  value: r || void 0,
1506
- required: !l && !!i,
1507
- onClick: l ? (e) => e.preventDefault() : void 0,
1508
- tabIndex: l ? -1 : void 0,
1529
+ required: !s && !!i,
1530
+ onClick: s ? (e) => e.preventDefault() : void 0,
1531
+ tabIndex: s ? -1 : void 0,
1509
1532
  style: {
1510
1533
  margin: 0,
1511
1534
  accentColor: "var(--page-accent, #111827)"
@@ -1513,8 +1536,8 @@ function We({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1513
1536
  }), t]
1514
1537
  });
1515
1538
  }
1516
- function Ge({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1517
- return /* @__PURE__ */ c("select", {
1539
+ function $e({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1540
+ return /* @__PURE__ */ l("select", {
1518
1541
  ref: a,
1519
1542
  name: e || void 0,
1520
1543
  required: !o && !!r,
@@ -1524,43 +1547,43 @@ function Ge({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1524
1547
  style: {
1525
1548
  ...Z,
1526
1549
  appearance: "auto",
1527
- ...g(i)
1550
+ ..._(i)
1528
1551
  },
1529
- children: [t !== "" && /* @__PURE__ */ s("option", {
1552
+ children: [t !== "" && /* @__PURE__ */ c("option", {
1530
1553
  value: "",
1531
1554
  disabled: !0,
1532
1555
  children: t ?? "Select…"
1533
- }), n.map((e, t) => /* @__PURE__ */ s("option", {
1556
+ }), n.map((e, t) => /* @__PURE__ */ c("option", {
1534
1557
  value: e,
1535
1558
  children: e
1536
1559
  }, t))]
1537
1560
  });
1538
1561
  }
1539
- function Ke({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: o, inert: l }) {
1540
- let [u, d] = a(null);
1541
- return /* @__PURE__ */ c("label", {
1542
- ref: o,
1562
+ function et({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1563
+ let [u, d] = o(null);
1564
+ return /* @__PURE__ */ l("label", {
1565
+ ref: a,
1543
1566
  style: {
1544
1567
  ...Z,
1545
1568
  display: "flex",
1546
1569
  alignItems: "center",
1547
1570
  gap: "8px",
1548
- cursor: l ? "default" : "pointer",
1571
+ cursor: s ? "default" : "pointer",
1549
1572
  borderStyle: "dashed",
1550
1573
  color: u ? "#111827" : "#6b7280",
1551
- ...g(i)
1574
+ ..._(i)
1552
1575
  },
1553
1576
  children: [
1554
- /* @__PURE__ */ s("input", {
1577
+ /* @__PURE__ */ c("input", {
1555
1578
  type: "file",
1556
1579
  name: e || void 0,
1557
1580
  accept: t || void 0,
1558
- required: !l && !!n,
1559
- disabled: !!l,
1581
+ required: !s && !!n,
1582
+ disabled: !!s,
1560
1583
  onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1561
1584
  style: { display: "none" }
1562
1585
  }),
1563
- /* @__PURE__ */ s("span", {
1586
+ /* @__PURE__ */ c("span", {
1564
1587
  "aria-hidden": !0,
1565
1588
  children: "📎"
1566
1589
  }),
@@ -1568,184 +1591,526 @@ function Ke({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
1568
1591
  ]
1569
1592
  });
1570
1593
  }
1571
- function qe({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1572
- return /* @__PURE__ */ s("button", {
1594
+ function tt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1595
+ return /* @__PURE__ */ c("button", {
1573
1596
  ref: n,
1574
1597
  type: r ? "button" : "submit",
1575
1598
  style: {
1576
- ...V,
1599
+ ...ae,
1577
1600
  border: 0,
1578
1601
  cursor: "pointer",
1579
1602
  alignSelf: "flex-start",
1580
- ...g(t)
1603
+ padding: "10px 22px",
1604
+ borderRadius: 8,
1605
+ fontSize: 15,
1606
+ fontWeight: 600,
1607
+ lineHeight: 1.4,
1608
+ fontFamily: "inherit",
1609
+ ..._(t)
1581
1610
  },
1582
1611
  children: e
1583
1612
  });
1584
1613
  }
1585
- function Je({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1614
+ function nt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1586
1615
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1587
- return /* @__PURE__ */ s("div", {
1616
+ return /* @__PURE__ */ c("div", {
1588
1617
  ref: r,
1589
1618
  style: {
1590
1619
  display: "grid",
1591
1620
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1592
1621
  gap: 16,
1593
1622
  width: "100%",
1594
- ...g(n)
1623
+ ..._(n)
1595
1624
  },
1596
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ s("div", {
1625
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ c("div", {
1597
1626
  style: { minWidth: 0 },
1598
1627
  children: i?.[`cell-${t}`] ?? null
1599
1628
  }, t))
1600
1629
  });
1601
1630
  }
1602
- var Ye = {
1603
- PageRoot: re,
1604
- Section: ie,
1605
- Container: ae,
1606
- Heading: oe,
1607
- TextBlock: pe,
1608
- ButtonBlock: ge,
1609
- ImageBlock: _e,
1610
- Spacer: Ce,
1611
- Divider: we,
1612
- SliderBlock: Ae,
1613
- CanvasSlider: je,
1614
- TabsBlock: Pe,
1615
- QuickStack: Je,
1616
- AccordionBlock: Fe,
1617
- NavbarBlock: Ne,
1618
- ListBlock: fe,
1619
- TextSpan: se,
1620
- QuoteBlock: de,
1621
- TextLink: he,
1622
- RichTextBlock: le,
1623
- RichContentBlock: le,
1624
- VideoBlock: ve,
1625
- YouTubeBlock: be,
1626
- IframeBlock: xe,
1627
- EmbedBlock: Se,
1628
- FormBlock: Be,
1629
- FormLabel: Ve,
1630
- FormInput: He,
1631
- FormTextarea: Ue,
1632
- FormCheckbox: (e) => /* @__PURE__ */ s(We, {
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);
1633
+ if (i(() => {
1634
+ if (!e || b) return;
1635
+ let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
1636
+ 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([])), () => {
1637
+ t = !1;
1638
+ };
1639
+ }, [
1640
+ e,
1641
+ g,
1642
+ v,
1643
+ b
1644
+ ]), !e) return null;
1645
+ 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" ? {
1646
+ display: "flex",
1647
+ flexDirection: "column",
1648
+ gap: 20
1649
+ } : {
1650
+ display: "grid",
1651
+ gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
1652
+ gap: 24
1653
+ };
1654
+ return f && p && y?.render ? /* @__PURE__ */ c("div", {
1655
+ ref: h,
1656
+ style: {
1657
+ width: "100%",
1658
+ ...T,
1659
+ ..._(m)
1660
+ },
1661
+ children: C.map((e) => /* @__PURE__ */ c("div", {
1662
+ style: { minWidth: 0 },
1663
+ children: y.render(p, (t) => re(t, e))
1664
+ }, e.id ?? e?.data?.slug))
1665
+ }) : /* @__PURE__ */ c("div", {
1666
+ ref: h,
1667
+ style: {
1668
+ width: "100%",
1669
+ ...T,
1670
+ ..._(m)
1671
+ },
1672
+ children: C.map((e) => {
1673
+ 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";
1674
+ return /* @__PURE__ */ l("div", {
1675
+ style: {
1676
+ display: "flex",
1677
+ flexDirection: f ? "row" : "column",
1678
+ gap: f ? 20 : 12,
1679
+ alignItems: f ? "center" : "stretch",
1680
+ minWidth: 0
1681
+ },
1682
+ children: [t && /* @__PURE__ */ c("img", {
1683
+ src: t,
1684
+ alt: r ?? "",
1685
+ style: {
1686
+ width: f ? 160 : "100%",
1687
+ aspectRatio: "3 / 2",
1688
+ objectFit: "cover",
1689
+ borderRadius: 10,
1690
+ flexShrink: 0,
1691
+ display: "block"
1692
+ }
1693
+ }), /* @__PURE__ */ l("div", {
1694
+ style: { minWidth: 0 },
1695
+ children: [
1696
+ r && /* @__PURE__ */ c("h3", {
1697
+ style: {
1698
+ margin: 0,
1699
+ fontSize: 18,
1700
+ fontWeight: 700
1701
+ },
1702
+ children: r
1703
+ }),
1704
+ o && /* @__PURE__ */ c("p", {
1705
+ style: {
1706
+ margin: "6px 0 0",
1707
+ fontSize: 14,
1708
+ lineHeight: 1.55,
1709
+ opacity: .75
1710
+ },
1711
+ children: o
1712
+ }),
1713
+ a && /* @__PURE__ */ c("div", {
1714
+ style: {
1715
+ marginTop: 6,
1716
+ fontSize: 14,
1717
+ lineHeight: 1.55,
1718
+ opacity: .85
1719
+ },
1720
+ children: ge(a)
1721
+ })
1722
+ ]
1723
+ })]
1724
+ }, e.id ?? e?.data?.slug);
1725
+ })
1726
+ });
1727
+ }
1728
+ function it({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
1729
+ return e.length ? /* @__PURE__ */ c("nav", {
1730
+ ref: r,
1731
+ "aria-label": "Breadcrumb",
1732
+ style: { ..._(n) },
1733
+ children: /* @__PURE__ */ c("ol", {
1734
+ style: {
1735
+ display: "flex",
1736
+ flexWrap: "wrap",
1737
+ alignItems: "center",
1738
+ gap: 8,
1739
+ listStyle: "none",
1740
+ margin: 0,
1741
+ padding: 0,
1742
+ fontSize: 14
1743
+ },
1744
+ children: e.map((n, r) => {
1745
+ let i = r === e.length - 1;
1746
+ return /* @__PURE__ */ l("li", {
1747
+ style: {
1748
+ display: "flex",
1749
+ alignItems: "center",
1750
+ gap: 8,
1751
+ minWidth: 0
1752
+ },
1753
+ children: [r > 0 && /* @__PURE__ */ c("span", {
1754
+ style: { opacity: .4 },
1755
+ "aria-hidden": !0,
1756
+ children: t
1757
+ }), i || !n.href ? /* @__PURE__ */ c("span", {
1758
+ style: {
1759
+ fontWeight: i ? 600 : 400,
1760
+ opacity: i ? 1 : .7
1761
+ },
1762
+ "aria-current": i ? "page" : void 0,
1763
+ children: n.label
1764
+ }) : /* @__PURE__ */ c("a", {
1765
+ href: n.href,
1766
+ style: {
1767
+ color: "inherit",
1768
+ opacity: .7,
1769
+ textDecoration: "none"
1770
+ },
1771
+ children: n.label
1772
+ })]
1773
+ }, r);
1774
+ })
1775
+ })
1776
+ }) : null;
1777
+ }
1778
+ function at({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
1779
+ 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
+ display: "inline-flex",
1781
+ alignItems: "center",
1782
+ justifyContent: "center",
1783
+ minWidth: 36,
1784
+ height: 36,
1785
+ padding: "0 8px",
1786
+ borderRadius: 8,
1787
+ fontSize: 14,
1788
+ textDecoration: "none",
1789
+ color: e ? "var(--page-accent-text, #ffffff)" : "inherit",
1790
+ background: e ? "var(--page-accent, #111827)" : "transparent",
1791
+ border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
1792
+ });
1793
+ return /* @__PURE__ */ l("nav", {
1794
+ ref: a,
1795
+ "aria-label": "Pagination",
1796
+ style: {
1797
+ display: "flex",
1798
+ flexWrap: "wrap",
1799
+ gap: 8,
1800
+ alignItems: "center",
1801
+ ..._(i)
1802
+ },
1803
+ children: [
1804
+ n && /* @__PURE__ */ c("a", {
1805
+ href: s > 1 ? u(s - 1) : "#",
1806
+ "aria-label": "Previous",
1807
+ style: {
1808
+ ...d(!1),
1809
+ opacity: s > 1 ? 1 : .4
1810
+ },
1811
+ children: "‹"
1812
+ }),
1813
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ c("a", {
1814
+ href: u(e),
1815
+ "aria-current": e === s ? "page" : void 0,
1816
+ style: d(e === s),
1817
+ children: e
1818
+ }, e)),
1819
+ n && /* @__PURE__ */ c("a", {
1820
+ href: s < o ? u(s + 1) : "#",
1821
+ "aria-label": "Next",
1822
+ style: {
1823
+ ...d(!1),
1824
+ opacity: s < o ? 1 : .4
1825
+ },
1826
+ children: "›"
1827
+ })
1828
+ ]
1829
+ });
1830
+ }
1831
+ function ot({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
1832
+ if (!e.length) return null;
1833
+ let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
1834
+ width: 32,
1835
+ height: 32,
1836
+ borderRadius: "50%",
1837
+ display: "flex",
1838
+ alignItems: "center",
1839
+ justifyContent: "center",
1840
+ fontSize: 14,
1841
+ fontWeight: 600,
1842
+ flexShrink: 0,
1843
+ color: e === "todo" ? "inherit" : "var(--page-accent-text, #ffffff)",
1844
+ background: e === "todo" ? "transparent" : "var(--page-accent, #111827)",
1845
+ border: e === "todo" ? "1px solid rgba(148, 163, 184, 0.5)" : "1px solid transparent",
1846
+ opacity: e === "todo" ? .6 : 1,
1847
+ boxShadow: e === "active" ? "0 0 0 4px rgba(99, 102, 241, 0.2)" : "none"
1848
+ }), u = (e) => ({
1849
+ flexGrow: 1,
1850
+ alignSelf: "center",
1851
+ background: e ? "var(--page-accent, #111827)" : "rgba(148, 163, 184, 0.4)",
1852
+ ...r ? {
1853
+ width: 2,
1854
+ minHeight: 24,
1855
+ marginLeft: 15,
1856
+ alignSelf: "auto"
1857
+ } : {
1858
+ height: 2,
1859
+ minWidth: 24
1860
+ }
1861
+ });
1862
+ return /* @__PURE__ */ c("div", {
1863
+ ref: a,
1864
+ style: {
1865
+ display: "flex",
1866
+ flexDirection: r ? "column" : "row",
1867
+ alignItems: r ? "stretch" : "flex-start",
1868
+ gap: r ? 4 : 8,
1869
+ ..._(i)
1870
+ },
1871
+ children: e.map((e, n) => {
1872
+ let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
1873
+ return /* @__PURE__ */ l(t, { children: [n > 0 && /* @__PURE__ */ c("div", {
1874
+ style: u(i <= o),
1875
+ "aria-hidden": !0
1876
+ }), /* @__PURE__ */ l("div", {
1877
+ style: {
1878
+ display: "flex",
1879
+ flexDirection: r ? "row" : "column",
1880
+ alignItems: "center",
1881
+ gap: 8,
1882
+ minWidth: 0,
1883
+ textAlign: r ? "left" : "center"
1884
+ },
1885
+ children: [/* @__PURE__ */ c("div", {
1886
+ style: s(a),
1887
+ children: a === "done" ? "✓" : i
1888
+ }), /* @__PURE__ */ l("div", {
1889
+ style: { minWidth: 0 },
1890
+ children: [/* @__PURE__ */ c("div", {
1891
+ style: {
1892
+ fontSize: 13,
1893
+ fontWeight: a === "active" ? 700 : 500,
1894
+ opacity: a === "todo" ? .6 : 1
1895
+ },
1896
+ children: e.label
1897
+ }), e.description && /* @__PURE__ */ c("div", {
1898
+ style: {
1899
+ fontSize: 12,
1900
+ opacity: .6
1901
+ },
1902
+ children: e.description
1903
+ })]
1904
+ })]
1905
+ })] }, n);
1906
+ })
1907
+ });
1908
+ }
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 };
1912
+ return /* @__PURE__ */ c("div", {
1913
+ ref: o,
1914
+ style: {
1915
+ width: "100%",
1916
+ overflowX: "auto",
1917
+ ..._(a)
1918
+ },
1919
+ children: /* @__PURE__ */ l("table", {
1920
+ style: {
1921
+ width: "100%",
1922
+ borderCollapse: "collapse",
1923
+ fontSize: 14,
1924
+ ...r ? { border: u } : {}
1925
+ },
1926
+ children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
1927
+ style: {
1928
+ textAlign: "left",
1929
+ fontWeight: 600,
1930
+ padding: s,
1931
+ background: "rgba(148, 163, 184, 0.12)",
1932
+ ...d
1933
+ },
1934
+ 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,
1937
+ children: e.map((e, n) => /* @__PURE__ */ c("td", {
1938
+ style: {
1939
+ padding: s,
1940
+ ...d
1941
+ },
1942
+ children: t?.[n] ?? ""
1943
+ }, n))
1944
+ }, r)) })]
1945
+ })
1946
+ });
1947
+ }
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, {
1633
1984
  kind: "checkbox",
1634
1985
  ...e
1635
1986
  }),
1636
- FormRadio: (e) => /* @__PURE__ */ s(We, {
1987
+ FormRadio: (e) => /* @__PURE__ */ c(Qe, {
1637
1988
  kind: "radio",
1638
1989
  ...e
1639
1990
  }),
1640
- FormSelect: Ge,
1641
- FormFile: Ke,
1642
- FormSubmit: qe
1991
+ FormSelect: $e,
1992
+ FormFile: et,
1993
+ FormSubmit: tt
1643
1994
  };
1644
1995
  //#endregion
1645
1996
  //#region ../ui/src/components/builder/render.jsx
1646
- function Q(e, n, r, i = /* @__PURE__ */ new Set()) {
1647
- let a = n[e];
1648
- if (!a || a.hidden) return null;
1649
- let o = a.type?.resolvedName;
1650
- if (o === "ComponentInstance") {
1651
- let n = a.props?.componentId, o = r?.[n];
1652
- if (!o?.template || i.has(n)) return null;
1653
- let c = new Set(i).add(n);
1654
- return /* @__PURE__ */ s(t, { children: Q(o.template.rootId, o.template.nodes, r, c) }, e);
1997
+ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
1998
+ let o = n[e];
1999
+ if (!o || o.hidden) return null;
2000
+ let s = o.type?.resolvedName, l = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2001
+ if (s === "ComponentInstance") {
2002
+ let n = o.props?.componentId, s = r?.[n];
2003
+ if (!s?.template || i.has(n)) return null;
2004
+ let l = new Set(i).add(n);
2005
+ return /* @__PURE__ */ c(t, { children: Q(s.template.rootId, s.template.nodes, r, l, a) }, e);
1655
2006
  }
1656
- let c = Ye[o];
1657
- if (!c) return null;
1658
- let l = (a.nodes ?? []).map((e) => Q(e, n, r, i)).filter(Boolean), u = Object.entries(a.linkedNodes ?? {}), d = u.length ? Object.fromEntries(u.map(([e, t]) => [e, Q(t, n, r, i)])) : void 0;
1659
- return /* @__PURE__ */ s(c, {
1660
- ...a.props,
1661
- linked: d,
2007
+ let u = ct[s];
2008
+ if (!u) return null;
2009
+ 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
+ return /* @__PURE__ */ c(u, {
2011
+ ...l,
2012
+ ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2013
+ linked: p,
1662
2014
  nodeRef: (t) => {
1663
- t && (t.setAttribute("data-wb", e), b(t, a.props ?? {}));
2015
+ t && (t.setAttribute("data-wb", e), x(t, l));
1664
2016
  },
1665
- children: l.length ? l : void 0
2017
+ children: d.length ? d : void 0
1666
2018
  }, e);
1667
2019
  }
1668
2020
  //#endregion
1669
2021
  //#region ../ui/src/components/builder/PageRenderer.jsx
1670
- var Xe = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
1671
- function Ze({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: o, tenant: l, apiUrl: d }) {
1672
- let p = o?.js?.trim();
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 }) {
2024
+ let h = s?.js?.trim();
1673
2025
  if (i(() => {
1674
- if (!p) return;
2026
+ if (!h) return;
1675
2027
  let e = document.createElement("script");
1676
- return e.text = p, document.body.appendChild(e), () => e.remove();
1677
- }, [p]), !e?.ROOT) return null;
1678
- let m = {
2028
+ return e.text = h, document.body.appendChild(e), () => e.remove();
2029
+ }, [h]), !e?.ROOT) return null;
2030
+ let g = {
1679
2031
  minHeight: "100%",
1680
2032
  display: "flex",
1681
2033
  flexDirection: "column"
1682
- }, h = Q("ROOT", e, n), g = E(e, n), _ = te(e, n), v = o?.css?.trim(), y = f(e, n).map((e) => /* @__PURE__ */ s("link", {
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", {
1683
2035
  rel: "stylesheet",
1684
2036
  precedence: "default",
1685
- href: u(e)
2037
+ href: d(e)
1686
2038
  }, e));
1687
- if (r !== "auto") return /* @__PURE__ */ s(R.Provider, {
2039
+ if (r !== "auto") return /* @__PURE__ */ c(z.Provider, {
1688
2040
  value: {
1689
- tenant: l || "",
1690
- apiUrl: d || "/api"
2041
+ tenant: u || "",
2042
+ apiUrl: f || "/api"
1691
2043
  },
1692
- children: /* @__PURE__ */ c("div", {
1693
- style: {
1694
- ...m,
1695
- ...I(t, r),
1696
- ...a
1697
- },
1698
- children: [
1699
- y,
1700
- g && /* @__PURE__ */ s("style", { children: g }),
1701
- _ && /* @__PURE__ */ s("style", { children: _ }),
1702
- v && /* @__PURE__ */ s("style", { children: v }),
1703
- h
1704
- ]
2044
+ children: /* @__PURE__ */ c(B.Provider, {
2045
+ value: m ?? null,
2046
+ children: /* @__PURE__ */ c(V.Provider, {
2047
+ value: v,
2048
+ children: /* @__PURE__ */ l("div", {
2049
+ style: {
2050
+ ...g,
2051
+ ...L(t, r),
2052
+ ...o
2053
+ },
2054
+ children: [
2055
+ S,
2056
+ y && /* @__PURE__ */ c("style", { children: y }),
2057
+ b && /* @__PURE__ */ c("style", { children: b }),
2058
+ x && /* @__PURE__ */ c("style", { children: x }),
2059
+ _
2060
+ ]
2061
+ })
2062
+ })
1705
2063
  })
1706
2064
  });
1707
- let b = N(t);
1708
- return /* @__PURE__ */ s(R.Provider, {
2065
+ let C = P(t);
2066
+ return /* @__PURE__ */ c(z.Provider, {
1709
2067
  value: {
1710
- tenant: l || "",
1711
- apiUrl: d || "/api"
2068
+ tenant: u || "",
2069
+ apiUrl: f || "/api"
1712
2070
  },
1713
- children: /* @__PURE__ */ c("div", {
1714
- className: "webim-page",
1715
- style: {
1716
- ...m,
1717
- ...F(t),
1718
- ...a
1719
- },
1720
- children: [
1721
- /* @__PURE__ */ s("style", { children: `.webim-page { ${Xe(P(b.light))} }
1722
- @media (prefers-color-scheme: dark) { .webim-page { ${Xe(P(b.dark))} } }` }),
1723
- y,
1724
- g && /* @__PURE__ */ s("style", { children: g }),
1725
- _ && /* @__PURE__ */ s("style", { children: _ }),
1726
- v && /* @__PURE__ */ s("style", { children: v }),
1727
- h
1728
- ]
2071
+ children: /* @__PURE__ */ c(B.Provider, {
2072
+ value: m ?? null,
2073
+ children: /* @__PURE__ */ c(V.Provider, {
2074
+ value: v,
2075
+ children: /* @__PURE__ */ l("div", {
2076
+ className: "webim-page",
2077
+ style: {
2078
+ ...g,
2079
+ ...I(t),
2080
+ ...o
2081
+ },
2082
+ children: [
2083
+ /* @__PURE__ */ c("style", { children: `.webim-page { ${lt(F(C.light))} }
2084
+ @media (prefers-color-scheme: dark) { .webim-page { ${lt(F(C.dark))} } }` }),
2085
+ S,
2086
+ y && /* @__PURE__ */ c("style", { children: y }),
2087
+ b && /* @__PURE__ */ c("style", { children: b }),
2088
+ x && /* @__PURE__ */ c("style", { children: x }),
2089
+ _
2090
+ ]
2091
+ })
2092
+ })
1729
2093
  })
1730
2094
  });
1731
2095
  }
1732
2096
  //#endregion
1733
2097
  //#region src/WebimContent.jsx
1734
- function Qe({ bundle: e, mode: t = "auto", style: n }) {
1735
- return e?.blocks?.ROOT ? /* @__PURE__ */ s(Ze, {
2098
+ function dt({ bundle: e, mode: t = "auto", style: n }) {
2099
+ return e?.blocks?.ROOT ? /* @__PURE__ */ c(ut, {
1736
2100
  blocks: e.blocks,
1737
2101
  theme: e.theme,
1738
2102
  components: e.components,
1739
2103
  custom: e.custom,
1740
2104
  tenant: e.tenant,
1741
2105
  apiUrl: e.apiUrl,
2106
+ datasets: e.datasets,
1742
2107
  mode: t,
1743
2108
  style: n
1744
2109
  }) : null;
1745
2110
  }
1746
2111
  //#endregion
1747
2112
  //#region src/bundle.js
1748
- function $e({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2113
+ function ft({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
1749
2114
  let a = {
1750
2115
  ...t?.global ?? {},
1751
2116
  ...t?.tenant ?? {}
@@ -1755,7 +2120,7 @@ function $e({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
1755
2120
  title: e.title,
1756
2121
  slug: e.slug,
1757
2122
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
1758
- theme: L(o, a.builder_themes?.themes),
2123
+ theme: R(o, a.builder_themes?.themes),
1759
2124
  components: a.builder_components?.components ?? {},
1760
2125
  custom: o.custom,
1761
2126
  seo: o.seo,
@@ -1766,22 +2131,26 @@ function $e({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
1766
2131
  }
1767
2132
  //#endregion
1768
2133
  //#region src/fetchPage.js
1769
- var et = async (e) => {
2134
+ var pt = async (e) => {
1770
2135
  let t = await e.json().catch(() => null);
1771
2136
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
1772
2137
  return t?.payload ?? t;
1773
2138
  };
1774
- async function tt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
2139
+ async function mt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
1775
2140
  if (!e) throw Error("fetchPage: apiUrl is required");
1776
2141
  if (!n) throw Error("fetchPage: slug is required");
1777
- 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(et), o(`${s}/settings/public`, { headers: c }).then(et)]);
1778
- return $e({
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({
1779
2143
  page: l,
1780
2144
  settings: u,
1781
2145
  tenant: t,
1782
2146
  apiUrl: s,
1783
2147
  locale: r
1784
- });
2148
+ }), f = [...new Set(Object.values(d.blocks ?? {}).filter((e) => e?.type?.resolvedName === "CollectionList" && e.props?.collection).map((e) => e.props.collection))];
2149
+ 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, []])));
2151
+ d.datasets = Object.fromEntries(t);
2152
+ }
2153
+ return d;
1785
2154
  }
1786
2155
  //#endregion
1787
2156
  //#region src/ssr.jsx
@@ -1791,14 +2160,14 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
1791
2160
  ">": "&gt;",
1792
2161
  "\"": "&quot;"
1793
2162
  })[e]);
1794
- function nt(t, { mode: n = "auto", style: r } = {}) {
1795
- return e(/* @__PURE__ */ s(Qe, {
2163
+ function ht(t, { mode: n = "auto", style: r } = {}) {
2164
+ return e(/* @__PURE__ */ c(dt, {
1796
2165
  bundle: t,
1797
2166
  mode: n,
1798
2167
  style: r
1799
2168
  }));
1800
2169
  }
1801
- function rt(e, { mode: t = "auto", lang: n = "en" } = {}) {
2170
+ function gt(e, { mode: t = "auto", lang: n = "en" } = {}) {
1802
2171
  let r = e.seo ?? {}, i = r.title || e.title || e.slug || "Page", a = e.custom?.js?.trim(), o = [
1803
2172
  "<meta charset=\"utf-8\"/>",
1804
2173
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
@@ -1815,10 +2184,10 @@ function rt(e, { mode: t = "auto", lang: n = "en" } = {}) {
1815
2184
  ${o}
1816
2185
  </head>
1817
2186
  <body>
1818
- ${nt(e, { mode: t })}
2187
+ ${ht(e, { mode: t })}
1819
2188
  ${a ? `<script>${a.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
1820
2189
  </body>
1821
2190
  </html>`;
1822
2191
  }
1823
2192
  //#endregion
1824
- export { $e as assembleBundle, tt as fetchPage, nt as renderBundleHtml, rt as renderPageDocument };
2193
+ export { ft as assembleBundle, mt as fetchPage, ht as renderBundleHtml, gt as renderPageDocument };