import{d as Y,c as Z,e as ee,g as m,f as w,i as a,b as H,h as y,r as R,t as $,a as b,s as N,j as T}from"./web.4OCuPnM3.js";import{C as q}from"./CaretDown.ClI4lLwN.js";var te=$('<div><div class="min-h-[12rem] relative flex"><div class="flex overflow-hidden justify-center items-center w-full"></div><div class="absolute inset-y-0 left-0 w-14 flex items-center justify-center z-10"><button type=button class="transition-all duration-700 backdrop-blur-sm rounded-full"></button></div><div class="absolute inset-y-0 right-0 w-14 flex items-center justify-center z-10"><button type=button class="transition-all duration-700 backdrop-blur-sm rounded-full"></button></div></div><div class="flex self-center justify-center backdrop-blur-sm w-full absolute bottom-0 p-3"> <div class="flex gap-2">'),le=$("<div><!$><!/><!$><!/>"),re=$('<span class="absolute top-0 right-3 px-2 py-1 font-thin opacity-70"><!$><!/>/<!$><!/>'),oe=$("<img>"),ne=$("<button type=button>"),se=$('<small class="text-[.5rem] text-invert self-center"><!$><!/> ');const ce=({indicator:u={style:"circle",color:"gray"},items:S,active:B=0,fraction:F,className:G,autoplay:I,timing:J})=>{const[i,K]=Z(B??0),C=S.length,P=v=>K(v),E=()=>P(i()<C-1?i()+1:0),L=()=>P(i()>0?i()-1:C-1);return ee(()=>{const v=J??1e4;I&&setTimeout(E,v)},[i()]),(()=>{var v=m(te),z=v.firstChild,M=z.firstChild,A=M.nextSibling,g=A.firstChild,O=A.nextSibling,x=O.firstChild,Q=z.nextSibling,U=Q.firstChild,V=U.nextSibling;return w(v,`flex flex-col relative ${G} gap-6`),a(M,()=>S.map((o,l)=>(()=>{var e=m(le),c=e.firstChild,[t,f]=b(c.nextSibling),_=t.nextSibling,[j,d]=b(_.nextSibling);return N(e,"data-item",l),a(e,F&&(()=>{var r=m(re),n=r.firstChild,[s,h]=b(n.nextSibling),p=s.nextSibling,k=p.nextSibling,[W,X]=b(k.nextSibling);return a(r,l+1,s,h),a(r,C,W,X),y(D=>(D=u.color??"black")!=null?r.style.setProperty("color",D):r.style.removeProperty("color")),r})(),t,f),a(e,(()=>{var r=T(()=>!!o.image);return()=>r()&&(()=>{var n=m(oe);return y(s=>{var h=o.image,p=o.heading,k=`max-h-[75vh] h-full w-auto transition-all duration-700  ${i()===l?"object-contain":""}`;return h!==s.e&&N(n,"src",s.e=h),p!==s.t&&N(n,"alt",s.t=p),k!==s.a&&w(n,s.a=k),s},{e:void 0,t:void 0,a:void 0}),n})()})(),j,d),y(()=>w(e,`transition-all duration-700  flex justify-center ${i()===l?"z-2 self-center grow":"-z-50 opacity-0 shrink w-0"}`)),e})())),g.$$click=()=>L(),a(g,H(q,{className:"w-8 h-8 rotate-90"})),x.$$click=()=>E(),a(x,H(q,{className:"w-8 h-8 -rotate-90"})),a(V,()=>S.map((o,l)=>(()=>{var e=m(ne);return e.$$click=()=>P(l),a(e,(()=>{var c=T(()=>u.style==="number");return()=>c()&&(()=>{var t=m(se),f=t.firstChild,[_,j]=b(f.nextSibling);return _.nextSibling,a(t,l+1,_,j),y(d=>{var r=u.color??"black",n=i()===l?"700":"normal";return r!==d.e&&((d.e=r)!=null?t.style.setProperty("color",r):t.style.removeProperty("color")),n!==d.t&&((d.t=n)!=null?t.style.setProperty("font-weight",n):t.style.removeProperty("font-weight")),d},{e:void 0,t:void 0}),t})()})()),y(c=>{var t=u.color??"black",f=`transition-all duration-700 relative flex items-center justify-center ${i()===l?"scale-150":"opacity-75"} ${u.style==="circle"?" rounded-full h-3 w-3":u.style==="rect"?" h-1 w-4":" h-2 px-[.35rem] py-[.3rem] rounded-xl"}`;return t!==c.e&&((c.e=t)!=null?e.style.setProperty("background",t):e.style.removeProperty("background")),f!==c.t&&w(e,c.t=f),c},{e:void 0,t:void 0}),R(),e})())),y(o=>{var l=u.color??"black",e=u.color??"black";return l!==o.e&&((o.e=l)!=null?g.style.setProperty("color",l):g.style.removeProperty("color")),e!==o.t&&((o.t=e)!=null?x.style.setProperty("color",e):x.style.removeProperty("color")),o},{e:void 0,t:void 0}),R(),v})()};Y(["click"]);export{ce as Carousel};
