svg-scroll-draw 2.7.0 → 2.10.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 (76) hide show
  1. package/dist/angular/index.cjs +3 -3
  2. package/dist/angular/index.d.mts +48 -0
  3. package/dist/angular/index.d.ts +48 -0
  4. package/dist/angular/index.mjs +3 -3
  5. package/dist/astro/index.cjs +3 -3
  6. package/dist/astro/index.d.mts +20 -5
  7. package/dist/astro/index.d.ts +20 -5
  8. package/dist/astro/index.mjs +3 -3
  9. package/dist/cdn/svg-scroll-draw.dev.global.js +1878 -0
  10. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  11. package/dist/cinematic/index.cjs +2 -2
  12. package/dist/cinematic/index.mjs +2 -2
  13. package/dist/cli/init.js +104 -101
  14. package/dist/devtools/index.cjs +1 -1
  15. package/dist/devtools/index.mjs +1 -1
  16. package/dist/group/index.cjs +3 -3
  17. package/dist/group/index.d.mts +48 -0
  18. package/dist/group/index.d.ts +48 -0
  19. package/dist/group/index.mjs +3 -3
  20. package/dist/horizontal/index.cjs +1 -0
  21. package/dist/horizontal/index.d.mts +108 -0
  22. package/dist/horizontal/index.d.ts +108 -0
  23. package/dist/horizontal/index.mjs +1 -0
  24. package/dist/index.cjs +4 -4
  25. package/dist/index.d.mts +48 -0
  26. package/dist/index.d.ts +48 -0
  27. package/dist/index.mjs +4 -4
  28. package/dist/nuxt/index.cjs +3 -3
  29. package/dist/nuxt/index.d.mts +33 -0
  30. package/dist/nuxt/index.d.ts +33 -0
  31. package/dist/nuxt/index.mjs +3 -3
  32. package/dist/pin/index.cjs +1 -1
  33. package/dist/pin/index.mjs +1 -1
  34. package/dist/progress/index.cjs +1 -0
  35. package/dist/progress/index.d.mts +74 -0
  36. package/dist/progress/index.d.ts +74 -0
  37. package/dist/progress/index.mjs +1 -0
  38. package/dist/react/index.cjs +3 -3
  39. package/dist/react/index.d.mts +33 -0
  40. package/dist/react/index.d.ts +33 -0
  41. package/dist/react/index.mjs +3 -3
  42. package/dist/reveal/index.cjs +1 -0
  43. package/dist/reveal/index.d.mts +80 -0
  44. package/dist/reveal/index.d.ts +80 -0
  45. package/dist/reveal/index.mjs +1 -0
  46. package/dist/snap/index.cjs +1 -1
  47. package/dist/snap/index.d.mts +8 -0
  48. package/dist/snap/index.d.ts +8 -0
  49. package/dist/snap/index.mjs +1 -1
  50. package/dist/solid/index.cjs +3 -3
  51. package/dist/solid/index.d.mts +48 -0
  52. package/dist/solid/index.d.ts +48 -0
  53. package/dist/solid/index.mjs +3 -3
  54. package/dist/svelte/index.cjs +3 -3
  55. package/dist/svelte/index.d.mts +48 -0
  56. package/dist/svelte/index.d.ts +48 -0
  57. package/dist/svelte/index.mjs +3 -3
  58. package/dist/text/index.cjs +1 -1
  59. package/dist/text/index.d.mts +15 -0
  60. package/dist/text/index.d.ts +15 -0
  61. package/dist/text/index.mjs +1 -1
  62. package/dist/timeline/index.cjs +8 -8
  63. package/dist/timeline/index.d.mts +31 -0
  64. package/dist/timeline/index.d.ts +31 -0
  65. package/dist/timeline/index.mjs +8 -8
  66. package/dist/video/index.cjs +1 -1
  67. package/dist/video/index.d.mts +15 -0
  68. package/dist/video/index.d.ts +15 -0
  69. package/dist/video/index.mjs +1 -1
  70. package/dist/vue/index.cjs +3 -3
  71. package/dist/vue/index.d.mts +33 -0
  72. package/dist/vue/index.d.ts +33 -0
  73. package/dist/vue/index.mjs +3 -3
  74. package/dist/web-component/index.cjs +3 -3
  75. package/dist/web-component/index.mjs +3 -3
  76. package/package.json +37 -5
@@ -1,3 +1,3 @@
1
- 'use strict';function ot({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),m=Math.sqrt(t),s=0,f=[];for(let g=0;g<r;g++){let A=Math.pow(m,g);f.push(A),s+=A;}let p=[0],c=0;for(let g=0;g<r;g++)c+=f[g]/s,p.push(c);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let A=0;A<r;A++)if(g<=p[A+1]){let _=(g-p[A])/(p[A+1]-p[A]);if(A===0)return _*(2-_);let v=1-Math.pow(t,A);return v+(1-v)*(2*_-1)*(2*_-1)}return 1}}function st({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),m=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-m)*(2*Math.PI)/t)+1}var ae={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:ot(),elastic:st()};function me(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function tt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function rt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function We(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function vt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:vt((e-n)/(r-n)*t,0,1)}function be(e,n,r,t,m){let s=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),f=tt(e.top,e.height,n,m.element)-rt(m.viewport,r);return {tStart:s,tEnd:f}}function nt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function Oe(e,n,r){let t=nt(e),m=nt(n);return !t||!m?e:`rgb(${Math.round(t[0]+(m[0]-t[0])*r)},${Math.round(t[1]+(m[1]-t[1])*r)},${Math.round(t[2]+(m[2]-t[2])*r)})`}var Xe={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};function it(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var at={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Et=0;function xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Tt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?it("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&it("Element has a fill \u2014 it may obscure the stroke animation.",e);}function At(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function m(){let s=r==="x"?window.scrollX:window.scrollY,f=e-s,p=n-s,c=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${c?`left:${p}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${p}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",m,{passive:true}),m(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),m=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let f=parseFloat(s),p=t[m++]??f;return String(+(f+(p-f)*r).toFixed(4))})}function _e(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,m=r?{...Xe[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:p=1,fade:c=false,easing:g="linear",trigger:A={},stagger:_=0,direction:v="forward",once:Q=false,debug:ve=false,axis:I="y",scrollContainer:te,autoReverse:ie=false,delay:J=0,strokeColor:x,strokeWidth:N,fillOpacity:b,waypoints:S,velocityScale:q=false,threshold:G=0,rootMargin:re="0px",repeat:z=0,repeatDelay:F=0,morphTo:T,clip:j,autoplay:le=false,duration:Y=1e3,native:U=true,onProgress:d,onStart:M,onComplete:y,onEnter:k,onLeave:we,onEnterBack:Ae,onLeaveBack:Me}=m,ge=j===true?"left":typeof j=="string"?j:false,pe=typeof g=="function"?g:ae[g]??ae.linear,Ne=me(A.start??"top bottom"),Le=me(A.end??"bottom top"),V=typeof te=="string"?document.querySelector(te):te??null,i=Array.isArray(x)?x[0]:null,u=Array.isArray(x)?x[1]:typeof x=="string"?x:null,H=Array.isArray(N)?N[0]:null,P=Array.isArray(N)?N[1]:typeof N=="number"?N:null,B=Array.isArray(b)?b[0]:null,Z=Array.isArray(b)?b[1]:typeof b=="number"?b:null;function W(o){let a=o*100;switch(ge){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let D=ge?[]:Array.from(e.querySelectorAll(f)),C=[],ce=[],fe=0,Ee=0,ee=false,de=false,X=0,He=false,ye=-1,Re=-1,ne=false,Ce=0,Se=0,xe,Ge=null,Te=new Set,qe=-1,Ke=performance.now(),Pe=NaN;function Fe(){return V?I==="x"?V.scrollLeft:V.scrollTop:I==="x"?window.scrollX:window.scrollY}function Qe(){return V?I==="x"?V.clientWidth:V.clientHeight:I==="x"?window.innerWidth:window.innerHeight}function et(){let o=e.getBoundingClientRect(),a,w,R;if(V){let se=V.getBoundingClientRect();a=I==="x"?o.left-se.left+V.scrollLeft:o.top-se.top+V.scrollTop,w=I==="x"?o.width:o.height,R=Fe();}else a=I==="x"?o.left:o.top,w=I==="x"?o.width:o.height,R=Fe();let oe=be({top:a,height:w},R,Qe(),Ne,Le);fe=oe.tStart,Ee=oe.tEnd,ve&&process.env.NODE_ENV!=="production"&&(Ge?.remove(),Ge=At(fe,Ee,I));}function ht(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ge){let w=a==="reverse"?1-o:o;e.style.clipPath=W(w);return}D.forEach((w,R)=>{w.style.strokeDashoffset=a==="reverse"?`${C[R]*o}`:`${C[R]*(1-o)}`,c&&(w.style.opacity=a==="reverse"?`${1-o}`:`${o}`),i&&u?w.style.stroke=Oe(i,u,o):u&&(w.style.stroke=u),H!==null&&P!==null?w.style.strokeWidth=`${H+(P-H)*o}`:P!==null&&(w.style.strokeWidth=`${P}`),B!==null&&Z!==null?w.style.fillOpacity=`${B+(Z-B)*o}`:Z!==null&&(w.style.fillOpacity=`${Z}`),T&&w.tagName.toLowerCase()==="path"&&ce[R]&&w.setAttribute("d",Je(ce[R],T,o));});}function ze(){if(e.style.setProperty("--scroll-draw-progress","0"),ge){e.style.clipPath=W(0);return}D.forEach((o,a)=>{o.style.strokeDasharray=`${C[a]}`,o.style.strokeDashoffset=v==="reverse"?"0":`${C[a]}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",i&&(o.style.stroke=i),H!==null&&(o.style.strokeWidth=`${H}`),B!==null&&(o.style.fillOpacity=`${B}`),T&&o.tagName.toLowerCase()==="path"&&ce[a]&&o.setAttribute("d",ce[a]);});}if(D.forEach(o=>{Tt(o);let a=We(o);C.push(a),o.tagName.toLowerCase()==="path"?ce.push(o.getAttribute("d")??""):ce.push(""),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=v==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),u&&(o.style.stroke=u),P!==null&&(o.style.strokeWidth=`${P}`),Z!==null&&(o.style.fillOpacity=`${Z}`),T&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",T)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=v==="reverse"?"0":`${a}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",i&&(o.style.stroke=i),H!==null&&(o.style.strokeWidth=`${H}`),B!==null&&(o.style.fillOpacity=`${B}`));}),ge){if(s)return e.style.clipPath=W(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=W(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(U===false||!xt()||!D.length||typeof g!="string"||!(g in at)||ge||I!=="y"||V||p!==1||_!==0||Q||ie||q!==false||T||S||z||J>0||d||M||y||k||we||Ae||Me||x!=null||N!=null||b!=null||(A.start??"top bottom").trim()!=="top bottom"||(A.end??"bottom top").trim()!=="bottom top")}function wt(){let o=`svg-scroll-draw-${++Et}`,a=v==="reverse"?"0":"var(--ssd-len)",w=v==="reverse"?"var(--ssd-len)":"0",R=`stroke-dashoffset:${a};`,oe=`stroke-dashoffset:${w};`;c&&(R+=`opacity:${v==="reverse"?1:0};`,oe+=`opacity:${v==="reverse"?0:1};`);let se=document.createElement("style");se.setAttribute("data-svg-scroll-draw",""),se.textContent=`@keyframes ${o}{from{${R}}to{${oe}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${at[g]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(se);function ue(l,E){l.style.setProperty("--ssd-len",String(C[E])),l.style.strokeDasharray=`${C[E]}`,l.style.strokeDashoffset="",l.style.opacity="",l.style.animationPlayState="",l.classList.add(o);}D.forEach(ue);let h=false,$=-1;function L(){if($>=0)return $;let l=e.getBoundingClientRect(),{tStart:E,tEnd:O}=be({top:l.top,height:l.height},Fe(),Qe(),Ne,Le);return pe(K(Fe(),E,O,p))}return {destroy(){D.forEach(l=>{l.classList.remove(o),l.style.removeProperty("--ssd-len"),l.style.animationPlayState="";}),se.remove();},replay(){h=false,$=-1,D.forEach(ue);},pause(){h=true,D.forEach(l=>{l.style.animationPlayState="paused";});},resume(){h&&(h=false,D.forEach(l=>{l.style.animationPlayState="running";}));},seek(l){let E=Math.min(1,Math.max(0,l));$=E,h=true,D.forEach((O,$e)=>{O.classList.remove(o),O.style.strokeDashoffset=v==="reverse"?`${C[$e]*E}`:`${C[$e]*(1-E)}`,c&&(O.style.opacity=v==="reverse"?`${1-E}`:`${E}`);});},getProgress(){return L()}}}if(bt())return wt();function St(){let o=Math.max(1,Y),a=0,w=0;function R(L){let l=true;if(ge){let E=Math.min(1,Math.max(0,L/o)),O=pe(E);Ce=O,e.style.setProperty("--scroll-draw-progress",String(O)),e.style.clipPath=W(v==="reverse"?1-O:O),d?.(O),E<1&&(l=false);}else D.forEach((E,O)=>{let $e=O*_*o,ke=Math.min(1,Math.max(0,(L-$e)/o)),he=pe(ke);E.style.strokeDashoffset=v==="reverse"?`${C[O]*he}`:`${C[O]*(1-he)}`,c&&(E.style.opacity=v==="reverse"?`${1-he}`:`${he}`),i&&u?E.style.stroke=Oe(i,u,he):u&&(E.style.stroke=u),H!==null&&P!==null?E.style.strokeWidth=`${H+(P-H)*he}`:P!==null&&(E.style.strokeWidth=`${P}`),B!==null&&Z!==null?E.style.fillOpacity=`${B+(Z-B)*he}`:Z!==null&&(E.style.fillOpacity=`${Z}`),T&&E.tagName.toLowerCase()==="path"&&ce[O]&&E.setAttribute("d",Je(ce[O],T,he)),O===0&&(d?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),ke<1&&(l=false);});if(S){let E=Math.min(1,Math.max(0,L/o)),O=pe(E);for(let $e in S){let ke=parseFloat($e);O>=ke&&!Te.has(ke)&&(Te.add(ke),S[$e]?.());}}return l}function oe(L){if(ne)return;let l=L-a;de||(de=true,M?.());let E=R(l);if(E&&!ee){ee=true,R(o*(1+Math.max(0,D.length-1)*_)),y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{a=performance.now(),de=false,ee=false,Te.clear(),ze(),X=requestAnimationFrame(oe);},F));return}E||(X=requestAnimationFrame(oe));}function se(){cancelAnimationFrame(X),clearTimeout(xe),a=performance.now(),w=0,ne=false,de=false,ee=false,Se=0,Te.clear(),ze(),X=requestAnimationFrame(oe);}let ue=new IntersectionObserver(L=>{L.forEach(l=>{l.isIntersecting&&!(Q&&ee)?se():!l.isIntersecting&&!Q&&!ee&&(cancelAnimationFrame(X),clearTimeout(xe),a=null);});},{root:V??null,threshold:G,rootMargin:re}),h;function $(){clearTimeout(h),h=setTimeout(()=>{D.forEach((L,l)=>{C[l]=We(L),L.style.strokeDasharray=`${C[l]}`;});},150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),J>0?setTimeout(()=>ue.observe(e),J):ue.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),ue.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(h);},replay(){Se=0,se();},pause(){ne||(ne=true,w=performance.now()-a,cancelAnimationFrame(X));},resume(){ne&&(ne=false,a=performance.now()-w,X=requestAnimationFrame(oe));},seek(L){let l=Math.min(1,Math.max(0,L));Ce=l,ne=true,w=l*o,a=performance.now()-w,cancelAnimationFrame(X),R(w);},getProgress(){return Ce}}}if(le)return St();et();function Ve(){if(!He||ne)return;let o=performance.now(),a=Fe(),w=p;if(q!==false){let h=o-Ke,$=h>0?Math.abs(a-(qe<0?a:qe))/h:0;w=p*Math.max(.2,1+$*(typeof q=="number"?q:1)*.04);}qe=a,Ke=o;let R=ie?Re===-1||a>=Re?"forward":"reverse":v;Re=a;let oe=Ee-fe,se=true,ue=oe===0?0:(a-fe)/oe;if(isNaN(Pe)||(Pe<=0&&ue>0?k?.():Pe>0&&ue<=0&&Me?.(),Pe<1&&ue>=1?we?.():Pe>=1&&ue<1&&Ae?.()),Pe=ue,ge){let h=pe(K(a,fe,Ee,w));Q&&!ie&&(ye=Math.max(ye,h),h=ye),Ce=h,e.style.setProperty("--scroll-draw-progress",String(h));let $=R==="reverse"?1-h:h;e.style.clipPath=W($),d?.(h),!de&&K(a,fe,Ee,w)>0&&(de=true,M?.()),h>=1&&!ee?(ee=true,y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{ye=-1,de=false,ee=false,e.style.clipPath=W(0);},F))):h<1&&!Q&&(ee=false),X=requestAnimationFrame(Ve);return}if(D.forEach((h,$)=>{let L=$*_*oe,l=pe(K(a,fe+L,Ee+L,w));Q&&!ie&&(ye=Math.max(ye,l),l=ye),Ce=l,h.style.strokeDashoffset=R==="reverse"?`${C[$]*l}`:`${C[$]*(1-l)}`,c&&(h.style.opacity=R==="reverse"?`${1-l}`:`${l}`),i&&u?h.style.stroke=Oe(i,u,l):u&&(h.style.stroke=u),H!==null&&P!==null?h.style.strokeWidth=`${H+(P-H)*l}`:P!==null&&(h.style.strokeWidth=`${P}`),B!==null&&Z!==null?h.style.fillOpacity=`${B+(Z-B)*l}`:Z!==null&&(h.style.fillOpacity=`${Z}`),T&&h.tagName.toLowerCase()==="path"&&ce[$]&&h.setAttribute("d",Je(ce[$],T,l)),$===0&&(d?.(l),e.style.setProperty("--scroll-draw-progress",String(l))),l<1&&(se=false);}),S){let h=pe(K(a,fe,Ee,w));for(let $ in S){let L=parseFloat($);h>=L&&!Te.has(L)&&(Te.add(L),S[$]?.());}}!de&&K(a,fe,Ee,w)>0&&(de=true,M?.()),se&&!ee?(ee=true,y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{ye=-1,de=false,ee=false,Te.clear(),ze();},F))):!se&&!Q&&(ee=false),X=requestAnimationFrame(Ve);}let je=new IntersectionObserver(o=>{o.forEach(a=>{He=a.isIntersecting,He&&!ne?X=requestAnimationFrame(Ve):cancelAnimationFrame(X);});},{root:V??null,threshold:G,rootMargin:re}),Ye;function Be(){clearTimeout(Ye),Ye=setTimeout(()=>{D.forEach((o,a)=>{C[a]=We(o),o.style.strokeDasharray=`${C[a]}`;}),et();},150);}return window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be),J>0?setTimeout(()=>je.observe(e),J):je.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),je.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ye),Ge?.remove();},replay(){ye=-1,Re=-1,qe=-1,de=false,ee=false,Se=0,ne=false,Te.clear(),clearTimeout(xe),ze();},pause(){ne=true,cancelAnimationFrame(X);},resume(){ne&&(ne=false,He&&(X=requestAnimationFrame(Ve)));},seek(o){let a=Math.min(1,Math.max(0,o));Ce=a,ye=a,ne=true,cancelAnimationFrame(X),ht(a,v);},getProgress(){return Ce}}}var lt=new Map;function De(e,n){lt.set(e,n);}function Ie(e){lt.delete(e);}function Mt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ct(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let m=[],s=[],f=t[2].trim();if(f)for(let p of f.split(/[\s,]+/)){let c=p.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}n.push({fn:t[1],nums:m,units:s});}return n}function Ct(e,n,r){let t=ct(e),m=ct(n);return t.length===0||t.length!==m.length?r<1?e:n:t.map((s,f)=>{let p=m[f];return s.fn!==p.fn||s.nums.length!==p.nums.length?r<1?`${s.fn}(${s.nums.map((c,g)=>`${c}${s.units[g]}`).join(", ")})`:`${p.fn}(${p.nums.map((c,g)=>`${c}${p.units[g]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,g)=>`${c+(p.nums[g]-c)*r}${s.units[g]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),m=String(n);if(Mt(t))return Oe(t,m,r);if(t.includes("("))return Ct(t,m,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),f=m.match(/^([-+]?[\d.]+)(.*)$/);if(s&&f){let p=parseFloat(s[1]),c=parseFloat(f[1]);return `${p+(c-p)*r}${s[2]||f[2]}`}return r<1?t:m}function $t(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var mt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Pt=0;function kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function pt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:m={},easing:s="ease-out",speed:f=1,once:p=false,axis:c="y",scrollContainer:g,native:A=true,onProgress:_,onComplete:v,onEnter:Q,onLeave:ve,onEnterBack:I,onLeaveBack:te}=n,ie=window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=typeof s=="function"?s:ae[s]??ae["ease-out"],x=me(m.start??"top bottom"),N=me(m.end??"bottom top"),b=typeof g=="string"?document.querySelector(g):g??null,S=Object.entries(t).map(([i,u])=>({prop:$t(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function q(){let i=window.getComputedStyle(e);for(let u of S)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function G(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}if(ie)return G(),v?.(),r;q();function re(){if(!A||!kt()||typeof s!="string"||!(s in mt)||c!=="y"||b||p||f!==1||_||v||Q||ve||I||te||(m.start??"top bottom").trim()!=="top bottom"||(m.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!Lt.has(i.prop))return false;return true}function z(){let i=`ssd-a-${++Pt}`,u=S.map(W=>`${W.prop}:${W.from}`).join(";"),H=S.map(W=>`${W.prop}:${W.to}`).join(";"),P=document.createElement("style");P.setAttribute("data-ssd-animate",""),P.textContent=`@keyframes ${i}{from{${u}}to{${H}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${mt[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(P),e.classList.add(i);let B=()=>c==="x"?window.scrollX:window.scrollY,Z=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),P.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(W){let D=Math.min(1,Math.max(0,W));e.classList.remove(i);for(let C of S)e.style.setProperty(C.prop,ut(C.from,C.to,D));},getProgress(){let W=e.getBoundingClientRect(),D=B(),C=Z(),{tStart:ce,tEnd:fe}=be({top:W.top,height:W.height},D,C,x,N);return J(K(D,ce,fe,f))}}}if(re())return z();let F=0,T=0,j=0,le=false,Y=false,U=-1,d=0,M=false,y=NaN,k=()=>b?c==="x"?b.scrollLeft:b.scrollTop:c==="x"?window.scrollX:window.scrollY,we=()=>b?c==="x"?b.clientWidth:b.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function Ae(){let i=e.getBoundingClientRect(),u,H;if(b){let B=b.getBoundingClientRect();u=c==="x"?i.left-B.left+b.scrollLeft:i.top-B.top+b.scrollTop,H=c==="x"?i.width:i.height;}else u=c==="x"?i.left:i.top,H=c==="x"?i.width:i.height;let P=be({top:u,height:H},k(),we(),x,N);F=P.tStart,T=P.tEnd;}function Me(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let u of S)e.style.setProperty(u.prop,ut(u.from,u.to,i));_?.(i);}function ge(i){if(isNaN(y)){y=i;return}y<=0&&i>0?Q?.():y>0&&i<=0&&te?.(),y<1&&i>=1?ve?.():y>=1&&i<1&&I?.(),y=i;}function pe(){if(!le||Y)return;let i=T===F?0:(k()-F)/(T-F);ge(i);let u=J(K(k(),F,T,f));p&&(U=Math.max(U,u),u=U),d=u,Me(u),u>=1&&!M?(M=true,v?.()):u<1&&!p&&(M=false),j=requestAnimationFrame(pe);}Ae();{let i=J(K(k(),F,T,f));p&&i>0&&(U=i),d=i,Me(i);}let Ne=new IntersectionObserver(i=>{i.forEach(u=>{le=u.isIntersecting,le&&!Y?j=requestAnimationFrame(pe):cancelAnimationFrame(j);});},{root:b??null}),Le;function V(){clearTimeout(Le),Le=setTimeout(Ae,150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),Ne.observe(e),De(e,{type:"animate",getProgress:()=>d,getTrigger:()=>({tStart:F,tEnd:T})}),{destroy(){cancelAnimationFrame(j),Ne.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(Le),Ie(e);},replay(){U=-1,M=false,d=0,Y=false,Me(0);},pause(){Y=true,cancelAnimationFrame(j);},resume(){Y&&(Y=false,le&&(j=requestAnimationFrame(pe)));},seek(i){let u=Math.min(1,Math.max(0,i));d=u,U=u,Y=true,cancelAnimationFrame(j),Me(u);},getProgress(){return d}}}var Ue={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ze(e,n){if(typeof window>"u")return Ue;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),Ue;let t=r,{from:m=0,to:s,format:f,easing:p="ease-out",trigger:c={},once:g=true,decimals:A,onComplete:_}=n,v=A!==void 0?d=>d.toFixed(A):f??(d=>String(Math.round(d))),Q=typeof p=="function"?p:ae[p]??ae["ease-out"],ve=me(c.start??"top 80%"),I=me(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=v(s),_?.(),Ue;t.textContent=v(m);let ie=0,J=0,x=0,N=false,b=false,S=-1,q=0,G=false,re=()=>window.scrollY,z=()=>window.innerHeight;function F(){let d=t.getBoundingClientRect(),M=be({top:d.top,height:d.height},re(),z(),ve,I);ie=M.tStart,J=M.tEnd;}function T(d){t.textContent=v(m+(s-m)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function j(){if(!N||b)return;let d=Q(K(re(),ie,J,1));g&&(S=Math.max(S,d),d=S),q=d,T(d),d>=1&&!G?(G=true,_?.()):d<1&&!g&&(G=false),x=requestAnimationFrame(j);}F();{let d=Q(K(re(),ie,J,1));g&&d>0&&(S=d),q=d,T(d);}let le=new IntersectionObserver(d=>{d.forEach(M=>{N=M.isIntersecting,N&&!b?x=requestAnimationFrame(j):cancelAnimationFrame(x);});}),Y;function U(){clearTimeout(Y),Y=setTimeout(F,150);}return window.addEventListener("resize",U),window.addEventListener("orientationchange",U),le.observe(t),De(t,{type:"counter",getProgress:()=>q,getTrigger:()=>({tStart:ie,tEnd:J})}),{destroy(){cancelAnimationFrame(x),le.disconnect(),window.removeEventListener("resize",U),window.removeEventListener("orientationchange",U),clearTimeout(Y),Ie(t);},replay(){S=-1,G=false,q=0,b=false,T(0);},pause(){b=true,cancelAnimationFrame(x);},resume(){b&&(b=false,N&&(x=requestAnimationFrame(j)));},seek(d){let M=Math.min(1,Math.max(0,d));q=M,S=M,b=true,cancelAnimationFrame(x),T(M);},getProgress(){return q}}}function gt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function Ot(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function ft(e){let n=gt(e),r=new Map;for(let s of n){let f=s.offsetTop;r.has(f)||r.set(f,[]),r.get(f).push(s);}let t=[],m=Array.from(r.keys()).sort((s,f)=>s-f);for(let s of m){let f=r.get(s),p=document.createElement("span");p.setAttribute("aria-hidden","true"),p.style.display="inline-block";for(let c of f)p.appendChild(c);t.push(p);}e.textContent="";for(let s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function Dt(e,n,r,t){if(r<=1||t===0)return e;let m=(r-1)*t,s=n*t,f=s+(1-m);return f<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(f-s)))}function It(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=r,{split:m="words",stagger:s=.04,easing:f="ease-out",from:p={opacity:0,y:24},trigger:c={},once:g=true,onComplete:A}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,v=typeof f=="function"?f:ae[f]??ae["ease-out"],Q=me(c.start??"top 85%"),ve=me(c.end??"top 40%"),I=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let te;m==="chars"?te=Ot(t):m==="lines"?te=ft(t):te=gt(t);let ie=te.length;function J(y,k){p?.opacity!==void 0&&(y.style.opacity=String(p.opacity+(1-p.opacity)*k));let we=It(k,p);we&&(y.style.transform=we);}function x(y){t.style.setProperty("--scroll-draw-progress",String(y)),te.forEach((k,we)=>{let Ae=v(Dt(y,we,ie,s));J(k,Ae);});}if(_)return x(1),A?.(),{destroy(){t.innerHTML=I,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let N=0,b=0,S=0,q=false,G=false,re=-1,z=0,F=false,T=()=>window.scrollY,j=()=>window.innerHeight;function le(){let y=t.getBoundingClientRect(),k=be({top:y.top,height:y.height},T(),j(),Q,ve);N=k.tStart,b=k.tEnd;}function Y(){if(!q||G)return;let y=K(T(),N,b,1);g&&(re=Math.max(re,y),y=re),z=y,x(y),y>=1&&!F?(F=true,A?.()):y<1&&!g&&(F=false),S=requestAnimationFrame(Y);}le();let U=new IntersectionObserver(y=>{y.forEach(k=>{q=k.isIntersecting,q&&!G?S=requestAnimationFrame(Y):cancelAnimationFrame(S);});}),d;function M(){clearTimeout(d),d=setTimeout(()=>{if(m==="lines"){let y=z;t.innerHTML=I,t.setAttribute("aria-label",t.textContent??""),te=ft(t),x(y);}le();},150);}return window.addEventListener("resize",M),window.addEventListener("orientationchange",M),U.observe(t),De(t,{type:"text",getProgress:()=>z,getTrigger:()=>({tStart:N,tEnd:b})}),{destroy(){cancelAnimationFrame(S),U.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),clearTimeout(d),t.innerHTML=I,t.removeAttribute("aria-label"),Ie(t);},replay(){re=-1,F=false,z=0,G=false,x(0);},pause(){G=true,cancelAnimationFrame(S);},resume(){G&&(G=false,q&&(S=requestAnimationFrame(Y)));},seek(y){let k=Math.min(1,Math.max(0,y));z=k,re=k,G=true,cancelAnimationFrame(S),x(k);},getProgress(){return z}}}function Nt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?_e(t,n):(console.warn("[svg-scroll-draw] Container not found:",e),r)}function Ft(e=document){return Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return _e(n,r)})}function Ht(e=document){return Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return pt(n,r)})}function Rt(e=document){return Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(process.env.NODE_ENV!=="production"&&console.warn('[svg-scroll-draw] initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Ze(n,r)})}function qt(e=document){return Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return yt(n,r)})}function br(e=document){return {draw:Ft(e),animate:Ht(e),counter:Rt(e),text:qt(e)}}exports.initAll=br;exports.initScrollAnimate=Ht;exports.initScrollCounter=Rt;exports.initScrollDraw=Ft;exports.initScrollText=qt;exports.scrollDraw=Nt;
1
+ 'use strict';function Ft({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let v=Math.pow(l,d);c.push(v),s+=v;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let v=0;v<r;v++)if(d<=u[v+1]){let _=(d-u[v])/(u[v+1]-u[v]);if(v===0)return _*(2-_);let x=1-Math.pow(t,v);return x+(1-x)*(2*_-1)*(2*_-1)}return 1}}function Rt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var le={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:Ft(),elastic:Rt()};function ve(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 dt(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 gt(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 He(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 Nt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:Nt((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function Le(e,n,r,t,l){let s=dt(e.top,e.height,n,t.element)-gt(t.viewport,r),c=dt(e.top,e.height,n,l.element)-gt(l.viewport,r);return {tStart:s,tEnd:c}}function yt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=yt(e),l=yt(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var ht={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ee(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Ht="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",_t="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",bt=33;function zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function qt(e){let n=[];for(let r=0;r<bt;r++){let t=r/(bt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return Ht;case "ease-out":return _t;case "ease-in-out":return zt()?qt(le["ease-in-out"]):null;default:return null}}var Vt=0;function Wt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Bt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?ee("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&ee("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Gt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,vt=/[MmLlHhVvCcSsQqTtAaZz]/g;function jt(e,n,r){if(!Ze)return;let t=(e.match(vt)??[]).join("").toUpperCase(),l=(n.match(vt)??[]).join("").toUpperCase(),s=(e.match(wt)??[]).length,c=(n.match(wt)??[]).length;if(t!==l){ee(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&ee(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function st(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function et(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...ht[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:v={},stagger:_=0,direction:x="forward",once:oe=false,debug:Oe=false,axis:j="y",scrollContainer:se,autoReverse:ie=false,delay:te=0,strokeColor:T,strokeWidth:W,fillOpacity:L,waypoints:A,velocityScale:F=false,threshold:B=0,rootMargin:P="0px",repeat:M=0,repeatDelay:ce=0,morphTo:D,clip:pe,autoplay:Se=false,duration:de=1e3,native:Ee=true,onProgress:g,onStart:S,onComplete:y,onEnter:$,onLeave:ge,onEnterBack:ye,onLeaveBack:Ce}=l,re=pe===true?"left":typeof pe=="string"?pe:false,he=typeof d=="function"?d:le[d]??le.linear,Te=ve(v.start??"top bottom"),Re=ve(v.end??"bottom top"),ue=typeof se=="string"?document.querySelector(se):se??null,me=Array.isArray(T)?T[0]:null,X=Array.isArray(T)?T[1]:typeof T=="string"?T:null,Y=Array.isArray(W)?W[0]:null,z=Array.isArray(W)?W[1]:typeof W=="number"?W:null,ne=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Ae(o){let a=o*100;switch(re){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 I=re?[]:Array.from(e.querySelectorAll(c)),E=[],i=[],f=0,fe=0,O=false,R=false,N=0,q=false,J=-1,Me=-1,U=false,be=0,Pe=0,ke,tt=null;function at(){tt?.destroy(),tt=null;}let Ie=new Set,lt=NaN,Fe=true,Ge=-1,ct=performance.now(),Ne=NaN;function rt(){return ue?j==="x"?ue.scrollLeft:ue.scrollTop:j==="x"?window.scrollX:window.scrollY}function ut(){return ue?j==="x"?ue.clientWidth:ue.clientHeight:j==="x"?window.innerWidth:window.innerHeight}function mt(){let o=Qe(e,ue,j),a=Le(o,o.scroll,ut(),Te,Re);f=a.tStart,fe=a.tEnd,Oe&&Ze&&(at(),tt=Gt(f,fe,j));}function Dt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),re){let b=a==="reverse"?1-o:o;e.style.clipPath=Ae(b);return}I.forEach((b,Q)=>{b.style.strokeDashoffset=a==="reverse"?`${E[Q]*o}`:`${E[Q]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),me&&X?b.style.stroke=_e(me,X,o):X&&(b.style.stroke=X),Y!==null&&z!==null?b.style.strokeWidth=`${Y+(z-Y)*o}`:z!==null&&(b.style.strokeWidth=`${z}`),ne!==null&&G!==null?b.style.fillOpacity=`${ne+(G-ne)*o}`:G!==null&&(b.style.fillOpacity=`${G}`),D&&b.tagName.toLowerCase()==="path"&&i[Q]&&b.setAttribute("d",st(i[Q],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),re){e.style.clipPath=Ae(0);return}I.forEach((o,a)=>{o.style.strokeDasharray=`${E[a]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${E[a]}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(I.forEach(o=>{Bt(o);let a=He(o);E.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?jt(i[i.length-1],D,o):ee(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),X&&(o.style.stroke=X),z!==null&&(o.style.strokeWidth=`${z}`),G!==null&&(o.style.fillOpacity=`${G}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?"0":`${a}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`));}),re){if(s)return e.style.clipPath=Ae(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ae(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ft=typeof d=="string"?Ke(d):null;function Ot(){return !(Ee===false||!Wt()||!I.length||!ft||re||j!=="y"||ue||u!==1||_!==0||oe||ie||F!==false||D||A||M||te>0||g||S||y||$||ge||ye||Ce||T!=null||W!=null||L!=null||(v.start??"top bottom").trim()!=="top bottom"||(v.end??"bottom top").trim()!=="bottom top")}function kt(){let o=++Vt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,Q=`--svg-scroll-draw-${o}`,De=x==="reverse"?"0":"var(--ssd-len)",$e=x==="reverse"?"var(--ssd-len)":"0",xe=`stroke-dashoffset:${De};`,w=`stroke-dashoffset:${$e};`;m&&(xe+=`opacity:${x==="reverse"?1:0};`,w+=`opacity:${x==="reverse"?0:1};`);let C=document.createElement("style");C.setAttribute("data-svg-scroll-draw",""),C.textContent=`@keyframes ${a}{from{${xe}}to{${w}}}.${b}{view-timeline-name:${Q};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ft};animation-fill-mode:both;animation-timeline:${Q};animation-range:cover 0% cover 100%;}`,document.head.appendChild(C),e.classList.add(b);function Z(p,V){p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(a);}I.forEach(Z);let h=false,k=-1;function H(){if(k>=0)return k;let p=e.getBoundingClientRect(),{tStart:V,tEnd:we}=Le({top:p.top,height:p.height},rt(),ut(),Te,Re);return he(K(rt(),V,we,u))}return {destroy(){e.classList.remove(b),I.forEach(p=>{p.classList.remove(a),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),C.remove();},replay(){h=false,k=-1,I.forEach(Z);},pause(){h=true,I.forEach(p=>{p.style.animationPlayState="paused";});},resume(){h&&(h=false,I.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let V=Math.min(1,Math.max(0,p));k=V,h=true,I.forEach((we,ae)=>{we.classList.remove(a),we.style.strokeDashoffset=x==="reverse"?`${E[ae]*V}`:`${E[ae]*(1-V)}`,m&&(we.style.opacity=x==="reverse"?`${1-V}`:`${V}`);});},getProgress(){return H()},refresh(){I.forEach((p,V)=>{E[V]=He(p),p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`;});}}}if(Ot())return kt();function It(){let o=Math.max(1,de),a=0,b=0,Q=false;function De(h){let k=true;if(re){let H=Math.min(1,Math.max(0,h/o)),p=he(H);be=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=Ae(x==="reverse"?1-p:p),g?.(p),H<1&&(k=false);}else I.forEach((H,p)=>{let V=p*_*o,we=Math.min(1,Math.max(0,(h-V)/o)),ae=he(we);H.style.strokeDashoffset=x==="reverse"?`${E[p]*ae}`:`${E[p]*(1-ae)}`,m&&(H.style.opacity=x==="reverse"?`${1-ae}`:`${ae}`),me&&X?H.style.stroke=_e(me,X,ae):X&&(H.style.stroke=X),Y!==null&&z!==null?H.style.strokeWidth=`${Y+(z-Y)*ae}`:z!==null&&(H.style.strokeWidth=`${z}`),ne!==null&&G!==null?H.style.fillOpacity=`${ne+(G-ne)*ae}`:G!==null&&(H.style.fillOpacity=`${G}`),D&&H.tagName.toLowerCase()==="path"&&i[p]&&H.setAttribute("d",st(i[p],D,ae)),p===0&&(be=ae,g?.(ae),e.style.setProperty("--scroll-draw-progress",String(ae))),we<1&&(k=false);});if(A){let H=Math.min(1,Math.max(0,h/o)),p=he(H);for(let V in A){let we=parseFloat(V);p>=we&&!Ie.has(we)&&(Ie.add(we),A[V]?.());}}return k}function $e(h){if(U)return;let k=h-a;R||(R=true,S?.());let H=De(k);if(H&&!O){O=true,De(o*(1+Math.max(0,I.length-1)*_)),y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{a=performance.now(),R=false,O=false,Ie.clear(),je(),N=requestAnimationFrame($e);},ce));return}H||(N=requestAnimationFrame($e));}function xe(){cancelAnimationFrame(N),clearTimeout(ke),a=performance.now(),b=0,U=false,R=false,O=false,Pe=0,Q=true,be=0,Ie.clear(),je(),N=requestAnimationFrame($e);}let w=new IntersectionObserver(h=>{h.forEach(k=>{k.isIntersecting&&!(oe&&O)?xe():!k.isIntersecting&&!oe&&!O&&(cancelAnimationFrame(N),clearTimeout(ke),Q=false);});},{root:ue??null,threshold:B,rootMargin:P}),C;function Z(){clearTimeout(C),C=setTimeout(()=>{I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),te>0?setTimeout(()=>w.observe(e),te):w.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),w.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(C);},replay(){Pe=0,xe();},pause(){U||!Q||(U=true,b=performance.now()-a,cancelAnimationFrame(N));},resume(){U&&(U=false,Q=true,a=performance.now()-b,N=requestAnimationFrame($e));},seek(h){let k=Math.min(1,Math.max(0,h));be=k,U=true,b=k*o,a=performance.now()-b,cancelAnimationFrame(N),De(b);},getProgress(){return be},refresh(){clearTimeout(C),I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});}}}if(Se)return It();mt();function Ue(){if(!q||U)return;let o=performance.now(),a=rt();if(!Fe&&F===false&&a===lt){N=requestAnimationFrame(Ue);return}Fe=false,lt=a;let b=u;if(F!==false){let w=o-ct,C=w>0?Math.abs(a-(Ge<0?a:Ge))/w:0;b=u*Math.max(.2,1+C*(typeof F=="number"?F:1)*.04);}Ge=a,ct=o;let Q=ie?Me===-1||a>=Me?"forward":"reverse":x;Me=a;let De=fe-f,$e=true,xe=De===0?0:(a-f)/De;if(isNaN(Ne)||(Ne<=0&&xe>0?$?.():Ne>0&&xe<=0&&Ce?.(),Ne<1&&xe>=1?ge?.():Ne>=1&&xe<1&&ye?.()),Ne=xe,re){let w=he(K(a,f,fe,b));oe&&!ie&&(J=Math.max(J,w),w=J),be=w,e.style.setProperty("--scroll-draw-progress",String(w));let C=Q==="reverse"?1-w:w;e.style.clipPath=Ae(C),g?.(w),!R&&K(a,f,fe,b)>0&&(R=true,S?.()),w>=1&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,e.style.clipPath=Ae(0);},ce))):w<1&&!oe&&(O=false),N=requestAnimationFrame(Ue);return}if(I.forEach((w,C)=>{let Z=C*_*De,h=he(K(a,f+Z,fe+Z,b));oe&&!ie&&(J=Math.max(J,h),h=J),be=h,w.style.strokeDashoffset=Q==="reverse"?`${E[C]*h}`:`${E[C]*(1-h)}`,m&&(w.style.opacity=Q==="reverse"?`${1-h}`:`${h}`),me&&X?w.style.stroke=_e(me,X,h):X&&(w.style.stroke=X),Y!==null&&z!==null?w.style.strokeWidth=`${Y+(z-Y)*h}`:z!==null&&(w.style.strokeWidth=`${z}`),ne!==null&&G!==null?w.style.fillOpacity=`${ne+(G-ne)*h}`:G!==null&&(w.style.fillOpacity=`${G}`),D&&w.tagName.toLowerCase()==="path"&&i[C]&&w.setAttribute("d",st(i[C],D,h)),C===0&&(g?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&($e=false);}),A){let w=he(K(a,f,fe,b));for(let C in A){let Z=parseFloat(C);w>=Z&&!Ie.has(Z)&&(Ie.add(Z),A[C]?.());}}!R&&K(a,f,fe,b)>0&&(R=true,S?.()),$e&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,Ie.clear(),je(),Fe=true;},ce))):!$e&&!oe&&(O=false),N=requestAnimationFrame(Ue);}let nt=false;function Xe(){nt||(nt=true,N=requestAnimationFrame(function(){Ue();}));}function Ye(){nt=false,cancelAnimationFrame(N);}let ot=new IntersectionObserver(o=>{o.forEach(a=>{q=a.isIntersecting,q&&!U?(Fe=true,Xe()):Ye();});},{root:ue??null,threshold:B,rootMargin:P});function pt(){I.forEach((o,a)=>{E[a]=He(o),o.style.strokeDasharray=`${E[a]}`;}),mt(),Fe=true;}let Je;function Ve(){clearTimeout(Je),Je=setTimeout(pt,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>Ve()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),te>0?setTimeout(()=>ot.observe(e),te):ot.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),Ye(),ot.disconnect(),We?.disconnect(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(Je),at();},replay(){J=-1,Me=-1,Ge=-1,R=false,O=false,Pe=0,U=false,be=0,Ie.clear(),clearTimeout(ke),je(),Fe=true,q&&Xe();},pause(){U=true,Ye();},resume(){U&&(U=false,Fe=true,q&&Xe());},seek(o){let a=Math.min(1,Math.max(0,o));be=a,J=a,U=true,Ye(),Dt(a,x),Fe=true;},getProgress(){return be},refresh(){clearTimeout(Je),pt(),q&&!U&&Xe();}}}var St=new Map;function ze(e,n){St.set(e,n);}function qe(e){St.delete(e);}function Ut(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Et(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function Xt(e,n,r){let t=Et(e),l=Et(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function xt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Ut(t))return _e(t,l,r);if(t.includes("("))return Xt(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function Yt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Jt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Qt=0,Tt="--scroll-draw-progress";function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function At(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:v=true,velocityScale:_=false,respectReducedMotion:x=true,triggerElement:oe,onProgress:Oe,onComplete:j,onEnter:se,onLeave:ie,onEnterBack:te,onLeaveBack:T}=n,W=x&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:le[s]??le["ease-out"],A=ve(l.start??"top bottom"),F=ve(l.end??"bottom top"),B=oe??e,P=typeof d=="string"?document.querySelector(d):d??null,M=Object.entries(t).map(([i,f])=>({prop:Yt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function ce(){let i=window.getComputedStyle(e);for(let f of M)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of M)e.style.setProperty(i.prop,String(i.to));}let pe=new Map;for(let i of [...M.map(f=>f.prop),Tt])pe.set(i,e.style.getPropertyValue(i));function Se(){for(let[i,f]of pe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(W)return D(),j?.(),{...r,destroy:Se,getProgress:()=>1};ce();let de=typeof s=="string"?Ke(s):null;function Ee(){if(!v||!Zt()||!de||m!=="y"||P||B!==e||u||c!==1||Oe||j||se||ie||te||T||_!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of M)if(!Jt.has(i.prop))return false;return true}function g(){let i=`ssd-a-${++Qt}`,f=M.map(q=>`${q.prop}:${q.from}`).join(";"),fe=M.map(q=>`${q.prop}:${q.to}`).join(";"),O=document.createElement("style");O.setAttribute("data-ssd-animate",""),O.textContent=`@keyframes ${i}{from{${f}}to{${fe}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${de};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(i);let R=()=>m==="x"?window.scrollX:window.scrollY,N=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),O.remove(),e.style.animationPlayState="",Se();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(q){let J=Math.min(1,Math.max(0,q));e.classList.remove(i);for(let Me of M)e.style.setProperty(Me.prop,xt(Me.from,Me.to,J));},getProgress(){let q=e.getBoundingClientRect(),J=R(),Me=N(),{tStart:U,tEnd:be}=Le({top:q.top,height:q.height},J,Me,A,F);return L(K(J,U,be,c))}}}if(Ee())return g();let S=0,y=0,$=0,ge=false,ye=false,Ce=-1,re=0,he=false,Te=NaN,Re=-1,ue=0,me=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,X=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function Y(){let i=Qe(B,P,m),f=Le(i,i.scroll,X(),A,F);S=f.tStart,y=f.tEnd;}function z(i){e.style.setProperty(Tt,String(i));for(let f of M)e.style.setProperty(f.prop,xt(f.from,f.to,i));Oe?.(i);}function ne(i){if(isNaN(Te)){Te=i;return}Te<=0&&i>0?se?.():Te>0&&i<=0&&T?.(),Te<1&&i>=1?ie?.():Te>=1&&i<1&&te?.(),Te=i;}function G(){if(!ge||ye)return;let i=performance.now(),f=me(),fe=c;if(_!==false){let N=i-ue,q=N>0?Math.abs(f-(Re<0?f:Re))/N:0;fe=c*Math.max(.2,1+q*(typeof _=="number"?_:1)*.04);}Re=f,ue=i;let O=y===S?0:(f-S)/(y-S);ne(O);let R=L(K(f,S,y,fe));u&&(Ce=Math.max(Ce,R),R=Ce),re=R,z(R),R>=1&&!he?(he=true,j?.()):R<1&&!u&&(he=false),$=requestAnimationFrame(G);}Y(),y===S&&ee("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=L(K(me(),S,y,c));u&&i>0&&(Ce=i),re=i,z(i);}let Ae=new IntersectionObserver(i=>{i.forEach(f=>{ge=f.isIntersecting,ge&&!ye?$=requestAnimationFrame(G):cancelAnimationFrame($);});},{root:P??null}),I;function E(){clearTimeout(I),I=setTimeout(Y,150);}return window.addEventListener("resize",E),window.addEventListener("orientationchange",E),Ae.observe(e),ze(e,{type:"animate",getProgress:()=>re,getTrigger:()=>({tStart:S,tEnd:y})}),{destroy(){cancelAnimationFrame($),Ae.disconnect(),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),clearTimeout(I),Se(),qe(e);},replay(){Ce=-1,he=false,re=0,ye=false,z(0);},pause(){ye=true,cancelAnimationFrame($);},resume(){ye&&(ye=false,ge&&($=requestAnimationFrame(G)));},seek(i){let f=Math.min(1,Math.max(0,i));re=f,Ce=f,ye=true,cancelAnimationFrame($),z(f);},getProgress(){return re}}}var it={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mt(e,n){if(typeof window>"u")return it;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollCounter: element not found:",e),it;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:v,onComplete:_}=n,x=v!==void 0?g=>g.toFixed(v):c??(g=>String(Math.round(g))),oe=typeof u=="function"?u:le[u]??le["ease-out"],Oe=ve(m.start??"top 80%"),j=ve(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=x(s),_?.(),it;let ie=0,te=0,T=0,W=false,L=false,A=-1,F=0,B=false,P=()=>window.scrollY,M=()=>window.innerHeight;function ce(){let g=t.getBoundingClientRect(),S=Le({top:g.top,height:g.height},P(),M(),Oe,j);ie=S.tStart,te=S.tEnd;}function D(g){t.textContent=x(l+(s-l)*g),t.style.setProperty("--scroll-draw-progress",String(g));}function pe(){if(!W||L)return;let g=oe(K(P(),ie,te,1));d&&(A=Math.max(A,g),g=A),F=g,D(g),g>=1&&!B?(B=true,_?.()):g<1&&!d&&(B=false),T=requestAnimationFrame(pe);}ce();{let g=oe(K(P(),ie,te,1));d&&g>0&&(A=g),F=g,D(g);}let Se=new IntersectionObserver(g=>{g.forEach(S=>{W=S.isIntersecting,W&&!L?T=requestAnimationFrame(pe):cancelAnimationFrame(T);});}),de;function Ee(){clearTimeout(de),de=setTimeout(ce,150);}return window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee),Se.observe(t),ze(t,{type:"counter",getProgress:()=>F,getTrigger:()=>({tStart:ie,tEnd:te})}),{destroy(){cancelAnimationFrame(T),Se.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),clearTimeout(de),qe(t);},replay(){A=-1,B=false,F=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(T);},resume(){L&&(L=false,W&&(T=requestAnimationFrame(pe)));},seek(g){let S=Math.min(1,Math.max(0,g));F=S,A=S,L=true,cancelAnimationFrame(T),D(S);},getProgress(){return F}}}function Ct(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 Kt(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 $t(e){let n=Ct(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let v=m.nextElementSibling;u.appendChild(m),d<c.length-1&&v&&v.style.whiteSpace==="pre"&&u.appendChild(v);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function er(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function tr(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 Lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Pt(e,n={}){if(typeof window>"u")return Lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollText: element not found:",e),Lt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:v}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof c=="function"?c:le[c]??le["ease-out"],oe=ve(m.start??"top 85%"),Oe=ve(m.end??"top 40%"),j=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let se;l==="chars"?se=Kt(t):l==="lines"?se=$t(t):se=Ct(t);let ie=se.length;function te(y,$){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*$));let ge=tr($,u);ge&&(y.style.transform=ge);}function T(y){t.style.setProperty("--scroll-draw-progress",String(y)),se.forEach(($,ge)=>{let ye=x(er(y,ge,ie,s));te($,ye);});}if(_)return T(1),v?.(),{destroy(){t.innerHTML=j,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T(0);let W=0,L=0,A=0,F=false,B=false,P=-1,M=0,ce=false,D=()=>window.scrollY,pe=()=>window.innerHeight;function Se(){let y=t.getBoundingClientRect(),$=Le({top:y.top,height:y.height},D(),pe(),oe,Oe);W=$.tStart,L=$.tEnd;}function de(){if(!F||B)return;let y=K(D(),W,L,1);d&&(P=Math.max(P,y),y=P),M=y,T(y),y>=1&&!ce?(ce=true,v?.()):y<1&&!d&&(ce=false),A=requestAnimationFrame(de);}Se();let Ee=new IntersectionObserver(y=>{y.forEach($=>{F=$.isIntersecting,F&&!B?A=requestAnimationFrame(de):cancelAnimationFrame(A);});}),g;function S(){clearTimeout(g),g=setTimeout(()=>{if(l==="lines"){let y=M;t.innerHTML=j,t.setAttribute("aria-label",t.textContent??""),se=$t(t),T(y);}Se();},150);}return window.addEventListener("resize",S),window.addEventListener("orientationchange",S),Ee.observe(t),ze(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:W,tEnd:L})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S),clearTimeout(g),t.innerHTML=j,t.removeAttribute("aria-label"),qe(t);},replay(){P=-1,ce=false,M=0,B=false,T(0);},pause(){B=true,cancelAnimationFrame(A);},resume(){B&&(B=false,F&&(A=requestAnimationFrame(de)));},seek(y){let $=Math.min(1,Math.max(0,y));M=$,P=$,B=true,cancelAnimationFrame(A),T($);},getProgress(){return M}}}function rr(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?et(t,n):(ee("Container not found:",e),r)}function Be(){return typeof document>"u"?null:document}function nr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return et(n,r)}):[]}function or(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return At(n,r)}):[]}function sr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(ee('initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Mt(n,r)}):[]}function ir(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return Pt(n,r)}):[]}function _r(e=Be()){return {draw:nr(e),animate:or(e),counter:sr(e),text:ir(e)}}exports.initAll=_r;exports.initScrollAnimate=or;exports.initScrollCounter=sr;exports.initScrollDraw=nr;exports.initScrollText=ir;exports.scrollDraw=rr;
@@ -125,6 +125,21 @@ interface ScrollDrawInstance {
125
125
  seek: (progress: number) => void;
126
126
  /** Returns current draw progress (0–1). */
127
127
  getProgress: () => number;
128
+ /**
129
+ * Re-measure after a layout change: path lengths, and the scroll trigger window.
130
+ *
131
+ * The engine already re-measures on `resize`, on `orientationchange`, and via a
132
+ * `ResizeObserver` on the document element — but none of those fire for a layout
133
+ * change that leaves the document height alone, such as a tab switching, a
134
+ * sibling collapsing, or a font swapping inside a fixed-height box. Call this
135
+ * after one of those.
136
+ *
137
+ * Optional on this shared type because several instances here are fan-outs over
138
+ * other instances or SSR no-op stubs. `scrollDraw`, `scrollPin`,
139
+ * `scrollHorizontal`, `scrollDrawTimeline` and the group APIs all provide it;
140
+ * use `instance.refresh?.()` if you hold an instance of unknown origin.
141
+ */
142
+ refresh?: () => void;
128
143
  }
129
144
 
130
145
  declare function scrollDraw(target: string | Element, options?: ScrollDrawOptions): ScrollDrawInstance;
@@ -144,7 +159,7 @@ declare function scrollDraw(target: string | Element, options?: ScrollDrawOption
144
159
  * initScrollDraw();
145
160
  * </script>
146
161
  */
147
- declare function initScrollDraw(root?: Element | Document): ScrollDrawInstance[];
162
+ declare function initScrollDraw(root?: Element | Document | null): ScrollDrawInstance[];
148
163
  /**
149
164
  * Auto-initialises all [data-scroll-animate] elements on the page.
150
165
  * Options (including `props`) are read from the data-scroll-animate-options JSON attribute.
@@ -162,7 +177,7 @@ declare function initScrollDraw(root?: Element | Document): ScrollDrawInstance[]
162
177
  * initScrollAnimate();
163
178
  * </script>
164
179
  */
165
- declare function initScrollAnimate(root?: Element | Document): ScrollDrawInstance[];
180
+ declare function initScrollAnimate(root?: Element | Document | null): ScrollDrawInstance[];
166
181
  /**
167
182
  * Auto-initialises all [data-scroll-counter] elements on the page.
168
183
  * Options are read from the data-scroll-counter-options JSON attribute.
@@ -179,7 +194,7 @@ declare function initScrollAnimate(root?: Element | Document): ScrollDrawInstanc
179
194
  * initScrollCounter();
180
195
  * </script>
181
196
  */
182
- declare function initScrollCounter(root?: Element | Document): ScrollDrawInstance[];
197
+ declare function initScrollCounter(root?: Element | Document | null): ScrollDrawInstance[];
183
198
  /**
184
199
  * Auto-initialises all [data-scroll-text] elements on the page.
185
200
  * Options are read from the data-scroll-text-options JSON attribute.
@@ -197,7 +212,7 @@ declare function initScrollCounter(root?: Element | Document): ScrollDrawInstanc
197
212
  * initScrollText();
198
213
  * </script>
199
214
  */
200
- declare function initScrollText(root?: Element | Document): ScrollDrawInstance[];
215
+ declare function initScrollText(root?: Element | Document | null): ScrollDrawInstance[];
201
216
  /**
202
217
  * Convenience — runs all four init functions in one call.
203
218
  * Pass a root element to scope to a specific subtree.
@@ -208,7 +223,7 @@ declare function initScrollText(root?: Element | Document): ScrollDrawInstance[]
208
223
  * initAll(); // Initialises scrollDraw, scrollAnimate, scrollCounter, scrollText
209
224
  * </script>
210
225
  */
211
- declare function initAll(root?: Element | Document): {
226
+ declare function initAll(root?: Element | Document | null): {
212
227
  draw: ScrollDrawInstance[];
213
228
  animate: ScrollDrawInstance[];
214
229
  counter: ScrollDrawInstance[];
@@ -125,6 +125,21 @@ interface ScrollDrawInstance {
125
125
  seek: (progress: number) => void;
126
126
  /** Returns current draw progress (0–1). */
127
127
  getProgress: () => number;
128
+ /**
129
+ * Re-measure after a layout change: path lengths, and the scroll trigger window.
130
+ *
131
+ * The engine already re-measures on `resize`, on `orientationchange`, and via a
132
+ * `ResizeObserver` on the document element — but none of those fire for a layout
133
+ * change that leaves the document height alone, such as a tab switching, a
134
+ * sibling collapsing, or a font swapping inside a fixed-height box. Call this
135
+ * after one of those.
136
+ *
137
+ * Optional on this shared type because several instances here are fan-outs over
138
+ * other instances or SSR no-op stubs. `scrollDraw`, `scrollPin`,
139
+ * `scrollHorizontal`, `scrollDrawTimeline` and the group APIs all provide it;
140
+ * use `instance.refresh?.()` if you hold an instance of unknown origin.
141
+ */
142
+ refresh?: () => void;
128
143
  }
129
144
 
130
145
  declare function scrollDraw(target: string | Element, options?: ScrollDrawOptions): ScrollDrawInstance;
@@ -144,7 +159,7 @@ declare function scrollDraw(target: string | Element, options?: ScrollDrawOption
144
159
  * initScrollDraw();
145
160
  * </script>
146
161
  */
147
- declare function initScrollDraw(root?: Element | Document): ScrollDrawInstance[];
162
+ declare function initScrollDraw(root?: Element | Document | null): ScrollDrawInstance[];
148
163
  /**
149
164
  * Auto-initialises all [data-scroll-animate] elements on the page.
150
165
  * Options (including `props`) are read from the data-scroll-animate-options JSON attribute.
@@ -162,7 +177,7 @@ declare function initScrollDraw(root?: Element | Document): ScrollDrawInstance[]
162
177
  * initScrollAnimate();
163
178
  * </script>
164
179
  */
165
- declare function initScrollAnimate(root?: Element | Document): ScrollDrawInstance[];
180
+ declare function initScrollAnimate(root?: Element | Document | null): ScrollDrawInstance[];
166
181
  /**
167
182
  * Auto-initialises all [data-scroll-counter] elements on the page.
168
183
  * Options are read from the data-scroll-counter-options JSON attribute.
@@ -179,7 +194,7 @@ declare function initScrollAnimate(root?: Element | Document): ScrollDrawInstanc
179
194
  * initScrollCounter();
180
195
  * </script>
181
196
  */
182
- declare function initScrollCounter(root?: Element | Document): ScrollDrawInstance[];
197
+ declare function initScrollCounter(root?: Element | Document | null): ScrollDrawInstance[];
183
198
  /**
184
199
  * Auto-initialises all [data-scroll-text] elements on the page.
185
200
  * Options are read from the data-scroll-text-options JSON attribute.
@@ -197,7 +212,7 @@ declare function initScrollCounter(root?: Element | Document): ScrollDrawInstanc
197
212
  * initScrollText();
198
213
  * </script>
199
214
  */
200
- declare function initScrollText(root?: Element | Document): ScrollDrawInstance[];
215
+ declare function initScrollText(root?: Element | Document | null): ScrollDrawInstance[];
201
216
  /**
202
217
  * Convenience — runs all four init functions in one call.
203
218
  * Pass a root element to scope to a specific subtree.
@@ -208,7 +223,7 @@ declare function initScrollText(root?: Element | Document): ScrollDrawInstance[]
208
223
  * initAll(); // Initialises scrollDraw, scrollAnimate, scrollCounter, scrollText
209
224
  * </script>
210
225
  */
211
- declare function initAll(root?: Element | Document): {
226
+ declare function initAll(root?: Element | Document | null): {
212
227
  draw: ScrollDrawInstance[];
213
228
  animate: ScrollDrawInstance[];
214
229
  counter: ScrollDrawInstance[];
@@ -1,3 +1,3 @@
1
- function ot({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),m=Math.sqrt(t),s=0,f=[];for(let g=0;g<r;g++){let A=Math.pow(m,g);f.push(A),s+=A;}let p=[0],c=0;for(let g=0;g<r;g++)c+=f[g]/s,p.push(c);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let A=0;A<r;A++)if(g<=p[A+1]){let _=(g-p[A])/(p[A+1]-p[A]);if(A===0)return _*(2-_);let v=1-Math.pow(t,A);return v+(1-v)*(2*_-1)*(2*_-1)}return 1}}function st({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),m=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-m)*(2*Math.PI)/t)+1}var ae={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:ot(),elastic:st()};function me(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function tt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function rt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function We(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function vt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:vt((e-n)/(r-n)*t,0,1)}function be(e,n,r,t,m){let s=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),f=tt(e.top,e.height,n,m.element)-rt(m.viewport,r);return {tStart:s,tEnd:f}}function nt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function Oe(e,n,r){let t=nt(e),m=nt(n);return !t||!m?e:`rgb(${Math.round(t[0]+(m[0]-t[0])*r)},${Math.round(t[1]+(m[1]-t[1])*r)},${Math.round(t[2]+(m[2]-t[2])*r)})`}var Xe={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};function it(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var at={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Et=0;function xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Tt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?it("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&it("Element has a fill \u2014 it may obscure the stroke animation.",e);}function At(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function m(){let s=r==="x"?window.scrollX:window.scrollY,f=e-s,p=n-s,c=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${c?`left:${p}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${p}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",m,{passive:true}),m(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),m=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let f=parseFloat(s),p=t[m++]??f;return String(+(f+(p-f)*r).toFixed(4))})}function _e(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,m=r?{...Xe[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:p=1,fade:c=false,easing:g="linear",trigger:A={},stagger:_=0,direction:v="forward",once:Q=false,debug:ve=false,axis:I="y",scrollContainer:te,autoReverse:ie=false,delay:J=0,strokeColor:x,strokeWidth:N,fillOpacity:b,waypoints:S,velocityScale:q=false,threshold:G=0,rootMargin:re="0px",repeat:z=0,repeatDelay:F=0,morphTo:T,clip:j,autoplay:le=false,duration:Y=1e3,native:U=true,onProgress:d,onStart:M,onComplete:y,onEnter:k,onLeave:we,onEnterBack:Ae,onLeaveBack:Me}=m,ge=j===true?"left":typeof j=="string"?j:false,pe=typeof g=="function"?g:ae[g]??ae.linear,Ne=me(A.start??"top bottom"),Le=me(A.end??"bottom top"),V=typeof te=="string"?document.querySelector(te):te??null,i=Array.isArray(x)?x[0]:null,u=Array.isArray(x)?x[1]:typeof x=="string"?x:null,H=Array.isArray(N)?N[0]:null,P=Array.isArray(N)?N[1]:typeof N=="number"?N:null,B=Array.isArray(b)?b[0]:null,Z=Array.isArray(b)?b[1]:typeof b=="number"?b:null;function W(o){let a=o*100;switch(ge){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let D=ge?[]:Array.from(e.querySelectorAll(f)),C=[],ce=[],fe=0,Ee=0,ee=false,de=false,X=0,He=false,ye=-1,Re=-1,ne=false,Ce=0,Se=0,xe,Ge=null,Te=new Set,qe=-1,Ke=performance.now(),Pe=NaN;function Fe(){return V?I==="x"?V.scrollLeft:V.scrollTop:I==="x"?window.scrollX:window.scrollY}function Qe(){return V?I==="x"?V.clientWidth:V.clientHeight:I==="x"?window.innerWidth:window.innerHeight}function et(){let o=e.getBoundingClientRect(),a,w,R;if(V){let se=V.getBoundingClientRect();a=I==="x"?o.left-se.left+V.scrollLeft:o.top-se.top+V.scrollTop,w=I==="x"?o.width:o.height,R=Fe();}else a=I==="x"?o.left:o.top,w=I==="x"?o.width:o.height,R=Fe();let oe=be({top:a,height:w},R,Qe(),Ne,Le);fe=oe.tStart,Ee=oe.tEnd,ve&&process.env.NODE_ENV!=="production"&&(Ge?.remove(),Ge=At(fe,Ee,I));}function ht(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ge){let w=a==="reverse"?1-o:o;e.style.clipPath=W(w);return}D.forEach((w,R)=>{w.style.strokeDashoffset=a==="reverse"?`${C[R]*o}`:`${C[R]*(1-o)}`,c&&(w.style.opacity=a==="reverse"?`${1-o}`:`${o}`),i&&u?w.style.stroke=Oe(i,u,o):u&&(w.style.stroke=u),H!==null&&P!==null?w.style.strokeWidth=`${H+(P-H)*o}`:P!==null&&(w.style.strokeWidth=`${P}`),B!==null&&Z!==null?w.style.fillOpacity=`${B+(Z-B)*o}`:Z!==null&&(w.style.fillOpacity=`${Z}`),T&&w.tagName.toLowerCase()==="path"&&ce[R]&&w.setAttribute("d",Je(ce[R],T,o));});}function ze(){if(e.style.setProperty("--scroll-draw-progress","0"),ge){e.style.clipPath=W(0);return}D.forEach((o,a)=>{o.style.strokeDasharray=`${C[a]}`,o.style.strokeDashoffset=v==="reverse"?"0":`${C[a]}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",i&&(o.style.stroke=i),H!==null&&(o.style.strokeWidth=`${H}`),B!==null&&(o.style.fillOpacity=`${B}`),T&&o.tagName.toLowerCase()==="path"&&ce[a]&&o.setAttribute("d",ce[a]);});}if(D.forEach(o=>{Tt(o);let a=We(o);C.push(a),o.tagName.toLowerCase()==="path"?ce.push(o.getAttribute("d")??""):ce.push(""),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=v==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),u&&(o.style.stroke=u),P!==null&&(o.style.strokeWidth=`${P}`),Z!==null&&(o.style.fillOpacity=`${Z}`),T&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",T)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=v==="reverse"?"0":`${a}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",i&&(o.style.stroke=i),H!==null&&(o.style.strokeWidth=`${H}`),B!==null&&(o.style.fillOpacity=`${B}`));}),ge){if(s)return e.style.clipPath=W(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=W(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(U===false||!xt()||!D.length||typeof g!="string"||!(g in at)||ge||I!=="y"||V||p!==1||_!==0||Q||ie||q!==false||T||S||z||J>0||d||M||y||k||we||Ae||Me||x!=null||N!=null||b!=null||(A.start??"top bottom").trim()!=="top bottom"||(A.end??"bottom top").trim()!=="bottom top")}function wt(){let o=`svg-scroll-draw-${++Et}`,a=v==="reverse"?"0":"var(--ssd-len)",w=v==="reverse"?"var(--ssd-len)":"0",R=`stroke-dashoffset:${a};`,oe=`stroke-dashoffset:${w};`;c&&(R+=`opacity:${v==="reverse"?1:0};`,oe+=`opacity:${v==="reverse"?0:1};`);let se=document.createElement("style");se.setAttribute("data-svg-scroll-draw",""),se.textContent=`@keyframes ${o}{from{${R}}to{${oe}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${at[g]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(se);function ue(l,E){l.style.setProperty("--ssd-len",String(C[E])),l.style.strokeDasharray=`${C[E]}`,l.style.strokeDashoffset="",l.style.opacity="",l.style.animationPlayState="",l.classList.add(o);}D.forEach(ue);let h=false,$=-1;function L(){if($>=0)return $;let l=e.getBoundingClientRect(),{tStart:E,tEnd:O}=be({top:l.top,height:l.height},Fe(),Qe(),Ne,Le);return pe(K(Fe(),E,O,p))}return {destroy(){D.forEach(l=>{l.classList.remove(o),l.style.removeProperty("--ssd-len"),l.style.animationPlayState="";}),se.remove();},replay(){h=false,$=-1,D.forEach(ue);},pause(){h=true,D.forEach(l=>{l.style.animationPlayState="paused";});},resume(){h&&(h=false,D.forEach(l=>{l.style.animationPlayState="running";}));},seek(l){let E=Math.min(1,Math.max(0,l));$=E,h=true,D.forEach((O,$e)=>{O.classList.remove(o),O.style.strokeDashoffset=v==="reverse"?`${C[$e]*E}`:`${C[$e]*(1-E)}`,c&&(O.style.opacity=v==="reverse"?`${1-E}`:`${E}`);});},getProgress(){return L()}}}if(bt())return wt();function St(){let o=Math.max(1,Y),a=0,w=0;function R(L){let l=true;if(ge){let E=Math.min(1,Math.max(0,L/o)),O=pe(E);Ce=O,e.style.setProperty("--scroll-draw-progress",String(O)),e.style.clipPath=W(v==="reverse"?1-O:O),d?.(O),E<1&&(l=false);}else D.forEach((E,O)=>{let $e=O*_*o,ke=Math.min(1,Math.max(0,(L-$e)/o)),he=pe(ke);E.style.strokeDashoffset=v==="reverse"?`${C[O]*he}`:`${C[O]*(1-he)}`,c&&(E.style.opacity=v==="reverse"?`${1-he}`:`${he}`),i&&u?E.style.stroke=Oe(i,u,he):u&&(E.style.stroke=u),H!==null&&P!==null?E.style.strokeWidth=`${H+(P-H)*he}`:P!==null&&(E.style.strokeWidth=`${P}`),B!==null&&Z!==null?E.style.fillOpacity=`${B+(Z-B)*he}`:Z!==null&&(E.style.fillOpacity=`${Z}`),T&&E.tagName.toLowerCase()==="path"&&ce[O]&&E.setAttribute("d",Je(ce[O],T,he)),O===0&&(d?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),ke<1&&(l=false);});if(S){let E=Math.min(1,Math.max(0,L/o)),O=pe(E);for(let $e in S){let ke=parseFloat($e);O>=ke&&!Te.has(ke)&&(Te.add(ke),S[$e]?.());}}return l}function oe(L){if(ne)return;let l=L-a;de||(de=true,M?.());let E=R(l);if(E&&!ee){ee=true,R(o*(1+Math.max(0,D.length-1)*_)),y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{a=performance.now(),de=false,ee=false,Te.clear(),ze(),X=requestAnimationFrame(oe);},F));return}E||(X=requestAnimationFrame(oe));}function se(){cancelAnimationFrame(X),clearTimeout(xe),a=performance.now(),w=0,ne=false,de=false,ee=false,Se=0,Te.clear(),ze(),X=requestAnimationFrame(oe);}let ue=new IntersectionObserver(L=>{L.forEach(l=>{l.isIntersecting&&!(Q&&ee)?se():!l.isIntersecting&&!Q&&!ee&&(cancelAnimationFrame(X),clearTimeout(xe),a=null);});},{root:V??null,threshold:G,rootMargin:re}),h;function $(){clearTimeout(h),h=setTimeout(()=>{D.forEach((L,l)=>{C[l]=We(L),L.style.strokeDasharray=`${C[l]}`;});},150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),J>0?setTimeout(()=>ue.observe(e),J):ue.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),ue.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(h);},replay(){Se=0,se();},pause(){ne||(ne=true,w=performance.now()-a,cancelAnimationFrame(X));},resume(){ne&&(ne=false,a=performance.now()-w,X=requestAnimationFrame(oe));},seek(L){let l=Math.min(1,Math.max(0,L));Ce=l,ne=true,w=l*o,a=performance.now()-w,cancelAnimationFrame(X),R(w);},getProgress(){return Ce}}}if(le)return St();et();function Ve(){if(!He||ne)return;let o=performance.now(),a=Fe(),w=p;if(q!==false){let h=o-Ke,$=h>0?Math.abs(a-(qe<0?a:qe))/h:0;w=p*Math.max(.2,1+$*(typeof q=="number"?q:1)*.04);}qe=a,Ke=o;let R=ie?Re===-1||a>=Re?"forward":"reverse":v;Re=a;let oe=Ee-fe,se=true,ue=oe===0?0:(a-fe)/oe;if(isNaN(Pe)||(Pe<=0&&ue>0?k?.():Pe>0&&ue<=0&&Me?.(),Pe<1&&ue>=1?we?.():Pe>=1&&ue<1&&Ae?.()),Pe=ue,ge){let h=pe(K(a,fe,Ee,w));Q&&!ie&&(ye=Math.max(ye,h),h=ye),Ce=h,e.style.setProperty("--scroll-draw-progress",String(h));let $=R==="reverse"?1-h:h;e.style.clipPath=W($),d?.(h),!de&&K(a,fe,Ee,w)>0&&(de=true,M?.()),h>=1&&!ee?(ee=true,y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{ye=-1,de=false,ee=false,e.style.clipPath=W(0);},F))):h<1&&!Q&&(ee=false),X=requestAnimationFrame(Ve);return}if(D.forEach((h,$)=>{let L=$*_*oe,l=pe(K(a,fe+L,Ee+L,w));Q&&!ie&&(ye=Math.max(ye,l),l=ye),Ce=l,h.style.strokeDashoffset=R==="reverse"?`${C[$]*l}`:`${C[$]*(1-l)}`,c&&(h.style.opacity=R==="reverse"?`${1-l}`:`${l}`),i&&u?h.style.stroke=Oe(i,u,l):u&&(h.style.stroke=u),H!==null&&P!==null?h.style.strokeWidth=`${H+(P-H)*l}`:P!==null&&(h.style.strokeWidth=`${P}`),B!==null&&Z!==null?h.style.fillOpacity=`${B+(Z-B)*l}`:Z!==null&&(h.style.fillOpacity=`${Z}`),T&&h.tagName.toLowerCase()==="path"&&ce[$]&&h.setAttribute("d",Je(ce[$],T,l)),$===0&&(d?.(l),e.style.setProperty("--scroll-draw-progress",String(l))),l<1&&(se=false);}),S){let h=pe(K(a,fe,Ee,w));for(let $ in S){let L=parseFloat($);h>=L&&!Te.has(L)&&(Te.add(L),S[$]?.());}}!de&&K(a,fe,Ee,w)>0&&(de=true,M?.()),se&&!ee?(ee=true,y?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{ye=-1,de=false,ee=false,Te.clear(),ze();},F))):!se&&!Q&&(ee=false),X=requestAnimationFrame(Ve);}let je=new IntersectionObserver(o=>{o.forEach(a=>{He=a.isIntersecting,He&&!ne?X=requestAnimationFrame(Ve):cancelAnimationFrame(X);});},{root:V??null,threshold:G,rootMargin:re}),Ye;function Be(){clearTimeout(Ye),Ye=setTimeout(()=>{D.forEach((o,a)=>{C[a]=We(o),o.style.strokeDasharray=`${C[a]}`;}),et();},150);}return window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be),J>0?setTimeout(()=>je.observe(e),J):je.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),je.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ye),Ge?.remove();},replay(){ye=-1,Re=-1,qe=-1,de=false,ee=false,Se=0,ne=false,Te.clear(),clearTimeout(xe),ze();},pause(){ne=true,cancelAnimationFrame(X);},resume(){ne&&(ne=false,He&&(X=requestAnimationFrame(Ve)));},seek(o){let a=Math.min(1,Math.max(0,o));Ce=a,ye=a,ne=true,cancelAnimationFrame(X),ht(a,v);},getProgress(){return Ce}}}var lt=new Map;function De(e,n){lt.set(e,n);}function Ie(e){lt.delete(e);}function Mt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ct(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let m=[],s=[],f=t[2].trim();if(f)for(let p of f.split(/[\s,]+/)){let c=p.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}n.push({fn:t[1],nums:m,units:s});}return n}function Ct(e,n,r){let t=ct(e),m=ct(n);return t.length===0||t.length!==m.length?r<1?e:n:t.map((s,f)=>{let p=m[f];return s.fn!==p.fn||s.nums.length!==p.nums.length?r<1?`${s.fn}(${s.nums.map((c,g)=>`${c}${s.units[g]}`).join(", ")})`:`${p.fn}(${p.nums.map((c,g)=>`${c}${p.units[g]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,g)=>`${c+(p.nums[g]-c)*r}${s.units[g]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),m=String(n);if(Mt(t))return Oe(t,m,r);if(t.includes("("))return Ct(t,m,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),f=m.match(/^([-+]?[\d.]+)(.*)$/);if(s&&f){let p=parseFloat(s[1]),c=parseFloat(f[1]);return `${p+(c-p)*r}${s[2]||f[2]}`}return r<1?t:m}function $t(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var mt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Pt=0;function kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function pt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:m={},easing:s="ease-out",speed:f=1,once:p=false,axis:c="y",scrollContainer:g,native:A=true,onProgress:_,onComplete:v,onEnter:Q,onLeave:ve,onEnterBack:I,onLeaveBack:te}=n,ie=window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=typeof s=="function"?s:ae[s]??ae["ease-out"],x=me(m.start??"top bottom"),N=me(m.end??"bottom top"),b=typeof g=="string"?document.querySelector(g):g??null,S=Object.entries(t).map(([i,u])=>({prop:$t(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function q(){let i=window.getComputedStyle(e);for(let u of S)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function G(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}if(ie)return G(),v?.(),r;q();function re(){if(!A||!kt()||typeof s!="string"||!(s in mt)||c!=="y"||b||p||f!==1||_||v||Q||ve||I||te||(m.start??"top bottom").trim()!=="top bottom"||(m.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!Lt.has(i.prop))return false;return true}function z(){let i=`ssd-a-${++Pt}`,u=S.map(W=>`${W.prop}:${W.from}`).join(";"),H=S.map(W=>`${W.prop}:${W.to}`).join(";"),P=document.createElement("style");P.setAttribute("data-ssd-animate",""),P.textContent=`@keyframes ${i}{from{${u}}to{${H}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${mt[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(P),e.classList.add(i);let B=()=>c==="x"?window.scrollX:window.scrollY,Z=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),P.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(W){let D=Math.min(1,Math.max(0,W));e.classList.remove(i);for(let C of S)e.style.setProperty(C.prop,ut(C.from,C.to,D));},getProgress(){let W=e.getBoundingClientRect(),D=B(),C=Z(),{tStart:ce,tEnd:fe}=be({top:W.top,height:W.height},D,C,x,N);return J(K(D,ce,fe,f))}}}if(re())return z();let F=0,T=0,j=0,le=false,Y=false,U=-1,d=0,M=false,y=NaN,k=()=>b?c==="x"?b.scrollLeft:b.scrollTop:c==="x"?window.scrollX:window.scrollY,we=()=>b?c==="x"?b.clientWidth:b.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function Ae(){let i=e.getBoundingClientRect(),u,H;if(b){let B=b.getBoundingClientRect();u=c==="x"?i.left-B.left+b.scrollLeft:i.top-B.top+b.scrollTop,H=c==="x"?i.width:i.height;}else u=c==="x"?i.left:i.top,H=c==="x"?i.width:i.height;let P=be({top:u,height:H},k(),we(),x,N);F=P.tStart,T=P.tEnd;}function Me(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let u of S)e.style.setProperty(u.prop,ut(u.from,u.to,i));_?.(i);}function ge(i){if(isNaN(y)){y=i;return}y<=0&&i>0?Q?.():y>0&&i<=0&&te?.(),y<1&&i>=1?ve?.():y>=1&&i<1&&I?.(),y=i;}function pe(){if(!le||Y)return;let i=T===F?0:(k()-F)/(T-F);ge(i);let u=J(K(k(),F,T,f));p&&(U=Math.max(U,u),u=U),d=u,Me(u),u>=1&&!M?(M=true,v?.()):u<1&&!p&&(M=false),j=requestAnimationFrame(pe);}Ae();{let i=J(K(k(),F,T,f));p&&i>0&&(U=i),d=i,Me(i);}let Ne=new IntersectionObserver(i=>{i.forEach(u=>{le=u.isIntersecting,le&&!Y?j=requestAnimationFrame(pe):cancelAnimationFrame(j);});},{root:b??null}),Le;function V(){clearTimeout(Le),Le=setTimeout(Ae,150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),Ne.observe(e),De(e,{type:"animate",getProgress:()=>d,getTrigger:()=>({tStart:F,tEnd:T})}),{destroy(){cancelAnimationFrame(j),Ne.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(Le),Ie(e);},replay(){U=-1,M=false,d=0,Y=false,Me(0);},pause(){Y=true,cancelAnimationFrame(j);},resume(){Y&&(Y=false,le&&(j=requestAnimationFrame(pe)));},seek(i){let u=Math.min(1,Math.max(0,i));d=u,U=u,Y=true,cancelAnimationFrame(j),Me(u);},getProgress(){return d}}}var Ue={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ze(e,n){if(typeof window>"u")return Ue;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),Ue;let t=r,{from:m=0,to:s,format:f,easing:p="ease-out",trigger:c={},once:g=true,decimals:A,onComplete:_}=n,v=A!==void 0?d=>d.toFixed(A):f??(d=>String(Math.round(d))),Q=typeof p=="function"?p:ae[p]??ae["ease-out"],ve=me(c.start??"top 80%"),I=me(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=v(s),_?.(),Ue;t.textContent=v(m);let ie=0,J=0,x=0,N=false,b=false,S=-1,q=0,G=false,re=()=>window.scrollY,z=()=>window.innerHeight;function F(){let d=t.getBoundingClientRect(),M=be({top:d.top,height:d.height},re(),z(),ve,I);ie=M.tStart,J=M.tEnd;}function T(d){t.textContent=v(m+(s-m)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function j(){if(!N||b)return;let d=Q(K(re(),ie,J,1));g&&(S=Math.max(S,d),d=S),q=d,T(d),d>=1&&!G?(G=true,_?.()):d<1&&!g&&(G=false),x=requestAnimationFrame(j);}F();{let d=Q(K(re(),ie,J,1));g&&d>0&&(S=d),q=d,T(d);}let le=new IntersectionObserver(d=>{d.forEach(M=>{N=M.isIntersecting,N&&!b?x=requestAnimationFrame(j):cancelAnimationFrame(x);});}),Y;function U(){clearTimeout(Y),Y=setTimeout(F,150);}return window.addEventListener("resize",U),window.addEventListener("orientationchange",U),le.observe(t),De(t,{type:"counter",getProgress:()=>q,getTrigger:()=>({tStart:ie,tEnd:J})}),{destroy(){cancelAnimationFrame(x),le.disconnect(),window.removeEventListener("resize",U),window.removeEventListener("orientationchange",U),clearTimeout(Y),Ie(t);},replay(){S=-1,G=false,q=0,b=false,T(0);},pause(){b=true,cancelAnimationFrame(x);},resume(){b&&(b=false,N&&(x=requestAnimationFrame(j)));},seek(d){let M=Math.min(1,Math.max(0,d));q=M,S=M,b=true,cancelAnimationFrame(x),T(M);},getProgress(){return q}}}function gt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function Ot(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function ft(e){let n=gt(e),r=new Map;for(let s of n){let f=s.offsetTop;r.has(f)||r.set(f,[]),r.get(f).push(s);}let t=[],m=Array.from(r.keys()).sort((s,f)=>s-f);for(let s of m){let f=r.get(s),p=document.createElement("span");p.setAttribute("aria-hidden","true"),p.style.display="inline-block";for(let c of f)p.appendChild(c);t.push(p);}e.textContent="";for(let s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function Dt(e,n,r,t){if(r<=1||t===0)return e;let m=(r-1)*t,s=n*t,f=s+(1-m);return f<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(f-s)))}function It(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=r,{split:m="words",stagger:s=.04,easing:f="ease-out",from:p={opacity:0,y:24},trigger:c={},once:g=true,onComplete:A}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,v=typeof f=="function"?f:ae[f]??ae["ease-out"],Q=me(c.start??"top 85%"),ve=me(c.end??"top 40%"),I=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let te;m==="chars"?te=Ot(t):m==="lines"?te=ft(t):te=gt(t);let ie=te.length;function J(y,k){p?.opacity!==void 0&&(y.style.opacity=String(p.opacity+(1-p.opacity)*k));let we=It(k,p);we&&(y.style.transform=we);}function x(y){t.style.setProperty("--scroll-draw-progress",String(y)),te.forEach((k,we)=>{let Ae=v(Dt(y,we,ie,s));J(k,Ae);});}if(_)return x(1),A?.(),{destroy(){t.innerHTML=I,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let N=0,b=0,S=0,q=false,G=false,re=-1,z=0,F=false,T=()=>window.scrollY,j=()=>window.innerHeight;function le(){let y=t.getBoundingClientRect(),k=be({top:y.top,height:y.height},T(),j(),Q,ve);N=k.tStart,b=k.tEnd;}function Y(){if(!q||G)return;let y=K(T(),N,b,1);g&&(re=Math.max(re,y),y=re),z=y,x(y),y>=1&&!F?(F=true,A?.()):y<1&&!g&&(F=false),S=requestAnimationFrame(Y);}le();let U=new IntersectionObserver(y=>{y.forEach(k=>{q=k.isIntersecting,q&&!G?S=requestAnimationFrame(Y):cancelAnimationFrame(S);});}),d;function M(){clearTimeout(d),d=setTimeout(()=>{if(m==="lines"){let y=z;t.innerHTML=I,t.setAttribute("aria-label",t.textContent??""),te=ft(t),x(y);}le();},150);}return window.addEventListener("resize",M),window.addEventListener("orientationchange",M),U.observe(t),De(t,{type:"text",getProgress:()=>z,getTrigger:()=>({tStart:N,tEnd:b})}),{destroy(){cancelAnimationFrame(S),U.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),clearTimeout(d),t.innerHTML=I,t.removeAttribute("aria-label"),Ie(t);},replay(){re=-1,F=false,z=0,G=false,x(0);},pause(){G=true,cancelAnimationFrame(S);},resume(){G&&(G=false,q&&(S=requestAnimationFrame(Y)));},seek(y){let k=Math.min(1,Math.max(0,y));z=k,re=k,G=true,cancelAnimationFrame(S),x(k);},getProgress(){return z}}}function Nt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?_e(t,n):(console.warn("[svg-scroll-draw] Container not found:",e),r)}function Ft(e=document){return Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return _e(n,r)})}function Ht(e=document){return Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return pt(n,r)})}function Rt(e=document){return Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(process.env.NODE_ENV!=="production"&&console.warn('[svg-scroll-draw] initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Ze(n,r)})}function qt(e=document){return Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return yt(n,r)})}function br(e=document){return {draw:Ft(e),animate:Ht(e),counter:Rt(e),text:qt(e)}}export{br as initAll,Ht as initScrollAnimate,Rt as initScrollCounter,Ft as initScrollDraw,qt as initScrollText,Nt as scrollDraw};
1
+ function Ft({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let v=Math.pow(l,d);c.push(v),s+=v;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let v=0;v<r;v++)if(d<=u[v+1]){let _=(d-u[v])/(u[v+1]-u[v]);if(v===0)return _*(2-_);let x=1-Math.pow(t,v);return x+(1-x)*(2*_-1)*(2*_-1)}return 1}}function Rt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var le={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:Ft(),elastic:Rt()};function ve(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 dt(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 gt(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 He(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 Nt(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:Nt((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function Le(e,n,r,t,l){let s=dt(e.top,e.height,n,t.element)-gt(t.viewport,r),c=dt(e.top,e.height,n,l.element)-gt(l.viewport,r);return {tStart:s,tEnd:c}}function yt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=yt(e),l=yt(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var ht={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ee(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Ht="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",_t="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",bt=33;function zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function qt(e){let n=[];for(let r=0;r<bt;r++){let t=r/(bt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return Ht;case "ease-out":return _t;case "ease-in-out":return zt()?qt(le["ease-in-out"]):null;default:return null}}var Vt=0;function Wt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Bt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?ee("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&ee("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Gt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,vt=/[MmLlHhVvCcSsQqTtAaZz]/g;function jt(e,n,r){if(!Ze)return;let t=(e.match(vt)??[]).join("").toUpperCase(),l=(n.match(vt)??[]).join("").toUpperCase(),s=(e.match(wt)??[]).length,c=(n.match(wt)??[]).length;if(t!==l){ee(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&ee(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function st(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function et(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...ht[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:v={},stagger:_=0,direction:x="forward",once:oe=false,debug:Oe=false,axis:j="y",scrollContainer:se,autoReverse:ie=false,delay:te=0,strokeColor:T,strokeWidth:W,fillOpacity:L,waypoints:A,velocityScale:F=false,threshold:B=0,rootMargin:P="0px",repeat:M=0,repeatDelay:ce=0,morphTo:D,clip:pe,autoplay:Se=false,duration:de=1e3,native:Ee=true,onProgress:g,onStart:S,onComplete:y,onEnter:$,onLeave:ge,onEnterBack:ye,onLeaveBack:Ce}=l,re=pe===true?"left":typeof pe=="string"?pe:false,he=typeof d=="function"?d:le[d]??le.linear,Te=ve(v.start??"top bottom"),Re=ve(v.end??"bottom top"),ue=typeof se=="string"?document.querySelector(se):se??null,me=Array.isArray(T)?T[0]:null,X=Array.isArray(T)?T[1]:typeof T=="string"?T:null,Y=Array.isArray(W)?W[0]:null,z=Array.isArray(W)?W[1]:typeof W=="number"?W:null,ne=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Ae(o){let a=o*100;switch(re){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 I=re?[]:Array.from(e.querySelectorAll(c)),E=[],i=[],f=0,fe=0,O=false,R=false,N=0,q=false,J=-1,Me=-1,U=false,be=0,Pe=0,ke,tt=null;function at(){tt?.destroy(),tt=null;}let Ie=new Set,lt=NaN,Fe=true,Ge=-1,ct=performance.now(),Ne=NaN;function rt(){return ue?j==="x"?ue.scrollLeft:ue.scrollTop:j==="x"?window.scrollX:window.scrollY}function ut(){return ue?j==="x"?ue.clientWidth:ue.clientHeight:j==="x"?window.innerWidth:window.innerHeight}function mt(){let o=Qe(e,ue,j),a=Le(o,o.scroll,ut(),Te,Re);f=a.tStart,fe=a.tEnd,Oe&&Ze&&(at(),tt=Gt(f,fe,j));}function Dt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),re){let b=a==="reverse"?1-o:o;e.style.clipPath=Ae(b);return}I.forEach((b,Q)=>{b.style.strokeDashoffset=a==="reverse"?`${E[Q]*o}`:`${E[Q]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),me&&X?b.style.stroke=_e(me,X,o):X&&(b.style.stroke=X),Y!==null&&z!==null?b.style.strokeWidth=`${Y+(z-Y)*o}`:z!==null&&(b.style.strokeWidth=`${z}`),ne!==null&&G!==null?b.style.fillOpacity=`${ne+(G-ne)*o}`:G!==null&&(b.style.fillOpacity=`${G}`),D&&b.tagName.toLowerCase()==="path"&&i[Q]&&b.setAttribute("d",st(i[Q],D,o));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),re){e.style.clipPath=Ae(0);return}I.forEach((o,a)=>{o.style.strokeDasharray=`${E[a]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${E[a]}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(I.forEach(o=>{Bt(o);let a=He(o);E.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?jt(i[i.length-1],D,o):ee(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),X&&(o.style.stroke=X),z!==null&&(o.style.strokeWidth=`${z}`),G!==null&&(o.style.fillOpacity=`${G}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=x==="reverse"?"0":`${a}`,m?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",me&&(o.style.stroke=me),Y!==null&&(o.style.strokeWidth=`${Y}`),ne!==null&&(o.style.fillOpacity=`${ne}`));}),re){if(s)return e.style.clipPath=Ae(1),y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ae(0);}else if(s)return y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ft=typeof d=="string"?Ke(d):null;function Ot(){return !(Ee===false||!Wt()||!I.length||!ft||re||j!=="y"||ue||u!==1||_!==0||oe||ie||F!==false||D||A||M||te>0||g||S||y||$||ge||ye||Ce||T!=null||W!=null||L!=null||(v.start??"top bottom").trim()!=="top bottom"||(v.end??"bottom top").trim()!=="bottom top")}function kt(){let o=++Vt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,Q=`--svg-scroll-draw-${o}`,De=x==="reverse"?"0":"var(--ssd-len)",$e=x==="reverse"?"var(--ssd-len)":"0",xe=`stroke-dashoffset:${De};`,w=`stroke-dashoffset:${$e};`;m&&(xe+=`opacity:${x==="reverse"?1:0};`,w+=`opacity:${x==="reverse"?0:1};`);let C=document.createElement("style");C.setAttribute("data-svg-scroll-draw",""),C.textContent=`@keyframes ${a}{from{${xe}}to{${w}}}.${b}{view-timeline-name:${Q};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ft};animation-fill-mode:both;animation-timeline:${Q};animation-range:cover 0% cover 100%;}`,document.head.appendChild(C),e.classList.add(b);function Z(p,V){p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(a);}I.forEach(Z);let h=false,k=-1;function H(){if(k>=0)return k;let p=e.getBoundingClientRect(),{tStart:V,tEnd:we}=Le({top:p.top,height:p.height},rt(),ut(),Te,Re);return he(K(rt(),V,we,u))}return {destroy(){e.classList.remove(b),I.forEach(p=>{p.classList.remove(a),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),C.remove();},replay(){h=false,k=-1,I.forEach(Z);},pause(){h=true,I.forEach(p=>{p.style.animationPlayState="paused";});},resume(){h&&(h=false,I.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let V=Math.min(1,Math.max(0,p));k=V,h=true,I.forEach((we,ae)=>{we.classList.remove(a),we.style.strokeDashoffset=x==="reverse"?`${E[ae]*V}`:`${E[ae]*(1-V)}`,m&&(we.style.opacity=x==="reverse"?`${1-V}`:`${V}`);});},getProgress(){return H()},refresh(){I.forEach((p,V)=>{E[V]=He(p),p.style.setProperty("--ssd-len",String(E[V])),p.style.strokeDasharray=`${E[V]}`;});}}}if(Ot())return kt();function It(){let o=Math.max(1,de),a=0,b=0,Q=false;function De(h){let k=true;if(re){let H=Math.min(1,Math.max(0,h/o)),p=he(H);be=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=Ae(x==="reverse"?1-p:p),g?.(p),H<1&&(k=false);}else I.forEach((H,p)=>{let V=p*_*o,we=Math.min(1,Math.max(0,(h-V)/o)),ae=he(we);H.style.strokeDashoffset=x==="reverse"?`${E[p]*ae}`:`${E[p]*(1-ae)}`,m&&(H.style.opacity=x==="reverse"?`${1-ae}`:`${ae}`),me&&X?H.style.stroke=_e(me,X,ae):X&&(H.style.stroke=X),Y!==null&&z!==null?H.style.strokeWidth=`${Y+(z-Y)*ae}`:z!==null&&(H.style.strokeWidth=`${z}`),ne!==null&&G!==null?H.style.fillOpacity=`${ne+(G-ne)*ae}`:G!==null&&(H.style.fillOpacity=`${G}`),D&&H.tagName.toLowerCase()==="path"&&i[p]&&H.setAttribute("d",st(i[p],D,ae)),p===0&&(be=ae,g?.(ae),e.style.setProperty("--scroll-draw-progress",String(ae))),we<1&&(k=false);});if(A){let H=Math.min(1,Math.max(0,h/o)),p=he(H);for(let V in A){let we=parseFloat(V);p>=we&&!Ie.has(we)&&(Ie.add(we),A[V]?.());}}return k}function $e(h){if(U)return;let k=h-a;R||(R=true,S?.());let H=De(k);if(H&&!O){O=true,De(o*(1+Math.max(0,I.length-1)*_)),y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{a=performance.now(),R=false,O=false,Ie.clear(),je(),N=requestAnimationFrame($e);},ce));return}H||(N=requestAnimationFrame($e));}function xe(){cancelAnimationFrame(N),clearTimeout(ke),a=performance.now(),b=0,U=false,R=false,O=false,Pe=0,Q=true,be=0,Ie.clear(),je(),N=requestAnimationFrame($e);}let w=new IntersectionObserver(h=>{h.forEach(k=>{k.isIntersecting&&!(oe&&O)?xe():!k.isIntersecting&&!oe&&!O&&(cancelAnimationFrame(N),clearTimeout(ke),Q=false);});},{root:ue??null,threshold:B,rootMargin:P}),C;function Z(){clearTimeout(C),C=setTimeout(()=>{I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),te>0?setTimeout(()=>w.observe(e),te):w.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),w.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(C);},replay(){Pe=0,xe();},pause(){U||!Q||(U=true,b=performance.now()-a,cancelAnimationFrame(N));},resume(){U&&(U=false,Q=true,a=performance.now()-b,N=requestAnimationFrame($e));},seek(h){let k=Math.min(1,Math.max(0,h));be=k,U=true,b=k*o,a=performance.now()-b,cancelAnimationFrame(N),De(b);},getProgress(){return be},refresh(){clearTimeout(C),I.forEach((h,k)=>{E[k]=He(h),h.style.strokeDasharray=`${E[k]}`;});}}}if(Se)return It();mt();function Ue(){if(!q||U)return;let o=performance.now(),a=rt();if(!Fe&&F===false&&a===lt){N=requestAnimationFrame(Ue);return}Fe=false,lt=a;let b=u;if(F!==false){let w=o-ct,C=w>0?Math.abs(a-(Ge<0?a:Ge))/w:0;b=u*Math.max(.2,1+C*(typeof F=="number"?F:1)*.04);}Ge=a,ct=o;let Q=ie?Me===-1||a>=Me?"forward":"reverse":x;Me=a;let De=fe-f,$e=true,xe=De===0?0:(a-f)/De;if(isNaN(Ne)||(Ne<=0&&xe>0?$?.():Ne>0&&xe<=0&&Ce?.(),Ne<1&&xe>=1?ge?.():Ne>=1&&xe<1&&ye?.()),Ne=xe,re){let w=he(K(a,f,fe,b));oe&&!ie&&(J=Math.max(J,w),w=J),be=w,e.style.setProperty("--scroll-draw-progress",String(w));let C=Q==="reverse"?1-w:w;e.style.clipPath=Ae(C),g?.(w),!R&&K(a,f,fe,b)>0&&(R=true,S?.()),w>=1&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,e.style.clipPath=Ae(0);},ce))):w<1&&!oe&&(O=false),N=requestAnimationFrame(Ue);return}if(I.forEach((w,C)=>{let Z=C*_*De,h=he(K(a,f+Z,fe+Z,b));oe&&!ie&&(J=Math.max(J,h),h=J),be=h,w.style.strokeDashoffset=Q==="reverse"?`${E[C]*h}`:`${E[C]*(1-h)}`,m&&(w.style.opacity=Q==="reverse"?`${1-h}`:`${h}`),me&&X?w.style.stroke=_e(me,X,h):X&&(w.style.stroke=X),Y!==null&&z!==null?w.style.strokeWidth=`${Y+(z-Y)*h}`:z!==null&&(w.style.strokeWidth=`${z}`),ne!==null&&G!==null?w.style.fillOpacity=`${ne+(G-ne)*h}`:G!==null&&(w.style.fillOpacity=`${G}`),D&&w.tagName.toLowerCase()==="path"&&i[C]&&w.setAttribute("d",st(i[C],D,h)),C===0&&(g?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&($e=false);}),A){let w=he(K(a,f,fe,b));for(let C in A){let Z=parseFloat(C);w>=Z&&!Ie.has(Z)&&(Ie.add(Z),A[C]?.());}}!R&&K(a,f,fe,b)>0&&(R=true,S?.()),$e&&!O?(O=true,y?.(),Pe<(M==="infinite"?1/0:M??0)&&(Pe++,ke=setTimeout(()=>{J=-1,R=false,O=false,Ie.clear(),je(),Fe=true;},ce))):!$e&&!oe&&(O=false),N=requestAnimationFrame(Ue);}let nt=false;function Xe(){nt||(nt=true,N=requestAnimationFrame(function(){Ue();}));}function Ye(){nt=false,cancelAnimationFrame(N);}let ot=new IntersectionObserver(o=>{o.forEach(a=>{q=a.isIntersecting,q&&!U?(Fe=true,Xe()):Ye();});},{root:ue??null,threshold:B,rootMargin:P});function pt(){I.forEach((o,a)=>{E[a]=He(o),o.style.strokeDasharray=`${E[a]}`;}),mt(),Fe=true;}let Je;function Ve(){clearTimeout(Je),Je=setTimeout(pt,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>Ve()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),te>0?setTimeout(()=>ot.observe(e),te):ot.observe(e),{destroy(){cancelAnimationFrame(N),clearTimeout(ke),Ye(),ot.disconnect(),We?.disconnect(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(Je),at();},replay(){J=-1,Me=-1,Ge=-1,R=false,O=false,Pe=0,U=false,be=0,Ie.clear(),clearTimeout(ke),je(),Fe=true,q&&Xe();},pause(){U=true,Ye();},resume(){U&&(U=false,Fe=true,q&&Xe());},seek(o){let a=Math.min(1,Math.max(0,o));be=a,J=a,U=true,Ye(),Dt(a,x),Fe=true;},getProgress(){return be},refresh(){clearTimeout(Je),pt(),q&&!U&&Xe();}}}var St=new Map;function ze(e,n){St.set(e,n);}function qe(e){St.delete(e);}function Ut(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Et(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function Xt(e,n,r){let t=Et(e),l=Et(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function xt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Ut(t))return _e(t,l,r);if(t.includes("("))return Xt(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function Yt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Jt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Qt=0,Tt="--scroll-draw-progress";function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function At(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:v=true,velocityScale:_=false,respectReducedMotion:x=true,triggerElement:oe,onProgress:Oe,onComplete:j,onEnter:se,onLeave:ie,onEnterBack:te,onLeaveBack:T}=n,W=x&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:le[s]??le["ease-out"],A=ve(l.start??"top bottom"),F=ve(l.end??"bottom top"),B=oe??e,P=typeof d=="string"?document.querySelector(d):d??null,M=Object.entries(t).map(([i,f])=>({prop:Yt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function ce(){let i=window.getComputedStyle(e);for(let f of M)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of M)e.style.setProperty(i.prop,String(i.to));}let pe=new Map;for(let i of [...M.map(f=>f.prop),Tt])pe.set(i,e.style.getPropertyValue(i));function Se(){for(let[i,f]of pe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(W)return D(),j?.(),{...r,destroy:Se,getProgress:()=>1};ce();let de=typeof s=="string"?Ke(s):null;function Ee(){if(!v||!Zt()||!de||m!=="y"||P||B!==e||u||c!==1||Oe||j||se||ie||te||T||_!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of M)if(!Jt.has(i.prop))return false;return true}function g(){let i=`ssd-a-${++Qt}`,f=M.map(q=>`${q.prop}:${q.from}`).join(";"),fe=M.map(q=>`${q.prop}:${q.to}`).join(";"),O=document.createElement("style");O.setAttribute("data-ssd-animate",""),O.textContent=`@keyframes ${i}{from{${f}}to{${fe}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${de};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(i);let R=()=>m==="x"?window.scrollX:window.scrollY,N=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),O.remove(),e.style.animationPlayState="",Se();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(q){let J=Math.min(1,Math.max(0,q));e.classList.remove(i);for(let Me of M)e.style.setProperty(Me.prop,xt(Me.from,Me.to,J));},getProgress(){let q=e.getBoundingClientRect(),J=R(),Me=N(),{tStart:U,tEnd:be}=Le({top:q.top,height:q.height},J,Me,A,F);return L(K(J,U,be,c))}}}if(Ee())return g();let S=0,y=0,$=0,ge=false,ye=false,Ce=-1,re=0,he=false,Te=NaN,Re=-1,ue=0,me=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,X=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function Y(){let i=Qe(B,P,m),f=Le(i,i.scroll,X(),A,F);S=f.tStart,y=f.tEnd;}function z(i){e.style.setProperty(Tt,String(i));for(let f of M)e.style.setProperty(f.prop,xt(f.from,f.to,i));Oe?.(i);}function ne(i){if(isNaN(Te)){Te=i;return}Te<=0&&i>0?se?.():Te>0&&i<=0&&T?.(),Te<1&&i>=1?ie?.():Te>=1&&i<1&&te?.(),Te=i;}function G(){if(!ge||ye)return;let i=performance.now(),f=me(),fe=c;if(_!==false){let N=i-ue,q=N>0?Math.abs(f-(Re<0?f:Re))/N:0;fe=c*Math.max(.2,1+q*(typeof _=="number"?_:1)*.04);}Re=f,ue=i;let O=y===S?0:(f-S)/(y-S);ne(O);let R=L(K(f,S,y,fe));u&&(Ce=Math.max(Ce,R),R=Ce),re=R,z(R),R>=1&&!he?(he=true,j?.()):R<1&&!u&&(he=false),$=requestAnimationFrame(G);}Y(),y===S&&ee("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=L(K(me(),S,y,c));u&&i>0&&(Ce=i),re=i,z(i);}let Ae=new IntersectionObserver(i=>{i.forEach(f=>{ge=f.isIntersecting,ge&&!ye?$=requestAnimationFrame(G):cancelAnimationFrame($);});},{root:P??null}),I;function E(){clearTimeout(I),I=setTimeout(Y,150);}return window.addEventListener("resize",E),window.addEventListener("orientationchange",E),Ae.observe(e),ze(e,{type:"animate",getProgress:()=>re,getTrigger:()=>({tStart:S,tEnd:y})}),{destroy(){cancelAnimationFrame($),Ae.disconnect(),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),clearTimeout(I),Se(),qe(e);},replay(){Ce=-1,he=false,re=0,ye=false,z(0);},pause(){ye=true,cancelAnimationFrame($);},resume(){ye&&(ye=false,ge&&($=requestAnimationFrame(G)));},seek(i){let f=Math.min(1,Math.max(0,i));re=f,Ce=f,ye=true,cancelAnimationFrame($),z(f);},getProgress(){return re}}}var it={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mt(e,n){if(typeof window>"u")return it;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollCounter: element not found:",e),it;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:v,onComplete:_}=n,x=v!==void 0?g=>g.toFixed(v):c??(g=>String(Math.round(g))),oe=typeof u=="function"?u:le[u]??le["ease-out"],Oe=ve(m.start??"top 80%"),j=ve(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=x(s),_?.(),it;let ie=0,te=0,T=0,W=false,L=false,A=-1,F=0,B=false,P=()=>window.scrollY,M=()=>window.innerHeight;function ce(){let g=t.getBoundingClientRect(),S=Le({top:g.top,height:g.height},P(),M(),Oe,j);ie=S.tStart,te=S.tEnd;}function D(g){t.textContent=x(l+(s-l)*g),t.style.setProperty("--scroll-draw-progress",String(g));}function pe(){if(!W||L)return;let g=oe(K(P(),ie,te,1));d&&(A=Math.max(A,g),g=A),F=g,D(g),g>=1&&!B?(B=true,_?.()):g<1&&!d&&(B=false),T=requestAnimationFrame(pe);}ce();{let g=oe(K(P(),ie,te,1));d&&g>0&&(A=g),F=g,D(g);}let Se=new IntersectionObserver(g=>{g.forEach(S=>{W=S.isIntersecting,W&&!L?T=requestAnimationFrame(pe):cancelAnimationFrame(T);});}),de;function Ee(){clearTimeout(de),de=setTimeout(ce,150);}return window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee),Se.observe(t),ze(t,{type:"counter",getProgress:()=>F,getTrigger:()=>({tStart:ie,tEnd:te})}),{destroy(){cancelAnimationFrame(T),Se.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),clearTimeout(de),qe(t);},replay(){A=-1,B=false,F=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(T);},resume(){L&&(L=false,W&&(T=requestAnimationFrame(pe)));},seek(g){let S=Math.min(1,Math.max(0,g));F=S,A=S,L=true,cancelAnimationFrame(T),D(S);},getProgress(){return F}}}function Ct(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 Kt(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 $t(e){let n=Ct(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let v=m.nextElementSibling;u.appendChild(m),d<c.length-1&&v&&v.style.whiteSpace==="pre"&&u.appendChild(v);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function er(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function tr(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 Lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Pt(e,n={}){if(typeof window>"u")return Lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ee("scrollText: element not found:",e),Lt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:v}=n,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof c=="function"?c:le[c]??le["ease-out"],oe=ve(m.start??"top 85%"),Oe=ve(m.end??"top 40%"),j=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let se;l==="chars"?se=Kt(t):l==="lines"?se=$t(t):se=Ct(t);let ie=se.length;function te(y,$){u?.opacity!==void 0&&(y.style.opacity=String(u.opacity+(1-u.opacity)*$));let ge=tr($,u);ge&&(y.style.transform=ge);}function T(y){t.style.setProperty("--scroll-draw-progress",String(y)),se.forEach(($,ge)=>{let ye=x(er(y,ge,ie,s));te($,ye);});}if(_)return T(1),v?.(),{destroy(){t.innerHTML=j,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T(0);let W=0,L=0,A=0,F=false,B=false,P=-1,M=0,ce=false,D=()=>window.scrollY,pe=()=>window.innerHeight;function Se(){let y=t.getBoundingClientRect(),$=Le({top:y.top,height:y.height},D(),pe(),oe,Oe);W=$.tStart,L=$.tEnd;}function de(){if(!F||B)return;let y=K(D(),W,L,1);d&&(P=Math.max(P,y),y=P),M=y,T(y),y>=1&&!ce?(ce=true,v?.()):y<1&&!d&&(ce=false),A=requestAnimationFrame(de);}Se();let Ee=new IntersectionObserver(y=>{y.forEach($=>{F=$.isIntersecting,F&&!B?A=requestAnimationFrame(de):cancelAnimationFrame(A);});}),g;function S(){clearTimeout(g),g=setTimeout(()=>{if(l==="lines"){let y=M;t.innerHTML=j,t.setAttribute("aria-label",t.textContent??""),se=$t(t),T(y);}Se();},150);}return window.addEventListener("resize",S),window.addEventListener("orientationchange",S),Ee.observe(t),ze(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:W,tEnd:L})}),{destroy(){cancelAnimationFrame(A),Ee.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S),clearTimeout(g),t.innerHTML=j,t.removeAttribute("aria-label"),qe(t);},replay(){P=-1,ce=false,M=0,B=false,T(0);},pause(){B=true,cancelAnimationFrame(A);},resume(){B&&(B=false,F&&(A=requestAnimationFrame(de)));},seek(y){let $=Math.min(1,Math.max(0,y));M=$,P=$,B=true,cancelAnimationFrame(A),T($);},getProgress(){return M}}}function rr(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?et(t,n):(ee("Container not found:",e),r)}function Be(){return typeof document>"u"?null:document}function nr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return et(n,r)}):[]}function or(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return At(n,r)}):[]}function sr(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(ee('initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Mt(n,r)}):[]}function ir(e=Be()){return e?Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return Pt(n,r)}):[]}function _r(e=Be()){return {draw:nr(e),animate:or(e),counter:sr(e),text:ir(e)}}export{_r as initAll,or as initScrollAnimate,sr as initScrollCounter,nr as initScrollDraw,ir as initScrollText,rr as scrollDraw};