(function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("react")):typeof define=="function"&&define.amd?define(["react"],n):(e=typeof globalThis<"u"?globalThis:e||self,e["Image Slider"]=n(e.React))})(this,function(e){"use strict";const n="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2019.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20240.823%20240.823'%20style='enable-background:new%200%200%20240.823%20240.823;'%20xml:space='preserve'%3e%3cg%3e%3cpath%20id='Chevron_Right'%20d='M57.633,129.007L165.93,237.268c4.752,4.74,12.451,4.74,17.215,0c4.752-4.74,4.752-12.439,0-17.179%20l-99.707-99.671l99.695-99.671c4.752-4.74,4.752-12.439,0-17.191c-4.752-4.74-12.463-4.74-17.215,0L57.621,111.816%20C52.942,116.507,52.942,124.327,57.633,129.007z'/%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2019.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20240.823%20240.823'%20style='enable-background:new%200%200%20240.823%20240.823;'%20xml:space='preserve'%3e%3cg%3e%3cpath%20id='Chevron_Right_1_'%20d='M183.189,111.816L74.892,3.555c-4.752-4.74-12.451-4.74-17.215,0c-4.752,4.74-4.752,12.439,0,17.179%20l99.707,99.671l-99.695,99.671c-4.752,4.74-4.752,12.439,0,17.191c4.752,4.74,12.463,4.74,17.215,0l108.297-108.261%20C187.881,124.315,187.881,116.495,183.189,111.816z'/%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3cg%3e%3c/g%3e%3c/svg%3e";return({imageList:l,width:o,height:u,loop:g=!0,autoPlay:m=!0,autoPlayInterval:v=3e3,showArrowControls:s=!0,showDotControls:x=!0,bgColor:p="none"})=>{let[c,r]=e.useState(0);const f=()=>{c!==0?r(c-=1):g&&r(c=l.length-1)},a=()=>{c!==l.length-1?r(c+=1):g&&r(c=0)},k=()=>{f()},h=()=>{a()},w=i=>{const t=i.target.getAttribute("data-key");r(c=parseInt(t))};return e.useEffect(()=>{if(m){let i=setInterval(a,v);return()=>clearInterval(i)}},[c]),e.createElement("div",null,e.createElement("div",{className:"wrapper",style:{backgroundColor:p}},(s&&!g&&c!==0||s&&g)&&e.createElement("div",{className:"leftClick",onClick:k},e.createElement("img",{className:"button",src:n,alt:"back"})),e.createElement("img",{src:l[c].url,style:{width:o,height:u,objectFit:"cover"},alt:"image"}),(s&&!g&&c!==l.length-1||s&&g)&&e.createElement("div",{className:"rightClick",onClick:h},e.createElement("img",{className:"button",src:d,alt:"next"}))),x&&e.createElement("div",{className:"dots"},l.map((i,t)=>t!==c?e.createElement("div",{key:t,className:"dot","data-key":t,onClick:w}):e.createElement("div",{key:t,className:"activeDot"}))))}});