@builder.io/sdk-react-nextjs 0.14.6 → 0.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +8 -2
  2. package/lib/browser/USE_CLIENT_BUNDLE-2046b4f7.cjs +21 -0
  3. package/lib/browser/{USE_CLIENT_BUNDLE-dbef551d.js → USE_CLIENT_BUNDLE-78517750.js} +143 -136
  4. package/lib/{edge/USE_SERVER_BUNDLE-abb6c4ae.js → browser/USE_SERVER_BUNDLE-29f23050.js} +1 -1
  5. package/lib/{edge/USE_SERVER_BUNDLE-2000e927.cjs → browser/USE_SERVER_BUNDLE-d3d0c3a5.cjs} +1 -1
  6. package/lib/browser/{bundle-b2b7ab8b.js → bundle-d78727c9.js} +630 -591
  7. package/lib/browser/bundle-eca4b0ba.cjs +169 -0
  8. package/lib/browser/index.cjs +1 -1
  9. package/lib/browser/index.mjs +3 -3
  10. package/lib/{node/USE_CLIENT_BUNDLE-22e26b2f.js → edge/USE_CLIENT_BUNDLE-01cf3cc1.js} +143 -136
  11. package/lib/edge/USE_CLIENT_BUNDLE-23418377.cjs +21 -0
  12. package/lib/{node/USE_SERVER_BUNDLE-90b6e155.js → edge/USE_SERVER_BUNDLE-2cb317bc.js} +1 -1
  13. package/lib/{node/USE_SERVER_BUNDLE-5a67cb67.cjs → edge/USE_SERVER_BUNDLE-7cb08770.cjs} +1 -1
  14. package/lib/edge/{bundle-f4b34118.cjs → bundle-07c68bbe.cjs} +39 -38
  15. package/lib/edge/{bundle-9950e3ec.js → bundle-7da386a2.js} +1316 -1277
  16. package/lib/edge/index.cjs +1 -1
  17. package/lib/edge/index.mjs +3 -3
  18. package/lib/{edge/USE_CLIENT_BUNDLE-471a7309.js → node/USE_CLIENT_BUNDLE-690f58c3.js} +143 -136
  19. package/lib/node/USE_CLIENT_BUNDLE-f9317c5f.cjs +21 -0
  20. package/lib/{browser/USE_SERVER_BUNDLE-a6a333bd.js → node/USE_SERVER_BUNDLE-649f2942.js} +1 -1
  21. package/lib/{browser/USE_SERVER_BUNDLE-545db2f7.cjs → node/USE_SERVER_BUNDLE-e8d80664.cjs} +1 -1
  22. package/lib/node/{bundle-a8519a3b.js → bundle-001f0cdc.js} +272 -233
  23. package/lib/node/{bundle-9f34ab83.cjs → bundle-77f045ce.cjs} +16 -15
  24. package/lib/node/index.cjs +1 -1
  25. package/lib/node/index.mjs +3 -3
  26. package/package.json +1 -1
  27. package/types/cjs/components/block/block.helpers.d.ts +4 -0
  28. package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
  29. package/types/cjs/components/content/components/styles.d.ts +1 -0
  30. package/types/cjs/components/content/components/styles.helpers.d.ts +1 -0
  31. package/types/cjs/components/content/contentProps.types.d.ts +6 -1
  32. package/types/cjs/components/content-variants/content-variants.d.ts +1 -1
  33. package/types/cjs/constants/sdk-version.d.ts +1 -1
  34. package/types/cjs/functions/evaluate/evaluate.d.ts +3 -1
  35. package/types/cjs/functions/evaluate/helpers.d.ts +1 -0
  36. package/types/esm/components/block/block.helpers.d.ts +4 -0
  37. package/types/esm/components/content/components/enable-editor.d.ts +1 -1
  38. package/types/esm/components/content/components/styles.d.ts +1 -0
  39. package/types/esm/components/content/components/styles.helpers.d.ts +1 -0
  40. package/types/esm/components/content/contentProps.types.d.ts +6 -1
  41. package/types/esm/components/content-variants/content-variants.d.ts +1 -1
  42. package/types/esm/constants/sdk-version.d.ts +1 -1
  43. package/types/esm/functions/evaluate/evaluate.d.ts +3 -1
  44. package/types/esm/functions/evaluate/helpers.d.ts +1 -0
  45. package/lib/browser/USE_CLIENT_BUNDLE-e0428aec.cjs +0 -21
  46. package/lib/browser/bundle-0de8b96d.cjs +0 -168
  47. package/lib/edge/USE_CLIENT_BUNDLE-1ce5de06.cjs +0 -21
  48. package/lib/node/USE_CLIENT_BUNDLE-07b10dcb.cjs +0 -21
@@ -1,21 +0,0 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-0de8b96d.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-545db2f7.cjs"),V=require("next/navigation");function C(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}function H(e){return t.jsx(C,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.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})}function U(e){return t.jsx(C,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function $(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function l(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:l()+" props-blocks-wrapper-7354e098","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>x(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7354e098 {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
5
- }`})]})}function J(e){return t.jsx("span",{children:e.children})}function G(e){var o,m,b,v;function l(){var f;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(s)}else if(e.image&&!e.srcset)return a.getSrcSet(s);return a.getSrcSet(s)}function g(){var h;return(h=l==null?void 0:l())!=null&&h.match(/builder\.io/)&&!e.noWebp?l().replace(/\?/g,"?format=webp&"):""}function x(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...x()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0614da04",src:e.image,srcSet:l(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-0614da04",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(b=e.builderBlock)==null?void 0:b.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-0614da04-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-0614da04 {
6
- opacity: 1;
7
- transition: opacity 0.2s ease-in-out;
8
- }.div-0614da04 {
9
- width: 100%;
10
- pointer-events: none;
11
- font-size: 0;
12
- }.div-0614da04-2 {
13
- display: flex;
14
- flex-direction: column;
15
- align-items: stretch;
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 100%;
20
- height: 100%;
21
- }`})]})}function Q(e){return t.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})}function X(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=l.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const b=l.current.getElementsByTagName("script");for(let h=0;h<b.length;h++){const s=b[h];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:l,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]),[b,v]=r.useState(()=>!1);function h(){if(!l.current||!l.current.getElementsByTagName)return;const s=l.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!o.includes(k.innerText))try{o.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{l.current&&!b&&(v(!0),h())},[l.current,b]),t.jsx("div",{className:"builder-embed",ref:l,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var x,o,m,b,v,h,s;function l(){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 g(){return{...l()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(b=e.builderBlock)==null?void 0:b.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(s=(h=e.builderBlock)==null?void 0:h.children)!=null&&s.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.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 ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,F,L,W;const l=r.useRef(null),[g,x]=r.useState(()=>0);r.useState(()=>!0);function o(i){var c,d;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,n):e.builderContextSignal.rootState=n}function m(i){var c,d,u,S,A;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(S=e.builderContextSignal.content)==null?void 0:S.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:n,key:n.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[b,v]=r.useState(()=>!1),[h,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:d}=n;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),x(g+1))},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{m(n),x(g+1)}}})(i)}function k(){var n,c;const i=(c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,ne]=r.useState(()=>({})),[j,K]=r.useState(()=>!1);function q(i){var n,c;if(e.builderContextSignal.content){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!j})}j||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,S;const d={...e.builderContextSignal.rootState,[n]:c};(S=(u=e.builderContextSignal).rootSetState)==null||S.call(u,d),y[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function w(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const S=_(u);z({url:S,key:d})}})}function E(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){x(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(n=>{var d;const c=a.createRegisterComponentMessage(n);(d=window.parent)==null||d.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function I(i){const n=new URL(location.href).searchParams,c=n.get("builder.preview"),d=n.get(`builder.preview.${c}`),u=n.get("apiKey")||n.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(S=>{S&&m(S)})}const M=V.useRouter();return r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initeditingbldr",R),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var i,n;if(a.isBrowser()){if(a.isEditing()&&l.current&&l.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(n=e.builderContextSignal.content)==null?void 0:n.id,S=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:S,variationId:d!==u?d:void 0})}a.isPreviewing()}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),w(),E()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[b]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{w()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{E()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&o(e.data)},[e.data]),r.useEffect(()=>{e.locale&&o({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(h,{key:g,ref:l,onClick:i=>q(i),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=C;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;
@@ -1,168 +0,0 @@
1
- "use strict";const c=require("react/jsx-runtime");require("react");const Me=require("lru-cache"),v=require("./USE_CLIENT_BUNDLE-e0428aec.cjs");require("next/navigation");const He=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ke=e=>typeof e=="string"&&He.has(e.toLowerCase()),E="rsc",F=()=>{switch(E){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function ze(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const P="[Builder.io]: ",k={log:(...e)=>console.log(P,...e),error:(...e)=>console.error(P,...e),warn:(...e)=>console.warn(P,...e),debug:(...e)=>console.debug(P,...e)};function x(){return typeof window<"u"&&typeof document<"u"}const qe=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},ce=e=>e instanceof URLSearchParams?qe(e):e,le=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function Je(){return x()&&window.self!==window.top}function W(e){return Je()&&le(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const Ye=()=>{if(x()){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},Ge=()=>typeof navigator=="object"&&navigator.userAgent||"",de=()=>{const e=Ge(),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()||E==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Ye();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},Qe=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),Xe=()=>({isEditing:W(),isBrowser:x(),isServer:!x(),getUserAttributes:()=>de()}),Ze=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,J=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=Qe({builder:t,context:n,event:o,state:ue({rootState:a,localState:i,rootSetState:r})});return new Function(...s.map(([l])=>l),e)(...s.map(([,l])=>l))};function ue({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,i)=>{if(t&&i in t)return t[i];const r=o[i];return typeof r=="object"?ue({rootState:r,localState:void 0,rootSetState:n?a=>{o[i]=a,n(o)}:void 0}):r},set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[i]=r,n==null||n(o),!0}})}const w=e=>e!=null;function et(){var e;return typeof process<"u"&&w((e=process==null?void 0:process.versions)==null?void 0:e.node)}const tt=()=>{var o;if(!et())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(k.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},nt=e=>(x()||tt(),J(e));function O({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const s={code:Ze(e,{isExpression:a}),builder:Xe(),context:t,event:r,rootSetState:i,rootState:o,localState:n};try{return nt(s)}catch(l){k.error("Failed code evaluation: "+l.message,{code:e});return}}const R=e=>JSON.parse(JSON.stringify(e)),ot=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const it=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=R(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const l=e.bindings[s],m=O({code:l,localState:n,rootState:o,rootSetState:i,context:t});ot(a,s,m)}return a};function V({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?it({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const rt=({block:e,context:t,registeredComponents:n})=>{var r;const o=(r=V({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!o)return null;const i=n[o];if(i)return i;console.warn(`
2
- Could not find a registered component named "${o}".
3
- If you registered it, is the file that registered it imported by the file that needs to render it?`)},at=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=O({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((l,m)=>({context:{...t,localState:{...t.localState,$index:m,$item:l,[a]:l,[`$${a}Index`]:m}},block:o}))},me={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},Y=(e,t=me)=>`@media (max-width: ${t[e].max}px)`,fe=({small:e,medium:t})=>{const n=R(me);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const i=n.small.max+1;n.medium={max:t,min:i,default:i+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n},st=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${st(n)}: ${o};`}).filter(w),ct=e=>he(e).join(`
4
- `),_=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
5
- ${ct(n)}
6
- }`;return e?`${e} {
7
- ${o}
8
- }`:o};function $(e){return c.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function lt(e){const t=function(){const i=V({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return w(i.hide)?!i.hide:w(i.show)?i.show:!0},n=function(){var d;const i=V({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=i.responsiveStyles,a=e.context.content,s=fe(((d=a==null?void 0:a.meta)==null?void 0:d.breakpoints)||{}),l=r==null?void 0:r.large,m=r==null?void 0:r.medium,b=r==null?void 0:r.small,g=i.id;if(!g)return"";const f=l?_({className:g,styles:l}):"",h=m?_({className:g,styles:m,mediaQuery:Y("medium",s)}):"",u=b?_({className:g,styles:b,mediaQuery:Y("small",s)}):"";return[f,h,u].join(" ")};return c.jsx(c.Fragment,{children:n()&&t()?c.jsx(c.Fragment,{children:c.jsx($,{styles:n()})}):null})}function dt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ut=e=>`on${dt(e)}`,mt=(e,t)=>n=>O({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function ft(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=ut(o);if(e.stripPrefix)switch(E){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=mt(i,e)}return t}function ht({style:e}){return e}const pt=({block:e,context:t})=>pe(ht({style:e.style||{},context:t,block:e}));function pe(e){switch(E){case"svelte":case"vue":case"solid":return he(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}function gt({properties:e}){return e}const bt=e=>({href:e.href});function ge({block:e,context:t}){var o;const n={...bt(e),...e.properties,"builder-id":e.id,style:pt({block:e,context:t}),[F()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return gt({properties:n,context:t,block:e})}const yt=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:i,isInteractive:r,contextValue:a})=>{const s={...e,...i?{attributes:ge({block:t,context:a})}:{}};return r?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:i}:s};function G(e){var n;const t=e.isInteractive?v.InteractiveElement:e.componentRef;return c.jsx(c.Fragment,{children:e.componentRef?c.jsx(c.Fragment,{children:c.jsx(t,{...yt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(o=>c.jsx(N,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function xt(e){const t=e.repeatContext;return c.jsx(N,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function N(e){var m,b,g;const t=function(){return rt({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return at({block:e.block,context:e.context})},o=function(){var h;return(h=e.block.repeat)!=null&&h.collection?e.block:V({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},i=function(){var u;return e.block.tagName==="a"||((u=o().properties)==null?void 0:u.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},r=function(){var d,y;if((d=e.block.repeat)!=null&&d.collection)return!!((y=n())!=null&&y.length);const h="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!h},a=function(){var u;return!((u=t())!=null&&u.component)&&!n()?o().children??[]:[]},s=function(){var h,u,d,y,p,C,T,S,I,U;return{blockChildren:o().children??[],componentRef:(h=t())==null?void 0:h.component,componentOptions:{...ze(o()),builderContext:e.context,...((u=t())==null?void 0:u.name)==="Core:Button"||((d=t())==null?void 0:d.name)==="Symbol"||((y=t())==null?void 0:y.name)==="Columns"||((p=t())==null?void 0:p.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((C=t())==null?void 0:C.name)==="Symbol"||((T=t())==null?void 0:T.name)==="Columns"||((S=t())==null?void 0:S.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:l,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((I=t())==null?void 0:I.noWrap)===!0,isInteractive:!((U=t())!=null&&U.isRSC)}},l=e.context;return c.jsx(c.Fragment,{children:r()?c.jsxs(c.Fragment,{children:[c.jsx(lt,{block:e.block,context:e.context}),(m=t())!=null&&m.noWrap?c.jsx(c.Fragment,{children:c.jsx(G,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):c.jsx(c.Fragment,{children:n()?c.jsx(c.Fragment,{children:(g=n())==null?void 0:g.map((f,h)=>c.jsx(xt,{repeatContext:f.context,block:f.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},h))}):c.jsx(c.Fragment,{children:c.jsxs(v.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[c.jsx(G,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(b=a())==null?void 0:b.map(f=>c.jsx(N,{block:f,context:l,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},f.id))]})})})]}):null})}function L(e){var t,n,o;return c.jsx(v.BlocksWrapper,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?c.jsx(c.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>c.jsx(N,{block:i,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},i.id))}):null})}function be(e){var h;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",i=function(d){var y;return((y=n[d])==null?void 0:y.width)||100/n.length},r=function(d){const y=t*(n.length-1)/n.length;return`calc(${i(d)}% - ${y}px)`},a=function({stackedStyle:d,desktopStyle:y}){return o==="tablet"?d:y},s=function({stackedStyle:d,desktopStyle:y}){return o==="never"?y:d},l=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",m=function(){return{"--flex-dir":l,"--flex-dir-tablet":a({stackedStyle:l,desktopStyle:"row"})}},b=function(d){const y=d===0?0:t,p=r(d),C=`${y}px`,T="100%",S=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:p,["marginLeft"]:C,"--column-width-mobile":s({stackedStyle:T,desktopStyle:p}),"--column-margin-left-mobile":s({stackedStyle:S,desktopStyle:C}),"--column-width-tablet":a({stackedStyle:T,desktopStyle:p}),"--column-margin-left-tablet":a({stackedStyle:S,desktopStyle:C})}},g=function(d){var p,C;return fe(((C=(p=e.builderContext.content)==null?void 0:p.meta)==null?void 0:C.breakpoints)||{})[d].max},f=function(){return`
9
- @media (max-width: ${g("medium")}px) {
10
- .${e.builderBlock.id}-breakpoints {
11
- flex-direction: var(--flex-dir-tablet);
12
- align-items: stretch;
13
- }
14
-
15
- .${e.builderBlock.id}-breakpoints > .builder-column {
16
- width: var(--column-width-tablet) !important;
17
- margin-left: var(--column-margin-left-tablet) !important;
18
- }
19
- }
20
-
21
- @media (max-width: ${g("small")}px) {
22
- .${e.builderBlock.id}-breakpoints {
23
- flex-direction: var(--flex-dir);
24
- align-items: stretch;
25
- }
26
-
27
- .${e.builderBlock.id}-breakpoints > .builder-column {
28
- width: var(--column-width-mobile) !important;
29
- margin-left: var(--column-margin-left-mobile) !important;
30
- }
31
- },
32
- `};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-1f78b21c`,style:m(),children:[c.jsx(c.Fragment,{children:c.jsx($,{styles:f()})}),(h=e.columns)==null?void 0:h.map((u,d)=>c.jsx(v.DynamicRenderer,{TagName:u.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...u.link?{href:u.link}:{},[F()]:"builder-column",style:pe(b(d))},children:c.jsx(L,{path:`component.options.columns.${d}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:u.blocks})},d))]}),c.jsx("style",{children:`.div-1f78b21c {
33
- display: flex;
34
- line-height: normal;
35
- }`})]})}function Q(e){return e.replace(/http(s)?:/,"")}function St(e="",t,n){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+i+t+"="+encodeURIComponent(n)}function kt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Q(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=e.split(n[0]),i=n[3],r=t.match("x")?t:`${t}x`;return Q(`${o[0]}_${r}${i}`)}return null}function vt(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const o=Number(e.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),t.filter(i=>i!==o).map(i=>`${St(e,"width",i)} ${i}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[kt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([e]).join(", "):e}const Ct=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},ye=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){k.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},xe=async e=>ye(e),wt=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(w).join("; "),It=[["secure",""],["SameSite","None"]],Et=({name:e,value:t,expires:n})=>{const i=(x()?location.protocol==="https:":!0)?It:[[]],r=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...r,["path","/"],["domain",Ct(window.location.hostname)],...i];return wt(a)},Se=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const i=Et({name:e,value:t,expires:n});document.cookie=i}catch(i){k.warn("[COOKIE] SET error: ",(i==null?void 0:i.message)||i)}},Tt="builder.tests",H=e=>`${Tt}.${e}`,Rt=({contentId:e})=>xe({name:H(e),canTrack:!0}),Pt=({contentId:e})=>ye({name:H(e),canTrack:!0}),At=({contentId:e,value:t})=>Se({name:H(e),value:t,canTrack:!0}),ke=e=>w(e.id)&&w(e.variations)&&Object.keys(e.variations).length>0,Bt=({id:e,variations:t})=>{var i;let n=0;const o=Math.random();for(const r in t){const a=(i=t[r])==null?void 0:i.testRatio;if(n+=a,o<n)return r}return e},ve=e=>{const t=Bt(e);return At({contentId:e.id,value:t}).catch(n=>{k.error("could not store A/B test variation: ",n)}),t},Ce=({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":"")}},Vt=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!ke(e))return e;const n=Pt({contentId:e.id})||ve({variations:e.variations,id:e.id}),o=Ce({item:e,testGroupId:n});return{...e,...o}},jt=async({item:e,canTrack:t})=>{if(!t||!ke(e))return e;const o=await Rt({contentId:e.id})||ve({variations:e.variations,id:e.id}),i=Ce({item:e,testGroupId:o});return{...e,...i}},j=e=>w(e)?e:!0,Ft={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},Wt={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(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(i=>i.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((s,l)=>s+l.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}]},Ot={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},$t={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(a,s=6e4){return new Promise((l,m)=>{const b=document.createElement("img");let g=!1;b.onload=()=>{g=!0,l(b)},b.addEventListener("error",f=>{console.warn("Image load failed",f.error),m(f.error)}),b.src=a,setTimeout(()=>{g||m(new Error("Image load timed out"))},s)})}function o(a){return Math.round(a*1e3)/1e3}const i=e.get("image"),r=e.get("aspectRatio");if(fetch(i).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),i&&(!r||r===.7041))return n(i).then(a=>{const s=e.get("aspectRatio");e.get("image")===i&&(!s||s===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(a.height/a.width)),e.set("height",a.height),e.set("width",a.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}]},Nt={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>"}}}]},Lt={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 Ut(e){var t,n,o;return c.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:c.jsx(L,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(o=e.builderContext.rootState)==null?void 0:o[e.name]})})}const _t={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"}]},Dt={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 we(e){var t;return c.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Mt={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}]},Ht={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(o=>o.json()).then(o=>{e.get("url")===t&&(o.html?e.set("content",o.html):e.set("content","Invalid url, please try another"))}).catch(o=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Kt=["text/javascript","application/javascript","application/ecmascript"],zt=e=>Kt.includes(e.type),qt={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},Jt={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}]},Yt=()=>[{component:v.CustomCode,...Mt},{component:v.Embed,...Ht},{component:v.ImgComponent,...qt},{component:v.Video,...Jt}],X=()=>[{component:v.Button,...Ft},{component:be,...Wt},{component:v.FragmentComponent,...Ot},{component:v.Image,...$t},{component:v.SectionComponent,...Nt},{component:Ut,...Lt},{component:De,..._t},{component:we,...Dt},...Yt()],Gt=e=>({type:"builder.registerComponent",data:D(e)}),Qt=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},Xt=e=>typeof e=="function"?Qt(e):R(e),D=({inputs:e,...t})=>({...R(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((o,[i,r])=>({...o,[i]:Xt(r)}),{}))}),Zt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
36
- function getAndSetVariantId() {
37
- function setCookie(name, value, days) {
38
- let expires = '';
39
- if (days) {
40
- const date = new Date();
41
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
42
- expires = '; expires=' + date.toUTCString();
43
- }
44
- document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
45
- }
46
- function getCookie(name) {
47
- const nameEQ = name + '=';
48
- const ca = document.cookie.split(';');
49
- for (let i = 0; i < ca.length; i++) {
50
- let c = ca[i];
51
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
52
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
53
- }
54
- return null;
55
- }
56
- const cookieName = \`builder.tests.\${contentId}\`;
57
- const variantInCookie = getCookie(cookieName);
58
- const availableIDs = variants.map(vr => vr.id).concat(contentId);
59
- if (variantInCookie && availableIDs.includes(variantInCookie)) {
60
- return variantInCookie;
61
- }
62
- let n = 0;
63
- const random = Math.random();
64
- for (let i = 0; i < variants.length; i++) {
65
- const variant = variants[i];
66
- const testRatio = variant.testRatio;
67
- n += testRatio;
68
- if (random < n) {
69
- setCookie(cookieName, variant.id);
70
- return variant.id;
71
- }
72
- }
73
- setCookie(cookieName, contentId);
74
- return contentId;
75
- }
76
- const winningVariantId = getAndSetVariantId();
77
- const styleEl = document.currentScript?.previousElementSibling;
78
- if (isHydrationTarget) {
79
- styleEl.remove();
80
- const thisScriptEl = document.currentScript;
81
- thisScriptEl?.remove();
82
- } else {
83
- const newStyleStr = variants.concat({
84
- id: contentId
85
- }).filter(variant => variant.id !== winningVariantId).map(value => {
86
- return \`.variant-\${value.id} { display: none; }
87
- \`;
88
- }).join('');
89
- styleEl.innerHTML = newStyleStr;
90
- }
91
- }`,en=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
92
- if (!navigator.cookieEnabled) {
93
- return;
94
- }
95
- function getCookie(name) {
96
- const nameEQ = name + '=';
97
- const ca = document.cookie.split(';');
98
- for (let i = 0; i < ca.length; i++) {
99
- let c = ca[i];
100
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
101
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
102
- }
103
- return null;
104
- }
105
- const cookieName = \`builder.tests.\${defaultContentId}\`;
106
- const winningVariant = getCookie(cookieName);
107
- const parentDiv = document.currentScript?.parentElement;
108
- const isDefaultContent = variantContentId === defaultContentId;
109
- const isWinningVariant = winningVariant === variantContentId;
110
- if (isWinningVariant && !isDefaultContent) {
111
- parentDiv?.removeAttribute('hidden');
112
- parentDiv?.removeAttribute('aria-hidden');
113
- } else if (!isWinningVariant && isDefaultContent) {
114
- parentDiv?.setAttribute('hidden', 'true');
115
- parentDiv?.setAttribute('aria-hidden', 'true');
116
- }
117
- if (isHydrationTarget) {
118
- if (!isWinningVariant) {
119
- parentDiv?.remove();
120
- }
121
- const thisScriptEl = document.currentScript;
122
- thisScriptEl?.remove();
123
- }
124
- return;
125
- }`,Ie="builderIoAbTest",Ee="builderIoRenderContent",A=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),tn=({canTrack:e,content:t})=>!(!(A(t).length>0)||!e||x()),nn=e=>e==="react"||e==="reactNative",Te=nn(E),on=()=>`
126
- window.${Ie} = ${Zt}
127
- window.${Ee} = ${en}
128
- `,rn=(e,t)=>`
129
- window.${Ie}(
130
- "${t}",${JSON.stringify(e)}, ${Te}
131
- )`,an=({contentId:e,variationId:t})=>`window.${Ee}(
132
- "${t}", "${e}", ${Te}
133
- )`;function M(e){return c.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const sn=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function Re(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Me.LRUCache({max:500,ttl:1e3*60*5}))}function cn(e){Re();const t=sn(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function ln(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function dn(){const e=ln().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
134
- 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 Pe=dn();function B(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...B(r,a,n)}:{...o,[a]:r}},{})}const un="v3",Z="builder.",mn="options.",K=e=>{if(!e)return{};const t=ce(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(Z)){const i=o.replace(Z,"").replace(mn,"");n[i]=t[o]}}),n},fn=()=>{if(!x())return{};const e=new URLSearchParams(window.location.search);return K(e)},ee=e=>typeof e=="number"&&!isNaN(e)&&e>=0,z=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:l=un,fields:m,omit:b,offset:g,cacheSeconds:f,staleCacheSeconds:h,sort:u,includeUnpublished:d}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const y=t!==1,p=new URL(`https://cdn.builder.io/api/${l}/content/${i}`);if(p.searchParams.set("apiKey",r),p.searchParams.set("limit",String(t)),p.searchParams.set("noTraverse",String(y)),p.searchParams.set("includeRefs",String(!0)),s&&p.searchParams.set("locale",s),a&&p.searchParams.set("enrich",String(a)),p.searchParams.set("omit",b||"meta.componentsUsed"),m&&p.searchParams.set("fields",m),Number.isFinite(g)&&g>-1&&p.searchParams.set("offset",String(Math.floor(g))),typeof d=="boolean"&&p.searchParams.set("includeUnpublished",String(d)),f&&ee(f)&&p.searchParams.set("cacheSeconds",String(f)),h&&ee(h)&&p.searchParams.set("staleCacheSeconds",String(h)),u){const S=B({sort:u});for(const I in S)p.searchParams.set(I,JSON.stringify(S[I]))}const C={...fn(),...ce(e.options||{})},T=B(C);for(const S in T)p.searchParams.set(S,String(T[S]));if(n&&p.searchParams.set("userAttributes",JSON.stringify(n)),o){const S=B({query:o});for(const I in S)p.searchParams.set(I,JSON.stringify(S[I]))}return p},hn=e=>"results"in e;async function q(e){const t=await Be({...e,limit:1});return t&&t[0]||null}const pn=async e=>{const t=z(e);return await(await Pe(t.href)).json()},Ae=async(e,t,n=z(e))=>{const o=j(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=cn(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(x()||E==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await jt({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function Be(e){try{const t=z(e),n=await pn(e);return hn(n)?Ae(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}function gn(e){if(!x())return!1;const t=le(e||window.location.search);return W(t)?!1:t.indexOf("builder.preview=")!==-1}function bn(){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 Ve(){return bn().replace(/-/g,"")}const je="builderSessionId",yn=async({canTrack:e})=>{if(!e)return;const t=await xe({name:je,canTrack:e});if(w(t))return t;{const n=xn();return Sn({id:n,canTrack:e}),n}},xn=()=>Ve(),Sn=({id:e,canTrack:t})=>Se({name:je,value:e,canTrack:t}),Fe=()=>x()&&typeof localStorage<"u"?localStorage:void 0,kn=({key:e,canTrack:t})=>{var n;try{return t?(n=Fe())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},vn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Fe())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},We="builderVisitorId",Cn=({canTrack:e})=>{if(!e)return;const t=kn({key:We,canTrack:e});if(w(t))return t;{const n=wn();return In({id:n,canTrack:e}),n}},wn=()=>Ve(),In=({id:e,canTrack:t})=>vn({key:We,value:e,canTrack:t}),En=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await yn({canTrack:e}),n=Cn({canTrack:e});return{sessionId:t,visitorId:n}},Tn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await En({canTrack:t}),userAttributes:de(),ownerId:n}});async function Oe(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!W()&&(x()||E==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Tn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Rn=e=>Oe({...e,canTrack:!0});function te(e){return Math.round(e*1e3)/1e3}const Pn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},An=e=>Pn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ne=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=te(o/n.width),a=te(i/n.height);return{x:r,y:a}},Bn=e=>{const t=e.target,n=t&&An(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ne({event:e,target:t}):void 0,builderTargetOffset:n?ne({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Vn=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function $e(e,t){const n=new URL(t.origin),o=n.hostname;return(e||Vn).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const jn="0.14.6",oe={};function Ne(e,t){let n=oe[e];if(n||(n=oe[e]=[]),n.push(t),x()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const Fn=()=>{Ne("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 ie=!1;const Le=(e={})=>{var t,n;ie||(ie=!0,x()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:E,version:jn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!$e(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,l=i.data.arguments||[],m=i.data.id,b=new Function(s);let g,f=null;try{g=b.apply(null,l)}catch(h){f=h}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:m,error:f.message}},"*"):g&&typeof g.then=="function"?g.then(h=>{var u;(u=window.parent)==null||u.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:g,id:m}},"*");break}}})))},Ue=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!$e(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},Wn=(e,t,n)=>{if(!x)return k.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};Le();const o=Ue({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function re(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}const On=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function $n(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Nn(e,t){const n=Ln(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const l of n)l in s||(s[l]=o[l])}function Ln(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function Un(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){$n(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Nn(e,n),n.style.transition="none",n.style.transitionDelay="0",re(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${On(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),re(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const _n=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
135
- @font-face {
136
- font-family: "${t}";
137
- src: local("${n}"), url('${o}') format('woff2');
138
- font-display: fallback;
139
- font-weight: 400;
140
- }
141
- `.trim()),e.files)for(const a in e.files){if(!(String(Number(a))===a))continue;const l=e.files[a];l&&l!==o&&(i+=`
142
- @font-face {
143
- font-family: "${t}";
144
- src: url('${l}') format('woff2');
145
- font-display: fallback;
146
- font-weight: ${a};
147
- }
148
- `.trim())}return i},Dn=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>_n(n)))==null?void 0:t.join(" "))||""},Mn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"";function Hn(e){const t=`
149
- ${Mn({cssCode:e.cssCode,contentId:e.contentId})}
150
- ${Dn({customFonts:e.customFonts})}
151
-
152
- .builder-button {
153
- all: unset;
154
- }
155
-
156
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
157
- margin: 0;
158
- }
159
- .builder-text > p, .builder-text > .builder-paragraph {
160
- color: inherit;
161
- line-height: inherit;
162
- letter-spacing: inherit;
163
- font-weight: inherit;
164
- font-size: inherit;
165
- text-align: inherit;
166
- font-family: inherit;
167
- }
168
- `.trim();return c.jsx($,{styles:t})}const Kn=({content:e,data:t,locale:n})=>{var r,a,s;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},zn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ae(e){var i,r,a,s,l,m,b,g,f;const t=an({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...X(),...e.customComponents||[]].reduce((h,{component:u,...d})=>({...h,[d.name]:{component:u,...D(d)}}),{}),o={content:zn({content:e.content,data:e.data}),localState:void 0,rootState:Kn({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...X(),...e.customComponents||[]].reduce((h,{component:u,...d})=>({...h,[d.name]:D(d)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return c.jsxs(v.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?c.jsx(c.Fragment,{children:c.jsx(M,{scriptStr:t})}):null,c.jsx(c.Fragment,{children:c.jsx(Hn,{contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(s=o.content)==null?void 0:s.data)==null?void 0:l.cssCode,customFonts:(b=(m=o.content)==null?void 0:m.data)==null?void 0:b.customFonts})}),c.jsx(L,{blocks:(f=(g=o.content)==null?void 0:g.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function _e(e){var r,a;const t=tn({canTrack:j(e.canTrack),content:e.content}),n=function(){var l;return rn(A(e.content).map(m=>({id:m.testVariationId,testRatio:m.testRatio})),((l=e.content)==null?void 0:l.id)||"")},o=function(){return A(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")},i=function(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:Vt({item:e.content,canTrack:j(e.canTrack)})};return c.jsxs(c.Fragment,{children:[!e.__isNestedRender&&E!=="reactNative"?c.jsx(c.Fragment,{children:c.jsx(M,{scriptStr:on()})}):null,t?c.jsxs(c.Fragment,{children:[c.jsx($,{id:`variants-styles-${(r=e.content)==null?void 0:r.id}`,styles:o()}),c.jsx(M,{scriptStr:n()}),(a=A(e.content))==null?void 0:a.map(s=>c.jsx(ae,{content:s,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},s.testVariationId))]}):null,c.jsx(ae,{content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const qn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return q({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{k.error("Could not fetch symbol content: ",n)})};async function De(e){var o,i,r,a,s;const t=function(){var m,b;return[e.attributes[F()],"builder-symbol",(m=e.symbol)!=null&&m.inline?"builder-inline-symbol":void 0,(b=e.symbol)!=null&&b.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await qn({symbol:e.symbol,builderContextValue:e.builderContext});return c.jsx("div",{...e.attributes,className:t(),children:c.jsx(_e,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(i=e.builderBlock)==null?void 0:i.id},customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(s=e.symbol)==null?void 0:s.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}const se={};function Jn(e){if(x()){Object.assign(se,e);const t={type:"builder.settingsChange",data:se};parent.postMessage(t,"*")}}const Yn=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:K(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await q(n)}};exports.Blocks=L;exports.Columns=be;exports.ContentVariants=_e;exports.Symbol=De;exports.Text=we;exports._processContentResult=Ae;exports._track=Oe;exports.createEditorListener=Ue;exports.createRegisterComponentMessage=Gt;exports.evaluate=O;exports.fastClone=R;exports.fetch=Pe;exports.fetchBuilderProps=Yn;exports.fetchEntries=Be;exports.fetchOneEntry=q;exports.getBlockActions=ft;exports.getBlockProperties=ge;exports.getBuilderSearchParams=K;exports.getClassPropName=F;exports.getDefaultCanTrack=j;exports.getInteractionPropertiesForEvent=Bn;exports.getSrcSet=vt;exports.init=Re;exports.isBrowser=x;exports.isEditing=W;exports.isEmptyElement=Ke;exports.isJsScript=zt;exports.isPreviewing=gn;exports.logger=k;exports.register=Ne;exports.registerInsertMenu=Fn;exports.setEditorSettings=Jn;exports.setupBrowserForEditing=Le;exports.subscribeToEditor=Wn;exports.track=Rn;exports.triggerAnimation=Un;
@@ -1,21 +0,0 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-f4b34118.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-2000e927.cjs"),V=require("next/navigation");function C(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}function H(e){return t.jsx(C,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.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})}function U(e){return t.jsx(C,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function $(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function l(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:l()+" props-blocks-wrapper-7354e098","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>x(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7354e098 {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
5
- }`})]})}function J(e){return t.jsx("span",{children:e.children})}function G(e){var o,m,b,v;function l(){var f;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(s)}else if(e.image&&!e.srcset)return a.getSrcSet(s);return a.getSrcSet(s)}function g(){var h;return(h=l==null?void 0:l())!=null&&h.match(/builder\.io/)&&!e.noWebp?l().replace(/\?/g,"?format=webp&"):""}function x(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...x()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0614da04",src:e.image,srcSet:l(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-0614da04",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(b=e.builderBlock)==null?void 0:b.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-0614da04-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-0614da04 {
6
- opacity: 1;
7
- transition: opacity 0.2s ease-in-out;
8
- }.div-0614da04 {
9
- width: 100%;
10
- pointer-events: none;
11
- font-size: 0;
12
- }.div-0614da04-2 {
13
- display: flex;
14
- flex-direction: column;
15
- align-items: stretch;
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 100%;
20
- height: 100%;
21
- }`})]})}function Q(e){return t.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})}function X(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=l.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const b=l.current.getElementsByTagName("script");for(let h=0;h<b.length;h++){const s=b[h];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:l,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]),[b,v]=r.useState(()=>!1);function h(){if(!l.current||!l.current.getElementsByTagName)return;const s=l.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!o.includes(k.innerText))try{o.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{l.current&&!b&&(v(!0),h())},[l.current,b]),t.jsx("div",{className:"builder-embed",ref:l,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var x,o,m,b,v,h,s;function l(){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 g(){return{...l()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(b=e.builderBlock)==null?void 0:b.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(s=(h=e.builderBlock)==null?void 0:h.children)!=null&&s.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.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 ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,F,L,W;const l=r.useRef(null),[g,x]=r.useState(()=>0);r.useState(()=>!0);function o(i){var c,d;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,n):e.builderContextSignal.rootState=n}function m(i){var c,d,u,S,A;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(S=e.builderContextSignal.content)==null?void 0:S.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:n,key:n.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[b,v]=r.useState(()=>!1),[h,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:d}=n;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),x(g+1))},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{m(n),x(g+1)}}})(i)}function k(){var n,c;const i=(c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,ne]=r.useState(()=>({})),[j,K]=r.useState(()=>!1);function q(i){var n,c;if(e.builderContextSignal.content){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!j})}j||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,S;const d={...e.builderContextSignal.rootState,[n]:c};(S=(u=e.builderContextSignal).rootSetState)==null||S.call(u,d),y[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function w(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const S=_(u);z({url:S,key:d})}})}function E(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){x(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(n=>{var d;const c=a.createRegisterComponentMessage(n);(d=window.parent)==null||d.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function I(i){const n=new URL(location.href).searchParams,c=n.get("builder.preview"),d=n.get(`builder.preview.${c}`),u=n.get("apiKey")||n.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(S=>{S&&m(S)})}const M=V.useRouter();return r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initeditingbldr",R),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var i,n;if(a.isBrowser()){if(a.isEditing()&&l.current&&l.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(n=e.builderContextSignal.content)==null?void 0:n.id,S=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:S,variationId:d!==u?d:void 0})}a.isPreviewing()}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),w(),E()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[b]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{w()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{E()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&o(e.data)},[e.data]),r.useEffect(()=>{e.locale&&o({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(h,{key:g,ref:l,onClick:i=>q(i),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=C;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;
@@ -1,21 +0,0 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-9f34ab83.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-5a67cb67.cjs"),V=require("next/navigation");function C(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}function H(e){return t.jsx(C,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.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})}function U(e){return t.jsx(C,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function $(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function l(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:l()+" props-blocks-wrapper-7354e098","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>x(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7354e098 {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
5
- }`})]})}function J(e){return t.jsx("span",{children:e.children})}function G(e){var o,m,b,v;function l(){var f;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(s)}else if(e.image&&!e.srcset)return a.getSrcSet(s);return a.getSrcSet(s)}function g(){var h;return(h=l==null?void 0:l())!=null&&h.match(/builder\.io/)&&!e.noWebp?l().replace(/\?/g,"?format=webp&"):""}function x(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...x()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0614da04",src:e.image,srcSet:l(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-0614da04",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(b=e.builderBlock)==null?void 0:b.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-0614da04-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-0614da04 {
6
- opacity: 1;
7
- transition: opacity 0.2s ease-in-out;
8
- }.div-0614da04 {
9
- width: 100%;
10
- pointer-events: none;
11
- font-size: 0;
12
- }.div-0614da04-2 {
13
- display: flex;
14
- flex-direction: column;
15
- align-items: stretch;
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 100%;
20
- height: 100%;
21
- }`})]})}function Q(e){return t.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})}function X(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=l.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const b=l.current.getElementsByTagName("script");for(let h=0;h<b.length;h++){const s=b[h];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:l,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]),[b,v]=r.useState(()=>!1);function h(){if(!l.current||!l.current.getElementsByTagName)return;const s=l.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!o.includes(k.innerText))try{o.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{l.current&&!b&&(v(!0),h())},[l.current,b]),t.jsx("div",{className:"builder-embed",ref:l,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var x,o,m,b,v,h,s;function l(){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 g(){return{...l()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(b=e.builderBlock)==null?void 0:b.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children})}):null,(s=(h=e.builderBlock)==null?void 0:h.children)!=null&&s.length&&!e.fitContent?t.jsx(t.Fragment,{children:t.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 ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,F,L,W;const l=r.useRef(null),[g,x]=r.useState(()=>0);r.useState(()=>!0);function o(i){var c,d;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,n):e.builderContextSignal.rootState=n}function m(i){var c,d,u,S,A;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(S=e.builderContextSignal.content)==null?void 0:S.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:n,key:n.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[b,v]=r.useState(()=>!1),[h,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:d}=n;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),x(g+1))},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{m(n),x(g+1)}}})(i)}function k(){var n,c;const i=(c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,ne]=r.useState(()=>({})),[j,K]=r.useState(()=>!1);function q(i){var n,c;if(e.builderContextSignal.content){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!j})}j||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,S;const d={...e.builderContextSignal.rootState,[n]:c};(S=(u=e.builderContextSignal).rootSetState)==null||S.call(u,d),y[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function w(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const S=_(u);z({url:S,key:d})}})}function E(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){x(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(n=>{var d;const c=a.createRegisterComponentMessage(n);(d=window.parent)==null||d.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function I(i){const n=new URL(location.href).searchParams,c=n.get("builder.preview"),d=n.get(`builder.preview.${c}`),u=n.get("apiKey")||n.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(S=>{S&&m(S)})}const M=V.useRouter();return r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initeditingbldr",R),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var i,n;if(a.isBrowser()){if(a.isEditing()&&l.current&&l.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(n=e.builderContextSignal.content)==null?void 0:n.id,S=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:S,variationId:d!==u?d:void 0})}a.isPreviewing()}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),w(),E()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[b]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{w()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{E()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&o(e.data)},[e.data]),r.useEffect(()=>{e.locale&&o({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(h,{key:g,ref:l,onClick:i=>q(i),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=C;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;