import{t as T,m as F,n as P,N as L,u as h,R as t,F as c,H as _,B as R,D as I,T as E,v,w as N,r as p,d as X}from"./index-DnDa_30t.js";import{R as f,z as S}from"./BlockContainer-CksxSEY6.js";var $=T((n,e)=>F.jsx(P.img,{ref:e,as:L,className:"chakra-image",...n}));function A(n){var u,o,m,g,a,x,b;const{data:e}=n,r=h(),l=(o=(u=e==null?void 0:e.theme[0])==null?void 0:u.colors)==null?void 0:o.text_color,i=(g=(m=e==null?void 0:e.theme[0])==null?void 0:m.colors)==null?void 0:g.background_color,s=r.colors[i];return t.createElement(c,{w:"100%",minH:"450px",backgroundImage:(a=e==null?void 0:e.image)==null?void 0:a.url,bgSize:"cover",bgPos:"center",direction:"column",justify:"center",align:"center"},t.createElement(c,{direction:"column",w:"100%",minH:"inherit",backgroundColor:i?`${s}80`:null,color:r.colors[l]||r.colors.Black,justify:"center",align:"center"},t.createElement(c,{direction:"column",justify:"center",align:"center",gap:"2.5rem"},t.createElement(c,{direction:"column",gap:"1rem",justify:"center",align:"center",px:"16px"},t.createElement(_,{as:"h1",fontWeight:"800",fontSize:"2.5rem",lineHeight:"2.813rem",textAlign:"center",color:r.colors[l]||r.colors.Black},e==null?void 0:e.headline),t.createElement(f,{fontWeight:"500",fontSize:"1.25rem",lineHeight:"1.5rem",data:e==null?void 0:e.rich_text_editor})),((b=(x=e==null?void 0:e.cta_button)==null?void 0:x.button_link)==null?void 0:b.title)&&t.createElement(S,{data:e}))))}function G(n){var i,s,u,o,m,g;const{data:e,newTab:r}=n,l=h();return t.createElement(R,{bgColor:((s=(i=e==null?void 0:e.theme[0])==null?void 0:i.background_color)==null?void 0:s.replace(" ",""))||"White",minH:"597px"},t.createElement(c,{direction:e!=null&&e.img_align_left?{base:"column",lg:"row"}:{base:"column-reverse",lg:"row"},maxW:"1440px",mx:"auto",h:"100%",minH:"inherit",p:{base:"16px",lg:"initial"},gap:{base:"16px",lg:"initial"}},(e==null?void 0:e.image_align_left)&&t.createElement(C,{data:e}),t.createElement(c,{direction:"column",justify:"center",align:"start",color:((u=e==null?void 0:e.theme[0])==null?void 0:u.text_color)||l.colors.Black,w:{base:"100%",lg:"35%"},pl:"2%",gap:"1.5rem",mb:"1%"},t.createElement(_,{color:((o=e==null?void 0:e.theme[0])==null?void 0:o.text_color)||l.colors.Black,as:"h1",fontWeight:"800",fontSize:"40px",lineHeight:"45px",letterSpacing:"-.05rem"},e==null?void 0:e.headline),t.createElement(f,{fontWeight:"500",fontSize:{base:"1rem",lg:"1.25rem"},lineHeight:{base:"1.362rem",lg:"1.5rem"},data:e==null?void 0:e.rich_text_editor,mx:"0",px:"0"}),((g=(m=e==null?void 0:e.cta_button)==null?void 0:m.button_link)==null?void 0:g.title)&&t.createElement(S,{data:e})),!(e!=null&&e.image_align_left)&&t.createElement(C,{data:e})),t.createElement(I,null))}function C(n){var l,i,s;const{data:e}=n,r=h();return t.createElement(c,{direction:{base:"column",md:"row"},w:{base:"100%",lg:"65%"},h:"29rem",gap:{base:"16px",lg:"24px"},my:"auto",color:r.colors.White,justify:"center",px:{base:"16px",lg:"initial"},align:"center"},t.createElement(c,{direction:"column",justify:"end",bgImage:(l=e==null?void 0:e.image)==null?void 0:l.url,alt:e==null?void 0:e.image_alt_text,h:"100%",maxW:"250px",w:"100%",bgPos:"center",bgSize:"cover",borderRadius:"20px",p:"1rem"},t.createElement(_,{as:"h1"},e==null?void 0:e.image_title),t.createElement(E,null,e==null?void 0:e.image_text)),t.createElement(v,{below:"md"},t.createElement(c,{direction:"column",justify:"end",bgImage:(i=e==null?void 0:e.image_2)==null?void 0:i.url,alt:e==null?void 0:e.image_2_alt_text,h:"100%",maxW:"250px",w:"100%",bgPos:"center",bgSize:"cover",borderRadius:"20px",p:"1rem"},t.createElement(_,null,e==null?void 0:e.image_2_title),t.createElement(E,null,e==null?void 0:e.image_2_text))),t.createElement(v,{below:"md"},t.createElement(c,{direction:"column",justify:"end",bgImage:(s=e==null?void 0:e.image_3)==null?void 0:s.url,alt:e==null?void 0:e.image_3_alt_text,h:"100%",maxW:"250px",w:"100%",bgPos:"center",bgSize:"cover",borderRadius:"20px",p:"1rem"},t.createElement(_,null,e==null?void 0:e.image_3_title),t.createElement(E,null,e==null?void 0:e.image_3_text))))}function D(){const n=h(),[e,r]=N([`(min-width: ${n.breakpoints.md})`,`(min-width: ${n.breakpoints.lg})`]);return{isMedScreen:e,isLargeScreen:r}}function Q(n){var a,x,b,B,w,y;const{data:e}=n,r=h(),{isLargeScreen:l,isMedScreen:i}=D(),s=((x=(a=e==null?void 0:e.theme[0])==null?void 0:a.colors)==null?void 0:x.text_color)||"Black",u=((B=(b=e==null?void 0:e.theme[0])==null?void 0:b.colors)==null?void 0:B.background_color)||"White",o=e==null?void 0:e.image_align_left,m=p.useMemo(()=>{var k,W,H,j,z,M;return l?(k=e==null?void 0:e.image)==null?void 0:k.url:i?((W=e==null?void 0:e.tablet_image)==null?void 0:W.url)||((H=e==null?void 0:e.image)==null?void 0:H.url):((j=e==null?void 0:e.mobile_image)==null?void 0:j.url)||((z=e==null?void 0:e.tablet_image)==null?void 0:z.url)||((M=e==null?void 0:e.image)==null?void 0:M.url)},[l,i,e]),g=p.useMemo(()=>l?e==null?void 0:e.image_alt_text:i?(e==null?void 0:e.tablet_image_alt)||(e==null?void 0:e.image_alt_text):(e==null?void 0:e.mobile_image_alt)||(e==null?void 0:e.tablet_image_alt)||(e==null?void 0:e.image_alt_text),[l,i,e]);return t.createElement(R,{bgColor:r.colors[u],width:"100%"},t.createElement(c,{flexDirection:o?{base:"column",md:"row"}:{base:"column",md:"row-reverse"},maxW:"1440px",marginX:"auto",paddingX:"40px",justifyContent:"space-between",gap:"40px"},t.createElement(c,{maxHeight:"597px",maxWidth:{base:"100%",md:"65%"}},t.createElement($,{src:m,alt:g,objectFit:"contain",w:"100%"})),t.createElement(c,{direction:"column",justify:"center",align:"start",color:r.colors[s],gap:"24px"},t.createElement(_,{as:"h1",fontWeight:"800",fontSize:{base:"1.5rem",md:"2rem",lg:"2.5rem"},lineHeight:{base:"1.8rem",md:"2.813rem"},color:r.colors[s],marginTop:"32px"},e==null?void 0:e.headline),t.createElement(f,{fontWeight:"500",fontSize:{base:"1rem",lg:"1.25rem"},lineHeight:{base:"1.362rem",lg:"1.5rem"},data:e==null?void 0:e.rich_text_editor,mx:"0",px:"0"}),((y=(w=e==null?void 0:e.cta_button)==null?void 0:w.button_link)==null?void 0:y.title)&&t.createElement(c,{marginBottom:"24px"},t.createElement(S,{btnMarginX:"0",data:e})))),t.createElement(I,null))}function q(n){const{data:e}=n;return t.createElement(t.Fragment,null,(e==null?void 0:e.image_style)==="Background"?t.createElement(A,n):(e==null?void 0:e.image_style)==="Multiple"?t.createElement(G,n):t.createElement(Q,n))}function O(n){const{refData:e}=n,[r,l]=p.useState([]),i=Math.floor(Math.random()*r.length);p.useEffect(()=>{s()},[]);async function s(){var m;const o=await X.getSpecificEntryWithRef(e==null?void 0:e._content_type_uid,e==null?void 0:e.uid,"home_banner.theme");(m=o==null?void 0:o.entry)!=null&&m.home_banner&&u(o.entry.home_banner)}function u(o){o.map(m=>{var g;(g=m.publish_details)!=null&&g.time&&l(a=>[...a,m])})}return t.createElement(t.Fragment,null,t.createElement(q,{data:r[i]}))}export{O as B};