import{r as t,h as i,a as r,g as s}from"./p-d52b3602.js";import{c as e}from"./p-c608c6dc.js";import{s as o}from"./p-c5a89792.js";const a=class{constructor(i){t(this,i),this.vertical=!1,this.slidesArray=[],this.value=0,this.handleSlideChange=t=>{const i=this.value;"prev"===t&&(this.value=0===i?-100*(this.slidesArray.length-1):i+100),"next"===t&&(this.value=i===-100*(this.slidesArray.length-1)?0:i-100)},this.setActiveSlide=t=>{this.value=-100*t},this.setTransformValue=()=>this.vertical?`translateY(${this.value}%)`:`translateX(${this.value}%)`,this.setActiveCssClass=t=>Math.abs(this.value)/100===t?"carousel__indicator--active":""}connectedCallback(){o({source:this.hostElement,type:"warn"})}componentWillLoad(){if(0===this.slidesArray.length){const t=this.hostElement.children;for(let i=0;i<t.length;i++)if(""===t[i].slot)for(let r=0;r<t[i].children.length;r++)this.slidesArray.push(t[i].children[r])}}render(){return i(r,null,this.styles&&i("style",null,this.styles),i("div",{class:this.getCssClassMap()},i("div",{class:"carousel__container"},i("div",{class:"carousel__arrow carousel__arrow--left",onClick:()=>this.handleSlideChange("prev")},i("slot",{name:"arrow-left"})),this.slidesArray.map((t=>i("div",{class:"carousel__slide",style:{transform:this.setTransformValue()}},i("div",{innerHTML:t.outerHTML})))),i("div",{class:"carousel__arrow carousel__arrow--right",onClick:()=>this.handleSlideChange("next")},i("slot",{name:"arrow-right"}))),i("ul",{class:"carousel__indicators"},Array.from(Array(this.slidesArray.length).keys()).map((t=>i("li",{key:t,class:`carousel__indicator ${this.setActiveCssClass(t)}`,onClick:()=>this.setActiveSlide(t)}))))))}getCssClassMap(){return e("carousel",this.vertical&&"carousel--vertical")}get hostElement(){return s(this)}};a.style=".carousel{width:400px;height:300px;position:relative}.carousel__container{width:100%;height:100%;margin:0;display:flex;padding:0;overflow:hidden;position:relative;box-sizing:border-box;align-items:center}.carousel__slide{height:100%;position:relative;min-width:100%;transition:all 0.3s ease-in-out}.carousel__arrow{top:50%;color:#fff;width:24px;border:none;cursor:pointer;height:24px;display:flex;outline:none;z-index:99;position:absolute;transform:translateY(-50%);background:rgba(31, 45, 61, 0.11);align-items:center;border-radius:50%;justify-content:center}.carousel__arrow--left{left:12px}.carousel__arrow--right{right:12px}.carousel__indicators{left:50%;bottom:12px;margin:0;display:inline-flex;padding:0;z-index:2;position:absolute;transform:translateX(-50%);list-style:none}.carousel__indicator{width:30px;border:none;cursor:pointer;height:4px;margin:0 6px;display:block;opacity:0.5;outline:none;padding:0;background:#fff;transition:0.3s}.carousel__indicator--active{opacity:1}.carousel--vertical .carousel__container{flex-direction:column}.carousel--vertical .carousel__arrow{display:none}.carousel--vertical .carousel__indicators{top:50%;left:unset;right:12px;bottom:0;display:flex;transform:translateY(-50%);flex-direction:column}.carousel--vertical .carousel__indicator{width:4px;height:30px;margin:6px 0}";export{a as scale_carousel}