import{C as bt,F as zt,H as wt,I as Bt,K as Ft,M as $t,N as Ht,O as Nt,R as qt,b as rt,ba as St,d as gt,ea as g,f as yt,ha as Gt,j as Dt,m as it,r as Vt,t as P,u as Wt,x as j,y as vt}from"./chunk-YIBH3X53.mjs";import{c as v}from"./chunk-OIST4OYN.mjs";var J=t=>t;var ot={ms:t=>1e3*t,s:t=>t/1e3};function xt(t,e){return e?t*(1e3/e):0}var Ut=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,me=1e-7,ge=12;function ye(t,e,r,n,i){let o,a,h=0;do a=e+(r-e)/2,o=Ut(a,n,i)-t,o>0?r=a:e=a;while(Math.abs(o)>me&&++hye(o,0,1,t,r);return o=>o===0||o===1?o:Ut(i(o),e,n)}var dn={ease:Q(.25,.1,.25,1),"ease-in":Q(.42,0,1,1),"ease-in-out":Q(.42,0,.58,1),"ease-out":Q(0,0,.58,1)};function Kt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);ie/(2*Math.sqrt(t*r));function Oe(t,e,r){return t=e||t>e&&r<=e}var Tt=({stiffness:t=Y.stiffness,damping:e=Y.damping,mass:r=Y.mass,from:n=0,to:i=1,velocity:o=0,restSpeed:a=2,restDistance:h=.5}={})=>{o=o?ot.s(o):0;let u={done:!1,hasReachedTarget:!1,current:n,target:i},f=i-n,c=Math.sqrt(t/r)/1e3,s=Te(t,e,r),b;if(s<1){let m=c*Math.sqrt(1-s*s);b=y=>i-Math.exp(-s*c*y)*((s*c*f-o)/m*Math.sin(m*y)+f*Math.cos(m*y))}else b=m=>i-Math.exp(-c*m)*(f+(c*f-o)*m);return m=>{u.current=b(m);let y=m===0?o:st(b,m,u.current),I=Math.abs(y)<=a,w=Math.abs(i-u.current)<=h;return u.done=I&&w,u.hasReachedTarget=Oe(n,i,u.current),u}},Xt=({from:t=0,velocity:e=0,power:r=.8,decay:n=.325,bounceDamping:i,bounceStiffness:o,changeTarget:a,min:h,max:u,restDistance:f=.5,restSpeed:c})=>{n=ot.ms(n);let s={hasReachedTarget:!1,done:!1,current:t,target:t},b=l=>h!==void 0&&lu,m=l=>h===void 0?u:u===void 0||Math.abs(h-l)-y*Math.exp(-l/n),C=l=>w+z(l),M=l=>{let S=z(l),L=C(l);s.done=Math.abs(S)<=f,s.current=s.done?w:L},x,O,R=l=>{b(s.current)&&(x=l,O=Tt({from:s.current,to:m(s.current),velocity:st(C,l,s.current),damping:i,stiffness:o,restDistance:f,restSpeed:c}))};return R(0),l=>{let S=!1;return!O&&x===void 0&&(S=!0,M(l),R(l)),x!==void 0&&l>x?(s.hasReachedTarget=!0,O(l-x)):(s.hasReachedTarget=!1,!S&&M(l),s)}},_t=10,Ee=1e4;function Yt(t){let e,r=_t,n=t(0),i=[n.current];for(;!n.done&&r",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},ke={translate:{syntax:"",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:Zt,scale:{syntax:"",initialValue:1,toDefaultUnit:J},skew:Zt},Pe=new Map,je=t=>`--motion-${t}`,ne=["x","y","z"];Me.forEach(t=>{Ae.forEach(e=>{ne.push(t+e),Pe.set(je(t+e),ke[t])})});var Nn=new Set(ne);var Jt=t=>document.createElement("div").animate(t,{duration:.001}),Qt={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Jt({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Jt({opacity:[0,1]}).finished},Ot={},Ie={};for(let t in Qt)Ie[t]=()=>(Ot[t]===void 0&&(Ot[t]=Qt[t]()),Ot[t]);function re(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}function ie(t){let e=new WeakMap;return(r={})=>{let n=new Map,i=(a=0,h=100,u=0,f=!1)=>{let c=`${a}-${h}-${u}-${f}`;return n.has(c)||n.set(c,t(Object.assign({from:a,to:h,velocity:u,restSpeed:f?.05:2,restDistance:f?.01:.5},r))),n.get(c)},o=a=>(e.has(a)||e.set(a,Yt(a)),e.get(a));return{createAnimation:(a,h,u,f,c)=>{var s,b;let m,y=a.length;if(u&&y<=2&&a.every(Ce)){let w=a[y-1],z=y===1?null:a[0],C=0,M=0,x=c?.generator;if(x){let{animation:l,generatorStartTime:S}=c,L=l?.startTime||S||0,G=l?.currentTime||performance.now()-L,B=x(G).current;M=(s=z)!==null&&s!==void 0?s:B,(y===1||y===2&&a[0]===null)&&(C=st(F=>x(F).current,G,B))}else M=(b=z)!==null&&b!==void 0?b:parseFloat(h());let O=i(M,w,C,f?.includes("scale")),R=o(O);m=Object.assign(Object.assign({},R),{easing:"linear"}),c&&(c.generator=O,c.generatorStartTime=performance.now())}else m={easing:"ease",duration:o(i(0,100)).overshootDuration};return m}}}}var Ce=t=>typeof t!="string",qn=ie(Tt),Gn=ie(Xt),Re={any:0,all:1};function Le(t,e,{root:r,margin:n,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};let o=re(t),a=new WeakMap,h=f=>{f.forEach(c=>{let s=a.get(c.target);if(c.isIntersecting!==!!s)if(c.isIntersecting){let b=e(c);typeof b=="function"?a.set(c.target,b):u.unobserve(c.target)}else s&&(s(c),a.delete(c.target))})},u=new IntersectionObserver(h,{root:r,rootMargin:n,threshold:typeof i=="number"?i:Re[i]});return o.forEach(f=>u.observe(f)),()=>u.disconnect()}var at=new WeakMap,W;function De(t,e){if(e){let{inlineSize:r,blockSize:n}=e[0];return{width:r,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}function Ve({target:t,contentRect:e,borderBoxSize:r}){var n;(n=at.get(t))===null||n===void 0||n.forEach(i=>{i({target:t,contentSize:e,get size(){return De(t,r)}})})}function We(t){t.forEach(Ve)}function ze(){typeof ResizeObserver<"u"&&(W=new ResizeObserver(We))}function Be(t,e){W||ze();let r=re(t);return r.forEach(n=>{let i=at.get(n);i||(i=new Set,at.set(n,i)),i.add(e),W?.observe(n)}),()=>{r.forEach(n=>{let i=at.get(n);i?.delete(e),i?.size||W?.unobserve(n)})}}var ct=new Set,tt;function Fe(){tt=()=>{let t={width:v.innerWidth,height:v.innerHeight},e={target:v,size:t,contentSize:t};ct.forEach(r=>r(e))},v.addEventListener("resize",tt)}function $e(t){return ct.add(t),tt||Fe(),()=>{ct.delete(t),!ct.size&&tt&&(tt=void 0)}}function oe(t,e){return typeof t=="function"?$e(t):Be(t,e)}function Et(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function te(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}var He={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:n={}})=>{let{once:i}=n,o=Kt(n,["once"]);return Le(t,a=>{if(e(),te(t,"viewenter",a),!i)return h=>{r(),te(t,"viewleave",h)}},o)}},ee=(t,e,r)=>n=>{(!n.pointerType||n.pointerType==="mouse")&&(r(),Et(t,e,n))},Ne={isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{let n=ee(t,"hoverstart",e),i=ee(t,"hoverend",r);return t.addEventListener("pointerenter",n),t.addEventListener("pointerleave",i),()=>{t.removeEventListener("pointerenter",n),t.removeEventListener("pointerleave",i)}}},qe={isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{let n=o=>{r(),Et(t,"pressend",o),v.removeEventListener("pointerup",n)},i=o=>{e(),Et(t,"pressstart",o),v.addEventListener("pointerup",n)};return t.addEventListener("pointerdown",i),()=>{t.removeEventListener("pointerdown",i),v.removeEventListener("pointerup",n)}}},Ge={inView:He,hover:Ne,press:qe},Un=["initial","animate",...Object.keys(Ge),"exit"];var Ue=100,Ke={left:t=>`translateX(-${t}px)`,right:t=>`translateX(${t}px)`,top:t=>`translateY(-${t}px)`,bottom:t=>`translateY(${t}px)`},At=typeof Animation<"u"&&typeof Animation.prototype.updatePlaybackRate=="function";function Mt(t){let{slots:e,gap:r,padding:n,paddingPerSide:i,paddingTop:o,paddingRight:a,paddingBottom:h,paddingLeft:u,speed:f,hoverFactor:c,direction:s,alignment:b,sizingOptions:m,fadeOptions:y,style:I}=t,{fadeContent:w,overflow:z,fadeWidth:C,fadeInset:M,fadeAlpha:x}=y,{widthType:O,heightType:R}=m,l=i?`${o}px ${a}px ${h}px ${u}px`:`${n}px`,S=St.current()===St.canvas,L=e.filter(Boolean),G=rt.count(L),B=G>0;s===!0&&(s="left");let F=s==="left"||s==="right",kt=Bt(0),et=Ke[s],ce=Ft(kt,et),U=P(null),E=Vt(()=>[yt(),yt()],[]),[$,le]=Wt({parent:null,children:null}),Pt=[],lt=[],Z=0,ut=0;S&&(Z=G?Math.floor(10/G):0,ut=1),!S&&B&&$.parent&&(Z=Math.round($.parent/$.children*2)+1,Z=Math.min(Z,Ue),ut=1);let jt=Dt(()=>{if(B&&U.current){let d=F?U.current.offsetWidth:U.current.offsetHeight,p=E[0].current?F?E[0].current.offsetLeft:E[0].current.offsetTop:0,_=(E[1].current?F?E[1].current.offsetLeft+E[1].current.offsetWidth:E[1].current.offsetTop+E[1].current.offsetHeight:0)-p+r;le({parent:d,children:_})}},[]),It=S?{contentVisibility:"auto"}:{};if(B){if(!S){let d=P(!0);it(()=>(bt.read(jt),oe(U.current,({contentSize:p})=>{!d.current&&(p.width||p.height)&&bt.read(jt),d.current=!1})),[])}Pt=rt.map(L,(d,p)=>{var k,_,H,N;let q;p===0&&(q=E[0]),p===L.length-1&&(q=E[1]);let K={width:O?(k=d.props)===null||k===void 0?void 0:k.width:"100%",height:R?(_=d.props)===null||_===void 0?void 0:_.height:"100%"};return j(wt,{inherit:"id",children:j("li",{ref:q,style:K,children:gt(d,{style:{...(H=d.props)===null||H===void 0?void 0:H.style,...K,flexShrink:0,...It},layoutId:d.props.layoutId?d.props.layoutId+"-original-"+p:void 0},(N=d.props)===null||N===void 0?void 0:N.children)})})})}if(!S)for(let d=0;d{var _,H,N,q,K,mt;let he={width:O?(_=p.props)===null||_===void 0?void 0:_.width:"100%",height:R?(H=p.props)===null||H===void 0?void 0:H.height:"100%",willChange:"transform"};return j(wt,{inherit:"id",children:j("li",{style:he,"aria-hidden":!0,children:gt(p,{key:d+" "+k,style:{...(N=p.props)===null||N===void 0?void 0:N.style,width:O?(q=p.props)===null||q===void 0?void 0:q.width:"100%",height:R?(K=p.props)===null||K===void 0?void 0:K.height:"100%",flexShrink:0,...It},layoutId:p.props.layoutId?p.props.layoutId+"-dupe-"+d:void 0},(mt=p.props)===null||mt===void 0?void 0:mt.children)},d+"li"+k)},d+"lg"+k)})];let A=$.children+$.children*Math.round($.parent/$.children),ft=P(null),dt=P(null),nt=P(0),pt=P(!1),Ct=Ht(),Rt=P(null),T=P(null);if(!S){let d=qt(U);At?(it(()=>{if(!(Ct||!A||!f))return T.current=Rt.current.animate({transform:[et(0),et(A)]},{duration:Math.abs(A)/f*1e3,iterations:1/0,easing:"linear"}),()=>T.current.cancel()},[c,A,f]),it(()=>{T.current&&(d&&T.current.playState==="paused"?T.current.play():!d&&T.current.playState==="running"&&T.current.pause())},[d])):$t(p=>{if(!A||Ct||At)return;ft.current===null&&(ft.current=p),p=p-ft.current;let _=(dt.current===null?0:p-dt.current)*(f/1e3);pt.current&&(_*=c),nt.current+=_,nt.current=Nt(0,A,nt.current),dt.current=p,d&&kt.set(nt.current)})}let ue=F?"to right":"to bottom",Lt=C/2,fe=100-C/2,de=Qe(M,0,Lt),pe=100-M,ht=`linear-gradient(${ue}, rgba(0, 0, 0, ${x}) ${de}%, rgba(0, 0, 0, 1) ${Lt}%, rgba(0, 0, 0, 1) ${fe}%, rgba(0, 0, 0, ${x}) ${pe}%)`;return B?j("section",{style:{...se,opacity:ut,WebkitMaskImage:w?ht:void 0,MozMaskImage:w?ht:void 0,maskImage:w?ht:void 0,overflow:z?"visible":"hidden",padding:l},ref:U,children:vt(zt.ul,{ref:Rt,style:{...se,gap:r,top:s==="bottom"&&ae(A)?-A:void 0,left:s==="right"&&ae(A)?-A:void 0,placeItems:b,position:"relative",flexDirection:F?"row":"column",...I,willChange:S?"auto":"transform",transform:At?et(0):ce},onMouseEnter:()=>{pt.current=!0,T.current&&(T.current.playbackRate=c)},onMouseLeave:()=>{pt.current=!1,T.current&&(T.current.playbackRate=1)},children:[Pt,lt]})}):vt("section",{style:Xe,children:[j("div",{style:Ye,children:"\u2728"}),j("p",{style:Ze,children:"Connect to Content"}),j("p",{style:Je,children:"Add layers or components to infinitely loop on your page."})]})}Mt.defaultProps={gap:10,padding:10,sizingOptions:{widthType:!0,heightType:!0},fadeOptions:{fadeContent:!0,overflow:!1,fadeWidth:25,fadeAlpha:0,fadeInset:0},direction:!0};Gt(Mt,{slots:{type:g.Array,title:"Children",control:{type:g.ComponentInstance}},speed:{type:g.Number,title:"Speed",min:0,max:1e3,defaultValue:100,unit:"%",displayStepper:!0,step:5},direction:{type:g.Enum,title:"Direction",options:["left","right","top","bottom"],optionIcons:["direction-left","direction-right","direction-up","direction-down"],optionTitles:["Left","Right","Top","Bottom"],defaultValue:"left",displaySegmentedControl:!0},alignment:{type:g.Enum,title:"Align",options:["flex-start","center","flex-end"],optionIcons:{direction:{right:["align-top","align-middle","align-bottom"],left:["align-top","align-middle","align-bottom"],top:["align-left","align-center","align-right"],bottom:["align-left","align-center","align-right"]}},defaultValue:"center",displaySegmentedControl:!0},gap:{type:g.Number,title:"Gap"},padding:{title:"Padding",type:g.FusedNumber,toggleKey:"paddingPerSide",toggleTitles:["Padding","Padding per side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["T","R","B","L"],min:0},sizingOptions:{type:g.Object,title:"Sizing",controls:{widthType:{type:g.Boolean,title:"Width",enabledTitle:"Auto",disabledTitle:"Stretch",defaultValue:!0},heightType:{type:g.Boolean,title:"Height",enabledTitle:"Auto",disabledTitle:"Stretch",defaultValue:!0}}},fadeOptions:{type:g.Object,title:"Clipping",controls:{fadeContent:{type:g.Boolean,title:"Fade",defaultValue:!0},overflow:{type:g.Boolean,title:"Overflow",enabledTitle:"Show",disabledTitle:"Hide",defaultValue:!1,hidden(t){return t.fadeContent===!0}},fadeWidth:{type:g.Number,title:"Width",defaultValue:25,min:0,max:100,unit:"%",hidden(t){return t.fadeContent===!1}},fadeInset:{type:g.Number,title:"Inset",defaultValue:0,min:0,max:100,unit:"%",hidden(t){return t.fadeContent===!1}},fadeAlpha:{type:g.Number,title:"Opacity",defaultValue:0,min:0,max:1,step:.05,hidden(t){return t.fadeContent===!1}}}},hoverFactor:{type:g.Number,title:"Hover",min:0,max:1,unit:"x",defaultValue:1,step:.1,displayStepper:!0,description:"Slows down the speed while you are hovering."}});var se={display:"flex",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",placeItems:"center",margin:0,padding:0,listStyleType:"none",textIndent:"none"},Xe={display:"flex",width:"100%",height:"100%",placeContent:"center",placeItems:"center",flexDirection:"column",color:"#96F",background:"rgba(136, 85, 255, 0.1)",fontSize:11,overflow:"hidden",padding:"20px 20px 30px 20px"},Ye={fontSize:32,marginBottom:10},Ze={margin:0,marginBottom:10,fontWeight:600,textAlign:"center"},Je={margin:0,opacity:.7,maxWidth:150,lineHeight:1.5,textAlign:"center"},Qe=(t,e,r)=>Math.min(Math.max(t,e),r),ae=t=>typeof t=="number"&&!isNaN(t);export{Mt as a}; //# sourceMappingURL=chunk-LO2MMGYI.mjs.map