svg-scroll-draw 2.7.0 → 2.9.0

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.
Files changed (50) hide show
  1. package/dist/angular/index.cjs +2 -2
  2. package/dist/angular/index.d.mts +6 -0
  3. package/dist/angular/index.d.ts +6 -0
  4. package/dist/angular/index.mjs +2 -2
  5. package/dist/astro/index.cjs +3 -3
  6. package/dist/astro/index.mjs +3 -3
  7. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  8. package/dist/group/index.cjs +3 -3
  9. package/dist/group/index.d.mts +6 -0
  10. package/dist/group/index.d.ts +6 -0
  11. package/dist/group/index.mjs +3 -3
  12. package/dist/horizontal/index.cjs +1 -0
  13. package/dist/horizontal/index.d.mts +61 -0
  14. package/dist/horizontal/index.d.ts +61 -0
  15. package/dist/horizontal/index.mjs +1 -0
  16. package/dist/index.cjs +2 -2
  17. package/dist/index.d.mts +6 -0
  18. package/dist/index.d.ts +6 -0
  19. package/dist/index.mjs +2 -2
  20. package/dist/nuxt/index.cjs +3 -3
  21. package/dist/nuxt/index.d.mts +6 -0
  22. package/dist/nuxt/index.d.ts +6 -0
  23. package/dist/nuxt/index.mjs +3 -3
  24. package/dist/pin/index.cjs +1 -1
  25. package/dist/pin/index.mjs +1 -1
  26. package/dist/progress/index.cjs +1 -0
  27. package/dist/progress/index.d.mts +59 -0
  28. package/dist/progress/index.d.ts +59 -0
  29. package/dist/progress/index.mjs +1 -0
  30. package/dist/react/index.cjs +3 -3
  31. package/dist/react/index.d.mts +6 -0
  32. package/dist/react/index.d.ts +6 -0
  33. package/dist/react/index.mjs +3 -3
  34. package/dist/reveal/index.cjs +1 -0
  35. package/dist/reveal/index.d.mts +80 -0
  36. package/dist/reveal/index.d.ts +80 -0
  37. package/dist/reveal/index.mjs +1 -0
  38. package/dist/solid/index.cjs +2 -2
  39. package/dist/solid/index.d.mts +6 -0
  40. package/dist/solid/index.d.ts +6 -0
  41. package/dist/solid/index.mjs +2 -2
  42. package/dist/svelte/index.cjs +2 -2
  43. package/dist/svelte/index.d.mts +6 -0
  44. package/dist/svelte/index.d.ts +6 -0
  45. package/dist/svelte/index.mjs +2 -2
  46. package/dist/vue/index.cjs +2 -2
  47. package/dist/vue/index.d.mts +6 -0
  48. package/dist/vue/index.d.ts +6 -0
  49. package/dist/vue/index.mjs +2 -2
  50. package/package.json +16 -1
@@ -1,3 +1,3 @@
1
- 'use strict';function Mt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,f=[];for(let y=0;y<n;y++){let $=Math.pow(u,y);f.push($),o+=$;}let l=[0],c=0;for(let y=0;y<n;y++)c+=f[y]/o,l.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let $=0;$<n;$++)if(y<=l[$+1]){let B=(y-l[$])/(l[$+1]-l[$]);if($===0)return B*(2-B);let S=1-Math.pow(t,$);return S+(1-S)*(2*B-1)*(2*B-1)}return 1}}function Pt({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ie={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:Mt(),elastic:Pt()};function ae(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ke(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Qe(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function _e(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function $t(e,r,n){return Math.min(n,Math.max(r,e))}function K(e,r,n,t){return n===r?0:$t((e-r)/(n-r)*t,0,1)}function pe(e,r,n,t,u){let o=Ke(e.top,e.height,r,t.element)-Qe(t.viewport,n),f=Ke(e.top,e.height,r,u.element)-Qe(u.viewport,n);return {tStart:o,tEnd:f}}function et(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Fe(e,r,n){let t=et(e),u=et(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var tt={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}};function rt(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function kt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?rt("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&rt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function It(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,f=e-o,l=r-o,c=n==="x";t.innerHTML=`
1
+ 'use strict';function Mt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,f=[];for(let y=0;y<n;y++){let C=Math.pow(u,y);f.push(C),o+=C;}let l=[0],c=0;for(let y=0;y<n;y++)c+=f[y]/o,l.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let C=0;C<n;C++)if(y<=l[C+1]){let R=(y-l[C])/(l[C+1]-l[C]);if(C===0)return R*(2-R);let E=1-Math.pow(t,C);return E+(1-E)*(2*R-1)*(2*R-1)}return 1}}function Pt({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ae={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:Mt(),elastic:Pt()};function le(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ke(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Qe(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function _e(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function $t(e,r,n){return Math.min(n,Math.max(r,e))}function Q(e,r,n,t){return n===r?0:$t((e-r)/(n-r)*t,0,1)}function he(e,r,n,t,u){let o=Ke(e.top,e.height,r,t.element)-Qe(t.viewport,n),f=Ke(e.top,e.height,r,u.element)-Qe(u.viewport,n);return {tStart:o,tEnd:f}}function et(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Fe(e,r,n){let t=et(e),u=et(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var tt={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}};function rt(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function kt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?rt("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&rt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function It(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,f=e-o,l=r-o,c=n==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}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;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function Ye(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let f=parseFloat(o),l=t[u++]??f;return String(+(f+(l-f)*n).toFixed(4))})}function st(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...tt[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:y="linear",trigger:$={},stagger:B=0,direction:S="forward",once:Q=false,debug:ye=false,axis:R="y",scrollContainer:ee,autoReverse:te=false,delay:q=0,strokeColor:x,strokeWidth:A,fillOpacity:w,waypoints:b,velocityScale:C=false,threshold:k=0,rootMargin:G="0px",repeat:L=0,repeatDelay:N=0,morphTo:M,clip:z,autoplay:re=false,duration:D=1e3,native:W=true,onProgress:d,onStart:P,onComplete:g,onEnter:h,onLeave:X,onEnterBack:Se,onLeaveBack:be}=u,we=z===true?"left":typeof z=="string"?z:false,de=typeof y=="function"?y:ie[y]??ie.linear,Ne=ae($.start??"top bottom"),ke=ae($.end??"bottom top"),U=typeof ee=="string"?document.querySelector(ee):ee??null,i=Array.isArray(x)?x[0]:null,p=Array.isArray(x)?x[1]:typeof x=="string"?x:null,Y=Array.isArray(A)?A[0]:null,H=Array.isArray(A)?A[1]:typeof A=="number"?A:null,Z=Array.isArray(w)?w[0]:null,se=Array.isArray(w)?w[1]:typeof w=="number"?w:null;function J(s){let a=s*100;switch(we){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let _=we?[]:Array.from(e.querySelectorAll(f)),I=[],me=[],ge=0,Te=0,oe=false,he=false,ne=0,He=false,ve=-1,Re=-1,le=false,Le=0,xe=0,Ae,Be=null,Me=new Set,ze=-1,Ue=performance.now(),Ie=NaN;function De(){return U?R==="x"?U.scrollLeft:U.scrollTop:R==="x"?window.scrollX:window.scrollY}function Ze(){return U?R==="x"?U.clientWidth:U.clientHeight:R==="x"?window.innerWidth:window.innerHeight}function Je(){let s=e.getBoundingClientRect(),a,E,j;if(U){let ue=U.getBoundingClientRect();a=R==="x"?s.left-ue.left+U.scrollLeft:s.top-ue.top+U.scrollTop,E=R==="x"?s.width:s.height,j=De();}else a=R==="x"?s.left:s.top,E=R==="x"?s.width:s.height,j=De();let ce=pe({top:a,height:E},j,Ze(),Ne,ke);ge=ce.tStart,Te=ce.tEnd,ye&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=It(ge,Te,R));}function St(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),we){let E=a==="reverse"?1-s:s;e.style.clipPath=J(E);return}_.forEach((E,j)=>{E.style.strokeDashoffset=a==="reverse"?`${I[j]*s}`:`${I[j]*(1-s)}`,c&&(E.style.opacity=a==="reverse"?`${1-s}`:`${s}`),i&&p?E.style.stroke=Fe(i,p,s):p&&(E.style.stroke=p),Y!==null&&H!==null?E.style.strokeWidth=`${Y+(H-Y)*s}`:H!==null&&(E.style.strokeWidth=`${H}`),Z!==null&&se!==null?E.style.fillOpacity=`${Z+(se-Z)*s}`:se!==null&&(E.style.fillOpacity=`${se}`),M&&E.tagName.toLowerCase()==="path"&&me[j]&&E.setAttribute("d",Ye(me[j],M,s));});}function Ve(){if(e.style.setProperty("--scroll-draw-progress","0"),we){e.style.clipPath=J(0);return}_.forEach((s,a)=>{s.style.strokeDasharray=`${I[a]}`,s.style.strokeDashoffset=S==="reverse"?"0":`${I[a]}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",i&&(s.style.stroke=i),Y!==null&&(s.style.strokeWidth=`${Y}`),Z!==null&&(s.style.fillOpacity=`${Z}`),M&&s.tagName.toLowerCase()==="path"&&me[a]&&s.setAttribute("d",me[a]);});}if(_.forEach(s=>{kt(s);let a=_e(s);I.push(a),s.tagName.toLowerCase()==="path"?me.push(s.getAttribute("d")??""):me.push(""),o?(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=S==="reverse"?`${a}`:"0",c&&(s.style.opacity="1"),p&&(s.style.stroke=p),H!==null&&(s.style.strokeWidth=`${H}`),se!==null&&(s.style.fillOpacity=`${se}`),M&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",M)):(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=S==="reverse"?"0":`${a}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",i&&(s.style.stroke=i),Y!==null&&(s.style.strokeWidth=`${Y}`),Z!==null&&(s.style.fillOpacity=`${Z}`));}),we){if(o)return e.style.clipPath=J(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=J(0);}else if(o)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function xt(){return !(W===false||!Ct()||!_.length||typeof y!="string"||!(y in nt)||we||R!=="y"||U||l!==1||B!==0||Q||te||C!==false||M||b||L||q>0||d||P||g||h||X||Se||be||x!=null||A!=null||w!=null||($.start??"top bottom").trim()!=="top bottom"||($.end??"bottom top").trim()!=="bottom top")}function Tt(){let s=`svg-scroll-draw-${++Lt}`,a=S==="reverse"?"0":"var(--ssd-len)",E=S==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${a};`,ce=`stroke-dashoffset:${E};`;c&&(j+=`opacity:${S==="reverse"?1:0};`,ce+=`opacity:${S==="reverse"?0:1};`);let ue=document.createElement("style");ue.setAttribute("data-svg-scroll-draw",""),ue.textContent=`@keyframes ${s}{from{${j}}to{${ce}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${nt[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue);function fe(m,T){m.style.setProperty("--ssd-len",String(I[T])),m.style.strokeDasharray=`${I[T]}`,m.style.strokeDashoffset="",m.style.opacity="",m.style.animationPlayState="",m.classList.add(s);}_.forEach(fe);let v=false,O=-1;function F(){if(O>=0)return O;let m=e.getBoundingClientRect(),{tStart:T,tEnd:V}=pe({top:m.top,height:m.height},De(),Ze(),Ne,ke);return de(K(De(),T,V,l))}return {destroy(){_.forEach(m=>{m.classList.remove(s),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),ue.remove();},replay(){v=false,O=-1,_.forEach(fe);},pause(){v=true,_.forEach(m=>{m.style.animationPlayState="paused";});},resume(){v&&(v=false,_.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let T=Math.min(1,Math.max(0,m));O=T,v=true,_.forEach((V,Ce)=>{V.classList.remove(s),V.style.strokeDashoffset=S==="reverse"?`${I[Ce]*T}`:`${I[Ce]*(1-T)}`,c&&(V.style.opacity=S==="reverse"?`${1-T}`:`${T}`);});},getProgress(){return F()}}}if(xt())return Tt();function At(){let s=Math.max(1,D),a=0,E=0;function j(F){let m=true;if(we){let T=Math.min(1,Math.max(0,F/s)),V=de(T);Le=V,e.style.setProperty("--scroll-draw-progress",String(V)),e.style.clipPath=J(S==="reverse"?1-V:V),d?.(V),T<1&&(m=false);}else _.forEach((T,V)=>{let Ce=V*B*s,Oe=Math.min(1,Math.max(0,(F-Ce)/s)),Ee=de(Oe);T.style.strokeDashoffset=S==="reverse"?`${I[V]*Ee}`:`${I[V]*(1-Ee)}`,c&&(T.style.opacity=S==="reverse"?`${1-Ee}`:`${Ee}`),i&&p?T.style.stroke=Fe(i,p,Ee):p&&(T.style.stroke=p),Y!==null&&H!==null?T.style.strokeWidth=`${Y+(H-Y)*Ee}`:H!==null&&(T.style.strokeWidth=`${H}`),Z!==null&&se!==null?T.style.fillOpacity=`${Z+(se-Z)*Ee}`:se!==null&&(T.style.fillOpacity=`${se}`),M&&T.tagName.toLowerCase()==="path"&&me[V]&&T.setAttribute("d",Ye(me[V],M,Ee)),V===0&&(d?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Oe<1&&(m=false);});if(b){let T=Math.min(1,Math.max(0,F/s)),V=de(T);for(let Ce in b){let Oe=parseFloat(Ce);V>=Oe&&!Me.has(Oe)&&(Me.add(Oe),b[Ce]?.());}}return m}function ce(F){if(le)return;let m=F-a;he||(he=true,P?.());let T=j(m);if(T&&!oe){oe=true,j(s*(1+Math.max(0,_.length-1)*B)),g?.(),xe<(L==="infinite"?1/0:L??0)&&(xe++,Ae=setTimeout(()=>{a=performance.now(),he=false,oe=false,Me.clear(),Ve(),ne=requestAnimationFrame(ce);},N));return}T||(ne=requestAnimationFrame(ce));}function ue(){cancelAnimationFrame(ne),clearTimeout(Ae),a=performance.now(),E=0,le=false,he=false,oe=false,xe=0,Me.clear(),Ve(),ne=requestAnimationFrame(ce);}let fe=new IntersectionObserver(F=>{F.forEach(m=>{m.isIntersecting&&!(Q&&oe)?ue():!m.isIntersecting&&!Q&&!oe&&(cancelAnimationFrame(ne),clearTimeout(Ae),a=null);});},{root:U??null,threshold:k,rootMargin:G}),v;function O(){clearTimeout(v),v=setTimeout(()=>{_.forEach((F,m)=>{I[m]=_e(F),F.style.strokeDasharray=`${I[m]}`;});},150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),q>0?setTimeout(()=>fe.observe(e),q):fe.observe(e),{destroy(){cancelAnimationFrame(ne),clearTimeout(Ae),fe.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(v);},replay(){xe=0,ue();},pause(){le||(le=true,E=performance.now()-a,cancelAnimationFrame(ne));},resume(){le&&(le=false,a=performance.now()-E,ne=requestAnimationFrame(ce));},seek(F){let m=Math.min(1,Math.max(0,F));Le=m,le=true,E=m*s,a=performance.now()-E,cancelAnimationFrame(ne),j(E);},getProgress(){return Le}}}if(re)return At();Je();function qe(){if(!He||le)return;let s=performance.now(),a=De(),E=l;if(C!==false){let v=s-Ue,O=v>0?Math.abs(a-(ze<0?a:ze))/v:0;E=l*Math.max(.2,1+O*(typeof C=="number"?C:1)*.04);}ze=a,Ue=s;let j=te?Re===-1||a>=Re?"forward":"reverse":S;Re=a;let ce=Te-ge,ue=true,fe=ce===0?0:(a-ge)/ce;if(isNaN(Ie)||(Ie<=0&&fe>0?h?.():Ie>0&&fe<=0&&be?.(),Ie<1&&fe>=1?X?.():Ie>=1&&fe<1&&Se?.()),Ie=fe,we){let v=de(K(a,ge,Te,E));Q&&!te&&(ve=Math.max(ve,v),v=ve),Le=v,e.style.setProperty("--scroll-draw-progress",String(v));let O=j==="reverse"?1-v:v;e.style.clipPath=J(O),d?.(v),!he&&K(a,ge,Te,E)>0&&(he=true,P?.()),v>=1&&!oe?(oe=true,g?.(),xe<(L==="infinite"?1/0:L??0)&&(xe++,Ae=setTimeout(()=>{ve=-1,he=false,oe=false,e.style.clipPath=J(0);},N))):v<1&&!Q&&(oe=false),ne=requestAnimationFrame(qe);return}if(_.forEach((v,O)=>{let F=O*B*ce,m=de(K(a,ge+F,Te+F,E));Q&&!te&&(ve=Math.max(ve,m),m=ve),Le=m,v.style.strokeDashoffset=j==="reverse"?`${I[O]*m}`:`${I[O]*(1-m)}`,c&&(v.style.opacity=j==="reverse"?`${1-m}`:`${m}`),i&&p?v.style.stroke=Fe(i,p,m):p&&(v.style.stroke=p),Y!==null&&H!==null?v.style.strokeWidth=`${Y+(H-Y)*m}`:H!==null&&(v.style.strokeWidth=`${H}`),Z!==null&&se!==null?v.style.fillOpacity=`${Z+(se-Z)*m}`:se!==null&&(v.style.fillOpacity=`${se}`),M&&v.tagName.toLowerCase()==="path"&&me[O]&&v.setAttribute("d",Ye(me[O],M,m)),O===0&&(d?.(m),e.style.setProperty("--scroll-draw-progress",String(m))),m<1&&(ue=false);}),b){let v=de(K(a,ge,Te,E));for(let O in b){let F=parseFloat(O);v>=F&&!Me.has(F)&&(Me.add(F),b[O]?.());}}!he&&K(a,ge,Te,E)>0&&(he=true,P?.()),ue&&!oe?(oe=true,g?.(),xe<(L==="infinite"?1/0:L??0)&&(xe++,Ae=setTimeout(()=>{ve=-1,he=false,oe=false,Me.clear(),Ve();},N))):!ue&&!Q&&(oe=false),ne=requestAnimationFrame(qe);}let Ge=new IntersectionObserver(s=>{s.forEach(a=>{He=a.isIntersecting,He&&!le?ne=requestAnimationFrame(qe):cancelAnimationFrame(ne);});},{root:U??null,threshold:k,rootMargin:G}),Xe;function We(){clearTimeout(Xe),Xe=setTimeout(()=>{_.forEach((s,a)=>{I[a]=_e(s),s.style.strokeDasharray=`${I[a]}`;}),Je();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),q>0?setTimeout(()=>Ge.observe(e),q):Ge.observe(e),{destroy(){cancelAnimationFrame(ne),clearTimeout(Ae),Ge.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Xe),Be?.remove();},replay(){ve=-1,Re=-1,ze=-1,he=false,oe=false,xe=0,le=false,Me.clear(),clearTimeout(Ae),Ve();},pause(){le=true,cancelAnimationFrame(ne);},resume(){le&&(le=false,He&&(ne=requestAnimationFrame(qe)));},seek(s){let a=Math.min(1,Math.max(0,s));Le=a,ve=a,le=true,cancelAnimationFrame(ne),St(a,S);},getProgress(){return Le}}}var ot=new Map;function Pe(e,r){ot.set(e,r);}function $e(e){ot.delete(e);}function Ot(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function it(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],f=t[2].trim();if(f)for(let l of f.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Ft(e,r,n){let t=it(e),u=it(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,f)=>{let l=u[f];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,y)=>`${c}${l.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(l.nums[y]-c)*n}${o.units[y]}`).join(", ")})`}).join(" ")}function at(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Ot(t))return Fe(t,u,n);if(t.includes("("))return Ft(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),f=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&f){let l=parseFloat(o[1]),c=parseFloat(f[1]);return `${l+(c-l)*n}${o[2]||f[2]}`}return n<1?t:u}function Nt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Dt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ht=0;function Rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ct(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:f=1,once:l=false,axis:c="y",scrollContainer:y,native:$=true,onProgress:B,onComplete:S,onEnter:Q,onLeave:ye,onEnterBack:R,onLeaveBack:ee}=r,te=window.matchMedia("(prefers-reduced-motion: reduce)").matches,q=typeof o=="function"?o:ie[o]??ie["ease-out"],x=ae(u.start??"top bottom"),A=ae(u.end??"bottom top"),w=typeof y=="string"?document.querySelector(y):y??null,b=Object.entries(t).map(([i,p])=>({prop:Nt(i),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function C(){let i=window.getComputedStyle(e);for(let p of b)p.from===""&&(p.from=i.getPropertyValue(p.prop).trim()||"0");}function k(){for(let i of b)e.style.setProperty(i.prop,String(i.to));}if(te)return k(),S?.(),n;C();function G(){if(!$||!Rt()||typeof o!="string"||!(o in lt)||c!=="y"||w||l||f!==1||B||S||Q||ye||R||ee||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let i of b)if(!Dt.has(i.prop))return false;return true}function L(){let i=`ssd-a-${++Ht}`,p=b.map(J=>`${J.prop}:${J.from}`).join(";"),Y=b.map(J=>`${J.prop}:${J.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${i}{from{${p}}to{${Y}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${lt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(i);let Z=()=>c==="x"?window.scrollX:window.scrollY,se=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),H.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(J){let _=Math.min(1,Math.max(0,J));e.classList.remove(i);for(let I of b)e.style.setProperty(I.prop,at(I.from,I.to,_));},getProgress(){let J=e.getBoundingClientRect(),_=Z(),I=se(),{tStart:me,tEnd:ge}=pe({top:J.top,height:J.height},_,I,x,A);return q(K(_,me,ge,f))}}}if(G())return L();let N=0,M=0,z=0,re=false,D=false,W=-1,d=0,P=false,g=NaN,h=()=>w?c==="x"?w.scrollLeft:w.scrollTop:c==="x"?window.scrollX:window.scrollY,X=()=>w?c==="x"?w.clientWidth:w.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function Se(){let i=e.getBoundingClientRect(),p,Y;if(w){let Z=w.getBoundingClientRect();p=c==="x"?i.left-Z.left+w.scrollLeft:i.top-Z.top+w.scrollTop,Y=c==="x"?i.width:i.height;}else p=c==="x"?i.left:i.top,Y=c==="x"?i.width:i.height;let H=pe({top:p,height:Y},h(),X(),x,A);N=H.tStart,M=H.tEnd;}function be(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let p of b)e.style.setProperty(p.prop,at(p.from,p.to,i));B?.(i);}function we(i){if(isNaN(g)){g=i;return}g<=0&&i>0?Q?.():g>0&&i<=0&&ee?.(),g<1&&i>=1?ye?.():g>=1&&i<1&&R?.(),g=i;}function de(){if(!re||D)return;let i=M===N?0:(h()-N)/(M-N);we(i);let p=q(K(h(),N,M,f));l&&(W=Math.max(W,p),p=W),d=p,be(p),p>=1&&!P?(P=true,S?.()):p<1&&!l&&(P=false),z=requestAnimationFrame(de);}Se();{let i=q(K(h(),N,M,f));l&&i>0&&(W=i),d=i,be(i);}let Ne=new IntersectionObserver(i=>{i.forEach(p=>{re=p.isIntersecting,re&&!D?z=requestAnimationFrame(de):cancelAnimationFrame(z);});},{root:w??null}),ke;function U(){clearTimeout(ke),ke=setTimeout(Se,150);}return window.addEventListener("resize",U),window.addEventListener("orientationchange",U),Ne.observe(e),Pe(e,{type:"animate",getProgress:()=>d,getTrigger:()=>({tStart:N,tEnd:M})}),{destroy(){cancelAnimationFrame(z),Ne.disconnect(),window.removeEventListener("resize",U),window.removeEventListener("orientationchange",U),clearTimeout(ke),$e(e);},replay(){W=-1,P=false,d=0,D=false,be(0);},pause(){D=true,cancelAnimationFrame(z);},resume(){D&&(D=false,re&&(z=requestAnimationFrame(de)));},seek(i){let p=Math.min(1,Math.max(0,i));d=p,W=p,D=true,cancelAnimationFrame(z),be(p);},getProgress(){return d}}}var je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,r){if(typeof window>"u")return je;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),je;let t=n,{from:u=0,to:o,format:f,easing:l="ease-out",trigger:c={},once:y=true,decimals:$,onComplete:B}=r,S=$!==void 0?d=>d.toFixed($):f??(d=>String(Math.round(d))),Q=typeof l=="function"?l:ie[l]??ie["ease-out"],ye=ae(c.start??"top 80%"),R=ae(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(o),B?.(),je;t.textContent=S(u);let te=0,q=0,x=0,A=false,w=false,b=-1,C=0,k=false,G=()=>window.scrollY,L=()=>window.innerHeight;function N(){let d=t.getBoundingClientRect(),P=pe({top:d.top,height:d.height},G(),L(),ye,R);te=P.tStart,q=P.tEnd;}function M(d){t.textContent=S(u+(o-u)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function z(){if(!A||w)return;let d=Q(K(G(),te,q,1));y&&(b=Math.max(b,d),d=b),C=d,M(d),d>=1&&!k?(k=true,B?.()):d<1&&!y&&(k=false),x=requestAnimationFrame(z);}N();{let d=Q(K(G(),te,q,1));y&&d>0&&(b=d),C=d,M(d);}let re=new IntersectionObserver(d=>{d.forEach(P=>{A=P.isIntersecting,A&&!w?x=requestAnimationFrame(z):cancelAnimationFrame(x);});}),D;function W(){clearTimeout(D),D=setTimeout(N,150);}return window.addEventListener("resize",W),window.addEventListener("orientationchange",W),re.observe(t),Pe(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:te,tEnd:q})}),{destroy(){cancelAnimationFrame(x),re.disconnect(),window.removeEventListener("resize",W),window.removeEventListener("orientationchange",W),clearTimeout(D),$e(t);},replay(){b=-1,k=false,C=0,w=false,M(0);},pause(){w=true,cancelAnimationFrame(x);},resume(){w&&(w=false,A&&(x=requestAnimationFrame(z)));},seek(d){let P=Math.min(1,Math.max(0,d));C=P,b=P,w=true,cancelAnimationFrame(x),M(P);},getProgress(){return C}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r={}){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),mt;let t=n,{trigger:u={},easing:o="linear",once:f=false,axis:l="y",preload:c="auto",onReady:y,onComplete:$,onProgress:B}=r,S=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=typeof o=="function"?o:ie[o]??ie.linear,ye=ae(u.start??"top top"),R=ae(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let ee=r.from??0,te=r.to,q=0,x=0,A=0,w=false,b=false,C=-1,k=0,G=false,L=false,N=()=>l==="x"?window.scrollX:window.scrollY,M=()=>l==="x"?window.innerWidth:window.innerHeight;function z(){let h=t.getBoundingClientRect(),X=l==="x"?h.left:h.top,Se=l==="x"?h.width:h.height,be=pe({top:X,height:Se},N(),M(),ye,R);q=be.tStart,x=be.tEnd;}function re(h){if(!L)return;let X=te??t.duration??0;t.currentTime=ee+(X-ee)*h,t.style.setProperty("--scroll-draw-progress",String(h)),B?.(h);}function D(){if(!w||b||!L)return;let h=Q(K(N(),q,x,1));f&&(C=Math.max(C,h),h=C),k=h,re(h),h>=1&&!G?(G=true,$?.()):h<1&&!f&&(G=false),A=requestAnimationFrame(D);}function W(){if(L=true,te===void 0&&(te=t.duration),S){re(1),y?.();return}z(),y?.(),w&&!b&&(A=requestAnimationFrame(D));}t.readyState>=1?W():t.addEventListener("loadedmetadata",W,{once:true}),L||z();let d=new IntersectionObserver(h=>{h.forEach(X=>{w=X.isIntersecting,w&&!b&&L?A=requestAnimationFrame(D):cancelAnimationFrame(A);});}),P;function g(){clearTimeout(P),P=setTimeout(z,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),d.observe(t),Pe(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:q,tEnd:x})}),{destroy(){cancelAnimationFrame(A),d.disconnect(),t.removeEventListener("loadedmetadata",W),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(P),$e(t);},replay(){C=-1,G=false,k=0,b=false,re(0);},pause(){b=true,cancelAnimationFrame(A);},resume(){b&&(b=false,w&&L&&(A=requestAnimationFrame(D)));},seek(h){let X=Math.min(1,Math.max(0,h));k=X,C=X,b=true,cancelAnimationFrame(A),re(X);},getProgress(){return k}}}function gt(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function zt(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function pt(e){let r=gt(e),n=new Map;for(let o of r){let f=o.offsetTop;n.has(f)||n.set(f,[]),n.get(f).push(o);}let t=[],u=Array.from(n.keys()).sort((o,f)=>o-f);for(let o of u){let f=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of f)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Vt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,f=o+(1-u);return f<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(f-o)))}function qt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ht(e,r={}){if(typeof window>"u")return dt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=n,{split:u="words",stagger:o=.04,easing:f="ease-out",from:l={opacity:0,y:24},trigger:c={},once:y=true,onComplete:$}=r,B=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof f=="function"?f:ie[f]??ie["ease-out"],Q=ae(c.start??"top 85%"),ye=ae(c.end??"top 40%"),R=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=zt(t):u==="lines"?ee=pt(t):ee=gt(t);let te=ee.length;function q(g,h){l?.opacity!==void 0&&(g.style.opacity=String(l.opacity+(1-l.opacity)*h));let X=qt(h,l);X&&(g.style.transform=X);}function x(g){t.style.setProperty("--scroll-draw-progress",String(g)),ee.forEach((h,X)=>{let Se=S(Vt(g,X,te,o));q(h,Se);});}if(B)return x(1),$?.(),{destroy(){t.innerHTML=R,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let A=0,w=0,b=0,C=false,k=false,G=-1,L=0,N=false,M=()=>window.scrollY,z=()=>window.innerHeight;function re(){let g=t.getBoundingClientRect(),h=pe({top:g.top,height:g.height},M(),z(),Q,ye);A=h.tStart,w=h.tEnd;}function D(){if(!C||k)return;let g=K(M(),A,w,1);y&&(G=Math.max(G,g),g=G),L=g,x(g),g>=1&&!N?(N=true,$?.()):g<1&&!y&&(N=false),b=requestAnimationFrame(D);}re();let W=new IntersectionObserver(g=>{g.forEach(h=>{C=h.isIntersecting,C&&!k?b=requestAnimationFrame(D):cancelAnimationFrame(b);});}),d;function P(){clearTimeout(d),d=setTimeout(()=>{if(u==="lines"){let g=L;t.innerHTML=R,t.setAttribute("aria-label",t.textContent??""),ee=pt(t),x(g);}re();},150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),W.observe(t),Pe(t,{type:"text",getProgress:()=>L,getTrigger:()=>({tStart:A,tEnd:w})}),{destroy(){cancelAnimationFrame(b),W.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(d),t.innerHTML=R,t.removeAttribute("aria-label"),$e(t);},replay(){G=-1,N=false,L=0,k=false,x(0);},pause(){k=true,cancelAnimationFrame(b);},resume(){k&&(k=false,C&&(b=requestAnimationFrame(D)));},seek(g){let h=Math.min(1,Math.max(0,g));L=h,G=h,k=true,cancelAnimationFrame(b),x(h);},getProgress(){return L}}}var yt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},bt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ct(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},wt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ut(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},vt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ft(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},Et=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ht(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};exports.ScrollAnimateRef=bt;exports.ScrollCounterRef=wt;exports.ScrollDrawRef=yt;exports.ScrollTextRef=Et;exports.ScrollVideoRef=vt;
3
+ <div style="position:absolute;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function Ye(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let f=parseFloat(o),l=t[u++]??f;return String(+(f+(l-f)*n).toFixed(4))})}function st(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...tt[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:y="linear",trigger:C={},stagger:R=0,direction:E="forward",once:j=false,debug:ye=false,axis:z="y",scrollContainer:ee,autoReverse:U=false,delay:Z=0,strokeColor:S,strokeWidth:M,fillOpacity:P,waypoints:g,velocityScale:x=false,threshold:I=0,rootMargin:G="0px",repeat:k=0,repeatDelay:oe=0,morphTo:$,clip:_,autoplay:B=false,duration:X=1e3,native:V=true,onProgress:p,onStart:T,onComplete:b,onEnter:h,onLeave:q,onEnterBack:Se,onLeaveBack:xe}=u,be=_===true?"left":typeof _=="string"?_:false,we=typeof y=="function"?y:ae[y]??ae.linear,Le=le(C.start??"top bottom"),De=le(C.end??"bottom top"),te=typeof ee=="string"?document.querySelector(ee):ee??null,pe=Array.isArray(S)?S[0]:null,J=Array.isArray(S)?S[1]:typeof S=="string"?S:null,K=Array.isArray(M)?M[0]:null,i=Array.isArray(M)?M[1]:typeof M=="number"?M:null,d=Array.isArray(P)?P[0]:null,O=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function re(s){let a=s*100;switch(be){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let L=be?[]:Array.from(e.querySelectorAll(f)),H=[],F=[],ie=0,ce=0,ne=false,de=false,se=0,He=false,ve=-1,Re=-1,ue=false,Ce=0,Te=0,Ae,Be=null,Me=new Set,ze=-1,Ue=performance.now(),Ie=NaN;function Ne(){return te?z==="x"?te.scrollLeft:te.scrollTop:z==="x"?window.scrollX:window.scrollY}function Ze(){return te?z==="x"?te.clientWidth:te.clientHeight:z==="x"?window.innerWidth:window.innerHeight}function Je(){let s=e.getBoundingClientRect(),a,v,Y;if(te){let fe=te.getBoundingClientRect();a=z==="x"?s.left-fe.left+te.scrollLeft:s.top-fe.top+te.scrollTop,v=z==="x"?s.width:s.height,Y=Ne();}else a=z==="x"?s.left:s.top,v=z==="x"?s.width:s.height,Y=Ne();let me=he({top:a,height:v},Y,Ze(),Le,De);ie=me.tStart,ce=me.tEnd,ye&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=It(ie,ce,z));}function St(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),be){let v=a==="reverse"?1-s:s;e.style.clipPath=re(v);return}L.forEach((v,Y)=>{v.style.strokeDashoffset=a==="reverse"?`${H[Y]*s}`:`${H[Y]*(1-s)}`,c&&(v.style.opacity=a==="reverse"?`${1-s}`:`${s}`),pe&&J?v.style.stroke=Fe(pe,J,s):J&&(v.style.stroke=J),K!==null&&i!==null?v.style.strokeWidth=`${K+(i-K)*s}`:i!==null&&(v.style.strokeWidth=`${i}`),d!==null&&O!==null?v.style.fillOpacity=`${d+(O-d)*s}`:O!==null&&(v.style.fillOpacity=`${O}`),$&&v.tagName.toLowerCase()==="path"&&F[Y]&&v.setAttribute("d",Ye(F[Y],$,s));});}function Ve(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=re(0);return}L.forEach((s,a)=>{s.style.strokeDasharray=`${H[a]}`,s.style.strokeDashoffset=E==="reverse"?"0":`${H[a]}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`),$&&s.tagName.toLowerCase()==="path"&&F[a]&&s.setAttribute("d",F[a]);});}if(L.forEach(s=>{kt(s);let a=_e(s);H.push(a),s.tagName.toLowerCase()==="path"?F.push(s.getAttribute("d")??""):F.push(""),o?(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?`${a}`:"0",c&&(s.style.opacity="1"),J&&(s.style.stroke=J),i!==null&&(s.style.strokeWidth=`${i}`),O!==null&&(s.style.fillOpacity=`${O}`),$&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",$)):(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?"0":`${a}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`));}),be){if(o)return e.style.clipPath=re(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=re(0);}else if(o)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function xt(){return !(V===false||!Ct()||!L.length||typeof y!="string"||!(y in nt)||be||z!=="y"||te||l!==1||R!==0||j||U||x!==false||$||g||k||Z>0||p||T||b||h||q||Se||xe||S!=null||M!=null||P!=null||(C.start??"top bottom").trim()!=="top bottom"||(C.end??"bottom top").trim()!=="bottom top")}function Tt(){let s=`svg-scroll-draw-${++Lt}`,a=E==="reverse"?"0":"var(--ssd-len)",v=E==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${a};`,me=`stroke-dashoffset:${v};`;c&&(Y+=`opacity:${E==="reverse"?1:0};`,me+=`opacity:${E==="reverse"?0:1};`);let fe=document.createElement("style");fe.setAttribute("data-svg-scroll-draw",""),fe.textContent=`@keyframes ${s}{from{${Y}}to{${me}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${nt[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe);function ge(m,A){m.style.setProperty("--ssd-len",String(H[A])),m.style.strokeDasharray=`${H[A]}`,m.style.strokeDashoffset="",m.style.opacity="",m.style.animationPlayState="",m.classList.add(s);}L.forEach(ge);let w=false,N=-1;function D(){if(N>=0)return N;let m=e.getBoundingClientRect(),{tStart:A,tEnd:W}=he({top:m.top,height:m.height},Ne(),Ze(),Le,De);return we(Q(Ne(),A,W,l))}return {destroy(){L.forEach(m=>{m.classList.remove(s),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),fe.remove();},replay(){w=false,N=-1,L.forEach(ge);},pause(){w=true,L.forEach(m=>{m.style.animationPlayState="paused";});},resume(){w&&(w=false,L.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let A=Math.min(1,Math.max(0,m));N=A,w=true,L.forEach((W,ke)=>{W.classList.remove(s),W.style.strokeDashoffset=E==="reverse"?`${H[ke]*A}`:`${H[ke]*(1-A)}`,c&&(W.style.opacity=E==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return D()}}}if(xt())return Tt();function At(){let s=Math.max(1,X),a=0,v=0;function Y(D){let m=true;if(be){let A=Math.min(1,Math.max(0,D/s)),W=we(A);Ce=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=re(E==="reverse"?1-W:W),p?.(W),A<1&&(m=false);}else L.forEach((A,W)=>{let ke=W*R*s,Oe=Math.min(1,Math.max(0,(D-ke)/s)),Ee=we(Oe);A.style.strokeDashoffset=E==="reverse"?`${H[W]*Ee}`:`${H[W]*(1-Ee)}`,c&&(A.style.opacity=E==="reverse"?`${1-Ee}`:`${Ee}`),pe&&J?A.style.stroke=Fe(pe,J,Ee):J&&(A.style.stroke=J),K!==null&&i!==null?A.style.strokeWidth=`${K+(i-K)*Ee}`:i!==null&&(A.style.strokeWidth=`${i}`),d!==null&&O!==null?A.style.fillOpacity=`${d+(O-d)*Ee}`:O!==null&&(A.style.fillOpacity=`${O}`),$&&A.tagName.toLowerCase()==="path"&&F[W]&&A.setAttribute("d",Ye(F[W],$,Ee)),W===0&&(p?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Oe<1&&(m=false);});if(g){let A=Math.min(1,Math.max(0,D/s)),W=we(A);for(let ke in g){let Oe=parseFloat(ke);W>=Oe&&!Me.has(Oe)&&(Me.add(Oe),g[ke]?.());}}return m}function me(D){if(ue)return;let m=D-a;de||(de=true,T?.());let A=Y(m);if(A&&!ne){ne=true,Y(s*(1+Math.max(0,L.length-1)*R)),b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{a=performance.now(),de=false,ne=false,Me.clear(),Ve(),se=requestAnimationFrame(me);},oe));return}A||(se=requestAnimationFrame(me));}function fe(){cancelAnimationFrame(se),clearTimeout(Ae),a=performance.now(),v=0,ue=false,de=false,ne=false,Te=0,Me.clear(),Ve(),se=requestAnimationFrame(me);}let ge=new IntersectionObserver(D=>{D.forEach(m=>{m.isIntersecting&&!(j&&ne)?fe():!m.isIntersecting&&!j&&!ne&&(cancelAnimationFrame(se),clearTimeout(Ae),a=null);});},{root:te??null,threshold:I,rootMargin:G}),w;function N(){clearTimeout(w),w=setTimeout(()=>{L.forEach((D,m)=>{H[m]=_e(D),D.style.strokeDasharray=`${H[m]}`;});},150);}return window.addEventListener("resize",N),window.addEventListener("orientationchange",N),Z>0?setTimeout(()=>ge.observe(e),Z):ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),ge.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N),clearTimeout(w);},replay(){Te=0,fe();},pause(){ue||(ue=true,v=performance.now()-a,cancelAnimationFrame(se));},resume(){ue&&(ue=false,a=performance.now()-v,se=requestAnimationFrame(me));},seek(D){let m=Math.min(1,Math.max(0,D));Ce=m,ue=true,v=m*s,a=performance.now()-v,cancelAnimationFrame(se),Y(v);},getProgress(){return Ce}}}if(B)return At();Je();function qe(){if(!He||ue)return;let s=performance.now(),a=Ne(),v=l;if(x!==false){let w=s-Ue,N=w>0?Math.abs(a-(ze<0?a:ze))/w:0;v=l*Math.max(.2,1+N*(typeof x=="number"?x:1)*.04);}ze=a,Ue=s;let Y=U?Re===-1||a>=Re?"forward":"reverse":E;Re=a;let me=ce-ie,fe=true,ge=me===0?0:(a-ie)/me;if(isNaN(Ie)||(Ie<=0&&ge>0?h?.():Ie>0&&ge<=0&&xe?.(),Ie<1&&ge>=1?q?.():Ie>=1&&ge<1&&Se?.()),Ie=ge,be){let w=we(Q(a,ie,ce,v));j&&!U&&(ve=Math.max(ve,w),w=ve),Ce=w,e.style.setProperty("--scroll-draw-progress",String(w));let N=Y==="reverse"?1-w:w;e.style.clipPath=re(N),p?.(w),!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),w>=1&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,e.style.clipPath=re(0);},oe))):w<1&&!j&&(ne=false),se=requestAnimationFrame(qe);return}if(L.forEach((w,N)=>{let D=N*R*me,m=we(Q(a,ie+D,ce+D,v));j&&!U&&(ve=Math.max(ve,m),m=ve),Ce=m,w.style.strokeDashoffset=Y==="reverse"?`${H[N]*m}`:`${H[N]*(1-m)}`,c&&(w.style.opacity=Y==="reverse"?`${1-m}`:`${m}`),pe&&J?w.style.stroke=Fe(pe,J,m):J&&(w.style.stroke=J),K!==null&&i!==null?w.style.strokeWidth=`${K+(i-K)*m}`:i!==null&&(w.style.strokeWidth=`${i}`),d!==null&&O!==null?w.style.fillOpacity=`${d+(O-d)*m}`:O!==null&&(w.style.fillOpacity=`${O}`),$&&w.tagName.toLowerCase()==="path"&&F[N]&&w.setAttribute("d",Ye(F[N],$,m)),N===0&&(p?.(m),e.style.setProperty("--scroll-draw-progress",String(m))),m<1&&(fe=false);}),g){let w=we(Q(a,ie,ce,v));for(let N in g){let D=parseFloat(N);w>=D&&!Me.has(D)&&(Me.add(D),g[N]?.());}}!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),fe&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,Me.clear(),Ve();},oe))):!fe&&!j&&(ne=false),se=requestAnimationFrame(qe);}let Ge=new IntersectionObserver(s=>{s.forEach(a=>{He=a.isIntersecting,He&&!ue?se=requestAnimationFrame(qe):cancelAnimationFrame(se);});},{root:te??null,threshold:I,rootMargin:G}),Xe;function We(){clearTimeout(Xe),Xe=setTimeout(()=>{L.forEach((s,a)=>{H[a]=_e(s),s.style.strokeDasharray=`${H[a]}`;}),Je();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),Z>0?setTimeout(()=>Ge.observe(e),Z):Ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),Ge.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Xe),Be?.remove();},replay(){ve=-1,Re=-1,ze=-1,de=false,ne=false,Te=0,ue=false,Me.clear(),clearTimeout(Ae),Ve();},pause(){ue=true,cancelAnimationFrame(se);},resume(){ue&&(ue=false,He&&(se=requestAnimationFrame(qe)));},seek(s){let a=Math.min(1,Math.max(0,s));Ce=a,ve=a,ue=true,cancelAnimationFrame(se),St(a,E);},getProgress(){return Ce}}}var ot=new Map;function Pe(e,r){ot.set(e,r);}function $e(e){ot.delete(e);}function Ot(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function it(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],f=t[2].trim();if(f)for(let l of f.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Ft(e,r,n){let t=it(e),u=it(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,f)=>{let l=u[f];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,y)=>`${c}${l.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(l.nums[y]-c)*n}${o.units[y]}`).join(", ")})`}).join(" ")}function at(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Ot(t))return Fe(t,u,n);if(t.includes("("))return Ft(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),f=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&f){let l=parseFloat(o[1]),c=parseFloat(f[1]);return `${l+(c-l)*n}${o[2]||f[2]}`}return n<1?t:u}function Nt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Dt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ht=0;function Rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ct(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:f=1,once:l=false,axis:c="y",scrollContainer:y,native:C=true,velocityScale:R=false,onProgress:E,onComplete:j,onEnter:ye,onLeave:z,onEnterBack:ee,onLeaveBack:U}=r,Z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof o=="function"?o:ae[o]??ae["ease-out"],M=le(u.start??"top bottom"),P=le(u.end??"bottom top"),g=typeof y=="string"?document.querySelector(y):y??null,x=Object.entries(t).map(([i,d])=>({prop:Nt(i),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function I(){let i=window.getComputedStyle(e);for(let d of x)d.from===""&&(d.from=i.getPropertyValue(d.prop).trim()||"0");}function G(){for(let i of x)e.style.setProperty(i.prop,String(i.to));}if(Z)return G(),j?.(),n;I();function k(){if(!C||!Rt()||typeof o!="string"||!(o in lt)||c!=="y"||g||l||f!==1||E||j||ye||z||ee||U||R!==false||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let i of x)if(!Dt.has(i.prop))return false;return true}function oe(){let i=`ssd-a-${++Ht}`,d=x.map(F=>`${F.prop}:${F.from}`).join(";"),O=x.map(F=>`${F.prop}:${F.to}`).join(";"),re=document.createElement("style");re.setAttribute("data-ssd-animate",""),re.textContent=`@keyframes ${i}{from{${d}}to{${O}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${lt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(re),e.classList.add(i);let L=()=>c==="x"?window.scrollX:window.scrollY,H=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),re.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(F){let ie=Math.min(1,Math.max(0,F));e.classList.remove(i);for(let ce of x)e.style.setProperty(ce.prop,at(ce.from,ce.to,ie));},getProgress(){let F=e.getBoundingClientRect(),ie=L(),ce=H(),{tStart:ne,tEnd:de}=he({top:F.top,height:F.height},ie,ce,M,P);return S(Q(ie,ne,de,f))}}}if(k())return oe();let $=0,_=0,B=0,X=false,V=false,p=-1,T=0,b=false,h=NaN,q=-1,Se=0,xe=()=>g?c==="x"?g.scrollLeft:g.scrollTop:c==="x"?window.scrollX:window.scrollY,be=()=>g?c==="x"?g.clientWidth:g.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function we(){let i=e.getBoundingClientRect(),d,O;if(g){let L=g.getBoundingClientRect();d=c==="x"?i.left-L.left+g.scrollLeft:i.top-L.top+g.scrollTop,O=c==="x"?i.width:i.height;}else d=c==="x"?i.left:i.top,O=c==="x"?i.width:i.height;let re=he({top:d,height:O},xe(),be(),M,P);$=re.tStart,_=re.tEnd;}function Le(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let d of x)e.style.setProperty(d.prop,at(d.from,d.to,i));E?.(i);}function De(i){if(isNaN(h)){h=i;return}h<=0&&i>0?ye?.():h>0&&i<=0&&U?.(),h<1&&i>=1?z?.():h>=1&&i<1&&ee?.(),h=i;}function te(){if(!X||V)return;let i=performance.now(),d=xe(),O=f;if(R!==false){let H=i-Se,F=H>0?Math.abs(d-(q<0?d:q))/H:0;O=f*Math.max(.2,1+F*(typeof R=="number"?R:1)*.04);}q=d,Se=i;let re=_===$?0:(d-$)/(_-$);De(re);let L=S(Q(d,$,_,O));l&&(p=Math.max(p,L),L=p),T=L,Le(L),L>=1&&!b?(b=true,j?.()):L<1&&!l&&(b=false),B=requestAnimationFrame(te);}we();{let i=S(Q(xe(),$,_,f));l&&i>0&&(p=i),T=i,Le(i);}let pe=new IntersectionObserver(i=>{i.forEach(d=>{X=d.isIntersecting,X&&!V?B=requestAnimationFrame(te):cancelAnimationFrame(B);});},{root:g??null}),J;function K(){clearTimeout(J),J=setTimeout(we,150);}return window.addEventListener("resize",K),window.addEventListener("orientationchange",K),pe.observe(e),Pe(e,{type:"animate",getProgress:()=>T,getTrigger:()=>({tStart:$,tEnd:_})}),{destroy(){cancelAnimationFrame(B),pe.disconnect(),window.removeEventListener("resize",K),window.removeEventListener("orientationchange",K),clearTimeout(J),$e(e);},replay(){p=-1,b=false,T=0,V=false,Le(0);},pause(){V=true,cancelAnimationFrame(B);},resume(){V&&(V=false,X&&(B=requestAnimationFrame(te)));},seek(i){let d=Math.min(1,Math.max(0,i));T=d,p=d,V=true,cancelAnimationFrame(B),Le(d);},getProgress(){return T}}}var je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,r){if(typeof window>"u")return je;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),je;let t=n,{from:u=0,to:o,format:f,easing:l="ease-out",trigger:c={},once:y=true,decimals:C,onComplete:R}=r,E=C!==void 0?p=>p.toFixed(C):f??(p=>String(Math.round(p))),j=typeof l=="function"?l:ae[l]??ae["ease-out"],ye=le(c.start??"top 80%"),z=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(o),R?.(),je;t.textContent=E(u);let U=0,Z=0,S=0,M=false,P=false,g=-1,x=0,I=false,G=()=>window.scrollY,k=()=>window.innerHeight;function oe(){let p=t.getBoundingClientRect(),T=he({top:p.top,height:p.height},G(),k(),ye,z);U=T.tStart,Z=T.tEnd;}function $(p){t.textContent=E(u+(o-u)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function _(){if(!M||P)return;let p=j(Q(G(),U,Z,1));y&&(g=Math.max(g,p),p=g),x=p,$(p),p>=1&&!I?(I=true,R?.()):p<1&&!y&&(I=false),S=requestAnimationFrame(_);}oe();{let p=j(Q(G(),U,Z,1));y&&p>0&&(g=p),x=p,$(p);}let B=new IntersectionObserver(p=>{p.forEach(T=>{M=T.isIntersecting,M&&!P?S=requestAnimationFrame(_):cancelAnimationFrame(S);});}),X;function V(){clearTimeout(X),X=setTimeout(oe,150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),B.observe(t),Pe(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:U,tEnd:Z})}),{destroy(){cancelAnimationFrame(S),B.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(X),$e(t);},replay(){g=-1,I=false,x=0,P=false,$(0);},pause(){P=true,cancelAnimationFrame(S);},resume(){P&&(P=false,M&&(S=requestAnimationFrame(_)));},seek(p){let T=Math.min(1,Math.max(0,p));x=T,g=T,P=true,cancelAnimationFrame(S),$(T);},getProgress(){return x}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r={}){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),mt;let t=n,{trigger:u={},easing:o="linear",once:f=false,axis:l="y",preload:c="auto",onReady:y,onComplete:C,onProgress:R}=r,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,j=typeof o=="function"?o:ae[o]??ae.linear,ye=le(u.start??"top top"),z=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let ee=r.from??0,U=r.to,Z=0,S=0,M=0,P=false,g=false,x=-1,I=0,G=false,k=false,oe=()=>l==="x"?window.scrollX:window.scrollY,$=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let h=t.getBoundingClientRect(),q=l==="x"?h.left:h.top,Se=l==="x"?h.width:h.height,xe=he({top:q,height:Se},oe(),$(),ye,z);Z=xe.tStart,S=xe.tEnd;}function B(h){if(!k)return;let q=U??t.duration??0;t.currentTime=ee+(q-ee)*h,t.style.setProperty("--scroll-draw-progress",String(h)),R?.(h);}function X(){if(!P||g||!k)return;let h=j(Q(oe(),Z,S,1));f&&(x=Math.max(x,h),h=x),I=h,B(h),h>=1&&!G?(G=true,C?.()):h<1&&!f&&(G=false),M=requestAnimationFrame(X);}function V(){if(k=true,U===void 0&&(U=t.duration),E){B(1),y?.();return}_(),y?.(),P&&!g&&(M=requestAnimationFrame(X));}t.readyState>=1?V():t.addEventListener("loadedmetadata",V,{once:true}),k||_();let p=new IntersectionObserver(h=>{h.forEach(q=>{P=q.isIntersecting,P&&!g&&k?M=requestAnimationFrame(X):cancelAnimationFrame(M);});}),T;function b(){clearTimeout(T),T=setTimeout(_,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),p.observe(t),Pe(t,{type:"video",getProgress:()=>I,getTrigger:()=>({tStart:Z,tEnd:S})}),{destroy(){cancelAnimationFrame(M),p.disconnect(),t.removeEventListener("loadedmetadata",V),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(T),$e(t);},replay(){x=-1,G=false,I=0,g=false,B(0);},pause(){g=true,cancelAnimationFrame(M);},resume(){g&&(g=false,P&&k&&(M=requestAnimationFrame(X)));},seek(h){let q=Math.min(1,Math.max(0,h));I=q,x=q,g=true,cancelAnimationFrame(M),B(q);},getProgress(){return I}}}function gt(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function zt(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function pt(e){let r=gt(e),n=new Map;for(let o of r){let f=o.offsetTop;n.has(f)||n.set(f,[]),n.get(f).push(o);}let t=[],u=Array.from(n.keys()).sort((o,f)=>o-f);for(let o of u){let f=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of f)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Vt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,f=o+(1-u);return f<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(f-o)))}function qt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ht(e,r={}){if(typeof window>"u")return dt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=n,{split:u="words",stagger:o=.04,easing:f="ease-out",from:l={opacity:0,y:24},trigger:c={},once:y=true,onComplete:C}=r,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof f=="function"?f:ae[f]??ae["ease-out"],j=le(c.start??"top 85%"),ye=le(c.end??"top 40%"),z=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=zt(t):u==="lines"?ee=pt(t):ee=gt(t);let U=ee.length;function Z(b,h){l?.opacity!==void 0&&(b.style.opacity=String(l.opacity+(1-l.opacity)*h));let q=qt(h,l);q&&(b.style.transform=q);}function S(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach((h,q)=>{let Se=E(Vt(b,q,U,o));Z(h,Se);});}if(R)return S(1),C?.(),{destroy(){t.innerHTML=z,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};S(0);let M=0,P=0,g=0,x=false,I=false,G=-1,k=0,oe=false,$=()=>window.scrollY,_=()=>window.innerHeight;function B(){let b=t.getBoundingClientRect(),h=he({top:b.top,height:b.height},$(),_(),j,ye);M=h.tStart,P=h.tEnd;}function X(){if(!x||I)return;let b=Q($(),M,P,1);y&&(G=Math.max(G,b),b=G),k=b,S(b),b>=1&&!oe?(oe=true,C?.()):b<1&&!y&&(oe=false),g=requestAnimationFrame(X);}B();let V=new IntersectionObserver(b=>{b.forEach(h=>{x=h.isIntersecting,x&&!I?g=requestAnimationFrame(X):cancelAnimationFrame(g);});}),p;function T(){clearTimeout(p),p=setTimeout(()=>{if(u==="lines"){let b=k;t.innerHTML=z,t.setAttribute("aria-label",t.textContent??""),ee=pt(t),S(b);}B();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),V.observe(t),Pe(t,{type:"text",getProgress:()=>k,getTrigger:()=>({tStart:M,tEnd:P})}),{destroy(){cancelAnimationFrame(g),V.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(p),t.innerHTML=z,t.removeAttribute("aria-label"),$e(t);},replay(){G=-1,oe=false,k=0,I=false,S(0);},pause(){I=true,cancelAnimationFrame(g);},resume(){I&&(I=false,x&&(g=requestAnimationFrame(X)));},seek(b){let h=Math.min(1,Math.max(0,b));k=h,G=h,I=true,cancelAnimationFrame(g),S(h);},getProgress(){return k}}}var yt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},bt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ct(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},wt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ut(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},vt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ft(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},Et=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ht(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};exports.ScrollAnimateRef=bt;exports.ScrollCounterRef=wt;exports.ScrollDrawRef=yt;exports.ScrollTextRef=Et;exports.ScrollVideoRef=vt;
@@ -136,6 +136,12 @@ interface ScrollAnimateOptions {
136
136
  axis?: 'x' | 'y';
137
137
  scrollContainer?: string | Element;
138
138
  native?: boolean;
139
+ /**
140
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
141
+ * Pass `true` for default sensitivity (1) or a number to control it.
142
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
143
+ */
144
+ velocityScale?: boolean | number;
139
145
  onProgress?: (alpha: number) => void;
140
146
  onComplete?: () => void;
141
147
  /** Fires when scroll enters the trigger zone (scrolling forward). */
@@ -136,6 +136,12 @@ interface ScrollAnimateOptions {
136
136
  axis?: 'x' | 'y';
137
137
  scrollContainer?: string | Element;
138
138
  native?: boolean;
139
+ /**
140
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
141
+ * Pass `true` for default sensitivity (1) or a number to control it.
142
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
143
+ */
144
+ velocityScale?: boolean | number;
139
145
  onProgress?: (alpha: number) => void;
140
146
  onComplete?: () => void;
141
147
  /** Fires when scroll enters the trigger zone (scrolling forward). */
@@ -1,3 +1,3 @@
1
- function Mt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,f=[];for(let y=0;y<n;y++){let $=Math.pow(u,y);f.push($),o+=$;}let l=[0],c=0;for(let y=0;y<n;y++)c+=f[y]/o,l.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let $=0;$<n;$++)if(y<=l[$+1]){let B=(y-l[$])/(l[$+1]-l[$]);if($===0)return B*(2-B);let S=1-Math.pow(t,$);return S+(1-S)*(2*B-1)*(2*B-1)}return 1}}function Pt({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ie={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:Mt(),elastic:Pt()};function ae(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ke(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Qe(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function _e(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function $t(e,r,n){return Math.min(n,Math.max(r,e))}function K(e,r,n,t){return n===r?0:$t((e-r)/(n-r)*t,0,1)}function pe(e,r,n,t,u){let o=Ke(e.top,e.height,r,t.element)-Qe(t.viewport,n),f=Ke(e.top,e.height,r,u.element)-Qe(u.viewport,n);return {tStart:o,tEnd:f}}function et(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Fe(e,r,n){let t=et(e),u=et(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var tt={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}};function rt(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function kt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?rt("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&rt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function It(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,f=e-o,l=r-o,c=n==="x";t.innerHTML=`
1
+ function Mt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,f=[];for(let y=0;y<n;y++){let C=Math.pow(u,y);f.push(C),o+=C;}let l=[0],c=0;for(let y=0;y<n;y++)c+=f[y]/o,l.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let C=0;C<n;C++)if(y<=l[C+1]){let R=(y-l[C])/(l[C+1]-l[C]);if(C===0)return R*(2-R);let E=1-Math.pow(t,C);return E+(1-E)*(2*R-1)*(2*R-1)}return 1}}function Pt({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ae={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:Mt(),elastic:Pt()};function le(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ke(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Qe(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function _e(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function $t(e,r,n){return Math.min(n,Math.max(r,e))}function Q(e,r,n,t){return n===r?0:$t((e-r)/(n-r)*t,0,1)}function he(e,r,n,t,u){let o=Ke(e.top,e.height,r,t.element)-Qe(t.viewport,n),f=Ke(e.top,e.height,r,u.element)-Qe(u.viewport,n);return {tStart:o,tEnd:f}}function et(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Fe(e,r,n){let t=et(e),u=et(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var tt={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}};function rt(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function kt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?rt("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&rt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function It(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,f=e-o,l=r-o,c=n==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}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;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function Ye(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let f=parseFloat(o),l=t[u++]??f;return String(+(f+(l-f)*n).toFixed(4))})}function st(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...tt[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:y="linear",trigger:$={},stagger:B=0,direction:S="forward",once:Q=false,debug:ye=false,axis:R="y",scrollContainer:ee,autoReverse:te=false,delay:q=0,strokeColor:x,strokeWidth:A,fillOpacity:w,waypoints:b,velocityScale:C=false,threshold:k=0,rootMargin:G="0px",repeat:L=0,repeatDelay:N=0,morphTo:M,clip:z,autoplay:re=false,duration:D=1e3,native:W=true,onProgress:d,onStart:P,onComplete:g,onEnter:h,onLeave:X,onEnterBack:Se,onLeaveBack:be}=u,we=z===true?"left":typeof z=="string"?z:false,de=typeof y=="function"?y:ie[y]??ie.linear,Ne=ae($.start??"top bottom"),ke=ae($.end??"bottom top"),U=typeof ee=="string"?document.querySelector(ee):ee??null,i=Array.isArray(x)?x[0]:null,p=Array.isArray(x)?x[1]:typeof x=="string"?x:null,Y=Array.isArray(A)?A[0]:null,H=Array.isArray(A)?A[1]:typeof A=="number"?A:null,Z=Array.isArray(w)?w[0]:null,se=Array.isArray(w)?w[1]:typeof w=="number"?w:null;function J(s){let a=s*100;switch(we){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let _=we?[]:Array.from(e.querySelectorAll(f)),I=[],me=[],ge=0,Te=0,oe=false,he=false,ne=0,He=false,ve=-1,Re=-1,le=false,Le=0,xe=0,Ae,Be=null,Me=new Set,ze=-1,Ue=performance.now(),Ie=NaN;function De(){return U?R==="x"?U.scrollLeft:U.scrollTop:R==="x"?window.scrollX:window.scrollY}function Ze(){return U?R==="x"?U.clientWidth:U.clientHeight:R==="x"?window.innerWidth:window.innerHeight}function Je(){let s=e.getBoundingClientRect(),a,E,j;if(U){let ue=U.getBoundingClientRect();a=R==="x"?s.left-ue.left+U.scrollLeft:s.top-ue.top+U.scrollTop,E=R==="x"?s.width:s.height,j=De();}else a=R==="x"?s.left:s.top,E=R==="x"?s.width:s.height,j=De();let ce=pe({top:a,height:E},j,Ze(),Ne,ke);ge=ce.tStart,Te=ce.tEnd,ye&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=It(ge,Te,R));}function St(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),we){let E=a==="reverse"?1-s:s;e.style.clipPath=J(E);return}_.forEach((E,j)=>{E.style.strokeDashoffset=a==="reverse"?`${I[j]*s}`:`${I[j]*(1-s)}`,c&&(E.style.opacity=a==="reverse"?`${1-s}`:`${s}`),i&&p?E.style.stroke=Fe(i,p,s):p&&(E.style.stroke=p),Y!==null&&H!==null?E.style.strokeWidth=`${Y+(H-Y)*s}`:H!==null&&(E.style.strokeWidth=`${H}`),Z!==null&&se!==null?E.style.fillOpacity=`${Z+(se-Z)*s}`:se!==null&&(E.style.fillOpacity=`${se}`),M&&E.tagName.toLowerCase()==="path"&&me[j]&&E.setAttribute("d",Ye(me[j],M,s));});}function Ve(){if(e.style.setProperty("--scroll-draw-progress","0"),we){e.style.clipPath=J(0);return}_.forEach((s,a)=>{s.style.strokeDasharray=`${I[a]}`,s.style.strokeDashoffset=S==="reverse"?"0":`${I[a]}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",i&&(s.style.stroke=i),Y!==null&&(s.style.strokeWidth=`${Y}`),Z!==null&&(s.style.fillOpacity=`${Z}`),M&&s.tagName.toLowerCase()==="path"&&me[a]&&s.setAttribute("d",me[a]);});}if(_.forEach(s=>{kt(s);let a=_e(s);I.push(a),s.tagName.toLowerCase()==="path"?me.push(s.getAttribute("d")??""):me.push(""),o?(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=S==="reverse"?`${a}`:"0",c&&(s.style.opacity="1"),p&&(s.style.stroke=p),H!==null&&(s.style.strokeWidth=`${H}`),se!==null&&(s.style.fillOpacity=`${se}`),M&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",M)):(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=S==="reverse"?"0":`${a}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",i&&(s.style.stroke=i),Y!==null&&(s.style.strokeWidth=`${Y}`),Z!==null&&(s.style.fillOpacity=`${Z}`));}),we){if(o)return e.style.clipPath=J(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=J(0);}else if(o)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function xt(){return !(W===false||!Ct()||!_.length||typeof y!="string"||!(y in nt)||we||R!=="y"||U||l!==1||B!==0||Q||te||C!==false||M||b||L||q>0||d||P||g||h||X||Se||be||x!=null||A!=null||w!=null||($.start??"top bottom").trim()!=="top bottom"||($.end??"bottom top").trim()!=="bottom top")}function Tt(){let s=`svg-scroll-draw-${++Lt}`,a=S==="reverse"?"0":"var(--ssd-len)",E=S==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${a};`,ce=`stroke-dashoffset:${E};`;c&&(j+=`opacity:${S==="reverse"?1:0};`,ce+=`opacity:${S==="reverse"?0:1};`);let ue=document.createElement("style");ue.setAttribute("data-svg-scroll-draw",""),ue.textContent=`@keyframes ${s}{from{${j}}to{${ce}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${nt[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue);function fe(m,T){m.style.setProperty("--ssd-len",String(I[T])),m.style.strokeDasharray=`${I[T]}`,m.style.strokeDashoffset="",m.style.opacity="",m.style.animationPlayState="",m.classList.add(s);}_.forEach(fe);let v=false,O=-1;function F(){if(O>=0)return O;let m=e.getBoundingClientRect(),{tStart:T,tEnd:V}=pe({top:m.top,height:m.height},De(),Ze(),Ne,ke);return de(K(De(),T,V,l))}return {destroy(){_.forEach(m=>{m.classList.remove(s),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),ue.remove();},replay(){v=false,O=-1,_.forEach(fe);},pause(){v=true,_.forEach(m=>{m.style.animationPlayState="paused";});},resume(){v&&(v=false,_.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let T=Math.min(1,Math.max(0,m));O=T,v=true,_.forEach((V,Ce)=>{V.classList.remove(s),V.style.strokeDashoffset=S==="reverse"?`${I[Ce]*T}`:`${I[Ce]*(1-T)}`,c&&(V.style.opacity=S==="reverse"?`${1-T}`:`${T}`);});},getProgress(){return F()}}}if(xt())return Tt();function At(){let s=Math.max(1,D),a=0,E=0;function j(F){let m=true;if(we){let T=Math.min(1,Math.max(0,F/s)),V=de(T);Le=V,e.style.setProperty("--scroll-draw-progress",String(V)),e.style.clipPath=J(S==="reverse"?1-V:V),d?.(V),T<1&&(m=false);}else _.forEach((T,V)=>{let Ce=V*B*s,Oe=Math.min(1,Math.max(0,(F-Ce)/s)),Ee=de(Oe);T.style.strokeDashoffset=S==="reverse"?`${I[V]*Ee}`:`${I[V]*(1-Ee)}`,c&&(T.style.opacity=S==="reverse"?`${1-Ee}`:`${Ee}`),i&&p?T.style.stroke=Fe(i,p,Ee):p&&(T.style.stroke=p),Y!==null&&H!==null?T.style.strokeWidth=`${Y+(H-Y)*Ee}`:H!==null&&(T.style.strokeWidth=`${H}`),Z!==null&&se!==null?T.style.fillOpacity=`${Z+(se-Z)*Ee}`:se!==null&&(T.style.fillOpacity=`${se}`),M&&T.tagName.toLowerCase()==="path"&&me[V]&&T.setAttribute("d",Ye(me[V],M,Ee)),V===0&&(d?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Oe<1&&(m=false);});if(b){let T=Math.min(1,Math.max(0,F/s)),V=de(T);for(let Ce in b){let Oe=parseFloat(Ce);V>=Oe&&!Me.has(Oe)&&(Me.add(Oe),b[Ce]?.());}}return m}function ce(F){if(le)return;let m=F-a;he||(he=true,P?.());let T=j(m);if(T&&!oe){oe=true,j(s*(1+Math.max(0,_.length-1)*B)),g?.(),xe<(L==="infinite"?1/0:L??0)&&(xe++,Ae=setTimeout(()=>{a=performance.now(),he=false,oe=false,Me.clear(),Ve(),ne=requestAnimationFrame(ce);},N));return}T||(ne=requestAnimationFrame(ce));}function ue(){cancelAnimationFrame(ne),clearTimeout(Ae),a=performance.now(),E=0,le=false,he=false,oe=false,xe=0,Me.clear(),Ve(),ne=requestAnimationFrame(ce);}let fe=new IntersectionObserver(F=>{F.forEach(m=>{m.isIntersecting&&!(Q&&oe)?ue():!m.isIntersecting&&!Q&&!oe&&(cancelAnimationFrame(ne),clearTimeout(Ae),a=null);});},{root:U??null,threshold:k,rootMargin:G}),v;function O(){clearTimeout(v),v=setTimeout(()=>{_.forEach((F,m)=>{I[m]=_e(F),F.style.strokeDasharray=`${I[m]}`;});},150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),q>0?setTimeout(()=>fe.observe(e),q):fe.observe(e),{destroy(){cancelAnimationFrame(ne),clearTimeout(Ae),fe.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(v);},replay(){xe=0,ue();},pause(){le||(le=true,E=performance.now()-a,cancelAnimationFrame(ne));},resume(){le&&(le=false,a=performance.now()-E,ne=requestAnimationFrame(ce));},seek(F){let m=Math.min(1,Math.max(0,F));Le=m,le=true,E=m*s,a=performance.now()-E,cancelAnimationFrame(ne),j(E);},getProgress(){return Le}}}if(re)return At();Je();function qe(){if(!He||le)return;let s=performance.now(),a=De(),E=l;if(C!==false){let v=s-Ue,O=v>0?Math.abs(a-(ze<0?a:ze))/v:0;E=l*Math.max(.2,1+O*(typeof C=="number"?C:1)*.04);}ze=a,Ue=s;let j=te?Re===-1||a>=Re?"forward":"reverse":S;Re=a;let ce=Te-ge,ue=true,fe=ce===0?0:(a-ge)/ce;if(isNaN(Ie)||(Ie<=0&&fe>0?h?.():Ie>0&&fe<=0&&be?.(),Ie<1&&fe>=1?X?.():Ie>=1&&fe<1&&Se?.()),Ie=fe,we){let v=de(K(a,ge,Te,E));Q&&!te&&(ve=Math.max(ve,v),v=ve),Le=v,e.style.setProperty("--scroll-draw-progress",String(v));let O=j==="reverse"?1-v:v;e.style.clipPath=J(O),d?.(v),!he&&K(a,ge,Te,E)>0&&(he=true,P?.()),v>=1&&!oe?(oe=true,g?.(),xe<(L==="infinite"?1/0:L??0)&&(xe++,Ae=setTimeout(()=>{ve=-1,he=false,oe=false,e.style.clipPath=J(0);},N))):v<1&&!Q&&(oe=false),ne=requestAnimationFrame(qe);return}if(_.forEach((v,O)=>{let F=O*B*ce,m=de(K(a,ge+F,Te+F,E));Q&&!te&&(ve=Math.max(ve,m),m=ve),Le=m,v.style.strokeDashoffset=j==="reverse"?`${I[O]*m}`:`${I[O]*(1-m)}`,c&&(v.style.opacity=j==="reverse"?`${1-m}`:`${m}`),i&&p?v.style.stroke=Fe(i,p,m):p&&(v.style.stroke=p),Y!==null&&H!==null?v.style.strokeWidth=`${Y+(H-Y)*m}`:H!==null&&(v.style.strokeWidth=`${H}`),Z!==null&&se!==null?v.style.fillOpacity=`${Z+(se-Z)*m}`:se!==null&&(v.style.fillOpacity=`${se}`),M&&v.tagName.toLowerCase()==="path"&&me[O]&&v.setAttribute("d",Ye(me[O],M,m)),O===0&&(d?.(m),e.style.setProperty("--scroll-draw-progress",String(m))),m<1&&(ue=false);}),b){let v=de(K(a,ge,Te,E));for(let O in b){let F=parseFloat(O);v>=F&&!Me.has(F)&&(Me.add(F),b[O]?.());}}!he&&K(a,ge,Te,E)>0&&(he=true,P?.()),ue&&!oe?(oe=true,g?.(),xe<(L==="infinite"?1/0:L??0)&&(xe++,Ae=setTimeout(()=>{ve=-1,he=false,oe=false,Me.clear(),Ve();},N))):!ue&&!Q&&(oe=false),ne=requestAnimationFrame(qe);}let Ge=new IntersectionObserver(s=>{s.forEach(a=>{He=a.isIntersecting,He&&!le?ne=requestAnimationFrame(qe):cancelAnimationFrame(ne);});},{root:U??null,threshold:k,rootMargin:G}),Xe;function We(){clearTimeout(Xe),Xe=setTimeout(()=>{_.forEach((s,a)=>{I[a]=_e(s),s.style.strokeDasharray=`${I[a]}`;}),Je();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),q>0?setTimeout(()=>Ge.observe(e),q):Ge.observe(e),{destroy(){cancelAnimationFrame(ne),clearTimeout(Ae),Ge.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Xe),Be?.remove();},replay(){ve=-1,Re=-1,ze=-1,he=false,oe=false,xe=0,le=false,Me.clear(),clearTimeout(Ae),Ve();},pause(){le=true,cancelAnimationFrame(ne);},resume(){le&&(le=false,He&&(ne=requestAnimationFrame(qe)));},seek(s){let a=Math.min(1,Math.max(0,s));Le=a,ve=a,le=true,cancelAnimationFrame(ne),St(a,S);},getProgress(){return Le}}}var ot=new Map;function Pe(e,r){ot.set(e,r);}function $e(e){ot.delete(e);}function Ot(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function it(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],f=t[2].trim();if(f)for(let l of f.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Ft(e,r,n){let t=it(e),u=it(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,f)=>{let l=u[f];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,y)=>`${c}${l.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(l.nums[y]-c)*n}${o.units[y]}`).join(", ")})`}).join(" ")}function at(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Ot(t))return Fe(t,u,n);if(t.includes("("))return Ft(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),f=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&f){let l=parseFloat(o[1]),c=parseFloat(f[1]);return `${l+(c-l)*n}${o[2]||f[2]}`}return n<1?t:u}function Nt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Dt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ht=0;function Rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ct(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:f=1,once:l=false,axis:c="y",scrollContainer:y,native:$=true,onProgress:B,onComplete:S,onEnter:Q,onLeave:ye,onEnterBack:R,onLeaveBack:ee}=r,te=window.matchMedia("(prefers-reduced-motion: reduce)").matches,q=typeof o=="function"?o:ie[o]??ie["ease-out"],x=ae(u.start??"top bottom"),A=ae(u.end??"bottom top"),w=typeof y=="string"?document.querySelector(y):y??null,b=Object.entries(t).map(([i,p])=>({prop:Nt(i),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function C(){let i=window.getComputedStyle(e);for(let p of b)p.from===""&&(p.from=i.getPropertyValue(p.prop).trim()||"0");}function k(){for(let i of b)e.style.setProperty(i.prop,String(i.to));}if(te)return k(),S?.(),n;C();function G(){if(!$||!Rt()||typeof o!="string"||!(o in lt)||c!=="y"||w||l||f!==1||B||S||Q||ye||R||ee||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let i of b)if(!Dt.has(i.prop))return false;return true}function L(){let i=`ssd-a-${++Ht}`,p=b.map(J=>`${J.prop}:${J.from}`).join(";"),Y=b.map(J=>`${J.prop}:${J.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${i}{from{${p}}to{${Y}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${lt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(i);let Z=()=>c==="x"?window.scrollX:window.scrollY,se=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),H.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(J){let _=Math.min(1,Math.max(0,J));e.classList.remove(i);for(let I of b)e.style.setProperty(I.prop,at(I.from,I.to,_));},getProgress(){let J=e.getBoundingClientRect(),_=Z(),I=se(),{tStart:me,tEnd:ge}=pe({top:J.top,height:J.height},_,I,x,A);return q(K(_,me,ge,f))}}}if(G())return L();let N=0,M=0,z=0,re=false,D=false,W=-1,d=0,P=false,g=NaN,h=()=>w?c==="x"?w.scrollLeft:w.scrollTop:c==="x"?window.scrollX:window.scrollY,X=()=>w?c==="x"?w.clientWidth:w.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function Se(){let i=e.getBoundingClientRect(),p,Y;if(w){let Z=w.getBoundingClientRect();p=c==="x"?i.left-Z.left+w.scrollLeft:i.top-Z.top+w.scrollTop,Y=c==="x"?i.width:i.height;}else p=c==="x"?i.left:i.top,Y=c==="x"?i.width:i.height;let H=pe({top:p,height:Y},h(),X(),x,A);N=H.tStart,M=H.tEnd;}function be(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let p of b)e.style.setProperty(p.prop,at(p.from,p.to,i));B?.(i);}function we(i){if(isNaN(g)){g=i;return}g<=0&&i>0?Q?.():g>0&&i<=0&&ee?.(),g<1&&i>=1?ye?.():g>=1&&i<1&&R?.(),g=i;}function de(){if(!re||D)return;let i=M===N?0:(h()-N)/(M-N);we(i);let p=q(K(h(),N,M,f));l&&(W=Math.max(W,p),p=W),d=p,be(p),p>=1&&!P?(P=true,S?.()):p<1&&!l&&(P=false),z=requestAnimationFrame(de);}Se();{let i=q(K(h(),N,M,f));l&&i>0&&(W=i),d=i,be(i);}let Ne=new IntersectionObserver(i=>{i.forEach(p=>{re=p.isIntersecting,re&&!D?z=requestAnimationFrame(de):cancelAnimationFrame(z);});},{root:w??null}),ke;function U(){clearTimeout(ke),ke=setTimeout(Se,150);}return window.addEventListener("resize",U),window.addEventListener("orientationchange",U),Ne.observe(e),Pe(e,{type:"animate",getProgress:()=>d,getTrigger:()=>({tStart:N,tEnd:M})}),{destroy(){cancelAnimationFrame(z),Ne.disconnect(),window.removeEventListener("resize",U),window.removeEventListener("orientationchange",U),clearTimeout(ke),$e(e);},replay(){W=-1,P=false,d=0,D=false,be(0);},pause(){D=true,cancelAnimationFrame(z);},resume(){D&&(D=false,re&&(z=requestAnimationFrame(de)));},seek(i){let p=Math.min(1,Math.max(0,i));d=p,W=p,D=true,cancelAnimationFrame(z),be(p);},getProgress(){return d}}}var je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,r){if(typeof window>"u")return je;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),je;let t=n,{from:u=0,to:o,format:f,easing:l="ease-out",trigger:c={},once:y=true,decimals:$,onComplete:B}=r,S=$!==void 0?d=>d.toFixed($):f??(d=>String(Math.round(d))),Q=typeof l=="function"?l:ie[l]??ie["ease-out"],ye=ae(c.start??"top 80%"),R=ae(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(o),B?.(),je;t.textContent=S(u);let te=0,q=0,x=0,A=false,w=false,b=-1,C=0,k=false,G=()=>window.scrollY,L=()=>window.innerHeight;function N(){let d=t.getBoundingClientRect(),P=pe({top:d.top,height:d.height},G(),L(),ye,R);te=P.tStart,q=P.tEnd;}function M(d){t.textContent=S(u+(o-u)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function z(){if(!A||w)return;let d=Q(K(G(),te,q,1));y&&(b=Math.max(b,d),d=b),C=d,M(d),d>=1&&!k?(k=true,B?.()):d<1&&!y&&(k=false),x=requestAnimationFrame(z);}N();{let d=Q(K(G(),te,q,1));y&&d>0&&(b=d),C=d,M(d);}let re=new IntersectionObserver(d=>{d.forEach(P=>{A=P.isIntersecting,A&&!w?x=requestAnimationFrame(z):cancelAnimationFrame(x);});}),D;function W(){clearTimeout(D),D=setTimeout(N,150);}return window.addEventListener("resize",W),window.addEventListener("orientationchange",W),re.observe(t),Pe(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:te,tEnd:q})}),{destroy(){cancelAnimationFrame(x),re.disconnect(),window.removeEventListener("resize",W),window.removeEventListener("orientationchange",W),clearTimeout(D),$e(t);},replay(){b=-1,k=false,C=0,w=false,M(0);},pause(){w=true,cancelAnimationFrame(x);},resume(){w&&(w=false,A&&(x=requestAnimationFrame(z)));},seek(d){let P=Math.min(1,Math.max(0,d));C=P,b=P,w=true,cancelAnimationFrame(x),M(P);},getProgress(){return C}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r={}){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),mt;let t=n,{trigger:u={},easing:o="linear",once:f=false,axis:l="y",preload:c="auto",onReady:y,onComplete:$,onProgress:B}=r,S=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=typeof o=="function"?o:ie[o]??ie.linear,ye=ae(u.start??"top top"),R=ae(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let ee=r.from??0,te=r.to,q=0,x=0,A=0,w=false,b=false,C=-1,k=0,G=false,L=false,N=()=>l==="x"?window.scrollX:window.scrollY,M=()=>l==="x"?window.innerWidth:window.innerHeight;function z(){let h=t.getBoundingClientRect(),X=l==="x"?h.left:h.top,Se=l==="x"?h.width:h.height,be=pe({top:X,height:Se},N(),M(),ye,R);q=be.tStart,x=be.tEnd;}function re(h){if(!L)return;let X=te??t.duration??0;t.currentTime=ee+(X-ee)*h,t.style.setProperty("--scroll-draw-progress",String(h)),B?.(h);}function D(){if(!w||b||!L)return;let h=Q(K(N(),q,x,1));f&&(C=Math.max(C,h),h=C),k=h,re(h),h>=1&&!G?(G=true,$?.()):h<1&&!f&&(G=false),A=requestAnimationFrame(D);}function W(){if(L=true,te===void 0&&(te=t.duration),S){re(1),y?.();return}z(),y?.(),w&&!b&&(A=requestAnimationFrame(D));}t.readyState>=1?W():t.addEventListener("loadedmetadata",W,{once:true}),L||z();let d=new IntersectionObserver(h=>{h.forEach(X=>{w=X.isIntersecting,w&&!b&&L?A=requestAnimationFrame(D):cancelAnimationFrame(A);});}),P;function g(){clearTimeout(P),P=setTimeout(z,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),d.observe(t),Pe(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:q,tEnd:x})}),{destroy(){cancelAnimationFrame(A),d.disconnect(),t.removeEventListener("loadedmetadata",W),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(P),$e(t);},replay(){C=-1,G=false,k=0,b=false,re(0);},pause(){b=true,cancelAnimationFrame(A);},resume(){b&&(b=false,w&&L&&(A=requestAnimationFrame(D)));},seek(h){let X=Math.min(1,Math.max(0,h));k=X,C=X,b=true,cancelAnimationFrame(A),re(X);},getProgress(){return k}}}function gt(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function zt(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function pt(e){let r=gt(e),n=new Map;for(let o of r){let f=o.offsetTop;n.has(f)||n.set(f,[]),n.get(f).push(o);}let t=[],u=Array.from(n.keys()).sort((o,f)=>o-f);for(let o of u){let f=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of f)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Vt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,f=o+(1-u);return f<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(f-o)))}function qt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ht(e,r={}){if(typeof window>"u")return dt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=n,{split:u="words",stagger:o=.04,easing:f="ease-out",from:l={opacity:0,y:24},trigger:c={},once:y=true,onComplete:$}=r,B=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof f=="function"?f:ie[f]??ie["ease-out"],Q=ae(c.start??"top 85%"),ye=ae(c.end??"top 40%"),R=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=zt(t):u==="lines"?ee=pt(t):ee=gt(t);let te=ee.length;function q(g,h){l?.opacity!==void 0&&(g.style.opacity=String(l.opacity+(1-l.opacity)*h));let X=qt(h,l);X&&(g.style.transform=X);}function x(g){t.style.setProperty("--scroll-draw-progress",String(g)),ee.forEach((h,X)=>{let Se=S(Vt(g,X,te,o));q(h,Se);});}if(B)return x(1),$?.(),{destroy(){t.innerHTML=R,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let A=0,w=0,b=0,C=false,k=false,G=-1,L=0,N=false,M=()=>window.scrollY,z=()=>window.innerHeight;function re(){let g=t.getBoundingClientRect(),h=pe({top:g.top,height:g.height},M(),z(),Q,ye);A=h.tStart,w=h.tEnd;}function D(){if(!C||k)return;let g=K(M(),A,w,1);y&&(G=Math.max(G,g),g=G),L=g,x(g),g>=1&&!N?(N=true,$?.()):g<1&&!y&&(N=false),b=requestAnimationFrame(D);}re();let W=new IntersectionObserver(g=>{g.forEach(h=>{C=h.isIntersecting,C&&!k?b=requestAnimationFrame(D):cancelAnimationFrame(b);});}),d;function P(){clearTimeout(d),d=setTimeout(()=>{if(u==="lines"){let g=L;t.innerHTML=R,t.setAttribute("aria-label",t.textContent??""),ee=pt(t),x(g);}re();},150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),W.observe(t),Pe(t,{type:"text",getProgress:()=>L,getTrigger:()=>({tStart:A,tEnd:w})}),{destroy(){cancelAnimationFrame(b),W.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(d),t.innerHTML=R,t.removeAttribute("aria-label"),$e(t);},replay(){G=-1,N=false,L=0,k=false,x(0);},pause(){k=true,cancelAnimationFrame(b);},resume(){k&&(k=false,C&&(b=requestAnimationFrame(D)));},seek(g){let h=Math.min(1,Math.max(0,g));L=h,G=h,k=true,cancelAnimationFrame(b),x(h);},getProgress(){return L}}}var yt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},bt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ct(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},wt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ut(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},vt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ft(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},Et=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ht(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};export{bt as ScrollAnimateRef,wt as ScrollCounterRef,yt as ScrollDrawRef,Et as ScrollTextRef,vt as ScrollVideoRef};
3
+ <div style="position:absolute;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function Ye(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let f=parseFloat(o),l=t[u++]??f;return String(+(f+(l-f)*n).toFixed(4))})}function st(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...tt[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:y="linear",trigger:C={},stagger:R=0,direction:E="forward",once:j=false,debug:ye=false,axis:z="y",scrollContainer:ee,autoReverse:U=false,delay:Z=0,strokeColor:S,strokeWidth:M,fillOpacity:P,waypoints:g,velocityScale:x=false,threshold:I=0,rootMargin:G="0px",repeat:k=0,repeatDelay:oe=0,morphTo:$,clip:_,autoplay:B=false,duration:X=1e3,native:V=true,onProgress:p,onStart:T,onComplete:b,onEnter:h,onLeave:q,onEnterBack:Se,onLeaveBack:xe}=u,be=_===true?"left":typeof _=="string"?_:false,we=typeof y=="function"?y:ae[y]??ae.linear,Le=le(C.start??"top bottom"),De=le(C.end??"bottom top"),te=typeof ee=="string"?document.querySelector(ee):ee??null,pe=Array.isArray(S)?S[0]:null,J=Array.isArray(S)?S[1]:typeof S=="string"?S:null,K=Array.isArray(M)?M[0]:null,i=Array.isArray(M)?M[1]:typeof M=="number"?M:null,d=Array.isArray(P)?P[0]:null,O=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function re(s){let a=s*100;switch(be){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let L=be?[]:Array.from(e.querySelectorAll(f)),H=[],F=[],ie=0,ce=0,ne=false,de=false,se=0,He=false,ve=-1,Re=-1,ue=false,Ce=0,Te=0,Ae,Be=null,Me=new Set,ze=-1,Ue=performance.now(),Ie=NaN;function Ne(){return te?z==="x"?te.scrollLeft:te.scrollTop:z==="x"?window.scrollX:window.scrollY}function Ze(){return te?z==="x"?te.clientWidth:te.clientHeight:z==="x"?window.innerWidth:window.innerHeight}function Je(){let s=e.getBoundingClientRect(),a,v,Y;if(te){let fe=te.getBoundingClientRect();a=z==="x"?s.left-fe.left+te.scrollLeft:s.top-fe.top+te.scrollTop,v=z==="x"?s.width:s.height,Y=Ne();}else a=z==="x"?s.left:s.top,v=z==="x"?s.width:s.height,Y=Ne();let me=he({top:a,height:v},Y,Ze(),Le,De);ie=me.tStart,ce=me.tEnd,ye&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=It(ie,ce,z));}function St(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),be){let v=a==="reverse"?1-s:s;e.style.clipPath=re(v);return}L.forEach((v,Y)=>{v.style.strokeDashoffset=a==="reverse"?`${H[Y]*s}`:`${H[Y]*(1-s)}`,c&&(v.style.opacity=a==="reverse"?`${1-s}`:`${s}`),pe&&J?v.style.stroke=Fe(pe,J,s):J&&(v.style.stroke=J),K!==null&&i!==null?v.style.strokeWidth=`${K+(i-K)*s}`:i!==null&&(v.style.strokeWidth=`${i}`),d!==null&&O!==null?v.style.fillOpacity=`${d+(O-d)*s}`:O!==null&&(v.style.fillOpacity=`${O}`),$&&v.tagName.toLowerCase()==="path"&&F[Y]&&v.setAttribute("d",Ye(F[Y],$,s));});}function Ve(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=re(0);return}L.forEach((s,a)=>{s.style.strokeDasharray=`${H[a]}`,s.style.strokeDashoffset=E==="reverse"?"0":`${H[a]}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`),$&&s.tagName.toLowerCase()==="path"&&F[a]&&s.setAttribute("d",F[a]);});}if(L.forEach(s=>{kt(s);let a=_e(s);H.push(a),s.tagName.toLowerCase()==="path"?F.push(s.getAttribute("d")??""):F.push(""),o?(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?`${a}`:"0",c&&(s.style.opacity="1"),J&&(s.style.stroke=J),i!==null&&(s.style.strokeWidth=`${i}`),O!==null&&(s.style.fillOpacity=`${O}`),$&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",$)):(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?"0":`${a}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`));}),be){if(o)return e.style.clipPath=re(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=re(0);}else if(o)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function xt(){return !(V===false||!Ct()||!L.length||typeof y!="string"||!(y in nt)||be||z!=="y"||te||l!==1||R!==0||j||U||x!==false||$||g||k||Z>0||p||T||b||h||q||Se||xe||S!=null||M!=null||P!=null||(C.start??"top bottom").trim()!=="top bottom"||(C.end??"bottom top").trim()!=="bottom top")}function Tt(){let s=`svg-scroll-draw-${++Lt}`,a=E==="reverse"?"0":"var(--ssd-len)",v=E==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${a};`,me=`stroke-dashoffset:${v};`;c&&(Y+=`opacity:${E==="reverse"?1:0};`,me+=`opacity:${E==="reverse"?0:1};`);let fe=document.createElement("style");fe.setAttribute("data-svg-scroll-draw",""),fe.textContent=`@keyframes ${s}{from{${Y}}to{${me}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${nt[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe);function ge(m,A){m.style.setProperty("--ssd-len",String(H[A])),m.style.strokeDasharray=`${H[A]}`,m.style.strokeDashoffset="",m.style.opacity="",m.style.animationPlayState="",m.classList.add(s);}L.forEach(ge);let w=false,N=-1;function D(){if(N>=0)return N;let m=e.getBoundingClientRect(),{tStart:A,tEnd:W}=he({top:m.top,height:m.height},Ne(),Ze(),Le,De);return we(Q(Ne(),A,W,l))}return {destroy(){L.forEach(m=>{m.classList.remove(s),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),fe.remove();},replay(){w=false,N=-1,L.forEach(ge);},pause(){w=true,L.forEach(m=>{m.style.animationPlayState="paused";});},resume(){w&&(w=false,L.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let A=Math.min(1,Math.max(0,m));N=A,w=true,L.forEach((W,ke)=>{W.classList.remove(s),W.style.strokeDashoffset=E==="reverse"?`${H[ke]*A}`:`${H[ke]*(1-A)}`,c&&(W.style.opacity=E==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return D()}}}if(xt())return Tt();function At(){let s=Math.max(1,X),a=0,v=0;function Y(D){let m=true;if(be){let A=Math.min(1,Math.max(0,D/s)),W=we(A);Ce=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=re(E==="reverse"?1-W:W),p?.(W),A<1&&(m=false);}else L.forEach((A,W)=>{let ke=W*R*s,Oe=Math.min(1,Math.max(0,(D-ke)/s)),Ee=we(Oe);A.style.strokeDashoffset=E==="reverse"?`${H[W]*Ee}`:`${H[W]*(1-Ee)}`,c&&(A.style.opacity=E==="reverse"?`${1-Ee}`:`${Ee}`),pe&&J?A.style.stroke=Fe(pe,J,Ee):J&&(A.style.stroke=J),K!==null&&i!==null?A.style.strokeWidth=`${K+(i-K)*Ee}`:i!==null&&(A.style.strokeWidth=`${i}`),d!==null&&O!==null?A.style.fillOpacity=`${d+(O-d)*Ee}`:O!==null&&(A.style.fillOpacity=`${O}`),$&&A.tagName.toLowerCase()==="path"&&F[W]&&A.setAttribute("d",Ye(F[W],$,Ee)),W===0&&(p?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Oe<1&&(m=false);});if(g){let A=Math.min(1,Math.max(0,D/s)),W=we(A);for(let ke in g){let Oe=parseFloat(ke);W>=Oe&&!Me.has(Oe)&&(Me.add(Oe),g[ke]?.());}}return m}function me(D){if(ue)return;let m=D-a;de||(de=true,T?.());let A=Y(m);if(A&&!ne){ne=true,Y(s*(1+Math.max(0,L.length-1)*R)),b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{a=performance.now(),de=false,ne=false,Me.clear(),Ve(),se=requestAnimationFrame(me);},oe));return}A||(se=requestAnimationFrame(me));}function fe(){cancelAnimationFrame(se),clearTimeout(Ae),a=performance.now(),v=0,ue=false,de=false,ne=false,Te=0,Me.clear(),Ve(),se=requestAnimationFrame(me);}let ge=new IntersectionObserver(D=>{D.forEach(m=>{m.isIntersecting&&!(j&&ne)?fe():!m.isIntersecting&&!j&&!ne&&(cancelAnimationFrame(se),clearTimeout(Ae),a=null);});},{root:te??null,threshold:I,rootMargin:G}),w;function N(){clearTimeout(w),w=setTimeout(()=>{L.forEach((D,m)=>{H[m]=_e(D),D.style.strokeDasharray=`${H[m]}`;});},150);}return window.addEventListener("resize",N),window.addEventListener("orientationchange",N),Z>0?setTimeout(()=>ge.observe(e),Z):ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),ge.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N),clearTimeout(w);},replay(){Te=0,fe();},pause(){ue||(ue=true,v=performance.now()-a,cancelAnimationFrame(se));},resume(){ue&&(ue=false,a=performance.now()-v,se=requestAnimationFrame(me));},seek(D){let m=Math.min(1,Math.max(0,D));Ce=m,ue=true,v=m*s,a=performance.now()-v,cancelAnimationFrame(se),Y(v);},getProgress(){return Ce}}}if(B)return At();Je();function qe(){if(!He||ue)return;let s=performance.now(),a=Ne(),v=l;if(x!==false){let w=s-Ue,N=w>0?Math.abs(a-(ze<0?a:ze))/w:0;v=l*Math.max(.2,1+N*(typeof x=="number"?x:1)*.04);}ze=a,Ue=s;let Y=U?Re===-1||a>=Re?"forward":"reverse":E;Re=a;let me=ce-ie,fe=true,ge=me===0?0:(a-ie)/me;if(isNaN(Ie)||(Ie<=0&&ge>0?h?.():Ie>0&&ge<=0&&xe?.(),Ie<1&&ge>=1?q?.():Ie>=1&&ge<1&&Se?.()),Ie=ge,be){let w=we(Q(a,ie,ce,v));j&&!U&&(ve=Math.max(ve,w),w=ve),Ce=w,e.style.setProperty("--scroll-draw-progress",String(w));let N=Y==="reverse"?1-w:w;e.style.clipPath=re(N),p?.(w),!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),w>=1&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,e.style.clipPath=re(0);},oe))):w<1&&!j&&(ne=false),se=requestAnimationFrame(qe);return}if(L.forEach((w,N)=>{let D=N*R*me,m=we(Q(a,ie+D,ce+D,v));j&&!U&&(ve=Math.max(ve,m),m=ve),Ce=m,w.style.strokeDashoffset=Y==="reverse"?`${H[N]*m}`:`${H[N]*(1-m)}`,c&&(w.style.opacity=Y==="reverse"?`${1-m}`:`${m}`),pe&&J?w.style.stroke=Fe(pe,J,m):J&&(w.style.stroke=J),K!==null&&i!==null?w.style.strokeWidth=`${K+(i-K)*m}`:i!==null&&(w.style.strokeWidth=`${i}`),d!==null&&O!==null?w.style.fillOpacity=`${d+(O-d)*m}`:O!==null&&(w.style.fillOpacity=`${O}`),$&&w.tagName.toLowerCase()==="path"&&F[N]&&w.setAttribute("d",Ye(F[N],$,m)),N===0&&(p?.(m),e.style.setProperty("--scroll-draw-progress",String(m))),m<1&&(fe=false);}),g){let w=we(Q(a,ie,ce,v));for(let N in g){let D=parseFloat(N);w>=D&&!Me.has(D)&&(Me.add(D),g[N]?.());}}!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),fe&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,Me.clear(),Ve();},oe))):!fe&&!j&&(ne=false),se=requestAnimationFrame(qe);}let Ge=new IntersectionObserver(s=>{s.forEach(a=>{He=a.isIntersecting,He&&!ue?se=requestAnimationFrame(qe):cancelAnimationFrame(se);});},{root:te??null,threshold:I,rootMargin:G}),Xe;function We(){clearTimeout(Xe),Xe=setTimeout(()=>{L.forEach((s,a)=>{H[a]=_e(s),s.style.strokeDasharray=`${H[a]}`;}),Je();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),Z>0?setTimeout(()=>Ge.observe(e),Z):Ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),Ge.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Xe),Be?.remove();},replay(){ve=-1,Re=-1,ze=-1,de=false,ne=false,Te=0,ue=false,Me.clear(),clearTimeout(Ae),Ve();},pause(){ue=true,cancelAnimationFrame(se);},resume(){ue&&(ue=false,He&&(se=requestAnimationFrame(qe)));},seek(s){let a=Math.min(1,Math.max(0,s));Ce=a,ve=a,ue=true,cancelAnimationFrame(se),St(a,E);},getProgress(){return Ce}}}var ot=new Map;function Pe(e,r){ot.set(e,r);}function $e(e){ot.delete(e);}function Ot(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function it(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],f=t[2].trim();if(f)for(let l of f.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Ft(e,r,n){let t=it(e),u=it(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,f)=>{let l=u[f];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,y)=>`${c}${l.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(l.nums[y]-c)*n}${o.units[y]}`).join(", ")})`}).join(" ")}function at(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Ot(t))return Fe(t,u,n);if(t.includes("("))return Ft(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),f=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&f){let l=parseFloat(o[1]),c=parseFloat(f[1]);return `${l+(c-l)*n}${o[2]||f[2]}`}return n<1?t:u}function Nt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Dt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ht=0;function Rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ct(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:f=1,once:l=false,axis:c="y",scrollContainer:y,native:C=true,velocityScale:R=false,onProgress:E,onComplete:j,onEnter:ye,onLeave:z,onEnterBack:ee,onLeaveBack:U}=r,Z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof o=="function"?o:ae[o]??ae["ease-out"],M=le(u.start??"top bottom"),P=le(u.end??"bottom top"),g=typeof y=="string"?document.querySelector(y):y??null,x=Object.entries(t).map(([i,d])=>({prop:Nt(i),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function I(){let i=window.getComputedStyle(e);for(let d of x)d.from===""&&(d.from=i.getPropertyValue(d.prop).trim()||"0");}function G(){for(let i of x)e.style.setProperty(i.prop,String(i.to));}if(Z)return G(),j?.(),n;I();function k(){if(!C||!Rt()||typeof o!="string"||!(o in lt)||c!=="y"||g||l||f!==1||E||j||ye||z||ee||U||R!==false||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let i of x)if(!Dt.has(i.prop))return false;return true}function oe(){let i=`ssd-a-${++Ht}`,d=x.map(F=>`${F.prop}:${F.from}`).join(";"),O=x.map(F=>`${F.prop}:${F.to}`).join(";"),re=document.createElement("style");re.setAttribute("data-ssd-animate",""),re.textContent=`@keyframes ${i}{from{${d}}to{${O}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${lt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(re),e.classList.add(i);let L=()=>c==="x"?window.scrollX:window.scrollY,H=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),re.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(F){let ie=Math.min(1,Math.max(0,F));e.classList.remove(i);for(let ce of x)e.style.setProperty(ce.prop,at(ce.from,ce.to,ie));},getProgress(){let F=e.getBoundingClientRect(),ie=L(),ce=H(),{tStart:ne,tEnd:de}=he({top:F.top,height:F.height},ie,ce,M,P);return S(Q(ie,ne,de,f))}}}if(k())return oe();let $=0,_=0,B=0,X=false,V=false,p=-1,T=0,b=false,h=NaN,q=-1,Se=0,xe=()=>g?c==="x"?g.scrollLeft:g.scrollTop:c==="x"?window.scrollX:window.scrollY,be=()=>g?c==="x"?g.clientWidth:g.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function we(){let i=e.getBoundingClientRect(),d,O;if(g){let L=g.getBoundingClientRect();d=c==="x"?i.left-L.left+g.scrollLeft:i.top-L.top+g.scrollTop,O=c==="x"?i.width:i.height;}else d=c==="x"?i.left:i.top,O=c==="x"?i.width:i.height;let re=he({top:d,height:O},xe(),be(),M,P);$=re.tStart,_=re.tEnd;}function Le(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let d of x)e.style.setProperty(d.prop,at(d.from,d.to,i));E?.(i);}function De(i){if(isNaN(h)){h=i;return}h<=0&&i>0?ye?.():h>0&&i<=0&&U?.(),h<1&&i>=1?z?.():h>=1&&i<1&&ee?.(),h=i;}function te(){if(!X||V)return;let i=performance.now(),d=xe(),O=f;if(R!==false){let H=i-Se,F=H>0?Math.abs(d-(q<0?d:q))/H:0;O=f*Math.max(.2,1+F*(typeof R=="number"?R:1)*.04);}q=d,Se=i;let re=_===$?0:(d-$)/(_-$);De(re);let L=S(Q(d,$,_,O));l&&(p=Math.max(p,L),L=p),T=L,Le(L),L>=1&&!b?(b=true,j?.()):L<1&&!l&&(b=false),B=requestAnimationFrame(te);}we();{let i=S(Q(xe(),$,_,f));l&&i>0&&(p=i),T=i,Le(i);}let pe=new IntersectionObserver(i=>{i.forEach(d=>{X=d.isIntersecting,X&&!V?B=requestAnimationFrame(te):cancelAnimationFrame(B);});},{root:g??null}),J;function K(){clearTimeout(J),J=setTimeout(we,150);}return window.addEventListener("resize",K),window.addEventListener("orientationchange",K),pe.observe(e),Pe(e,{type:"animate",getProgress:()=>T,getTrigger:()=>({tStart:$,tEnd:_})}),{destroy(){cancelAnimationFrame(B),pe.disconnect(),window.removeEventListener("resize",K),window.removeEventListener("orientationchange",K),clearTimeout(J),$e(e);},replay(){p=-1,b=false,T=0,V=false,Le(0);},pause(){V=true,cancelAnimationFrame(B);},resume(){V&&(V=false,X&&(B=requestAnimationFrame(te)));},seek(i){let d=Math.min(1,Math.max(0,i));T=d,p=d,V=true,cancelAnimationFrame(B),Le(d);},getProgress(){return T}}}var je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,r){if(typeof window>"u")return je;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),je;let t=n,{from:u=0,to:o,format:f,easing:l="ease-out",trigger:c={},once:y=true,decimals:C,onComplete:R}=r,E=C!==void 0?p=>p.toFixed(C):f??(p=>String(Math.round(p))),j=typeof l=="function"?l:ae[l]??ae["ease-out"],ye=le(c.start??"top 80%"),z=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(o),R?.(),je;t.textContent=E(u);let U=0,Z=0,S=0,M=false,P=false,g=-1,x=0,I=false,G=()=>window.scrollY,k=()=>window.innerHeight;function oe(){let p=t.getBoundingClientRect(),T=he({top:p.top,height:p.height},G(),k(),ye,z);U=T.tStart,Z=T.tEnd;}function $(p){t.textContent=E(u+(o-u)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function _(){if(!M||P)return;let p=j(Q(G(),U,Z,1));y&&(g=Math.max(g,p),p=g),x=p,$(p),p>=1&&!I?(I=true,R?.()):p<1&&!y&&(I=false),S=requestAnimationFrame(_);}oe();{let p=j(Q(G(),U,Z,1));y&&p>0&&(g=p),x=p,$(p);}let B=new IntersectionObserver(p=>{p.forEach(T=>{M=T.isIntersecting,M&&!P?S=requestAnimationFrame(_):cancelAnimationFrame(S);});}),X;function V(){clearTimeout(X),X=setTimeout(oe,150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),B.observe(t),Pe(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:U,tEnd:Z})}),{destroy(){cancelAnimationFrame(S),B.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(X),$e(t);},replay(){g=-1,I=false,x=0,P=false,$(0);},pause(){P=true,cancelAnimationFrame(S);},resume(){P&&(P=false,M&&(S=requestAnimationFrame(_)));},seek(p){let T=Math.min(1,Math.max(0,p));x=T,g=T,P=true,cancelAnimationFrame(S),$(T);},getProgress(){return x}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r={}){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),mt;let t=n,{trigger:u={},easing:o="linear",once:f=false,axis:l="y",preload:c="auto",onReady:y,onComplete:C,onProgress:R}=r,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,j=typeof o=="function"?o:ae[o]??ae.linear,ye=le(u.start??"top top"),z=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let ee=r.from??0,U=r.to,Z=0,S=0,M=0,P=false,g=false,x=-1,I=0,G=false,k=false,oe=()=>l==="x"?window.scrollX:window.scrollY,$=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let h=t.getBoundingClientRect(),q=l==="x"?h.left:h.top,Se=l==="x"?h.width:h.height,xe=he({top:q,height:Se},oe(),$(),ye,z);Z=xe.tStart,S=xe.tEnd;}function B(h){if(!k)return;let q=U??t.duration??0;t.currentTime=ee+(q-ee)*h,t.style.setProperty("--scroll-draw-progress",String(h)),R?.(h);}function X(){if(!P||g||!k)return;let h=j(Q(oe(),Z,S,1));f&&(x=Math.max(x,h),h=x),I=h,B(h),h>=1&&!G?(G=true,C?.()):h<1&&!f&&(G=false),M=requestAnimationFrame(X);}function V(){if(k=true,U===void 0&&(U=t.duration),E){B(1),y?.();return}_(),y?.(),P&&!g&&(M=requestAnimationFrame(X));}t.readyState>=1?V():t.addEventListener("loadedmetadata",V,{once:true}),k||_();let p=new IntersectionObserver(h=>{h.forEach(q=>{P=q.isIntersecting,P&&!g&&k?M=requestAnimationFrame(X):cancelAnimationFrame(M);});}),T;function b(){clearTimeout(T),T=setTimeout(_,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),p.observe(t),Pe(t,{type:"video",getProgress:()=>I,getTrigger:()=>({tStart:Z,tEnd:S})}),{destroy(){cancelAnimationFrame(M),p.disconnect(),t.removeEventListener("loadedmetadata",V),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(T),$e(t);},replay(){x=-1,G=false,I=0,g=false,B(0);},pause(){g=true,cancelAnimationFrame(M);},resume(){g&&(g=false,P&&k&&(M=requestAnimationFrame(X)));},seek(h){let q=Math.min(1,Math.max(0,h));I=q,x=q,g=true,cancelAnimationFrame(M),B(q);},getProgress(){return I}}}function gt(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function zt(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function pt(e){let r=gt(e),n=new Map;for(let o of r){let f=o.offsetTop;n.has(f)||n.set(f,[]),n.get(f).push(o);}let t=[],u=Array.from(n.keys()).sort((o,f)=>o-f);for(let o of u){let f=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of f)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Vt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,f=o+(1-u);return f<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(f-o)))}function qt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ht(e,r={}){if(typeof window>"u")return dt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=n,{split:u="words",stagger:o=.04,easing:f="ease-out",from:l={opacity:0,y:24},trigger:c={},once:y=true,onComplete:C}=r,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof f=="function"?f:ae[f]??ae["ease-out"],j=le(c.start??"top 85%"),ye=le(c.end??"top 40%"),z=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=zt(t):u==="lines"?ee=pt(t):ee=gt(t);let U=ee.length;function Z(b,h){l?.opacity!==void 0&&(b.style.opacity=String(l.opacity+(1-l.opacity)*h));let q=qt(h,l);q&&(b.style.transform=q);}function S(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach((h,q)=>{let Se=E(Vt(b,q,U,o));Z(h,Se);});}if(R)return S(1),C?.(),{destroy(){t.innerHTML=z,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};S(0);let M=0,P=0,g=0,x=false,I=false,G=-1,k=0,oe=false,$=()=>window.scrollY,_=()=>window.innerHeight;function B(){let b=t.getBoundingClientRect(),h=he({top:b.top,height:b.height},$(),_(),j,ye);M=h.tStart,P=h.tEnd;}function X(){if(!x||I)return;let b=Q($(),M,P,1);y&&(G=Math.max(G,b),b=G),k=b,S(b),b>=1&&!oe?(oe=true,C?.()):b<1&&!y&&(oe=false),g=requestAnimationFrame(X);}B();let V=new IntersectionObserver(b=>{b.forEach(h=>{x=h.isIntersecting,x&&!I?g=requestAnimationFrame(X):cancelAnimationFrame(g);});}),p;function T(){clearTimeout(p),p=setTimeout(()=>{if(u==="lines"){let b=k;t.innerHTML=z,t.setAttribute("aria-label",t.textContent??""),ee=pt(t),S(b);}B();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),V.observe(t),Pe(t,{type:"text",getProgress:()=>k,getTrigger:()=>({tStart:M,tEnd:P})}),{destroy(){cancelAnimationFrame(g),V.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(p),t.innerHTML=z,t.removeAttribute("aria-label"),$e(t);},replay(){G=-1,oe=false,k=0,I=false,S(0);},pause(){I=true,cancelAnimationFrame(g);},resume(){I&&(I=false,x&&(g=requestAnimationFrame(X)));},seek(b){let h=Math.min(1,Math.max(0,b));k=h,G=h,I=true,cancelAnimationFrame(g),S(h);},getProgress(){return k}}}var yt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},bt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ct(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},wt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ut(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},vt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ft(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},Et=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ht(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};export{bt as ScrollAnimateRef,wt as ScrollCounterRef,yt as ScrollDrawRef,Et as ScrollTextRef,vt as ScrollVideoRef};
@@ -1,3 +1,3 @@
1
- 'use strict';function ot({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),m=Math.sqrt(t),s=0,f=[];for(let g=0;g<r;g++){let A=Math.pow(m,g);f.push(A),s+=A;}let p=[0],c=0;for(let g=0;g<r;g++)c+=f[g]/s,p.push(c);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let A=0;A<r;A++)if(g<=p[A+1]){let _=(g-p[A])/(p[A+1]-p[A]);if(A===0)return _*(2-_);let v=1-Math.pow(t,A);return v+(1-v)*(2*_-1)*(2*_-1)}return 1}}function st({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),m=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-m)*(2*Math.PI)/t)+1}var ae={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:ot(),elastic:st()};function me(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 tt(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 rt(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 We(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 vt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:vt((e-n)/(r-n)*t,0,1)}function be(e,n,r,t,m){let s=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),f=tt(e.top,e.height,n,m.element)-rt(m.viewport,r);return {tStart:s,tEnd:f}}function nt(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 Oe(e,n,r){let t=nt(e),m=nt(n);return !t||!m?e:`rgb(${Math.round(t[0]+(m[0]-t[0])*r)},${Math.round(t[1]+(m[1]-t[1])*r)},${Math.round(t[2]+(m[2]-t[2])*r)})`}var Xe={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}};function it(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var at={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Et=0;function xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Tt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?it("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&it("Element has a fill \u2014 it may obscure the stroke animation.",e);}function At(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 m(){let s=r==="x"?window.scrollX:window.scrollY,f=e-s,p=n-s,c=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}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;${c?`left:${p}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${p}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",m,{passive:true}),m(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),m=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let f=parseFloat(s),p=t[m++]??f;return String(+(f+(p-f)*r).toFixed(4))})}function _e(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,m=r?{...Xe[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:p=1,fade:c=false,easing:g="linear",trigger:A={},stagger:_=0,direction:v="forward",once:Q=false,debug:ve=false,axis:I="y",scrollContainer:te,autoReverse:ie=false,delay:J=0,strokeColor:x,strokeWidth:N,fillOpacity:b,waypoints:S,velocityScale:q=false,threshold:G=0,rootMargin:re="0px",repeat:z=0,repeatDelay:F=0,morphTo:T,clip:j,autoplay:le=false,duration:Y=1e3,native:U=true,onProgress:d,onStart:M,onComplete:y,onEnter:k,onLeave:we,onEnterBack:Ae,onLeaveBack:Me}=m,ge=j===true?"left":typeof j=="string"?j:false,pe=typeof g=="function"?g:ae[g]??ae.linear,Ne=me(A.start??"top bottom"),Le=me(A.end??"bottom top"),V=typeof te=="string"?document.querySelector(te):te??null,i=Array.isArray(x)?x[0]:null,u=Array.isArray(x)?x[1]:typeof x=="string"?x:null,H=Array.isArray(N)?N[0]:null,P=Array.isArray(N)?N[1]:typeof N=="number"?N:null,B=Array.isArray(b)?b[0]:null,Z=Array.isArray(b)?b[1]:typeof b=="number"?b:null;function W(o){let a=o*100;switch(ge){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 D=ge?[]:Array.from(e.querySelectorAll(f)),C=[],ce=[],fe=0,Ee=0,ee=false,de=false,X=0,He=false,ye=-1,Re=-1,ne=false,Ce=0,Se=0,xe,Ge=null,Te=new Set,qe=-1,Ke=performance.now(),Pe=NaN;function Fe(){return V?I==="x"?V.scrollLeft:V.scrollTop:I==="x"?window.scrollX:window.scrollY}function Qe(){return V?I==="x"?V.clientWidth:V.clientHeight:I==="x"?window.innerWidth:window.innerHeight}function et(){let o=e.getBoundingClientRect(),a,w,R;if(V){let se=V.getBoundingClientRect();a=I==="x"?o.left-se.left+V.scrollLeft:o.top-se.top+V.scrollTop,w=I==="x"?o.width:o.height,R=Fe();}else a=I==="x"?o.left:o.top,w=I==="x"?o.width:o.height,R=Fe();let oe=be({top:a,height:w},R,Qe(),Ne,Le);fe=oe.tStart,Ee=oe.tEnd,ve&&process.env.NODE_ENV!=="production"&&(Ge?.remove(),Ge=At(fe,Ee,I));}function ht(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ge){let w=a==="reverse"?1-o:o;e.style.clipPath=W(w);return}D.forEach((w,R)=>{w.style.strokeDashoffset=a==="reverse"?`${C[R]*o}`:`${C[R]*(1-o)}`,c&&(w.style.opacity=a==="reverse"?`${1-o}`:`${o}`),i&&u?w.style.stroke=Oe(i,u,o):u&&(w.style.stroke=u),H!==null&&P!==null?w.style.strokeWidth=`${H+(P-H)*o}`:P!==null&&(w.style.strokeWidth=`${P}`),B!==null&&Z!==null?w.style.fillOpacity=`${B+(Z-B)*o}`:Z!==null&&(w.style.fillOpacity=`${Z}`),T&&w.tagName.toLowerCase()==="path"&&ce[R]&&w.setAttribute("d",Je(ce[R],T,o));});}function ze(){if(e.style.setProperty("--scroll-draw-progress","0"),ge){e.style.clipPath=W(0);return}D.forEach((o,a)=>{o.style.strokeDasharray=`${C[a]}`,o.style.strokeDashoffset=v==="reverse"?"0":`${C[a]}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",i&&(o.style.stroke=i),H!==null&&(o.style.strokeWidth=`${H}`),B!==null&&(o.style.fillOpacity=`${B}`),T&&o.tagName.toLowerCase()==="path"&&ce[a]&&o.setAttribute("d",ce[a]);});}if(D.forEach(o=>{Tt(o);let a=We(o);C.push(a),o.tagName.toLowerCase()==="path"?ce.push(o.getAttribute("d")??""):ce.push(""),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=v==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),u&&(o.style.stroke=u),P!==null&&(o.style.strokeWidth=`${P}`),Z!==null&&(o.style.fillOpacity=`${Z}`),T&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",T)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=v==="reverse"?"0":`${a}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",i&&(o.style.stroke=i),H!==null&&(o.style.strokeWidth=`${H}`),B!==null&&(o.style.fillOpacity=`${B}`));}),ge){if(s)return e.style.clipPath=W(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=W(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(U===false||!xt()||!D.length||typeof g!="string"||!(g in at)||ge||I!=="y"||V||p!==1||_!==0||Q||ie||q!==false||T||S||z||J>0||d||M||y||k||we||Ae||Me||x!=null||N!=null||b!=null||(A.start??"top bottom").trim()!=="top bottom"||(A.end??"bottom top").trim()!=="bottom top")}function wt(){let o=`svg-scroll-draw-${++Et}`,a=v==="reverse"?"0":"var(--ssd-len)",w=v==="reverse"?"var(--ssd-len)":"0",R=`stroke-dashoffset:${a};`,oe=`stroke-dashoffset:${w};`;c&&(R+=`opacity:${v==="reverse"?1:0};`,oe+=`opacity:${v==="reverse"?0:1};`);let se=document.createElement("style");se.setAttribute("data-svg-scroll-draw",""),se.textContent=`@keyframes ${o}{from{${R}}to{${oe}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${at[g]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(se);function ue(l,E){l.style.setProperty("--ssd-len",String(C[E])),l.style.strokeDasharray=`${C[E]}`,l.style.strokeDashoffset="",l.style.opacity="",l.style.animationPlayState="",l.classList.add(o);}D.forEach(ue);let h=false,$=-1;function L(){if($>=0)return $;let l=e.getBoundingClientRect(),{tStart:E,tEnd:O}=be({top:l.top,height:l.height},Fe(),Qe(),Ne,Le);return pe(K(Fe(),E,O,p))}return {destroy(){D.forEach(l=>{l.classList.remove(o),l.style.removeProperty("--ssd-len"),l.style.animationPlayState="";}),se.remove();},replay(){h=false,$=-1,D.forEach(ue);},pause(){h=true,D.forEach(l=>{l.style.animationPlayState="paused";});},resume(){h&&(h=false,D.forEach(l=>{l.style.animationPlayState="running";}));},seek(l){let E=Math.min(1,Math.max(0,l));$=E,h=true,D.forEach((O,$e)=>{O.classList.remove(o),O.style.strokeDashoffset=v==="reverse"?`${C[$e]*E}`:`${C[$e]*(1-E)}`,c&&(O.style.opacity=v==="reverse"?`${1-E}`:`${E}`);});},getProgress(){return L()}}}if(bt())return wt();function St(){let o=Math.max(1,Y),a=0,w=0;function R(L){let l=true;if(ge){let E=Math.min(1,Math.max(0,L/o)),O=pe(E);Ce=O,e.style.setProperty("--scroll-draw-progress",String(O)),e.style.clipPath=W(v==="reverse"?1-O:O),d?.(O),E<1&&(l=false);}else D.forEach((E,O)=>{let $e=O*_*o,ke=Math.min(1,Math.max(0,(L-$e)/o)),he=pe(ke);E.style.strokeDashoffset=v==="reverse"?`${C[O]*he}`:`${C[O]*(1-he)}`,c&&(E.style.opacity=v==="reverse"?`${1-he}`:`${he}`),i&&u?E.style.stroke=Oe(i,u,he):u&&(E.style.stroke=u),H!==null&&P!==null?E.style.strokeWidth=`${H+(P-H)*he}`:P!==null&&(E.style.strokeWidth=`${P}`),B!==null&&Z!==null?E.style.fillOpacity=`${B+(Z-B)*he}`:Z!==null&&(E.style.fillOpacity=`${Z}`),T&&E.tagName.toLowerCase()==="path"&&ce[O]&&E.setAttribute("d",Je(ce[O],T,he)),O===0&&(d?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),ke<1&&(l=false);});if(S){let E=Math.min(1,Math.max(0,L/o)),O=pe(E);for(let $e in S){let ke=parseFloat($e);O>=ke&&!Te.has(ke)&&(Te.add(ke),S[$e]?.());}}return l}function oe(L){if(ne)return;let l=L-a;de||(de=true,M?.());let E=R(l);if(E&&!ee){ee=true,R(o*(1+Math.max(0,D.length-1)*_)),y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{a=performance.now(),de=false,ee=false,Te.clear(),ze(),X=requestAnimationFrame(oe);},F));return}E||(X=requestAnimationFrame(oe));}function se(){cancelAnimationFrame(X),clearTimeout(xe),a=performance.now(),w=0,ne=false,de=false,ee=false,Se=0,Te.clear(),ze(),X=requestAnimationFrame(oe);}let ue=new IntersectionObserver(L=>{L.forEach(l=>{l.isIntersecting&&!(Q&&ee)?se():!l.isIntersecting&&!Q&&!ee&&(cancelAnimationFrame(X),clearTimeout(xe),a=null);});},{root:V??null,threshold:G,rootMargin:re}),h;function $(){clearTimeout(h),h=setTimeout(()=>{D.forEach((L,l)=>{C[l]=We(L),L.style.strokeDasharray=`${C[l]}`;});},150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),J>0?setTimeout(()=>ue.observe(e),J):ue.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),ue.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(h);},replay(){Se=0,se();},pause(){ne||(ne=true,w=performance.now()-a,cancelAnimationFrame(X));},resume(){ne&&(ne=false,a=performance.now()-w,X=requestAnimationFrame(oe));},seek(L){let l=Math.min(1,Math.max(0,L));Ce=l,ne=true,w=l*o,a=performance.now()-w,cancelAnimationFrame(X),R(w);},getProgress(){return Ce}}}if(le)return St();et();function Ve(){if(!He||ne)return;let o=performance.now(),a=Fe(),w=p;if(q!==false){let h=o-Ke,$=h>0?Math.abs(a-(qe<0?a:qe))/h:0;w=p*Math.max(.2,1+$*(typeof q=="number"?q:1)*.04);}qe=a,Ke=o;let R=ie?Re===-1||a>=Re?"forward":"reverse":v;Re=a;let oe=Ee-fe,se=true,ue=oe===0?0:(a-fe)/oe;if(isNaN(Pe)||(Pe<=0&&ue>0?k?.():Pe>0&&ue<=0&&Me?.(),Pe<1&&ue>=1?we?.():Pe>=1&&ue<1&&Ae?.()),Pe=ue,ge){let h=pe(K(a,fe,Ee,w));Q&&!ie&&(ye=Math.max(ye,h),h=ye),Ce=h,e.style.setProperty("--scroll-draw-progress",String(h));let $=R==="reverse"?1-h:h;e.style.clipPath=W($),d?.(h),!de&&K(a,fe,Ee,w)>0&&(de=true,M?.()),h>=1&&!ee?(ee=true,y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{ye=-1,de=false,ee=false,e.style.clipPath=W(0);},F))):h<1&&!Q&&(ee=false),X=requestAnimationFrame(Ve);return}if(D.forEach((h,$)=>{let L=$*_*oe,l=pe(K(a,fe+L,Ee+L,w));Q&&!ie&&(ye=Math.max(ye,l),l=ye),Ce=l,h.style.strokeDashoffset=R==="reverse"?`${C[$]*l}`:`${C[$]*(1-l)}`,c&&(h.style.opacity=R==="reverse"?`${1-l}`:`${l}`),i&&u?h.style.stroke=Oe(i,u,l):u&&(h.style.stroke=u),H!==null&&P!==null?h.style.strokeWidth=`${H+(P-H)*l}`:P!==null&&(h.style.strokeWidth=`${P}`),B!==null&&Z!==null?h.style.fillOpacity=`${B+(Z-B)*l}`:Z!==null&&(h.style.fillOpacity=`${Z}`),T&&h.tagName.toLowerCase()==="path"&&ce[$]&&h.setAttribute("d",Je(ce[$],T,l)),$===0&&(d?.(l),e.style.setProperty("--scroll-draw-progress",String(l))),l<1&&(se=false);}),S){let h=pe(K(a,fe,Ee,w));for(let $ in S){let L=parseFloat($);h>=L&&!Te.has(L)&&(Te.add(L),S[$]?.());}}!de&&K(a,fe,Ee,w)>0&&(de=true,M?.()),se&&!ee?(ee=true,y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{ye=-1,de=false,ee=false,Te.clear(),ze();},F))):!se&&!Q&&(ee=false),X=requestAnimationFrame(Ve);}let je=new IntersectionObserver(o=>{o.forEach(a=>{He=a.isIntersecting,He&&!ne?X=requestAnimationFrame(Ve):cancelAnimationFrame(X);});},{root:V??null,threshold:G,rootMargin:re}),Ye;function Be(){clearTimeout(Ye),Ye=setTimeout(()=>{D.forEach((o,a)=>{C[a]=We(o),o.style.strokeDasharray=`${C[a]}`;}),et();},150);}return window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be),J>0?setTimeout(()=>je.observe(e),J):je.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),je.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ye),Ge?.remove();},replay(){ye=-1,Re=-1,qe=-1,de=false,ee=false,Se=0,ne=false,Te.clear(),clearTimeout(xe),ze();},pause(){ne=true,cancelAnimationFrame(X);},resume(){ne&&(ne=false,He&&(X=requestAnimationFrame(Ve)));},seek(o){let a=Math.min(1,Math.max(0,o));Ce=a,ye=a,ne=true,cancelAnimationFrame(X),ht(a,v);},getProgress(){return Ce}}}var lt=new Map;function De(e,n){lt.set(e,n);}function Ie(e){lt.delete(e);}function Mt(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 m=[],s=[],f=t[2].trim();if(f)for(let p of f.split(/[\s,]+/)){let c=p.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}n.push({fn:t[1],nums:m,units:s});}return n}function Ct(e,n,r){let t=ct(e),m=ct(n);return t.length===0||t.length!==m.length?r<1?e:n:t.map((s,f)=>{let p=m[f];return s.fn!==p.fn||s.nums.length!==p.nums.length?r<1?`${s.fn}(${s.nums.map((c,g)=>`${c}${s.units[g]}`).join(", ")})`:`${p.fn}(${p.nums.map((c,g)=>`${c}${p.units[g]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,g)=>`${c+(p.nums[g]-c)*r}${s.units[g]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),m=String(n);if(Mt(t))return Oe(t,m,r);if(t.includes("("))return Ct(t,m,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),f=m.match(/^([-+]?[\d.]+)(.*)$/);if(s&&f){let p=parseFloat(s[1]),c=parseFloat(f[1]);return `${p+(c-p)*r}${s[2]||f[2]}`}return r<1?t:m}function $t(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var mt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Pt=0;function kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function pt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:m={},easing:s="ease-out",speed:f=1,once:p=false,axis:c="y",scrollContainer:g,native:A=true,onProgress:_,onComplete:v,onEnter:Q,onLeave:ve,onEnterBack:I,onLeaveBack:te}=n,ie=window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=typeof s=="function"?s:ae[s]??ae["ease-out"],x=me(m.start??"top bottom"),N=me(m.end??"bottom top"),b=typeof g=="string"?document.querySelector(g):g??null,S=Object.entries(t).map(([i,u])=>({prop:$t(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function q(){let i=window.getComputedStyle(e);for(let u of S)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function G(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}if(ie)return G(),v?.(),r;q();function re(){if(!A||!kt()||typeof s!="string"||!(s in mt)||c!=="y"||b||p||f!==1||_||v||Q||ve||I||te||(m.start??"top bottom").trim()!=="top bottom"||(m.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!Lt.has(i.prop))return false;return true}function z(){let i=`ssd-a-${++Pt}`,u=S.map(W=>`${W.prop}:${W.from}`).join(";"),H=S.map(W=>`${W.prop}:${W.to}`).join(";"),P=document.createElement("style");P.setAttribute("data-ssd-animate",""),P.textContent=`@keyframes ${i}{from{${u}}to{${H}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${mt[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(P),e.classList.add(i);let B=()=>c==="x"?window.scrollX:window.scrollY,Z=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),P.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(W){let D=Math.min(1,Math.max(0,W));e.classList.remove(i);for(let C of S)e.style.setProperty(C.prop,ut(C.from,C.to,D));},getProgress(){let W=e.getBoundingClientRect(),D=B(),C=Z(),{tStart:ce,tEnd:fe}=be({top:W.top,height:W.height},D,C,x,N);return J(K(D,ce,fe,f))}}}if(re())return z();let F=0,T=0,j=0,le=false,Y=false,U=-1,d=0,M=false,y=NaN,k=()=>b?c==="x"?b.scrollLeft:b.scrollTop:c==="x"?window.scrollX:window.scrollY,we=()=>b?c==="x"?b.clientWidth:b.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function Ae(){let i=e.getBoundingClientRect(),u,H;if(b){let B=b.getBoundingClientRect();u=c==="x"?i.left-B.left+b.scrollLeft:i.top-B.top+b.scrollTop,H=c==="x"?i.width:i.height;}else u=c==="x"?i.left:i.top,H=c==="x"?i.width:i.height;let P=be({top:u,height:H},k(),we(),x,N);F=P.tStart,T=P.tEnd;}function Me(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let u of S)e.style.setProperty(u.prop,ut(u.from,u.to,i));_?.(i);}function ge(i){if(isNaN(y)){y=i;return}y<=0&&i>0?Q?.():y>0&&i<=0&&te?.(),y<1&&i>=1?ve?.():y>=1&&i<1&&I?.(),y=i;}function pe(){if(!le||Y)return;let i=T===F?0:(k()-F)/(T-F);ge(i);let u=J(K(k(),F,T,f));p&&(U=Math.max(U,u),u=U),d=u,Me(u),u>=1&&!M?(M=true,v?.()):u<1&&!p&&(M=false),j=requestAnimationFrame(pe);}Ae();{let i=J(K(k(),F,T,f));p&&i>0&&(U=i),d=i,Me(i);}let Ne=new IntersectionObserver(i=>{i.forEach(u=>{le=u.isIntersecting,le&&!Y?j=requestAnimationFrame(pe):cancelAnimationFrame(j);});},{root:b??null}),Le;function V(){clearTimeout(Le),Le=setTimeout(Ae,150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),Ne.observe(e),De(e,{type:"animate",getProgress:()=>d,getTrigger:()=>({tStart:F,tEnd:T})}),{destroy(){cancelAnimationFrame(j),Ne.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(Le),Ie(e);},replay(){U=-1,M=false,d=0,Y=false,Me(0);},pause(){Y=true,cancelAnimationFrame(j);},resume(){Y&&(Y=false,le&&(j=requestAnimationFrame(pe)));},seek(i){let u=Math.min(1,Math.max(0,i));d=u,U=u,Y=true,cancelAnimationFrame(j),Me(u);},getProgress(){return d}}}var Ue={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ze(e,n){if(typeof window>"u")return Ue;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),Ue;let t=r,{from:m=0,to:s,format:f,easing:p="ease-out",trigger:c={},once:g=true,decimals:A,onComplete:_}=n,v=A!==void 0?d=>d.toFixed(A):f??(d=>String(Math.round(d))),Q=typeof p=="function"?p:ae[p]??ae["ease-out"],ve=me(c.start??"top 80%"),I=me(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=v(s),_?.(),Ue;t.textContent=v(m);let ie=0,J=0,x=0,N=false,b=false,S=-1,q=0,G=false,re=()=>window.scrollY,z=()=>window.innerHeight;function F(){let d=t.getBoundingClientRect(),M=be({top:d.top,height:d.height},re(),z(),ve,I);ie=M.tStart,J=M.tEnd;}function T(d){t.textContent=v(m+(s-m)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function j(){if(!N||b)return;let d=Q(K(re(),ie,J,1));g&&(S=Math.max(S,d),d=S),q=d,T(d),d>=1&&!G?(G=true,_?.()):d<1&&!g&&(G=false),x=requestAnimationFrame(j);}F();{let d=Q(K(re(),ie,J,1));g&&d>0&&(S=d),q=d,T(d);}let le=new IntersectionObserver(d=>{d.forEach(M=>{N=M.isIntersecting,N&&!b?x=requestAnimationFrame(j):cancelAnimationFrame(x);});}),Y;function U(){clearTimeout(Y),Y=setTimeout(F,150);}return window.addEventListener("resize",U),window.addEventListener("orientationchange",U),le.observe(t),De(t,{type:"counter",getProgress:()=>q,getTrigger:()=>({tStart:ie,tEnd:J})}),{destroy(){cancelAnimationFrame(x),le.disconnect(),window.removeEventListener("resize",U),window.removeEventListener("orientationchange",U),clearTimeout(Y),Ie(t);},replay(){S=-1,G=false,q=0,b=false,T(0);},pause(){b=true,cancelAnimationFrame(x);},resume(){b&&(b=false,N&&(x=requestAnimationFrame(j)));},seek(d){let M=Math.min(1,Math.max(0,d));q=M,S=M,b=true,cancelAnimationFrame(x),T(M);},getProgress(){return q}}}function gt(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 Ot(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=gt(e),r=new Map;for(let s of n){let f=s.offsetTop;r.has(f)||r.set(f,[]),r.get(f).push(s);}let t=[],m=Array.from(r.keys()).sort((s,f)=>s-f);for(let s of m){let f=r.get(s),p=document.createElement("span");p.setAttribute("aria-hidden","true"),p.style.display="inline-block";for(let c of f)p.appendChild(c);t.push(p);}e.textContent="";for(let s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function Dt(e,n,r,t){if(r<=1||t===0)return e;let m=(r-1)*t,s=n*t,f=s+(1-m);return f<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(f-s)))}function It(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 dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=r,{split:m="words",stagger:s=.04,easing:f="ease-out",from:p={opacity:0,y:24},trigger:c={},once:g=true,onComplete:A}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,v=typeof f=="function"?f:ae[f]??ae["ease-out"],Q=me(c.start??"top 85%"),ve=me(c.end??"top 40%"),I=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let te;m==="chars"?te=Ot(t):m==="lines"?te=ft(t):te=gt(t);let ie=te.length;function J(y,k){p?.opacity!==void 0&&(y.style.opacity=String(p.opacity+(1-p.opacity)*k));let we=It(k,p);we&&(y.style.transform=we);}function x(y){t.style.setProperty("--scroll-draw-progress",String(y)),te.forEach((k,we)=>{let Ae=v(Dt(y,we,ie,s));J(k,Ae);});}if(_)return x(1),A?.(),{destroy(){t.innerHTML=I,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let N=0,b=0,S=0,q=false,G=false,re=-1,z=0,F=false,T=()=>window.scrollY,j=()=>window.innerHeight;function le(){let y=t.getBoundingClientRect(),k=be({top:y.top,height:y.height},T(),j(),Q,ve);N=k.tStart,b=k.tEnd;}function Y(){if(!q||G)return;let y=K(T(),N,b,1);g&&(re=Math.max(re,y),y=re),z=y,x(y),y>=1&&!F?(F=true,A?.()):y<1&&!g&&(F=false),S=requestAnimationFrame(Y);}le();let U=new IntersectionObserver(y=>{y.forEach(k=>{q=k.isIntersecting,q&&!G?S=requestAnimationFrame(Y):cancelAnimationFrame(S);});}),d;function M(){clearTimeout(d),d=setTimeout(()=>{if(m==="lines"){let y=z;t.innerHTML=I,t.setAttribute("aria-label",t.textContent??""),te=ft(t),x(y);}le();},150);}return window.addEventListener("resize",M),window.addEventListener("orientationchange",M),U.observe(t),De(t,{type:"text",getProgress:()=>z,getTrigger:()=>({tStart:N,tEnd:b})}),{destroy(){cancelAnimationFrame(S),U.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),clearTimeout(d),t.innerHTML=I,t.removeAttribute("aria-label"),Ie(t);},replay(){re=-1,F=false,z=0,G=false,x(0);},pause(){G=true,cancelAnimationFrame(S);},resume(){G&&(G=false,q&&(S=requestAnimationFrame(Y)));},seek(y){let k=Math.min(1,Math.max(0,y));z=k,re=k,G=true,cancelAnimationFrame(S),x(k);},getProgress(){return z}}}function Nt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?_e(t,n):(console.warn("[svg-scroll-draw] Container not found:",e),r)}function Ft(e=document){return Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return _e(n,r)})}function Ht(e=document){return Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return pt(n,r)})}function Rt(e=document){return Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(process.env.NODE_ENV!=="production"&&console.warn('[svg-scroll-draw] initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Ze(n,r)})}function qt(e=document){return Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return yt(n,r)})}function br(e=document){return {draw:Ft(e),animate:Ht(e),counter:Rt(e),text:qt(e)}}exports.initAll=br;exports.initScrollAnimate=Ht;exports.initScrollCounter=Rt;exports.initScrollDraw=Ft;exports.initScrollText=qt;exports.scrollDraw=Nt;
1
+ 'use strict';function ot({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),u=Math.sqrt(t),i=0,p=[];for(let g=0;g<r;g++){let M=Math.pow(u,g);p.push(M),i+=M;}let m=[0],c=0;for(let g=0;g<r;g++)c+=p[g]/i,m.push(c);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let M=0;M<r;M++)if(g<=m[M+1]){let F=(g-m[M])/(m[M+1]-m[M]);if(M===0)return F*(2-F);let S=1-Math.pow(t,M);return S+(1-S)*(2*F-1)*(2*F-1)}return 1}}function st({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),u=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-u)*(2*Math.PI)/t)+1}var pe={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:ot(),elastic:st()};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 tt(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 rt(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 We(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 St(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:St((e-n)/(r-n)*t,0,1)}function ve(e,n,r,t,u){let i=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),p=tt(e.top,e.height,n,u.element)-rt(u.viewport,r);return {tStart:i,tEnd:p}}function nt(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 Oe(e,n,r){let t=nt(e),u=nt(n);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*r)},${Math.round(t[1]+(u[1]-t[1])*r)},${Math.round(t[2]+(u[2]-t[2])*r)})`}var Xe={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}};function it(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var at={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Et=0;function xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Tt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?it("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&it("Element has a fill \u2014 it may obscure the stroke animation.",e);}function At(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 u(){let i=r==="x"?window.scrollX:window.scrollY,p=e-i,m=n-i,c=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${c?`left:${p}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${p}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;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}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",u,{passive:true}),u(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let p=parseFloat(i),m=t[u++]??p;return String(+(p+(m-p)*r).toFixed(4))})}function _e(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,u=r?{...Xe[r],...t}:t,i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:p="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=false,easing:g="linear",trigger:M={},stagger:F=0,direction:S="forward",once:J=false,debug:Ee=false,axis:H="y",scrollContainer:ee,autoReverse:te=false,delay:re=0,strokeColor:x,strokeWidth:R,fillOpacity:D,waypoints:h,velocityScale:C=false,threshold:W=0,rootMargin:ne="0px",repeat:z=0,repeatDelay:ce=0,morphTo:T,clip:U,autoplay:K=false,duration:oe=1e3,native:_=true,onProgress:d,onStart:A,onComplete:b,onEnter:$,onLeave:ge,onEnterBack:Ae,onLeaveBack:Le}=u,ye=U===true?"left":typeof U=="string"?U:false,he=typeof g=="function"?g:pe[g]??pe.linear,Me=de(M.start??"top bottom"),Fe=de(M.end??"bottom top"),G=typeof ee=="string"?document.querySelector(ee):ee??null,ue=Array.isArray(x)?x[0]:null,V=Array.isArray(x)?x[1]:typeof x=="string"?x:null,B=Array.isArray(R)?R[0]:null,s=Array.isArray(R)?R[1]:typeof R=="number"?R:null,f=Array.isArray(D)?D[0]:null,L=Array.isArray(D)?D[1]:typeof D=="number"?D:null;function j(o){let a=o*100;switch(ye){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 E=ye?[]:Array.from(e.querySelectorAll(p)),I=[],P=[],Q=0,se=0,Y=false,me=false,X=0,He=false,be=-1,Re=-1,ie=false,Ce=0,Se=0,xe,Ge=null,Te=new Set,qe=-1,Ke=performance.now(),Pe=NaN;function Ne(){return G?H==="x"?G.scrollLeft:G.scrollTop:H==="x"?window.scrollX:window.scrollY}function Qe(){return G?H==="x"?G.clientWidth:G.clientHeight:H==="x"?window.innerWidth:window.innerHeight}function et(){let o=e.getBoundingClientRect(),a,w,q;if(G){let le=G.getBoundingClientRect();a=H==="x"?o.left-le.left+G.scrollLeft:o.top-le.top+G.scrollTop,w=H==="x"?o.width:o.height,q=Ne();}else a=H==="x"?o.left:o.top,w=H==="x"?o.width:o.height,q=Ne();let ae=ve({top:a,height:w},q,Qe(),Me,Fe);Q=ae.tStart,se=ae.tEnd,Ee&&process.env.NODE_ENV!=="production"&&(Ge?.remove(),Ge=At(Q,se,H));}function ht(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ye){let w=a==="reverse"?1-o:o;e.style.clipPath=j(w);return}E.forEach((w,q)=>{w.style.strokeDashoffset=a==="reverse"?`${I[q]*o}`:`${I[q]*(1-o)}`,c&&(w.style.opacity=a==="reverse"?`${1-o}`:`${o}`),ue&&V?w.style.stroke=Oe(ue,V,o):V&&(w.style.stroke=V),B!==null&&s!==null?w.style.strokeWidth=`${B+(s-B)*o}`:s!==null&&(w.style.strokeWidth=`${s}`),f!==null&&L!==null?w.style.fillOpacity=`${f+(L-f)*o}`:L!==null&&(w.style.fillOpacity=`${L}`),T&&w.tagName.toLowerCase()==="path"&&P[q]&&w.setAttribute("d",Je(P[q],T,o));});}function ze(){if(e.style.setProperty("--scroll-draw-progress","0"),ye){e.style.clipPath=j(0);return}E.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=S==="reverse"?"0":`${I[a]}`,c?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),B!==null&&(o.style.strokeWidth=`${B}`),f!==null&&(o.style.fillOpacity=`${f}`),T&&o.tagName.toLowerCase()==="path"&&P[a]&&o.setAttribute("d",P[a]);});}if(E.forEach(o=>{Tt(o);let a=We(o);I.push(a),o.tagName.toLowerCase()==="path"?P.push(o.getAttribute("d")??""):P.push(""),i?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=S==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),V&&(o.style.stroke=V),s!==null&&(o.style.strokeWidth=`${s}`),L!==null&&(o.style.fillOpacity=`${L}`),T&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",T)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=S==="reverse"?"0":`${a}`,c?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),B!==null&&(o.style.strokeWidth=`${B}`),f!==null&&(o.style.fillOpacity=`${f}`));}),ye){if(i)return e.style.clipPath=j(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=j(0);}else if(i)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(_===false||!xt()||!E.length||typeof g!="string"||!(g in at)||ye||H!=="y"||G||m!==1||F!==0||J||te||C!==false||T||h||z||re>0||d||A||b||$||ge||Ae||Le||x!=null||R!=null||D!=null||(M.start??"top bottom").trim()!=="top bottom"||(M.end??"bottom top").trim()!=="bottom top")}function wt(){let o=`svg-scroll-draw-${++Et}`,a=S==="reverse"?"0":"var(--ssd-len)",w=S==="reverse"?"var(--ssd-len)":"0",q=`stroke-dashoffset:${a};`,ae=`stroke-dashoffset:${w};`;c&&(q+=`opacity:${S==="reverse"?1:0};`,ae+=`opacity:${S==="reverse"?0:1};`);let le=document.createElement("style");le.setAttribute("data-svg-scroll-draw",""),le.textContent=`@keyframes ${o}{from{${q}}to{${ae}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${at[g]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(le);function fe(l,v){l.style.setProperty("--ssd-len",String(I[v])),l.style.strokeDasharray=`${I[v]}`,l.style.strokeDashoffset="",l.style.opacity="",l.style.animationPlayState="",l.classList.add(o);}E.forEach(fe);let y=false,k=-1;function O(){if(k>=0)return k;let l=e.getBoundingClientRect(),{tStart:v,tEnd:N}=ve({top:l.top,height:l.height},Ne(),Qe(),Me,Fe);return he(Z(Ne(),v,N,m))}return {destroy(){E.forEach(l=>{l.classList.remove(o),l.style.removeProperty("--ssd-len"),l.style.animationPlayState="";}),le.remove();},replay(){y=false,k=-1,E.forEach(fe);},pause(){y=true,E.forEach(l=>{l.style.animationPlayState="paused";});},resume(){y&&(y=false,E.forEach(l=>{l.style.animationPlayState="running";}));},seek(l){let v=Math.min(1,Math.max(0,l));k=v,y=true,E.forEach((N,$e)=>{N.classList.remove(o),N.style.strokeDashoffset=S==="reverse"?`${I[$e]*v}`:`${I[$e]*(1-v)}`,c&&(N.style.opacity=S==="reverse"?`${1-v}`:`${v}`);});},getProgress(){return O()}}}if(bt())return wt();function vt(){let o=Math.max(1,oe),a=0,w=0;function q(O){let l=true;if(ye){let v=Math.min(1,Math.max(0,O/o)),N=he(v);Ce=N,e.style.setProperty("--scroll-draw-progress",String(N)),e.style.clipPath=j(S==="reverse"?1-N:N),d?.(N),v<1&&(l=false);}else E.forEach((v,N)=>{let $e=N*F*o,ke=Math.min(1,Math.max(0,(O-$e)/o)),we=he(ke);v.style.strokeDashoffset=S==="reverse"?`${I[N]*we}`:`${I[N]*(1-we)}`,c&&(v.style.opacity=S==="reverse"?`${1-we}`:`${we}`),ue&&V?v.style.stroke=Oe(ue,V,we):V&&(v.style.stroke=V),B!==null&&s!==null?v.style.strokeWidth=`${B+(s-B)*we}`:s!==null&&(v.style.strokeWidth=`${s}`),f!==null&&L!==null?v.style.fillOpacity=`${f+(L-f)*we}`:L!==null&&(v.style.fillOpacity=`${L}`),T&&v.tagName.toLowerCase()==="path"&&P[N]&&v.setAttribute("d",Je(P[N],T,we)),N===0&&(d?.(we),e.style.setProperty("--scroll-draw-progress",String(we))),ke<1&&(l=false);});if(h){let v=Math.min(1,Math.max(0,O/o)),N=he(v);for(let $e in h){let ke=parseFloat($e);N>=ke&&!Te.has(ke)&&(Te.add(ke),h[$e]?.());}}return l}function ae(O){if(ie)return;let l=O-a;me||(me=true,A?.());let v=q(l);if(v&&!Y){Y=true,q(o*(1+Math.max(0,E.length-1)*F)),b?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{a=performance.now(),me=false,Y=false,Te.clear(),ze(),X=requestAnimationFrame(ae);},ce));return}v||(X=requestAnimationFrame(ae));}function le(){cancelAnimationFrame(X),clearTimeout(xe),a=performance.now(),w=0,ie=false,me=false,Y=false,Se=0,Te.clear(),ze(),X=requestAnimationFrame(ae);}let fe=new IntersectionObserver(O=>{O.forEach(l=>{l.isIntersecting&&!(J&&Y)?le():!l.isIntersecting&&!J&&!Y&&(cancelAnimationFrame(X),clearTimeout(xe),a=null);});},{root:G??null,threshold:W,rootMargin:ne}),y;function k(){clearTimeout(y),y=setTimeout(()=>{E.forEach((O,l)=>{I[l]=We(O),O.style.strokeDasharray=`${I[l]}`;});},150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),re>0?setTimeout(()=>fe.observe(e),re):fe.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),fe.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(y);},replay(){Se=0,le();},pause(){ie||(ie=true,w=performance.now()-a,cancelAnimationFrame(X));},resume(){ie&&(ie=false,a=performance.now()-w,X=requestAnimationFrame(ae));},seek(O){let l=Math.min(1,Math.max(0,O));Ce=l,ie=true,w=l*o,a=performance.now()-w,cancelAnimationFrame(X),q(w);},getProgress(){return Ce}}}if(K)return vt();et();function Ve(){if(!He||ie)return;let o=performance.now(),a=Ne(),w=m;if(C!==false){let y=o-Ke,k=y>0?Math.abs(a-(qe<0?a:qe))/y:0;w=m*Math.max(.2,1+k*(typeof C=="number"?C:1)*.04);}qe=a,Ke=o;let q=te?Re===-1||a>=Re?"forward":"reverse":S;Re=a;let ae=se-Q,le=true,fe=ae===0?0:(a-Q)/ae;if(isNaN(Pe)||(Pe<=0&&fe>0?$?.():Pe>0&&fe<=0&&Le?.(),Pe<1&&fe>=1?ge?.():Pe>=1&&fe<1&&Ae?.()),Pe=fe,ye){let y=he(Z(a,Q,se,w));J&&!te&&(be=Math.max(be,y),y=be),Ce=y,e.style.setProperty("--scroll-draw-progress",String(y));let k=q==="reverse"?1-y:y;e.style.clipPath=j(k),d?.(y),!me&&Z(a,Q,se,w)>0&&(me=true,A?.()),y>=1&&!Y?(Y=true,b?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{be=-1,me=false,Y=false,e.style.clipPath=j(0);},ce))):y<1&&!J&&(Y=false),X=requestAnimationFrame(Ve);return}if(E.forEach((y,k)=>{let O=k*F*ae,l=he(Z(a,Q+O,se+O,w));J&&!te&&(be=Math.max(be,l),l=be),Ce=l,y.style.strokeDashoffset=q==="reverse"?`${I[k]*l}`:`${I[k]*(1-l)}`,c&&(y.style.opacity=q==="reverse"?`${1-l}`:`${l}`),ue&&V?y.style.stroke=Oe(ue,V,l):V&&(y.style.stroke=V),B!==null&&s!==null?y.style.strokeWidth=`${B+(s-B)*l}`:s!==null&&(y.style.strokeWidth=`${s}`),f!==null&&L!==null?y.style.fillOpacity=`${f+(L-f)*l}`:L!==null&&(y.style.fillOpacity=`${L}`),T&&y.tagName.toLowerCase()==="path"&&P[k]&&y.setAttribute("d",Je(P[k],T,l)),k===0&&(d?.(l),e.style.setProperty("--scroll-draw-progress",String(l))),l<1&&(le=false);}),h){let y=he(Z(a,Q,se,w));for(let k in h){let O=parseFloat(k);y>=O&&!Te.has(O)&&(Te.add(O),h[k]?.());}}!me&&Z(a,Q,se,w)>0&&(me=true,A?.()),le&&!Y?(Y=true,b?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{be=-1,me=false,Y=false,Te.clear(),ze();},ce))):!le&&!J&&(Y=false),X=requestAnimationFrame(Ve);}let je=new IntersectionObserver(o=>{o.forEach(a=>{He=a.isIntersecting,He&&!ie?X=requestAnimationFrame(Ve):cancelAnimationFrame(X);});},{root:G??null,threshold:W,rootMargin:ne}),Ye;function Be(){clearTimeout(Ye),Ye=setTimeout(()=>{E.forEach((o,a)=>{I[a]=We(o),o.style.strokeDasharray=`${I[a]}`;}),et();},150);}return window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be),re>0?setTimeout(()=>je.observe(e),re):je.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),je.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ye),Ge?.remove();},replay(){be=-1,Re=-1,qe=-1,me=false,Y=false,Se=0,ie=false,Te.clear(),clearTimeout(xe),ze();},pause(){ie=true,cancelAnimationFrame(X);},resume(){ie&&(ie=false,He&&(X=requestAnimationFrame(Ve)));},seek(o){let a=Math.min(1,Math.max(0,o));Ce=a,be=a,ie=true,cancelAnimationFrame(X),ht(a,S);},getProgress(){return Ce}}}var lt=new Map;function De(e,n){lt.set(e,n);}function Ie(e){lt.delete(e);}function Mt(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 u=[],i=[],p=t[2].trim();if(p)for(let m of p.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),i.push(c?c[2]:"");}n.push({fn:t[1],nums:u,units:i});}return n}function Ct(e,n,r){let t=ct(e),u=ct(n);return t.length===0||t.length!==u.length?r<1?e:n:t.map((i,p)=>{let m=u[p];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((c,g)=>`${c}${i.units[g]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,g)=>`${c}${m.units[g]}`).join(", ")})`:`${i.fn}(${i.nums.map((c,g)=>`${c+(m.nums[g]-c)*r}${i.units[g]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),u=String(n);if(Mt(t))return Oe(t,u,r);if(t.includes("("))return Ct(t,u,r);let i=t.match(/^([-+]?[\d.]+)(.*)$/),p=u.match(/^([-+]?[\d.]+)(.*)$/);if(i&&p){let m=parseFloat(i[1]),c=parseFloat(p[1]);return `${m+(c-m)*r}${i[2]||p[2]}`}return r<1?t:u}function $t(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var mt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Pt=0;function kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function pt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:u={},easing:i="ease-out",speed:p=1,once:m=false,axis:c="y",scrollContainer:g,native:M=true,velocityScale:F=false,onProgress:S,onComplete:J,onEnter:Ee,onLeave:H,onEnterBack:ee,onLeaveBack:te}=n,re=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof i=="function"?i:pe[i]??pe["ease-out"],R=de(u.start??"top bottom"),D=de(u.end??"bottom top"),h=typeof g=="string"?document.querySelector(g):g??null,C=Object.entries(t).map(([s,f])=>({prop:$t(s),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function W(){let s=window.getComputedStyle(e);for(let f of C)f.from===""&&(f.from=s.getPropertyValue(f.prop).trim()||"0");}function ne(){for(let s of C)e.style.setProperty(s.prop,String(s.to));}if(re)return ne(),J?.(),r;W();function z(){if(!M||!kt()||typeof i!="string"||!(i in mt)||c!=="y"||h||m||p!==1||S||J||Ee||H||ee||te||F!==false||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let s of C)if(!Lt.has(s.prop))return false;return true}function ce(){let s=`ssd-a-${++Pt}`,f=C.map(P=>`${P.prop}:${P.from}`).join(";"),L=C.map(P=>`${P.prop}:${P.to}`).join(";"),j=document.createElement("style");j.setAttribute("data-ssd-animate",""),j.textContent=`@keyframes ${s}{from{${f}}to{${L}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${mt[i]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(j),e.classList.add(s);let E=()=>c==="x"?window.scrollX:window.scrollY,I=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(s),j.remove();},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(P){let Q=Math.min(1,Math.max(0,P));e.classList.remove(s);for(let se of C)e.style.setProperty(se.prop,ut(se.from,se.to,Q));},getProgress(){let P=e.getBoundingClientRect(),Q=E(),se=I(),{tStart:Y,tEnd:me}=ve({top:P.top,height:P.height},Q,se,R,D);return x(Z(Q,Y,me,p))}}}if(z())return ce();let T=0,U=0,K=0,oe=false,_=false,d=-1,A=0,b=false,$=NaN,ge=-1,Ae=0,Le=()=>h?c==="x"?h.scrollLeft:h.scrollTop:c==="x"?window.scrollX:window.scrollY,ye=()=>h?c==="x"?h.clientWidth:h.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function he(){let s=e.getBoundingClientRect(),f,L;if(h){let E=h.getBoundingClientRect();f=c==="x"?s.left-E.left+h.scrollLeft:s.top-E.top+h.scrollTop,L=c==="x"?s.width:s.height;}else f=c==="x"?s.left:s.top,L=c==="x"?s.width:s.height;let j=ve({top:f,height:L},Le(),ye(),R,D);T=j.tStart,U=j.tEnd;}function Me(s){e.style.setProperty("--scroll-draw-progress",String(s));for(let f of C)e.style.setProperty(f.prop,ut(f.from,f.to,s));S?.(s);}function Fe(s){if(isNaN($)){$=s;return}$<=0&&s>0?Ee?.():$>0&&s<=0&&te?.(),$<1&&s>=1?H?.():$>=1&&s<1&&ee?.(),$=s;}function G(){if(!oe||_)return;let s=performance.now(),f=Le(),L=p;if(F!==false){let I=s-Ae,P=I>0?Math.abs(f-(ge<0?f:ge))/I:0;L=p*Math.max(.2,1+P*(typeof F=="number"?F:1)*.04);}ge=f,Ae=s;let j=U===T?0:(f-T)/(U-T);Fe(j);let E=x(Z(f,T,U,L));m&&(d=Math.max(d,E),E=d),A=E,Me(E),E>=1&&!b?(b=true,J?.()):E<1&&!m&&(b=false),K=requestAnimationFrame(G);}he();{let s=x(Z(Le(),T,U,p));m&&s>0&&(d=s),A=s,Me(s);}let ue=new IntersectionObserver(s=>{s.forEach(f=>{oe=f.isIntersecting,oe&&!_?K=requestAnimationFrame(G):cancelAnimationFrame(K);});},{root:h??null}),V;function B(){clearTimeout(V),V=setTimeout(he,150);}return window.addEventListener("resize",B),window.addEventListener("orientationchange",B),ue.observe(e),De(e,{type:"animate",getProgress:()=>A,getTrigger:()=>({tStart:T,tEnd:U})}),{destroy(){cancelAnimationFrame(K),ue.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),clearTimeout(V),Ie(e);},replay(){d=-1,b=false,A=0,_=false,Me(0);},pause(){_=true,cancelAnimationFrame(K);},resume(){_&&(_=false,oe&&(K=requestAnimationFrame(G)));},seek(s){let f=Math.min(1,Math.max(0,s));A=f,d=f,_=true,cancelAnimationFrame(K),Me(f);},getProgress(){return A}}}var Ue={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ze(e,n){if(typeof window>"u")return Ue;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),Ue;let t=r,{from:u=0,to:i,format:p,easing:m="ease-out",trigger:c={},once:g=true,decimals:M,onComplete:F}=n,S=M!==void 0?d=>d.toFixed(M):p??(d=>String(Math.round(d))),J=typeof m=="function"?m:pe[m]??pe["ease-out"],Ee=de(c.start??"top 80%"),H=de(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(i),F?.(),Ue;t.textContent=S(u);let te=0,re=0,x=0,R=false,D=false,h=-1,C=0,W=false,ne=()=>window.scrollY,z=()=>window.innerHeight;function ce(){let d=t.getBoundingClientRect(),A=ve({top:d.top,height:d.height},ne(),z(),Ee,H);te=A.tStart,re=A.tEnd;}function T(d){t.textContent=S(u+(i-u)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function U(){if(!R||D)return;let d=J(Z(ne(),te,re,1));g&&(h=Math.max(h,d),d=h),C=d,T(d),d>=1&&!W?(W=true,F?.()):d<1&&!g&&(W=false),x=requestAnimationFrame(U);}ce();{let d=J(Z(ne(),te,re,1));g&&d>0&&(h=d),C=d,T(d);}let K=new IntersectionObserver(d=>{d.forEach(A=>{R=A.isIntersecting,R&&!D?x=requestAnimationFrame(U):cancelAnimationFrame(x);});}),oe;function _(){clearTimeout(oe),oe=setTimeout(ce,150);}return window.addEventListener("resize",_),window.addEventListener("orientationchange",_),K.observe(t),De(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:te,tEnd:re})}),{destroy(){cancelAnimationFrame(x),K.disconnect(),window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_),clearTimeout(oe),Ie(t);},replay(){h=-1,W=false,C=0,D=false,T(0);},pause(){D=true,cancelAnimationFrame(x);},resume(){D&&(D=false,R&&(x=requestAnimationFrame(U)));},seek(d){let A=Math.min(1,Math.max(0,d));C=A,h=A,D=true,cancelAnimationFrame(x),T(A);},getProgress(){return C}}}function gt(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 Ot(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=gt(e),r=new Map;for(let i of n){let p=i.offsetTop;r.has(p)||r.set(p,[]),r.get(p).push(i);}let t=[],u=Array.from(r.keys()).sort((i,p)=>i-p);for(let i of u){let p=r.get(i),m=document.createElement("span");m.setAttribute("aria-hidden","true"),m.style.display="inline-block";for(let c of p)m.appendChild(c);t.push(m);}e.textContent="";for(let i of t)e.appendChild(i),e.appendChild(document.createTextNode(" "));return t}function Dt(e,n,r,t){if(r<=1||t===0)return e;let u=(r-1)*t,i=n*t,p=i+(1-u);return p<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(p-i)))}function It(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 dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=r,{split:u="words",stagger:i=.04,easing:p="ease-out",from:m={opacity:0,y:24},trigger:c={},once:g=true,onComplete:M}=n,F=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof p=="function"?p:pe[p]??pe["ease-out"],J=de(c.start??"top 85%"),Ee=de(c.end??"top 40%"),H=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=Ot(t):u==="lines"?ee=ft(t):ee=gt(t);let te=ee.length;function re(b,$){m?.opacity!==void 0&&(b.style.opacity=String(m.opacity+(1-m.opacity)*$));let ge=It($,m);ge&&(b.style.transform=ge);}function x(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach(($,ge)=>{let Ae=S(Dt(b,ge,te,i));re($,Ae);});}if(F)return x(1),M?.(),{destroy(){t.innerHTML=H,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let R=0,D=0,h=0,C=false,W=false,ne=-1,z=0,ce=false,T=()=>window.scrollY,U=()=>window.innerHeight;function K(){let b=t.getBoundingClientRect(),$=ve({top:b.top,height:b.height},T(),U(),J,Ee);R=$.tStart,D=$.tEnd;}function oe(){if(!C||W)return;let b=Z(T(),R,D,1);g&&(ne=Math.max(ne,b),b=ne),z=b,x(b),b>=1&&!ce?(ce=true,M?.()):b<1&&!g&&(ce=false),h=requestAnimationFrame(oe);}K();let _=new IntersectionObserver(b=>{b.forEach($=>{C=$.isIntersecting,C&&!W?h=requestAnimationFrame(oe):cancelAnimationFrame(h);});}),d;function A(){clearTimeout(d),d=setTimeout(()=>{if(u==="lines"){let b=z;t.innerHTML=H,t.setAttribute("aria-label",t.textContent??""),ee=ft(t),x(b);}K();},150);}return window.addEventListener("resize",A),window.addEventListener("orientationchange",A),_.observe(t),De(t,{type:"text",getProgress:()=>z,getTrigger:()=>({tStart:R,tEnd:D})}),{destroy(){cancelAnimationFrame(h),_.disconnect(),window.removeEventListener("resize",A),window.removeEventListener("orientationchange",A),clearTimeout(d),t.innerHTML=H,t.removeAttribute("aria-label"),Ie(t);},replay(){ne=-1,ce=false,z=0,W=false,x(0);},pause(){W=true,cancelAnimationFrame(h);},resume(){W&&(W=false,C&&(h=requestAnimationFrame(oe)));},seek(b){let $=Math.min(1,Math.max(0,b));z=$,ne=$,W=true,cancelAnimationFrame(h),x($);},getProgress(){return z}}}function Nt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?_e(t,n):(console.warn("[svg-scroll-draw] Container not found:",e),r)}function Ft(e=document){return Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return _e(n,r)})}function Ht(e=document){return Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return pt(n,r)})}function Rt(e=document){return Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(process.env.NODE_ENV!=="production"&&console.warn('[svg-scroll-draw] initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Ze(n,r)})}function qt(e=document){return Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return yt(n,r)})}function br(e=document){return {draw:Ft(e),animate:Ht(e),counter:Rt(e),text:qt(e)}}exports.initAll=br;exports.initScrollAnimate=Ht;exports.initScrollCounter=Rt;exports.initScrollDraw=Ft;exports.initScrollText=qt;exports.scrollDraw=Nt;