import{_ as I}from"./CUZc3WDI.js";import{a as z,_ as F}from"./CJl6yHPT.js";import{_ as A,a as D}from"./CioX7pik.js";import{d as E,k as N,s as G,r as u,a as s,b as h,f as d,u as r,F as v,A as k,e as b,o,L as O,j as H}from"./m2W8DxR4.js";import{u as K}from"./ByNB5mo6.js";import"./ByXNX2C_.js";import"./CTby_rp-.js";import"./DT-hKSom.js";import"./C8p6Bfm2.js";import"./0eED25Of.js";import"./D4cd7EFQ.js";const M={class:"relative"},U={key:0,class:"container mx-auto flex items-center justify-center"},W={key:1,class:"min-h-[430.78px]"},q=["dir"],J=["dir"],Q={key:2,class:"mt-6 flex items-center justify-center gap-6"},X=["aria-label"],Y={key:0,class:"custom-pagination-container"},Z=["onClick"],ee=["aria-label"],te=E({__name:"HorizontalCarouselWithControls",props:{testimonials:{}},setup(C){const y=C,{locale:S}=N(),c=G(()=>S.value==="ar"?"rtl":"ltr"),_=u(null),g=u(0),$=u(0),a=u(null),p=u({}),f=u(0),w=e=>{const n=String(e);p.value[n]=(p.value[n]||0)+1},P=e=>{var n,l;a.value!==null&&a.value!==e&&w(a.value),a.value=e,(l=(n=i.instance.value)==null?void 0:n.autoplay)==null||l.stop()},B=e=>{var n,l;a.value===e&&(a.value=null),(l=(n=i.instance.value)==null?void 0:n.autoplay)==null||l.start()},x=y.testimonials?y.testimonials.length:0,i=K(_,{slidesPerView:3,spaceBetween:20,autoplay:{delay:2e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},keyboard:{enabled:!0},loop:x>3,grabCursor:!0,on:{slideChange:e=>{var n;g.value=e.realIndex,$.value++,a.value!==null&&Date.now()>f.value&&(w(a.value),a.value=null,(n=e.autoplay)==null||n.start())},beforeResize:()=>{f.value=Date.now()+600},resize:()=>{f.value=Date.now()+600}},breakpoints:{320:{slidesPerView:1,spaceBetween:10},720:{slidesPerView:2,spaceBetween:15},1024:{slidesPerView:3,spaceBetween:20}}}),R=e=>{i.instance.value&&i.instance.value.slideToLoop(e)};return(e,n)=>{const l=I,V=z,j=F,L=A,T=D;return o(),s("div",M,[e.testimonials&&e.testimonials.length===0?(o(),s("div",U,[d(l)])):(o(),s("div",W,[e.testimonials?(o(),s("swiper-container",{ref_key:"swiperRef",ref:_,key:"testimonials-"+r(c),dir:r(c),init:!1},[(o(!0),s(v,null,k(e.testimonials,t=>(o(),s("swiper-slide",{key:t.id},[d(V,{id:t.id,"full-name":t.full_name,"job-position":t.job_position,image:t.image,"audio-url":t.audio_url,"video-url":t.video_url,comment:t.comment,"video-reset-token":r(p)[String(t.id)]||0,"audio-reset-token":r(p)[String(t.id)]||0,onPlay:m=>P(t.id),onPause:m=>B(t.id)},null,8,["id","full-name","job-position","image","audio-url","video-url","comment","video-reset-token","audio-reset-token","onPlay","onPause"])]))),128))],8,q)):(o(),s("swiper-container",{ref_key:"swiperRef",ref:_,key:"skeleton-"+r(c),dir:r(c),init:!1},[(o(),s(v,null,k(6,t=>b("swiper-slide",{key:t},[d(j,{id:t,class:"w-full"},null,8,["id"])])),64))],8,J))])),e.testimonials&&e.testimonials.length>0?(o(),s("div",Q,[b("button",{class:"prev-button-latest-models bg-surface-background border-surface-border rounded-ws-rounded flex-shrink-0 cursor-pointer border p-3","aria-label":e.$t("ariaLabels.prevBtn"),onClick:n[0]||(n[0]=t=>r(i).prev())},[d(L,{class:"rtl:scale-x-[-1]"})],8,X),e.testimonials?(o(),s("div",Y,[(o(!0),s(v,null,k(e.testimonials,(t,m)=>(o(),s("div",{key:`pagination-${t.id}`,class:O(["pagination-dot",{active:r(g)===m}]),onClick:ne=>R(m)},null,10,Z))),128))])):h("",!0),b("button",{"aria-label":e.$t("ariaLabels.nextBtn"),class:"next-button-latest-models bg-surface-background border-surface-border rounded-ws-rounded flex-shrink-0 cursor-pointer border p-3",onClick:n[1]||(n[1]=t=>r(i).next())},[d(T,{class:"rtl:scale-x-[-1]"})],8,ee)])):h("",!0)])}}}),_e=H(te,[["__scopeId","data-v-e9fc413a"]]);export{_e as default};
