@builder.io/sdk-react 0.13.2 → 0.13.3
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/index.cjs +4 -4
- package/lib/browser/index.mjs +8 -8
- package/lib/browser/{server-entry-be000726.js → server-entry-143700d6.js} +1 -1
- package/lib/browser/{server-entry-af9b0dd3.cjs → server-entry-ad61693c.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/index.cjs +4 -4
- package/lib/edge/index.mjs +8 -8
- package/lib/edge/{server-entry-b02b5197.js → server-entry-290d474f.js} +1 -1
- package/lib/edge/{server-entry-af9b0dd3.cjs → server-entry-ad61693c.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/node/index.cjs +4 -4
- package/lib/node/index.mjs +8 -8
- package/lib/node/{server-entry-6e7475d7.cjs → server-entry-6709478c.cjs} +1 -1
- package/lib/node/{server-entry-9969d641.js → server-entry-fb67b805.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/blocks/columns/columns.d.ts +1 -2
- package/types/blocks/columns/columns.types.d.ts +2 -2
- package/types/blocks/form/form/form.d.ts +3 -3
- package/types/blocks/slot/slot.d.ts +3 -3
- package/types/blocks/symbol/symbol.d.ts +1 -2
- package/types/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/components/block/components/block-wrapper.d.ts +2 -2
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/types/components/block/components/interactive-element.d.ts +3 -2
- package/types/components/blocks/blocks-wrapper.d.ts +2 -2
- package/types/components/content/content.types.d.ts +1 -8
- package/types/components/content/contentProps.types.d.ts +12 -0
- package/types/components/dynamic-renderer/dynamic-renderer.d.ts +4 -3
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/types/builder-props.d.ts +1 -1
- package/types/types/input.d.ts +1 -0
- package/types/types/typescript.d.ts +0 -3
package/lib/browser/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),u=require("./server-entry-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),u=require("./server-entry-ad61693c.cjs"),Ae=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ve=e=>typeof e=="string"&&Ae.has(e.toLowerCase());function Y(e){return o.jsx(o.Fragment,{children:Ve(e.TagName)?o.jsx(o.Fragment,{children:o.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):o.jsx(o.Fragment,{children:typeof e.TagName=="string"?o.jsx(o.Fragment,{children:o.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):o.jsx(o.Fragment,{children:o.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}const O=()=>{switch(u.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function me(e){return o.jsx(Y,{TagName:e.link?e.builderLinkComponent||"a":"button",attributes:{...e.attributes,[O()]:`${e.link?"":"builder-button"} ${e.attributes[O()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},actionAttributes:{},children:e.text})}const Q=m.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}}),fe=m.createContext({registeredComponents:{}});function We(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const Ne=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),$e=()=>({isEditing:u.isEditing(),isBrowser:u.isBrowser(),isServer:!u.isBrowser(),getUserAttributes:()=>u.getUserAttributes()}),De=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,oe=({code:e,builder:t,context:n,event:i,localState:a,rootSetState:r,rootState:s})=>{const l=Ne({builder:t,context:n,event:i,state:ge({rootState:s,localState:a,rootSetState:r})});return new Function(...l.map(([c])=>c),e)(...l.map(([,c])=>c))};function ge({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,a)=>{if(t&&a in t)return t[a];const r=i[a];return typeof r=="object"?ge({rootState:r,localState:void 0,rootSetState:n?s=>{i[a]=s,n(i)}:void 0}):r},set:(i,a,r)=>{if(t&&a in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[a]=r,n==null||n(i),!0}})}function Le(){var e;return typeof process!="undefined"&&u.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const Oe=()=>{var i;if(!Le())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(u.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},Me=e=>(u.isBrowser()||Oe(),oe(e));function M({code:e,context:t,localState:n,rootState:i,rootSetState:a,event:r,isExpression:s=!0}){if(e===""){u.logger.warn("Skipping evaluation of empty code block.");return}const l={code:De(e,{isExpression:s}),builder:$e(),context:t,event:r,rootSetState:a,rootState:i,localState:n};try{return Me(l)}catch(c){u.logger.error("Failed code evaluation: "+c.message,{code:e});return}}const he=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((a,r,s)=>Object(a[r])===a[r]?a[r]:a[r]=Math.abs(Number(i[s+1]))>>0===+i[s+1]?[]:{},e)[i[i.length-1]]=n,e};const Ue=({block:e,context:t,localState:n,rootState:i,rootSetState:a})=>{if(!e.bindings)return e;const r=u.fastClone(e),s={...r,properties:{...r.properties},actions:{...r.actions}};for(const l in e.bindings){const c=e.bindings[l],d=M({code:c,localState:n,rootState:i,rootSetState:a,context:t});he(s,l,d)}return s};function K({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:a,rootSetState:r}){const s=e;return n?Ue({block:s,localState:i,rootState:a,rootSetState:r,context:t}):s}function He(e,t,n={}){let i,a,r,s=null,l=0;const c=function(){l=n.leading===!1?0:Date.now(),s=null,r=e.apply(i,a),s||(i=a=null)};return function(){const d=Date.now();!l&&n.leading===!1&&(l=d);const f=t-(d-l);return i=this,a=arguments,f<=0||f>t?(s&&(clearTimeout(s),s=null),l=d,r=e.apply(i,a),s||(i=a=null)):!s&&n.trailing!==!1&&(s=setTimeout(c,f)),r}}function D(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const a=arguments[i];if(a!=null)for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(n[r]=a[r])}return n}const X=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function _e(e){for(const t of e)switch(t.trigger){case"pageLoad":be(t);break;case"hover":qe(t);break;case"scrollInView":ze(t);break}}function Z(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function ee(e,t){const n=Ke(e),i=getComputedStyle(t),a=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,s=[a,r];for(const l of s)for(const c of n)c in l||(l[c]=i[c])}function Ke(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function be(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",D(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"),D(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function qe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Z(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{ee(e,n);const i=e.steps[0].styles,a=e.steps[1].styles;function r(){D(n.style,i)}function s(){D(n.style,a)}r(),n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",r),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${X(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")})})}function ze(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Z(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{ee(e,n);let i=!1,a=!1;function r(){!i&&l(n)?(i=!0,a=!0,setTimeout(()=>{D(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",s),setTimeout(()=>{a=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!a&&!l(n)&&(i=!1,D(n.style,e.steps[0].styles))}const s=He(r,200,{leading:!1});function l(f){const S=f.getBoundingClientRect(),C=window.innerHeight,y=(e.thresholdPercent||0)/100*C;return S.bottom>y&&S.top<C-y}const c=e.steps[0].styles;function d(){D(n.style,c)}d(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${X(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",s,{capture:!0,passive:!0}),r()})}const Je=({block:e,context:t,registeredComponents:n})=>{var r;const i=(r=K({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!i)return null;const a=n[i];if(a)return a;console.warn(`
|
|
2
2
|
Could not find a registered component named "${i}".
|
|
3
3
|
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 a=M({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(a))return;const r=n.collection.split(".").pop(),s=n.itemName||(r?r+"Item":"item");return a.map((c,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:c,[s]:c,[`$${s}Index`]:d}},block:i}))},xe={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ae=(e,t=xe)=>`@media (max-width: ${t[e].max}px)`,ye=({small:e,medium:t})=>{const n=u.fastClone(xe);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const a=n.small.max+1;n.medium={max:t,min:a,default:a+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n},Ye=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),pe=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${Ye(n)}: ${i};`}).filter(u.checkIsDefined),Qe=e=>pe(e).join(`
|
|
4
4
|
`),z=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
5
5
|
${Qe(n)}
|
|
6
6
|
}`;return e?`${e} {
|
|
7
7
|
${i}
|
|
8
|
-
}`:i};function q(e){return o.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function Xe(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 u.checkIsDefined(i.hide)?!i.hide:u.checkIsDefined(i.show)?i.show:!0}function n(){var y;const i=K({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),a=i.responsiveStyles,r=e.context.content,s=ye(((y=r==null?void 0:r.meta)==null?void 0:y.breakpoints)||{}),l=a==null?void 0:a.large,c=a==null?void 0:a.medium,d=a==null?void 0:a.small,f=i.id;if(!f)return"";const S=l?z({className:f,styles:l}):"",C=c?z({className:f,styles:c,mediaQuery:ae("medium",s)}):"",g=d?z({className:f,styles:d,mediaQuery:ae("small",s)}):"";return[S,C,g].join(" ")}return o.jsx(o.Fragment,{children:n()&&t()?o.jsx(o.Fragment,{children:o.jsx(q,{styles:n()})}):null})}function Ze(e){return e.charAt(0).toUpperCase()+e.slice(1)}const et=e=>`on${Ze(e)}`,tt=(e,t)=>n=>M({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Se(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const a in n){if(!n.hasOwnProperty(a))continue;const r=n[a];let s=et(a);if(e.stripPrefix)switch(u.TARGET){case"vue":s=s.replace("v-on:","");break;case"svelte":s=s.replace("on:","");break}t[s]=tt(r,e)}return t}function nt({style:e}){return e}const it=({block:e,context:t})=>ve(nt({style:e.style||{},context:t,block:e}));function ve(e){switch(u.TARGET){case"svelte":case"vue":case"solid":return pe(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}function ot({properties:e}){return e}const at=e=>({href:e.href});function te({block:e,context:t}){var i;const n={...at(e),...e.properties,"builder-id":e.id,style:it({block:e,context:t}),[O()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return ot({properties:n,context:t,block:e})}function rt(e){return o.jsx(Y,{TagName:e.Wrapper,attributes:te({block:e.block,context:e.context}),actionAttributes:Se({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function st(e){return o.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...te({block:e.block,context:e.context}),...Se({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}const lt=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:a,isInteractive:r,contextValue:s})=>{const l={...e,...a?{attributes:te({block:t,context:s})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:a}:l};function re(e){var i;const[t,n]=m.useState(()=>e.isInteractive?st:e.componentRef);return o.jsx(o.Fragment,{children:e.componentRef?o.jsx(o.Fragment,{children:o.jsx(t,{...lt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(a=>o.jsx(U,{block:a,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},a.id))})}):null})}function ct(e){const[t,n]=m.useState(()=>e.repeatContext);return o.jsx(Q.Provider,{value:t,children:o.jsx(U,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function U(e){var f,S,C;function t(){return Je({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 a(){var y;return e.block.tagName==="a"||((y=i().properties)==null?void 0:y.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"}function r(){var p,E;if((p=e.block.repeat)!=null&&p.collection)return!!((E=n==null?void 0:n())!=null&&E.length);const g="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!g}function s(){var y,p;return!((y=t==null?void 0:t())!=null&&y.component)&&!n()?(p=i().children)!=null?p:[]:[]}function l(){var g,y,p,E,P,k,I,F,R,V,W;return{blockChildren:(g=i().children)!=null?g:[],componentRef:(y=t==null?void 0:t())==null?void 0:y.component,componentOptions:{...We(i()),builderContext:e.context,...((p=t==null?void 0:t())==null?void 0:p.name)==="Core:Button"||((E=t==null?void 0:t())==null?void 0:E.name)==="Symbol"||((P=t==null?void 0:t())==null?void 0:P.name)==="Columns"||((k=t==null?void 0:t())==null?void 0:k.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((I=t==null?void 0:t())==null?void 0:I.name)==="Symbol"||((F=t==null?void 0:t())==null?void 0:F.name)==="Columns"||((R=t==null?void 0:t())==null?void 0:R.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:c,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((V=t==null?void 0:t())==null?void 0:V.noWrap)===!0,isInteractive:!((W=t==null?void 0:t())!=null&&W.isRSC)}}const[c,d]=m.useState(()=>e.context);return m.useEffect(()=>{const g=i().id,y=i().animations;y&&g&&_e(y.filter(p=>p.trigger!=="hover").map(p=>({...p,elementId:g})))},[]),o.jsx(o.Fragment,{children:r()?o.jsxs(o.Fragment,{children:[o.jsx(Xe,{block:e.block,context:e.context}),(f=t==null?void 0:t())!=null&&f.noWrap?o.jsx(o.Fragment,{children:o.jsx(re,{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})}):o.jsx(o.Fragment,{children:n()?o.jsx(o.Fragment,{children:(C=n())==null?void 0:C.map((g,y)=>o.jsx(ct,{repeatContext:g.context,block:g.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},y))}):o.jsx(o.Fragment,{children:o.jsxs(rt,{Wrapper:a(),block:i(),context:e.context,linkComponent:e.linkComponent,children:[o.jsx(re,{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}),(S=s())==null?void 0:S.map(g=>o.jsx(U,{block:g,context:c,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},g.id))]})})})]}):null})}function dt(e){function t(){var a;return"builder-blocks"+((a=e.blocks)!=null&&a.length?"":" no-blocks")}function n(){var a,r;u.isEditing()&&!((a=e.blocks)!=null&&a.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var a,r;u.isEditing()&&!((a=e.blocks)!=null&&a.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return o.jsxs(o.Fragment,{children:[o.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-
|
|
8
|
+
}`:i};function q(e){return o.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function Xe(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 u.checkIsDefined(i.hide)?!i.hide:u.checkIsDefined(i.show)?i.show:!0}function n(){var y;const i=K({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),a=i.responsiveStyles,r=e.context.content,s=ye(((y=r==null?void 0:r.meta)==null?void 0:y.breakpoints)||{}),l=a==null?void 0:a.large,c=a==null?void 0:a.medium,d=a==null?void 0:a.small,f=i.id;if(!f)return"";const S=l?z({className:f,styles:l}):"",C=c?z({className:f,styles:c,mediaQuery:ae("medium",s)}):"",g=d?z({className:f,styles:d,mediaQuery:ae("small",s)}):"";return[S,C,g].join(" ")}return o.jsx(o.Fragment,{children:n()&&t()?o.jsx(o.Fragment,{children:o.jsx(q,{styles:n()})}):null})}function Ze(e){return e.charAt(0).toUpperCase()+e.slice(1)}const et=e=>`on${Ze(e)}`,tt=(e,t)=>n=>M({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Se(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const a in n){if(!n.hasOwnProperty(a))continue;const r=n[a];let s=et(a);if(e.stripPrefix)switch(u.TARGET){case"vue":s=s.replace("v-on:","");break;case"svelte":s=s.replace("on:","");break}t[s]=tt(r,e)}return t}function nt({style:e}){return e}const it=({block:e,context:t})=>ve(nt({style:e.style||{},context:t,block:e}));function ve(e){switch(u.TARGET){case"svelte":case"vue":case"solid":return pe(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}function ot({properties:e}){return e}const at=e=>({href:e.href});function te({block:e,context:t}){var i;const n={...at(e),...e.properties,"builder-id":e.id,style:it({block:e,context:t}),[O()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return ot({properties:n,context:t,block:e})}function rt(e){return o.jsx(Y,{TagName:e.Wrapper,attributes:te({block:e.block,context:e.context}),actionAttributes:Se({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function st(e){return o.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...te({block:e.block,context:e.context}),...Se({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}const lt=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:a,isInteractive:r,contextValue:s})=>{const l={...e,...a?{attributes:te({block:t,context:s})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:a}:l};function re(e){var i;const[t,n]=m.useState(()=>e.isInteractive?st:e.componentRef);return o.jsx(o.Fragment,{children:e.componentRef?o.jsx(o.Fragment,{children:o.jsx(t,{...lt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(a=>o.jsx(U,{block:a,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},a.id))})}):null})}function ct(e){const[t,n]=m.useState(()=>e.repeatContext);return o.jsx(Q.Provider,{value:t,children:o.jsx(U,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function U(e){var f,S,C;function t(){return Je({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 a(){var y;return e.block.tagName==="a"||((y=i().properties)==null?void 0:y.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"}function r(){var p,E;if((p=e.block.repeat)!=null&&p.collection)return!!((E=n==null?void 0:n())!=null&&E.length);const g="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!g}function s(){var y,p;return!((y=t==null?void 0:t())!=null&&y.component)&&!n()?(p=i().children)!=null?p:[]:[]}function l(){var g,y,p,E,P,k,I,F,R,V,W;return{blockChildren:(g=i().children)!=null?g:[],componentRef:(y=t==null?void 0:t())==null?void 0:y.component,componentOptions:{...We(i()),builderContext:e.context,...((p=t==null?void 0:t())==null?void 0:p.name)==="Core:Button"||((E=t==null?void 0:t())==null?void 0:E.name)==="Symbol"||((P=t==null?void 0:t())==null?void 0:P.name)==="Columns"||((k=t==null?void 0:t())==null?void 0:k.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((I=t==null?void 0:t())==null?void 0:I.name)==="Symbol"||((F=t==null?void 0:t())==null?void 0:F.name)==="Columns"||((R=t==null?void 0:t())==null?void 0:R.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:c,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((V=t==null?void 0:t())==null?void 0:V.noWrap)===!0,isInteractive:!((W=t==null?void 0:t())!=null&&W.isRSC)}}const[c,d]=m.useState(()=>e.context);return m.useEffect(()=>{const g=i().id,y=i().animations;y&&g&&_e(y.filter(p=>p.trigger!=="hover").map(p=>({...p,elementId:g})))},[]),o.jsx(o.Fragment,{children:r()?o.jsxs(o.Fragment,{children:[o.jsx(Xe,{block:e.block,context:e.context}),(f=t==null?void 0:t())!=null&&f.noWrap?o.jsx(o.Fragment,{children:o.jsx(re,{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})}):o.jsx(o.Fragment,{children:n()?o.jsx(o.Fragment,{children:(C=n())==null?void 0:C.map((g,y)=>o.jsx(ct,{repeatContext:g.context,block:g.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},y))}):o.jsx(o.Fragment,{children:o.jsxs(rt,{Wrapper:a(),block:i(),context:e.context,linkComponent:e.linkComponent,children:[o.jsx(re,{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}),(S=s())==null?void 0:S.map(g=>o.jsx(U,{block:g,context:c,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},g.id))]})})})]}):null})}function dt(e){function t(){var a;return"builder-blocks"+((a=e.blocks)!=null&&a.length?"":" no-blocks")}function n(){var a,r;u.isEditing()&&!((a=e.blocks)!=null&&a.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var a,r;u.isEditing()&&!((a=e.blocks)!=null&&a.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return o.jsxs(o.Fragment,{children:[o.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-7354e098","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:a=>n(),onMouseEnter:a=>i(),onKeyPress:a=>n(),...e.BlocksWrapperProps,children:e.children}),o.jsx("style",{children:`.props-blocks-wrapper-7354e098 {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
`}return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
36
|
+
`}return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-1046d78c`,style:g(),children:[o.jsx(o.Fragment,{children:o.jsx(q,{styles:E()})}),(P=e.columns)==null?void 0:P.map((k,I)=>o.jsx(Y,{TagName:k.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...k.link?{href:k.link}:{},[O()]:"builder-column",style:ve(y(I))},children:o.jsx($,{path:`component.options.columns.${I}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:k.blocks})},I))]}),o.jsx("style",{children:`.div-1046d78c {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
39
|
}`})]})}function Ce(e){return o.jsx("span",{children:e.children})}function se(e){return e.replace(/http(s)?:/,"")}function ut(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+a+t+"="+encodeURIComponent(n)}function mt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return se(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]),a=n[3],r=t.match("x")?t:`${t}x`;return se(`${i[0]}_${r}${a}`)}return null}function J(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(a=>a!==i).map(a=>`${ut(e,"width",a)} ${a}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[mt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function we(e){var a,r,s,l;function t(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),J(d)}else if(e.image&&!e.srcset)return J(d);return J(d)}function n(){var c;return(c=t==null?void 0:t())!=null&&c.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const c={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?c:void 0}return o.jsxs(o.Fragment,{children:[o.jsxs(o.Fragment,{children:[o.jsxs("picture",{children:[n()?o.jsx(o.Fragment,{children:o.jsx("source",{type:"image/webp",srcSet:n()})}):null,o.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-40c70c9b",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(a=e.builderBlock)==null?void 0:a.children)!=null&&r.length&&e.fitContent)?o.jsx(o.Fragment,{children:o.jsx("div",{className:"builder-image-sizer div-40c70c9b",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?o.jsx(o.Fragment,{children:e.children}):null,!e.fitContent&&e.children?o.jsx(o.Fragment,{children:o.jsx("div",{className:"div-40c70c9b-2",children:e.children})}):null]}),o.jsx("style",{children:`.img-40c70c9b {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
55
|
-
}`})]})}function Ie(e){return o.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const ft={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},gt={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(a=>a.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((l,c)=>l+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}]},ht={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},bt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(s,l=6e4){return new Promise((c,d)=>{const f=document.createElement("img");let S=!1;f.onload=()=>{S=!0,c(f)},f.addEventListener("error",C=>{console.warn("Image load failed",C.error),d(C.error)}),f.src=s,setTimeout(()=>{S||d(new Error("Image load timed out"))},l)})}function i(s){return Math.round(s*1e3)/1e3}const a=e.get("image"),r=e.get("aspectRatio");if(fetch(a).then(s=>s.blob()).then(s=>{s.type.includes("svg")&&e.set("noWebp",!0)}),a&&(!r||r===.7041))return n(a).then(s=>{const l=e.get("aspectRatio");e.get("image")===a&&(!l||l===.7041)&&s.width&&s.height&&(e.set("aspectRatio",i(s.height/s.width)),e.set("height",s.height),e.set("width",s.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},xt={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},yt={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function pt(e){var t,n,i;return o.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:o.jsx($,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const St={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},vt={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Te(e){var t;return o.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const kt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function Ct(e){const t=m.useRef(null),[n,i]=m.useState(()=>[]),[a,r]=m.useState(()=>[]);return m.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const s=t.current.getElementsByTagName("script");for(let c=0;c<s.length;c++){const d=s[c];if(d.src){if(n.includes(d.src))continue;n.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(a.includes(d.innerText))continue;try{a.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),o.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const wt={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},It=["text/javascript","application/javascript","application/ecmascript"],Tt=e=>It.includes(e.type);function Et(e){const t=m.useRef(null),[n,i]=m.useState(()=>[]),[a,r]=m.useState(()=>[]),[s,l]=m.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const d=t.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const S=d[f];if(S.src&&!n.includes(S.src)){n.push(S.src);const C=document.createElement("script");C.async=!0,C.src=S.src,document.head.appendChild(C)}else if(Tt(S)&&!a.includes(S.innerText))try{a.push(S.innerText),new Function(S.innerText)()}catch(C){console.warn("`Embed`: Error running script:",C)}}}return m.useEffect(()=>{t.current&&!s&&(l(!0),c())},[t.current,s]),o.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const jt={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}]},Rt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Ft=()=>{const e=process.env.NODE_ENV||"production";return Rt.includes(e)?e:"production"},Pt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((a,r)=>a!=null?a[r]:a,e);return i===void 0||i===e?n:i};function Bt(e){var S,C;const t=m.useRef(null),[n,i]=m.useState(()=>"unsubmitted"),[a,r]=m.useState(()=>null),[s,l]=m.useState(()=>"");function c(g){var p,E;const y={...e.builderContext.rootState,...g};e.builderContext.rootSetState?(E=(p=e.builderContext).rootSetState)==null||E.call(p,y):e.builderContext.rootState=y}function d(){return u.isEditing()&&e.previewState||n}function f(g){var p;const y=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")g.preventDefault();else if(y){if(!(e.action||e.sendSubmissionsTo==="email")){g.preventDefault();return}g.preventDefault();const E=g.currentTarget,P=e.customHeaders||{};let k;const I=new FormData(E),F=Array.from(g.currentTarget.querySelectorAll("input,select,textarea")).filter(h=>!!h.name).map(h=>{let T;const N=h.name;if(h instanceof HTMLInputElement)if(h.type==="radio"){if(h.checked)return T=h.name,{key:N,value:T}}else if(h.type==="checkbox")T=h.checked;else if(h.type==="number"||h.type==="range"){const B=h.valueAsNumber;isNaN(B)||(T=B)}else h.type==="file"?T=h.files:T=h.value;else T=h.value;return{key:N,value:T}});let R=e.contentType;if(e.sendSubmissionsTo==="email"&&(R="multipart/form-data"),Array.from(F).forEach(({value:h})=>{(h instanceof File||Array.isArray(h)&&h[0]instanceof File||h instanceof FileList)&&(R="multipart/form-data")}),R!=="application/json")k=I;else{const h={};Array.from(F).forEach(({value:T,key:N})=>{he(h,N,T)}),k=JSON.stringify(h)}R&&R!=="multipart/form-data"&&(y&&((p=e.action)!=null&&p.includes("zapier.com"))||(P["content-type"]=R));const V=new CustomEvent("presubmit",{detail:{body:k}});if(t.current&&(t.current.dispatchEvent(V),V.defaultPrevented))return;i("sending");const W=`${Ft()==="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"?W:e.action,{body:k,headers:P,method:e.method||"post"}).then(async h=>{let T;const N=h.headers.get("content-type");if(N&&N.indexOf("application/json")!==-1?T=await h.json():T=await h.text(),!h.ok&&e.errorMessagePath){let B=Pt(T,e.errorMessagePath);B&&(typeof B!="string"&&(B=JSON.stringify(B)),l(B),c({formErrorMessage:B}))}if(r(T),i(h.ok?"success":"error"),h.ok){const B=new CustomEvent("submit:success",{detail:{res:h,body:T}});if(t.current){if(t.current.dispatchEvent(B),B.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const L=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(L),L.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},h=>{const T=new CustomEvent("submit:error",{detail:{error:h}});t.current&&(t.current.dispatchEvent(T),T.defaultPrevented)||(r(h),i("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:g=>f(g),...e.attributes,children:[" ",e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(C=(S=e.builderBlock)==null?void 0:S.children)==null?void 0:C.map((g,y)=>o.jsx(U,{block:g,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${y}`))}):null," ",d()==="error"?o.jsx(o.Fragment,{children:o.jsx($,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext})}):null," ",d()==="sending"?o.jsx(o.Fragment,{children:o.jsx($,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext})}):null," ",d()==="error"&&a?o.jsx(o.Fragment,{children:o.jsxs("pre",{className:"builder-form-error-text pre-8fbb5280",children:[" ",JSON.stringify(a,null,2)," "]})}):null," ",d()==="success"?o.jsx(o.Fragment,{children:o.jsx($,{path:"successMessage",blocks:e.successMessage,context:e.builderContext})}):null," "]})," ",o.jsx("style",{children:".pre-8fbb5280 { padding: 10px; color: red; text-align: center; }"})," "]})}const At={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 m.createElement("input",{...e.attributes,key:u.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Wt={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function Nt(e){var t;return m.createElement("select",{...e.attributes,value:e.value,key:u.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map(n=>o.jsx("option",{value:n.value,children:n.name||n.value})))}const $t={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function Dt(e){return o.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Lt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function Ot(e){return o.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},u.isEditing()&&e.imgSrc||"default-key")}const Mt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",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 Ee(e){var i,a,r,s,l,c,d;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 o.jsxs("div",{style:{position:"relative"},children:[o.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:o.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(a=e.builderBlock)==null?void 0:a.children)!=null&&r.length))?o.jsx(o.Fragment,{children:o.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?o.jsx(o.Fragment,{children:o.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(d=(c=e.builderBlock)==null?void 0:c.children)!=null&&d.length&&!e.fitContent?o.jsx(o.Fragment,{children:o.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children})}):null]})}const Ut=()=>[{component:Ct,...kt},{component:Et,...wt},{component:Bt,...jt},{component:Vt,...At},{component:Dt,...$t},{component:Nt,...Wt},{component:Ot,...Lt},{component:Ee,...Mt}],le=()=>[{component:me,...ft},{component:ke,...gt},{component:Ce,...ht},{component:we,...bt},{component:Ie,...xt},{component:pt,...yt},{component:Pe,...St},{component:Te,...vt},...Ut()],Ht=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function Ie(e){return o.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const ft={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},gt={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(a=>a.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((l,c)=>l+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}]},ht={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},bt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(s,l=6e4){return new Promise((c,d)=>{const f=document.createElement("img");let S=!1;f.onload=()=>{S=!0,c(f)},f.addEventListener("error",C=>{console.warn("Image load failed",C.error),d(C.error)}),f.src=s,setTimeout(()=>{S||d(new Error("Image load timed out"))},l)})}function i(s){return Math.round(s*1e3)/1e3}const a=e.get("image"),r=e.get("aspectRatio");if(fetch(a).then(s=>s.blob()).then(s=>{s.type.includes("svg")&&e.set("noWebp",!0)}),a&&(!r||r===.7041))return n(a).then(s=>{const l=e.get("aspectRatio");e.get("image")===a&&(!l||l===.7041)&&s.width&&s.height&&(e.set("aspectRatio",i(s.height/s.width)),e.set("height",s.height),e.set("width",s.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},xt={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},yt={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function pt(e){var t,n,i;return o.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:o.jsx($,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const St={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},vt={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Te(e){var t;return o.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const kt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function Ct(e){const t=m.useRef(null),[n,i]=m.useState(()=>[]),[a,r]=m.useState(()=>[]);return m.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.getElementsByTagName)||typeof window=="undefined")return;const s=t.current.getElementsByTagName("script");for(let c=0;c<s.length;c++){const d=s[c];if(d.src){if(n.includes(d.src))continue;n.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(a.includes(d.innerText))continue;try{a.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),o.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const wt={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},It=["text/javascript","application/javascript","application/ecmascript"],Tt=e=>It.includes(e.type);function Et(e){const t=m.useRef(null),[n,i]=m.useState(()=>[]),[a,r]=m.useState(()=>[]),[s,l]=m.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const d=t.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const S=d[f];if(S.src&&!n.includes(S.src)){n.push(S.src);const C=document.createElement("script");C.async=!0,C.src=S.src,document.head.appendChild(C)}else if(Tt(S)&&!a.includes(S.innerText))try{a.push(S.innerText),new Function(S.innerText)()}catch(C){console.warn("`Embed`: Error running script:",C)}}}return m.useEffect(()=>{t.current&&!s&&(l(!0),c())},[t.current,s]),o.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const jt={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}]},Rt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Ft=()=>{const e=process.env.NODE_ENV||"production";return Rt.includes(e)?e:"production"},Pt=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((a,r)=>a!=null?a[r]:a,e);return i===void 0||i===e?n:i};function Bt(e){var S,C;const t=m.useRef(null),[n,i]=m.useState(()=>"unsubmitted"),[a,r]=m.useState(()=>null),[s,l]=m.useState(()=>"");function c(g){var p,E;const y={...e.builderContext.rootState,...g};e.builderContext.rootSetState?(E=(p=e.builderContext).rootSetState)==null||E.call(p,y):e.builderContext.rootState=y}function d(){return u.isEditing()&&e.previewState||n}function f(g){var p;const y=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")g.preventDefault();else if(y){if(!(e.action||e.sendSubmissionsTo==="email")){g.preventDefault();return}g.preventDefault();const E=g.currentTarget,P=e.customHeaders||{};let k;const I=new FormData(E),F=Array.from(g.currentTarget.querySelectorAll("input,select,textarea")).filter(h=>!!h.name).map(h=>{let T;const N=h.name;if(h instanceof HTMLInputElement)if(h.type==="radio"){if(h.checked)return T=h.name,{key:N,value:T}}else if(h.type==="checkbox")T=h.checked;else if(h.type==="number"||h.type==="range"){const B=h.valueAsNumber;isNaN(B)||(T=B)}else h.type==="file"?T=h.files:T=h.value;else T=h.value;return{key:N,value:T}});let R=e.contentType;if(e.sendSubmissionsTo==="email"&&(R="multipart/form-data"),Array.from(F).forEach(({value:h})=>{(h instanceof File||Array.isArray(h)&&h[0]instanceof File||h instanceof FileList)&&(R="multipart/form-data")}),R!=="application/json")k=I;else{const h={};Array.from(F).forEach(({value:T,key:N})=>{he(h,N,T)}),k=JSON.stringify(h)}R&&R!=="multipart/form-data"&&(y&&((p=e.action)!=null&&p.includes("zapier.com"))||(P["content-type"]=R));const V=new CustomEvent("presubmit",{detail:{body:k}});if(t.current&&(t.current.dispatchEvent(V),V.defaultPrevented))return;i("sending");const W=`${Ft()==="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"?W:e.action,{body:k,headers:P,method:e.method||"post"}).then(async h=>{let T;const N=h.headers.get("content-type");if(N&&N.indexOf("application/json")!==-1?T=await h.json():T=await h.text(),!h.ok&&e.errorMessagePath){let B=Pt(T,e.errorMessagePath);B&&(typeof B!="string"&&(B=JSON.stringify(B)),l(B),c({formErrorMessage:B}))}if(r(T),i(h.ok?"success":"error"),h.ok){const B=new CustomEvent("submit:success",{detail:{res:h,body:T}});if(t.current){if(t.current.dispatchEvent(B),B.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const L=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(L),L.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},h=>{const T=new CustomEvent("submit:error",{detail:{error:h}});t.current&&(t.current.dispatchEvent(T),T.defaultPrevented)||(r(h),i("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:g=>f(g),...e.attributes,children:[" ",e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(C=(S=e.builderBlock)==null?void 0:S.children)==null?void 0:C.map((g,y)=>o.jsx(U,{block:g,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${y}`))}):null," ",d()==="error"?o.jsx(o.Fragment,{children:o.jsx($,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext})}):null," ",d()==="sending"?o.jsx(o.Fragment,{children:o.jsx($,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext})}):null," ",d()==="error"&&a?o.jsx(o.Fragment,{children:o.jsxs("pre",{className:"builder-form-error-text pre-25b9edf0",children:[" ",JSON.stringify(a,null,2)," "]})}):null," ",d()==="success"?o.jsx(o.Fragment,{children:o.jsx($,{path:"successMessage",blocks:e.successMessage,context:e.builderContext})}):null," "]})," ",o.jsx("style",{children:".pre-25b9edf0 { padding: 10px; color: red; text-align: center; }"})," "]})}const At={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 m.createElement("input",{...e.attributes,key:u.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Wt={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function Nt(e){var t;return m.createElement("select",{...e.attributes,value:e.value,key:u.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map(n=>o.jsx("option",{value:n.value,children:n.name||n.value})))}const $t={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function Dt(e){return o.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Lt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function Ot(e){return o.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},u.isEditing()&&e.imgSrc||"default-key")}const Mt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",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 Ee(e){var i,a,r,s,l,c,d;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 o.jsxs("div",{style:{position:"relative"},children:[o.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:o.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(a=e.builderBlock)==null?void 0:a.children)!=null&&r.length))?o.jsx(o.Fragment,{children:o.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(l=(s=e.builderBlock)==null?void 0:s.children)!=null&&l.length&&e.fitContent?o.jsx(o.Fragment,{children:o.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(d=(c=e.builderBlock)==null?void 0:c.children)!=null&&d.length&&!e.fitContent?o.jsx(o.Fragment,{children:o.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children})}):null]})}const Ut=()=>[{component:Ct,...kt},{component:Et,...wt},{component:Bt,...jt},{component:Vt,...At},{component:Dt,...$t},{component:Nt,...Wt},{component:Ot,...Lt},{component:Ee,...Mt}],le=()=>[{component:me,...ft},{component:ke,...gt},{component:Ce,...ht},{component:we,...bt},{component:Ie,...xt},{component:pt,...yt},{component:Pe,...St},{component:Te,...vt},...Ut()],Ht=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
56
|
function getAndSetVariantId() {
|
|
57
57
|
function setCookie(name, value, days) {
|
|
58
58
|
let expires = '';
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as l, Fragment as m, jsxs as F } from "react/jsx-runtime";
|
|
3
3
|
import { createContext as Te, useState as v, useEffect as V, useContext as he, useRef as ee, createElement as ae } from "react";
|
|
4
|
-
import { T as z, i as M, k as j, l as je, m as G, n as _, o as re, p as X, q as ge, a as He, u as _e, v as Ke, w as qe, c as ze, e as Ee, x as Je, y as be, z as ye, A as Ye } from "./server-entry-
|
|
5
|
-
import { _ as On, f as Un, d as jn, h as Hn, g as _n, j as Kn, r as qn, s as zn, b as Jn, t as Yn } from "./server-entry-
|
|
4
|
+
import { T as z, i as M, k as j, l as je, m as G, n as _, o as re, p as X, q as ge, a as He, u as _e, v as Ke, w as qe, c as ze, e as Ee, x as Je, y as be, z as ye, A as Ye } from "./server-entry-143700d6.js";
|
|
5
|
+
import { _ as On, f as Un, d as jn, h as Hn, g as _n, j as Kn, r as qn, s as zn, b as Jn, t as Yn } from "./server-entry-143700d6.js";
|
|
6
6
|
const Qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Ge = (e) => typeof e == "string" && Qe.has(e.toLowerCase());
|
|
7
7
|
function le(e) {
|
|
8
8
|
return /* @__PURE__ */ l(m, { children: Ge(e.TagName) ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ l(m, { children: typeof e.TagName == "string" ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
@@ -887,7 +887,7 @@ function Rt(e) {
|
|
|
887
887
|
/* @__PURE__ */ l(
|
|
888
888
|
e.BlocksWrapper,
|
|
889
889
|
{
|
|
890
|
-
className: t() + " props-blocks-wrapper-
|
|
890
|
+
className: t() + " props-blocks-wrapper-7354e098",
|
|
891
891
|
"builder-path": e.path,
|
|
892
892
|
"builder-parent-id": e.parent,
|
|
893
893
|
style: e.styleProp,
|
|
@@ -898,7 +898,7 @@ function Rt(e) {
|
|
|
898
898
|
children: e.children
|
|
899
899
|
}
|
|
900
900
|
),
|
|
901
|
-
/* @__PURE__ */ l("style", { children: `.props-blocks-wrapper-
|
|
901
|
+
/* @__PURE__ */ l("style", { children: `.props-blocks-wrapper-7354e098 {
|
|
902
902
|
display: flex;
|
|
903
903
|
flex-direction: column;
|
|
904
904
|
align-items: stretch;
|
|
@@ -1034,7 +1034,7 @@ function Pt(e) {
|
|
|
1034
1034
|
/* @__PURE__ */ F(
|
|
1035
1035
|
"div",
|
|
1036
1036
|
{
|
|
1037
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
1037
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-1046d78c`,
|
|
1038
1038
|
style: f(),
|
|
1039
1039
|
children: [
|
|
1040
1040
|
/* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(te, { styles: E() }) }),
|
|
@@ -1070,7 +1070,7 @@ function Pt(e) {
|
|
|
1070
1070
|
]
|
|
1071
1071
|
}
|
|
1072
1072
|
),
|
|
1073
|
-
/* @__PURE__ */ l("style", { children: `.div-
|
|
1073
|
+
/* @__PURE__ */ l("style", { children: `.div-1046d78c {
|
|
1074
1074
|
display: flex;
|
|
1075
1075
|
line-height: normal;
|
|
1076
1076
|
}` })
|
|
@@ -2204,7 +2204,7 @@ function tn(e) {
|
|
|
2204
2204
|
}
|
|
2205
2205
|
) }) : null,
|
|
2206
2206
|
" ",
|
|
2207
|
-
d() === "error" && o ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ F("pre", { className: "builder-form-error-text pre-
|
|
2207
|
+
d() === "error" && o ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ F("pre", { className: "builder-form-error-text pre-25b9edf0", children: [
|
|
2208
2208
|
" ",
|
|
2209
2209
|
JSON.stringify(o, null, 2),
|
|
2210
2210
|
" "
|
|
@@ -2223,7 +2223,7 @@ function tn(e) {
|
|
|
2223
2223
|
}
|
|
2224
2224
|
),
|
|
2225
2225
|
" ",
|
|
2226
|
-
/* @__PURE__ */ l("style", { children: ".pre-
|
|
2226
|
+
/* @__PURE__ */ l("style", { children: ".pre-25b9edf0 { padding: 10px; color: red; text-align: center; }" }),
|
|
2227
2227
|
" "
|
|
2228
2228
|
] });
|
|
2229
2229
|
}
|
|
@@ -478,7 +478,7 @@ function Y(e, t) {
|
|
|
478
478
|
const n = new URL(t.origin), r = n.hostname;
|
|
479
479
|
return (e || $e).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
480
480
|
}
|
|
481
|
-
const je = "0.13.
|
|
481
|
+
const je = "0.13.3", B = {};
|
|
482
482
|
function De(e, t) {
|
|
483
483
|
let n = B[e];
|
|
484
484
|
if (n || (n = B[e] = []), n.push(t), i()) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";const S="react",v="[Builder.io]: ",u={log:(...e)=>console.log(v,...e),error:(...e)=>console.error(v,...e),warn:(...e)=>console.warn(v,...e),debug:(...e)=>console.debug(v,...e)};function a(){return typeof window!="undefined"&&typeof document!="undefined"}function ce(){return a()&&window.self!==window.top}function C(){return ce()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const ue=()=>{if(a()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},de=()=>typeof navigator=="object"&&navigator.userAgent||"",$=()=>{const e=de(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||S==="reactNative"}},n=e.match(/Tablet|iPad/i),r=ue();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},h=e=>e!=null,O=e=>JSON.parse(JSON.stringify(e)),le=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},j=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){u.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},K=async e=>j(e),fe=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(h).join("; "),ge=[["secure",""],["SameSite","None"]],he=({name:e,value:t,expires:n})=>{const o=(a()?location.protocol==="https:":!0)?ge:[[]],s=n?[["expires",n.toUTCString()]]:[[]],i=[[e,t],...s,["path","/"],["domain",le(window.location.hostname)],...o];return fe(i)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=he({name:e,value:t,expires:n});document.cookie=o}catch(o){u.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}},pe="builder.tests",T=e=>`${pe}.${e}`,me=({contentId:e})=>K({name:T(e),canTrack:!0}),ye=({contentId:e})=>j({name:T(e),canTrack:!0}),we=({contentId:e,value:t})=>_({name:T(e),value:t,canTrack:!0}),W=e=>h(e.id)&&h(e.variations)&&Object.keys(e.variations).length>0,be=({id:e,variations:t})=>{var o;let n=0;const r=Math.random();for(const s in t){const i=(o=t[s])==null?void 0:o.testRatio;if(n+=i,r<n)return s}return e},G=e=>{const t=be(e);return we({contentId:e.id,value:t}).catch(n=>{u.error("could not store A/B test variation: ",n)}),t},J=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},Se=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!W(e))return e;const n=ye({contentId:e.id})||G({variations:e.variations,id:e.id}),r=J({item:e,testGroupId:n});return{...e,...r}},Ie=async({item:e,canTrack:t})=>{if(!t||!W(e))return e;const r=await me({contentId:e.id})||G({variations:e.variations,id:e.id}),o=J({item:e,testGroupId:r});return{...e,...o}},z=e=>h(e)?e:!0,ve=[],Ee=e=>({type:"builder.registerComponent",data:H(e)}),ke=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},Ce=e=>typeof e=="function"?ke(e):O(e),H=({inputs:e,...t})=>({...O(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((r,[o,s])=>({...r,[o]:Ce(s)}),{}))});function Oe(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Te(){const e=Oe().fetch;if(typeof e=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
2
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const X=Te();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],i=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,i,n)}:{...r,[i]:s}},{})}const Ae="v3",M="builder.",Pe="options.",xe=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},A=e=>{if(!e)return{};const t=q(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(M)){const o=r.replace(M,"").replace(Pe,"");n[o]=t[r]}}),n},Re=()=>{if(!a())return{};const e=new URLSearchParams(window.location.search);return A(e)},q=e=>e instanceof URLSearchParams?xe(e):e,U=e=>typeof e=="number"&&!isNaN(e)&&e>=0,P=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:r,query:o,model:s,apiKey:i,includeRefs:f=!0,enrich:I,locale:p,apiVersion:y=Ae,fields:d,omit:w,offset:g,cacheSeconds:m,staleCacheSeconds:k,sort:B,includeUnpublished:L}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const c=new URL(`https://cdn.builder.io/api/${y}/content/${s}?apiKey=${i}&limit=${n}&noTraverse=${t}&includeRefs=${f}${p?`&locale=${p}`:""}${I?`&enrich=${I}`:""}`);if(c.searchParams.set("omit",w||"meta.componentsUsed"),d&&c.searchParams.set("fields",d),Number.isFinite(g)&&g>-1&&c.searchParams.set("offset",String(Math.floor(g))),typeof L=="boolean"&&c.searchParams.set("includeUnpublished",String(L)),m&&U(m)&&c.searchParams.set("cacheSeconds",String(m)),k&&U(k)&&c.searchParams.set("staleCacheSeconds",String(k)),B){const l=E({sort:B});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}const ae={...Re(),...q(e.options||{})},V=E(ae);for(const l in V)c.searchParams.set(l,String(V[l]));if(r&&c.searchParams.set("userAttributes",JSON.stringify(r)),o){const l=E({query:o});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}return c},Be=e=>"results"in e;async function x(e){const t=await R({...e,limit:1});return t&&t[0]||null}const Le=x,Ve=async e=>{const t=P(e);return await(await X(t.href)).json()},Y=async(e,t,n=P(e))=>{const r=z(e.canTrack);if(n.search.includes("preview="),!r||!(a()||S==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await Ie({item:s,canTrack:r}));t.results=o}catch(o){u.error("Could not process A/B tests. ",o)}return t.results};async function R(e){try{const t=P(e),n=await Ve(e);return Be(n)?Y(e,n):(u.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return u.error("Error fetching data. ",t),null}}const Me=R;function Ue(){return!a()||C()?!1:location.search.indexOf("builder.preview=")!==-1}function Fe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Q(){return Fe().replace(/-/g,"")}const Z="builderSessionId",Ne=async({canTrack:e})=>{if(!e)return;const t=await K({name:Z,canTrack:e});if(h(t))return t;{const n=De();return $e({id:n,canTrack:e}),n}},De=()=>Q(),$e=({id:e,canTrack:t})=>_({name:Z,value:e,canTrack:t}),ee=()=>a()&&typeof localStorage!="undefined"?localStorage:void 0,je=({key:e,canTrack:t})=>{var n;try{return t?(n=ee())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ke=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=ee())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},te="builderVisitorId",_e=({canTrack:e})=>{if(!e)return;const t=je({key:te,canTrack:e});if(h(t))return t;{const n=We();return Ge({id:n,canTrack:e}),n}},We=()=>Q(),Ge=({id:e,canTrack:t})=>Ke({key:te,value:e,canTrack:t}),Je=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ne({canTrack:e}),n=_e({canTrack:e});return{sessionId:t,visitorId:n}},ze=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Je({canTrack:t}),userAttributes:$(),ownerId:n}});async function ne(e){if(!e.apiKey){u.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!C()&&(a()||S==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ze(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const He=e=>ne({...e,canTrack:!0}),Xe=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function re(e,t){const n=new URL(t.origin),r=n.hostname;return(e||Xe).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const qe="0.13.
|
|
2
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const X=Te();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],i=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,i,n)}:{...r,[i]:s}},{})}const Ae="v3",M="builder.",Pe="options.",xe=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},A=e=>{if(!e)return{};const t=q(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(M)){const o=r.replace(M,"").replace(Pe,"");n[o]=t[r]}}),n},Re=()=>{if(!a())return{};const e=new URLSearchParams(window.location.search);return A(e)},q=e=>e instanceof URLSearchParams?xe(e):e,U=e=>typeof e=="number"&&!isNaN(e)&&e>=0,P=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:r,query:o,model:s,apiKey:i,includeRefs:f=!0,enrich:I,locale:p,apiVersion:y=Ae,fields:d,omit:w,offset:g,cacheSeconds:m,staleCacheSeconds:k,sort:B,includeUnpublished:L}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const c=new URL(`https://cdn.builder.io/api/${y}/content/${s}?apiKey=${i}&limit=${n}&noTraverse=${t}&includeRefs=${f}${p?`&locale=${p}`:""}${I?`&enrich=${I}`:""}`);if(c.searchParams.set("omit",w||"meta.componentsUsed"),d&&c.searchParams.set("fields",d),Number.isFinite(g)&&g>-1&&c.searchParams.set("offset",String(Math.floor(g))),typeof L=="boolean"&&c.searchParams.set("includeUnpublished",String(L)),m&&U(m)&&c.searchParams.set("cacheSeconds",String(m)),k&&U(k)&&c.searchParams.set("staleCacheSeconds",String(k)),B){const l=E({sort:B});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}const ae={...Re(),...q(e.options||{})},V=E(ae);for(const l in V)c.searchParams.set(l,String(V[l]));if(r&&c.searchParams.set("userAttributes",JSON.stringify(r)),o){const l=E({query:o});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}return c},Be=e=>"results"in e;async function x(e){const t=await R({...e,limit:1});return t&&t[0]||null}const Le=x,Ve=async e=>{const t=P(e);return await(await X(t.href)).json()},Y=async(e,t,n=P(e))=>{const r=z(e.canTrack);if(n.search.includes("preview="),!r||!(a()||S==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await Ie({item:s,canTrack:r}));t.results=o}catch(o){u.error("Could not process A/B tests. ",o)}return t.results};async function R(e){try{const t=P(e),n=await Ve(e);return Be(n)?Y(e,n):(u.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return u.error("Error fetching data. ",t),null}}const Me=R;function Ue(){return!a()||C()?!1:location.search.indexOf("builder.preview=")!==-1}function Fe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Q(){return Fe().replace(/-/g,"")}const Z="builderSessionId",Ne=async({canTrack:e})=>{if(!e)return;const t=await K({name:Z,canTrack:e});if(h(t))return t;{const n=De();return $e({id:n,canTrack:e}),n}},De=()=>Q(),$e=({id:e,canTrack:t})=>_({name:Z,value:e,canTrack:t}),ee=()=>a()&&typeof localStorage!="undefined"?localStorage:void 0,je=({key:e,canTrack:t})=>{var n;try{return t?(n=ee())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ke=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=ee())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},te="builderVisitorId",_e=({canTrack:e})=>{if(!e)return;const t=je({key:te,canTrack:e});if(h(t))return t;{const n=We();return Ge({id:n,canTrack:e}),n}},We=()=>Q(),Ge=({id:e,canTrack:t})=>Ke({key:te,value:e,canTrack:t}),Je=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ne({canTrack:e}),n=_e({canTrack:e});return{sessionId:t,visitorId:n}},ze=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Je({canTrack:t}),userAttributes:$(),ownerId:n}});async function ne(e){if(!e.apiKey){u.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!C()&&(a()||S==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ze(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const He=e=>ne({...e,canTrack:!0}),Xe=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function re(e,t){const n=new URL(t.origin),r=n.hostname;return(e||Xe).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const qe="0.13.3",F={};function oe(e,t){let n=F[e];if(n||(n=F[e]=[]),n.push(t),a()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const Ye=()=>{oe("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let N=!1;const se=(e={})=>{var t,n;N||(N=!0,a()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:S,version:qe,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,i;if(!re(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const f=o.data.text,I=o.data.arguments||[],p=o.data.id,y=new Function(f);let d,w=null;try{d=y.apply(null,I)}catch(g){w=g}w?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:p,error:w.message}},"*"):d&&typeof d.then=="function"?d.then(g=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:p,result:g}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:d,id:p}},"*");break}}})))},ie=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!re(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const s=o.data,i=s.key||s.alias||s.entry||s.modelName,f=s.data;i===e&&n.contentUpdate(f);break}}},Qe=(e,t,n)=>{if(!a)return u.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};se();const r=ie({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},D={};function Ze(e){if(a()){Object.assign(D,e);const t={type:"builder.settingsChange",data:D};parent.postMessage(t,"*")}}const et=async e=>{var r,o,s;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:A(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await x(n)}};exports.TARGET=S;exports._processContentResult=Y;exports._track=ne;exports.checkIsDefined=h;exports.components=ve;exports.createEditorListener=ie;exports.createRegisterComponentMessage=Ee;exports.fastClone=O;exports.fetch=X;exports.fetchBuilderProps=et;exports.fetchEntries=R;exports.fetchOneEntry=x;exports.getAllContent=Me;exports.getBuilderSearchParams=A;exports.getContent=Le;exports.getDefaultCanTrack=z;exports.getUserAttributes=$;exports.handleABTestingSync=Se;exports.isBrowser=a;exports.isEditing=C;exports.isPreviewing=Ue;exports.logger=u;exports.register=oe;exports.registerInsertMenu=Ye;exports.serializeComponentInfo=H;exports.setEditorSettings=Ze;exports.setupBrowserForEditing=se;exports.subscribeToEditor=Qe;exports.track=He;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-ad61693c.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as t, c as a, f as r, d as i, e as n, h as o, g, j as c, i as d, a as f, r as h, s as l, b as E, t as p } from "./server-entry-
|
|
1
|
+
import { _ as t, c as a, f as r, d as i, e as n, h as o, g, j as c, i as d, a as f, r as h, s as l, b as E, t as p } from "./server-entry-143700d6.js";
|
|
2
2
|
export {
|
|
3
3
|
t as _processContentResult,
|
|
4
4
|
a as createRegisterComponentMessage,
|