svg-scroll-draw 2.15.0 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- import {onMount,onCleanup}from'solid-js';function _t({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function qt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:_t(),elastic:qt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function Et(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function St(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function qe(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Wt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:Wt((e-n)/(r-n)*t,0,1)}function Ke(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=Et(e.top,e.height,n,t.element)-St(t.viewport,r),c=Et(e.top,e.height,n,l.element)-St(l.viewport,r);return {tStart:s,tEnd:c}}function Tt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,n,r){let t=Tt(e),l=Tt(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var xt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Je=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Je&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Bt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Gt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Mt=33;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Yt(e){let n=[];for(let r=0;r<Mt;r++){let t=r/(Mt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return Bt;case "ease-out":return Gt;case "ease-in-out":return jt()?Yt(re["ease-in-out"]):null;default:return null}}var At=Symbol.for("svg-scroll-draw.registry");function Lt(){let e=globalThis;return e[At]||(e[At]=new Map)}function Le(e,n){Lt().set(e,n);}function $e(e){Lt().delete(e);}var Ut=0;function Xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Qt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?we("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Zt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
1
+ import {onMount,onCleanup}from'solid-js';function Wt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function Bt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Wt(),elastic:Bt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function Et(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function St(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function qe(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Gt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:Gt((e-n)/(r-n)*t,0,1)}function Je(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=Et(e.top,e.height,n,t.element)-St(t.viewport,r),c=Et(e.top,e.height,n,l.element)-St(l.viewport,r);return {tStart:s,tEnd:c}}function Tt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,n,r){let t=Tt(e),l=Tt(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var xt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var je=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){je&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var jt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Yt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Mt=33;function Ut(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Xt(e){let n=[];for(let r=0;r<Mt;r++){let t=r/(Mt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return jt;case "ease-out":return Yt;case "ease-in-out":return Ut()?Xt(re["ease-in-out"]):null;default:return null}}var At=Symbol.for("svg-scroll-draw.registry");function Lt(){let e=globalThis;return e[At]||(e[At]=new Map)}function Le(e,n){Lt().set(e,n);}function $e(e){Lt().delete(e);}var Qt=0;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function $t(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Pt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Kt(e){if(!je)return;let n=$t(e,"stroke");if(!n||n==="none"){we("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Pt.has(r)&&!Pt.has($t(e,"fill"))&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Jt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var $t=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Ct=/[MmLlHhVvCcSsQqTtAaZz]/g;function Kt(e,n,r){if(!Je)return;let t=(e.match(Ct)??[]).join("").toUpperCase(),l=(n.match(Ct)??[]).join("").toUpperCase(),s=(e.match($t)??[]).length,c=(n.match($t)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function it(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function at(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...xt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Ce=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:M,strokeWidth:C,fillOpacity:A,waypoints:w,velocityScale:k=false,threshold:O=0,rootMargin:P="0px",repeat:E=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:S,onEnterBack:F,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Se=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),ze=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Ee=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray(C)?C[0]:null,j=Array.isArray(C)?C[1]:typeof C=="number"?C:null,pe=Array.isArray(A)?A[0]:null,Z=Array.isArray(A)?A[1]:typeof A=="number"?A:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,R=false,_=false,q=0,Me=false,ye=-1,te=-1,Y=false,he=0,He=0,Re,tt=null;function pt(){tt?.destroy(),tt=null;}let Ne=new Set,dt=NaN,Ve=true,je=-1,gt=performance.now(),_e=NaN;function rt(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function yt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function ht(){let o=Ke(e,ve,B);return xe(o,o.scroll,yt(),Pe,ze)}function bt(){(({tStart:f,tEnd:ge}=ht())),Ce&&Je&&(pt(),tt=Zt(f,ge,B));}function nt(o,a=ht){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Rt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Ee&&le?b.style.stroke=We(Ee,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",it(i[ue],D,o));});}function Ye(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Qt(o);let a=qe(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Kt(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let wt=typeof p=="string"?et(p):null;function Nt(){return !(ae===false||!Xt()||!z.length||!wt||Q||B!=="y"||ve||u!==1||V!==0||ne||X||k!==false||D||w||E||G>0||d||x||g||L||S||F||fe||M!=null||C!=null||A!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Vt(){let o=++Ut,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Fe=$==="reverse"?"0":"var(--ssd-len)",ke=$==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Fe};`,v=`stroke-dashoffset:${ke};`;m&&(Ae+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let H=document.createElement("style");H.setAttribute("data-svg-scroll-draw",""),H.textContent=`@keyframes ${a}{from{${Ae}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${wt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,N=-1;function W(){if(N>=0)return N;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},rt(),yt(),Pe,ze);return Se(K(rt(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),H.remove();},replay(){h=false,N=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));N=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=qe(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(Nt())return nt(Vt());function zt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function Fe(h){let N=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Se(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(N=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Se(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Ee&&le?W.style.stroke=We(Ee,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",it(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(N=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Se(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Ne.has(Te)&&(Ne.add(Te),w[U]?.());}}return N}function ke(h){if(Y)return;let N=h-a;_||(_=true,x?.());let W=Fe(N);if(W&&!R){R=true,Fe(o*(1+Math.max(0,z.length-1)*V)),g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{a=performance.now(),_=false,R=false,Ne.clear(),Ye(),q=requestAnimationFrame(ke);},oe));return}W||(q=requestAnimationFrame(ke));}function Ae(){cancelAnimationFrame(q),clearTimeout(Re),a=performance.now(),b=0,Y=false,_=false,R=false,He=0,ue=true,he=0,Ne.clear(),Ye(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(ne&&R)?Ae():!N.isIntersecting&&!ne&&!R&&(cancelAnimationFrame(q),clearTimeout(Re),ue=false);});},{root:ve??null,threshold:O,rootMargin:P}),H;function me(){clearTimeout(H),H=setTimeout(()=>{z.forEach((h,N)=>{I[N]=qe(h),h.style.strokeDasharray=`${I[N]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Re),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(H);},replay(){He=0,Ae();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let N=Math.min(1,Math.max(0,h));he=N,Y=true,b=N*o,a=performance.now()-b,cancelAnimationFrame(q),Fe(b);},getProgress(){return he},refresh(){clearTimeout(H),z.forEach((h,N)=>{I[N]=qe(h),h.style.strokeDasharray=`${I[N]}`;});}}}if(ie)return nt(zt());bt();function Ue(){if(!Me||Y)return;let o=performance.now(),a=rt();if(!Ve&&k===false&&a===dt){q=requestAnimationFrame(Ue);return}Ve=false,dt=a;let b=u;if(k!==false){let v=o-gt,H=v>0?Math.abs(a-(je<0?a:je))/v:0;b=u*Math.max(.2,1+H*(typeof k=="number"?k:1)*.04);}je=a,gt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let Fe=ge-f,ke=true,Ae=Fe===0?0:(a-f)/Fe;if(isNaN(_e)||(_e<=0&&Ae>0?L?.():_e>0&&Ae<=0&&fe?.(),_e<1&&Ae>=1?S?.():_e>=1&&Ae<1&&F?.()),_e=Ae,Q){let v=Se(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let H=ue==="reverse"?1-v:v;e.style.clipPath=Ie(H),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!R?(R=true,g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{ye=-1,_=false,R=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(R=false),q=requestAnimationFrame(Ue);return}if(z.forEach((v,H)=>{let me=H*V*Fe,h=Se(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[H]*h}`:`${I[H]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Ee&&le?v.style.stroke=We(Ee,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[H]&&v.setAttribute("d",it(i[H],D,h)),H===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=Se(K(a,f,ge,b));for(let H in w){let me=parseFloat(H);v>=me&&!Ne.has(me)&&(Ne.add(me),w[H]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),ke&&!R?(R=true,g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{ye=-1,_=false,R=false,Ne.clear(),Ye(),Ve=true;},oe))):!ke&&!ne&&(R=false),q=requestAnimationFrame(Ue);}let ot=false;function Xe(){ot||(ot=true,q=requestAnimationFrame(function(){Ue();}));}function Qe(){ot=false,cancelAnimationFrame(q);}let st=new IntersectionObserver(o=>{o.forEach(a=>{Me=a.isIntersecting,Me&&!Y?(Ve=true,Xe()):Qe();});},{root:ve??null,threshold:O,rootMargin:P});function vt(){z.forEach((o,a)=>{I[a]=qe(o),o.style.strokeDasharray=`${I[a]}`;}),bt(),Ve=true;}let Ze;function Be(){clearTimeout(Ze),Ze=setTimeout(vt,150);}window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be);let Ge;return typeof ResizeObserver<"u"&&(Ge=new ResizeObserver(()=>Be()),Ge.observe(document.body),Ge.observe(document.documentElement),Ge.observe(e)),G>0?setTimeout(()=>st.observe(e),G):st.observe(e),nt({destroy(){cancelAnimationFrame(q),clearTimeout(Re),Qe(),st.disconnect(),Ge?.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ze),pt();},replay(){ye=-1,te=-1,je=-1,_=false,R=false,He=0,Y=false,he=0,Ne.clear(),clearTimeout(Re),Ye(),Ve=true,Me&&Xe();},pause(){Y=true,Qe();},resume(){Y&&(Y=false,Ve=true,Me&&Xe());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Qe(),Rt(a,$),Ve=true;},getProgress(){return he},refresh(){clearTimeout(Ze),vt(),Me&&!Y&&Xe();}},()=>({tStart:f,tEnd:ge}))}function Jt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Pt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function er(e,n,r){let t=Pt(e),l=Pt(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function It(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Jt(t))return We(t,l,r);if(t.includes("("))return er(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function tr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var rr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),nr=0,kt="--scroll-draw-progress";function or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function lt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Ce,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:M}=n,C=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),k=de(l.end??"bottom top"),O=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,E=Object.entries(t).map(([i,f])=>({prop:tr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...E.map(f=>f.prop),kt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(C)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?et(s):null;function ae(){if(!T||!or()||!ee||m!=="y"||P||O!==e||u||c!==1||Ce||B||J||X||G||M||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!rr.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++nr}`,f=E.map(te=>`${te.prop}:${te.from}`).join(";"),ge=E.map(te=>`${te.prop}:${te.to}`).join(";"),R=document.createElement("style");R.setAttribute("data-ssd-animate",""),R.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,k)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Me});let ye={destroy(){e.classList.remove(i),R.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of E)e.style.setProperty(he.prop,It(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Me();return A(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,S=false,F=false,fe=-1,Q=0,Se=false,Pe=NaN,ze=-1,ve=0,Ee=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Ke(O,P,m),f=xe(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(kt,String(i));for(let f of E)e.style.setProperty(f.prop,It(f.from,f.to,i));Ce?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&M?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!S||F)return;let i=performance.now(),f=Ee(),ge=c;if(V!==false){let q=i-ve,Me=q>0?Math.abs(f-(ze<0?f:ze))/q:0;ge=c*Math.max(.2,1+Me*(typeof V=="number"?V:1)*.04);}ze=f,ve=i;let R=g===x?0:(f-x)/(g-x);pe(R);let _=A(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Se?(Se=true,B?.()):_<1&&!u&&(Se=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=A(K(Ee(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{S=f.isIntersecting,S&&!F?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:P??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Se=false,Q=0,F=false,j(0);},pause(){F=true,cancelAnimationFrame(L);},resume(){F&&(F=false,S&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,F=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,n){if(typeof window>"u")return ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ct;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Ce=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ct;let X=0,G=0,M=0,C=false,A=false,w=-1,k=0,O=false,P=()=>window.scrollY,E=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),E(),Ce,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!C||A)return;let d=ne(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,D(d),d>=1&&!O?(O=true,V?.()):d<1&&!p&&(O=false),M=requestAnimationFrame(se);}oe();{let d=ne(K(P(),X,G,1));p&&d>0&&(w=d),k=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{C=x.isIntersecting,C&&!A?M=requestAnimationFrame(se):cancelAnimationFrame(M);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,O=false,k=0,A=false,D(0);},pause(){A=true,cancelAnimationFrame(M);},resume(){A&&(A=false,C&&(M=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,A=true,cancelAnimationFrame(M),D(x);},getProgress(){return k}}}var Ot={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function mt(e,n={}){if(typeof window>"u")return Ot;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Ot;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Ce=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,M=0,C=0,A=false,w=false,k=-1,O=0,P=false,E=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let S=t.getBoundingClientRect(),F=u==="x"?S.left:S.top,fe=u==="x"?S.width:S.height,Q=xe({top:F,height:fe},oe(),D(),Ce,B);G=Q.tStart,M=Q.tEnd;}let ie=NaN;function ee(S){if(!E)return;let F=X??t.duration??0,fe=J+(F-J)*S;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(S)),V?.(S);}function ae(){if(!A||w||!E)return;let S=ne(K(oe(),G,M,1));c&&(k=Math.max(k,S),S=k),O=S,ee(S),S>=1&&!P?(P=true,T?.()):S<1&&!c&&(P=false),C=requestAnimationFrame(ae);}function d(){if(E=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),A&&!w&&(C=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),E||se();let x=new IntersectionObserver(S=>{S.forEach(F=>{A=F.isIntersecting,A&&!w&&E?C=requestAnimationFrame(ae):cancelAnimationFrame(C);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:G,tEnd:M})}),{destroy(){cancelAnimationFrame(C),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){k=-1,P=false,O=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,A&&E&&(C=requestAnimationFrame(ae)));},seek(S){let F=Math.min(1,Math.max(0,S));O=F,k=F,w=true,cancelAnimationFrame(C),ie=NaN,ee(F);},getProgress(){return O}}}function Ft(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function sr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Dt(e){let n=Ft(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function ir(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function ar(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,n={}){if(typeof window>"u")return Ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Ht;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Ce=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=sr(t):l==="lines"?J=Dt(t):J=Ft(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let S=ar(L,u);S&&(g.style.transform=S);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,S)=>{let F=$(ir(g,S,X,s));G(L,F);});}if(V)return M(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let C=0,A=0,w=0,k=false,O=false,P=-1,E=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Ce);C=L.tStart,A=L.tEnd;}function ee(){if(!k||O)return;let g=K(D(),C,A,1);p&&(P=Math.max(P,g),g=P),E=g,M(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{k=L.isIntersecting,k&&!O?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Dt(t),M(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:C,tEnd:A})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){P=-1,oe=false,E=0,O=false,M(0);},pause(){O=true,cancelAnimationFrame(w);},resume(){O&&(O=false,k&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));E=L,P=L,O=true,cancelAnimationFrame(w),M(L);},getProgress(){return E}}}function Wr(e={}){let n,r;return onMount(()=>{n&&(r=at(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Br(e={}){let n,r;return onMount(()=>{n&&(r=at(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Gr(e){let n,r;return onMount(()=>{n&&(r=lt(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function jr(e){let n,r;return onMount(()=>{n&&(r=lt(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Yr(e){let n,r;return onMount(()=>{n&&(r=ut(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Ur(e){let n,r;return onMount(()=>{n&&(r=ut(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Xr(e={}){let n,r;return onMount(()=>{n&&(r=mt(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Qr(e={}){let n,r;return onMount(()=>{n&&(r=mt(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Zr(e={}){let n,r;return onMount(()=>{n&&(r=ft(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Kr(e={}){let n,r;return onMount(()=>{n&&(r=ft(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}export{jr as createScrollAnimate,Ur as createScrollCounter,Br as createScrollDraw,Kr as createScrollText,Qr as createScrollVideo,Gr as useScrollAnimate,Yr as useScrollCounter,Wr as useScrollDraw,Zr as useScrollText,Xr as useScrollVideo};
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Ct=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,It=/[MmLlHhVvCcSsQqTtAaZz]/g;function er(e,n,r){if(!je)return;let t=(e.match(It)??[]).join("").toUpperCase(),l=(n.match(It)??[]).join("").toUpperCase(),s=(e.match(Ct)??[]).length,c=(n.match(Ct)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function it(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function at(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...xt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Pe=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:M,strokeWidth:P,fillOpacity:A,waypoints:w,velocityScale:k=false,threshold:O=0,rootMargin:C="0px",repeat:E=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:S,onEnterBack:F,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Se=typeof p=="function"?p:re[p]??re.linear,Ce=de(T.start??"top bottom"),ze=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Ee=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray(P)?P[0]:null,j=Array.isArray(P)?P[1]:typeof P=="number"?P:null,pe=Array.isArray(A)?A[0]:null,Z=Array.isArray(A)?A[1]:typeof A=="number"?A:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,R=false,_=false,q=0,Me=false,ye=-1,te=-1,Y=false,he=0,He=0,Re,tt=null;function pt(){tt?.destroy(),tt=null;}let Ne=new Set,dt=NaN,Ve=true,Ye=-1,gt=performance.now(),_e=NaN;function rt(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function yt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function ht(){let o=Je(e,ve,B);return xe(o,o.scroll,yt(),Ce,ze)}function bt(){(({tStart:f,tEnd:ge}=ht())),Pe&&je&&(pt(),tt=Jt(f,ge,B));}function nt(o,a=ht){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Vt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Ee&&le?b.style.stroke=We(Ee,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",it(i[ue],D,o));});}function Ue(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Kt(o);let a=qe(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?er(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let wt=typeof p=="string"?et(p):null;function zt(){return !(ae===false||!Zt()||!z.length||!wt||Q||B!=="y"||ve||u!==1||V!==0||ne||X||k!==false||D||w||E||G>0||d||x||g||L||S||F||fe||M!=null||P!=null||A!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function _t(){let o=++Qt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Fe=$==="reverse"?"0":"var(--ssd-len)",ke=$==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Fe};`,v=`stroke-dashoffset:${ke};`;m&&(Ae+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let H=document.createElement("style");H.setAttribute("data-svg-scroll-draw",""),H.textContent=`@keyframes ${a}{from{${Ae}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${wt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,N=-1;function W(){if(N>=0)return N;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},rt(),yt(),Ce,ze);return Se(K(rt(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),H.remove();},replay(){h=false,N=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));N=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=qe(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(zt())return nt(_t());function qt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function Fe(h){let N=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Se(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(N=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Se(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Ee&&le?W.style.stroke=We(Ee,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",it(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(N=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Se(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Ne.has(Te)&&(Ne.add(Te),w[U]?.());}}return N}function ke(h){if(Y)return;let N=h-a;_||(_=true,x?.());let W=Fe(N);if(W&&!R){R=true,Fe(o*(1+Math.max(0,z.length-1)*V)),g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{a=performance.now(),_=false,R=false,Ne.clear(),Ue(),q=requestAnimationFrame(ke);},oe));return}W||(q=requestAnimationFrame(ke));}function Ae(){cancelAnimationFrame(q),clearTimeout(Re),a=performance.now(),b=0,Y=false,_=false,R=false,He=0,ue=true,he=0,Ne.clear(),Ue(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(ne&&R)?Ae():!N.isIntersecting&&!ne&&!R&&(cancelAnimationFrame(q),clearTimeout(Re),ue=false);});},{root:ve??null,threshold:O,rootMargin:C}),H;function me(){clearTimeout(H),H=setTimeout(()=>{z.forEach((h,N)=>{I[N]=qe(h),h.style.strokeDasharray=`${I[N]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Re),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(H);},replay(){He=0,Ae();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let N=Math.min(1,Math.max(0,h));he=N,Y=true,b=N*o,a=performance.now()-b,cancelAnimationFrame(q),Fe(b);},getProgress(){return he},refresh(){clearTimeout(H),z.forEach((h,N)=>{I[N]=qe(h),h.style.strokeDasharray=`${I[N]}`;});}}}if(ie)return nt(qt());bt();function Xe(){if(!Me||Y)return;let o=performance.now(),a=rt();if(!Ve&&k===false&&a===dt){q=requestAnimationFrame(Xe);return}Ve=false,dt=a;let b=u;if(k!==false){let v=o-gt,H=v>0?Math.abs(a-(Ye<0?a:Ye))/v:0;b=u*Math.max(.2,1+H*(typeof k=="number"?k:1)*.04);}Ye=a,gt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let Fe=ge-f,ke=true,Ae=Fe===0?0:(a-f)/Fe;if(isNaN(_e)||(_e<=0&&Ae>0?L?.():_e>0&&Ae<=0&&fe?.(),_e<1&&Ae>=1?S?.():_e>=1&&Ae<1&&F?.()),_e=Ae,Q){let v=Se(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let H=ue==="reverse"?1-v:v;e.style.clipPath=Ie(H),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!R?(R=true,g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{ye=-1,_=false,R=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(R=false),q=requestAnimationFrame(Xe);return}if(z.forEach((v,H)=>{let me=H*V*Fe,h=Se(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[H]*h}`:`${I[H]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Ee&&le?v.style.stroke=We(Ee,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[H]&&v.setAttribute("d",it(i[H],D,h)),H===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=Se(K(a,f,ge,b));for(let H in w){let me=parseFloat(H);v>=me&&!Ne.has(me)&&(Ne.add(me),w[H]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),ke&&!R?(R=true,g?.(),He<(E==="infinite"?1/0:E??0)&&(He++,Re=setTimeout(()=>{ye=-1,_=false,R=false,Ne.clear(),Ue(),Ve=true;},oe))):!ke&&!ne&&(R=false),q=requestAnimationFrame(Xe);}let ot=false;function Qe(){ot||(ot=true,q=requestAnimationFrame(function(){Xe();}));}function Ze(){ot=false,cancelAnimationFrame(q);}let st=new IntersectionObserver(o=>{o.forEach(a=>{Me=a.isIntersecting,Me&&!Y?(Ve=true,Qe()):Ze();});},{root:ve??null,threshold:O,rootMargin:C});function vt(){z.forEach((o,a)=>{I[a]=qe(o),o.style.strokeDasharray=`${I[a]}`;}),bt(),Ve=true;}let Ke;function Be(){clearTimeout(Ke),Ke=setTimeout(vt,150);}window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be);let Ge;return typeof ResizeObserver<"u"&&(Ge=new ResizeObserver(()=>Be()),Ge.observe(document.body),Ge.observe(document.documentElement),Ge.observe(e)),G>0?setTimeout(()=>st.observe(e),G):st.observe(e),nt({destroy(){cancelAnimationFrame(q),clearTimeout(Re),Ze(),st.disconnect(),Ge?.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ke),pt();},replay(){ye=-1,te=-1,Ye=-1,_=false,R=false,He=0,Y=false,he=0,Ne.clear(),clearTimeout(Re),Ue(),Ve=true,Me&&Qe();},pause(){Y=true,Ze();},resume(){Y&&(Y=false,Ve=true,Me&&Qe());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Ze(),Vt(a,$),Ve=true;},getProgress(){return he},refresh(){clearTimeout(Ke),vt(),Me&&!Y&&Qe();}},()=>({tStart:f,tEnd:ge}))}function tr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function kt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function rr(e,n,r){let t=kt(e),l=kt(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Ot(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(tr(t))return We(t,l,r);if(t.includes("("))return rr(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function nr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var or=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),sr=0,Dt="--scroll-draw-progress";function ir(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function lt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Pe,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:M}=n,P=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),k=de(l.end??"bottom top"),O=ne??e,C=typeof p=="string"?document.querySelector(p):p??null,E=Object.entries(t).map(([i,f])=>({prop:nr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...E.map(f=>f.prop),Dt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(P)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?et(s):null;function ae(){if(!T||!ir()||!ee||m!=="y"||C||O!==e||u||c!==1||Pe||B||J||X||G||M||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!or.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++sr}`,f=E.map(te=>`${te.prop}:${te.from}`).join(";"),ge=E.map(te=>`${te.prop}:${te.to}`).join(";"),R=document.createElement("style");R.setAttribute("data-ssd-animate",""),R.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,k)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Me});let ye={destroy(){e.classList.remove(i),R.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of E)e.style.setProperty(he.prop,Ot(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Me();return A(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,S=false,F=false,fe=-1,Q=0,Se=false,Ce=NaN,ze=-1,ve=0,Ee=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Je(O,C,m),f=xe(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Dt,String(i));for(let f of E)e.style.setProperty(f.prop,Ot(f.from,f.to,i));Pe?.(i);}function pe(i){if(isNaN(Ce)){Ce=i;return}Ce<=0&&i>0?J?.():Ce>0&&i<=0&&M?.(),Ce<1&&i>=1?X?.():Ce>=1&&i<1&&G?.(),Ce=i;}function Z(){if(!S||F)return;let i=performance.now(),f=Ee(),ge=c;if(V!==false){let q=i-ve,Me=q>0?Math.abs(f-(ze<0?f:ze))/q:0;ge=c*Math.max(.2,1+Me*(typeof V=="number"?V:1)*.04);}ze=f,ve=i;let R=g===x?0:(f-x)/(g-x);pe(R);let _=A(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Se?(Se=true,B?.()):_<1&&!u&&(Se=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=A(K(Ee(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{S=f.isIntersecting,S&&!F?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:C??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Se=false,Q=0,F=false,j(0);},pause(){F=true,cancelAnimationFrame(L);},resume(){F&&(F=false,S&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,F=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,n){if(typeof window>"u")return ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ct;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Pe=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ct;let X=0,G=0,M=0,P=false,A=false,w=-1,k=0,O=false,C=()=>window.scrollY,E=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},C(),E(),Pe,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!P||A)return;let d=ne(K(C(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,D(d),d>=1&&!O?(O=true,V?.()):d<1&&!p&&(O=false),M=requestAnimationFrame(se);}oe();{let d=ne(K(C(),X,G,1));p&&d>0&&(w=d),k=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{P=x.isIntersecting,P&&!A?M=requestAnimationFrame(se):cancelAnimationFrame(M);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,O=false,k=0,A=false,D(0);},pause(){A=true,cancelAnimationFrame(M);},resume(){A&&(A=false,P&&(M=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,A=true,cancelAnimationFrame(M),D(x);},getProgress(){return k}}}var Ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function mt(e,n={}){if(typeof window>"u")return Ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Ht;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Pe=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,M=0,P=0,A=false,w=false,k=-1,O=0,C=false,E=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let S=t.getBoundingClientRect(),F=u==="x"?S.left:S.top,fe=u==="x"?S.width:S.height,Q=xe({top:F,height:fe},oe(),D(),Pe,B);G=Q.tStart,M=Q.tEnd;}let ie=NaN;function ee(S){if(!E)return;let F=X??t.duration??0,fe=J+(F-J)*S;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(S)),V?.(S);}function ae(){if(!A||w||!E)return;let S=ne(K(oe(),G,M,1));c&&(k=Math.max(k,S),S=k),O=S,ee(S),S>=1&&!C?(C=true,T?.()):S<1&&!c&&(C=false),P=requestAnimationFrame(ae);}function d(){if(E=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),A&&!w&&(P=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),E||se();let x=new IntersectionObserver(S=>{S.forEach(F=>{A=F.isIntersecting,A&&!w&&E?P=requestAnimationFrame(ae):cancelAnimationFrame(P);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:G,tEnd:M})}),{destroy(){cancelAnimationFrame(P),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){k=-1,C=false,O=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(P);},resume(){w&&(w=false,A&&E&&(P=requestAnimationFrame(ae)));},seek(S){let F=Math.min(1,Math.max(0,S));O=F,k=F,w=true,cancelAnimationFrame(P),ie=NaN,ee(F);},getProgress(){return O}}}function Nt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function ar(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ft(e){let n=Nt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function lr(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function cr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Rt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,n={}){if(typeof window>"u")return Rt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Rt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Pe=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=ar(t):l==="lines"?J=Ft(t):J=Nt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let S=cr(L,u);S&&(g.style.transform=S);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,S)=>{let F=$(lr(g,S,X,s));G(L,F);});}if(V)return M(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let P=0,A=0,w=0,k=false,O=false,C=-1,E=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Pe);P=L.tStart,A=L.tEnd;}function ee(){if(!k||O)return;let g=K(D(),P,A,1);p&&(C=Math.max(C,g),g=C),E=g,M(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{k=L.isIntersecting,k&&!O?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Ft(t),M(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:P,tEnd:A})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){C=-1,oe=false,E=0,O=false,M(0);},pause(){O=true,cancelAnimationFrame(w);},resume(){O&&(O=false,k&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));E=L,C=L,O=true,cancelAnimationFrame(w),M(L);},getProgress(){return E}}}function Gr(e={}){let n,r;return onMount(()=>{n&&(r=at(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function jr(e={}){let n,r;return onMount(()=>{n&&(r=at(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Yr(e){let n,r;return onMount(()=>{n&&(r=lt(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Ur(e){let n,r;return onMount(()=>{n&&(r=lt(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Xr(e){let n,r;return onMount(()=>{n&&(r=ut(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Qr(e){let n,r;return onMount(()=>{n&&(r=ut(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Zr(e={}){let n,r;return onMount(()=>{n&&(r=mt(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function Kr(e={}){let n,r;return onMount(()=>{n&&(r=mt(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}function Jr(e={}){let n,r;return onMount(()=>{n&&(r=ft(n,e));}),onCleanup(()=>{r?.destroy();}),t=>{n=t;}}function en(e={}){let n,r;return onMount(()=>{n&&(r=ft(n,e));}),onCleanup(()=>{r?.destroy(),r=void 0;}),{ref:t=>{n=t;},getInstance:()=>r}}export{Ur as createScrollAnimate,Qr as createScrollCounter,jr as createScrollDraw,en as createScrollText,Kr as createScrollVideo,Yr as useScrollAnimate,Xr as useScrollCounter,Gr as useScrollDraw,Jr as useScrollText,Zr as useScrollVideo};
@@ -1,3 +1,3 @@
1
- 'use strict';function Vt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function zt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Vt(),elastic:zt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function wt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function vt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function _t(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:_t((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=wt(e.top,e.height,n,t.element)-vt(t.viewport,r),c=wt(e.top,e.height,n,l.element)-vt(l.viewport,r);return {tStart:s,tEnd:c}}function St(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=St(e),l=St(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Wt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function Bt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Gt(e){let n=[];for(let r=0;r<Tt;r++){let t=r/(Tt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return qt;case "ease-out":return Wt;case "ease-in-out":return Bt()?Gt(re["ease-in-out"]):null;default:return null}}var xt=Symbol.for("svg-scroll-draw.registry");function At(){let e=globalThis;return e[xt]||(e[xt]=new Map)}function Le(e,n){At().set(e,n);}function $e(e){At().delete(e);}var jt=0;function Yt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ut(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?we("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Xt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
1
+ 'use strict';function _t({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function qt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:_t(),elastic:qt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function wt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function vt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Wt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:Wt((e-n)/(r-n)*t,0,1)}function Ze(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=wt(e.top,e.height,n,t.element)-vt(t.viewport,r),c=wt(e.top,e.height,n,l.element)-vt(l.viewport,r);return {tStart:s,tEnd:c}}function St(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=St(e),l=St(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Be=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Be&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Bt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Gt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Yt(e){let n=[];for(let r=0;r<Tt;r++){let t=r/(Tt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return Bt;case "ease-out":return Gt;case "ease-in-out":return jt()?Yt(re["ease-in-out"]):null;default:return null}}var xt=Symbol.for("svg-scroll-draw.registry");function At(){let e=globalThis;return e[xt]||(e[xt]=new Map)}function Le(e,n){At().set(e,n);}function $e(e){At().delete(e);}var Ut=0;function Xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Mt(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Lt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Qt(e){if(!Be)return;let n=Mt(e,"stroke");if(!n||n==="none"){we("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Lt.has(r)&&!Lt.has(Mt(e,"fill"))&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Zt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Mt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Lt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Qt(e,n,r){if(!Ze)return;let t=(e.match(Lt)??[]).join("").toUpperCase(),l=(n.match(Lt)??[]).join("").toUpperCase(),s=(e.match(Mt)??[]).length,c=(n.match(Mt)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Je(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Ce=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:C,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:P="0px",repeat:S=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:R,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),Ne=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(C)?C[0]:null,j=Array.isArray(C)?C[1]:typeof C=="number"?C:null,pe=Array.isArray(M)?M[0]:null,Z=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,H=false,_=false,q=0,Ae=false,ye=-1,te=-1,Y=false,he=0,ke=0,Fe,ot=null;function mt(){ot?.destroy(),ot=null;}let Re=new Set,ft=NaN,He=true,Be=-1,pt=performance.now(),Ve=NaN;function st(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function dt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function gt(){let o=Qe(e,ve,B);return xe(o,o.scroll,dt(),Pe,Ne)}function yt(){(({tStart:f,tEnd:ge}=gt())),Ce&&Ze&&(mt(),ot=Xt(f,ge,B));}function it(o,a=gt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Ft(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=_e(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],D,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Ut(o);let a=ze(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Qt(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof p=="string"?Ke(p):null;function Rt(){return !(ae===false||!Yt()||!z.length||!ht||Q||B!=="y"||ve||u!==1||V!==0||ne||X||O!==false||D||w||S||G>0||d||x||g||L||E||R||fe||A!=null||C!=null||M!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Ht(){let o=++jt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=$==="reverse"?"0":"var(--ssd-len)",Oe=$==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${Oe};`;m&&(Me+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,N=-1;function W(){if(N>=0)return N;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},st(),dt(),Pe,Ne);return Ee(K(st(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),F.remove();},replay(){h=false,N=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));N=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=ze(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(Rt())return it(Ht());function Nt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function De(h){let N=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(N=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Ee(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Se&&le?W.style.stroke=_e(Se,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",ct(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(N=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Re.has(Te)&&(Re.add(Te),w[U]?.());}}return N}function Oe(h){if(Y)return;let N=h-a;_||(_=true,x?.());let W=De(N);if(W&&!H){H=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{a=performance.now(),_=false,H=false,Re.clear(),Ge(),q=requestAnimationFrame(Oe);},oe));return}W||(q=requestAnimationFrame(Oe));}function Me(){cancelAnimationFrame(q),clearTimeout(Fe),a=performance.now(),b=0,Y=false,_=false,H=false,ke=0,ue=true,he=0,Re.clear(),Ge(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(ne&&H)?Me():!N.isIntersecting&&!ne&&!H&&(cancelAnimationFrame(q),clearTimeout(Fe),ue=false);});},{root:ve??null,threshold:k,rootMargin:P}),F;function me(){clearTimeout(F),F=setTimeout(()=>{z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Fe),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(F);},replay(){ke=0,Me();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let N=Math.min(1,Math.max(0,h));he=N,Y=true,b=N*o,a=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return he},refresh(){clearTimeout(F),z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});}}}if(ie)return it(Nt());yt();function je(){if(!Ae||Y)return;let o=performance.now(),a=st();if(!He&&O===false&&a===ft){q=requestAnimationFrame(je);return}He=false,ft=a;let b=u;if(O!==false){let v=o-pt,F=v>0?Math.abs(a-(Be<0?a:Be))/v:0;b=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Be=a,pt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let De=ge-f,Oe=true,Me=De===0?0:(a-f)/De;if(isNaN(Ve)||(Ve<=0&&Me>0?L?.():Ve>0&&Me<=0&&fe?.(),Ve<1&&Me>=1?E?.():Ve>=1&&Me<1&&R?.()),Ve=Me,Q){let v=Ee(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let F=ue==="reverse"?1-v:v;e.style.clipPath=Ie(F),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(H=false),q=requestAnimationFrame(je);return}if(z.forEach((v,F)=>{let me=F*V*De,h=Ee(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[F]*h}`:`${I[F]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=_e(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[F]&&v.setAttribute("d",ct(i[F],D,h)),F===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=Ee(K(a,f,ge,b));for(let F in w){let me=parseFloat(F);v>=me&&!Re.has(me)&&(Re.add(me),w[F]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),Oe&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,Re.clear(),Ge(),He=true;},oe))):!Oe&&!ne&&(H=false),q=requestAnimationFrame(je);}let at=false;function Ye(){at||(at=true,q=requestAnimationFrame(function(){je();}));}function Ue(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!Y?(He=true,Ye()):Ue();});},{root:ve??null,threshold:k,rootMargin:P});function bt(){z.forEach((o,a)=>{I[a]=ze(o),o.style.strokeDasharray=`${I[a]}`;}),yt(),He=true;}let Xe;function qe(){clearTimeout(Xe),Xe=setTimeout(bt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(Fe),Ue(),lt.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Xe),mt();},replay(){ye=-1,te=-1,Be=-1,_=false,H=false,ke=0,Y=false,he=0,Re.clear(),clearTimeout(Fe),Ge(),He=true,Ae&&Ye();},pause(){Y=true,Ue();},resume(){Y&&(Y=false,He=true,Ae&&Ye());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Ue(),Ft(a,$),He=true;},getProgress(){return he},refresh(){clearTimeout(Xe),bt(),Ae&&!Y&&Ye();}},()=>({tStart:f,tEnd:ge}))}function Zt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function $t(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function Kt(e,n,r){let t=$t(e),l=$t(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Ct(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Zt(t))return _e(t,l,r);if(t.includes("("))return Kt(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function Jt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var er=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),tr=0,Pt="--scroll-draw-progress";function rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Ce,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,C=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),O=de(l.end??"bottom top"),k=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:Jt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Pt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(C)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?Ke(s):null;function ae(){if(!T||!rr()||!ee||m!=="y"||P||k!==e||u||c!==1||Ce||B||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!er.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++tr}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,O)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),H.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,Ct(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Ae();return M(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,R=false,fe=-1,Q=0,Ee=false,Pe=NaN,Ne=-1,ve=0,Se=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Qe(k,P,m),f=xe(i,i.scroll,le(),w,O);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Pt,String(i));for(let f of S)e.style.setProperty(f.prop,Ct(f.from,f.to,i));Ce?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!E||R)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(Ne<0?f:Ne))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}Ne=f,ve=i;let H=g===x?0:(f-x)/(g-x);pe(H);let _=M(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,B?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!R?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:P??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Ee=false,Q=0,R=false,j(0);},pause(){R=true,cancelAnimationFrame(L);},resume(){R&&(R=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,R=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ut;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Ce=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ut;let X=0,G=0,A=0,C=false,M=false,w=-1,O=0,k=false,P=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),S(),Ce,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!C||M)return;let d=ne(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),O=d,D(d),d>=1&&!k?(k=true,V?.()):d<1&&!p&&(k=false),A=requestAnimationFrame(se);}oe();{let d=ne(K(P(),X,G,1));p&&d>0&&(w=d),O=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{C=x.isIntersecting,C&&!M?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,C&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));O=x,w=x,M=true,cancelAnimationFrame(A),D(x);},getProgress(){return O}}}var It={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return It;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),It;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Ce=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,A=0,C=0,M=false,w=false,O=-1,k=0,P=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),R=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:R,height:fe},oe(),D(),Ce,B);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let R=X??t.duration??0,fe=J+(R-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!M||w||!S)return;let E=ne(K(oe(),G,A,1));c&&(O=Math.max(O,E),E=O),k=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),C=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),M&&!w&&(C=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(R=>{M=R.isIntersecting,M&&!w&&S?C=requestAnimationFrame(ae):cancelAnimationFrame(C);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(C),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){O=-1,P=false,k=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,M&&S&&(C=requestAnimationFrame(ae)));},seek(E){let R=Math.min(1,Math.max(0,E));k=R,O=R,w=true,cancelAnimationFrame(C),ie=NaN,ee(R);},getProgress(){return k}}}function Dt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function nr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ot(e){let n=Dt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function or(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function sr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),kt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Ce=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=nr(t):l==="lines"?J=Ot(t):J=Dt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=sr(L,u);E&&(g.style.transform=E);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let R=$(or(g,E,X,s));G(L,R);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let C=0,M=0,w=0,O=false,k=false,P=-1,S=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Ce);C=L.tStart,M=L.tEnd;}function ee(){if(!O||k)return;let g=K(D(),C,M,1);p&&(P=Math.max(P,g),g=P),S=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{O=L.isIntersecting,O&&!k?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Ot(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){P=-1,oe=false,S=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,P=L,k=true,cancelAnimationFrame(w),A(L);},getProgress(){return S}}}function zr(e,n={}){let r=Je(e,n);return {update(t){r.destroy(),r=Je(e,t);},destroy(){r.destroy();}}}function _r(e={}){let n=null;function r(t){return n=Je(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function qr(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Wr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function Gr(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function jr(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Yr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Ur(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Xr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}exports.createScrollAnimate=Wr;exports.createScrollCounter=Gr;exports.createScrollDraw=_r;exports.createScrollText=Xr;exports.createScrollVideo=Yr;exports.scrollAnimate=qr;exports.scrollCounterAction=Br;exports.scrollDraw=zr;exports.scrollTextAction=Ur;exports.scrollVideoAction=jr;
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var $t=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Pt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Kt(e,n,r){if(!Be)return;let t=(e.match(Pt)??[]).join("").toUpperCase(),l=(n.match(Pt)??[]).join("").toUpperCase(),s=(e.match($t)??[]).length,c=(n.match($t)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Je(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Pe=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:P,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:C="0px",repeat:S=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:R,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Ce=de(T.start??"top bottom"),He=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(P)?P[0]:null,j=Array.isArray(P)?P[1]:typeof P=="number"?P:null,pe=Array.isArray(M)?M[0]:null,Z=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,N=false,_=false,q=0,Ae=false,ye=-1,te=-1,Y=false,he=0,ke=0,Fe,ot=null;function mt(){ot?.destroy(),ot=null;}let Re=new Set,ft=NaN,Ne=true,Ge=-1,pt=performance.now(),Ve=NaN;function st(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function dt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function gt(){let o=Ze(e,ve,B);return xe(o,o.scroll,dt(),Ce,He)}function yt(){(({tStart:f,tEnd:ge}=gt())),Pe&&Be&&(mt(),ot=Zt(f,ge,B));}function it(o,a=gt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Nt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=_e(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Qt(o);let a=ze(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Kt(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof p=="string"?Ke(p):null;function Ht(){return !(ae===false||!Xt()||!z.length||!ht||Q||B!=="y"||ve||u!==1||V!==0||ne||X||O!==false||D||w||S||G>0||d||x||g||L||E||R||fe||A!=null||P!=null||M!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Vt(){let o=++Ut,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=$==="reverse"?"0":"var(--ssd-len)",Oe=$==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${Oe};`;m&&(Me+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,H=-1;function W(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},st(),dt(),Ce,He);return Ee(K(st(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),F.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));H=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=ze(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(Ht())return it(Vt());function zt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function De(h){let H=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(H=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Ee(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Se&&le?W.style.stroke=_e(Se,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",ct(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(H=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Re.has(Te)&&(Re.add(Te),w[U]?.());}}return H}function Oe(h){if(Y)return;let H=h-a;_||(_=true,x?.());let W=De(H);if(W&&!N){N=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{a=performance.now(),_=false,N=false,Re.clear(),je(),q=requestAnimationFrame(Oe);},oe));return}W||(q=requestAnimationFrame(Oe));}function Me(){cancelAnimationFrame(q),clearTimeout(Fe),a=performance.now(),b=0,Y=false,_=false,N=false,ke=0,ue=true,he=0,Re.clear(),je(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(ne&&N)?Me():!H.isIntersecting&&!ne&&!N&&(cancelAnimationFrame(q),clearTimeout(Fe),ue=false);});},{root:ve??null,threshold:k,rootMargin:C}),F;function me(){clearTimeout(F),F=setTimeout(()=>{z.forEach((h,H)=>{I[H]=ze(h),h.style.strokeDasharray=`${I[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Fe),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(F);},replay(){ke=0,Me();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let H=Math.min(1,Math.max(0,h));he=H,Y=true,b=H*o,a=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return he},refresh(){clearTimeout(F),z.forEach((h,H)=>{I[H]=ze(h),h.style.strokeDasharray=`${I[H]}`;});}}}if(ie)return it(zt());yt();function Ye(){if(!Ae||Y)return;let o=performance.now(),a=st();if(!Ne&&O===false&&a===ft){q=requestAnimationFrame(Ye);return}Ne=false,ft=a;let b=u;if(O!==false){let v=o-pt,F=v>0?Math.abs(a-(Ge<0?a:Ge))/v:0;b=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Ge=a,pt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let De=ge-f,Oe=true,Me=De===0?0:(a-f)/De;if(isNaN(Ve)||(Ve<=0&&Me>0?L?.():Ve>0&&Me<=0&&fe?.(),Ve<1&&Me>=1?E?.():Ve>=1&&Me<1&&R?.()),Ve=Me,Q){let v=Ee(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let F=ue==="reverse"?1-v:v;e.style.clipPath=Ie(F),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!N?(N=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,N=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(N=false),q=requestAnimationFrame(Ye);return}if(z.forEach((v,F)=>{let me=F*V*De,h=Ee(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[F]*h}`:`${I[F]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=_e(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[F]&&v.setAttribute("d",ct(i[F],D,h)),F===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=Ee(K(a,f,ge,b));for(let F in w){let me=parseFloat(F);v>=me&&!Re.has(me)&&(Re.add(me),w[F]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),Oe&&!N?(N=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,N=false,Re.clear(),je(),Ne=true;},oe))):!Oe&&!ne&&(N=false),q=requestAnimationFrame(Ye);}let at=false;function Ue(){at||(at=true,q=requestAnimationFrame(function(){Ye();}));}function Xe(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!Y?(Ne=true,Ue()):Xe();});},{root:ve??null,threshold:k,rootMargin:C});function bt(){z.forEach((o,a)=>{I[a]=ze(o),o.style.strokeDasharray=`${I[a]}`;}),yt(),Ne=true;}let Qe;function qe(){clearTimeout(Qe),Qe=setTimeout(bt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(Fe),Xe(),lt.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Qe),mt();},replay(){ye=-1,te=-1,Ge=-1,_=false,N=false,ke=0,Y=false,he=0,Re.clear(),clearTimeout(Fe),je(),Ne=true,Ae&&Ue();},pause(){Y=true,Xe();},resume(){Y&&(Y=false,Ne=true,Ae&&Ue());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Xe(),Nt(a,$),Ne=true;},getProgress(){return he},refresh(){clearTimeout(Qe),bt(),Ae&&!Y&&Ue();}},()=>({tStart:f,tEnd:ge}))}function Jt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ct(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function er(e,n,r){let t=Ct(e),l=Ct(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function It(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Jt(t))return _e(t,l,r);if(t.includes("("))return er(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function tr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var rr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),nr=0,Ot="--scroll-draw-progress";function or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Pe,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,P=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),O=de(l.end??"bottom top"),k=ne??e,C=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:tr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Ot])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(P)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?Ke(s):null;function ae(){if(!T||!or()||!ee||m!=="y"||C||k!==e||u||c!==1||Pe||B||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!rr.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++nr}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,O)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,It(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Ae();return M(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,R=false,fe=-1,Q=0,Ee=false,Ce=NaN,He=-1,ve=0,Se=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Ze(k,C,m),f=xe(i,i.scroll,le(),w,O);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Ot,String(i));for(let f of S)e.style.setProperty(f.prop,It(f.from,f.to,i));Pe?.(i);}function pe(i){if(isNaN(Ce)){Ce=i;return}Ce<=0&&i>0?J?.():Ce>0&&i<=0&&A?.(),Ce<1&&i>=1?X?.():Ce>=1&&i<1&&G?.(),Ce=i;}function Z(){if(!E||R)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(He<0?f:He))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}He=f,ve=i;let N=g===x?0:(f-x)/(g-x);pe(N);let _=M(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,B?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!R?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:C??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Ee=false,Q=0,R=false,j(0);},pause(){R=true,cancelAnimationFrame(L);},resume(){R&&(R=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,R=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ut;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Pe=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ut;let X=0,G=0,A=0,P=false,M=false,w=-1,O=0,k=false,C=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},C(),S(),Pe,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!P||M)return;let d=ne(K(C(),X,G,1));p&&(w=Math.max(w,d),d=w),O=d,D(d),d>=1&&!k?(k=true,V?.()):d<1&&!p&&(k=false),A=requestAnimationFrame(se);}oe();{let d=ne(K(C(),X,G,1));p&&d>0&&(w=d),O=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{P=x.isIntersecting,P&&!M?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,P&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));O=x,w=x,M=true,cancelAnimationFrame(A),D(x);},getProgress(){return O}}}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),kt;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Pe=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,A=0,P=0,M=false,w=false,O=-1,k=0,C=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),R=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:R,height:fe},oe(),D(),Pe,B);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let R=X??t.duration??0,fe=J+(R-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!M||w||!S)return;let E=ne(K(oe(),G,A,1));c&&(O=Math.max(O,E),E=O),k=E,ee(E),E>=1&&!C?(C=true,T?.()):E<1&&!c&&(C=false),P=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),M&&!w&&(P=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(R=>{M=R.isIntersecting,M&&!w&&S?P=requestAnimationFrame(ae):cancelAnimationFrame(P);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(P),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){O=-1,C=false,k=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(P);},resume(){w&&(w=false,M&&S&&(P=requestAnimationFrame(ae)));},seek(E){let R=Math.min(1,Math.max(0,E));k=R,O=R,w=true,cancelAnimationFrame(P),ie=NaN,ee(R);},getProgress(){return k}}}function Rt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function sr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Dt(e){let n=Rt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function ir(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function ar(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return Ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Ft;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Pe=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=sr(t):l==="lines"?J=Dt(t):J=Rt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=ar(L,u);E&&(g.style.transform=E);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let R=$(ir(g,E,X,s));G(L,R);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let P=0,M=0,w=0,O=false,k=false,C=-1,S=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Pe);P=L.tStart,M=L.tEnd;}function ee(){if(!O||k)return;let g=K(D(),P,M,1);p&&(C=Math.max(C,g),g=C),S=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{O=L.isIntersecting,O&&!k?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Dt(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:P,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){C=-1,oe=false,S=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,C=L,k=true,cancelAnimationFrame(w),A(L);},getProgress(){return S}}}function qr(e,n={}){let r=Je(e,n);return {update(t){r.destroy(),r=Je(e,t);},destroy(){r.destroy();}}}function Wr(e={}){let n=null;function r(t){return n=Je(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Gr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function jr(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function Yr(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Ur(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Xr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Qr(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Zr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}exports.createScrollAnimate=Gr;exports.createScrollCounter=Yr;exports.createScrollDraw=Wr;exports.createScrollText=Zr;exports.createScrollVideo=Xr;exports.scrollAnimate=Br;exports.scrollCounterAction=jr;exports.scrollDraw=qr;exports.scrollTextAction=Qr;exports.scrollVideoAction=Ur;
@@ -1,3 +1,3 @@
1
- function Vt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function zt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Vt(),elastic:zt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function wt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function vt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function _t(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:_t((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=wt(e.top,e.height,n,t.element)-vt(t.viewport,r),c=wt(e.top,e.height,n,l.element)-vt(l.viewport,r);return {tStart:s,tEnd:c}}function St(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=St(e),l=St(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Wt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function Bt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Gt(e){let n=[];for(let r=0;r<Tt;r++){let t=r/(Tt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return qt;case "ease-out":return Wt;case "ease-in-out":return Bt()?Gt(re["ease-in-out"]):null;default:return null}}var xt=Symbol.for("svg-scroll-draw.registry");function At(){let e=globalThis;return e[xt]||(e[xt]=new Map)}function Le(e,n){At().set(e,n);}function $e(e){At().delete(e);}var jt=0;function Yt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ut(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?we("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Xt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
1
+ function _t({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function qt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:_t(),elastic:qt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function wt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function vt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Wt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:Wt((e-n)/(r-n)*t,0,1)}function Ze(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=wt(e.top,e.height,n,t.element)-vt(t.viewport,r),c=wt(e.top,e.height,n,l.element)-vt(l.viewport,r);return {tStart:s,tEnd:c}}function St(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=St(e),l=St(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Be=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Be&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Bt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Gt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Yt(e){let n=[];for(let r=0;r<Tt;r++){let t=r/(Tt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return Bt;case "ease-out":return Gt;case "ease-in-out":return jt()?Yt(re["ease-in-out"]):null;default:return null}}var xt=Symbol.for("svg-scroll-draw.registry");function At(){let e=globalThis;return e[xt]||(e[xt]=new Map)}function Le(e,n){At().set(e,n);}function $e(e){At().delete(e);}var Ut=0;function Xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Mt(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Lt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Qt(e){if(!Be)return;let n=Mt(e,"stroke");if(!n||n==="none"){we("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Lt.has(r)&&!Lt.has(Mt(e,"fill"))&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Zt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Mt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Lt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Qt(e,n,r){if(!Ze)return;let t=(e.match(Lt)??[]).join("").toUpperCase(),l=(n.match(Lt)??[]).join("").toUpperCase(),s=(e.match(Mt)??[]).length,c=(n.match(Mt)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Je(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Ce=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:C,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:P="0px",repeat:S=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:R,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),Ne=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(C)?C[0]:null,j=Array.isArray(C)?C[1]:typeof C=="number"?C:null,pe=Array.isArray(M)?M[0]:null,Z=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,H=false,_=false,q=0,Ae=false,ye=-1,te=-1,Y=false,he=0,ke=0,Fe,ot=null;function mt(){ot?.destroy(),ot=null;}let Re=new Set,ft=NaN,He=true,Be=-1,pt=performance.now(),Ve=NaN;function st(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function dt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function gt(){let o=Qe(e,ve,B);return xe(o,o.scroll,dt(),Pe,Ne)}function yt(){(({tStart:f,tEnd:ge}=gt())),Ce&&Ze&&(mt(),ot=Xt(f,ge,B));}function it(o,a=gt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Ft(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=_e(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],D,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Ut(o);let a=ze(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Qt(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof p=="string"?Ke(p):null;function Rt(){return !(ae===false||!Yt()||!z.length||!ht||Q||B!=="y"||ve||u!==1||V!==0||ne||X||O!==false||D||w||S||G>0||d||x||g||L||E||R||fe||A!=null||C!=null||M!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Ht(){let o=++jt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=$==="reverse"?"0":"var(--ssd-len)",Oe=$==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${Oe};`;m&&(Me+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,N=-1;function W(){if(N>=0)return N;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},st(),dt(),Pe,Ne);return Ee(K(st(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),F.remove();},replay(){h=false,N=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));N=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=ze(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(Rt())return it(Ht());function Nt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function De(h){let N=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(N=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Ee(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Se&&le?W.style.stroke=_e(Se,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",ct(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(N=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Re.has(Te)&&(Re.add(Te),w[U]?.());}}return N}function Oe(h){if(Y)return;let N=h-a;_||(_=true,x?.());let W=De(N);if(W&&!H){H=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{a=performance.now(),_=false,H=false,Re.clear(),Ge(),q=requestAnimationFrame(Oe);},oe));return}W||(q=requestAnimationFrame(Oe));}function Me(){cancelAnimationFrame(q),clearTimeout(Fe),a=performance.now(),b=0,Y=false,_=false,H=false,ke=0,ue=true,he=0,Re.clear(),Ge(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(ne&&H)?Me():!N.isIntersecting&&!ne&&!H&&(cancelAnimationFrame(q),clearTimeout(Fe),ue=false);});},{root:ve??null,threshold:k,rootMargin:P}),F;function me(){clearTimeout(F),F=setTimeout(()=>{z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Fe),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(F);},replay(){ke=0,Me();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let N=Math.min(1,Math.max(0,h));he=N,Y=true,b=N*o,a=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return he},refresh(){clearTimeout(F),z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});}}}if(ie)return it(Nt());yt();function je(){if(!Ae||Y)return;let o=performance.now(),a=st();if(!He&&O===false&&a===ft){q=requestAnimationFrame(je);return}He=false,ft=a;let b=u;if(O!==false){let v=o-pt,F=v>0?Math.abs(a-(Be<0?a:Be))/v:0;b=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Be=a,pt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let De=ge-f,Oe=true,Me=De===0?0:(a-f)/De;if(isNaN(Ve)||(Ve<=0&&Me>0?L?.():Ve>0&&Me<=0&&fe?.(),Ve<1&&Me>=1?E?.():Ve>=1&&Me<1&&R?.()),Ve=Me,Q){let v=Ee(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let F=ue==="reverse"?1-v:v;e.style.clipPath=Ie(F),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(H=false),q=requestAnimationFrame(je);return}if(z.forEach((v,F)=>{let me=F*V*De,h=Ee(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[F]*h}`:`${I[F]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=_e(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[F]&&v.setAttribute("d",ct(i[F],D,h)),F===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=Ee(K(a,f,ge,b));for(let F in w){let me=parseFloat(F);v>=me&&!Re.has(me)&&(Re.add(me),w[F]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),Oe&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,Re.clear(),Ge(),He=true;},oe))):!Oe&&!ne&&(H=false),q=requestAnimationFrame(je);}let at=false;function Ye(){at||(at=true,q=requestAnimationFrame(function(){je();}));}function Ue(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!Y?(He=true,Ye()):Ue();});},{root:ve??null,threshold:k,rootMargin:P});function bt(){z.forEach((o,a)=>{I[a]=ze(o),o.style.strokeDasharray=`${I[a]}`;}),yt(),He=true;}let Xe;function qe(){clearTimeout(Xe),Xe=setTimeout(bt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(Fe),Ue(),lt.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Xe),mt();},replay(){ye=-1,te=-1,Be=-1,_=false,H=false,ke=0,Y=false,he=0,Re.clear(),clearTimeout(Fe),Ge(),He=true,Ae&&Ye();},pause(){Y=true,Ue();},resume(){Y&&(Y=false,He=true,Ae&&Ye());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Ue(),Ft(a,$),He=true;},getProgress(){return he},refresh(){clearTimeout(Xe),bt(),Ae&&!Y&&Ye();}},()=>({tStart:f,tEnd:ge}))}function Zt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function $t(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function Kt(e,n,r){let t=$t(e),l=$t(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Ct(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Zt(t))return _e(t,l,r);if(t.includes("("))return Kt(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function Jt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var er=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),tr=0,Pt="--scroll-draw-progress";function rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Ce,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,C=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),O=de(l.end??"bottom top"),k=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:Jt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Pt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(C)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?Ke(s):null;function ae(){if(!T||!rr()||!ee||m!=="y"||P||k!==e||u||c!==1||Ce||B||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!er.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++tr}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,O)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),H.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,Ct(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Ae();return M(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,R=false,fe=-1,Q=0,Ee=false,Pe=NaN,Ne=-1,ve=0,Se=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Qe(k,P,m),f=xe(i,i.scroll,le(),w,O);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Pt,String(i));for(let f of S)e.style.setProperty(f.prop,Ct(f.from,f.to,i));Ce?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!E||R)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(Ne<0?f:Ne))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}Ne=f,ve=i;let H=g===x?0:(f-x)/(g-x);pe(H);let _=M(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,B?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!R?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:P??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Ee=false,Q=0,R=false,j(0);},pause(){R=true,cancelAnimationFrame(L);},resume(){R&&(R=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,R=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ut;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Ce=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ut;let X=0,G=0,A=0,C=false,M=false,w=-1,O=0,k=false,P=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),S(),Ce,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!C||M)return;let d=ne(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),O=d,D(d),d>=1&&!k?(k=true,V?.()):d<1&&!p&&(k=false),A=requestAnimationFrame(se);}oe();{let d=ne(K(P(),X,G,1));p&&d>0&&(w=d),O=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{C=x.isIntersecting,C&&!M?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,C&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));O=x,w=x,M=true,cancelAnimationFrame(A),D(x);},getProgress(){return O}}}var It={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return It;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),It;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Ce=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,A=0,C=0,M=false,w=false,O=-1,k=0,P=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),R=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:R,height:fe},oe(),D(),Ce,B);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let R=X??t.duration??0,fe=J+(R-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!M||w||!S)return;let E=ne(K(oe(),G,A,1));c&&(O=Math.max(O,E),E=O),k=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),C=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),M&&!w&&(C=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(R=>{M=R.isIntersecting,M&&!w&&S?C=requestAnimationFrame(ae):cancelAnimationFrame(C);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(C),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){O=-1,P=false,k=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,M&&S&&(C=requestAnimationFrame(ae)));},seek(E){let R=Math.min(1,Math.max(0,E));k=R,O=R,w=true,cancelAnimationFrame(C),ie=NaN,ee(R);},getProgress(){return k}}}function Dt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function nr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ot(e){let n=Dt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function or(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function sr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),kt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Ce=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=nr(t):l==="lines"?J=Ot(t):J=Dt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=sr(L,u);E&&(g.style.transform=E);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let R=$(or(g,E,X,s));G(L,R);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let C=0,M=0,w=0,O=false,k=false,P=-1,S=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Ce);C=L.tStart,M=L.tEnd;}function ee(){if(!O||k)return;let g=K(D(),C,M,1);p&&(P=Math.max(P,g),g=P),S=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{O=L.isIntersecting,O&&!k?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Ot(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){P=-1,oe=false,S=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,P=L,k=true,cancelAnimationFrame(w),A(L);},getProgress(){return S}}}function zr(e,n={}){let r=Je(e,n);return {update(t){r.destroy(),r=Je(e,t);},destroy(){r.destroy();}}}function _r(e={}){let n=null;function r(t){return n=Je(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function qr(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Wr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function Gr(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function jr(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Yr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Ur(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Xr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}export{Wr as createScrollAnimate,Gr as createScrollCounter,_r as createScrollDraw,Xr as createScrollText,Yr as createScrollVideo,qr as scrollAnimate,Br as scrollCounterAction,zr as scrollDraw,Ur as scrollTextAction,jr as scrollVideoAction};
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var $t=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Pt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Kt(e,n,r){if(!Be)return;let t=(e.match(Pt)??[]).join("").toUpperCase(),l=(n.match(Pt)??[]).join("").toUpperCase(),s=(e.match($t)??[]).length,c=(n.match($t)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Je(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Pe=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:P,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:C="0px",repeat:S=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:R,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Ce=de(T.start??"top bottom"),He=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(P)?P[0]:null,j=Array.isArray(P)?P[1]:typeof P=="number"?P:null,pe=Array.isArray(M)?M[0]:null,Z=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,N=false,_=false,q=0,Ae=false,ye=-1,te=-1,Y=false,he=0,ke=0,Fe,ot=null;function mt(){ot?.destroy(),ot=null;}let Re=new Set,ft=NaN,Ne=true,Ge=-1,pt=performance.now(),Ve=NaN;function st(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function dt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function gt(){let o=Ze(e,ve,B);return xe(o,o.scroll,dt(),Ce,He)}function yt(){(({tStart:f,tEnd:ge}=gt())),Pe&&Be&&(mt(),ot=Zt(f,ge,B));}function it(o,a=gt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Nt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=_e(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Qt(o);let a=ze(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Kt(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof p=="string"?Ke(p):null;function Ht(){return !(ae===false||!Xt()||!z.length||!ht||Q||B!=="y"||ve||u!==1||V!==0||ne||X||O!==false||D||w||S||G>0||d||x||g||L||E||R||fe||A!=null||P!=null||M!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Vt(){let o=++Ut,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=$==="reverse"?"0":"var(--ssd-len)",Oe=$==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${Oe};`;m&&(Me+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,H=-1;function W(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},st(),dt(),Ce,He);return Ee(K(st(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),F.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));H=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=ze(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(Ht())return it(Vt());function zt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function De(h){let H=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(H=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Ee(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Se&&le?W.style.stroke=_e(Se,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",ct(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(H=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Re.has(Te)&&(Re.add(Te),w[U]?.());}}return H}function Oe(h){if(Y)return;let H=h-a;_||(_=true,x?.());let W=De(H);if(W&&!N){N=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{a=performance.now(),_=false,N=false,Re.clear(),je(),q=requestAnimationFrame(Oe);},oe));return}W||(q=requestAnimationFrame(Oe));}function Me(){cancelAnimationFrame(q),clearTimeout(Fe),a=performance.now(),b=0,Y=false,_=false,N=false,ke=0,ue=true,he=0,Re.clear(),je(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(ne&&N)?Me():!H.isIntersecting&&!ne&&!N&&(cancelAnimationFrame(q),clearTimeout(Fe),ue=false);});},{root:ve??null,threshold:k,rootMargin:C}),F;function me(){clearTimeout(F),F=setTimeout(()=>{z.forEach((h,H)=>{I[H]=ze(h),h.style.strokeDasharray=`${I[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Fe),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(F);},replay(){ke=0,Me();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let H=Math.min(1,Math.max(0,h));he=H,Y=true,b=H*o,a=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return he},refresh(){clearTimeout(F),z.forEach((h,H)=>{I[H]=ze(h),h.style.strokeDasharray=`${I[H]}`;});}}}if(ie)return it(zt());yt();function Ye(){if(!Ae||Y)return;let o=performance.now(),a=st();if(!Ne&&O===false&&a===ft){q=requestAnimationFrame(Ye);return}Ne=false,ft=a;let b=u;if(O!==false){let v=o-pt,F=v>0?Math.abs(a-(Ge<0?a:Ge))/v:0;b=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Ge=a,pt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let De=ge-f,Oe=true,Me=De===0?0:(a-f)/De;if(isNaN(Ve)||(Ve<=0&&Me>0?L?.():Ve>0&&Me<=0&&fe?.(),Ve<1&&Me>=1?E?.():Ve>=1&&Me<1&&R?.()),Ve=Me,Q){let v=Ee(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let F=ue==="reverse"?1-v:v;e.style.clipPath=Ie(F),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!N?(N=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,N=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(N=false),q=requestAnimationFrame(Ye);return}if(z.forEach((v,F)=>{let me=F*V*De,h=Ee(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[F]*h}`:`${I[F]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=_e(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[F]&&v.setAttribute("d",ct(i[F],D,h)),F===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=Ee(K(a,f,ge,b));for(let F in w){let me=parseFloat(F);v>=me&&!Re.has(me)&&(Re.add(me),w[F]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),Oe&&!N?(N=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,N=false,Re.clear(),je(),Ne=true;},oe))):!Oe&&!ne&&(N=false),q=requestAnimationFrame(Ye);}let at=false;function Ue(){at||(at=true,q=requestAnimationFrame(function(){Ye();}));}function Xe(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!Y?(Ne=true,Ue()):Xe();});},{root:ve??null,threshold:k,rootMargin:C});function bt(){z.forEach((o,a)=>{I[a]=ze(o),o.style.strokeDasharray=`${I[a]}`;}),yt(),Ne=true;}let Qe;function qe(){clearTimeout(Qe),Qe=setTimeout(bt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(Fe),Xe(),lt.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Qe),mt();},replay(){ye=-1,te=-1,Ge=-1,_=false,N=false,ke=0,Y=false,he=0,Re.clear(),clearTimeout(Fe),je(),Ne=true,Ae&&Ue();},pause(){Y=true,Xe();},resume(){Y&&(Y=false,Ne=true,Ae&&Ue());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Xe(),Nt(a,$),Ne=true;},getProgress(){return he},refresh(){clearTimeout(Qe),bt(),Ae&&!Y&&Ue();}},()=>({tStart:f,tEnd:ge}))}function Jt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ct(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function er(e,n,r){let t=Ct(e),l=Ct(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function It(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Jt(t))return _e(t,l,r);if(t.includes("("))return er(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function tr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var rr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),nr=0,Ot="--scroll-draw-progress";function or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Pe,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,P=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),O=de(l.end??"bottom top"),k=ne??e,C=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:tr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Ot])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(P)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?Ke(s):null;function ae(){if(!T||!or()||!ee||m!=="y"||C||k!==e||u||c!==1||Pe||B||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!rr.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++nr}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,O)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,It(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Ae();return M(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,R=false,fe=-1,Q=0,Ee=false,Ce=NaN,He=-1,ve=0,Se=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Ze(k,C,m),f=xe(i,i.scroll,le(),w,O);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Ot,String(i));for(let f of S)e.style.setProperty(f.prop,It(f.from,f.to,i));Pe?.(i);}function pe(i){if(isNaN(Ce)){Ce=i;return}Ce<=0&&i>0?J?.():Ce>0&&i<=0&&A?.(),Ce<1&&i>=1?X?.():Ce>=1&&i<1&&G?.(),Ce=i;}function Z(){if(!E||R)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(He<0?f:He))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}He=f,ve=i;let N=g===x?0:(f-x)/(g-x);pe(N);let _=M(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,B?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!R?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:C??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Ee=false,Q=0,R=false,j(0);},pause(){R=true,cancelAnimationFrame(L);},resume(){R&&(R=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,R=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ut;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Pe=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ut;let X=0,G=0,A=0,P=false,M=false,w=-1,O=0,k=false,C=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},C(),S(),Pe,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!P||M)return;let d=ne(K(C(),X,G,1));p&&(w=Math.max(w,d),d=w),O=d,D(d),d>=1&&!k?(k=true,V?.()):d<1&&!p&&(k=false),A=requestAnimationFrame(se);}oe();{let d=ne(K(C(),X,G,1));p&&d>0&&(w=d),O=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{P=x.isIntersecting,P&&!M?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,P&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));O=x,w=x,M=true,cancelAnimationFrame(A),D(x);},getProgress(){return O}}}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),kt;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Pe=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,A=0,P=0,M=false,w=false,O=-1,k=0,C=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),R=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:R,height:fe},oe(),D(),Pe,B);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let R=X??t.duration??0,fe=J+(R-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!M||w||!S)return;let E=ne(K(oe(),G,A,1));c&&(O=Math.max(O,E),E=O),k=E,ee(E),E>=1&&!C?(C=true,T?.()):E<1&&!c&&(C=false),P=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),M&&!w&&(P=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(R=>{M=R.isIntersecting,M&&!w&&S?P=requestAnimationFrame(ae):cancelAnimationFrame(P);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(P),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){O=-1,C=false,k=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(P);},resume(){w&&(w=false,M&&S&&(P=requestAnimationFrame(ae)));},seek(E){let R=Math.min(1,Math.max(0,E));k=R,O=R,w=true,cancelAnimationFrame(P),ie=NaN,ee(R);},getProgress(){return k}}}function Rt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function sr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Dt(e){let n=Rt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function ir(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function ar(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return Ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Ft;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Pe=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=sr(t):l==="lines"?J=Dt(t):J=Rt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=ar(L,u);E&&(g.style.transform=E);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let R=$(ir(g,E,X,s));G(L,R);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let P=0,M=0,w=0,O=false,k=false,C=-1,S=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Pe);P=L.tStart,M=L.tEnd;}function ee(){if(!O||k)return;let g=K(D(),P,M,1);p&&(C=Math.max(C,g),g=C),S=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{O=L.isIntersecting,O&&!k?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Dt(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:P,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){C=-1,oe=false,S=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,C=L,k=true,cancelAnimationFrame(w),A(L);},getProgress(){return S}}}function qr(e,n={}){let r=Je(e,n);return {update(t){r.destroy(),r=Je(e,t);},destroy(){r.destroy();}}}function Wr(e={}){let n=null;function r(t){return n=Je(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Gr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function jr(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function Yr(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Ur(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Xr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Qr(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Zr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}export{Gr as createScrollAnimate,Yr as createScrollCounter,Wr as createScrollDraw,Zr as createScrollText,Xr as createScrollVideo,Br as scrollAnimate,jr as scrollCounterAction,qr as scrollDraw,Qr as scrollTextAction,Ur as scrollVideoAction};