@builder.io/sdk-react 1.0.19 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +2 -2
- package/lib/browser/blocks-exports.mjs +2 -2
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-cfff49d1.js → server-entry-a562cf23.js} +1 -1
- package/lib/browser/{server-entry-1a86f409.cjs → server-entry-a77461d4.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-5341123d.cjs → blocks-523eb4f1.cjs} +1 -1
- package/lib/edge/{blocks-1ea14427.js → blocks-683aad9f.js} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-c6255c8e.cjs → button-0d418bcf.cjs} +1 -1
- package/lib/edge/{button-f5764a4c.js → button-9f6acf3e.js} +2 -2
- package/lib/edge/{columns-01e0bb50.cjs → columns-1613d62d.cjs} +1 -1
- package/lib/edge/{columns-17090869.js → columns-b0785992.js} +3 -3
- package/lib/edge/{content-variants-bfca78f9.js → content-variants-13f821c6.js} +8 -8
- package/lib/edge/{content-variants-3961c4ee.cjs → content-variants-281298f6.cjs} +1 -1
- package/lib/edge/{form-b97fba27.cjs → form-0483aa64.cjs} +1 -1
- package/lib/edge/{form-39e97f30.js → form-db27fc26.js} +3 -3
- package/lib/edge/{get-class-prop-name-859a7f60.js → get-class-prop-name-6bfc4756.js} +1 -1
- package/lib/edge/{get-class-prop-name-f1301669.cjs → get-class-prop-name-e3ba0522.cjs} +1 -1
- package/lib/edge/{img-b4ff1bef.js → img-43a8ffe0.js} +1 -1
- package/lib/edge/{img-0c1e53c0.cjs → img-f01d904d.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-c6fee09c.js → input-805a9ac6.js} +1 -1
- package/lib/edge/{input-2103da14.cjs → input-e6483bd7.cjs} +1 -1
- package/lib/edge/select-4966723f.js +20 -0
- package/lib/edge/select-e5d1e627.cjs +1 -0
- package/lib/edge/{server-entry-00891f33.cjs → server-entry-83648311.cjs} +1 -1
- package/lib/edge/{server-entry-d46a218d.js → server-entry-c13e82bd.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-c9f94715.js → slot-1b0351de.js} +3 -3
- package/lib/edge/{slot-8de7d746.cjs → slot-3ef77ae1.cjs} +1 -1
- package/lib/edge/{symbol-636383eb.cjs → symbol-883d624f.cjs} +1 -1
- package/lib/edge/{symbol-324dadc8.js → symbol-f1632f93.js} +2 -2
- package/lib/node/blocks-exports.cjs +2 -2
- package/lib/node/blocks-exports.mjs +2 -2
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-8c84ddbd.js → server-entry-8c712c9b.js} +1 -1
- package/lib/node/{server-entry-ff6fc2b4.cjs → server-entry-bedf45f8.cjs} +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/button/button.d.ts +1 -1
- package/types/blocks/button/button.types.d.ts +1 -1
- package/types/blocks/button/component-info.d.ts +1 -1
- package/types/blocks/columns/columns.d.ts +1 -1
- package/types/blocks/columns/columns.types.d.ts +2 -2
- package/types/blocks/columns/component-info.d.ts +1 -1
- package/types/blocks/custom-code/component-info.d.ts +1 -1
- package/types/blocks/embed/component-info.d.ts +1 -1
- package/types/blocks/form/form/component-info.d.ts +1 -1
- package/types/blocks/form/form/form.d.ts +2 -2
- package/types/blocks/form/input/component-info.d.ts +1 -1
- package/types/blocks/form/select/component-info.d.ts +1 -1
- package/types/blocks/form/submit-button/component-info.d.ts +1 -1
- package/types/blocks/fragment/component-info.d.ts +1 -1
- package/types/blocks/fragment/fragment.d.ts +1 -1
- package/types/blocks/image/component-info.d.ts +1 -1
- package/types/blocks/image/image.d.ts +1 -1
- package/types/blocks/image/image.types.d.ts +1 -1
- package/types/blocks/img/component-info.d.ts +1 -1
- package/types/blocks/raw-text/component-info.d.ts +1 -1
- package/types/blocks/section/component-info.d.ts +1 -1
- package/types/blocks/section/section.d.ts +1 -1
- package/types/blocks/slot/component-info.d.ts +1 -1
- package/types/blocks/slot/slot.d.ts +1 -1
- package/types/blocks/symbol/component-info.d.ts +1 -1
- package/types/blocks/symbol/symbol.d.ts +1 -1
- package/types/blocks/symbol/symbol.helpers.d.ts +2 -2
- package/types/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/blocks/text/component-info.d.ts +1 -1
- package/types/blocks/text/text.d.ts +1 -1
- package/types/blocks/textarea/component-info.d.ts +1 -1
- package/types/blocks/video/component-info.d.ts +1 -1
- package/types/blocks/video/video.d.ts +1 -1
- package/types/blocks/video/video.types.d.ts +1 -1
- package/types/components/block/animator.d.ts +1 -1
- package/types/components/block/block.d.ts +2 -2
- package/types/components/block/block.helpers.d.ts +4 -4
- package/types/components/block/components/block-styles.d.ts +2 -2
- package/types/components/block/components/block-wrapper.d.ts +2 -2
- package/types/components/block/components/component-ref/component-ref.d.ts +1 -1
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/types/components/block/components/interactive-element.d.ts +3 -3
- package/types/components/block/components/repeated-block.d.ts +1 -1
- package/types/components/block/types.d.ts +2 -2
- package/types/components/blocks/blocks-wrapper.d.ts +1 -1
- package/types/components/blocks/blocks.d.ts +1 -1
- package/types/components/blocks/blocks.types.d.ts +1 -1
- package/types/components/content/components/enable-editor.d.ts +2 -2
- package/types/components/content/components/styles.d.ts +1 -1
- package/types/components/content/content.d.ts +1 -1
- package/types/components/content/content.helpers.d.ts +3 -3
- package/types/components/content/content.types.d.ts +2 -2
- package/types/components/content/contentProps.types.d.ts +2 -2
- package/types/components/content-variants/content-variants.d.ts +1 -1
- package/types/components/content-variants/content-variants.types.d.ts +4 -4
- package/types/components/content-variants/helpers.d.ts +5 -5
- package/types/constants/builder-registered-components.d.ts +1 -1
- package/types/constants/extra-components.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/index.d.ts +1 -1
- package/types/context/types.d.ts +4 -4
- package/types/functions/evaluate/browser-runtime/browser.d.ts +2 -2
- package/types/functions/evaluate/browser-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/choose-eval.d.ts +1 -1
- package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +1 -1
- package/types/functions/evaluate/edge-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/evaluate.d.ts +1 -1
- package/types/functions/evaluate/helpers.d.ts +3 -3
- package/types/functions/evaluate/index.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/node-runtime.d.ts +1 -1
- package/types/functions/evaluate/placeholder-runtime.d.ts +1 -1
- package/types/functions/fetch-builder-props.d.ts +3 -3
- package/types/functions/get-block-actions-handler.d.ts +2 -2
- package/types/functions/get-block-actions.d.ts +2 -2
- package/types/functions/get-block-component-options.d.ts +1 -1
- package/types/functions/get-block-properties.d.ts +2 -2
- package/types/functions/get-builder-search-params/index.d.ts +1 -1
- package/types/functions/get-content/generate-content-url.d.ts +1 -1
- package/types/functions/get-content/index.d.ts +2 -2
- package/types/functions/get-processed-block.d.ts +2 -2
- package/types/functions/get-style.d.ts +2 -2
- package/types/functions/is-editing.d.ts +1 -1
- package/types/functions/is-previewing.d.ts +1 -1
- package/types/functions/register-component.d.ts +1 -1
- package/types/functions/register.d.ts +2 -2
- package/types/functions/track/index.d.ts +2 -2
- package/types/functions/transform-block-properties.d.ts +2 -2
- package/types/functions/transform-block.d.ts +1 -1
- package/types/functions/transform-style-property.d.ts +2 -2
- package/types/helpers/ab-tests.d.ts +3 -3
- package/types/helpers/cookie.d.ts +1 -1
- package/types/helpers/localStorage.d.ts +2 -2
- package/types/helpers/preview-lru-cache/get.d.ts +1 -1
- package/types/helpers/preview-lru-cache/set.d.ts +1 -1
- package/types/helpers/sessionId.d.ts +1 -1
- package/types/helpers/subscribe-to-editor.d.ts +3 -3
- package/types/helpers/visitorId.d.ts +1 -1
- package/types/index-helpers/blocks-exports.d.ts +11 -11
- package/types/index.d.ts +3 -3
- package/types/server-index.d.ts +27 -27
- package/types/types/builder-content.d.ts +3 -3
- package/types/types/builder-props.d.ts +2 -2
- package/types/types/components.d.ts +2 -2
- package/types/types/enforced-partials.d.ts +1 -1
- package/lib/edge/select-b8ad0a4c.cjs +0 -1
- package/lib/edge/select-f260d051.js +0 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";var N=Object.defineProperty;var $=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var V=(e,t,n)=>($(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("react/jsx-runtime"),serverEntry=require("./server-entry-
|
|
1
|
+
"use client";"use strict";var N=Object.defineProperty;var $=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var V=(e,t,n)=>($(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("react/jsx-runtime"),serverEntry=require("./server-entry-bedf45f8.cjs"),react=require("react"),EMPTY_HTML_ELEMENTS=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),isEmptyElement=e=>typeof e=="string"&&EMPTY_HTML_ELEMENTS.has(e.toLowerCase());function DynamicRenderer(e){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:isEmptyElement(e.TagName)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof e.TagName=="string"?jsxRuntime.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):jsxRuntime.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const getClassPropName=()=>{switch(serverEntry.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function Button(e){return jsxRuntime.jsx(DynamicRenderer,{attributes:{...e.attributes,[getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const builderContext=react.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}}),ComponentsContext=react.createContext({registeredComponents:{}});function getBlockComponentOptions(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const getFunctionArguments=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,runInBrowser=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:a,rootState:r})=>{const s=getFunctionArguments({builder:t,context:n,event:i,state:flattenState({rootState:r,localState:o,rootSetState:a})});return new Function(...s.map(([c])=>c),e)(...s.map(([,c])=>c))};function flattenState({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const a=i[o];return typeof a=="object"&&a!==null?flattenState({rootState:a,localState:void 0,rootSetState:n?r=>{i[o]=r,n(i)}:void 0}):a},set:(i,o,a)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=a,n==null||n(i),!0}})}const set=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,a,r)=>Object(o[a])===o[a]?o[a]:o[a]=Math.abs(Number(i[r+1]))>>0===+i[r+1]?[]:{},e)[i[i.length-1]]=n,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
2
|
var refToProxy = (obj) => {
|
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
|
4
4
|
return obj;
|
|
@@ -92,7 +92,7 @@ output;
|
|
|
92
92
|
left: 0;
|
|
93
93
|
width: 100%;
|
|
94
94
|
height: 100%;
|
|
95
|
-
}`})]})}function SectionComponent(e){return jsxRuntime.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const componentInfo$f={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},componentInfo$e={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(a=>!a.get("width"))||n.reduce((s,c)=>s+c.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},componentInfo$d={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},componentInfo$c={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(r,s=6e4){return new Promise((c,l)=>{const d=document.createElement("img");let m=!1;d.onload=()=>{m=!0,c(d)},d.addEventListener("error",g=>{console.warn("Image load failed",g.error),l(g.error)}),d.src=r,setTimeout(()=>{m||l(new Error("Image load timed out"))},s)})}function i(r){return Math.round(r*1e3)/1e3}const o=e.get("image"),a=e.get("aspectRatio");if(fetch(o).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!a||a===.7041))return n(o).then(r=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},componentInfo$b={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},componentInfo$a={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function Slot(e){var t,n,i;return jsxRuntime.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:jsxRuntime.jsx(Blocks,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const componentInfo$9={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},componentInfo$8={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Text(e){var t;return jsxRuntime.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const componentInfo$7={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function CustomCode(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[o,a]=react.useState(()=>[]);return react.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let c=0;c<r.length;c++){const l=r[c];if(l.src){if(n.includes(l.src))continue;n.push(l.src);const d=document.createElement("script");d.async=!0,d.src=l.src,document.head.appendChild(d)}else if(!l.type||["text/javascript","application/javascript","application/ecmascript"].includes(l.type)){if(o.includes(l.innerText))continue;try{o.push(l.innerText),new Function(l.innerText)()}catch(d){console.warn("`CustomCode`: Error running script:",d)}}}},[]),jsxRuntime.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const componentInfo$6={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},SCRIPT_MIME_TYPES=["text/javascript","application/javascript","application/ecmascript"],isJsScript=e=>SCRIPT_MIME_TYPES.includes(e.type);function Embed(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[o,a]=react.useState(()=>[]),[r,s]=react.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const l=t.current.getElementsByTagName("script");for(let d=0;d<l.length;d++){const m=l[d];if(m.src&&!n.includes(m.src)){n.push(m.src);const g=document.createElement("script");g.async=!0,g.src=m.src,document.head.appendChild(g)}else if(isJsScript(m)&&!o.includes(m.innerText))try{o.push(m.innerText),new Function(m.innerText)()}catch(g){console.warn("`Embed`: Error running script:",g)}}}return react.useEffect(()=>{t.current&&!r&&(s(!0),c())},[t.current,r]),jsxRuntime.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const componentInfo$5={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}]},validEnvList=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],getEnv=()=>{const e=process.env.NODE_ENV||"production";return validEnvList.includes(e)?e:"production"},get=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,a)=>o!=null?o[a]:o,e);return i===void 0||i===e?n:i};function FormComponent(e){var m,g;const t=react.useRef(null),[n,i]=react.useState(()=>"unsubmitted"),[o,a]=react.useState(()=>null),[r,s]=react.useState(()=>"");function c(h){var y,k;const x={...e.builderContext.rootState,...h};e.builderContext.rootSetState?(k=(y=e.builderContext).rootSetState)==null||k.call(y,x):e.builderContext.rootState=x}function l(){return serverEntry.isEditing()&&e.previewState||n}function d(h){var y;const x=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")h.preventDefault();else if(x){if(!(e.action||e.sendSubmissionsTo==="email")){h.preventDefault();return}h.preventDefault();const k=h.currentTarget,I=e.customHeaders||{};let p;const C=new FormData(k),R=Array.from(h.currentTarget.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let f;const v=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return f=u.name,{key:v,value:f}}else if(u.type==="checkbox")f=u.checked;else if(u.type==="number"||u.type==="range"){const b=u.valueAsNumber;isNaN(b)||(f=b)}else u.type==="file"?f=u.files:f=u.value;else f=u.value;return{key:v,value:f}});let E=e.contentType;if(e.sendSubmissionsTo==="email"&&(E="multipart/form-data"),Array.from(R).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(E="multipart/form-data")}),E!=="application/json")p=C;else{const u={};Array.from(R).forEach(({value:f,key:v})=>{set(u,v,f)}),p=JSON.stringify(u)}E&&E!=="multipart/form-data"&&(x&&((y=e.action)!=null&&y.includes("zapier.com"))||(I["content-type"]=E));const P=new CustomEvent("presubmit",{detail:{body:p}});if(t.current&&(t.current.dispatchEvent(P),P.defaultPrevented))return;i("sending");const B=`${getEnv()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?B:e.action,{body:p,headers:I,method:e.method||"post"}).then(async u=>{let f;const v=u.headers.get("content-type");if(v&&v.indexOf("application/json")!==-1?f=await u.json():f=await u.text(),!u.ok&&e.errorMessagePath){let b=get(f,e.errorMessagePath);b&&(typeof b!="string"&&(b=JSON.stringify(b)),s(b),c({formErrorMessage:b}))}if(a(f),i(u.ok?"success":"error"),u.ok){const b=new CustomEvent("submit:success",{detail:{res:u,body:f}});if(t.current){if(t.current.dispatchEvent(b),b.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const S=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(S),S.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const f=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(f),f.defaultPrevented)||(a(u),i("error"))})}}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",jsxRuntime.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:h=>d(h),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(g=(m=e.builderBlock)==null?void 0:m.children)==null?void 0:g.map((h,x)=>jsxRuntime.jsx(Block,{block:h,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${x}`))}):null,l()==="error"?jsxRuntime.jsx(Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,l()==="sending"?jsxRuntime.jsx(Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,l()==="error"&&o?jsxRuntime.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(o,null,2)}):null,l()==="success"?jsxRuntime.jsx(Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",jsxRuntime.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}const componentInfo$4={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function FormInputComponent(e){return react.createElement("input",{...e.attributes,key:serverEntry.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const componentInfo$3={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function SelectComponent(e){var t;return react.createElement("select",{...e.attributes,value:e.value,key:serverEntry.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map(n=>jsxRuntime.jsx("option",{value:n.value,children:n.name||n.value})))}const componentInfo$2={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function SubmitButton(e){return jsxRuntime.jsx("button",{type:"submit",...e.attributes,children:e.text})}const componentInfo$1={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function ImgComponent(e){return jsxRuntime.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},serverEntry.isEditing()&&e.imgSrc||"default-key")}const componentInfo={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function Video(e){var i,o,a,r,s,c,l;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return jsxRuntime.jsxs("div",{style:{position:"relative"},children:[jsxRuntime.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:jsxRuntime.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((a=(o=e.builderBlock)==null?void 0:o.children)!=null&&a.length))?jsxRuntime.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(r=e.builderBlock)==null?void 0:r.children)!=null&&s.length&&e.fitContent?jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(l=(c=e.builderBlock)==null?void 0:c.children)!=null&&l.length&&!e.fitContent?jsxRuntime.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const getExtraComponents=()=>[{component:CustomCode,...componentInfo$7},{component:Embed,...componentInfo$6},{component:FormComponent,...componentInfo$5},{component:FormInputComponent,...componentInfo$4},{component:SubmitButton,...componentInfo$2},{component:SelectComponent,...componentInfo$3},{component:ImgComponent,...componentInfo$1},{component:Video,...componentInfo}],getDefaultRegisteredComponents=()=>[{component:Button,...componentInfo$f},{component:Columns,...componentInfo$e},{component:FragmentComponent,...componentInfo$d},{component:Image,...componentInfo$c},{component:SectionComponent,...componentInfo$b},{component:Slot,...componentInfo$a},{component:Symbol$1,...componentInfo$9},{component:Text,...componentInfo$8},...getExtraComponents()],UPDATE_COOKIES_AND_STYLES_SCRIPT=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
95
|
+
}`})]})}function SectionComponent(e){return jsxRuntime.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}const componentInfo$f={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},componentInfo$e={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(a=>!a.get("width"))||n.reduce((s,c)=>s+c.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},componentInfo$d={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},componentInfo$c={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(r,s=6e4){return new Promise((c,l)=>{const d=document.createElement("img");let m=!1;d.onload=()=>{m=!0,c(d)},d.addEventListener("error",g=>{console.warn("Image load failed",g.error),l(g.error)}),d.src=r,setTimeout(()=>{m||l(new Error("Image load timed out"))},s)})}function i(r){return Math.round(r*1e3)/1e3}const o=e.get("image"),a=e.get("aspectRatio");if(fetch(o).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!a||a===.7041))return n(o).then(r=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},componentInfo$b={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},componentInfo$a={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function Slot(e){var t,n,i;return jsxRuntime.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:jsxRuntime.jsx(Blocks,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const componentInfo$9={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},componentInfo$8={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Text(e){var t;return jsxRuntime.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const componentInfo$7={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]};function CustomCode(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[o,a]=react.useState(()=>[]);return react.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let c=0;c<r.length;c++){const l=r[c];if(l.src){if(n.includes(l.src))continue;n.push(l.src);const d=document.createElement("script");d.async=!0,d.src=l.src,document.head.appendChild(d)}else if(!l.type||["text/javascript","application/javascript","application/ecmascript"].includes(l.type)){if(o.includes(l.innerText))continue;try{o.push(l.innerText),new Function(l.innerText)()}catch(d){console.warn("`CustomCode`: Error running script:",d)}}}},[]),jsxRuntime.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const componentInfo$6={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},SCRIPT_MIME_TYPES=["text/javascript","application/javascript","application/ecmascript"],isJsScript=e=>SCRIPT_MIME_TYPES.includes(e.type);function Embed(e){const t=react.useRef(null),[n,i]=react.useState(()=>[]),[o,a]=react.useState(()=>[]),[r,s]=react.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const l=t.current.getElementsByTagName("script");for(let d=0;d<l.length;d++){const m=l[d];if(m.src&&!n.includes(m.src)){n.push(m.src);const g=document.createElement("script");g.async=!0,g.src=m.src,document.head.appendChild(g)}else if(isJsScript(m)&&!o.includes(m.innerText))try{o.push(m.innerText),new Function(m.innerText)()}catch(g){console.warn("`Embed`: Error running script:",g)}}}return react.useEffect(()=>{t.current&&!r&&(s(!0),c())},[t.current,r]),jsxRuntime.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const componentInfo$5={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}]},validEnvList=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],getEnv=()=>{const e=process.env.NODE_ENV||"production";return validEnvList.includes(e)?e:"production"},get=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,a)=>o!=null?o[a]:o,e);return i===void 0||i===e?n:i};function FormComponent(e){var m,g;const t=react.useRef(null),[n,i]=react.useState(()=>"unsubmitted"),[o,a]=react.useState(()=>null),[r,s]=react.useState(()=>"");function c(h){var y,k;const x={...e.builderContext.rootState,...h};e.builderContext.rootSetState?(k=(y=e.builderContext).rootSetState)==null||k.call(y,x):e.builderContext.rootState=x}function l(){return serverEntry.isEditing()&&e.previewState||n}function d(h){var y;const x=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")h.preventDefault();else if(x){if(!(e.action||e.sendSubmissionsTo==="email")){h.preventDefault();return}h.preventDefault();const k=h.currentTarget,I=e.customHeaders||{};let p;const C=new FormData(k),R=Array.from(h.currentTarget.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let f;const v=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return f=u.name,{key:v,value:f}}else if(u.type==="checkbox")f=u.checked;else if(u.type==="number"||u.type==="range"){const b=u.valueAsNumber;isNaN(b)||(f=b)}else u.type==="file"?f=u.files:f=u.value;else f=u.value;return{key:v,value:f}});let E=e.contentType;if(e.sendSubmissionsTo==="email"&&(E="multipart/form-data"),Array.from(R).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(E="multipart/form-data")}),E!=="application/json")p=C;else{const u={};Array.from(R).forEach(({value:f,key:v})=>{set(u,v,f)}),p=JSON.stringify(u)}E&&E!=="multipart/form-data"&&(x&&((y=e.action)!=null&&y.includes("zapier.com"))||(I["content-type"]=E));const P=new CustomEvent("presubmit",{detail:{body:p}});if(t.current&&(t.current.dispatchEvent(P),P.defaultPrevented))return;i("sending");const B=`${getEnv()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?B:e.action,{body:p,headers:I,method:e.method||"post"}).then(async u=>{let f;const v=u.headers.get("content-type");if(v&&v.indexOf("application/json")!==-1?f=await u.json():f=await u.text(),!u.ok&&e.errorMessagePath){let b=get(f,e.errorMessagePath);b&&(typeof b!="string"&&(b=JSON.stringify(b)),s(b),c({formErrorMessage:b}))}if(a(f),i(u.ok?"success":"error"),u.ok){const b=new CustomEvent("submit:success",{detail:{res:u,body:f}});if(t.current){if(t.current.dispatchEvent(b),b.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const S=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(S),S.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const f=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(f),f.defaultPrevented)||(a(u),i("error"))})}}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",jsxRuntime.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:h=>d(h),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(g=(m=e.builderBlock)==null?void 0:m.children)==null?void 0:g.map((h,x)=>jsxRuntime.jsx(Block,{block:h,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${x}`))}):null,l()==="error"?jsxRuntime.jsx(Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,l()==="sending"?jsxRuntime.jsx(Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,l()==="error"&&o?jsxRuntime.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(o,null,2)}):null,l()==="success"?jsxRuntime.jsx(Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",jsxRuntime.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}const componentInfo$4={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function FormInputComponent(e){return react.createElement("input",{...e.attributes,key:serverEntry.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const componentInfo$3={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function SelectComponent(e){var t;return react.createElement("select",{...e.attributes,value:e.value,key:serverEntry.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(t=e.options)==null?void 0:t.map((n,i)=>jsxRuntime.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const componentInfo$2={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function SubmitButton(e){return jsxRuntime.jsx("button",{type:"submit",...e.attributes,children:e.text})}const componentInfo$1={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function ImgComponent(e){return jsxRuntime.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},serverEntry.isEditing()&&e.imgSrc||"default-key")}const componentInfo={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function Video(e){var i,o,a,r,s,c,l;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return jsxRuntime.jsxs("div",{style:{position:"relative"},children:[jsxRuntime.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:jsxRuntime.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((a=(o=e.builderBlock)==null?void 0:o.children)!=null&&a.length))?jsxRuntime.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(r=e.builderBlock)==null?void 0:r.children)!=null&&s.length&&e.fitContent?jsxRuntime.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(l=(c=e.builderBlock)==null?void 0:c.children)!=null&&l.length&&!e.fitContent?jsxRuntime.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const getExtraComponents=()=>[{component:CustomCode,...componentInfo$7},{component:Embed,...componentInfo$6},{component:FormComponent,...componentInfo$5},{component:FormInputComponent,...componentInfo$4},{component:SubmitButton,...componentInfo$2},{component:SelectComponent,...componentInfo$3},{component:ImgComponent,...componentInfo$1},{component:Video,...componentInfo}],getDefaultRegisteredComponents=()=>[{component:Button,...componentInfo$f},{component:Columns,...componentInfo$e},{component:FragmentComponent,...componentInfo$d},{component:Image,...componentInfo$c},{component:SectionComponent,...componentInfo$b},{component:Slot,...componentInfo$a},{component:Symbol$1,...componentInfo$9},{component:Text,...componentInfo$8},...getExtraComponents()],UPDATE_COOKIES_AND_STYLES_SCRIPT=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
96
96
|
function getAndSetVariantId() {
|
|
97
97
|
function setCookie(name, value, days) {
|
|
98
98
|
let expires = '';
|
|
@@ -3,7 +3,7 @@ var N = Object.defineProperty;
|
|
|
3
3
|
var $ = (e, t, n) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var F = (e, t, n) => ($(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
5
5
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-
|
|
6
|
+
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-8c712c9b.js";
|
|
7
7
|
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
8
8
|
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
|
|
9
9
|
function DynamicRenderer(e) {
|
|
@@ -2481,7 +2481,7 @@ function SelectComponent(e) {
|
|
|
2481
2481
|
defaultValue: e.defaultValue,
|
|
2482
2482
|
name: e.name
|
|
2483
2483
|
},
|
|
2484
|
-
(t = e.options) == null ? void 0 : t.map((n) => /* @__PURE__ */ jsx("option", { value: n.value, children: n.name || n.value }))
|
|
2484
|
+
(t = e.options) == null ? void 0 : t.map((n, i) => /* @__PURE__ */ jsx("option", { value: n.value, children: n.name || n.value }, `${n.name}-${i}`))
|
|
2485
2485
|
);
|
|
2486
2486
|
}
|
|
2487
2487
|
const componentInfo$2 = {
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-bedf45f8.cjs");require("react/jsx-runtime");require("react");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Blocks as i, BuilderContext as s, Button as n, Columns as c, Content as m, Fragment as g, Image as a, Section as d, Symbol as l, Text as p, Video as u } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as B, createRegisterComponentMessage as C, fetchBuilderProps as E, fetchEntries as h, fetchOneEntry as x, getBuilderSearchParams as S, isEditing as b, isPreviewing as P, register as k, setEditorSettings as y, subscribeToEditor as R, track as T } from "./server-entry-
|
|
2
|
+
import { _processContentResult as B, createRegisterComponentMessage as C, fetchBuilderProps as E, fetchEntries as h, fetchOneEntry as x, getBuilderSearchParams as S, isEditing as b, isPreviewing as P, register as k, setEditorSettings as y, subscribeToEditor as R, track as T } from "./server-entry-8c712c9b.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
export {
|
|
@@ -477,7 +477,7 @@ function H(e, t) {
|
|
|
477
477
|
const n = new URL(t.origin), r = n.hostname;
|
|
478
478
|
return (e || je).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
479
479
|
}
|
|
480
|
-
const De = "1.0.
|
|
480
|
+
const De = "1.0.20", T = {};
|
|
481
481
|
function Ke(e, t) {
|
|
482
482
|
let n = T[e];
|
|
483
483
|
if (n || (n = T[e] = []), n.push(t), c()) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";const b="react",I="[Builder.io]: ",d={log:(...e)=>console.log(I,...e),error:(...e)=>console.error(I,...e),warn:(...e)=>console.warn(I,...e),debug:(...e)=>console.debug(I,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const ce=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},M=e=>e instanceof URLSearchParams?ce(e):e,F=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function ue(){return c()&&window.self!==window.top}function k(e){return ue()&&F(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const de=()=>{if(c()){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},le=()=>typeof navigator=="object"&&navigator.userAgent||"",N=()=>{const e=le(),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()||b==="reactNative"}},n=e.match(/Tablet|iPad/i),r=de();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"}},C=e=>JSON.parse(JSON.stringify(e)),p=e=>e!=null,fe=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},D=({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){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},j=async e=>D(e),ge=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),he=[["secure",""],["SameSite","None"]],pe=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?he:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...s,["path","/"],["domain",fe(window.location.hostname)],...o];return ge(a)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=pe({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}},me="builder.tests",P=e=>`${me}.${e}`,ye=({contentId:e})=>j({name:P(e),canTrack:!0}),we=({contentId:e})=>D({name:P(e),canTrack:!0}),Se=({contentId:e,value:t})=>_({name:P(e),value:t,canTrack:!0}),K=e=>p(e.id)&&p(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 a=(o=t[s])==null?void 0:o.testRatio;if(n+=a,r<n)return s}return e},W=e=>{const t=be(e);return Se({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},$=({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":"")}},Ie=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!K(e))return e;const n=we({contentId:e.id})||W({variations:e.variations,id:e.id}),r=$({item:e,testGroupId:n});return{...e,...r}},ve=async({item:e,canTrack:t})=>{if(!t||!K(e))return e;const r=await ye({contentId:e.id})||W({variations:e.variations,id:e.id}),o=$({item:e,testGroupId:r});return{...e,...o}},G=e=>p(e)?e:!0,Ee=e=>({type:"builder.registerComponent",data:z(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):C(e),z=({inputs:e,...t})=>({...C(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((r,[o,s])=>({...r,[o]:Ce(s)}),{}))});function Pe(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Oe(){const e=Pe().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 J=Oe();function v(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],a=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...v(s,a,n)}:{...r,[a]:s}},{})}const Te="v3",R="builder.",xe="options.",O=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(R)){const o=r.replace(R,"").replace(xe,"");n[o]=t[r]}}),n},Ae=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return O(e)},B=e=>typeof e=="number"&&!isNaN(e)&&e>=0,T=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:a,locale:l,apiVersion:y=Te,fields:m,omit:E,offset:u,cacheSeconds:g,staleCacheSeconds:h,sort:w,includeUnpublished:x}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ie=t!==1,i=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(i.searchParams.set("apiKey",s),i.searchParams.set("limit",String(t)),i.searchParams.set("noTraverse",String(ie)),i.searchParams.set("includeRefs",String(!0)),l&&i.searchParams.set("locale",l),a&&i.searchParams.set("enrich",String(a)),i.searchParams.set("omit",E||"meta.componentsUsed"),m&&i.searchParams.set("fields",m),Number.isFinite(u)&&u>-1&&i.searchParams.set("offset",String(Math.floor(u))),typeof x=="boolean"&&i.searchParams.set("includeUnpublished",String(x)),g&&B(g)&&i.searchParams.set("cacheSeconds",String(g)),h&&B(h)&&i.searchParams.set("staleCacheSeconds",String(h)),w){const f=v({sort:w});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}const ae={...Ae(),...M(e.options||{})},A=v(ae);for(const f in A)i.searchParams.set(f,String(A[f]));if(n&&i.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=v({query:r});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}return i},Re=e=>"results"in e;async function H(e){const t=await q({...e,limit:1});return t&&t[0]||null}const Be=async e=>{var s;const t=T(e);return await(await((s=e.fetch)!=null?s:J)(t.href,e.fetchOptions)).json()},X=async(e,t,n=T(e))=>{const r=G(e.canTrack);if(n.search.includes("preview="),!r||!(c()||b==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await ve({item:s,canTrack:r}));t.results=o}catch(o){d.error("Could not process A/B tests. ",o)}return t.results};async function q(e){try{const t=T(e),n=await Be(e);return Re(n)?X(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}function Le(e){if(!c())return!1;const t=F(e||window.location.search);return k(t)?!1:t.indexOf("builder.preview=")!==-1}function Ve(){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 Y(){return Ve().replace(/-/g,"")}const Q="builderSessionId",Ue=async({canTrack:e})=>{if(!e)return;const t=await j({name:Q,canTrack:e});if(p(t))return t;{const n=Me();return Fe({id:n,canTrack:e}),n}},Me=()=>Y(),Fe=({id:e,canTrack:t})=>_({name:Q,value:e,canTrack:t}),Z=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Ne=({key:e,canTrack:t})=>{var n;try{return t?(n=Z())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},De=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Z())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},ee="builderVisitorId",je=({canTrack:e})=>{if(!e)return;const t=Ne({key:ee,canTrack:e});if(p(t))return t;{const n=_e();return Ke({id:n,canTrack:e}),n}},_e=()=>Y(),Ke=({id:e,canTrack:t})=>De({key:ee,value:e,canTrack:t}),We=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ue({canTrack:e}),n=je({canTrack:e});return{sessionId:t,visitorId:n}},$e=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await We({canTrack:t}),userAttributes:N(),ownerId:n}});async function te(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!k()&&(c()||b==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await $e(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Ge=e=>te({...e,canTrack:!0}),ze=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function ne(e,t){const n=new URL(t.origin),r=n.hostname;return(e||ze).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Je="1.0.
|
|
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 J=Oe();function v(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],a=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...v(s,a,n)}:{...r,[a]:s}},{})}const Te="v3",R="builder.",xe="options.",O=e=>{if(!e)return{};const t=M(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(R)){const o=r.replace(R,"").replace(xe,"");n[o]=t[r]}}),n},Ae=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return O(e)},B=e=>typeof e=="number"&&!isNaN(e)&&e>=0,T=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:a,locale:l,apiVersion:y=Te,fields:m,omit:E,offset:u,cacheSeconds:g,staleCacheSeconds:h,sort:w,includeUnpublished:x}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ie=t!==1,i=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(i.searchParams.set("apiKey",s),i.searchParams.set("limit",String(t)),i.searchParams.set("noTraverse",String(ie)),i.searchParams.set("includeRefs",String(!0)),l&&i.searchParams.set("locale",l),a&&i.searchParams.set("enrich",String(a)),i.searchParams.set("omit",E||"meta.componentsUsed"),m&&i.searchParams.set("fields",m),Number.isFinite(u)&&u>-1&&i.searchParams.set("offset",String(Math.floor(u))),typeof x=="boolean"&&i.searchParams.set("includeUnpublished",String(x)),g&&B(g)&&i.searchParams.set("cacheSeconds",String(g)),h&&B(h)&&i.searchParams.set("staleCacheSeconds",String(h)),w){const f=v({sort:w});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}const ae={...Ae(),...M(e.options||{})},A=v(ae);for(const f in A)i.searchParams.set(f,String(A[f]));if(n&&i.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=v({query:r});for(const S in f)i.searchParams.set(S,JSON.stringify(f[S]))}return i},Re=e=>"results"in e;async function H(e){const t=await q({...e,limit:1});return t&&t[0]||null}const Be=async e=>{var s;const t=T(e);return await(await((s=e.fetch)!=null?s:J)(t.href,e.fetchOptions)).json()},X=async(e,t,n=T(e))=>{const r=G(e.canTrack);if(n.search.includes("preview="),!r||!(c()||b==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await ve({item:s,canTrack:r}));t.results=o}catch(o){d.error("Could not process A/B tests. ",o)}return t.results};async function q(e){try{const t=T(e),n=await Be(e);return Re(n)?X(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}function Le(e){if(!c())return!1;const t=F(e||window.location.search);return k(t)?!1:t.indexOf("builder.preview=")!==-1}function Ve(){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 Y(){return Ve().replace(/-/g,"")}const Q="builderSessionId",Ue=async({canTrack:e})=>{if(!e)return;const t=await j({name:Q,canTrack:e});if(p(t))return t;{const n=Me();return Fe({id:n,canTrack:e}),n}},Me=()=>Y(),Fe=({id:e,canTrack:t})=>_({name:Q,value:e,canTrack:t}),Z=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Ne=({key:e,canTrack:t})=>{var n;try{return t?(n=Z())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},De=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Z())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},ee="builderVisitorId",je=({canTrack:e})=>{if(!e)return;const t=Ne({key:ee,canTrack:e});if(p(t))return t;{const n=_e();return Ke({id:n,canTrack:e}),n}},_e=()=>Y(),Ke=({id:e,canTrack:t})=>De({key:ee,value:e,canTrack:t}),We=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ue({canTrack:e}),n=je({canTrack:e});return{sessionId:t,visitorId:n}},$e=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await We({canTrack:t}),userAttributes:N(),ownerId:n}});async function te(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!k()&&(c()||b==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await $e(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Ge=e=>te({...e,canTrack:!0}),ze=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function ne(e,t){const n=new URL(t.origin),r=n.hostname;return(e||ze).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Je="1.0.20",L={};function re(e,t){let n=L[e];if(n||(n=L[e]=[]),n.push(t),c()){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 He=()=>{re("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 V=!1;const oe=(e={})=>{var t,n;V||(V=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:b,version:Je,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,a;if(!ne(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const l=o.data.text,y=o.data.arguments||[],m=o.data.id,E=new Function(l);let u,g=null;try{u=E.apply(null,y)}catch(h){g=h}g?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:m,error:g.message}},"*"):u&&typeof u.then=="function"?u.then(h=>{var w;(w=window.parent)==null||w.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:m}},"*");break}}})))},se=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!ne(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,a=s.key||s.alias||s.entry||s.modelName,l=s.data;a===e&&n.contentUpdate(l);break}}},Xe=(e,t,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};oe();const r=se({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},U={};function qe(e){if(c()){Object.assign(U,e);const t={type:"builder.settingsChange",data:U};parent.postMessage(t,"*")}}const Ye=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:O(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await H(n)}};exports.TARGET=b;exports._processContentResult=X;exports._track=te;exports.checkIsDefined=p;exports.createEditorListener=se;exports.createRegisterComponentMessage=Ee;exports.fastClone=C;exports.fetch=J;exports.fetchBuilderProps=Ye;exports.fetchEntries=q;exports.fetchOneEntry=H;exports.getBuilderSearchParams=O;exports.getDefaultCanTrack=G;exports.getUserAttributes=N;exports.handleABTestingSync=Ie;exports.isBrowser=c;exports.isEditing=k;exports.isPreviewing=Le;exports.logger=d;exports.register=re;exports.registerInsertMenu=He;exports.serializeComponentInfo=z;exports.setEditorSettings=qe;exports.setupBrowserForEditing=oe;exports.subscribeToEditor=Xe;exports.track=Ge;
|
|
@@ -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-bedf45f8.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;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 { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-8c712c9b.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderBlock } from '../../types/builder-block
|
|
2
|
-
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props';
|
|
3
3
|
type Column = {
|
|
4
4
|
blocks: BuilderBlock[];
|
|
5
5
|
width?: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -27,7 +27,7 @@ export type FormProps = BuilderDataProps & BuilderComponentsProp & BuilderLinkCo
|
|
|
27
27
|
* This import is used by the Svelte SDK. Do not remove.
|
|
28
28
|
*/
|
|
29
29
|
export type FormState = "unsubmitted" | "sending" | "success" | "error";
|
|
30
|
-
import type { BuilderBlock } from "../../../types/builder-block
|
|
31
|
-
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from "../../../types/builder-props
|
|
30
|
+
import type { BuilderBlock } from "../../../types/builder-block";
|
|
31
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from "../../../types/builder-props";
|
|
32
32
|
declare function FormComponent(props: FormProps): React.JSX.Element;
|
|
33
33
|
export default FormComponent;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -3,6 +3,6 @@ export type DropzoneProps = BuilderDataProps & {
|
|
|
3
3
|
name: string;
|
|
4
4
|
attributes: any;
|
|
5
5
|
};
|
|
6
|
-
import type { BuilderDataProps } from "../../types/builder-props
|
|
6
|
+
import type { BuilderDataProps } from "../../types/builder-props";
|
|
7
7
|
declare function Slot(props: DropzoneProps): React.JSX.Element;
|
|
8
8
|
export default Slot;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderContextInterface } from '../../context/types
|
|
2
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
1
|
+
import type { BuilderContextInterface } from '../../context/types';
|
|
2
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
3
3
|
export interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BuilderContent } from '../../types/builder-content
|
|
2
|
-
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props
|
|
1
|
+
import type { BuilderContent } from '../../types/builder-content';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props';
|
|
3
3
|
interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ComponentInfo } from '../../types/components
|
|
1
|
+
import type { ComponentInfo } from '../../types/components';
|
|
2
2
|
export declare const componentInfo: ComponentInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BuilderAnimation } from '../../types/builder-block
|
|
1
|
+
import type { BuilderAnimation } from '../../types/builder-block';
|
|
2
2
|
export declare function bindAnimations(animations: BuilderAnimation[]): void;
|
|
3
3
|
export declare function triggerAnimation(animation: BuilderAnimation): void;
|
|
4
4
|
export declare function bindHoverAnimation(animation: BuilderAnimation): void;
|
|
@@ -5,7 +5,7 @@ export type BlockProps = {
|
|
|
5
5
|
registeredComponents: RegisteredComponents;
|
|
6
6
|
linkComponent: any;
|
|
7
7
|
};
|
|
8
|
-
import type { BuilderContextInterface, RegisteredComponents } from "../../context/types
|
|
9
|
-
import type { BuilderBlock } from "../../types/builder-block
|
|
8
|
+
import type { BuilderContextInterface, RegisteredComponents } from "../../context/types";
|
|
9
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
10
10
|
declare function Block(props: BlockProps): React.JSX.Element;
|
|
11
11
|
export default Block;
|