svg-scroll-draw 2.6.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 (66) hide show
  1. package/dist/angular/index.cjs +3 -3
  2. package/dist/angular/index.d.mts +22 -0
  3. package/dist/angular/index.d.ts +22 -0
  4. package/dist/angular/index.mjs +3 -3
  5. package/dist/astro/index.cjs +3 -3
  6. package/dist/astro/index.d.mts +8 -0
  7. package/dist/astro/index.d.ts +8 -0
  8. package/dist/astro/index.mjs +3 -3
  9. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  10. package/dist/devtools/index.cjs +1 -1
  11. package/dist/devtools/index.mjs +1 -1
  12. package/dist/group/index.cjs +3 -3
  13. package/dist/group/index.d.mts +22 -0
  14. package/dist/group/index.d.ts +22 -0
  15. package/dist/group/index.mjs +3 -3
  16. package/dist/horizontal/index.cjs +1 -0
  17. package/dist/horizontal/index.d.mts +61 -0
  18. package/dist/horizontal/index.d.ts +61 -0
  19. package/dist/horizontal/index.mjs +1 -0
  20. package/dist/index.cjs +4 -4
  21. package/dist/index.d.mts +22 -0
  22. package/dist/index.d.ts +22 -0
  23. package/dist/index.mjs +4 -4
  24. package/dist/lenis/index.cjs +1 -0
  25. package/dist/lenis/index.d.mts +51 -0
  26. package/dist/lenis/index.d.ts +51 -0
  27. package/dist/lenis/index.mjs +1 -0
  28. package/dist/nuxt/index.cjs +2 -2
  29. package/dist/nuxt/index.d.mts +22 -0
  30. package/dist/nuxt/index.d.ts +22 -0
  31. package/dist/nuxt/index.mjs +2 -2
  32. package/dist/pin/index.cjs +1 -0
  33. package/dist/pin/index.d.mts +29 -0
  34. package/dist/pin/index.d.ts +29 -0
  35. package/dist/pin/index.mjs +1 -0
  36. package/dist/progress/index.cjs +1 -0
  37. package/dist/progress/index.d.mts +59 -0
  38. package/dist/progress/index.d.ts +59 -0
  39. package/dist/progress/index.mjs +1 -0
  40. package/dist/react/index.cjs +3 -3
  41. package/dist/react/index.d.mts +22 -0
  42. package/dist/react/index.d.ts +22 -0
  43. package/dist/react/index.mjs +3 -3
  44. package/dist/reveal/index.cjs +1 -0
  45. package/dist/reveal/index.d.mts +80 -0
  46. package/dist/reveal/index.d.ts +80 -0
  47. package/dist/reveal/index.mjs +1 -0
  48. package/dist/snap/index.cjs +1 -0
  49. package/dist/snap/index.d.mts +30 -0
  50. package/dist/snap/index.d.ts +30 -0
  51. package/dist/snap/index.mjs +1 -0
  52. package/dist/solid/index.cjs +3 -3
  53. package/dist/solid/index.d.mts +22 -0
  54. package/dist/solid/index.d.ts +22 -0
  55. package/dist/solid/index.mjs +3 -3
  56. package/dist/svelte/index.cjs +3 -3
  57. package/dist/svelte/index.d.mts +22 -0
  58. package/dist/svelte/index.d.ts +22 -0
  59. package/dist/svelte/index.mjs +3 -3
  60. package/dist/vue/index.cjs +2 -2
  61. package/dist/vue/index.d.mts +22 -0
  62. package/dist/vue/index.d.ts +22 -0
  63. package/dist/vue/index.mjs +2 -2
  64. package/dist/web-component/index.cjs +3 -3
  65. package/dist/web-component/index.mjs +3 -3
  66. package/package.json +31 -1
@@ -71,6 +71,14 @@ interface ScrollDrawOptions {
71
71
  onProgress?: (alpha: number) => void;
72
72
  onStart?: () => void;
73
73
  onComplete?: () => void;
74
+ /** Fires when scroll position enters the trigger zone (scrolling forward). */
75
+ onEnter?: () => void;
76
+ /** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
77
+ onLeave?: () => void;
78
+ /** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
79
+ onEnterBack?: () => void;
80
+ /** Fires when scroll position exits the trigger zone at the start (scrolling back). */
81
+ onLeaveBack?: () => void;
74
82
  /**
75
83
  * Trigger the animation when the element enters the viewport instead of
76
84
  * tying it to scroll position. The draw runs over `duration` milliseconds,
@@ -128,8 +136,22 @@ interface ScrollAnimateOptions {
128
136
  axis?: 'x' | 'y';
129
137
  scrollContainer?: string | Element;
130
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;
131
145
  onProgress?: (alpha: number) => void;
132
146
  onComplete?: () => void;
147
+ /** Fires when scroll enters the trigger zone (scrolling forward). */
148
+ onEnter?: () => void;
149
+ /** Fires when scroll exits the trigger zone at the end (scrolling forward). */
150
+ onLeave?: () => void;
151
+ /** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
152
+ onEnterBack?: () => void;
153
+ /** Fires when scroll exits the trigger zone at the start (scrolling back). */
154
+ onLeaveBack?: () => void;
133
155
  }
134
156
 
135
157
  interface ScrollCounterOptions {
@@ -71,6 +71,14 @@ interface ScrollDrawOptions {
71
71
  onProgress?: (alpha: number) => void;
72
72
  onStart?: () => void;
73
73
  onComplete?: () => void;
74
+ /** Fires when scroll position enters the trigger zone (scrolling forward). */
75
+ onEnter?: () => void;
76
+ /** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
77
+ onLeave?: () => void;
78
+ /** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
79
+ onEnterBack?: () => void;
80
+ /** Fires when scroll position exits the trigger zone at the start (scrolling back). */
81
+ onLeaveBack?: () => void;
74
82
  /**
75
83
  * Trigger the animation when the element enters the viewport instead of
76
84
  * tying it to scroll position. The draw runs over `duration` milliseconds,
@@ -128,8 +136,22 @@ interface ScrollAnimateOptions {
128
136
  axis?: 'x' | 'y';
129
137
  scrollContainer?: string | Element;
130
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;
131
145
  onProgress?: (alpha: number) => void;
132
146
  onComplete?: () => void;
147
+ /** Fires when scroll enters the trigger zone (scrolling forward). */
148
+ onEnter?: () => void;
149
+ /** Fires when scroll exits the trigger zone at the end (scrolling forward). */
150
+ onLeave?: () => void;
151
+ /** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
152
+ onEnterBack?: () => void;
153
+ /** Fires when scroll exits the trigger zone at the start (scrolling back). */
154
+ onLeaveBack?: () => void;
133
155
  }
134
156
 
135
157
  interface ScrollCounterOptions {
@@ -1,3 +1,3 @@
1
- function yt({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),s=0,m=[];for(let d=0;d<r;d++){let O=Math.pow(u,d);m.push(O),s+=O;}let l=[0],c=0;for(let d=0;d<r;d++)c+=m[d]/s,l.push(c);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let O=0;O<r;O++)if(d<=l[O+1]){let B=(d-l[O])/(l[O+1]-l[O]);if(O===0)return B*(2-B);let E=1-Math.pow(t,O);return E+(1-E)*(2*B-1)*(2*B-1)}return 1}}function ht({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 s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-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:yt(),elastic:ht()};function le(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 Ke(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 Qe(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 Re(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function wt(e,n,r){return Math.min(r,Math.max(n,e))}function J(e,n,r,t){return r===n?0:wt((e-n)/(r-n)*t,0,1)}function pe(e,n,r,t,u){let s=Ke(e.top,e.height,n,t.element)-Qe(t.viewport,r),m=Ke(e.top,e.height,n,u.element)-Qe(u.viewport,r);return {tStart:s,tEnd:m}}function et(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 Pe(e,n,r){let t=et(e),u=et(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 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,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},bt=0;function vt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Et(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?rt("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&rt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function St(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 s=r==="x"?window.scrollX:window.scrollY,m=e-s,l=n-s,c=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${m}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,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let m=parseFloat(s),l=t[u++]??m;return String(+(m+(l-m)*r).toFixed(4))})}function ze(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,u=r?{...tt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:d="linear",trigger:O={},stagger:B=0,direction:E="forward",once:re=false,debug:de=false,axis:q="y",scrollContainer:K,autoReverse:T=false,delay:H=0,strokeColor:A,strokeWidth:$,fillOpacity:L,waypoints:w,velocityScale:C=false,threshold:D=0,rootMargin:F="0px",repeat:M=0,repeatDelay:z=0,morphTo:P,clip:_,autoplay:Q=false,duration:j=1e3,native:se=true,onProgress:p,onStart:I,onComplete:y}=u,f=_===true?"left":typeof _=="string"?_:false,k=typeof d=="function"?d:ae[d]??ae.linear,ge=le(O.start??"top bottom"),a=le(O.end??"bottom top"),g=typeof K=="string"?document.querySelector(K):K??null,ne=Array.isArray(A)?A[0]:null,V=Array.isArray(A)?A[1]:typeof A=="string"?A:null,U=Array.isArray($)?$[0]:null,oe=Array.isArray($)?$[1]:typeof $=="number"?$:null,N=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function me(o){let i=o*100;switch(f){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let ee=f?[]:Array.from(e.querySelectorAll(m)),X=[],he=[],Ee=0,Se=0,ie=false,ye=false,te=0,Oe=false,we=-1,De=-1,ce=false,$e=0,ve=0,xe,Be=null,Te=new Set,ke=-1,Ue=performance.now();function Ie(){return g?q==="x"?g.scrollLeft:g.scrollTop:q==="x"?window.scrollX:window.scrollY}function Ze(){return g?q==="x"?g.clientWidth:g.clientHeight:q==="x"?window.innerWidth:window.innerHeight}function Je(){let o=e.getBoundingClientRect(),i,v,Y;if(g){let ue=g.getBoundingClientRect();i=q==="x"?o.left-ue.left+g.scrollLeft:o.top-ue.top+g.scrollTop,v=q==="x"?o.width:o.height,Y=Ie();}else i=q==="x"?o.left:o.top,v=q==="x"?o.width:o.height,Y=Ie();let fe=pe({top:i,height:v},Y,Ze(),ge,a);Ee=fe.tStart,Se=fe.tEnd,de&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=St(Ee,Se,q));}function ft(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),f){let v=i==="reverse"?1-o:o;e.style.clipPath=me(v);return}ee.forEach((v,Y)=>{v.style.strokeDashoffset=i==="reverse"?`${X[Y]*o}`:`${X[Y]*(1-o)}`,c&&(v.style.opacity=i==="reverse"?`${1-o}`:`${o}`),ne&&V?v.style.stroke=Pe(ne,V,o):V&&(v.style.stroke=V),U!==null&&oe!==null?v.style.strokeWidth=`${U+(oe-U)*o}`:oe!==null&&(v.style.strokeWidth=`${oe}`),N!==null&&G!==null?v.style.fillOpacity=`${N+(G-N)*o}`:G!==null&&(v.style.fillOpacity=`${G}`),P&&v.tagName.toLowerCase()==="path"&&he[Y]&&v.setAttribute("d",Ye(he[Y],P,o));});}function Fe(){if(e.style.setProperty("--scroll-draw-progress","0"),f){e.style.clipPath=me(0);return}ee.forEach((o,i)=>{o.style.strokeDasharray=`${X[i]}`,o.style.strokeDashoffset=E==="reverse"?"0":`${X[i]}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",ne&&(o.style.stroke=ne),U!==null&&(o.style.strokeWidth=`${U}`),N!==null&&(o.style.fillOpacity=`${N}`),P&&o.tagName.toLowerCase()==="path"&&he[i]&&o.setAttribute("d",he[i]);});}if(ee.forEach(o=>{Et(o);let i=Re(o);X.push(i),o.tagName.toLowerCase()==="path"?he.push(o.getAttribute("d")??""):he.push(""),s?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=E==="reverse"?`${i}`:"0",c&&(o.style.opacity="1"),V&&(o.style.stroke=V),oe!==null&&(o.style.strokeWidth=`${oe}`),G!==null&&(o.style.fillOpacity=`${G}`),P&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",P)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=E==="reverse"?"0":`${i}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",ne&&(o.style.stroke=ne),U!==null&&(o.style.strokeWidth=`${U}`),N!==null&&(o.style.fillOpacity=`${N}`));}),f){if(s)return e.style.clipPath=me(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=me(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function pt(){return !(se===false||!vt()||!ee.length||typeof d!="string"||!(d in nt)||f||q!=="y"||g||l!==1||B!==0||re||T||C!==false||P||w||M||H>0||p||I||y||A!=null||$!=null||L!=null||(O.start??"top bottom").trim()!=="top bottom"||(O.end??"bottom top").trim()!=="bottom top")}function dt(){let o=`svg-scroll-draw-${++bt}`,i=E==="reverse"?"0":"var(--ssd-len)",v=E==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${i};`,fe=`stroke-dashoffset:${v};`;c&&(Y+=`opacity:${E==="reverse"?1:0};`,fe+=`opacity:${E==="reverse"?0:1};`);let ue=document.createElement("style");ue.setAttribute("data-svg-scroll-draw",""),ue.textContent=`@keyframes ${o}{from{${Y}}to{${fe}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${nt[d]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue);function b(h,x){h.style.setProperty("--ssd-len",String(X[x])),h.style.strokeDasharray=`${X[x]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(o);}ee.forEach(b);let R=false,Z=-1;function S(){if(Z>=0)return Z;let h=e.getBoundingClientRect(),{tStart:x,tEnd:W}=pe({top:h.top,height:h.height},Ie(),Ze(),ge,a);return k(J(Ie(),x,W,l))}return {destroy(){ee.forEach(h=>{h.classList.remove(o),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),ue.remove();},replay(){R=false,Z=-1,ee.forEach(b);},pause(){R=true,ee.forEach(h=>{h.style.animationPlayState="paused";});},resume(){R&&(R=false,ee.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let x=Math.min(1,Math.max(0,h));Z=x,R=true,ee.forEach((W,Le)=>{W.classList.remove(o),W.style.strokeDashoffset=E==="reverse"?`${X[Le]*x}`:`${X[Le]*(1-x)}`,c&&(W.style.opacity=E==="reverse"?`${1-x}`:`${x}`);});},getProgress(){return S()}}}if(pt())return dt();function gt(){let o=Math.max(1,j),i=0,v=0;function Y(S){let h=true;if(f){let x=Math.min(1,Math.max(0,S/o)),W=k(x);$e=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=me(E==="reverse"?1-W:W),p?.(W),x<1&&(h=false);}else ee.forEach((x,W)=>{let Le=W*B*o,Ce=Math.min(1,Math.max(0,(S-Le)/o)),be=k(Ce);x.style.strokeDashoffset=E==="reverse"?`${X[W]*be}`:`${X[W]*(1-be)}`,c&&(x.style.opacity=E==="reverse"?`${1-be}`:`${be}`),ne&&V?x.style.stroke=Pe(ne,V,be):V&&(x.style.stroke=V),U!==null&&oe!==null?x.style.strokeWidth=`${U+(oe-U)*be}`:oe!==null&&(x.style.strokeWidth=`${oe}`),N!==null&&G!==null?x.style.fillOpacity=`${N+(G-N)*be}`:G!==null&&(x.style.fillOpacity=`${G}`),P&&x.tagName.toLowerCase()==="path"&&he[W]&&x.setAttribute("d",Ye(he[W],P,be)),W===0&&(p?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Ce<1&&(h=false);});if(w){let x=Math.min(1,Math.max(0,S/o)),W=k(x);for(let Le in w){let Ce=parseFloat(Le);W>=Ce&&!Te.has(Ce)&&(Te.add(Ce),w[Le]?.());}}return h}function fe(S){if(ce)return;let h=S-i;ye||(ye=true,I?.());let x=Y(h);if(x&&!ie){ie=true,Y(o*(1+Math.max(0,ee.length-1)*B)),y?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{i=performance.now(),ye=false,ie=false,Te.clear(),Fe(),te=requestAnimationFrame(fe);},z));return}x||(te=requestAnimationFrame(fe));}function ue(){cancelAnimationFrame(te),clearTimeout(xe),i=performance.now(),v=0,ce=false,ye=false,ie=false,ve=0,Te.clear(),Fe(),te=requestAnimationFrame(fe);}let b=new IntersectionObserver(S=>{S.forEach(h=>{h.isIntersecting&&!(re&&ie)?ue():!h.isIntersecting&&!re&&!ie&&(cancelAnimationFrame(te),clearTimeout(xe),i=null);});},{root:g??null,threshold:D,rootMargin:F}),R;function Z(){clearTimeout(R),R=setTimeout(()=>{ee.forEach((S,h)=>{X[h]=Re(S),S.style.strokeDasharray=`${X[h]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),H>0?setTimeout(()=>b.observe(e),H):b.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(xe),b.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(R);},replay(){ve=0,ue();},pause(){ce||(ce=true,v=performance.now()-i,cancelAnimationFrame(te));},resume(){ce&&(ce=false,i=performance.now()-v,te=requestAnimationFrame(fe));},seek(S){let h=Math.min(1,Math.max(0,S));$e=h,ce=true,v=h*o,i=performance.now()-v,cancelAnimationFrame(te),Y(v);},getProgress(){return $e}}}if(Q)return gt();Je();function He(){if(!Oe||ce)return;let o=performance.now(),i=Ie(),v=l;if(C!==false){let b=o-Ue,R=b>0?Math.abs(i-(ke<0?i:ke))/b:0;v=l*Math.max(.2,1+R*(typeof C=="number"?C:1)*.04);}ke=i,Ue=o;let Y=T?De===-1||i>=De?"forward":"reverse":E;De=i;let fe=Se-Ee,ue=true;if(f){let b=k(J(i,Ee,Se,v));re&&!T&&(we=Math.max(we,b),b=we),$e=b,e.style.setProperty("--scroll-draw-progress",String(b));let R=Y==="reverse"?1-b:b;e.style.clipPath=me(R),p?.(b),!ye&&J(i,Ee,Se,v)>0&&(ye=true,I?.()),b>=1&&!ie?(ie=true,y?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{we=-1,ye=false,ie=false,e.style.clipPath=me(0);},z))):b<1&&!re&&(ie=false),te=requestAnimationFrame(He);return}if(ee.forEach((b,R)=>{let Z=R*B*fe,S=k(J(i,Ee+Z,Se+Z,v));re&&!T&&(we=Math.max(we,S),S=we),$e=S,b.style.strokeDashoffset=Y==="reverse"?`${X[R]*S}`:`${X[R]*(1-S)}`,c&&(b.style.opacity=Y==="reverse"?`${1-S}`:`${S}`),ne&&V?b.style.stroke=Pe(ne,V,S):V&&(b.style.stroke=V),U!==null&&oe!==null?b.style.strokeWidth=`${U+(oe-U)*S}`:oe!==null&&(b.style.strokeWidth=`${oe}`),N!==null&&G!==null?b.style.fillOpacity=`${N+(G-N)*S}`:G!==null&&(b.style.fillOpacity=`${G}`),P&&b.tagName.toLowerCase()==="path"&&he[R]&&b.setAttribute("d",Ye(he[R],P,S)),R===0&&(p?.(S),e.style.setProperty("--scroll-draw-progress",String(S))),S<1&&(ue=false);}),w){let b=k(J(i,Ee,Se,v));for(let R in w){let Z=parseFloat(R);b>=Z&&!Te.has(Z)&&(Te.add(Z),w[R]?.());}}!ye&&J(i,Ee,Se,v)>0&&(ye=true,I?.()),ue&&!ie?(ie=true,y?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{we=-1,ye=false,ie=false,Te.clear(),Fe();},z))):!ue&&!re&&(ie=false),te=requestAnimationFrame(He);}let Ge=new IntersectionObserver(o=>{o.forEach(i=>{Oe=i.isIntersecting,Oe&&!ce?te=requestAnimationFrame(He):cancelAnimationFrame(te);});},{root:g??null,threshold:D,rootMargin:F}),Xe;function Ne(){clearTimeout(Xe),Xe=setTimeout(()=>{ee.forEach((o,i)=>{X[i]=Re(o),o.style.strokeDasharray=`${X[i]}`;}),Je();},150);}return window.addEventListener("resize",Ne),window.addEventListener("orientationchange",Ne),H>0?setTimeout(()=>Ge.observe(e),H):Ge.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(xe),Ge.disconnect(),window.removeEventListener("resize",Ne),window.removeEventListener("orientationchange",Ne),clearTimeout(Xe),Be?.remove();},replay(){we=-1,De=-1,ke=-1,ye=false,ie=false,ve=0,ce=false,Te.clear(),clearTimeout(xe),Fe();},pause(){ce=true,cancelAnimationFrame(te);},resume(){ce&&(ce=false,Oe&&(te=requestAnimationFrame(He)));},seek(o){let i=Math.min(1,Math.max(0,o));$e=i,we=i,ce=true,cancelAnimationFrame(te),ft(i,E);},getProgress(){return $e}}}var ot=new Map;function Ae(e,n){ot.set(e,n);}function Me(e){ot.delete(e);}function xt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function st(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let u=[],s=[],m=t[2].trim();if(m)for(let l of m.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}n.push({fn:t[1],nums:u,units:s});}return n}function Tt(e,n,r){let t=st(e),u=st(n);return t.length===0||t.length!==u.length?r<1?e:n:t.map((s,m)=>{let l=u[m];return s.fn!==l.fn||s.nums.length!==l.nums.length?r<1?`${s.fn}(${s.nums.map((c,d)=>`${c}${s.units[d]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,d)=>`${c}${l.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,d)=>`${c+(l.nums[d]-c)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function it(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),u=String(n);if(xt(t))return Pe(t,u,r);if(t.includes("("))return Tt(t,u,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),m=u.match(/^([-+]?[\d.]+)(.*)$/);if(s&&m){let l=parseFloat(s[1]),c=parseFloat(m[1]);return `${l+(c-l)*r}${s[2]||m[2]}`}return r<1?t:u}function At(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var at={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Mt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),$t=0;function Lt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Ve(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:u={},easing:s="ease-out",speed:m=1,once:l=false,axis:c="y",scrollContainer:d,native:O=true,onProgress:B,onComplete:E}=n,re=window.matchMedia("(prefers-reduced-motion: reduce)").matches,de=typeof s=="function"?s:ae[s]??ae["ease-out"],q=le(u.start??"top bottom"),K=le(u.end??"bottom top"),T=typeof d=="string"?document.querySelector(d):d??null,H=Object.entries(t).map(([a,g])=>({prop:At(a),from:Array.isArray(g)?g[0]:"",to:Array.isArray(g)?g[1]:g}));function A(){let a=window.getComputedStyle(e);for(let g of H)g.from===""&&(g.from=a.getPropertyValue(g.prop).trim()||"0");}function $(){for(let a of H)e.style.setProperty(a.prop,String(a.to));}if(re)return $(),E?.(),r;A();function L(){if(!O||!Lt()||typeof s!="string"||!(s in at)||c!=="y"||T||l||m!==1||B||E||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let a of H)if(!Mt.has(a.prop))return false;return true}function w(){let a=`ssd-a-${++$t}`,g=H.map(N=>`${N.prop}:${N.from}`).join(";"),ne=H.map(N=>`${N.prop}:${N.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${a}{from{${g}}to{${ne}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${at[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(a);let U=()=>c==="x"?window.scrollX:window.scrollY,oe=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),V.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(N){let G=Math.min(1,Math.max(0,N));e.classList.remove(a);for(let me of H)e.style.setProperty(me.prop,it(me.from,me.to,G));},getProgress(){let N=e.getBoundingClientRect(),G=U(),me=oe(),{tStart:ee,tEnd:X}=pe({top:N.top,height:N.height},G,me,q,K);return de(J(G,ee,X,m))}}}if(L())return w();let C=0,D=0,F=0,M=false,z=false,P=-1,_=0,Q=false,j=()=>T?c==="x"?T.scrollLeft:T.scrollTop:c==="x"?window.scrollX:window.scrollY,se=()=>T?c==="x"?T.clientWidth:T.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function p(){let a=e.getBoundingClientRect(),g,ne;if(T){let U=T.getBoundingClientRect();g=c==="x"?a.left-U.left+T.scrollLeft:a.top-U.top+T.scrollTop,ne=c==="x"?a.width:a.height;}else g=c==="x"?a.left:a.top,ne=c==="x"?a.width:a.height;let V=pe({top:g,height:ne},j(),se(),q,K);C=V.tStart,D=V.tEnd;}function I(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let g of H)e.style.setProperty(g.prop,it(g.from,g.to,a));B?.(a);}function y(){if(!M||z)return;let a=de(J(j(),C,D,m));l&&(P=Math.max(P,a),a=P),_=a,I(a),a>=1&&!Q?(Q=true,E?.()):a<1&&!l&&(Q=false),F=requestAnimationFrame(y);}p();{let a=de(J(j(),C,D,m));l&&a>0&&(P=a),_=a,I(a);}let f=new IntersectionObserver(a=>{a.forEach(g=>{M=g.isIntersecting,M&&!z?F=requestAnimationFrame(y):cancelAnimationFrame(F);});},{root:T??null}),k;function ge(){clearTimeout(k),k=setTimeout(p,150);}return window.addEventListener("resize",ge),window.addEventListener("orientationchange",ge),f.observe(e),Ae(e,{type:"animate",getProgress:()=>_,getTrigger:()=>({tStart:C,tEnd:D})}),{destroy(){cancelAnimationFrame(F),f.disconnect(),window.removeEventListener("resize",ge),window.removeEventListener("orientationchange",ge),clearTimeout(k),Me(e);},replay(){P=-1,Q=false,_=0,z=false,I(0);},pause(){z=true,cancelAnimationFrame(F);},resume(){z&&(z=false,M&&(F=requestAnimationFrame(y)));},seek(a){let g=Math.min(1,Math.max(0,a));_=g,P=g,z=true,cancelAnimationFrame(F),I(g);},getProgress(){return _}}}var je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function qe(e,n){if(typeof window>"u")return je;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),je;let t=r,{from:u=0,to:s,format:m,easing:l="ease-out",trigger:c={},once:d=true,decimals:O,onComplete:B}=n,E=O!==void 0?p=>p.toFixed(O):m??(p=>String(Math.round(p))),re=typeof l=="function"?l:ae[l]??ae["ease-out"],de=le(c.start??"top 80%"),q=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(s),B?.(),je;t.textContent=E(u);let T=0,H=0,A=0,$=false,L=false,w=-1,C=0,D=false,F=()=>window.scrollY,M=()=>window.innerHeight;function z(){let p=t.getBoundingClientRect(),I=pe({top:p.top,height:p.height},F(),M(),de,q);T=I.tStart,H=I.tEnd;}function P(p){t.textContent=E(u+(s-u)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function _(){if(!$||L)return;let p=re(J(F(),T,H,1));d&&(w=Math.max(w,p),p=w),C=p,P(p),p>=1&&!D?(D=true,B?.()):p<1&&!d&&(D=false),A=requestAnimationFrame(_);}z();{let p=re(J(F(),T,H,1));d&&p>0&&(w=p),C=p,P(p);}let Q=new IntersectionObserver(p=>{p.forEach(I=>{$=I.isIntersecting,$&&!L?A=requestAnimationFrame(_):cancelAnimationFrame(A);});}),j;function se(){clearTimeout(j),j=setTimeout(z,150);}return window.addEventListener("resize",se),window.addEventListener("orientationchange",se),Q.observe(t),Ae(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:T,tEnd:H})}),{destroy(){cancelAnimationFrame(A),Q.disconnect(),window.removeEventListener("resize",se),window.removeEventListener("orientationchange",se),clearTimeout(j),Me(t);},replay(){w=-1,D=false,C=0,L=false,P(0);},pause(){L=true,cancelAnimationFrame(A);},resume(){L&&(L=false,$&&(A=requestAnimationFrame(_)));},seek(p){let I=Math.min(1,Math.max(0,p));C=I,w=I,L=true,cancelAnimationFrame(A),P(I);},getProgress(){return C}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function We(e,n={}){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),lt;let t=r,{trigger:u={},easing:s="linear",once:m=false,axis:l="y",preload:c="auto",onReady:d,onComplete:O,onProgress:B}=n,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof s=="function"?s:ae[s]??ae.linear,de=le(u.start??"top top"),q=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let K=n.from??0,T=n.to,H=0,A=0,$=0,L=false,w=false,C=-1,D=0,F=false,M=false,z=()=>l==="x"?window.scrollX:window.scrollY,P=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let f=t.getBoundingClientRect(),k=l==="x"?f.left:f.top,ge=l==="x"?f.width:f.height,a=pe({top:k,height:ge},z(),P(),de,q);H=a.tStart,A=a.tEnd;}function Q(f){if(!M)return;let k=T??t.duration??0;t.currentTime=K+(k-K)*f,t.style.setProperty("--scroll-draw-progress",String(f)),B?.(f);}function j(){if(!L||w||!M)return;let f=re(J(z(),H,A,1));m&&(C=Math.max(C,f),f=C),D=f,Q(f),f>=1&&!F?(F=true,O?.()):f<1&&!m&&(F=false),$=requestAnimationFrame(j);}function se(){if(M=true,T===void 0&&(T=t.duration),E){Q(1),d?.();return}_(),d?.(),L&&!w&&($=requestAnimationFrame(j));}t.readyState>=1?se():t.addEventListener("loadedmetadata",se,{once:true}),M||_();let p=new IntersectionObserver(f=>{f.forEach(k=>{L=k.isIntersecting,L&&!w&&M?$=requestAnimationFrame(j):cancelAnimationFrame($);});}),I;function y(){clearTimeout(I),I=setTimeout(_,150);}return window.addEventListener("resize",y),window.addEventListener("orientationchange",y),p.observe(t),Ae(t,{type:"video",getProgress:()=>D,getTrigger:()=>({tStart:H,tEnd:A})}),{destroy(){cancelAnimationFrame($),p.disconnect(),t.removeEventListener("loadedmetadata",se),window.removeEventListener("resize",y),window.removeEventListener("orientationchange",y),clearTimeout(I),Me(t);},replay(){C=-1,F=false,D=0,w=false,Q(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,L&&M&&($=requestAnimationFrame(j)));},seek(f){let k=Math.min(1,Math.max(0,f));D=k,C=k,w=true,cancelAnimationFrame($),Q(k);},getProgress(){return D}}}function mt(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 Ct(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 ct(e){let n=mt(e),r=new Map;for(let s of n){let m=s.offsetTop;r.has(m)||r.set(m,[]),r.get(m).push(s);}let t=[],u=Array.from(r.keys()).sort((s,m)=>s-m);for(let s of u){let m=r.get(s),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of m)l.appendChild(c);t.push(l);}e.textContent="";for(let s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function Pt(e,n,r,t){if(r<=1||t===0)return e;let u=(r-1)*t,s=n*t,m=s+(1-u);return m<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(m-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 ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function _e(e,n={}){if(typeof window>"u")return ut;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),ut;let t=r,{split:u="words",stagger:s=.04,easing:m="ease-out",from:l={opacity:0,y:24},trigger:c={},once:d=true,onComplete:O}=n,B=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof m=="function"?m:ae[m]??ae["ease-out"],re=le(c.start??"top 85%"),de=le(c.end??"top 40%"),q=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let K;u==="chars"?K=Ct(t):u==="lines"?K=ct(t):K=mt(t);let T=K.length;function H(y,f){l?.opacity!==void 0&&(y.style.opacity=String(l.opacity+(1-l.opacity)*f));let k=It(f,l);k&&(y.style.transform=k);}function A(y){t.style.setProperty("--scroll-draw-progress",String(y)),K.forEach((f,k)=>{let ge=E(Pt(y,k,T,s));H(f,ge);});}if(B)return A(1),O?.(),{destroy(){t.innerHTML=q,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let $=0,L=0,w=0,C=false,D=false,F=-1,M=0,z=false,P=()=>window.scrollY,_=()=>window.innerHeight;function Q(){let y=t.getBoundingClientRect(),f=pe({top:y.top,height:y.height},P(),_(),re,de);$=f.tStart,L=f.tEnd;}function j(){if(!C||D)return;let y=J(P(),$,L,1);d&&(F=Math.max(F,y),y=F),M=y,A(y),y>=1&&!z?(z=true,O?.()):y<1&&!d&&(z=false),w=requestAnimationFrame(j);}Q();let se=new IntersectionObserver(y=>{y.forEach(f=>{C=f.isIntersecting,C&&!D?w=requestAnimationFrame(j):cancelAnimationFrame(w);});}),p;function I(){clearTimeout(p),p=setTimeout(()=>{if(u==="lines"){let y=M;t.innerHTML=q,t.setAttribute("aria-label",t.textContent??""),K=ct(t),A(y);}Q();},150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),se.observe(t),Ae(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:$,tEnd:L})}),{destroy(){cancelAnimationFrame(w),se.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(p),t.innerHTML=q,t.removeAttribute("aria-label"),Me(t);},replay(){F=-1,z=false,M=0,D=false,A(0);},pause(){D=true,cancelAnimationFrame(w);},resume(){D&&(D=false,C&&(w=requestAnimationFrame(j)));},seek(y){let f=Math.min(1,Math.max(0,y));M=f,F=f,D=true,cancelAnimationFrame(w),A(f);},getProgress(){return M}}}function tr(e,n={}){let r=ze(e,n);return {update(t){r.destroy(),r=ze(e,t);},destroy(){r.destroy();}}}function rr(e={}){let n=null;function r(t){return n=ze(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function nr(e,n){let r=Ve(e,n);return {update(t){r.destroy(),r=Ve(e,t);},destroy(){r.destroy();}}}function or(e){let n=null;function r(t){return n=Ve(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function sr(e,n){let r=qe(e,n);return {update(t){r.destroy(),r=qe(e,t);},destroy(){r.destroy();}}}function ir(e){let n=null;function r(t){return n=qe(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function ar(e,n={}){let r=We(e,n);return {update(t){r.destroy(),r=We(e,t);},destroy(){r.destroy();}}}function lr(e={}){let n=null;function r(t){return n=We(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function cr(e,n={}){let r=_e(e,n);return {update(t){r.destroy(),r=_e(e,t);},destroy(){r.destroy();}}}function ur(e={}){let n=null;function r(t){return n=_e(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}export{or as createScrollAnimate,ir as createScrollCounter,rr as createScrollDraw,ur as createScrollText,lr as createScrollVideo,nr as scrollAnimate,sr as scrollCounterAction,tr as scrollDraw,cr as scrollTextAction,ar as scrollVideoAction};
1
+ function Et({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),s=0,f=[];for(let h=0;h<r;h++){let P=Math.pow(u,h);f.push(P),s+=P;}let l=[0],c=0;for(let h=0;h<r;h++)c+=f[h]/s,l.push(c);return h=>{if(h<=0)return 0;if(h>=1)return 1;for(let P=0;P<r;P++)if(h<=l[P+1]){let R=(h-l[P])/(l[P+1]-l[P]);if(P===0)return R*(2-R);let E=1-Math.pow(t,P);return E+(1-E)*(2*R-1)*(2*R-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 s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-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:Et(),elastic:St()};function le(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 nt(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 ot(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 _e(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 xt(e,n,r){return Math.min(r,Math.max(n,e))}function Q(e,n,r,t){return r===n?0:xt((e-n)/(r-n)*t,0,1)}function ye(e,n,r,t,u){let s=nt(e.top,e.height,n,t.element)-ot(t.viewport,r),f=nt(e.top,e.height,n,u.element)-ot(u.viewport,r);return {tStart:s,tEnd:f}}function st(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function De(e,n,r){let t=st(e),u=st(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 it={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 at(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Tt=0;function At(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Mt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?at("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&at("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Lt(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 s=r==="x"?window.scrollX:window.scrollY,f=e-s,l=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:${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 Ke(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let f=parseFloat(s),l=t[u++]??f;return String(+(f+(l-f)*r).toFixed(4))})}function Be(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,u=r?{...it[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:h="linear",trigger:P={},stagger:R=0,direction:E="forward",once:j=false,debug:he=false,axis:V="y",scrollContainer:ee,autoReverse:U=false,delay:Z=0,strokeColor:S,strokeWidth:M,fillOpacity:L,waypoints:g,velocityScale:x=false,threshold:O=0,rootMargin:G="0px",repeat:I=0,repeatDelay:se=0,morphTo:$,clip:_,autoplay:B=false,duration:X=1e3,native:z=true,onProgress:p,onStart:T,onComplete:b,onEnter:y,onLeave:q,onEnterBack:Se,onLeaveBack:xe}=u,be=_===true?"left":typeof _=="string"?_:false,we=typeof h=="function"?h:ae[h]??ae.linear,Ce=le(P.start??"top bottom"),Ne=le(P.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(L)?L[0]:null,k=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function re(o){let a=o*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(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let C=be?[]:Array.from(e.querySelectorAll(f)),H=[],D=[],ie=0,ce=0,ne=false,de=false,oe=0,He=false,ve=-1,Re=-1,ue=false,Pe=0,Te=0,Ae,Ue=null,Me=new Set,Ve=-1,et=performance.now(),Oe=NaN;function Fe(){return te?V==="x"?te.scrollLeft:te.scrollTop:V==="x"?window.scrollX:window.scrollY}function tt(){return te?V==="x"?te.clientWidth:te.clientHeight:V==="x"?window.innerWidth:window.innerHeight}function rt(){let o=e.getBoundingClientRect(),a,v,Y;if(te){let fe=te.getBoundingClientRect();a=V==="x"?o.left-fe.left+te.scrollLeft:o.top-fe.top+te.scrollTop,v=V==="x"?o.width:o.height,Y=Fe();}else a=V==="x"?o.left:o.top,v=V==="x"?o.width:o.height,Y=Fe();let me=ye({top:a,height:v},Y,tt(),Ce,Ne);ie=me.tStart,ce=me.tEnd,he&&process.env.NODE_ENV!=="production"&&(Ue?.remove(),Ue=Lt(ie,ce,V));}function ht(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),be){let v=a==="reverse"?1-o:o;e.style.clipPath=re(v);return}C.forEach((v,Y)=>{v.style.strokeDashoffset=a==="reverse"?`${H[Y]*o}`:`${H[Y]*(1-o)}`,c&&(v.style.opacity=a==="reverse"?`${1-o}`:`${o}`),pe&&J?v.style.stroke=De(pe,J,o):J&&(v.style.stroke=J),K!==null&&i!==null?v.style.strokeWidth=`${K+(i-K)*o}`:i!==null&&(v.style.strokeWidth=`${i}`),d!==null&&k!==null?v.style.fillOpacity=`${d+(k-d)*o}`:k!==null&&(v.style.fillOpacity=`${k}`),$&&v.tagName.toLowerCase()==="path"&&D[Y]&&v.setAttribute("d",Ke(D[Y],$,o));});}function ze(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=re(0);return}C.forEach((o,a)=>{o.style.strokeDasharray=`${H[a]}`,o.style.strokeDashoffset=E==="reverse"?"0":`${H[a]}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),K!==null&&(o.style.strokeWidth=`${K}`),d!==null&&(o.style.fillOpacity=`${d}`),$&&o.tagName.toLowerCase()==="path"&&D[a]&&o.setAttribute("d",D[a]);});}if(C.forEach(o=>{Mt(o);let a=_e(o);H.push(a),o.tagName.toLowerCase()==="path"?D.push(o.getAttribute("d")??""):D.push(""),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=E==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),J&&(o.style.stroke=J),i!==null&&(o.style.strokeWidth=`${i}`),k!==null&&(o.style.fillOpacity=`${k}`),$&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",$)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=E==="reverse"?"0":`${a}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),K!==null&&(o.style.strokeWidth=`${K}`),d!==null&&(o.style.fillOpacity=`${d}`));}),be){if(s)return e.style.clipPath=re(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=re(0);}else if(s)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(z===false||!At()||!C.length||typeof h!="string"||!(h in lt)||be||V!=="y"||te||l!==1||R!==0||j||U||x!==false||$||g||I||Z>0||p||T||b||y||q||Se||xe||S!=null||M!=null||L!=null||(P.start??"top bottom").trim()!=="top bottom"||(P.end??"bottom top").trim()!=="bottom top")}function wt(){let o=`svg-scroll-draw-${++Tt}`,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 ${o}{from{${Y}}to{${me}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${lt[h]};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(o);}C.forEach(ge);let w=false,F=-1;function N(){if(F>=0)return F;let m=e.getBoundingClientRect(),{tStart:A,tEnd:W}=ye({top:m.top,height:m.height},Fe(),tt(),Ce,Ne);return we(Q(Fe(),A,W,l))}return {destroy(){C.forEach(m=>{m.classList.remove(o),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),fe.remove();},replay(){w=false,F=-1,C.forEach(ge);},pause(){w=true,C.forEach(m=>{m.style.animationPlayState="paused";});},resume(){w&&(w=false,C.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let A=Math.min(1,Math.max(0,m));F=A,w=true,C.forEach((W,Ie)=>{W.classList.remove(o),W.style.strokeDashoffset=E==="reverse"?`${H[Ie]*A}`:`${H[Ie]*(1-A)}`,c&&(W.style.opacity=E==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return N()}}}if(bt())return wt();function vt(){let o=Math.max(1,X),a=0,v=0;function Y(N){let m=true;if(be){let A=Math.min(1,Math.max(0,N/o)),W=we(A);Pe=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 C.forEach((A,W)=>{let Ie=W*R*o,ke=Math.min(1,Math.max(0,(N-Ie)/o)),Ee=we(ke);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=De(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&&k!==null?A.style.fillOpacity=`${d+(k-d)*Ee}`:k!==null&&(A.style.fillOpacity=`${k}`),$&&A.tagName.toLowerCase()==="path"&&D[W]&&A.setAttribute("d",Ke(D[W],$,Ee)),W===0&&(p?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),ke<1&&(m=false);});if(g){let A=Math.min(1,Math.max(0,N/o)),W=we(A);for(let Ie in g){let ke=parseFloat(Ie);W>=ke&&!Me.has(ke)&&(Me.add(ke),g[Ie]?.());}}return m}function me(N){if(ue)return;let m=N-a;de||(de=true,T?.());let A=Y(m);if(A&&!ne){ne=true,Y(o*(1+Math.max(0,C.length-1)*R)),b?.(),Te<(I==="infinite"?1/0:I??0)&&(Te++,Ae=setTimeout(()=>{a=performance.now(),de=false,ne=false,Me.clear(),ze(),oe=requestAnimationFrame(me);},se));return}A||(oe=requestAnimationFrame(me));}function fe(){cancelAnimationFrame(oe),clearTimeout(Ae),a=performance.now(),v=0,ue=false,de=false,ne=false,Te=0,Me.clear(),ze(),oe=requestAnimationFrame(me);}let ge=new IntersectionObserver(N=>{N.forEach(m=>{m.isIntersecting&&!(j&&ne)?fe():!m.isIntersecting&&!j&&!ne&&(cancelAnimationFrame(oe),clearTimeout(Ae),a=null);});},{root:te??null,threshold:O,rootMargin:G}),w;function F(){clearTimeout(w),w=setTimeout(()=>{C.forEach((N,m)=>{H[m]=_e(N),N.style.strokeDasharray=`${H[m]}`;});},150);}return window.addEventListener("resize",F),window.addEventListener("orientationchange",F),Z>0?setTimeout(()=>ge.observe(e),Z):ge.observe(e),{destroy(){cancelAnimationFrame(oe),clearTimeout(Ae),ge.disconnect(),window.removeEventListener("resize",F),window.removeEventListener("orientationchange",F),clearTimeout(w);},replay(){Te=0,fe();},pause(){ue||(ue=true,v=performance.now()-a,cancelAnimationFrame(oe));},resume(){ue&&(ue=false,a=performance.now()-v,oe=requestAnimationFrame(me));},seek(N){let m=Math.min(1,Math.max(0,N));Pe=m,ue=true,v=m*o,a=performance.now()-v,cancelAnimationFrame(oe),Y(v);},getProgress(){return Pe}}}if(B)return vt();rt();function qe(){if(!He||ue)return;let o=performance.now(),a=Fe(),v=l;if(x!==false){let w=o-et,F=w>0?Math.abs(a-(Ve<0?a:Ve))/w:0;v=l*Math.max(.2,1+F*(typeof x=="number"?x:1)*.04);}Ve=a,et=o;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(Oe)||(Oe<=0&&ge>0?y?.():Oe>0&&ge<=0&&xe?.(),Oe<1&&ge>=1?q?.():Oe>=1&&ge<1&&Se?.()),Oe=ge,be){let w=we(Q(a,ie,ce,v));j&&!U&&(ve=Math.max(ve,w),w=ve),Pe=w,e.style.setProperty("--scroll-draw-progress",String(w));let F=Y==="reverse"?1-w:w;e.style.clipPath=re(F),p?.(w),!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),w>=1&&!ne?(ne=true,b?.(),Te<(I==="infinite"?1/0:I??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,e.style.clipPath=re(0);},se))):w<1&&!j&&(ne=false),oe=requestAnimationFrame(qe);return}if(C.forEach((w,F)=>{let N=F*R*me,m=we(Q(a,ie+N,ce+N,v));j&&!U&&(ve=Math.max(ve,m),m=ve),Pe=m,w.style.strokeDashoffset=Y==="reverse"?`${H[F]*m}`:`${H[F]*(1-m)}`,c&&(w.style.opacity=Y==="reverse"?`${1-m}`:`${m}`),pe&&J?w.style.stroke=De(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&&k!==null?w.style.fillOpacity=`${d+(k-d)*m}`:k!==null&&(w.style.fillOpacity=`${k}`),$&&w.tagName.toLowerCase()==="path"&&D[F]&&w.setAttribute("d",Ke(D[F],$,m)),F===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 F in g){let N=parseFloat(F);w>=N&&!Me.has(N)&&(Me.add(N),g[F]?.());}}!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),fe&&!ne?(ne=true,b?.(),Te<(I==="infinite"?1/0:I??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,Me.clear(),ze();},se))):!fe&&!j&&(ne=false),oe=requestAnimationFrame(qe);}let Ze=new IntersectionObserver(o=>{o.forEach(a=>{He=a.isIntersecting,He&&!ue?oe=requestAnimationFrame(qe):cancelAnimationFrame(oe);});},{root:te??null,threshold:O,rootMargin:G}),Je;function We(){clearTimeout(Je),Je=setTimeout(()=>{C.forEach((o,a)=>{H[a]=_e(o),o.style.strokeDasharray=`${H[a]}`;}),rt();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),Z>0?setTimeout(()=>Ze.observe(e),Z):Ze.observe(e),{destroy(){cancelAnimationFrame(oe),clearTimeout(Ae),Ze.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Je),Ue?.remove();},replay(){ve=-1,Re=-1,Ve=-1,de=false,ne=false,Te=0,ue=false,Me.clear(),clearTimeout(Ae),ze();},pause(){ue=true,cancelAnimationFrame(oe);},resume(){ue&&(ue=false,He&&(oe=requestAnimationFrame(qe)));},seek(o){let a=Math.min(1,Math.max(0,o));Pe=a,ve=a,ue=true,cancelAnimationFrame(oe),ht(a,E);},getProgress(){return Pe}}}var ct=new Map;function Le(e,n){ct.set(e,n);}function $e(e){ct.delete(e);}function $t(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ut(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let u=[],s=[],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),s.push(c?c[2]:"");}n.push({fn:t[1],nums:u,units:s});}return n}function Ct(e,n,r){let t=ut(e),u=ut(n);return t.length===0||t.length!==u.length?r<1?e:n:t.map((s,f)=>{let l=u[f];return s.fn!==l.fn||s.nums.length!==l.nums.length?r<1?`${s.fn}(${s.nums.map((c,h)=>`${c}${s.units[h]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,h)=>`${c}${l.units[h]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,h)=>`${c+(l.nums[h]-c)*r}${s.units[h]}`).join(", ")})`}).join(" ")}function mt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),u=String(n);if($t(t))return De(t,u,r);if(t.includes("("))return Ct(t,u,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),f=u.match(/^([-+]?[\d.]+)(.*)$/);if(s&&f){let l=parseFloat(s[1]),c=parseFloat(f[1]);return `${l+(c-l)*r}${s[2]||f[2]}`}return r<1?t:u}function Pt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var ft={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},It=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ot=0;function kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Ge(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:u={},easing:s="ease-out",speed:f=1,once:l=false,axis:c="y",scrollContainer:h,native:P=true,velocityScale:R=false,onProgress:E,onComplete:j,onEnter:he,onLeave:V,onEnterBack:ee,onLeaveBack:U}=n,Z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof s=="function"?s:ae[s]??ae["ease-out"],M=le(u.start??"top bottom"),L=le(u.end??"bottom top"),g=typeof h=="string"?document.querySelector(h):h??null,x=Object.entries(t).map(([i,d])=>({prop:Pt(i),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function O(){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?.(),r;O();function I(){if(!P||!kt()||typeof s!="string"||!(s in ft)||c!=="y"||g||l||f!==1||E||j||he||V||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(!It.has(i.prop))return false;return true}function se(){let i=`ssd-a-${++Ot}`,d=x.map(D=>`${D.prop}:${D.from}`).join(";"),k=x.map(D=>`${D.prop}:${D.to}`).join(";"),re=document.createElement("style");re.setAttribute("data-ssd-animate",""),re.textContent=`@keyframes ${i}{from{${d}}to{${k}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ft[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(re),e.classList.add(i);let C=()=>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(D){let ie=Math.min(1,Math.max(0,D));e.classList.remove(i);for(let ce of x)e.style.setProperty(ce.prop,mt(ce.from,ce.to,ie));},getProgress(){let D=e.getBoundingClientRect(),ie=C(),ce=H(),{tStart:ne,tEnd:de}=ye({top:D.top,height:D.height},ie,ce,M,L);return S(Q(ie,ne,de,f))}}}if(I())return se();let $=0,_=0,B=0,X=false,z=false,p=-1,T=0,b=false,y=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,k;if(g){let C=g.getBoundingClientRect();d=c==="x"?i.left-C.left+g.scrollLeft:i.top-C.top+g.scrollTop,k=c==="x"?i.width:i.height;}else d=c==="x"?i.left:i.top,k=c==="x"?i.width:i.height;let re=ye({top:d,height:k},xe(),be(),M,L);$=re.tStart,_=re.tEnd;}function Ce(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let d of x)e.style.setProperty(d.prop,mt(d.from,d.to,i));E?.(i);}function Ne(i){if(isNaN(y)){y=i;return}y<=0&&i>0?he?.():y>0&&i<=0&&U?.(),y<1&&i>=1?V?.():y>=1&&i<1&&ee?.(),y=i;}function te(){if(!X||z)return;let i=performance.now(),d=xe(),k=f;if(R!==false){let H=i-Se,D=H>0?Math.abs(d-(q<0?d:q))/H:0;k=f*Math.max(.2,1+D*(typeof R=="number"?R:1)*.04);}q=d,Se=i;let re=_===$?0:(d-$)/(_-$);Ne(re);let C=S(Q(d,$,_,k));l&&(p=Math.max(p,C),C=p),T=C,Ce(C),C>=1&&!b?(b=true,j?.()):C<1&&!l&&(b=false),B=requestAnimationFrame(te);}we();{let i=S(Q(xe(),$,_,f));l&&i>0&&(p=i),T=i,Ce(i);}let pe=new IntersectionObserver(i=>{i.forEach(d=>{X=d.isIntersecting,X&&!z?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),Le(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,z=false,Ce(0);},pause(){z=true,cancelAnimationFrame(B);},resume(){z&&(z=false,X&&(B=requestAnimationFrame(te)));},seek(i){let d=Math.min(1,Math.max(0,i));T=d,p=d,z=true,cancelAnimationFrame(B),Ce(d);},getProgress(){return T}}}var Qe={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Xe(e,n){if(typeof window>"u")return Qe;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),Qe;let t=r,{from:u=0,to:s,format:f,easing:l="ease-out",trigger:c={},once:h=true,decimals:P,onComplete:R}=n,E=P!==void 0?p=>p.toFixed(P):f??(p=>String(Math.round(p))),j=typeof l=="function"?l:ae[l]??ae["ease-out"],he=le(c.start??"top 80%"),V=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(s),R?.(),Qe;t.textContent=E(u);let U=0,Z=0,S=0,M=false,L=false,g=-1,x=0,O=false,G=()=>window.scrollY,I=()=>window.innerHeight;function se(){let p=t.getBoundingClientRect(),T=ye({top:p.top,height:p.height},G(),I(),he,V);U=T.tStart,Z=T.tEnd;}function $(p){t.textContent=E(u+(s-u)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function _(){if(!M||L)return;let p=j(Q(G(),U,Z,1));h&&(g=Math.max(g,p),p=g),x=p,$(p),p>=1&&!O?(O=true,R?.()):p<1&&!h&&(O=false),S=requestAnimationFrame(_);}se();{let p=j(Q(G(),U,Z,1));h&&p>0&&(g=p),x=p,$(p);}let B=new IntersectionObserver(p=>{p.forEach(T=>{M=T.isIntersecting,M&&!L?S=requestAnimationFrame(_):cancelAnimationFrame(S);});}),X;function z(){clearTimeout(X),X=setTimeout(se,150);}return window.addEventListener("resize",z),window.addEventListener("orientationchange",z),B.observe(t),Le(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:U,tEnd:Z})}),{destroy(){cancelAnimationFrame(S),B.disconnect(),window.removeEventListener("resize",z),window.removeEventListener("orientationchange",z),clearTimeout(X),$e(t);},replay(){g=-1,O=false,x=0,L=false,$(0);},pause(){L=true,cancelAnimationFrame(S);},resume(){L&&(L=false,M&&(S=requestAnimationFrame(_)));},seek(p){let T=Math.min(1,Math.max(0,p));x=T,g=T,L=true,cancelAnimationFrame(S),$(T);},getProgress(){return x}}}var pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ye(e,n={}){if(typeof window>"u")return pt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),pt;let t=r,{trigger:u={},easing:s="linear",once:f=false,axis:l="y",preload:c="auto",onReady:h,onComplete:P,onProgress:R}=n,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,j=typeof s=="function"?s:ae[s]??ae.linear,he=le(u.start??"top top"),V=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let ee=n.from??0,U=n.to,Z=0,S=0,M=0,L=false,g=false,x=-1,O=0,G=false,I=false,se=()=>l==="x"?window.scrollX:window.scrollY,$=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let y=t.getBoundingClientRect(),q=l==="x"?y.left:y.top,Se=l==="x"?y.width:y.height,xe=ye({top:q,height:Se},se(),$(),he,V);Z=xe.tStart,S=xe.tEnd;}function B(y){if(!I)return;let q=U??t.duration??0;t.currentTime=ee+(q-ee)*y,t.style.setProperty("--scroll-draw-progress",String(y)),R?.(y);}function X(){if(!L||g||!I)return;let y=j(Q(se(),Z,S,1));f&&(x=Math.max(x,y),y=x),O=y,B(y),y>=1&&!G?(G=true,P?.()):y<1&&!f&&(G=false),M=requestAnimationFrame(X);}function z(){if(I=true,U===void 0&&(U=t.duration),E){B(1),h?.();return}_(),h?.(),L&&!g&&(M=requestAnimationFrame(X));}t.readyState>=1?z():t.addEventListener("loadedmetadata",z,{once:true}),I||_();let p=new IntersectionObserver(y=>{y.forEach(q=>{L=q.isIntersecting,L&&!g&&I?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),Le(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:Z,tEnd:S})}),{destroy(){cancelAnimationFrame(M),p.disconnect(),t.removeEventListener("loadedmetadata",z),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(T),$e(t);},replay(){x=-1,G=false,O=0,g=false,B(0);},pause(){g=true,cancelAnimationFrame(M);},resume(){g&&(g=false,L&&I&&(M=requestAnimationFrame(X)));},seek(y){let q=Math.min(1,Math.max(0,y));O=q,x=q,g=true,cancelAnimationFrame(M),B(q);},getProgress(){return O}}}function yt(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 Dt(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function dt(e){let n=yt(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=[],u=Array.from(r.keys()).sort((s,f)=>s-f);for(let s of u){let f=r.get(s),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 s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function Ft(e,n,r,t){if(r<=1||t===0)return e;let u=(r-1)*t,s=n*t,f=s+(1-u);return f<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(f-s)))}function Nt(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 gt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function je(e,n={}){if(typeof window>"u")return gt;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),gt;let t=r,{split:u="words",stagger:s=.04,easing:f="ease-out",from:l={opacity:0,y:24},trigger:c={},once:h=true,onComplete:P}=n,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof f=="function"?f:ae[f]??ae["ease-out"],j=le(c.start??"top 85%"),he=le(c.end??"top 40%"),V=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=Dt(t):u==="lines"?ee=dt(t):ee=yt(t);let U=ee.length;function Z(b,y){l?.opacity!==void 0&&(b.style.opacity=String(l.opacity+(1-l.opacity)*y));let q=Nt(y,l);q&&(b.style.transform=q);}function S(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach((y,q)=>{let Se=E(Ft(b,q,U,s));Z(y,Se);});}if(R)return S(1),P?.(),{destroy(){t.innerHTML=V,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};S(0);let M=0,L=0,g=0,x=false,O=false,G=-1,I=0,se=false,$=()=>window.scrollY,_=()=>window.innerHeight;function B(){let b=t.getBoundingClientRect(),y=ye({top:b.top,height:b.height},$(),_(),j,he);M=y.tStart,L=y.tEnd;}function X(){if(!x||O)return;let b=Q($(),M,L,1);h&&(G=Math.max(G,b),b=G),I=b,S(b),b>=1&&!se?(se=true,P?.()):b<1&&!h&&(se=false),g=requestAnimationFrame(X);}B();let z=new IntersectionObserver(b=>{b.forEach(y=>{x=y.isIntersecting,x&&!O?g=requestAnimationFrame(X):cancelAnimationFrame(g);});}),p;function T(){clearTimeout(p),p=setTimeout(()=>{if(u==="lines"){let b=I;t.innerHTML=V,t.setAttribute("aria-label",t.textContent??""),ee=dt(t),S(b);}B();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),z.observe(t),Le(t,{type:"text",getProgress:()=>I,getTrigger:()=>({tStart:M,tEnd:L})}),{destroy(){cancelAnimationFrame(g),z.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(p),t.innerHTML=V,t.removeAttribute("aria-label"),$e(t);},replay(){G=-1,se=false,I=0,O=false,S(0);},pause(){O=true,cancelAnimationFrame(g);},resume(){O&&(O=false,x&&(g=requestAnimationFrame(X)));},seek(b){let y=Math.min(1,Math.max(0,b));I=y,G=y,O=true,cancelAnimationFrame(g),S(y);},getProgress(){return I}}}function ir(e,n={}){let r=Be(e,n);return {update(t){r.destroy(),r=Be(e,t);},destroy(){r.destroy();}}}function ar(e={}){let n=null;function r(t){return n=Be(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function lr(e,n){let r=Ge(e,n);return {update(t){r.destroy(),r=Ge(e,t);},destroy(){r.destroy();}}}function cr(e){let n=null;function r(t){return n=Ge(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function ur(e,n){let r=Xe(e,n);return {update(t){r.destroy(),r=Xe(e,t);},destroy(){r.destroy();}}}function mr(e){let n=null;function r(t){return n=Xe(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function fr(e,n={}){let r=Ye(e,n);return {update(t){r.destroy(),r=Ye(e,t);},destroy(){r.destroy();}}}function pr(e={}){let n=null;function r(t){return n=Ye(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function dr(e,n={}){let r=je(e,n);return {update(t){r.destroy(),r=je(e,t);},destroy(){r.destroy();}}}function gr(e={}){let n=null;function r(t){return n=je(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}export{cr as createScrollAnimate,mr as createScrollCounter,ar as createScrollDraw,gr as createScrollText,pr as createScrollVideo,lr as scrollAnimate,ur as scrollCounterAction,ir as scrollDraw,dr as scrollTextAction,fr as scrollVideoAction};
@@ -1,3 +1,3 @@
1
- 'use strict';var vue=require('vue');function St({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),s=0,m=[];for(let d=0;d<n;d++){let F=Math.pow(l,d);m.push(F),s+=F;}let c=[0],u=0;for(let d=0;d<n;d++)u+=m[d]/s,c.push(u);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let F=0;F<n;F++)if(d<=c[F+1]){let B=(d-c[F])/(c[F+1]-c[F]);if(F===0)return B*(2-B);let S=1-Math.pow(t,F);return S+(1-S)*(2*B-1)*(2*B-1)}return 1}}function Et({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-l)*(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:St(),elastic:Et()};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 rt(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 ot(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 xt(e,r,n){return Math.min(n,Math.max(r,e))}function J(e,r,n,t){return n===r?0:xt((e-r)/(n-r)*t,0,1)}function pe(e,r,n,t,l){let s=rt(e.top,e.height,r,t.element)-ot(t.viewport,n),m=rt(e.top,e.height,r,l.element)-ot(l.viewport,n);return {tStart:s,tEnd:m}}function st(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 ke(e,r,n){let t=st(e),l=st(r);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*n)},${Math.round(t[1]+(l[1]-t[1])*n)},${Math.round(t[2]+(l[2]-t[2])*n)})`}var it={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 at(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Tt=0;function At(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Mt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?at("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&at("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Ct(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 l(){let s=n==="x"?window.scrollX:window.scrollY,m=e-s,c=r-s,u=n==="x";t.innerHTML=`
1
+ 'use strict';var vue=require('vue');function Mt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),s=0,m=[];for(let h=0;h<n;h++){let P=Math.pow(l,h);m.push(P),s+=P;}let c=[0],u=0;for(let h=0;h<n;h++)u+=m[h]/s,c.push(u);return h=>{if(h<=0)return 0;if(h>=1)return 1;for(let P=0;P<n;P++)if(h<=c[P+1]){let H=(h-c[P])/(c[P+1]-c[P]);if(P===0)return H*(2-H);let S=1-Math.pow(t,P);return S+(1-S)*(2*H-1)*(2*H-1)}return 1}}function Ct({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-l)*(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:Ct()};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 lt(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 ct(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 Ye(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 Lt(e,r,n){return Math.min(n,Math.max(r,e))}function Q(e,r,n,t){return n===r?0:Lt((e-r)/(n-r)*t,0,1)}function ye(e,r,n,t,l){let s=lt(e.top,e.height,r,t.element)-ct(t.viewport,n),m=lt(e.top,e.height,r,l.element)-ct(l.viewport,n);return {tStart:s,tEnd:m}}function ut(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 Re(e,r,n){let t=ut(e),l=ut(r);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*n)},${Math.round(t[1]+(l[1]-t[1])*n)},${Math.round(t[2]+(l[2]-t[2])*n)})`}var ft={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 mt(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var pt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},$t=0;function Pt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Ot(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?mt("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&mt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function kt(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 l(){let s=n==="x"?window.scrollX:window.scrollY,m=e-s,c=r-s,u=n==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${u?`left:${m}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${m}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;${u?`left:${c}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${c}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),t}function Xe(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let m=parseFloat(s),c=t[l++]??m;return String(+(m+(c-m)*n).toFixed(4))})}function Ye(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,l=n?{...it[n],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:c=1,fade:u=false,easing:d="linear",trigger:F={},stagger:B=0,direction:S="forward",once:ne=false,debug:de=false,axis:q="y",scrollContainer:K,autoReverse:T=false,delay:R=0,strokeColor:A,strokeWidth:C,fillOpacity:$,waypoints:b,velocityScale:L=false,threshold:k=0,rootMargin:D="0px",repeat:M=0,repeatDelay:z=0,morphTo:P,clip:_,autoplay:Q=false,duration:Y=1e3,native:se=true,onProgress:p,onStart:O,onComplete:y}=l,f=_===true?"left":typeof _=="string"?_:false,I=typeof d=="function"?d:ae[d]??ae.linear,ge=le(F.start??"top bottom"),a=le(F.end??"bottom top"),g=typeof K=="string"?document.querySelector(K):K??null,re=Array.isArray(A)?A[0]:null,V=Array.isArray(A)?A[1]:typeof A=="string"?A:null,U=Array.isArray(C)?C[0]:null,oe=Array.isArray(C)?C[1]:typeof C=="number"?C:null,N=Array.isArray($)?$[0]:null,G=Array.isArray($)?$[1]:typeof $=="number"?$:null;function me(o){let i=o*100;switch(f){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let ee=f?[]:Array.from(e.querySelectorAll(m)),j=[],he=[],Te=0,Ae=0,ie=false,ye=false,te=0,Ne=false,be=-1,He=-1,ce=false,Pe=0,xe=0,Me,Be=null,Ce=new Set,ze=-1,et=performance.now();function Ie(){return g?q==="x"?g.scrollLeft:g.scrollTop:q==="x"?window.scrollX:window.scrollY}function tt(){return g?q==="x"?g.clientWidth:g.clientHeight:q==="x"?window.innerWidth:window.innerHeight}function nt(){let o=e.getBoundingClientRect(),i,v,X;if(g){let ue=g.getBoundingClientRect();i=q==="x"?o.left-ue.left+g.scrollLeft:o.top-ue.top+g.scrollTop,v=q==="x"?o.width:o.height,X=Ie();}else i=q==="x"?o.left:o.top,v=q==="x"?o.width:o.height,X=Ie();let fe=pe({top:i,height:v},X,tt(),ge,a);Te=fe.tStart,Ae=fe.tEnd,de&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=Ct(Te,Ae,q));}function ht(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),f){let v=i==="reverse"?1-o:o;e.style.clipPath=me(v);return}ee.forEach((v,X)=>{v.style.strokeDashoffset=i==="reverse"?`${j[X]*o}`:`${j[X]*(1-o)}`,u&&(v.style.opacity=i==="reverse"?`${1-o}`:`${o}`),re&&V?v.style.stroke=ke(re,V,o):V&&(v.style.stroke=V),U!==null&&oe!==null?v.style.strokeWidth=`${U+(oe-U)*o}`:oe!==null&&(v.style.strokeWidth=`${oe}`),N!==null&&G!==null?v.style.fillOpacity=`${N+(G-N)*o}`:G!==null&&(v.style.fillOpacity=`${G}`),P&&v.tagName.toLowerCase()==="path"&&he[X]&&v.setAttribute("d",Xe(he[X],P,o));});}function Ve(){if(e.style.setProperty("--scroll-draw-progress","0"),f){e.style.clipPath=me(0);return}ee.forEach((o,i)=>{o.style.strokeDasharray=`${j[i]}`,o.style.strokeDashoffset=S==="reverse"?"0":`${j[i]}`,u?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",re&&(o.style.stroke=re),U!==null&&(o.style.strokeWidth=`${U}`),N!==null&&(o.style.fillOpacity=`${N}`),P&&o.tagName.toLowerCase()==="path"&&he[i]&&o.setAttribute("d",he[i]);});}if(ee.forEach(o=>{Mt(o);let i=_e(o);j.push(i),o.tagName.toLowerCase()==="path"?he.push(o.getAttribute("d")??""):he.push(""),s?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=S==="reverse"?`${i}`:"0",u&&(o.style.opacity="1"),V&&(o.style.stroke=V),oe!==null&&(o.style.strokeWidth=`${oe}`),G!==null&&(o.style.fillOpacity=`${G}`),P&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",P)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=S==="reverse"?"0":`${i}`,u?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",re&&(o.style.stroke=re),U!==null&&(o.style.strokeWidth=`${U}`),N!==null&&(o.style.fillOpacity=`${N}`));}),f){if(s)return e.style.clipPath=me(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=me(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(se===false||!At()||!ee.length||typeof d!="string"||!(d in lt)||f||q!=="y"||g||c!==1||B!==0||ne||T||L!==false||P||b||M||R>0||p||O||y||A!=null||C!=null||$!=null||(F.start??"top bottom").trim()!=="top bottom"||(F.end??"bottom top").trim()!=="bottom top")}function wt(){let o=`svg-scroll-draw-${++Tt}`,i=S==="reverse"?"0":"var(--ssd-len)",v=S==="reverse"?"var(--ssd-len)":"0",X=`stroke-dashoffset:${i};`,fe=`stroke-dashoffset:${v};`;u&&(X+=`opacity:${S==="reverse"?1:0};`,fe+=`opacity:${S==="reverse"?0:1};`);let ue=document.createElement("style");ue.setAttribute("data-svg-scroll-draw",""),ue.textContent=`@keyframes ${o}{from{${X}}to{${fe}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${lt[d]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue);function w(h,x){h.style.setProperty("--ssd-len",String(j[x])),h.style.strokeDasharray=`${j[x]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(o);}ee.forEach(w);let H=false,Z=-1;function E(){if(Z>=0)return Z;let h=e.getBoundingClientRect(),{tStart:x,tEnd:W}=pe({top:h.top,height:h.height},Ie(),tt(),ge,a);return I(J(Ie(),x,W,c))}return {destroy(){ee.forEach(h=>{h.classList.remove(o),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),ue.remove();},replay(){H=false,Z=-1,ee.forEach(w);},pause(){H=true,ee.forEach(h=>{h.style.animationPlayState="paused";});},resume(){H&&(H=false,ee.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let x=Math.min(1,Math.max(0,h));Z=x,H=true,ee.forEach((W,Oe)=>{W.classList.remove(o),W.style.strokeDashoffset=S==="reverse"?`${j[Oe]*x}`:`${j[Oe]*(1-x)}`,u&&(W.style.opacity=S==="reverse"?`${1-x}`:`${x}`);});},getProgress(){return E()}}}if(bt())return wt();function vt(){let o=Math.max(1,Y),i=0,v=0;function X(E){let h=true;if(f){let x=Math.min(1,Math.max(0,E/o)),W=I(x);Pe=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=me(S==="reverse"?1-W:W),p?.(W),x<1&&(h=false);}else ee.forEach((x,W)=>{let Oe=W*B*o,Fe=Math.min(1,Math.max(0,(E-Oe)/o)),we=I(Fe);x.style.strokeDashoffset=S==="reverse"?`${j[W]*we}`:`${j[W]*(1-we)}`,u&&(x.style.opacity=S==="reverse"?`${1-we}`:`${we}`),re&&V?x.style.stroke=ke(re,V,we):V&&(x.style.stroke=V),U!==null&&oe!==null?x.style.strokeWidth=`${U+(oe-U)*we}`:oe!==null&&(x.style.strokeWidth=`${oe}`),N!==null&&G!==null?x.style.fillOpacity=`${N+(G-N)*we}`:G!==null&&(x.style.fillOpacity=`${G}`),P&&x.tagName.toLowerCase()==="path"&&he[W]&&x.setAttribute("d",Xe(he[W],P,we)),W===0&&(p?.(we),e.style.setProperty("--scroll-draw-progress",String(we))),Fe<1&&(h=false);});if(b){let x=Math.min(1,Math.max(0,E/o)),W=I(x);for(let Oe in b){let Fe=parseFloat(Oe);W>=Fe&&!Ce.has(Fe)&&(Ce.add(Fe),b[Oe]?.());}}return h}function fe(E){if(ce)return;let h=E-i;ye||(ye=true,O?.());let x=X(h);if(x&&!ie){ie=true,X(o*(1+Math.max(0,ee.length-1)*B)),y?.(),xe<(M==="infinite"?1/0:M??0)&&(xe++,Me=setTimeout(()=>{i=performance.now(),ye=false,ie=false,Ce.clear(),Ve(),te=requestAnimationFrame(fe);},z));return}x||(te=requestAnimationFrame(fe));}function ue(){cancelAnimationFrame(te),clearTimeout(Me),i=performance.now(),v=0,ce=false,ye=false,ie=false,xe=0,Ce.clear(),Ve(),te=requestAnimationFrame(fe);}let w=new IntersectionObserver(E=>{E.forEach(h=>{h.isIntersecting&&!(ne&&ie)?ue():!h.isIntersecting&&!ne&&!ie&&(cancelAnimationFrame(te),clearTimeout(Me),i=null);});},{root:g??null,threshold:k,rootMargin:D}),H;function Z(){clearTimeout(H),H=setTimeout(()=>{ee.forEach((E,h)=>{j[h]=_e(E),E.style.strokeDasharray=`${j[h]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),R>0?setTimeout(()=>w.observe(e),R):w.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(Me),w.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(H);},replay(){xe=0,ue();},pause(){ce||(ce=true,v=performance.now()-i,cancelAnimationFrame(te));},resume(){ce&&(ce=false,i=performance.now()-v,te=requestAnimationFrame(fe));},seek(E){let h=Math.min(1,Math.max(0,E));Pe=h,ce=true,v=h*o,i=performance.now()-v,cancelAnimationFrame(te),X(v);},getProgress(){return Pe}}}if(Q)return vt();nt();function qe(){if(!Ne||ce)return;let o=performance.now(),i=Ie(),v=c;if(L!==false){let w=o-et,H=w>0?Math.abs(i-(ze<0?i:ze))/w:0;v=c*Math.max(.2,1+H*(typeof L=="number"?L:1)*.04);}ze=i,et=o;let X=T?He===-1||i>=He?"forward":"reverse":S;He=i;let fe=Ae-Te,ue=true;if(f){let w=I(J(i,Te,Ae,v));ne&&!T&&(be=Math.max(be,w),w=be),Pe=w,e.style.setProperty("--scroll-draw-progress",String(w));let H=X==="reverse"?1-w:w;e.style.clipPath=me(H),p?.(w),!ye&&J(i,Te,Ae,v)>0&&(ye=true,O?.()),w>=1&&!ie?(ie=true,y?.(),xe<(M==="infinite"?1/0:M??0)&&(xe++,Me=setTimeout(()=>{be=-1,ye=false,ie=false,e.style.clipPath=me(0);},z))):w<1&&!ne&&(ie=false),te=requestAnimationFrame(qe);return}if(ee.forEach((w,H)=>{let Z=H*B*fe,E=I(J(i,Te+Z,Ae+Z,v));ne&&!T&&(be=Math.max(be,E),E=be),Pe=E,w.style.strokeDashoffset=X==="reverse"?`${j[H]*E}`:`${j[H]*(1-E)}`,u&&(w.style.opacity=X==="reverse"?`${1-E}`:`${E}`),re&&V?w.style.stroke=ke(re,V,E):V&&(w.style.stroke=V),U!==null&&oe!==null?w.style.strokeWidth=`${U+(oe-U)*E}`:oe!==null&&(w.style.strokeWidth=`${oe}`),N!==null&&G!==null?w.style.fillOpacity=`${N+(G-N)*E}`:G!==null&&(w.style.fillOpacity=`${G}`),P&&w.tagName.toLowerCase()==="path"&&he[H]&&w.setAttribute("d",Xe(he[H],P,E)),H===0&&(p?.(E),e.style.setProperty("--scroll-draw-progress",String(E))),E<1&&(ue=false);}),b){let w=I(J(i,Te,Ae,v));for(let H in b){let Z=parseFloat(H);w>=Z&&!Ce.has(Z)&&(Ce.add(Z),b[H]?.());}}!ye&&J(i,Te,Ae,v)>0&&(ye=true,O?.()),ue&&!ie?(ie=true,y?.(),xe<(M==="infinite"?1/0:M??0)&&(xe++,Me=setTimeout(()=>{be=-1,ye=false,ie=false,Ce.clear(),Ve();},z))):!ue&&!ne&&(ie=false),te=requestAnimationFrame(qe);}let Ge=new IntersectionObserver(o=>{o.forEach(i=>{Ne=i.isIntersecting,Ne&&!ce?te=requestAnimationFrame(qe):cancelAnimationFrame(te);});},{root:g??null,threshold:k,rootMargin:D}),je;function We(){clearTimeout(je),je=setTimeout(()=>{ee.forEach((o,i)=>{j[i]=_e(o),o.style.strokeDasharray=`${j[i]}`;}),nt();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),R>0?setTimeout(()=>Ge.observe(e),R):Ge.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(Me),Ge.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(je),Be?.remove();},replay(){be=-1,He=-1,ze=-1,ye=false,ie=false,xe=0,ce=false,Ce.clear(),clearTimeout(Me),Ve();},pause(){ce=true,cancelAnimationFrame(te);},resume(){ce&&(ce=false,Ne&&(te=requestAnimationFrame(qe)));},seek(o){let i=Math.min(1,Math.max(0,o));Pe=i,be=i,ce=true,cancelAnimationFrame(te),ht(i,S);},getProgress(){return Pe}}}var ct=new Map;function $e(e,r){ct.set(e,r);}function Le(e){ct.delete(e);}function $t(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ut(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let l=[],s=[],m=t[2].trim();if(m)for(let c of m.split(/[\s,]+/)){let u=c.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(u?parseFloat(u[1]):0),s.push(u?u[2]:"");}r.push({fn:t[1],nums:l,units:s});}return r}function Lt(e,r,n){let t=ut(e),l=ut(r);return t.length===0||t.length!==l.length?n<1?e:r:t.map((s,m)=>{let c=l[m];return s.fn!==c.fn||s.nums.length!==c.nums.length?n<1?`${s.fn}(${s.nums.map((u,d)=>`${u}${s.units[d]}`).join(", ")})`:`${c.fn}(${c.nums.map((u,d)=>`${u}${c.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((u,d)=>`${u+(c.nums[d]-u)*n}${s.units[d]}`).join(", ")})`}).join(" ")}function mt(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),l=String(r);if($t(t))return ke(t,l,n);if(t.includes("("))return Lt(t,l,n);let s=t.match(/^([-+]?[\d.]+)(.*)$/),m=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&m){let c=parseFloat(s[1]),u=parseFloat(m[1]);return `${c+(u-c)*n}${s[2]||m[2]}`}return n<1?t:l}function Pt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var ft={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Ot=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ft=0;function kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Ue(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:l={},easing:s="ease-out",speed:m=1,once:c=false,axis:u="y",scrollContainer:d,native:F=true,onProgress:B,onComplete:S}=r,ne=window.matchMedia("(prefers-reduced-motion: reduce)").matches,de=typeof s=="function"?s:ae[s]??ae["ease-out"],q=le(l.start??"top bottom"),K=le(l.end??"bottom top"),T=typeof d=="string"?document.querySelector(d):d??null,R=Object.entries(t).map(([a,g])=>({prop:Pt(a),from:Array.isArray(g)?g[0]:"",to:Array.isArray(g)?g[1]:g}));function A(){let a=window.getComputedStyle(e);for(let g of R)g.from===""&&(g.from=a.getPropertyValue(g.prop).trim()||"0");}function C(){for(let a of R)e.style.setProperty(a.prop,String(a.to));}if(ne)return C(),S?.(),n;A();function $(){if(!F||!kt()||typeof s!="string"||!(s in ft)||u!=="y"||T||c||m!==1||B||S||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let a of R)if(!Ot.has(a.prop))return false;return true}function b(){let a=`ssd-a-${++Ft}`,g=R.map(N=>`${N.prop}:${N.from}`).join(";"),re=R.map(N=>`${N.prop}:${N.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${a}{from{${g}}to{${re}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ft[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(a);let U=()=>u==="x"?window.scrollX:window.scrollY,oe=()=>u==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),V.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(N){let G=Math.min(1,Math.max(0,N));e.classList.remove(a);for(let me of R)e.style.setProperty(me.prop,mt(me.from,me.to,G));},getProgress(){let N=e.getBoundingClientRect(),G=U(),me=oe(),{tStart:ee,tEnd:j}=pe({top:N.top,height:N.height},G,me,q,K);return de(J(G,ee,j,m))}}}if($())return b();let L=0,k=0,D=0,M=false,z=false,P=-1,_=0,Q=false,Y=()=>T?u==="x"?T.scrollLeft:T.scrollTop:u==="x"?window.scrollX:window.scrollY,se=()=>T?u==="x"?T.clientWidth:T.clientHeight:u==="x"?window.innerWidth:window.innerHeight;function p(){let a=e.getBoundingClientRect(),g,re;if(T){let U=T.getBoundingClientRect();g=u==="x"?a.left-U.left+T.scrollLeft:a.top-U.top+T.scrollTop,re=u==="x"?a.width:a.height;}else g=u==="x"?a.left:a.top,re=u==="x"?a.width:a.height;let V=pe({top:g,height:re},Y(),se(),q,K);L=V.tStart,k=V.tEnd;}function O(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let g of R)e.style.setProperty(g.prop,mt(g.from,g.to,a));B?.(a);}function y(){if(!M||z)return;let a=de(J(Y(),L,k,m));c&&(P=Math.max(P,a),a=P),_=a,O(a),a>=1&&!Q?(Q=true,S?.()):a<1&&!c&&(Q=false),D=requestAnimationFrame(y);}p();{let a=de(J(Y(),L,k,m));c&&a>0&&(P=a),_=a,O(a);}let f=new IntersectionObserver(a=>{a.forEach(g=>{M=g.isIntersecting,M&&!z?D=requestAnimationFrame(y):cancelAnimationFrame(D);});},{root:T??null}),I;function ge(){clearTimeout(I),I=setTimeout(p,150);}return window.addEventListener("resize",ge),window.addEventListener("orientationchange",ge),f.observe(e),$e(e,{type:"animate",getProgress:()=>_,getTrigger:()=>({tStart:L,tEnd:k})}),{destroy(){cancelAnimationFrame(D),f.disconnect(),window.removeEventListener("resize",ge),window.removeEventListener("orientationchange",ge),clearTimeout(I),Le(e);},replay(){P=-1,Q=false,_=0,z=false,O(0);},pause(){z=true,cancelAnimationFrame(D);},resume(){z&&(z=false,M&&(D=requestAnimationFrame(y)));},seek(a){let g=Math.min(1,Math.max(0,a));_=g,P=g,z=true,cancelAnimationFrame(D),O(g);},getProgress(){return _}}}var Ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Je(e,r){if(typeof window>"u")return Ze;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),Ze;let t=n,{from:l=0,to:s,format:m,easing:c="ease-out",trigger:u={},once:d=true,decimals:F,onComplete:B}=r,S=F!==void 0?p=>p.toFixed(F):m??(p=>String(Math.round(p))),ne=typeof c=="function"?c:ae[c]??ae["ease-out"],de=le(u.start??"top 80%"),q=le(u.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(s),B?.(),Ze;t.textContent=S(l);let T=0,R=0,A=0,C=false,$=false,b=-1,L=0,k=false,D=()=>window.scrollY,M=()=>window.innerHeight;function z(){let p=t.getBoundingClientRect(),O=pe({top:p.top,height:p.height},D(),M(),de,q);T=O.tStart,R=O.tEnd;}function P(p){t.textContent=S(l+(s-l)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function _(){if(!C||$)return;let p=ne(J(D(),T,R,1));d&&(b=Math.max(b,p),p=b),L=p,P(p),p>=1&&!k?(k=true,B?.()):p<1&&!d&&(k=false),A=requestAnimationFrame(_);}z();{let p=ne(J(D(),T,R,1));d&&p>0&&(b=p),L=p,P(p);}let Q=new IntersectionObserver(p=>{p.forEach(O=>{C=O.isIntersecting,C&&!$?A=requestAnimationFrame(_):cancelAnimationFrame(A);});}),Y;function se(){clearTimeout(Y),Y=setTimeout(z,150);}return window.addEventListener("resize",se),window.addEventListener("orientationchange",se),Q.observe(t),$e(t,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:T,tEnd:R})}),{destroy(){cancelAnimationFrame(A),Q.disconnect(),window.removeEventListener("resize",se),window.removeEventListener("orientationchange",se),clearTimeout(Y),Le(t);},replay(){b=-1,k=false,L=0,$=false,P(0);},pause(){$=true,cancelAnimationFrame(A);},resume(){$&&($=false,C&&(A=requestAnimationFrame(_)));},seek(p){let O=Math.min(1,Math.max(0,p));L=O,b=O,$=true,cancelAnimationFrame(A),P(O);},getProgress(){return L}}}var pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ke(e,r={}){if(typeof window>"u")return pt;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),pt;let t=n,{trigger:l={},easing:s="linear",once:m=false,axis:c="y",preload:u="auto",onReady:d,onComplete:F,onProgress:B}=r,S=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:ae[s]??ae.linear,de=le(l.start??"top top"),q=le(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=u);let K=r.from??0,T=r.to,R=0,A=0,C=0,$=false,b=false,L=-1,k=0,D=false,M=false,z=()=>c==="x"?window.scrollX:window.scrollY,P=()=>c==="x"?window.innerWidth:window.innerHeight;function _(){let f=t.getBoundingClientRect(),I=c==="x"?f.left:f.top,ge=c==="x"?f.width:f.height,a=pe({top:I,height:ge},z(),P(),de,q);R=a.tStart,A=a.tEnd;}function Q(f){if(!M)return;let I=T??t.duration??0;t.currentTime=K+(I-K)*f,t.style.setProperty("--scroll-draw-progress",String(f)),B?.(f);}function Y(){if(!$||b||!M)return;let f=ne(J(z(),R,A,1));m&&(L=Math.max(L,f),f=L),k=f,Q(f),f>=1&&!D?(D=true,F?.()):f<1&&!m&&(D=false),C=requestAnimationFrame(Y);}function se(){if(M=true,T===void 0&&(T=t.duration),S){Q(1),d?.();return}_(),d?.(),$&&!b&&(C=requestAnimationFrame(Y));}t.readyState>=1?se():t.addEventListener("loadedmetadata",se,{once:true}),M||_();let p=new IntersectionObserver(f=>{f.forEach(I=>{$=I.isIntersecting,$&&!b&&M?C=requestAnimationFrame(Y):cancelAnimationFrame(C);});}),O;function y(){clearTimeout(O),O=setTimeout(_,150);}return window.addEventListener("resize",y),window.addEventListener("orientationchange",y),p.observe(t),$e(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:R,tEnd:A})}),{destroy(){cancelAnimationFrame(C),p.disconnect(),t.removeEventListener("loadedmetadata",se),window.removeEventListener("resize",y),window.removeEventListener("orientationchange",y),clearTimeout(O),Le(t);},replay(){L=-1,D=false,k=0,b=false,Q(0);},pause(){b=true,cancelAnimationFrame(C);},resume(){b&&(b=false,$&&M&&(C=requestAnimationFrame(Y)));},seek(f){let I=Math.min(1,Math.max(0,f));k=I,L=I,b=true,cancelAnimationFrame(C),Q(I);},getProgress(){return k}}}function yt(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 It(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 dt(e){let r=yt(e),n=new Map;for(let s of r){let m=s.offsetTop;n.has(m)||n.set(m,[]),n.get(m).push(s);}let t=[],l=Array.from(n.keys()).sort((s,m)=>s-m);for(let s of l){let m=n.get(s),c=document.createElement("span");c.setAttribute("aria-hidden","true"),c.style.display="inline-block";for(let u of m)c.appendChild(u);t.push(c);}e.textContent="";for(let s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function Dt(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,s=r*t,m=s+(1-l);return m<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(m-s)))}function Rt(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 gt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Qe(e,r={}){if(typeof window>"u")return gt;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),gt;let t=n,{split:l="words",stagger:s=.04,easing:m="ease-out",from:c={opacity:0,y:24},trigger:u={},once:d=true,onComplete:F}=r,B=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof m=="function"?m:ae[m]??ae["ease-out"],ne=le(u.start??"top 85%"),de=le(u.end??"top 40%"),q=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let K;l==="chars"?K=It(t):l==="lines"?K=dt(t):K=yt(t);let T=K.length;function R(y,f){c?.opacity!==void 0&&(y.style.opacity=String(c.opacity+(1-c.opacity)*f));let I=Rt(f,c);I&&(y.style.transform=I);}function A(y){t.style.setProperty("--scroll-draw-progress",String(y)),K.forEach((f,I)=>{let ge=S(Dt(y,I,T,s));R(f,ge);});}if(B)return A(1),F?.(),{destroy(){t.innerHTML=q,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let C=0,$=0,b=0,L=false,k=false,D=-1,M=0,z=false,P=()=>window.scrollY,_=()=>window.innerHeight;function Q(){let y=t.getBoundingClientRect(),f=pe({top:y.top,height:y.height},P(),_(),ne,de);C=f.tStart,$=f.tEnd;}function Y(){if(!L||k)return;let y=J(P(),C,$,1);d&&(D=Math.max(D,y),y=D),M=y,A(y),y>=1&&!z?(z=true,F?.()):y<1&&!d&&(z=false),b=requestAnimationFrame(Y);}Q();let se=new IntersectionObserver(y=>{y.forEach(f=>{L=f.isIntersecting,L&&!k?b=requestAnimationFrame(Y):cancelAnimationFrame(b);});}),p;function O(){clearTimeout(p),p=setTimeout(()=>{if(l==="lines"){let y=M;t.innerHTML=q,t.setAttribute("aria-label",t.textContent??""),K=dt(t),A(y);}Q();},150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),se.observe(t),$e(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:C,tEnd:$})}),{destroy(){cancelAnimationFrame(b),se.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(p),t.innerHTML=q,t.removeAttribute("aria-label"),Le(t);},replay(){D=-1,z=false,M=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(b);},resume(){k&&(k=false,L&&(b=requestAnimationFrame(Y)));},seek(y){let f=Math.min(1,Math.max(0,y));M=f,D=f,k=true,cancelAnimationFrame(b),A(f);},getProgress(){return M}}}function ln(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=Ye(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var cn=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=Ye(n.value,t);vue.onUnmounted(()=>l.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function un(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=Ue(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var mn=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=Ue(n.value,e.options);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function fn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=Je(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var pn=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n={to:e.to};e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete);let t=Je(r.value,n);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("span",{ref:r})}});function dn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=Ke(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var gn=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=Ke(r.value,e.options??{});vue.onUnmounted(()=>n.destroy());}),()=>vue.h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function yn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=Qe(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var hn=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=Qe(n.value,e.options??{});vue.onUnmounted(()=>t.destroy());}),()=>vue.h(e.tag,{ref:n},r.default?.())}});exports.ScrollAnimate=mn;exports.ScrollCounter=pn;exports.ScrollDraw=cn;exports.ScrollText=hn;exports.ScrollVideo=gn;exports.useScrollAnimate=un;exports.useScrollCounter=fn;exports.useScrollDraw=ln;exports.useScrollText=yn;exports.useScrollVideo=dn;
3
+ <div style="position:absolute;${u?`left:${c}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${c}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),t}function Ke(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let m=parseFloat(s),c=t[l++]??m;return String(+(m+(c-m)*n).toFixed(4))})}function Qe(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,l=n?{...ft[n],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:c=1,fade:u=false,easing:h="linear",trigger:P={},stagger:H=0,direction:S="forward",once:Y=false,debug:he=false,axis:V="y",scrollContainer:ee,autoReverse:U=false,delay:Z=0,strokeColor:E,strokeWidth:M,fillOpacity:C,waypoints:g,velocityScale:x=false,threshold:k=0,rootMargin:G="0px",repeat:O=0,repeatDelay:se=0,morphTo:L,clip:W,autoplay:_=false,duration:j=1e3,native:z=true,onProgress:p,onStart:T,onComplete:b,onEnter:y,onLeave:q,onEnterBack:Ae,onLeaveBack:Me}=l,be=W===true?"left":typeof W=="string"?W:false,we=typeof h=="function"?h:ae[h]??ae.linear,ke=le(P.start??"top bottom"),qe=le(P.end??"bottom top"),te=typeof ee=="string"?document.querySelector(ee):ee??null,pe=Array.isArray(E)?E[0]:null,J=Array.isArray(E)?E[1]:typeof E=="string"?E:null,K=Array.isArray(M)?M[0]:null,i=Array.isArray(M)?M[1]:typeof M=="number"?M:null,d=Array.isArray(C)?C[0]:null,F=Array.isArray(C)?C[1]:typeof C=="number"?C:null;function ne(o){let a=o*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(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let $=be?[]:Array.from(e.querySelectorAll(m)),R=[],I=[],ie=0,ce=0,re=false,de=false,oe=0,Be=false,ve=-1,We=-1,ue=false,Fe=0,Ce=0,Le,Ue=null,$e=new Set,_e=-1,st=performance.now(),Ne=NaN;function He(){return te?V==="x"?te.scrollLeft:te.scrollTop:V==="x"?window.scrollX:window.scrollY}function it(){return te?V==="x"?te.clientWidth:te.clientHeight:V==="x"?window.innerWidth:window.innerHeight}function at(){let o=e.getBoundingClientRect(),a,v,X;if(te){let me=te.getBoundingClientRect();a=V==="x"?o.left-me.left+te.scrollLeft:o.top-me.top+te.scrollTop,v=V==="x"?o.width:o.height,X=He();}else a=V==="x"?o.left:o.top,v=V==="x"?o.width:o.height,X=He();let fe=ye({top:a,height:v},X,it(),ke,qe);ie=fe.tStart,ce=fe.tEnd,he&&process.env.NODE_ENV!=="production"&&(Ue?.remove(),Ue=kt(ie,ce,V));}function Et(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),be){let v=a==="reverse"?1-o:o;e.style.clipPath=ne(v);return}$.forEach((v,X)=>{v.style.strokeDashoffset=a==="reverse"?`${R[X]*o}`:`${R[X]*(1-o)}`,u&&(v.style.opacity=a==="reverse"?`${1-o}`:`${o}`),pe&&J?v.style.stroke=Re(pe,J,o):J&&(v.style.stroke=J),K!==null&&i!==null?v.style.strokeWidth=`${K+(i-K)*o}`:i!==null&&(v.style.strokeWidth=`${i}`),d!==null&&F!==null?v.style.fillOpacity=`${d+(F-d)*o}`:F!==null&&(v.style.fillOpacity=`${F}`),L&&v.tagName.toLowerCase()==="path"&&I[X]&&v.setAttribute("d",Ke(I[X],L,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=ne(0);return}$.forEach((o,a)=>{o.style.strokeDasharray=`${R[a]}`,o.style.strokeDashoffset=S==="reverse"?"0":`${R[a]}`,u?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),K!==null&&(o.style.strokeWidth=`${K}`),d!==null&&(o.style.fillOpacity=`${d}`),L&&o.tagName.toLowerCase()==="path"&&I[a]&&o.setAttribute("d",I[a]);});}if($.forEach(o=>{Ot(o);let a=Ye(o);R.push(a),o.tagName.toLowerCase()==="path"?I.push(o.getAttribute("d")??""):I.push(""),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=S==="reverse"?`${a}`:"0",u&&(o.style.opacity="1"),J&&(o.style.stroke=J),i!==null&&(o.style.strokeWidth=`${i}`),F!==null&&(o.style.fillOpacity=`${F}`),L&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",L)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=S==="reverse"?"0":`${a}`,u?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",pe&&(o.style.stroke=pe),K!==null&&(o.style.strokeWidth=`${K}`),d!==null&&(o.style.fillOpacity=`${d}`));}),be){if(s)return e.style.clipPath=ne(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=ne(0);}else if(s)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function xt(){return !(z===false||!Pt()||!$.length||typeof h!="string"||!(h in pt)||be||V!=="y"||te||c!==1||H!==0||Y||U||x!==false||L||g||O||Z>0||p||T||b||y||q||Ae||Me||E!=null||M!=null||C!=null||(P.start??"top bottom").trim()!=="top bottom"||(P.end??"bottom top").trim()!=="bottom top")}function Tt(){let o=`svg-scroll-draw-${++$t}`,a=S==="reverse"?"0":"var(--ssd-len)",v=S==="reverse"?"var(--ssd-len)":"0",X=`stroke-dashoffset:${a};`,fe=`stroke-dashoffset:${v};`;u&&(X+=`opacity:${S==="reverse"?1:0};`,fe+=`opacity:${S==="reverse"?0:1};`);let me=document.createElement("style");me.setAttribute("data-svg-scroll-draw",""),me.textContent=`@keyframes ${o}{from{${X}}to{${fe}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${pt[h]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(me);function ge(f,A){f.style.setProperty("--ssd-len",String(R[A])),f.style.strokeDasharray=`${R[A]}`,f.style.strokeDashoffset="",f.style.opacity="",f.style.animationPlayState="",f.classList.add(o);}$.forEach(ge);let w=false,N=-1;function D(){if(N>=0)return N;let f=e.getBoundingClientRect(),{tStart:A,tEnd:B}=ye({top:f.top,height:f.height},He(),it(),ke,qe);return we(Q(He(),A,B,c))}return {destroy(){$.forEach(f=>{f.classList.remove(o),f.style.removeProperty("--ssd-len"),f.style.animationPlayState="";}),me.remove();},replay(){w=false,N=-1,$.forEach(ge);},pause(){w=true,$.forEach(f=>{f.style.animationPlayState="paused";});},resume(){w&&(w=false,$.forEach(f=>{f.style.animationPlayState="running";}));},seek(f){let A=Math.min(1,Math.max(0,f));N=A,w=true,$.forEach((B,Ie)=>{B.classList.remove(o),B.style.strokeDashoffset=S==="reverse"?`${R[Ie]*A}`:`${R[Ie]*(1-A)}`,u&&(B.style.opacity=S==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return D()}}}if(xt())return Tt();function At(){let o=Math.max(1,j),a=0,v=0;function X(D){let f=true;if(be){let A=Math.min(1,Math.max(0,D/o)),B=we(A);Fe=B,e.style.setProperty("--scroll-draw-progress",String(B)),e.style.clipPath=ne(S==="reverse"?1-B:B),p?.(B),A<1&&(f=false);}else $.forEach((A,B)=>{let Ie=B*H*o,De=Math.min(1,Math.max(0,(D-Ie)/o)),Se=we(De);A.style.strokeDashoffset=S==="reverse"?`${R[B]*Se}`:`${R[B]*(1-Se)}`,u&&(A.style.opacity=S==="reverse"?`${1-Se}`:`${Se}`),pe&&J?A.style.stroke=Re(pe,J,Se):J&&(A.style.stroke=J),K!==null&&i!==null?A.style.strokeWidth=`${K+(i-K)*Se}`:i!==null&&(A.style.strokeWidth=`${i}`),d!==null&&F!==null?A.style.fillOpacity=`${d+(F-d)*Se}`:F!==null&&(A.style.fillOpacity=`${F}`),L&&A.tagName.toLowerCase()==="path"&&I[B]&&A.setAttribute("d",Ke(I[B],L,Se)),B===0&&(p?.(Se),e.style.setProperty("--scroll-draw-progress",String(Se))),De<1&&(f=false);});if(g){let A=Math.min(1,Math.max(0,D/o)),B=we(A);for(let Ie in g){let De=parseFloat(Ie);B>=De&&!$e.has(De)&&($e.add(De),g[Ie]?.());}}return f}function fe(D){if(ue)return;let f=D-a;de||(de=true,T?.());let A=X(f);if(A&&!re){re=true,X(o*(1+Math.max(0,$.length-1)*H)),b?.(),Ce<(O==="infinite"?1/0:O??0)&&(Ce++,Le=setTimeout(()=>{a=performance.now(),de=false,re=false,$e.clear(),Ge(),oe=requestAnimationFrame(fe);},se));return}A||(oe=requestAnimationFrame(fe));}function me(){cancelAnimationFrame(oe),clearTimeout(Le),a=performance.now(),v=0,ue=false,de=false,re=false,Ce=0,$e.clear(),Ge(),oe=requestAnimationFrame(fe);}let ge=new IntersectionObserver(D=>{D.forEach(f=>{f.isIntersecting&&!(Y&&re)?me():!f.isIntersecting&&!Y&&!re&&(cancelAnimationFrame(oe),clearTimeout(Le),a=null);});},{root:te??null,threshold:k,rootMargin:G}),w;function N(){clearTimeout(w),w=setTimeout(()=>{$.forEach((D,f)=>{R[f]=Ye(D),D.style.strokeDasharray=`${R[f]}`;});},150);}return window.addEventListener("resize",N),window.addEventListener("orientationchange",N),Z>0?setTimeout(()=>ge.observe(e),Z):ge.observe(e),{destroy(){cancelAnimationFrame(oe),clearTimeout(Le),ge.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N),clearTimeout(w);},replay(){Ce=0,me();},pause(){ue||(ue=true,v=performance.now()-a,cancelAnimationFrame(oe));},resume(){ue&&(ue=false,a=performance.now()-v,oe=requestAnimationFrame(fe));},seek(D){let f=Math.min(1,Math.max(0,D));Fe=f,ue=true,v=f*o,a=performance.now()-v,cancelAnimationFrame(oe),X(v);},getProgress(){return Fe}}}if(_)return At();at();function je(){if(!Be||ue)return;let o=performance.now(),a=He(),v=c;if(x!==false){let w=o-st,N=w>0?Math.abs(a-(_e<0?a:_e))/w:0;v=c*Math.max(.2,1+N*(typeof x=="number"?x:1)*.04);}_e=a,st=o;let X=U?We===-1||a>=We?"forward":"reverse":S;We=a;let fe=ce-ie,me=true,ge=fe===0?0:(a-ie)/fe;if(isNaN(Ne)||(Ne<=0&&ge>0?y?.():Ne>0&&ge<=0&&Me?.(),Ne<1&&ge>=1?q?.():Ne>=1&&ge<1&&Ae?.()),Ne=ge,be){let w=we(Q(a,ie,ce,v));Y&&!U&&(ve=Math.max(ve,w),w=ve),Fe=w,e.style.setProperty("--scroll-draw-progress",String(w));let N=X==="reverse"?1-w:w;e.style.clipPath=ne(N),p?.(w),!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),w>=1&&!re?(re=true,b?.(),Ce<(O==="infinite"?1/0:O??0)&&(Ce++,Le=setTimeout(()=>{ve=-1,de=false,re=false,e.style.clipPath=ne(0);},se))):w<1&&!Y&&(re=false),oe=requestAnimationFrame(je);return}if($.forEach((w,N)=>{let D=N*H*fe,f=we(Q(a,ie+D,ce+D,v));Y&&!U&&(ve=Math.max(ve,f),f=ve),Fe=f,w.style.strokeDashoffset=X==="reverse"?`${R[N]*f}`:`${R[N]*(1-f)}`,u&&(w.style.opacity=X==="reverse"?`${1-f}`:`${f}`),pe&&J?w.style.stroke=Re(pe,J,f):J&&(w.style.stroke=J),K!==null&&i!==null?w.style.strokeWidth=`${K+(i-K)*f}`:i!==null&&(w.style.strokeWidth=`${i}`),d!==null&&F!==null?w.style.fillOpacity=`${d+(F-d)*f}`:F!==null&&(w.style.fillOpacity=`${F}`),L&&w.tagName.toLowerCase()==="path"&&I[N]&&w.setAttribute("d",Ke(I[N],L,f)),N===0&&(p?.(f),e.style.setProperty("--scroll-draw-progress",String(f))),f<1&&(me=false);}),g){let w=we(Q(a,ie,ce,v));for(let N in g){let D=parseFloat(N);w>=D&&!$e.has(D)&&($e.add(D),g[N]?.());}}!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),me&&!re?(re=true,b?.(),Ce<(O==="infinite"?1/0:O??0)&&(Ce++,Le=setTimeout(()=>{ve=-1,de=false,re=false,$e.clear(),Ge();},se))):!me&&!Y&&(re=false),oe=requestAnimationFrame(je);}let Ze=new IntersectionObserver(o=>{o.forEach(a=>{Be=a.isIntersecting,Be&&!ue?oe=requestAnimationFrame(je):cancelAnimationFrame(oe);});},{root:te??null,threshold:k,rootMargin:G}),Je;function Xe(){clearTimeout(Je),Je=setTimeout(()=>{$.forEach((o,a)=>{R[a]=Ye(o),o.style.strokeDasharray=`${R[a]}`;}),at();},150);}return window.addEventListener("resize",Xe),window.addEventListener("orientationchange",Xe),Z>0?setTimeout(()=>Ze.observe(e),Z):Ze.observe(e),{destroy(){cancelAnimationFrame(oe),clearTimeout(Le),Ze.disconnect(),window.removeEventListener("resize",Xe),window.removeEventListener("orientationchange",Xe),clearTimeout(Je),Ue?.remove();},replay(){ve=-1,We=-1,_e=-1,de=false,re=false,Ce=0,ue=false,$e.clear(),clearTimeout(Le),Ge();},pause(){ue=true,cancelAnimationFrame(oe);},resume(){ue&&(ue=false,Be&&(oe=requestAnimationFrame(je)));},seek(o){let a=Math.min(1,Math.max(0,o));Fe=a,ve=a,ue=true,cancelAnimationFrame(oe),Et(a,S);},getProgress(){return Fe}}}var dt=new Map;function Pe(e,r){dt.set(e,r);}function Oe(e){dt.delete(e);}function Ft(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function gt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let l=[],s=[],m=t[2].trim();if(m)for(let c of m.split(/[\s,]+/)){let u=c.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(u?parseFloat(u[1]):0),s.push(u?u[2]:"");}r.push({fn:t[1],nums:l,units:s});}return r}function It(e,r,n){let t=gt(e),l=gt(r);return t.length===0||t.length!==l.length?n<1?e:r:t.map((s,m)=>{let c=l[m];return s.fn!==c.fn||s.nums.length!==c.nums.length?n<1?`${s.fn}(${s.nums.map((u,h)=>`${u}${s.units[h]}`).join(", ")})`:`${c.fn}(${c.nums.map((u,h)=>`${u}${c.units[h]}`).join(", ")})`:`${s.fn}(${s.nums.map((u,h)=>`${u+(c.nums[h]-u)*n}${s.units[h]}`).join(", ")})`}).join(" ")}function yt(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),l=String(r);if(Ft(t))return Re(t,l,n);if(t.includes("("))return It(t,l,n);let s=t.match(/^([-+]?[\d.]+)(.*)$/),m=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&m){let c=parseFloat(s[1]),u=parseFloat(m[1]);return `${c+(u-c)*n}${s[2]||m[2]}`}return n<1?t:l}function Nt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var ht={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"]),Rt=0;function Ht(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:l={},easing:s="ease-out",speed:m=1,once:c=false,axis:u="y",scrollContainer:h,native:P=true,velocityScale:H=false,onProgress:S,onComplete:Y,onEnter:he,onLeave:V,onEnterBack:ee,onLeaveBack:U}=r,Z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof s=="function"?s:ae[s]??ae["ease-out"],M=le(l.start??"top bottom"),C=le(l.end??"bottom top"),g=typeof h=="string"?document.querySelector(h):h??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 k(){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(),Y?.(),n;k();function O(){if(!P||!Ht()||typeof s!="string"||!(s in ht)||u!=="y"||g||c||m!==1||S||Y||he||V||ee||U||H!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of x)if(!Dt.has(i.prop))return false;return true}function se(){let i=`ssd-a-${++Rt}`,d=x.map(I=>`${I.prop}:${I.from}`).join(";"),F=x.map(I=>`${I.prop}:${I.to}`).join(";"),ne=document.createElement("style");ne.setAttribute("data-ssd-animate",""),ne.textContent=`@keyframes ${i}{from{${d}}to{${F}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ht[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ne),e.classList.add(i);let $=()=>u==="x"?window.scrollX:window.scrollY,R=()=>u==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),ne.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(I){let ie=Math.min(1,Math.max(0,I));e.classList.remove(i);for(let ce of x)e.style.setProperty(ce.prop,yt(ce.from,ce.to,ie));},getProgress(){let I=e.getBoundingClientRect(),ie=$(),ce=R(),{tStart:re,tEnd:de}=ye({top:I.top,height:I.height},ie,ce,M,C);return E(Q(ie,re,de,m))}}}if(O())return se();let L=0,W=0,_=0,j=false,z=false,p=-1,T=0,b=false,y=NaN,q=-1,Ae=0,Me=()=>g?u==="x"?g.scrollLeft:g.scrollTop:u==="x"?window.scrollX:window.scrollY,be=()=>g?u==="x"?g.clientWidth:g.clientHeight:u==="x"?window.innerWidth:window.innerHeight;function we(){let i=e.getBoundingClientRect(),d,F;if(g){let $=g.getBoundingClientRect();d=u==="x"?i.left-$.left+g.scrollLeft:i.top-$.top+g.scrollTop,F=u==="x"?i.width:i.height;}else d=u==="x"?i.left:i.top,F=u==="x"?i.width:i.height;let ne=ye({top:d,height:F},Me(),be(),M,C);L=ne.tStart,W=ne.tEnd;}function ke(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let d of x)e.style.setProperty(d.prop,yt(d.from,d.to,i));S?.(i);}function qe(i){if(isNaN(y)){y=i;return}y<=0&&i>0?he?.():y>0&&i<=0&&U?.(),y<1&&i>=1?V?.():y>=1&&i<1&&ee?.(),y=i;}function te(){if(!j||z)return;let i=performance.now(),d=Me(),F=m;if(H!==false){let R=i-Ae,I=R>0?Math.abs(d-(q<0?d:q))/R:0;F=m*Math.max(.2,1+I*(typeof H=="number"?H:1)*.04);}q=d,Ae=i;let ne=W===L?0:(d-L)/(W-L);qe(ne);let $=E(Q(d,L,W,F));c&&(p=Math.max(p,$),$=p),T=$,ke($),$>=1&&!b?(b=true,Y?.()):$<1&&!c&&(b=false),_=requestAnimationFrame(te);}we();{let i=E(Q(Me(),L,W,m));c&&i>0&&(p=i),T=i,ke(i);}let pe=new IntersectionObserver(i=>{i.forEach(d=>{j=d.isIntersecting,j&&!z?_=requestAnimationFrame(te):cancelAnimationFrame(_);});},{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:L,tEnd:W})}),{destroy(){cancelAnimationFrame(_),pe.disconnect(),window.removeEventListener("resize",K),window.removeEventListener("orientationchange",K),clearTimeout(J),Oe(e);},replay(){p=-1,b=false,T=0,z=false,ke(0);},pause(){z=true,cancelAnimationFrame(_);},resume(){z&&(z=false,j&&(_=requestAnimationFrame(te)));},seek(i){let d=Math.min(1,Math.max(0,i));T=d,p=d,z=true,cancelAnimationFrame(_),ke(d);},getProgress(){return T}}}var tt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,r){if(typeof window>"u")return tt;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),tt;let t=n,{from:l=0,to:s,format:m,easing:c="ease-out",trigger:u={},once:h=true,decimals:P,onComplete:H}=r,S=P!==void 0?p=>p.toFixed(P):m??(p=>String(Math.round(p))),Y=typeof c=="function"?c:ae[c]??ae["ease-out"],he=le(u.start??"top 80%"),V=le(u.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(s),H?.(),tt;t.textContent=S(l);let U=0,Z=0,E=0,M=false,C=false,g=-1,x=0,k=false,G=()=>window.scrollY,O=()=>window.innerHeight;function se(){let p=t.getBoundingClientRect(),T=ye({top:p.top,height:p.height},G(),O(),he,V);U=T.tStart,Z=T.tEnd;}function L(p){t.textContent=S(l+(s-l)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function W(){if(!M||C)return;let p=Y(Q(G(),U,Z,1));h&&(g=Math.max(g,p),p=g),x=p,L(p),p>=1&&!k?(k=true,H?.()):p<1&&!h&&(k=false),E=requestAnimationFrame(W);}se();{let p=Y(Q(G(),U,Z,1));h&&p>0&&(g=p),x=p,L(p);}let _=new IntersectionObserver(p=>{p.forEach(T=>{M=T.isIntersecting,M&&!C?E=requestAnimationFrame(W):cancelAnimationFrame(E);});}),j;function z(){clearTimeout(j),j=setTimeout(se,150);}return window.addEventListener("resize",z),window.addEventListener("orientationchange",z),_.observe(t),Pe(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:U,tEnd:Z})}),{destroy(){cancelAnimationFrame(E),_.disconnect(),window.removeEventListener("resize",z),window.removeEventListener("orientationchange",z),clearTimeout(j),Oe(t);},replay(){g=-1,k=false,x=0,C=false,L(0);},pause(){C=true,cancelAnimationFrame(E);},resume(){C&&(C=false,M&&(E=requestAnimationFrame(W)));},seek(p){let T=Math.min(1,Math.max(0,p));x=T,g=T,C=true,cancelAnimationFrame(E),L(T);},getProgress(){return x}}}var bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,r={}){if(typeof window>"u")return bt;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),bt;let t=n,{trigger:l={},easing:s="linear",once:m=false,axis:c="y",preload:u="auto",onReady:h,onComplete:P,onProgress:H}=r,S=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Y=typeof s=="function"?s:ae[s]??ae.linear,he=le(l.start??"top top"),V=le(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=u);let ee=r.from??0,U=r.to,Z=0,E=0,M=0,C=false,g=false,x=-1,k=0,G=false,O=false,se=()=>c==="x"?window.scrollX:window.scrollY,L=()=>c==="x"?window.innerWidth:window.innerHeight;function W(){let y=t.getBoundingClientRect(),q=c==="x"?y.left:y.top,Ae=c==="x"?y.width:y.height,Me=ye({top:q,height:Ae},se(),L(),he,V);Z=Me.tStart,E=Me.tEnd;}function _(y){if(!O)return;let q=U??t.duration??0;t.currentTime=ee+(q-ee)*y,t.style.setProperty("--scroll-draw-progress",String(y)),H?.(y);}function j(){if(!C||g||!O)return;let y=Y(Q(se(),Z,E,1));m&&(x=Math.max(x,y),y=x),k=y,_(y),y>=1&&!G?(G=true,P?.()):y<1&&!m&&(G=false),M=requestAnimationFrame(j);}function z(){if(O=true,U===void 0&&(U=t.duration),S){_(1),h?.();return}W(),h?.(),C&&!g&&(M=requestAnimationFrame(j));}t.readyState>=1?z():t.addEventListener("loadedmetadata",z,{once:true}),O||W();let p=new IntersectionObserver(y=>{y.forEach(q=>{C=q.isIntersecting,C&&!g&&O?M=requestAnimationFrame(j):cancelAnimationFrame(M);});}),T;function b(){clearTimeout(T),T=setTimeout(W,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),p.observe(t),Pe(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:Z,tEnd:E})}),{destroy(){cancelAnimationFrame(M),p.disconnect(),t.removeEventListener("loadedmetadata",z),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(T),Oe(t);},replay(){x=-1,G=false,k=0,g=false,_(0);},pause(){g=true,cancelAnimationFrame(M);},resume(){g&&(g=false,C&&O&&(M=requestAnimationFrame(j)));},seek(y){let q=Math.min(1,Math.max(0,y));k=q,x=q,g=true,cancelAnimationFrame(M),_(q);},getProgress(){return k}}}function St(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 Vt(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 wt(e){let r=St(e),n=new Map;for(let s of r){let m=s.offsetTop;n.has(m)||n.set(m,[]),n.get(m).push(s);}let t=[],l=Array.from(n.keys()).sort((s,m)=>s-m);for(let s of l){let m=n.get(s),c=document.createElement("span");c.setAttribute("aria-hidden","true"),c.style.display="inline-block";for(let u of m)c.appendChild(u);t.push(c);}e.textContent="";for(let s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function zt(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,s=r*t,m=s+(1-l);return m<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(m-s)))}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 vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ot(e,r={}){if(typeof window>"u")return vt;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),vt;let t=n,{split:l="words",stagger:s=.04,easing:m="ease-out",from:c={opacity:0,y:24},trigger:u={},once:h=true,onComplete:P}=r,H=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof m=="function"?m:ae[m]??ae["ease-out"],Y=le(u.start??"top 85%"),he=le(u.end??"top 40%"),V=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;l==="chars"?ee=Vt(t):l==="lines"?ee=wt(t):ee=St(t);let U=ee.length;function Z(b,y){c?.opacity!==void 0&&(b.style.opacity=String(c.opacity+(1-c.opacity)*y));let q=qt(y,c);q&&(b.style.transform=q);}function E(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach((y,q)=>{let Ae=S(zt(b,q,U,s));Z(y,Ae);});}if(H)return E(1),P?.(),{destroy(){t.innerHTML=V,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};E(0);let M=0,C=0,g=0,x=false,k=false,G=-1,O=0,se=false,L=()=>window.scrollY,W=()=>window.innerHeight;function _(){let b=t.getBoundingClientRect(),y=ye({top:b.top,height:b.height},L(),W(),Y,he);M=y.tStart,C=y.tEnd;}function j(){if(!x||k)return;let b=Q(L(),M,C,1);h&&(G=Math.max(G,b),b=G),O=b,E(b),b>=1&&!se?(se=true,P?.()):b<1&&!h&&(se=false),g=requestAnimationFrame(j);}_();let z=new IntersectionObserver(b=>{b.forEach(y=>{x=y.isIntersecting,x&&!k?g=requestAnimationFrame(j):cancelAnimationFrame(g);});}),p;function T(){clearTimeout(p),p=setTimeout(()=>{if(l==="lines"){let b=O;t.innerHTML=V,t.setAttribute("aria-label",t.textContent??""),ee=wt(t),E(b);}_();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),z.observe(t),Pe(t,{type:"text",getProgress:()=>O,getTrigger:()=>({tStart:M,tEnd:C})}),{destroy(){cancelAnimationFrame(g),z.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(p),t.innerHTML=V,t.removeAttribute("aria-label"),Oe(t);},replay(){G=-1,se=false,O=0,k=false,E(0);},pause(){k=true,cancelAnimationFrame(g);},resume(){k&&(k=false,x&&(g=requestAnimationFrame(j)));},seek(b){let y=Math.min(1,Math.max(0,b));O=y,G=y,k=true,cancelAnimationFrame(g),E(y);},getProgress(){return O}}}function pn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=Qe(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var dn=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=Qe(n.value,t);vue.onUnmounted(()=>l.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function gn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=et(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var yn=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=et(n.value,e.options);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function hn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=nt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var bn=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n={to:e.to};e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete);let t=nt(r.value,n);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("span",{ref:r})}});function wn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=rt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var vn=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=rt(r.value,e.options??{});vue.onUnmounted(()=>n.destroy());}),()=>vue.h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Sn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=ot(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var En=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=ot(n.value,e.options??{});vue.onUnmounted(()=>t.destroy());}),()=>vue.h(e.tag,{ref:n},r.default?.())}});exports.ScrollAnimate=yn;exports.ScrollCounter=bn;exports.ScrollDraw=dn;exports.ScrollText=En;exports.ScrollVideo=vn;exports.useScrollAnimate=gn;exports.useScrollCounter=hn;exports.useScrollDraw=pn;exports.useScrollText=Sn;exports.useScrollVideo=wn;
@@ -73,6 +73,14 @@ interface ScrollDrawOptions {
73
73
  onProgress?: (alpha: number) => void;
74
74
  onStart?: () => void;
75
75
  onComplete?: () => void;
76
+ /** Fires when scroll position enters the trigger zone (scrolling forward). */
77
+ onEnter?: () => void;
78
+ /** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
79
+ onLeave?: () => void;
80
+ /** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
81
+ onEnterBack?: () => void;
82
+ /** Fires when scroll position exits the trigger zone at the start (scrolling back). */
83
+ onLeaveBack?: () => void;
76
84
  /**
77
85
  * Trigger the animation when the element enters the viewport instead of
78
86
  * tying it to scroll position. The draw runs over `duration` milliseconds,
@@ -117,8 +125,22 @@ interface ScrollAnimateOptions {
117
125
  axis?: 'x' | 'y';
118
126
  scrollContainer?: string | Element;
119
127
  native?: boolean;
128
+ /**
129
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
130
+ * Pass `true` for default sensitivity (1) or a number to control it.
131
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
132
+ */
133
+ velocityScale?: boolean | number;
120
134
  onProgress?: (alpha: number) => void;
121
135
  onComplete?: () => void;
136
+ /** Fires when scroll enters the trigger zone (scrolling forward). */
137
+ onEnter?: () => void;
138
+ /** Fires when scroll exits the trigger zone at the end (scrolling forward). */
139
+ onLeave?: () => void;
140
+ /** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
141
+ onEnterBack?: () => void;
142
+ /** Fires when scroll exits the trigger zone at the start (scrolling back). */
143
+ onLeaveBack?: () => void;
122
144
  }
123
145
 
124
146
  interface ScrollCounterOptions {
@@ -73,6 +73,14 @@ interface ScrollDrawOptions {
73
73
  onProgress?: (alpha: number) => void;
74
74
  onStart?: () => void;
75
75
  onComplete?: () => void;
76
+ /** Fires when scroll position enters the trigger zone (scrolling forward). */
77
+ onEnter?: () => void;
78
+ /** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
79
+ onLeave?: () => void;
80
+ /** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
81
+ onEnterBack?: () => void;
82
+ /** Fires when scroll position exits the trigger zone at the start (scrolling back). */
83
+ onLeaveBack?: () => void;
76
84
  /**
77
85
  * Trigger the animation when the element enters the viewport instead of
78
86
  * tying it to scroll position. The draw runs over `duration` milliseconds,
@@ -117,8 +125,22 @@ interface ScrollAnimateOptions {
117
125
  axis?: 'x' | 'y';
118
126
  scrollContainer?: string | Element;
119
127
  native?: boolean;
128
+ /**
129
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
130
+ * Pass `true` for default sensitivity (1) or a number to control it.
131
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
132
+ */
133
+ velocityScale?: boolean | number;
120
134
  onProgress?: (alpha: number) => void;
121
135
  onComplete?: () => void;
136
+ /** Fires when scroll enters the trigger zone (scrolling forward). */
137
+ onEnter?: () => void;
138
+ /** Fires when scroll exits the trigger zone at the end (scrolling forward). */
139
+ onLeave?: () => void;
140
+ /** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
141
+ onEnterBack?: () => void;
142
+ /** Fires when scroll exits the trigger zone at the start (scrolling back). */
143
+ onLeaveBack?: () => void;
122
144
  }
123
145
 
124
146
  interface ScrollCounterOptions {