@builder.io/sdk-react-nextjs 0.16.19 → 0.16.23

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.
Files changed (49) hide show
  1. package/lib/browser/blocks/columns/columns.cjs +3 -3
  2. package/lib/browser/blocks/columns/columns.mjs +42 -34
  3. package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
  4. package/lib/browser/components/blocks/blocks-wrapper.mjs +26 -20
  5. package/lib/browser/components/content/components/enable-editor.cjs +1 -1
  6. package/lib/browser/components/content/components/enable-editor.mjs +58 -57
  7. package/lib/browser/constants/sdk-version.cjs +1 -1
  8. package/lib/browser/constants/sdk-version.mjs +1 -1
  9. package/lib/browser/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
  10. package/lib/browser/functions/evaluate/node-runtime/node-runtime.mjs +16 -14
  11. package/lib/browser/functions/log-fetch.cjs +1 -0
  12. package/lib/browser/functions/log-fetch.mjs +8 -0
  13. package/lib/browser/functions/track/index.cjs +1 -1
  14. package/lib/browser/functions/track/index.mjs +18 -14
  15. package/lib/edge/blocks/columns/columns.cjs +3 -3
  16. package/lib/edge/blocks/columns/columns.mjs +42 -34
  17. package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
  18. package/lib/edge/components/blocks/blocks-wrapper.mjs +26 -20
  19. package/lib/edge/components/content/components/enable-editor.cjs +1 -1
  20. package/lib/edge/components/content/components/enable-editor.mjs +58 -57
  21. package/lib/edge/constants/sdk-version.cjs +1 -1
  22. package/lib/edge/constants/sdk-version.mjs +1 -1
  23. package/lib/edge/functions/evaluate/node-runtime/node-runtime.cjs +3 -3
  24. package/lib/edge/functions/evaluate/node-runtime/node-runtime.mjs +16 -14
  25. package/lib/edge/functions/log-fetch.cjs +1 -0
  26. package/lib/edge/functions/log-fetch.mjs +8 -0
  27. package/lib/edge/functions/track/index.cjs +1 -1
  28. package/lib/edge/functions/track/index.mjs +18 -14
  29. package/lib/node/blocks/columns/columns.cjs +3 -3
  30. package/lib/node/blocks/columns/columns.mjs +42 -34
  31. package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
  32. package/lib/node/components/blocks/blocks-wrapper.mjs +26 -20
  33. package/lib/node/components/content/components/enable-editor.cjs +1 -1
  34. package/lib/node/components/content/components/enable-editor.mjs +58 -57
  35. package/lib/node/constants/sdk-version.cjs +1 -1
  36. package/lib/node/constants/sdk-version.mjs +1 -1
  37. package/lib/node/functions/evaluate/node-runtime/node-runtime.cjs +6 -6
  38. package/lib/node/functions/evaluate/node-runtime/node-runtime.mjs +20 -18
  39. package/lib/node/functions/log-fetch.cjs +1 -0
  40. package/lib/node/functions/log-fetch.mjs +8 -0
  41. package/lib/node/functions/track/index.cjs +1 -1
  42. package/lib/node/functions/track/index.mjs +18 -14
  43. package/package.json +1 -1
  44. package/types/cjs/constants/sdk-version.d.ts +1 -1
  45. package/types/cjs/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
  46. package/types/cjs/functions/log-fetch.d.ts +1 -0
  47. package/types/esm/constants/sdk-version.d.ts +1 -1
  48. package/types/esm/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
  49. package/types/esm/functions/log-fetch.d.ts +1 -0
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("react/jsx-runtime"),p=require("../../components/blocks/blocks.cjs"),W=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),j=require("../../components/inlined-styles.cjs"),q=require("../../constants/device-sizes.cjs"),B=require("../../functions/get-class-prop-name.cjs"),z=require("../../functions/get-style.cjs"),N=require("./helpers.cjs");function A(e){var g,k;const a=typeof e.space=="number"?e.space||0:20,r=e.columns||[],u=e.stackColumnsAt||"tablet",y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var n;return((n=r[t])==null?void 0:n.width)||100/r.length},x=function(t){const n=S(t),l=a*(r.length-1)*(n/100);return`calc(${n}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:n}){return u==="tablet"?t:n},m=function({stackedStyle:t,desktopStyle:n}){return u==="never"?n:t},d=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",C=function(){return{"--flex-dir":d,"--flex-dir-tablet":c({stackedStyle:d,desktopStyle:"row"})}},v=function(t){const n=t===0?0:a,l=x(t),s=`${n}px`,h="100%",f=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:s,"--column-width-mobile":m({stackedStyle:h,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:f,desktopStyle:s}),"--column-width-tablet":c({stackedStyle:h,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:f,desktopStyle:s})}},b=function(t){var l,s;return q.getSizesForBreakpoints(((s=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:s.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
1
+ "use strict";const o=require("react/jsx-runtime"),W=require("../../components/blocks/blocks.cjs"),j=require("../../components/dynamic-renderer/dynamic-renderer.cjs"),q=require("../../components/inlined-styles.cjs"),z=require("../../constants/device-sizes.cjs"),B=require("../../functions/get-class-prop-name.cjs"),p=require("../../functions/get-style.cjs"),A=require("./helpers.cjs");function N(e){var g,f;const a=function(){return typeof e.space=="number"?e.space||0:20},s=function(){return e.columns||[]},u=function(){return e.stackColumnsAt||"tablet"},y=function(t){return t.link?e.builderLinkComponent||"a":"div"},S=function(t){var i;return((i=s()[t])==null?void 0:i.width)||100/s().length},x=function(t){const i=S(t),l=a()*(s().length-1)*(i/100);return`calc(${i}% - ${l}px)`},c=function({stackedStyle:t,desktopStyle:i}){return u()==="tablet"?t:i},m=function({stackedStyle:t,desktopStyle:i}){return u()==="never"?i:t},d=function(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"},C=function(){return{"--flex-dir":d(),"--flex-dir-tablet":c({stackedStyle:d(),desktopStyle:"row"})}},v=function(t){const i=t===0?0:a(),l=x(t),r=`${i}px`,k="100%",h=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:l,["marginLeft"]:r,"--column-width-mobile":m({stackedStyle:k,desktopStyle:l}),"--column-margin-left-mobile":m({stackedStyle:h,desktopStyle:r}),"--column-width-tablet":c({stackedStyle:k,desktopStyle:l}),"--column-margin-left-tablet":c({stackedStyle:h,desktopStyle:r})}},b=function(t){var l,r;return z.getSizesForBreakpoints(((r=(l=e.builderContext.content)==null?void 0:l.meta)==null?void 0:r.breakpoints)||{})[t].max},w=function(){const t=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
2
2
  @media (max-width: ${b("medium")}px) {
3
3
  .${e.builderBlock.id}-breakpoints {
4
4
  flex-direction: var(--flex-dir-tablet);
@@ -22,7 +22,7 @@
22
22
  margin-left: var(--column-margin-left-mobile) !important;
23
23
  }
24
24
  },
25
- `},$=function(t,n){return{...t.link?{href:t.link}:{},[B.getClassPropName()]:"builder-column",style:z.mapStyleObjToStrIfNeeded(v(n))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:N.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-153273e4",style:C(),children:[o.jsx(j,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(k=e.columns)==null?void 0:k.map((i,t)=>o.jsx(W,{TagName:y(i),actionAttributes:{},attributes:$(i,t),children:o.jsx(p,{path:`component.options.columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:i.blocks})},t))]}),o.jsx("style",{children:`.div-153273e4 {
25
+ `},$=function(t,i){return{...t.link?{href:t.link}:{},[B.getClassPropName()]:"builder-column",style:p.mapStyleObjToStrIfNeeded(v(i))}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:A.getColumnsClass((g=e.builderBlock)==null?void 0:g.id)+" div-6e395700",style:C(),children:[o.jsx(q,{id:"builderio-columns",styles:w(),nonce:e.builderContext.nonce}),(f=e.columns)==null?void 0:f.map((n,t)=>o.jsx(j,{TagName:y(n),actionAttributes:{},attributes:$(n,t),children:o.jsx(W,{path:`columns.${t}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:n.blocks})},t))]}),o.jsx("style",{children:`.div-6e395700 {
26
26
  display: flex;
27
27
  line-height: normal;
28
- }`})]})}module.exports=A;
28
+ }`})]})}module.exports=N;
@@ -7,35 +7,43 @@ import { getClassPropName as N } from "../../functions/get-class-prop-name.mjs";
7
7
  import { mapStyleObjToStrIfNeeded as T } from "../../functions/get-style.mjs";
8
8
  import { getColumnsClass as D } from "./helpers.mjs";
9
9
  function q(e) {
10
- var f, g;
11
- const a = typeof e.space == "number" ? e.space || 0 : 20, s = e.columns || [], m = e.stackColumnsAt || "tablet", S = function(t) {
10
+ var b, g;
11
+ const a = function() {
12
+ return typeof e.space == "number" ? e.space || 0 : 20;
13
+ }, s = function() {
14
+ return e.columns || [];
15
+ }, m = function() {
16
+ return e.stackColumnsAt || "tablet";
17
+ }, S = function(t) {
12
18
  return t.link ? e.builderLinkComponent || "a" : "div";
13
- }, C = function(t) {
14
- var n;
15
- return ((n = s[t]) == null ? void 0 : n.width) || 100 / s.length;
16
19
  }, x = function(t) {
17
- const n = C(t), l = a * (s.length - 1) * (n / 100);
18
- return `calc(${n}% - ${l}px)`;
20
+ var i;
21
+ return ((i = s()[t]) == null ? void 0 : i.width) || 100 / s().length;
22
+ }, C = function(t) {
23
+ const i = x(t), l = a() * (s().length - 1) * (i / 100);
24
+ return `calc(${i}% - ${l}px)`;
19
25
  }, c = function({
20
26
  stackedStyle: t,
21
- desktopStyle: n
27
+ desktopStyle: i
22
28
  }) {
23
- return m === "tablet" ? t : n;
24
- }, d = function({
29
+ return m() === "tablet" ? t : i;
30
+ }, u = function({
25
31
  stackedStyle: t,
26
- desktopStyle: n
32
+ desktopStyle: i
27
33
  }) {
28
- return m === "never" ? n : t;
29
- }, u = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", p = function() {
34
+ return m() === "never" ? i : t;
35
+ }, d = function() {
36
+ return e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column";
37
+ }, v = function() {
30
38
  return {
31
- "--flex-dir": u,
39
+ "--flex-dir": d(),
32
40
  "--flex-dir-tablet": c({
33
- stackedStyle: u,
41
+ stackedStyle: d(),
34
42
  desktopStyle: "row"
35
43
  })
36
44
  };
37
- }, v = function(t) {
38
- const n = t === 0 ? 0 : a, l = x(t), o = `${n}px`, k = "100%", h = 0;
45
+ }, w = function(t) {
46
+ const i = t === 0 ? 0 : a(), l = C(t), o = `${i}px`, k = "100%", h = 0;
39
47
  return {
40
48
  ...{
41
49
  display: "flex",
@@ -44,11 +52,11 @@ function q(e) {
44
52
  },
45
53
  width: l,
46
54
  ["marginLeft"]: o,
47
- "--column-width-mobile": d({
55
+ "--column-width-mobile": u({
48
56
  stackedStyle: k,
49
57
  desktopStyle: l
50
58
  }),
51
- "--column-margin-left-mobile": d({
59
+ "--column-margin-left-mobile": u({
52
60
  stackedStyle: h,
53
61
  desktopStyle: o
54
62
  }),
@@ -61,15 +69,15 @@ function q(e) {
61
69
  desktopStyle: o
62
70
  })
63
71
  };
64
- }, b = function(t) {
72
+ }, f = function(t) {
65
73
  var l, o;
66
74
  return L(
67
75
  ((o = (l = e.builderContext.content) == null ? void 0 : l.meta) == null ? void 0 : o.breakpoints) || {}
68
76
  )[t].max;
69
- }, w = function() {
77
+ }, p = function() {
70
78
  const t = `.${e.builderBlock.id}-breakpoints > .builder-column`;
71
79
  return `
72
- @media (max-width: ${b("medium")}px) {
80
+ @media (max-width: ${f("medium")}px) {
73
81
  .${e.builderBlock.id}-breakpoints {
74
82
  flex-direction: var(--flex-dir-tablet);
75
83
  align-items: stretch;
@@ -81,7 +89,7 @@ function q(e) {
81
89
  }
82
90
  }
83
91
 
84
- @media (max-width: ${b("small")}px) {
92
+ @media (max-width: ${f("small")}px) {
85
93
  .${e.builderBlock.id}-breakpoints {
86
94
  flex-direction: var(--flex-dir);
87
95
  align-items: stretch;
@@ -93,40 +101,40 @@ function q(e) {
93
101
  }
94
102
  },
95
103
  `;
96
- }, $ = function(t, n) {
104
+ }, $ = function(t, i) {
97
105
  return {
98
106
  ...t.link ? {
99
107
  href: t.link
100
108
  } : {},
101
109
  [N()]: "builder-column",
102
- style: T(v(n))
110
+ style: T(w(i))
103
111
  };
104
112
  };
105
113
  return /* @__PURE__ */ y(B, { children: [
106
114
  /* @__PURE__ */ y(
107
115
  "div",
108
116
  {
109
- className: D((f = e.builderBlock) == null ? void 0 : f.id) + " div-153273e4",
110
- style: p(),
117
+ className: D((b = e.builderBlock) == null ? void 0 : b.id) + " div-6e395700",
118
+ style: v(),
111
119
  children: [
112
120
  /* @__PURE__ */ r(
113
121
  A,
114
122
  {
115
123
  id: "builderio-columns",
116
- styles: w(),
124
+ styles: p(),
117
125
  nonce: e.builderContext.nonce
118
126
  }
119
127
  ),
120
- (g = e.columns) == null ? void 0 : g.map((i, t) => /* @__PURE__ */ r(
128
+ (g = e.columns) == null ? void 0 : g.map((n, t) => /* @__PURE__ */ r(
121
129
  z,
122
130
  {
123
- TagName: S(i),
131
+ TagName: S(n),
124
132
  actionAttributes: {},
125
- attributes: $(i, t),
133
+ attributes: $(n, t),
126
134
  children: /* @__PURE__ */ r(
127
135
  W,
128
136
  {
129
- path: `component.options.columns.${t}.blocks`,
137
+ path: `columns.${t}.blocks`,
130
138
  parent: e.builderBlock.id,
131
139
  styleProp: {
132
140
  flexGrow: "1"
@@ -134,7 +142,7 @@ function q(e) {
134
142
  context: e.builderContext,
135
143
  registeredComponents: e.builderComponents,
136
144
  linkComponent: e.builderLinkComponent,
137
- blocks: i.blocks
145
+ blocks: n.blocks
138
146
  }
139
147
  )
140
148
  },
@@ -143,7 +151,7 @@ function q(e) {
143
151
  ]
144
152
  }
145
153
  ),
146
- /* @__PURE__ */ r("style", { children: `.div-153273e4 {
154
+ /* @__PURE__ */ r("style", { children: `.div-6e395700 {
147
155
  display: flex;
148
156
  line-height: normal;
149
157
  }` })
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const l=require("react/jsx-runtime"),c=require("react"),i=require("../../functions/is-editing.cjs");function d(e){const r=c.useRef(null);function s(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function a(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var t,n;i.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return c.useEffect(()=>{},[]),l.jsxs(l.Fragment,{children:[l.jsx(e.BlocksWrapper,{ref:r,className:s()+" props-blocks-wrapper-43ec7ac8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>a(),onMouseEnter:t=>o(),onKeyPress:t=>a(),...e.BlocksWrapperProps,children:e.children}),l.jsx("style",{children:`.props-blocks-wrapper-43ec7ac8 {
1
+ "use client";"use strict";const a=require("react/jsx-runtime"),l=require("react"),s=require("../../functions/is-editing.cjs");function d(e){const c=l.useRef(null);function o(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function i(){if(!e.path)return;const t="component.options.";return e.path.startsWith(t)?e.path:`${t}${e.path||""}`}function r(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}function u(){var t,n;s.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}return l.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:c,className:o()+" props-blocks-wrapper-215a41e0","builder-path":i(),"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>r(),onMouseEnter:t=>u(),onKeyPress:t=>r(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-215a41e0 {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: stretch;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { jsxs as s, Fragment as d, jsx as a } from "react/jsx-runtime";
3
- import { useRef as u, useEffect as f } from "react";
4
- import { isEditing as r } from "../../functions/is-editing.mjs";
5
- function h(e) {
6
- const c = u(null);
7
- function i() {
2
+ import { jsxs as d, Fragment as u, jsx as r } from "react/jsx-runtime";
3
+ import { useRef as f, useEffect as h } from "react";
4
+ import { isEditing as i } from "../../functions/is-editing.mjs";
5
+ function b(e) {
6
+ const o = f(null);
7
+ function c() {
8
8
  var t;
9
9
  return [
10
10
  "builder-blocks",
@@ -12,50 +12,56 @@ function h(e) {
12
12
  e.classNameProp
13
13
  ].filter(Boolean).join(" ");
14
14
  }
15
+ function a() {
16
+ if (!e.path)
17
+ return;
18
+ const t = "component.options.";
19
+ return e.path.startsWith(t) ? e.path : `${t}${e.path || ""}`;
20
+ }
15
21
  function l() {
16
22
  var t, n;
17
- r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
23
+ i() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
18
24
  {
19
25
  type: "builder.clickEmptyBlocks",
20
26
  data: {
21
27
  parentElementId: e.parent,
22
- dataPath: e.path
28
+ dataPath: a()
23
29
  }
24
30
  },
25
31
  "*"
26
32
  ));
27
33
  }
28
- function o() {
34
+ function s() {
29
35
  var t, n;
30
- r() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
36
+ i() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
31
37
  {
32
38
  type: "builder.hoverEmptyBlocks",
33
39
  data: {
34
40
  parentElementId: e.parent,
35
- dataPath: e.path
41
+ dataPath: a()
36
42
  }
37
43
  },
38
44
  "*"
39
45
  ));
40
46
  }
41
- return f(() => {
42
- }, []), /* @__PURE__ */ s(d, { children: [
43
- /* @__PURE__ */ a(
47
+ return h(() => {
48
+ }, []), /* @__PURE__ */ d(u, { children: [
49
+ /* @__PURE__ */ r(
44
50
  e.BlocksWrapper,
45
51
  {
46
- ref: c,
47
- className: i() + " props-blocks-wrapper-43ec7ac8",
48
- "builder-path": e.path,
52
+ ref: o,
53
+ className: c() + " props-blocks-wrapper-215a41e0",
54
+ "builder-path": a(),
49
55
  "builder-parent-id": e.parent,
50
56
  style: e.styleProp,
51
57
  onClick: (t) => l(),
52
- onMouseEnter: (t) => o(),
58
+ onMouseEnter: (t) => s(),
53
59
  onKeyPress: (t) => l(),
54
60
  ...e.BlocksWrapperProps,
55
61
  children: e.children
56
62
  }
57
63
  ),
58
- /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-43ec7ac8 {
64
+ /* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-215a41e0 {
59
65
  display: flex;
60
66
  flex-direction: column;
61
67
  align-items: stretch;
@@ -63,5 +69,5 @@ function h(e) {
63
69
  ] });
64
70
  }
65
71
  export {
66
- h as default
72
+ b as default
67
73
  };
@@ -1 +1 @@
1
- "use client";"use strict";const k=require("react/jsx-runtime"),o=require("react"),N=require("../../../context/builder.context.cjs"),W=require("../../../functions/evaluate/evaluate.cjs"),A=require("../../../functions/fast-clone.cjs"),B=require("../../../functions/get-content/index.cjs"),R=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),D=require("../../../functions/is-previewing.cjs"),U=require("../../../functions/register-component.cjs"),P=require("../../../functions/track/index.cjs"),O=require("../../../functions/track/interaction.cjs"),y=require("../../../helpers/canTrack.cjs"),F=require("../../../helpers/preview-lru-cache/set.cjs"),$=require("../../../helpers/subscribe-to-editor.cjs"),H=require("../../../scripts/init-editing.cjs"),z=require("../../block/animator.cjs"),G=require("./styles.helpers.cjs"),J=require("next/navigation");function Q(e){var q,w,I;const d=o.useRef(null);function f(n){var a,i;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(i=(a=e.builderContextSignal).rootSetState)==null||i.call(a,t):e.builderContextSignal.rootState=t}function b(n){var a,i,r,c,u;const t={...e.builderContextSignal.content,...n,data:{...(a=e.builderContextSignal.content)==null?void 0:a.data,...n==null?void 0:n.data},meta:{...(i=e.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((r=n==null?void 0:n.meta)==null?void 0:r.breakpoints)||((u=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:u.breakpoints)}};F.postPreviewContent({value:t,key:t.id}).then(()=>{V.refresh()})}function L(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[K,X]=o.useState(()=>e.contentWrapper||"div");function S(n){return $.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var r;const{breakpoints:a,contentId:i}=t;!i||i!==((r=e.builderContextSignal.content)==null?void 0:r.id)||a&&b({meta:{breakpoints:a}})},animation:t=>{z.triggerAnimation(t)},contentUpdate:t=>{b(t)}}})(n)}const[v,Y]=o.useState(()=>({})),[m,Z]=o.useState(()=>({})),[h,T]=o.useState(()=>!1);function _(n){var t,a;if(e.builderContextSignal.content){const i=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,r=(a=e.builderContextSignal.content)==null?void 0:a.id;P._track({apiHost:e.apiHost,type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:r,apiKey:e.apiKey,variationId:i!==r?i:void 0,...O.getInteractionPropertiesForEvent(n),unique:!h})}h||T(!0)}function j(){var t,a,i;const n=(i=(a=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:a.httpRequests)!=null?i:{};Object.entries(n).forEach(([r,c])=>{if(!c||m[r]||v[r]&&!g.isEditing())return;m[r]=!0;const u=c.replace(/{{([^}]+)}}/g,(s,M)=>String(W.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));fetch(u).then(s=>s.json()).then(s=>{f({[r]:s}),v[r]=!0}).catch(s=>{console.error("error fetching dynamic data",c,s)}).finally(()=>{m[r]=!1})})}function l(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:A.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",S),H.registerInsertMenu(),H.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var i;const a=U.createRegisterComponentMessage(t);(i=window.parent)==null||i.postMessage(a,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",l)}function x(n){const t=new URL(location.href).searchParams,a=t.get("builder.preview"),i=t.get(`builder.overrides.${a}`),r=t.get("apiKey")||t.get("builder.space");a===e.model&&r===e.apiKey&&(!e.content||i===e.content.id)&&B.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(c=>{c&&b(c)})}const V=J.useRouter(),C=o.useRef(!1);return C.current||(j(),l(),C.current=!0),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=d.current)==null||n.addEventListener("initpreviewingbldr",x),()=>{var t;return(t=d.current)==null?void 0:t.removeEventListener("initpreviewingbldr",x)}},[]),o.useEffect(()=>{var n,t;if(R.isBrowser()){if(g.isEditing()&&!e.isNestedRender&&d.current&&d.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const i=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,r=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;P._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:r,apiKey:c,variationId:i!==r?i:void 0})}D.isPreviewing()&&g.isEditing()}},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{l()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&f(e.data)},[e.data]),o.useEffect(()=>{e.locale&&f({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{R.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",l))},[]),k.jsx(N.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?k.jsx(K,{ref:d,onClick:n=>_(n),"builder-content-id":(q=e.builderContextSignal.content)==null?void 0:q.id,"builder-model":e.model,className:G.getWrapperClassName(((w=e.content)==null?void 0:w.testVariationId)||((I=e.content)==null?void 0:I.id)),...L(),...e.contentWrapperProps,children:e.children}):null})}module.exports=Q;
1
+ "use client";"use strict";const k=require("react/jsx-runtime"),o=require("react"),N=require("../../../context/builder.context.cjs"),W=require("../../../functions/evaluate/evaluate.cjs"),A=require("../../../functions/fast-clone.cjs"),B=require("../../../functions/get-content/index.cjs"),R=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),D=require("../../../functions/is-previewing.cjs"),F=require("../../../functions/log-fetch.cjs"),U=require("../../../functions/register-component.cjs"),P=require("../../../functions/track/index.cjs"),O=require("../../../functions/track/interaction.cjs"),y=require("../../../helpers/canTrack.cjs"),$=require("../../../helpers/preview-lru-cache/set.cjs"),z=require("../../../helpers/subscribe-to-editor.cjs"),H=require("../../../scripts/init-editing.cjs"),G=require("../../block/animator.cjs"),J=require("./styles.helpers.cjs"),Q=require("next/navigation");function X(e){var q,w,I;const s=o.useRef(null);function f(n){var r,i;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(i=(r=e.builderContextSignal).rootSetState)==null||i.call(r,t):e.builderContextSignal.rootState=t}function b(n){var r,i,a,c,l;const t={...e.builderContextSignal.content,...n,data:{...(r=e.builderContextSignal.content)==null?void 0:r.data,...n==null?void 0:n.data},meta:{...(i=e.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((a=n==null?void 0:n.meta)==null?void 0:a.breakpoints)||((l=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:l.breakpoints)}};$.postPreviewContent({value:t,key:t.id}).then(()=>{V.refresh()})}function L(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[K,Y]=o.useState(()=>e.contentWrapper||"div");function S(n){return z.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var a;const{breakpoints:r,contentId:i}=t;!i||i!==((a=e.builderContextSignal.content)==null?void 0:a.id)||r&&b({meta:{breakpoints:r}})},animation:t=>{G.triggerAnimation(t)},contentUpdate:t=>{b(t)}}})(n)}const[v,Z]=o.useState(()=>({})),[m,p]=o.useState(()=>({})),[h,T]=o.useState(()=>!1);function _(n){var t,r;if(e.builderContextSignal.content){const i=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,a=(r=e.builderContextSignal.content)==null?void 0:r.id;P._track({apiHost:e.apiHost,type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:a,apiKey:e.apiKey,variationId:i!==a?i:void 0,...O.getInteractionPropertiesForEvent(n),unique:!h})}h||T(!0)}function j(){var t,r,i;const n=(i=(r=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:r.httpRequests)!=null?i:{};Object.entries(n).forEach(([a,c])=>{if(!c||m[a]||v[a]&&!g.isEditing())return;m[a]=!0;const l=c.replace(/{{([^}]+)}}/g,(d,M)=>String(W.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));F.logFetch(l),fetch(l).then(d=>d.json()).then(d=>{f({[a]:d}),v[a]=!0}).catch(d=>{console.error("error fetching dynamic data",c,d)}).finally(()=>{m[a]=!1})})}function u(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:A.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",S),H.registerInsertMenu(),H.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(t=>{var i;const r=U.createRegisterComponentMessage(t);(i=window.parent)==null||i.postMessage(r,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",u)}function x(n){const t=new URL(location.href).searchParams,r=t.get("builder.preview"),i=t.get(`builder.overrides.${r}`),a=t.get("apiKey")||t.get("builder.space");r===e.model&&a===e.apiKey&&(!e.content||i===e.content.id)&&B.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(c=>{c&&b(c)})}const V=Q.useRouter(),C=o.useRef(!1);return C.current||(j(),u(),C.current=!0),o.useEffect(()=>{var n;return(n=s.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=s.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=s.current)==null||n.addEventListener("initpreviewingbldr",x),()=>{var t;return(t=s.current)==null?void 0:t.removeEventListener("initpreviewingbldr",x)}},[]),o.useEffect(()=>{var n,t;if(R.isBrowser()){if(g.isEditing()&&!e.isNestedRender&&s.current&&s.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const i=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,a=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;P._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:a,apiKey:c,variationId:i!==a?i:void 0})}D.isPreviewing()&&g.isEditing()}},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{u()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&f(e.data)},[e.data]),o.useEffect(()=>{e.locale&&f({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{R.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",u))},[]),k.jsx(N.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?k.jsx(K,{ref:s,onClick:n=>_(n),"builder-content-id":(q=e.builderContextSignal.content)==null?void 0:q.id,"builder-model":e.model,className:J.getWrapperClassName(((w=e.content)==null?void 0:w.testVariationId)||((I=e.content)==null?void 0:I.id)),...L(),...e.contentWrapperProps,children:e.children}):null})}module.exports=X;
@@ -7,44 +7,45 @@ import { fastClone as _ } from "../../../functions/fast-clone.mjs";
7
7
  import { fetchOneEntry as D } from "../../../functions/get-content/index.mjs";
8
8
  import { isBrowser as L } from "../../../functions/is-browser.mjs";
9
9
  import { isEditing as f } from "../../../functions/is-editing.mjs";
10
- import { isPreviewing as O } from "../../../functions/is-previewing.mjs";
10
+ import { isPreviewing as F } from "../../../functions/is-previewing.mjs";
11
+ import { logFetch as O } from "../../../functions/log-fetch.mjs";
11
12
  import { createRegisterComponentMessage as B } from "../../../functions/register-component.mjs";
12
13
  import { _track as y } from "../../../functions/track/index.mjs";
13
- import { getInteractionPropertiesForEvent as F } from "../../../functions/track/interaction.mjs";
14
+ import { getInteractionPropertiesForEvent as z } from "../../../functions/track/interaction.mjs";
14
15
  import { getDefaultCanTrack as K } from "../../../helpers/canTrack.mjs";
15
- import { postPreviewContent as z } from "../../../helpers/preview-lru-cache/set.mjs";
16
- import { createEditorListener as $ } from "../../../helpers/subscribe-to-editor.mjs";
17
- import { registerInsertMenu as G, setupBrowserForEditing as J } from "../../../scripts/init-editing.mjs";
18
- import { triggerAnimation as Q } from "../../block/animator.mjs";
19
- import { getWrapperClassName as X } from "./styles.helpers.mjs";
20
- import { useRouter as Y } from "next/navigation";
21
- function Ct(t) {
16
+ import { postPreviewContent as $ } from "../../../helpers/preview-lru-cache/set.mjs";
17
+ import { createEditorListener as G } from "../../../helpers/subscribe-to-editor.mjs";
18
+ import { registerInsertMenu as J, setupBrowserForEditing as Q } from "../../../scripts/init-editing.mjs";
19
+ import { triggerAnimation as X } from "../../block/animator.mjs";
20
+ import { getWrapperClassName as Y } from "./styles.helpers.mjs";
21
+ import { useRouter as Z } from "next/navigation";
22
+ function It(t) {
22
23
  var w, k, P;
23
24
  const d = H(null);
24
25
  function g(n) {
25
- var a, i;
26
+ var r, i;
26
27
  const e = {
27
28
  ...t.builderContextSignal.rootState,
28
29
  ...n
29
30
  };
30
- t.builderContextSignal.rootSetState ? (i = (a = t.builderContextSignal).rootSetState) == null || i.call(a, e) : t.builderContextSignal.rootState = e;
31
+ t.builderContextSignal.rootSetState ? (i = (r = t.builderContextSignal).rootSetState) == null || i.call(r, e) : t.builderContextSignal.rootState = e;
31
32
  }
32
33
  function b(n) {
33
- var a, i, r, o, s;
34
+ var r, i, a, o, u;
34
35
  const e = {
35
36
  ...t.builderContextSignal.content,
36
37
  ...n,
37
38
  data: {
38
- ...(a = t.builderContextSignal.content) == null ? void 0 : a.data,
39
+ ...(r = t.builderContextSignal.content) == null ? void 0 : r.data,
39
40
  ...n == null ? void 0 : n.data
40
41
  },
41
42
  meta: {
42
43
  ...(i = t.builderContextSignal.content) == null ? void 0 : i.meta,
43
44
  ...n == null ? void 0 : n.meta,
44
- breakpoints: ((r = n == null ? void 0 : n.meta) == null ? void 0 : r.breakpoints) || ((s = (o = t.builderContextSignal.content) == null ? void 0 : o.meta) == null ? void 0 : s.breakpoints)
45
+ breakpoints: ((a = n == null ? void 0 : n.meta) == null ? void 0 : a.breakpoints) || ((u = (o = t.builderContextSignal.content) == null ? void 0 : o.meta) == null ? void 0 : u.breakpoints)
45
46
  }
46
47
  };
47
- z({
48
+ $({
48
49
  value: e,
49
50
  key: e.id
50
51
  }).then(() => {
@@ -57,25 +58,25 @@ function Ct(t) {
57
58
  "aria-hidden": !0
58
59
  };
59
60
  }
60
- const [T, Z] = m(
61
+ const [T, p] = m(
61
62
  () => t.contentWrapper || "div"
62
63
  );
63
64
  function v(n) {
64
- return $({
65
+ return G({
65
66
  model: t.model,
66
67
  trustedHosts: t.trustedHosts,
67
68
  callbacks: {
68
69
  configureSdk: (e) => {
69
- var r;
70
- const { breakpoints: a, contentId: i } = e;
71
- !i || i !== ((r = t.builderContextSignal.content) == null ? void 0 : r.id) || a && b({
70
+ var a;
71
+ const { breakpoints: r, contentId: i } = e;
72
+ !i || i !== ((a = t.builderContextSignal.content) == null ? void 0 : a.id) || r && b({
72
73
  meta: {
73
- breakpoints: a
74
+ breakpoints: r
74
75
  }
75
76
  });
76
77
  },
77
78
  animation: (e) => {
78
- Q(e);
79
+ X(e);
79
80
  },
80
81
  contentUpdate: (e) => {
81
82
  b(e);
@@ -83,32 +84,32 @@ function Ct(t) {
83
84
  }
84
85
  })(n);
85
86
  }
86
- const [h, p] = m(() => ({})), [S, tt] = m(() => ({})), [x, V] = m(() => !1);
87
+ const [h, tt] = m(() => ({})), [S, et] = m(() => ({})), [x, V] = m(() => !1);
87
88
  function M(n) {
88
- var e, a;
89
+ var e, r;
89
90
  if (t.builderContextSignal.content) {
90
- const i = (e = t.builderContextSignal.content) == null ? void 0 : e.testVariationId, r = (a = t.builderContextSignal.content) == null ? void 0 : a.id;
91
+ const i = (e = t.builderContextSignal.content) == null ? void 0 : e.testVariationId, a = (r = t.builderContextSignal.content) == null ? void 0 : r.id;
91
92
  y({
92
93
  apiHost: t.apiHost,
93
94
  type: "click",
94
95
  canTrack: K(t.canTrack),
95
- contentId: r,
96
+ contentId: a,
96
97
  apiKey: t.apiKey,
97
- variationId: i !== r ? i : void 0,
98
- ...F(n),
98
+ variationId: i !== a ? i : void 0,
99
+ ...z(n),
99
100
  unique: !x
100
101
  });
101
102
  }
102
103
  x || V(!0);
103
104
  }
104
105
  function N() {
105
- var e, a, i;
106
- const n = (i = (a = (e = t.builderContextSignal.content) == null ? void 0 : e.data) == null ? void 0 : a.httpRequests) != null ? i : {};
107
- Object.entries(n).forEach(([r, o]) => {
108
- if (!o || S[r] || h[r] && !f())
106
+ var e, r, i;
107
+ const n = (i = (r = (e = t.builderContextSignal.content) == null ? void 0 : e.data) == null ? void 0 : r.httpRequests) != null ? i : {};
108
+ Object.entries(n).forEach(([a, o]) => {
109
+ if (!o || S[a] || h[a] && !f())
109
110
  return;
110
- S[r] = !0;
111
- const s = o.replace(
111
+ S[a] = !0;
112
+ const u = o.replace(
112
113
  /{{([^}]+)}}/g,
113
114
  (l, j) => String(
114
115
  U({
@@ -120,18 +121,18 @@ function Ct(t) {
120
121
  })
121
122
  )
122
123
  );
123
- fetch(s).then((l) => l.json()).then((l) => {
124
+ O(u), fetch(u).then((l) => l.json()).then((l) => {
124
125
  g({
125
- [r]: l
126
- }), h[r] = !0;
126
+ [a]: l
127
+ }), h[a] = !0;
127
128
  }).catch((l) => {
128
129
  console.error("error fetching dynamic data", o, l);
129
130
  }).finally(() => {
130
- S[r] = !1;
131
+ S[a] = !1;
131
132
  });
132
133
  });
133
134
  }
134
- function u() {
135
+ function s() {
135
136
  f() && window.dispatchEvent(
136
137
  new CustomEvent(
137
138
  "builder:component:stateChange",
@@ -147,7 +148,7 @@ function Ct(t) {
147
148
  );
148
149
  }
149
150
  function C(n) {
150
- window.addEventListener("message", v), G(), J({
151
+ window.addEventListener("message", v), J(), Q({
151
152
  ...t.locale ? {
152
153
  locale: t.locale
153
154
  } : {},
@@ -161,18 +162,18 @@ function Ct(t) {
161
162
  t.builderContextSignal.componentInfos
162
163
  ).forEach((e) => {
163
164
  var i;
164
- const a = B(e);
165
- (i = window.parent) == null || i.postMessage(a, "*");
165
+ const r = B(e);
166
+ (i = window.parent) == null || i.postMessage(r, "*");
166
167
  }), window.addEventListener(
167
168
  "builder:component:stateChangeListenerActivated",
168
- u
169
+ s
169
170
  );
170
171
  }
171
172
  function E(n) {
172
- const e = new URL(location.href).searchParams, a = e.get("builder.preview"), i = e.get(
173
- `builder.overrides.${a}`
174
- ), r = e.get("apiKey") || e.get("builder.space");
175
- a === t.model && r === t.apiKey && (!t.content || i === t.content.id) && D({
173
+ const e = new URL(location.href).searchParams, r = e.get("builder.preview"), i = e.get(
174
+ `builder.overrides.${r}`
175
+ ), a = e.get("apiKey") || e.get("builder.space");
176
+ r === t.model && a === t.apiKey && (!t.content || i === t.content.id) && D({
176
177
  model: t.model,
177
178
  apiKey: t.apiKey,
178
179
  apiVersion: t.builderContextSignal.apiVersion
@@ -180,8 +181,8 @@ function Ct(t) {
180
181
  o && b(o);
181
182
  });
182
183
  }
183
- const W = Y(), I = H(!1);
184
- return I.current || (N(), u(), I.current = !0), c(() => {
184
+ const W = Z(), I = H(!1);
185
+ return I.current || (N(), s(), I.current = !0), c(() => {
185
186
  var n;
186
187
  return (n = d.current) == null || n.addEventListener(
187
188
  "initeditingbldr",
@@ -209,21 +210,21 @@ function Ct(t) {
209
210
  var n, e;
210
211
  if (L()) {
211
212
  if (f() && !t.isNestedRender && d.current && d.current.dispatchEvent(new CustomEvent("initeditingbldr")), t.builderContextSignal.content && K(t.canTrack)) {
212
- const i = (n = t.builderContextSignal.content) == null ? void 0 : n.testVariationId, r = (e = t.builderContextSignal.content) == null ? void 0 : e.id, o = t.apiKey;
213
+ const i = (n = t.builderContextSignal.content) == null ? void 0 : n.testVariationId, a = (e = t.builderContextSignal.content) == null ? void 0 : e.id, o = t.apiKey;
213
214
  y({
214
215
  apiHost: t.apiHost,
215
216
  type: "impression",
216
217
  canTrack: !0,
217
- contentId: r,
218
+ contentId: a,
218
219
  apiKey: o,
219
- variationId: i !== r ? i : void 0
220
+ variationId: i !== a ? i : void 0
220
221
  });
221
222
  }
222
- O() && f();
223
+ F() && f();
223
224
  }
224
225
  }, []), c(() => {
225
226
  }, [t.content]), c(() => {
226
- u();
227
+ s();
227
228
  }, [t.builderContextSignal.rootState]), c(() => {
228
229
  t.data && g(t.data);
229
230
  }, [t.data]), c(() => {
@@ -233,7 +234,7 @@ function Ct(t) {
233
234
  }, [t.locale]), c(() => () => {
234
235
  L() && (window.removeEventListener("message", v), window.removeEventListener(
235
236
  "builder:component:stateChangeListenerActivated",
236
- u
237
+ s
237
238
  ));
238
239
  }, []), /* @__PURE__ */ R(A.Provider, { value: t.builderContextSignal, children: t.builderContextSignal.content ? /* @__PURE__ */ R(
239
240
  T,
@@ -242,7 +243,7 @@ function Ct(t) {
242
243
  onClick: (n) => M(n),
243
244
  "builder-content-id": (w = t.builderContextSignal.content) == null ? void 0 : w.id,
244
245
  "builder-model": t.model,
245
- className: X(
246
+ className: Y(
246
247
  ((k = t.content) == null ? void 0 : k.testVariationId) || ((P = t.content) == null ? void 0 : P.id)
247
248
  ),
248
249
  ...q(),
@@ -252,5 +253,5 @@ function Ct(t) {
252
253
  ) : null });
253
254
  }
254
255
  export {
255
- Ct as default
256
+ It as default
256
257
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.19";exports.SDK_VERSION=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.16.23";exports.SDK_VERSION=e;
@@ -1,4 +1,4 @@
1
- const o = "0.16.19";
1
+ const o = "0.16.23";
2
2
  export {
3
3
  o as SDK_VERSION
4
4
  };
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../constants/sdk-name.cjs"),s=require("../../../helpers/logger.cjs"),a=require("./safeDynamicRequire.cjs"),c="BUILDER_IVM";let n=null;const d=(o,e={})=>{n=o,I(e)},m=t.SDK_NAME==="@builder.io/sdk-react-nextjs"||t.SDK_NAME==="@builder.io/sdk-react"||t.SDK_NAME==="@builder.io/sdk-qwik"||t.SDK_NAME==="@builder.io/sdk-vue",u=()=>{try{if(n)return n;const e=a.safeDynamicRequire("isolated-vm");if(e)return e}catch(e){s.logger.error("isolated-vm import error.",e)}const o=`${s.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../constants/sdk-name.cjs"),l=require("../../../helpers/logger.cjs"),c=require("./safeDynamicRequire.cjs"),d="BUILDER_IVM";let n=null,s=null;const u=(t,e={})=>{n||(n=t,S(e))},m=o.SDK_NAME==="@builder.io/sdk-react-nextjs"||o.SDK_NAME==="@builder.io/sdk-react"||o.SDK_NAME==="@builder.io/sdk-qwik"||o.SDK_NAME==="@builder.io/sdk-vue",I=()=>{try{if(n)return n;const e=c.safeDynamicRequire("isolated-vm");if(e)return e}catch(e){l.logger.error("isolated-vm import error.",e)}const t=`${l.MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on a Node server.
2
2
 
3
3
  SOLUTION: In a server-only execution path within your application, do one of the following:
4
4
 
5
- ${m?`- import and call \`initializeNodeRuntime()\` from "${t.SDK_NAME}/node/init".`:""}
5
+ ${m?`- import and call \`initializeNodeRuntime()\` from "${o.SDK_NAME}/node/init".`:""}
6
6
  - add the following import: \`await import('isolated-vm')\`.
7
7
 
8
- For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(o)};function I(o={memoryLimit:128}){const e=u(),r=new e.Isolate(o).createContextSync(),i=r.global;return i.setSync("global",i.derefInto()),i.setSync("log",function(...l){console.log(...l)}),i.setSync(c,e),r}exports.setIvm=d;
8
+ For more information, visit https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments`;throw new Error(t)};function S(t={memoryLimit:128}){if(s)return s;const e=I(),r=new e.Isolate(t).createContextSync(),i=r.global;return i.setSync("global",i.derefInto()),i.setSync("log",function(...a){console.log(...a)}),i.setSync(d,e),s=r,r}exports.setIvm=u;