svg-scroll-draw 2.18.1 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +10 -10
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +3 -3
  4. package/dist/angular/index.d.ts +3 -3
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +3 -3
  7. package/dist/astro/index.d.mts +6 -5
  8. package/dist/astro/index.d.ts +6 -5
  9. package/dist/astro/index.mjs +1 -1
  10. package/dist/cdn/svg-scroll-draw.dev.global.js +133 -31
  11. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  12. package/dist/chunk-7SBTYJGH.mjs +1 -0
  13. package/dist/chunk-A4JCC3QQ.mjs +1 -0
  14. package/dist/chunk-BFX2CSQ3.mjs +1 -0
  15. package/dist/chunk-I45LCJUP.mjs +1 -0
  16. package/dist/{chunk-DIMNQPW5.mjs → chunk-JPK2NJWO.mjs} +1 -1
  17. package/dist/chunk-KHQ7OGQK.mjs +1 -0
  18. package/dist/chunk-MTEGM4RR.mjs +1 -0
  19. package/dist/chunk-PKHX3HSS.mjs +1 -0
  20. package/dist/chunk-WHFRS7IP.mjs +3 -0
  21. package/dist/{engine-6AXEX8CL.d.ts → engine-C9LKls__.d.ts} +1 -1
  22. package/dist/{engine-Ci08nM91.d.mts → engine-CvzRSkuk.d.mts} +1 -1
  23. package/dist/group/index.cjs +2 -2
  24. package/dist/group/index.d.mts +3 -3
  25. package/dist/group/index.d.ts +3 -3
  26. package/dist/group/index.mjs +1 -1
  27. package/dist/horizontal/index.cjs +1 -1
  28. package/dist/horizontal/index.d.mts +1 -1
  29. package/dist/horizontal/index.d.ts +1 -1
  30. package/dist/horizontal/index.mjs +1 -1
  31. package/dist/{index-BDGQEK6X.d.mts → index-BlIjovDN.d.mts} +1 -1
  32. package/dist/{index-DxjUOIbK.d.ts → index-DZjvLJcU.d.ts} +1 -1
  33. package/dist/{index-BVuNgQSd.d.ts → index-G3VfLIN8.d.ts} +2 -2
  34. package/dist/{index-CGR7pSOR.d.mts → index-Zxa5HIes.d.mts} +2 -2
  35. package/dist/index.cjs +4 -4
  36. package/dist/index.d.mts +6 -6
  37. package/dist/index.d.ts +6 -6
  38. package/dist/index.mjs +1 -1
  39. package/dist/nuxt/index.cjs +3 -3
  40. package/dist/nuxt/index.d.mts +3 -3
  41. package/dist/nuxt/index.d.ts +3 -3
  42. package/dist/nuxt/index.mjs +1 -1
  43. package/dist/pin/index.cjs +1 -1
  44. package/dist/pin/index.mjs +1 -1
  45. package/dist/progress/index.cjs +1 -1
  46. package/dist/progress/index.d.mts +1 -1
  47. package/dist/progress/index.d.ts +1 -1
  48. package/dist/progress/index.mjs +1 -1
  49. package/dist/react/index.cjs +3 -3
  50. package/dist/react/index.d.mts +16 -13
  51. package/dist/react/index.d.ts +16 -13
  52. package/dist/react/index.mjs +1 -1
  53. package/dist/reveal/index.cjs +1 -1
  54. package/dist/reveal/index.d.mts +1 -1
  55. package/dist/reveal/index.d.ts +1 -1
  56. package/dist/reveal/index.mjs +1 -1
  57. package/dist/{scroll-draw-CNlq4Z_L.d.mts → scroll-draw-B4CadBz0.d.mts} +1 -1
  58. package/dist/{scroll-draw-BlJfbTDv.d.ts → scroll-draw-Cs6Z5ype.d.ts} +1 -1
  59. package/dist/snap/index.d.mts +1 -1
  60. package/dist/snap/index.d.ts +1 -1
  61. package/dist/solid/index.cjs +2 -2
  62. package/dist/solid/index.d.mts +3 -3
  63. package/dist/solid/index.d.ts +3 -3
  64. package/dist/solid/index.mjs +1 -1
  65. package/dist/svelte/index.cjs +2 -2
  66. package/dist/svelte/index.d.mts +3 -3
  67. package/dist/svelte/index.d.ts +3 -3
  68. package/dist/svelte/index.mjs +1 -1
  69. package/dist/text/index.cjs +1 -1
  70. package/dist/text/index.d.mts +1 -1
  71. package/dist/text/index.d.ts +1 -1
  72. package/dist/text/index.mjs +1 -1
  73. package/dist/timeline/index.cjs +11 -11
  74. package/dist/timeline/index.d.mts +1 -1
  75. package/dist/timeline/index.d.ts +1 -1
  76. package/dist/timeline/index.mjs +4 -4
  77. package/dist/{types-DHU1zNEw.d.mts → types-B0YM4nQP.d.mts} +6 -1
  78. package/dist/{types-DHU1zNEw.d.ts → types-B0YM4nQP.d.ts} +6 -1
  79. package/dist/video/index.cjs +1 -1
  80. package/dist/video/index.d.mts +1 -1
  81. package/dist/video/index.d.ts +1 -1
  82. package/dist/video/index.mjs +1 -1
  83. package/dist/vue/index.cjs +3 -3
  84. package/dist/vue/index.d.mts +5 -83
  85. package/dist/vue/index.d.ts +5 -83
  86. package/dist/vue/index.mjs +1 -1
  87. package/dist/web-component/index.cjs +3 -3
  88. package/dist/web-component/index.mjs +1 -1
  89. package/package.json +1 -1
  90. package/dist/chunk-4MH5SQTH.mjs +0 -1
  91. package/dist/chunk-CTVQDBD3.mjs +0 -1
  92. package/dist/chunk-KBFWDHF4.mjs +0 -1
  93. package/dist/chunk-LINFV2GK.mjs +0 -3
  94. package/dist/chunk-PEFR3ZB7.mjs +0 -1
  95. package/dist/chunk-QJ4H2HW3.mjs +0 -1
  96. package/dist/chunk-SNCRC6BA.mjs +0 -1
  97. package/dist/chunk-TIRZOSQ4.mjs +0 -1
@@ -0,0 +1,3 @@
1
+ import {b as b$1,a as a$5}from'./chunk-OJFWQ6CU.mjs';import {a as a$2}from'./chunk-YWKPTYSG.mjs';import {a as a$1}from'./chunk-YZV4Z3EQ.mjs';import {a,d as d$1,c,b as b$3}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$4,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b,a as a$3}from'./chunk-LFSU6LR3.mjs';var ct={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 kt=0;function St(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function ut(r,b){let p="";try{p=getComputedStyle(r).getPropertyValue(b).trim();}catch{}return p||(r.getAttribute(b)??"").trim()}var mt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function At(r){if(!a$3)return;let b$1=ut(r,"stroke");if(!b$1||b$1==="none"){b("Element has no stroke \u2014 path will not be visible.",r);return}let p=(r.getAttribute("fill")??"").trim();p&&!mt.has(p)&&!mt.has(ut(r,"fill"))&&b("Element has a fill \u2014 it may obscure the stroke animation.",r);}function xt(r,b,p){let $=document.createElement("div");$.setAttribute("data-svg-scroll-draw-debug",""),$.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 H(){let D=p==="x"?window.scrollX:window.scrollY,C=r-D,V=b-D,O=p==="x";$.innerHTML=`
2
+ <div style="position:absolute;${O?`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;${O?`left:${V}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${V}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($),window.addEventListener("scroll",H,{passive:true}),H(),{el:$,destroy(){window.removeEventListener("scroll",H),$.remove();}}}var pt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,dt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Pt(r,b$1,p){if(!a$3)return;let $=(r.match(dt)??[]).join("").toUpperCase(),H=(b$1.match(dt)??[]).join("").toUpperCase(),D=(r.match(pt)??[]).length,C=(b$1.match(pt)??[]).length;if($!==H){b(`morphTo: command sequence differs (${$||"\u2205"} \u2192 ${H||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,p);return}D!==C&&b(`morphTo: coordinate count differs (${D} \u2192 ${C}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,p);}function Ve(r,b,p){let $=(b.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),H=0;return r.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,D=>{let C=parseFloat(D),V=$[H++]??C;return String(+(C+(V-C)*p).toFixed(4))})}function Wt(r,b$4={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:p,...$}=b$4,H=p?{...ct[p],...$}:$,D=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:C="path, polyline, line, polygon, rect, circle",speed:V=1,fade:O=false,easing:me="linear",trigger:ve={},stagger:we=0,direction:d$2="forward",once:Z=false,debug:yt=false,axis:J="y",scrollContainer:De,autoReverse:be=false,delay:pe=0,strokeColor:K,strokeWidth:ee,fillOpacity:te,waypoints:re,velocityScale:de=false,threshold:Ge=0,rootMargin:Be="0px",repeat:se=0,repeatDelay:Ce=0,morphTo:P,clip:Oe,autoplay:ht=false,duration:gt=1e3,native:vt=true,onProgress:ye,onStart:$e,onComplete:ae,onEnter:_e,onLeave:Ue,onEnterBack:je,onLeaveBack:Xe}=H,U=Oe===true?"left":typeof Oe=="string"?Oe:false,oe=typeof me=="function"?me:d[me]??d.linear,Ye=a(ve.start??"top bottom"),Qe=a(ve.end??"bottom top"),R=typeof De=="string"?document.querySelector(De):De??null,I=Array.isArray(K)?K[0]:null,E=Array.isArray(K)?K[1]:typeof K=="string"?K:null,A=Array.isArray(ee)?ee[0]:null,T=Array.isArray(ee)?ee[1]:typeof ee=="number"?ee:null,x=Array.isArray(te)?te[0]:null,k=Array.isArray(te)?te[1]:typeof te=="number"?te:null;function ne(e){let t=e*100;switch(U){case "right":return `inset(0 0 0 ${100-t}%)`;case "top":return `inset(0 0 ${100-t}% 0)`;case "bottom":return `inset(${100-t}% 0 0 0)`;case "center":return `circle(${e*150}% at 50% 50%)`;default:return `inset(0 ${100-t}% 0 0)`}}let m=U?[]:Array.from(r.querySelectorAll(C)),l=[],L=[],z=0,G=0,g=false,F=false,v=0,le=false,j=-1,he=[],Ee=-1,w=false,W=0,B=0,X,Fe=null;function Ze(){Fe?.destroy(),Fe=null;}let Y=new Set,Je=NaN,Q=true,Te=-1,Ke=performance.now(),fe=NaN;function Ne(){return R?J==="x"?R.scrollLeft:R.scrollTop:J==="x"?window.scrollX:window.scrollY}function et(){return R?J==="x"?R.clientWidth:R.clientHeight:J==="x"?window.innerWidth:window.innerHeight}function tt(){let e=a$2(r,R,J);return c(e,e.scroll,et(),Ye,Qe)}function rt(){(({tStart:z,tEnd:G}=tt())),yt&&a$3&&(Ze(),Fe=xt(z,G,J));}function He(e,t=tt){a$4(r,{type:"draw",getProgress:()=>e.getProgress(),getTrigger:t});let n=e.destroy;return e.destroy=()=>{n.call(e),b$2(r);},e}function wt(e,t){if(r.style.setProperty("--scroll-draw-progress",String(e)),U){let n=t==="reverse"?1-e:e;r.style.clipPath=ne(n);return}m.forEach((n,y)=>{n.style.strokeDashoffset=t==="reverse"?`${l[y]*e}`:`${l[y]*(1-e)}`,O&&(n.style.opacity=t==="reverse"?`${1-e}`:`${e}`),I&&E?n.style.stroke=a$5(I,E,e):E&&(n.style.stroke=E),A!==null&&T!==null?n.style.strokeWidth=`${A+(T-A)*e}`:T!==null&&(n.style.strokeWidth=`${T}`),x!==null&&k!==null?n.style.fillOpacity=`${x+(k-x)*e}`:k!==null&&(n.style.fillOpacity=`${k}`),P&&n.tagName.toLowerCase()==="path"&&L[y]&&n.setAttribute("d",Ve(L[y],P,e));});}function ke(){if(r.style.setProperty("--scroll-draw-progress","0"),U){r.style.clipPath=ne(0);return}m.forEach((e,t)=>{e.style.strokeDasharray=`${l[t]}`,e.style.strokeDashoffset=d$2==="reverse"?"0":`${l[t]}`,O?e.style.opacity=d$2==="reverse"?"1":"0":e.style.opacity="",I&&(e.style.stroke=I),A!==null&&(e.style.strokeWidth=`${A}`),x!==null&&(e.style.fillOpacity=`${x}`),P&&e.tagName.toLowerCase()==="path"&&L[t]&&e.setAttribute("d",L[t]);});}if(m.forEach(e=>{At(e);let t=a$1(e);l.push(t);let n=e.tagName.toLowerCase()==="path";n?L.push(e.getAttribute("d")??""):L.push(""),P&&(n?Pt(L[L.length-1],P,e):b(`morphTo only applies to <path> elements \u2014 ignored on <${e.tagName}>.`,e)),D?(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=d$2==="reverse"?`${t}`:"0",O&&(e.style.opacity="1"),E&&(e.style.stroke=E),T!==null&&(e.style.strokeWidth=`${T}`),k!==null&&(e.style.fillOpacity=`${k}`),P&&e.tagName.toLowerCase()==="path"&&e.setAttribute("d",P)):(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=d$2==="reverse"?"0":`${t}`,O?e.style.opacity=d$2==="reverse"?"1":"0":e.style.opacity="",I&&(e.style.stroke=I),A!==null&&(e.style.strokeWidth=`${A}`),x!==null&&(e.style.fillOpacity=`${x}`));}),U){if(D)return r.style.clipPath=ne(1),ae?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};r.style.clipPath=ne(0);}else if(D)return ae?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let st=typeof me=="string"?b$1(me):null;function bt(){return !(vt===false||!St()||!m.length||!st||U||J!=="y"||R||V!==1||we!==0||Z||be||de!==false||P||re||se||pe>0||ye||$e||ae||_e||Ue||je||Xe||K!=null||ee!=null||te!=null||(ve.start??"top bottom").trim()!=="top bottom"||(ve.end??"bottom top").trim()!=="bottom top")}function $t(){let e=++kt,t=`svg-scroll-draw-${e}`,n=`svg-scroll-draw-host-${e}`,y=`--svg-scroll-draw-${e}`,_=d$2==="reverse"?"0":"var(--ssd-len)",q=d$2==="reverse"?"var(--ssd-len)":"0",N=`stroke-dashoffset:${_};`,i=`stroke-dashoffset:${q};`;O&&(N+=`opacity:${d$2==="reverse"?1:0};`,i+=`opacity:${d$2==="reverse"?0:1};`);let a=document.createElement("style");a.setAttribute("data-svg-scroll-draw",""),a.textContent=`@keyframes ${t}{from{${N}}to{${i}}}.${n}{view-timeline-name:${y};view-timeline-axis:block;}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${st};animation-fill-mode:both;animation-timeline:${y};animation-range:cover 0% cover 100%;}`,document.head.appendChild(a),r.classList.add(n);function h(s,u){s.style.setProperty("--ssd-len",String(l[u])),s.style.strokeDasharray=`${l[u]}`,s.style.strokeDashoffset="",s.style.opacity="",s.style.animationPlayState="",s.classList.add(t);}m.forEach(h);let o=false,f=-1;function c$1(){if(f>=0)return f;let s=r.getBoundingClientRect(),{tStart:u,tEnd:M}=c({top:s.top,height:s.height},Ne(),et(),Ye,Qe);return oe(b$3(Ne(),u,M,V))}return {destroy(){r.classList.remove(n),m.forEach(s=>{s.classList.remove(t),s.style.removeProperty("--ssd-len"),s.style.animationPlayState="";}),a.remove();},replay(){o=false,f=-1,m.forEach(h);},pause(){o=true,m.forEach(s=>{s.style.animationPlayState="paused";});},resume(){o&&(o=false,m.forEach(s=>{s.style.animationPlayState="running";}));},seek(s){let u=Math.min(1,Math.max(0,s));f=u,o=true,m.forEach((M,S)=>{M.classList.remove(t),M.style.strokeDashoffset=d$2==="reverse"?`${l[S]*u}`:`${l[S]*(1-u)}`,O&&(M.style.opacity=d$2==="reverse"?`${1-u}`:`${u}`);});},getProgress(){return c$1()},refresh(){m.forEach((s,u)=>{l[u]=a$1(s),s.style.setProperty("--ssd-len",String(l[u])),s.style.strokeDasharray=`${l[u]}`;});}}}if(bt())return He($t());function Et(){let e=Math.max(1,gt),t=0,n=0,y=false;function _(o){let f=true;if(U){let c=Math.min(1,Math.max(0,o/e)),s=oe(c);W=s,r.style.setProperty("--scroll-draw-progress",String(s)),r.style.clipPath=ne(d$2==="reverse"?1-s:s),ye?.(s),c<1&&(f=false);}else m.forEach((c,s)=>{let u=s*we*e,M=Math.min(1,Math.max(0,(o-u)/e)),S=oe(M);c.style.strokeDashoffset=d$2==="reverse"?`${l[s]*S}`:`${l[s]*(1-S)}`,O&&(c.style.opacity=d$2==="reverse"?`${1-S}`:`${S}`),I&&E?c.style.stroke=a$5(I,E,S):E&&(c.style.stroke=E),A!==null&&T!==null?c.style.strokeWidth=`${A+(T-A)*S}`:T!==null&&(c.style.strokeWidth=`${T}`),x!==null&&k!==null?c.style.fillOpacity=`${x+(k-x)*S}`:k!==null&&(c.style.fillOpacity=`${k}`),P&&c.tagName.toLowerCase()==="path"&&L[s]&&c.setAttribute("d",Ve(L[s],P,S)),s===0&&(W=S,ye?.(S),r.style.setProperty("--scroll-draw-progress",String(S))),M<1&&(f=false);});if(re){let c=Math.min(1,Math.max(0,o/e)),s=oe(c);for(let u in re){let M=parseFloat(u);s>=M&&!Y.has(M)&&(Y.add(M),re[u]?.());}}return f}function q(o){if(w)return;let f=o-t;F||(F=true,$e?.());let c=_(f);if(c&&!g){g=true,_(e*(1+Math.max(0,m.length-1)*we)),ae?.(),B<(se==="infinite"?1/0:se??0)&&(B++,X=setTimeout(()=>{t=performance.now(),F=false,g=false,Y.clear(),ke(),v=requestAnimationFrame(q);},Ce));return}c||(v=requestAnimationFrame(q));}function N(){cancelAnimationFrame(v),clearTimeout(X),t=performance.now(),n=0,w=false,F=false,g=false,B=0,y=true,W=0,Y.clear(),ke(),v=requestAnimationFrame(q);}let i=new IntersectionObserver(o=>{o.forEach(f=>{f.isIntersecting&&!(Z&&g)?N():!f.isIntersecting&&!Z&&!g&&(cancelAnimationFrame(v),clearTimeout(X),y=false);});},{root:R??null,threshold:Ge,rootMargin:Be}),a;function h(){clearTimeout(a),a=setTimeout(()=>{m.forEach((o,f)=>{l[f]=a$1(o),o.style.strokeDasharray=`${l[f]}`;});},150);}return window.addEventListener("resize",h),window.addEventListener("orientationchange",h),pe>0?setTimeout(()=>i.observe(r),pe):i.observe(r),{destroy(){cancelAnimationFrame(v),clearTimeout(X),i.disconnect(),window.removeEventListener("resize",h),window.removeEventListener("orientationchange",h),clearTimeout(a);},replay(){B=0,N();},pause(){w||!y||(w=true,n=performance.now()-t,cancelAnimationFrame(v));},resume(){w&&(w=false,y=true,t=performance.now()-n,v=requestAnimationFrame(q));},seek(o){let f=Math.min(1,Math.max(0,o));W=f,w=true,n=f*e,t=performance.now()-n,cancelAnimationFrame(v),_(n);},getProgress(){return W},refresh(){clearTimeout(a),m.forEach((o,f)=>{l[f]=a$1(o),o.style.strokeDasharray=`${l[f]}`;});}}}if(ht)return He(Et());rt();function Se(){if(!le||w)return;let e=performance.now(),t=Ne();if(!Q&&de===false&&t===Je){v=requestAnimationFrame(Se);return}Q=false,Je=t;let n=V;if(de!==false){let i=e-Ke,a=i>0?Math.abs(t-(Te<0?t:Te))/i:0;n=V*Math.max(.2,1+a*(typeof de=="number"?de:1)*.04);}Te=t,Ke=e;let y=be?Ee===-1||t>=Ee?"forward":"reverse":d$2;Ee=t;let _=G-z,q=true,N=_===0?0:(t-z)/_;if(isNaN(fe)||(fe<=0&&N>0?_e?.():fe>0&&N<=0&&Xe?.(),fe<1&&N>=1?Ue?.():fe>=1&&N<1&&je?.()),fe=N,U){let i=oe(b$3(t,z,G,n));Z&&!be&&(j=Math.max(j,i),i=j),W=i,r.style.setProperty("--scroll-draw-progress",String(i));let a=y==="reverse"?1-i:i;r.style.clipPath=ne(a),ye?.(i),!F&&b$3(t,z,G,n)>0&&(F=true,$e?.()),i>=1&&!g?(g=true,ae?.(),B<(se==="infinite"?1/0:se??0)&&(B++,X=setTimeout(()=>{j=-1,F=false,g=false,r.style.clipPath=ne(0);},Ce))):i<1&&!Z&&(g=false),v=requestAnimationFrame(Se);return}if(m.forEach((i,a)=>{let h=a*we*_,o=oe(b$3(t,z+h,G+h,n));Z&&!be&&(o=he[a]=Math.max(he[a]??j,o)),i.style.strokeDashoffset=y==="reverse"?`${l[a]*o}`:`${l[a]*(1-o)}`,O&&(i.style.opacity=y==="reverse"?`${1-o}`:`${o}`),I&&E?i.style.stroke=a$5(I,E,o):E&&(i.style.stroke=E),A!==null&&T!==null?i.style.strokeWidth=`${A+(T-A)*o}`:T!==null&&(i.style.strokeWidth=`${T}`),x!==null&&k!==null?i.style.fillOpacity=`${x+(k-x)*o}`:k!==null&&(i.style.fillOpacity=`${k}`),P&&i.tagName.toLowerCase()==="path"&&L[a]&&i.setAttribute("d",Ve(L[a],P,o)),a===0&&(W=o,ye?.(o),r.style.setProperty("--scroll-draw-progress",String(o))),o<1&&(q=false);}),re){let i=oe(b$3(t,z,G,n));for(let a in re){let h=parseFloat(a);i>=h&&!Y.has(h)&&(Y.add(h),re[a]?.());}}!F&&b$3(t,z,G,n)>0&&(F=true,$e?.()),q&&!g?(g=true,ae?.(),B<(se==="infinite"?1/0:se??0)&&(B++,X=setTimeout(()=>{j=-1,he=[],F=false,g=false,Y.clear(),ke(),Q=true;},Ce))):!q&&!Z&&(g=false),v=requestAnimationFrame(Se);}let Re=false;function Ae(){Re||(Re=true,v=requestAnimationFrame(function(){Se();}));}function xe(){Re=false,cancelAnimationFrame(v);}let Ie=new IntersectionObserver(e=>{e.forEach(t=>{le=t.isIntersecting,le&&!w?(Q=true,Ae()):xe();});},{root:R??null,threshold:Ge,rootMargin:Be});function ot(){m.forEach((e,t)=>{l[t]=a$1(e),e.style.strokeDasharray=`${l[t]}`;}),rt(),Q=true;}let Pe;function ge(){clearTimeout(Pe),Pe=setTimeout(ot,150);}window.addEventListener("resize",ge),window.addEventListener("orientationchange",ge);let Tt=d$1([r],ge);return pe>0?setTimeout(()=>Ie.observe(r),pe):Ie.observe(r),He({destroy(){cancelAnimationFrame(v),clearTimeout(X),xe(),Ie.disconnect(),Tt(),window.removeEventListener("resize",ge),window.removeEventListener("orientationchange",ge),clearTimeout(Pe),Ze();},replay(){j=-1,he=[],Ee=-1,Te=-1,F=false,g=false,B=0,w=false,W=0,Y.clear(),clearTimeout(X),ke(),Q=true,le&&Ae();},pause(){w=true,xe();},resume(){w&&(w=false,Q=true,le&&Ae());},seek(e){let t=Math.min(1,Math.max(0,e));W=t,j=t,he=[],w=true,xe(),wt(t,d$2),Q=true;},getProgress(){return W},refresh(){clearTimeout(Pe),ot(),le&&!w&&Ae();}},()=>({tStart:z,tEnd:G}))}export{ct as a,Wt as b};
@@ -1,4 +1,4 @@
1
- import { T as TriggerConfig, E as EasingName } from './types-DHU1zNEw.js';
1
+ import { T as TriggerConfig, E as EasingName } from './types-B0YM4nQP.js';
2
2
 
3
3
  interface ScrollAnimateOptions {
4
4
  props: Record<string, string | number | [string | number, string | number]>;
@@ -1,4 +1,4 @@
1
- import { T as TriggerConfig, E as EasingName } from './types-DHU1zNEw.mjs';
1
+ import { T as TriggerConfig, E as EasingName } from './types-B0YM4nQP.mjs';
2
2
 
3
3
  interface ScrollAnimateOptions {
4
4
  props: Record<string, string | number | [string | number, string | number]>;
@@ -1,3 +1,3 @@
1
- 'use strict';function Ht({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),c=0,m=[];for(let h=0;h<r;h++){let S=Math.pow(o,h);m.push(S),c+=S;}let i=[0],u=0;for(let h=0;h<r;h++)u+=m[h]/c,i.push(u);return h=>{if(h<=0)return 0;if(h>=1)return 1;for(let S=0;S<r;S++)if(h<=i[S+1]){let V=(h-i[S])/(i[S+1]-i[S]);if(S===0)return V*(2-V);let x=1-Math.pow(t,S);return x+(1-x)*(2*V-1)*(2*V-1)}return 1}}function Vt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return c=>c<=0?0:c>=1?1:r*Math.pow(2,-10*c)*Math.sin((c-o)*(2*Math.PI)/t)+1}var xe={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:Ht(),elastic:Vt()};function wt(e,n,r){return Math.min(r,Math.max(n,e))}function Ie(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 vt(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 Et(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function re(e,n,r,t){return r===n?0:wt((e-n)/(r-n)*t,0,1)}function Ce(e,n,r,t,o){let c=vt(e.top,e.height,n,t.element)-Et(t.viewport,r),m=vt(e.top,e.height,n,o.element)-Et(o.viewport,r);return {tStart:c,tEnd:m}}function et(e,n,r){let t=e.getBoundingClientRect(),o=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:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function Oe(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function St(e){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 Re(e,n,r){let t=St(e),o=St(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var xt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var We=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function fe(e,...n){We&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var zt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Wt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function qt(){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 tt(e){switch(e){case "linear":return "linear";case "ease-in":return zt;case "ease-out":return Wt;case "ease-in-out":return qt()?Gt(xe["ease-in-out"]):null;default:return null}}var $t=Symbol.for("svg-scroll-draw.registry");function At(){let e=globalThis;return e[$t]||(e[$t]=new Map)}function qe(e,n){At().set(e,n);}function Ge(e){At().delete(e);}var Bt=0;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Pt(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Mt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Ut(e){if(!We)return;let n=Pt(e,"stroke");if(!n||n==="none"){fe("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Mt.has(r)&&!Mt.has(Pt(e,"fill"))&&fe("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 o(){let c=r==="x"?window.scrollX:window.scrollY,m=e-c,i=n-c,u=r==="x";t.innerHTML=`
1
+ 'use strict';function Bt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),c=0,m=[];for(let y=0;y<r;y++){let P=Math.pow(o,y);m.push(P),c+=P;}let a=[0],u=0;for(let y=0;y<r;y++)u+=m[y]/c,a.push(u);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let P=0;P<r;P++)if(y<=a[P+1]){let N=(y-a[P])/(a[P+1]-a[P]);if(P===0)return N*(2-N);let b=1-Math.pow(t,P);return b+(1-b)*(2*N-1)*(2*N-1)}return 1}}function jt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return c=>c<=0?0:c>=1?1:r*Math.pow(2,-10*c)*Math.sin((c-o)*(2*Math.PI)/t)+1}var xe={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:Bt(),elastic:jt()};function xt(e,n,r){return Math.min(r,Math.max(n,e))}function Ce(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function Tt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function Pt(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 ie(e,n,r,t){return r===n?0:xt((e-n)/(r-n)*t,0,1)}function Oe(e,n,r,t,o){let c=Tt(e.top,e.height,n,t.element)-Pt(t.viewport,r),m=Tt(e.top,e.height,n,o.element)-Pt(o.viewport,r);return {tStart:c,tEnd:m}}function tt(e,n,r){let t=e.getBoundingClientRect(),o=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:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function Re(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function $t(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 Ne(e,n,r){let t=$t(e),o=$t(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var At={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 pe(e,...n){ze&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Ut="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Xt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Mt=33;function Yt(){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<Mt;r++){let t=r/(Mt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function rt(e){switch(e){case "linear":return "linear";case "ease-in":return Ut;case "ease-out":return Xt;case "ease-in-out":return Yt()?Qt(xe["ease-in-out"]):null;default:return null}}var Lt=Symbol.for("svg-scroll-draw.registry");function kt(){let e=globalThis;return e[Lt]||(e[Lt]=new Map)}function We(e,n){kt().set(e,n);}function qe(e){kt().delete(e);}var Ge,nt=new Set,ot=new WeakMap,Be=new Map,Dt=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function Zt(e){let n=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let t=r;t;t=t.previousElementSibling)n.add(t);return n}function st(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();Ge??(Ge=new ResizeObserver(o=>{let c=false;for(let{target:m}of o)ot.get(m)!==Dt(m)&&(c=true),ot.set(m,"");c&&nt.forEach(m=>m());})),nt.add(r);let t=Zt(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{ot.has(o)||ot.set(o,Dt(o)),Be.set(o,(Be.get(o)??0)+1),Ge.observe(o);}),()=>{nt.delete(r)&&(t.forEach(o=>{let c=(Be.get(o)??1)-1;if(c)return void Be.set(o,c);Be.delete(o),Ge?.unobserve(o);}),nt.size||(Ge?.disconnect(),Ge=void 0));}}var Kt=0;function Jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function It(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Ct=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function er(e){if(!ze)return;let n=It(e,"stroke");if(!n||n==="none"){pe("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Ct.has(r)&&!Ct.has(It(e,"fill"))&&pe("Element has a fill \u2014 it may obscure the stroke animation.",e);}function tr(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 o(){let c=r==="x"?window.scrollX:window.scrollY,m=e-c,a=n-c,u=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${u?`left:${m}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${m}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${u?`left:${i}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${i}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",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var kt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Lt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Yt(e,n,r){if(!We)return;let t=(e.match(Lt)??[]).join("").toUpperCase(),o=(n.match(Lt)??[]).join("").toUpperCase(),c=(e.match(kt)??[]).length,m=(n.match(kt)??[]).length;if(t!==o){fe(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}c!==m&&fe(`morphTo: coordinate count differs (${c} \u2192 ${m}). 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),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,c=>{let m=parseFloat(c),i=t[o++]??m;return String(+(m+(i-m)*r).toFixed(4))})}function ct(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,o=r?{...xt[r],...t}:t,c=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:i=1,fade:u=false,easing:h="linear",trigger:S={},stagger:V=0,direction:x="forward",once:me=false,debug:je=false,axis:K="y",scrollContainer:Me,autoReverse:Te=false,delay:he=0,strokeColor:ne,strokeWidth:pe,fillOpacity:J,waypoints:oe,velocityScale:be=false,threshold:Fe=0,rootMargin:X="0px",repeat:C=0,repeatDelay:_e=0,morphTo:z,clip:ke,autoplay:He=false,duration:Ue=1e3,native:rt=true,onProgress:$e,onStart:B,onComplete:W,onEnter:se,onLeave:Ae,onEnterBack:ie,onLeaveBack:de}=o,_=ke===true?"left":typeof ke=="string"?ke:false,Y=typeof h=="function"?h:xe[h]??xe.linear,ae=Ie(S.start??"top bottom"),Le=Ie(S.end??"bottom top"),j=typeof Me=="string"?document.querySelector(Me):Me??null,U=Array.isArray(ne)?ne[0]:null,O=Array.isArray(ne)?ne[1]:typeof ne=="string"?ne:null,R=Array.isArray(pe)?pe[0]:null,M=Array.isArray(pe)?pe[1]:typeof pe=="number"?pe:null,H=Array.isArray(J)?J[0]:null,D=Array.isArray(J)?J[1]:typeof J=="number"?J:null;function le(s){let l=s*100;switch(_){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let T=_?[]:Array.from(e.querySelectorAll(m)),b=[],a=[],f=0,q=0,v=false,$=false,A=0,ee=false,Q=-1,I=[],we=-1,k=false,ce=0,ge=0,ve,nt=null;function ft(){nt?.destroy(),nt=null;}let Ee=new Set,mt=NaN,Se=true,Xe=-1,pt=performance.now(),De=NaN;function ot(){return j?K==="x"?j.scrollLeft:j.scrollTop:K==="x"?window.scrollX:window.scrollY}function dt(){return j?K==="x"?j.clientWidth:j.clientHeight:K==="x"?window.innerWidth:window.innerHeight}function gt(){let s=et(e,j,K);return Ce(s,s.scroll,dt(),ae,Le)}function yt(){(({tStart:f,tEnd:q}=gt())),je&&We&&(ft(),nt=Xt(f,q,K));}function st(s,l=gt){qe(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:l});let g=s.destroy;return s.destroy=()=>{g.call(s),Ge(e);},s}function Rt(s,l){if(e.style.setProperty("--scroll-draw-progress",String(s)),_){let g=l==="reverse"?1-s:s;e.style.clipPath=le(g);return}T.forEach((g,N)=>{g.style.strokeDashoffset=l==="reverse"?`${b[N]*s}`:`${b[N]*(1-s)}`,u&&(g.style.opacity=l==="reverse"?`${1-s}`:`${s}`),U&&O?g.style.stroke=Re(U,O,s):O&&(g.style.stroke=O),R!==null&&M!==null?g.style.strokeWidth=`${R+(M-R)*s}`:M!==null&&(g.style.strokeWidth=`${M}`),H!==null&&D!==null?g.style.fillOpacity=`${H+(D-H)*s}`:D!==null&&(g.style.fillOpacity=`${D}`),z&&g.tagName.toLowerCase()==="path"&&a[N]&&g.setAttribute("d",lt(a[N],z,s));});}function Ye(){if(e.style.setProperty("--scroll-draw-progress","0"),_){e.style.clipPath=le(0);return}T.forEach((s,l)=>{s.style.strokeDasharray=`${b[l]}`,s.style.strokeDashoffset=x==="reverse"?"0":`${b[l]}`,u?s.style.opacity=x==="reverse"?"1":"0":s.style.opacity="",U&&(s.style.stroke=U),R!==null&&(s.style.strokeWidth=`${R}`),H!==null&&(s.style.fillOpacity=`${H}`),z&&s.tagName.toLowerCase()==="path"&&a[l]&&s.setAttribute("d",a[l]);});}if(T.forEach(s=>{Ut(s);let l=Oe(s);b.push(l);let g=s.tagName.toLowerCase()==="path";g?a.push(s.getAttribute("d")??""):a.push(""),z&&(g?Yt(a[a.length-1],z,s):fe(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),c?(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=x==="reverse"?`${l}`:"0",u&&(s.style.opacity="1"),O&&(s.style.stroke=O),M!==null&&(s.style.strokeWidth=`${M}`),D!==null&&(s.style.fillOpacity=`${D}`),z&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",z)):(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=x==="reverse"?"0":`${l}`,u?s.style.opacity=x==="reverse"?"1":"0":s.style.opacity="",U&&(s.style.stroke=U),R!==null&&(s.style.strokeWidth=`${R}`),H!==null&&(s.style.fillOpacity=`${H}`));}),_){if(c)return e.style.clipPath=le(1),W?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=le(0);}else if(c)return W?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof h=="string"?tt(h):null;function Nt(){return !(rt===false||!jt()||!T.length||!ht||_||K!=="y"||j||i!==1||V!==0||me||Te||be!==false||z||oe||C||he>0||$e||B||W||se||Ae||ie||de||ne!=null||pe!=null||J!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function Ft(){let s=++Bt,l=`svg-scroll-draw-${s}`,g=`svg-scroll-draw-host-${s}`,N=`--svg-scroll-draw-${s}`,ye=x==="reverse"?"0":"var(--ssd-len)",ue=x==="reverse"?"var(--ssd-len)":"0",te=`stroke-dashoffset:${ye};`,y=`stroke-dashoffset:${ue};`;u&&(te+=`opacity:${x==="reverse"?1:0};`,y+=`opacity:${x==="reverse"?0:1};`);let w=document.createElement("style");w.setAttribute("data-svg-scroll-draw",""),w.textContent=`@keyframes ${l}{from{${te}}to{${y}}}.${g}{view-timeline-name:${N};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${N};animation-range:cover 0% cover 100%;}`,document.head.appendChild(w),e.classList.add(g);function F(p,L){p.style.setProperty("--ssd-len",String(b[L])),p.style.strokeDasharray=`${b[L]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(l);}T.forEach(F);let d=false,E=-1;function P(){if(E>=0)return E;let p=e.getBoundingClientRect(),{tStart:L,tEnd:Z}=Ce({top:p.top,height:p.height},ot(),dt(),ae,Le);return Y(re(ot(),L,Z,i))}return {destroy(){e.classList.remove(g),T.forEach(p=>{p.classList.remove(l),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),w.remove();},replay(){d=false,E=-1,T.forEach(F);},pause(){d=true,T.forEach(p=>{p.style.animationPlayState="paused";});},resume(){d&&(d=false,T.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let L=Math.min(1,Math.max(0,p));E=L,d=true,T.forEach((Z,G)=>{Z.classList.remove(l),Z.style.strokeDashoffset=x==="reverse"?`${b[G]*L}`:`${b[G]*(1-L)}`,u&&(Z.style.opacity=x==="reverse"?`${1-L}`:`${L}`);});},getProgress(){return P()},refresh(){T.forEach((p,L)=>{b[L]=Oe(p),p.style.setProperty("--ssd-len",String(b[L])),p.style.strokeDasharray=`${b[L]}`;});}}}if(Nt())return st(Ft());function _t(){let s=Math.max(1,Ue),l=0,g=0,N=false;function ye(d){let E=true;if(_){let P=Math.min(1,Math.max(0,d/s)),p=Y(P);ce=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=le(x==="reverse"?1-p:p),$e?.(p),P<1&&(E=false);}else T.forEach((P,p)=>{let L=p*V*s,Z=Math.min(1,Math.max(0,(d-L)/s)),G=Y(Z);P.style.strokeDashoffset=x==="reverse"?`${b[p]*G}`:`${b[p]*(1-G)}`,u&&(P.style.opacity=x==="reverse"?`${1-G}`:`${G}`),U&&O?P.style.stroke=Re(U,O,G):O&&(P.style.stroke=O),R!==null&&M!==null?P.style.strokeWidth=`${R+(M-R)*G}`:M!==null&&(P.style.strokeWidth=`${M}`),H!==null&&D!==null?P.style.fillOpacity=`${H+(D-H)*G}`:D!==null&&(P.style.fillOpacity=`${D}`),z&&P.tagName.toLowerCase()==="path"&&a[p]&&P.setAttribute("d",lt(a[p],z,G)),p===0&&(ce=G,$e?.(G),e.style.setProperty("--scroll-draw-progress",String(G))),Z<1&&(E=false);});if(oe){let P=Math.min(1,Math.max(0,d/s)),p=Y(P);for(let L in oe){let Z=parseFloat(L);p>=Z&&!Ee.has(Z)&&(Ee.add(Z),oe[L]?.());}}return E}function ue(d){if(k)return;let E=d-l;$||($=true,B?.());let P=ye(E);if(P&&!v){v=true,ye(s*(1+Math.max(0,T.length-1)*V)),W?.(),ge<(C==="infinite"?1/0:C??0)&&(ge++,ve=setTimeout(()=>{l=performance.now(),$=false,v=false,Ee.clear(),Ye(),A=requestAnimationFrame(ue);},_e));return}P||(A=requestAnimationFrame(ue));}function te(){cancelAnimationFrame(A),clearTimeout(ve),l=performance.now(),g=0,k=false,$=false,v=false,ge=0,N=true,ce=0,Ee.clear(),Ye(),A=requestAnimationFrame(ue);}let y=new IntersectionObserver(d=>{d.forEach(E=>{E.isIntersecting&&!(me&&v)?te():!E.isIntersecting&&!me&&!v&&(cancelAnimationFrame(A),clearTimeout(ve),N=false);});},{root:j??null,threshold:Fe,rootMargin:X}),w;function F(){clearTimeout(w),w=setTimeout(()=>{T.forEach((d,E)=>{b[E]=Oe(d),d.style.strokeDasharray=`${b[E]}`;});},150);}return window.addEventListener("resize",F),window.addEventListener("orientationchange",F),he>0?setTimeout(()=>y.observe(e),he):y.observe(e),{destroy(){cancelAnimationFrame(A),clearTimeout(ve),y.disconnect(),window.removeEventListener("resize",F),window.removeEventListener("orientationchange",F),clearTimeout(w);},replay(){ge=0,te();},pause(){k||!N||(k=true,g=performance.now()-l,cancelAnimationFrame(A));},resume(){k&&(k=false,N=true,l=performance.now()-g,A=requestAnimationFrame(ue));},seek(d){let E=Math.min(1,Math.max(0,d));ce=E,k=true,g=E*s,l=performance.now()-g,cancelAnimationFrame(A),ye(g);},getProgress(){return ce},refresh(){clearTimeout(w),T.forEach((d,E)=>{b[E]=Oe(d),d.style.strokeDasharray=`${b[E]}`;});}}}if(He)return st(_t());yt();function Qe(){if(!ee||k)return;let s=performance.now(),l=ot();if(!Se&&be===false&&l===mt){A=requestAnimationFrame(Qe);return}Se=false,mt=l;let g=i;if(be!==false){let y=s-pt,w=y>0?Math.abs(l-(Xe<0?l:Xe))/y:0;g=i*Math.max(.2,1+w*(typeof be=="number"?be:1)*.04);}Xe=l,pt=s;let N=Te?we===-1||l>=we?"forward":"reverse":x;we=l;let ye=q-f,ue=true,te=ye===0?0:(l-f)/ye;if(isNaN(De)||(De<=0&&te>0?se?.():De>0&&te<=0&&de?.(),De<1&&te>=1?Ae?.():De>=1&&te<1&&ie?.()),De=te,_){let y=Y(re(l,f,q,g));me&&!Te&&(Q=Math.max(Q,y),y=Q),ce=y,e.style.setProperty("--scroll-draw-progress",String(y));let w=N==="reverse"?1-y:y;e.style.clipPath=le(w),$e?.(y),!$&&re(l,f,q,g)>0&&($=true,B?.()),y>=1&&!v?(v=true,W?.(),ge<(C==="infinite"?1/0:C??0)&&(ge++,ve=setTimeout(()=>{Q=-1,$=false,v=false,e.style.clipPath=le(0);},_e))):y<1&&!me&&(v=false),A=requestAnimationFrame(Qe);return}if(T.forEach((y,w)=>{let F=w*V*ye,d=Y(re(l,f+F,q+F,g));me&&!Te&&(d=I[w]=Math.max(I[w]??Q,d)),ce=d,y.style.strokeDashoffset=N==="reverse"?`${b[w]*d}`:`${b[w]*(1-d)}`,u&&(y.style.opacity=N==="reverse"?`${1-d}`:`${d}`),U&&O?y.style.stroke=Re(U,O,d):O&&(y.style.stroke=O),R!==null&&M!==null?y.style.strokeWidth=`${R+(M-R)*d}`:M!==null&&(y.style.strokeWidth=`${M}`),H!==null&&D!==null?y.style.fillOpacity=`${H+(D-H)*d}`:D!==null&&(y.style.fillOpacity=`${D}`),z&&y.tagName.toLowerCase()==="path"&&a[w]&&y.setAttribute("d",lt(a[w],z,d)),w===0&&($e?.(d),e.style.setProperty("--scroll-draw-progress",String(d))),d<1&&(ue=false);}),oe){let y=Y(re(l,f,q,g));for(let w in oe){let F=parseFloat(w);y>=F&&!Ee.has(F)&&(Ee.add(F),oe[w]?.());}}!$&&re(l,f,q,g)>0&&($=true,B?.()),ue&&!v?(v=true,W?.(),ge<(C==="infinite"?1/0:C??0)&&(ge++,ve=setTimeout(()=>{Q=-1,I=[],$=false,v=false,Ee.clear(),Ye(),Se=true;},_e))):!ue&&!me&&(v=false),A=requestAnimationFrame(Qe);}let it=false;function Ze(){it||(it=true,A=requestAnimationFrame(function(){Qe();}));}function Ke(){it=false,cancelAnimationFrame(A);}let at=new IntersectionObserver(s=>{s.forEach(l=>{ee=l.isIntersecting,ee&&!k?(Se=true,Ze()):Ke();});},{root:j??null,threshold:Fe,rootMargin:X});function bt(){T.forEach((s,l)=>{b[l]=Oe(s),s.style.strokeDasharray=`${b[l]}`;}),yt(),Se=true;}let Je;function Ve(){clearTimeout(Je),Je=setTimeout(bt,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let ze;return typeof ResizeObserver<"u"&&(ze=new ResizeObserver(()=>Ve()),ze.observe(document.body),ze.observe(document.documentElement),ze.observe(e)),he>0?setTimeout(()=>at.observe(e),he):at.observe(e),st({destroy(){cancelAnimationFrame(A),clearTimeout(ve),Ke(),at.disconnect(),ze?.disconnect(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(Je),ft();},replay(){Q=-1,I=[],we=-1,Xe=-1,$=false,v=false,ge=0,k=false,ce=0,Ee.clear(),clearTimeout(ve),Ye(),Se=true,ee&&Ze();},pause(){k=true,Ke();},resume(){k&&(k=false,Se=true,ee&&Ze());},seek(s){let l=Math.min(1,Math.max(0,s));ce=l,Q=l,I=[],k=true,Ke(),Rt(l,x),Se=true;},getProgress(){return ce},refresh(){clearTimeout(Je),bt(),ee&&!k&&Ze();}},()=>({tStart:f,tEnd:q}))}function Qt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Dt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],c=[],m=t[2].trim();if(m)for(let i of m.split(/[\s,]+/)){let u=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(u?parseFloat(u[1]):0),c.push(u?u[2]:"");}n.push({fn:t[1],nums:o,units:c});}return n}function Zt(e,n,r){let t=Dt(e),o=Dt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((c,m)=>{let i=o[m];return c.fn!==i.fn||c.nums.length!==i.nums.length?r<1?`${c.fn}(${c.nums.map((u,h)=>`${u}${c.units[h]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,h)=>`${u}${i.units[h]}`).join(", ")})`:`${c.fn}(${c.nums.map((u,h)=>`${u+(i.nums[h]-u)*r}${c.units[h]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(Qt(t))return Re(t,o,r);if(t.includes("("))return Zt(t,o,r);let c=t.match(/^([-+]?[\d.]+)(.*)$/),m=o.match(/^([-+]?[\d.]+)(.*)$/);if(c&&m){let i=parseFloat(c[1]),u=parseFloat(m[1]);return `${i+(u-i)*r}${c[2]||m[2]}`}return r<1?t:o}function Kt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Jt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),er=0,It="--scroll-draw-progress";function tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Ne(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:o={},easing:c="ease-out",speed:m=1,once:i=false,axis:u="y",scrollContainer:h,native:S=true,velocityScale:V=false,respectReducedMotion:x=true,triggerElement:me,onProgress:je,onComplete:K,onEnter:Me,onLeave:Te,onEnterBack:he,onLeaveBack:ne}=n,pe=x&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=typeof c=="function"?c:xe[c]??xe["ease-out"],oe=Ie(o.start??"top bottom"),be=Ie(o.end??"bottom top"),Fe=me??e,X=typeof h=="string"?document.querySelector(h):h??null,C=Object.entries(t).map(([a,f])=>({prop:Kt(a),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function _e(){let a=window.getComputedStyle(e);for(let f of C)f.from===""&&(f.from=a.getPropertyValue(f.prop).trim()||"0");}function z(){for(let a of C)e.style.setProperty(a.prop,String(a.to));}let ke=new Map;for(let a of [...C.map(f=>f.prop),It])ke.set(a,e.style.getPropertyValue(a));function He(){for(let[a,f]of ke)f?e.style.setProperty(a,f):e.style.removeProperty(a);}if(pe)return z(),K?.(),{...r,destroy:He,getProgress:()=>1};_e();let Ue=typeof c=="string"?tt(c):null;function rt(){if(!S||!tr()||!Ue||u!=="y"||X||Fe!==e||i||m!==1||je||K||Me||Te||he||ne||V!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let a of C)if(!Jt.has(a.prop))return false;return true}function $e(){let a=`ssd-a-${++er}`,f=C.map(I=>`${I.prop}:${I.from}`).join(";"),q=C.map(I=>`${I.prop}:${I.to}`).join(";"),v=document.createElement("style");v.setAttribute("data-ssd-animate",""),v.textContent=`@keyframes ${a}{from{${f}}to{${q}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Ue};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),e.classList.add(a);let $=()=>u==="x"?window.scrollX:window.scrollY,A=()=>u==="x"?window.innerWidth:window.innerHeight,ee=()=>{let I=e.getBoundingClientRect();return Ce({top:I.top,height:I.height},$(),A(),oe,be)};qe(e,{type:"animate",getProgress:()=>Q.getProgress(),getTrigger:ee});let Q={destroy(){e.classList.remove(a),v.remove(),e.style.animationPlayState="",He(),Ge(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(I){let we=Math.min(1,Math.max(0,I));e.classList.remove(a);for(let k of C)e.style.setProperty(k.prop,ut(k.from,k.to,we));},getProgress(){let{tStart:I,tEnd:we}=ee();return J(re($(),I,we,m))}};return Q}if(rt())return $e();let B=0,W=0,se=0,Ae=false,ie=false,de=-1,_=0,Y=false,ae=NaN,Le=-1,j=0,U=()=>X?u==="x"?X.scrollLeft:X.scrollTop:u==="x"?window.scrollX:window.scrollY,O=()=>X?u==="x"?X.clientWidth:X.clientHeight:u==="x"?window.innerWidth:window.innerHeight;function R(){let a=et(Fe,X,u),f=Ce(a,a.scroll,O(),oe,be);B=f.tStart,W=f.tEnd;}function M(a){e.style.setProperty(It,String(a));for(let f of C)e.style.setProperty(f.prop,ut(f.from,f.to,a));je?.(a);}function H(a){if(isNaN(ae)){ae=a;return}ae<=0&&a>0?Me?.():ae>0&&a<=0&&ne?.(),ae<1&&a>=1?Te?.():ae>=1&&a<1&&he?.(),ae=a;}function D(){if(!Ae||ie)return;let a=performance.now(),f=U(),q=m;if(V!==false){let A=a-j,ee=A>0?Math.abs(f-(Le<0?f:Le))/A:0;q=m*Math.max(.2,1+ee*(typeof V=="number"?V:1)*.04);}Le=f,j=a;let v=W===B?0:(f-B)/(W-B);H(v);let $=J(re(f,B,W,q));i&&(de=Math.max(de,$),$=de),_=$,M($),$>=1&&!Y?(Y=true,K?.()):$<1&&!i&&(Y=false),se=requestAnimationFrame(D);}R(),W===B&&fe("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 a=J(re(U(),B,W,m));i&&a>0&&(de=a),_=a,M(a);}let le=new IntersectionObserver(a=>{a.forEach(f=>{Ae=f.isIntersecting,Ae&&!ie?se=requestAnimationFrame(D):cancelAnimationFrame(se);});},{root:X??null}),T;function b(){clearTimeout(T),T=setTimeout(R,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),le.observe(e),qe(e,{type:"animate",getProgress:()=>_,getTrigger:()=>({tStart:B,tEnd:W})}),{destroy(){cancelAnimationFrame(se),le.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(T),He(),Ge(e);},replay(){de=-1,Y=false,_=0,ie=false,M(0);},pause(){ie=true,cancelAnimationFrame(se);},resume(){ie&&(ie=false,Ae&&(se=requestAnimationFrame(D)));},seek(a){let f=Math.min(1,Math.max(0,a));_=f,de=f,ie=true,cancelAnimationFrame(se),M(f);},getProgress(){return _}}}var Ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ot(e,n={}){if(typeof window>"u")return Ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return fe("scrollParallax: element not found:",e),Ct;let{speed:t=.3,axis:o="y",easing:c="linear",trigger:m,onProgress:i}=n,u=r.getBoundingClientRect(),h=o==="x"?u.width:u.height,S=t*h;return Ne(r,{props:o==="x"?{transform:["translateX(0px)",`translateX(${-S}px)`]}:{transform:["translateY(0px)",`translateY(${-S}px)`]},trigger:m??{start:"top bottom",end:"bottom top"},easing:c,native:false,onProgress:i})}function Be(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var Pe={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function _r(e,n={}){if(typeof window>"u")return Pe;let r=Be(e).map(t=>ct(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function Hr(e,n={}){if(typeof window>"u")return Pe;let r=Be(e);if(r.length===0)return Pe;let t=0,o=[];function c(i){return ct(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function m(){r.forEach((i,u)=>{o[u]=c(u);});for(let i=1;i<o.length;i++)o[i].pause();}return m(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,m();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function Vr(e,n){if(typeof window>"u")return Pe;let r=Be(e).map(t=>Ne(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function zr(e,n){if(typeof window>"u")return Pe;let r=Be(e);if(r.length===0)return Pe;let t=0,o=[];function c(i){return Ne(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function m(){r.forEach((i,u)=>{o[u]=c(u);});for(let i=1;i<o.length;i++)o[i].pause();}return m(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,m();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function Wr(e,n={}){if(typeof window>"u")return Pe;let r=Be(e).map(t=>Ot(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}exports.scrollAnimateGroup=Vr;exports.scrollAnimateSequence=zr;exports.scrollDrawGroup=_r;exports.scrollDrawSequence=Hr;exports.scrollParallaxGroup=Wr;
3
+ <div style="position:absolute;${u?`left:${a}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${a}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",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var Ot=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Rt=/[MmLlHhVvCcSsQqTtAaZz]/g;function rr(e,n,r){if(!ze)return;let t=(e.match(Rt)??[]).join("").toUpperCase(),o=(n.match(Rt)??[]).join("").toUpperCase(),c=(e.match(Ot)??[]).length,m=(n.match(Ot)??[]).length;if(t!==o){pe(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}c!==m&&pe(`morphTo: coordinate count differs (${c} \u2192 ${m}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function mt(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,c=>{let m=parseFloat(c),a=t[o++]??m;return String(+(m+(a-m)*r).toFixed(4))})}function pt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,o=r?{...At[r],...t}:t,c=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:a=1,fade:u=false,easing:y="linear",trigger:P={},stagger:N=0,direction:b="forward",once:de=false,debug:Ue=false,axis:te="y",scrollContainer:ke,autoReverse:Te=false,delay:we=0,strokeColor:ae,strokeWidth:ge,fillOpacity:re,waypoints:le,velocityScale:Ee=false,threshold:Pe=0,rootMargin:Z="0px",repeat:I=0,repeatDelay:_e=0,morphTo:B,clip:$e,autoplay:He=false,duration:Xe=1e3,native:it=true,onProgress:Ae,onStart:j,onComplete:q,onEnter:ce,onLeave:Me,onEnterBack:ue,onLeaveBack:ye}=o,G=$e===true?"left":typeof $e=="string"?$e:false,K=typeof y=="function"?y:xe[y]??xe.linear,fe=Ce(P.start??"top bottom"),De=Ce(P.end??"bottom top"),X=typeof ke=="string"?document.querySelector(ke):ke??null,Y=Array.isArray(ae)?ae[0]:null,F=Array.isArray(ae)?ae[1]:typeof ae=="string"?ae:null,M=Array.isArray(ge)?ge[0]:null,C=Array.isArray(ge)?ge[1]:typeof ge=="number"?ge:null,O=Array.isArray(re)?re[0]:null,L=Array.isArray(re)?re[1]:typeof re=="number"?re:null;function he(s){let l=s*100;switch(G){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let $=G?[]:Array.from(e.querySelectorAll(m)),w=[],_=[],H=0,ne=0,i=false,f=false,x=0,V=false,v=-1,R=[],oe=-1,k=false,S=0,Q=0,J,at=null;function gt(){at?.destroy(),at=null;}let ve=new Set,yt=NaN,Se=true,Ye=-1,ht=performance.now(),Ie=NaN;function lt(){return X?te==="x"?X.scrollLeft:X.scrollTop:te==="x"?window.scrollX:window.scrollY}function bt(){return X?te==="x"?X.clientWidth:X.clientHeight:te==="x"?window.innerWidth:window.innerHeight}function wt(){let s=tt(e,X,te);return Oe(s,s.scroll,bt(),fe,De)}function Et(){(({tStart:H,tEnd:ne}=wt())),Ue&&ze&&(gt(),at=tr(H,ne,te));}function ct(s,l=wt){We(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:l});let g=s.destroy;return s.destroy=()=>{g.call(s),qe(e);},s}function Vt(s,l){if(e.style.setProperty("--scroll-draw-progress",String(s)),G){let g=l==="reverse"?1-s:s;e.style.clipPath=he(g);return}$.forEach((g,z)=>{g.style.strokeDashoffset=l==="reverse"?`${w[z]*s}`:`${w[z]*(1-s)}`,u&&(g.style.opacity=l==="reverse"?`${1-s}`:`${s}`),Y&&F?g.style.stroke=Ne(Y,F,s):F&&(g.style.stroke=F),M!==null&&C!==null?g.style.strokeWidth=`${M+(C-M)*s}`:C!==null&&(g.style.strokeWidth=`${C}`),O!==null&&L!==null?g.style.fillOpacity=`${O+(L-O)*s}`:L!==null&&(g.style.fillOpacity=`${L}`),B&&g.tagName.toLowerCase()==="path"&&_[z]&&g.setAttribute("d",mt(_[z],B,s));});}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),G){e.style.clipPath=he(0);return}$.forEach((s,l)=>{s.style.strokeDasharray=`${w[l]}`,s.style.strokeDashoffset=b==="reverse"?"0":`${w[l]}`,u?s.style.opacity=b==="reverse"?"1":"0":s.style.opacity="",Y&&(s.style.stroke=Y),M!==null&&(s.style.strokeWidth=`${M}`),O!==null&&(s.style.fillOpacity=`${O}`),B&&s.tagName.toLowerCase()==="path"&&_[l]&&s.setAttribute("d",_[l]);});}if($.forEach(s=>{er(s);let l=Re(s);w.push(l);let g=s.tagName.toLowerCase()==="path";g?_.push(s.getAttribute("d")??""):_.push(""),B&&(g?rr(_[_.length-1],B,s):pe(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),c?(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=b==="reverse"?`${l}`:"0",u&&(s.style.opacity="1"),F&&(s.style.stroke=F),C!==null&&(s.style.strokeWidth=`${C}`),L!==null&&(s.style.fillOpacity=`${L}`),B&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",B)):(s.style.strokeDasharray=`${l}`,s.style.strokeDashoffset=b==="reverse"?"0":`${l}`,u?s.style.opacity=b==="reverse"?"1":"0":s.style.opacity="",Y&&(s.style.stroke=Y),M!==null&&(s.style.strokeWidth=`${M}`),O!==null&&(s.style.fillOpacity=`${O}`));}),G){if(c)return e.style.clipPath=he(1),q?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=he(0);}else if(c)return q?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let vt=typeof y=="string"?rt(y):null;function zt(){return !(it===false||!Jt()||!$.length||!vt||G||te!=="y"||X||a!==1||N!==0||de||Te||Ee!==false||B||le||I||we>0||Ae||j||q||ce||Me||ue||ye||ae!=null||ge!=null||re!=null||(P.start??"top bottom").trim()!=="top bottom"||(P.end??"bottom top").trim()!=="bottom top")}function Wt(){let s=++Kt,l=`svg-scroll-draw-${s}`,g=`svg-scroll-draw-host-${s}`,z=`--svg-scroll-draw-${s}`,be=b==="reverse"?"0":"var(--ssd-len)",me=b==="reverse"?"var(--ssd-len)":"0",se=`stroke-dashoffset:${be};`,h=`stroke-dashoffset:${me};`;u&&(se+=`opacity:${b==="reverse"?1:0};`,h+=`opacity:${b==="reverse"?0:1};`);let E=document.createElement("style");E.setAttribute("data-svg-scroll-draw",""),E.textContent=`@keyframes ${l}{from{${se}}to{${h}}}.${g}{view-timeline-name:${z};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${vt};animation-fill-mode:both;animation-timeline:${z};animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),e.classList.add(g);function W(p,D){p.style.setProperty("--ssd-len",String(w[D])),p.style.strokeDasharray=`${w[D]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(l);}$.forEach(W);let d=false,T=-1;function A(){if(T>=0)return T;let p=e.getBoundingClientRect(),{tStart:D,tEnd:ee}=Oe({top:p.top,height:p.height},lt(),bt(),fe,De);return K(ie(lt(),D,ee,a))}return {destroy(){e.classList.remove(g),$.forEach(p=>{p.classList.remove(l),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),E.remove();},replay(){d=false,T=-1,$.forEach(W);},pause(){d=true,$.forEach(p=>{p.style.animationPlayState="paused";});},resume(){d&&(d=false,$.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let D=Math.min(1,Math.max(0,p));T=D,d=true,$.forEach((ee,U)=>{ee.classList.remove(l),ee.style.strokeDashoffset=b==="reverse"?`${w[U]*D}`:`${w[U]*(1-D)}`,u&&(ee.style.opacity=b==="reverse"?`${1-D}`:`${D}`);});},getProgress(){return A()},refresh(){$.forEach((p,D)=>{w[D]=Re(p),p.style.setProperty("--ssd-len",String(w[D])),p.style.strokeDasharray=`${w[D]}`;});}}}if(zt())return ct(Wt());function qt(){let s=Math.max(1,Xe),l=0,g=0,z=false;function be(d){let T=true;if(G){let A=Math.min(1,Math.max(0,d/s)),p=K(A);S=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=he(b==="reverse"?1-p:p),Ae?.(p),A<1&&(T=false);}else $.forEach((A,p)=>{let D=p*N*s,ee=Math.min(1,Math.max(0,(d-D)/s)),U=K(ee);A.style.strokeDashoffset=b==="reverse"?`${w[p]*U}`:`${w[p]*(1-U)}`,u&&(A.style.opacity=b==="reverse"?`${1-U}`:`${U}`),Y&&F?A.style.stroke=Ne(Y,F,U):F&&(A.style.stroke=F),M!==null&&C!==null?A.style.strokeWidth=`${M+(C-M)*U}`:C!==null&&(A.style.strokeWidth=`${C}`),O!==null&&L!==null?A.style.fillOpacity=`${O+(L-O)*U}`:L!==null&&(A.style.fillOpacity=`${L}`),B&&A.tagName.toLowerCase()==="path"&&_[p]&&A.setAttribute("d",mt(_[p],B,U)),p===0&&(S=U,Ae?.(U),e.style.setProperty("--scroll-draw-progress",String(U))),ee<1&&(T=false);});if(le){let A=Math.min(1,Math.max(0,d/s)),p=K(A);for(let D in le){let ee=parseFloat(D);p>=ee&&!ve.has(ee)&&(ve.add(ee),le[D]?.());}}return T}function me(d){if(k)return;let T=d-l;f||(f=true,j?.());let A=be(T);if(A&&!i){i=true,be(s*(1+Math.max(0,$.length-1)*N)),q?.(),Q<(I==="infinite"?1/0:I??0)&&(Q++,J=setTimeout(()=>{l=performance.now(),f=false,i=false,ve.clear(),Qe(),x=requestAnimationFrame(me);},_e));return}A||(x=requestAnimationFrame(me));}function se(){cancelAnimationFrame(x),clearTimeout(J),l=performance.now(),g=0,k=false,f=false,i=false,Q=0,z=true,S=0,ve.clear(),Qe(),x=requestAnimationFrame(me);}let h=new IntersectionObserver(d=>{d.forEach(T=>{T.isIntersecting&&!(de&&i)?se():!T.isIntersecting&&!de&&!i&&(cancelAnimationFrame(x),clearTimeout(J),z=false);});},{root:X??null,threshold:Pe,rootMargin:Z}),E;function W(){clearTimeout(E),E=setTimeout(()=>{$.forEach((d,T)=>{w[T]=Re(d),d.style.strokeDasharray=`${w[T]}`;});},150);}return window.addEventListener("resize",W),window.addEventListener("orientationchange",W),we>0?setTimeout(()=>h.observe(e),we):h.observe(e),{destroy(){cancelAnimationFrame(x),clearTimeout(J),h.disconnect(),window.removeEventListener("resize",W),window.removeEventListener("orientationchange",W),clearTimeout(E);},replay(){Q=0,se();},pause(){k||!z||(k=true,g=performance.now()-l,cancelAnimationFrame(x));},resume(){k&&(k=false,z=true,l=performance.now()-g,x=requestAnimationFrame(me));},seek(d){let T=Math.min(1,Math.max(0,d));S=T,k=true,g=T*s,l=performance.now()-g,cancelAnimationFrame(x),be(g);},getProgress(){return S},refresh(){clearTimeout(E),$.forEach((d,T)=>{w[T]=Re(d),d.style.strokeDasharray=`${w[T]}`;});}}}if(He)return ct(qt());Et();function Ze(){if(!V||k)return;let s=performance.now(),l=lt();if(!Se&&Ee===false&&l===yt){x=requestAnimationFrame(Ze);return}Se=false,yt=l;let g=a;if(Ee!==false){let h=s-ht,E=h>0?Math.abs(l-(Ye<0?l:Ye))/h:0;g=a*Math.max(.2,1+E*(typeof Ee=="number"?Ee:1)*.04);}Ye=l,ht=s;let z=Te?oe===-1||l>=oe?"forward":"reverse":b;oe=l;let be=ne-H,me=true,se=be===0?0:(l-H)/be;if(isNaN(Ie)||(Ie<=0&&se>0?ce?.():Ie>0&&se<=0&&ye?.(),Ie<1&&se>=1?Me?.():Ie>=1&&se<1&&ue?.()),Ie=se,G){let h=K(ie(l,H,ne,g));de&&!Te&&(v=Math.max(v,h),h=v),S=h,e.style.setProperty("--scroll-draw-progress",String(h));let E=z==="reverse"?1-h:h;e.style.clipPath=he(E),Ae?.(h),!f&&ie(l,H,ne,g)>0&&(f=true,j?.()),h>=1&&!i?(i=true,q?.(),Q<(I==="infinite"?1/0:I??0)&&(Q++,J=setTimeout(()=>{v=-1,f=false,i=false,e.style.clipPath=he(0);},_e))):h<1&&!de&&(i=false),x=requestAnimationFrame(Ze);return}if($.forEach((h,E)=>{let W=E*N*be,d=K(ie(l,H+W,ne+W,g));de&&!Te&&(d=R[E]=Math.max(R[E]??v,d)),h.style.strokeDashoffset=z==="reverse"?`${w[E]*d}`:`${w[E]*(1-d)}`,u&&(h.style.opacity=z==="reverse"?`${1-d}`:`${d}`),Y&&F?h.style.stroke=Ne(Y,F,d):F&&(h.style.stroke=F),M!==null&&C!==null?h.style.strokeWidth=`${M+(C-M)*d}`:C!==null&&(h.style.strokeWidth=`${C}`),O!==null&&L!==null?h.style.fillOpacity=`${O+(L-O)*d}`:L!==null&&(h.style.fillOpacity=`${L}`),B&&h.tagName.toLowerCase()==="path"&&_[E]&&h.setAttribute("d",mt(_[E],B,d)),E===0&&(S=d,Ae?.(d),e.style.setProperty("--scroll-draw-progress",String(d))),d<1&&(me=false);}),le){let h=K(ie(l,H,ne,g));for(let E in le){let W=parseFloat(E);h>=W&&!ve.has(W)&&(ve.add(W),le[E]?.());}}!f&&ie(l,H,ne,g)>0&&(f=true,j?.()),me&&!i?(i=true,q?.(),Q<(I==="infinite"?1/0:I??0)&&(Q++,J=setTimeout(()=>{v=-1,R=[],f=false,i=false,ve.clear(),Qe(),Se=true;},_e))):!me&&!de&&(i=false),x=requestAnimationFrame(Ze);}let ut=false;function Ke(){ut||(ut=true,x=requestAnimationFrame(function(){Ze();}));}function Je(){ut=false,cancelAnimationFrame(x);}let ft=new IntersectionObserver(s=>{s.forEach(l=>{V=l.isIntersecting,V&&!k?(Se=true,Ke()):Je();});},{root:X??null,threshold:Pe,rootMargin:Z});function St(){$.forEach((s,l)=>{w[l]=Re(s),s.style.strokeDasharray=`${w[l]}`;}),Et(),Se=true;}let et;function Ve(){clearTimeout(et),et=setTimeout(St,150);}window.addEventListener("resize",Ve),window.addEventListener("orientationchange",Ve);let Gt=st([e],Ve);return we>0?setTimeout(()=>ft.observe(e),we):ft.observe(e),ct({destroy(){cancelAnimationFrame(x),clearTimeout(J),Je(),ft.disconnect(),Gt(),window.removeEventListener("resize",Ve),window.removeEventListener("orientationchange",Ve),clearTimeout(et),gt();},replay(){v=-1,R=[],oe=-1,Ye=-1,f=false,i=false,Q=0,k=false,S=0,ve.clear(),clearTimeout(J),Qe(),Se=true,V&&Ke();},pause(){k=true,Je();},resume(){k&&(k=false,Se=true,V&&Ke());},seek(s){let l=Math.min(1,Math.max(0,s));S=l,v=l,R=[],k=true,Je(),Vt(l,b),Se=true;},getProgress(){return S},refresh(){clearTimeout(et),St(),V&&!k&&Ke();}},()=>({tStart:H,tEnd:ne}))}function nr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Nt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],c=[],m=t[2].trim();if(m)for(let a of m.split(/[\s,]+/)){let u=a.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(u?parseFloat(u[1]):0),c.push(u?u[2]:"");}n.push({fn:t[1],nums:o,units:c});}return n}function or(e,n,r){let t=Nt(e),o=Nt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((c,m)=>{let a=o[m];return c.fn!==a.fn||c.nums.length!==a.nums.length?r<1?`${c.fn}(${c.nums.map((u,y)=>`${u}${c.units[y]}`).join(", ")})`:`${a.fn}(${a.nums.map((u,y)=>`${u}${a.units[y]}`).join(", ")})`:`${c.fn}(${c.nums.map((u,y)=>`${u+(a.nums[y]-u)*r}${c.units[y]}`).join(", ")})`}).join(" ")}function dt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(nr(t))return Ne(t,o,r);if(t.includes("("))return or(t,o,r);let c=t.match(/^([-+]?[\d.]+)(.*)$/),m=o.match(/^([-+]?[\d.]+)(.*)$/);if(c&&m){let a=parseFloat(c[1]),u=parseFloat(m[1]);return `${a+(u-a)*r}${c[2]||m[2]}`}return r<1?t:o}function sr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var ir=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),ar=0,Ft="--scroll-draw-progress";function lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Fe(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:o={},easing:c="ease-out",speed:m=1,once:a=false,axis:u="y",scrollContainer:y,native:P=true,velocityScale:N=false,respectReducedMotion:b=true,triggerElement:de,onProgress:Ue,onComplete:te,onEnter:ke,onLeave:Te,onEnterBack:we,onLeaveBack:ae}=n,ge=b&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof c=="function"?c:xe[c]??xe["ease-out"],le=Ce(o.start??"top bottom"),Ee=Ce(o.end??"bottom top"),Pe=de??e,Z=typeof y=="string"?document.querySelector(y):y??null,I=Object.entries(t).map(([i,f])=>({prop:sr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function _e(){let i=window.getComputedStyle(e);for(let f of I)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function B(){for(let i of I)e.style.setProperty(i.prop,String(i.to));}let $e=new Map;for(let i of [...I.map(f=>f.prop),Ft])$e.set(i,e.style.getPropertyValue(i));function He(){for(let[i,f]of $e)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(ge)return B(),te?.(),{...r,destroy:He,getProgress:()=>1};_e();let Xe=typeof c=="string"?rt(c):null;function it(){if(!P||!lr()||!Xe||u!=="y"||Z||Pe!==e||a||m!==1||Ue||te||ke||Te||we||ae||N!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let i of I)if(!ir.has(i.prop))return false;return true}function Ae(){let i=`ssd-a-${++ar}`,f=I.map(S=>`${S.prop}:${S.from}`).join(";"),x=I.map(S=>`${S.prop}:${S.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${i}{from{${f}}to{${x}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${Xe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(i);let v=()=>u==="x"?window.scrollX:window.scrollY,R=()=>u==="x"?window.innerWidth:window.innerHeight,oe=()=>{let S=e.getBoundingClientRect();return Oe({top:S.top,height:S.height},v(),R(),le,Ee)};We(e,{type:"animate",getProgress:()=>k.getProgress(),getTrigger:oe});let k={refresh(){},destroy(){e.classList.remove(i),V.remove(),e.style.animationPlayState="",He(),qe(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(S){let Q=Math.min(1,Math.max(0,S));e.classList.remove(i);for(let J of I)e.style.setProperty(J.prop,dt(J.from,J.to,Q));},getProgress(){let{tStart:S,tEnd:Q}=oe();return re(ie(v(),S,Q,m))}};return k}if(it())return Ae();let j=0,q=0,ce=0,Me=false,ue=false,ye=-1,G=0,K=false,fe=NaN,De=-1,X=0,Y=()=>Z?u==="x"?Z.scrollLeft:Z.scrollTop:u==="x"?window.scrollX:window.scrollY,F=()=>Z?u==="x"?Z.clientWidth:Z.clientHeight:u==="x"?window.innerWidth:window.innerHeight,M=Pe===e?I:[],C=false;function O(){let i=e.style,f=M.map(R=>i.getPropertyValue(R.prop)),x=i.transition;M.length&&(i.transition="none"),M.forEach(R=>i.setProperty(R.prop,$e.get(R.prop)??""));let V=tt(Pe,Z,u);M.forEach((R,oe)=>i.setProperty(R.prop,f[oe])),M.length&&(e.offsetWidth,i.transition=x);let v=Oe(V,V.scroll,F(),le,Ee);C&&Math.abs(v.tStart-j)<1&&Math.abs(v.tEnd-q)<1||(C=true,j=v.tStart,q=v.tEnd);}function L(i){e.style.setProperty(Ft,String(i));for(let f of I)e.style.setProperty(f.prop,dt(f.from,f.to,i));Ue?.(i);}function he(i){if(isNaN(fe)){fe=i;return}fe<=0&&i>0?ke?.():fe>0&&i<=0&&ae?.(),fe<1&&i>=1?Te?.():fe>=1&&i<1&&we?.(),fe=i;}function $(){if(!Me||ue)return;let i=performance.now(),f=Y(),x=m;if(N!==false){let R=i-X,oe=R>0?Math.abs(f-(De<0?f:De))/R:0;x=m*Math.max(.2,1+oe*(typeof N=="number"?N:1)*.04);}De=f,X=i;let V=q===j?0:(f-j)/(q-j);he(V);let v=re(ie(f,j,q,x));a&&(ye=Math.max(ye,v),v=ye),G=v,L(v),v>=1&&!K?(K=true,te?.()):v<1&&!a&&(K=false),ce=requestAnimationFrame($);}O(),q===j&&pe("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=re(ie(Y(),j,q,m));a&&i>0&&(ye=i),G=i,L(i);}let w=new IntersectionObserver(i=>{i.forEach(f=>{Me=f.isIntersecting,Me&&!ue?ce=requestAnimationFrame($):cancelAnimationFrame(ce);});},{root:Z??null}),_;function H(){clearTimeout(_),_=setTimeout(O,150);}window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let ne=st([Pe],H);return w.observe(e),We(e,{type:"animate",getProgress:()=>G,getTrigger:()=>({tStart:j,tEnd:q})}),{destroy(){cancelAnimationFrame(ce),w.disconnect(),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),ne(),clearTimeout(_),He(),qe(e);},replay(){ye=-1,K=false,G=0,ue=false,L(0);},pause(){ue=true,cancelAnimationFrame(ce);},resume(){ue&&(ue=false,Me&&(ce=requestAnimationFrame($)));},seek(i){let f=Math.min(1,Math.max(0,i));G=f,ye=f,ue=true,cancelAnimationFrame(ce),L(f);},getProgress(){return G},refresh(){O();}}}var _t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ht(e,n={}){if(typeof window>"u")return _t;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return pe("scrollParallax: element not found:",e),_t;let{speed:t=.3,axis:o="y",easing:c="linear",trigger:m,onProgress:a}=n,u=-t*100,y=r.style,P=!!r.ownerSVGElement,N=y.getPropertyValue("transform-box");P&&y.setProperty("transform-box","fill-box");let b=Fe(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:m??{start:"top bottom",end:"bottom top"},easing:c,native:false,onProgress:a});return P?{...b,destroy(){b.destroy(),y.setProperty("transform-box",N);}}:b}function je(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var Le={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Xr(e,n={}){if(typeof window>"u")return Le;let r=je(e).map(t=>pt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function Yr(e,n={}){if(typeof window>"u")return Le;let r=je(e);if(r.length===0)return Le;let t=0,o=[];function c(a){return pt(r[a],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(a+1,r.length-1),t>a&&o[t]?.resume();}})}function m(){r.forEach((a,u)=>{o[u]=c(u);});for(let a=1;a<o.length;a++)o[a].pause();}return m(),{destroy(){o.forEach(a=>a.destroy()),o.length=0;},replay(){o.forEach(a=>a.destroy()),o.length=0,t=0,m();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(a){o[t]?.seek(a);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(a=>a.refresh?.());}}}function Qr(e,n){if(typeof window>"u")return Le;let r=je(e).map(t=>Fe(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function Zr(e,n){if(typeof window>"u")return Le;let r=je(e);if(r.length===0)return Le;let t=0,o=[];function c(a){return Fe(r[a],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(a+1,r.length-1),t>a&&o[t]?.resume();}})}function m(){r.forEach((a,u)=>{o[u]=c(u);});for(let a=1;a<o.length;a++)o[a].pause();}return m(),{destroy(){o.forEach(a=>a.destroy()),o.length=0;},replay(){o.forEach(a=>a.destroy()),o.length=0,t=0,m();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(a){o[t]?.seek(a);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(a=>a.refresh?.());}}}function Kr(e,n={}){if(typeof window>"u")return Le;let r=je(e).map(t=>Ht(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}exports.scrollAnimateGroup=Qr;exports.scrollAnimateSequence=Zr;exports.scrollDrawGroup=Xr;exports.scrollDrawSequence=Yr;exports.scrollParallaxGroup=Kr;
@@ -1,6 +1,6 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-DHU1zNEw.mjs';
2
- import { S as ScrollParallaxOptions } from '../index-CGR7pSOR.mjs';
3
- import { S as ScrollAnimateOptions } from '../engine-Ci08nM91.mjs';
1
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-B0YM4nQP.mjs';
2
+ import { S as ScrollParallaxOptions } from '../index-Zxa5HIes.mjs';
3
+ import { S as ScrollAnimateOptions } from '../engine-CvzRSkuk.mjs';
4
4
 
5
5
  /**
6
6
  * Animate multiple SVG containers simultaneously with the same options.
@@ -1,6 +1,6 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-DHU1zNEw.js';
2
- import { S as ScrollParallaxOptions } from '../index-BVuNgQSd.js';
3
- import { S as ScrollAnimateOptions } from '../engine-6AXEX8CL.js';
1
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-B0YM4nQP.js';
2
+ import { S as ScrollParallaxOptions } from '../index-G3VfLIN8.js';
3
+ import { S as ScrollAnimateOptions } from '../engine-C9LKls__.js';
4
4
 
5
5
  /**
6
6
  * Animate multiple SVG containers simultaneously with the same options.
@@ -1 +1 @@
1
- import {b as b$1}from'../chunk-KBFWDHF4.mjs';import {a as a$1}from'../chunk-QJ4H2HW3.mjs';import {b}from'../chunk-LINFV2GK.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-PEFR3ZB7.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
1
+ import {b as b$1}from'../chunk-MTEGM4RR.mjs';import {a as a$1}from'../chunk-BFX2CSQ3.mjs';import {b}from'../chunk-WHFRS7IP.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
@@ -1 +1 @@
1
- 'use strict';function _e({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),a=Math.sqrt(n),s=0,m=[];for(let u=0;u<r;u++){let g=Math.pow(a,u);m.push(g),s+=g;}let p=[0],c=0;for(let u=0;u<r;u++)c+=m[u]/s,p.push(c);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let g=0;g<r;g++)if(u<=p[g+1]){let h=(u-p[g])/(p[g+1]-p[g]);if(g===0)return h*(2-h);let M=1-Math.pow(n,g);return M+(1-M)*(2*h-1)*(2*h-1)}return 1}}function He({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),a=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-a)*(2*Math.PI)/n)+1}var V={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:_e(),elastic:He()};function de(e,t,r){return Math.min(r,Math.max(t,e))}function ie(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function be(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function ye(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function Q(e,t,r,n){return r===t?0:de((e-t)/(r-t)*n,0,1)}function se(e,t,r,n,a){let s=be(e.top,e.height,t,n.element)-ye(n.viewport,r),m=be(e.top,e.height,t,a.element)-ye(a.viewport,r);return {tStart:s,tEnd:m}}function he(e,t,r){let n=e.getBoundingClientRect(),a=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:a,scroll:0}:{top:r==="x"?n.left:n.top,height:a,scroll:r==="x"?window.scrollX:window.scrollY}}function Ee(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[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 n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function we(e,t,r){let n=Ee(e),a=Ee(t);return !n||!a?e:`rgb(${Math.round(n[0]+(a[0]-n[0])*r)},${Math.round(n[1]+(a[1]-n[1])*r)},${Math.round(n[2]+(a[2]-n[2])*r)})`}var ze="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Ne="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",ve=33;function Oe(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Fe(e){let t=[];for(let r=0;r<ve;r++){let n=r/(ve-1);t.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${t.join(",")})`}function Se(e){switch(e){case "linear":return "linear";case "ease-in":return ze;case "ease-out":return Ne;case "ease-in-out":return Oe()?Fe(V["ease-in-out"]):null;default:return null}}var Me=Symbol.for("svg-scroll-draw.registry");function Te(){let e=globalThis;return e[Me]||(e[Me]=new Map)}function ae(e,t){Te().set(e,t);}function ue(e){Te().delete(e);}var De=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function W(e,...t){De&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function Ve(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function xe(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let a=[],s=[],m=n[2].trim();if(m)for(let p of m.split(/[\s,]+/)){let c=p.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:n[1],nums:a,units:s});}return t}function We(e,t,r){let n=xe(e),a=xe(t);return n.length===0||n.length!==a.length?r<1?e:t:n.map((s,m)=>{let p=a[m];return s.fn!==p.fn||s.nums.length!==p.nums.length?r<1?`${s.fn}(${s.nums.map((c,u)=>`${c}${s.units[u]}`).join(", ")})`:`${p.fn}(${p.nums.map((c,u)=>`${c}${p.units[u]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,u)=>`${c+(p.nums[u]-c)*r}${s.units[u]}`).join(", ")})`}).join(" ")}function Le(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),a=String(t);if(Ve(n))return we(n,a,r);if(n.includes("("))return We(n,a,r);let s=n.match(/^([-+]?[\d.]+)(.*)$/),m=a.match(/^([-+]?[\d.]+)(.*)$/);if(s&&m){let p=parseFloat(s[1]),c=parseFloat(m[1]);return `${p+(c-p)*r}${s[2]||m[2]}`}return r<1?n:a}function ke(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Be=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),qe=0,Pe="--scroll-draw-progress";function je(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function le(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:a={},easing:s="ease-out",speed:m=1,once:p=false,axis:c="y",scrollContainer:u,native:g=true,velocityScale:h=false,respectReducedMotion:M=true,triggerElement:N,onProgress:A,onComplete:E,onEnter:d,onLeave:O,onEnterBack:v,onLeaveBack:F}=t,D=M&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,I=typeof s=="function"?s:V[s]??V["ease-out"],C=ie(a.start??"top bottom"),k=ie(a.end??"bottom top"),T=N??e,b=typeof u=="string"?document.querySelector(u):u??null,w=Object.entries(n).map(([o,i])=>({prop:ke(o),from:Array.isArray(i)?i[0]:"",to:Array.isArray(i)?i[1]:i}));function l(){let o=window.getComputedStyle(e);for(let i of w)i.from===""&&(i.from=o.getPropertyValue(i.prop).trim()||"0");}function f(){for(let o of w)e.style.setProperty(o.prop,String(o.to));}let B=new Map;for(let o of [...w.map(i=>i.prop),Pe])B.set(o,e.style.getPropertyValue(o));function Z(){for(let[o,i]of B)i?e.style.setProperty(o,i):e.style.removeProperty(o);}if(D)return f(),E?.(),{...r,destroy:Z,getProgress:()=>1};l();let ce=typeof s=="string"?Se(s):null;function Re(){if(!g||!je()||!ce||c!=="y"||b||T!==e||p||m!==1||A||E||d||O||v||F||h!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let o of w)if(!Be.has(o.prop))return false;return true}function Ae(){let o=`ssd-a-${++qe}`,i=w.map(y=>`${y.prop}:${y.from}`).join(";"),U=w.map(y=>`${y.prop}:${y.to}`).join(";"),z=document.createElement("style");z.setAttribute("data-ssd-animate",""),z.textContent=`@keyframes ${o}{from{${i}}to{${U}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${ce};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(z),e.classList.add(o);let S=()=>c==="x"?window.scrollX:window.scrollY,Y=()=>c==="x"?window.innerWidth:window.innerHeight,K=()=>{let y=e.getBoundingClientRect();return se({top:y.top,height:y.height},S(),Y(),C,k)};ae(e,{type:"animate",getProgress:()=>ne.getProgress(),getTrigger:K});let ne={destroy(){e.classList.remove(o),z.remove(),e.style.animationPlayState="",Z(),ue(e);},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(y){let re=Math.min(1,Math.max(0,y));e.classList.remove(o);for(let oe of w)e.style.setProperty(oe.prop,Le(oe.from,oe.to,re));},getProgress(){let{tStart:y,tEnd:re}=K();return I(Q(S(),y,re,m))}};return ne}if(Re())return Ae();let x=0,L=0,P=0,q=false,$=false,_=-1,H=0,j=false,R=NaN,J=-1,me=0,pe=()=>b?c==="x"?b.scrollLeft:b.scrollTop:c==="x"?window.scrollX:window.scrollY,Ie=()=>b?c==="x"?b.clientWidth:b.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function fe(){let o=he(T,b,c),i=se(o,o.scroll,Ie(),C,k);x=i.tStart,L=i.tEnd;}function G(o){e.style.setProperty(Pe,String(o));for(let i of w)e.style.setProperty(i.prop,Le(i.from,i.to,o));A?.(o);}function Ce(o){if(isNaN(R)){R=o;return}R<=0&&o>0?d?.():R>0&&o<=0&&F?.(),R<1&&o>=1?O?.():R>=1&&o<1&&v?.(),R=o;}function ee(){if(!q||$)return;let o=performance.now(),i=pe(),U=m;if(h!==false){let Y=o-me,K=Y>0?Math.abs(i-(J<0?i:J))/Y:0;U=m*Math.max(.2,1+K*(typeof h=="number"?h:1)*.04);}J=i,me=o;let z=L===x?0:(i-x)/(L-x);Ce(z);let S=I(Q(i,x,L,U));p&&(_=Math.max(_,S),S=_),H=S,G(S),S>=1&&!j?(j=true,E?.()):S<1&&!p&&(j=false),P=requestAnimationFrame(ee);}fe(),L===x&&W("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 o=I(Q(pe(),x,L,m));p&&o>0&&(_=o),H=o,G(o);}let ge=new IntersectionObserver(o=>{o.forEach(i=>{q=i.isIntersecting,q&&!$?P=requestAnimationFrame(ee):cancelAnimationFrame(P);});},{root:b??null}),te;function X(){clearTimeout(te),te=setTimeout(fe,150);}return window.addEventListener("resize",X),window.addEventListener("orientationchange",X),ge.observe(e),ae(e,{type:"animate",getProgress:()=>H,getTrigger:()=>({tStart:x,tEnd:L})}),{destroy(){cancelAnimationFrame(P),ge.disconnect(),window.removeEventListener("resize",X),window.removeEventListener("orientationchange",X),clearTimeout(te),Z(),ue(e);},replay(){_=-1,j=false,H=0,$=false,G(0);},pause(){$=true,cancelAnimationFrame(P);},resume(){$&&($=false,q&&(P=requestAnimationFrame(ee)));},seek(o){let i=Math.min(1,Math.max(0,o));H=i,_=i,$=true,cancelAnimationFrame(P),G(i);},getProgress(){return H}}}var $e={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function pt(e,t={}){if(typeof window>"u")return $e;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return W("scrollHorizontal: track element not found:",e),$e;let n=r,{easing:a="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:m,respectReducedMotion:p=false,onProgress:c}=t,u=typeof m=="string"?document.querySelector(m):m??null;function g(){for(let l=n.parentElement;l;l=l.parentElement)if(window.getComputedStyle(l).position==="sticky")return l;return null}function h(){let l=g();if(l){let f=window.getComputedStyle(l);return l.clientWidth-(parseFloat(f.paddingLeft)||0)-(parseFloat(f.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function M(){return t.distance??n.scrollWidth-h()}function N(){if(t.triggerElement!==void 0){let f=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(f)return f;W("scrollHorizontal: triggerElement not found:",t.triggerElement);}let l=g();return l?l.parentElement??l:n}let A=M(),E=N(),d=le(n,F(A,E)),O=D(),v=null;function F(l,f){return {props:{transform:["translateX(0px)",`translateX(${-l}px)`]},trigger:s,easing:a,native:false,respectReducedMotion:p,...f!==n&&{triggerElement:f},...m!==void 0&&{scrollContainer:m},...c!==void 0&&{onProgress:c}}}function D(){let l=E.getBoundingClientRect(),f=u?l.top-u.getBoundingClientRect().top+u.scrollTop:l.top+window.scrollY;return `${M()} ${Math.round(f)} ${Math.round(l.height)}`}function I(){d.destroy();let l=N(),f=l!==E;A=M(),E=l,d=le(n,F(A,E)),O=D(),v!==null&&d.seek(v),f&&w();}let C;function k(){(N()!==E||D()!==O)&&I();}function T(){clearTimeout(C),C=setTimeout(k,150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let b=typeof ResizeObserver<"u"?new ResizeObserver(T):void 0;function w(){if(!b)return;b.disconnect();let l=[document.body,document.documentElement,n,E];l.filter((f,B)=>f&&l.indexOf(f)===B).forEach(f=>b.observe(f));}return w(),{destroy(){clearTimeout(C),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),b?.disconnect(),d.destroy();},replay(){v=null,d.replay();},pause(){d.pause(),v=d.getProgress();},resume(){v=null,d.resume();},seek(l){d.seek(l),v=d.getProgress();},getProgress(){return d.getProgress()},refresh(){I();}}}exports.scrollHorizontal=pt;
1
+ 'use strict';function ke({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),i=Math.sqrt(n),s=0,u=[];for(let l=0;l<r;l++){let p=Math.pow(i,l);u.push(p),s+=p;}let f=[0],c=0;for(let l=0;l<r;l++)c+=u[l]/s,f.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let p=0;p<r;p++)if(l<=f[p+1]){let w=(l-f[p])/(f[p+1]-f[p]);if(p===0)return w*(2-w);let P=1-Math.pow(n,p);return P+(1-P)*(2*w-1)*(2*w-1)}return 1}}function Be({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),i=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-i)*(2*Math.PI)/n)+1}var j={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:ke(),elastic:Be()};function Se(e,t,r){return Math.min(r,Math.max(t,e))}function fe(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function Me(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function Te(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function J(e,t,r,n){return r===t?0:Se((e-t)/(r-t)*n,0,1)}function pe(e,t,r,n,i){let s=Me(e.top,e.height,t,n.element)-Te(n.viewport,r),u=Me(e.top,e.height,t,i.element)-Te(i.viewport,r);return {tStart:s,tEnd:u}}function xe(e,t,r){let n=e.getBoundingClientRect(),i=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:i,scroll:0}:{top:r==="x"?n.left:n.top,height:i,scroll:r==="x"?window.scrollX:window.scrollY}}function Le(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[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 n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function Pe(e,t,r){let n=Le(e),i=Le(t);return !n||!i?e:`rgb(${Math.round(n[0]+(i[0]-n[0])*r)},${Math.round(n[1]+(i[1]-n[1])*r)},${Math.round(n[2]+(i[2]-n[2])*r)})`}var qe="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",je="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Re=33;function Ge(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Xe(e){let t=[];for(let r=0;r<Re;r++){let n=r/(Re-1);t.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${t.join(",")})`}function $e(e){switch(e){case "linear":return "linear";case "ease-in":return qe;case "ease-out":return je;case "ease-in-out":return Ge()?Xe(j["ease-in-out"]):null;default:return null}}var Ae=Symbol.for("svg-scroll-draw.registry");function Ce(){let e=globalThis;return e[Ae]||(e[Ae]=new Map)}function ge(e,t){Ce().set(e,t);}function de(e){Ce().delete(e);}var Ue=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function G(e,...t){Ue&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var X,ee=new Set,te=new WeakMap,U=new Map,Ie=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ye(e){let t=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let n=r;n;n=n.previousElementSibling)t.add(n);return t}function ne(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>t();X??(X=new ResizeObserver(i=>{let s=false;for(let{target:u}of i)te.get(u)!==Ie(u)&&(s=true),te.set(u,"");s&&ee.forEach(u=>u());})),ee.add(r);let n=Ye(e);return [document.body,document.documentElement].forEach(i=>i&&n.add(i)),n.forEach(i=>{te.has(i)||te.set(i,Ie(i)),U.set(i,(U.get(i)??0)+1),X.observe(i);}),()=>{ee.delete(r)&&(n.forEach(i=>{let s=(U.get(i)??1)-1;if(s)return void U.set(i,s);U.delete(i),X?.unobserve(i);}),ee.size||(X?.disconnect(),X=void 0));}}function Ke(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _e(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let i=[],s=[],u=n[2].trim();if(u)for(let f of u.split(/[\s,]+/)){let c=f.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:n[1],nums:i,units:s});}return t}function Qe(e,t,r){let n=_e(e),i=_e(t);return n.length===0||n.length!==i.length?r<1?e:t:n.map((s,u)=>{let f=i[u];return s.fn!==f.fn||s.nums.length!==f.nums.length?r<1?`${s.fn}(${s.nums.map((c,l)=>`${c}${s.units[l]}`).join(", ")})`:`${f.fn}(${f.nums.map((c,l)=>`${c}${f.units[l]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,l)=>`${c+(f.nums[l]-c)*r}${s.units[l]}`).join(", ")})`}).join(" ")}function He(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),i=String(t);if(Ke(n))return Pe(n,i,r);if(n.includes("("))return Qe(n,i,r);let s=n.match(/^([-+]?[\d.]+)(.*)$/),u=i.match(/^([-+]?[\d.]+)(.*)$/);if(s&&u){let f=parseFloat(s[1]),c=parseFloat(u[1]);return `${f+(c-f)*r}${s[2]||u[2]}`}return r<1?n:i}function Ze(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Je=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),et=0,ze="--scroll-draw-progress";function tt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function be(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:i={},easing:s="ease-out",speed:u=1,once:f=false,axis:c="y",scrollContainer:l,native:p=true,velocityScale:w=false,respectReducedMotion:P=true,triggerElement:W,onProgress:I,onComplete:v,onEnter:g,onLeave:D,onEnterBack:T,onLeaveBack:V}=t,k=P&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,_=typeof s=="function"?s:j[s]??j["ease-out"],H=fe(i.start??"top bottom"),Y=fe(i.end??"bottom top"),M=W??e,h=typeof l=="string"?document.querySelector(l):l??null,y=Object.entries(n).map(([o,a])=>({prop:Ze(o),from:Array.isArray(a)?a[0]:"",to:Array.isArray(a)?a[1]:a}));function m(){let o=window.getComputedStyle(e);for(let a of y)a.from===""&&(a.from=o.getPropertyValue(a.prop).trim()||"0");}function d(){for(let o of y)e.style.setProperty(o.prop,String(o.to));}let re=new Map;for(let o of [...y.map(a=>a.prop),ze])re.set(o,e.style.getPropertyValue(o));function oe(){for(let[o,a]of re)a?e.style.setProperty(o,a):e.style.removeProperty(o);}if(k)return d(),v?.(),{...r,destroy:oe,getProgress:()=>1};m();let he=typeof s=="string"?$e(s):null;function Oe(){if(!p||!tt()||!he||c!=="y"||h||M!==e||f||u!==1||I||v||g||D||T||V||w!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let o of y)if(!Je.has(o.prop))return false;return true}function Fe(){let o=`ssd-a-${++et}`,a=y.map(E=>`${E.prop}:${E.from}`).join(";"),O=y.map(E=>`${E.prop}:${E.to}`).join(";"),L=document.createElement("style");L.setAttribute("data-ssd-animate",""),L.textContent=`@keyframes ${o}{from{${a}}to{${O}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${he};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(L),e.classList.add(o);let b=()=>c==="x"?window.scrollX:window.scrollY,S=()=>c==="x"?window.innerWidth:window.innerHeight,F=()=>{let E=e.getBoundingClientRect();return pe({top:E.top,height:E.height},b(),S(),H,Y)};ge(e,{type:"animate",getProgress:()=>le.getProgress(),getTrigger:F});let le={refresh(){},destroy(){e.classList.remove(o),L.remove(),e.style.animationPlayState="",oe(),de(e);},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(E){let ce=Math.min(1,Math.max(0,E));e.classList.remove(o);for(let me of y)e.style.setProperty(me.prop,He(me.from,me.to,ce));},getProgress(){let{tStart:E,tEnd:ce}=F();return _(J(b(),E,ce,u))}};return le}if(Oe())return Fe();let x=0,R=0,$=0,K=false,A=false,z=-1,N=0,Q=false,C=NaN,ie=-1,ye=0,Ee=()=>h?c==="x"?h.scrollLeft:h.scrollTop:c==="x"?window.scrollX:window.scrollY,We=()=>h?c==="x"?h.clientWidth:h.clientHeight:c==="x"?window.innerWidth:window.innerHeight,B=M===e?y:[],we=false;function se(){let o=e.style,a=B.map(S=>o.getPropertyValue(S.prop)),O=o.transition;B.length&&(o.transition="none"),B.forEach(S=>o.setProperty(S.prop,re.get(S.prop)??""));let L=xe(M,h,c);B.forEach((S,F)=>o.setProperty(S.prop,a[F])),B.length&&(e.offsetWidth,o.transition=O);let b=pe(L,L.scroll,We(),H,Y);we&&Math.abs(b.tStart-x)<1&&Math.abs(b.tEnd-R)<1||(we=true,x=b.tStart,R=b.tEnd);}function Z(o){e.style.setProperty(ze,String(o));for(let a of y)e.style.setProperty(a.prop,He(a.from,a.to,o));I?.(o);}function De(o){if(isNaN(C)){C=o;return}C<=0&&o>0?g?.():C>0&&o<=0&&V?.(),C<1&&o>=1?D?.():C>=1&&o<1&&T?.(),C=o;}function ae(){if(!K||A)return;let o=performance.now(),a=Ee(),O=u;if(w!==false){let S=o-ye,F=S>0?Math.abs(a-(ie<0?a:ie))/S:0;O=u*Math.max(.2,1+F*(typeof w=="number"?w:1)*.04);}ie=a,ye=o;let L=R===x?0:(a-x)/(R-x);De(L);let b=_(J(a,x,R,O));f&&(z=Math.max(z,b),b=z),N=b,Z(b),b>=1&&!Q?(Q=true,v?.()):b<1&&!f&&(Q=false),$=requestAnimationFrame(ae);}se(),R===x&&G("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 o=_(J(Ee(),x,R,u));f&&o>0&&(z=o),N=o,Z(o);}let ve=new IntersectionObserver(o=>{o.forEach(a=>{K=a.isIntersecting,K&&!A?$=requestAnimationFrame(ae):cancelAnimationFrame($);});},{root:h??null}),ue;function q(){clearTimeout(ue),ue=setTimeout(se,150);}window.addEventListener("resize",q),window.addEventListener("orientationchange",q);let Ve=ne([M],q);return ve.observe(e),ge(e,{type:"animate",getProgress:()=>N,getTrigger:()=>({tStart:x,tEnd:R})}),{destroy(){cancelAnimationFrame($),ve.disconnect(),window.removeEventListener("resize",q),window.removeEventListener("orientationchange",q),Ve(),clearTimeout(ue),oe(),de(e);},replay(){z=-1,Q=false,N=0,A=false,Z(0);},pause(){A=true,cancelAnimationFrame($);},resume(){A&&(A=false,K&&($=requestAnimationFrame(ae)));},seek(o){let a=Math.min(1,Math.max(0,o));N=a,z=a,A=true,cancelAnimationFrame($),Z(a);},getProgress(){return N},refresh(){se();}}}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function xt(e,t={}){if(typeof window>"u")return Ne;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return G("scrollHorizontal: track element not found:",e),Ne;let n=r,{easing:i="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:u,respectReducedMotion:f=false,onProgress:c}=t,l=typeof u=="string"?document.querySelector(u):u??null;function p(){for(let m=n.parentElement;m;m=m.parentElement)if(window.getComputedStyle(m).position==="sticky")return m;return null}function w(){let m=p();if(m){let d=window.getComputedStyle(m);return m.clientWidth-(parseFloat(d.paddingLeft)||0)-(parseFloat(d.paddingRight)||0)}return l?l.clientWidth:document.documentElement.clientWidth||window.innerWidth}function P(){return t.distance??n.scrollWidth-w()}function W(){if(t.triggerElement!==void 0){let d=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(d)return d;G("scrollHorizontal: triggerElement not found:",t.triggerElement);}let m=p();return m?m.parentElement??m:n}let I=P(),v=W(),g=be(n,V(I,v)),D=k(),T=null;function V(m,d){return {props:{transform:["translateX(0px)",`translateX(${-m}px)`]},trigger:s,easing:i,native:false,respectReducedMotion:f,...d!==n&&{triggerElement:d},...u!==void 0&&{scrollContainer:u},...c!==void 0&&{onProgress:c}}}function k(){let m=v.getBoundingClientRect(),d=l?m.top-l.getBoundingClientRect().top+l.scrollTop:m.top+window.scrollY;return `${P()} ${Math.round(d)} ${Math.round(m.height)}`}function _(){g.destroy();let m=W(),d=m!==v;I=P(),v=m,g=be(n,V(I,v)),D=k(),T!==null&&g.seek(T),d&&y();}let H;function Y(){(W()!==v||k()!==D)&&_();}function M(){clearTimeout(H),H=setTimeout(Y,150);}window.addEventListener("resize",M),window.addEventListener("orientationchange",M);let h=()=>{};function y(){h(),h=ne([n,v],M);}return y(),{destroy(){clearTimeout(H),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),h(),g.destroy();},replay(){T=null,g.replay();},pause(){g.pause(),T=g.getProgress();},resume(){T=null,g.resume();},seek(m){g.seek(m),T=g.getProgress();},getProgress(){return g.getProgress()},refresh(){_();}}}exports.scrollHorizontal=xt;
@@ -1,4 +1,4 @@
1
- import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-DHU1zNEw.mjs';
1
+ import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-B0YM4nQP.mjs';
2
2
 
3
3
  interface ScrollHorizontalOptions {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-DHU1zNEw.js';
1
+ import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-B0YM4nQP.js';
2
2
 
3
3
  interface ScrollHorizontalOptions {
4
4
  /**
@@ -1 +1 @@
1
- import {a}from'../chunk-QJ4H2HW3.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-PEFR3ZB7.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function k(d,r={}){if(typeof window>"u")return x;let h=typeof d=="string"?document.querySelector(d):d;if(!h)return b("scrollHorizontal: track element not found:",d),x;let o=h,{easing:R="linear",trigger:C={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:L=false,onProgress:v}=r,c=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function O(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return c?c.clientWidth:document.documentElement.clientWidth||window.innerWidth}function g(){return r.distance??o.scrollWidth-O()}function m(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let f=g(),i=m(),n=a(o,z(f,i)),S=p(),l=null;function z(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:C,easing:R,native:false,respectReducedMotion:L,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function p(){let e=i.getBoundingClientRect(),t=c?e.top-c.getBoundingClientRect().top+c.scrollTop:e.top+window.scrollY;return `${g()} ${Math.round(t)} ${Math.round(e.height)}`}function T(){n.destroy();let e=m(),t=e!==i;f=g(),i=e,n=a(o,z(f,i)),S=p(),l!==null&&n.seek(l),t&&H();}let E;function P(){(m()!==i||p()!==S)&&T();}function u(){clearTimeout(E),E=setTimeout(P,150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let a$1=typeof ResizeObserver<"u"?new ResizeObserver(u):void 0;function H(){if(!a$1)return;a$1.disconnect();let e=[document.body,document.documentElement,o,i];e.filter((t,M)=>t&&e.indexOf(t)===M).forEach(t=>a$1.observe(t));}return H(),{destroy(){clearTimeout(E),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),a$1?.disconnect(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){T();}}}export{k as scrollHorizontal};
1
+ import {a}from'../chunk-BFX2CSQ3.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import {d}from'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
@@ -1,4 +1,4 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-DHU1zNEw.mjs';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-B0YM4nQP.mjs';
2
2
 
3
3
  interface ScrollCounterOptions {
4
4
  from?: number;
@@ -1,4 +1,4 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-DHU1zNEw.js';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-B0YM4nQP.js';
2
2
 
3
3
  interface ScrollCounterOptions {
4
4
  from?: number;
@@ -1,5 +1,5 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-DHU1zNEw.js';
2
- import { S as ScrollAnimateOptions } from './engine-6AXEX8CL.js';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-B0YM4nQP.js';
2
+ import { S as ScrollAnimateOptions } from './engine-C9LKls__.js';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
@@ -1,5 +1,5 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-DHU1zNEw.mjs';
2
- import { S as ScrollAnimateOptions } from './engine-Ci08nM91.mjs';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-B0YM4nQP.mjs';
2
+ import { S as ScrollAnimateOptions } from './engine-CvzRSkuk.mjs';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';function Wt({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function St({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(n),a=0,d=[];for(let f=0;f<t;f++){let x=Math.pow(l,f);d.push(x),a+=x;}let m=[0],c=0;for(let f=0;f<t;f++)c+=d[f]/a,m.push(c);return f=>{if(f<=0)return 0;if(f>=1)return 1;for(let x=0;x<t;x++)if(f<=m[x+1]){let I=(f-m[x])/(m[x+1]-m[x]);if(x===0)return I*(2-I);let A=1-Math.pow(n,x);return A+(1-A)*(2*I-1)*(2*I-1)}return 1}}function Et({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),l=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-l)*(2*Math.PI)/n)+1}var K={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:St(),elastic:Et()};function xt(e,r,t){return Math.min(t,Math.max(r,e))}function $e(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}function Tt(e,r,t,n){switch(n){case "top":return e+t;case "center":return e+t+r/2;case "bottom":return e+t+r;default:return e+t}}function At(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 ie(e,r,t,n){return t===r?0:xt((e-r)/(t-r)*n,0,1)}function Ne(e,r,t,n,l){let a=Tt(e.top,e.height,r,n.element)-At(n.viewport,t),d=Tt(e.top,e.height,r,l.element)-At(l.viewport,t);return {tStart:a,tEnd:d}}function Ke(e,r,t){let n=e.getBoundingClientRect(),l=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left+r.scrollLeft:n.top-r.getBoundingClientRect().top+r.scrollTop,height:l,scroll:0}:{top:t==="x"?n.left:n.top,height:l,scroll:t==="x"?window.scrollX:window.scrollY}}function ze(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function $t(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function qe(e,r,t){let n=$t(e),l=$t(r);return !n||!l?e:`rgb(${Math.round(n[0]+(l[0]-n[0])*t)},${Math.round(n[1]+(l[1]-n[1])*t)},${Math.round(n[2]+(l[2]-n[2])*t)})`}var at={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 Ge=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function j(e,...r){Ge&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var Bt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Gt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Mt=33;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Yt(e){let r=[];for(let t=0;t<Mt;t++){let n=t/(Mt-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function Je(e){switch(e){case "linear":return "linear";case "ease-in":return Bt;case "ease-out":return Gt;case "ease-in-out":return jt()?Yt(K["ease-in-out"]):null;default:return null}}var Pt=Symbol.for("svg-scroll-draw.registry");function kt(){let e=globalThis;return e[Pt]||(e[Pt]=new Map)}function Me(e,r){kt().set(e,r);}function Pe(e){kt().delete(e);}var Ut=0;function Xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Lt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var Ct=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Qt(e){if(!Ge)return;let r=Lt(e,"stroke");if(!r||r==="none"){j("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Ct.has(t)&&!Ct.has(Lt(e,"fill"))&&j("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Zt(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.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 a=t==="x"?window.scrollX:window.scrollY,d=e-a,m=r-a,c=t==="x";n.innerHTML=`
2
- <div style="position:absolute;${c?`left:${d}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${d}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",l,{passive:true}),l(),{el:n,destroy(){window.removeEventListener("scroll",l),n.remove();}}}var Dt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,It=/[MmLlHhVvCcSsQqTtAaZz]/g;function Kt(e,r,t){if(!Ge)return;let n=(e.match(It)??[]).join("").toUpperCase(),l=(r.match(It)??[]).join("").toUpperCase(),a=(e.match(Dt)??[]).length,d=(r.match(Dt)??[]).length;if(n!==l){j(`morphTo: command sequence differs (${n||"\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.`,t);return}a!==d&&j(`morphTo: coordinate count differs (${a} \u2192 ${d}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function lt(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let d=parseFloat(a),m=n[l++]??d;return String(+(d+(m-d)*t).toFixed(4))})}function Ot(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:t,...n}=r,l=t?{...at[t],...n}:n,a=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:d="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=false,easing:f="linear",trigger:x={},stagger:I=0,direction:A="forward",once:J=false,debug:Ee=false,axis:S="y",scrollContainer:$,autoReverse:g=false,delay:E=0,strokeColor:b,strokeWidth:z,fillOpacity:F,waypoints:G,velocityScale:ee=false,threshold:de=0,rootMargin:Y="0px",repeat:q=0,repeatDelay:ke=0,morphTo:N,clip:ge,autoplay:Le=false,duration:Ce=1e3,native:De=true,onProgress:w,onStart:P,onComplete:ne,onEnter:ye,onLeave:He,onEnterBack:he,onLeaveBack:xe}=l,te=ge===true?"left":typeof ge=="string"?ge:false,ce=typeof f=="function"?f:K[f]??K.linear,be=$e(x.start??"top bottom"),_e=$e(x.end??"bottom top"),ae=typeof $=="string"?document.querySelector($):$??null,le=Array.isArray(b)?b[0]:null,U=Array.isArray(b)?b[1]:typeof b=="string"?b:null,X=Array.isArray(z)?z[0]:null,H=Array.isArray(z)?z[1]:typeof z=="number"?z:null,re=Array.isArray(F)?F[0]:null,W=Array.isArray(F)?F[1]:typeof F=="number"?F:null;function we(o){let i=o*100;switch(te){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let C=te?[]:Array.from(e.querySelectorAll(d)),T=[],s=[],u=0,oe=0,k=false,D=false,O=0,fe=false,ue=-1,B=[],Ie=-1,_=false,ve=0,Te=0,Oe,rt=null;function pt(){rt?.destroy(),rt=null;}let Re=new Set,dt=NaN,Fe=true,je=-1,gt=performance.now(),Ve=NaN;function nt(){return ae?S==="x"?ae.scrollLeft:ae.scrollTop:S==="x"?window.scrollX:window.scrollY}function yt(){return ae?S==="x"?ae.clientWidth:ae.clientHeight:S==="x"?window.innerWidth:window.innerHeight}function ht(){let o=Ke(e,ae,S);return Ne(o,o.scroll,yt(),be,_e)}function bt(){(({tStart:u,tEnd:oe}=ht())),Ee&&Ge&&(pt(),rt=Zt(u,oe,S));}function ot(o,i=ht){Me(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:i});let h=o.destroy;return o.destroy=()=>{h.call(o),Pe(e);},o}function _t(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),te){let h=i==="reverse"?1-o:o;e.style.clipPath=we(h);return}C.forEach((h,Q)=>{h.style.strokeDashoffset=i==="reverse"?`${T[Q]*o}`:`${T[Q]*(1-o)}`,c&&(h.style.opacity=i==="reverse"?`${1-o}`:`${o}`),le&&U?h.style.stroke=qe(le,U,o):U&&(h.style.stroke=U),X!==null&&H!==null?h.style.strokeWidth=`${X+(H-X)*o}`:H!==null&&(h.style.strokeWidth=`${H}`),re!==null&&W!==null?h.style.fillOpacity=`${re+(W-re)*o}`:W!==null&&(h.style.fillOpacity=`${W}`),N&&h.tagName.toLowerCase()==="path"&&s[Q]&&h.setAttribute("d",lt(s[Q],N,o));});}function Ye(){if(e.style.setProperty("--scroll-draw-progress","0"),te){e.style.clipPath=we(0);return}C.forEach((o,i)=>{o.style.strokeDasharray=`${T[i]}`,o.style.strokeDashoffset=A==="reverse"?"0":`${T[i]}`,c?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),X!==null&&(o.style.strokeWidth=`${X}`),re!==null&&(o.style.fillOpacity=`${re}`),N&&o.tagName.toLowerCase()==="path"&&s[i]&&o.setAttribute("d",s[i]);});}if(C.forEach(o=>{Qt(o);let i=ze(o);T.push(i);let h=o.tagName.toLowerCase()==="path";h?s.push(o.getAttribute("d")??""):s.push(""),N&&(h?Kt(s[s.length-1],N,o):j(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),a?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=A==="reverse"?`${i}`:"0",c&&(o.style.opacity="1"),U&&(o.style.stroke=U),H!==null&&(o.style.strokeWidth=`${H}`),W!==null&&(o.style.fillOpacity=`${W}`),N&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",N)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=A==="reverse"?"0":`${i}`,c?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),X!==null&&(o.style.strokeWidth=`${X}`),re!==null&&(o.style.fillOpacity=`${re}`));}),te){if(a)return e.style.clipPath=we(1),ne?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=we(0);}else if(a)return ne?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let wt=typeof f=="string"?Je(f):null;function Vt(){return !(De===false||!Xt()||!C.length||!wt||te||S!=="y"||ae||m!==1||I!==0||J||g||ee!==false||N||G||q||E>0||w||P||ne||ye||He||he||xe||b!=null||z!=null||F!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function zt(){let o=++Ut,i=`svg-scroll-draw-${o}`,h=`svg-scroll-draw-host-${o}`,Q=`--svg-scroll-draw-${o}`,Ae=A==="reverse"?"0":"var(--ssd-len)",Se=A==="reverse"?"var(--ssd-len)":"0",pe=`stroke-dashoffset:${Ae};`,v=`stroke-dashoffset:${Se};`;c&&(pe+=`opacity:${A==="reverse"?1:0};`,v+=`opacity:${A==="reverse"?0:1};`);let M=document.createElement("style");M.setAttribute("data-svg-scroll-draw",""),M.textContent=`@keyframes ${i}{from{${pe}}to{${v}}}.${h}{view-timeline-name:${Q};view-timeline-axis:block;}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${wt};animation-fill-mode:both;animation-timeline:${Q};animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(h);function Z(p,V){p.style.setProperty("--ssd-len",String(T[V])),p.style.strokeDasharray=`${T[V]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(i);}C.forEach(Z);let y=false,L=-1;function R(){if(L>=0)return L;let p=e.getBoundingClientRect(),{tStart:V,tEnd:me}=Ne({top:p.top,height:p.height},nt(),yt(),be,_e);return ce(ie(nt(),V,me,m))}return {destroy(){e.classList.remove(h),C.forEach(p=>{p.classList.remove(i),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),M.remove();},replay(){y=false,L=-1,C.forEach(Z);},pause(){y=true,C.forEach(p=>{p.style.animationPlayState="paused";});},resume(){y&&(y=false,C.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let V=Math.min(1,Math.max(0,p));L=V,y=true,C.forEach((me,se)=>{me.classList.remove(i),me.style.strokeDashoffset=A==="reverse"?`${T[se]*V}`:`${T[se]*(1-V)}`,c&&(me.style.opacity=A==="reverse"?`${1-V}`:`${V}`);});},getProgress(){return R()},refresh(){C.forEach((p,V)=>{T[V]=ze(p),p.style.setProperty("--ssd-len",String(T[V])),p.style.strokeDasharray=`${T[V]}`;});}}}if(Vt())return ot(zt());function qt(){let o=Math.max(1,Ce),i=0,h=0,Q=false;function Ae(y){let L=true;if(te){let R=Math.min(1,Math.max(0,y/o)),p=ce(R);ve=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=we(A==="reverse"?1-p:p),w?.(p),R<1&&(L=false);}else C.forEach((R,p)=>{let V=p*I*o,me=Math.min(1,Math.max(0,(y-V)/o)),se=ce(me);R.style.strokeDashoffset=A==="reverse"?`${T[p]*se}`:`${T[p]*(1-se)}`,c&&(R.style.opacity=A==="reverse"?`${1-se}`:`${se}`),le&&U?R.style.stroke=qe(le,U,se):U&&(R.style.stroke=U),X!==null&&H!==null?R.style.strokeWidth=`${X+(H-X)*se}`:H!==null&&(R.style.strokeWidth=`${H}`),re!==null&&W!==null?R.style.fillOpacity=`${re+(W-re)*se}`:W!==null&&(R.style.fillOpacity=`${W}`),N&&R.tagName.toLowerCase()==="path"&&s[p]&&R.setAttribute("d",lt(s[p],N,se)),p===0&&(ve=se,w?.(se),e.style.setProperty("--scroll-draw-progress",String(se))),me<1&&(L=false);});if(G){let R=Math.min(1,Math.max(0,y/o)),p=ce(R);for(let V in G){let me=parseFloat(V);p>=me&&!Re.has(me)&&(Re.add(me),G[V]?.());}}return L}function Se(y){if(_)return;let L=y-i;D||(D=true,P?.());let R=Ae(L);if(R&&!k){k=true,Ae(o*(1+Math.max(0,C.length-1)*I)),ne?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,Oe=setTimeout(()=>{i=performance.now(),D=false,k=false,Re.clear(),Ye(),O=requestAnimationFrame(Se);},ke));return}R||(O=requestAnimationFrame(Se));}function pe(){cancelAnimationFrame(O),clearTimeout(Oe),i=performance.now(),h=0,_=false,D=false,k=false,Te=0,Q=true,ve=0,Re.clear(),Ye(),O=requestAnimationFrame(Se);}let v=new IntersectionObserver(y=>{y.forEach(L=>{L.isIntersecting&&!(J&&k)?pe():!L.isIntersecting&&!J&&!k&&(cancelAnimationFrame(O),clearTimeout(Oe),Q=false);});},{root:ae??null,threshold:de,rootMargin:Y}),M;function Z(){clearTimeout(M),M=setTimeout(()=>{C.forEach((y,L)=>{T[L]=ze(y),y.style.strokeDasharray=`${T[L]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),E>0?setTimeout(()=>v.observe(e),E):v.observe(e),{destroy(){cancelAnimationFrame(O),clearTimeout(Oe),v.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(M);},replay(){Te=0,pe();},pause(){_||!Q||(_=true,h=performance.now()-i,cancelAnimationFrame(O));},resume(){_&&(_=false,Q=true,i=performance.now()-h,O=requestAnimationFrame(Se));},seek(y){let L=Math.min(1,Math.max(0,y));ve=L,_=true,h=L*o,i=performance.now()-h,cancelAnimationFrame(O),Ae(h);},getProgress(){return ve},refresh(){clearTimeout(M),C.forEach((y,L)=>{T[L]=ze(y),y.style.strokeDasharray=`${T[L]}`;});}}}if(Le)return ot(qt());bt();function Ue(){if(!fe||_)return;let o=performance.now(),i=nt();if(!Fe&&ee===false&&i===dt){O=requestAnimationFrame(Ue);return}Fe=false,dt=i;let h=m;if(ee!==false){let v=o-gt,M=v>0?Math.abs(i-(je<0?i:je))/v:0;h=m*Math.max(.2,1+M*(typeof ee=="number"?ee:1)*.04);}je=i,gt=o;let Q=g?Ie===-1||i>=Ie?"forward":"reverse":A;Ie=i;let Ae=oe-u,Se=true,pe=Ae===0?0:(i-u)/Ae;if(isNaN(Ve)||(Ve<=0&&pe>0?ye?.():Ve>0&&pe<=0&&xe?.(),Ve<1&&pe>=1?He?.():Ve>=1&&pe<1&&he?.()),Ve=pe,te){let v=ce(ie(i,u,oe,h));J&&!g&&(ue=Math.max(ue,v),v=ue),ve=v,e.style.setProperty("--scroll-draw-progress",String(v));let M=Q==="reverse"?1-v:v;e.style.clipPath=we(M),w?.(v),!D&&ie(i,u,oe,h)>0&&(D=true,P?.()),v>=1&&!k?(k=true,ne?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,Oe=setTimeout(()=>{ue=-1,D=false,k=false,e.style.clipPath=we(0);},ke))):v<1&&!J&&(k=false),O=requestAnimationFrame(Ue);return}if(C.forEach((v,M)=>{let Z=M*I*Ae,y=ce(ie(i,u+Z,oe+Z,h));J&&!g&&(y=B[M]=Math.max(B[M]??ue,y)),ve=y,v.style.strokeDashoffset=Q==="reverse"?`${T[M]*y}`:`${T[M]*(1-y)}`,c&&(v.style.opacity=Q==="reverse"?`${1-y}`:`${y}`),le&&U?v.style.stroke=qe(le,U,y):U&&(v.style.stroke=U),X!==null&&H!==null?v.style.strokeWidth=`${X+(H-X)*y}`:H!==null&&(v.style.strokeWidth=`${H}`),re!==null&&W!==null?v.style.fillOpacity=`${re+(W-re)*y}`:W!==null&&(v.style.fillOpacity=`${W}`),N&&v.tagName.toLowerCase()==="path"&&s[M]&&v.setAttribute("d",lt(s[M],N,y)),M===0&&(w?.(y),e.style.setProperty("--scroll-draw-progress",String(y))),y<1&&(Se=false);}),G){let v=ce(ie(i,u,oe,h));for(let M in G){let Z=parseFloat(M);v>=Z&&!Re.has(Z)&&(Re.add(Z),G[M]?.());}}!D&&ie(i,u,oe,h)>0&&(D=true,P?.()),Se&&!k?(k=true,ne?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,Oe=setTimeout(()=>{ue=-1,B=[],D=false,k=false,Re.clear(),Ye(),Fe=true;},ke))):!Se&&!J&&(k=false),O=requestAnimationFrame(Ue);}let st=false;function Xe(){st||(st=true,O=requestAnimationFrame(function(){Ue();}));}function Qe(){st=false,cancelAnimationFrame(O);}let it=new IntersectionObserver(o=>{o.forEach(i=>{fe=i.isIntersecting,fe&&!_?(Fe=true,Xe()):Qe();});},{root:ae??null,threshold:de,rootMargin:Y});function vt(){C.forEach((o,i)=>{T[i]=ze(o),o.style.strokeDasharray=`${T[i]}`;}),bt(),Fe=true;}let Ze;function We(){clearTimeout(Ze),Ze=setTimeout(vt,150);}window.addEventListener("resize",We),window.addEventListener("orientationchange",We);let Be;return typeof ResizeObserver<"u"&&(Be=new ResizeObserver(()=>We()),Be.observe(document.body),Be.observe(document.documentElement),Be.observe(e)),E>0?setTimeout(()=>it.observe(e),E):it.observe(e),ot({destroy(){cancelAnimationFrame(O),clearTimeout(Oe),Qe(),it.disconnect(),Be?.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Ze),pt();},replay(){ue=-1,B=[],Ie=-1,je=-1,D=false,k=false,Te=0,_=false,ve=0,Re.clear(),clearTimeout(Oe),Ye(),Fe=true,fe&&Xe();},pause(){_=true,Qe();},resume(){_&&(_=false,Fe=true,fe&&Xe());},seek(o){let i=Math.min(1,Math.max(0,o));ve=i,ue=i,B=[],_=true,Qe(),_t(i,A),Fe=true;},getProgress(){return ve},refresh(){clearTimeout(Ze),vt(),fe&&!_&&Xe();}},()=>({tStart:u,tEnd:oe}))}function Jt(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?Ot(n,r):(j("Container not found:",e),t)}function er(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Rt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let l=[],a=[],d=n[2].trim();if(d)for(let m of d.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(c?parseFloat(c[1]):0),a.push(c?c[2]:"");}r.push({fn:n[1],nums:l,units:a});}return r}function tr(e,r,t){let n=Rt(e),l=Rt(r);return n.length===0||n.length!==l.length?t<1?e:r:n.map((a,d)=>{let m=l[d];return a.fn!==m.fn||a.nums.length!==m.nums.length?t<1?`${a.fn}(${a.nums.map((c,f)=>`${c}${a.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,f)=>`${c}${m.units[f]}`).join(", ")})`:`${a.fn}(${a.nums.map((c,f)=>`${c+(m.nums[f]-c)*t}${a.units[f]}`).join(", ")})`}).join(" ")}function Ft(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),l=String(r);if(er(n))return qe(n,l,t);if(n.includes("("))return tr(n,l,t);let a=n.match(/^([-+]?[\d.]+)(.*)$/),d=l.match(/^([-+]?[\d.]+)(.*)$/);if(a&&d){let m=parseFloat(a[1]),c=parseFloat(d[1]);return `${m+(c-m)*t}${a[2]||d[2]}`}return t<1?n:l}function rr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var nr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),or=0,Nt="--scroll-draw-progress";function sr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ct(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let{props:n,trigger:l={},easing:a="ease-out",speed:d=1,once:m=false,axis:c="y",scrollContainer:f,native:x=true,velocityScale:I=false,respectReducedMotion:A=true,triggerElement:J,onProgress:Ee,onComplete:S,onEnter:$,onLeave:g,onEnterBack:E,onLeaveBack:b}=r,z=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,F=typeof a=="function"?a:K[a]??K["ease-out"],G=$e(l.start??"top bottom"),ee=$e(l.end??"bottom top"),de=J??e,Y=typeof f=="string"?document.querySelector(f):f??null,q=Object.entries(n).map(([s,u])=>({prop:rr(s),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function ke(){let s=window.getComputedStyle(e);for(let u of q)u.from===""&&(u.from=s.getPropertyValue(u.prop).trim()||"0");}function N(){for(let s of q)e.style.setProperty(s.prop,String(s.to));}let ge=new Map;for(let s of [...q.map(u=>u.prop),Nt])ge.set(s,e.style.getPropertyValue(s));function Le(){for(let[s,u]of ge)u?e.style.setProperty(s,u):e.style.removeProperty(s);}if(z)return N(),S?.(),{...t,destroy:Le,getProgress:()=>1};ke();let Ce=typeof a=="string"?Je(a):null;function De(){if(!x||!sr()||!Ce||c!=="y"||Y||de!==e||m||d!==1||Ee||S||$||g||E||b||I!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let s of q)if(!nr.has(s.prop))return false;return true}function w(){let s=`ssd-a-${++or}`,u=q.map(B=>`${B.prop}:${B.from}`).join(";"),oe=q.map(B=>`${B.prop}:${B.to}`).join(";"),k=document.createElement("style");k.setAttribute("data-ssd-animate",""),k.textContent=`@keyframes ${s}{from{${u}}to{${oe}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${Ce};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(k),e.classList.add(s);let D=()=>c==="x"?window.scrollX:window.scrollY,O=()=>c==="x"?window.innerWidth:window.innerHeight,fe=()=>{let B=e.getBoundingClientRect();return Ne({top:B.top,height:B.height},D(),O(),G,ee)};Me(e,{type:"animate",getProgress:()=>ue.getProgress(),getTrigger:fe});let ue={destroy(){e.classList.remove(s),k.remove(),e.style.animationPlayState="",Le(),Pe(e);},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(B){let Ie=Math.min(1,Math.max(0,B));e.classList.remove(s);for(let _ of q)e.style.setProperty(_.prop,Ft(_.from,_.to,Ie));},getProgress(){let{tStart:B,tEnd:Ie}=fe();return F(ie(D(),B,Ie,d))}};return ue}if(De())return w();let P=0,ne=0,ye=0,He=false,he=false,xe=-1,te=0,ce=false,be=NaN,_e=-1,ae=0,le=()=>Y?c==="x"?Y.scrollLeft:Y.scrollTop:c==="x"?window.scrollX:window.scrollY,U=()=>Y?c==="x"?Y.clientWidth:Y.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function X(){let s=Ke(de,Y,c),u=Ne(s,s.scroll,U(),G,ee);P=u.tStart,ne=u.tEnd;}function H(s){e.style.setProperty(Nt,String(s));for(let u of q)e.style.setProperty(u.prop,Ft(u.from,u.to,s));Ee?.(s);}function re(s){if(isNaN(be)){be=s;return}be<=0&&s>0?$?.():be>0&&s<=0&&b?.(),be<1&&s>=1?g?.():be>=1&&s<1&&E?.(),be=s;}function W(){if(!He||he)return;let s=performance.now(),u=le(),oe=d;if(I!==false){let O=s-ae,fe=O>0?Math.abs(u-(_e<0?u:_e))/O:0;oe=d*Math.max(.2,1+fe*(typeof I=="number"?I:1)*.04);}_e=u,ae=s;let k=ne===P?0:(u-P)/(ne-P);re(k);let D=F(ie(u,P,ne,oe));m&&(xe=Math.max(xe,D),D=xe),te=D,H(D),D>=1&&!ce?(ce=true,S?.()):D<1&&!m&&(ce=false),ye=requestAnimationFrame(W);}X(),ne===P&&j("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 s=F(ie(le(),P,ne,d));m&&s>0&&(xe=s),te=s,H(s);}let we=new IntersectionObserver(s=>{s.forEach(u=>{He=u.isIntersecting,He&&!he?ye=requestAnimationFrame(W):cancelAnimationFrame(ye);});},{root:Y??null}),C;function T(){clearTimeout(C),C=setTimeout(X,150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),we.observe(e),Me(e,{type:"animate",getProgress:()=>te,getTrigger:()=>({tStart:P,tEnd:ne})}),{destroy(){cancelAnimationFrame(ye),we.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(C),Le(),Pe(e);},replay(){xe=-1,ce=false,te=0,he=false,H(0);},pause(){he=true,cancelAnimationFrame(ye);},resume(){he&&(he=false,He&&(ye=requestAnimationFrame(W)));},seek(s){let u=Math.min(1,Math.max(0,s));te=u,xe=u,he=true,cancelAnimationFrame(ye),H(u);},getProgress(){return te}}}var et={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ir(e,r){if(typeof window>"u")return et;let t=typeof e=="string"?document.querySelector(e):e;return t?ct(t,r):(j("scrollAnimate: element not found:",e),et)}function ar(e,r={}){if(typeof window>"u")return et;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return j("scrollParallax: element not found:",e),et;let{speed:n=.3,axis:l="y",easing:a="linear",trigger:d,onProgress:m}=r,c=t.getBoundingClientRect(),f=l==="x"?c.width:c.height,x=n*f;return ct(t,{props:l==="x"?{transform:["translateX(0px)",`translateX(${-x}px)`]}:{transform:["translateY(0px)",`translateY(${-x}px)`]},trigger:d??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:m})}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function lr(e,r){if(typeof window>"u")return ut;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return j("scrollCounter: element not found:",e),ut;let n=t,{from:l=0,to:a,format:d,easing:m="ease-out",trigger:c={},once:f=true,decimals:x,onComplete:I}=r,A=x!==void 0?w=>w.toFixed(x):d??(w=>String(Math.round(w))),J=typeof m=="function"?m:K[m]??K["ease-out"],Ee=$e(c.start??"top 80%"),S=$e(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.textContent=A(a),I?.(),ut;let g=0,E=0,b=0,z=false,F=false,G=-1,ee=0,de=false,Y=()=>window.scrollY,q=()=>window.innerHeight;function ke(){let w=n.getBoundingClientRect(),P=Ne({top:w.top,height:w.height},Y(),q(),Ee,S);g=P.tStart,E=P.tEnd;}function N(w){n.textContent=A(l+(a-l)*w),n.style.setProperty("--scroll-draw-progress",String(w));}function ge(){if(!z||F)return;let w=J(ie(Y(),g,E,1));f&&(G=Math.max(G,w),w=G),ee=w,N(w),w>=1&&!de?(de=true,I?.()):w<1&&!f&&(de=false),b=requestAnimationFrame(ge);}ke();{let w=J(ie(Y(),g,E,1));f&&w>0&&(G=w),ee=w,N(w);}let Le=new IntersectionObserver(w=>{w.forEach(P=>{z=P.isIntersecting,z&&!F?b=requestAnimationFrame(ge):cancelAnimationFrame(b);});}),Ce;function De(){clearTimeout(Ce),Ce=setTimeout(ke,150);}return window.addEventListener("resize",De),window.addEventListener("orientationchange",De),Le.observe(n),Me(n,{type:"counter",getProgress:()=>ee,getTrigger:()=>({tStart:g,tEnd:E})}),{destroy(){cancelAnimationFrame(b),Le.disconnect(),window.removeEventListener("resize",De),window.removeEventListener("orientationchange",De),clearTimeout(Ce),Pe(n);},replay(){G=-1,de=false,ee=0,F=false,N(0);},pause(){F=true,cancelAnimationFrame(b);},resume(){F&&(F=false,z&&(b=requestAnimationFrame(ge)));},seek(w){let P=Math.min(1,Math.max(0,w));ee=P,G=P,F=true,cancelAnimationFrame(b),N(P);},getProgress(){return ee}}}var Ht="http://www.w3.org/2000/svg",cr="cinematic-photo",mt=e=>e<0?0:e>1?1:e;function tt(e){let r=parseFloat(e);return Number.isFinite(r)?mt(r/100):0}function ur(e){return K[e]??K.linear}var mr={destroy:()=>{},getProgress:()=>0},ft=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||j("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return mr;t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let l=[];for(let S of r.scenes){if(S.background){let g=document.createElement("img");g.id=cr,g.src=S.background,g.alt="",g.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(g);}let $=S.animations.filter(g=>g.type==="draw");if($.length){let g=document.createElementNS(Ht,"svg");g.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),g.setAttribute("preserveAspectRatio","xMidYMid meet"),g.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(g);for(let E of $){let b=document.createElementNS(Ht,"path");b.id=E.target.replace(/^#/,""),b.setAttribute("d",E.d),b.setAttribute("fill","none"),b.setAttribute("stroke",E.stroke),b.setAttribute("stroke-width",String(E.strokeWidth)),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round");let z=E.length||b.getTotalLength?.()||0;b.style.strokeDasharray=String(z),b.style.strokeDashoffset=String(z),g.appendChild(b),l.push({kind:"draw",el:b,start:tt(E.start),end:tt(E.end),ease:ur(E.easing),length:z});}}for(let g of S.animations){if(g.type!=="fade")continue;let E=n.querySelector(g.target)??document.querySelector(g.target);E&&(E.style.opacity=String(g.from),l.push({kind:"fade",el:E,start:tt(g.start),end:tt(g.end),ease:K["ease-in-out"]??K.linear,from:g.from,to:g.to}));}}let a=0,d=()=>{let S=t.offsetHeight-window.innerHeight;return S<=0?t.getBoundingClientRect().top<=0?1:0:mt(-t.getBoundingClientRect().top/S)},m=S=>{for(let $ of l){let g=$.end-$.start,E=g<=0?S>=$.end?1:0:mt((S-$.start)/g),b=$.ease(E);$.kind==="draw"?$.el.style.strokeDashoffset=String($.length*(1-b)):$.el.style.opacity=String($.from+($.to-$.from)*b);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let c=0,f=false,x=false,I=()=>{a=d(),m(a),f&&(c=requestAnimationFrame(I));},A=()=>{f||(f=true,c=requestAnimationFrame(I));},J=()=>{f=false,cancelAnimationFrame(c);},Ee=new IntersectionObserver(S=>{for(let $ of S)x=$.isIntersecting,x?A():J();},{threshold:0});return Ee.observe(n),a=d(),m(a),Me(t,{type:"draw",getProgress:()=>a,getTrigger:()=>{let S=t.getBoundingClientRect().top+window.scrollY;return {tStart:S,tEnd:S+Math.max(0,t.offsetHeight-window.innerHeight)}}}),{destroy(){J(),Ee.disconnect(),Pe(t);},getProgress:()=>a}}};
4
- exports.Cinematic=ft;exports.PRESETS=at;exports.createBounce=St;exports.createElastic=Et;exports.createSpring=Wt;exports.scrollAnimate=ir;exports.scrollCounter=lr;exports.scrollDraw=Jt;exports.scrollParallax=ar;
1
+ 'use strict';function Xt({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function At({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),i=Math.sqrt(n),a=0,m=[];for(let p=0;p<t;p++){let T=Math.pow(i,p);m.push(T),a+=T;}let f=[0],c=0;for(let p=0;p<t;p++)c+=m[p]/a,f.push(c);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<t;T++)if(p<=f[T+1]){let k=(p-f[T])/(f[T+1]-f[T]);if(T===0)return k*(2-k);let v=1-Math.pow(n,T);return v+(1-v)*(2*k-1)*(2*k-1)}return 1}}function Mt({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),i=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-i)*(2*Math.PI)/n)+1}var ne={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:At(),elastic:Mt()};function Pt(e,r,t){return Math.min(t,Math.max(r,e))}function Le(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}function $t(e,r,t,n){switch(n){case "top":return e+t;case "center":return e+t+r/2;case "bottom":return e+t+r;default:return e+t}}function Lt(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 ce(e,r,t,n){return t===r?0:Pt((e-r)/(t-r)*n,0,1)}function Oe(e,r,t,n,i){let a=$t(e.top,e.height,r,n.element)-Lt(n.viewport,t),m=$t(e.top,e.height,r,i.element)-Lt(i.viewport,t);return {tStart:a,tEnd:m}}function et(e,r,t){let n=e.getBoundingClientRect(),i=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left+r.scrollLeft:n.top-r.getBoundingClientRect().top+r.scrollTop,height:i,scroll:0}:{top:t==="x"?n.left:n.top,height:i,scroll:t==="x"?window.scrollX:window.scrollY}}function ze(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function kt(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function qe(e,r,t){let n=kt(e),i=kt(r);return !n||!i?e:`rgb(${Math.round(n[0]+(i[0]-n[0])*t)},${Math.round(n[1]+(i[1]-n[1])*t)},${Math.round(n[2]+(i[2]-n[2])*t)})`}var mt={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 Ge=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function U(e,...r){Ge&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var Qt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Zt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ct=33;function Kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Jt(e){let r=[];for(let t=0;t<Ct;t++){let n=t/(Ct-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function tt(e){switch(e){case "linear":return "linear";case "ease-in":return Qt;case "ease-out":return Zt;case "ease-in-out":return Kt()?Jt(ne["ease-in-out"]):null;default:return null}}var Dt=Symbol.for("svg-scroll-draw.registry");function It(){let e=globalThis;return e[Dt]||(e[Dt]=new Map)}function ke(e,r){It().set(e,r);}function Ce(e){It().delete(e);}var je,rt=new Set,nt=new WeakMap,Ye=new Map,Ot=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function er(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function We(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();je??(je=new ResizeObserver(i=>{let a=false;for(let{target:m}of i)nt.get(m)!==Ot(m)&&(a=true),nt.set(m,"");a&&rt.forEach(m=>m());})),rt.add(t);let n=er(e);return [document.body,document.documentElement].forEach(i=>i&&n.add(i)),n.forEach(i=>{nt.has(i)||nt.set(i,Ot(i)),Ye.set(i,(Ye.get(i)??0)+1),je.observe(i);}),()=>{rt.delete(t)&&(n.forEach(i=>{let a=(Ye.get(i)??1)-1;if(a)return void Ye.set(i,a);Ye.delete(i),je?.unobserve(i);}),rt.size||(je?.disconnect(),je=void 0));}}var tr=0;function rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Rt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var Ft=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function nr(e){if(!Ge)return;let r=Rt(e,"stroke");if(!r||r==="none"){U("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Ft.has(t)&&!Ft.has(Rt(e,"fill"))&&U("Element has a fill \u2014 it may obscure the stroke animation.",e);}function or(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.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 i(){let a=t==="x"?window.scrollX:window.scrollY,m=e-a,f=r-a,c=t==="x";n.innerHTML=`
2
+ <div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${m}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${f}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(n),window.addEventListener("scroll",i,{passive:true}),i(),{el:n,destroy(){window.removeEventListener("scroll",i),n.remove();}}}var Nt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Ht=/[MmLlHhVvCcSsQqTtAaZz]/g;function sr(e,r,t){if(!Ge)return;let n=(e.match(Ht)??[]).join("").toUpperCase(),i=(r.match(Ht)??[]).join("").toUpperCase(),a=(e.match(Nt)??[]).length,m=(r.match(Nt)??[]).length;if(n!==i){U(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}a!==m&&U(`morphTo: coordinate count differs (${a} \u2192 ${m}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function ft(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let m=parseFloat(a),f=n[i++]??m;return String(+(m+(f-m)*t).toFixed(4))})}function _t(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:t,...n}=r,i=t?{...mt[t],...n}:n,a=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:f=1,fade:c=false,easing:p="linear",trigger:T={},stagger:k=0,direction:v="forward",once:oe=false,debug:Te=false,axis:E="y",scrollContainer:A,autoReverse:g=false,delay:S=0,strokeColor:x,strokeWidth:I,fillOpacity:X,waypoints:q,velocityScale:se=false,threshold:ae=0,rootMargin:W="0px",repeat:O=0,repeatDelay:Re=0,morphTo:B,clip:de,autoplay:Ae=false,duration:Fe=1e3,native:Ne=true,onProgress:ue,onStart:Q,onComplete:d,onEnter:R,onLeave:He,onEnterBack:Ee,onLeaveBack:Me}=i,ie=de===true?"left":typeof de=="string"?de:false,ge=typeof p=="function"?p:ne[p]??ne.linear,Se=Le(T.start??"top bottom"),_e=Le(T.end??"bottom top"),me=typeof A=="string"?document.querySelector(A):A??null,fe=Array.isArray(x)?x[0]:null,Z=Array.isArray(x)?x[1]:typeof x=="string"?x:null,H=Array.isArray(I)?I[0]:null,G=Array.isArray(I)?I[1]:typeof I=="number"?I:null,j=Array.isArray(X)?X[0]:null,_=Array.isArray(X)?X[1]:typeof X=="number"?X:null;function Pe(o){let l=o*100;switch(ie){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let F=ie?[]:Array.from(e.querySelectorAll(m)),M=[],K=[],J=0,be=0,s=false,u=false,C=0,ee=false,$=-1,Y=[],we=-1,V=false,L=0,pe=0,ye,it=null;function ht(){it?.destroy(),it=null;}let De=new Set,bt=NaN,Ie=true,Ue=-1,wt=performance.now(),Ve=NaN;function at(){return me?E==="x"?me.scrollLeft:me.scrollTop:E==="x"?window.scrollX:window.scrollY}function vt(){return me?E==="x"?me.clientWidth:me.clientHeight:E==="x"?window.innerWidth:window.innerHeight}function Et(){let o=et(e,me,E);return Oe(o,o.scroll,vt(),Se,_e)}function St(){(({tStart:J,tEnd:be}=Et())),Te&&Ge&&(ht(),it=or(J,be,E));}function lt(o,l=Et){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let b=o.destroy;return o.destroy=()=>{b.call(o),Ce(e);},o}function Bt(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),ie){let b=l==="reverse"?1-o:o;e.style.clipPath=Pe(b);return}F.forEach((b,te)=>{b.style.strokeDashoffset=l==="reverse"?`${M[te]*o}`:`${M[te]*(1-o)}`,c&&(b.style.opacity=l==="reverse"?`${1-o}`:`${o}`),fe&&Z?b.style.stroke=qe(fe,Z,o):Z&&(b.style.stroke=Z),H!==null&&G!==null?b.style.strokeWidth=`${H+(G-H)*o}`:G!==null&&(b.style.strokeWidth=`${G}`),j!==null&&_!==null?b.style.fillOpacity=`${j+(_-j)*o}`:_!==null&&(b.style.fillOpacity=`${_}`),B&&b.tagName.toLowerCase()==="path"&&K[te]&&b.setAttribute("d",ft(K[te],B,o));});}function Xe(){if(e.style.setProperty("--scroll-draw-progress","0"),ie){e.style.clipPath=Pe(0);return}F.forEach((o,l)=>{o.style.strokeDasharray=`${M[l]}`,o.style.strokeDashoffset=v==="reverse"?"0":`${M[l]}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",fe&&(o.style.stroke=fe),H!==null&&(o.style.strokeWidth=`${H}`),j!==null&&(o.style.fillOpacity=`${j}`),B&&o.tagName.toLowerCase()==="path"&&K[l]&&o.setAttribute("d",K[l]);});}if(F.forEach(o=>{nr(o);let l=ze(o);M.push(l);let b=o.tagName.toLowerCase()==="path";b?K.push(o.getAttribute("d")??""):K.push(""),B&&(b?sr(K[K.length-1],B,o):U(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),a?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=v==="reverse"?`${l}`:"0",c&&(o.style.opacity="1"),Z&&(o.style.stroke=Z),G!==null&&(o.style.strokeWidth=`${G}`),_!==null&&(o.style.fillOpacity=`${_}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=v==="reverse"?"0":`${l}`,c?o.style.opacity=v==="reverse"?"1":"0":o.style.opacity="",fe&&(o.style.stroke=fe),H!==null&&(o.style.strokeWidth=`${H}`),j!==null&&(o.style.fillOpacity=`${j}`));}),ie){if(a)return e.style.clipPath=Pe(1),d?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Pe(0);}else if(a)return d?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let xt=typeof p=="string"?tt(p):null;function Gt(){return !(Ne===false||!rr()||!F.length||!xt||ie||E!=="y"||me||f!==1||k!==0||oe||g||se!==false||B||q||O||S>0||ue||Q||d||R||He||Ee||Me||x!=null||I!=null||X!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function jt(){let o=++tr,l=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,te=`--svg-scroll-draw-${o}`,$e=v==="reverse"?"0":"var(--ssd-len)",xe=v==="reverse"?"var(--ssd-len)":"0",ve=`stroke-dashoffset:${$e};`,w=`stroke-dashoffset:${xe};`;c&&(ve+=`opacity:${v==="reverse"?1:0};`,w+=`opacity:${v==="reverse"?0:1};`);let P=document.createElement("style");P.setAttribute("data-svg-scroll-draw",""),P.textContent=`@keyframes ${l}{from{${ve}}to{${w}}}.${b}{view-timeline-name:${te};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${xt};animation-fill-mode:both;animation-timeline:${te};animation-range:cover 0% cover 100%;}`,document.head.appendChild(P),e.classList.add(b);function re(y,z){y.style.setProperty("--ssd-len",String(M[z])),y.style.strokeDasharray=`${M[z]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l);}F.forEach(re);let h=false,D=-1;function N(){if(D>=0)return D;let y=e.getBoundingClientRect(),{tStart:z,tEnd:he}=Oe({top:y.top,height:y.height},at(),vt(),Se,_e);return ge(ce(at(),z,he,f))}return {destroy(){e.classList.remove(b),F.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),P.remove();},replay(){h=false,D=-1,F.forEach(re);},pause(){h=true,F.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,F.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let z=Math.min(1,Math.max(0,y));D=z,h=true,F.forEach((he,le)=>{he.classList.remove(l),he.style.strokeDashoffset=v==="reverse"?`${M[le]*z}`:`${M[le]*(1-z)}`,c&&(he.style.opacity=v==="reverse"?`${1-z}`:`${z}`);});},getProgress(){return N()},refresh(){F.forEach((y,z)=>{M[z]=ze(y),y.style.setProperty("--ssd-len",String(M[z])),y.style.strokeDasharray=`${M[z]}`;});}}}if(Gt())return lt(jt());function Yt(){let o=Math.max(1,Fe),l=0,b=0,te=false;function $e(h){let D=true;if(ie){let N=Math.min(1,Math.max(0,h/o)),y=ge(N);L=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Pe(v==="reverse"?1-y:y),ue?.(y),N<1&&(D=false);}else F.forEach((N,y)=>{let z=y*k*o,he=Math.min(1,Math.max(0,(h-z)/o)),le=ge(he);N.style.strokeDashoffset=v==="reverse"?`${M[y]*le}`:`${M[y]*(1-le)}`,c&&(N.style.opacity=v==="reverse"?`${1-le}`:`${le}`),fe&&Z?N.style.stroke=qe(fe,Z,le):Z&&(N.style.stroke=Z),H!==null&&G!==null?N.style.strokeWidth=`${H+(G-H)*le}`:G!==null&&(N.style.strokeWidth=`${G}`),j!==null&&_!==null?N.style.fillOpacity=`${j+(_-j)*le}`:_!==null&&(N.style.fillOpacity=`${_}`),B&&N.tagName.toLowerCase()==="path"&&K[y]&&N.setAttribute("d",ft(K[y],B,le)),y===0&&(L=le,ue?.(le),e.style.setProperty("--scroll-draw-progress",String(le))),he<1&&(D=false);});if(q){let N=Math.min(1,Math.max(0,h/o)),y=ge(N);for(let z in q){let he=parseFloat(z);y>=he&&!De.has(he)&&(De.add(he),q[z]?.());}}return D}function xe(h){if(V)return;let D=h-l;u||(u=true,Q?.());let N=$e(D);if(N&&!s){s=true,$e(o*(1+Math.max(0,F.length-1)*k)),d?.(),pe<(O==="infinite"?1/0:O??0)&&(pe++,ye=setTimeout(()=>{l=performance.now(),u=false,s=false,De.clear(),Xe(),C=requestAnimationFrame(xe);},Re));return}N||(C=requestAnimationFrame(xe));}function ve(){cancelAnimationFrame(C),clearTimeout(ye),l=performance.now(),b=0,V=false,u=false,s=false,pe=0,te=true,L=0,De.clear(),Xe(),C=requestAnimationFrame(xe);}let w=new IntersectionObserver(h=>{h.forEach(D=>{D.isIntersecting&&!(oe&&s)?ve():!D.isIntersecting&&!oe&&!s&&(cancelAnimationFrame(C),clearTimeout(ye),te=false);});},{root:me??null,threshold:ae,rootMargin:W}),P;function re(){clearTimeout(P),P=setTimeout(()=>{F.forEach((h,D)=>{M[D]=ze(h),h.style.strokeDasharray=`${M[D]}`;});},150);}return window.addEventListener("resize",re),window.addEventListener("orientationchange",re),S>0?setTimeout(()=>w.observe(e),S):w.observe(e),{destroy(){cancelAnimationFrame(C),clearTimeout(ye),w.disconnect(),window.removeEventListener("resize",re),window.removeEventListener("orientationchange",re),clearTimeout(P);},replay(){pe=0,ve();},pause(){V||!te||(V=true,b=performance.now()-l,cancelAnimationFrame(C));},resume(){V&&(V=false,te=true,l=performance.now()-b,C=requestAnimationFrame(xe));},seek(h){let D=Math.min(1,Math.max(0,h));L=D,V=true,b=D*o,l=performance.now()-b,cancelAnimationFrame(C),$e(b);},getProgress(){return L},refresh(){clearTimeout(P),F.forEach((h,D)=>{M[D]=ze(h),h.style.strokeDasharray=`${M[D]}`;});}}}if(Ae)return lt(Yt());St();function Qe(){if(!ee||V)return;let o=performance.now(),l=at();if(!Ie&&se===false&&l===bt){C=requestAnimationFrame(Qe);return}Ie=false,bt=l;let b=f;if(se!==false){let w=o-wt,P=w>0?Math.abs(l-(Ue<0?l:Ue))/w:0;b=f*Math.max(.2,1+P*(typeof se=="number"?se:1)*.04);}Ue=l,wt=o;let te=g?we===-1||l>=we?"forward":"reverse":v;we=l;let $e=be-J,xe=true,ve=$e===0?0:(l-J)/$e;if(isNaN(Ve)||(Ve<=0&&ve>0?R?.():Ve>0&&ve<=0&&Me?.(),Ve<1&&ve>=1?He?.():Ve>=1&&ve<1&&Ee?.()),Ve=ve,ie){let w=ge(ce(l,J,be,b));oe&&!g&&($=Math.max($,w),w=$),L=w,e.style.setProperty("--scroll-draw-progress",String(w));let P=te==="reverse"?1-w:w;e.style.clipPath=Pe(P),ue?.(w),!u&&ce(l,J,be,b)>0&&(u=true,Q?.()),w>=1&&!s?(s=true,d?.(),pe<(O==="infinite"?1/0:O??0)&&(pe++,ye=setTimeout(()=>{$=-1,u=false,s=false,e.style.clipPath=Pe(0);},Re))):w<1&&!oe&&(s=false),C=requestAnimationFrame(Qe);return}if(F.forEach((w,P)=>{let re=P*k*$e,h=ge(ce(l,J+re,be+re,b));oe&&!g&&(h=Y[P]=Math.max(Y[P]??$,h)),w.style.strokeDashoffset=te==="reverse"?`${M[P]*h}`:`${M[P]*(1-h)}`,c&&(w.style.opacity=te==="reverse"?`${1-h}`:`${h}`),fe&&Z?w.style.stroke=qe(fe,Z,h):Z&&(w.style.stroke=Z),H!==null&&G!==null?w.style.strokeWidth=`${H+(G-H)*h}`:G!==null&&(w.style.strokeWidth=`${G}`),j!==null&&_!==null?w.style.fillOpacity=`${j+(_-j)*h}`:_!==null&&(w.style.fillOpacity=`${_}`),B&&w.tagName.toLowerCase()==="path"&&K[P]&&w.setAttribute("d",ft(K[P],B,h)),P===0&&(L=h,ue?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(xe=false);}),q){let w=ge(ce(l,J,be,b));for(let P in q){let re=parseFloat(P);w>=re&&!De.has(re)&&(De.add(re),q[P]?.());}}!u&&ce(l,J,be,b)>0&&(u=true,Q?.()),xe&&!s?(s=true,d?.(),pe<(O==="infinite"?1/0:O??0)&&(pe++,ye=setTimeout(()=>{$=-1,Y=[],u=false,s=false,De.clear(),Xe(),Ie=true;},Re))):!xe&&!oe&&(s=false),C=requestAnimationFrame(Qe);}let ct=false;function Ze(){ct||(ct=true,C=requestAnimationFrame(function(){Qe();}));}function Ke(){ct=false,cancelAnimationFrame(C);}let ut=new IntersectionObserver(o=>{o.forEach(l=>{ee=l.isIntersecting,ee&&!V?(Ie=true,Ze()):Ke();});},{root:me??null,threshold:ae,rootMargin:W});function Tt(){F.forEach((o,l)=>{M[l]=ze(o),o.style.strokeDasharray=`${M[l]}`;}),St(),Ie=true;}let Je;function Be(){clearTimeout(Je),Je=setTimeout(Tt,150);}window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be);let Ut=We([e],Be);return S>0?setTimeout(()=>ut.observe(e),S):ut.observe(e),lt({destroy(){cancelAnimationFrame(C),clearTimeout(ye),Ke(),ut.disconnect(),Ut(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Je),ht();},replay(){$=-1,Y=[],we=-1,Ue=-1,u=false,s=false,pe=0,V=false,L=0,De.clear(),clearTimeout(ye),Xe(),Ie=true,ee&&Ze();},pause(){V=true,Ke();},resume(){V&&(V=false,Ie=true,ee&&Ze());},seek(o){let l=Math.min(1,Math.max(0,o));L=l,$=l,Y=[],V=true,Ke(),Bt(l,v),Ie=true;},getProgress(){return L},refresh(){clearTimeout(Je),Tt(),ee&&!V&&Ze();}},()=>({tStart:J,tEnd:be}))}function ir(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?_t(n,r):(U("Container not found:",e),t)}function ar(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Vt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let i=[],a=[],m=n[2].trim();if(m)for(let f of m.split(/[\s,]+/)){let c=f.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(c?parseFloat(c[1]):0),a.push(c?c[2]:"");}r.push({fn:n[1],nums:i,units:a});}return r}function lr(e,r,t){let n=Vt(e),i=Vt(r);return n.length===0||n.length!==i.length?t<1?e:r:n.map((a,m)=>{let f=i[m];return a.fn!==f.fn||a.nums.length!==f.nums.length?t<1?`${a.fn}(${a.nums.map((c,p)=>`${c}${a.units[p]}`).join(", ")})`:`${f.fn}(${f.nums.map((c,p)=>`${c}${f.units[p]}`).join(", ")})`:`${a.fn}(${a.nums.map((c,p)=>`${c+(f.nums[p]-c)*t}${a.units[p]}`).join(", ")})`}).join(" ")}function zt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),i=String(r);if(ar(n))return qe(n,i,t);if(n.includes("("))return lr(n,i,t);let a=n.match(/^([-+]?[\d.]+)(.*)$/),m=i.match(/^([-+]?[\d.]+)(.*)$/);if(a&&m){let f=parseFloat(a[1]),c=parseFloat(m[1]);return `${f+(c-f)*t}${a[2]||m[2]}`}return t<1?n:i}function cr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var ur=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),mr=0,qt="--scroll-draw-progress";function fr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function pt(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let{props:n,trigger:i={},easing:a="ease-out",speed:m=1,once:f=false,axis:c="y",scrollContainer:p,native:T=true,velocityScale:k=false,respectReducedMotion:v=true,triggerElement:oe,onProgress:Te,onComplete:E,onEnter:A,onLeave:g,onEnterBack:S,onLeaveBack:x}=r,I=v&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,X=typeof a=="function"?a:ne[a]??ne["ease-out"],q=Le(i.start??"top bottom"),se=Le(i.end??"bottom top"),ae=oe??e,W=typeof p=="string"?document.querySelector(p):p??null,O=Object.entries(n).map(([s,u])=>({prop:cr(s),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function Re(){let s=window.getComputedStyle(e);for(let u of O)u.from===""&&(u.from=s.getPropertyValue(u.prop).trim()||"0");}function B(){for(let s of O)e.style.setProperty(s.prop,String(s.to));}let de=new Map;for(let s of [...O.map(u=>u.prop),qt])de.set(s,e.style.getPropertyValue(s));function Ae(){for(let[s,u]of de)u?e.style.setProperty(s,u):e.style.removeProperty(s);}if(I)return B(),E?.(),{...t,destroy:Ae,getProgress:()=>1};Re();let Fe=typeof a=="string"?tt(a):null;function Ne(){if(!T||!fr()||!Fe||c!=="y"||W||ae!==e||f||m!==1||Te||E||A||g||S||x||k!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let s of O)if(!ur.has(s.prop))return false;return true}function ue(){let s=`ssd-a-${++mr}`,u=O.map(L=>`${L.prop}:${L.from}`).join(";"),C=O.map(L=>`${L.prop}:${L.to}`).join(";"),ee=document.createElement("style");ee.setAttribute("data-ssd-animate",""),ee.textContent=`@keyframes ${s}{from{${u}}to{${C}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${Fe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ee),e.classList.add(s);let $=()=>c==="x"?window.scrollX:window.scrollY,Y=()=>c==="x"?window.innerWidth:window.innerHeight,we=()=>{let L=e.getBoundingClientRect();return Oe({top:L.top,height:L.height},$(),Y(),q,se)};ke(e,{type:"animate",getProgress:()=>V.getProgress(),getTrigger:we});let V={refresh(){},destroy(){e.classList.remove(s),ee.remove(),e.style.animationPlayState="",Ae(),Ce(e);},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(L){let pe=Math.min(1,Math.max(0,L));e.classList.remove(s);for(let ye of O)e.style.setProperty(ye.prop,zt(ye.from,ye.to,pe));},getProgress(){let{tStart:L,tEnd:pe}=we();return X(ce($(),L,pe,m))}};return V}if(Ne())return ue();let Q=0,d=0,R=0,He=false,Ee=false,Me=-1,ie=0,ge=false,Se=NaN,_e=-1,me=0,fe=()=>W?c==="x"?W.scrollLeft:W.scrollTop:c==="x"?window.scrollX:window.scrollY,Z=()=>W?c==="x"?W.clientWidth:W.clientHeight:c==="x"?window.innerWidth:window.innerHeight,H=ae===e?O:[],G=false;function j(){let s=e.style,u=H.map(Y=>s.getPropertyValue(Y.prop)),C=s.transition;H.length&&(s.transition="none"),H.forEach(Y=>s.setProperty(Y.prop,de.get(Y.prop)??""));let ee=et(ae,W,c);H.forEach((Y,we)=>s.setProperty(Y.prop,u[we])),H.length&&(e.offsetWidth,s.transition=C);let $=Oe(ee,ee.scroll,Z(),q,se);G&&Math.abs($.tStart-Q)<1&&Math.abs($.tEnd-d)<1||(G=true,Q=$.tStart,d=$.tEnd);}function _(s){e.style.setProperty(qt,String(s));for(let u of O)e.style.setProperty(u.prop,zt(u.from,u.to,s));Te?.(s);}function Pe(s){if(isNaN(Se)){Se=s;return}Se<=0&&s>0?A?.():Se>0&&s<=0&&x?.(),Se<1&&s>=1?g?.():Se>=1&&s<1&&S?.(),Se=s;}function F(){if(!He||Ee)return;let s=performance.now(),u=fe(),C=m;if(k!==false){let Y=s-me,we=Y>0?Math.abs(u-(_e<0?u:_e))/Y:0;C=m*Math.max(.2,1+we*(typeof k=="number"?k:1)*.04);}_e=u,me=s;let ee=d===Q?0:(u-Q)/(d-Q);Pe(ee);let $=X(ce(u,Q,d,C));f&&(Me=Math.max(Me,$),$=Me),ie=$,_($),$>=1&&!ge?(ge=true,E?.()):$<1&&!f&&(ge=false),R=requestAnimationFrame(F);}j(),d===Q&&U("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 s=X(ce(fe(),Q,d,m));f&&s>0&&(Me=s),ie=s,_(s);}let M=new IntersectionObserver(s=>{s.forEach(u=>{He=u.isIntersecting,He&&!Ee?R=requestAnimationFrame(F):cancelAnimationFrame(R);});},{root:W??null}),K;function J(){clearTimeout(K),K=setTimeout(j,150);}window.addEventListener("resize",J),window.addEventListener("orientationchange",J);let be=We([ae],J);return M.observe(e),ke(e,{type:"animate",getProgress:()=>ie,getTrigger:()=>({tStart:Q,tEnd:d})}),{destroy(){cancelAnimationFrame(R),M.disconnect(),window.removeEventListener("resize",J),window.removeEventListener("orientationchange",J),be(),clearTimeout(K),Ae(),Ce(e);},replay(){Me=-1,ge=false,ie=0,Ee=false,_(0);},pause(){Ee=true,cancelAnimationFrame(R);},resume(){Ee&&(Ee=false,He&&(R=requestAnimationFrame(F)));},seek(s){let u=Math.min(1,Math.max(0,s));ie=u,Me=u,Ee=true,cancelAnimationFrame(R),_(u);},getProgress(){return ie},refresh(){j();}}}var ot={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pr(e,r){if(typeof window>"u")return ot;let t=typeof e=="string"?document.querySelector(e):e;return t?pt(t,r):(U("scrollAnimate: element not found:",e),ot)}function dr(e,r={}){if(typeof window>"u")return ot;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return U("scrollParallax: element not found:",e),ot;let{speed:n=.3,axis:i="y",easing:a="linear",trigger:m,onProgress:f}=r,c=-n*100,p=t.style,T=!!t.ownerSVGElement,k=p.getPropertyValue("transform-box");T&&p.setProperty("transform-box","fill-box");let v=pt(t,{props:i==="x"?{transform:["translateX(0%)",`translateX(${c}%)`]}:{transform:["translateY(0%)",`translateY(${c}%)`]},trigger:m??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:f});return T?{...v,destroy(){v.destroy(),p.setProperty("transform-box",k);}}:v}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gr(e,r){if(typeof window>"u")return dt;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return U("scrollCounter: element not found:",e),dt;let n=t,{from:i=0,to:a,format:m,easing:f="ease-out",trigger:c={},once:p=true,decimals:T,onComplete:k}=r,v=T!==void 0?d=>d.toFixed(T):m??(d=>String(Math.round(d))),oe=typeof f=="function"?f:ne[f]??ne["ease-out"],Te=Le(c.start??"top 80%"),E=Le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.textContent=v(a),k?.(),dt;let g=0,S=0,x=false,I=0,X=false,q=false,se=-1,ae=0,W=false,O=()=>window.scrollY,Re=()=>window.innerHeight;function B(){let d=n.getBoundingClientRect(),R=Oe({top:d.top,height:d.height},O(),Re(),Te,E);x&&Math.abs(R.tStart-g)<1&&Math.abs(R.tEnd-S)<1||(x=true,g=R.tStart,S=R.tEnd);}function de(d){n.textContent=v(i+(a-i)*d),n.style.setProperty("--scroll-draw-progress",String(d));}function Ae(){if(!X||q)return;let d=oe(ce(O(),g,S,1));p&&(se=Math.max(se,d),d=se),ae=d,de(d),d>=1&&!W?(W=true,k?.()):d<1&&!p&&(W=false),I=requestAnimationFrame(Ae);}B();{let d=oe(ce(O(),g,S,1));p&&d>0&&(se=d),ae=d,de(d);}let Fe=new IntersectionObserver(d=>{d.forEach(R=>{X=R.isIntersecting,X&&!q?I=requestAnimationFrame(Ae):cancelAnimationFrame(I);});}),Ne;function ue(){clearTimeout(Ne),Ne=setTimeout(B,150);}window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue);let Q=We([n],ue);return Fe.observe(n),ke(n,{type:"counter",getProgress:()=>ae,getTrigger:()=>({tStart:g,tEnd:S})}),{destroy(){cancelAnimationFrame(I),Fe.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),Q(),clearTimeout(Ne),Ce(n);},replay(){se=-1,W=false,ae=0,q=false,de(0);},pause(){q=true,cancelAnimationFrame(I);},resume(){q&&(q=false,X&&(I=requestAnimationFrame(Ae)));},seek(d){let R=Math.min(1,Math.max(0,d));ae=R,se=R,q=true,cancelAnimationFrame(I),de(R);},getProgress(){return ae}}}var Wt="http://www.w3.org/2000/svg",yr="cinematic-photo",gt=e=>e<0?0:e>1?1:e;function st(e){let r=parseFloat(e);return Number.isFinite(r)?gt(r/100):0}function hr(e){return ne[e]??ne.linear}var br={destroy:()=>{},getProgress:()=>0},yt=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||U("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return br;t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let i=[];for(let E of r.scenes){if(E.background){let g=document.createElement("img");g.id=yr,g.src=E.background,g.alt="",g.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(g);}let A=E.animations.filter(g=>g.type==="draw");if(A.length){let g=document.createElementNS(Wt,"svg");g.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),g.setAttribute("preserveAspectRatio","xMidYMid meet"),g.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(g);for(let S of A){let x=document.createElementNS(Wt,"path");x.id=S.target.replace(/^#/,""),x.setAttribute("d",S.d),x.setAttribute("fill","none"),x.setAttribute("stroke",S.stroke),x.setAttribute("stroke-width",String(S.strokeWidth)),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round");let I=S.length||x.getTotalLength?.()||0;x.style.strokeDasharray=String(I),x.style.strokeDashoffset=String(I),g.appendChild(x),i.push({kind:"draw",el:x,start:st(S.start),end:st(S.end),ease:hr(S.easing),length:I});}}for(let g of E.animations){if(g.type!=="fade")continue;let S=n.querySelector(g.target)??document.querySelector(g.target);S&&(S.style.opacity=String(g.from),i.push({kind:"fade",el:S,start:st(g.start),end:st(g.end),ease:ne["ease-in-out"]??ne.linear,from:g.from,to:g.to}));}}let a=0,m=()=>{let E=t.offsetHeight-window.innerHeight;return E<=0?t.getBoundingClientRect().top<=0?1:0:gt(-t.getBoundingClientRect().top/E)},f=E=>{for(let A of i){let g=A.end-A.start,S=g<=0?E>=A.end?1:0:gt((E-A.start)/g),x=A.ease(S);A.kind==="draw"?A.el.style.strokeDashoffset=String(A.length*(1-x)):A.el.style.opacity=String(A.from+(A.to-A.from)*x);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return f(1),{destroy:()=>{},getProgress:()=>1};let c=0,p=false,T=false,k=()=>{a=m(),f(a),p&&(c=requestAnimationFrame(k));},v=()=>{p||(p=true,c=requestAnimationFrame(k));},oe=()=>{p=false,cancelAnimationFrame(c);},Te=new IntersectionObserver(E=>{for(let A of E)T=A.isIntersecting,T?v():oe();},{threshold:0});return Te.observe(n),a=m(),f(a),ke(t,{type:"draw",getProgress:()=>a,getTrigger:()=>{let E=t.getBoundingClientRect().top+window.scrollY;return {tStart:E,tEnd:E+Math.max(0,t.offsetHeight-window.innerHeight)}}}),{destroy(){oe(),Te.disconnect(),Ce(t);},getProgress:()=>a}}};
4
+ exports.Cinematic=yt;exports.PRESETS=mt;exports.createBounce=At;exports.createElastic=Mt;exports.createSpring=Xt;exports.scrollAnimate=pr;exports.scrollCounter=gr;exports.scrollDraw=ir;exports.scrollParallax=dr;