svg-scroll-draw 2.10.0 → 2.10.2

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 (44) hide show
  1. package/README.md +19 -10
  2. package/dist/angular/index.cjs +2 -2
  3. package/dist/angular/index.mjs +2 -2
  4. package/dist/astro/index.cjs +2 -2
  5. package/dist/astro/index.mjs +2 -2
  6. package/dist/cdn/svg-scroll-draw.dev.global.js +55 -29
  7. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  8. package/dist/cinematic/index.cjs +2 -2
  9. package/dist/cinematic/index.mjs +2 -2
  10. package/dist/devtools/index.cjs +1 -1
  11. package/dist/devtools/index.mjs +1 -1
  12. package/dist/group/index.cjs +2 -2
  13. package/dist/group/index.mjs +2 -2
  14. package/dist/horizontal/index.cjs +1 -1
  15. package/dist/horizontal/index.mjs +1 -1
  16. package/dist/index.cjs +3 -3
  17. package/dist/index.mjs +3 -3
  18. package/dist/nuxt/index.cjs +2 -2
  19. package/dist/nuxt/index.mjs +2 -2
  20. package/dist/pin/index.cjs +1 -1
  21. package/dist/pin/index.mjs +1 -1
  22. package/dist/progress/index.cjs +1 -1
  23. package/dist/progress/index.mjs +1 -1
  24. package/dist/react/index.cjs +2 -2
  25. package/dist/react/index.mjs +2 -2
  26. package/dist/reveal/index.cjs +1 -1
  27. package/dist/reveal/index.mjs +1 -1
  28. package/dist/snap/index.cjs +1 -1
  29. package/dist/snap/index.mjs +1 -1
  30. package/dist/solid/index.cjs +2 -2
  31. package/dist/solid/index.mjs +2 -2
  32. package/dist/svelte/index.cjs +2 -2
  33. package/dist/svelte/index.mjs +2 -2
  34. package/dist/text/index.cjs +1 -1
  35. package/dist/text/index.mjs +1 -1
  36. package/dist/timeline/index.cjs +8 -8
  37. package/dist/timeline/index.mjs +8 -8
  38. package/dist/video/index.cjs +1 -1
  39. package/dist/video/index.mjs +1 -1
  40. package/dist/vue/index.cjs +2 -2
  41. package/dist/vue/index.mjs +2 -2
  42. package/dist/web-component/index.cjs +3 -3
  43. package/dist/web-component/index.mjs +3 -3
  44. package/package.json +255 -68
@@ -1,3 +1,3 @@
1
- 'use strict';function Rt({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 x=Math.pow(l,d);c.push(x),s+=x;}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 x=0;x<r;x++)if(d<=u[x+1]){let N=(d-u[x])/(u[x+1]-u[x]);if(x===0)return N*(2-N);let L=1-Math.pow(t,x);return L+(1-L)*(2*N-1)*(2*N-1)}return 1}}function Ht({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 ee={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:Rt(),elastic:Ht()};function pe(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 ht(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 bt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Nt(e,n,r){return Math.min(r,Math.max(n,e))}function Q(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 xe(e,n,r,t,l){let s=ht(e.top,e.height,n,t.element)-bt(t.viewport,r),c=ht(e.top,e.height,n,l.element)-bt(l.viewport,r);return {tStart:s,tEnd:c}}function wt(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=wt(e),l=wt(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 vt={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 ye(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Vt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",zt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function _t(){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<St;r++){let t=r/(St-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Je(e){switch(e){case "linear":return "linear";case "ease-in":return Vt;case "ease-out":return zt;case "ease-in-out":return _t()?qt(ee["ease-in-out"]):null;default:return null}}var Wt=0;function Bt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Gt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?ye("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&ye("Element has a fill \u2014 it may obscure the stroke animation.",e);}function jt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
1
+ 'use strict';function Vt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function zt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Vt(),elastic:zt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function wt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function vt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function _t(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:_t((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=wt(e.top,e.height,n,t.element)-vt(t.viewport,r),c=wt(e.top,e.height,n,l.element)-vt(l.viewport,r);return {tStart:s,tEnd:c}}function St(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=St(e),l=St(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Wt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function Bt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Gt(e){let n=[];for(let r=0;r<Tt;r++){let t=r/(Tt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return qt;case "ease-out":return Wt;case "ease-in-out":return Bt()?Gt(re["ease-in-out"]):null;default:return null}}var xt=Symbol.for("svg-scroll-draw.registry");function At(){let e=globalThis;return e[xt]||(e[xt]=new Map)}function Le(e,n){At().set(e,n);}function $e(e){At().delete(e);}var jt=0;function Yt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ut(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?we("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Xt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Et=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Tt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Ut(e,n,r){if(!Ze)return;let t=(e.match(Tt)??[]).join("").toUpperCase(),l=(n.match(Tt)??[]).join("").toUpperCase(),s=(e.match(Et)??[]).length,c=(n.match(Et)??[]).length;if(t!==l){ye(`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&&ye(`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 lt(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 Ke(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...vt[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:x={},stagger:N=0,direction:L="forward",once:te=false,debug:Me=false,axis:W="y",scrollContainer:Z,autoReverse:X=false,delay:B=0,strokeColor:A,strokeWidth:$,fillOpacity:M,waypoints:w,velocityScale:I=false,threshold:O=0,rootMargin:C="0px",repeat:E=0,repeatDelay:re=0,morphTo:k,clip:ne,autoplay:oe=false,duration:J=1e3,native:ue=true,onProgress:y,onStart:T,onComplete:g,onEnter:p,onLeave:F,onEnterBack:de,onLeaveBack:ve}=l,me=ne===true?"left":typeof ne=="string"?ne:false,Se=typeof d=="function"?d:ee[d]??ee.linear,Le=pe(x.start??"top bottom"),Ne=pe(x.end??"bottom top"),he=typeof Z=="string"?document.querySelector(Z):Z??null,be=Array.isArray(A)?A[0]:null,se=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ie=Array.isArray($)?$[0]:null,G=Array.isArray($)?$[1]:typeof $=="number"?$:null,fe=Array.isArray(M)?M[0]:null,Y=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function $e(o){let a=o*100;switch(me){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 V=me?[]:Array.from(e.querySelectorAll(c)),P=[],i=[],f=0,we=0,R=false,z=false,_=0,j=false,ae=-1,Ce=-1,K=false,Ee=0,Ie=0,ke,ot=null;function ut(){ot?.destroy(),ot=null;}let De=new Set,mt=NaN,Fe=true,Be=-1,ft=performance.now(),Ve=NaN;function st(){return he?W==="x"?he.scrollLeft:he.scrollTop:W==="x"?window.scrollX:window.scrollY}function pt(){return he?W==="x"?he.clientWidth:he.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function dt(){let o=Qe(e,he,W),a=xe(o,o.scroll,pt(),Le,Ne);f=a.tStart,we=a.tEnd,Me&&Ze&&(ut(),ot=jt(f,we,W));}function Ot(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),me){let v=a==="reverse"?1-o:o;e.style.clipPath=$e(v);return}V.forEach((v,le)=>{v.style.strokeDashoffset=a==="reverse"?`${P[le]*o}`:`${P[le]*(1-o)}`,m&&(v.style.opacity=a==="reverse"?`${1-o}`:`${o}`),be&&se?v.style.stroke=_e(be,se,o):se&&(v.style.stroke=se),ie!==null&&G!==null?v.style.strokeWidth=`${ie+(G-ie)*o}`:G!==null&&(v.style.strokeWidth=`${G}`),fe!==null&&Y!==null?v.style.fillOpacity=`${fe+(Y-fe)*o}`:Y!==null&&(v.style.fillOpacity=`${Y}`),k&&v.tagName.toLowerCase()==="path"&&i[le]&&v.setAttribute("d",lt(i[le],k,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),me){e.style.clipPath=$e(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${P[a]}`,o.style.strokeDashoffset=L==="reverse"?"0":`${P[a]}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`),k&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{Gt(o);let a=ze(o);P.push(a);let v=o.tagName.toLowerCase()==="path";v?i.push(o.getAttribute("d")??""):i.push(""),k&&(v?Ut(i[i.length-1],k,o):ye(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=L==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),se&&(o.style.stroke=se),G!==null&&(o.style.strokeWidth=`${G}`),Y!==null&&(o.style.fillOpacity=`${Y}`),k&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",k)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=L==="reverse"?"0":`${a}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`));}),me){if(s)return e.style.clipPath=$e(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=$e(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof d=="string"?Je(d):null;function kt(){return !(ue===false||!Bt()||!V.length||!gt||me||W!=="y"||he||u!==1||N!==0||te||X||I!==false||k||w||E||B>0||y||T||g||p||F||de||ve||A!=null||$!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function Dt(){let o=++Wt,a=`svg-scroll-draw-${o}`,v=`svg-scroll-draw-host-${o}`,le=`--svg-scroll-draw-${o}`,Oe=L==="reverse"?"0":"var(--ssd-len)",Pe=L==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Oe};`,S=`stroke-dashoffset:${Pe};`;m&&(Ae+=`opacity:${L==="reverse"?1:0};`,S+=`opacity:${L==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${a}{from{${Ae}}to{${S}}}.${v}{view-timeline-name:${le};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${le};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(v);function ce(h,U){h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(a);}V.forEach(ce);let b=false,H=-1;function q(){if(H>=0)return H;let h=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:h.top,height:h.height},st(),pt(),Le,Ne);return Se(Q(st(),U,Te,u))}return {destroy(){e.classList.remove(v),V.forEach(h=>{h.classList.remove(a),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),D.remove();},replay(){b=false,H=-1,V.forEach(ce);},pause(){b=true,V.forEach(h=>{h.style.animationPlayState="paused";});},resume(){b&&(b=false,V.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let U=Math.min(1,Math.max(0,h));H=U,b=true,V.forEach((Te,ge)=>{Te.classList.remove(a),Te.style.strokeDashoffset=L==="reverse"?`${P[ge]*U}`:`${P[ge]*(1-U)}`,m&&(Te.style.opacity=L==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return q()},refresh(){V.forEach((h,U)=>{P[U]=ze(h),h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`;});}}}if(kt())return Dt();function Ft(){let o=Math.max(1,J),a=0,v=0,le=false;function Oe(b){let H=true;if(me){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);Ee=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=$e(L==="reverse"?1-h:h),y?.(h),q<1&&(H=false);}else V.forEach((q,h)=>{let U=h*N*o,Te=Math.min(1,Math.max(0,(b-U)/o)),ge=Se(Te);q.style.strokeDashoffset=L==="reverse"?`${P[h]*ge}`:`${P[h]*(1-ge)}`,m&&(q.style.opacity=L==="reverse"?`${1-ge}`:`${ge}`),be&&se?q.style.stroke=_e(be,se,ge):se&&(q.style.stroke=se),ie!==null&&G!==null?q.style.strokeWidth=`${ie+(G-ie)*ge}`:G!==null&&(q.style.strokeWidth=`${G}`),fe!==null&&Y!==null?q.style.fillOpacity=`${fe+(Y-fe)*ge}`:Y!==null&&(q.style.fillOpacity=`${Y}`),k&&q.tagName.toLowerCase()==="path"&&i[h]&&q.setAttribute("d",lt(i[h],k,ge)),h===0&&(Ee=ge,y?.(ge),e.style.setProperty("--scroll-draw-progress",String(ge))),Te<1&&(H=false);});if(w){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);for(let U in w){let Te=parseFloat(U);h>=Te&&!De.has(Te)&&(De.add(Te),w[U]?.());}}return H}function Pe(b){if(K)return;let H=b-a;z||(z=true,T?.());let q=Oe(H);if(q&&!R){R=true,Oe(o*(1+Math.max(0,V.length-1)*N)),g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,ke=setTimeout(()=>{a=performance.now(),z=false,R=false,De.clear(),Ge(),_=requestAnimationFrame(Pe);},re));return}q||(_=requestAnimationFrame(Pe));}function Ae(){cancelAnimationFrame(_),clearTimeout(ke),a=performance.now(),v=0,K=false,z=false,R=false,Ie=0,le=true,Ee=0,De.clear(),Ge(),_=requestAnimationFrame(Pe);}let S=new IntersectionObserver(b=>{b.forEach(H=>{H.isIntersecting&&!(te&&R)?Ae():!H.isIntersecting&&!te&&!R&&(cancelAnimationFrame(_),clearTimeout(ke),le=false);});},{root:he??null,threshold:O,rootMargin:C}),D;function ce(){clearTimeout(D),D=setTimeout(()=>{V.forEach((b,H)=>{P[H]=ze(b),b.style.strokeDasharray=`${P[H]}`;});},150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),B>0?setTimeout(()=>S.observe(e),B):S.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(ke),S.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(D);},replay(){Ie=0,Ae();},pause(){K||!le||(K=true,v=performance.now()-a,cancelAnimationFrame(_));},resume(){K&&(K=false,le=true,a=performance.now()-v,_=requestAnimationFrame(Pe));},seek(b){let H=Math.min(1,Math.max(0,b));Ee=H,K=true,v=H*o,a=performance.now()-v,cancelAnimationFrame(_),Oe(v);},getProgress(){return Ee},refresh(){clearTimeout(D),V.forEach((b,H)=>{P[H]=ze(b),b.style.strokeDasharray=`${P[H]}`;});}}}if(oe)return Ft();dt();function je(){if(!j||K)return;let o=performance.now(),a=st();if(!Fe&&I===false&&a===mt){_=requestAnimationFrame(je);return}Fe=false,mt=a;let v=u;if(I!==false){let S=o-ft,D=S>0?Math.abs(a-(Be<0?a:Be))/S:0;v=u*Math.max(.2,1+D*(typeof I=="number"?I:1)*.04);}Be=a,ft=o;let le=X?Ce===-1||a>=Ce?"forward":"reverse":L;Ce=a;let Oe=we-f,Pe=true,Ae=Oe===0?0:(a-f)/Oe;if(isNaN(Ve)||(Ve<=0&&Ae>0?p?.():Ve>0&&Ae<=0&&ve?.(),Ve<1&&Ae>=1?F?.():Ve>=1&&Ae<1&&de?.()),Ve=Ae,me){let S=Se(Q(a,f,we,v));te&&!X&&(ae=Math.max(ae,S),S=ae),Ee=S,e.style.setProperty("--scroll-draw-progress",String(S));let D=le==="reverse"?1-S:S;e.style.clipPath=$e(D),y?.(S),!z&&Q(a,f,we,v)>0&&(z=true,T?.()),S>=1&&!R?(R=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,ke=setTimeout(()=>{ae=-1,z=false,R=false,e.style.clipPath=$e(0);},re))):S<1&&!te&&(R=false),_=requestAnimationFrame(je);return}if(V.forEach((S,D)=>{let ce=D*N*Oe,b=Se(Q(a,f+ce,we+ce,v));te&&!X&&(ae=Math.max(ae,b),b=ae),Ee=b,S.style.strokeDashoffset=le==="reverse"?`${P[D]*b}`:`${P[D]*(1-b)}`,m&&(S.style.opacity=le==="reverse"?`${1-b}`:`${b}`),be&&se?S.style.stroke=_e(be,se,b):se&&(S.style.stroke=se),ie!==null&&G!==null?S.style.strokeWidth=`${ie+(G-ie)*b}`:G!==null&&(S.style.strokeWidth=`${G}`),fe!==null&&Y!==null?S.style.fillOpacity=`${fe+(Y-fe)*b}`:Y!==null&&(S.style.fillOpacity=`${Y}`),k&&S.tagName.toLowerCase()==="path"&&i[D]&&S.setAttribute("d",lt(i[D],k,b)),D===0&&(y?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Pe=false);}),w){let S=Se(Q(a,f,we,v));for(let D in w){let ce=parseFloat(D);S>=ce&&!De.has(ce)&&(De.add(ce),w[D]?.());}}!z&&Q(a,f,we,v)>0&&(z=true,T?.()),Pe&&!R?(R=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,ke=setTimeout(()=>{ae=-1,z=false,R=false,De.clear(),Ge(),Fe=true;},re))):!Pe&&!te&&(R=false),_=requestAnimationFrame(je);}let it=false;function Ue(){it||(it=true,_=requestAnimationFrame(function(){je();}));}function Xe(){it=false,cancelAnimationFrame(_);}let at=new IntersectionObserver(o=>{o.forEach(a=>{j=a.isIntersecting,j&&!K?(Fe=true,Ue()):Xe();});},{root:he??null,threshold:O,rootMargin:C});function yt(){V.forEach((o,a)=>{P[a]=ze(o),o.style.strokeDasharray=`${P[a]}`;}),dt(),Fe=true;}let Ye;function qe(){clearTimeout(Ye),Ye=setTimeout(yt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),B>0?setTimeout(()=>at.observe(e),B):at.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(ke),Xe(),at.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Ye),ut();},replay(){ae=-1,Ce=-1,Be=-1,z=false,R=false,Ie=0,K=false,Ee=0,De.clear(),clearTimeout(ke),Ge(),Fe=true,j&&Ue();},pause(){K=true,Xe();},resume(){K&&(K=false,Fe=true,j&&Ue());},seek(o){let a=Math.min(1,Math.max(0,o));Ee=a,ae=a,K=true,Xe(),Ot(a,L),Fe=true;},getProgress(){return Ee},refresh(){clearTimeout(Ye),yt(),j&&!K&&Ue();}}}var xt=new Map;function Re(e,n){xt.set(e,n);}function He(e){xt.delete(e);}function Xt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function At(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 Yt(e,n,r){let t=At(e),l=At(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 Mt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Xt(t))return _e(t,l,r);if(t.includes("("))return Yt(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 Qt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Zt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Jt=0,Lt="--scroll-draw-progress";function Kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:x=true,velocityScale:N=false,respectReducedMotion:L=true,triggerElement:te,onProgress:Me,onComplete:W,onEnter:Z,onLeave:X,onEnterBack:B,onLeaveBack:A}=n,$=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:ee[s]??ee["ease-out"],w=pe(l.start??"top bottom"),I=pe(l.end??"bottom top"),O=te??e,C=typeof d=="string"?document.querySelector(d):d??null,E=Object.entries(t).map(([i,f])=>({prop:Qt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function re(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function k(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let ne=new Map;for(let i of [...E.map(f=>f.prop),Lt])ne.set(i,e.style.getPropertyValue(i));function oe(){for(let[i,f]of ne)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if($)return k(),W?.(),{...r,destroy:oe,getProgress:()=>1};re();let J=typeof s=="string"?Je(s):null;function ue(){if(!x||!Kt()||!J||m!=="y"||C||O!==e||u||c!==1||Me||W||Z||X||B||A||N!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!Zt.has(i.prop))return false;return true}function y(){let i=`ssd-a-${++Jt}`,f=E.map(j=>`${j.prop}:${j.from}`).join(";"),we=E.map(j=>`${j.prop}:${j.to}`).join(";"),R=document.createElement("style");R.setAttribute("data-ssd-animate",""),R.textContent=`@keyframes ${i}{from{${f}}to{${we}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${J};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(i);let z=()=>m==="x"?window.scrollX:window.scrollY,_=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),R.remove(),e.style.animationPlayState="",oe();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(j){let ae=Math.min(1,Math.max(0,j));e.classList.remove(i);for(let Ce of E)e.style.setProperty(Ce.prop,Mt(Ce.from,Ce.to,ae));},getProgress(){let j=e.getBoundingClientRect(),ae=z(),Ce=_(),{tStart:K,tEnd:Ee}=xe({top:j.top,height:j.height},ae,Ce,w,I);return M(Q(ae,K,Ee,c))}}}if(ue())return y();let T=0,g=0,p=0,F=false,de=false,ve=-1,me=0,Se=false,Le=NaN,Ne=-1,he=0,be=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,se=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ie(){let i=Qe(O,C,m),f=xe(i,i.scroll,se(),w,I);T=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(Lt,String(i));for(let f of E)e.style.setProperty(f.prop,Mt(f.from,f.to,i));Me?.(i);}function fe(i){if(isNaN(Le)){Le=i;return}Le<=0&&i>0?Z?.():Le>0&&i<=0&&A?.(),Le<1&&i>=1?X?.():Le>=1&&i<1&&B?.(),Le=i;}function Y(){if(!F||de)return;let i=performance.now(),f=be(),we=c;if(N!==false){let _=i-he,j=_>0?Math.abs(f-(Ne<0?f:Ne))/_:0;we=c*Math.max(.2,1+j*(typeof N=="number"?N:1)*.04);}Ne=f,he=i;let R=g===T?0:(f-T)/(g-T);fe(R);let z=M(Q(f,T,g,we));u&&(ve=Math.max(ve,z),z=ve),me=z,G(z),z>=1&&!Se?(Se=true,W?.()):z<1&&!u&&(Se=false),p=requestAnimationFrame(Y);}ie(),g===T&&ye("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(Q(be(),T,g,c));u&&i>0&&(ve=i),me=i,G(i);}let $e=new IntersectionObserver(i=>{i.forEach(f=>{F=f.isIntersecting,F&&!de?p=requestAnimationFrame(Y):cancelAnimationFrame(p);});},{root:C??null}),V;function P(){clearTimeout(V),V=setTimeout(ie,150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),$e.observe(e),Re(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:T,tEnd:g})}),{destroy(){cancelAnimationFrame(p),$e.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(V),oe(),He(e);},replay(){ve=-1,Se=false,me=0,de=false,G(0);},pause(){de=true,cancelAnimationFrame(p);},resume(){de&&(de=false,F&&(p=requestAnimationFrame(Y)));},seek(i){let f=Math.min(1,Math.max(0,i));me=f,ve=f,de=true,cancelAnimationFrame(p),G(f);},getProgress(){return me}}}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ye("scrollCounter: element not found:",e),ct;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:x,onComplete:N}=n,L=x!==void 0?y=>y.toFixed(x):c??(y=>String(Math.round(y))),te=typeof u=="function"?u:ee[u]??ee["ease-out"],Me=pe(m.start??"top 80%"),W=pe(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(s),N?.(),ct;let X=0,B=0,A=0,$=false,M=false,w=-1,I=0,O=false,C=()=>window.scrollY,E=()=>window.innerHeight;function re(){let y=t.getBoundingClientRect(),T=xe({top:y.top,height:y.height},C(),E(),Me,W);X=T.tStart,B=T.tEnd;}function k(y){t.textContent=L(l+(s-l)*y),t.style.setProperty("--scroll-draw-progress",String(y));}function ne(){if(!$||M)return;let y=te(Q(C(),X,B,1));d&&(w=Math.max(w,y),y=w),I=y,k(y),y>=1&&!O?(O=true,N?.()):y<1&&!d&&(O=false),A=requestAnimationFrame(ne);}re();{let y=te(Q(C(),X,B,1));d&&y>0&&(w=y),I=y,k(y);}let oe=new IntersectionObserver(y=>{y.forEach(T=>{$=T.isIntersecting,$&&!M?A=requestAnimationFrame(ne):cancelAnimationFrame(A);});}),J;function ue(){clearTimeout(J),J=setTimeout(re,150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),oe.observe(t),Re(t,{type:"counter",getProgress:()=>I,getTrigger:()=>({tStart:X,tEnd:B})}),{destroy(){cancelAnimationFrame(A),oe.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(J),He(t);},replay(){w=-1,O=false,I=0,M=false,k(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,$&&(A=requestAnimationFrame(ne)));},seek(y){let T=Math.min(1,Math.max(0,y));I=T,w=T,M=true,cancelAnimationFrame(A),k(T);},getProgress(){return I}}}var $t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return $t;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ye("scrollVideo: <video> element not found:",e),$t;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:d,onComplete:x,onProgress:N}=n,L=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof s=="function"?s:ee[s]??ee.linear,Me=pe(l.start??"top top"),W=pe(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Z=n.from??0,X=n.to,B=0,A=0,$=0,M=false,w=false,I=-1,O=0,C=false,E=false,re=()=>u==="x"?window.scrollX:window.scrollY,k=()=>u==="x"?window.innerWidth:window.innerHeight;function ne(){let p=t.getBoundingClientRect(),F=u==="x"?p.left:p.top,de=u==="x"?p.width:p.height,ve=xe({top:F,height:de},re(),k(),Me,W);B=ve.tStart,A=ve.tEnd;}function oe(p){if(!E)return;let F=X??t.duration??0;t.currentTime=Z+(F-Z)*p,t.style.setProperty("--scroll-draw-progress",String(p)),N?.(p);}function J(){if(!M||w||!E)return;let p=te(Q(re(),B,A,1));c&&(I=Math.max(I,p),p=I),O=p,oe(p),p>=1&&!C?(C=true,x?.()):p<1&&!c&&(C=false),$=requestAnimationFrame(J);}function ue(){if(E=true,X===void 0&&(X=t.duration),L){oe(1),d?.();return}ne(),d?.(),M&&!w&&($=requestAnimationFrame(J));}t.readyState>=1?ue():t.addEventListener("loadedmetadata",ue,{once:true}),E||ne();let y=new IntersectionObserver(p=>{p.forEach(F=>{M=F.isIntersecting,M&&!w&&E?$=requestAnimationFrame(J):cancelAnimationFrame($);});}),T;function g(){clearTimeout(T),T=setTimeout(ne,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),y.observe(t),Re(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:B,tEnd:A})}),{destroy(){cancelAnimationFrame($),y.disconnect(),t.removeEventListener("loadedmetadata",ue),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(T),He(t);},replay(){I=-1,C=false,O=0,w=false,oe(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,M&&E&&($=requestAnimationFrame(J)));},seek(p){let F=Math.min(1,Math.max(0,p));O=F,I=F,w=true,cancelAnimationFrame($),oe(F);},getProgress(){return O}}}function It(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 er(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ct(e){let n=It(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 x=m.nextElementSibling;u.appendChild(m),d<c.length-1&&x&&x.style.whiteSpace==="pre"&&u.appendChild(x);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function tr(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 rr(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 Pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return Pt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ye("scrollText: element not found:",e),Pt;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:x}=n,N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof c=="function"?c:ee[c]??ee["ease-out"],te=pe(m.start??"top 85%"),Me=pe(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let Z;l==="chars"?Z=er(t):l==="lines"?Z=Ct(t):Z=It(t);let X=Z.length;function B(g,p){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*p));let F=rr(p,u);F&&(g.style.transform=F);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),Z.forEach((p,F)=>{let de=L(tr(g,F,X,s));B(p,de);});}if(N)return A(1),x?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let $=0,M=0,w=0,I=false,O=false,C=-1,E=0,re=false,k=()=>window.scrollY,ne=()=>window.innerHeight;function oe(){let g=t.getBoundingClientRect(),p=xe({top:g.top,height:g.height},k(),ne(),te,Me);$=p.tStart,M=p.tEnd;}function J(){if(!I||O)return;let g=Q(k(),$,M,1);d&&(C=Math.max(C,g),g=C),E=g,A(g),g>=1&&!re?(re=true,x?.()):g<1&&!d&&(re=false),w=requestAnimationFrame(J);}oe();let ue=new IntersectionObserver(g=>{g.forEach(p=>{I=p.isIntersecting,I&&!O?w=requestAnimationFrame(J):cancelAnimationFrame(w);});}),y;function T(){clearTimeout(y),y=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),Z=Ct(t),A(g);}oe();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),ue.observe(t),Re(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:$,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ue.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(y),t.innerHTML=W,t.removeAttribute("aria-label"),He(t);},replay(){C=-1,re=false,E=0,O=false,A(0);},pause(){O=true,cancelAnimationFrame(w);},resume(){O&&(O=false,I&&(w=requestAnimationFrame(J)));},seek(g){let p=Math.min(1,Math.max(0,g));E=p,C=p,O=true,cancelAnimationFrame(w),A(p);},getProgress(){return E}}}function Rr(e,n={}){let r=Ke(e,n);return {update(t){r.destroy(),r=Ke(e,t);},destroy(){r.destroy();}}}function Hr(e={}){let n=null;function r(t){return n=Ke(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Nr(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Vr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function zr(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function _r(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function qr(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Wr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Gr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}exports.createScrollAnimate=Vr;exports.createScrollCounter=_r;exports.createScrollDraw=Hr;exports.createScrollText=Gr;exports.createScrollVideo=Wr;exports.scrollAnimate=Nr;exports.scrollCounterAction=zr;exports.scrollDraw=Rr;exports.scrollTextAction=Br;exports.scrollVideoAction=qr;
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Mt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Lt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Qt(e,n,r){if(!Ze)return;let t=(e.match(Lt)??[]).join("").toUpperCase(),l=(n.match(Lt)??[]).join("").toUpperCase(),s=(e.match(Mt)??[]).length,c=(n.match(Mt)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Je(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Ce=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:C,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:P="0px",repeat:S=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:R,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),Ne=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(C)?C[0]:null,j=Array.isArray(C)?C[1]:typeof C=="number"?C:null,pe=Array.isArray(M)?M[0]:null,Z=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,H=false,_=false,q=0,Ae=false,ye=-1,te=-1,Y=false,he=0,ke=0,Fe,ot=null;function mt(){ot?.destroy(),ot=null;}let Re=new Set,ft=NaN,He=true,Be=-1,pt=performance.now(),Ve=NaN;function st(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function dt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function gt(){let o=Qe(e,ve,B);return xe(o,o.scroll,dt(),Pe,Ne)}function yt(){(({tStart:f,tEnd:ge}=gt())),Ce&&Ze&&(mt(),ot=Xt(f,ge,B));}function it(o,a=gt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Ft(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=_e(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],D,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Ut(o);let a=ze(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Qt(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof p=="string"?Ke(p):null;function Rt(){return !(ae===false||!Yt()||!z.length||!ht||Q||B!=="y"||ve||u!==1||V!==0||ne||X||O!==false||D||w||S||G>0||d||x||g||L||E||R||fe||A!=null||C!=null||M!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Ht(){let o=++jt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=$==="reverse"?"0":"var(--ssd-len)",Oe=$==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${Oe};`;m&&(Me+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,N=-1;function W(){if(N>=0)return N;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},st(),dt(),Pe,Ne);return Ee(K(st(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),F.remove();},replay(){h=false,N=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));N=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=ze(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(Rt())return it(Ht());function Nt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function De(h){let N=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(N=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Ee(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Se&&le?W.style.stroke=_e(Se,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",ct(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(N=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Re.has(Te)&&(Re.add(Te),w[U]?.());}}return N}function Oe(h){if(Y)return;let N=h-a;_||(_=true,x?.());let W=De(N);if(W&&!H){H=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{a=performance.now(),_=false,H=false,Re.clear(),Ge(),q=requestAnimationFrame(Oe);},oe));return}W||(q=requestAnimationFrame(Oe));}function Me(){cancelAnimationFrame(q),clearTimeout(Fe),a=performance.now(),b=0,Y=false,_=false,H=false,ke=0,ue=true,he=0,Re.clear(),Ge(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(ne&&H)?Me():!N.isIntersecting&&!ne&&!H&&(cancelAnimationFrame(q),clearTimeout(Fe),ue=false);});},{root:ve??null,threshold:k,rootMargin:P}),F;function me(){clearTimeout(F),F=setTimeout(()=>{z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Fe),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(F);},replay(){ke=0,Me();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let N=Math.min(1,Math.max(0,h));he=N,Y=true,b=N*o,a=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return he},refresh(){clearTimeout(F),z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});}}}if(ie)return it(Nt());yt();function je(){if(!Ae||Y)return;let o=performance.now(),a=st();if(!He&&O===false&&a===ft){q=requestAnimationFrame(je);return}He=false,ft=a;let b=u;if(O!==false){let v=o-pt,F=v>0?Math.abs(a-(Be<0?a:Be))/v:0;b=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Be=a,pt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let De=ge-f,Oe=true,Me=De===0?0:(a-f)/De;if(isNaN(Ve)||(Ve<=0&&Me>0?L?.():Ve>0&&Me<=0&&fe?.(),Ve<1&&Me>=1?E?.():Ve>=1&&Me<1&&R?.()),Ve=Me,Q){let v=Ee(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let F=ue==="reverse"?1-v:v;e.style.clipPath=Ie(F),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(H=false),q=requestAnimationFrame(je);return}if(z.forEach((v,F)=>{let me=F*V*De,h=Ee(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[F]*h}`:`${I[F]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=_e(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[F]&&v.setAttribute("d",ct(i[F],D,h)),F===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=Ee(K(a,f,ge,b));for(let F in w){let me=parseFloat(F);v>=me&&!Re.has(me)&&(Re.add(me),w[F]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),Oe&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,Re.clear(),Ge(),He=true;},oe))):!Oe&&!ne&&(H=false),q=requestAnimationFrame(je);}let at=false;function Ye(){at||(at=true,q=requestAnimationFrame(function(){je();}));}function Ue(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!Y?(He=true,Ye()):Ue();});},{root:ve??null,threshold:k,rootMargin:P});function bt(){z.forEach((o,a)=>{I[a]=ze(o),o.style.strokeDasharray=`${I[a]}`;}),yt(),He=true;}let Xe;function qe(){clearTimeout(Xe),Xe=setTimeout(bt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(Fe),Ue(),lt.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Xe),mt();},replay(){ye=-1,te=-1,Be=-1,_=false,H=false,ke=0,Y=false,he=0,Re.clear(),clearTimeout(Fe),Ge(),He=true,Ae&&Ye();},pause(){Y=true,Ue();},resume(){Y&&(Y=false,He=true,Ae&&Ye());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Ue(),Ft(a,$),He=true;},getProgress(){return he},refresh(){clearTimeout(Xe),bt(),Ae&&!Y&&Ye();}},()=>({tStart:f,tEnd:ge}))}function Zt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function $t(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function Kt(e,n,r){let t=$t(e),l=$t(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Ct(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Zt(t))return _e(t,l,r);if(t.includes("("))return Kt(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function Jt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var er=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),tr=0,Pt="--scroll-draw-progress";function rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Ce,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,C=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),O=de(l.end??"bottom top"),k=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:Jt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Pt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(C)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?Ke(s):null;function ae(){if(!T||!rr()||!ee||m!=="y"||P||k!==e||u||c!==1||Ce||B||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!er.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++tr}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,O)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),H.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,Ct(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Ae();return M(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,R=false,fe=-1,Q=0,Ee=false,Pe=NaN,Ne=-1,ve=0,Se=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Qe(k,P,m),f=xe(i,i.scroll,le(),w,O);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Pt,String(i));for(let f of S)e.style.setProperty(f.prop,Ct(f.from,f.to,i));Ce?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!E||R)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(Ne<0?f:Ne))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}Ne=f,ve=i;let H=g===x?0:(f-x)/(g-x);pe(H);let _=M(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,B?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!R?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:P??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Ee=false,Q=0,R=false,j(0);},pause(){R=true,cancelAnimationFrame(L);},resume(){R&&(R=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,R=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ut;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Ce=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ut;let X=0,G=0,A=0,C=false,M=false,w=-1,O=0,k=false,P=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),S(),Ce,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!C||M)return;let d=ne(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),O=d,D(d),d>=1&&!k?(k=true,V?.()):d<1&&!p&&(k=false),A=requestAnimationFrame(se);}oe();{let d=ne(K(P(),X,G,1));p&&d>0&&(w=d),O=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{C=x.isIntersecting,C&&!M?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,C&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));O=x,w=x,M=true,cancelAnimationFrame(A),D(x);},getProgress(){return O}}}var It={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return It;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),It;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Ce=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,A=0,C=0,M=false,w=false,O=-1,k=0,P=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),R=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:R,height:fe},oe(),D(),Ce,B);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let R=X??t.duration??0,fe=J+(R-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!M||w||!S)return;let E=ne(K(oe(),G,A,1));c&&(O=Math.max(O,E),E=O),k=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),C=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),M&&!w&&(C=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(R=>{M=R.isIntersecting,M&&!w&&S?C=requestAnimationFrame(ae):cancelAnimationFrame(C);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(C),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){O=-1,P=false,k=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,M&&S&&(C=requestAnimationFrame(ae)));},seek(E){let R=Math.min(1,Math.max(0,E));k=R,O=R,w=true,cancelAnimationFrame(C),ie=NaN,ee(R);},getProgress(){return k}}}function Dt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function nr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ot(e){let n=Dt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function or(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function sr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),kt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Ce=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=nr(t):l==="lines"?J=Ot(t):J=Dt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=sr(L,u);E&&(g.style.transform=E);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let R=$(or(g,E,X,s));G(L,R);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let C=0,M=0,w=0,O=false,k=false,P=-1,S=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Ce);C=L.tStart,M=L.tEnd;}function ee(){if(!O||k)return;let g=K(D(),C,M,1);p&&(P=Math.max(P,g),g=P),S=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{O=L.isIntersecting,O&&!k?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Ot(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){P=-1,oe=false,S=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,P=L,k=true,cancelAnimationFrame(w),A(L);},getProgress(){return S}}}function zr(e,n={}){let r=Je(e,n);return {update(t){r.destroy(),r=Je(e,t);},destroy(){r.destroy();}}}function _r(e={}){let n=null;function r(t){return n=Je(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function qr(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Wr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function Gr(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function jr(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Yr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Ur(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Xr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}exports.createScrollAnimate=Wr;exports.createScrollCounter=Gr;exports.createScrollDraw=_r;exports.createScrollText=Xr;exports.createScrollVideo=Yr;exports.scrollAnimate=qr;exports.scrollCounterAction=Br;exports.scrollDraw=zr;exports.scrollTextAction=Ur;exports.scrollVideoAction=jr;
@@ -1,3 +1,3 @@
1
- function Rt({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 x=Math.pow(l,d);c.push(x),s+=x;}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 x=0;x<r;x++)if(d<=u[x+1]){let N=(d-u[x])/(u[x+1]-u[x]);if(x===0)return N*(2-N);let L=1-Math.pow(t,x);return L+(1-L)*(2*N-1)*(2*N-1)}return 1}}function Ht({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 ee={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:Rt(),elastic:Ht()};function pe(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 ht(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 bt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Nt(e,n,r){return Math.min(r,Math.max(n,e))}function Q(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 xe(e,n,r,t,l){let s=ht(e.top,e.height,n,t.element)-bt(t.viewport,r),c=ht(e.top,e.height,n,l.element)-bt(l.viewport,r);return {tStart:s,tEnd:c}}function wt(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=wt(e),l=wt(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 vt={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 ye(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Vt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",zt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function _t(){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<St;r++){let t=r/(St-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Je(e){switch(e){case "linear":return "linear";case "ease-in":return Vt;case "ease-out":return zt;case "ease-in-out":return _t()?qt(ee["ease-in-out"]):null;default:return null}}var Wt=0;function Bt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Gt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?ye("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&ye("Element has a fill \u2014 it may obscure the stroke animation.",e);}function jt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
1
+ function Vt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<r;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let $=1-Math.pow(t,T);return $+(1-$)*(2*V-1)*(2*V-1)}return 1}}function zt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var re={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Vt(),elastic:zt()};function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function wt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function vt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function ze(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function _t(e,n,r){return Math.min(r,Math.max(n,e))}function K(e,n,r,t){return r===n?0:_t((e-n)/(r-n)*t,0,1)}function Qe(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=wt(e.top,e.height,n,t.element)-vt(t.viewport,r),c=wt(e.top,e.height,n,l.element)-vt(l.viewport,r);return {tStart:s,tEnd:c}}function St(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function _e(e,n,r){let t=St(e),l=St(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Wt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function Bt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Gt(e){let n=[];for(let r=0;r<Tt;r++){let t=r/(Tt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return qt;case "ease-out":return Wt;case "ease-in-out":return Bt()?Gt(re["ease-in-out"]):null;default:return null}}var xt=Symbol.for("svg-scroll-draw.registry");function At(){let e=globalThis;return e[xt]||(e[xt]=new Map)}function Le(e,n){At().set(e,n);}function $e(e){At().delete(e);}var jt=0;function Yt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ut(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?we("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Xt(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Et=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Tt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Ut(e,n,r){if(!Ze)return;let t=(e.match(Tt)??[]).join("").toUpperCase(),l=(n.match(Tt)??[]).join("").toUpperCase(),s=(e.match(Et)??[]).length,c=(n.match(Et)??[]).length;if(t!==l){ye(`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&&ye(`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 lt(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 Ke(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...vt[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:x={},stagger:N=0,direction:L="forward",once:te=false,debug:Me=false,axis:W="y",scrollContainer:Z,autoReverse:X=false,delay:B=0,strokeColor:A,strokeWidth:$,fillOpacity:M,waypoints:w,velocityScale:I=false,threshold:O=0,rootMargin:C="0px",repeat:E=0,repeatDelay:re=0,morphTo:k,clip:ne,autoplay:oe=false,duration:J=1e3,native:ue=true,onProgress:y,onStart:T,onComplete:g,onEnter:p,onLeave:F,onEnterBack:de,onLeaveBack:ve}=l,me=ne===true?"left":typeof ne=="string"?ne:false,Se=typeof d=="function"?d:ee[d]??ee.linear,Le=pe(x.start??"top bottom"),Ne=pe(x.end??"bottom top"),he=typeof Z=="string"?document.querySelector(Z):Z??null,be=Array.isArray(A)?A[0]:null,se=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ie=Array.isArray($)?$[0]:null,G=Array.isArray($)?$[1]:typeof $=="number"?$:null,fe=Array.isArray(M)?M[0]:null,Y=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function $e(o){let a=o*100;switch(me){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 V=me?[]:Array.from(e.querySelectorAll(c)),P=[],i=[],f=0,we=0,R=false,z=false,_=0,j=false,ae=-1,Ce=-1,K=false,Ee=0,Ie=0,ke,ot=null;function ut(){ot?.destroy(),ot=null;}let De=new Set,mt=NaN,Fe=true,Be=-1,ft=performance.now(),Ve=NaN;function st(){return he?W==="x"?he.scrollLeft:he.scrollTop:W==="x"?window.scrollX:window.scrollY}function pt(){return he?W==="x"?he.clientWidth:he.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function dt(){let o=Qe(e,he,W),a=xe(o,o.scroll,pt(),Le,Ne);f=a.tStart,we=a.tEnd,Me&&Ze&&(ut(),ot=jt(f,we,W));}function Ot(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),me){let v=a==="reverse"?1-o:o;e.style.clipPath=$e(v);return}V.forEach((v,le)=>{v.style.strokeDashoffset=a==="reverse"?`${P[le]*o}`:`${P[le]*(1-o)}`,m&&(v.style.opacity=a==="reverse"?`${1-o}`:`${o}`),be&&se?v.style.stroke=_e(be,se,o):se&&(v.style.stroke=se),ie!==null&&G!==null?v.style.strokeWidth=`${ie+(G-ie)*o}`:G!==null&&(v.style.strokeWidth=`${G}`),fe!==null&&Y!==null?v.style.fillOpacity=`${fe+(Y-fe)*o}`:Y!==null&&(v.style.fillOpacity=`${Y}`),k&&v.tagName.toLowerCase()==="path"&&i[le]&&v.setAttribute("d",lt(i[le],k,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),me){e.style.clipPath=$e(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${P[a]}`,o.style.strokeDashoffset=L==="reverse"?"0":`${P[a]}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`),k&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{Gt(o);let a=ze(o);P.push(a);let v=o.tagName.toLowerCase()==="path";v?i.push(o.getAttribute("d")??""):i.push(""),k&&(v?Ut(i[i.length-1],k,o):ye(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=L==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),se&&(o.style.stroke=se),G!==null&&(o.style.strokeWidth=`${G}`),Y!==null&&(o.style.fillOpacity=`${Y}`),k&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",k)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=L==="reverse"?"0":`${a}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`));}),me){if(s)return e.style.clipPath=$e(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=$e(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof d=="string"?Je(d):null;function kt(){return !(ue===false||!Bt()||!V.length||!gt||me||W!=="y"||he||u!==1||N!==0||te||X||I!==false||k||w||E||B>0||y||T||g||p||F||de||ve||A!=null||$!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function Dt(){let o=++Wt,a=`svg-scroll-draw-${o}`,v=`svg-scroll-draw-host-${o}`,le=`--svg-scroll-draw-${o}`,Oe=L==="reverse"?"0":"var(--ssd-len)",Pe=L==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Oe};`,S=`stroke-dashoffset:${Pe};`;m&&(Ae+=`opacity:${L==="reverse"?1:0};`,S+=`opacity:${L==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${a}{from{${Ae}}to{${S}}}.${v}{view-timeline-name:${le};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${le};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(v);function ce(h,U){h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(a);}V.forEach(ce);let b=false,H=-1;function q(){if(H>=0)return H;let h=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:h.top,height:h.height},st(),pt(),Le,Ne);return Se(Q(st(),U,Te,u))}return {destroy(){e.classList.remove(v),V.forEach(h=>{h.classList.remove(a),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),D.remove();},replay(){b=false,H=-1,V.forEach(ce);},pause(){b=true,V.forEach(h=>{h.style.animationPlayState="paused";});},resume(){b&&(b=false,V.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let U=Math.min(1,Math.max(0,h));H=U,b=true,V.forEach((Te,ge)=>{Te.classList.remove(a),Te.style.strokeDashoffset=L==="reverse"?`${P[ge]*U}`:`${P[ge]*(1-U)}`,m&&(Te.style.opacity=L==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return q()},refresh(){V.forEach((h,U)=>{P[U]=ze(h),h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`;});}}}if(kt())return Dt();function Ft(){let o=Math.max(1,J),a=0,v=0,le=false;function Oe(b){let H=true;if(me){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);Ee=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=$e(L==="reverse"?1-h:h),y?.(h),q<1&&(H=false);}else V.forEach((q,h)=>{let U=h*N*o,Te=Math.min(1,Math.max(0,(b-U)/o)),ge=Se(Te);q.style.strokeDashoffset=L==="reverse"?`${P[h]*ge}`:`${P[h]*(1-ge)}`,m&&(q.style.opacity=L==="reverse"?`${1-ge}`:`${ge}`),be&&se?q.style.stroke=_e(be,se,ge):se&&(q.style.stroke=se),ie!==null&&G!==null?q.style.strokeWidth=`${ie+(G-ie)*ge}`:G!==null&&(q.style.strokeWidth=`${G}`),fe!==null&&Y!==null?q.style.fillOpacity=`${fe+(Y-fe)*ge}`:Y!==null&&(q.style.fillOpacity=`${Y}`),k&&q.tagName.toLowerCase()==="path"&&i[h]&&q.setAttribute("d",lt(i[h],k,ge)),h===0&&(Ee=ge,y?.(ge),e.style.setProperty("--scroll-draw-progress",String(ge))),Te<1&&(H=false);});if(w){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);for(let U in w){let Te=parseFloat(U);h>=Te&&!De.has(Te)&&(De.add(Te),w[U]?.());}}return H}function Pe(b){if(K)return;let H=b-a;z||(z=true,T?.());let q=Oe(H);if(q&&!R){R=true,Oe(o*(1+Math.max(0,V.length-1)*N)),g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,ke=setTimeout(()=>{a=performance.now(),z=false,R=false,De.clear(),Ge(),_=requestAnimationFrame(Pe);},re));return}q||(_=requestAnimationFrame(Pe));}function Ae(){cancelAnimationFrame(_),clearTimeout(ke),a=performance.now(),v=0,K=false,z=false,R=false,Ie=0,le=true,Ee=0,De.clear(),Ge(),_=requestAnimationFrame(Pe);}let S=new IntersectionObserver(b=>{b.forEach(H=>{H.isIntersecting&&!(te&&R)?Ae():!H.isIntersecting&&!te&&!R&&(cancelAnimationFrame(_),clearTimeout(ke),le=false);});},{root:he??null,threshold:O,rootMargin:C}),D;function ce(){clearTimeout(D),D=setTimeout(()=>{V.forEach((b,H)=>{P[H]=ze(b),b.style.strokeDasharray=`${P[H]}`;});},150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),B>0?setTimeout(()=>S.observe(e),B):S.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(ke),S.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(D);},replay(){Ie=0,Ae();},pause(){K||!le||(K=true,v=performance.now()-a,cancelAnimationFrame(_));},resume(){K&&(K=false,le=true,a=performance.now()-v,_=requestAnimationFrame(Pe));},seek(b){let H=Math.min(1,Math.max(0,b));Ee=H,K=true,v=H*o,a=performance.now()-v,cancelAnimationFrame(_),Oe(v);},getProgress(){return Ee},refresh(){clearTimeout(D),V.forEach((b,H)=>{P[H]=ze(b),b.style.strokeDasharray=`${P[H]}`;});}}}if(oe)return Ft();dt();function je(){if(!j||K)return;let o=performance.now(),a=st();if(!Fe&&I===false&&a===mt){_=requestAnimationFrame(je);return}Fe=false,mt=a;let v=u;if(I!==false){let S=o-ft,D=S>0?Math.abs(a-(Be<0?a:Be))/S:0;v=u*Math.max(.2,1+D*(typeof I=="number"?I:1)*.04);}Be=a,ft=o;let le=X?Ce===-1||a>=Ce?"forward":"reverse":L;Ce=a;let Oe=we-f,Pe=true,Ae=Oe===0?0:(a-f)/Oe;if(isNaN(Ve)||(Ve<=0&&Ae>0?p?.():Ve>0&&Ae<=0&&ve?.(),Ve<1&&Ae>=1?F?.():Ve>=1&&Ae<1&&de?.()),Ve=Ae,me){let S=Se(Q(a,f,we,v));te&&!X&&(ae=Math.max(ae,S),S=ae),Ee=S,e.style.setProperty("--scroll-draw-progress",String(S));let D=le==="reverse"?1-S:S;e.style.clipPath=$e(D),y?.(S),!z&&Q(a,f,we,v)>0&&(z=true,T?.()),S>=1&&!R?(R=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,ke=setTimeout(()=>{ae=-1,z=false,R=false,e.style.clipPath=$e(0);},re))):S<1&&!te&&(R=false),_=requestAnimationFrame(je);return}if(V.forEach((S,D)=>{let ce=D*N*Oe,b=Se(Q(a,f+ce,we+ce,v));te&&!X&&(ae=Math.max(ae,b),b=ae),Ee=b,S.style.strokeDashoffset=le==="reverse"?`${P[D]*b}`:`${P[D]*(1-b)}`,m&&(S.style.opacity=le==="reverse"?`${1-b}`:`${b}`),be&&se?S.style.stroke=_e(be,se,b):se&&(S.style.stroke=se),ie!==null&&G!==null?S.style.strokeWidth=`${ie+(G-ie)*b}`:G!==null&&(S.style.strokeWidth=`${G}`),fe!==null&&Y!==null?S.style.fillOpacity=`${fe+(Y-fe)*b}`:Y!==null&&(S.style.fillOpacity=`${Y}`),k&&S.tagName.toLowerCase()==="path"&&i[D]&&S.setAttribute("d",lt(i[D],k,b)),D===0&&(y?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Pe=false);}),w){let S=Se(Q(a,f,we,v));for(let D in w){let ce=parseFloat(D);S>=ce&&!De.has(ce)&&(De.add(ce),w[D]?.());}}!z&&Q(a,f,we,v)>0&&(z=true,T?.()),Pe&&!R?(R=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,ke=setTimeout(()=>{ae=-1,z=false,R=false,De.clear(),Ge(),Fe=true;},re))):!Pe&&!te&&(R=false),_=requestAnimationFrame(je);}let it=false;function Ue(){it||(it=true,_=requestAnimationFrame(function(){je();}));}function Xe(){it=false,cancelAnimationFrame(_);}let at=new IntersectionObserver(o=>{o.forEach(a=>{j=a.isIntersecting,j&&!K?(Fe=true,Ue()):Xe();});},{root:he??null,threshold:O,rootMargin:C});function yt(){V.forEach((o,a)=>{P[a]=ze(o),o.style.strokeDasharray=`${P[a]}`;}),dt(),Fe=true;}let Ye;function qe(){clearTimeout(Ye),Ye=setTimeout(yt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),B>0?setTimeout(()=>at.observe(e),B):at.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(ke),Xe(),at.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Ye),ut();},replay(){ae=-1,Ce=-1,Be=-1,z=false,R=false,Ie=0,K=false,Ee=0,De.clear(),clearTimeout(ke),Ge(),Fe=true,j&&Ue();},pause(){K=true,Xe();},resume(){K&&(K=false,Fe=true,j&&Ue());},seek(o){let a=Math.min(1,Math.max(0,o));Ee=a,ae=a,K=true,Xe(),Ot(a,L),Fe=true;},getProgress(){return Ee},refresh(){clearTimeout(Ye),yt(),j&&!K&&Ue();}}}var xt=new Map;function Re(e,n){xt.set(e,n);}function He(e){xt.delete(e);}function Xt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function At(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 Yt(e,n,r){let t=At(e),l=At(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 Mt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Xt(t))return _e(t,l,r);if(t.includes("("))return Yt(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 Qt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Zt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Jt=0,Lt="--scroll-draw-progress";function Kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:x=true,velocityScale:N=false,respectReducedMotion:L=true,triggerElement:te,onProgress:Me,onComplete:W,onEnter:Z,onLeave:X,onEnterBack:B,onLeaveBack:A}=n,$=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:ee[s]??ee["ease-out"],w=pe(l.start??"top bottom"),I=pe(l.end??"bottom top"),O=te??e,C=typeof d=="string"?document.querySelector(d):d??null,E=Object.entries(t).map(([i,f])=>({prop:Qt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function re(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function k(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let ne=new Map;for(let i of [...E.map(f=>f.prop),Lt])ne.set(i,e.style.getPropertyValue(i));function oe(){for(let[i,f]of ne)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if($)return k(),W?.(),{...r,destroy:oe,getProgress:()=>1};re();let J=typeof s=="string"?Je(s):null;function ue(){if(!x||!Kt()||!J||m!=="y"||C||O!==e||u||c!==1||Me||W||Z||X||B||A||N!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!Zt.has(i.prop))return false;return true}function y(){let i=`ssd-a-${++Jt}`,f=E.map(j=>`${j.prop}:${j.from}`).join(";"),we=E.map(j=>`${j.prop}:${j.to}`).join(";"),R=document.createElement("style");R.setAttribute("data-ssd-animate",""),R.textContent=`@keyframes ${i}{from{${f}}to{${we}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${J};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(i);let z=()=>m==="x"?window.scrollX:window.scrollY,_=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),R.remove(),e.style.animationPlayState="",oe();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(j){let ae=Math.min(1,Math.max(0,j));e.classList.remove(i);for(let Ce of E)e.style.setProperty(Ce.prop,Mt(Ce.from,Ce.to,ae));},getProgress(){let j=e.getBoundingClientRect(),ae=z(),Ce=_(),{tStart:K,tEnd:Ee}=xe({top:j.top,height:j.height},ae,Ce,w,I);return M(Q(ae,K,Ee,c))}}}if(ue())return y();let T=0,g=0,p=0,F=false,de=false,ve=-1,me=0,Se=false,Le=NaN,Ne=-1,he=0,be=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,se=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ie(){let i=Qe(O,C,m),f=xe(i,i.scroll,se(),w,I);T=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(Lt,String(i));for(let f of E)e.style.setProperty(f.prop,Mt(f.from,f.to,i));Me?.(i);}function fe(i){if(isNaN(Le)){Le=i;return}Le<=0&&i>0?Z?.():Le>0&&i<=0&&A?.(),Le<1&&i>=1?X?.():Le>=1&&i<1&&B?.(),Le=i;}function Y(){if(!F||de)return;let i=performance.now(),f=be(),we=c;if(N!==false){let _=i-he,j=_>0?Math.abs(f-(Ne<0?f:Ne))/_:0;we=c*Math.max(.2,1+j*(typeof N=="number"?N:1)*.04);}Ne=f,he=i;let R=g===T?0:(f-T)/(g-T);fe(R);let z=M(Q(f,T,g,we));u&&(ve=Math.max(ve,z),z=ve),me=z,G(z),z>=1&&!Se?(Se=true,W?.()):z<1&&!u&&(Se=false),p=requestAnimationFrame(Y);}ie(),g===T&&ye("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(Q(be(),T,g,c));u&&i>0&&(ve=i),me=i,G(i);}let $e=new IntersectionObserver(i=>{i.forEach(f=>{F=f.isIntersecting,F&&!de?p=requestAnimationFrame(Y):cancelAnimationFrame(p);});},{root:C??null}),V;function P(){clearTimeout(V),V=setTimeout(ie,150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),$e.observe(e),Re(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:T,tEnd:g})}),{destroy(){cancelAnimationFrame(p),$e.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(V),oe(),He(e);},replay(){ve=-1,Se=false,me=0,de=false,G(0);},pause(){de=true,cancelAnimationFrame(p);},resume(){de&&(de=false,F&&(p=requestAnimationFrame(Y)));},seek(i){let f=Math.min(1,Math.max(0,i));me=f,ve=f,de=true,cancelAnimationFrame(p),G(f);},getProgress(){return me}}}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ye("scrollCounter: element not found:",e),ct;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:x,onComplete:N}=n,L=x!==void 0?y=>y.toFixed(x):c??(y=>String(Math.round(y))),te=typeof u=="function"?u:ee[u]??ee["ease-out"],Me=pe(m.start??"top 80%"),W=pe(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(s),N?.(),ct;let X=0,B=0,A=0,$=false,M=false,w=-1,I=0,O=false,C=()=>window.scrollY,E=()=>window.innerHeight;function re(){let y=t.getBoundingClientRect(),T=xe({top:y.top,height:y.height},C(),E(),Me,W);X=T.tStart,B=T.tEnd;}function k(y){t.textContent=L(l+(s-l)*y),t.style.setProperty("--scroll-draw-progress",String(y));}function ne(){if(!$||M)return;let y=te(Q(C(),X,B,1));d&&(w=Math.max(w,y),y=w),I=y,k(y),y>=1&&!O?(O=true,N?.()):y<1&&!d&&(O=false),A=requestAnimationFrame(ne);}re();{let y=te(Q(C(),X,B,1));d&&y>0&&(w=y),I=y,k(y);}let oe=new IntersectionObserver(y=>{y.forEach(T=>{$=T.isIntersecting,$&&!M?A=requestAnimationFrame(ne):cancelAnimationFrame(A);});}),J;function ue(){clearTimeout(J),J=setTimeout(re,150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),oe.observe(t),Re(t,{type:"counter",getProgress:()=>I,getTrigger:()=>({tStart:X,tEnd:B})}),{destroy(){cancelAnimationFrame(A),oe.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(J),He(t);},replay(){w=-1,O=false,I=0,M=false,k(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,$&&(A=requestAnimationFrame(ne)));},seek(y){let T=Math.min(1,Math.max(0,y));I=T,w=T,M=true,cancelAnimationFrame(A),k(T);},getProgress(){return I}}}var $t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return $t;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ye("scrollVideo: <video> element not found:",e),$t;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:d,onComplete:x,onProgress:N}=n,L=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof s=="function"?s:ee[s]??ee.linear,Me=pe(l.start??"top top"),W=pe(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Z=n.from??0,X=n.to,B=0,A=0,$=0,M=false,w=false,I=-1,O=0,C=false,E=false,re=()=>u==="x"?window.scrollX:window.scrollY,k=()=>u==="x"?window.innerWidth:window.innerHeight;function ne(){let p=t.getBoundingClientRect(),F=u==="x"?p.left:p.top,de=u==="x"?p.width:p.height,ve=xe({top:F,height:de},re(),k(),Me,W);B=ve.tStart,A=ve.tEnd;}function oe(p){if(!E)return;let F=X??t.duration??0;t.currentTime=Z+(F-Z)*p,t.style.setProperty("--scroll-draw-progress",String(p)),N?.(p);}function J(){if(!M||w||!E)return;let p=te(Q(re(),B,A,1));c&&(I=Math.max(I,p),p=I),O=p,oe(p),p>=1&&!C?(C=true,x?.()):p<1&&!c&&(C=false),$=requestAnimationFrame(J);}function ue(){if(E=true,X===void 0&&(X=t.duration),L){oe(1),d?.();return}ne(),d?.(),M&&!w&&($=requestAnimationFrame(J));}t.readyState>=1?ue():t.addEventListener("loadedmetadata",ue,{once:true}),E||ne();let y=new IntersectionObserver(p=>{p.forEach(F=>{M=F.isIntersecting,M&&!w&&E?$=requestAnimationFrame(J):cancelAnimationFrame($);});}),T;function g(){clearTimeout(T),T=setTimeout(ne,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),y.observe(t),Re(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:B,tEnd:A})}),{destroy(){cancelAnimationFrame($),y.disconnect(),t.removeEventListener("loadedmetadata",ue),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(T),He(t);},replay(){I=-1,C=false,O=0,w=false,oe(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,M&&E&&($=requestAnimationFrame(J)));},seek(p){let F=Math.min(1,Math.max(0,p));O=F,I=F,w=true,cancelAnimationFrame($),oe(F);},getProgress(){return O}}}function It(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 er(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ct(e){let n=It(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 x=m.nextElementSibling;u.appendChild(m),d<c.length-1&&x&&x.style.whiteSpace==="pre"&&u.appendChild(x);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function tr(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 rr(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 Pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return Pt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ye("scrollText: element not found:",e),Pt;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:x}=n,N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof c=="function"?c:ee[c]??ee["ease-out"],te=pe(m.start??"top 85%"),Me=pe(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let Z;l==="chars"?Z=er(t):l==="lines"?Z=Ct(t):Z=It(t);let X=Z.length;function B(g,p){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*p));let F=rr(p,u);F&&(g.style.transform=F);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),Z.forEach((p,F)=>{let de=L(tr(g,F,X,s));B(p,de);});}if(N)return A(1),x?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let $=0,M=0,w=0,I=false,O=false,C=-1,E=0,re=false,k=()=>window.scrollY,ne=()=>window.innerHeight;function oe(){let g=t.getBoundingClientRect(),p=xe({top:g.top,height:g.height},k(),ne(),te,Me);$=p.tStart,M=p.tEnd;}function J(){if(!I||O)return;let g=Q(k(),$,M,1);d&&(C=Math.max(C,g),g=C),E=g,A(g),g>=1&&!re?(re=true,x?.()):g<1&&!d&&(re=false),w=requestAnimationFrame(J);}oe();let ue=new IntersectionObserver(g=>{g.forEach(p=>{I=p.isIntersecting,I&&!O?w=requestAnimationFrame(J):cancelAnimationFrame(w);});}),y;function T(){clearTimeout(y),y=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),Z=Ct(t),A(g);}oe();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),ue.observe(t),Re(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:$,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ue.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(y),t.innerHTML=W,t.removeAttribute("aria-label"),He(t);},replay(){C=-1,re=false,E=0,O=false,A(0);},pause(){O=true,cancelAnimationFrame(w);},resume(){O&&(O=false,I&&(w=requestAnimationFrame(J)));},seek(g){let p=Math.min(1,Math.max(0,g));E=p,C=p,O=true,cancelAnimationFrame(w),A(p);},getProgress(){return E}}}function Rr(e,n={}){let r=Ke(e,n);return {update(t){r.destroy(),r=Ke(e,t);},destroy(){r.destroy();}}}function Hr(e={}){let n=null;function r(t){return n=Ke(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Nr(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Vr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function zr(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function _r(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function qr(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Wr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Gr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}export{Vr as createScrollAnimate,_r as createScrollCounter,Hr as createScrollDraw,Gr as createScrollText,Wr as createScrollVideo,Nr as scrollAnimate,zr as scrollCounterAction,Rr as scrollDraw,Br as scrollTextAction,qr as scrollVideoAction};
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Mt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Lt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Qt(e,n,r){if(!Ze)return;let t=(e.match(Lt)??[]).join("").toUpperCase(),l=(n.match(Lt)??[]).join("").toUpperCase(),s=(e.match(Mt)??[]).length,c=(n.match(Mt)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Je(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:$="forward",once:ne=false,debug:Ce=false,axis:B="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:C,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:P="0px",repeat:S=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:R,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),Ne=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(C)?C[0]:null,j=Array.isArray(C)?C[1]:typeof C=="number"?C:null,pe=Array.isArray(M)?M[0]:null,Z=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Ie(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),I=[],i=[],f=0,ge=0,H=false,_=false,q=0,Ae=false,ye=-1,te=-1,Y=false,he=0,ke=0,Fe,ot=null;function mt(){ot?.destroy(),ot=null;}let Re=new Set,ft=NaN,He=true,Be=-1,pt=performance.now(),Ve=NaN;function st(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function dt(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function gt(){let o=Qe(e,ve,B);return xe(o,o.scroll,dt(),Pe,Ne)}function yt(){(({tStart:f,tEnd:ge}=gt())),Ce&&Ze&&(mt(),ot=Xt(f,ge,B));}function it(o,a=gt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Ft(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Ie(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${I[ue]*o}`:`${I[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=_e(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],D,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Ie(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=$==="reverse"?"0":`${I[a]}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{Ut(o);let a=ze(o);I.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?Qt(i[i.length-1],D,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=$==="reverse"?"0":`${a}`,m?o.style.opacity=$==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Ie(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ie(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof p=="string"?Ke(p):null;function Rt(){return !(ae===false||!Yt()||!z.length||!ht||Q||B!=="y"||ve||u!==1||V!==0||ne||X||O!==false||D||w||S||G>0||d||x||g||L||E||R||fe||A!=null||C!=null||M!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Ht(){let o=++jt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=$==="reverse"?"0":"var(--ssd-len)",Oe=$==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${Oe};`;m&&(Me+=`opacity:${$==="reverse"?1:0};`,v+=`opacity:${$==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,N=-1;function W(){if(N>=0)return N;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},st(),dt(),Pe,Ne);return Ee(K(st(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),F.remove();},replay(){h=false,N=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));N=U,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=$==="reverse"?`${I[be]*U}`:`${I[be]*(1-U)}`,m&&(Te.style.opacity=$==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){z.forEach((y,U)=>{I[U]=ze(y),y.style.setProperty("--ssd-len",String(I[U])),y.style.strokeDasharray=`${I[U]}`;});}}}if(Rt())return it(Ht());function Nt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function De(h){let N=true;if(Q){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ie($==="reverse"?1-y:y),d?.(y),W<1&&(N=false);}else z.forEach((W,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),be=Ee(Te);W.style.strokeDashoffset=$==="reverse"?`${I[y]*be}`:`${I[y]*(1-be)}`,m&&(W.style.opacity=$==="reverse"?`${1-be}`:`${be}`),Se&&le?W.style.stroke=_e(Se,le,be):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Z!==null?W.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(W.style.fillOpacity=`${Z}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",ct(i[y],D,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(N=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=Ee(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Re.has(Te)&&(Re.add(Te),w[U]?.());}}return N}function Oe(h){if(Y)return;let N=h-a;_||(_=true,x?.());let W=De(N);if(W&&!H){H=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{a=performance.now(),_=false,H=false,Re.clear(),Ge(),q=requestAnimationFrame(Oe);},oe));return}W||(q=requestAnimationFrame(Oe));}function Me(){cancelAnimationFrame(q),clearTimeout(Fe),a=performance.now(),b=0,Y=false,_=false,H=false,ke=0,ue=true,he=0,Re.clear(),Ge(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(N=>{N.isIntersecting&&!(ne&&H)?Me():!N.isIntersecting&&!ne&&!H&&(cancelAnimationFrame(q),clearTimeout(Fe),ue=false);});},{root:ve??null,threshold:k,rootMargin:P}),F;function me(){clearTimeout(F),F=setTimeout(()=>{z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Fe),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(F);},replay(){ke=0,Me();},pause(){Y||!ue||(Y=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){Y&&(Y=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let N=Math.min(1,Math.max(0,h));he=N,Y=true,b=N*o,a=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return he},refresh(){clearTimeout(F),z.forEach((h,N)=>{I[N]=ze(h),h.style.strokeDasharray=`${I[N]}`;});}}}if(ie)return it(Nt());yt();function je(){if(!Ae||Y)return;let o=performance.now(),a=st();if(!He&&O===false&&a===ft){q=requestAnimationFrame(je);return}He=false,ft=a;let b=u;if(O!==false){let v=o-pt,F=v>0?Math.abs(a-(Be<0?a:Be))/v:0;b=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Be=a,pt=o;let ue=X?te===-1||a>=te?"forward":"reverse":$;te=a;let De=ge-f,Oe=true,Me=De===0?0:(a-f)/De;if(isNaN(Ve)||(Ve<=0&&Me>0?L?.():Ve>0&&Me<=0&&fe?.(),Ve<1&&Me>=1?E?.():Ve>=1&&Me<1&&R?.()),Ve=Me,Q){let v=Ee(K(a,f,ge,b));ne&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let F=ue==="reverse"?1-v:v;e.style.clipPath=Ie(F),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,e.style.clipPath=Ie(0);},oe))):v<1&&!ne&&(H=false),q=requestAnimationFrame(je);return}if(z.forEach((v,F)=>{let me=F*V*De,h=Ee(K(a,f+me,ge+me,b));ne&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${I[F]*h}`:`${I[F]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=_e(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),D&&v.tagName.toLowerCase()==="path"&&i[F]&&v.setAttribute("d",ct(i[F],D,h)),F===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=Ee(K(a,f,ge,b));for(let F in w){let me=parseFloat(F);v>=me&&!Re.has(me)&&(Re.add(me),w[F]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),Oe&&!H?(H=true,g?.(),ke<(S==="infinite"?1/0:S??0)&&(ke++,Fe=setTimeout(()=>{ye=-1,_=false,H=false,Re.clear(),Ge(),He=true;},oe))):!Oe&&!ne&&(H=false),q=requestAnimationFrame(je);}let at=false;function Ye(){at||(at=true,q=requestAnimationFrame(function(){je();}));}function Ue(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!Y?(He=true,Ye()):Ue();});},{root:ve??null,threshold:k,rootMargin:P});function bt(){z.forEach((o,a)=>{I[a]=ze(o),o.style.strokeDasharray=`${I[a]}`;}),yt(),He=true;}let Xe;function qe(){clearTimeout(Xe),Xe=setTimeout(bt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(Fe),Ue(),lt.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Xe),mt();},replay(){ye=-1,te=-1,Be=-1,_=false,H=false,ke=0,Y=false,he=0,Re.clear(),clearTimeout(Fe),Ge(),He=true,Ae&&Ye();},pause(){Y=true,Ue();},resume(){Y&&(Y=false,He=true,Ae&&Ye());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,Y=true,Ue(),Ft(a,$),He=true;},getProgress(){return he},refresh(){clearTimeout(Xe),bt(),Ae&&!Y&&Ye();}},()=>({tStart:f,tEnd:ge}))}function Zt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function $t(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function Kt(e,n,r){let t=$t(e),l=$t(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Ct(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(Zt(t))return _e(t,l,r);if(t.includes("("))return Kt(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function Jt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var er=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),tr=0,Pt="--scroll-draw-progress";function rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function et(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:$=true,triggerElement:ne,onProgress:Ce,onComplete:B,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,C=$&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),O=de(l.end??"bottom top"),k=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:Jt(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Pt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(C)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?Ke(s):null;function ae(){if(!T||!rr()||!ee||m!=="y"||P||k!==e||u||c!==1||Ce||B||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!er.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++tr}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,O)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),H.remove(),e.style.animationPlayState="",ie(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let Y=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,Ct(he.from,he.to,Y));},getProgress(){let{tStart:te,tEnd:Y}=Ae();return M(K(_(),te,Y,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,R=false,fe=-1,Q=0,Ee=false,Pe=NaN,Ne=-1,ve=0,Se=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Qe(k,P,m),f=xe(i,i.scroll,le(),w,O);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Pt,String(i));for(let f of S)e.style.setProperty(f.prop,Ct(f.from,f.to,i));Ce?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!E||R)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(Ne<0?f:Ne))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}Ne=f,ve=i;let H=g===x?0:(f-x)/(g-x);pe(H);let _=M(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,B?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Ie=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!R?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:P??null}),z;function I(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",I),window.addEventListener("orientationchange",I),Ie.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Ie.disconnect(),window.removeEventListener("resize",I),window.removeEventListener("orientationchange",I),clearTimeout(z),ie(),$e(e);},replay(){fe=-1,Ee=false,Q=0,R=false,j(0);},pause(){R=true,cancelAnimationFrame(L);},resume(){R&&(R=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,R=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tt(e,n){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),ut;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,$=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Ce=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=$(s),V?.(),ut;let X=0,G=0,A=0,C=false,M=false,w=-1,O=0,k=false,P=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),S(),Ce,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=$(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!C||M)return;let d=ne(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),O=d,D(d),d>=1&&!k?(k=true,V?.()):d<1&&!p&&(k=false),A=requestAnimationFrame(se);}oe();{let d=ne(K(P(),X,G,1));p&&d>0&&(w=d),O=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{C=x.isIntersecting,C&&!M?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),$e(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,C&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));O=x,w=x,M=true,cancelAnimationFrame(A),D(x);},getProgress(){return O}}}var It={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rt(e,n={}){if(typeof window>"u")return It;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),It;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,$=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Ce=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=n.from??0,X=n.to,G=0,A=0,C=0,M=false,w=false,O=-1,k=0,P=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),R=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:R,height:fe},oe(),D(),Ce,B);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let R=X??t.duration??0,fe=J+(R-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!M||w||!S)return;let E=ne(K(oe(),G,A,1));c&&(O=Math.max(O,E),E=O),k=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),C=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),$){ee(1),p?.();return}se(),p?.(),M&&!w&&(C=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(R=>{M=R.isIntersecting,M&&!w&&S?C=requestAnimationFrame(ae):cancelAnimationFrame(C);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(C),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),$e(t);},replay(){O=-1,P=false,k=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,M&&S&&(C=requestAnimationFrame(ae)));},seek(E){let R=Math.min(1,Math.max(0,E));k=R,O=R,w=true,cancelAnimationFrame(C),ie=NaN,ee(R);},getProgress(){return k}}}function Dt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function nr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Ot(e){let n=Dt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function or(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function sr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nt(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),kt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Ce=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=nr(t):l==="lines"?J=Ot(t):J=Dt(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=sr(L,u);E&&(g.style.transform=E);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let R=$(or(g,E,X,s));G(L,R);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let C=0,M=0,w=0,O=false,k=false,P=-1,S=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},D(),se(),ne,Ce);C=L.tStart,M=L.tEnd;}function ee(){if(!O||k)return;let g=K(D(),C,M,1);p&&(P=Math.max(P,g),g=P),S=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{O=L.isIntersecting,O&&!k?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),J=Ot(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),$e(t);},replay(){P=-1,oe=false,S=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,P=L,k=true,cancelAnimationFrame(w),A(L);},getProgress(){return S}}}function zr(e,n={}){let r=Je(e,n);return {update(t){r.destroy(),r=Je(e,t);},destroy(){r.destroy();}}}function _r(e={}){let n=null;function r(t){return n=Je(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function qr(e,n){let r=et(e,n);return {update(t){r.destroy(),r=et(e,t);},destroy(){r.destroy();}}}function Wr(e){let n=null;function r(t){return n=et(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Br(e,n){let r=tt(e,n);return {update(t){r.destroy(),r=tt(e,t);},destroy(){r.destroy();}}}function Gr(e){let n=null;function r(t){return n=tt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function jr(e,n={}){let r=rt(e,n);return {update(t){r.destroy(),r=rt(e,t);},destroy(){r.destroy();}}}function Yr(e={}){let n=null;function r(t){return n=rt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}function Ur(e,n={}){let r=nt(e,n);return {update(t){r.destroy(),r=nt(e,t);},destroy(){r.destroy();}}}function Xr(e={}){let n=null;function r(t){return n=nt(t,e),{destroy(){n?.destroy(),n=null;}}}return {action:r,getInstance:()=>n}}export{Wr as createScrollAnimate,Gr as createScrollCounter,_r as createScrollDraw,Xr as createScrollText,Yr as createScrollVideo,qr as scrollAnimate,Br as scrollCounterAction,zr as scrollDraw,Ur as scrollTextAction,jr as scrollVideoAction};
@@ -1 +1 @@
1
- 'use strict';function Q({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),o=0,s=[];for(let u=0;u<n;u++){let a=Math.pow(l,u);s.push(a),o+=a;}let c=[0],m=0;for(let u=0;u<n;u++)m+=s[u]/o,c.push(m);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let a=0;a<n;a++)if(u<=c[a+1]){let g=(u-c[a])/(c[a+1]-c[a]);if(a===0)return g*(2-g);let w=1-Math.pow(t,a);return w+(1-w)*(2*g-1)*(2*g-1)}return 1}}function Z({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-l)*(2*Math.PI)/t)+1}var I={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:Q(),elastic:Z()};function R(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function F(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function H(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function ee(e,r,n){return Math.min(n,Math.max(r,e))}function V(e,r,n,t){return n===r?0:ee((e-r)/(n-r)*t,0,1)}function O(e,r,n,t,l){let o=F(e.top,e.height,r,t.element)-H(t.viewport,n),s=F(e.top,e.height,r,l.element)-H(l.viewport,n);return {tStart:o,tEnd:s}}var N=new Map;function G(e,r){N.set(e,r);}function z(e){N.delete(e);}var te=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function B(e,...r){te&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function k(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function ne(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function q(e){let r=k(e),n=new Map;for(let o of r){let s=o.offsetTop;n.has(s)||n.set(s,[]),n.get(s).push(o);}let t=[],l=Array.from(n.keys()).sort((o,s)=>o-s);for(let o of l){let s=n.get(o),c=document.createElement("span");c.setAttribute("aria-hidden","true"),c.style.display="inline-block",s.forEach((m,u)=>{let a=m.nextElementSibling;c.appendChild(m),u<s.length-1&&a&&a.style.whiteSpace==="pre"&&c.appendChild(a);}),t.push(c);}return e.textContent="",t.forEach((o,s)=>{e.appendChild(o),s<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function re(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,o=r*t,s=o+(1-l);return s<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(s-o)))}function oe(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var W={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pe(e,r={}){if(typeof window>"u")return W;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return B("scrollText: element not found:",e),W;let t=n,{split:l="words",stagger:o=.04,easing:s="ease-out",from:c={opacity:0,y:24},trigger:m={},once:u=true,onComplete:a}=r,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,w=typeof s=="function"?s:I[s]??I["ease-out"],X=R(m.start??"top 85%"),j=R(m.end??"top 40%"),C=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let b;l==="chars"?b=ne(t):l==="lines"?b=q(t):b=k(t);let U=b.length;function Y(i,p){c?.opacity!==void 0&&(i.style.opacity=String(c.opacity+(1-c.opacity)*p));let S=oe(p,c);S&&(i.style.transform=S);}function h(i){t.style.setProperty("--scroll-draw-progress",String(i)),b.forEach((p,S)=>{let K=w(re(i,S,U,o));Y(p,K);});}if(g)return h(1),a?.(),{destroy(){t.innerHTML=C,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};h(0);let L=0,v=0,d=0,M=false,f=false,x=-1,y=0,E=false,P=()=>window.scrollY,J=()=>window.innerHeight;function $(){let i=t.getBoundingClientRect(),p=O({top:i.top,height:i.height},P(),J(),X,j);L=p.tStart,v=p.tEnd;}function _(){if(!M||f)return;let i=V(P(),L,v,1);u&&(x=Math.max(x,i),i=x),y=i,h(i),i>=1&&!E?(E=true,a?.()):i<1&&!u&&(E=false),d=requestAnimationFrame(_);}$();let D=new IntersectionObserver(i=>{i.forEach(p=>{M=p.isIntersecting,M&&!f?d=requestAnimationFrame(_):cancelAnimationFrame(d);});}),A;function T(){clearTimeout(A),A=setTimeout(()=>{if(l==="lines"){let i=y;t.innerHTML=C,t.setAttribute("aria-label",t.textContent??""),b=q(t),h(i);}$();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),D.observe(t),G(t,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:L,tEnd:v})}),{destroy(){cancelAnimationFrame(d),D.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(A),t.innerHTML=C,t.removeAttribute("aria-label"),z(t);},replay(){x=-1,E=false,y=0,f=false,h(0);},pause(){f=true,cancelAnimationFrame(d);},resume(){f&&(f=false,M&&(d=requestAnimationFrame(_)));},seek(i){let p=Math.min(1,Math.max(0,i));y=p,x=p,f=true,cancelAnimationFrame(d),h(p);},getProgress(){return y}}}exports.scrollText=pe;
1
+ 'use strict';function Z({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),o=0,s=[];for(let u=0;u<n;u++){let a=Math.pow(l,u);s.push(a),o+=a;}let c=[0],m=0;for(let u=0;u<n;u++)m+=s[u]/o,c.push(m);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let a=0;a<n;a++)if(u<=c[a+1]){let g=(u-c[a])/(c[a+1]-c[a]);if(a===0)return g*(2-g);let x=1-Math.pow(t,a);return x+(1-x)*(2*g-1)*(2*g-1)}return 1}}function ee({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-l)*(2*Math.PI)/t)+1}var _={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:Z(),elastic:ee()};function R(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function F(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function H(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function te(e,r,n){return Math.min(n,Math.max(r,e))}function V(e,r,n,t){return n===r?0:te((e-r)/(n-r)*t,0,1)}function O(e,r,n,t,l){let o=F(e.top,e.height,r,t.element)-H(t.viewport,n),s=F(e.top,e.height,r,l.element)-H(l.viewport,n);return {tStart:o,tEnd:s}}var N=Symbol.for("svg-scroll-draw.registry");function G(){let e=globalThis;return e[N]||(e[N]=new Map)}function z(e,r){G().set(e,r);}function B(e){G().delete(e);}var ne=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function k(e,...r){ne&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function X(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function re(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function q(e){let r=X(e),n=new Map;for(let o of r){let s=o.offsetTop;n.has(s)||n.set(s,[]),n.get(s).push(o);}let t=[],l=Array.from(n.keys()).sort((o,s)=>o-s);for(let o of l){let s=n.get(o),c=document.createElement("span");c.setAttribute("aria-hidden","true"),c.style.display="inline-block",s.forEach((m,u)=>{let a=m.nextElementSibling;c.appendChild(m),u<s.length-1&&a&&a.style.whiteSpace==="pre"&&c.appendChild(a);}),t.push(c);}return e.textContent="",t.forEach((o,s)=>{e.appendChild(o),s<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function oe(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,o=r*t,s=o+(1-l);return s<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(s-o)))}function se(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var W={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function me(e,r={}){if(typeof window>"u")return W;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return k("scrollText: element not found:",e),W;let t=n,{split:l="words",stagger:o=.04,easing:s="ease-out",from:c={opacity:0,y:24},trigger:m={},once:u=true,onComplete:a}=r,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof s=="function"?s:_[s]??_["ease-out"],Y=R(m.start??"top 85%"),j=R(m.end??"top 40%"),v=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let b;l==="chars"?b=re(t):l==="lines"?b=q(t):b=X(t);let K=b.length;function U(i,p){c?.opacity!==void 0&&(i.style.opacity=String(c.opacity+(1-c.opacity)*p));let S=se(p,c);S&&(i.style.transform=S);}function h(i){t.style.setProperty("--scroll-draw-progress",String(i)),b.forEach((p,S)=>{let Q=x(oe(i,S,K,o));U(p,Q);});}if(g)return h(1),a?.(),{destroy(){t.innerHTML=v,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};h(0);let C=0,L=0,d=0,E=false,f=false,w=-1,y=0,M=false,P=()=>window.scrollY,J=()=>window.innerHeight;function $(){let i=t.getBoundingClientRect(),p=O({top:i.top,height:i.height},P(),J(),Y,j);C=p.tStart,L=p.tEnd;}function A(){if(!E||f)return;let i=V(P(),C,L,1);u&&(w=Math.max(w,i),i=w),y=i,h(i),i>=1&&!M?(M=true,a?.()):i<1&&!u&&(M=false),d=requestAnimationFrame(A);}$();let D=new IntersectionObserver(i=>{i.forEach(p=>{E=p.isIntersecting,E&&!f?d=requestAnimationFrame(A):cancelAnimationFrame(d);});}),I;function T(){clearTimeout(I),I=setTimeout(()=>{if(l==="lines"){let i=y;t.innerHTML=v,t.setAttribute("aria-label",t.textContent??""),b=q(t),h(i);}$();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),D.observe(t),z(t,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:C,tEnd:L})}),{destroy(){cancelAnimationFrame(d),D.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(I),t.innerHTML=v,t.removeAttribute("aria-label"),B(t);},replay(){w=-1,M=false,y=0,f=false,h(0);},pause(){f=true,cancelAnimationFrame(d);},resume(){f&&(f=false,E&&(d=requestAnimationFrame(A)));},seek(i){let p=Math.min(1,Math.max(0,i));y=p,w=p,f=true,cancelAnimationFrame(d),h(p);},getProgress(){return y}}}exports.scrollText=me;
@@ -1 +1 @@
1
- function Q({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),o=0,s=[];for(let u=0;u<n;u++){let a=Math.pow(l,u);s.push(a),o+=a;}let c=[0],m=0;for(let u=0;u<n;u++)m+=s[u]/o,c.push(m);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let a=0;a<n;a++)if(u<=c[a+1]){let g=(u-c[a])/(c[a+1]-c[a]);if(a===0)return g*(2-g);let w=1-Math.pow(t,a);return w+(1-w)*(2*g-1)*(2*g-1)}return 1}}function Z({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-l)*(2*Math.PI)/t)+1}var I={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:Q(),elastic:Z()};function R(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function F(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function H(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function ee(e,r,n){return Math.min(n,Math.max(r,e))}function V(e,r,n,t){return n===r?0:ee((e-r)/(n-r)*t,0,1)}function O(e,r,n,t,l){let o=F(e.top,e.height,r,t.element)-H(t.viewport,n),s=F(e.top,e.height,r,l.element)-H(l.viewport,n);return {tStart:o,tEnd:s}}var N=new Map;function G(e,r){N.set(e,r);}function z(e){N.delete(e);}var te=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function B(e,...r){te&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function k(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function ne(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function q(e){let r=k(e),n=new Map;for(let o of r){let s=o.offsetTop;n.has(s)||n.set(s,[]),n.get(s).push(o);}let t=[],l=Array.from(n.keys()).sort((o,s)=>o-s);for(let o of l){let s=n.get(o),c=document.createElement("span");c.setAttribute("aria-hidden","true"),c.style.display="inline-block",s.forEach((m,u)=>{let a=m.nextElementSibling;c.appendChild(m),u<s.length-1&&a&&a.style.whiteSpace==="pre"&&c.appendChild(a);}),t.push(c);}return e.textContent="",t.forEach((o,s)=>{e.appendChild(o),s<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function re(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,o=r*t,s=o+(1-l);return s<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(s-o)))}function oe(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var W={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pe(e,r={}){if(typeof window>"u")return W;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return B("scrollText: element not found:",e),W;let t=n,{split:l="words",stagger:o=.04,easing:s="ease-out",from:c={opacity:0,y:24},trigger:m={},once:u=true,onComplete:a}=r,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,w=typeof s=="function"?s:I[s]??I["ease-out"],X=R(m.start??"top 85%"),j=R(m.end??"top 40%"),C=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let b;l==="chars"?b=ne(t):l==="lines"?b=q(t):b=k(t);let U=b.length;function Y(i,p){c?.opacity!==void 0&&(i.style.opacity=String(c.opacity+(1-c.opacity)*p));let S=oe(p,c);S&&(i.style.transform=S);}function h(i){t.style.setProperty("--scroll-draw-progress",String(i)),b.forEach((p,S)=>{let K=w(re(i,S,U,o));Y(p,K);});}if(g)return h(1),a?.(),{destroy(){t.innerHTML=C,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};h(0);let L=0,v=0,d=0,M=false,f=false,x=-1,y=0,E=false,P=()=>window.scrollY,J=()=>window.innerHeight;function $(){let i=t.getBoundingClientRect(),p=O({top:i.top,height:i.height},P(),J(),X,j);L=p.tStart,v=p.tEnd;}function _(){if(!M||f)return;let i=V(P(),L,v,1);u&&(x=Math.max(x,i),i=x),y=i,h(i),i>=1&&!E?(E=true,a?.()):i<1&&!u&&(E=false),d=requestAnimationFrame(_);}$();let D=new IntersectionObserver(i=>{i.forEach(p=>{M=p.isIntersecting,M&&!f?d=requestAnimationFrame(_):cancelAnimationFrame(d);});}),A;function T(){clearTimeout(A),A=setTimeout(()=>{if(l==="lines"){let i=y;t.innerHTML=C,t.setAttribute("aria-label",t.textContent??""),b=q(t),h(i);}$();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),D.observe(t),G(t,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:L,tEnd:v})}),{destroy(){cancelAnimationFrame(d),D.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(A),t.innerHTML=C,t.removeAttribute("aria-label"),z(t);},replay(){x=-1,E=false,y=0,f=false,h(0);},pause(){f=true,cancelAnimationFrame(d);},resume(){f&&(f=false,M&&(d=requestAnimationFrame(_)));},seek(i){let p=Math.min(1,Math.max(0,i));y=p,x=p,f=true,cancelAnimationFrame(d),h(p);},getProgress(){return y}}}export{pe as scrollText};
1
+ function Z({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),o=0,s=[];for(let u=0;u<n;u++){let a=Math.pow(l,u);s.push(a),o+=a;}let c=[0],m=0;for(let u=0;u<n;u++)m+=s[u]/o,c.push(m);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let a=0;a<n;a++)if(u<=c[a+1]){let g=(u-c[a])/(c[a+1]-c[a]);if(a===0)return g*(2-g);let x=1-Math.pow(t,a);return x+(1-x)*(2*g-1)*(2*g-1)}return 1}}function ee({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-l)*(2*Math.PI)/t)+1}var _={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:Z(),elastic:ee()};function R(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function F(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function H(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function te(e,r,n){return Math.min(n,Math.max(r,e))}function V(e,r,n,t){return n===r?0:te((e-r)/(n-r)*t,0,1)}function O(e,r,n,t,l){let o=F(e.top,e.height,r,t.element)-H(t.viewport,n),s=F(e.top,e.height,r,l.element)-H(l.viewport,n);return {tStart:o,tEnd:s}}var N=Symbol.for("svg-scroll-draw.registry");function G(){let e=globalThis;return e[N]||(e[N]=new Map)}function z(e,r){G().set(e,r);}function B(e){G().delete(e);}var ne=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function k(e,...r){ne&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function X(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function re(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function q(e){let r=X(e),n=new Map;for(let o of r){let s=o.offsetTop;n.has(s)||n.set(s,[]),n.get(s).push(o);}let t=[],l=Array.from(n.keys()).sort((o,s)=>o-s);for(let o of l){let s=n.get(o),c=document.createElement("span");c.setAttribute("aria-hidden","true"),c.style.display="inline-block",s.forEach((m,u)=>{let a=m.nextElementSibling;c.appendChild(m),u<s.length-1&&a&&a.style.whiteSpace==="pre"&&c.appendChild(a);}),t.push(c);}return e.textContent="",t.forEach((o,s)=>{e.appendChild(o),s<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function oe(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,o=r*t,s=o+(1-l);return s<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(s-o)))}function se(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var W={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function me(e,r={}){if(typeof window>"u")return W;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return k("scrollText: element not found:",e),W;let t=n,{split:l="words",stagger:o=.04,easing:s="ease-out",from:c={opacity:0,y:24},trigger:m={},once:u=true,onComplete:a}=r,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof s=="function"?s:_[s]??_["ease-out"],Y=R(m.start??"top 85%"),j=R(m.end??"top 40%"),v=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let b;l==="chars"?b=re(t):l==="lines"?b=q(t):b=X(t);let K=b.length;function U(i,p){c?.opacity!==void 0&&(i.style.opacity=String(c.opacity+(1-c.opacity)*p));let S=se(p,c);S&&(i.style.transform=S);}function h(i){t.style.setProperty("--scroll-draw-progress",String(i)),b.forEach((p,S)=>{let Q=x(oe(i,S,K,o));U(p,Q);});}if(g)return h(1),a?.(),{destroy(){t.innerHTML=v,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};h(0);let C=0,L=0,d=0,E=false,f=false,w=-1,y=0,M=false,P=()=>window.scrollY,J=()=>window.innerHeight;function $(){let i=t.getBoundingClientRect(),p=O({top:i.top,height:i.height},P(),J(),Y,j);C=p.tStart,L=p.tEnd;}function A(){if(!E||f)return;let i=V(P(),C,L,1);u&&(w=Math.max(w,i),i=w),y=i,h(i),i>=1&&!M?(M=true,a?.()):i<1&&!u&&(M=false),d=requestAnimationFrame(A);}$();let D=new IntersectionObserver(i=>{i.forEach(p=>{E=p.isIntersecting,E&&!f?d=requestAnimationFrame(A):cancelAnimationFrame(d);});}),I;function T(){clearTimeout(I),I=setTimeout(()=>{if(l==="lines"){let i=y;t.innerHTML=v,t.setAttribute("aria-label",t.textContent??""),b=q(t),h(i);}$();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),D.observe(t),z(t,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:C,tEnd:L})}),{destroy(){cancelAnimationFrame(d),D.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(I),t.innerHTML=v,t.removeAttribute("aria-label"),B(t);},replay(){w=-1,M=false,y=0,f=false,h(0);},pause(){f=true,cancelAnimationFrame(d);},resume(){f&&(f=false,E&&(d=requestAnimationFrame(A)));},seek(i){let p=Math.min(1,Math.max(0,i));y=p,w=p,f=true,cancelAnimationFrame(d),h(p);},getProgress(){return y}}}export{me as scrollText};
@@ -1,15 +1,15 @@
1
- 'use strict';function ve({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,n)),u=Math.sqrt(o),m=0,M=[];for(let c=0;c<r;c++){let p=Math.pow(u,c);M.push(p),m+=p;}let f=[0],y=0;for(let c=0;c<r;c++)y+=M[c]/m,f.push(y);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let p=0;p<r;p++)if(c<=f[p+1]){let b=(c-f[p])/(f[p+1]-f[p]);if(p===0)return b*(2-b);let E=1-Math.pow(o,p);return E+(1-E)*(2*b-1)*(2*b-1)}return 1}}function Me({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),o=Math.max(.1,n),u=r<=1?o/4:o/(2*Math.PI)*Math.asin(1/r);return m=>m<=0?0:m>=1?1:r*Math.pow(2,-10*m)*Math.sin((m-u)*(2*Math.PI)/o)+1}var B={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:ve(),elastic:Me()};function j(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",o="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:o}}function re(e,n,r,o){switch(o){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function oe(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 H(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(r+o)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Ee(e,n,r){return Math.min(r,Math.max(n,e))}function ie(e,n,r,o){return r===n?0:Ee((e-n)/(r-n)*o,0,1)}function se(e,n,r,o,u){let m=re(e.top,e.height,n,o.element)-oe(o.viewport,r),M=re(e.top,e.height,n,u.element)-oe(u.viewport,r);return {tStart:m,tEnd:M}}function ae(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ue(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=u=>e(!!u.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",r),()=>n.removeEventListener("change",r);let o=n;return o.addListener?.(r),()=>o.removeListener?.(r)}var Le=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ce(e,...n){Le&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var le=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function _e(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let o=typeof e=="string"?document.querySelector(e):e;if(!o)return ce("timeline: Container not found:",e),r;let u=o,{trigger:m={},speed:M=1,once:f=false,axis:y="y",tracks:c,onComplete:p,repeat:b,repeatDelay:E=0,loop:P=false,loopDuration:de=1500,debug:pe=false,label:me,respectReducedMotion:X=true}=n,fe=j(m.start??"top bottom"),be=j(m.end??"bottom top"),$=b==="infinite"?1/0:b??0,l,V=P===true?1/0:typeof P=="number"?P:0,h=false,G=0,L=V,z=X&&ae(),he=ue(t=>{z=X&&t,z&&(h=false,clearTimeout(l),l=void 0);}),O=()=>V>0&&!z,Q=new Map,q=c.map(t=>{let s=typeof t.easing=="function"?t.easing:B[t.easing??"linear"]??B.linear,d=Array.from(u.querySelectorAll(t.selector)),a=d.map(i=>H(i));return d.forEach((i,g)=>{Q.has(i)||Q.set(i,i.getAttribute("style")??""),i.style.strokeDasharray=`${a[g]}`,i.style.strokeDashoffset=`${a[g]}`,t.fade&&(i.style.opacity="0");}),{...t,elements:d,lengths:a,easeFn:s}});function ge(){for(let[t,s]of Q)s?t.setAttribute("style",s):t.removeAttribute("style");}let U=0,J=0,R=false,x=false,v=0,S=false,D=-1,T=0,w=null;pe&&(w=document.createElement("div"),Object.assign(w.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(w));function we(t){if(!w)return;let s=me??(typeof e=="string"?e:"timeline"),d=c.map(({selector:a,from:i,to:g},W)=>{let I=le[W%le.length],F=g>i?Math.min(1,Math.max(0,(t-i)/(g-i))):0,k=Math.round(F*100);return `<div style="margin:4px 0">
1
+ 'use strict';function Le({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,n)),s=Math.sqrt(o),m=0,E=[];for(let c=0;c<r;c++){let p=Math.pow(s,c);E.push(p),m+=p;}let f=[0],w=0;for(let c=0;c<r;c++)w+=E[c]/m,f.push(w);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let p=0;p<r;p++)if(c<=f[p+1]){let g=(c-f[p])/(f[p+1]-f[p]);if(p===0)return g*(2-g);let T=1-Math.pow(o,p);return T+(1-T)*(2*g-1)*(2*g-1)}return 1}}function Ie({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),o=Math.max(.1,n),s=r<=1?o/4:o/(2*Math.PI)*Math.asin(1/r);return m=>m<=0?0:m>=1?1:r*Math.pow(2,-10*m)*Math.sin((m-s)*(2*Math.PI)/o)+1}var H={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:Le(),elastic:Ie()};function X(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",o="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:o}}function re(e,n,r,o){switch(o){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function oe(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 K(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(r+o)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Re(e,n,r){return Math.min(r,Math.max(n,e))}function ie(e,n,r,o){return r===n?0:Re((e-n)/(r-n)*o,0,1)}function se(e,n,r,o,s){let m=re(e.top,e.height,n,o.element)-oe(o.viewport,r),E=re(e.top,e.height,n,s.element)-oe(s.viewport,r);return {tStart:m,tEnd:E}}function ae(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ue(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=s=>e(!!s.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",r),()=>n.removeEventListener("change",r);let o=n;return o.addListener?.(r),()=>o.removeListener?.(r)}var Se=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ce(e,...n){Se&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var le=Symbol.for("svg-scroll-draw.registry");function de(){let e=globalThis;return e[le]||(e[le]=new Map)}function pe(e,n){de().set(e,n);}function me(e){de().delete(e);}var fe=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Ve(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let o=typeof e=="string"?document.querySelector(e):e;if(!o)return ce("timeline: Container not found:",e),r;let s=o,{trigger:m={},speed:E=1,once:f=false,axis:w="y",tracks:c,onComplete:p,repeat:g,repeatDelay:T=0,loop:P=false,loopDuration:ge=1500,debug:be=false,label:he,respectReducedMotion:U=true}=n,ye=X(m.start??"top bottom"),we=X(m.end??"bottom top"),D=g==="infinite"?1/0:g??0,l,V=P===true?1/0:typeof P=="number"?P:0,b=false,G=0,L=V,z=U&&ae(),xe=ue(t=>{z=U&&t,z&&(b=false,clearTimeout(l),l=void 0);}),O=()=>V>0&&!z,Q=new Map,q=c.map(t=>{let a=typeof t.easing=="function"?t.easing:H[t.easing??"linear"]??H.linear,d=Array.from(s.querySelectorAll(t.selector)),u=d.map(i=>K(i));return d.forEach((i,h)=>{Q.has(i)||Q.set(i,i.getAttribute("style")??""),i.style.strokeDasharray=`${u[h]}`,i.style.strokeDashoffset=`${u[h]}`,t.fade&&(i.style.opacity="0");}),{...t,elements:d,lengths:u,easeFn:a}});function ve(){for(let[t,a]of Q)a?t.setAttribute("style",a):t.removeAttribute("style");}let N=0,W=0,_=false,x=false,v=0,R=false,S=-1,M=0,y=null;be&&(y=document.createElement("div"),Object.assign(y.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(y));function Me(t){if(!y)return;let a=he??(typeof e=="string"?e:"timeline"),d=c.map(({selector:u,from:i,to:h},j)=>{let I=fe[j%fe.length],C=h>i?Math.min(1,Math.max(0,(t-i)/(h-i))):0,F=Math.round(C*100);return `<div style="margin:4px 0">
2
2
  <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
3
- <span style="color:${I};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${a}</span>
4
- <span style="color:#666;margin-left:8px">${k}%</span>
3
+ <span style="color:${I};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${u}</span>
4
+ <span style="color:#666;margin-left:8px">${F}%</span>
5
5
  </div>
6
6
  <div style="height:3px;background:#2a2a2a;border-radius:2px;position:relative;overflow:hidden">
7
- <div style="position:absolute;left:${i*100}%;width:${(g-i)*100}%;height:100%;background:${I}33;border-radius:2px"></div>
8
- <div style="position:absolute;left:${i*100}%;width:${(g-i)*F*100}%;height:100%;background:${I};border-radius:2px;transition:width 0.05s linear"></div>
7
+ <div style="position:absolute;left:${i*100}%;width:${(h-i)*100}%;height:100%;background:${I}33;border-radius:2px"></div>
8
+ <div style="position:absolute;left:${i*100}%;width:${(h-i)*C*100}%;height:100%;background:${I};border-radius:2px;transition:width 0.05s linear"></div>
9
9
  </div>
10
- </div>`}).join("");w.innerHTML=`
10
+ </div>`}).join("");y.innerHTML=`
11
11
  <div style="color:#555;margin-bottom:8px;font-size:10px;text-transform:uppercase;letter-spacing:0.12em;border-bottom:1px solid rgba(255,255,255,0.06);padding-bottom:6px">
12
- scrollDrawTimeline \xB7 ${s}
12
+ scrollDrawTimeline \xB7 ${a}
13
13
  </div>
14
14
  ${d}
15
15
  <div style="margin-top:6px;padding-top:6px;border-top:1px solid rgba(255,255,255,0.06)">
@@ -20,4 +20,4 @@
20
20
  <div style="height:2px;background:#2a2a2a;border-radius:1px;overflow:hidden">
21
21
  <div style="height:100%;background:#fff;border-radius:1px;width:${t*100}%;transition:width 0.05s linear"></div>
22
22
  </div>
23
- </div>`;}function K(){return y==="x"?window.scrollX:window.scrollY}function ye(){return y==="x"?window.innerWidth:window.innerHeight}function Y(){let t=u.getBoundingClientRect(),s=K(),d=y==="x"?t.left:t.top,a=y==="x"?t.width:t.height,i=se({top:d,height:a},s,ye(),fe,be);U=i.tStart,J=i.tEnd;}function Z(t){u.style.setProperty("--scroll-draw-progress",String(t)),q.forEach(({elements:s,lengths:d,from:a,to:i,easeFn:g,fade:W})=>{let I=i-a,F=I>0?Math.min(1,Math.max(0,(t-a)/I)):0,k=g(F);s.forEach((ne,xe)=>{ne.style.strokeDashoffset=`${d[xe]*(1-k)}`,W&&(ne.style.opacity=String(k));});}),we(t);}function _(){D=-1,T=0,S=false,q.forEach(({elements:t,lengths:s,fade:d})=>{t.forEach((a,i)=>{a.style.strokeDashoffset=`${s[i]}`,d&&(a.style.opacity="0");});}),u.style.setProperty("--scroll-draw-progress","0");}function N(){if(!R||x)return;let t;h?t=Math.min(1,(performance.now()-G)/de):(t=ie(K(),U,J,M),(f||O())&&(D=Math.max(D,t),t=D)),T=t,Z(t),t>=1&&!S?(S=true,p?.(),O()&&!h&&!l?l=setTimeout(()=>{l=void 0,L!==1/0&&L--,_(),h=true,G=performance.now();},E):$>0&&f&&!h&&!l&&(l=setTimeout(()=>{l=void 0,$!==1/0&&$--,_();},E))):!h&&t<1&&!f&&(S=false),h&&t>=1&&!l&&(S=false,L>0&&O()?l=setTimeout(()=>{l=void 0,L!==1/0&&L--,_(),G=performance.now();},E):h=false),v=requestAnimationFrame(N);}Y();let ee=new IntersectionObserver(t=>{t.forEach(s=>{R=s.isIntersecting,R&&!x?v=requestAnimationFrame(N):cancelAnimationFrame(v);});},{threshold:0});ee.observe(u);function te(){q.forEach(({elements:t,lengths:s})=>{t.forEach((d,a)=>{s[a]=H(d),d.style.strokeDasharray=`${s[a]}`;});}),Y();}let A;function C(){clearTimeout(A),A=setTimeout(te,150);}return window.addEventListener("resize",C),window.addEventListener("orientationchange",C),{destroy(){cancelAnimationFrame(v),clearTimeout(A),clearTimeout(l),ee.disconnect(),window.removeEventListener("resize",C),window.removeEventListener("orientationchange",C),he(),w&&(w.remove(),w=null),ge(),u.style.removeProperty("--scroll-draw-progress");},refresh(){clearTimeout(A),te();},replay(){$=b==="infinite"?1/0:b??0,L=V,h=false,clearTimeout(l),l=void 0,_(),x=false;},pause(){x=true,cancelAnimationFrame(v);},resume(){x&&(x=false,R&&(v=requestAnimationFrame(N)));},seek(t){T=Math.min(1,Math.max(0,t)),D=T,x=true,cancelAnimationFrame(v),Z(T);},getProgress(){return T}}}exports.scrollDrawTimeline=_e;
23
+ </div>`;}function Y(){return w==="x"?window.scrollX:window.scrollY}function Ee(){return w==="x"?window.innerWidth:window.innerHeight}function J(){let t=s.getBoundingClientRect(),a=Y(),d=w==="x"?t.left:t.top,u=w==="x"?t.width:t.height,i=se({top:d,height:u},a,Ee(),ye,we);N=i.tStart,W=i.tEnd;}function Z(t){s.style.setProperty("--scroll-draw-progress",String(t)),q.forEach(({elements:a,lengths:d,from:u,to:i,easeFn:h,fade:j})=>{let I=i-u,C=I>0?Math.min(1,Math.max(0,(t-u)/I)):0,F=h(C);a.forEach((ne,Te)=>{ne.style.strokeDashoffset=`${d[Te]*(1-F)}`,j&&(ne.style.opacity=String(F));});}),Me(t);}function $(){S=-1,M=0,R=false,q.forEach(({elements:t,lengths:a,fade:d})=>{t.forEach((u,i)=>{u.style.strokeDashoffset=`${a[i]}`,d&&(u.style.opacity="0");});}),s.style.setProperty("--scroll-draw-progress","0");}function B(){if(!_||x)return;let t;b?t=Math.min(1,(performance.now()-G)/ge):(t=ie(Y(),N,W,E),(f||O())&&(S=Math.max(S,t),t=S)),M=t,Z(t),t>=1&&!R?(R=true,p?.(),O()&&!b&&!l?l=setTimeout(()=>{l=void 0,L!==1/0&&L--,$(),b=true,G=performance.now();},T):D>0&&f&&!b&&!l&&(l=setTimeout(()=>{l=void 0,D!==1/0&&D--,$();},T))):!b&&t<1&&!f&&(R=false),b&&t>=1&&!l&&(R=false,L>0&&O()?l=setTimeout(()=>{l=void 0,L!==1/0&&L--,$(),G=performance.now();},T):b=false),v=requestAnimationFrame(B);}J();let ee=new IntersectionObserver(t=>{t.forEach(a=>{_=a.isIntersecting,_&&!x?v=requestAnimationFrame(B):cancelAnimationFrame(v);});},{threshold:0});ee.observe(s);function te(){q.forEach(({elements:t,lengths:a})=>{t.forEach((d,u)=>{a[u]=K(d),d.style.strokeDasharray=`${a[u]}`;});}),J();}let A;function k(){clearTimeout(A),A=setTimeout(te,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),pe(s,{type:"draw",getProgress:()=>M,getTrigger:()=>({tStart:N,tEnd:W})}),{destroy(){cancelAnimationFrame(v),clearTimeout(A),clearTimeout(l),ee.disconnect(),me(s),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),xe(),y&&(y.remove(),y=null),ve(),s.style.removeProperty("--scroll-draw-progress");},refresh(){clearTimeout(A),te();},replay(){D=g==="infinite"?1/0:g??0,L=V,b=false,clearTimeout(l),l=void 0,$(),x=false;},pause(){x=true,cancelAnimationFrame(v);},resume(){x&&(x=false,_&&(v=requestAnimationFrame(B)));},seek(t){M=Math.min(1,Math.max(0,t)),S=M,x=true,cancelAnimationFrame(v),Z(M);},getProgress(){return M}}}exports.scrollDrawTimeline=Ve;