var W=Object.defineProperty,z=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var k=(r,t,a)=>t in r?W(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a,h=(r,t)=>{for(var a in t||(t={}))S.call(t,a)&&k(r,a,t[a]);if(N)for(var a of N(t))L.call(t,a)&&k(r,a,t[a]);return r},w=(r,t)=>z(r,B(t));import{a as R,r as c,j as e,ca as $,K as g,h as E,bs as K}from"./main-634.js";const n={backdrop:{pn:"fixed",tp:0,lt:0,w:"100vw",h:"100vw",zx:9999,flx:"center",tn:"background .3s"},modalWrapper:{pn:"relative"},modal:{bd:"var(--white-100)",zx:99999,pn:"fixed",tp:"50%",lt:"50%",ml:"-250px",mt:"-100px",brs:14,tm:"scale(0) transform(-50%, -50%)",oy:1,bs:`0px 3px 0.5px rgba(0, 0, 0, 0.034),
    0px 6.1px 2.9px rgba(0, 0, 0, 0.049),
    0px 10.1px 8.8px rgba(0, 0, 0, 0.061),
    0px 16.9px 24.3px rgba(0, 0, 0, 0.076),
    0px 47px 93px rgba(0, 0, 0, 0.11)`,tn:"transform 0.4s cubic-bezier(0, 1.02, 0.2, 1.1) 0s, opacity .3s"},title:{my:10},closeBtn:{w:25,h:25,b:"none",brs:500,flx:"center",cr:"var(--white-0-0-64)",vd:"var(--white-0-86)",curp:1,":hover":{cr:"var(--white-0-9)"}},leftArrwWrp:{w:60,h:70,flx:"center",pn:"absolute",tp:"40%",tm:"translateY(-50%)",lt:"-60px",oy:0,tn:"opacity .3s"},rightArrwWrp:{w:60,h:70,flx:"center",pn:"absolute",tp:"40%",tm:"translateY(-50%)",rt:"-60px",oy:0,tn:"opacity .3s"},rightArw:{tm:"rotate(180deg)"},arrwBtn:{w:40,h:40,brs:500,b:"none",flx:"center",bd:"var(--white-0-89)",pr:10,curp:1,tn:"background .3s",":hover":{bd:"var(--white-100)",bs:"0 0 10px -3px black"}},sliderContentWrp:{pn:"relative",h:"calc(100% - 42px)",flx:1,ow:"hidden",brs:"0 0 14px 14px"},sliderContent:{w:"100%",h:"100%",mnw:"100%",tn:"transform .4s"}};function T({title:r="Example Title",className:t,show:a=!0,setModal:f,children:o,isInfinite:y=!0,modalStyle:A={width:500,height:500},onChange:d,defaultActiveSlideIndex:x=0}){const{css:l}=R(),[b,u]=c.useState(x),v=c.useRef(null);c.useEffect(()=>{u(x)},[x]);const p=i=>{switch(i){case"inc":u(s=>s===o.length-1?y?0:s:s+1);break;case"dec":u(s=>s<1?y?o.length-1:s:s-1);break}},j=({type:i,code:s})=>{i==="keyup"&&(s==="Escape"&&f(C=>w(h({},C),{show:!1})),s==="ArrowRight"&&p("inc"),s==="ArrowLeft"&&p("dec"))},m=()=>{f(i=>w(h({},i),{show:!1}))};return c.useEffect(()=>(document.addEventListener("keyup",j),()=>{document.removeEventListener("keyup",j)}),[]),c.useEffect(()=>{d==null||d(b)},[b]),e.jsx($,{in:a,timeout:400,classNames:"btc-slider-modal",unmountOnExit:!0,nodeRef:v,children:e.jsxs("div",{ref:v,children:[e.jsxs("div",{"aria-labelledby":"title","aria-describedby":"description",role:"dialog","aria-modal":"true","data-modal":!0,className:`${l(n.modal)} ${t}`,style:A,children:[e.jsx("div",{"data-arrow":!0,className:l(n.leftArrwWrp),children:e.jsx("button",{onClick:()=>p("dec"),className:l(n.arrwBtn),type:"button","aria-label":"Previous",title:"Previous",children:e.jsx(g,{size:"30"})})}),e.jsx("div",{"data-arrow":!0,className:l(n.rightArrwWrp),children:e.jsx("button",{onClick:()=>p("inc"),className:l(n.arrwBtn,n.rightArw),type:"button","aria-label":"Next",title:"Next",children:e.jsx(g,{size:"30"})})}),e.jsxs("div",{className:l(E.flxcb,E.px10),children:[e.jsx("div",{className:l({h:42,w:"100%",flx:"center"}),children:typeof r=="string"?e.jsx("h2",{id:"title",className:l(n.title),children:r}):r}),e.jsx("div",{children:e.jsx("button",{onClick:m,className:l(n.closeBtn),type:"button","aria-label":"Close Modal",title:"Close modal   Esc",children:e.jsx(K,{size:"12"})})})]}),e.jsxs("div",{className:l(n.sliderContentWrp),id:"description",children:[Array.isArray(o)&&o.map((i,s)=>e.jsx("div",{className:l(n.sliderContent),style:{transform:`translate3d(${b*-100}%,0,0)`},children:i},`slider-itm-${s*7}`)),!Array.isArray(o)&&o]})]}),e.jsx("div",{role:"button",tabIndex:"0",onClick:m,onKeyDown:m,className:l(n.backdrop),"aria-label":"Close modal","data-backdrop":!0})]})})}export{T as S};
