@bravostudioai/react 0.1.12 → 0.1.14

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