@builder.io/sdk-react 1.0.20 → 1.0.21
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.
- package/lib/browser/blocks-exports.cjs +1 -1
- package/lib/browser/blocks-exports.mjs +1 -1
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -0
- package/lib/browser/init.mjs +13 -0
- package/lib/browser/{server-entry-a562cf23.js → server-entry-166d8ec9.js} +1 -1
- package/lib/browser/{server-entry-a77461d4.cjs → server-entry-c6e9a10a.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-683aad9f.js → blocks-793a81d9.js} +36 -37
- package/lib/edge/{blocks-523eb4f1.cjs → blocks-c26b2ffc.cjs} +5 -5
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-9f6acf3e.js → button-659db379.js} +2 -2
- package/lib/edge/{button-0d418bcf.cjs → button-f62c1e15.cjs} +1 -1
- package/lib/edge/{columns-b0785992.js → columns-07ef2925.js} +3 -3
- package/lib/edge/{columns-1613d62d.cjs → columns-5fe66f05.cjs} +1 -1
- package/lib/edge/{content-variants-281298f6.cjs → content-variants-9aedb66d.cjs} +1 -1
- package/lib/edge/{content-variants-13f821c6.js → content-variants-fcba4b5b.js} +8 -8
- package/lib/edge/{form-0483aa64.cjs → form-5c293cd8.cjs} +1 -1
- package/lib/edge/{form-db27fc26.js → form-82e6d435.js} +3 -3
- package/lib/edge/{get-class-prop-name-6bfc4756.js → get-class-prop-name-6242df6a.js} +1 -1
- package/lib/edge/{get-class-prop-name-e3ba0522.cjs → get-class-prop-name-c54d7ada.cjs} +1 -1
- package/lib/edge/{img-43a8ffe0.js → img-11c91db6.js} +1 -1
- package/lib/edge/{img-f01d904d.cjs → img-73cc7d69.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -0
- package/lib/edge/init.mjs +13 -0
- package/lib/edge/{input-805a9ac6.js → input-6b8ac645.js} +1 -1
- package/lib/edge/{input-e6483bd7.cjs → input-9c7d1291.cjs} +1 -1
- package/lib/edge/{select-e5d1e627.cjs → select-42de6b22.cjs} +1 -1
- package/lib/edge/{select-4966723f.js → select-f324140d.js} +1 -1
- package/lib/edge/{server-entry-c13e82bd.js → server-entry-396b1a7b.js} +1 -1
- package/lib/edge/{server-entry-83648311.cjs → server-entry-bc7f82dd.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-1b0351de.js → slot-4e55a3d1.js} +3 -3
- package/lib/edge/{slot-3ef77ae1.cjs → slot-746347ff.cjs} +1 -1
- package/lib/edge/{symbol-883d624f.cjs → symbol-4b8cffaa.cjs} +1 -1
- package/lib/edge/{symbol-f1632f93.js → symbol-e3905b86.js} +2 -2
- package/lib/node/blocks-exports.cjs +30 -70
- package/lib/node/blocks-exports.mjs +891 -1017
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +23 -22
- package/lib/node/init.cjs +1 -0
- package/lib/node/init.mjs +9 -0
- package/lib/node/node-runtime-2a838da2.cjs +48 -0
- package/lib/node/node-runtime-eb3ca94b.js +155 -0
- package/lib/node/{server-entry-8c712c9b.js → server-entry-54c1491b.js} +2 -1
- package/lib/node/{server-entry-bedf45f8.cjs → server-entry-cb0df432.cjs} +2 -2
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +6 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/init.d.ts +10 -0
- package/types/functions/evaluate/node-runtime/node-runtime.d.ts +6 -0
- package/types/functions/get-content/types.d.ts +3 -3
- package/types/helpers/logger.d.ts +1 -0
|
@@ -1,56 +1,16 @@
|
|
|
1
|
-
"use client";"use strict";var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return obj;
|
|
5
|
-
}
|
|
6
|
-
return new Proxy({}, {
|
|
7
|
-
get(target, key) {
|
|
8
|
-
if (key === 'copySync') {
|
|
9
|
-
return () => obj.copySync();
|
|
10
|
-
}
|
|
11
|
-
const val = obj.getSync(key);
|
|
12
|
-
if (typeof val?.getSync === 'function') {
|
|
13
|
-
return refToProxy(val);
|
|
14
|
-
}
|
|
15
|
-
return val;
|
|
16
|
-
},
|
|
17
|
-
set(target, key, value) {
|
|
18
|
-
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
19
|
-
obj.setSync(key, v);
|
|
20
|
-
${BUILDER_SET_STATE_NAME}(key, value)
|
|
21
|
-
},
|
|
22
|
-
deleteProperty(target, key) {
|
|
23
|
-
obj.deleteSync(key);
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
}
|
|
27
|
-
`,processCode=({code:e,args:t})=>{const n=t.map(([i])=>`var ${i} = refToProxy(${getSyncValName(i)}); `).join("");return`
|
|
28
|
-
${REF_TO_PROXY_FN}
|
|
29
|
-
${n}
|
|
30
|
-
function theFunction() {
|
|
31
|
-
${e}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
let output = theFunction()
|
|
35
|
-
|
|
36
|
-
if (typeof output === 'object' && output !== null) {
|
|
37
|
-
output = JSON.stringify(output.copySync ? output.copySync() : output);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
output;
|
|
41
|
-
`},getIsolateContext=()=>{const e=safeDynamicRequire("isolated-vm");return new e.Isolate({memoryLimit:128}).createContextSync()},runInNode=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:a,rootState:r})=>{const s=safeDynamicRequire("isolated-vm"),c=serverEntry.fastClone({...r,...o}),l=getFunctionArguments({builder:t,context:n,event:i,state:c}),d=getIsolateContext(),m=d.global;m.setSync("global",m.derefInto()),m.setSync("log",function(...x){console.log(...x)}),m.setSync(BUILDER_SET_STATE_NAME,function(x,y){set(r,x,y),a==null||a(r)}),l.forEach(([x,y])=>{const k=typeof y=="object"?new s.Reference(x==="builder"?{...y,getUserAttributes:()=>y.getUserAttributes()}:y):null;m.setSync(getSyncValName(x),k)}),m.setSync(INJECTED_IVM_GLOBAL,s);const g=processCode({code:e,args:l}),h=d.evalSync(g);try{return JSON.parse(h)}catch{return h}};function isNodeRuntime(){var e;return typeof process!="undefined"&&serverEntry.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const shouldForceBrowserRuntimeInNode=()=>{var i;if(!isNodeRuntime())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?(serverEntry.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},chooseBrowserOrServerEval=e=>serverEntry.isBrowser()||shouldForceBrowserRuntimeInNode()?runInBrowser(e):runInNode(e),w=class w{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return w.cache.get(t)}static setCachedValue(t,n){w.cache.size>20&&w.cache.delete(w.cache.keys().next().value),w.cache.set(t,{value:n})}};V(w,"cacheLimit",20),V(w,"cache",new Map);let EvalCache=w;function evaluate({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:a,isExpression:r=!0,enableCache:s}){if(e===""){serverEntry.logger.warn("Skipping evaluation of empty code block.");return}const c={code:parseCode(e,{isExpression:r}),builder:getBuilderGlobals(),context:t,event:a,rootSetState:o,rootState:i,localState:n};if(s){const l=EvalCache.getCacheKey(c),d=EvalCache.getCachedValue(l);if(d)return d.value}try{const l=chooseBrowserOrServerEval(c);if(s){const d=EvalCache.getCacheKey(c);EvalCache.setCachedValue(d,l)}return l}catch(l){serverEntry.logger.error("Failed code evaluation: "+l.message,{code:e});return}}function transformBlock(e){return e}const evaluateBindings=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const a=serverEntry.fastClone(e),r={...a,properties:{...a.properties},actions:{...a.actions}};for(const s in e.bindings){const c=e.bindings[s],l=evaluate({code:c,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});set(r,s,l)}return r};function getProcessedBlock({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:a}){const r=e;return n?evaluateBindings({block:r,localState:i,rootState:o,rootSetState:a,context:t}):r}function throttle(e,t,n={}){let i,o,a,r=null,s=0;const c=function(){s=n.leading===!1?0:Date.now(),r=null,a=e.apply(i,o),r||(i=o=null)};return function(){const l=Date.now();!s&&n.leading===!1&&(s=l);const d=t-(l-s);return i=this,o=arguments,d<=0||d>t?(r&&(clearTimeout(r),r=null),s=l,a=e.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(c,d)),a}}function assign(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])}return n}const camelCaseToKebabCase=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function bindAnimations(e){for(const t of e)switch(t.trigger){case"pageLoad":triggerAnimation(t);break;case"hover":bindHoverAnimation(t);break;case"scrollInView":bindScrollInViewAnimation(t);break}}function warnElementNotPresent(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function augmentAnimation(e,t){const n=getAllStylesUsed(e),i=getComputedStyle(t),o=e.steps[0].styles,a=e.steps[e.steps.length-1].styles,r=[o,a];for(const s of r)for(const c of n)c in s||(s[c]=i[c])}function getAllStylesUsed(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 triggerAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function bindHoverAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n);const i=e.steps[0].styles,o=e.steps[1].styles;function a(){assign(n.style,i)}function r(){assign(n.style,o)}a(),n.addEventListener("mouseenter",r),n.addEventListener("mouseleave",a),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")})})}function bindScrollInViewAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n);let i=!1,o=!1;function a(){!i&&s(n)?(i=!0,o=!0,setTimeout(()=>{assign(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",r),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!s(n)&&(i=!1,assign(n.style,e.steps[0].styles))}const r=throttle(a,200,{leading:!1});function s(d){const m=d.getBoundingClientRect(),g=window.innerHeight,x=(e.thresholdPercent||0)/100*g;return m.bottom>x&&m.top<g-x}const c=e.steps[0].styles;function l(){assign(n.style,c)}l(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",r,{capture:!0,passive:!0}),a()})}const camelToKebabCase=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),convertStyleMapToCSSArray=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${camelToKebabCase(n)}: ${i};`}).filter(serverEntry.checkIsDefined),convertStyleMapToCSS=e=>convertStyleMapToCSSArray(e).join(`
|
|
42
|
-
`),createCssClass=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
43
|
-
${convertStyleMapToCSS(n)}
|
|
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 z=(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"),h=require("./server-entry-cb0df432.cjs"),f=require("react"),L=require("./node-runtime-2a838da2.cjs"),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 Q(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 M=()=>{switch(h.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(Q,{attributes:{...e.attributes,[M()]:`${e.link?"":"builder-button"} ${e.attributes[M()]||""}`,...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 q=f.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}}),de=f.createContext({registeredComponents:{}});function Ae(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const We=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:s,rootState:r})=>{const l=L.getFunctionArguments({builder:t,context:n,event:i,state:ue({rootState:r,localState:o,rootSetState:s})});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 s=i[o];return typeof s=="object"&&s!==null?ue({rootState:s,localState:void 0,rootSetState:n?r=>{i[o]=r,n(i)}:void 0}):s},set:(i,o,s)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=s,n==null||n(i),!0}})}function Ne(){var e;return typeof process!="undefined"&&h.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const $e=()=>{var i;if(!Ne())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?(h.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},De=e=>h.isBrowser()||$e()?We(e):L.runInNode(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 O({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:s,isExpression:r=!0,enableCache:l}){if(e===""){h.logger.warn("Skipping evaluation of empty code block.");return}const d={code:L.parseCode(e,{isExpression:r}),builder:L.getBuilderGlobals(),context:t,event:s,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=De(d);if(l){const m=D.getCacheKey(d);D.setCachedValue(m,c)}return c}catch(c){h.logger.error("Failed code evaluation: "+c.message,{code:e});return}}const Le=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const s=h.fastClone(e),r={...s,properties:{...s.properties},actions:{...s.actions}};for(const l in e.bindings){const d=e.bindings[l],c=O({code:d,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});L.set(r,l,c)}return r};function K({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:s}){const r=e;return n?Le({block:r,localState:i,rootState:o,rootSetState:s,context:t}):r}function Me(e,t,n={}){let i,o,s,r=null,l=0;const d=function(){l=n.leading===!1?0:Date.now(),r=null,s=e.apply(i,o),r||(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?(r&&(clearTimeout(r),r=null),l=c,s=e.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(d,m)),s}}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 s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])}return n}const X=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Oe(e){for(const t of e)switch(t.trigger){case"pageLoad":me(t);break;case"hover":He(t);break;case"scrollInView":Ke(t);break}}function Z(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function ee(e,t){const n=Ue(e),i=getComputedStyle(t),o=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,r=[o,s];for(const l of r)for(const d of n)d in l||(l[d]=i[d])}function Ue(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 me(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Z(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{ee(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 ${X(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 He(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Z(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{ee(e,n);const i=e.steps[0].styles,o=e.steps[1].styles;function s(){W(n.style,i)}function r(){W(n.style,o)}s(),n.addEventListener("mouseenter",r),n.addEventListener("mouseleave",s),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${X(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")})})}function Ke(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Z(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{ee(e,n);let i=!1,o=!1;function s(){!i&&l(n)?(i=!0,o=!0,setTimeout(()=>{W(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",r),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 r=Me(s,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 ${X(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",r,{capture:!0,passive:!0}),s()})}const qe=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),fe=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${qe(n)}: ${i};`}).filter(h.checkIsDefined),_e=e=>fe(e).join(`
|
|
2
|
+
`),J=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
+
${_e(n)}
|
|
44
4
|
}`;return e?`${e} {
|
|
45
5
|
${i}
|
|
46
|
-
}`:i};function
|
|
6
|
+
}`:i};function ze({style:e}){return e}const Je=({block:e,context:t})=>he(ze({style:e.style||{},context:t,block:e}));function he(e){switch(h.TARGET){case"svelte":case"vue":case"solid":return fe(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const Ye=({block:e,context:t,registeredComponents:n})=>{var s;const i=(s=K({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:s.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
|
|
47
7
|
Could not find a registered component named "${i}".
|
|
48
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Ge=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=O({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const s=n.collection.split(".").pop(),r=n.itemName||(s?s+"Item":"item");return o.map((d,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:d,[r]:d,[`$${r}Index`]:c}},block:i}))},ge={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ne=(e,t=ge)=>`@media (max-width: ${t[e].max}px)`,be=({small:e,medium:t})=>{const n=h.fastClone(ge);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 s=n.medium.max+1;return n.large={max:2e3,min:s,default:s+1},n};function _(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function Qe(e){function t(){const i=K({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return h.checkIsDefined(i.hide)?!i.hide:h.checkIsDefined(i.show)?i.show:!0}function n(){var k;const i=K({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,s=e.context.content,r=be(((k=s==null?void 0:s.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?J({className:m,styles:l}):"",y=d?J({className:m,styles:d,mediaQuery:ne("medium",r)}):"",p=c?J({className:m,styles:c,mediaQuery:ne("small",r)}):"";return[g,y,p].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(_,{id:"builderio-block",styles:n()})}):null})}function Xe(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ze=e=>`on${Xe(e)}`,et=(e,t)=>n=>O({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function ye(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const s=n[o];let r=Ze(o);if(e.stripPrefix)switch(h.TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=et(s,e)}return t}function tt({properties:e}){return e}const nt=e=>({href:e.href});function te({block:e,context:t}){var i;const n={...nt(e),...e.properties,"builder-id":e.id,style:Je({block:e,context:t}),[M()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return tt({properties:n,context:t,block:e})}function it(e){return a.jsx(Q,{TagName:e.Wrapper,attributes:te({block:e.block,context:e.context}),actionAttributes:ye({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 ot(e){return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...te({block:e.block,context:e.context}),...ye({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}const at=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:s,contextValue:r})=>{const l={...e,...o?{attributes:te({block:t,context:r})}:{}};return s?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:l};function ie(e){var i;const[t,n]=f.useState(()=>e.isInteractive?ot:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...at({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(U,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function rt(e){const[t,n]=f.useState(()=>e.repeatContext);return a.jsx(q.Provider,{value:t,children:a.jsx(U,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function U(e){var d,c,m;function t(){return Ye({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return Ge({block:e.block,context:e.context})}function i(){var g;return(g=e.block.repeat)!=null&&g.collection?e.block:K({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 s(){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 r(){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:{...Ae(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 f.useEffect(()=>{const g=i().id,y=i().animations;y&&g&&Oe(y.filter(p=>p.trigger!=="hover").map(p=>({...p,elementId:g})))},[]),a.jsx(a.Fragment,{children:s()?a.jsxs(a.Fragment,{children:[a.jsx(Qe,{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(rt,{repeatContext:g.context,block:g.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},y))}):a.jsxs(it,{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=r())==null?void 0:c.map(g=>a.jsx(U,{block:g,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},g.id))]})})]}):null})}function st(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,s;h.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((s=window.parent)==null||s.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,s;h.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((s=window.parent)==null||s.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 {
|
|
49
9
|
display: flex;
|
|
50
10
|
flex-direction: column;
|
|
51
11
|
align-items: stretch;
|
|
52
|
-
}`})]})}function
|
|
53
|
-
@media (max-width: ${
|
|
12
|
+
}`})]})}function N(e){var i,o,s;const t=f.useContext(q),n=f.useContext(de);return a.jsx(st,{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:(s=e.blocks)==null?void 0:s.map(r=>a.jsx(U,{block:r,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},r.id))}):null})}function xe(e){var j;const[t,n]=f.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=f.useState(()=>e.columns||[]),[s,r]=f.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 s==="tablet"?S:I}function m({stackedStyle:S,desktopStyle:I}){return s==="never"?I:S}const[g,y]=f.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 be(((E=(R=e.builderContext.content)==null?void 0:R.meta)==null?void 0:E.breakpoints)||{})[S].max}function T(){return`
|
|
13
|
+
@media (max-width: ${w("medium")}px) {
|
|
54
14
|
.${e.builderBlock.id}-breakpoints {
|
|
55
15
|
flex-direction: var(--flex-dir-tablet);
|
|
56
16
|
align-items: stretch;
|
|
@@ -62,7 +22,7 @@ output;
|
|
|
62
22
|
}
|
|
63
23
|
}
|
|
64
24
|
|
|
65
|
-
@media (max-width: ${
|
|
25
|
+
@media (max-width: ${w("small")}px) {
|
|
66
26
|
.${e.builderBlock.id}-breakpoints {
|
|
67
27
|
flex-direction: var(--flex-dir);
|
|
68
28
|
align-items: stretch;
|
|
@@ -73,10 +33,10 @@ output;
|
|
|
73
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
74
34
|
}
|
|
75
35
|
},
|
|
76
|
-
`}return
|
|
36
|
+
`}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,style:p(),children:[a.jsx(_,{id:"builderio-columns",styles:T()}),(j=e.columns)==null?void 0:j.map((S,I)=>a.jsx(Q,{TagName:S.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...S.link?{href:S.link}:{},[M()]:"builder-column",style:he(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 {
|
|
77
37
|
display: flex;
|
|
78
38
|
line-height: normal;
|
|
79
|
-
}`})]})}function
|
|
39
|
+
}`})]})}function pe(e){return a.jsx("span",{children:e.children})}function oe(e){return e.replace(/http(s)?:/,"")}function lt(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 ct(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],s=t.match("x")?t:`${t}x`;return oe(`${i[0]}_${s}${o}`)}return null}function Y(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=>`${lt(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[ct(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function Se(e){var o,s,r,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"),Y(c)}else if(e.image&&!e.srcset)return Y(c);return Y(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&&!((s=(o=e.builderBlock)==null?void 0:o.children)!=null&&s.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(l=(r=e.builderBlock)==null?void 0:r.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 {
|
|
80
40
|
opacity: 1;
|
|
81
41
|
transition: opacity 0.2s ease-in-out;
|
|
82
42
|
}.div-a0c95e8c {
|
|
@@ -92,7 +52,7 @@ output;
|
|
|
92
52
|
left: 0;
|
|
93
53
|
width: 100%;
|
|
94
54
|
height: 100%;
|
|
95
|
-
}`})]})}function SectionComponent(e){return jsxRuntime.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 componentInfo$f={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},componentInfo$e={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(a=>!a.get("width"))||n.reduce((s,c)=>s+c.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}]},componentInfo$d={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},componentInfo$c={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(r,s=6e4){return new Promise((c,l)=>{const d=document.createElement("img");let m=!1;d.onload=()=>{m=!0,c(d)},d.addEventListener("error",g=>{console.warn("Image load failed",g.error),l(g.error)}),d.src=r,setTimeout(()=>{m||l(new Error("Image load timed out"))},s)})}function i(r){return Math.round(r*1e3)/1e3}const o=e.get("image"),a=e.get("aspectRatio");if(fetch(o).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!a||a===.7041))return n(o).then(r=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.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}]},componentInfo$b={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>"}}}]},componentInfo$a={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 Slot(e){var t,n,i;return jsxRuntime.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:jsxRuntime.jsx(Blocks,{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 componentInfo$9={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"}]},componentInfo$8={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 Text(e){var t;return jsxRuntime.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const componentInfo$7={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 CustomCode(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[o,a]=react.useState(()=>[]);return react.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let c=0;c<r.length;c++){const l=r[c];if(l.src){if(n.includes(l.src))continue;n.push(l.src);const d=document.createElement("script");d.async=!0,d.src=l.src,document.head.appendChild(d)}else if(!l.type||["text/javascript","application/javascript","application/ecmascript"].includes(l.type)){if(o.includes(l.innerText))continue;try{o.push(l.innerText),new Function(l.innerText)()}catch(d){console.warn("`CustomCode`: Error running script:",d)}}}},[]),jsxRuntime.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const componentInfo$6={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}]},SCRIPT_MIME_TYPES=["text/javascript","application/javascript","application/ecmascript"],isJsScript=e=>SCRIPT_MIME_TYPES.includes(e.type);function Embed(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[o,a]=react.useState(()=>[]),[r,s]=react.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const l=t.current.getElementsByTagName("script");for(let d=0;d<l.length;d++){const m=l[d];if(m.src&&!n.includes(m.src)){n.push(m.src);const g=document.createElement("script");g.async=!0,g.src=m.src,document.head.appendChild(g)}else if(isJsScript(m)&&!o.includes(m.innerText))try{o.push(m.innerText),new Function(m.innerText)()}catch(g){console.warn("`Embed`: Error running script:",g)}}}return react.useEffect(()=>{t.current&&!r&&(s(!0),c())},[t.current,r]),jsxRuntime.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const componentInfo$5={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"}}}]},validEnvList=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],getEnv=()=>{const e=process.env.NODE_ENV||"production";return validEnvList.includes(e)?e:"production"},get=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,a)=>o!=null?o[a]:o,e);return i===void 0||i===e?n:i};function FormComponent(e){var m,g;const t=react.useRef(null),[n,i]=react.useState(()=>"unsubmitted"),[o,a]=react.useState(()=>null),[r,s]=react.useState(()=>"");function c(h){var y,k;const x={...e.builderContext.rootState,...h};e.builderContext.rootSetState?(k=(y=e.builderContext).rootSetState)==null||k.call(y,x):e.builderContext.rootState=x}function l(){return serverEntry.isEditing()&&e.previewState||n}function d(h){var y;const x=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")h.preventDefault();else if(x){if(!(e.action||e.sendSubmissionsTo==="email")){h.preventDefault();return}h.preventDefault();const k=h.currentTarget,I=e.customHeaders||{};let p;const C=new FormData(k),R=Array.from(h.currentTarget.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let f;const v=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return f=u.name,{key:v,value:f}}else if(u.type==="checkbox")f=u.checked;else if(u.type==="number"||u.type==="range"){const b=u.valueAsNumber;isNaN(b)||(f=b)}else u.type==="file"?f=u.files:f=u.value;else f=u.value;return{key:v,value:f}});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")p=C;else{const u={};Array.from(R).forEach(({value:f,key:v})=>{set(u,v,f)}),p=JSON.stringify(u)}E&&E!=="multipart/form-data"&&(x&&((y=e.action)!=null&&y.includes("zapier.com"))||(I["content-type"]=E));const P=new CustomEvent("presubmit",{detail:{body:p}});if(t.current&&(t.current.dispatchEvent(P),P.defaultPrevented))return;i("sending");const B=`${getEnv()==="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:p,headers:I,method:e.method||"post"}).then(async u=>{let f;const v=u.headers.get("content-type");if(v&&v.indexOf("application/json")!==-1?f=await u.json():f=await u.text(),!u.ok&&e.errorMessagePath){let b=get(f,e.errorMessagePath);b&&(typeof b!="string"&&(b=JSON.stringify(b)),s(b),c({formErrorMessage:b}))}if(a(f),i(u.ok?"success":"error"),u.ok){const b=new CustomEvent("submit:success",{detail:{res:u,body:f}});if(t.current){if(t.current.dispatchEvent(b),b.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const S=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(S),S.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const f=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(f),f.defaultPrevented)||(a(u),i("error"))})}}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",jsxRuntime.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:h=>d(h),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(g=(m=e.builderBlock)==null?void 0:m.children)==null?void 0:g.map((h,x)=>jsxRuntime.jsx(Block,{block:h,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${x}`))}):null,l()==="error"?jsxRuntime.jsx(Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,l()==="sending"?jsxRuntime.jsx(Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,l()==="error"&&o?jsxRuntime.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(o,null,2)}):null,l()==="success"?jsxRuntime.jsx(Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",jsxRuntime.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}const componentInfo$4={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 FormInputComponent(e){return react.createElement("input",{...e.attributes,key:serverEntry.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 componentInfo$3={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 SelectComponent(e){var t;return react.createElement("select",{...e.attributes,value:e.value,key:serverEntry.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map((n,i)=>jsxRuntime.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const componentInfo$2={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 SubmitButton(e){return jsxRuntime.jsx("button",{type:"submit",...e.attributes,children:e.text})}const componentInfo$1={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 ImgComponent(e){return jsxRuntime.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},serverEntry.isEditing()&&e.imgSrc||"default-key")}const componentInfo={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 Video(e){var i,o,a,r,s,c,l;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 jsxRuntime.jsxs("div",{style:{position:"relative"},children:[jsxRuntime.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:jsxRuntime.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((a=(o=e.builderBlock)==null?void 0:o.children)!=null&&a.length))?jsxRuntime.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(r=e.builderBlock)==null?void 0:r.children)!=null&&s.length&&e.fitContent?jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(l=(c=e.builderBlock)==null?void 0:c.children)!=null&&l.length&&!e.fitContent?jsxRuntime.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 getExtraComponents=()=>[{component:CustomCode,...componentInfo$7},{component:Embed,...componentInfo$6},{component:FormComponent,...componentInfo$5},{component:FormInputComponent,...componentInfo$4},{component:SubmitButton,...componentInfo$2},{component:SelectComponent,...componentInfo$3},{component:ImgComponent,...componentInfo$1},{component:Video,...componentInfo}],getDefaultRegisteredComponents=()=>[{component:Button,...componentInfo$f},{component:Columns,...componentInfo$e},{component:FragmentComponent,...componentInfo$d},{component:Image,...componentInfo$c},{component:SectionComponent,...componentInfo$b},{component:Slot,...componentInfo$a},{component:Symbol$1,...componentInfo$9},{component:Text,...componentInfo$8},...getExtraComponents()],UPDATE_COOKIES_AND_STYLES_SCRIPT=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function ve(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 dt={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},ut={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(s=>!s.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}]},mt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},ft={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(r,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=r,setTimeout(()=>{g||c(new Error("Image load timed out"))},l)})}function i(r){return Math.round(r*1e3)/1e3}const o=e.get("image"),s=e.get("aspectRatio");if(fetch(o).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!s||s===.7041))return n(o).then(r=>{const l=e.get("aspectRatio");e.get("image")===o&&(!l||l===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.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}]},ht={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>"}}}]},gt={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 bt(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 yt={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"}]},xt={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 ke(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const pt={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 St(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,s]=f.useState(()=>[]);return f.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let d=0;d<r.length;d++){const c=r[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 vt={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}]},kt=["text/javascript","application/javascript","application/ecmascript"],Ct=e=>kt.includes(e.type);function wt(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,s]=f.useState(()=>[]),[r,l]=f.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(Ct(g)&&!o.includes(g.innerText))try{o.push(g.innerText),new Function(g.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return f.useEffect(()=>{t.current&&!r&&(l(!0),d())},[t.current,r]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const It={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"}}}]},Tt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Et=()=>{const e=process.env.NODE_ENV||"production";return Tt.includes(e)?e:"production"},jt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,s)=>o!=null?o[s]:o,e);return i===void 0||i===e?n:i};function Rt(e){var g,y;const t=f.useRef(null),[n,i]=f.useState(()=>"unsubmitted"),[o,s]=f.useState(()=>null),[r,l]=f.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 h.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})=>{L.set(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=`${Et()==="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=jt(b,e.errorMessagePath);x&&(typeof x!="string"&&(x=JSON.stringify(x)),l(x),d({formErrorMessage:x}))}if(s(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)||(s(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(U,{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 Pt={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 Vt(e){return f.createElement("input",{...e.attributes,key:h.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 Ft={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 Bt(e){var t;return f.createElement("select",{...e.attributes,value:e.value,key:h.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map((n,i)=>a.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const At={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 Wt(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Nt={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 $t(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},h.isEditing()&&e.imgSrc||"default-key")}const Dt={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 Ce(e){var i,o,s,r,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&&((s=(o=e.builderBlock)==null?void 0:o.children)!=null&&s.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(r=e.builderBlock)==null?void 0:r.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 Lt=()=>[{component:St,...pt},{component:wt,...vt},{component:Rt,...It},{component:Vt,...Pt},{component:Wt,...At},{component:Bt,...Ft},{component:$t,...Nt},{component:Ce,...Dt}],ae=()=>[{component:ce,...dt},{component:xe,...ut},{component:pe,...mt},{component:Se,...ft},{component:ve,...ht},{component:bt,...gt},{component:je,...yt},{component:ke,...xt},...Lt()],Mt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
96
56
|
function getAndSetVariantId() {
|
|
97
57
|
function setCookie(name, value, days) {
|
|
98
58
|
let expires = '';
|
|
@@ -148,7 +108,7 @@ output;
|
|
|
148
108
|
}).join('');
|
|
149
109
|
styleEl.innerHTML = newStyleStr;
|
|
150
110
|
}
|
|
151
|
-
}`,
|
|
111
|
+
}`,Ot=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
152
112
|
if (!navigator.cookieEnabled) {
|
|
153
113
|
return;
|
|
154
114
|
}
|
|
@@ -182,29 +142,29 @@ output;
|
|
|
182
142
|
thisScriptEl?.remove();
|
|
183
143
|
}
|
|
184
144
|
return;
|
|
185
|
-
}`,
|
|
186
|
-
window.${
|
|
187
|
-
window.${
|
|
188
|
-
`,
|
|
189
|
-
window.${
|
|
190
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
191
|
-
)`,
|
|
192
|
-
"${t}", "${e}", ${
|
|
193
|
-
)`;function
|
|
145
|
+
}`,we="builderIoAbTest",Ie="builderIoRenderContent",H=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Ut=({canTrack:e,content:t})=>!(!(H(t).length>0)||!e||h.isBrowser()),Ht=e=>e==="react"||e==="reactNative",Te=Ht(h.TARGET),Kt=()=>`
|
|
146
|
+
window.${we} = ${Mt}
|
|
147
|
+
window.${Ie} = ${Ot}
|
|
148
|
+
`,qt=(e,t)=>`
|
|
149
|
+
window.${we}(
|
|
150
|
+
"${t}",${JSON.stringify(e)}, ${Te}
|
|
151
|
+
)`,_t=({contentId:e,variationId:t})=>`window.${Ie}(
|
|
152
|
+
"${t}", "${e}", ${Te}
|
|
153
|
+
)`;function G(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}function re(e){return Math.round(e*1e3)/1e3}const zt=(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},Jt=e=>zt(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,s=re(i/n.width),r=re(o/n.height);return{x:s,y:r}},Yt=e=>{const t=e.target,n=t&&Jt(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 Gt(e){var j,S,I,R,E,B,A;const t=f.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,s]=f.useState(()=>e.contentWrapper||"div");function r(u){return h.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=>{me(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&&O({code:u,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[d,c]=f.useState(()=>({})),[m,g]=f.useState(()=>({})),[y,p]=f.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;h._track({type:"click",canTrack:h.getDefaultCanTrack(e.canTrack),contentId:v,apiKey:e.apiKey,variationId:x!==v?x:void 0,...Yt(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]&&!h.isEditing())return;m[v]=!0;const $=P.replace(/{{([^}]+)}}/g,(V,Re)=>String(O({code:Re,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));h.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(){h.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:h.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return f.useEffect(()=>{var u,b;if(h.isBrowser()){if(h.isEditing()&&(window.addEventListener("message",r),h.registerInsertMenu(),h.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(x=>{var P;const v=h.createRegisterComponentMessage(x);(P=window.parent)==null||P.postMessage(v,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",T)),e.builderContextSignal.content&&h.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;h._track({type:"impression",canTrack:!0,contentId:v,apiKey:P,variationId:x!==v?x:void 0})}if(h.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)&&h.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(V=>{V&&i(V)})}}},[]),f.useEffect(()=>{e.apiKey||h.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()},[]),f.useEffect(()=>{e.content&&i(e.content)},[e.content]),f.useEffect(()=>{l()},[(S=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:S.jsCode]),f.useEffect(()=>{w()},[(R=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:R.httpRequests]),f.useEffect(()=>{T()},[e.builderContextSignal.rootState]),f.useEffect(()=>{e.data&&n(e.data)},[e.data]),f.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),f.useEffect(()=>()=>{h.isBrowser()&&(window.removeEventListener("message",r),window.removeEventListener("builder:component:stateChangeListenerActivated",T))},[]),a.jsx(q.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 Qt=e=>{var s,r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(r=e.fileUrl)!=null?r:(s=e==null?void 0:e.files)==null?void 0:s.regular;let o="";if(i&&t&&n&&(o+=`
|
|
194
154
|
@font-face {
|
|
195
155
|
font-family: "${t}";
|
|
196
156
|
src: local("${n}"), url('${i}') format('woff2');
|
|
197
157
|
font-display: fallback;
|
|
198
158
|
font-weight: 400;
|
|
199
159
|
}
|
|
200
|
-
`.trim()),e.files)for(const
|
|
160
|
+
`.trim()),e.files)for(const l in e.files){if(!(String(Number(l))===l))continue;const c=e.files[l];c&&c!==i&&(o+=`
|
|
201
161
|
@font-face {
|
|
202
162
|
font-family: "${t}";
|
|
203
|
-
src: url('${
|
|
163
|
+
src: url('${c}') format('woff2');
|
|
204
164
|
font-display: fallback;
|
|
205
|
-
font-weight: ${
|
|
165
|
+
font-weight: ${l};
|
|
206
166
|
}
|
|
207
|
-
`.trim())}return o},
|
|
167
|
+
`.trim())}return o},Xt=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>Qt(n)))==null?void 0:t.join(" "))||""},Zt=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",en=`
|
|
208
168
|
.builder-button {
|
|
209
169
|
all: unset;
|
|
210
170
|
}
|
|
@@ -221,8 +181,8 @@ font-weight: ${s};
|
|
|
221
181
|
text-align: inherit;
|
|
222
182
|
font-family: inherit;
|
|
223
183
|
}
|
|
224
|
-
`,
|
|
225
|
-
${
|
|
226
|
-
${
|
|
227
|
-
${
|
|
228
|
-
`.trim());return
|
|
184
|
+
`,tn=e=>e?"":en;function nn(e){const[t,n]=f.useState(()=>`
|
|
185
|
+
${Zt({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
|
+
${Xt({customFonts:e.customFonts})}
|
|
187
|
+
${tn(e.isNestedRender)}
|
|
188
|
+
`.trim());return a.jsx(_,{id:"builderio-content",styles:t})}const on=({content:e,data:t,locale:n})=>{var s,r,l;const i={},o=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(d=>{d.name&&d.defaultValue!==void 0&&(i[d.name]=d.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},an=({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]=f.useState(()=>{var w,T;return _t({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,s]=f.useState(()=>[...ae(),...e.customComponents||[]].reduce((w,{component:T,...j})=>({...w,[j.name]:{component:T,...h.serializeComponentInfo(j)}}),{})),[r,l]=f.useState(()=>({content:an({content:e.content,data:e.data}),localState:void 0,rootState:on({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]:h.serializeComponentInfo(j)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}}));return a.jsx(de.Provider,{value:{registeredComponents:o},children:a.jsxs(Gt,{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:r,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,setBuilderContextSignal:l,children:[e.isSsrAbTest?a.jsx(G,{id:"builderio-variant-visibility",scriptStr:t}):null,a.jsx(nn,{isNestedRender:e.isNestedRender,contentId:(d=r.content)==null?void 0:d.id,cssCode:(m=(c=r.content)==null?void 0:c.data)==null?void 0:m.cssCode,customFonts:(y=(g=r.content)==null?void 0:g.data)==null?void 0:y.customFonts}),a.jsx(N,{blocks:(k=(p=r.content)==null?void 0:p.data)==null?void 0:k.blocks,context:r,registeredComponents:o,linkComponent:e.linkComponent})]})})}function Ee(e){var r;const[t,n]=f.useState(()=>Ut({canTrack:h.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return qt(H(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function o(){return H(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function s(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:h.handleABTestingSync({item:e.content,canTrack:h.getDefaultCanTrack(e.canTrack)})}return f.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&h.TARGET!=="reactNative"?a.jsx(G,{id:"builderio-init-variants-fns",scriptStr:Kt()}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(_,{id:"builderio-variants",styles:o()}),a.jsx(G,{id:"builderio-variants-visibility",scriptStr:i()}),(r=H(e.content))==null?void 0:r.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:s(),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 rn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return h.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{h.logger.error("Could not fetch symbol content: ",n)})};function je(e){var s,r,l,d;function t(){var c,m;return[e.attributes[M()],"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]=f.useState(()=>{var c;return(c=e.symbol)==null?void 0:c.content});function o(){n||rn({symbol:e.symbol,builderContextValue:e.builderContext}).then(c=>{c&&i(c)})}return f.useEffect(()=>{},[]),f.useEffect(()=>{o()},[e.symbol]),a.jsx("div",{...e.attributes,className:t(),children:a.jsx(Ee,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(s=e.builderBlock)==null?void 0:s.id},customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.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=q;exports.Button=ce;exports.Columns=xe;exports.Content=Ee;exports.Fragment=pe;exports.Image=Se;exports.Section=ve;exports.Symbol=je;exports.Text=ke;exports.Video=Ce;
|