import{d as H,k as K,s as M,r as h,h as U,R as I,a as f,e as a,b as V,c as v,u as i,z as x,f as l,w as s,D as z,X as O,o as n,v as X,t as y,F as N,A as Y,K as q,L as S,j as G}from"./m2W8DxR4.js";import{u as J,_ as Q,a as W,b as Z,c as ee,d as te,e as se}from"./CbxdrCRW.js";import{C as oe,a as ae}from"./_K6KS46d.js";import"./DT-hKSom.js";import"./CYT-4scj.js";const le={class:"hero -mt-header relative grid min-h-[500px] w-full items-center"},ne={class:"absolute inset-0 overflow-hidden"},re=["poster"],ie=["src"],ce={class:"relative z-[2] container mx-auto grid place-items-center px-4 py-[40px] lg:pt-[80px]"},ue={class:"mb-[60px]"},de={class:"title dark-text-gradient mb-6 max-w-[800px] text-center text-2xl leading-10 font-semibold text-pretty md:text-4xl md:leading-14 2xl:text-5xl 2xl:leading-16"},me={class:"button flex min-h-[48px] items-center justify-center"},pe=H({__name:"InternalHeaderSection",props:{pages:{},videoUrl:{},image:{}},setup(E){const{locale:T,t:j}=K(),R=M(()=>T.value==="ar"?"rtl":"ltr"),o=h(),b=h(!0),u=h(!0),c=E;J(c.pages),U(()=>{if(c.videoUrl&&o.value){const e=new IntersectionObserver(t=>{t.forEach(p=>{var d,m;b.value=p.isIntersecting,p.isIntersecting&&u.value?(d=o.value)==null||d.play():(m=o.value)==null||m.pause()})},{threshold:.1});e.observe(o.value),I(()=>{e.disconnect()})}});let g;const w=()=>{o.value&&(u.value=!1,o.value.pause(),clearTimeout(g),g=setTimeout(()=>{var e;u.value=!0,b.value&&((e=o.value)==null||e.play())},150))};return U(()=>{c.videoUrl&&(window.addEventListener("scroll",w,{passive:!0}),I(()=>{window.removeEventListener("scroll",w),clearTimeout(g)}))}),(e,t)=>{var B,L,$,C;const p=O,d=X,m=ee,k=Z,D=te,A=se,F=W,P=Q;return n(),f("section",le,[a("div",ne,[c.videoUrl?(n(),f("video",{key:0,ref_key:"videoRef",ref:o,autoplay:"",muted:"",loop:"",playsinline:"",preload:"metadata",class:"absolute inset-0 h-full w-full object-cover will-change-auto",poster:(B=c.image)==null?void 0:B.Url,style:{filter:"contrast(1.05) brightness(0.95)"},onLoadstart:()=>{},onError:t[0]||(t[0]=()=>{u.value=!1}),onCanplay:t[1]||(t[1]=()=>{var r;i(b)&&i(u)&&((r=i(o))==null||r.play())})},[a("source",{src:c.videoUrl,type:"video/mp4"},null,8,ie),t[2]||(t[2]=x(" Your browser does not support the video tag. ",-1))],40,re)):V("",!0),(L=e.image)!=null&&L.Url?(n(),v(p,{key:1,src:($=e.image)==null?void 0:$.Url,class:"absolute inset-0 block h-full w-full object-cover",alt:(C=e.image)==null?void 0:C.Alt,width:"1920",height:"500",sizes:"100vw"},null,8,["src","alt"])):V("",!0),t[3]||(t[3]=a("div",{class:"bg-hero-bg absolute inset-0 z-[1]"},null,-1))]),a("div",ce,[a("div",ue,[l(P,null,{default:s(()=>[l(F,{class:"text-primary flex items-center gap-1"},{default:s(()=>[l(k,null,{default:s(()=>[l(m,{"as-child":""},{default:s(()=>[l(d,{to:"/"},{default:s(()=>[x(y(i(j)("home")),1)]),_:1})]),_:1})]),_:1}),(n(!0),f(N,null,Y(e.pages,(r,_)=>(n(),f(N,{key:_},[l(D,null,{default:s(()=>[(n(),v(q(i(R)==="ltr"?i(oe):i(ae)),{size:20}))]),_:1}),l(k,null,{default:s(()=>[r.link&&_!==e.pages.length-1?(n(),v(m,{key:0,"as-child":""},{default:s(()=>[l(d,{to:r.link},{default:s(()=>[x(y(r.name),1)]),_:2},1032,["to"])]),_:2},1024)):(n(),v(A,{key:1,class:S(_===e.pages.length-1?"text-accent font-semibold":"")},{default:s(()=>[a("span",{class:S(_===e.pages.length-1?"xs:inline xs:w-auto block max-w-[130px] truncate":"")},y(r.name),3)]),_:2},1032,["class"]))]),_:2},1024)],64))),128))]),_:1})]),_:1})]),a("div",de,[z(e.$slots,"title",{},void 0,!0)]),a("div",me,[z(e.$slots,"button",{},void 0,!0)])])])}}}),he=G(pe,[["__scopeId","data-v-b29e29f7"]]);export{he as default};
