webim-adapter 0.22.0 → 0.24.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.
@@ -13,121 +13,152 @@ var p = /* @__PURE__ */ new Set([
13
13
  "yi",
14
14
  "dv",
15
15
  "ckb"
16
- ]), m = (e) => p.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", h = (e, t) => e === "ltr" || e === "rtl" ? e : t ? m(t) : void 0;
17
- new Map([
16
+ ]), m = (e) => p.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", h = (e, t) => e === "ltr" || e === "rtl" ? e : t ? m(t) : void 0, g = new Map([
18
17
  {
19
18
  family: "Bebas Neue",
20
- fallback: "sans-serif"
19
+ fallback: "sans-serif",
20
+ weights: "400"
21
21
  },
22
22
  {
23
23
  family: "Crimson Text",
24
- fallback: "serif"
24
+ fallback: "serif",
25
+ weights: "400;600;700"
25
26
  },
26
27
  {
27
28
  family: "DM Sans",
28
- fallback: "sans-serif"
29
+ fallback: "sans-serif",
30
+ weights: "100..1000"
29
31
  },
30
32
  {
31
33
  family: "Fira Sans",
32
- fallback: "sans-serif"
34
+ fallback: "sans-serif",
35
+ weights: "100;200;300;400;500;600;700;800;900"
33
36
  },
34
37
  {
35
38
  family: "Inter",
36
- fallback: "sans-serif"
39
+ fallback: "sans-serif",
40
+ weights: "100..900"
37
41
  },
38
42
  {
39
43
  family: "JetBrains Mono",
40
- fallback: "monospace"
44
+ fallback: "monospace",
45
+ weights: "100..800"
41
46
  },
42
47
  {
43
48
  family: "Josefin Sans",
44
- fallback: "sans-serif"
49
+ fallback: "sans-serif",
50
+ weights: "100..700"
45
51
  },
46
52
  {
47
53
  family: "Karla",
48
- fallback: "sans-serif"
54
+ fallback: "sans-serif",
55
+ weights: "200..800"
49
56
  },
50
57
  {
51
58
  family: "Lato",
52
- fallback: "sans-serif"
59
+ fallback: "sans-serif",
60
+ weights: "100;300;400;700;900"
53
61
  },
54
62
  {
55
63
  family: "Lora",
56
- fallback: "serif"
64
+ fallback: "serif",
65
+ weights: "400..700"
57
66
  },
58
67
  {
59
68
  family: "Manrope",
60
- fallback: "sans-serif"
69
+ fallback: "sans-serif",
70
+ weights: "200..800"
61
71
  },
62
72
  {
63
73
  family: "Merriweather",
64
- fallback: "serif"
74
+ fallback: "serif",
75
+ weights: "300..900"
65
76
  },
66
77
  {
67
78
  family: "Montserrat",
68
- fallback: "sans-serif"
79
+ fallback: "sans-serif",
80
+ weights: "100..900"
69
81
  },
70
82
  {
71
83
  family: "Nunito",
72
- fallback: "sans-serif"
84
+ fallback: "sans-serif",
85
+ weights: "200..1000"
73
86
  },
74
87
  {
75
88
  family: "Open Sans",
76
- fallback: "sans-serif"
89
+ fallback: "sans-serif",
90
+ weights: "300..800"
77
91
  },
78
92
  {
79
93
  family: "Oswald",
80
- fallback: "sans-serif"
94
+ fallback: "sans-serif",
95
+ weights: "200..700"
81
96
  },
82
97
  {
83
98
  family: "Outfit",
84
- fallback: "sans-serif"
99
+ fallback: "sans-serif",
100
+ weights: "100..900"
85
101
  },
86
102
  {
87
103
  family: "Playfair Display",
88
- fallback: "serif"
104
+ fallback: "serif",
105
+ weights: "400..900"
89
106
  },
90
107
  {
91
108
  family: "Poppins",
92
- fallback: "sans-serif"
109
+ fallback: "sans-serif",
110
+ weights: "100;200;300;400;500;600;700;800;900"
93
111
  },
94
112
  {
95
113
  family: "Quicksand",
96
- fallback: "sans-serif"
114
+ fallback: "sans-serif",
115
+ weights: "300..700"
97
116
  },
98
117
  {
99
118
  family: "Raleway",
100
- fallback: "sans-serif"
119
+ fallback: "sans-serif",
120
+ weights: "100..900"
101
121
  },
102
122
  {
103
123
  family: "Roboto",
104
- fallback: "sans-serif"
124
+ fallback: "sans-serif",
125
+ weights: "100..900"
105
126
  },
106
127
  {
107
128
  family: "Rubik",
108
- fallback: "sans-serif"
129
+ fallback: "sans-serif",
130
+ weights: "300..900"
109
131
  },
110
132
  {
111
133
  family: "Source Sans 3",
112
- fallback: "sans-serif"
134
+ fallback: "sans-serif",
135
+ weights: "200..900"
113
136
  },
114
137
  {
115
138
  family: "Space Grotesk",
116
- fallback: "sans-serif"
139
+ fallback: "sans-serif",
140
+ weights: "300..700"
117
141
  },
118
142
  {
119
143
  family: "Work Sans",
120
- fallback: "sans-serif"
144
+ fallback: "sans-serif",
145
+ weights: "100..900"
121
146
  }
122
- ].map((e) => [e.family, e]));
123
- function g(e) {
124
- return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
147
+ ].map((e) => [e.family, e])), _ = (e) => `"${e.family}", ${e.fallback}`, v = (e) => {
148
+ let t = g.get(e)?.weights;
149
+ return `family=${e.replace(/ /g, "+")}${t ? `:wght@${t}` : ""}`;
150
+ };
151
+ function y(e) {
152
+ return e.length ? `https://fonts.googleapis.com/css2?${e.map(v).join("&")}&display=swap` : null;
125
153
  }
126
- var _ = (e) => g([e]), v = (e) => {
154
+ var b = (e) => y([e]), x = (e) => {
127
155
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
128
156
  return t ? t[1] : null;
157
+ }, S = (e) => {
158
+ let t = g.get(e);
159
+ return t ? _(t) : null;
129
160
  };
130
- function y(e, t) {
161
+ function C(e, t) {
131
162
  let n = /* @__PURE__ */ new Set(), r = (e) => {
132
163
  for (let t of Object.values(e || {})) for (let e of [
133
164
  "style",
@@ -135,7 +166,7 @@ function y(e, t) {
135
166
  "pressed",
136
167
  "focused"
137
168
  ]) {
138
- let r = v(t.props?.[e]?.fontFamily);
169
+ let r = x(t.props?.[e]?.fontFamily);
139
170
  r && n.add(r);
140
171
  }
141
172
  };
@@ -145,38 +176,38 @@ function y(e, t) {
145
176
  }
146
177
  //#endregion
147
178
  //#region ../ui/src/components/builder/styles.js
148
- var b = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), x = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, S = [
179
+ var w = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), T = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, E = [
149
180
  "borderWidth",
150
181
  "borderStyle",
151
182
  "borderColor",
152
183
  "borderRadius",
153
184
  "gap"
154
185
  ];
155
- function C(e) {
186
+ function D(e) {
156
187
  let t = {};
157
- for (let n of S) {
188
+ for (let n of E) {
158
189
  let r = e?.[n];
159
- r != null && r !== "" && (t[n] = b.has(n) ? x(r) : r);
190
+ r != null && r !== "" && (t[n] = w.has(n) ? T(r) : r);
160
191
  }
161
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || S.includes(n) || (t[n] = b.has(n) ? x(r) : r);
192
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || E.includes(n) || (t[n] = w.has(n) ? T(r) : r);
162
193
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
163
194
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
164
195
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
165
196
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
166
- let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
197
+ let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${T(e.x ?? 0)} ${T(e.y ?? 0)} ${T(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
167
198
  [
168
199
  s,
169
200
  c,
170
201
  l,
171
202
  u
172
- ].some((e) => e !== void 0) && d.push(`${x(s ?? 0)} ${x(c ?? 0)} ${x(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
173
- let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${x(e.x ?? 0)}, ${x(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: _, rotate: v, skewX: y, skewY: C } = t;
203
+ ].some((e) => e !== void 0) && d.push(`${T(s ?? 0)} ${T(c ?? 0)} ${T(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
204
+ let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${T(e.x ?? 0)}, ${T(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: _, rotate: v, skewX: y, skewY: b } = t;
174
205
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
175
- let w = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
176
- (h !== void 0 || g !== void 0) && w.push(`translate(${x(h ?? 0)}, ${x(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), v !== void 0 && w.push(`rotate(${f(v)})`), (y !== void 0 || C !== void 0) && w.push(`skew(${f(y ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
177
- let T = (e) => `${e.inset ? "inset " : ""}${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${x(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
206
+ let x = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
207
+ (h !== void 0 || g !== void 0) && x.push(`translate(${T(h ?? 0)}, ${T(g ?? 0)})`), _ !== void 0 && x.push(`scale(${_})`), v !== void 0 && x.push(`rotate(${f(v)})`), (y !== void 0 || b !== void 0) && x.push(`skew(${f(y ?? 0)}, ${f(b ?? 0)})`), x.length && (t.transform = x.join(" "));
208
+ let S = (e) => `${e.inset ? "inset " : ""}${T(e.x ?? 0)} ${T(e.y ?? 0)} ${T(e.blur ?? 0)} ${T(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: C, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
178
209
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
179
- let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
210
+ let N = (Array.isArray(C) ? C : []).filter((e) => e && e.on !== !1).map(S);
180
211
  [
181
212
  D,
182
213
  O,
@@ -184,7 +215,7 @@ function C(e) {
184
215
  A,
185
216
  j,
186
217
  M
187
- ].some((e) => e !== void 0) && N.push(T({
218
+ ].some((e) => e !== void 0) && N.push(S({
188
219
  x: D,
189
220
  y: O,
190
221
  blur: k,
@@ -192,76 +223,76 @@ function C(e) {
192
223
  color: j,
193
224
  inset: M
194
225
  })), N.length && (t.boxShadow = N.join(", "));
195
- let P = (e) => e.type === "blur" ? `blur(${x(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: ee, filterContrast: te, filterSaturate: B } = t;
226
+ let P = (e) => e.type === "blur" ? `blur(${T(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: ee, backdropFilters: te, filterBlur: ne, filterGrayscale: re, filterBrightness: I, filterContrast: L, filterSaturate: ie } = t;
196
227
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
197
- let V = F(I);
198
- R !== void 0 && V.push(`blur(${x(R)})`), z !== void 0 && V.push(`grayscale(${z}%)`), ee !== void 0 && V.push(`brightness(${ee}%)`), te !== void 0 && V.push(`contrast(${te}%)`), B !== void 0 && V.push(`saturate(${B}%)`), V.length && (t.filter = V.join(" "));
199
- let ne = F(L);
200
- ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
201
- let { textStrokeWidth: re, textStrokeColor: ie } = t;
202
- delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
203
- let { clipText: H } = t;
204
- delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
- let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: oe } = t, G = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
228
+ let R = F(ee);
229
+ ne !== void 0 && R.push(`blur(${T(ne)})`), re !== void 0 && R.push(`grayscale(${re}%)`), I !== void 0 && R.push(`brightness(${I}%)`), L !== void 0 && R.push(`contrast(${L}%)`), ie !== void 0 && R.push(`saturate(${ie}%)`), R.length && (t.filter = R.join(" "));
230
+ let ae = F(te);
231
+ ae.length && (t.backdropFilter = ae.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
232
+ let { textStrokeWidth: oe, textStrokeColor: z } = t;
233
+ delete t.textStrokeWidth, delete t.textStrokeColor, (oe !== void 0 || z !== void 0) && (t.WebkitTextStroke = `${T(oe ?? 1)} ${z || "currentColor"}`);
234
+ let { clipText: B } = t;
235
+ delete t.clipText, B && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
236
+ let { transitions: se, transitionDuration: ce, transitionEasing: le, transitionProperty: V } = t, H = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
206
237
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
207
- let se = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${G(e.duration ?? 200)} ${e.easing || "ease"}`);
208
- if (W !== void 0 && se.push(`${oe || "all"} ${G(W)} ${ae || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
238
+ let U = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${H(e.duration ?? 200)} ${e.easing || "ease"}`);
239
+ if (ce !== void 0 && U.push(`${V || "all"} ${H(ce)} ${le || "ease"}`), U.length && (t.transition = U.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
209
240
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
210
241
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
211
242
  }
212
243
  delete t.backgroundVideo;
213
- let { overlayColor: K, overlayOpacity: ce } = t;
214
- if (delete t.overlayColor, delete t.overlayOpacity, K) {
215
- let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
244
+ let { overlayColor: ue, overlayOpacity: de } = t;
245
+ if (delete t.overlayColor, delete t.overlayOpacity, ue) {
246
+ let e = `color-mix(in srgb, ${ue} ${de ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
216
247
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
217
248
  }
218
249
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
219
- let { backgroundLayers: q } = t;
250
+ let { backgroundLayers: W } = t;
220
251
  delete t.backgroundLayers;
221
- let le = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
222
- if (le.length) {
252
+ let fe = (Array.isArray(W) ? W : []).filter((e) => e && e.on !== !1);
253
+ if (fe.length) {
223
254
  let e = [], n = [], r = [], i = [], a = [];
224
- for (let t of le) 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");
255
+ for (let t of fe) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
225
256
  else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
226
257
  else {
227
258
  if (!t.src) continue;
228
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${x(t.w ?? "auto")} ${x(t.h ?? "auto")}` : t.size || "cover"), r.push(`${x(t.posX ?? 0)} ${x(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
259
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${T(t.w ?? "auto")} ${T(t.h ?? "auto")}` : t.size || "cover"), r.push(`${T(t.posX ?? 0)} ${T(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
229
260
  }
230
261
  e.length && (t.backgroundImage && (e.push(t.backgroundImage), n.push(t.backgroundSize || "cover"), r.push(t.backgroundPosition || "center"), i.push(t.backgroundRepeat || "no-repeat"), a.push("scroll")), t.backgroundImage = e.join(", "), t.backgroundSize = n.join(", "), t.backgroundPosition = r.join(", "), t.backgroundRepeat = i.join(", "), t.backgroundAttachment = a.join(", "));
231
262
  }
232
263
  return t;
233
264
  }
234
- var w = {
265
+ var O = {
235
266
  hover: ":hover",
236
267
  pressed: ":active",
237
268
  focused: ":focus"
238
- }, T = /* @__PURE__ */ new Set([
269
+ }, k = /* @__PURE__ */ new Set([
239
270
  "style",
240
271
  "class",
241
272
  "id",
242
273
  "data-wb",
243
274
  "data-wb-class",
244
275
  "data-slot"
245
- ]), E = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !T.has(e.toLowerCase());
246
- function D(e, t, n = []) {
276
+ ]), A = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !k.has(e.toLowerCase());
277
+ function j(e, t, n = []) {
247
278
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
248
279
  for (let t of n) e.removeAttribute(t);
249
280
  let r = [];
250
281
  for (let n of t.attributes ?? []) {
251
282
  let t = String(n?.name ?? "").trim();
252
- E(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
283
+ A(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
253
284
  }
254
285
  return r;
255
286
  }
256
- var O = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
- function k(e, t, n, r = !1) {
258
- let i = Object.entries(C(t)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
287
+ var M = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
288
+ function N(e, t, n, r = !1) {
289
+ let i = Object.entries(D(t)).map(([e, t]) => `${M(e)}: ${t} !important;`).join(" ");
259
290
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
260
291
  }
261
- function A(e, t, n) {
262
- return Object.entries(w).map(([r, i]) => k(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
292
+ function P(e, t, n) {
293
+ return Object.entries(O).map(([r, i]) => N(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
263
294
  }
264
- var j = [
295
+ var F = [
265
296
  {
266
297
  key: "tablet",
267
298
  max: 991
@@ -274,17 +305,17 @@ var j = [
274
305
  key: "mobile",
275
306
  max: 478
276
307
  }
277
- ], M = (e) => Object.entries(C(e)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
278
- function N(e, t) {
279
- return j.map(({ key: n, max: r }) => {
280
- let i = t?.[n] ? M(t[n]) : "";
308
+ ], ee = (e) => Object.entries(D(e)).map(([e, t]) => `${M(e)}: ${t} !important;`).join(" ");
309
+ function te(e, t) {
310
+ return F.map(({ key: n, max: r }) => {
311
+ let i = t?.[n] ? ee(t[n]) : "";
281
312
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
282
313
  }).filter(Boolean).join("\n");
283
314
  }
284
- function P(e, t) {
315
+ function ne(e, t) {
285
316
  let n = [], r = (e) => {
286
317
  for (let [t, r] of Object.entries(e || {})) {
287
- let e = N(t, r.props);
318
+ let e = te(t, r.props);
288
319
  e && n.push(e);
289
320
  }
290
321
  };
@@ -292,10 +323,10 @@ function P(e, t) {
292
323
  for (let e of Object.values(t || {})) r(e.template?.nodes);
293
324
  return n.join("\n");
294
325
  }
295
- function F(e, t) {
326
+ function re(e, t) {
296
327
  let n = [], r = (e) => {
297
328
  for (let [t, r] of Object.entries(e || {})) {
298
- let e = A(t, r.props);
329
+ let e = P(t, r.props);
299
330
  e && n.push(e);
300
331
  }
301
332
  };
@@ -340,12 +371,12 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
340
371
  contrastText: "#052e2b"
341
372
  }
342
373
  }
343
- }, R = {
374
+ }, ie = {
344
375
  font: "system",
345
376
  headingFont: "inherit",
346
377
  light: L.light,
347
378
  dark: L.dark
348
- }, z = {
379
+ }, R = {
349
380
  system: {
350
381
  label: "System",
351
382
  value: I
@@ -366,7 +397,7 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
366
397
  label: "Mono",
367
398
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
368
399
  }
369
- }, ee = (e, t) => z[e]?.value ?? t, te = (e, ...t) => {
400
+ }, ae = (e, t) => R[e]?.value ?? S(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), oe = (e, ...t) => {
370
401
  let n = Object.assign({}, e, ...t);
371
402
  return n.primary = {
372
403
  ...e.primary,
@@ -382,16 +413,16 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
382
413
  }), {})
383
414
  }, n;
384
415
  };
385
- function B(e) {
416
+ function z(e) {
386
417
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
387
418
  return {
388
- font: r ?? R.font,
389
- headingFont: i ?? R.headingFont,
390
- light: te(L.light, a, t),
391
- dark: te(L.dark, n)
419
+ font: r ?? ie.font,
420
+ headingFont: i ?? ie.headingFont,
421
+ light: oe(L.light, a, t),
422
+ dark: oe(L.dark, n)
392
423
  };
393
424
  }
394
- function V(e) {
425
+ function B(e) {
395
426
  return {
396
427
  "--page-bg": e.background,
397
428
  "--page-text": e.text,
@@ -407,55 +438,55 @@ function V(e) {
407
438
  "--page-secondary-contrast": e.secondary.contrastText
408
439
  };
409
440
  }
410
- function ne(e) {
411
- let t = B(e);
441
+ function se(e) {
442
+ let t = z(e);
412
443
  return {
413
444
  backgroundColor: "var(--page-bg)",
414
445
  color: "var(--page-text)",
415
- fontFamily: ee(t.font, I),
416
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : ee(t.headingFont, "inherit")
446
+ fontFamily: ae(t.font, I),
447
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : ae(t.headingFont, "inherit")
417
448
  };
418
449
  }
419
- function re(e, t = "light") {
420
- let n = B(e);
450
+ function ce(e, t = "light") {
451
+ let n = z(e);
421
452
  return {
422
- ...ne(e),
423
- ...V(n[t] ?? n.light)
453
+ ...se(e),
454
+ ...B(n[t] ?? n.light)
424
455
  };
425
456
  }
426
- function ie(e, t) {
457
+ function le(e, t) {
427
458
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
428
459
  }
429
460
  //#endregion
430
461
  //#region ../ui/src/components/builder/views.jsx
431
- var H = n({
462
+ var V = n({
432
463
  tenant: "",
433
464
  apiUrl: "/api",
434
465
  locale: "",
435
466
  settings: null
436
- }), U = n(null), W = (e) => {
467
+ }), H = n(null), U = (e) => {
437
468
  let t = Number(e?.__page);
438
469
  if (Number.isFinite(t) && t >= 1) return Math.floor(t);
439
470
  if (typeof window > "u") return 1;
440
471
  let n = Number(new URLSearchParams(window.location.search).get("page"));
441
472
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
442
- }, ae = () => {
473
+ }, ue = () => {
443
474
  if (typeof window > "u") return {};
444
475
  let e = {};
445
476
  return new URLSearchParams(window.location.search).forEach((t, n) => {
446
477
  n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
447
478
  }), e;
448
- }, oe = (e) => {
479
+ }, de = (e) => {
449
480
  let t = {
450
481
  ...e && typeof e == "object" && !Array.isArray(e) ? e : {},
451
- ...ae()
482
+ ...ue()
452
483
  };
453
484
  return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
454
- }, G = n(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
455
- function K(e, t) {
485
+ }, W = n(null), fe = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
486
+ function G(e, t) {
456
487
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
457
488
  }
458
- var ce = (e) => {
489
+ var pe = (e) => {
459
490
  let t = [];
460
491
  for (let [n, r] of Object.entries(e ?? {})) {
461
492
  if (!/^[\w-]+$/.test(n)) continue;
@@ -465,36 +496,36 @@ var ce = (e) => {
465
496
  }
466
497
  return t;
467
498
  };
468
- function q(e) {
499
+ function K(e) {
469
500
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
470
501
  }
471
- function le(e, t) {
472
- let n = t?.data ?? {}, r = ce(n);
502
+ function me(e, t) {
503
+ let n = t?.data ?? {}, r = pe(n);
473
504
  if (!r.length) return e;
474
- let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => q(K(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
505
+ let i = RegExp(`:(${r.map(fe).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
475
506
  return a(e);
476
507
  }
477
- var ue = {
508
+ var he = {
478
509
  margin: 0,
479
510
  fontWeight: 700,
480
511
  lineHeight: 1.2,
481
512
  fontFamily: "var(--page-heading-font, inherit)"
482
- }, de = { margin: 0 }, J = {
513
+ }, ge = { margin: 0 }, q = {
483
514
  display: "inline-block",
484
515
  textDecoration: "none",
485
516
  cursor: "pointer",
486
517
  backgroundColor: "var(--page-accent, #111827)",
487
518
  color: "var(--page-accent-text, #ffffff)"
488
- }, fe = {
519
+ }, _e = {
489
520
  flexGrow: 1,
490
521
  display: "flex",
491
522
  flexDirection: "column",
492
523
  position: "relative"
493
- }, pe = {
524
+ }, ve = {
494
525
  display: "flex",
495
526
  flexDirection: "column"
496
527
  };
497
- function me({ style: e }) {
528
+ function ye({ style: e }) {
498
529
  let t = e?.backgroundVideo;
499
530
  if (!t) return null;
500
531
  let n = {
@@ -520,32 +551,32 @@ function me({ style: e }) {
520
551
  background: r
521
552
  } })] });
522
553
  }
523
- var he = (e, t) => e?.backgroundVideo ? {
554
+ var be = (e, t) => e?.backgroundVideo ? {
524
555
  position: "relative",
525
556
  ...t,
526
- ...C(e)
557
+ ...D(e)
527
558
  } : {
528
559
  ...t,
529
- ...C(e)
560
+ ...D(e)
530
561
  };
531
- function ge({ style: e, nodeRef: t, children: n }) {
562
+ function xe({ style: e, nodeRef: t, children: n }) {
532
563
  return /* @__PURE__ */ f("div", {
533
564
  ref: t,
534
565
  style: {
535
- ...fe,
536
- ...C(e)
566
+ ..._e,
567
+ ...D(e)
537
568
  },
538
- children: [/* @__PURE__ */ d(me, { style: e }), n]
569
+ children: [/* @__PURE__ */ d(ye, { style: e }), n]
539
570
  });
540
571
  }
541
- function _e({ style: e, nodeRef: t, children: n }) {
572
+ function Se({ style: e, nodeRef: t, children: n }) {
542
573
  return /* @__PURE__ */ f("section", {
543
574
  ref: t,
544
- style: he(e, pe),
545
- children: [/* @__PURE__ */ d(me, { style: e }), n]
575
+ style: be(e, ve),
576
+ children: [/* @__PURE__ */ d(ye, { style: e }), n]
546
577
  });
547
578
  }
548
- function ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
579
+ function Ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
549
580
  let i = t ? {
550
581
  position: "relative",
551
582
  minHeight: 240
@@ -554,32 +585,32 @@ function ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
554
585
  ref: n,
555
586
  style: i ? {
556
587
  ...i,
557
- ...he(e)
558
- } : he(e),
559
- children: [/* @__PURE__ */ d(me, { style: e }), r]
588
+ ...be(e)
589
+ } : be(e),
590
+ children: [/* @__PURE__ */ d(ye, { style: e }), r]
560
591
  });
561
592
  }
562
- function ye({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
593
+ function we({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
563
594
  return /* @__PURE__ */ d(n, {
564
595
  ref: a,
565
596
  style: {
566
- ...ue,
567
- ...C(r)
597
+ ...he,
598
+ ...D(r)
568
599
  },
569
- children: Y(t, e, i)
600
+ children: J(t, e, i)
570
601
  });
571
602
  }
572
- var be = {
573
- fontFamily: z.mono.value,
603
+ var Te = {
604
+ fontFamily: R.mono.value,
574
605
  background: "rgba(148, 163, 184, 0.18)",
575
606
  padding: "1px 5px",
576
607
  borderRadius: 4,
577
608
  fontSize: "0.9em"
578
609
  };
579
- function xe(e, t = [], n, r) {
610
+ function Ee(e, t = [], n, r) {
580
611
  let i = e;
581
612
  return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
582
- style: be,
613
+ style: Te,
583
614
  children: i
584
615
  })), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n && (i = /* @__PURE__ */ d("a", {
585
616
  href: n,
@@ -589,13 +620,13 @@ function xe(e, t = [], n, r) {
589
620
  children: i
590
621
  })), i;
591
622
  }
592
- function Y(e, n, r) {
623
+ function J(e, n, r) {
593
624
  return e?.length ? e.map((e, n) => {
594
625
  if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
595
- if (e.parts) return /* @__PURE__ */ d(t, { children: Y(e.parts, "", r) }, n);
626
+ if (e.parts) return /* @__PURE__ */ d(t, { children: J(e.parts, "", r) }, n);
596
627
  let i = e.text;
597
628
  return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
598
- style: be,
629
+ style: Te,
599
630
  children: i
600
631
  })), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
601
632
  style: {
@@ -612,13 +643,13 @@ function Y(e, n, r) {
612
643
  })), /* @__PURE__ */ d(t, { children: i }, n);
613
644
  }) : n;
614
645
  }
615
- function Se({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
646
+ function De({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
616
647
  return /* @__PURE__ */ d("span", {
617
- style: C(a),
618
- children: e?.length ? Y(e, t) : xe(t, n, r, i)
648
+ style: D(a),
649
+ children: e?.length ? J(e, t) : Ee(t, n, r, i)
619
650
  });
620
651
  }
621
- var Ce = {
652
+ var Oe = {
622
653
  h1: 40,
623
654
  h2: 32,
624
655
  h3: 26,
@@ -626,7 +657,7 @@ var Ce = {
626
657
  h5: 19,
627
658
  h6: 16
628
659
  };
629
- function we({ align: e = "center", width: t, wrap: n } = {}) {
660
+ function ke({ align: e = "center", width: t, wrap: n } = {}) {
630
661
  let r = t ? `${t}%` : void 0;
631
662
  if (e === "full") return { width: "100%" };
632
663
  let i = e === "left" || e === "right";
@@ -660,8 +691,8 @@ function we({ align: e = "center", width: t, wrap: n } = {}) {
660
691
  marginRight: "auto"
661
692
  };
662
693
  }
663
- function Te(e = [], t, n) {
664
- let r = n ?? ((e, n) => Y(e, n, t));
694
+ function Ae(e = [], t, n) {
695
+ let r = n ?? ((e, n) => J(e, n, t));
665
696
  return e.map((t, n) => {
666
697
  let i = {
667
698
  marginTop: 0,
@@ -683,7 +714,7 @@ function Te(e = [], t, n) {
683
714
  marginLeft: 0,
684
715
  marginRight: 0,
685
716
  ...i,
686
- ...we(t)
717
+ ...ke(t)
687
718
  },
688
719
  children: [t.href ? /* @__PURE__ */ d("a", {
689
720
  href: t.href,
@@ -702,16 +733,16 @@ function Te(e = [], t, n) {
702
733
  })]
703
734
  }, n);
704
735
  }
705
- if (t.type === "video") return Ie(t.url) ? /* @__PURE__ */ d("div", {
736
+ if (t.type === "video") return Ve(t.url) ? /* @__PURE__ */ d("div", {
706
737
  style: {
707
738
  ...i,
708
- ...we({
739
+ ...ke({
709
740
  align: t.align,
710
741
  wrap: t.wrap,
711
742
  width: t.width ?? 100
712
743
  })
713
744
  },
714
- children: /* @__PURE__ */ d(Le, {
745
+ children: /* @__PURE__ */ d(He, {
715
746
  url: t.url,
716
747
  autoplay: t.autoplay,
717
748
  muted: t.muted,
@@ -773,17 +804,17 @@ function Te(e = [], t, n) {
773
804
  }
774
805
  if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
775
806
  style: {
776
- ...De,
807
+ ...Me,
777
808
  ...i
778
809
  },
779
810
  children: r(t.parts, t.text)
780
811
  }, n);
781
- if (Ce[t.type]) {
812
+ if (Oe[t.type]) {
782
813
  let e = t.type;
783
814
  return /* @__PURE__ */ d(e, {
784
815
  style: {
785
- ...ue,
786
- fontSize: Ce[t.type],
816
+ ...he,
817
+ fontSize: Oe[t.type],
787
818
  ...i
788
819
  },
789
820
  children: r(t.parts, t.text)
@@ -791,95 +822,95 @@ function Te(e = [], t, n) {
791
822
  }
792
823
  return /* @__PURE__ */ d("p", {
793
824
  style: {
794
- ...de,
825
+ ...ge,
795
826
  ...i
796
827
  },
797
828
  children: r(t.parts, t.text)
798
829
  }, n);
799
830
  });
800
831
  }
801
- function Ee({ content: e, style: t, linked: n, nodeRef: r }) {
832
+ function je({ content: e, style: t, linked: n, nodeRef: r }) {
802
833
  return /* @__PURE__ */ d("div", {
803
834
  ref: r,
804
835
  style: {
805
836
  display: "flow-root",
806
- ...C(t)
837
+ ...D(t)
807
838
  },
808
- children: Te(e, n)
839
+ children: Ae(e, n)
809
840
  });
810
841
  }
811
- var De = {
842
+ var Me = {
812
843
  margin: 0,
813
844
  padding: "8px 0 8px 20px",
814
845
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
815
846
  };
816
- function Oe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
847
+ function Ne({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
817
848
  return /* @__PURE__ */ d("blockquote", {
818
849
  ref: i,
819
850
  style: {
820
- ...De,
821
- ...C(n)
851
+ ...Me,
852
+ ...D(n)
822
853
  },
823
- children: Y(t, e, r)
854
+ children: J(t, e, r)
824
855
  });
825
856
  }
826
- function ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
857
+ function Pe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
827
858
  return /* @__PURE__ */ d(e ? "ol" : "ul", {
828
859
  ref: r,
829
860
  style: {
830
861
  margin: 0,
831
862
  paddingLeft: 24,
832
- ...C(n)
863
+ ...D(n)
833
864
  },
834
865
  children: t.map((e, t) => /* @__PURE__ */ d("li", {
835
866
  style: { marginBottom: 4 },
836
- children: Y(e.parts, e.text)
867
+ children: J(e.parts, e.text)
837
868
  }, t))
838
869
  });
839
870
  }
840
- function Ae({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
871
+ function Fe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
841
872
  return /* @__PURE__ */ d("p", {
842
873
  ref: i,
843
874
  style: {
844
- ...de,
845
- ...C(n)
875
+ ...ge,
876
+ ...D(n)
846
877
  },
847
- children: Y(t, e, r)
878
+ children: J(t, e, r)
848
879
  });
849
880
  }
850
- var je = {
881
+ var Ie = {
851
882
  color: "var(--page-accent, inherit)",
852
883
  textDecoration: "underline",
853
884
  textUnderlineOffset: 3,
854
885
  cursor: "pointer"
855
886
  };
856
- function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
887
+ function Le({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
857
888
  return /* @__PURE__ */ d("a", {
858
889
  ref: o,
859
890
  href: n || "#",
860
891
  target: r || void 0,
861
892
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
862
893
  style: {
863
- ...je,
864
- ...C(i)
894
+ ...Ie,
895
+ ...D(i)
865
896
  },
866
- children: Y(t, e, a)
897
+ children: J(t, e, a)
867
898
  });
868
899
  }
869
- function Ne({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
900
+ function Re({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
870
901
  return /* @__PURE__ */ d("a", {
871
902
  ref: o,
872
903
  href: n || "#",
873
904
  target: r || void 0,
874
905
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
875
906
  style: {
876
- ...J,
877
- ...C(i)
907
+ ...q,
908
+ ...D(i)
878
909
  },
879
- children: Y(t, e, a)
910
+ children: J(t, e, a)
880
911
  });
881
912
  }
882
- function Pe({ src: e, alt: t, style: n, nodeRef: r }) {
913
+ function ze({ src: e, alt: t, style: n, nodeRef: r }) {
883
914
  return e ? /* @__PURE__ */ d("img", {
884
915
  ref: r,
885
916
  src: e,
@@ -887,11 +918,11 @@ function Pe({ src: e, alt: t, style: n, nodeRef: r }) {
887
918
  style: {
888
919
  display: "block",
889
920
  maxWidth: "100%",
890
- ...C(n)
921
+ ...D(n)
891
922
  }
892
923
  }) : null;
893
924
  }
894
- function Fe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
925
+ function Be({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
895
926
  return e ? /* @__PURE__ */ d("video", {
896
927
  ref: s,
897
928
  src: e,
@@ -905,13 +936,13 @@ function Fe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
905
936
  display: "block",
906
937
  width: "100%",
907
938
  maxWidth: "100%",
908
- ...C(o)
939
+ ...D(o)
909
940
  }
910
941
  }) : null;
911
942
  }
912
- var Ie = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
913
- function Le({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
914
- let c = Ie(e);
943
+ var Ve = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
944
+ function He({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
945
+ let c = Ve(e);
915
946
  if (!c) return null;
916
947
  let l = new URLSearchParams({ rel: "0" });
917
948
  return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
@@ -920,7 +951,7 @@ function Le({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
920
951
  position: "relative",
921
952
  width: "100%",
922
953
  paddingTop: "56.25%",
923
- ...C(o)
954
+ ...D(o)
924
955
  },
925
956
  children: /* @__PURE__ */ d("iframe", {
926
957
  src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
@@ -937,7 +968,7 @@ function Le({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
937
968
  })
938
969
  });
939
970
  }
940
- function Re({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
971
+ function Ue({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
941
972
  return e ? /* @__PURE__ */ d("iframe", {
942
973
  ref: i,
943
974
  src: e,
@@ -949,11 +980,11 @@ function Re({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
949
980
  width: "100%",
950
981
  height: 300,
951
982
  border: 0,
952
- ...C(r)
983
+ ...D(r)
953
984
  }
954
985
  }) : null;
955
986
  }
956
- function ze({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
987
+ function We({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
957
988
  let [i, o] = l(null);
958
989
  return a(() => {
959
990
  i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
@@ -969,10 +1000,10 @@ function ze({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
969
1000
  ref: (e) => {
970
1001
  o(e), r && r(e);
971
1002
  },
972
- style: C(n)
1003
+ style: D(n)
973
1004
  });
974
1005
  }
975
- function Be({ height: e, nodeRef: t }) {
1006
+ function Ge({ height: e, nodeRef: t }) {
976
1007
  return /* @__PURE__ */ d("div", {
977
1008
  ref: t,
978
1009
  style: {
@@ -982,18 +1013,18 @@ function Be({ height: e, nodeRef: t }) {
982
1013
  }
983
1014
  });
984
1015
  }
985
- function Ve({ style: e, nodeRef: t }) {
1016
+ function Ke({ style: e, nodeRef: t }) {
986
1017
  return /* @__PURE__ */ d("div", {
987
1018
  ref: t,
988
1019
  style: {
989
1020
  height: 1,
990
1021
  alignSelf: "stretch",
991
1022
  flexShrink: 0,
992
- ...C(e)
1023
+ ...D(e)
993
1024
  }
994
1025
  });
995
1026
  }
996
- var He = {
1027
+ var qe = {
997
1028
  position: "absolute",
998
1029
  top: "50%",
999
1030
  transform: "translateY(-50%)",
@@ -1010,7 +1041,7 @@ var He = {
1010
1041
  alignItems: "center",
1011
1042
  justifyContent: "center",
1012
1043
  padding: 0
1013
- }, Ue = {
1044
+ }, Je = {
1014
1045
  bottom: {
1015
1046
  inset: "auto 0 0 0",
1016
1047
  padding: "40px 24px 20px",
@@ -1029,8 +1060,8 @@ var He = {
1029
1060
  padding: 24,
1030
1061
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1031
1062
  }
1032
- }, We = 48;
1033
- function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1063
+ }, Ye = 48;
1064
+ function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1034
1065
  let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
1035
1066
  if (a(() => {
1036
1067
  if (!n || h || _ || e < 2) return;
@@ -1046,7 +1077,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1046
1077
  let b = (t) => m((t + e) % e), x = () => {
1047
1078
  if (!_) return;
1048
1079
  let { dx: e } = _;
1049
- v(null), e < -48 ? b(y + 1) : e > We && b(y - 1);
1080
+ v(null), e < -48 ? b(y + 1) : e > Ye && b(y - 1);
1050
1081
  };
1051
1082
  return /* @__PURE__ */ f("div", {
1052
1083
  ref: c,
@@ -1071,7 +1102,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1071
1102
  touchAction: "pan-y",
1072
1103
  userSelect: _ ? "none" : void 0,
1073
1104
  cursor: _ ? "grabbing" : void 0,
1074
- ...C(s)
1105
+ ...D(s)
1075
1106
  },
1076
1107
  children: [/* @__PURE__ */ d("div", {
1077
1108
  style: {
@@ -1094,7 +1125,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1094
1125
  type: "button",
1095
1126
  "aria-label": "Previous slide",
1096
1127
  style: {
1097
- ...He,
1128
+ ...qe,
1098
1129
  left: 12
1099
1130
  },
1100
1131
  onClick: () => b(y - 1),
@@ -1104,7 +1135,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1104
1135
  type: "button",
1105
1136
  "aria-label": "Next slide",
1106
1137
  style: {
1107
- ...He,
1138
+ ...qe,
1108
1139
  right: 12
1109
1140
  },
1110
1141
  onClick: () => b(y + 1),
@@ -1138,7 +1169,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1138
1169
  ] })]
1139
1170
  });
1140
1171
  }
1141
- var Ke = (e, t) => ({
1172
+ var Ze = (e, t) => ({
1142
1173
  position: "absolute",
1143
1174
  inset: 0,
1144
1175
  backgroundImage: e ? `url(${e})` : "none",
@@ -1146,18 +1177,18 @@ var Ke = (e, t) => ({
1146
1177
  backgroundSize: "cover",
1147
1178
  backgroundPosition: "center"
1148
1179
  });
1149
- function qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1150
- return e.length ? /* @__PURE__ */ d(Ge, {
1180
+ function Qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1181
+ return e.length ? /* @__PURE__ */ d(Xe, {
1151
1182
  ...r,
1152
1183
  count: e.length,
1153
1184
  renderSlide: (r) => {
1154
1185
  let i = e[r];
1155
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ke(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1186
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1156
1187
  style: {
1157
1188
  position: "absolute",
1158
1189
  color: "#fff",
1159
1190
  textAlign: n,
1160
- ...Ue[t] ?? Ue.bottom
1191
+ ...Je[t] ?? Je.bottom
1161
1192
  },
1162
1193
  children: [i.title && /* @__PURE__ */ d("div", {
1163
1194
  style: {
@@ -1177,13 +1208,13 @@ function qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1177
1208
  }
1178
1209
  }) : null;
1179
1210
  }
1180
- function Je({ slides: e = [], linked: t, ...n }) {
1181
- return e.length ? /* @__PURE__ */ d(Ge, {
1211
+ function $e({ slides: e = [], linked: t, ...n }) {
1212
+ return e.length ? /* @__PURE__ */ d(Xe, {
1182
1213
  ...n,
1183
1214
  count: e.length,
1184
1215
  renderSlide: (n) => {
1185
1216
  let r = e[n];
1186
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ke(r.image, r.color) }), /* @__PURE__ */ d("div", {
1217
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ze(r.image, r.color) }), /* @__PURE__ */ d("div", {
1187
1218
  style: {
1188
1219
  position: "absolute",
1189
1220
  inset: 0,
@@ -1195,7 +1226,7 @@ function Je({ slides: e = [], linked: t, ...n }) {
1195
1226
  }
1196
1227
  }) : null;
1197
1228
  }
1198
- function Ye({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: i = !0, style: o, nodeRef: s, inert: c }) {
1229
+ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: i = !0, style: o, nodeRef: s, inert: c }) {
1199
1230
  let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0), h = c ? (e) => e.preventDefault() : void 0, [g, _] = l(null), v = i && !c && g !== null && p[g];
1200
1231
  a(() => {
1201
1232
  if (!v) return;
@@ -1220,7 +1251,7 @@ function Ye({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1220
1251
  columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
1221
1252
  columnGap: m,
1222
1253
  width: "100%",
1223
- ...C(o)
1254
+ ...D(o)
1224
1255
  },
1225
1256
  children: [
1226
1257
  p.map((e, t) => {
@@ -1394,29 +1425,29 @@ function Ye({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1394
1425
  ]
1395
1426
  });
1396
1427
  }
1397
- var Xe = {
1428
+ var tt = {
1398
1429
  color: "inherit",
1399
1430
  textDecoration: "none",
1400
1431
  fontSize: 14,
1401
1432
  opacity: .85
1402
- }, Ze = {
1433
+ }, nt = {
1403
1434
  background: "var(--page-bg, #ffffff)",
1404
1435
  color: "var(--page-text, #111827)",
1405
1436
  border: "1px solid rgba(148, 163, 184, 0.25)",
1406
1437
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1407
1438
  zIndex: 60
1408
1439
  };
1409
- function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], style: s, nodeRef: c, menu: p = "auto", breakpoint: m = 768 }) {
1440
+ function rt({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], style: s, nodeRef: c, menu: p = "auto", breakpoint: m = 768 }) {
1410
1441
  let [h, g] = l(null), [_, v] = l(!1), [y, b] = l(!1), [x, S] = l(null);
1411
1442
  a(() => {
1412
1443
  if (!h) return;
1413
1444
  let e = new ResizeObserver(() => v(h.offsetWidth < m));
1414
1445
  return e.observe(h), () => e.disconnect();
1415
1446
  }, [h, m]);
1416
- let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ f("a", {
1447
+ let C = p === "hamburger" || p === "auto" && _, w = (e, t) => /* @__PURE__ */ f("a", {
1417
1448
  href: e.href || "#",
1418
1449
  style: {
1419
- ...Xe,
1450
+ ...tt,
1420
1451
  display: "block",
1421
1452
  ...t
1422
1453
  },
@@ -1442,7 +1473,7 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1442
1473
  padding: "14px 24px",
1443
1474
  width: "100%",
1444
1475
  position: "relative",
1445
- ...C(s)
1476
+ ...D(s)
1446
1477
  },
1447
1478
  children: [
1448
1479
  (n || e) && (() => {
@@ -1479,7 +1510,7 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1479
1510
  });
1480
1511
  })(),
1481
1512
  /* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
1482
- w ? /* @__PURE__ */ d("button", {
1513
+ C ? /* @__PURE__ */ d("button", {
1483
1514
  type: "button",
1484
1515
  "aria-label": y ? "Close menu" : "Open menu",
1485
1516
  onClick: () => b(!y),
@@ -1504,7 +1535,7 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1504
1535
  let t = e.children ?? [];
1505
1536
  if (!t.length) return /* @__PURE__ */ d("a", {
1506
1537
  href: e.href || "#",
1507
- style: Xe,
1538
+ style: tt,
1508
1539
  children: e.label
1509
1540
  }, e.key);
1510
1541
  let n = e.type === "mega";
@@ -1518,7 +1549,7 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1518
1549
  children: [/* @__PURE__ */ f("a", {
1519
1550
  href: e.href || "#",
1520
1551
  style: {
1521
- ...Xe,
1552
+ ...tt,
1522
1553
  cursor: "pointer"
1523
1554
  },
1524
1555
  children: [
@@ -1534,7 +1565,7 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1534
1565
  ]
1535
1566
  }), x === e.key && (n ? /* @__PURE__ */ d("div", {
1536
1567
  style: {
1537
- ...Ze,
1568
+ ...nt,
1538
1569
  position: "absolute",
1539
1570
  left: 0,
1540
1571
  right: 0,
@@ -1544,13 +1575,13 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1544
1575
  gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
1545
1576
  gap: 16
1546
1577
  },
1547
- children: t.map((e) => T(e, {
1578
+ children: t.map((e) => w(e, {
1548
1579
  padding: "6px 8px",
1549
1580
  borderRadius: 6
1550
1581
  }))
1551
1582
  }) : /* @__PURE__ */ d("div", {
1552
1583
  style: {
1553
- ...Ze,
1584
+ ...nt,
1554
1585
  position: "absolute",
1555
1586
  top: "100%",
1556
1587
  left: 0,
@@ -1560,7 +1591,7 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1560
1591
  display: "flex",
1561
1592
  flexDirection: "column"
1562
1593
  },
1563
- children: t.map((e) => T(e, {
1594
+ children: t.map((e) => w(e, {
1564
1595
  padding: "8px 12px",
1565
1596
  borderRadius: 6
1566
1597
  }))
@@ -1568,7 +1599,7 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1568
1599
  }, e.key);
1569
1600
  })
1570
1601
  }),
1571
- w && y && /* @__PURE__ */ d("div", {
1602
+ C && y && /* @__PURE__ */ d("div", {
1572
1603
  style: {
1573
1604
  flexBasis: "100%",
1574
1605
  width: "100%",
@@ -1579,24 +1610,24 @@ function Qe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
1579
1610
  children: o.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
1580
1611
  href: e.href || "#",
1581
1612
  style: {
1582
- ...Xe,
1613
+ ...tt,
1583
1614
  padding: "10px 4px",
1584
1615
  fontWeight: (e.children ?? []).length ? 600 : 400,
1585
1616
  opacity: 1
1586
1617
  },
1587
1618
  children: e.label
1588
- }), (e.children ?? []).map((e) => T(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
1619
+ }), (e.children ?? []).map((e) => w(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
1589
1620
  })
1590
1621
  ]
1591
1622
  });
1592
1623
  }
1593
- function $e({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1624
+ function it({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1594
1625
  let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1595
1626
  return e.length ? /* @__PURE__ */ f("div", {
1596
1627
  ref: r,
1597
1628
  style: {
1598
1629
  width: "100%",
1599
- ...C(n)
1630
+ ...D(n)
1600
1631
  },
1601
1632
  children: [/* @__PURE__ */ d("div", {
1602
1633
  style: {
@@ -1630,7 +1661,7 @@ function $e({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1630
1661
  }, e.key))]
1631
1662
  }) : null;
1632
1663
  }
1633
- function et({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1664
+ function at({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1634
1665
  let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
1635
1666
  if (!e.length) return null;
1636
1667
  let s = (e) => o((t) => {
@@ -1641,7 +1672,7 @@ function et({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1641
1672
  ref: i,
1642
1673
  style: {
1643
1674
  width: "100%",
1644
- ...C(r)
1675
+ ...D(r)
1645
1676
  },
1646
1677
  children: e.map((n, r) => {
1647
1678
  let i = a.has(n.key);
@@ -1687,15 +1718,15 @@ function et({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1687
1718
  })
1688
1719
  });
1689
1720
  }
1690
- var tt = {
1721
+ var ot = {
1691
1722
  display: "flex",
1692
1723
  flexDirection: "column",
1693
1724
  gap: "12px"
1694
- }, X = {
1725
+ }, Y = {
1695
1726
  fontSize: "14px",
1696
1727
  fontWeight: 500,
1697
1728
  color: "var(--page-text, #111827)"
1698
- }, Z = {
1729
+ }, X = {
1699
1730
  padding: "10px 12px",
1700
1731
  border: "1px solid #d1d5db",
1701
1732
  borderRadius: "6px",
@@ -1705,18 +1736,18 @@ var tt = {
1705
1736
  boxSizing: "border-box",
1706
1737
  backgroundColor: "#ffffff",
1707
1738
  color: "#111827"
1708
- }, nt = {
1739
+ }, st = {
1709
1740
  display: "flex",
1710
1741
  alignItems: "center",
1711
1742
  gap: "8px",
1712
1743
  fontSize: "14px",
1713
1744
  color: "var(--page-text, #111827)"
1714
- }, Q = (e) => e ? {
1745
+ }, Z = (e) => e ? {
1715
1746
  readOnly: !0,
1716
1747
  tabIndex: -1,
1717
1748
  onMouseDown: (e) => e.preventDefault()
1718
1749
  } : {};
1719
- function rt(e, t) {
1750
+ function ct(e, t) {
1720
1751
  if (!e) return !0;
1721
1752
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1722
1753
  switch (e.op) {
@@ -1730,11 +1761,11 @@ function rt(e, t) {
1730
1761
  default: return !1;
1731
1762
  }
1732
1763
  }
1733
- var it = {
1764
+ var lt = {
1734
1765
  display: "flex",
1735
1766
  flexDirection: "column",
1736
1767
  gap: 6
1737
- }, at = {
1768
+ }, ut = {
1738
1769
  font: "inherit",
1739
1770
  fontSize: 15,
1740
1771
  padding: "10px 12px",
@@ -1745,16 +1776,16 @@ var it = {
1745
1776
  width: "100%",
1746
1777
  boxSizing: "border-box"
1747
1778
  };
1748
- function ot(e, t) {
1779
+ function dt(e, t) {
1749
1780
  let n = Array.isArray(e?.options) ? e.options : [];
1750
1781
  if (!e?.parentField) return n;
1751
1782
  let r = t?.[e.parentField];
1752
1783
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1753
1784
  }
1754
- function st({ field: e, value: t, onChange: n, inert: r, values: i }) {
1785
+ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
1755
1786
  let a = /* @__PURE__ */ f("span", {
1756
1787
  style: {
1757
- ...X,
1788
+ ...Y,
1758
1789
  fontSize: 14
1759
1790
  },
1760
1791
  children: [e.label, e.required ? " *" : ""]
@@ -1763,7 +1794,7 @@ function st({ field: e, value: t, onChange: n, inert: r, values: i }) {
1763
1794
  required: e.required || void 0,
1764
1795
  placeholder: e.placeholder || void 0,
1765
1796
  disabled: r || void 0,
1766
- style: at,
1797
+ style: ut,
1767
1798
  value: t ?? "",
1768
1799
  onChange: (t) => n(e.name, t.target.value)
1769
1800
  };
@@ -1792,7 +1823,7 @@ function st({ field: e, value: t, onChange: n, inert: r, values: i }) {
1792
1823
  borderRadius: 8,
1793
1824
  display: "block"
1794
1825
  }
1795
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Le, {
1826
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(He, {
1796
1827
  url: e.src,
1797
1828
  style: { width: "100%" }
1798
1829
  }) : /* @__PURE__ */ d("video", {
@@ -1804,14 +1835,14 @@ function st({ field: e, value: t, onChange: n, inert: r, values: i }) {
1804
1835
  display: "block"
1805
1836
  }
1806
1837
  }) : null : /* @__PURE__ */ f("label", {
1807
- style: it,
1838
+ style: lt,
1808
1839
  children: [
1809
1840
  a,
1810
1841
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
1811
1842
  ...o,
1812
1843
  rows: 4,
1813
1844
  style: {
1814
- ...at,
1845
+ ...ut,
1815
1846
  resize: "vertical"
1816
1847
  }
1817
1848
  }) : e.type === "select" ? /* @__PURE__ */ f("select", {
@@ -1820,7 +1851,7 @@ function st({ field: e, value: t, onChange: n, inert: r, values: i }) {
1820
1851
  children: [/* @__PURE__ */ d("option", {
1821
1852
  value: "",
1822
1853
  children: e.placeholder || "—"
1823
- }), ot(e, i).map((e, t) => /* @__PURE__ */ d("option", {
1854
+ }), dt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
1824
1855
  value: typeof e == "string" ? e : e.value,
1825
1856
  children: typeof e == "string" ? e : e.label ?? e.value
1826
1857
  }, t))]
@@ -1867,12 +1898,12 @@ function st({ field: e, value: t, onChange: n, inert: r, values: i }) {
1867
1898
  ]
1868
1899
  });
1869
1900
  }
1870
- function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1871
- let { tenant: y, apiUrl: b } = i(H), [x, S] = l("form"), [w, T] = l(null), [E, D] = l({}), [O, k] = l(0), A = h ? v || "form" : x;
1901
+ function pt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1902
+ let { tenant: y, apiUrl: b } = i(V), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [O, k] = l(0), A = h ? v || "form" : x;
1872
1903
  a(() => {
1873
1904
  if (!c || !s) return;
1874
1905
  let e = !0;
1875
- return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1906
+ return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && w(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && w(null)), () => {
1876
1907
  e = !1;
1877
1908
  };
1878
1909
  }, [
@@ -1885,27 +1916,27 @@ function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1885
1916
  section: null,
1886
1917
  fields: []
1887
1918
  }];
1888
- for (let e of Array.isArray(w?.fields) ? w.fields : []) e.type === "section" ? j.push({
1919
+ for (let e of Array.isArray(C?.fields) ? C.fields : []) e.type === "section" ? j.push({
1889
1920
  section: e,
1890
1921
  fields: []
1891
1922
  }) : j[j.length - 1].fields.push(e);
1892
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || rt(e.section.condition, E)).map((e) => ({
1923
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || ct(e.section.condition, T)).map((e) => ({
1893
1924
  ...e,
1894
- fields: e.fields.filter((e) => rt(e.condition, E))
1895
- })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
1896
- let t = E[e.name];
1925
+ fields: e.fields.filter((e) => ct(e.condition, T))
1926
+ })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), ee = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), te = ee.filter((e) => {
1927
+ let t = T[e.name];
1897
1928
  return e.required && (t == null || t === "" || t === !1);
1898
- }), R = F >= N.length - 1, z = (e, t) => D((n) => {
1929
+ }), ne = F >= N.length - 1, re = (e, t) => E((n) => {
1899
1930
  let r = {
1900
1931
  ...n,
1901
1932
  [e]: t
1902
1933
  };
1903
- for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
1934
+ for (let t of Array.isArray(C?.fields) ? C.fields : []) t?.parentField === e && delete r[t.name];
1904
1935
  return r;
1905
1936
  });
1906
1937
  return /* @__PURE__ */ f("div", {
1907
1938
  ref: m,
1908
- style: C(e),
1939
+ style: D(e),
1909
1940
  children: [
1910
1941
  /* @__PURE__ */ d("form", {
1911
1942
  action: t || void 0,
@@ -1916,7 +1947,7 @@ function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1916
1947
  if (e.preventDefault(), !h) {
1917
1948
  if (s) {
1918
1949
  let t = {};
1919
- if (c) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1950
+ if (c) for (let [e, n] of Object.entries(T)) n != null && n !== "" && (t[e] = n);
1920
1951
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1921
1952
  try {
1922
1953
  let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
@@ -1949,11 +1980,11 @@ function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1949
1980
  }
1950
1981
  },
1951
1982
  style: {
1952
- ...tt,
1983
+ ...ot,
1953
1984
  display: A === "success" ? "none" : "flex"
1954
1985
  },
1955
1986
  children: c && s ? /* @__PURE__ */ f(u, { children: [
1956
- P && /* @__PURE__ */ d(jt, {
1987
+ P && /* @__PURE__ */ d(Ft, {
1957
1988
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1958
1989
  active: F + 1,
1959
1990
  style: { marginBottom: 8 }
@@ -1966,11 +1997,11 @@ function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1966
1997
  },
1967
1998
  children: N[F].section.help
1968
1999
  }),
1969
- I.map((e) => /* @__PURE__ */ d(st, {
2000
+ ee.map((e) => /* @__PURE__ */ d(ft, {
1970
2001
  field: e,
1971
- value: E[e.name],
1972
- values: E,
1973
- onChange: z,
2002
+ value: T[e.name],
2003
+ values: T,
2004
+ onChange: re,
1974
2005
  inert: h
1975
2006
  }, e.name)),
1976
2007
  /* @__PURE__ */ f("div", {
@@ -1985,7 +2016,7 @@ function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1985
2016
  disabled: h || void 0,
1986
2017
  onClick: () => k(F - 1),
1987
2018
  style: {
1988
- ...J,
2019
+ ...q,
1989
2020
  background: "transparent",
1990
2021
  color: "inherit",
1991
2022
  border: 0,
@@ -1993,26 +2024,26 @@ function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1993
2024
  cursor: "pointer"
1994
2025
  },
1995
2026
  children: "Back"
1996
- }), P && !R ? /* @__PURE__ */ d("button", {
2027
+ }), P && !ne ? /* @__PURE__ */ d("button", {
1997
2028
  type: "button",
1998
- disabled: h || L.length > 0,
2029
+ disabled: h || te.length > 0,
1999
2030
  onClick: () => k(F + 1),
2000
2031
  style: {
2001
- ...J,
2032
+ ...q,
2002
2033
  border: 0,
2003
2034
  padding: "10px 22px",
2004
2035
  borderRadius: 8,
2005
2036
  fontSize: 15,
2006
2037
  fontWeight: 600,
2007
2038
  cursor: "pointer",
2008
- opacity: L.length ? .5 : 1
2039
+ opacity: te.length ? .5 : 1
2009
2040
  },
2010
2041
  children: "Next"
2011
2042
  }) : /* @__PURE__ */ d("button", {
2012
2043
  type: "submit",
2013
2044
  disabled: h || void 0,
2014
2045
  style: {
2015
- ...J,
2046
+ ...q,
2016
2047
  border: 0,
2017
2048
  padding: "10px 22px",
2018
2049
  borderRadius: 8,
@@ -2039,10 +2070,10 @@ function ct({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2039
2070
  ]
2040
2071
  });
2041
2072
  }
2042
- var $ = null, lt = null, ut = (e) => {
2073
+ var Q = null, mt = null, ht = (e) => {
2043
2074
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2044
- if ($ && lt === t) return $;
2045
- if ($ && typeof window < "u") {
2075
+ if (Q && mt === t) return Q;
2076
+ if (Q && typeof window < "u") {
2046
2077
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2047
2078
  delete window[e];
2048
2079
  } catch {
@@ -2050,22 +2081,22 @@ var $ = null, lt = null, ut = (e) => {
2050
2081
  }
2051
2082
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2052
2083
  }
2053
- return lt = t, $ = new Promise((e) => {
2084
+ return mt = t, Q = new Promise((e) => {
2054
2085
  if (typeof window > "u") return;
2055
2086
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2056
2087
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2057
2088
  let n = document.createElement("script");
2058
2089
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2059
- }), $;
2090
+ }), Q;
2060
2091
  };
2061
- function dt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
2062
- let p = i(H), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
2092
+ function gt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
2093
+ let p = i(V), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
2063
2094
  if (_.current = u, a(() => {
2064
2095
  if (l || !h || !g.current) return;
2065
2096
  let e = !0, i = (t) => {
2066
2097
  e && typeof _.current == "function" && _.current(t);
2067
2098
  };
2068
- return ut(r).then((r) => {
2099
+ return ht(r).then((r) => {
2069
2100
  if (!(!e || !g.current || !r?.render)) {
2070
2101
  g.current.innerHTML = "", i("");
2071
2102
  try {
@@ -2092,7 +2123,7 @@ function dt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
2092
2123
  let e = t === "dark";
2093
2124
  return /* @__PURE__ */ f("div", {
2094
2125
  ref: s,
2095
- style: C(o),
2126
+ style: D(o),
2096
2127
  children: [/* @__PURE__ */ f("div", {
2097
2128
  style: {
2098
2129
  width: n === "compact" ? 164 : 302,
@@ -2143,21 +2174,21 @@ function dt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
2143
2174
  }
2144
2175
  return h ? /* @__PURE__ */ d("div", {
2145
2176
  ref: s,
2146
- style: C(o),
2177
+ style: D(o),
2147
2178
  children: /* @__PURE__ */ d("div", { ref: g })
2148
2179
  }) : null;
2149
2180
  }
2150
- function ft({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2181
+ function _t({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2151
2182
  return /* @__PURE__ */ d("label", {
2152
2183
  ref: r,
2153
2184
  style: {
2154
- ...X,
2155
- ...C(n)
2185
+ ...Y,
2186
+ ...D(n)
2156
2187
  },
2157
- children: Y(t, e, i)
2188
+ children: J(t, e, i)
2158
2189
  });
2159
2190
  }
2160
- function pt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2191
+ function vt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2161
2192
  return /* @__PURE__ */ d("input", {
2162
2193
  ref: a,
2163
2194
  type: e,
@@ -2165,13 +2196,13 @@ function pt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2165
2196
  placeholder: n,
2166
2197
  required: !o && !!r,
2167
2198
  style: {
2168
- ...Z,
2169
- ...C(i)
2199
+ ...X,
2200
+ ...D(i)
2170
2201
  },
2171
- ...Q(o)
2202
+ ...Z(o)
2172
2203
  });
2173
2204
  }
2174
- function mt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2205
+ function yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2175
2206
  return /* @__PURE__ */ d("textarea", {
2176
2207
  ref: a,
2177
2208
  name: e || void 0,
@@ -2179,19 +2210,19 @@ function mt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2179
2210
  rows: n,
2180
2211
  required: !o && !!r,
2181
2212
  style: {
2182
- ...Z,
2213
+ ...X,
2183
2214
  resize: "vertical",
2184
- ...C(i)
2215
+ ...D(i)
2185
2216
  },
2186
- ...Q(o)
2217
+ ...Z(o)
2187
2218
  });
2188
2219
  }
2189
- function ht({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2220
+ function bt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2190
2221
  return /* @__PURE__ */ f("label", {
2191
2222
  ref: o,
2192
2223
  style: {
2193
- ...nt,
2194
- ...C(a)
2224
+ ...st,
2225
+ ...D(a)
2195
2226
  },
2196
2227
  children: [/* @__PURE__ */ d("input", {
2197
2228
  type: e,
@@ -2207,7 +2238,7 @@ function ht({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
2207
2238
  }), t]
2208
2239
  });
2209
2240
  }
2210
- function gt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2241
+ function xt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2211
2242
  return /* @__PURE__ */ f("select", {
2212
2243
  ref: a,
2213
2244
  name: e || void 0,
@@ -2216,9 +2247,9 @@ function gt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2216
2247
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
2217
2248
  tabIndex: o ? -1 : void 0,
2218
2249
  style: {
2219
- ...Z,
2250
+ ...X,
2220
2251
  appearance: "auto",
2221
- ...C(i)
2252
+ ...D(i)
2222
2253
  },
2223
2254
  children: [t !== "" && /* @__PURE__ */ d("option", {
2224
2255
  value: "",
@@ -2230,19 +2261,19 @@ function gt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2230
2261
  }, t))]
2231
2262
  });
2232
2263
  }
2233
- function _t({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2264
+ function St({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2234
2265
  let [s, c] = l(null);
2235
2266
  return /* @__PURE__ */ f("label", {
2236
2267
  ref: a,
2237
2268
  style: {
2238
- ...Z,
2269
+ ...X,
2239
2270
  display: "flex",
2240
2271
  alignItems: "center",
2241
2272
  gap: "8px",
2242
2273
  cursor: o ? "default" : "pointer",
2243
2274
  borderStyle: "dashed",
2244
2275
  color: s ? "#111827" : "#6b7280",
2245
- ...C(i)
2276
+ ...D(i)
2246
2277
  },
2247
2278
  children: [
2248
2279
  /* @__PURE__ */ d("input", {
@@ -2262,12 +2293,12 @@ function _t({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
2262
2293
  ]
2263
2294
  });
2264
2295
  }
2265
- function vt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2296
+ function Ct({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2266
2297
  return /* @__PURE__ */ d("button", {
2267
2298
  ref: n,
2268
2299
  type: r ? "button" : "submit",
2269
2300
  style: {
2270
- ...J,
2301
+ ...q,
2271
2302
  border: 0,
2272
2303
  cursor: "pointer",
2273
2304
  alignSelf: "flex-start",
@@ -2277,12 +2308,12 @@ function vt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2277
2308
  fontWeight: 600,
2278
2309
  lineHeight: 1.4,
2279
2310
  fontFamily: "inherit",
2280
- ...C(t)
2311
+ ...D(t)
2281
2312
  },
2282
2313
  children: e
2283
2314
  });
2284
2315
  }
2285
- function yt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2316
+ function wt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2286
2317
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
2287
2318
  return /* @__PURE__ */ d("div", {
2288
2319
  ref: r,
@@ -2291,7 +2322,7 @@ function yt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2291
2322
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
2292
2323
  gap: 16,
2293
2324
  width: "100%",
2294
- ...C(n)
2325
+ ...D(n)
2295
2326
  },
2296
2327
  children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ d("div", {
2297
2328
  style: { minWidth: 0 },
@@ -2299,20 +2330,28 @@ function yt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2299
2330
  }, t))
2300
2331
  });
2301
2332
  }
2302
- function bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
2303
- let { tenant: v, apiUrl: y, locale: b } = i(H), x = i(G), S = i(U), w = oe(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? W(S) : 1, [k, A] = l(null);
2333
+ function Tt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
2334
+ let { tenant: v, apiUrl: y, locale: b } = i(V), x = i(W), S = i(H), [, C] = l(0);
2335
+ a(() => {
2336
+ if (typeof window > "u") return;
2337
+ let e = () => C((e) => e + 1);
2338
+ return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
2339
+ window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
2340
+ };
2341
+ }, []);
2342
+ let w = de(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), O = E ? null : S?.[e], k = m ? U(S) : 1, [A, j] = l(null);
2304
2343
  if (a(() => {
2305
- if (!e || D) return;
2344
+ if (!e || O) return;
2306
2345
  let n = !0, r = new URLSearchParams();
2307
2346
  if (b && r.set("locale", b), E && r.set("data_filter", T), m && !e.startsWith("api:")) {
2308
2347
  let e = Math.max(1, Number(t) || 6);
2309
- r.set("offset", String((O - 1) * e)), r.set("limit", String(e));
2348
+ r.set("offset", String((k - 1) * e)), r.set("limit", String(e));
2310
2349
  }
2311
2350
  let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2312
2351
  return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
2313
2352
  let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
2314
- return n && A(t.filter((e) => e && typeof e == "object"));
2315
- }).catch(() => n && A([])), () => {
2353
+ return n && j(t.filter((e) => e && typeof e == "object"));
2354
+ }).catch(() => n && j([])), () => {
2316
2355
  n = !1;
2317
2356
  };
2318
2357
  }, [
@@ -2320,42 +2359,42 @@ function bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
2320
2359
  v,
2321
2360
  y,
2322
2361
  b,
2323
- D,
2324
- m,
2325
2362
  O,
2363
+ m,
2364
+ k,
2326
2365
  t,
2327
2366
  E,
2328
2367
  T
2329
2368
  ]), !e) return null;
2330
- let j = Math.max(1, Number(t) || 6), M = m ? D || e.startsWith("api:") ? (D ?? k ?? []).slice((O - 1) * j, O * j) : (k ?? []).slice(0, j) : (D ?? k ?? []).slice(0, j), N = Math.min(Math.max(Number(r) || 3, 1), 6), P = n === "list" ? {
2369
+ let M = Math.max(1, Number(t) || 6), N = m ? O || e.startsWith("api:") ? (O ?? A ?? []).slice((k - 1) * M, k * M) : (A ?? []).slice(0, M) : (O ?? A ?? []).slice(0, M), P = Math.min(Math.max(Number(r) || 3, 1), 6), F = n === "list" ? {
2331
2370
  display: "flex",
2332
2371
  flexDirection: "column",
2333
2372
  gap: 20
2334
2373
  } : {
2335
2374
  display: "grid",
2336
- gridTemplateColumns: `repeat(${N}, minmax(0, 1fr))`,
2375
+ gridTemplateColumns: `repeat(${P}, minmax(0, 1fr))`,
2337
2376
  gap: 24
2338
2377
  };
2339
2378
  return u && p && x?.render ? /* @__PURE__ */ d("div", {
2340
2379
  ref: _,
2341
2380
  style: {
2342
2381
  width: "100%",
2343
- ...P,
2344
- ...C(g)
2382
+ ...F,
2383
+ ...D(g)
2345
2384
  },
2346
- children: M.map((e) => /* @__PURE__ */ d("div", {
2385
+ children: N.map((e) => /* @__PURE__ */ d("div", {
2347
2386
  style: { minWidth: 0 },
2348
- children: x.render(p, (t) => le(t, e))
2387
+ children: x.render(p, (t) => me(t, e))
2349
2388
  }, e.id ?? e?.data?.slug))
2350
2389
  }) : /* @__PURE__ */ d("div", {
2351
2390
  ref: _,
2352
2391
  style: {
2353
2392
  width: "100%",
2354
- ...P,
2355
- ...C(g)
2393
+ ...F,
2394
+ ...D(g)
2356
2395
  },
2357
- children: M.map((e) => {
2358
- let t = o ? K(e?.data, o) : null, r = s ? q(K(e?.data, s)) : null, i = c ? K(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : q(i), u = n === "list";
2396
+ children: N.map((e) => {
2397
+ let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = c ? G(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : K(i), u = n === "list";
2359
2398
  return /* @__PURE__ */ f("div", {
2360
2399
  style: {
2361
2400
  display: "flex",
@@ -2402,7 +2441,7 @@ function bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
2402
2441
  lineHeight: 1.55,
2403
2442
  opacity: .85
2404
2443
  },
2405
- children: Te(a)
2444
+ children: Ae(a)
2406
2445
  })
2407
2446
  ]
2408
2447
  })]
@@ -2410,8 +2449,8 @@ function bt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
2410
2449
  })
2411
2450
  });
2412
2451
  }
2413
- function xt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
2414
- let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : ae(), s = {
2452
+ function Et({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
2453
+ let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : ue(), s = {
2415
2454
  height: 34,
2416
2455
  padding: "0 12px",
2417
2456
  borderRadius: 8,
@@ -2434,20 +2473,32 @@ function xt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2434
2473
  return /* @__PURE__ */ f("form", {
2435
2474
  ref: r,
2436
2475
  method: "get",
2437
- onSubmit: i ? (e) => e.preventDefault() : void 0,
2476
+ onSubmit: (e) => {
2477
+ if (i) {
2478
+ e.preventDefault();
2479
+ return;
2480
+ }
2481
+ if (typeof window > "u" || !window.history?.pushState) return;
2482
+ e.preventDefault();
2483
+ let t = new URLSearchParams(window.location.search);
2484
+ for (let e of [...t.keys()]) (e.startsWith("f_") || e === "page") && t.delete(e);
2485
+ for (let [n, r] of new FormData(e.currentTarget).entries()) n.startsWith("f_") && typeof r == "string" && r.trim() !== "" && t.set(n, r);
2486
+ let n = t.toString();
2487
+ window.history.pushState({}, "", `${window.location.pathname}${n ? `?${n}` : ""}`), window.dispatchEvent(new Event("webim:urlchange"));
2488
+ },
2438
2489
  style: {
2439
2490
  display: "flex",
2440
2491
  flexWrap: "wrap",
2441
2492
  alignItems: "center",
2442
2493
  gap: 8,
2443
2494
  width: "100%",
2444
- ...C(n)
2495
+ ...D(n)
2445
2496
  },
2446
2497
  children: [a.map((e) => Array.isArray(e.options) && e.options.length > 0 || e.type === "option" || e.type === "select" ? /* @__PURE__ */ f("select", {
2447
2498
  name: `f_${e.name}`,
2448
2499
  defaultValue: o[e.name] ?? "",
2449
2500
  style: s,
2450
- ...Q(i),
2501
+ ...Z(i),
2451
2502
  children: [/* @__PURE__ */ d("option", {
2452
2503
  value: "",
2453
2504
  children: e.label || e.name
@@ -2462,7 +2513,7 @@ function xt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2462
2513
  name: `f_${e.name}`,
2463
2514
  defaultValue: o[e.name] ?? "",
2464
2515
  style: s,
2465
- ...Q(i),
2516
+ ...Z(i),
2466
2517
  children: [
2467
2518
  /* @__PURE__ */ d("option", {
2468
2519
  value: "",
@@ -2483,7 +2534,7 @@ function xt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2483
2534
  defaultValue: o[e.name] ?? "",
2484
2535
  placeholder: e.label || e.name,
2485
2536
  style: s,
2486
- ...Q(i)
2537
+ ...Z(i)
2487
2538
  }, e.name)), /* @__PURE__ */ d("button", {
2488
2539
  type: "submit",
2489
2540
  style: {
@@ -2496,16 +2547,16 @@ function xt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2496
2547
  fontWeight: 600,
2497
2548
  cursor: i ? "default" : "pointer"
2498
2549
  },
2499
- ...Q(i),
2550
+ ...Z(i),
2500
2551
  children: t
2501
2552
  })]
2502
2553
  });
2503
2554
  }
2504
- function St({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2555
+ function Dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2505
2556
  return e.length ? /* @__PURE__ */ d("nav", {
2506
2557
  ref: r,
2507
2558
  "aria-label": "Breadcrumb",
2508
- style: { ...C(n) },
2559
+ style: { ...D(n) },
2509
2560
  children: /* @__PURE__ */ d("ol", {
2510
2561
  style: {
2511
2562
  display: "flex",
@@ -2551,8 +2602,8 @@ function St({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2551
2602
  })
2552
2603
  }) : null;
2553
2604
  }
2554
- function Ct({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
2555
- let { tenant: g, apiUrl: _ } = i(H), v = i(U), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
2605
+ function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
2606
+ let { tenant: g, apiUrl: _ } = i(V), v = i(H), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
2556
2607
  a(() => {
2557
2608
  if (!o || Number.isFinite(x)) return;
2558
2609
  let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
@@ -2569,9 +2620,9 @@ function Ct({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
2569
2620
  _,
2570
2621
  x
2571
2622
  ]);
2572
- let S = Math.max(1, Number(s) || 6), w = Number.isFinite(x) ? x : y;
2573
- if (o && w === null || o && u && !(w > 0)) return null;
2574
- let T = Math.min(Math.max(o ? Math.ceil(w / S) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? W(v) : Number(t) || 1, 1), T), D = (e) => {
2623
+ let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
2624
+ if (o && C === null || o && u && !(C > 0)) return null;
2625
+ let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? U(v) : Number(t) || 1, 1), w), E = (e) => {
2575
2626
  if (o) {
2576
2627
  if (typeof window < "u") {
2577
2628
  let t = new URLSearchParams(window.location.search);
@@ -2603,48 +2654,48 @@ function Ct({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
2603
2654
  gap: 8,
2604
2655
  alignItems: "center",
2605
2656
  justifyContent: O,
2606
- ...C(m)
2657
+ ...D(m)
2607
2658
  },
2608
2659
  children: [
2609
2660
  n && /* @__PURE__ */ d("a", {
2610
- href: E > 1 ? D(E - 1) : "#",
2661
+ href: T > 1 ? E(T - 1) : "#",
2611
2662
  onClick: k,
2612
2663
  "aria-label": "Previous",
2613
2664
  style: {
2614
2665
  ...A(!1),
2615
- opacity: E > 1 ? 1 : .4
2666
+ opacity: T > 1 ? 1 : .4
2616
2667
  },
2617
2668
  children: "‹"
2618
2669
  }),
2619
- Array.from({ length: T }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
2620
- href: D(e),
2670
+ Array.from({ length: w }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
2671
+ href: E(e),
2621
2672
  onClick: k,
2622
- "aria-current": e === E ? "page" : void 0,
2623
- style: A(e === E),
2673
+ "aria-current": e === T ? "page" : void 0,
2674
+ style: A(e === T),
2624
2675
  children: e
2625
2676
  }, e)),
2626
2677
  n && /* @__PURE__ */ d("a", {
2627
- href: E < T ? D(E + 1) : "#",
2678
+ href: T < w ? E(T + 1) : "#",
2628
2679
  onClick: k,
2629
2680
  "aria-label": "Next",
2630
2681
  style: {
2631
2682
  ...A(!1),
2632
- opacity: E < T ? 1 : .4
2683
+ opacity: T < w ? 1 : .4
2633
2684
  },
2634
2685
  children: "›"
2635
2686
  })
2636
2687
  ]
2637
2688
  });
2638
2689
  }
2639
- var wt = "webim.page_mode", Tt = () => {
2690
+ var kt = "webim.page_mode", At = () => {
2640
2691
  if (typeof window > "u") return "auto";
2641
2692
  try {
2642
- let e = window.localStorage.getItem(wt);
2693
+ let e = window.localStorage.getItem(kt);
2643
2694
  return e === "light" || e === "dark" ? e : "auto";
2644
2695
  } catch {
2645
2696
  return "auto";
2646
2697
  }
2647
- }, Et = (e) => {
2698
+ }, jt = (e) => {
2648
2699
  let t = {
2649
2700
  width: 16,
2650
2701
  height: 16,
@@ -2676,13 +2727,13 @@ var wt = "webim.page_mode", Tt = () => {
2676
2727
  rx: "2"
2677
2728
  }), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
2678
2729
  });
2679
- }, Dt = {
2730
+ }, $ = {
2680
2731
  light: "Light theme",
2681
2732
  dark: "Dark theme",
2682
2733
  auto: "Follow the device theme"
2683
2734
  };
2684
- function Ot({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
2685
- let [o, s] = l(i ? "auto" : Tt), u = c(null), f = (e) => {
2735
+ function Mt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
2736
+ let [o, s] = l(i ? "auto" : At), u = c(null), f = (e) => {
2686
2737
  u.current = e, typeof r == "function" && r(e);
2687
2738
  };
2688
2739
  a(() => {
@@ -2690,7 +2741,7 @@ function Ot({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
2690
2741
  let e = u.current?.closest?.(".webim-page");
2691
2742
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
2692
2743
  try {
2693
- o === "auto" ? window.localStorage.removeItem(wt) : window.localStorage.setItem(wt, o);
2744
+ o === "auto" ? window.localStorage.removeItem(kt) : window.localStorage.setItem(kt, o);
2694
2745
  } catch {}
2695
2746
  }, [o, i]);
2696
2747
  let p = t === !1 ? ["light", "dark"] : [
@@ -2721,12 +2772,12 @@ function Ot({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
2721
2772
  padding: 3,
2722
2773
  borderRadius: 999,
2723
2774
  border: "1px solid rgba(148, 163, 184, 0.4)",
2724
- ...C(n)
2775
+ ...D(n)
2725
2776
  },
2726
2777
  children: p.map((e) => /* @__PURE__ */ d("button", {
2727
2778
  type: "button",
2728
- title: Dt[e],
2729
- "aria-label": Dt[e],
2779
+ title: $[e],
2780
+ "aria-label": $[e],
2730
2781
  "aria-pressed": e === m,
2731
2782
  onClick: i ? void 0 : () => s(e),
2732
2783
  style: {
@@ -2737,27 +2788,27 @@ function Ot({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
2737
2788
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
2738
2789
  opacity: e === m ? 1 : .7
2739
2790
  },
2740
- children: Et(e)
2791
+ children: jt(e)
2741
2792
  }, e))
2742
2793
  });
2743
2794
  let g = p[(p.indexOf(m) + 1) % p.length];
2744
2795
  return /* @__PURE__ */ d("button", {
2745
2796
  ref: f,
2746
2797
  type: "button",
2747
- title: Dt[m],
2748
- "aria-label": `Theme: ${Dt[m]} — switch to ${Dt[g]}`,
2798
+ title: $[m],
2799
+ "aria-label": `Theme: ${$[m]} — switch to ${$[g]}`,
2749
2800
  onClick: i ? void 0 : () => s(g),
2750
2801
  style: {
2751
2802
  ...h,
2752
2803
  width: 36,
2753
2804
  height: 36,
2754
2805
  border: "1px solid rgba(148, 163, 184, 0.4)",
2755
- ...C(n)
2806
+ ...D(n)
2756
2807
  },
2757
- children: Et(m)
2808
+ children: jt(m)
2758
2809
  });
2759
2810
  }
2760
- var kt = {
2811
+ var Nt = {
2761
2812
  facebook: {
2762
2813
  label: "Facebook",
2763
2814
  color: "#1877f2",
@@ -2824,8 +2875,8 @@ var kt = {
2824
2875
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
2825
2876
  }
2826
2877
  };
2827
- function At({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
2828
- let l = Array.isArray(e) ? e.filter((e) => e && kt[e.network]) : [];
2878
+ function Pt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
2879
+ let l = Array.isArray(e) ? e.filter((e) => e && Nt[e.network]) : [];
2829
2880
  if (!l.length) return null;
2830
2881
  let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
2831
2882
  return /* @__PURE__ */ d("div", {
@@ -2835,10 +2886,10 @@ function At({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
2835
2886
  flexWrap: "wrap",
2836
2887
  alignItems: "center",
2837
2888
  gap: p,
2838
- ...C(o)
2889
+ ...D(o)
2839
2890
  },
2840
2891
  children: l.map((e, r) => {
2841
- let i = kt[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
2892
+ let i = Nt[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
2842
2893
  return /* @__PURE__ */ d("a", {
2843
2894
  href: e.url || "#",
2844
2895
  onClick: h,
@@ -2872,7 +2923,7 @@ function At({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
2872
2923
  })
2873
2924
  });
2874
2925
  }
2875
- function jt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2926
+ function Ft({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2876
2927
  if (!e.length) return null;
2877
2928
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
2878
2929
  width: 32,
@@ -2910,7 +2961,7 @@ function jt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2910
2961
  flexDirection: r ? "column" : "row",
2911
2962
  alignItems: r ? "stretch" : "flex-start",
2912
2963
  gap: r ? 4 : 8,
2913
- ...C(i)
2964
+ ...D(i)
2914
2965
  },
2915
2966
  children: e.map((e, n) => {
2916
2967
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
@@ -2950,7 +3001,7 @@ function jt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2950
3001
  })
2951
3002
  });
2952
3003
  }
2953
- var Mt = {
3004
+ var It = {
2954
3005
  small: {
2955
3006
  w: 132,
2956
3007
  h: 46,
@@ -2972,10 +3023,10 @@ var Mt = {
2972
3023
  title: 12.5,
2973
3024
  avatar: 46
2974
3025
  }
2975
- }, Nt = (e) => Mt[e] ?? Mt.medium;
2976
- Mt.medium.w, Mt.medium.h;
2977
- function Pt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2978
- let r = Nt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
3026
+ }, Lt = (e) => It[e] ?? It.medium;
3027
+ It.medium.w, It.medium.h;
3028
+ function Rt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3029
+ let r = Lt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2979
3030
  for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
2980
3031
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2981
3032
  if (t.has(e.id)) return 0;
@@ -3027,19 +3078,19 @@ function Pt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3027
3078
  horizontal: n
3028
3079
  };
3029
3080
  }
3030
- var Ft = (e, t) => {
3081
+ var zt = (e, t) => {
3031
3082
  let n = String(e ?? "");
3032
3083
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3033
- }, It = (e) => {
3084
+ }, Bt = (e) => {
3034
3085
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3035
3086
  if (!t) return "#ffffff";
3036
3087
  let n = t[1];
3037
3088
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3038
3089
  let r = parseInt(n, 16);
3039
3090
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3040
- }, Lt = (e) => !!(e?.cv?.trim?.() || e?.photo);
3041
- function Rt(e, t = {}) {
3042
- let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : q(e);
3091
+ }, Vt = (e) => !!(e?.cv?.trim?.() || e?.photo);
3092
+ function Ht(e, t = {}) {
3093
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
3043
3094
  return n.map((e) => {
3044
3095
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
3045
3096
  return {
@@ -3053,11 +3104,11 @@ function Rt(e, t = {}) {
3053
3104
  };
3054
3105
  });
3055
3106
  }
3056
- var zt = {
3107
+ var Ut = {
3057
3108
  size: 36,
3058
3109
  pad: 10
3059
3110
  };
3060
- function Bt({ node: e, onClose: t }) {
3111
+ function Wt({ node: e, onClose: t }) {
3061
3112
  return a(() => {
3062
3113
  let e = (e) => e.key === "Escape" && t();
3063
3114
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -3070,7 +3121,9 @@ function Bt({ node: e, onClose: t }) {
3070
3121
  position: "fixed",
3071
3122
  inset: 0,
3072
3123
  zIndex: 1e3,
3073
- background: "rgba(15, 23, 42, 0.55)",
3124
+ background: "rgba(2, 6, 23, 0.6)",
3125
+ backdropFilter: "blur(4px)",
3126
+ WebkitBackdropFilter: "blur(4px)",
3074
3127
  display: "flex",
3075
3128
  alignItems: "center",
3076
3129
  justifyContent: "center",
@@ -3081,6 +3134,7 @@ function Bt({ node: e, onClose: t }) {
3081
3134
  style: {
3082
3135
  background: "var(--page-bg, #ffffff)",
3083
3136
  color: "var(--page-text, #111827)",
3137
+ border: "1px solid rgba(148, 163, 184, 0.35)",
3084
3138
  borderRadius: 14,
3085
3139
  maxWidth: 420,
3086
3140
  width: "100%",
@@ -3088,7 +3142,7 @@ function Bt({ node: e, onClose: t }) {
3088
3142
  overflowY: "auto",
3089
3143
  padding: 24,
3090
3144
  position: "relative",
3091
- boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
3145
+ boxShadow: "0 24px 64px rgba(2, 6, 23, 0.5)"
3092
3146
  },
3093
3147
  children: [
3094
3148
  /* @__PURE__ */ d("button", {
@@ -3175,12 +3229,12 @@ function Bt({ node: e, onClose: t }) {
3175
3229
  })
3176
3230
  });
3177
3231
  }
3178
- function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
3179
- let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
3232
+ function Gt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
3233
+ let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(V), T = i(H)?.[t], [E, O] = l(null);
3180
3234
  a(() => {
3181
- if (!t || E) return;
3235
+ if (!t || T) return;
3182
3236
  let e = !0;
3183
- return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
3237
+ return fetch(`${w}/dynamic/${encodeURIComponent(t)}`, { headers: C ? { "x-tenant": C } : {} }).then((e) => e.json()).then((t) => {
3184
3238
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
3185
3239
  e && O(n);
3186
3240
  }).catch(() => e && O([])), () => {
@@ -3188,18 +3242,18 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3188
3242
  };
3189
3243
  }, [
3190
3244
  t,
3245
+ C,
3191
3246
  w,
3192
- T,
3193
- E
3247
+ T
3194
3248
  ]);
3195
- let k = t ? Rt(E ?? D ?? [], {
3249
+ let k = t ? Ht(T ?? E ?? [], {
3196
3250
  nameField: n,
3197
3251
  titleField: r,
3198
3252
  photoField: s,
3199
3253
  parentField: c,
3200
3254
  cvField: p,
3201
3255
  hrefField: m
3202
- }) : e, A = Nt(h), { boxes: j, links: M, width: N, height: P } = Pt(k, {
3256
+ }) : e, A = Lt(h), { boxes: j, links: M, width: N, height: P } = Rt(k, {
3203
3257
  size: h,
3204
3258
  horizontal: g
3205
3259
  });
@@ -3212,7 +3266,7 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3212
3266
  fontSize: 13,
3213
3267
  opacity: .7,
3214
3268
  textAlign: "center",
3215
- ...C(_)
3269
+ ...D(_)
3216
3270
  },
3217
3271
  children: [
3218
3272
  "Org Chart — no published entries in “",
@@ -3226,7 +3280,7 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3226
3280
  style: {
3227
3281
  maxWidth: "100%",
3228
3282
  overflowX: "auto",
3229
- ...C(_)
3283
+ ...D(_)
3230
3284
  },
3231
3285
  children: [/* @__PURE__ */ f("svg", {
3232
3286
  viewBox: `0 0 ${N} ${P}`,
@@ -3245,7 +3299,7 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3245
3299
  stroke: "rgba(148, 163, 184, 0.7)",
3246
3300
  strokeWidth: "1.5"
3247
3301
  }, t)), j.map(({ node: e, x: t, y: n }) => {
3248
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? It(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? It(e.color2) : s, l = y && (Lt(e) || e.href), p = () => Lt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + zt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
3302
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Bt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Bt(e.color2) : s, l = y && (Vt(e) || e.href), p = () => Vt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Ut.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
3249
3303
  return /* @__PURE__ */ f("g", {
3250
3304
  onClick: l ? p : void 0,
3251
3305
  style: l ? { cursor: "pointer" } : void 0,
@@ -3309,13 +3363,13 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3309
3363
  e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
3310
3364
  id: `${b}-${e.id}`,
3311
3365
  children: /* @__PURE__ */ d("circle", {
3312
- cx: t + zt.pad + A.avatar / 2,
3366
+ cx: t + Ut.pad + A.avatar / 2,
3313
3367
  cy: n + A.h / 2,
3314
3368
  r: A.avatar / 2
3315
3369
  })
3316
3370
  }), /* @__PURE__ */ d("image", {
3317
3371
  href: e.photo,
3318
- x: t + zt.pad,
3372
+ x: t + Ut.pad,
3319
3373
  y: n + (A.h - A.avatar) / 2,
3320
3374
  width: A.avatar,
3321
3375
  height: A.avatar,
@@ -3329,7 +3383,7 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3329
3383
  fontSize: A.title,
3330
3384
  fontWeight: "600",
3331
3385
  fill: s,
3332
- children: Ft(e.title, g + 4)
3386
+ children: zt(e.title, g + 4)
3333
3387
  }), e.name && /* @__PURE__ */ d("text", {
3334
3388
  x: m,
3335
3389
  y: n + _ + _ / 2 + A.name * .35,
@@ -3337,7 +3391,7 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3337
3391
  fontSize: A.name,
3338
3392
  fontWeight: "600",
3339
3393
  fill: c,
3340
- children: Ft(e.name, g)
3394
+ children: zt(e.name, g)
3341
3395
  })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
3342
3396
  x: m,
3343
3397
  y: n + (v[1] ? A.h * .43 : A.h * .57),
@@ -3345,7 +3399,7 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3345
3399
  fontSize: A.name,
3346
3400
  fontWeight: "600",
3347
3401
  fill: s,
3348
- children: Ft(v[0], g)
3402
+ children: zt(v[0], g)
3349
3403
  }), v[1] && /* @__PURE__ */ d("text", {
3350
3404
  x: m,
3351
3405
  y: n + A.h * .73,
@@ -3353,19 +3407,19 @@ function Vt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
3353
3407
  fontSize: A.title,
3354
3408
  opacity: "0.7",
3355
3409
  fill: s,
3356
- children: Ft(v[1], g + 4)
3410
+ children: zt(v[1], g + 4)
3357
3411
  })] })
3358
3412
  ]
3359
3413
  }, e.id);
3360
3414
  })]
3361
- }), x && /* @__PURE__ */ d(Bt, {
3415
+ }), x && /* @__PURE__ */ d(Wt, {
3362
3416
  node: x,
3363
3417
  onClose: () => S(null)
3364
3418
  })]
3365
3419
  });
3366
3420
  }
3367
- function Ht({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
3368
- let { tenant: g, apiUrl: _ } = i(H), v = i(U), y = v?.[n], b = u ? W(v) : 1, [x, S] = l(null);
3421
+ function Kt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
3422
+ let { tenant: g, apiUrl: _ } = i(V), v = i(H), y = v?.[n], b = u ? U(v) : 1, [x, S] = l(null);
3369
3423
  if (a(() => {
3370
3424
  if (!n || y) return;
3371
3425
  let e = !0, t = Math.max(1, Number(r) || 10), i = u && !n.startsWith("api:") ? `?offset=${(b - 1) * t}&limit=${t}` : "", a = n.startsWith("api:") ? `${_}/data/${encodeURIComponent(n.slice(4))}` : `${_}/dynamic/${encodeURIComponent(n)}${i}`;
@@ -3384,13 +3438,13 @@ function Ht({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
3384
3438
  b,
3385
3439
  r
3386
3440
  ]), !e.length) return null;
3387
- let w = Math.max(1, Number(r) || 10), T = n ? u ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * w, b * w) : (x ?? []).slice(0, w) : (y ?? x ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => q(K(t?.data, e.field)))) : t, D = !!n && !(n && !y && x === null) && E.length === 0, O = c ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
3441
+ let C = Math.max(1, Number(r) || 10), w = n ? u ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * C, b * C) : (x ?? []).slice(0, C) : (y ?? x ?? []).slice(0, C) : null, T = w ? w.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, E = !!n && !(n && !y && x === null) && T.length === 0, O = c ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
3388
3442
  return /* @__PURE__ */ d("div", {
3389
3443
  ref: h,
3390
3444
  style: {
3391
3445
  width: "100%",
3392
3446
  overflowX: "auto",
3393
- ...C(m)
3447
+ ...D(m)
3394
3448
  },
3395
3449
  children: /* @__PURE__ */ f("table", {
3396
3450
  style: {
@@ -3408,7 +3462,7 @@ function Ht({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
3408
3462
  ...A
3409
3463
  },
3410
3464
  children: e.label ?? e
3411
- }, t)) }) }), /* @__PURE__ */ f("tbody", { children: [D && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
3465
+ }, t)) }) }), /* @__PURE__ */ f("tbody", { children: [E && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
3412
3466
  colSpan: e.length,
3413
3467
  style: {
3414
3468
  padding: O,
@@ -3417,7 +3471,7 @@ function Ht({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
3417
3471
  ...A
3418
3472
  },
3419
3473
  children: p || "No data yet"
3420
- }) }), E.map((t, n) => /* @__PURE__ */ d("tr", {
3474
+ }) }), T.map((t, n) => /* @__PURE__ */ d("tr", {
3421
3475
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
3422
3476
  children: e.map((e, n) => /* @__PURE__ */ d("td", {
3423
3477
  style: {
@@ -3430,79 +3484,79 @@ function Ht({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
3430
3484
  })
3431
3485
  });
3432
3486
  }
3433
- var Ut = {
3434
- PageRoot: ge,
3435
- Section: _e,
3436
- Container: ve,
3437
- Heading: ye,
3438
- TextBlock: Ae,
3439
- ButtonBlock: Ne,
3440
- ImageBlock: Pe,
3441
- Spacer: Be,
3442
- Divider: Ve,
3443
- SliderBlock: qe,
3444
- CanvasSlider: Je,
3445
- TabsBlock: $e,
3446
- QuickStack: yt,
3447
- CollectionList: bt,
3448
- CollectionSearch: xt,
3449
- BreadcrumbsBlock: St,
3450
- PaginationBlock: Ct,
3451
- StepperBlock: jt,
3452
- SocialLinksBlock: At,
3453
- ThemeModeBlock: Ot,
3454
- OrgChartBlock: Vt,
3455
- TableBlock: Ht,
3456
- MasonryBlock: Ye,
3457
- AccordionBlock: et,
3458
- NavbarBlock: Qe,
3459
- ListBlock: ke,
3460
- TextSpan: Se,
3461
- QuoteBlock: Oe,
3462
- TextLink: Me,
3463
- RichTextBlock: Ee,
3464
- RichContentBlock: Ee,
3465
- VideoBlock: Fe,
3466
- YouTubeBlock: Le,
3467
- IframeBlock: Re,
3468
- EmbedBlock: ze,
3469
- FormBlock: ct,
3470
- FormLabel: ft,
3471
- FormInput: pt,
3472
- FormTextarea: mt,
3473
- FormCheckbox: (e) => /* @__PURE__ */ d(ht, {
3487
+ var qt = {
3488
+ PageRoot: xe,
3489
+ Section: Se,
3490
+ Container: Ce,
3491
+ Heading: we,
3492
+ TextBlock: Fe,
3493
+ ButtonBlock: Re,
3494
+ ImageBlock: ze,
3495
+ Spacer: Ge,
3496
+ Divider: Ke,
3497
+ SliderBlock: Qe,
3498
+ CanvasSlider: $e,
3499
+ TabsBlock: it,
3500
+ QuickStack: wt,
3501
+ CollectionList: Tt,
3502
+ CollectionSearch: Et,
3503
+ BreadcrumbsBlock: Dt,
3504
+ PaginationBlock: Ot,
3505
+ StepperBlock: Ft,
3506
+ SocialLinksBlock: Pt,
3507
+ ThemeModeBlock: Mt,
3508
+ OrgChartBlock: Gt,
3509
+ TableBlock: Kt,
3510
+ MasonryBlock: et,
3511
+ AccordionBlock: at,
3512
+ NavbarBlock: rt,
3513
+ ListBlock: Pe,
3514
+ TextSpan: De,
3515
+ QuoteBlock: Ne,
3516
+ TextLink: Le,
3517
+ RichTextBlock: je,
3518
+ RichContentBlock: je,
3519
+ VideoBlock: Be,
3520
+ YouTubeBlock: He,
3521
+ IframeBlock: Ue,
3522
+ EmbedBlock: We,
3523
+ FormBlock: pt,
3524
+ FormLabel: _t,
3525
+ FormInput: vt,
3526
+ FormTextarea: yt,
3527
+ FormCheckbox: (e) => /* @__PURE__ */ d(bt, {
3474
3528
  kind: "checkbox",
3475
3529
  ...e
3476
3530
  }),
3477
- FormRadio: (e) => /* @__PURE__ */ d(ht, {
3531
+ FormRadio: (e) => /* @__PURE__ */ d(bt, {
3478
3532
  kind: "radio",
3479
3533
  ...e
3480
3534
  }),
3481
- FormSelect: gt,
3482
- FormFile: _t,
3483
- FormRecaptcha: dt,
3484
- FormSubmit: vt
3485
- }, Wt = {
3535
+ FormSelect: xt,
3536
+ FormFile: St,
3537
+ FormRecaptcha: gt,
3538
+ FormSubmit: Ct
3539
+ }, Jt = {
3486
3540
  id: "auth",
3487
3541
  label: "Accounts",
3488
3542
  category: "Apps",
3489
3543
  keys: ["SiteLoginForm", "SiteAccountMenu"],
3490
3544
  ssr: "shell",
3491
3545
  settings: ["site.authRedirect"]
3492
- }, Gt = n({
3546
+ }, Yt = n({
3493
3547
  user: null,
3494
3548
  status: "idle",
3495
3549
  ensure: () => {},
3496
3550
  refresh: () => {},
3497
3551
  signOut: () => {}
3498
- }), Kt = () => {
3499
- let e = i(Gt);
3552
+ }), Xt = () => {
3553
+ let e = i(Yt);
3500
3554
  return a(() => {
3501
3555
  e.ensure();
3502
3556
  }, [e]), e;
3503
3557
  };
3504
- function qt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
3505
- let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
3558
+ function Zt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
3559
+ let u = i(V), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
3506
3560
  ...t,
3507
3561
  credentials: "include",
3508
3562
  headers: {
@@ -3534,24 +3588,24 @@ function qt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o })
3534
3588
  b,
3535
3589
  x
3536
3590
  ]);
3537
- return /* @__PURE__ */ d(Gt.Provider, {
3591
+ return /* @__PURE__ */ d(Yt.Provider, {
3538
3592
  value: C,
3539
3593
  children: e
3540
3594
  });
3541
3595
  }
3542
- function Jt({ when: e, children: t }) {
3543
- let { status: n } = Kt();
3596
+ function Qt({ when: e, children: t }) {
3597
+ let { status: n } = Xt();
3544
3598
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
3545
3599
  }
3546
3600
  //#endregion
3547
3601
  //#region ../ui/src/components/builder/apps/auth/views.jsx
3548
- function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
3549
- let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3602
+ function $t({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
3603
+ let { tenant: h, apiUrl: g, settings: _ } = i(V), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3550
3604
  if (e.preventDefault(), u) return;
3551
3605
  let n = new FormData(e.currentTarget);
3552
- w(!0), x("");
3606
+ C(!0), x("");
3553
3607
  try {
3554
- let e = await fetch(`${g || "/api"}/site/${T ? "register" : "login"}`, {
3608
+ let e = await fetch(`${g || "/api"}/site/${w ? "register" : "login"}`, {
3555
3609
  method: "post",
3556
3610
  headers: {
3557
3611
  "content-type": "application/json",
@@ -3561,19 +3615,19 @@ function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3561
3615
  body: JSON.stringify({
3562
3616
  email: n.get("email"),
3563
3617
  password: n.get("password"),
3564
- ...T ? { name: n.get("name") || "" } : {}
3618
+ ...w ? { name: n.get("name") || "" } : {}
3565
3619
  })
3566
3620
  }), r = await e.json().catch(() => null);
3567
3621
  if (!e.ok || r?.success === !1) {
3568
- x(r?.error?.message || "Sign-in failed"), y("error"), w(!1);
3622
+ x(r?.error?.message || "Sign-in failed"), y("error"), C(!1);
3569
3623
  return;
3570
3624
  }
3571
3625
  if (y("success"), typeof window < "u") {
3572
- let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(_?.["site.authRedirect"]) || D(_?.["apps.auth.redirect"]) || "/";
3626
+ let e = E(t) || E(new URLSearchParams(window.location.search).get("next")) || E(_?.["site.authRedirect"]) || E(_?.["apps.auth.redirect"]) || "/";
3573
3627
  window.location.assign(e);
3574
3628
  }
3575
3629
  } catch {
3576
- x("Sign-in failed"), y("error"), w(!1);
3630
+ x("Sign-in failed"), y("error"), C(!1);
3577
3631
  }
3578
3632
  };
3579
3633
  return /* @__PURE__ */ f("div", {
@@ -3582,32 +3636,32 @@ function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3582
3636
  display: "grid",
3583
3637
  gap: 12,
3584
3638
  maxWidth: 360,
3585
- ...C(s)
3639
+ ...D(s)
3586
3640
  },
3587
3641
  children: [
3588
3642
  /* @__PURE__ */ f("form", {
3589
3643
  onSubmit: O,
3590
3644
  style: {
3591
- display: E === "form" ? "grid" : "none",
3645
+ display: T === "form" ? "grid" : "none",
3592
3646
  gap: 10
3593
3647
  },
3594
3648
  children: [
3595
- T ? /* @__PURE__ */ f("label", {
3649
+ w ? /* @__PURE__ */ f("label", {
3596
3650
  style: {
3597
- ...X,
3651
+ ...Y,
3598
3652
  display: "grid",
3599
3653
  gap: 6
3600
3654
  },
3601
3655
  children: [a, /* @__PURE__ */ d("input", {
3602
3656
  name: "name",
3603
3657
  type: "text",
3604
- style: Z,
3605
- ...Q(u)
3658
+ style: X,
3659
+ ...Z(u)
3606
3660
  })]
3607
3661
  }) : null,
3608
3662
  /* @__PURE__ */ f("label", {
3609
3663
  style: {
3610
- ...X,
3664
+ ...Y,
3611
3665
  display: "grid",
3612
3666
  gap: 6
3613
3667
  },
@@ -3615,13 +3669,13 @@ function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3615
3669
  name: "email",
3616
3670
  type: "email",
3617
3671
  required: !u,
3618
- style: Z,
3619
- ...Q(u)
3672
+ style: X,
3673
+ ...Z(u)
3620
3674
  })]
3621
3675
  }),
3622
3676
  /* @__PURE__ */ f("label", {
3623
3677
  style: {
3624
- ...X,
3678
+ ...Y,
3625
3679
  display: "grid",
3626
3680
  gap: 6
3627
3681
  },
@@ -3629,15 +3683,15 @@ function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3629
3683
  name: "password",
3630
3684
  type: "password",
3631
3685
  required: !u,
3632
- style: Z,
3633
- ...Q(u)
3686
+ style: X,
3687
+ ...Z(u)
3634
3688
  })]
3635
3689
  }),
3636
3690
  /* @__PURE__ */ d("button", {
3637
3691
  type: u ? "button" : "submit",
3638
3692
  disabled: S || void 0,
3639
3693
  style: {
3640
- ...J,
3694
+ ...q,
3641
3695
  border: 0,
3642
3696
  padding: "10px 22px",
3643
3697
  borderRadius: 8,
@@ -3646,7 +3700,7 @@ function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3646
3700
  cursor: "pointer",
3647
3701
  opacity: S ? .6 : 1
3648
3702
  },
3649
- children: o || (T ? "Create account" : "Sign in")
3703
+ children: o || (w ? "Create account" : "Sign in")
3650
3704
  }),
3651
3705
  b ? /* @__PURE__ */ d("p", {
3652
3706
  style: {
@@ -3659,18 +3713,18 @@ function Yt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3659
3713
  ]
3660
3714
  }),
3661
3715
  /* @__PURE__ */ d("div", {
3662
- style: { display: E === "success" ? "block" : "none" },
3716
+ style: { display: T === "success" ? "block" : "none" },
3663
3717
  children: p?.success ?? null
3664
3718
  }),
3665
3719
  /* @__PURE__ */ d("div", {
3666
- style: { display: E === "error" ? "block" : "none" },
3720
+ style: { display: T === "error" ? "block" : "none" },
3667
3721
  children: p?.error ?? null
3668
3722
  })
3669
3723
  ]
3670
3724
  });
3671
3725
  }
3672
- function Xt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3673
- let { user: c, status: l, signOut: u } = Kt(), p = a ? s || "user" : l, m = a ? {
3726
+ function en({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3727
+ let { user: c, status: l, signOut: u } = Xt(), p = a ? s || "user" : l, m = a ? {
3674
3728
  name: "Ada Lovelace",
3675
3729
  email: "ada@example.com"
3676
3730
  } : c;
@@ -3678,7 +3732,7 @@ function Xt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3678
3732
  ref: i,
3679
3733
  style: {
3680
3734
  minHeight: 24,
3681
- ...C(r)
3735
+ ...D(r)
3682
3736
  }
3683
3737
  }) : p === "user" ? /* @__PURE__ */ f("div", {
3684
3738
  ref: i,
@@ -3686,12 +3740,12 @@ function Xt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3686
3740
  display: "flex",
3687
3741
  alignItems: "center",
3688
3742
  gap: 10,
3689
- ...C(r)
3743
+ ...D(r)
3690
3744
  },
3691
3745
  children: [
3692
3746
  /* @__PURE__ */ f("span", {
3693
3747
  style: {
3694
- ...X,
3748
+ ...Y,
3695
3749
  fontWeight: 600
3696
3750
  },
3697
3751
  children: [
@@ -3702,7 +3756,7 @@ function Xt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3702
3756
  }),
3703
3757
  n && m?.email ? /* @__PURE__ */ d("span", {
3704
3758
  style: {
3705
- ...X,
3759
+ ...Y,
3706
3760
  opacity: .7
3707
3761
  },
3708
3762
  children: m.email
@@ -3711,14 +3765,14 @@ function Xt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3711
3765
  type: "button",
3712
3766
  onClick: a ? void 0 : u,
3713
3767
  style: {
3714
- ...J,
3768
+ ...q,
3715
3769
  border: 0,
3716
3770
  padding: "8px 16px",
3717
3771
  borderRadius: 8,
3718
3772
  fontSize: 14,
3719
3773
  cursor: a ? "default" : "pointer"
3720
3774
  },
3721
- ...Q(a),
3775
+ ...Z(a),
3722
3776
  children: t
3723
3777
  })
3724
3778
  ]
@@ -3728,49 +3782,49 @@ function Xt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3728
3782
  display: "flex",
3729
3783
  alignItems: "center",
3730
3784
  gap: 10,
3731
- ...C(r)
3785
+ ...D(r)
3732
3786
  },
3733
3787
  children: o?.signedOut ?? null
3734
3788
  });
3735
3789
  }
3736
3790
  //#endregion
3737
3791
  //#region ../ui/src/components/builder/apps/index.js
3738
- var Zt = [Wt], Qt = {
3739
- SiteLoginForm: Yt,
3740
- SiteAccountMenu: Xt
3792
+ var tn = [Jt], nn = {
3793
+ SiteLoginForm: $t,
3794
+ SiteAccountMenu: en
3741
3795
  };
3742
- new Set(Zt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3796
+ new Set(tn.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3743
3797
  //#endregion
3744
3798
  //#region ../ui/src/components/builder/plugins/runtime.js
3745
- var $t = /* @__PURE__ */ new Map();
3746
- function en(e) {
3747
- if ($t.has(e)) return $t.get(e);
3799
+ var rn = /* @__PURE__ */ new Map();
3800
+ function an(e) {
3801
+ if (rn.has(e)) return rn.get(e);
3748
3802
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
3749
3803
  /* @vite-ignore */
3750
3804
  /* webpackIgnore: true */
3751
3805
  t
3752
3806
  ).finally(() => URL.revokeObjectURL(t));
3753
- return $t.set(e, n), n;
3807
+ return rn.set(e, n), n;
3754
3808
  }
3755
- function tn(e) {
3809
+ function on(e) {
3756
3810
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
3757
3811
  return n && typeof n == "object" ? n : {};
3758
3812
  }
3759
3813
  //#endregion
3760
3814
  //#region ../ui/src/components/builder/plugins/view.jsx
3761
- async function nn(e, t) {
3762
- let n = await en(e);
3815
+ async function sn(e, t) {
3816
+ let n = await an(e);
3763
3817
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
3764
3818
  }
3765
- var rn = {
3819
+ var cn = {
3766
3820
  padding: "10px 12px",
3767
3821
  border: "1px dashed rgba(148, 163, 184, 0.5)",
3768
3822
  borderRadius: 8,
3769
3823
  fontSize: 12,
3770
3824
  opacity: .6
3771
3825
  };
3772
- function an({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3773
- let s = i(H), l = tn(s?.settings)[e], u = c(null), p = c(null), m = {
3826
+ function ln({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3827
+ let s = i(V), l = on(s?.settings)[e], u = c(null), p = c(null), m = {
3774
3828
  tenant: s?.tenant ?? "",
3775
3829
  apiUrl: s?.apiUrl ?? "/api",
3776
3830
  locale: s?.locale ?? "",
@@ -3782,7 +3836,7 @@ function an({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3782
3836
  let e = u.current;
3783
3837
  if (!l?.code || !e) return;
3784
3838
  let n = !0;
3785
- return nn(l.code, t).then((e) => {
3839
+ return sn(l.code, t).then((e) => {
3786
3840
  if (!(!n || !e || !u.current)) {
3787
3841
  p.current = e;
3788
3842
  try {
@@ -3807,13 +3861,13 @@ function an({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3807
3861
  } catch {}
3808
3862
  }, [g]), l ? /* @__PURE__ */ d("div", {
3809
3863
  ref: o,
3810
- style: C(r),
3864
+ style: D(r),
3811
3865
  children: /* @__PURE__ */ d("div", { ref: u })
3812
3866
  }) : /* @__PURE__ */ f("div", {
3813
3867
  ref: o,
3814
3868
  style: {
3815
- ...rn,
3816
- ...C(r)
3869
+ ...cn,
3870
+ ...D(r)
3817
3871
  },
3818
3872
  children: [
3819
3873
  "Plugin “",
@@ -3824,12 +3878,12 @@ function an({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
3824
3878
  }
3825
3879
  //#endregion
3826
3880
  //#region ../ui/src/components/builder/render.jsx
3827
- var on = {
3828
- ...Ut,
3829
- ...Qt,
3830
- PluginBlock: an
3881
+ var un = {
3882
+ ...qt,
3883
+ ...nn,
3884
+ PluginBlock: ln
3831
3885
  };
3832
- function sn(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3886
+ function dn(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3833
3887
  let o = n[e];
3834
3888
  if (!o || o.hidden) return null;
3835
3889
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -3837,74 +3891,74 @@ function sn(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3837
3891
  let n = o.props?.componentId, s = r?.[n];
3838
3892
  if (!s?.template || i.has(n)) return null;
3839
3893
  let c = new Set(i).add(n);
3840
- return /* @__PURE__ */ d(t, { children: sn(s.template.rootId, s.template.nodes, r, c, a) }, e);
3894
+ return /* @__PURE__ */ d(t, { children: dn(s.template.rootId, s.template.nodes, r, c, a) }, e);
3841
3895
  }
3842
- let l = on[s];
3896
+ let l = un[s];
3843
3897
  if (!l) return null;
3844
- let u = (o.nodes ?? []).map((e) => sn(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, sn(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
3898
+ let u = (o.nodes ?? []).map((e) => dn(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, dn(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
3845
3899
  ...c,
3846
3900
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
3847
3901
  linked: p,
3848
3902
  nodeRef: (t) => {
3849
- t && (t.setAttribute("data-wb", e), D(t, c));
3903
+ t && (t.setAttribute("data-wb", e), j(t, c));
3850
3904
  },
3851
3905
  children: u.length ? u : void 0
3852
3906
  }, e);
3853
- return c.when && c.when !== "always" ? /* @__PURE__ */ d(Jt, {
3907
+ return c.when && c.when !== "always" ? /* @__PURE__ */ d(Qt, {
3854
3908
  when: c.when,
3855
3909
  children: m
3856
3910
  }, e) : m;
3857
3911
  }
3858
3912
  //#endregion
3859
3913
  //#region ../ui/src/components/builder/PageRenderer.jsx
3860
- var cn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ln = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
3861
- .webim-page[data-webim-mode="dark"] { ${Object.entries(V(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
3862
- function un({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
3863
- let b = o?.js?.trim();
3914
+ var fn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), pn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(B(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
3915
+ .webim-page[data-webim-mode="dark"] { ${Object.entries(B(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
3916
+ function mn({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: _ }) {
3917
+ let v = o?.js?.trim();
3864
3918
  if (a(() => {
3865
- if (!b) return;
3919
+ if (!v) return;
3866
3920
  let e = document.createElement("script");
3867
- return e.text = b, document.body.appendChild(e), () => e.remove();
3868
- }, [b]), !e?.ROOT) return null;
3869
- let x = {
3921
+ return e.text = v, document.body.appendChild(e), () => e.remove();
3922
+ }, [v]), !e?.ROOT) return null;
3923
+ let y = {
3870
3924
  lang: p || void 0,
3871
3925
  dir: h(m, p)
3872
- }, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
3926
+ }, x = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", S = {
3873
3927
  minHeight: "100%",
3874
3928
  display: "flex",
3875
3929
  flexDirection: "column"
3876
- }, w = sn("ROOT", e, n), T = s(() => ({ render: (t, r) => sn(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
3930
+ }, w = dn("ROOT", e, n), T = s(() => ({ render: (t, r) => dn(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = re(e, n), D = ne(e, n), O = o?.css?.trim(), k = z(t), A = [k.font, k.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !R[e]), j = [.../* @__PURE__ */ new Set([...C(e, n), ...A])].map((e) => /* @__PURE__ */ d("link", {
3877
3931
  rel: "stylesheet",
3878
3932
  precedence: "default",
3879
- href: _(e)
3880
- }, e)), A = B(t), j = ln(A);
3881
- return r === "auto" ? /* @__PURE__ */ d(H.Provider, {
3933
+ href: b(e)
3934
+ }, e)), M = pn(k);
3935
+ return r === "auto" ? /* @__PURE__ */ d(V.Provider, {
3882
3936
  value: {
3883
3937
  tenant: c || "",
3884
3938
  apiUrl: l || "/api",
3885
3939
  locale: p || "",
3886
3940
  settings: g ?? null
3887
3941
  },
3888
- children: /* @__PURE__ */ d(qt, {
3889
- initialUser: v,
3890
- children: /* @__PURE__ */ d(U.Provider, {
3942
+ children: /* @__PURE__ */ d(Zt, {
3943
+ initialUser: _,
3944
+ children: /* @__PURE__ */ d(H.Provider, {
3891
3945
  value: u ?? null,
3892
- children: /* @__PURE__ */ d(G.Provider, {
3946
+ children: /* @__PURE__ */ d(W.Provider, {
3893
3947
  value: T,
3894
3948
  children: /* @__PURE__ */ f("div", {
3895
- ...x,
3949
+ ...y,
3896
3950
  className: "webim-page",
3897
3951
  style: {
3898
- ...C,
3899
- ...ne(t),
3952
+ ...S,
3953
+ ...se(t),
3900
3954
  ...i
3901
3955
  },
3902
3956
  children: [
3903
- /* @__PURE__ */ d("style", { children: `.webim-page { ${cn(V(A.light))} }
3904
- @media (prefers-color-scheme: dark) { .webim-page { ${cn(V(A.dark))} } }` }),
3905
- /* @__PURE__ */ d("style", { children: j }),
3906
- k,
3907
- /* @__PURE__ */ d("style", { children: S }),
3957
+ /* @__PURE__ */ d("style", { children: `.webim-page { ${fn(B(k.light))} }
3958
+ @media (prefers-color-scheme: dark) { .webim-page { ${fn(B(k.dark))} } }` }),
3959
+ /* @__PURE__ */ d("style", { children: M }),
3960
+ j,
3961
+ /* @__PURE__ */ d("style", { children: x }),
3908
3962
  E && /* @__PURE__ */ d("style", { children: E }),
3909
3963
  D && /* @__PURE__ */ d("style", { children: D }),
3910
3964
  O && /* @__PURE__ */ d("style", { children: O }),
@@ -3914,31 +3968,31 @@ function un({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3914
3968
  })
3915
3969
  })
3916
3970
  })
3917
- }) : /* @__PURE__ */ d(H.Provider, {
3971
+ }) : /* @__PURE__ */ d(V.Provider, {
3918
3972
  value: {
3919
3973
  tenant: c || "",
3920
3974
  apiUrl: l || "/api",
3921
3975
  locale: p || "",
3922
3976
  settings: g ?? null
3923
3977
  },
3924
- children: /* @__PURE__ */ d(qt, {
3925
- initialUser: v,
3926
- children: /* @__PURE__ */ d(U.Provider, {
3978
+ children: /* @__PURE__ */ d(Zt, {
3979
+ initialUser: _,
3980
+ children: /* @__PURE__ */ d(H.Provider, {
3927
3981
  value: u ?? null,
3928
- children: /* @__PURE__ */ d(G.Provider, {
3982
+ children: /* @__PURE__ */ d(W.Provider, {
3929
3983
  value: T,
3930
3984
  children: /* @__PURE__ */ f("div", {
3931
- ...x,
3985
+ ...y,
3932
3986
  className: "webim-page",
3933
3987
  style: {
3934
- ...C,
3935
- ...re(t, r),
3988
+ ...S,
3989
+ ...ce(t, r),
3936
3990
  ...i
3937
3991
  },
3938
3992
  children: [
3939
- k,
3940
- /* @__PURE__ */ d("style", { children: j }),
3941
- /* @__PURE__ */ d("style", { children: S }),
3993
+ j,
3994
+ /* @__PURE__ */ d("style", { children: M }),
3995
+ /* @__PURE__ */ d("style", { children: x }),
3942
3996
  E && /* @__PURE__ */ d("style", { children: E }),
3943
3997
  D && /* @__PURE__ */ d("style", { children: D }),
3944
3998
  O && /* @__PURE__ */ d("style", { children: O }),
@@ -3952,8 +4006,8 @@ function un({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3952
4006
  }
3953
4007
  //#endregion
3954
4008
  //#region src/WebimContent.jsx
3955
- function dn({ bundle: e, mode: t = "auto", style: n }) {
3956
- return e?.blocks?.ROOT ? /* @__PURE__ */ d(un, {
4009
+ function hn({ bundle: e, mode: t = "auto", style: n }) {
4010
+ return e?.blocks?.ROOT ? /* @__PURE__ */ d(mn, {
3957
4011
  blocks: e.blocks,
3958
4012
  theme: e.theme,
3959
4013
  components: e.components,
@@ -3970,7 +4024,7 @@ function dn({ bundle: e, mode: t = "auto", style: n }) {
3970
4024
  }
3971
4025
  //#endregion
3972
4026
  //#region src/bundle.js
3973
- function fn({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
4027
+ function gn({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3974
4028
  let a = {
3975
4029
  ...t?.global ?? {},
3976
4030
  ...t?.tenant ?? {}
@@ -3980,7 +4034,7 @@ function fn({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3980
4034
  title: e.title,
3981
4035
  slug: e.slug,
3982
4036
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
3983
- theme: ie(o, a.builder_themes?.themes),
4037
+ theme: le(o, a.builder_themes?.themes),
3984
4038
  components: a.builder_components?.components ?? {},
3985
4039
  custom: o.custom,
3986
4040
  seo: o.seo,
@@ -3994,18 +4048,18 @@ function fn({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3994
4048
  }
3995
4049
  //#endregion
3996
4050
  //#region src/fetchPage.js
3997
- var pn = async (e) => {
4051
+ var _n = async (e) => {
3998
4052
  let t = await e.json().catch(() => null);
3999
4053
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
4000
4054
  return t?.payload ?? t;
4001
4055
  };
4002
- async function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
4056
+ async function vn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
4003
4057
  if (!e) throw Error("fetchPage: apiUrl is required");
4004
4058
  if (!n) throw Error("fetchPage: slug is required");
4005
4059
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
4006
4060
  ...t ? { "x-tenant": t } : {},
4007
4061
  ...a ? { authorization: `Bearer ${a}` } : {}
4008
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(pn), c(`${l}/settings/public`, { headers: u }).then(pn)]), p = fn({
4062
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(_n), c(`${l}/settings/public`, { headers: u }).then(_n)]), p = gn({
4009
4063
  page: d,
4010
4064
  settings: f,
4011
4065
  tenant: t,
@@ -4013,7 +4067,7 @@ async function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
4013
4067
  locale: r
4014
4068
  }), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
4015
4069
  if (m.length) {
4016
- let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(pn).then((e) => {
4070
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(_n).then((e) => {
4017
4071
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
4018
4072
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
4019
4073
  }).catch(() => [[t, []]])));
@@ -4027,40 +4081,40 @@ async function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
4027
4081
  }
4028
4082
  //#endregion
4029
4083
  //#region src/ssr.jsx
4030
- var hn = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
4084
+ var yn = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
4031
4085
  "&": "&amp;",
4032
4086
  "<": "&lt;",
4033
4087
  ">": "&gt;",
4034
4088
  "\"": "&quot;"
4035
4089
  })[e]);
4036
- function gn(t, { mode: n = "auto", style: r } = {}) {
4037
- return e(/* @__PURE__ */ d(dn, {
4090
+ function bn(t, { mode: n = "auto", style: r } = {}) {
4091
+ return e(/* @__PURE__ */ d(hn, {
4038
4092
  bundle: t,
4039
4093
  mode: n,
4040
4094
  style: r
4041
4095
  }));
4042
4096
  }
4043
- function _n(e, { mode: t = "auto", lang: n } = {}) {
4097
+ function xn(e, { mode: t = "auto", lang: n } = {}) {
4044
4098
  let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
4045
4099
  "<meta charset=\"utf-8\"/>",
4046
4100
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
4047
- `<title>${hn(o)}</title>`,
4048
- r.description && `<meta name="description" content="${hn(r.description)}"/>`,
4049
- `<meta property="og:title" content="${hn(o)}"/>`,
4050
- r.image && `<meta property="og:image" content="${hn(r.image)}"/>`,
4101
+ `<title>${yn(o)}</title>`,
4102
+ r.description && `<meta name="description" content="${yn(r.description)}"/>`,
4103
+ `<meta property="og:title" content="${yn(o)}"/>`,
4104
+ r.image && `<meta property="og:image" content="${yn(r.image)}"/>`,
4051
4105
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
4052
4106
  "<style>html,body{margin:0;height:100%}</style>"
4053
4107
  ].filter(Boolean).join("\n");
4054
4108
  return `<!doctype html>
4055
- <html lang="${hn(i)}"${a ? ` dir="${a}"` : ""}>
4109
+ <html lang="${yn(i)}"${a ? ` dir="${a}"` : ""}>
4056
4110
  <head>
4057
4111
  ${c}
4058
4112
  </head>
4059
4113
  <body>
4060
- ${gn(e, { mode: t })}
4114
+ ${bn(e, { mode: t })}
4061
4115
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
4062
4116
  </body>
4063
4117
  </html>`;
4064
4118
  }
4065
4119
  //#endregion
4066
- export { fn as assembleBundle, mn as fetchPage, gn as renderBundleHtml, _n as renderPageDocument };
4120
+ export { gn as assembleBundle, vn as fetchPage, bn as renderBundleHtml, xn as renderPageDocument };