@bravostudioai/react 0.1.35 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,89 +1,89 @@
1
- import { jsx as p, jsxs as it, Fragment as ut } from "react/jsx-runtime";
2
- import x, { useContext as N, useMemo as Ht, useState as Vt, useCallback as Nt } from "react";
3
- import tt from "./contexts/EncoreBindingContext.js";
4
- import k from "./stores/useEncoreState.js";
1
+ import { jsx as d, jsxs as it, Fragment as ut } from "react/jsx-runtime";
2
+ import v, { useContext as N, useMemo as Ht, useState as Nt, useCallback as Mt } from "react";
3
+ import _ from "./contexts/EncoreBindingContext.js";
4
+ import $ from "./stores/useEncoreState.js";
5
5
  import lt from "./contexts/EncoreComponentIdContext.js";
6
6
  import Ot from "axios";
7
7
  import ft from "./contexts/EncoreActionContext.js";
8
- import Mt from "./contexts/EncoreRepeatingContainerContext.js";
9
- const ct = x.createContext({}), V = x.createContext(
8
+ import jt from "./contexts/EncoreRepeatingContainerContext.js";
9
+ const ct = v.createContext({}), H = v.createContext(
10
10
  {}
11
- ), st = (t) => t.replace(/#(\w{2})(\w{6})/, "#$2$1"), Gt = (t) => t.slice(1, 3) === "00", jt = (t) => {
11
+ ), st = (t) => t.replace(/#(\w{2})(\w{6})/, "#$2$1"), Gt = (t) => t.slice(1, 3) === "00", Ut = (t) => {
12
12
  if (!Array.isArray(t)) return null;
13
13
  const r = t.find((n) => n.startsWith("input-group:"));
14
14
  if (!r) return null;
15
15
  const e = r.split(":");
16
16
  return e.length >= 3 ? { type: e[1], groupName: e[2] } : null;
17
17
  }, rt = () => {
18
- const [t, r] = Vt({ width: 0, height: 0 }), e = x.useRef(null);
19
- return x.useEffect(() => {
18
+ const [t, r] = Nt({ width: 0, height: 0 }), e = v.useRef(null);
19
+ return v.useEffect(() => {
20
20
  if (!e.current) return;
21
21
  const n = e.current, i = () => {
22
- const { width: o, height: m } = n.getBoundingClientRect();
23
- r({ width: o, height: m });
22
+ const { width: o, height: p } = n.getBoundingClientRect();
23
+ r({ width: o, height: p });
24
24
  };
25
25
  i(), requestAnimationFrame(() => {
26
26
  i();
27
27
  });
28
- const l = new ResizeObserver((o) => {
29
- for (const m of o) {
30
- const a = m.contentRect;
28
+ const s = new ResizeObserver((o) => {
29
+ for (const p of o) {
30
+ const a = p.contentRect;
31
31
  r({ width: a.width, height: a.height });
32
32
  }
33
33
  });
34
- return l.observe(n), () => l.disconnect();
34
+ return s.observe(n), () => s.disconnect();
35
35
  }, []), { dimensions: t, ref: e };
36
- }, L = (t, r = {}) => {
37
- const e = N(ct), n = N(V), i = {
36
+ }, R = (t, r = {}) => {
37
+ const e = N(ct), n = N(H), i = {
38
38
  width: window.innerWidth,
39
39
  height: window.innerHeight
40
- }, l = Nt(
41
- (s) => (n.dimensions?.width ?? 0) * 0.01 * s,
40
+ }, s = Mt(
41
+ (l) => (n.dimensions?.width ?? 0) * 0.01 * l,
42
42
  [n.dimensions?.width]
43
43
  ), o = {};
44
44
  r = { debug: !1, ...r };
45
- const m = k((s) => s.fontsById || {});
46
- if (k((s) => s.fontsByIdFull || {}), !t || !t) return;
47
- const a = n.dimensions?.width ?? i.width, y = n.dimensions?.height ?? i.height;
48
- if (t.layout?.layoutSizingHorizontal || t.layout?.layoutSizingVertical || (t.width && a > 0 && (o.width = t.width * a * 0.01), t.aspectRatio && t.width ? a > 0 && (o.height = t.width * a * 0.01 / t.aspectRatio) : t.height && y > 0 && (o.height = t.height * y * 0.01)), !(n?.isFlex ?? !1) && t.positioning) {
49
- const s = t.layout?.layoutSizingHorizontal === "FIXED" || t.layout?.layoutSizingVertical === "FIXED", u = s && t.positioning.top < 0 ? 0 : t.positioning.top, R = s && t.positioning.left < 0 ? 0 : t.positioning.left;
45
+ const p = $((l) => l.fontsById || {});
46
+ if ($((l) => l.fontsByIdFull || {}), !t || !t) return;
47
+ const a = n.dimensions?.width ?? i.width, h = n.dimensions?.height ?? i.height;
48
+ if (t.layout?.layoutSizingHorizontal || t.layout?.layoutSizingVertical || (t.width && a > 0 && (o.width = t.width * a * 0.01), t.aspectRatio && t.width ? a > 0 && (o.height = t.width * a * 0.01 / t.aspectRatio) : t.height && h > 0 && (o.height = t.height * h * 0.01)), !(n?.isFlex ?? !1) && t.positioning) {
49
+ const l = t.layout?.layoutSizingHorizontal === "FIXED" || t.layout?.layoutSizingVertical === "FIXED", I = l && t.positioning.top < 0 ? 0 : t.positioning.top, E = l && t.positioning.left < 0 ? 0 : t.positioning.left;
50
50
  let w = !1;
51
- t.horizontalPosition === "center" && (w = !0), o.top = `${u}%`;
52
- const S = !!t.inset;
51
+ t.horizontalPosition === "center" && (w = !0), o.top = `${I}%`;
52
+ const k = !!t.inset;
53
53
  if (w) {
54
- if (S) {
55
- const W = String(t.inset).split(/\s+/);
56
- W.length === 3 ? o.inset = `${W[0]} 50% ${W[2]} auto` : W.length === 4 && (o.inset = `${W[0]} 50% ${W[2]} auto`), delete o.left, delete o.right;
54
+ if (k) {
55
+ const P = String(t.inset).split(/\s+/);
56
+ P.length === 3 ? o.inset = `${P[0]} 50% ${P[2]} auto` : P.length === 4 && (o.inset = `${P[0]} 50% ${P[2]} auto`), delete o.left, delete o.right;
57
57
  } else
58
58
  o.left = "50%", o.right = "auto";
59
59
  o.transform = "translateX(-50%)";
60
60
  } else
61
- S ? o.inset = t.inset : o.left = `${R}%`;
62
- s ? (o.right = "auto", o.bottom = "auto") : (t.positioning.bottom !== void 0 && (o.bottom = `${t.positioning.bottom}%`), t.positioning.right !== void 0 && (o.right = `${t.positioning.right}%`)), o.position = "absolute";
61
+ k ? o.inset = t.inset : o.left = `${E}%`;
62
+ l ? (o.right = "auto", o.bottom = "auto") : (t.positioning.bottom !== void 0 && (o.bottom = `${t.positioning.bottom}%`), t.positioning.right !== void 0 && (o.right = `${t.positioning.right}%`)), o.position = "absolute";
63
63
  }
64
64
  if (t.layout?.padding) {
65
- const s = e.scaleFactor ?? 1, u = t.layout.padding;
66
- u.top !== void 0 && (o.paddingTop = u.top * s), u.right !== void 0 && (o.paddingRight = u.right * s), u.bottom !== void 0 && (o.paddingBottom = u.bottom * s), u.left !== void 0 && (o.paddingLeft = u.left * s);
65
+ const l = e.scaleFactor ?? 1, I = t.layout.padding;
66
+ I.top !== void 0 && (o.paddingTop = I.top * l), I.right !== void 0 && (o.paddingRight = I.right * l), I.bottom !== void 0 && (o.paddingBottom = I.bottom * l), I.left !== void 0 && (o.paddingLeft = I.left * l);
67
67
  }
68
68
  if (t.layout?.mode) {
69
69
  o.display = "flex";
70
- const s = (W) => W ? {
70
+ const l = (P) => P ? {
71
71
  MIN: "flex-start",
72
72
  MAX: "flex-end",
73
73
  CENTER: "center",
74
74
  SPACE_BETWEEN: "space-between",
75
75
  SPACE_AROUND: "space-around",
76
76
  SPACE_EVENLY: "space-evenly"
77
- }[W] || W.toLowerCase().replace(/_/g, "-") : void 0;
78
- t.layout.mode == "HORIZONTAL" ? (o.flexDirection = "row", t.layout.flexWrap && (o.flexWrap = t.layout.flexWrap), o.justifyContent = s(
77
+ }[P] || P.toLowerCase().replace(/_/g, "-") : void 0;
78
+ t.layout.mode == "HORIZONTAL" ? (o.flexDirection = "row", t.layout.flexWrap && (o.flexWrap = t.layout.flexWrap), o.justifyContent = l(
79
79
  t.layout.primaryAxisAlignItems
80
- ), o.alignItems = t.layout.counterAxisAlignItems) : (o.flexDirection = "column", o.justifyContent = s(
80
+ ), o.alignItems = t.layout.counterAxisAlignItems) : (o.flexDirection = "column", o.justifyContent = l(
81
81
  t.layout.primaryAxisAlignItems
82
82
  ), o.alignItems = t.layout.counterAxisAlignItems), o.flexGrow = t.layout.grow, t.layout.wrap === "WRAP" || t.layout.flexWrap === "wrap" ? o.flexWrap = "wrap" : t.layout.flexWrap ? o.flexWrap = t.layout.flexWrap : o.flexWrap = "nowrap";
83
- const u = t.layout.itemSpacing, R = e.scaleFactor ?? 1, S = t.layout.primaryAxisAlignItems === "SPACE_BETWEEN" ? 0 : (u !== void 0 ? u : 0) * R;
84
- o.gap = S === 0 ? "0px" : `${S}px`, o.rowGap = S === 0 ? "0px" : `${S}px`, o.columnGap = S === 0 ? "0px" : `${S}px`, (o.flexWrap === "wrap" || o.flexWrap === "wrap-reverse") && (o.alignContent = "flex-start"), r.debug || t.layout?.mode === "HORIZONTAL" && u === 0 ? console.log("[useEncoreStyle] Setting gap properties:", {
85
- itemSpacing: u,
86
- spacing: S,
83
+ const I = t.layout.itemSpacing, E = e.scaleFactor ?? 1, k = t.layout.primaryAxisAlignItems === "SPACE_BETWEEN" ? 0 : (I !== void 0 ? I : 0) * E;
84
+ o.gap = k === 0 ? "0px" : `${k}px`, o.rowGap = k === 0 ? "0px" : `${k}px`, o.columnGap = k === 0 ? "0px" : `${k}px`, (o.flexWrap === "wrap" || o.flexWrap === "wrap-reverse") && (o.alignContent = "flex-start"), r.debug || t.layout?.mode === "HORIZONTAL" && I === 0 ? console.log("[useEncoreStyle] Setting gap properties:", {
85
+ itemSpacing: I,
86
+ spacing: k,
87
87
  gap: o.gap,
88
88
  rowGap: o.rowGap,
89
89
  columnGap: o.columnGap,
@@ -93,16 +93,16 @@ const ct = x.createContext({}), V = x.createContext(
93
93
  "[useEncoreStyle] No gap properties set",
94
94
  r.debug,
95
95
  t.layout?.mode,
96
- u
96
+ I
97
97
  );
98
98
  }
99
99
  if (t.layout?.layoutSizingHorizontal === "FILL" && (o.width = "100%"), t.layout?.layoutSizingHorizontal === "FIXED") {
100
- const s = e.scaleFactor ?? 1;
101
- o.width = t.layout.size.x * s;
100
+ const l = e.scaleFactor ?? 1;
101
+ o.width = t.layout.size.x * l;
102
102
  }
103
103
  if (t.layout?.layoutSizingHorizontal, t.layout?.layoutSizingVertical === "FIXED") {
104
- const s = e.scaleFactor ?? 1;
105
- o.height = t.layout.size.y * s;
104
+ const l = e.scaleFactor ?? 1;
105
+ o.height = t.layout.size.y * l;
106
106
  }
107
107
  if (t.layout?.layoutSizingVertical === "FILL")
108
108
  if (!(n?.isFlex ?? !1) && t.positioning && t.positioning?.top !== void 0) {
@@ -110,22 +110,31 @@ const ct = x.createContext({}), V = x.createContext(
110
110
  o.height = `${w}%`;
111
111
  } else
112
112
  o.height = "100%";
113
- if (t.layout?.layoutSizingVertical, t.backgroundColor && !Gt(t.backgroundColor) && (o.backgroundColor = st(t.backgroundColor)), t.color && (o.color = st(t.color)), t.lineHeightPx && (o.lineHeight = (t.lineHeightPx * (e.scaleFactor ?? 1)).toString() + "px"), t.fontSize && (o.fontSize = t.fontSize * (e.scaleFactor ?? 1)), t.fontWeight && (o.fontWeight = `${t.fontWeight}`), t.opacity && (o.opacity = t.opacity * 0.01), t.fontId) {
114
- const s = m[t.fontId] || "sans-serif";
115
- o.fontFamily = `"${s}"`, console.log("[AG_DEBUG] [useEncoreStyle] Font Resolution:", {
116
- fontId: t.fontId,
117
- resolvedFamily: s,
118
- fontWeight: t.fontWeight,
119
- finalStyle: o.fontFamily
120
- });
121
- }
122
- if (t.borderRadius && (o.borderRadius = l(t.borderRadius)), t.cornerRadii) {
123
- const s = t.cornerRadii.map(l);
124
- o.borderTopLeftRadius = s[0], o.borderTopRightRadius = s[1], o.borderBottomRightRadius = s[2], o.borderBottomLeftRadius = s[3], delete o.borderRadius;
113
+ t.layout?.layoutSizingVertical, t.backgroundColor && !Gt(t.backgroundColor) && (o.backgroundColor = st(t.backgroundColor)), t.color && (o.color = st(t.color)), t.lineHeightPx && (o.lineHeight = (t.lineHeightPx * (e.scaleFactor ?? 1)).toString() + "px"), t.fontSize && (o.fontSize = t.fontSize * (e.scaleFactor ?? 1)), t.fontWeight && (o.fontWeight = `${t.fontWeight}`), t.opacity && (o.opacity = t.opacity * 0.01);
114
+ const y = (t.fontId ? p[t.fontId] : void 0) || t.fontFamily || void 0;
115
+ if (y ? ([
116
+ "sans-serif",
117
+ "serif",
118
+ "monospace",
119
+ "cursive",
120
+ "fantasy",
121
+ "system-ui",
122
+ "ui-sans-serif",
123
+ "ui-serif",
124
+ "ui-monospace",
125
+ "ui-rounded"
126
+ ].includes(y.toLowerCase()) ? o.fontFamily = y : o.fontFamily = `"${y}", sans-serif`, (r.debug || t.fontId) && console.log("[AG_DEBUG] [useEncoreStyle] Font Resolution:", {
127
+ fontId: t.fontId,
128
+ resolvedFamily: y,
129
+ styleFontFamily: t.fontFamily,
130
+ finalStyle: o.fontFamily
131
+ })) : o.fontFamily = "sans-serif", t.borderRadius && (o.borderRadius = s(t.borderRadius)), t.cornerRadii) {
132
+ const l = t.cornerRadii.map(s);
133
+ o.borderTopLeftRadius = l[0], o.borderTopRightRadius = l[1], o.borderBottomRightRadius = l[2], o.borderBottomLeftRadius = l[3], delete o.borderRadius;
125
134
  }
126
135
  return t.borderWidth && (t.borderWidth > 5 ? o.borderWidth = t.borderWidth * 0.5 : o.borderWidth = t.borderWidth * 1.5), t.borderColor && (o.borderColor = st(t.borderColor)), (t.borderWidth || t.borderColor) && (o.borderStyle = "solid"), t.rotation && (o.transform = `rotate(${t.rotation}deg)`), t.textCase === "upper" && (o.textTransform = "uppercase"), t.textCase === "lower" && (o.textTransform = "lowercase"), t.letterSpacing && (o.letterSpacing = t.letterSpacing), t.textAlign && (o.textAlign = t.textAlign), r.debug && (o.borderWidth = 1, o.borderColor = "#FF0000FF", o.borderStyle = "solid"), o;
127
- }, et = ({ id: t, nodeData: r }) => {
128
- const e = N(tt), n = e?.nodeData?.[t], { patch: i, list: l } = n ?? { list: null, patch: null }, m = Array.isArray(r?.tags) && (r.tags.includes("encore:data:array") || r.tags.includes("bravo:data:array")) && e?.arrayDataById && e.arrayDataById[t] && Array.isArray(e.arrayDataById[t]) ? e.arrayDataById[t] : null;
136
+ }, q = ({ id: t, nodeData: r }) => {
137
+ const e = N(_), n = e?.nodeData?.[t], { patch: i, list: s } = n ?? { list: null, patch: null }, p = Array.isArray(r?.tags) && (r.tags.includes("encore:data:array") || r.tags.includes("bravo:data:array")) && e?.arrayDataById && e.arrayDataById[t] && Array.isArray(e.arrayDataById[t]) ? e.arrayDataById[t] : null;
129
138
  let a = i ? {
130
139
  ...r,
131
140
  ...i || {},
@@ -133,98 +142,98 @@ const ct = x.createContext({}), V = x.createContext(
133
142
  // Preserve original actions if patch has empty or missing actions
134
143
  actions: i.actions && Array.isArray(i.actions) && i.actions.length > 0 ? i.actions : r.actions || i.actions || []
135
144
  } : r;
136
- const y = e?.textOverridesById && e.textOverridesById[t] !== void 0 ? e.textOverridesById[t] : void 0;
137
- y !== void 0 && Array.isArray(r?.tags) && r.tags.includes("PROP:TEXT_VAR") && (a = {
145
+ const h = e?.textOverridesById && e.textOverridesById[t] !== void 0 ? e.textOverridesById[t] : void 0;
146
+ h !== void 0 && Array.isArray(r?.tags) && r.tags.includes("PROP:TEXT_VAR") && (a = {
138
147
  ...a,
139
- data: { ...a?.data || {}, text: String(y) }
148
+ data: { ...a?.data || {}, text: String(h) }
140
149
  });
141
- const v = Array.isArray(r?.tags) && (r.tags.includes("encore:data") || r.tags.includes("bravo:data")), f = e?.rootData;
142
- f && f[t] && typeof f[t] == "object" && (a = {
150
+ const F = Array.isArray(r?.tags) && (r.tags.includes("encore:data") || r.tags.includes("bravo:data")), g = e?.rootData;
151
+ g && g[t] && typeof g[t] == "object" && (a = {
143
152
  ...a,
144
153
  data: {
145
154
  ...a.data || {},
146
- ...f[t]
155
+ ...g[t]
147
156
  }
148
157
  });
149
- const s = e?.nodeData && typeof e.nodeData == "object";
150
- if (v || s) {
151
- const u = e?.nodeData;
152
- if (u && typeof u == "object") {
153
- if (u[t] !== void 0) {
154
- const w = u[t];
155
- w && typeof w == "object" && a.data && (a = {
158
+ const y = e?.nodeData && typeof e.nodeData == "object";
159
+ if (F || y) {
160
+ const l = e?.nodeData;
161
+ if (l && typeof l == "object") {
162
+ if (l[t] !== void 0) {
163
+ const E = l[t];
164
+ E && typeof E == "object" && a.data && (a = {
156
165
  ...a,
157
166
  data: {
158
167
  ...a.data,
159
- ...w
168
+ ...E
160
169
  }
161
170
  });
162
- } else if (v && u.description && a.data && (a = {
171
+ } else if (F && l.description && a.data && (a = {
163
172
  ...a,
164
173
  data: {
165
174
  ...a.data,
166
- text: u.description
175
+ text: l.description
167
176
  }
168
- }), u.image && a.data) {
169
- const w = u.image.startsWith("//") ? `https:${u.image}` : u.image;
177
+ }), l.image && a.data) {
178
+ const E = l.image.startsWith("//") ? `https:${l.image}` : l.image;
170
179
  a = {
171
180
  ...a,
172
181
  data: {
173
182
  ...a.data,
174
- imageUrl: w
183
+ imageUrl: E
175
184
  }
176
185
  };
177
186
  }
178
- a.encoreData = u;
187
+ a.encoreData = l;
179
188
  }
180
189
  }
181
190
  return {
182
191
  patch: i,
183
- list: l || m,
192
+ list: s || p,
184
193
  // Use arrayData if list is not provided
185
194
  patchedNodeData: a,
186
- arrayData: m
195
+ arrayData: p
187
196
  // Also return separately for components that need it
188
197
  };
189
- }, Y = ({
198
+ }, D = ({
190
199
  id: t,
191
200
  nodeData: r,
192
201
  children: e,
193
202
  _parentStatefulSetId: n,
194
203
  _parentInputGroupInfo: i,
195
- _parentName: l
204
+ _parentName: s
196
205
  }) => {
197
- const o = k((h) => h.baseURL), m = k((h) => h.appId);
198
- k((h) => h.pageId);
199
- const { onAction: a } = x.useContext(ft), { statefulSetId: y } = x.useContext(
206
+ const o = $((f) => f.baseURL), p = $((f) => f.appId);
207
+ $((f) => f.pageId);
208
+ const { onAction: a } = v.useContext(ft), { statefulSetId: h } = v.useContext(
200
209
  lt
201
- ), v = n || y, { patchedNodeData: f } = et({ id: t, nodeData: r }), s = k(
202
- (h) => h.setStatefulSetVariant
203
- ), u = k(
204
- (h) => h.setInputGroupValue
205
- ), R = k((h) => h.setAccessToken), { app: w } = k((h) => h.app);
206
- w.data?.app?.startPageId, w.data?.app?.PageId;
207
- const S = L(
210
+ ), F = n || h, { patchedNodeData: g } = q({ id: t, nodeData: r }), y = $(
211
+ (f) => f.setStatefulSetVariant
212
+ ), l = $(
213
+ (f) => f.setInputGroupValue
214
+ ), I = $((f) => f.setAccessToken), { app: E } = $((f) => f.app);
215
+ E.data?.app?.startPageId, E.data?.app?.PageId;
216
+ const w = R(
208
217
  {
209
218
  positioning: r.style?.positioning
210
219
  },
211
220
  { debug: !1 }
212
221
  );
213
- S.zIndex = 99999, S.backgroundColor = "transparent", S.position = "absolute", S.top = "0", S.left = "0", S.right = "0", S.bottom = "0", S.width = "100%", S.height = "100%", S.pointerEvents = "auto", S.isolation = "isolate";
214
- const W = async (h) => {
215
- let A = !1;
216
- const G = () => {
217
- A = !1;
222
+ w.zIndex = 99999, w.backgroundColor = "transparent", w.position = "absolute", w.top = "0", w.left = "0", w.right = "0", w.bottom = "0", w.width = "100%", w.height = "100%", w.pointerEvents = "auto", w.isolation = "isolate";
223
+ const k = async (f) => {
224
+ let S = !1;
225
+ const j = () => {
226
+ S = !1;
218
227
  };
219
228
  if (typeof a == "function")
220
229
  try {
221
- await a({ bravo: { cancel: G, action: h, componentId: t } }), A = !0;
230
+ await a({ bravo: { cancel: j, action: f, componentId: t } }), S = !0;
222
231
  } catch {
223
232
  }
224
233
  else
225
- A = !0;
226
- if (A)
227
- switch (h.action) {
234
+ S = !0;
235
+ if (S)
236
+ switch (f.action) {
228
237
  case "login":
229
238
  // TODO firebase
230
239
  // TODO oauth
@@ -234,7 +243,7 @@ const ct = x.createContext({}), V = x.createContext(
234
243
  case "submit":
235
244
  break;
236
245
  case "email":
237
- window.location.href = `mailto:${h.params.email}`;
246
+ window.location.href = `mailto:${f.params.email}`;
238
247
  break;
239
248
  case "goback":
240
249
  break;
@@ -243,30 +252,30 @@ const ct = x.createContext({}), V = x.createContext(
243
252
  case "homepage":
244
253
  break;
245
254
  case "logout":
246
- R(void 0);
255
+ I(void 0);
247
256
  break;
248
257
  case "none":
249
258
  break;
250
259
  case "openurl":
251
- window.open(h.params.url, "_blank");
260
+ window.open(f.params.url, "_blank");
252
261
  break;
253
262
  case "phone":
254
- window.location.href = `tel:${h.params.phone}`;
263
+ window.location.href = `tel:${f.params.phone}`;
255
264
  break;
256
265
  case "remote":
257
- const O = btoa(JSON.stringify(h.params?.data || {})), j = `${o}/devices/apps/${m}/node/${t}/trigger/${h.event}?params=${O}`, K = await Ot.post(j);
258
- K.data?.action && await W(K.data);
266
+ const M = btoa(JSON.stringify(f.params?.data || {})), G = `${o}/devices/apps/${p}/node/${t}/trigger/${f.event}?params=${M}`, K = await Ot.post(G);
267
+ K.data?.action && await k(K.data);
259
268
  break;
260
269
  case "set-access-token":
261
- R(h.params);
270
+ I(f.params);
262
271
  break;
263
272
  case "set-state":
264
- if (i && l)
273
+ if (i && s)
265
274
  if (console.log("🔵 Input group change:", {
266
275
  groupName: i.groupName,
267
- elementName: l,
276
+ elementName: s,
268
277
  hasOnAction: typeof a == "function"
269
- }), u(i.groupName, l), typeof a == "function")
278
+ }), l(i.groupName, s), typeof a == "function")
270
279
  try {
271
280
  await a({
272
281
  bravo: {
@@ -277,51 +286,51 @@ const ct = x.createContext({}), V = x.createContext(
277
286
  params: {
278
287
  groupName: i.groupName,
279
288
  groupType: i.type,
280
- value: l
289
+ value: s
281
290
  },
282
291
  event: "tap"
283
292
  },
284
293
  componentId: t
285
294
  }
286
295
  }), console.log("✅ Input group change event fired");
287
- } catch (E) {
288
- console.error("❌ Error in onAction callback:", E);
296
+ } catch (A) {
297
+ console.error("❌ Error in onAction callback:", A);
289
298
  }
290
299
  else
291
300
  console.warn("⚠️ No onAction callback provided");
292
301
  else {
293
- let E = v || h.params?.stateSetId || f.data?.stateSetId;
294
- if (!E) {
302
+ let A = F || f.params?.stateSetId || g.data?.stateSetId;
303
+ if (!A) {
295
304
  console.error("❌ No stateSetId found in action or nodeData!", {
296
- actionParams: h.params,
297
- nodeDataStateSetId: f.data?.stateSetId,
298
- parentStatefulSetId: v
305
+ actionParams: f.params,
306
+ nodeDataStateSetId: g.data?.stateSetId,
307
+ parentStatefulSetId: F
299
308
  });
300
309
  break;
301
310
  }
302
- s(E, h.params.state);
311
+ y(A, f.params.state);
303
312
  }
304
313
  break;
305
314
  case "showalert":
306
- alert(h.params.message);
315
+ alert(f.params.message);
307
316
  break;
308
317
  default:
309
- console.log(h), alert(h.action);
318
+ console.log(f), alert(f.action);
310
319
  }
311
320
  };
312
321
  if (r.href)
313
322
  return /* @__PURE__ */ it(ut, { children: [
314
- /* @__PURE__ */ p(
323
+ /* @__PURE__ */ d(
315
324
  "button",
316
325
  {
317
326
  type: "button",
318
- onClick: () => W({
327
+ onClick: () => k({
319
328
  action: "goto",
320
329
  params: { href: r.href },
321
330
  event: "tap"
322
331
  }),
323
332
  style: {
324
- ...S,
333
+ ...w,
325
334
  cursor: "pointer",
326
335
  background: "transparent",
327
336
  border: "none",
@@ -332,17 +341,17 @@ const ct = x.createContext({}), V = x.createContext(
332
341
  ),
333
342
  e
334
343
  ] });
335
- let $ = f.actions && f.actions.length > 0 ? f.actions : r.actions || [];
336
- if (v && $.length > 0 && ($ = $.map((h) => h.action === "set-state" ? (h.params?.stateSetId, {
337
- ...h,
344
+ let P = g.actions && g.actions.length > 0 ? g.actions : r.actions || [];
345
+ if (F && P.length > 0 && (P = P.map((f) => f.action === "set-state" ? (f.params?.stateSetId, {
346
+ ...f,
338
347
  params: {
339
- ...h.params,
340
- stateSetId: v
348
+ ...f.params,
349
+ stateSetId: F
341
350
  // Always use parent's id
342
351
  }
343
- }) : h)), $.length === 0 && (f.data?.stateSetId || v))
344
- if (i && l)
345
- $ = [
352
+ }) : f)), P.length === 0 && (g.data?.stateSetId || F))
353
+ if (i && s)
354
+ P = [
346
355
  {
347
356
  action: "set-state",
348
357
  params: {
@@ -353,13 +362,13 @@ const ct = x.createContext({}), V = x.createContext(
353
362
  }
354
363
  ];
355
364
  else {
356
- const h = v || f.data.stateSetId;
357
- h ? $ = [
365
+ const f = F || g.data.stateSetId;
366
+ f ? P = [
358
367
  {
359
368
  action: "set-state",
360
369
  params: {
361
- state: k.getState().statefulSetVariants[h] === "active" ? "default" : "active",
362
- stateSetId: h
370
+ state: $.getState().statefulSetVariants[f] === "active" ? "default" : "active",
371
+ stateSetId: f
363
372
  // Use parent's id or button's stateSetId
364
373
  },
365
374
  event: "tap"
@@ -369,98 +378,118 @@ const ct = x.createContext({}), V = x.createContext(
369
378
  { id: t, name: r.name }
370
379
  );
371
380
  }
372
- if ($ && $.length > 0) {
373
- const h = $[0];
374
- return h.event !== "tap" ? e : /* @__PURE__ */ it(ut, { children: [
381
+ if (P && P.length > 0) {
382
+ const f = P[0];
383
+ return f.event !== "tap" ? e : /* @__PURE__ */ it(ut, { children: [
375
384
  e,
376
- /* @__PURE__ */ p(
385
+ /* @__PURE__ */ d(
377
386
  "div",
378
387
  {
379
- onClick: (A) => {
380
- A.stopPropagation(), W(h);
388
+ onClick: (S) => {
389
+ S.stopPropagation(), k(f);
381
390
  },
382
- onMouseDown: (A) => A.stopPropagation(),
383
- onMouseUp: (A) => A.stopPropagation(),
384
- style: { ...S, cursor: "pointer", pointerEvents: "auto" }
391
+ onMouseDown: (S) => S.stopPropagation(),
392
+ onMouseUp: (S) => S.stopPropagation(),
393
+ style: { ...w, cursor: "pointer", pointerEvents: "auto" }
385
394
  }
386
395
  )
387
396
  ] });
388
397
  }
389
398
  return e;
390
399
  }, ht = ({ id: t, name: r, nodeData: e }) => {
391
- const n = L(e.style, {
400
+ const { patchedNodeData: n } = q({ id: t, nodeData: e }), i = R(n.style, {
392
401
  debug: !1
393
402
  });
394
- return /* @__PURE__ */ p(
403
+ return /* @__PURE__ */ d(
395
404
  "iframe",
396
405
  {
397
406
  "data-id": t,
398
407
  "data-name": r,
399
408
  "data-type": "WebViewComponent",
400
- style: { border: "none", ...n },
401
- src: e.data?.params?.url
409
+ style: { border: "none", ...i },
410
+ src: n.data?.params?.url || n.data?.url || n.encoreData?.url
411
+ }
412
+ );
413
+ }, Xt = ({ id: t, name: r, nodeData: e }) => {
414
+ const { patchedNodeData: n } = q({ id: t, nodeData: e });
415
+ e = n;
416
+ const i = R(e.style, {
417
+ debug: !1
418
+ }), s = $((a) => a.assetsById), o = e.style?.scaleMode || "fill";
419
+ o === "fill" ? i.objectFit = "cover" : o === "fit" && (i.objectFit = "contain"), i.objectPosition = "center";
420
+ let p = e.data?.videoUrl;
421
+ return !p && e.encoreData?.video && (p = e.encoreData.video), p || (p = s[e.assetId]?.url), !p && !i.backgroundColor && !i.borderColor ? null : /* @__PURE__ */ d(
422
+ "video",
423
+ {
424
+ "data-id": t,
425
+ "data-name": r,
426
+ "data-type": "VideoComponent",
427
+ style: { ...i },
428
+ src: p,
429
+ controls: !0,
430
+ playsInline: !0
402
431
  }
403
432
  );
404
433
  }, gt = ({ id: t, name: r, nodeData: e }) => {
405
- const n = L(e.style, {
434
+ const n = R(e.style, {
406
435
  debug: !1
407
436
  });
408
437
  if (!n.backgroundColor && !n.borderColor)
409
438
  return null;
410
439
  if (n.borderColor && !n.backgroundColor && (n.backgroundColor = "transparent"), n.borderColor && n.borderWidth) {
411
- const v = Math.max(n.borderWidth || 0, 1);
412
- (!n.width || typeof n.width == "number" && n.width === 0) && (n.width = v), (!n.height || typeof n.height == "number" && n.height === 0) && (n.height = v), n.boxSizing = "border-box";
440
+ const F = Math.max(n.borderWidth || 0, 1);
441
+ (!n.width || typeof n.width == "number" && n.width === 0) && (n.width = F), (!n.height || typeof n.height == "number" && n.height === 0) && (n.height = F), n.boxSizing = "border-box";
413
442
  }
414
- const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"), l = N(V)?.isFlex ?? !1, o = e.style?.positioning, m = o && typeof o.top == "number" && typeof o.left == "number" && typeof o.right == "number" && typeof o.bottom == "number" && o.top === 0 && o.left === 0 && o.right === 0 && o.bottom === 0, a = i && (l || m), y = r && r.toLowerCase().startsWith("clip");
415
- return a && (n.position = "absolute", n.top = 0, n.left = 0, n.right = 0, n.bottom = 0, n.zIndex = -1, n.width && typeof n.width == "string" && n.width.includes("%") && delete n.width, n.height && typeof n.height == "string" && n.height.includes("%") && delete n.height), y && (n.backgroundColor = "transparent"), /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p("div", { "data-name": r, "data-type": "ColorComponent", style: n }) });
443
+ const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"), s = N(H)?.isFlex ?? !1, o = e.style?.positioning, p = o && typeof o.top == "number" && typeof o.left == "number" && typeof o.right == "number" && typeof o.bottom == "number" && o.top === 0 && o.left === 0 && o.right === 0 && o.bottom === 0, a = i && (s || p), h = r && r.toLowerCase().startsWith("clip");
444
+ return a && (n.position = "absolute", n.top = 0, n.left = 0, n.right = 0, n.bottom = 0, n.zIndex = -1, n.width && typeof n.width == "string" && n.width.includes("%") && delete n.width, n.height && typeof n.height == "string" && n.height.includes("%") && delete n.height), h && (n.backgroundColor = "transparent"), /* @__PURE__ */ d(D, { id: t, nodeData: e, children: /* @__PURE__ */ d("div", { "data-name": r, "data-type": "ColorComponent", style: n }) });
416
445
  }, mt = ({
417
446
  id: t,
418
447
  name: r,
419
448
  nodeData: e
420
449
  }) => {
421
- const n = L(e.style, {
450
+ const n = R(e.style, {
422
451
  debug: !1
423
- }), i = e.style, l = Array.isArray(i?.gradientColorStops) ? i.gradientColorStops.map((o) => {
452
+ }), i = e.style, s = Array.isArray(i?.gradientColorStops) ? i.gradientColorStops.map((o) => {
424
453
  if (!o?.color) return null;
425
- const m = st(o.color);
454
+ const p = st(o.color);
426
455
  if (typeof o.position == "number") {
427
456
  const a = o.position * 100;
428
- return `${m} ${a}%`;
457
+ return `${p} ${a}%`;
429
458
  }
430
- return m;
459
+ return p;
431
460
  }).filter(Boolean).join(", ") : "";
432
- if (l) {
461
+ if (s) {
433
462
  const o = i?.gradientType || "linear";
434
- n.backgroundImage = o === "radial" ? `radial-gradient(${l})` : `linear-gradient(${l})`, delete n.backgroundColor;
463
+ n.backgroundImage = o === "radial" ? `radial-gradient(${s})` : `linear-gradient(${s})`, delete n.backgroundColor;
435
464
  }
436
- return /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p("div", { "data-name": r, "data-type": "GradientComponent", style: n }) });
465
+ return /* @__PURE__ */ d(D, { id: t, nodeData: e, children: /* @__PURE__ */ d("div", { "data-name": r, "data-type": "GradientComponent", style: n }) });
437
466
  }, yt = ({ id: t, name: r, nodeData: e }) => {
438
- const { patchedNodeData: n } = et({ id: t, nodeData: e });
467
+ const { patchedNodeData: n } = q({ id: t, nodeData: e });
439
468
  e = n;
440
- const i = L(e.style, {
469
+ const i = R(e.style, {
441
470
  debug: !1
442
- }), l = N(V), o = k((u) => u.assetsById), m = e.style?.scaleMode || "fill";
443
- m === "fill" ? i.objectFit = "cover" : m === "fit" && (i.objectFit = "contain"), i.objectPosition = "center";
471
+ }), s = N(H), o = $((l) => l.assetsById), p = e.style?.scaleMode || "fill";
472
+ p === "fill" ? i.objectFit = "cover" : p === "fit" && (i.objectFit = "contain"), i.objectPosition = "center";
444
473
  let a = e.data?.imageUrl;
445
474
  !a && e.encoreData?.image && (a = e.encoreData.image.startsWith("//") ? `https:${e.encoreData.image}` : e.encoreData.image), a || (a = o[e.assetId]?.url);
446
- const y = e.style?.positioning, v = e.style?.aspectRatio, f = l.dimensions?.width || 0, s = l.dimensions?.height || 0;
447
- if (y && v && f > 0) {
448
- const u = typeof y.left == "number" && typeof y.right == "number", R = typeof y.top == "number" && typeof y.bottom == "number";
449
- if (u) {
450
- const w = 100 - y.left - y.right;
451
- if (w > 0) {
452
- const S = w * f / 100;
453
- i.width = S, i.height = S / v, i.left = `${Math.max(0, y.left)}%`, i.top = `${Math.max(0, y.top)}%`, delete i.right, delete i.bottom;
475
+ const h = e.style?.positioning, F = e.style?.aspectRatio, g = s.dimensions?.width || 0, y = s.dimensions?.height || 0;
476
+ if (h && F && g > 0) {
477
+ const l = typeof h.left == "number" && typeof h.right == "number", I = typeof h.top == "number" && typeof h.bottom == "number";
478
+ if (l) {
479
+ const E = 100 - h.left - h.right;
480
+ if (E > 0) {
481
+ const w = E * g / 100;
482
+ i.width = w, i.height = w / F, i.left = `${Math.max(0, h.left)}%`, i.top = `${Math.max(0, h.top)}%`, delete i.right, delete i.bottom;
454
483
  }
455
- } else if (R && s > 0) {
456
- const w = 100 - y.top - y.bottom;
457
- if (w > 0) {
458
- const S = w * s / 100;
459
- i.height = S, i.width = S * v, i.left = `${Math.max(0, y.left)}%`, i.top = `${Math.max(0, y.top)}%`, delete i.right, delete i.bottom;
484
+ } else if (I && y > 0) {
485
+ const E = 100 - h.top - h.bottom;
486
+ if (E > 0) {
487
+ const w = E * y / 100;
488
+ i.height = w, i.width = w * F, i.left = `${Math.max(0, h.left)}%`, i.top = `${Math.max(0, h.top)}%`, delete i.right, delete i.bottom;
460
489
  }
461
490
  }
462
491
  }
463
- return /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p(
492
+ return /* @__PURE__ */ d(D, { id: t, nodeData: e, children: /* @__PURE__ */ d(
464
493
  "img",
465
494
  {
466
495
  "data-id": t,
@@ -476,11 +505,11 @@ const ct = x.createContext({}), V = x.createContext(
476
505
  name: r,
477
506
  nodeData: e
478
507
  }) => {
479
- const n = k((l) => l.setFormInputValue), i = L(e.style, { debug: !1 });
480
- return /* @__PURE__ */ p(
508
+ const n = $((s) => s.setFormInputValue), i = R(e.style, { debug: !1 });
509
+ return /* @__PURE__ */ d(
481
510
  "input",
482
511
  {
483
- onChange: (l) => n(t, l.target.value),
512
+ onChange: (s) => n(t, s.target.value),
484
513
  "data-id": t,
485
514
  "data-name": r,
486
515
  "data-type": "EmailInputComponent",
@@ -494,8 +523,8 @@ const ct = x.createContext({}), V = x.createContext(
494
523
  name: r,
495
524
  nodeData: e
496
525
  }) => {
497
- const n = L(e.style);
498
- return n.visibility = "hidden", /* @__PURE__ */ p(
526
+ const n = R(e.style);
527
+ return n.visibility = "hidden", /* @__PURE__ */ d(
499
528
  "input",
500
529
  {
501
530
  "data-id": t,
@@ -505,21 +534,21 @@ const ct = x.createContext({}), V = x.createContext(
505
534
  type: "hidden"
506
535
  }
507
536
  );
508
- }, St = ({
537
+ }, vt = ({
509
538
  id: t,
510
539
  name: r,
511
540
  nodeData: e
512
541
  }) => {
513
- const n = k((o) => o.setFormInputValue), i = L(e.style, { debug: !1 }), l = k((o) => o.assetsById);
542
+ const n = $((o) => o.setFormInputValue), i = R(e.style, { debug: !1 }), s = $((o) => o.assetsById);
514
543
  return /* @__PURE__ */ it(ut, { children: [
515
- /* @__PURE__ */ p(
544
+ /* @__PURE__ */ d(
516
545
  "div",
517
546
  {
518
547
  style: { ...i, zIndex: 9999, cursor: "pointer" },
519
548
  onClick: () => alert("Image picker")
520
549
  }
521
550
  ),
522
- /* @__PURE__ */ p(
551
+ /* @__PURE__ */ d(
523
552
  "img",
524
553
  {
525
554
  onChange: (o) => n(t, o.target.value),
@@ -527,7 +556,7 @@ const ct = x.createContext({}), V = x.createContext(
527
556
  "data-id": t,
528
557
  "data-name": r,
529
558
  "data-type": "ImageInputComponent",
530
- src: l[e.assetId]?.url,
559
+ src: s[e.assetId]?.url,
531
560
  alt: r
532
561
  }
533
562
  )
@@ -537,11 +566,11 @@ const ct = x.createContext({}), V = x.createContext(
537
566
  name: r,
538
567
  nodeData: e
539
568
  }) => {
540
- const n = k((l) => l.setFormInputValue), i = L(e.style, { debug: !1 });
541
- return /* @__PURE__ */ p(
569
+ const n = $((s) => s.setFormInputValue), i = R(e.style, { debug: !1 });
570
+ return /* @__PURE__ */ d(
542
571
  "input",
543
572
  {
544
- onChange: (l) => n(t, l.target.value),
573
+ onChange: (s) => n(t, s.target.value),
545
574
  "data-id": t,
546
575
  "data-name": r,
547
576
  "data-type": "PasswordInputComponent",
@@ -550,25 +579,25 @@ const ct = x.createContext({}), V = x.createContext(
550
579
  type: "password"
551
580
  }
552
581
  );
553
- }, vt = ({
582
+ }, St = ({
554
583
  id: t,
555
584
  name: r,
556
585
  nodeData: e
557
586
  }) => {
558
- const n = k((f) => f.setFormInputValue), { onAction: i } = x.useContext(ft), { patchedNodeData: l } = et({ id: t, nodeData: e }), o = L(l.style, { debug: !1 });
587
+ const n = $((g) => g.setFormInputValue), { onAction: i } = v.useContext(ft), { patchedNodeData: s } = q({ id: t, nodeData: e }), o = R(s.style, { debug: !1 });
559
588
  o.width = "100%", o.flex = "1", o.minWidth = "0", o.boxSizing = "border-box", o.borderColor = o.borderColor ?? "transparent";
560
- const m = l.data?.value, a = l.data?.options, y = x.useMemo(() => !a || !Array.isArray(a) ? [] : a.map((f) => typeof f == "string" ? { value: f, label: f } : f), [a]);
589
+ const p = s.data?.value, a = s.data?.options, h = v.useMemo(() => !a || !Array.isArray(a) ? [] : a.map((g) => typeof g == "string" ? { value: g, label: g } : g), [a]);
561
590
  return /* @__PURE__ */ it(
562
591
  "select",
563
592
  {
564
593
  "data-id": t,
565
594
  "data-name": r,
566
595
  "data-type": "SelectInputComponent",
567
- value: m ?? "",
596
+ value: p ?? "",
568
597
  style: o,
569
- onChange: async (f) => {
570
- const s = f.target.value;
571
- if (n(t, s), console.log(`Select changed: ${s}`), typeof i == "function")
598
+ onChange: async (g) => {
599
+ const y = g.target.value;
600
+ if (n(t, y), console.log(`Select changed: ${y}`), typeof i == "function")
572
601
  try {
573
602
  await i({
574
603
  bravo: {
@@ -577,7 +606,7 @@ const ct = x.createContext({}), V = x.createContext(
577
606
  action: {
578
607
  action: "select-change",
579
608
  nodeId: t,
580
- params: { value: s }
609
+ params: { value: y }
581
610
  },
582
611
  componentId: t
583
612
  }
@@ -586,8 +615,8 @@ const ct = x.createContext({}), V = x.createContext(
586
615
  }
587
616
  },
588
617
  children: [
589
- y.length === 0 && /* @__PURE__ */ p("option", { value: "", disabled: !0, children: "Select an option..." }),
590
- y.map((f) => /* @__PURE__ */ p("option", { value: f.value, children: f.label }, f.value))
618
+ h.length === 0 && /* @__PURE__ */ d("option", { value: "", disabled: !0, children: "Select an option..." }),
619
+ h.map((g) => /* @__PURE__ */ d("option", { value: g.value, children: g.label }, g.value))
591
620
  ]
592
621
  }
593
622
  );
@@ -596,13 +625,13 @@ const ct = x.createContext({}), V = x.createContext(
596
625
  name: r,
597
626
  nodeData: e
598
627
  }) => {
599
- const n = k((l) => l.setFormInputValue), i = L(e.style, {
628
+ const n = $((s) => s.setFormInputValue), i = R(e.style, {
600
629
  debug: !1
601
630
  });
602
- return /* @__PURE__ */ p(
631
+ return /* @__PURE__ */ d(
603
632
  "input",
604
633
  {
605
- onChange: (l) => n(t, l.target.value),
634
+ onChange: (s) => n(t, s.target.value),
606
635
  name: t,
607
636
  "data-id": t,
608
637
  "data-name": r,
@@ -618,8 +647,8 @@ const ct = x.createContext({}), V = x.createContext(
618
647
  nodeData: e,
619
648
  children: n
620
649
  }) => {
621
- const i = L(e.style);
622
- return /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p(
650
+ const i = R(e.style);
651
+ return /* @__PURE__ */ d(D, { id: t, nodeData: e, children: /* @__PURE__ */ d(
623
652
  "div",
624
653
  {
625
654
  "data-id": t,
@@ -630,21 +659,21 @@ const ct = x.createContext({}), V = x.createContext(
630
659
  }
631
660
  ) });
632
661
  }, At = ({ id: t, name: r, nodeData: e }) => {
633
- const n = L(e.style, {
662
+ const n = R(e.style, {
634
663
  debug: !1
635
- }), i = k((o) => o.assetsById), l = e.style?.positioning;
636
- if (l) {
637
- const o = typeof l.left == "number" && typeof l.right == "number", m = typeof l.top == "number" && typeof l.bottom == "number";
664
+ }), i = $((o) => o.assetsById), s = e.style?.positioning;
665
+ if (s) {
666
+ const o = typeof s.left == "number" && typeof s.right == "number", p = typeof s.top == "number" && typeof s.bottom == "number";
638
667
  if (o) {
639
- const a = 100 - l.left - l.right;
640
- n.width = `${a}%`, n.left = `${l.left}%`, delete n.right;
668
+ const a = 100 - s.left - s.right;
669
+ n.width = `${a}%`, n.left = `${s.left}%`, delete n.right;
641
670
  }
642
- if (m) {
643
- const a = 100 - l.top - l.bottom;
644
- n.height = `${a}%`, n.top = `${l.top}%`, delete n.bottom;
671
+ if (p) {
672
+ const a = 100 - s.top - s.bottom;
673
+ n.height = `${a}%`, n.top = `${s.top}%`, delete n.bottom;
645
674
  }
646
675
  }
647
- return n.objectFit || (n.objectFit = "fill"), /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p(
676
+ return n.objectFit || (n.objectFit = "fill"), /* @__PURE__ */ d(D, { id: t, nodeData: e, children: /* @__PURE__ */ d(
648
677
  "img",
649
678
  {
650
679
  "data-id": t,
@@ -655,8 +684,8 @@ const ct = x.createContext({}), V = x.createContext(
655
684
  alt: r
656
685
  }
657
686
  ) });
658
- }, Et = ({ id: t, name: r, nodeData: e }) => {
659
- const { patchedNodeData: n } = et({ id: t, nodeData: e });
687
+ }, Ft = ({ id: t, name: r, nodeData: e }) => {
688
+ const { patchedNodeData: n } = q({ id: t, nodeData: e });
660
689
  e = n;
661
690
  const i = e.data?.text;
662
691
  r && r.includes("Purpose") && console.log("TextComponent Debug:", {
@@ -666,25 +695,25 @@ const ct = x.createContext({}), V = x.createContext(
666
695
  style: e.style,
667
696
  color: e.style?.color
668
697
  });
669
- const l = e.style, o = e.fontId ? { ...l, fontId: e.fontId } : l, m = L(o, {
698
+ const s = e.style, o = e.fontId ? { ...s, fontId: e.fontId } : s, p = R(o, {
670
699
  debug: !1
671
700
  });
672
- m.display = "flex", m.flexDirection = "column", l.verticalPosition && (m.justifyContent = {
701
+ p.display = "flex", p.flexDirection = "column", s.verticalPosition && (p.justifyContent = {
673
702
  "from-top": "flex-start",
674
703
  center: "center",
675
704
  "from-bottom": "flex-end"
676
- }[l.verticalPosition]);
705
+ }[s.verticalPosition]);
677
706
  const a = i && (i.includes(`
678
707
  `) || i.includes("\r"));
679
- let y;
680
- return a && m.flexDirection === "column" ? y = i.split(/\r?\n/).filter((f) => f.length > 0).map((f, s) => /* @__PURE__ */ p("div", { style: { lineHeight: "inherit" }, children: f }, s)) : y = i, /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p(
708
+ let h;
709
+ return a && p.flexDirection === "column" ? h = i.split(/\r?\n/).filter((g) => g.length > 0).map((g, y) => /* @__PURE__ */ d("div", { style: { lineHeight: "inherit" }, children: g }, y)) : h = i, /* @__PURE__ */ d(D, { id: t, nodeData: e, children: /* @__PURE__ */ d(
681
710
  "div",
682
711
  {
683
712
  "data-id": t,
684
713
  "data-name": r,
685
714
  "data-type": "TextComponent",
686
- style: m,
687
- children: y
715
+ style: p,
716
+ children: h
688
717
  }
689
718
  ) });
690
719
  }, dt = ({
@@ -693,82 +722,82 @@ const ct = x.createContext({}), V = x.createContext(
693
722
  nodeData: e,
694
723
  children: n
695
724
  }) => {
696
- const i = N(tt), { patchedNodeData: l } = et({ id: t, nodeData: e });
697
- e = l;
698
- const o = jt(e.tags), m = o ? k((w) => w.inputGroups[o.groupName]) : null, a = k((w) => w.statefulSetVariants[t]), y = L(e.style, {
725
+ const i = N(_), { patchedNodeData: s } = q({ id: t, nodeData: e });
726
+ e = s;
727
+ const o = Ut(e.tags), p = o ? $((E) => E.inputGroups[o.groupName]) : null, a = $((E) => E.statefulSetVariants[t]), h = R(e.style, {
699
728
  debug: !1
700
729
  });
701
- let v;
702
- o && m !== null ? v = m === r ? "active" : "default" : v = a || e.data.initialState || "default";
703
- const f = x.Children.toArray(n).find((w) => x.isValidElement(w) ? w.props?.nodeData?.data?.state === v : !1), s = x.isValidElement(f) ? x.cloneElement(f, {
730
+ let F;
731
+ o && p !== null ? F = p === r ? "active" : "default" : F = a || e.data.initialState || "default";
732
+ const g = v.Children.toArray(n).find((E) => v.isValidElement(E) ? E.props?.nodeData?.data?.state === F : !1), y = v.isValidElement(g) ? v.cloneElement(g, {
704
733
  _parentStatefulSetId: t,
705
734
  _parentInputGroupInfo: o,
706
735
  _parentName: r
707
736
  // Pass the name so we can identify which element is active
708
- }) : f, u = /* @__PURE__ */ p(
737
+ }) : g, l = /* @__PURE__ */ d(
709
738
  "div",
710
739
  {
711
740
  "data-id": t,
712
741
  "data-name": r,
713
742
  "data-type": "StatefulSetComponent",
714
- style: y,
715
- children: s
743
+ style: h,
744
+ children: y
716
745
  }
717
746
  );
718
747
  if (e.type === "component:input-stateful-set")
719
- return u;
720
- const R = x.useContext(lt);
721
- return /* @__PURE__ */ p(
722
- tt.Provider,
748
+ return l;
749
+ const I = v.useContext(lt);
750
+ return /* @__PURE__ */ d(
751
+ _.Provider,
723
752
  {
724
753
  value: { nodeData: i?.nodeData?.[t] || {} },
725
- children: /* @__PURE__ */ p(
754
+ children: /* @__PURE__ */ d(
726
755
  lt.Provider,
727
756
  {
728
- value: { ...R, statefulSetId: t },
729
- children: u
757
+ value: { ...I, statefulSetId: t },
758
+ children: l
730
759
  }
731
760
  )
732
761
  }
733
762
  );
734
- }, Ft = ({
763
+ }, Et = ({
735
764
  id: t,
736
765
  name: r,
737
766
  nodeData: e,
738
767
  children: n,
739
768
  _parentStatefulSetId: i,
740
- _parentInputGroupInfo: l,
769
+ _parentInputGroupInfo: s,
741
770
  _parentName: o
742
771
  }) => {
743
- const m = L(e.style, {
772
+ const p = R(e.style, {
744
773
  debug: !1
745
774
  }), a = {
746
- ...m,
747
- position: m.position || "relative"
775
+ ...p,
776
+ position: p.position || "relative"
748
777
  };
749
- return /* @__PURE__ */ p(
778
+ return /* @__PURE__ */ d(
750
779
  "div",
751
780
  {
752
781
  "data-id": t,
753
782
  "data-name": r,
754
783
  "data-type": "StatefulCompoundComponent",
755
784
  style: a,
756
- children: /* @__PURE__ */ p(
757
- Y,
785
+ children: /* @__PURE__ */ d(
786
+ D,
758
787
  {
759
788
  id: t,
760
789
  nodeData: e,
761
790
  _parentStatefulSetId: i,
762
- _parentInputGroupInfo: l,
791
+ _parentInputGroupInfo: s,
763
792
  _parentName: o,
764
793
  children: n
765
794
  }
766
795
  )
767
796
  }
768
797
  );
769
- }, Tt = ({ id: t, name: r, children: e }) => {
770
- N(V);
771
- const { dimensions: n, ref: i } = rt(), l = {
798
+ }, Pt = ({ id: t, name: r, children: e }) => {
799
+ N(H);
800
+ const { dimensions: n, ref: i } = rt(), s = {
772
801
  zIndex: 0,
773
802
  flex: 1,
774
803
  position: "absolute",
@@ -777,14 +806,14 @@ const ct = x.createContext({}), V = x.createContext(
777
806
  width: "100%",
778
807
  height: "100%"
779
808
  };
780
- return /* @__PURE__ */ p(V.Provider, { value: { dimensions: n, isFlex: !1 }, children: /* @__PURE__ */ p(
809
+ return /* @__PURE__ */ d(H.Provider, { value: { dimensions: n, isFlex: !1 }, children: /* @__PURE__ */ d(
781
810
  "div",
782
811
  {
783
812
  "data-id": t,
784
813
  "data-name": r,
785
814
  "data-type": "BackgroundContainerComponent",
786
815
  ref: i,
787
- style: l,
816
+ style: s,
788
817
  children: e
789
818
  }
790
819
  ) });
@@ -794,57 +823,57 @@ const ct = x.createContext({}), V = x.createContext(
794
823
  nodeData: e,
795
824
  children: n,
796
825
  _arrayItemIndex: i,
797
- _arrayItemData: l
826
+ _arrayItemData: s
798
827
  }) => {
799
828
  t === "01KB929X1KK5TX0K8VBNP6ZDPG" && console.log(
800
829
  `[DEBUG] ContainerComponent ${t} (Hero) FULL nodeData:`,
801
830
  JSON.stringify(e, null, 2)
802
831
  );
803
- const o = N(tt), { patchedNodeData: m, list: a, arrayData: y } = et({
832
+ const o = N(_), { patchedNodeData: p, list: a, arrayData: h } = q({
804
833
  id: t,
805
834
  nodeData: e
806
835
  });
807
- e = m;
808
- const { dimensions: v, ref: f } = rt(), s = L(e.style, {
836
+ e = p;
837
+ const { dimensions: F, ref: g } = rt(), y = R(e.style, {
809
838
  debug: !1
810
- }), u = !!e.style.layout?.mode, R = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", w = s.width !== void 0, S = s.height !== void 0, W = N(V), $ = W?.isFlex ?? !1, h = W?.flexDirection, A = $ && h === "row", G = !$ && e.style.positioning, O = e.style.layout?.layoutSizingHorizontal === "FIXED" || e.style.layout?.layoutSizingVertical === "FIXED", j = e.style.layout?.layoutSizingHorizontal === "HUG" || e.style.layout?.layoutSizingVertical === "HUG";
811
- if (!w && !A && !(G && (O || j)) && (s.width = "100%"), !S) {
812
- const B = !$ && e.style.positioning, Z = e.style.layout?.layoutSizingVertical === "FILL";
839
+ }), l = !!e.style.layout?.mode, I = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", E = y.width !== void 0, w = y.height !== void 0, k = N(H), P = k?.isFlex ?? !1, f = k?.flexDirection, S = P && f === "row", j = !P && e.style.positioning, M = e.style.layout?.layoutSizingHorizontal === "FIXED" || e.style.layout?.layoutSizingVertical === "FIXED", G = e.style.layout?.layoutSizingHorizontal === "HUG" || e.style.layout?.layoutSizingVertical === "HUG";
840
+ if (!E && !S && !(j && (M || G)) && (y.width = "100%"), !w) {
841
+ const W = !P && e.style.positioning, Z = e.style.layout?.layoutSizingVertical === "FILL";
813
842
  if (!(e.style.layout?.layoutSizingVertical === "HUG")) {
814
- if (!u) if (B && Z && e.style.positioning?.top !== void 0) {
815
- const Q = 100 - e.style.positioning.top;
816
- s.height = `${Q}%`;
843
+ if (!l) if (W && Z && e.style.positioning?.top !== void 0) {
844
+ const tt = 100 - e.style.positioning.top;
845
+ y.height = `${tt}%`;
817
846
  } else
818
- s.height = "100%";
847
+ y.height = "100%";
819
848
  }
820
849
  }
821
- const K = e.style.layout?.layoutSizingHorizontal || e.style.layout?.layoutSizingVertical, H = e.style.positioning && !u && (K || !0) ? { ...s, position: "absolute" } : s.position === "absolute" ? s : { ...s, position: s.position || "relative" }, U = (B) => typeof B == "number" ? B : typeof B == "string" && B.endsWith("px") && parseFloat(B) || 0, M = U(s.paddingLeft), g = U(s.paddingRight), q = U(s.paddingTop), X = U(s.paddingBottom), P = O && typeof s.width == "number" && typeof s.height == "number" ? {
822
- width: s.width - M - g,
823
- height: s.height - q - X
850
+ const K = e.style.layout?.layoutSizingHorizontal || e.style.layout?.layoutSizingVertical, V = e.style.positioning && !l && (K || !0) ? { ...y, position: "absolute" } : y.position === "absolute" ? y : { ...y, position: y.position || "relative" }, U = (W) => typeof W == "number" ? W : typeof W == "string" && W.endsWith("px") && parseFloat(W) || 0, O = U(y.paddingLeft), m = U(y.paddingRight), Y = U(y.paddingTop), X = U(y.paddingBottom), L = M && typeof y.width == "number" && typeof y.height == "number" ? {
851
+ width: y.width - O - m,
852
+ height: y.height - Y - X
824
853
  } : {
825
- width: v.width - M - g,
826
- height: v.height - q - X
854
+ width: F.width - O - m,
855
+ height: F.height - Y - X
827
856
  };
828
857
  if (i != null && a) {
829
- const B = a[i];
830
- if (B !== void 0) {
831
- const Z = typeof B == "object" && B !== null ? {
832
- nodeData: B,
858
+ const W = a[i];
859
+ if (W !== void 0) {
860
+ const Z = typeof W == "object" && W !== null ? {
861
+ nodeData: W,
833
862
  arrayDataById: o?.arrayDataById,
834
863
  textOverridesById: o?.textOverridesById,
835
864
  rootData: o?.rootData
836
- } : { nodeData: B };
837
- return /* @__PURE__ */ p(tt.Provider, { value: Z, children: /* @__PURE__ */ p(
838
- V.Provider,
865
+ } : { nodeData: W };
866
+ return /* @__PURE__ */ d(_.Provider, { value: Z, children: /* @__PURE__ */ d(
867
+ H.Provider,
839
868
  {
840
- value: { dimensions: P, isFlex: u, flexDirection: R },
841
- children: /* @__PURE__ */ p(
869
+ value: { dimensions: L, isFlex: l, flexDirection: I },
870
+ children: /* @__PURE__ */ d(
842
871
  "div",
843
872
  {
844
873
  "data-id": `${t}:${i}`,
845
874
  "data-name": r,
846
875
  "data-type": "ContainerComponent",
847
- style: H,
876
+ style: V,
848
877
  children: n
849
878
  }
850
879
  )
@@ -853,29 +882,29 @@ const ct = x.createContext({}), V = x.createContext(
853
882
  }
854
883
  }
855
884
  if (a) {
856
- const B = y || a;
857
- return Ht(() => B.map((J, ot) => {
858
- const Q = typeof J == "object" && J !== null ? {
885
+ const W = h || a;
886
+ return Ht(() => W.map((J, ot) => {
887
+ const tt = typeof J == "object" && J !== null ? {
859
888
  nodeData: J,
860
889
  arrayDataById: o?.arrayDataById,
861
890
  textOverridesById: o?.textOverridesById,
862
891
  rootData: o?.rootData
863
892
  } : { nodeData: J };
864
- return /* @__PURE__ */ p(
865
- tt.Provider,
893
+ return /* @__PURE__ */ d(
894
+ _.Provider,
866
895
  {
867
- value: Q,
868
- children: /* @__PURE__ */ p(
869
- V.Provider,
896
+ value: tt,
897
+ children: /* @__PURE__ */ d(
898
+ H.Provider,
870
899
  {
871
- value: { dimensions: P, isFlex: u, flexDirection: R },
872
- children: /* @__PURE__ */ p(
900
+ value: { dimensions: L, isFlex: l, flexDirection: I },
901
+ children: /* @__PURE__ */ d(
873
902
  "div",
874
903
  {
875
904
  "data-id": `${t}:${ot}`,
876
905
  "data-name": r,
877
906
  "data-type": "ContainerComponent",
878
- style: H,
907
+ style: V,
879
908
  children: n
880
909
  }
881
910
  )
@@ -884,57 +913,57 @@ const ct = x.createContext({}), V = x.createContext(
884
913
  },
885
914
  `${t}:${ot}`
886
915
  );
887
- }), [B, t]);
916
+ }), [W, t]);
888
917
  }
889
- let F = e.actions || [];
890
- !Array.isArray(F) && typeof F == "object" && F !== null && (F = Object.entries(F).map(
891
- ([B, Z]) => ({
892
- event: B,
918
+ let T = e.actions || [];
919
+ !Array.isArray(T) && typeof T == "object" && T !== null && (T = Object.entries(T).map(
920
+ ([W, Z]) => ({
921
+ event: W,
893
922
  ...typeof Z == "object" && Z !== null ? Z : {}
894
923
  })
895
924
  ));
896
- const z = Array.isArray(F) && F.length > 0;
897
- return /* @__PURE__ */ p(
898
- V.Provider,
925
+ const z = Array.isArray(T) && T.length > 0;
926
+ return /* @__PURE__ */ d(
927
+ H.Provider,
899
928
  {
900
- value: { dimensions: P, isFlex: u, flexDirection: R },
901
- children: /* @__PURE__ */ p(
929
+ value: { dimensions: L, isFlex: l, flexDirection: I },
930
+ children: /* @__PURE__ */ d(
902
931
  "div",
903
932
  {
904
933
  "data-id": t,
905
934
  "data-name": r,
906
935
  "data-type": "ContainerComponent",
907
- ref: f,
908
- style: H,
909
- children: z ? /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: n }) : n
936
+ ref: g,
937
+ style: V,
938
+ children: z ? /* @__PURE__ */ d(D, { id: t, nodeData: e, children: n }) : n
910
939
  }
911
940
  )
912
941
  }
913
942
  );
914
- }, Pt = pt, Bt = ({ id: t, name: r, nodeData: e, children: n }) => {
915
- const { dimensions: i, ref: l } = rt(), o = L(e.style, {
943
+ }, Tt = pt, Bt = ({ id: t, name: r, nodeData: e, children: n }) => {
944
+ const { dimensions: i, ref: s } = rt(), o = R(e.style, {
916
945
  debug: !1
917
- }), m = !!e.style.layout?.mode, a = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", y = o.position ? o : { ...o, position: "relative" };
918
- return /* @__PURE__ */ p(
919
- V.Provider,
946
+ }), p = !!e.style.layout?.mode, a = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", h = o.position ? o : { ...o, position: "relative" };
947
+ return /* @__PURE__ */ d(
948
+ H.Provider,
920
949
  {
921
- value: { dimensions: i, isFlex: m, flexDirection: a },
922
- children: /* @__PURE__ */ p(
950
+ value: { dimensions: i, isFlex: p, flexDirection: a },
951
+ children: /* @__PURE__ */ d(
923
952
  "div",
924
953
  {
925
954
  "data-id": t,
926
955
  "data-name": r,
927
956
  "data-type": "TopBarContainerComponent",
928
- ref: l,
929
- style: y,
957
+ ref: s,
958
+ style: h,
930
959
  children: n
931
960
  }
932
961
  )
933
962
  }
934
963
  );
935
- }, Ut = ({ id: t, name: r, nodeData: e, children: n }) => {
936
- const i = L(e.style, { debug: !1 });
937
- return /* @__PURE__ */ p(
964
+ }, Zt = ({ id: t, name: r, nodeData: e, children: n }) => {
965
+ const i = R(e.style, { debug: !1 });
966
+ return /* @__PURE__ */ d(
938
967
  "div",
939
968
  {
940
969
  "data-id": t,
@@ -944,20 +973,20 @@ const ct = x.createContext({}), V = x.createContext(
944
973
  children: n
945
974
  }
946
975
  );
947
- }, Lt = ({ id: t, name: r, nodeData: e, children: n }) => /* @__PURE__ */ p(
976
+ }, Lt = ({ id: t, name: r, nodeData: e, children: n }) => /* @__PURE__ */ d(
948
977
  "div",
949
978
  {
950
979
  "data-id": t,
951
980
  "data-name": r,
952
981
  "data-type": "TabsMenuComponent",
953
- style: L(e.style),
982
+ style: R(e.style),
954
983
  children: n
955
984
  }
956
985
  ), Wt = ({ id: t, name: r, nodeData: e, children: n }) => {
957
- const i = L(e.style, {
986
+ const i = R(e.style, {
958
987
  debug: !1
959
988
  });
960
- return /* @__PURE__ */ p(
989
+ return /* @__PURE__ */ d(
961
990
  "div",
962
991
  {
963
992
  "data-id": t,
@@ -972,191 +1001,191 @@ const ct = x.createContext({}), V = x.createContext(
972
1001
  `[DEBUG] SliderComponent ${t} FULL nodeData:`,
973
1002
  JSON.stringify(e, null, 2)
974
1003
  );
975
- const { dimensions: i, ref: l } = rt(), o = x.useRef(null), m = x.useRef(null), a = x.useRef(!1), y = x.useRef(null), v = N(ct), f = N(Mt), { onAction: s } = N(ft), [u, R] = x.useState({
1004
+ const { dimensions: i, ref: s } = rt(), o = v.useRef(null), p = v.useRef(null), a = v.useRef(!1), h = v.useRef(null), F = N(ct), g = N(jt), { onAction: y } = N(ft), [l, I] = v.useState({
976
1005
  currentIndex: void 0,
977
1006
  onIndexChange: void 0
978
- }), [w, S] = x.useState(0), W = x.useRef(null), { patchedNodeData: $ } = et({ id: t, nodeData: e });
979
- e = $;
980
- const h = e.data?.params || {}, A = h.infinite === !0, G = h.automatic === !0;
981
- let j = Array.isArray(e.tags) && e.tags.some((c) => c.includes("container:slider:vertical")) || e.name && e.name.includes("container:slider:vertical");
982
- if (!j && h.animation === "default") {
983
- const c = e.style?.width, d = e.style?.height;
984
- typeof c == "number" && typeof d == "number" && d > c && (j = !0);
1007
+ }), [E, w] = v.useState(0), k = v.useRef(null), { patchedNodeData: P } = q({ id: t, nodeData: e });
1008
+ e = P;
1009
+ const f = e.data?.params || {}, S = f.infinite === !0, j = f.automatic === !0;
1010
+ let G = Array.isArray(e.tags) && e.tags.some((c) => c.includes("container:slider:vertical")) || e.name && e.name.includes("container:slider:vertical");
1011
+ if (!G && f.animation === "default") {
1012
+ const c = e.style?.width, u = e.style?.height;
1013
+ typeof c == "number" && typeof u == "number" && u > c && (G = !0);
985
1014
  }
986
- const K = j ? "vertical" : h.animation === "default" ? "horizontal" : h.animation || "horizontal", E = L(e.style, {
1015
+ const K = G ? "vertical" : f.animation === "default" ? "horizontal" : f.animation || "horizontal", A = R(e.style, {
987
1016
  debug: !1
988
- }), H = E.width !== void 0, U = E.height !== void 0;
989
- H || (E.width = "100%"), U || (E.height = "100%"), E.position || (E.position = "relative");
990
- const M = N(tt), g = x.useMemo(() => {
1017
+ }), V = A.width !== void 0, U = A.height !== void 0;
1018
+ V || (A.width = "100%"), U || (A.height = "100%"), A.position || (A.position = "relative");
1019
+ const O = N(_), m = v.useMemo(() => {
991
1020
  const c = [];
992
- return x.Children.forEach(n, (d) => {
993
- if (d == null) return;
994
- const I = d?.props || {}, C = I.nodeData || {};
995
- if (Array.isArray(C?.tags) && (C.tags.includes("encore:data:array") || C.tags.includes("bravo:data:array")) && I.id && M) {
996
- const T = M?.arrayDataById && M.arrayDataById[I.id] && Array.isArray(M.arrayDataById[I.id]) ? M.arrayDataById[I.id] : null;
997
- T && T.length > 0 ? T.forEach((D, nt) => {
1021
+ return v.Children.forEach(n, (u) => {
1022
+ if (u == null) return;
1023
+ const x = u?.props || {}, C = x.nodeData || {};
1024
+ if (Array.isArray(C?.tags) && (C.tags.includes("encore:data:array") || C.tags.includes("bravo:data:array")) && x.id && O) {
1025
+ const B = O?.arrayDataById && O.arrayDataById[x.id] && Array.isArray(O.arrayDataById[x.id]) ? O.arrayDataById[x.id] : null;
1026
+ B && B.length > 0 ? B.forEach((et, nt) => {
998
1027
  c.push(
999
- x.cloneElement(d, {
1000
- key: `${I.id}:${nt}`,
1028
+ v.cloneElement(u, {
1029
+ key: `${x.id}:${nt}`,
1001
1030
  // ContainerComponent will use this to know which item to render
1002
1031
  _arrayItemIndex: nt,
1003
- _arrayItemData: D
1032
+ _arrayItemData: et
1004
1033
  })
1005
1034
  );
1006
- }) : c.push(d);
1035
+ }) : c.push(u);
1007
1036
  } else
1008
- c.push(d);
1037
+ c.push(u);
1009
1038
  }), c;
1010
- }, [n, t, M]), q = x.useMemo(() => {
1011
- if (!A || g.length === 0)
1012
- return g;
1013
- const c = g[0], d = g[g.length - 1];
1039
+ }, [n, t, O]), Y = v.useMemo(() => {
1040
+ if (!S || m.length === 0)
1041
+ return m;
1042
+ const c = m[0], u = m[m.length - 1];
1014
1043
  return [
1015
- x.cloneElement(d, {
1016
- key: `clone-last-${d.key || d.props.id}`
1044
+ v.cloneElement(u, {
1045
+ key: `clone-last-${u.key || u.props.id}`
1017
1046
  }),
1018
- ...g,
1019
- x.cloneElement(c, {
1047
+ ...m,
1048
+ v.cloneElement(c, {
1020
1049
  key: `clone-first-${c.key || c.props.id}`
1021
1050
  })
1022
1051
  ];
1023
- }, [g, A]), X = x.useMemo(() => {
1024
- if (g.length === 0) return { width: 0, height: 0 };
1025
- const d = g[0]?.props?.nodeData?.style, I = v.scaleFactor || 1;
1052
+ }, [m, S]), X = v.useMemo(() => {
1053
+ if (m.length === 0) return { width: 0, height: 0 };
1054
+ const u = m[0]?.props?.nodeData?.style, x = F.scaleFactor || 1;
1026
1055
  let C = 0, b = 0;
1027
- return d?.layout?.layoutSizingHorizontal === "FIXED" && d?.layout?.size?.x ? C = d.layout.size.x * I : C = i.width || 0, d?.layout?.layoutSizingVertical === "FIXED" && d?.layout?.size?.y ? b = d.layout.size.y * I : b = i.height || 0, { width: C, height: b };
1028
- }, [g, i.width, i.height, v.scaleFactor]), P = X.width, F = X.height, z = K === "vertical", _ = x.useCallback(() => {
1029
- if (!o.current || g.length === 0)
1056
+ return u?.layout?.layoutSizingHorizontal === "FIXED" && u?.layout?.size?.x ? C = u.layout.size.x * x : C = i.width || 0, u?.layout?.layoutSizingVertical === "FIXED" && u?.layout?.size?.y ? b = u.layout.size.y * x : b = i.height || 0, { width: C, height: b };
1057
+ }, [m, i.width, i.height, F.scaleFactor]), L = X.width, T = X.height, z = K === "vertical", Q = v.useCallback(() => {
1058
+ if (!o.current || m.length === 0)
1030
1059
  return 0;
1031
1060
  const c = o.current;
1032
1061
  if (z) {
1033
- if (F === 0) return 0;
1034
- const d = c.scrollTop;
1035
- if (A) {
1036
- const C = d - F;
1037
- let b = Math.round(C / F);
1038
- return b < 0 && (b = 0), b >= g.length && (b = g.length - 1), b;
1062
+ if (T === 0) return 0;
1063
+ const u = c.scrollTop;
1064
+ if (S) {
1065
+ const C = u - T;
1066
+ let b = Math.round(C / T);
1067
+ return b < 0 && (b = 0), b >= m.length && (b = m.length - 1), b;
1039
1068
  } else {
1040
- const I = Math.round(d / F);
1041
- return I < 0 ? 0 : I >= g.length ? g.length - 1 : I;
1069
+ const x = Math.round(u / T);
1070
+ return x < 0 ? 0 : x >= m.length ? m.length - 1 : x;
1042
1071
  }
1043
1072
  } else {
1044
- if (P === 0) return 0;
1045
- const d = c.scrollLeft;
1046
- if (A) {
1047
- const C = d - P;
1048
- let b = Math.round(C / P);
1049
- return b < 0 && (b = 0), b >= g.length && (b = g.length - 1), b;
1073
+ if (L === 0) return 0;
1074
+ const u = c.scrollLeft;
1075
+ if (S) {
1076
+ const C = u - L;
1077
+ let b = Math.round(C / L);
1078
+ return b < 0 && (b = 0), b >= m.length && (b = m.length - 1), b;
1050
1079
  } else {
1051
- const I = Math.round(d / P);
1052
- return I < 0 ? 0 : I >= g.length ? g.length - 1 : I;
1080
+ const x = Math.round(u / L);
1081
+ return x < 0 ? 0 : x >= m.length ? m.length - 1 : x;
1053
1082
  }
1054
1083
  }
1055
- }, [A, g.length, P, F, z]), B = x.useCallback(
1056
- (c, d = !0) => {
1057
- if (!o.current || g.length === 0) return;
1058
- const I = o.current;
1084
+ }, [S, m.length, L, T, z]), W = v.useCallback(
1085
+ (c, u = !0) => {
1086
+ if (!o.current || m.length === 0) return;
1087
+ const x = o.current;
1059
1088
  if (z) {
1060
1089
  let C;
1061
- A ? C = F + c * F : C = c * F, I.scrollTo({
1090
+ S ? C = T + c * T : C = c * T, x.scrollTo({
1062
1091
  top: C,
1063
- behavior: d ? "smooth" : "auto"
1092
+ behavior: u ? "smooth" : "auto"
1064
1093
  });
1065
1094
  } else {
1066
1095
  let C;
1067
- A ? C = P + c * P : C = c * P, I.scrollTo({
1096
+ S ? C = L + c * L : C = c * L, x.scrollTo({
1068
1097
  left: C,
1069
- behavior: d ? "smooth" : "auto"
1098
+ behavior: u ? "smooth" : "auto"
1070
1099
  });
1071
1100
  }
1072
1101
  },
1073
- [P, F, A, g.length, z]
1074
- ), Z = x.useCallback(() => {
1075
- if (!A || !o.current || g.length === 0) return;
1076
- const c = o.current, d = 1;
1102
+ [L, T, S, m.length, z]
1103
+ ), Z = v.useCallback(() => {
1104
+ if (!S || !o.current || m.length === 0) return;
1105
+ const c = o.current, u = 1;
1077
1106
  if (z) {
1078
- if (F === 0) return;
1079
- const I = c.scrollTop, C = F, b = C, T = b + g.length * C;
1080
- I >= T - d ? c.scrollTop = b : I <= d && (c.scrollTop = T - C);
1107
+ if (T === 0) return;
1108
+ const x = c.scrollTop, C = T, b = C, B = b + m.length * C;
1109
+ x >= B - u ? c.scrollTop = b : x <= u && (c.scrollTop = B - C);
1081
1110
  } else {
1082
- if (P === 0) return;
1083
- const I = c.scrollLeft, C = P, b = C, T = b + g.length * C;
1084
- I >= T - d ? c.scrollLeft = b : I <= d && (c.scrollLeft = T - C);
1111
+ if (L === 0) return;
1112
+ const x = c.scrollLeft, C = L, b = C, B = b + m.length * C;
1113
+ x >= B - u ? c.scrollLeft = b : x <= u && (c.scrollLeft = B - C);
1085
1114
  }
1086
- }, [A, g.length, P, F, z]);
1087
- x.useEffect(() => {
1088
- if (!G || g.length <= 1 || P === 0) return;
1115
+ }, [S, m.length, L, T, z]);
1116
+ v.useEffect(() => {
1117
+ if (!j || m.length <= 1 || L === 0) return;
1089
1118
  const c = () => {
1090
1119
  if (a.current || !o.current) return;
1091
- const d = o.current;
1120
+ const u = o.current;
1092
1121
  if (z) {
1093
- if (F === 0) return;
1094
- const I = d.scrollTop, C = F;
1122
+ if (T === 0) return;
1123
+ const x = u.scrollTop, C = T;
1095
1124
  let b;
1096
- if (A) {
1097
- const nt = I - C;
1098
- b = Math.round(nt / C), b < 0 && (b = 0), b >= g.length && (b = g.length - 1);
1125
+ if (S) {
1126
+ const nt = x - C;
1127
+ b = Math.round(nt / C), b < 0 && (b = 0), b >= m.length && (b = m.length - 1);
1099
1128
  } else
1100
- b = Math.round(I / C);
1101
- let T = b + 1;
1102
- if (A) {
1103
- T >= g.length && (T = 0);
1104
- const D = C;
1105
- d.scrollTo({
1106
- top: D + T * C,
1129
+ b = Math.round(x / C);
1130
+ let B = b + 1;
1131
+ if (S) {
1132
+ B >= m.length && (B = 0);
1133
+ const et = C;
1134
+ u.scrollTo({
1135
+ top: et + B * C,
1107
1136
  behavior: "smooth"
1108
1137
  });
1109
1138
  } else
1110
- T >= g.length && (T = 0), B(T);
1139
+ B >= m.length && (B = 0), W(B);
1111
1140
  } else {
1112
- if (P === 0) return;
1113
- const I = d.scrollLeft, C = P;
1141
+ if (L === 0) return;
1142
+ const x = u.scrollLeft, C = L;
1114
1143
  let b;
1115
- if (A) {
1116
- const nt = I - C;
1117
- b = Math.round(nt / C), b < 0 && (b = 0), b >= g.length && (b = g.length - 1);
1144
+ if (S) {
1145
+ const nt = x - C;
1146
+ b = Math.round(nt / C), b < 0 && (b = 0), b >= m.length && (b = m.length - 1);
1118
1147
  } else
1119
- b = Math.round(I / C);
1120
- let T = b + 1;
1121
- if (A) {
1122
- T >= g.length && (T = 0);
1123
- const D = C;
1124
- d.scrollTo({
1125
- left: D + T * C,
1148
+ b = Math.round(x / C);
1149
+ let B = b + 1;
1150
+ if (S) {
1151
+ B >= m.length && (B = 0);
1152
+ const et = C;
1153
+ u.scrollTo({
1154
+ left: et + B * C,
1126
1155
  behavior: "smooth"
1127
1156
  });
1128
1157
  } else
1129
- T >= g.length && (T = 0), B(T);
1158
+ B >= m.length && (B = 0), W(B);
1130
1159
  }
1131
1160
  };
1132
- return m.current = setInterval(c, 4e3), () => {
1133
- m.current && (clearInterval(m.current), m.current = null);
1161
+ return p.current = setInterval(c, 4e3), () => {
1162
+ p.current && (clearInterval(p.current), p.current = null);
1134
1163
  };
1135
1164
  }, [
1136
- G,
1137
- g.length,
1138
- A,
1139
- P,
1140
- F,
1165
+ j,
1166
+ m.length,
1167
+ S,
1168
+ L,
1169
+ T,
1141
1170
  z,
1142
- B
1171
+ W
1143
1172
  ]);
1144
- const J = x.useCallback(() => {
1145
- a.current = !0, y.current && clearTimeout(y.current), y.current = setTimeout(() => {
1173
+ const J = v.useCallback(() => {
1174
+ a.current = !0, h.current && clearTimeout(h.current), h.current = setTimeout(() => {
1146
1175
  a.current = !1;
1147
1176
  }, 3e3);
1148
- }, []), ot = x.useRef(u);
1149
- x.useEffect(() => {
1150
- ot.current = u;
1151
- }, [u]);
1152
- const Q = x.useCallback(
1177
+ }, []), ot = v.useRef(l);
1178
+ v.useEffect(() => {
1179
+ ot.current = l;
1180
+ }, [l]);
1181
+ const tt = v.useCallback(
1153
1182
  (c) => {
1154
- if (W.current === c) return;
1155
- W.current = c;
1156
- const d = ot.current;
1157
- if (d.currentIndex === void 0 && S(c), d.onIndexChange && d.onIndexChange(c), typeof s == "function")
1183
+ if (k.current === c) return;
1184
+ k.current = c;
1185
+ const u = ot.current;
1186
+ if (u.currentIndex === void 0 && w(c), u.onIndexChange && u.onIndexChange(c), typeof y == "function")
1158
1187
  try {
1159
- s({
1188
+ y({
1160
1189
  bravo: {
1161
1190
  cancel: () => {
1162
1191
  },
@@ -1170,77 +1199,77 @@ const ct = x.createContext({}), V = x.createContext(
1170
1199
  } catch {
1171
1200
  }
1172
1201
  },
1173
- [s, t]
1202
+ [y, t]
1174
1203
  // Depend on onAction to ensure we call the latest version
1175
1204
  );
1176
- x.useEffect(() => {
1205
+ v.useEffect(() => {
1177
1206
  const c = o.current;
1178
1207
  if (!c) return;
1179
- let d = null;
1180
- const I = () => {
1181
- J(), A ? (d !== null && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
1208
+ let u = null;
1209
+ const x = () => {
1210
+ J(), S ? (u !== null && cancelAnimationFrame(u), u = requestAnimationFrame(() => {
1182
1211
  Z();
1183
- const T = _();
1184
- Q(T);
1185
- })) : (d !== null && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
1186
- const T = _();
1187
- Q(T);
1212
+ const B = Q();
1213
+ tt(B);
1214
+ })) : (u !== null && cancelAnimationFrame(u), u = requestAnimationFrame(() => {
1215
+ const B = Q();
1216
+ tt(B);
1188
1217
  }));
1189
1218
  }, C = () => J(), b = () => J();
1190
- return c.addEventListener("scroll", I, { passive: !0 }), c.addEventListener("touchstart", C, {
1219
+ return c.addEventListener("scroll", x, { passive: !0 }), c.addEventListener("touchstart", C, {
1191
1220
  passive: !0
1192
1221
  }), c.addEventListener("mousedown", b), () => {
1193
- c.removeEventListener("scroll", I), c.removeEventListener("touchstart", C), c.removeEventListener("mousedown", b), y.current && clearTimeout(y.current), d !== null && cancelAnimationFrame(d);
1222
+ c.removeEventListener("scroll", x), c.removeEventListener("touchstart", C), c.removeEventListener("mousedown", b), h.current && clearTimeout(h.current), u !== null && cancelAnimationFrame(u);
1194
1223
  };
1195
1224
  }, [
1196
- A,
1225
+ S,
1197
1226
  J,
1198
1227
  Z,
1199
- _,
1200
- Q
1201
- ]), x.useEffect(() => {
1202
- if (f) {
1203
- const c = f.getControlProps(t);
1204
- c && c !== u && R(c);
1228
+ Q,
1229
+ tt
1230
+ ]), v.useEffect(() => {
1231
+ if (g) {
1232
+ const c = g.getControlProps(t);
1233
+ c && c !== l && I(c);
1205
1234
  }
1206
- }, [t, f, u]), x.useEffect(() => {
1207
- if (u.currentIndex !== void 0 && o.current && g.length > 0 && P > 0) {
1235
+ }, [t, g, l]), v.useEffect(() => {
1236
+ if (l.currentIndex !== void 0 && o.current && m.length > 0 && L > 0) {
1208
1237
  const c = Math.max(
1209
1238
  0,
1210
- Math.min(u.currentIndex, g.length - 1)
1211
- ), d = _();
1212
- c !== d && B(c, !0);
1239
+ Math.min(l.currentIndex, m.length - 1)
1240
+ ), u = Q();
1241
+ c !== u && W(c, !0);
1213
1242
  }
1214
1243
  }, [
1215
- u.currentIndex,
1216
- g.length,
1217
- g.length,
1218
- P,
1219
- F,
1244
+ l.currentIndex,
1245
+ m.length,
1246
+ m.length,
1247
+ L,
1248
+ T,
1220
1249
  z,
1221
- B,
1222
- _
1223
- ]), x.useEffect(() => {
1224
- if (A && o.current && g.length > 0 && g.length > 0 && (z ? F > 0 : P > 0)) {
1225
- const c = z ? F : P;
1250
+ W,
1251
+ Q
1252
+ ]), v.useEffect(() => {
1253
+ if (S && o.current && m.length > 0 && m.length > 0 && (z ? T > 0 : L > 0)) {
1254
+ const c = z ? T : L;
1226
1255
  setTimeout(() => {
1227
1256
  o.current && (z ? o.current.scrollTop = c : o.current.scrollLeft = c);
1228
1257
  }, 0);
1229
1258
  }
1230
- }, [A, g.length, P, F, z]), x.useEffect(() => {
1231
- if (!f) return;
1232
- const { registerContainer: c, unregisterContainer: d } = f;
1259
+ }, [S, m.length, L, T, z]), v.useEffect(() => {
1260
+ if (!g) return;
1261
+ const { registerContainer: c, unregisterContainer: u } = g;
1233
1262
  return () => {
1234
1263
  };
1235
1264
  }, [
1236
1265
  t,
1237
- f?.registerContainer,
1238
- f?.unregisterContainer,
1266
+ g?.registerContainer,
1267
+ g?.unregisterContainer,
1239
1268
  // controlProps, // REMOVED to break infinite loop
1240
- B,
1241
- _
1269
+ W,
1270
+ Q
1242
1271
  ]);
1243
- const $t = {
1272
+ const zt = {
1244
1273
  display: "flex",
1245
1274
  flexDirection: z ? "column" : "row",
1246
1275
  overflowX: z ? "hidden" : "auto",
@@ -1251,23 +1280,23 @@ const ct = x.createContext({}), V = x.createContext(
1251
1280
  height: "100%",
1252
1281
  WebkitOverflowScrolling: "touch"
1253
1282
  // Smooth scrolling on iOS
1254
- }, zt = {
1283
+ }, Vt = {
1255
1284
  flexShrink: 0,
1256
1285
  scrollSnapAlign: "start",
1257
1286
  width: X.width > 0 ? X.width : void 0,
1258
1287
  height: X.height > 0 ? X.height : void 0,
1259
1288
  position: "relative"
1260
1289
  };
1261
- return /* @__PURE__ */ p(
1290
+ return /* @__PURE__ */ d(
1262
1291
  "div",
1263
1292
  {
1264
1293
  "data-id": t,
1265
1294
  "data-name": r,
1266
1295
  "data-type": "SliderComponent",
1267
- ref: l,
1268
- style: E,
1269
- children: /* @__PURE__ */ p("div", { ref: o, style: $t, children: q.map((c, d) => /* @__PURE__ */ p(
1270
- V.Provider,
1296
+ ref: s,
1297
+ style: A,
1298
+ children: /* @__PURE__ */ d("div", { ref: o, style: zt, children: Y.map((c, u) => /* @__PURE__ */ d(
1299
+ H.Provider,
1271
1300
  {
1272
1301
  value: {
1273
1302
  dimensions: {
@@ -1276,33 +1305,41 @@ const ct = x.createContext({}), V = x.createContext(
1276
1305
  },
1277
1306
  isFlex: !1
1278
1307
  },
1279
- children: /* @__PURE__ */ p("div", { style: zt, children: c })
1308
+ children: /* @__PURE__ */ d("div", { style: Vt, children: c })
1280
1309
  },
1281
- c.key || `slide-${d}`
1310
+ c.key || `slide-${u}`
1282
1311
  )) })
1283
1312
  }
1284
1313
  );
1285
- }, kt = (t, r) => {
1314
+ }, $t = (t, r) => {
1286
1315
  const e = Array.isArray(t) ? t : [t];
1287
1316
  for (const n of e)
1288
1317
  if (!(!n || !n.props)) {
1289
1318
  if (n.props.id === r)
1290
1319
  return n;
1291
1320
  if (n.props.children) {
1292
- const i = kt(n.props.children, r);
1321
+ const i = $t(n.props.children, r);
1293
1322
  if (i) return i;
1294
1323
  }
1295
1324
  }
1296
1325
  return null;
1297
1326
  }, Rt = ({ id: t, name: r, nodeData: e, children: n }) => {
1298
- const { dimensions: i, ref: l } = rt(), { componentId: o } = N(lt), m = N(V), a = e.style.originalSize?.[0] || 1, y = e.style.originalSize?.[1] || 1, v = m?.dimensions?.width, f = m?.dimensions?.height, s = window.innerWidth, u = window.innerHeight, R = v && v > 0 && v < s * 0.8;
1299
- let w, S;
1300
- i.width > 0 && i.height > 0 ? (w = i.width, S = i.height) : R && v && f || v && f && v > 0 && f > 0 ? (w = v, S = f) : (w = s, S = u);
1301
- const $ = { scaleFactor: Math.min(w / a, S / y) || 1 };
1327
+ const { dimensions: i, ref: s } = rt(), { componentId: o } = N(lt), p = N(H), a = e.style.originalSize?.[0] || 375;
1328
+ e.style.originalSize?.[1];
1329
+ const h = p?.dimensions?.width, F = p?.dimensions?.height, g = window.innerWidth, y = h && h > 0 && h < g * 0.8;
1330
+ let l;
1331
+ i.width > 0 && i.height > 0 ? (l = i.width, i.height) : y && h && F || h && F && h > 0 && F > 0 ? l = h : l = g;
1332
+ const I = a < 768;
1333
+ let E = l, w = "100%";
1334
+ if (I && l > a * 1.5) {
1335
+ const A = Math.round(a * 1.5);
1336
+ E = A, w = A;
1337
+ }
1338
+ const P = { scaleFactor: E / a || 1 };
1302
1339
  if (o) {
1303
- const E = kt(n, o);
1304
- return E ? /* @__PURE__ */ p(ct.Provider, { value: $, children: /* @__PURE__ */ p(
1305
- V.Provider,
1340
+ const A = $t(n, o);
1341
+ return A ? /* @__PURE__ */ d(ct.Provider, { value: P, children: /* @__PURE__ */ d(
1342
+ H.Provider,
1306
1343
  {
1307
1344
  value: {
1308
1345
  dimensions: {
@@ -1310,57 +1347,59 @@ const ct = x.createContext({}), V = x.createContext(
1310
1347
  height: "100%"
1311
1348
  }
1312
1349
  },
1313
- children: E
1350
+ children: A
1314
1351
  }
1315
1352
  ) }) : (console.warn(`Child with id "${o}" not found`), null);
1316
1353
  }
1317
- const h = Array.isArray(n) ? n : [n], { scrollableChildren: A, nonScrollableChildren: G } = h.reduce(
1318
- (E, H) => {
1319
- const M = H.props.nodeData.type === "container:top-bar" ? "nonScrollableChildren" : "scrollableChildren";
1320
- return E[M].push(H), E;
1354
+ const f = Array.isArray(n) ? n : [n], { scrollableChildren: S, nonScrollableChildren: j } = f.reduce(
1355
+ (A, V) => {
1356
+ const O = V.props.nodeData.type === "container:top-bar" ? "nonScrollableChildren" : "scrollableChildren";
1357
+ return A[O].push(V), A;
1321
1358
  },
1322
1359
  {
1323
1360
  scrollableChildren: [],
1324
1361
  nonScrollableChildren: []
1325
1362
  }
1326
1363
  );
1327
- let O = e.style?.layout?.mode;
1328
- if (!O && t === "01KASW494V02Y8P5JVWV5XK62X" && (console.log("🔧 PATCHING missing layout for page", t), O = "HORIZONTAL"), !O && n) {
1329
- const E = Array.isArray(n) ? n : [n];
1330
- let H = 0, U = 0;
1331
- E.forEach((g) => {
1332
- const q = g?.props?.nodeData?.style?.width;
1333
- q && (H += q, q < 99 && U++);
1334
- }), U > 0 && H >= 99 && (console.log(
1335
- `[PATCH] Detected HORIZONTAL WRAP layout for page ${t} (Partial width children: ${U}, Total width: ${H})`
1336
- ), O = "HORIZONTAL", e.style || (e.style = {}), e.style.layout || (e.style.layout = {}), e.style.layout.mode = "HORIZONTAL", e.style.layout.flexWrap = "wrap", e.style.layout.primaryAxisAlignItems = "flex-start", e.style.layout.counterAxisAlignItems = "flex-start");
1364
+ let M = e.style?.layout?.mode;
1365
+ if (!M && t === "01KASW494V02Y8P5JVWV5XK62X" && (console.log("🔧 PATCHING missing layout for page", t), M = "HORIZONTAL"), !M && n) {
1366
+ const A = Array.isArray(n) ? n : [n];
1367
+ let V = 0, U = 0;
1368
+ A.forEach((m) => {
1369
+ const Y = m?.props?.nodeData?.style?.width;
1370
+ Y && (V += Y, Y < 99 && U++);
1371
+ }), U > 0 && V >= 99 && (console.log(
1372
+ `[PATCH] Detected HORIZONTAL WRAP layout for page ${t} (Partial width children: ${U}, Total width: ${V})`
1373
+ ), M = "HORIZONTAL", e.style || (e.style = {}), e.style.layout || (e.style.layout = {}), e.style.layout.mode = "HORIZONTAL", e.style.layout.flexWrap = "wrap", e.style.layout.primaryAxisAlignItems = "flex-start", e.style.layout.counterAxisAlignItems = "flex-start");
1337
1374
  }
1338
- const j = O === "HORIZONTAL" ? "row" : "column", K = G.some(
1339
- (E) => E?.props?.nodeData?.type !== "container:background"
1375
+ const G = M === "HORIZONTAL" ? "row" : "column", K = j.some(
1376
+ (A) => A?.props?.nodeData?.type !== "container:background"
1340
1377
  );
1341
- return /* @__PURE__ */ p(ct.Provider, { value: $, children: /* @__PURE__ */ it(
1378
+ return /* @__PURE__ */ d(ct.Provider, { value: P, children: /* @__PURE__ */ it(
1342
1379
  "div",
1343
1380
  {
1344
1381
  style: {
1345
1382
  width: "100%",
1346
1383
  height: "100%",
1384
+ maxWidth: typeof w == "number" ? `${w}px` : w,
1385
+ margin: I ? "0 auto" : 0,
1347
1386
  position: "relative",
1348
1387
  overflow: "hidden",
1349
1388
  // Only use flex if we have non-background nonScrollableChildren (like top-bar)
1350
1389
  ...K ? {
1351
1390
  display: "flex",
1352
- flexDirection: j,
1391
+ flexDirection: G,
1353
1392
  gap: 0,
1354
1393
  rowGap: 0,
1355
1394
  columnGap: 0
1356
1395
  } : {}
1357
1396
  },
1358
- ref: l,
1397
+ ref: s,
1359
1398
  children: [
1360
- G.filter(
1361
- (E) => E?.props?.nodeData?.type === "container:background"
1362
- ).map((E, H) => /* @__PURE__ */ p(
1363
- V.Provider,
1399
+ j.filter(
1400
+ (A) => A?.props?.nodeData?.type === "container:background"
1401
+ ).map((A, V) => /* @__PURE__ */ d(
1402
+ H.Provider,
1364
1403
  {
1365
1404
  value: {
1366
1405
  dimensions: {
@@ -1368,14 +1407,14 @@ const ct = x.createContext({}), V = x.createContext(
1368
1407
  height: i.height
1369
1408
  }
1370
1409
  },
1371
- children: E
1410
+ children: A
1372
1411
  },
1373
- `bg-${H}`
1412
+ `bg-${V}`
1374
1413
  )),
1375
- K && G.filter(
1376
- (E) => E?.props?.nodeData?.type !== "container:background"
1377
- ).map((E, H) => /* @__PURE__ */ p(
1378
- V.Provider,
1414
+ K && j.filter(
1415
+ (A) => A?.props?.nodeData?.type !== "container:background"
1416
+ ).map((A, V) => /* @__PURE__ */ d(
1417
+ H.Provider,
1379
1418
  {
1380
1419
  value: {
1381
1420
  dimensions: {
@@ -1383,11 +1422,11 @@ const ct = x.createContext({}), V = x.createContext(
1383
1422
  height: i.height
1384
1423
  }
1385
1424
  },
1386
- children: E
1425
+ children: A
1387
1426
  },
1388
- `non-scroll-${H}`
1427
+ `non-scroll-${V}`
1389
1428
  )),
1390
- /* @__PURE__ */ p(V.Provider, { value: { dimensions: i }, children: /* @__PURE__ */ p(
1429
+ /* @__PURE__ */ d(H.Provider, { value: { dimensions: i }, children: /* @__PURE__ */ d(
1391
1430
  "div",
1392
1431
  {
1393
1432
  "data-id": t,
@@ -1397,45 +1436,67 @@ const ct = x.createContext({}), V = x.createContext(
1397
1436
  position: "relative",
1398
1437
  ...K ? {
1399
1438
  flex: 1,
1400
- ...j === "row" ? { alignSelf: "stretch" } : {}
1439
+ ...G === "row" ? { alignSelf: "stretch" } : {}
1401
1440
  // Removed height: "100%" to allow HUG containers to size based on content
1402
1441
  } : {
1403
1442
  width: "100%"
1404
1443
  // Removed height: "100%" to allow HUG containers to size based on content
1405
1444
  },
1406
1445
  // Remove overflow: auto in horizontal mode as it causes height collapse
1407
- ...j === "column" && { overflow: "auto" },
1408
- ...L(e.style, {
1446
+ ...G === "column" && { overflow: "auto" },
1447
+ ...R(e.style, {
1409
1448
  debug: !1
1410
1449
  })
1411
1450
  },
1412
- children: A
1451
+ children: S
1413
1452
  }
1414
1453
  ) })
1415
1454
  ]
1416
1455
  }
1417
1456
  ) });
1418
- }, Dt = {
1457
+ }, kt = ({
1458
+ id: t,
1459
+ nodeData: r,
1460
+ children: e
1461
+ }) => {
1462
+ const i = N(_)?.embedsById?.[t], s = R(r.style, { debug: !1 });
1463
+ return i ? /* @__PURE__ */ d(
1464
+ "div",
1465
+ {
1466
+ style: {
1467
+ ...s,
1468
+ display: "flex",
1469
+ flexDirection: "column",
1470
+ // Reset positioning if provided by wrapper
1471
+ position: "absolute"
1472
+ },
1473
+ "data-type": "EmbedComponent",
1474
+ "data-id": t,
1475
+ children: i
1476
+ }
1477
+ ) : /* @__PURE__ */ d("div", { style: s, "data-type": "EmbedComponent-Empty", "data-id": t, children: e });
1478
+ }, ee = {
1479
+ EmbedComponent: kt,
1419
1480
  WebViewComponent: ht,
1420
1481
  ColorComponent: gt,
1421
1482
  GradientComponent: mt,
1422
1483
  ImageComponent: yt,
1423
1484
  EmailInputComponent: bt,
1424
1485
  HiddenInputComponent: Ct,
1425
- ImageInputComponent: St,
1486
+ ImageInputComponent: vt,
1426
1487
  PasswordInputComponent: xt,
1427
- SelectInputComponent: vt,
1488
+ SelectInputComponent: St,
1428
1489
  TextInputComponent: It,
1429
1490
  LottieComponent: wt,
1430
1491
  SvgComponent: At,
1431
- TextComponent: Et,
1492
+ TextComponent: Ft,
1432
1493
  StatefulSetComponent: dt,
1433
- StatefulCompoundComponent: Ft,
1434
- BackgroundContainerComponent: Tt,
1494
+ StatefulCompoundComponent: Et,
1495
+ BackgroundContainerComponent: Pt,
1435
1496
  ContainerComponent: pt,
1436
- CompoundComponent: Pt,
1497
+ CompoundComponent: Tt,
1437
1498
  TopBarContainerComponent: Bt,
1438
- DefaultLayerComponent: Ut,
1499
+ DefaultLayerComponent: Zt,
1439
1500
  TabsMenuComponent: Lt,
1440
1501
  MenuSideComponent: Wt,
1441
1502
  SliderComponent: at,
@@ -1443,32 +1504,34 @@ const ct = x.createContext({}), V = x.createContext(
1443
1504
  // Type string mappings for dynamically loaded components
1444
1505
  "menu:side": Wt,
1445
1506
  "page:default": Rt,
1446
- "container:background": Tt,
1507
+ "container:background": Pt,
1447
1508
  "container:default": pt,
1448
1509
  "container:top-bar": Bt,
1449
1510
  "container:slider": at,
1450
- "component:text": Et,
1511
+ "component:text": Ft,
1451
1512
  "component:color": gt,
1452
1513
  "component:gradient": mt,
1453
1514
  "component:image": yt,
1454
1515
  "component:svg": At,
1455
- "component:compound": Pt,
1516
+ "component:compound": Tt,
1456
1517
  "component:input-stateful-set": dt,
1457
1518
  "component:stateful-set": dt,
1458
- "component:stateful-compound": Ft,
1519
+ "component:stateful-compound": Et,
1459
1520
  "component:slider": at,
1460
1521
  "component:webview": ht,
1522
+ "component:video": Xt,
1461
1523
  "component:lottie": wt,
1462
1524
  "component:email-input": bt,
1463
1525
  "component:text-input": It,
1464
1526
  "component:password-input": xt,
1465
- "component:select-input": vt,
1466
- "component:image-input": St,
1527
+ "component:select-input": St,
1528
+ "component:image-input": vt,
1467
1529
  "component:hidden-input": Ct,
1468
1530
  "component:tabs-menu": Lt,
1531
+ "component:embed": kt,
1469
1532
  ContainerSliderComponent: at
1470
1533
  };
1471
1534
  export {
1472
- Dt as default
1535
+ ee as default
1473
1536
  };
1474
1537
  //# sourceMappingURL=components.js.map