@builder.io/sdk-react-nextjs 0.17.0 → 0.17.2

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 (147) hide show
  1. package/lib/browser/blocks/image/component-info.cjs +1 -1
  2. package/lib/browser/blocks/image/component-info.mjs +4 -3
  3. package/lib/browser/blocks/image/image.cjs +4 -4
  4. package/lib/browser/blocks/image/image.mjs +20 -20
  5. package/lib/browser/blocks/img/component-info.cjs +1 -1
  6. package/lib/browser/blocks/img/component-info.mjs +4 -3
  7. package/lib/browser/blocks/text/text.cjs +1 -1
  8. package/lib/browser/blocks/text/text.mjs +6 -24
  9. package/lib/browser/blocks/video/component-info.cjs +1 -1
  10. package/lib/browser/blocks/video/component-info.mjs +5 -4
  11. package/lib/browser/components/block/block.cjs +1 -1
  12. package/lib/browser/components/block/block.helpers.cjs +3 -3
  13. package/lib/browser/components/block/block.helpers.mjs +57 -54
  14. package/lib/browser/components/block/block.mjs +49 -48
  15. package/lib/browser/components/content/components/enable-editor.cjs +1 -1
  16. package/lib/browser/components/content/components/enable-editor.helpers.cjs +1 -0
  17. package/lib/browser/components/content/components/enable-editor.helpers.mjs +8 -0
  18. package/lib/browser/components/content/components/enable-editor.mjs +159 -147
  19. package/lib/browser/components/content/content.cjs +1 -1
  20. package/lib/browser/components/content/content.mjs +57 -56
  21. package/lib/browser/constants/file-types.cjs +1 -0
  22. package/lib/browser/constants/file-types.mjs +5 -0
  23. package/lib/browser/constants/sdk-version.cjs +1 -1
  24. package/lib/browser/constants/sdk-version.mjs +1 -1
  25. package/lib/browser/context/builder.context.cjs +1 -1
  26. package/lib/browser/context/builder.context.mjs +2 -1
  27. package/lib/browser/functions/extract-localized-values.cjs +1 -0
  28. package/lib/browser/functions/extract-localized-values.mjs +28 -0
  29. package/lib/browser/functions/get-block-component-options.cjs +1 -1
  30. package/lib/browser/functions/get-block-component-options.mjs +21 -5
  31. package/lib/browser/functions/get-content/generate-content-url.cjs +1 -1
  32. package/lib/browser/functions/get-content/generate-content-url.mjs +60 -40
  33. package/lib/browser/functions/get-processed-block.cjs +1 -1
  34. package/lib/browser/functions/get-processed-block.mjs +49 -49
  35. package/lib/browser/functions/register-component.cjs +1 -1
  36. package/lib/browser/functions/register-component.mjs +7 -7
  37. package/lib/browser/functions/traverse.cjs +1 -0
  38. package/lib/browser/functions/traverse.mjs +20 -0
  39. package/lib/browser/helpers/flatten.cjs +1 -1
  40. package/lib/browser/helpers/flatten.mjs +28 -15
  41. package/lib/edge/blocks/image/component-info.cjs +1 -1
  42. package/lib/edge/blocks/image/component-info.mjs +4 -3
  43. package/lib/edge/blocks/image/image.cjs +4 -4
  44. package/lib/edge/blocks/image/image.mjs +20 -20
  45. package/lib/edge/blocks/img/component-info.cjs +1 -1
  46. package/lib/edge/blocks/img/component-info.mjs +4 -3
  47. package/lib/edge/blocks/text/text.cjs +1 -1
  48. package/lib/edge/blocks/text/text.mjs +6 -24
  49. package/lib/edge/blocks/video/component-info.cjs +1 -1
  50. package/lib/edge/blocks/video/component-info.mjs +5 -4
  51. package/lib/edge/components/block/block.cjs +1 -1
  52. package/lib/edge/components/block/block.helpers.cjs +3 -3
  53. package/lib/edge/components/block/block.helpers.mjs +57 -54
  54. package/lib/edge/components/block/block.mjs +49 -48
  55. package/lib/edge/components/content/components/enable-editor.cjs +1 -1
  56. package/lib/edge/components/content/components/enable-editor.helpers.cjs +1 -0
  57. package/lib/edge/components/content/components/enable-editor.helpers.mjs +8 -0
  58. package/lib/edge/components/content/components/enable-editor.mjs +159 -147
  59. package/lib/edge/components/content/content.cjs +1 -1
  60. package/lib/edge/components/content/content.mjs +57 -56
  61. package/lib/edge/constants/file-types.cjs +1 -0
  62. package/lib/edge/constants/file-types.mjs +5 -0
  63. package/lib/edge/constants/sdk-version.cjs +1 -1
  64. package/lib/edge/constants/sdk-version.mjs +1 -1
  65. package/lib/edge/context/builder.context.cjs +1 -1
  66. package/lib/edge/context/builder.context.mjs +2 -1
  67. package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.cjs +5 -5
  68. package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.mjs +25 -28
  69. package/lib/edge/functions/extract-localized-values.cjs +1 -0
  70. package/lib/edge/functions/extract-localized-values.mjs +28 -0
  71. package/lib/edge/functions/get-block-component-options.cjs +1 -1
  72. package/lib/edge/functions/get-block-component-options.mjs +21 -5
  73. package/lib/edge/functions/get-content/generate-content-url.cjs +1 -1
  74. package/lib/edge/functions/get-content/generate-content-url.mjs +60 -40
  75. package/lib/edge/functions/get-processed-block.cjs +1 -1
  76. package/lib/edge/functions/get-processed-block.mjs +49 -49
  77. package/lib/edge/functions/register-component.cjs +1 -1
  78. package/lib/edge/functions/register-component.mjs +7 -7
  79. package/lib/edge/functions/traverse.cjs +1 -0
  80. package/lib/edge/functions/traverse.mjs +20 -0
  81. package/lib/edge/helpers/flatten.cjs +1 -1
  82. package/lib/edge/helpers/flatten.mjs +28 -15
  83. package/lib/node/blocks/image/component-info.cjs +1 -1
  84. package/lib/node/blocks/image/component-info.mjs +4 -3
  85. package/lib/node/blocks/image/image.cjs +4 -4
  86. package/lib/node/blocks/image/image.mjs +20 -20
  87. package/lib/node/blocks/img/component-info.cjs +1 -1
  88. package/lib/node/blocks/img/component-info.mjs +4 -3
  89. package/lib/node/blocks/text/text.cjs +1 -1
  90. package/lib/node/blocks/text/text.mjs +6 -24
  91. package/lib/node/blocks/video/component-info.cjs +1 -1
  92. package/lib/node/blocks/video/component-info.mjs +5 -4
  93. package/lib/node/components/block/block.cjs +1 -1
  94. package/lib/node/components/block/block.helpers.cjs +3 -3
  95. package/lib/node/components/block/block.helpers.mjs +57 -54
  96. package/lib/node/components/block/block.mjs +49 -48
  97. package/lib/node/components/content/components/enable-editor.cjs +1 -1
  98. package/lib/node/components/content/components/enable-editor.helpers.cjs +1 -0
  99. package/lib/node/components/content/components/enable-editor.helpers.mjs +8 -0
  100. package/lib/node/components/content/components/enable-editor.mjs +159 -147
  101. package/lib/node/components/content/content.cjs +1 -1
  102. package/lib/node/components/content/content.mjs +57 -56
  103. package/lib/node/constants/file-types.cjs +1 -0
  104. package/lib/node/constants/file-types.mjs +5 -0
  105. package/lib/node/constants/sdk-version.cjs +1 -1
  106. package/lib/node/constants/sdk-version.mjs +1 -1
  107. package/lib/node/context/builder.context.cjs +1 -1
  108. package/lib/node/context/builder.context.mjs +2 -1
  109. package/lib/node/functions/extract-localized-values.cjs +1 -0
  110. package/lib/node/functions/extract-localized-values.mjs +28 -0
  111. package/lib/node/functions/get-block-component-options.cjs +1 -1
  112. package/lib/node/functions/get-block-component-options.mjs +21 -5
  113. package/lib/node/functions/get-content/generate-content-url.cjs +1 -1
  114. package/lib/node/functions/get-content/generate-content-url.mjs +60 -40
  115. package/lib/node/functions/get-processed-block.cjs +1 -1
  116. package/lib/node/functions/get-processed-block.mjs +49 -49
  117. package/lib/node/functions/register-component.cjs +1 -1
  118. package/lib/node/functions/register-component.mjs +7 -7
  119. package/lib/node/functions/traverse.cjs +1 -0
  120. package/lib/node/functions/traverse.mjs +20 -0
  121. package/lib/node/helpers/flatten.cjs +1 -1
  122. package/lib/node/helpers/flatten.mjs +28 -15
  123. package/package.json +1 -1
  124. package/types/cjs/components/block/block.helpers.d.ts +6 -3
  125. package/types/cjs/components/content/components/enable-editor.helpers.d.ts +11 -0
  126. package/types/cjs/constants/file-types.d.ts +2 -0
  127. package/types/cjs/constants/sdk-version.d.ts +1 -1
  128. package/types/cjs/context/types.d.ts +1 -0
  129. package/types/cjs/functions/extract-localized-values.d.ts +2 -0
  130. package/types/cjs/functions/get-block-component-options.d.ts +2 -1
  131. package/types/cjs/functions/get-processed-block.d.ts +1 -6
  132. package/types/cjs/functions/traverse.d.ts +34 -0
  133. package/types/cjs/helpers/flatten.d.ts +6 -0
  134. package/types/cjs/server-index.d.ts +1 -1
  135. package/types/cjs/types/components.d.ts +3 -0
  136. package/types/esm/components/block/block.helpers.d.ts +6 -3
  137. package/types/esm/components/content/components/enable-editor.helpers.d.ts +11 -0
  138. package/types/esm/constants/file-types.d.ts +2 -0
  139. package/types/esm/constants/sdk-version.d.ts +1 -1
  140. package/types/esm/context/types.d.ts +1 -0
  141. package/types/esm/functions/extract-localized-values.d.ts +2 -0
  142. package/types/esm/functions/get-block-component-options.d.ts +2 -1
  143. package/types/esm/functions/get-processed-block.d.ts +1 -6
  144. package/types/esm/functions/traverse.d.ts +34 -0
  145. package/types/esm/helpers/flatten.d.ts +6 -0
  146. package/types/esm/server-index.d.ts +1 -1
  147. package/types/esm/types/components.d.ts +3 -0
@@ -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"),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;
1
+ "use client";"use strict";const w=require("react/jsx-runtime"),o=require("react"),F=require("../../../context/builder.context.cjs"),V=require("../../../functions/evaluate/evaluate.cjs"),M=require("../../../functions/fast-clone.cjs"),N=require("../../../functions/get-content/index.cjs"),k=require("../../../functions/is-browser.cjs"),g=require("../../../functions/is-editing.cjs"),O=require("../../../functions/is-previewing.cjs"),W=require("../../../functions/log-fetch.cjs"),A=require("../../../functions/register-component.cjs"),y=require("../../../functions/track/index.cjs"),$=require("../../../functions/track/interaction.cjs"),P=require("../../../helpers/canTrack.cjs"),z=require("../../../helpers/preview-lru-cache/set.cjs"),G=require("../../../helpers/subscribe-to-editor.cjs"),L=require("../../../scripts/init-editing.cjs"),J=require("../../block/animator.cjs"),H=require("./enable-editor.helpers.cjs"),Q=require("./styles.helpers.cjs"),X=require("next/navigation");function Y(e){var q,I,R;const l=o.useRef(null);function f(n){var i,a;const t={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(a=(i=e.builderContextSignal).rootSetState)==null||a.call(i,t):e.builderContextSignal.rootState=t}function m(n){var i,a,r,c,d;const t={...e.builderContextSignal.content,...n,data:{...(i=e.builderContextSignal.content)==null?void 0:i.data,...n==null?void 0:n.data},meta:{...(a=e.builderContextSignal.content)==null?void 0:a.meta,...n==null?void 0:n.meta,breakpoints:((r=n==null?void 0:n.meta)==null?void 0:r.breakpoints)||((d=(c=e.builderContextSignal.content)==null?void 0:c.meta)==null?void 0:d.breakpoints)}};z.postPreviewContent({value:t,key:t.id}).then(()=>{j.refresh()})}function T(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[D,Z]=o.useState(()=>e.contentWrapper||"div");function S(n){return G.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:t=>{var r;const{breakpoints:i,contentId:a}=t;!a||a!==((r=e.builderContextSignal.content)==null?void 0:r.id)||i&&m({meta:{breakpoints:i}})},animation:t=>{J.triggerAnimation(t)},contentUpdate:t=>{m(t)}}})(n)}const[v,p]=o.useState(()=>({})),[b,ee]=o.useState(()=>({})),[h,K]=o.useState(()=>!1);function _(n){var t,i;if(e.builderContextSignal.content){const a=(t=e.builderContextSignal.content)==null?void 0:t.testVariationId,r=(i=e.builderContextSignal.content)==null?void 0:i.id;y._track({apiHost:e.apiHost,type:"click",canTrack:P.getDefaultCanTrack(e.canTrack),contentId:r,apiKey:e.apiKey,variationId:a!==r?a:void 0,...$.getInteractionPropertiesForEvent(n),unique:!h})}h||K(!0)}function U(){var t,i,a;const n=(a=(i=(t=e.builderContextSignal.content)==null?void 0:t.data)==null?void 0:i.httpRequests)!=null?a:{};Object.entries(n).forEach(([r,c])=>{if(!c||b[r]||v[r]&&!g.isEditing())return;b[r]=!0;const d=c.replace(/{{([^}]+)}}/g,(s,B)=>String(V.evaluate({code:B,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));W.logFetch(d),fetch(d).then(s=>s.json()).then(s=>{f({[r]:s}),v[r]=!0}).catch(s=>{console.error("error fetching dynamic data",c,s)}).finally(()=>{b[r]=!1})})}function u(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:M.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function E(n){window.addEventListener("message",S),L.registerInsertMenu(),L.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,a;if(!e.model||!((i=t.models)!=null&&i.length)||t.models.includes(e.model)){const r=A.createRegisterComponentMessage(t);(a=window.parent)==null||a.postMessage(r,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",u)}function x(n){var c;const t=new URL(location.href).searchParams,i=t.get("builder.preview"),a=t.get(`builder.overrides.${i}`),r=t.get("apiKey")||t.get("builder.space");(i==="BUILDER_STUDIO"||i===e.model&&r===e.apiKey&&(!e.content||a===e.content.id))&&N.fetchOneEntry({model:e.model||"",apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...i==="BUILDER_STUDIO"&&((c=e.context)!=null&&c.symbolId)?{query:{id:e.context.symbolId}}:{}}).then(d=>{d&&m(d)})}const j=X.useRouter(),C=o.useRef(!1);return C.current||(U(),u(),C.current=!0),o.useEffect(()=>{var n;return(n=l.current)==null||n.addEventListener("initeditingbldr",E),()=>{var t;return(t=l.current)==null?void 0:t.removeEventListener("initeditingbldr",E)}},[]),o.useEffect(()=>{var n;return(n=l.current)==null||n.addEventListener("initpreviewingbldr",x),()=>{var t;return(t=l.current)==null?void 0:t.removeEventListener("initpreviewingbldr",x)}},[]),o.useEffect(()=>{var n,t;if(k.isBrowser()){if(g.isEditing()&&!e.isNestedRender&&l.current&&l.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&P.getDefaultCanTrack(e.canTrack)){const a=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,r=(t=e.builderContextSignal.content)==null?void 0:t.id,c=e.apiKey;y._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:r,apiKey:c,variationId:a!==r?a:void 0})}O.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(()=>()=>{k.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",u))},[]),w.jsx(F.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content||H.needsElementRefDivForEditing()?w.jsx(D,{ref:l,onClick:n=>_(n),"builder-content-id":(q=e.builderContextSignal.content)==null?void 0:q.id,"builder-model":e.model,className:Q.getWrapperClassName(((I=e.content)==null?void 0:I.testVariationId)||((R=e.content)==null?void 0:R.id)),style:{display:!e.builderContextSignal.content&&H.needsElementRefDivForEditing()?"none":void 0},...T(),...e.contentWrapperProps,children:e.children}):null})}module.exports=Y;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../constants/target.cjs"),t=require("../../../functions/is-editing.cjs"),n=require("../../../functions/is-previewing.cjs"),e=["svelte","qwik","vue"],r=()=>e.includes(i.TARGET)&&(t.isEditing()||n.isPreviewing());exports.SDKS_USING_ELEMENT_REF_APPROACH=e;exports.needsElementRefDivForEditing=r;
@@ -0,0 +1,8 @@
1
+ import { TARGET as i } from "../../../constants/target.mjs";
2
+ import { isEditing as e } from "../../../functions/is-editing.mjs";
3
+ import { isPreviewing as r } from "../../../functions/is-previewing.mjs";
4
+ const t = ["svelte", "qwik", "vue"], m = () => t.includes(i) && (e() || r());
5
+ export {
6
+ t as SDKS_USING_ELEMENT_REF_APPROACH,
7
+ m as needsElementRefDivForEditing
8
+ };
@@ -1,146 +1,147 @@
1
1
  "use client";
2
- import { jsx as R } from "react/jsx-runtime";
3
- import { useRef as H, useState as m, useEffect as c } from "react";
4
- import A from "../../../context/builder.context.mjs";
5
- import { evaluate as U } from "../../../functions/evaluate/evaluate.mjs";
6
- import { fastClone as _ } from "../../../functions/fast-clone.mjs";
7
- import { fetchOneEntry as D } from "../../../functions/get-content/index.mjs";
2
+ import { jsx as k } from "react/jsx-runtime";
3
+ import { useRef as P, useState as s, useEffect as l } from "react";
4
+ import O from "../../../context/builder.context.mjs";
5
+ import { evaluate as W } from "../../../functions/evaluate/evaluate.mjs";
6
+ import { fastClone as j } from "../../../functions/fast-clone.mjs";
7
+ import { fetchOneEntry as A } 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 F } from "../../../functions/is-previewing.mjs";
11
- import { logFetch as O } from "../../../functions/log-fetch.mjs";
12
- import { createRegisterComponentMessage as B } from "../../../functions/register-component.mjs";
13
- import { _track as y } from "../../../functions/track/index.mjs";
14
- import { getInteractionPropertiesForEvent as z } from "../../../functions/track/interaction.mjs";
10
+ import { isPreviewing as B } from "../../../functions/is-previewing.mjs";
11
+ import { logFetch as F } from "../../../functions/log-fetch.mjs";
12
+ import { createRegisterComponentMessage as z } from "../../../functions/register-component.mjs";
13
+ import { _track as H } from "../../../functions/track/index.mjs";
14
+ import { getInteractionPropertiesForEvent as $ } from "../../../functions/track/interaction.mjs";
15
15
  import { getDefaultCanTrack as K } from "../../../helpers/canTrack.mjs";
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) {
23
- var w, k, P;
24
- const d = H(null);
16
+ import { postPreviewContent as G } from "../../../helpers/preview-lru-cache/set.mjs";
17
+ import { createEditorListener as J } from "../../../helpers/subscribe-to-editor.mjs";
18
+ import { registerInsertMenu as Q, setupBrowserForEditing as X } from "../../../scripts/init-editing.mjs";
19
+ import { triggerAnimation as Y } from "../../block/animator.mjs";
20
+ import { needsElementRefDivForEditing as q } from "./enable-editor.helpers.mjs";
21
+ import { getWrapperClassName as Z } from "./styles.helpers.mjs";
22
+ import { useRouter as p } from "next/navigation";
23
+ function we(e) {
24
+ var R, w, y;
25
+ const c = P(null);
25
26
  function g(n) {
26
- var r, i;
27
- const e = {
28
- ...t.builderContextSignal.rootState,
27
+ var i, a;
28
+ const t = {
29
+ ...e.builderContextSignal.rootState,
29
30
  ...n
30
31
  };
31
- t.builderContextSignal.rootSetState ? (i = (r = t.builderContextSignal).rootSetState) == null || i.call(r, e) : t.builderContextSignal.rootState = e;
32
+ e.builderContextSignal.rootSetState ? (a = (i = e.builderContextSignal).rootSetState) == null || a.call(i, t) : e.builderContextSignal.rootState = t;
32
33
  }
33
34
  function b(n) {
34
- var r, i, a, o, u;
35
- const e = {
36
- ...t.builderContextSignal.content,
35
+ var i, a, r, o, d;
36
+ const t = {
37
+ ...e.builderContextSignal.content,
37
38
  ...n,
38
39
  data: {
39
- ...(r = t.builderContextSignal.content) == null ? void 0 : r.data,
40
+ ...(i = e.builderContextSignal.content) == null ? void 0 : i.data,
40
41
  ...n == null ? void 0 : n.data
41
42
  },
42
43
  meta: {
43
- ...(i = t.builderContextSignal.content) == null ? void 0 : i.meta,
44
+ ...(a = e.builderContextSignal.content) == null ? void 0 : a.meta,
44
45
  ...n == null ? void 0 : n.meta,
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)
46
+ breakpoints: ((r = n == null ? void 0 : n.meta) == null ? void 0 : r.breakpoints) || ((d = (o = e.builderContextSignal.content) == null ? void 0 : o.meta) == null ? void 0 : d.breakpoints)
46
47
  }
47
48
  };
48
- $({
49
- value: e,
50
- key: e.id
49
+ G({
50
+ value: t,
51
+ key: t.id
51
52
  }).then(() => {
52
- W.refresh();
53
+ M.refresh();
53
54
  });
54
55
  }
55
- function q() {
56
- return t.showContent ? {} : {
56
+ function T() {
57
+ return e.showContent ? {} : {
57
58
  hidden: !0,
58
59
  "aria-hidden": !0
59
60
  };
60
61
  }
61
- const [T, p] = m(
62
- () => t.contentWrapper || "div"
62
+ const [D, ee] = s(
63
+ () => e.contentWrapper || "div"
63
64
  );
64
65
  function v(n) {
65
- return G({
66
- model: t.model,
67
- trustedHosts: t.trustedHosts,
66
+ return J({
67
+ model: e.model,
68
+ trustedHosts: e.trustedHosts,
68
69
  callbacks: {
69
- configureSdk: (e) => {
70
- var a;
71
- const { breakpoints: r, contentId: i } = e;
72
- !i || i !== ((a = t.builderContextSignal.content) == null ? void 0 : a.id) || r && b({
70
+ configureSdk: (t) => {
71
+ var r;
72
+ const { breakpoints: i, contentId: a } = t;
73
+ !a || a !== ((r = e.builderContextSignal.content) == null ? void 0 : r.id) || i && b({
73
74
  meta: {
74
- breakpoints: r
75
+ breakpoints: i
75
76
  }
76
77
  });
77
78
  },
78
- animation: (e) => {
79
- X(e);
79
+ animation: (t) => {
80
+ Y(t);
80
81
  },
81
- contentUpdate: (e) => {
82
- b(e);
82
+ contentUpdate: (t) => {
83
+ b(t);
83
84
  }
84
85
  }
85
86
  })(n);
86
87
  }
87
- const [h, tt] = m(() => ({})), [S, et] = m(() => ({})), [x, V] = m(() => !1);
88
- function M(n) {
89
- var e, r;
90
- if (t.builderContextSignal.content) {
91
- const i = (e = t.builderContextSignal.content) == null ? void 0 : e.testVariationId, a = (r = t.builderContextSignal.content) == null ? void 0 : r.id;
92
- y({
93
- apiHost: t.apiHost,
88
+ const [h, te] = s(() => ({})), [S, ne] = s(() => ({})), [x, U] = s(() => !1);
89
+ function V(n) {
90
+ var t, i;
91
+ if (e.builderContextSignal.content) {
92
+ const a = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, r = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
93
+ H({
94
+ apiHost: e.apiHost,
94
95
  type: "click",
95
- canTrack: K(t.canTrack),
96
- contentId: a,
97
- apiKey: t.apiKey,
98
- variationId: i !== a ? i : void 0,
99
- ...z(n),
96
+ canTrack: K(e.canTrack),
97
+ contentId: r,
98
+ apiKey: e.apiKey,
99
+ variationId: a !== r ? a : void 0,
100
+ ...$(n),
100
101
  unique: !x
101
102
  });
102
103
  }
103
- x || V(!0);
104
+ x || U(!0);
104
105
  }
105
- function N() {
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())
106
+ function _() {
107
+ var t, i, a;
108
+ const n = (a = (i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.httpRequests) != null ? a : {};
109
+ Object.entries(n).forEach(([r, o]) => {
110
+ if (!o || S[r] || h[r] && !f())
110
111
  return;
111
- S[a] = !0;
112
- const u = o.replace(
112
+ S[r] = !0;
113
+ const d = o.replace(
113
114
  /{{([^}]+)}}/g,
114
- (l, j) => String(
115
- U({
116
- code: j,
117
- context: t.context || {},
115
+ (u, N) => String(
116
+ W({
117
+ code: N,
118
+ context: e.context || {},
118
119
  localState: void 0,
119
- rootState: t.builderContextSignal.rootState,
120
- rootSetState: t.builderContextSignal.rootSetState
120
+ rootState: e.builderContextSignal.rootState,
121
+ rootSetState: e.builderContextSignal.rootSetState
121
122
  })
122
123
  )
123
124
  );
124
- O(u), fetch(u).then((l) => l.json()).then((l) => {
125
+ F(d), fetch(d).then((u) => u.json()).then((u) => {
125
126
  g({
126
- [a]: l
127
- }), h[a] = !0;
128
- }).catch((l) => {
129
- console.error("error fetching dynamic data", o, l);
127
+ [r]: u
128
+ }), h[r] = !0;
129
+ }).catch((u) => {
130
+ console.error("error fetching dynamic data", o, u);
130
131
  }).finally(() => {
131
- S[a] = !1;
132
+ S[r] = !1;
132
133
  });
133
134
  });
134
135
  }
135
- function s() {
136
+ function m() {
136
137
  f() && window.dispatchEvent(
137
138
  new CustomEvent(
138
139
  "builder:component:stateChange",
139
140
  {
140
141
  detail: {
141
- state: _(t.builderContextSignal.rootState),
142
+ state: j(e.builderContextSignal.rootState),
142
143
  ref: {
143
- name: t.model
144
+ name: e.model
144
145
  }
145
146
  }
146
147
  }
@@ -148,110 +149,121 @@ function It(t) {
148
149
  );
149
150
  }
150
151
  function C(n) {
151
- window.addEventListener("message", v), J(), Q({
152
- ...t.locale ? {
153
- locale: t.locale
152
+ window.addEventListener("message", v), Q(), X({
153
+ ...e.locale ? {
154
+ locale: e.locale
154
155
  } : {},
155
- ...t.enrich ? {
156
- enrich: t.enrich
156
+ ...e.enrich ? {
157
+ enrich: e.enrich
157
158
  } : {},
158
- ...t.trustedHosts ? {
159
- trustedHosts: t.trustedHosts
159
+ ...e.trustedHosts ? {
160
+ trustedHosts: e.trustedHosts
160
161
  } : {}
161
162
  }), Object.values(
162
- t.builderContextSignal.componentInfos
163
- ).forEach((e) => {
164
- var i;
165
- const r = B(e);
166
- (i = window.parent) == null || i.postMessage(r, "*");
163
+ e.builderContextSignal.componentInfos
164
+ ).forEach((t) => {
165
+ var i, a;
166
+ if (!e.model || !((i = t.models) != null && i.length) || t.models.includes(e.model)) {
167
+ const r = z(t);
168
+ (a = window.parent) == null || a.postMessage(r, "*");
169
+ }
167
170
  }), window.addEventListener(
168
171
  "builder:component:stateChangeListenerActivated",
169
- s
172
+ m
170
173
  );
171
174
  }
172
175
  function E(n) {
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({
177
- model: t.model,
178
- apiKey: t.apiKey,
179
- apiVersion: t.builderContextSignal.apiVersion
180
- }).then((o) => {
181
- o && b(o);
176
+ var o;
177
+ const t = new URL(location.href).searchParams, i = t.get("builder.preview"), a = t.get(
178
+ `builder.overrides.${i}`
179
+ ), r = t.get("apiKey") || t.get("builder.space");
180
+ (i === "BUILDER_STUDIO" || i === e.model && r === e.apiKey && (!e.content || a === e.content.id)) && A({
181
+ model: e.model || "",
182
+ apiKey: e.apiKey,
183
+ apiVersion: e.builderContextSignal.apiVersion,
184
+ ...i === "BUILDER_STUDIO" && ((o = e.context) != null && o.symbolId) ? {
185
+ query: {
186
+ id: e.context.symbolId
187
+ }
188
+ } : {}
189
+ }).then((d) => {
190
+ d && b(d);
182
191
  });
183
192
  }
184
- const W = Z(), I = H(!1);
185
- return I.current || (N(), s(), I.current = !0), c(() => {
193
+ const M = p(), I = P(!1);
194
+ return I.current || (_(), m(), I.current = !0), l(() => {
186
195
  var n;
187
- return (n = d.current) == null || n.addEventListener(
196
+ return (n = c.current) == null || n.addEventListener(
188
197
  "initeditingbldr",
189
198
  C
190
199
  ), () => {
191
- var e;
192
- return (e = d.current) == null ? void 0 : e.removeEventListener(
200
+ var t;
201
+ return (t = c.current) == null ? void 0 : t.removeEventListener(
193
202
  "initeditingbldr",
194
203
  C
195
204
  );
196
205
  };
197
- }, []), c(() => {
206
+ }, []), l(() => {
198
207
  var n;
199
- return (n = d.current) == null || n.addEventListener(
208
+ return (n = c.current) == null || n.addEventListener(
200
209
  "initpreviewingbldr",
201
210
  E
202
211
  ), () => {
203
- var e;
204
- return (e = d.current) == null ? void 0 : e.removeEventListener(
212
+ var t;
213
+ return (t = c.current) == null ? void 0 : t.removeEventListener(
205
214
  "initpreviewingbldr",
206
215
  E
207
216
  );
208
217
  };
209
- }, []), c(() => {
210
- var n, e;
218
+ }, []), l(() => {
219
+ var n, t;
211
220
  if (L()) {
212
- if (f() && !t.isNestedRender && d.current && d.current.dispatchEvent(new CustomEvent("initeditingbldr")), t.builderContextSignal.content && K(t.canTrack)) {
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;
214
- y({
215
- apiHost: t.apiHost,
221
+ if (f() && !e.isNestedRender && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && K(e.canTrack)) {
222
+ const a = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, r = (t = e.builderContextSignal.content) == null ? void 0 : t.id, o = e.apiKey;
223
+ H({
224
+ apiHost: e.apiHost,
216
225
  type: "impression",
217
226
  canTrack: !0,
218
- contentId: a,
227
+ contentId: r,
219
228
  apiKey: o,
220
- variationId: i !== a ? i : void 0
229
+ variationId: a !== r ? a : void 0
221
230
  });
222
231
  }
223
- F() && f();
232
+ B() && f();
224
233
  }
225
- }, []), c(() => {
226
- }, [t.content]), c(() => {
227
- s();
228
- }, [t.builderContextSignal.rootState]), c(() => {
229
- t.data && g(t.data);
230
- }, [t.data]), c(() => {
231
- t.locale && g({
232
- locale: t.locale
234
+ }, []), l(() => {
235
+ }, [e.content]), l(() => {
236
+ m();
237
+ }, [e.builderContextSignal.rootState]), l(() => {
238
+ e.data && g(e.data);
239
+ }, [e.data]), l(() => {
240
+ e.locale && g({
241
+ locale: e.locale
233
242
  });
234
- }, [t.locale]), c(() => () => {
243
+ }, [e.locale]), l(() => () => {
235
244
  L() && (window.removeEventListener("message", v), window.removeEventListener(
236
245
  "builder:component:stateChangeListenerActivated",
237
- s
246
+ m
238
247
  ));
239
- }, []), /* @__PURE__ */ R(A.Provider, { value: t.builderContextSignal, children: t.builderContextSignal.content ? /* @__PURE__ */ R(
240
- T,
248
+ }, []), /* @__PURE__ */ k(O.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content || q() ? /* @__PURE__ */ k(
249
+ D,
241
250
  {
242
- ref: d,
243
- onClick: (n) => M(n),
244
- "builder-content-id": (w = t.builderContextSignal.content) == null ? void 0 : w.id,
245
- "builder-model": t.model,
246
- className: Y(
247
- ((k = t.content) == null ? void 0 : k.testVariationId) || ((P = t.content) == null ? void 0 : P.id)
251
+ ref: c,
252
+ onClick: (n) => V(n),
253
+ "builder-content-id": (R = e.builderContextSignal.content) == null ? void 0 : R.id,
254
+ "builder-model": e.model,
255
+ className: Z(
256
+ ((w = e.content) == null ? void 0 : w.testVariationId) || ((y = e.content) == null ? void 0 : y.id)
248
257
  ),
249
- ...q(),
250
- ...t.contentWrapperProps,
251
- children: t.children
258
+ style: {
259
+ display: !e.builderContextSignal.content && q() ? "none" : void 0
260
+ },
261
+ ...T(),
262
+ ...e.contentWrapperProps,
263
+ children: e.children
252
264
  }
253
265
  ) : null });
254
266
  }
255
267
  export {
256
- It as default
268
+ we as default
257
269
  };
@@ -1 +1 @@
1
- "use strict";const i=require("react/jsx-runtime"),y=require("../../constants/builder-registered-components.cjs"),R=require("../../functions/evaluate/evaluate.cjs"),f=require("../../functions/register-component.cjs"),W=require("../../helpers/logger.cjs"),j=require("../blocks/blocks.cjs"),P=require("../content-variants/helpers.cjs"),V=require("../inlined-script.cjs"),K=require("./components/enable-editor.cjs"),T=require("./components/styles.cjs"),q=require("./content.helpers.cjs");function N(e){var a,r,s,l,d,u,g,C,S,m,k,x,b;const v=P.getUpdateVariantVisibilityScript({variationId:(a=e.content)==null?void 0:a.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),I=[...y.getDefaultRegisteredComponents(),...((s=e.customComponents)==null?void 0:s.filter(({models:t})=>!(t!=null&&t.length)||!e.model?!0:t.includes(e.model)))||[]].reduce((t,{component:h,...o})=>({...t,[o.name]:{component:h,...f.serializeIncludingFunctions(o)}}),{}),n={content:q.getContentInitialValue({content:e.content,data:e.data}),localState:void 0,rootState:q.getRootStateInitialValue({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...y.getDefaultRegisteredComponents(),...((l=e.customComponents)==null?void 0:l.filter(({models:t})=>!(t!=null&&t.length)||!e.model?!0:t.includes(e.model)))||[]].reduce((t,{component:h,...o})=>({...t,[o.name]:f.serializeIncludingFunctions(o)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""};e.apiKey||W.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const c=(u=(d=n.content)==null?void 0:d.data)==null?void 0:u.jsCode;return c&&R.evaluate({code:c,context:e.context||{},localState:void 0,rootState:n.rootState,rootSetState:t=>{n.rootState=t},isExpression:!1}),i.jsxs(K,{apiHost:e.apiHost,nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:n,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,children:[e.isSsrAbTest?i.jsx(V,{id:"builderio-variant-visibility",scriptStr:v,nonce:e.nonce||""}):null,i.jsx(T,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(g=n.content)==null?void 0:g.id,cssCode:(S=(C=n.content)==null?void 0:C.data)==null?void 0:S.cssCode,customFonts:(k=(m=n.content)==null?void 0:m.data)==null?void 0:k.customFonts}),i.jsx(j,{blocks:(b=(x=n.content)==null?void 0:x.data)==null?void 0:b.blocks,context:n,registeredComponents:I,linkComponent:e.linkComponent})]})}module.exports=N;
1
+ "use strict";const c=require("react/jsx-runtime"),b=require("../../constants/builder-registered-components.cjs"),h=require("../../functions/evaluate/evaluate.cjs"),y=require("../../functions/register-component.cjs"),R=require("../../helpers/logger.cjs"),W=require("../blocks/blocks.cjs"),j=require("../content-variants/helpers.cjs"),P=require("../inlined-script.cjs"),V=require("./components/enable-editor.cjs"),K=require("./components/styles.cjs"),q=require("./content.helpers.cjs");function T(e){var a,s,r,d,l,u,m,C,g,S,k;const v=j.getUpdateVariantVisibilityScript({variationId:(a=e.content)==null?void 0:a.testVariationId,contentId:(s=e.content)==null?void 0:s.id}),I=[...b.getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((n,{component:x,...o})=>({...n,[o.name]:{component:x,...y.serializeIncludingFunctions(o)}}),{}),t={content:q.getContentInitialValue({content:e.content,data:e.data}),localState:void 0,rootState:q.getRootStateInitialValue({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...b.getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((n,{component:x,...o})=>({...n,[o.name]:y.serializeIncludingFunctions(o)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model||""};e.apiKey||R.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const i=(d=(r=t.content)==null?void 0:r.data)==null?void 0:d.jsCode;return i&&h.evaluate({code:i,context:e.context||{},localState:void 0,rootState:t.rootState,rootSetState:n=>{t.rootState=n},isExpression:!1}),c.jsxs(V,{apiHost:e.apiHost,nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:t,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,children:[e.isSsrAbTest?c.jsx(P,{id:"builderio-variant-visibility",scriptStr:v,nonce:e.nonce||""}):null,c.jsx(K,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(l=t.content)==null?void 0:l.id,cssCode:(m=(u=t.content)==null?void 0:u.data)==null?void 0:m.cssCode,customFonts:(g=(C=t.content)==null?void 0:C.data)==null?void 0:g.customFonts}),c.jsx(W,{blocks:(k=(S=t.content)==null?void 0:S.data)==null?void 0:k.blocks,context:t,registeredComponents:I,linkComponent:e.linkComponent})]})}module.exports=T;