@builder.io/sdk-react 1.0.16 → 1.0.19

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 (55) hide show
  1. package/lib/browser/blocks-exports.cjs +22 -22
  2. package/lib/browser/blocks-exports.mjs +498 -506
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +22 -21
  5. package/lib/browser/{server-entry-11e01841.cjs → server-entry-1a86f409.cjs} +1 -1
  6. package/lib/browser/{server-entry-afeff3cb.js → server-entry-cfff49d1.js} +1 -1
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{blocks-8e5cc463.js → blocks-1ea14427.js} +179 -192
  10. package/lib/edge/{blocks-a0a9d452.cjs → blocks-5341123d.cjs} +9 -9
  11. package/lib/edge/blocks-exports.cjs +1 -1
  12. package/lib/edge/blocks-exports.mjs +27 -13
  13. package/lib/edge/{button-66c46316.cjs → button-c6255c8e.cjs} +1 -1
  14. package/lib/edge/{button-764707c4.js → button-f5764a4c.js} +2 -2
  15. package/lib/edge/{columns-0a14db0e.cjs → columns-01e0bb50.cjs} +1 -1
  16. package/lib/edge/{columns-0bdc7586.js → columns-17090869.js} +24 -23
  17. package/lib/edge/content-variants-3961c4ee.cjs +134 -0
  18. package/lib/edge/{content-variants-db1e0281.js → content-variants-bfca78f9.js} +230 -239
  19. package/lib/edge/dynamic-blocks-exports.cjs +2 -0
  20. package/lib/edge/dynamic-blocks-exports.mjs +4 -1
  21. package/lib/edge/{form-7a6f998f.js → form-39e97f30.js} +6 -5
  22. package/lib/edge/form-b97fba27.cjs +1 -0
  23. package/lib/edge/{get-class-prop-name-49cbb2c6.js → get-class-prop-name-859a7f60.js} +1 -1
  24. package/lib/edge/{get-class-prop-name-bbc4d2f3.cjs → get-class-prop-name-f1301669.cjs} +1 -1
  25. package/lib/edge/{img-058cb6f0.cjs → img-0c1e53c0.cjs} +1 -1
  26. package/lib/edge/{img-c9630f56.js → img-b4ff1bef.js} +1 -1
  27. package/lib/edge/index.cjs +1 -1
  28. package/lib/edge/index.mjs +22 -21
  29. package/lib/edge/{input-ceacd029.cjs → input-2103da14.cjs} +1 -1
  30. package/lib/edge/{input-3de90790.js → input-c6fee09c.js} +1 -1
  31. package/lib/edge/{select-df72f987.cjs → select-b8ad0a4c.cjs} +1 -1
  32. package/lib/edge/{select-ee266e60.js → select-f260d051.js} +1 -1
  33. package/lib/edge/{server-entry-ef266884.cjs → server-entry-00891f33.cjs} +1 -1
  34. package/lib/edge/{server-entry-2b1068fd.js → server-entry-d46a218d.js} +1 -1
  35. package/lib/edge/server-entry.cjs +1 -1
  36. package/lib/edge/server-entry.mjs +1 -1
  37. package/lib/edge/slot-8de7d746.cjs +1 -0
  38. package/lib/edge/{slot-f246e67e.js → slot-c9f94715.js} +6 -5
  39. package/lib/edge/{symbol-f68a7357.js → symbol-324dadc8.js} +2 -2
  40. package/lib/edge/{symbol-991f09b3.cjs → symbol-636383eb.cjs} +1 -1
  41. package/lib/node/blocks-exports.cjs +10 -10
  42. package/lib/node/blocks-exports.mjs +241 -249
  43. package/lib/node/index.cjs +1 -1
  44. package/lib/node/index.mjs +22 -21
  45. package/lib/node/{server-entry-a221fe66.js → server-entry-8c84ddbd.js} +1 -1
  46. package/lib/node/{server-entry-4ba58cf3.cjs → server-entry-ff6fc2b4.cjs} +1 -1
  47. package/lib/node/server-entry.cjs +1 -1
  48. package/lib/node/server-entry.mjs +1 -1
  49. package/package.json +1 -1
  50. package/types/constants/sdk-version.d.ts +1 -1
  51. package/types/context/index.d.ts +1 -0
  52. package/types/index-helpers/blocks-exports.d.ts +4 -0
  53. package/lib/edge/content-variants-c03ec7a1.cjs +0 -134
  54. package/lib/edge/form-a5d18c89.cjs +0 -1
  55. package/lib/edge/slot-83d735d6.cjs +0 -1
@@ -1,15 +1,15 @@
1
- "use client";"use strict";var Pe=Object.defineProperty;var Ve=(e,t,n)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>(Ve(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("./server-entry-11e01841.cjs"),h=require("react"),Fe=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Be=e=>typeof e=="string"&&Fe.has(e.toLowerCase());function Y(e){return a.jsx(a.Fragment,{children:Be(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const D=()=>{switch(m.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function ce(e){return a.jsx(Y,{attributes:{...e.attributes,[D()]:`${e.link?"":"builder-button"} ${e.attributes[D()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const G=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}}),de=h.createContext({registeredComponents:{}});function Ae(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const We=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),Ne=()=>({isEditing:m.isEditing(),isBrowser:m.isBrowser(),isServer:!m.isBrowser(),getUserAttributes:()=>m.getUserAttributes()}),$e=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,te=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:s})=>{const l=We({builder:t,context:n,event:i,state:ue({rootState:s,localState:o,rootSetState:r})});return new Function(...l.map(([d])=>d),e)(...l.map(([,d])=>d))};function ue({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const r=i[o];return typeof r=="object"&&r!==null?ue({rootState:r,localState:void 0,rootSetState:n?s=>{i[o]=s,n(i)}:void 0}):r},set:(i,o,r)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=r,n==null||n(i),!0}})}function De(){var e;return typeof process!="undefined"&&m.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const Le=()=>{var i;if(!De())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(m.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},Me=e=>(m.isBrowser()||Le(),te(e)),V=class V{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return V.cache.get(t)}static setCachedValue(t,n){V.cache.size>20&&V.cache.delete(V.cache.keys().next().value),V.cache.set(t,{value:n})}};q(V,"cacheLimit",20),q(V,"cache",new Map);let $=V;function L({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:s=!0,enableCache:l}){if(e===""){m.logger.warn("Skipping evaluation of empty code block.");return}const d={code:$e(e,{isExpression:s}),builder:Ne(),context:t,event:r,rootSetState:o,rootState:i,localState:n};if(l){const c=$.getCacheKey(d),f=$.getCachedValue(c);if(f)return f.value}try{const c=Me(d);if(l){const f=$.getCacheKey(d);$.setCachedValue(f,c)}return c}catch(c){m.logger.error("Failed code evaluation: "+c.message,{code:e});return}}const me=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,r,s)=>Object(o[r])===o[r]?o[r]:o[r]=Math.abs(Number(i[s+1]))>>0===+i[s+1]?[]:{},e)[i[i.length-1]]=n,e};const Oe=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=m.fastClone(e),s={...r,properties:{...r.properties},actions:{...r.actions}};for(const l in e.bindings){const d=e.bindings[l],c=L({code:d,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});me(s,l,c)}return s};function H({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const s=e;return n?Oe({block:s,localState:i,rootState:o,rootSetState:r,context:t}):s}function Ue(e,t,n={}){let i,o,r,s=null,l=0;const d=function(){l=n.leading===!1?0:Date.now(),s=null,r=e.apply(i,o),s||(i=o=null)};return function(){const c=Date.now();!l&&n.leading===!1&&(l=c);const f=t-(c-l);return i=this,o=arguments,f<=0||f>t?(s&&(clearTimeout(s),s=null),l=c,r=e.apply(i,o),s||(i=o=null)):!s&&n.trailing!==!1&&(s=setTimeout(d,f)),r}}function A(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])}return n}const Q=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function He(e){for(const t of e)switch(t.trigger){case"pageLoad":fe(t);break;case"hover":qe(t);break;case"scrollInView":ze(t);break}}function X(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Z(e,t){const n=Ke(e),i=getComputedStyle(t),o=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,s=[o,r];for(const l of s)for(const d of n)d in l||(l[d]=i[d])}function Ke(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function fe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){X(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Z(e,n),n.style.transition="none",n.style.transitionDelay="0",A(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Q(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),A(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function qe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){X(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Z(e,n);const i=e.steps[0].styles,o=e.steps[1].styles;function r(){A(n.style,i)}function s(){A(n.style,o)}r(),n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",r),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Q(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")})})}function ze(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){X(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Z(e,n);let i=!1,o=!1;function r(){!i&&l(n)?(i=!0,o=!0,setTimeout(()=>{A(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",s),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!l(n)&&(i=!1,A(n.style,e.steps[0].styles))}const s=Ue(r,200,{leading:!1});function l(f){const b=f.getBoundingClientRect(),x=window.innerHeight,C=(e.thresholdPercent||0)/100*x;return b.bottom>C&&b.top<x-C}const d=e.steps[0].styles;function c(){A(n.style,d)}c(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Q(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",s,{capture:!0,passive:!0}),r()})}const _e=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),he=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${_e(n)}: ${i};`}).filter(m.checkIsDefined),Je=e=>he(e).join(`
2
- `),z=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
3
- ${Je(n)}
1
+ "use client";"use strict";var Ve=Object.defineProperty;var Fe=(e,t,n)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var z=(e,t,n)=>(Fe(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("./server-entry-1a86f409.cjs"),h=require("react"),Be=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ae=e=>typeof e=="string"&&Be.has(e.toLowerCase());function G(e){return a.jsx(a.Fragment,{children:Ae(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const L=()=>{switch(f.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function ce(e){return a.jsx(G,{attributes:{...e.attributes,[L()]:`${e.link?"":"builder-button"} ${e.attributes[L()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const K=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}}),de=h.createContext({registeredComponents:{}});function We(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const Ne=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),$e=()=>({isEditing:f.isEditing(),isBrowser:f.isBrowser(),isServer:!f.isBrowser(),getUserAttributes:()=>f.getUserAttributes()}),De=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,te=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:s})=>{const l=Ne({builder:t,context:n,event:i,state:ue({rootState:s,localState:o,rootSetState:r})});return new Function(...l.map(([d])=>d),e)(...l.map(([,d])=>d))};function ue({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const r=i[o];return typeof r=="object"&&r!==null?ue({rootState:r,localState:void 0,rootSetState:n?s=>{i[o]=s,n(i)}:void 0}):r},set:(i,o,r)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=r,n==null||n(i),!0}})}function Le(){var e;return typeof process!="undefined"&&f.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const Me=()=>{var i;if(!Le())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(f.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},Oe=e=>(f.isBrowser()||Me(),te(e)),F=class F{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return F.cache.get(t)}static setCachedValue(t,n){F.cache.size>20&&F.cache.delete(F.cache.keys().next().value),F.cache.set(t,{value:n})}};z(F,"cacheLimit",20),z(F,"cache",new Map);let D=F;function M({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:s=!0,enableCache:l}){if(e===""){f.logger.warn("Skipping evaluation of empty code block.");return}const d={code:De(e,{isExpression:s}),builder:$e(),context:t,event:r,rootSetState:o,rootState:i,localState:n};if(l){const c=D.getCacheKey(d),m=D.getCachedValue(c);if(m)return m.value}try{const c=Oe(d);if(l){const m=D.getCacheKey(d);D.setCachedValue(m,c)}return c}catch(c){f.logger.error("Failed code evaluation: "+c.message,{code:e});return}}const me=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,r,s)=>Object(o[r])===o[r]?o[r]:o[r]=Math.abs(Number(i[s+1]))>>0===+i[s+1]?[]:{},e)[i[i.length-1]]=n,e};const Ue=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=f.fastClone(e),s={...r,properties:{...r.properties},actions:{...r.actions}};for(const l in e.bindings){const d=e.bindings[l],c=M({code:d,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});me(s,l,c)}return s};function H({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const s=e;return n?Ue({block:s,localState:i,rootState:o,rootSetState:r,context:t}):s}function He(e,t,n={}){let i,o,r,s=null,l=0;const d=function(){l=n.leading===!1?0:Date.now(),s=null,r=e.apply(i,o),s||(i=o=null)};return function(){const c=Date.now();!l&&n.leading===!1&&(l=c);const m=t-(c-l);return i=this,o=arguments,m<=0||m>t?(s&&(clearTimeout(s),s=null),l=c,r=e.apply(i,o),s||(i=o=null)):!s&&n.trailing!==!1&&(s=setTimeout(d,m)),r}}function W(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])}return n}const Q=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Ke(e){for(const t of e)switch(t.trigger){case"pageLoad":fe(t);break;case"hover":ze(t);break;case"scrollInView":_e(t);break}}function X(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Z(e,t){const n=qe(e),i=getComputedStyle(t),o=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,s=[o,r];for(const l of s)for(const d of n)d in l||(l[d]=i[d])}function qe(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function fe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){X(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Z(e,n),n.style.transition="none",n.style.transitionDelay="0",W(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Q(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),W(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function ze(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){X(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Z(e,n);const i=e.steps[0].styles,o=e.steps[1].styles;function r(){W(n.style,i)}function s(){W(n.style,o)}r(),n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",r),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Q(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")})})}function _e(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){X(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Z(e,n);let i=!1,o=!1;function r(){!i&&l(n)?(i=!0,o=!0,setTimeout(()=>{W(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",s),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!l(n)&&(i=!1,W(n.style,e.steps[0].styles))}const s=He(r,200,{leading:!1});function l(m){const g=m.getBoundingClientRect(),y=window.innerHeight,k=(e.thresholdPercent||0)/100*y;return g.bottom>k&&g.top<y-k}const d=e.steps[0].styles;function c(){W(n.style,d)}c(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Q(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",s,{capture:!0,passive:!0}),r()})}const Je=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),he=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${Je(n)}: ${i};`}).filter(f.checkIsDefined),Ye=e=>he(e).join(`
2
+ `),_=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
3
+ ${Ye(n)}
4
4
  }`;return e?`${e} {
5
5
  ${i}
6
- }`:i};function Ye({style:e}){return e}const Ge=({block:e,context:t})=>ge(Ye({style:e.style||{},context:t,block:e}));function ge(e){switch(m.TARGET){case"svelte":case"vue":case"solid":return he(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const Qe=({block:e,context:t,registeredComponents:n})=>{var r;const i=(r=H({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
6
+ }`:i};function Ge({style:e}){return e}const Qe=({block:e,context:t})=>ge(Ge({style:e.style||{},context:t,block:e}));function ge(e){switch(f.TARGET){case"svelte":case"vue":case"solid":return he(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const Xe=({block:e,context:t,registeredComponents:n})=>{var r;const i=(r=H({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
7
7
  Could not find a registered component named "${i}".
8
- If you registered it, is the file that registered it imported by the file that needs to render it?`)},Xe=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=L({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),s=n.itemName||(r?r+"Item":"item");return o.map((d,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:d,[s]:d,[`$${s}Index`]:c}},block:i}))},be={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ne=(e,t=be)=>`@media (max-width: ${t[e].max}px)`,ye=({small:e,medium:t})=>{const n=m.fastClone(be);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function K(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function Ze(e){function t(){const i=H({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return m.checkIsDefined(i.hide)?!i.hide:m.checkIsDefined(i.show)?i.show:!0}function n(){var C;const i=H({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,r=e.context.content,s=ye(((C=r==null?void 0:r.meta)==null?void 0:C.breakpoints)||{}),l=o==null?void 0:o.large,d=o==null?void 0:o.medium,c=o==null?void 0:o.small,f=i.id;if(!f)return"";const b=l?z({className:f,styles:l}):"",x=d?z({className:f,styles:d,mediaQuery:ne("medium",s)}):"",p=c?z({className:f,styles:c,mediaQuery:ne("small",s)}):"";return[b,x,p].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(K,{id:"builderio-block",styles:n()})}):null})}function et(e){return e.charAt(0).toUpperCase()+e.slice(1)}const tt=e=>`on${et(e)}`,nt=(e,t)=>n=>L({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function xe(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let s=tt(o);if(e.stripPrefix)switch(m.TARGET){case"vue":s=s.replace("v-on:","");break;case"svelte":s=s.replace("on:","");break}t[s]=nt(r,e)}return t}function it({properties:e}){return e}const ot=e=>({href:e.href});function ee({block:e,context:t}){var i;const n={...ot(e),...e.properties,"builder-id":e.id,style:Ge({block:e,context:t}),[D()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return it({properties:n,context:t,block:e})}function at(e){return a.jsx(Y,{TagName:e.Wrapper,attributes:ee({block:e.block,context:e.context}),actionAttributes:xe({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function rt(e){return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...ee({block:e.block,context:e.context}),...xe({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}const st=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:s})=>{const l={...e,...o?{attributes:ee({block:t,context:s})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:l};function ie(e){var i;const[t,n]=h.useState(()=>e.isInteractive?rt:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...st({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(o=>a.jsx(M,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function lt(e){const[t,n]=h.useState(()=>e.repeatContext);return a.jsx(G.Provider,{value:t,children:a.jsx(M,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function M(e){var d,c,f;function t(){return Qe({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return Xe({block:e.block,context:e.context})}function i(){var b;return(b=e.block.repeat)!=null&&b.collection?e.block:H({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function o(){var x;return e.block.tagName==="a"||((x=i().properties)==null?void 0:x.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"}function r(){var p,C;if((p=e.block.repeat)!=null&&p.collection)return!!((C=n==null?void 0:n())!=null&&C.length);const b="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!b}function s(){var x,p;return!((x=t==null?void 0:t())!=null&&x.component)&&!n()?(p=i().children)!=null?p:[]:[]}function l(){var b,x,p,C,w,T,j,v,I,R,E;return{blockChildren:(b=i().children)!=null?b:[],componentRef:(x=t==null?void 0:t())==null?void 0:x.component,componentOptions:{...Ae(i()),builderContext:e.context,...((p=t==null?void 0:t())==null?void 0:p.name)==="Core:Button"||((C=t==null?void 0:t())==null?void 0:C.name)==="Symbol"||((w=t==null?void 0:t())==null?void 0:w.name)==="Columns"||((T=t==null?void 0:t())==null?void 0:T.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((j=t==null?void 0:t())==null?void 0:j.name)==="Symbol"||((v=t==null?void 0:t())==null?void 0:v.name)==="Columns"||((I=t==null?void 0:t())==null?void 0:I.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((R=t==null?void 0:t())==null?void 0:R.noWrap)===!0,isInteractive:!((E=t==null?void 0:t())!=null&&E.isRSC)}}return h.useEffect(()=>{const b=i().id,x=i().animations;x&&b&&He(x.filter(p=>p.trigger!=="hover").map(p=>({...p,elementId:b})))},[]),a.jsx(a.Fragment,{children:r()?a.jsxs(a.Fragment,{children:[a.jsx(Ze,{block:e.block,context:e.context}),(d=t==null?void 0:t())!=null&&d.noWrap?a.jsx(a.Fragment,{children:a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive})}):a.jsx(a.Fragment,{children:n()?a.jsx(a.Fragment,{children:(f=n())==null?void 0:f.map((b,x)=>a.jsx(lt,{repeatContext:b.context,block:b.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},x))}):a.jsxs(at,{Wrapper:o(),block:i(),context:e.context,linkComponent:e.linkComponent,children:[a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive}),(c=s())==null?void 0:c.map(b=>a.jsx(M,{block:b,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},b.id))]})})]}):null})}function ct(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,r;m.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,r;m.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
8
+ If you registered it, is the file that registered it imported by the file that needs to render it?`)},Ze=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=M({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),s=n.itemName||(r?r+"Item":"item");return o.map((d,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:d,[s]:d,[`$${s}Index`]:c}},block:i}))},be={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ne=(e,t=be)=>`@media (max-width: ${t[e].max}px)`,ye=({small:e,medium:t})=>{const n=f.fastClone(be);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function q(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function et(e){function t(){const i=H({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return f.checkIsDefined(i.hide)?!i.hide:f.checkIsDefined(i.show)?i.show:!0}function n(){var k;const i=H({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,r=e.context.content,s=ye(((k=r==null?void 0:r.meta)==null?void 0:k.breakpoints)||{}),l=o==null?void 0:o.large,d=o==null?void 0:o.medium,c=o==null?void 0:o.small,m=i.id;if(!m)return"";const g=l?_({className:m,styles:l}):"",y=d?_({className:m,styles:d,mediaQuery:ne("medium",s)}):"",p=c?_({className:m,styles:c,mediaQuery:ne("small",s)}):"";return[g,y,p].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(q,{id:"builderio-block",styles:n()})}):null})}function tt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const nt=e=>`on${tt(e)}`,it=(e,t)=>n=>M({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function xe(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let s=nt(o);if(e.stripPrefix)switch(f.TARGET){case"vue":s=s.replace("v-on:","");break;case"svelte":s=s.replace("on:","");break}t[s]=it(r,e)}return t}function ot({properties:e}){return e}const at=e=>({href:e.href});function ee({block:e,context:t}){var i;const n={...at(e),...e.properties,"builder-id":e.id,style:Qe({block:e,context:t}),[L()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return ot({properties:n,context:t,block:e})}function rt(e){return a.jsx(G,{TagName:e.Wrapper,attributes:ee({block:e.block,context:e.context}),actionAttributes:xe({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function st(e){return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...ee({block:e.block,context:e.context}),...xe({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}const lt=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:s})=>{const l={...e,...o?{attributes:ee({block:t,context:s})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:l};function ie(e){var i;const[t,n]=h.useState(()=>e.isInteractive?st:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...lt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(o=>a.jsx(O,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function ct(e){const[t,n]=h.useState(()=>e.repeatContext);return a.jsx(K.Provider,{value:t,children:a.jsx(O,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function O(e){var d,c,m;function t(){return Xe({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return Ze({block:e.block,context:e.context})}function i(){var g;return(g=e.block.repeat)!=null&&g.collection?e.block:H({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function o(){var y;return e.block.tagName==="a"||((y=i().properties)==null?void 0:y.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"}function r(){var p,k;if((p=e.block.repeat)!=null&&p.collection)return!!((k=n==null?void 0:n())!=null&&k.length);const g="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!g}function s(){var y,p;return!((y=t==null?void 0:t())!=null&&y.component)&&!n()?(p=i().children)!=null?p:[]:[]}function l(){var g,y,p,k,w,T,j,S,I,R,E;return{blockChildren:(g=i().children)!=null?g:[],componentRef:(y=t==null?void 0:t())==null?void 0:y.component,componentOptions:{...We(i()),builderContext:e.context,...((p=t==null?void 0:t())==null?void 0:p.name)==="Core:Button"||((k=t==null?void 0:t())==null?void 0:k.name)==="Symbol"||((w=t==null?void 0:t())==null?void 0:w.name)==="Columns"||((T=t==null?void 0:t())==null?void 0:T.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((j=t==null?void 0:t())==null?void 0:j.name)==="Symbol"||((S=t==null?void 0:t())==null?void 0:S.name)==="Columns"||((I=t==null?void 0:t())==null?void 0:I.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((R=t==null?void 0:t())==null?void 0:R.noWrap)===!0,isInteractive:!((E=t==null?void 0:t())!=null&&E.isRSC)}}return h.useEffect(()=>{const g=i().id,y=i().animations;y&&g&&Ke(y.filter(p=>p.trigger!=="hover").map(p=>({...p,elementId:g})))},[]),a.jsx(a.Fragment,{children:r()?a.jsxs(a.Fragment,{children:[a.jsx(et,{block:e.block,context:e.context}),(d=t==null?void 0:t())!=null&&d.noWrap?a.jsx(a.Fragment,{children:a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive})}):a.jsx(a.Fragment,{children:n()?a.jsx(a.Fragment,{children:(m=n())==null?void 0:m.map((g,y)=>a.jsx(ct,{repeatContext:g.context,block:g.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},y))}):a.jsxs(rt,{Wrapper:o(),block:i(),context:e.context,linkComponent:e.linkComponent,children:[a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive}),(c=s())==null?void 0:c.map(g=>a.jsx(O,{block:g,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},g.id))]})})]}):null})}function dt(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,r;f.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,r;f.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  align-items: stretch;
12
- }`})]})}function W(e){var i,o,r;const t=h.useContext(G),n=h.useContext(de);return a.jsx(ct,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:((i=e.context)==null?void 0:i.BlocksWrapper)||t.BlocksWrapper,BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||t.BlocksWrapperProps,children:e.blocks?a.jsx(a.Fragment,{children:(r=e.blocks)==null?void 0:r.map(s=>a.jsx(M,{block:s,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},s.id))}):null})}function pe(e){var j;const[t,n]=h.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=h.useState(()=>e.columns||[]),[r,s]=h.useState(()=>e.stackColumnsAt||"tablet");function l(v){var I;return((I=i[v])==null?void 0:I.width)||100/i.length}function d(v){const I=t*(i.length-1)/i.length;return`calc(${l(v)}% - ${I}px)`}function c({stackedStyle:v,desktopStyle:I}){return r==="tablet"?v:I}function f({stackedStyle:v,desktopStyle:I}){return r==="never"?I:v}const[b,x]=h.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function p(){return{"--flex-dir":b,"--flex-dir-tablet":c({stackedStyle:b,desktopStyle:"row"})}}function C(v){const I=v===0?0:t,R=d(v),E=`${I}px`,F="100%",B=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:R,["marginLeft"]:E,"--column-width-mobile":f({stackedStyle:F,desktopStyle:R}),"--column-margin-left-mobile":f({stackedStyle:B,desktopStyle:E}),"--column-width-tablet":c({stackedStyle:F,desktopStyle:R}),"--column-margin-left-tablet":c({stackedStyle:B,desktopStyle:E})}}function w(v){var R,E;return ye(((E=(R=e.builderContext.content)==null?void 0:R.meta)==null?void 0:E.breakpoints)||{})[v].max}function T(){return`
12
+ }`})]})}function N(e){var i,o,r;const t=h.useContext(K),n=h.useContext(de);return a.jsx(dt,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:((i=e.context)==null?void 0:i.BlocksWrapper)||t.BlocksWrapper,BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||t.BlocksWrapperProps,children:e.blocks?a.jsx(a.Fragment,{children:(r=e.blocks)==null?void 0:r.map(s=>a.jsx(O,{block:s,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},s.id))}):null})}function pe(e){var j;const[t,n]=h.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=h.useState(()=>e.columns||[]),[r,s]=h.useState(()=>e.stackColumnsAt||"tablet");function l(S){var I;return((I=i[S])==null?void 0:I.width)||100/i.length}function d(S){const I=t*(i.length-1)/i.length;return`calc(${l(S)}% - ${I}px)`}function c({stackedStyle:S,desktopStyle:I}){return r==="tablet"?S:I}function m({stackedStyle:S,desktopStyle:I}){return r==="never"?I:S}const[g,y]=h.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function p(){return{"--flex-dir":g,"--flex-dir-tablet":c({stackedStyle:g,desktopStyle:"row"})}}function k(S){const I=S===0?0:t,R=d(S),E=`${I}px`,B="100%",A=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:R,["marginLeft"]:E,"--column-width-mobile":m({stackedStyle:B,desktopStyle:R}),"--column-margin-left-mobile":m({stackedStyle:A,desktopStyle:E}),"--column-width-tablet":c({stackedStyle:B,desktopStyle:R}),"--column-margin-left-tablet":c({stackedStyle:A,desktopStyle:E})}}function w(S){var R,E;return ye(((E=(R=e.builderContext.content)==null?void 0:R.meta)==null?void 0:E.breakpoints)||{})[S].max}function T(){return`
13
13
  @media (max-width: ${w("medium")}px) {
14
14
  .${e.builderBlock.id}-breakpoints {
15
15
  flex-direction: var(--flex-dir-tablet);
@@ -33,10 +33,10 @@
33
33
  margin-left: var(--column-margin-left-mobile) !important;
34
34
  }
35
35
  },
36
- `}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,style:p(),children:[a.jsx(K,{id:"builderio-columns",styles:T()}),(j=e.columns)==null?void 0:j.map((v,I)=>a.jsx(Y,{TagName:v.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...v.link?{href:v.link}:{},[D()]:"builder-column",style:ge(C(I))},children:a.jsx(W,{path:`component.options.columns.${I}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:v.blocks})},I))]}),a.jsx("style",{children:`.div-003f4b1c {
36
+ `}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,style:p(),children:[a.jsx(q,{id:"builderio-columns",styles:T()}),(j=e.columns)==null?void 0:j.map((S,I)=>a.jsx(G,{TagName:S.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...S.link?{href:S.link}:{},[L()]:"builder-column",style:ge(k(I))},children:a.jsx(N,{path:`component.options.columns.${I}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:S.blocks})},I))]}),a.jsx("style",{children:`.div-003f4b1c {
37
37
  display: flex;
38
38
  line-height: normal;
39
- }`})]})}function Se(e){return a.jsx("span",{children:e.children})}function oe(e){return e.replace(/http(s)?:/,"")}function dt(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function ut(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return oe(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),o=n[3],r=t.match("x")?t:`${t}x`;return oe(`${i[0]}_${r}${o}`)}return null}function _(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(o=>o!==i).map(o=>`${dt(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[ut(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function ve(e){var o,r,s,l;function t(){var f;const c=e.image||e.src;if(!c||!(c.match(/builder\.io/)||c.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),_(c)}else if(e.image&&!e.srcset)return _(c);return _(c)}function n(){var d;return(d=t==null?void 0:t())!=null&&d.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const d={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?d:void 0}return a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx("source",{type:"image/webp",srcSet:n()}):null,a.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&e.children?a.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),a.jsx("style",{children:`.img-a0c95e8c {
39
+ }`})]})}function Se(e){return a.jsx("span",{children:e.children})}function oe(e){return e.replace(/http(s)?:/,"")}function ut(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function mt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return oe(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),o=n[3],r=t.match("x")?t:`${t}x`;return oe(`${i[0]}_${r}${o}`)}return null}function J(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(o=>o!==i).map(o=>`${ut(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[mt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function ve(e){var o,r,s,l;function t(){var m;const c=e.image||e.src;if(!c||!(c.match(/builder\.io/)||c.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((m=e.image)!=null&&m.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),J(c)}else if(e.image&&!e.srcset)return J(c);return J(c)}function n(){var d;return(d=t==null?void 0:t())!=null&&d.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const d={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?d:void 0}return a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx("source",{type:"image/webp",srcSet:n()}):null,a.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&e.children?a.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),a.jsx("style",{children:`.img-a0c95e8c {
40
40
  opacity: 1;
41
41
  transition: opacity 0.2s ease-in-out;
42
42
  }.div-a0c95e8c {
@@ -52,7 +52,7 @@
52
52
  left: 0;
53
53
  width: 100%;
54
54
  height: 100%;
55
- }`})]})}function ke(e){return a.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const mt={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},ft={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((l,d)=>l+d.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},ht={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},gt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(s,l=6e4){return new Promise((d,c)=>{const f=document.createElement("img");let b=!1;f.onload=()=>{b=!0,d(f)},f.addEventListener("error",x=>{console.warn("Image load failed",x.error),c(x.error)}),f.src=s,setTimeout(()=>{b||c(new Error("Image load timed out"))},l)})}function i(s){return Math.round(s*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(s=>s.blob()).then(s=>{s.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(s=>{const l=e.get("aspectRatio");e.get("image")===o&&(!l||l===.7041)&&s.width&&s.height&&(e.set("aspectRatio",i(s.height/s.width)),e.set("height",s.height),e.set("width",s.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},bt={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},yt={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function xt(e){var t,n,i;return a.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:a.jsx(W,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const pt={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},St={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Ce(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const vt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function kt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]);return h.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const s=t.current.getElementsByTagName("script");for(let d=0;d<s.length;d++){const c=s[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const f=document.createElement("script");f.async=!0,f.src=c.src,document.head.appendChild(f)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(o.includes(c.innerText))continue;try{o.push(c.innerText),new Function(c.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Ct={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},wt=["text/javascript","application/javascript","application/ecmascript"],It=e=>wt.includes(e.type);function Tt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]),[s,l]=h.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let f=0;f<c.length;f++){const b=c[f];if(b.src&&!n.includes(b.src)){n.push(b.src);const x=document.createElement("script");x.async=!0,x.src=b.src,document.head.appendChild(x)}else if(It(b)&&!o.includes(b.innerText))try{o.push(b.innerText),new Function(b.innerText)()}catch(x){console.warn("`Embed`: Error running script:",x)}}}return h.useEffect(()=>{t.current&&!s&&(l(!0),d())},[t.current,s]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Et={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}]},jt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Rt=()=>{const e=process.env.NODE_ENV||"production";return jt.includes(e)?e:"production"},Pt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,r)=>o!=null?o[r]:o,e);return i===void 0||i===e?n:i};function Vt(e){var b,x;const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[o,r]=h.useState(()=>null),[s,l]=h.useState(()=>"");function d(p){var w,T;const C={...e.builderContext.rootState,...p};e.builderContext.rootSetState?(T=(w=e.builderContext).rootSetState)==null||T.call(w,C):e.builderContext.rootState=C}function c(){return m.isEditing()&&e.previewState||n}function f(p){var w;const C=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")p.preventDefault();else if(C){if(!(e.action||e.sendSubmissionsTo==="email")){p.preventDefault();return}p.preventDefault();const T=p.currentTarget,j=e.customHeaders||{};let v;const I=new FormData(T),R=Array.from(p.currentTarget.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let g;const S=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return g=u.name,{key:S,value:g}}else if(u.type==="checkbox")g=u.checked;else if(u.type==="number"||u.type==="range"){const y=u.valueAsNumber;isNaN(y)||(g=y)}else u.type==="file"?g=u.files:g=u.value;else g=u.value;return{key:S,value:g}});let E=e.contentType;if(e.sendSubmissionsTo==="email"&&(E="multipart/form-data"),Array.from(R).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(E="multipart/form-data")}),E!=="application/json")v=I;else{const u={};Array.from(R).forEach(({value:g,key:S})=>{me(u,S,g)}),v=JSON.stringify(u)}E&&E!=="multipart/form-data"&&(C&&((w=e.action)!=null&&w.includes("zapier.com"))||(j["content-type"]=E));const F=new CustomEvent("presubmit",{detail:{body:v}});if(t.current&&(t.current.dispatchEvent(F),F.defaultPrevented))return;i("sending");const B=`${Rt()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?B:e.action,{body:v,headers:j,method:e.method||"post"}).then(async u=>{let g;const S=u.headers.get("content-type");if(S&&S.indexOf("application/json")!==-1?g=await u.json():g=await u.text(),!u.ok&&e.errorMessagePath){let y=Pt(g,e.errorMessagePath);y&&(typeof y!="string"&&(y=JSON.stringify(y)),l(y),d({formErrorMessage:y}))}if(r(g),i(u.ok?"success":"error"),u.ok){const y=new CustomEvent("submit:success",{detail:{res:u,body:g}});if(t.current){if(t.current.dispatchEvent(y),y.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const k=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(k),k.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const g=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(g),g.defaultPrevented)||(r(u),i("error"))})}}return a.jsxs(a.Fragment,{children:[" ",a.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:p=>f(p),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(x=(b=e.builderBlock)==null?void 0:b.children)==null?void 0:x.map((p,C)=>a.jsx(M,{block:p,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${C}`))}):null,c()==="error"?a.jsx(W,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(W,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(W,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}const Ft={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function Bt(e){return h.createElement("input",{...e.attributes,key:m.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const At={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function Wt(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:m.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map(n=>a.jsx("option",{value:n.value,children:n.name||n.value})))}const Nt={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function $t(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Dt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function Lt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},m.isEditing()&&e.imgSrc||"default-key")}const Mt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function we(e){var i,o,r,s,l,d,c;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.length&&!e.fitContent?a.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const Ot=()=>[{component:kt,...vt},{component:Tt,...Ct},{component:Vt,...Et},{component:Bt,...Ft},{component:$t,...Nt},{component:Wt,...At},{component:Lt,...Dt},{component:we,...Mt}],ae=()=>[{component:ce,...mt},{component:pe,...ft},{component:Se,...ht},{component:ve,...gt},{component:ke,...bt},{component:xt,...yt},{component:Re,...pt},{component:Ce,...St},...Ot()],Ut=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
55
+ }`})]})}function ke(e){return a.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const ft={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},ht={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((l,d)=>l+d.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},gt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},bt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(s,l=6e4){return new Promise((d,c)=>{const m=document.createElement("img");let g=!1;m.onload=()=>{g=!0,d(m)},m.addEventListener("error",y=>{console.warn("Image load failed",y.error),c(y.error)}),m.src=s,setTimeout(()=>{g||c(new Error("Image load timed out"))},l)})}function i(s){return Math.round(s*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(s=>s.blob()).then(s=>{s.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(s=>{const l=e.get("aspectRatio");e.get("image")===o&&(!l||l===.7041)&&s.width&&s.height&&(e.set("aspectRatio",i(s.height/s.width)),e.set("height",s.height),e.set("width",s.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},yt={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},xt={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function pt(e){var t,n,i;return a.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:a.jsx(N,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const St={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},vt={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Ce(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const kt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function Ct(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]);return h.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const s=t.current.getElementsByTagName("script");for(let d=0;d<s.length;d++){const c=s[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const m=document.createElement("script");m.async=!0,m.src=c.src,document.head.appendChild(m)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(o.includes(c.innerText))continue;try{o.push(c.innerText),new Function(c.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const wt={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},It=["text/javascript","application/javascript","application/ecmascript"],Tt=e=>It.includes(e.type);function Et(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,r]=h.useState(()=>[]),[s,l]=h.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let m=0;m<c.length;m++){const g=c[m];if(g.src&&!n.includes(g.src)){n.push(g.src);const y=document.createElement("script");y.async=!0,y.src=g.src,document.head.appendChild(y)}else if(Tt(g)&&!o.includes(g.innerText))try{o.push(g.innerText),new Function(g.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return h.useEffect(()=>{t.current&&!s&&(l(!0),d())},[t.current,s]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const jt={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}]},Rt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Pt=()=>{const e=process.env.NODE_ENV||"production";return Rt.includes(e)?e:"production"},Vt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,r)=>o!=null?o[r]:o,e);return i===void 0||i===e?n:i};function Ft(e){var g,y;const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[o,r]=h.useState(()=>null),[s,l]=h.useState(()=>"");function d(p){var w,T;const k={...e.builderContext.rootState,...p};e.builderContext.rootSetState?(T=(w=e.builderContext).rootSetState)==null||T.call(w,k):e.builderContext.rootState=k}function c(){return f.isEditing()&&e.previewState||n}function m(p){var w;const k=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")p.preventDefault();else if(k){if(!(e.action||e.sendSubmissionsTo==="email")){p.preventDefault();return}p.preventDefault();const T=p.currentTarget,j=e.customHeaders||{};let S;const I=new FormData(T),R=Array.from(p.currentTarget.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let b;const C=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return b=u.name,{key:C,value:b}}else if(u.type==="checkbox")b=u.checked;else if(u.type==="number"||u.type==="range"){const x=u.valueAsNumber;isNaN(x)||(b=x)}else u.type==="file"?b=u.files:b=u.value;else b=u.value;return{key:C,value:b}});let E=e.contentType;if(e.sendSubmissionsTo==="email"&&(E="multipart/form-data"),Array.from(R).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(E="multipart/form-data")}),E!=="application/json")S=I;else{const u={};Array.from(R).forEach(({value:b,key:C})=>{me(u,C,b)}),S=JSON.stringify(u)}E&&E!=="multipart/form-data"&&(k&&((w=e.action)!=null&&w.includes("zapier.com"))||(j["content-type"]=E));const B=new CustomEvent("presubmit",{detail:{body:S}});if(t.current&&(t.current.dispatchEvent(B),B.defaultPrevented))return;i("sending");const A=`${Pt()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?A:e.action,{body:S,headers:j,method:e.method||"post"}).then(async u=>{let b;const C=u.headers.get("content-type");if(C&&C.indexOf("application/json")!==-1?b=await u.json():b=await u.text(),!u.ok&&e.errorMessagePath){let x=Vt(b,e.errorMessagePath);x&&(typeof x!="string"&&(x=JSON.stringify(x)),l(x),d({formErrorMessage:x}))}if(r(b),i(u.ok?"success":"error"),u.ok){const x=new CustomEvent("submit:success",{detail:{res:u,body:b}});if(t.current){if(t.current.dispatchEvent(x),x.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const v=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(v),v.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const b=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(b),b.defaultPrevented)||(r(u),i("error"))})}}return a.jsxs(a.Fragment,{children:[" ",a.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:p=>m(p),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(y=(g=e.builderBlock)==null?void 0:g.children)==null?void 0:y.map((p,k)=>a.jsx(O,{block:p,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${k}`))}):null,c()==="error"?a.jsx(N,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(N,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(N,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}const Bt={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function At(e){return h.createElement("input",{...e.attributes,key:f.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Wt={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function Nt(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:f.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map(n=>a.jsx("option",{value:n.value,children:n.name||n.value})))}const $t={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function Dt(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Lt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function Mt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},f.isEditing()&&e.imgSrc||"default-key")}const Ot={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function we(e){var i,o,r,s,l,d,c;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.length&&!e.fitContent?a.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const Ut=()=>[{component:Ct,...kt},{component:Et,...wt},{component:Ft,...jt},{component:At,...Bt},{component:Dt,...$t},{component:Nt,...Wt},{component:Mt,...Lt},{component:we,...Ot}],ae=()=>[{component:ce,...ft},{component:pe,...ht},{component:Se,...gt},{component:ve,...bt},{component:ke,...yt},{component:pt,...xt},{component:Re,...St},{component:Ce,...vt},...Ut()],Ht=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
56
56
  function getAndSetVariantId() {
57
57
  function setCookie(name, value, days) {
58
58
  let expires = '';
@@ -108,7 +108,7 @@
108
108
  }).join('');
109
109
  styleEl.innerHTML = newStyleStr;
110
110
  }
111
- }`,Ht=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
111
+ }`,Kt=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
112
112
  if (!navigator.cookieEnabled) {
113
113
  return;
114
114
  }
@@ -142,15 +142,15 @@
142
142
  thisScriptEl?.remove();
143
143
  }
144
144
  return;
145
- }`,Ie="builderIoAbTest",Te="builderIoRenderContent",U=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Kt=({canTrack:e,content:t})=>!(!(U(t).length>0)||!e||m.isBrowser()),qt=e=>e==="react"||e==="reactNative",Ee=qt(m.TARGET),zt=()=>`
146
- window.${Ie} = ${Ut}
147
- window.${Te} = ${Ht}
148
- `,_t=(e,t)=>`
145
+ }`,Ie="builderIoAbTest",Te="builderIoRenderContent",U=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),qt=({canTrack:e,content:t})=>!(!(U(t).length>0)||!e||f.isBrowser()),zt=e=>e==="react"||e==="reactNative",Ee=zt(f.TARGET),_t=()=>`
146
+ window.${Ie} = ${Ht}
147
+ window.${Te} = ${Kt}
148
+ `,Jt=(e,t)=>`
149
149
  window.${Ie}(
150
150
  "${t}",${JSON.stringify(e)}, ${Ee}
151
- )`,Jt=({contentId:e,variationId:t})=>`window.${Te}(
151
+ )`,Yt=({contentId:e,variationId:t})=>`window.${Te}(
152
152
  "${t}", "${e}", ${Ee}
153
- )`;function J(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}function re(e){return Math.round(e*1e3)/1e3}const Yt=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let i=n?e:e.parentElement;do{if(!i)return null;if(t(i))return i}while(i=i.parentElement);return null},Gt=e=>Yt(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),se=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=re(i/n.width),s=re(o/n.height);return{x:r,y:s}},Qt=e=>{const t=e.target,n=t&&Gt(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?se({event:e,target:t}):void 0,builderTargetOffset:n?se({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};function Xt(e){var j,v,I,R,E,F,B;const t=h.useRef(null);function n(u){var S,y;const g={...e.builderContextSignal.rootState,...u};e.builderContextSignal.rootSetState?(y=(S=e.builderContextSignal).rootSetState)==null||y.call(S,g):e.setBuilderContextSignal(k=>({...k,rootState:g}))}function i(u){var S,y,k,P,N;const g={...e.builderContextSignal.content,...u,data:{...(S=e.builderContextSignal.content)==null?void 0:S.data,...u==null?void 0:u.data},meta:{...(y=e.builderContextSignal.content)==null?void 0:y.meta,...u==null?void 0:u.meta,breakpoints:((k=u==null?void 0:u.meta)==null?void 0:k.breakpoints)||((N=(P=e.builderContextSignal.content)==null?void 0:P.meta)==null?void 0:N.breakpoints)}};e.setBuilderContextSignal(O=>({...O,content:g}))}const[o,r]=h.useState(()=>e.contentWrapper||"div");function s(u){return m.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:g=>{var k;const{breakpoints:S,contentId:y}=g;!y||y!==((k=e.builderContextSignal.content)==null?void 0:k.id)||S&&i({meta:{breakpoints:S}})},animation:g=>{fe(g)},contentUpdate:g=>{i(g)}}})(u)}function l(){var g,S;const u=(S=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:S.jsCode;u&&L({code:u,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[d,c]=h.useState(()=>({})),[f,b]=h.useState(()=>!1);function x(u){var g,S;if(e.builderContextSignal.content){const y=(g=e.builderContextSignal.content)==null?void 0:g.testVariationId,k=(S=e.builderContextSignal.content)==null?void 0:S.id;m._track({type:"click",canTrack:m.getDefaultCanTrack(e.canTrack),contentId:k,apiKey:e.apiKey,variationId:y!==k?y:void 0,...Qt(u),unique:!f})}f||b(!0)}function p(u){return u.replace(/{{([^}]+)}}/g,(g,S)=>String(L({code:S,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})))}function C({url:u,key:g}){m.fetch(u).then(S=>S.json()).then(S=>{var k,P;const y={...e.builderContextSignal.rootState,[g]:S};(P=(k=e.builderContextSignal).rootSetState)==null||P.call(k,y),d[g]=!0}).catch(S=>{console.error("error fetching dynamic data",u,S)})}function w(){var g,S,y;const u=(y=(S=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:S.httpRequests)!=null?y:{};Object.entries(u).forEach(([k,P])=>{if(P&&(!d[k]||m.isEditing())){const N=p(P);C({url:N,key:k})}})}function T(){m.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:m.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return h.useEffect(()=>{var u,g;if(m.isBrowser()){if(m.isEditing()&&(window.addEventListener("message",s),m.registerInsertMenu(),m.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(y=>{var P;const k=m.createRegisterComponentMessage(y);(P=window.parent)==null||P.postMessage(k,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",T)),e.builderContextSignal.content&&m.getDefaultCanTrack(e.canTrack)){const y=(u=e.builderContextSignal.content)==null?void 0:u.testVariationId,k=(g=e.builderContextSignal.content)==null?void 0:g.id,P=e.apiKey;m._track({type:"impression",canTrack:!0,contentId:k,apiKey:P,variationId:y!==k?y:void 0})}if(m.isPreviewing()){const y=new URL(location.href).searchParams,k=y.get("builder.preview"),P=y.get(`builder.preview.${k}`),N=y.get("apiKey")||y.get("builder.space");k===e.model&&N===e.apiKey&&(!e.content||P===e.content.id)&&m.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(O=>{O&&i(O)})}}},[]),h.useEffect(()=>{e.apiKey||m.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),l(),w(),T()},[]),h.useEffect(()=>{e.content&&i(e.content)},[e.content]),h.useEffect(()=>{l()},[(v=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:v.jsCode]),h.useEffect(()=>{w()},[(R=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:R.httpRequests]),h.useEffect(()=>{T()},[e.builderContextSignal.rootState]),h.useEffect(()=>{e.data&&n(e.data)},[e.data]),h.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),h.useEffect(()=>()=>{m.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",T))},[]),a.jsx(G.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(o,{ref:t,onClick:u=>x(u),"builder-content-id":(E=e.builderContextSignal.content)==null?void 0:E.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((F=e.content)==null?void 0:F.testVariationId)||((B=e.content)==null?void 0:B.id)}`,children:e.children}):null})}const Zt=e=>{var r,s;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(s=e.fileUrl)!=null?s:(r=e==null?void 0:e.files)==null?void 0:r.regular;let o="";if(i&&t&&n&&(o+=`
153
+ )`;function Y(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}function re(e){return Math.round(e*1e3)/1e3}const Gt=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let i=n?e:e.parentElement;do{if(!i)return null;if(t(i))return i}while(i=i.parentElement);return null},Qt=e=>Gt(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),se=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=re(i/n.width),s=re(o/n.height);return{x:r,y:s}},Xt=e=>{const t=e.target,n=t&&Qt(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?se({event:e,target:t}):void 0,builderTargetOffset:n?se({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};function Zt(e){var j,S,I,R,E,B,A;const t=h.useRef(null);function n(u){var C,x;const b={...e.builderContextSignal.rootState,...u};e.builderContextSignal.rootSetState?(x=(C=e.builderContextSignal).rootSetState)==null||x.call(C,b):e.setBuilderContextSignal(v=>({...v,rootState:b}))}function i(u){var C,x,v,P,$;const b={...e.builderContextSignal.content,...u,data:{...(C=e.builderContextSignal.content)==null?void 0:C.data,...u==null?void 0:u.data},meta:{...(x=e.builderContextSignal.content)==null?void 0:x.meta,...u==null?void 0:u.meta,breakpoints:((v=u==null?void 0:u.meta)==null?void 0:v.breakpoints)||(($=(P=e.builderContextSignal.content)==null?void 0:P.meta)==null?void 0:$.breakpoints)}};e.setBuilderContextSignal(V=>({...V,content:b}))}const[o,r]=h.useState(()=>e.contentWrapper||"div");function s(u){return f.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:b=>{var v;const{breakpoints:C,contentId:x}=b;!x||x!==((v=e.builderContextSignal.content)==null?void 0:v.id)||C&&i({meta:{breakpoints:C}})},animation:b=>{fe(b)},contentUpdate:b=>{i(b)}}})(u)}function l(){var b,C;const u=(C=(b=e.builderContextSignal.content)==null?void 0:b.data)==null?void 0:C.jsCode;u&&M({code:u,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[d,c]=h.useState(()=>({})),[m,g]=h.useState(()=>({})),[y,p]=h.useState(()=>!1);function k(u){var b,C;if(e.builderContextSignal.content){const x=(b=e.builderContextSignal.content)==null?void 0:b.testVariationId,v=(C=e.builderContextSignal.content)==null?void 0:C.id;f._track({type:"click",canTrack:f.getDefaultCanTrack(e.canTrack),contentId:v,apiKey:e.apiKey,variationId:x!==v?x:void 0,...Xt(u),unique:!y})}y||p(!0)}function w(){var b,C,x;const u=(x=(C=(b=e.builderContextSignal.content)==null?void 0:b.data)==null?void 0:C.httpRequests)!=null?x:{};Object.entries(u).forEach(([v,P])=>{if(!P||m[v]||d[v]&&!f.isEditing())return;m[v]=!0;const $=P.replace(/{{([^}]+)}}/g,(V,Pe)=>String(M({code:Pe,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));f.fetch($).then(V=>V.json()).then(V=>{n({[v]:V}),d[v]=!0}).catch(V=>{console.error("error fetching dynamic data",P,V)}).finally(()=>{m[v]=!1})})}function T(){f.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:f.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return h.useEffect(()=>{var u,b;if(f.isBrowser()){if(f.isEditing()&&(window.addEventListener("message",s),f.registerInsertMenu(),f.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(x=>{var P;const v=f.createRegisterComponentMessage(x);(P=window.parent)==null||P.postMessage(v,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",T)),e.builderContextSignal.content&&f.getDefaultCanTrack(e.canTrack)){const x=(u=e.builderContextSignal.content)==null?void 0:u.testVariationId,v=(b=e.builderContextSignal.content)==null?void 0:b.id,P=e.apiKey;f._track({type:"impression",canTrack:!0,contentId:v,apiKey:P,variationId:x!==v?x:void 0})}if(f.isPreviewing()){const x=new URL(location.href).searchParams,v=x.get("builder.preview"),P=x.get(`builder.preview.${v}`),$=x.get("apiKey")||x.get("builder.space");v===e.model&&$===e.apiKey&&(!e.content||P===e.content.id)&&f.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(V=>{V&&i(V)})}}},[]),h.useEffect(()=>{e.apiKey||f.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),l(),w(),T()},[]),h.useEffect(()=>{e.content&&i(e.content)},[e.content]),h.useEffect(()=>{l()},[(S=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:S.jsCode]),h.useEffect(()=>{w()},[(R=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:R.httpRequests]),h.useEffect(()=>{T()},[e.builderContextSignal.rootState]),h.useEffect(()=>{e.data&&n(e.data)},[e.data]),h.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),h.useEffect(()=>()=>{f.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",T))},[]),a.jsx(K.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(o,{ref:t,onClick:u=>k(u),"builder-content-id":(E=e.builderContextSignal.content)==null?void 0:E.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((B=e.content)==null?void 0:B.testVariationId)||((A=e.content)==null?void 0:A.id)}`,children:e.children}):null})}const en=e=>{var r,s;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(s=e.fileUrl)!=null?s:(r=e==null?void 0:e.files)==null?void 0:r.regular;let o="";if(i&&t&&n&&(o+=`
154
154
  @font-face {
155
155
  font-family: "${t}";
156
156
  src: local("${n}"), url('${i}') format('woff2');
@@ -164,7 +164,7 @@ src: url('${c}') format('woff2');
164
164
  font-display: fallback;
165
165
  font-weight: ${l};
166
166
  }
167
- `.trim())}return o},en=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>Zt(n)))==null?void 0:t.join(" "))||""},tn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",nn=`
167
+ `.trim())}return o},tn=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>en(n)))==null?void 0:t.join(" "))||""},nn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",on=`
168
168
  .builder-button {
169
169
  all: unset;
170
170
  }
@@ -181,8 +181,8 @@ font-weight: ${l};
181
181
  text-align: inherit;
182
182
  font-family: inherit;
183
183
  }
184
- `,on=e=>e?"":nn;function an(e){const[t,n]=h.useState(()=>`
185
- ${tn({cssCode:e.cssCode,contentId:e.contentId})}
186
- ${en({customFonts:e.customFonts})}
187
- ${on(e.isNestedRender)}
188
- `.trim());return a.jsx(K,{id:"builderio-content",styles:t})}const rn=({content:e,data:t,locale:n})=>{var r,s,l;const i={},o=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(l=(s=e==null?void 0:e.data)==null?void 0:s.inputs)==null||l.forEach(d=>{d.name&&d.defaultValue!==void 0&&(i[d.name]=d.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},sn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function le(e){var d,c,f,b,x,p,C;const[t,n]=h.useState(()=>{var w,T;return Jt({variationId:(w=e.content)==null?void 0:w.testVariationId,contentId:(T=e.content)==null?void 0:T.id})});function i(w){l(T=>({...T,rootState:w}))}const[o,r]=h.useState(()=>[...ae(),...e.customComponents||[]].reduce((w,{component:T,...j})=>({...w,[j.name]:{component:T,...m.serializeComponentInfo(j)}}),{})),[s,l]=h.useState(()=>({content:sn({content:e.content,data:e.data}),localState:void 0,rootState:rn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ae(),...e.customComponents||[]].reduce((w,{component:T,...j})=>({...w,[j.name]:m.serializeComponentInfo(j)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}}));return a.jsx(de.Provider,{value:{registeredComponents:o},children:a.jsxs(Xt,{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:s,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,setBuilderContextSignal:l,children:[e.isSsrAbTest?a.jsx(J,{id:"builderio-variant-visibility",scriptStr:t}):null,a.jsx(an,{isNestedRender:e.isNestedRender,contentId:(d=s.content)==null?void 0:d.id,cssCode:(f=(c=s.content)==null?void 0:c.data)==null?void 0:f.cssCode,customFonts:(x=(b=s.content)==null?void 0:b.data)==null?void 0:x.customFonts}),a.jsx(W,{blocks:(C=(p=s.content)==null?void 0:p.data)==null?void 0:C.blocks,context:s,registeredComponents:o,linkComponent:e.linkComponent})]})})}function je(e){var s;const[t,n]=h.useState(()=>Kt({canTrack:m.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return _t(U(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function o(){return U(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function r(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:m.handleABTestingSync({item:e.content,canTrack:m.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&m.TARGET!=="reactNative"?a.jsx(J,{id:"builderio-init-variants-fns",scriptStr:zt()}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(K,{id:"builderio-variants",styles:o()}),a.jsx(J,{id:"builderio-variants-visibility",scriptStr:i()}),(s=U(e.content))==null?void 0:s.map(l=>a.jsx(le,{isNestedRender:e.isNestedRender,content:l,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},l.testVariationId))]}):null,a.jsx(le,{isNestedRender:e.isNestedRender,content:r(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const ln=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return m.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{m.logger.error("Could not fetch symbol content: ",n)})};function Re(e){var r,s,l,d;function t(){var c,f;return[e.attributes[D()],"builder-symbol",(c=e.symbol)!=null&&c.inline?"builder-inline-symbol":void 0,(f=e.symbol)!=null&&f.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[n,i]=h.useState(()=>{var c;return(c=e.symbol)==null?void 0:c.content});function o(){n||ln({symbol:e.symbol,builderContextValue:e.builderContext}).then(c=>{c&&i(c)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{o()},[e.symbol]),a.jsx("div",{...e.attributes,className:t(),children:a.jsx(je,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(r=e.builderBlock)==null?void 0:r.id},customComponents:Object.values(e.builderComponents),data:{...(s=e.symbol)==null?void 0:s.data,...e.builderContext.localState,...(l=n==null?void 0:n.data)==null?void 0:l.state},model:(d=e.symbol)==null?void 0:d.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}exports.Blocks=W;exports.Button=ce;exports.Columns=pe;exports.Content=je;exports.Fragment=Se;exports.Image=ve;exports.Section=ke;exports.Symbol=Re;exports.Text=Ce;exports.Video=we;
184
+ `,an=e=>e?"":on;function rn(e){const[t,n]=h.useState(()=>`
185
+ ${nn({cssCode:e.cssCode,contentId:e.contentId})}
186
+ ${tn({customFonts:e.customFonts})}
187
+ ${an(e.isNestedRender)}
188
+ `.trim());return a.jsx(q,{id:"builderio-content",styles:t})}const sn=({content:e,data:t,locale:n})=>{var r,s,l;const i={},o=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(l=(s=e==null?void 0:e.data)==null?void 0:s.inputs)==null||l.forEach(d=>{d.name&&d.defaultValue!==void 0&&(i[d.name]=d.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},ln=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function le(e){var d,c,m,g,y,p,k;const[t,n]=h.useState(()=>{var w,T;return Yt({variationId:(w=e.content)==null?void 0:w.testVariationId,contentId:(T=e.content)==null?void 0:T.id})});function i(w){l(T=>({...T,rootState:w}))}const[o,r]=h.useState(()=>[...ae(),...e.customComponents||[]].reduce((w,{component:T,...j})=>({...w,[j.name]:{component:T,...f.serializeComponentInfo(j)}}),{})),[s,l]=h.useState(()=>({content:ln({content:e.content,data:e.data}),localState:void 0,rootState:sn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ae(),...e.customComponents||[]].reduce((w,{component:T,...j})=>({...w,[j.name]:f.serializeComponentInfo(j)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}}));return a.jsx(de.Provider,{value:{registeredComponents:o},children:a.jsxs(Zt,{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:s,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,setBuilderContextSignal:l,children:[e.isSsrAbTest?a.jsx(Y,{id:"builderio-variant-visibility",scriptStr:t}):null,a.jsx(rn,{isNestedRender:e.isNestedRender,contentId:(d=s.content)==null?void 0:d.id,cssCode:(m=(c=s.content)==null?void 0:c.data)==null?void 0:m.cssCode,customFonts:(y=(g=s.content)==null?void 0:g.data)==null?void 0:y.customFonts}),a.jsx(N,{blocks:(k=(p=s.content)==null?void 0:p.data)==null?void 0:k.blocks,context:s,registeredComponents:o,linkComponent:e.linkComponent})]})})}function je(e){var s;const[t,n]=h.useState(()=>qt({canTrack:f.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return Jt(U(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function o(){return U(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function r(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:f.handleABTestingSync({item:e.content,canTrack:f.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&f.TARGET!=="reactNative"?a.jsx(Y,{id:"builderio-init-variants-fns",scriptStr:_t()}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(q,{id:"builderio-variants",styles:o()}),a.jsx(Y,{id:"builderio-variants-visibility",scriptStr:i()}),(s=U(e.content))==null?void 0:s.map(l=>a.jsx(le,{isNestedRender:e.isNestedRender,content:l,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},l.testVariationId))]}):null,a.jsx(le,{isNestedRender:e.isNestedRender,content:r(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const cn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return f.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{f.logger.error("Could not fetch symbol content: ",n)})};function Re(e){var r,s,l,d;function t(){var c,m;return[e.attributes[L()],"builder-symbol",(c=e.symbol)!=null&&c.inline?"builder-inline-symbol":void 0,(m=e.symbol)!=null&&m.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[n,i]=h.useState(()=>{var c;return(c=e.symbol)==null?void 0:c.content});function o(){n||cn({symbol:e.symbol,builderContextValue:e.builderContext}).then(c=>{c&&i(c)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{o()},[e.symbol]),a.jsx("div",{...e.attributes,className:t(),children:a.jsx(je,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(r=e.builderBlock)==null?void 0:r.id},customComponents:Object.values(e.builderComponents),data:{...(s=e.symbol)==null?void 0:s.data,...e.builderContext.localState,...(l=n==null?void 0:n.data)==null?void 0:l.state},model:(d=e.symbol)==null?void 0:d.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}exports.Blocks=N;exports.BuilderContext=K;exports.Button=ce;exports.Columns=pe;exports.Content=je;exports.Fragment=Se;exports.Image=ve;exports.Section=ke;exports.Symbol=Re;exports.Text=Ce;exports.Video=we;