svg-scroll-draw 2.18.0 → 2.19.1
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.
- package/README.md +11 -11
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.d.mts +3 -3
- package/dist/angular/index.d.ts +3 -3
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +3 -3
- package/dist/astro/index.d.mts +6 -5
- package/dist/astro/index.d.ts +6 -5
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +161 -37
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/{chunk-DIMNQPW5.mjs → chunk-6SSA5V7J.mjs} +1 -1
- package/dist/chunk-7SBTYJGH.mjs +1 -0
- package/dist/chunk-A4JCC3QQ.mjs +1 -0
- package/dist/chunk-BFX2CSQ3.mjs +1 -0
- package/dist/chunk-I45LCJUP.mjs +1 -0
- package/dist/chunk-KHQ7OGQK.mjs +1 -0
- package/dist/chunk-LQBXJRFY.mjs +3 -0
- package/dist/chunk-MTEGM4RR.mjs +1 -0
- package/dist/chunk-VVFGB4RT.mjs +1 -0
- package/dist/{engine-6AXEX8CL.d.ts → engine-DQyBzZDl.d.ts} +1 -1
- package/dist/{engine-Ci08nM91.d.mts → engine-P8u6OK4m.d.mts} +1 -1
- package/dist/group/index.cjs +3 -3
- package/dist/group/index.d.mts +3 -3
- package/dist/group/index.d.ts +3 -3
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +10 -3
- package/dist/horizontal/index.d.ts +10 -3
- package/dist/horizontal/index.mjs +1 -1
- package/dist/{index-CGR7pSOR.d.mts → index-CMqK0GCT.d.mts} +2 -2
- package/dist/{index-BDGQEK6X.d.mts → index-CdaBYn3A.d.mts} +1 -1
- package/dist/{index-DxjUOIbK.d.ts → index-D3o4vT3e.d.ts} +1 -1
- package/dist/{index-BVuNgQSd.d.ts → index-DPqPEnO-.d.ts} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.mts +3 -3
- package/dist/nuxt/index.d.ts +3 -3
- package/dist/nuxt/index.mjs +1 -1
- package/dist/pin/index.cjs +1 -1
- package/dist/pin/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.d.mts +1 -1
- package/dist/progress/index.d.ts +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +16 -13
- package/dist/react/index.d.ts +16 -13
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +1 -1
- package/dist/reveal/index.d.ts +1 -1
- package/dist/reveal/index.mjs +1 -1
- package/dist/{scroll-draw-CNlq4Z_L.d.mts → scroll-draw-Dej-GIRP.d.mts} +1 -1
- package/dist/{scroll-draw-BlJfbTDv.d.ts → scroll-draw-DsBMkwrX.d.ts} +1 -1
- package/dist/snap/index.d.mts +1 -1
- package/dist/snap/index.d.ts +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.d.mts +3 -3
- package/dist/solid/index.d.ts +3 -3
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +2 -2
- package/dist/svelte/index.d.mts +3 -3
- package/dist/svelte/index.d.ts +3 -3
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.d.mts +1 -1
- package/dist/text/index.d.ts +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +11 -11
- package/dist/timeline/index.d.mts +1 -1
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.mjs +4 -4
- package/dist/{types-DHU1zNEw.d.mts → types-MswK0erX.d.mts} +12 -1
- package/dist/{types-DHU1zNEw.d.ts → types-MswK0erX.d.ts} +12 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.mts +1 -1
- package/dist/video/index.d.ts +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.d.mts +5 -83
- package/dist/vue/index.d.ts +5 -83
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-4MH5SQTH.mjs +0 -1
- package/dist/chunk-CTVQDBD3.mjs +0 -1
- package/dist/chunk-KBFWDHF4.mjs +0 -1
- package/dist/chunk-LINFV2GK.mjs +0 -3
- package/dist/chunk-PEFR3ZB7.mjs +0 -1
- package/dist/chunk-QJ4H2HW3.mjs +0 -1
- package/dist/chunk-SNCRC6BA.mjs +0 -1
- package/dist/chunk-TIRZOSQ4.mjs +0 -1
package/dist/timeline/index.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function ke({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),i=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(i),a=0,f=[];for(let l=0;l<n;l++){let p=Math.pow(o,l);f.push(p),a+=p;}let b=[0],v=0;for(let l=0;l<n;l++)v+=f[l]/a,b.push(v);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let p=0;p<n;p++)if(l<=b[p+1]){let g=(l-b[p])/(b[p+1]-b[p]);if(p===0)return g*(2-g);let L=1-Math.pow(i,p);return L+(1-L)*(2*g-1)*(2*g-1)}return 1}}function Fe({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),i=Math.max(.1,t),o=n<=1?i/4:i/(2*Math.PI)*Math.asin(1/n);return a=>a<=0?0:a>=1?1:n*Math.pow(2,-10*a)*Math.sin((a-o)*(2*Math.PI)/i)+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:Fe()};function ae(e,t,n){return Math.min(n,Math.max(t,e))}function Y(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",i="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:i}}function ue(e,t,n,i){switch(i){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function ce(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 le(e,t,n,i){return n===t?0:ae((e-t)/(n-t)*i,0,1)}function de(e,t,n,i,o){let a=ue(e.top,e.height,t,i.element)-ce(i.viewport,n),f=ue(e.top,e.height,t,o.element)-ce(o.viewport,n);return {tStart:a,tEnd:f}}function Z(e){let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),i=parseFloat(e.getAttribute("height")??"0");return 2*(n+i)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function me(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function pe(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let i=t;return i.addListener?.(n),()=>i.removeListener?.(n)}var Oe=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,...t){Oe&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var be=Symbol.for("svg-scroll-draw.registry");function ge(){let e=globalThis;return e[be]||(e[be]=new Map)}function he(e,t){ge().set(e,t);}function ye(e){ge().delete(e);}var I,V=new Set,C=new WeakMap,A=new Map,we=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Pe(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let i=n;i;i=i.previousElementSibling)t.add(i);return t}function ve(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();I??(I=new ResizeObserver(o=>{let a=false;for(let{target:f}of o)C.get(f)!==we(f)&&(a=true),C.set(f,"");a&&V.forEach(f=>f());})),V.add(n);let i=Pe(e);return [document.body,document.documentElement].forEach(o=>o&&i.add(o)),i.forEach(o=>{C.has(o)||C.set(o,we(o)),A.set(o,(A.get(o)??0)+1),I.observe(o);}),()=>{V.delete(n)&&(i.forEach(o=>{let a=(A.get(o)??1)-1;if(a)return void A.set(o,a);A.delete(o),I?.unobserve(o);}),V.size||(I?.disconnect(),I=void 0));}}var xe=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function tt(e,t){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let i=typeof e=="string"?document.querySelector(e):e;if(!i)return fe("timeline: Container not found:",e),n;let o=i,{trigger:a={},speed:f=1,once:b=false,axis:v="y",tracks:l,onComplete:p,repeat:g,repeatDelay:L=0,loop:G=false,loopDuration:Ee=1500,debug:Me=false,label:Le,respectReducedMotion:ee=true}=t,Te=Y(a.start??"top bottom"),Se=Y(a.end??"bottom top"),$=g==="infinite"?1/0:g??0,d,Q=G===true?1/0:typeof G=="number"?G:0,h=false,W=0,T=Q,q=ee&&me(),Re=pe(r=>{q=ee&&r,q&&(h=false,clearTimeout(d),d=void 0);}),N=()=>Q>0&&!q,B=new Map,j=l.map(r=>{let u=typeof r.easing=="function"?r.easing:J[r.easing??"linear"]??J.linear,m=Array.from(o.querySelectorAll(r.selector)),c=m.map(s=>Z(s));return m.forEach((s,y)=>{B.has(s)||B.set(s,s.getAttribute("style")??""),s.style.strokeDasharray=`${c[y]}`,s.style.strokeDashoffset=`${c[y]}`,r.fade&&(s.style.opacity="0");}),{...r,elements:m,lengths:c,easeFn:u}});function De(){for(let[r,u]of B)u?r.setAttribute("style",u):r.removeAttribute("style");}let H=0,K=0,k=false,x=false,E=0,R=false,D=-1,M=0,w=null;Me&&(w=document.createElement("div"),Object.assign(w.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(w));function _e(r){if(!w)return;let u=Le??(typeof e=="string"?e:"timeline"),m=l.map(({selector:c,from:s,to:y},X)=>{let S=xe[X%xe.length],P=y>s?Math.min(1,Math.max(0,(r-s)/(y-s))):0,z=Math.round(P*100);return `<div style="margin:4px 0">
|
|
2
2
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
|
|
3
|
-
<span style="color:${S};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${
|
|
4
|
-
<span style="color:#666;margin-left:8px">${
|
|
3
|
+
<span style="color:${S};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${c}</span>
|
|
4
|
+
<span style="color:#666;margin-left:8px">${z}%</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div style="height:3px;background:#2a2a2a;border-radius:2px;position:relative;overflow:hidden">
|
|
7
|
-
<div style="position:absolute;left:${
|
|
8
|
-
<div style="position:absolute;left:${
|
|
7
|
+
<div style="position:absolute;left:${s*100}%;width:${(y-s)*100}%;height:100%;background:${S}33;border-radius:2px"></div>
|
|
8
|
+
<div style="position:absolute;left:${s*100}%;width:${(y-s)*P*100}%;height:100%;background:${S};border-radius:2px;transition:width 0.05s linear"></div>
|
|
9
9
|
</div>
|
|
10
|
-
</div>`}).join("");
|
|
10
|
+
</div>`}).join("");w.innerHTML=`
|
|
11
11
|
<div style="color:#555;margin-bottom:8px;font-size:10px;text-transform:uppercase;letter-spacing:0.12em;border-bottom:1px solid rgba(255,255,255,0.06);padding-bottom:6px">
|
|
12
|
-
scrollDrawTimeline \xB7 ${
|
|
12
|
+
scrollDrawTimeline \xB7 ${u}
|
|
13
13
|
</div>
|
|
14
|
-
${
|
|
14
|
+
${m}
|
|
15
15
|
<div style="margin-top:6px;padding-top:6px;border-top:1px solid rgba(255,255,255,0.06)">
|
|
16
16
|
<div style="display:flex;justify-content:space-between;margin-bottom:2px">
|
|
17
17
|
<span style="color:#555">scroll</span>
|
|
18
|
-
<span style="color:#666">${Math.round(
|
|
18
|
+
<span style="color:#666">${Math.round(r*100)}%</span>
|
|
19
19
|
</div>
|
|
20
20
|
<div style="height:2px;background:#2a2a2a;border-radius:1px;overflow:hidden">
|
|
21
|
-
<div style="height:100%;background:#fff;border-radius:1px;width:${
|
|
21
|
+
<div style="height:100%;background:#fff;border-radius:1px;width:${r*100}%;transition:width 0.05s linear"></div>
|
|
22
22
|
</div>
|
|
23
|
-
</div>`;}function
|
|
23
|
+
</div>`;}function te(){return v==="x"?window.scrollX:window.scrollY}function Ie(){return v==="x"?window.innerWidth:window.innerHeight}function ne(){let r=o.getBoundingClientRect(),u=te(),m=v==="x"?r.left:r.top,c=v==="x"?r.width:r.height,s=de({top:m,height:c},u,Ie(),Te,Se);H=s.tStart,K=s.tEnd;}function re(r){o.style.setProperty("--scroll-draw-progress",String(r)),j.forEach(({elements:u,lengths:m,from:c,to:s,easeFn:y,fade:X})=>{let S=s-c,P=S>0?Math.min(1,Math.max(0,(r-c)/S)):0,z=y(P);u.forEach((se,$e)=>{se.style.strokeDashoffset=`${m[$e]*(1-z)}`,X&&(se.style.opacity=String(z));});}),_e(r);}function F(){D=-1,M=0,R=false,j.forEach(({elements:r,lengths:u,fade:m})=>{r.forEach((c,s)=>{c.style.strokeDashoffset=`${u[s]}`,m&&(c.style.opacity="0");});}),o.style.setProperty("--scroll-draw-progress","0");}function U(){if(!k||x)return;let r;h?r=Math.min(1,(performance.now()-W)/Ee):(r=le(te(),H,K,f),(b||N())&&(D=Math.max(D,r),r=D)),M=r,re(r),r>=1&&!R?(R=true,p?.(),N()&&!h&&!d?d=setTimeout(()=>{d=void 0,T!==1/0&&T--,F(),h=true,W=performance.now();},L):$>0&&b&&!h&&!d&&(d=setTimeout(()=>{d=void 0,$!==1/0&&$--,F();},L))):!h&&r<1&&!b&&(R=false),h&&r>=1&&!d&&(R=false,T>0&&N()?d=setTimeout(()=>{d=void 0,T!==1/0&&T--,F(),W=performance.now();},L):h=false),E=requestAnimationFrame(U);}ne();let oe=new IntersectionObserver(r=>{r.forEach(u=>{k=u.isIntersecting,k&&!x?E=requestAnimationFrame(U):cancelAnimationFrame(E);});},{threshold:0});oe.observe(o);function ie(){j.forEach(({elements:r,lengths:u})=>{r.forEach((m,c)=>{u[c]=Z(m),m.style.strokeDasharray=`${u[c]}`;});}),ne();}let O;function _(){clearTimeout(O),O=setTimeout(ie,150);}window.addEventListener("resize",_),window.addEventListener("orientationchange",_);let Ae=ve([o],_);return he(o,{type:"draw",getProgress:()=>M,getTrigger:()=>({tStart:H,tEnd:K})}),{destroy(){cancelAnimationFrame(E),clearTimeout(O),clearTimeout(d),oe.disconnect(),ye(o),window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_),Ae(),Re(),w&&(w.remove(),w=null),De(),o.style.removeProperty("--scroll-draw-progress");},refresh(){clearTimeout(O),ie();},replay(){$=g==="infinite"?1/0:g??0,T=Q,h=false,clearTimeout(d),d=void 0,F(),x=false;},pause(){x=true,cancelAnimationFrame(E);},resume(){x&&(x=false,k&&(E=requestAnimationFrame(U)));},seek(r){M=Math.min(1,Math.max(0,r)),D=M,x=true,cancelAnimationFrame(E),re(M);},getProgress(){return M}}}exports.scrollDrawTimeline=tt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EasingName, S as ScrollDrawInstance } from '../types-
|
|
1
|
+
import { E as EasingName, S as ScrollDrawInstance } from '../types-MswK0erX.mjs';
|
|
2
2
|
|
|
3
3
|
interface TimelineTrack {
|
|
4
4
|
/** CSS selector for paths within the container to animate on this track. */
|
package/dist/timeline/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EasingName, S as ScrollDrawInstance } from '../types-
|
|
1
|
+
import { E as EasingName, S as ScrollDrawInstance } from '../types-MswK0erX.js';
|
|
2
2
|
|
|
3
3
|
interface TimelineTrack {
|
|
4
4
|
/** CSS selector for paths within the container to animate on this track. */
|
package/dist/timeline/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-YZV4Z3EQ.mjs';import {a,c,b as b$2}from'../chunk-
|
|
1
|
+
import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-YZV4Z3EQ.mjs';import {a,d as d$1,c,b as b$2}from'../chunk-A4JCC3QQ.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$4,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var le=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Ae(u,ce){let V={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return V;let W=typeof u=="string"?document.querySelector(u):u;if(!W)return b("timeline: Container not found:",u),V;let s=W,{trigger:_={},speed:pe=1,once:$=false,axis:w="y",tracks:B,onComplete:de,repeat:x,repeatDelay:I=0,loop:L=false,loopDuration:fe=1500,debug:ue=false,label:me,respectReducedMotion:U=true}=ce,ge=a(_.start??"top bottom"),ye=a(_.end??"bottom top"),v=x==="infinite"?1/0:x??0,r,k=L===true?1/0:typeof L=="number"?L:0,a$5=false,A=0,m=k,R=U&&a$1(),be=a$2(e=>{R=U&&e,R&&(a$5=false,clearTimeout(r),r=void 0);}),F=()=>k>0&&!R,z=new Map,C=B.map(e=>{let n=typeof e.easing=="function"?e.easing:d[e.easing??"linear"]??d.linear,i=Array.from(s.querySelectorAll(e.selector)),o=i.map(t=>a$3(t));return i.forEach((t,l)=>{z.has(t)||z.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=`${o[l]}`,t.style.strokeDashoffset=`${o[l]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:i,lengths:o,easeFn:n}});function he(){for(let[e,n]of z)n?e.setAttribute("style",n):e.removeAttribute("style");}let P=0,H=0,T=false,p=false,d$2=0,y=false,b$3=-1,f=0,c$1=null;ue&&(c$1=document.createElement("div"),Object.assign(c$1.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(c$1));function we(e){if(!c$1)return;let n=me??(typeof u=="string"?u:"timeline"),i=B.map(({selector:o,from:t,to:l},q)=>{let g=le[q%le.length],D=l>t?Math.min(1,Math.max(0,(e-t)/(l-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
|
|
2
2
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
|
|
3
3
|
<span style="color:${g};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${o}</span>
|
|
4
4
|
<span style="color:#666;margin-left:8px">${S}%</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div style="height:3px;background:#2a2a2a;border-radius:2px;position:relative;overflow:hidden">
|
|
7
|
-
<div style="position:absolute;left:${t*100}%;width:${(
|
|
8
|
-
<div style="position:absolute;left:${t*100}%;width:${(
|
|
7
|
+
<div style="position:absolute;left:${t*100}%;width:${(l-t)*100}%;height:100%;background:${g}33;border-radius:2px"></div>
|
|
8
|
+
<div style="position:absolute;left:${t*100}%;width:${(l-t)*D*100}%;height:100%;background:${g};border-radius:2px;transition:width 0.05s linear"></div>
|
|
9
9
|
</div>
|
|
10
10
|
</div>`}).join("");c$1.innerHTML=`
|
|
11
11
|
<div style="color:#555;margin-bottom:8px;font-size:10px;text-transform:uppercase;letter-spacing:0.12em;border-bottom:1px solid rgba(255,255,255,0.06);padding-bottom:6px">
|
|
@@ -20,4 +20,4 @@ import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$1}from'../chunk-AJ22
|
|
|
20
20
|
<div style="height:2px;background:#2a2a2a;border-radius:1px;overflow:hidden">
|
|
21
21
|
<div style="height:100%;background:#fff;border-radius:1px;width:${e*100}%;transition:width 0.05s linear"></div>
|
|
22
22
|
</div>
|
|
23
|
-
</div>`;}function X(){return
|
|
23
|
+
</div>`;}function X(){return w==="x"?window.scrollX:window.scrollY}function xe(){return w==="x"?window.innerWidth:window.innerHeight}function Y(){let e=s.getBoundingClientRect(),n=X(),i=w==="x"?e.left:e.top,o=w==="x"?e.width:e.height,t=c({top:i,height:o},n,xe(),ge,ye);P=t.tStart,H=t.tEnd;}function J(e){s.style.setProperty("--scroll-draw-progress",String(e)),C.forEach(({elements:n,lengths:i,from:o,to:t,easeFn:l,fade:q})=>{let g=t-o,D=g>0?Math.min(1,Math.max(0,(e-o)/g)):0,S=l(D);n.forEach((Z,Te)=>{Z.style.strokeDashoffset=`${i[Te]*(1-S)}`,q&&(Z.style.opacity=String(S));});}),we(e);}function E(){b$3=-1,f=0,y=false,C.forEach(({elements:e,lengths:n,fade:i})=>{e.forEach((o,t)=>{o.style.strokeDashoffset=`${n[t]}`,i&&(o.style.opacity="0");});}),s.style.setProperty("--scroll-draw-progress","0");}function O(){if(!T||p)return;let e;a$5?e=Math.min(1,(performance.now()-A)/fe):(e=b$2(X(),P,H,pe),($||F())&&(b$3=Math.max(b$3,e),e=b$3)),f=e,J(e),e>=1&&!y?(y=true,de?.(),F()&&!a$5&&!r?r=setTimeout(()=>{r=void 0,m!==1/0&&m--,E(),a$5=true,A=performance.now();},I):v>0&&$&&!a$5&&!r&&(r=setTimeout(()=>{r=void 0,v!==1/0&&v--,E();},I))):!a$5&&e<1&&!$&&(y=false),a$5&&e>=1&&!r&&(y=false,m>0&&F()?r=setTimeout(()=>{r=void 0,m!==1/0&&m--,E(),A=performance.now();},I):a$5=false),d$2=requestAnimationFrame(O);}Y();let K=new IntersectionObserver(e=>{e.forEach(n=>{T=n.isIntersecting,T&&!p?d$2=requestAnimationFrame(O):cancelAnimationFrame(d$2);});},{threshold:0});K.observe(s);function Q(){C.forEach(({elements:e,lengths:n})=>{e.forEach((i,o)=>{n[o]=a$3(i),i.style.strokeDasharray=`${n[o]}`;});}),Y();}let M;function h(){clearTimeout(M),M=setTimeout(Q,150);}window.addEventListener("resize",h),window.addEventListener("orientationchange",h);let ve=d$1([s],h);return a$4(s,{type:"draw",getProgress:()=>f,getTrigger:()=>({tStart:P,tEnd:H})}),{destroy(){cancelAnimationFrame(d$2),clearTimeout(M),clearTimeout(r),K.disconnect(),b$1(s),window.removeEventListener("resize",h),window.removeEventListener("orientationchange",h),ve(),be(),c$1&&(c$1.remove(),c$1=null),he(),s.style.removeProperty("--scroll-draw-progress");},refresh(){clearTimeout(M),Q();},replay(){v=x==="infinite"?1/0:x??0,m=k,a$5=false,clearTimeout(r),r=void 0,E(),p=false;},pause(){p=true,cancelAnimationFrame(d$2);},resume(){p&&(p=false,T&&(d$2=requestAnimationFrame(O)));},seek(e){f=Math.min(1,Math.max(0,e)),b$3=f,p=true,cancelAnimationFrame(d$2),J(f);},getProgress(){return f}}}export{Ae as scrollDrawTimeline};
|
|
@@ -20,6 +20,12 @@ interface ScrollDrawOptions {
|
|
|
20
20
|
fade?: boolean;
|
|
21
21
|
easing?: EasingName | ((t: number) => number);
|
|
22
22
|
trigger?: TriggerConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Each path starts this fraction of the scroll range after the previous one,
|
|
25
|
+
* and ends that much later too, so the last finishes after `trigger.end`.
|
|
26
|
+
* Where the page ends first, the stagger is tightened so the last path
|
|
27
|
+
* finishes at the bottom; a page with room keeps it as written.
|
|
28
|
+
*/
|
|
23
29
|
stagger?: number;
|
|
24
30
|
direction?: 'forward' | 'reverse';
|
|
25
31
|
once?: boolean;
|
|
@@ -68,6 +74,11 @@ interface ScrollDrawOptions {
|
|
|
68
74
|
* `<line>`, and other SVG shape elements.
|
|
69
75
|
*/
|
|
70
76
|
morphTo?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Progress 0–1, called as the scroll moves. Under `stagger` it is the first
|
|
79
|
+
* path's, the same value `getProgress()` and `--scroll-draw-progress` give;
|
|
80
|
+
* `onComplete` waits for the last path.
|
|
81
|
+
*/
|
|
71
82
|
onProgress?: (alpha: number) => void;
|
|
72
83
|
onStart?: () => void;
|
|
73
84
|
onComplete?: () => void;
|
|
@@ -125,7 +136,7 @@ interface ScrollDrawInstance {
|
|
|
125
136
|
resume: () => void;
|
|
126
137
|
/** Jump to a specific progress value (0–1) and pause. */
|
|
127
138
|
seek: (progress: number) => void;
|
|
128
|
-
/** Returns current draw progress (0–1)
|
|
139
|
+
/** Returns current draw progress (0–1): the first path's under `stagger`, as `onProgress`. */
|
|
129
140
|
getProgress: () => number;
|
|
130
141
|
/**
|
|
131
142
|
* Re-measure after a layout change: path lengths, and the scroll trigger window.
|
|
@@ -20,6 +20,12 @@ interface ScrollDrawOptions {
|
|
|
20
20
|
fade?: boolean;
|
|
21
21
|
easing?: EasingName | ((t: number) => number);
|
|
22
22
|
trigger?: TriggerConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Each path starts this fraction of the scroll range after the previous one,
|
|
25
|
+
* and ends that much later too, so the last finishes after `trigger.end`.
|
|
26
|
+
* Where the page ends first, the stagger is tightened so the last path
|
|
27
|
+
* finishes at the bottom; a page with room keeps it as written.
|
|
28
|
+
*/
|
|
23
29
|
stagger?: number;
|
|
24
30
|
direction?: 'forward' | 'reverse';
|
|
25
31
|
once?: boolean;
|
|
@@ -68,6 +74,11 @@ interface ScrollDrawOptions {
|
|
|
68
74
|
* `<line>`, and other SVG shape elements.
|
|
69
75
|
*/
|
|
70
76
|
morphTo?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Progress 0–1, called as the scroll moves. Under `stagger` it is the first
|
|
79
|
+
* path's, the same value `getProgress()` and `--scroll-draw-progress` give;
|
|
80
|
+
* `onComplete` waits for the last path.
|
|
81
|
+
*/
|
|
71
82
|
onProgress?: (alpha: number) => void;
|
|
72
83
|
onStart?: () => void;
|
|
73
84
|
onComplete?: () => void;
|
|
@@ -125,7 +136,7 @@ interface ScrollDrawInstance {
|
|
|
125
136
|
resume: () => void;
|
|
126
137
|
/** Jump to a specific progress value (0–1) and pause. */
|
|
127
138
|
seek: (progress: number) => void;
|
|
128
|
-
/** Returns current draw progress (0–1)
|
|
139
|
+
/** Returns current draw progress (0–1): the first path's under `stagger`, as `onProgress`. */
|
|
129
140
|
getProgress: () => number;
|
|
130
141
|
/**
|
|
131
142
|
* Re-measure after a layout change: path lengths, and the scroll trigger window.
|
package/dist/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function me({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(n),i=0,m=[];for(let a=0;a<r;a++){let u=Math.pow(o,a);m.push(u),i+=u;}let c=[0],M=0;for(let a=0;a<r;a++)M+=m[a]/i,c.push(M);return a=>{if(a<=0)return 0;if(a>=1)return 1;for(let u=0;u<r;u++)if(a<=c[u+1]){let g=(a-c[u])/(c[u+1]-c[u]);if(u===0)return g*(2-g);let S=1-Math.pow(n,u);return S+(1-S)*(2*g-1)*(2*g-1)}return 1}}function ce({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),o=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-o)*(2*Math.PI)/n)+1}var C={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:me(),elastic:ce()};function X(e,t,r){return Math.min(r,Math.max(t,e))}function F(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 j(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 J(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:X((e-t)/(r-t)*n,0,1)}function U(e,t,r,n,o){let i=j(e.top,e.height,t,n.element)-J(n.viewport,r),m=j(e.top,e.height,t,o.element)-J(o.viewport,r);return {tStart:i,tEnd:m}}var Y=Symbol.for("svg-scroll-draw.registry");function Z(){let e=globalThis;return e[Y]||(e[Y]=new Map)}function H(e,t){Z().set(e,t);}function ee(e){Z().delete(e);}var v,V=new Set,P=new WeakMap,x=new Map,te=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function le(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();v??(v=new ResizeObserver(o=>{let i=false;for(let{target:m}of o)P.get(m)!==te(m)&&(i=true),P.set(m,"");i&&V.forEach(m=>m());})),V.add(r);let n=le(e);return [document.body,document.documentElement].forEach(o=>o&&n.add(o)),n.forEach(o=>{P.has(o)||P.set(o,te(o)),x.set(o,(x.get(o)??0)+1),v.observe(o);}),()=>{V.delete(r)&&(n.forEach(o=>{let i=(x.get(o)??1)-1;if(i)return void x.set(o,i);x.delete(o),v?.unobserve(o);}),V.size||(v?.disconnect(),v=void 0));}}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 q(e,...t){de&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var re={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function _e(e,t={}){if(typeof window>"u")return re;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return q("scrollVideo: <video> element not found:",e),re;let n=r,{trigger:o={},easing:i="linear",once:m=false,axis:c="y",preload:M="auto",triggerElement:a,onReady:u,onComplete:g,onProgress:S}=t,W=a??n,k=window.matchMedia("(prefers-reduced-motion: reduce)").matches,oe=typeof i=="function"?i:C[i]??C.linear,ie=F(o.start??"top top"),se=F(o.end??"bottom top");n.pause(),n.hasAttribute("preload")||(n.preload=M);let G=t.from??0,N=t.to,_=0,R=0,d=0,b=false,f=false,w=-1,h=0,T=false,p=false,B=()=>c==="x"?window.scrollX:window.scrollY,ae=()=>c==="x"?window.innerWidth:window.innerHeight;function O(){let s=W.getBoundingClientRect(),l=c==="x"?s.left:s.top,y=c==="x"?s.width:s.height,K=U({top:l,height:y},B(),ae(),ie,se);_=K.tStart,R=K.tEnd,p&&R===_&&q("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",n);}let A=NaN;function L(s){if(!p)return;let l=N??n.duration??0,y=G+(l-G)*s;y!==A&&(A=y,n.currentTime=y),n.style.setProperty("--scroll-draw-progress",String(s)),S?.(s);}function I(){if(!b||f||!p||k)return;let s=oe(Q(B(),_,R,1));m&&(w=Math.max(w,s),s=w),h=s,L(s),s>=1&&!T?(T=true,g?.()):s<1&&!m&&(T=false),d=requestAnimationFrame(I);}function z(){if(p=true,N===void 0&&(N=n.duration),k){L(1),u?.();return}O(),u?.(),b&&!f&&(d=requestAnimationFrame(I));}n.readyState>=1?z():n.addEventListener("loadedmetadata",z,{once:true}),p||O();let $=new IntersectionObserver(s=>{s.forEach(l=>{b=l.isIntersecting,b&&!f&&p?d=requestAnimationFrame(I):cancelAnimationFrame(d);});}),D;function E(){clearTimeout(D),D=setTimeout(O,150);}window.addEventListener("resize",E),window.addEventListener("orientationchange",E);let ue=ne([W],E);return $.observe(n),H(n,{type:"video",getProgress:()=>h,getTrigger:()=>({tStart:_,tEnd:R})}),{destroy(){cancelAnimationFrame(d),$.disconnect(),n.removeEventListener("loadedmetadata",z),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),ue(),clearTimeout(D),ee(n);},replay(){w=-1,T=false,h=0,f=false,A=NaN,L(0);},pause(){f=true,cancelAnimationFrame(d);},resume(){f&&(f=false,b&&p&&(d=requestAnimationFrame(I)));},seek(s){let l=Math.min(1,Math.max(0,s));h=l,w=l,f=true,cancelAnimationFrame(d),A=NaN,L(l);},getProgress(){return h}}}exports.scrollVideo=_e;
|
package/dist/video/index.d.mts
CHANGED
package/dist/video/index.d.ts
CHANGED
package/dist/video/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as scrollVideo}from'../chunk-
|
|
1
|
+
export{a as scrollVideo}from'../chunk-7SBTYJGH.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var vue=require('vue');function
|
|
2
|
-
<div style="position:absolute;${m?`left:${
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",a,{passive:true}),a(),{el:t,destroy(){window.removeEventListener("scroll",a),t.remove();}}}var It=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Dt=/[MmLlHhVvCcSsQqTtAaZz]/g;function ar(e,n,r){if(!Ue)return;let t=(e.match(Dt)??[]).join("").toUpperCase(),a=(n.match(Dt)??[]).join("").toUpperCase(),s=(e.match(It)??[]).length,c=(n.match(It)??[]).length;if(t!==a){ge(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${a||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&ge(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ut(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),a=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[a++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function mt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,a=r?{...$t[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:E={},stagger:V=0,direction:L="forward",once:re=false,debug:Me=false,axis:W="y",scrollContainer:ne,autoReverse:oe=false,delay:Y=0,strokeColor:M,strokeWidth:D,fillOpacity:C,waypoints:w,velocityScale:R=false,threshold:P=0,rootMargin:$="0px",repeat:T=0,repeatDelay:X=0,morphTo:x,clip:fe,autoplay:be=false,duration:se=1e3,native:ie=true,onProgress:p,onStart:S,onComplete:g,onEnter:O,onLeave:ae,onEnterBack:ee,onLeaveBack:A}=a,F=fe===true?"left":typeof fe=="string"?fe:false,K=typeof d=="function"?d:te[d]??te.linear,we=de(E.start??"top bottom"),_e=de(E.end??"bottom top"),ve=typeof ne=="string"?document.querySelector(ne):ne??null,Se=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray(D)?D[0]:null,G=Array.isArray(D)?D[1]:typeof D=="number"?D:null,pe=Array.isArray(C)?C[0]:null,Q=Array.isArray(C)?C[1]:typeof C=="number"?C:null;function Pe(o){let l=o*100;switch(F){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 z=F?[]:Array.from(e.querySelectorAll(c)),k=[],i=[],f=0,ye=0,N=false,_=false,q=0,Ae=false,Ee=-1,Z=[],Ne=-1,j=false,Oe=0,Ie=0,He,st=null;function ht(){st?.destroy(),st=null;}let Ve=new Set,bt=NaN,ze=true,Qe=-1,wt=performance.now(),qe=NaN;function it(){return ve?W==="x"?ve.scrollLeft:ve.scrollTop:W==="x"?window.scrollX:window.scrollY}function vt(){return ve?W==="x"?ve.clientWidth:ve.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function St(){let o=nt(e,ve,W);return xe(o,o.scroll,vt(),we,_e)}function Et(){(({tStart:f,tEnd:ye}=St())),Me&&Ue&&(ht(),st=ir(f,ye,W));}function at(o,l=St){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Ut(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),F){let b=l==="reverse"?1-o:o;e.style.clipPath=Pe(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=l==="reverse"?`${k[ue]*o}`:`${k[ue]*(1-o)}`,m&&(b.style.opacity=l==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=We(Se,le,o):le&&(b.style.stroke=le),ce!==null&&G!==null?b.style.strokeWidth=`${ce+(G-ce)*o}`:G!==null&&(b.style.strokeWidth=`${G}`),pe!==null&&Q!==null?b.style.fillOpacity=`${pe+(Q-pe)*o}`:Q!==null&&(b.style.fillOpacity=`${Q}`),x&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ut(i[ue],x,o));});}function Ze(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=Pe(0);return}z.forEach((o,l)=>{o.style.strokeDasharray=`${k[l]}`,o.style.strokeDashoffset=L==="reverse"?"0":`${k[l]}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),x&&o.tagName.toLowerCase()==="path"&&i[l]&&o.setAttribute("d",i[l]);});}if(z.forEach(o=>{sr(o);let l=Be(o);k.push(l);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),x&&(b?ar(i[i.length-1],x,o):ge(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=L==="reverse"?`${l}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),G!==null&&(o.style.strokeWidth=`${G}`),Q!==null&&(o.style.fillOpacity=`${Q}`),x&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",x)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=L==="reverse"?"0":`${l}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),F){if(s)return e.style.clipPath=Pe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Pe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Tt=typeof d=="string"?ot(d):null;function Yt(){return !(ie===false||!or()||!z.length||!Tt||F||W!=="y"||ve||u!==1||V!==0||re||oe||R!==false||x||w||T||Y>0||p||S||g||O||ae||ee||A||M!=null||D!=null||C!=null||(E.start??"top bottom").trim()!=="top bottom"||(E.end??"bottom top").trim()!=="bottom top")}function Xt(){let o=++nr,l=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=L==="reverse"?"0":"var(--ssd-len)",ke=L==="reverse"?"var(--ssd-len)":"0",Le=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${ke};`;m&&(Le+=`opacity:${L==="reverse"?1:0};`,v+=`opacity:${L==="reverse"?0:1};`);let I=document.createElement("style");I.setAttribute("data-svg-scroll-draw",""),I.textContent=`@keyframes ${l}{from{${Le}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Tt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(k[U])),y.style.strokeDasharray=`${k[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l);}z.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},it(),vt(),we,_e);return K(J(it(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),I.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));H=U,h=true,z.forEach((Te,he)=>{Te.classList.remove(l),Te.style.strokeDashoffset=L==="reverse"?`${k[he]*U}`:`${k[he]*(1-U)}`,m&&(Te.style.opacity=L==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return B()},refresh(){z.forEach((y,U)=>{k[U]=Be(y),y.style.setProperty("--ssd-len",String(k[U])),y.style.strokeDasharray=`${k[U]}`;});}}}if(Yt())return at(Xt());function Kt(){let o=Math.max(1,se),l=0,b=0,ue=false;function De(h){let H=true;if(F){let B=Math.min(1,Math.max(0,h/o)),y=K(B);Oe=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Pe(L==="reverse"?1-y:y),p?.(y),B<1&&(H=false);}else z.forEach((B,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),he=K(Te);B.style.strokeDashoffset=L==="reverse"?`${k[y]*he}`:`${k[y]*(1-he)}`,m&&(B.style.opacity=L==="reverse"?`${1-he}`:`${he}`),Se&&le?B.style.stroke=We(Se,le,he):le&&(B.style.stroke=le),ce!==null&&G!==null?B.style.strokeWidth=`${ce+(G-ce)*he}`:G!==null&&(B.style.strokeWidth=`${G}`),pe!==null&&Q!==null?B.style.fillOpacity=`${pe+(Q-pe)*he}`:Q!==null&&(B.style.fillOpacity=`${Q}`),x&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ut(i[y],x,he)),y===0&&(Oe=he,p?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Te<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=K(B);for(let U in w){let Te=parseFloat(U);y>=Te&&!Ve.has(Te)&&(Ve.add(Te),w[U]?.());}}return H}function ke(h){if(j)return;let H=h-l;_||(_=true,S?.());let B=De(H);if(B&&!N){N=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,He=setTimeout(()=>{l=performance.now(),_=false,N=false,Ve.clear(),Ze(),q=requestAnimationFrame(ke);},X));return}B||(q=requestAnimationFrame(ke));}function Le(){cancelAnimationFrame(q),clearTimeout(He),l=performance.now(),b=0,j=false,_=false,N=false,Ie=0,ue=true,Oe=0,Ve.clear(),Ze(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(re&&N)?Le():!H.isIntersecting&&!re&&!N&&(cancelAnimationFrame(q),clearTimeout(He),ue=false);});},{root:ve??null,threshold:P,rootMargin:$}),I;function me(){clearTimeout(I),I=setTimeout(()=>{z.forEach((h,H)=>{k[H]=Be(h),h.style.strokeDasharray=`${k[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),Y>0?setTimeout(()=>v.observe(e),Y):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(He),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(I);},replay(){Ie=0,Le();},pause(){j||!ue||(j=true,b=performance.now()-l,cancelAnimationFrame(q));},resume(){j&&(j=false,ue=true,l=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));Oe=H,j=true,b=H*o,l=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return Oe},refresh(){clearTimeout(I),z.forEach((h,H)=>{k[H]=Be(h),h.style.strokeDasharray=`${k[H]}`;});}}}if(be)return at(Kt());Et();function Je(){if(!Ae||j)return;let o=performance.now(),l=it();if(!ze&&R===false&&l===bt){q=requestAnimationFrame(Je);return}ze=false,bt=l;let b=u;if(R!==false){let v=o-wt,I=v>0?Math.abs(l-(Qe<0?l:Qe))/v:0;b=u*Math.max(.2,1+I*(typeof R=="number"?R:1)*.04);}Qe=l,wt=o;let ue=oe?Ne===-1||l>=Ne?"forward":"reverse":L;Ne=l;let De=ye-f,ke=true,Le=De===0?0:(l-f)/De;if(isNaN(qe)||(qe<=0&&Le>0?O?.():qe>0&&Le<=0&&A?.(),qe<1&&Le>=1?ae?.():qe>=1&&Le<1&&ee?.()),qe=Le,F){let v=K(J(l,f,ye,b));re&&!oe&&(Ee=Math.max(Ee,v),v=Ee),Oe=v,e.style.setProperty("--scroll-draw-progress",String(v));let I=ue==="reverse"?1-v:v;e.style.clipPath=Pe(I),p?.(v),!_&&J(l,f,ye,b)>0&&(_=true,S?.()),v>=1&&!N?(N=true,g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,He=setTimeout(()=>{Ee=-1,_=false,N=false,e.style.clipPath=Pe(0);},X))):v<1&&!re&&(N=false),q=requestAnimationFrame(Je);return}if(z.forEach((v,I)=>{let me=I*V*De,h=K(J(l,f+me,ye+me,b));re&&!oe&&(h=Z[I]=Math.max(Z[I]??Ee,h)),Oe=h,v.style.strokeDashoffset=ue==="reverse"?`${k[I]*h}`:`${k[I]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=We(Se,le,h):le&&(v.style.stroke=le),ce!==null&&G!==null?v.style.strokeWidth=`${ce+(G-ce)*h}`:G!==null&&(v.style.strokeWidth=`${G}`),pe!==null&&Q!==null?v.style.fillOpacity=`${pe+(Q-pe)*h}`:Q!==null&&(v.style.fillOpacity=`${Q}`),x&&v.tagName.toLowerCase()==="path"&&i[I]&&v.setAttribute("d",ut(i[I],x,h)),I===0&&(p?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=K(J(l,f,ye,b));for(let I in w){let me=parseFloat(I);v>=me&&!Ve.has(me)&&(Ve.add(me),w[I]?.());}}!_&&J(l,f,ye,b)>0&&(_=true,S?.()),ke&&!N?(N=true,g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,He=setTimeout(()=>{Ee=-1,Z=[],_=false,N=false,Ve.clear(),Ze(),ze=true;},X))):!ke&&!re&&(N=false),q=requestAnimationFrame(Je);}let lt=false;function et(){lt||(lt=true,q=requestAnimationFrame(function(){Je();}));}function tt(){lt=false,cancelAnimationFrame(q);}let ct=new IntersectionObserver(o=>{o.forEach(l=>{Ae=l.isIntersecting,Ae&&!j?(ze=true,et()):tt();});},{root:ve??null,threshold:P,rootMargin:$});function xt(){z.forEach((o,l)=>{k[l]=Be(o),o.style.strokeDasharray=`${k[l]}`;}),Et(),ze=true;}let rt;function Ge(){clearTimeout(rt),rt=setTimeout(xt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),Y>0?setTimeout(()=>ct.observe(e),Y):ct.observe(e),at({destroy(){cancelAnimationFrame(q),clearTimeout(He),tt(),ct.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(rt),ht();},replay(){Ee=-1,Z=[],Ne=-1,Qe=-1,_=false,N=false,Ie=0,j=false,Oe=0,Ve.clear(),clearTimeout(He),Ze(),ze=true,Ae&&et();},pause(){j=true,tt();},resume(){j&&(j=false,ze=true,Ae&&et());},seek(o){let l=Math.min(1,Math.max(0,o));Oe=l,Ee=l,Z=[],j=true,tt(),Ut(l,L),ze=true;},getProgress(){return Oe},refresh(){clearTimeout(rt),xt(),Ae&&!j&&et();}},()=>({tStart:f,tEnd:ye}))}var Nt=new WeakMap,lr=0;function Ht(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=Nt.get(r);return t===void 0&&Nt.set(r,t=++lr),`el#${t}`}return r})}function Vt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...a)=>n()[t]?.(...a));return r}function cr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function zt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let a=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:a,units:s});}return n}function ur(e,n,r){let t=zt(e),a=zt(n);return t.length===0||t.length!==a.length?r<1?e:n:t.map((s,c)=>{let u=a[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function _t(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),a=String(n);if(cr(t))return We(t,a,r);if(t.includes("("))return ur(t,a,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=a.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:a}function mr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var fr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),pr=0,qt="--scroll-draw-progress";function dr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ft(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:a={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:E=true,velocityScale:V=false,respectReducedMotion:L=true,triggerElement:re,onProgress:Me,onComplete:W,onEnter:ne,onLeave:oe,onEnterBack:Y,onLeaveBack:M}=n,D=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof s=="function"?s:te[s]??te["ease-out"],w=de(a.start??"top bottom"),R=de(a.end??"bottom top"),P=re??e,$=typeof d=="string"?document.querySelector(d):d??null,T=Object.entries(t).map(([i,f])=>({prop:mr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function X(){let i=window.getComputedStyle(e);for(let f of T)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function x(){for(let i of T)e.style.setProperty(i.prop,String(i.to));}let fe=new Map;for(let i of [...T.map(f=>f.prop),qt])fe.set(i,e.style.getPropertyValue(i));function be(){for(let[i,f]of fe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(D)return x(),W?.(),{...r,destroy:be,getProgress:()=>1};X();let se=typeof s=="string"?ot(s):null;function ie(){if(!E||!dr()||!se||m!=="y"||$||P!==e||u||c!==1||Me||W||ne||oe||Y||M||V!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let i of T)if(!fr.has(i.prop))return false;return true}function p(){let i=`ssd-a-${++pr}`,f=T.map(Z=>`${Z.prop}:${Z.from}`).join(";"),ye=T.map(Z=>`${Z.prop}:${Z.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ye}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${se};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let Z=e.getBoundingClientRect();return xe({top:Z.top,height:Z.height},_(),q(),w,R)};Ce(e,{type:"animate",getProgress:()=>Ee.getProgress(),getTrigger:Ae});let Ee={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",be(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(Z){let Ne=Math.min(1,Math.max(0,Z));e.classList.remove(i);for(let j of T)e.style.setProperty(j.prop,_t(j.from,j.to,Ne));},getProgress(){let{tStart:Z,tEnd:Ne}=Ae();return C(J(_(),Z,Ne,c))}};return Ee}if(ie())return p();let S=0,g=0,O=0,ae=false,ee=false,A=-1,F=0,K=false,we=NaN,_e=-1,ve=0,Se=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=nt(P,$,m),f=xe(i,i.scroll,le(),w,R);S=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(qt,String(i));for(let f of T)e.style.setProperty(f.prop,_t(f.from,f.to,i));Me?.(i);}function pe(i){if(isNaN(we)){we=i;return}we<=0&&i>0?ne?.():we>0&&i<=0&&M?.(),we<1&&i>=1?oe?.():we>=1&&i<1&&Y?.(),we=i;}function Q(){if(!ae||ee)return;let i=performance.now(),f=Se(),ye=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ye=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}_e=f,ve=i;let N=g===S?0:(f-S)/(g-S);pe(N);let _=C(J(f,S,g,ye));u&&(A=Math.max(A,_),_=A),F=_,G(_),_>=1&&!K?(K=true,W?.()):_<1&&!u&&(K=false),O=requestAnimationFrame(Q);}ce(),g===S&&ge("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=C(J(Se(),S,g,c));u&&i>0&&(A=i),F=i,G(i);}let Pe=new IntersectionObserver(i=>{i.forEach(f=>{ae=f.isIntersecting,ae&&!ee?O=requestAnimationFrame(Q):cancelAnimationFrame(O);});},{root:$??null}),z;function k(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),Pe.observe(e),Ce(e,{type:"animate",getProgress:()=>F,getTrigger:()=>({tStart:S,tEnd:g})}),{destroy(){cancelAnimationFrame(O),Pe.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(z),be(),$e(e);},replay(){A=-1,K=false,F=0,ee=false,G(0);},pause(){ee=true,cancelAnimationFrame(O);},resume(){ee&&(ee=false,ae&&(O=requestAnimationFrame(Q)));},seek(i){let f=Math.min(1,Math.max(0,i));F=f,A=f,ee=true,cancelAnimationFrame(O),G(f);},getProgress(){return F}}}var pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n){if(typeof window>"u")return pt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollCounter: element not found:",e),pt;let t=r,{from:a=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:E,onComplete:V}=n,L=E!==void 0?p=>p.toFixed(E):c??(p=>String(Math.round(p))),re=typeof u=="function"?u:te[u]??te["ease-out"],Me=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(s),V?.(),pt;let oe=0,Y=0,M=0,D=false,C=false,w=-1,R=0,P=false,$=()=>window.scrollY,T=()=>window.innerHeight;function X(){let p=t.getBoundingClientRect(),S=xe({top:p.top,height:p.height},$(),T(),Me,W);oe=S.tStart,Y=S.tEnd;}function x(p){t.textContent=L(a+(s-a)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function fe(){if(!D||C)return;let p=re(J($(),oe,Y,1));d&&(w=Math.max(w,p),p=w),R=p,x(p),p>=1&&!P?(P=true,V?.()):p<1&&!d&&(P=false),M=requestAnimationFrame(fe);}X();{let p=re(J($(),oe,Y,1));d&&p>0&&(w=p),R=p,x(p);}let be=new IntersectionObserver(p=>{p.forEach(S=>{D=S.isIntersecting,D&&!C?M=requestAnimationFrame(fe):cancelAnimationFrame(M);});}),se;function ie(){clearTimeout(se),se=setTimeout(X,150);}return window.addEventListener("resize",ie),window.addEventListener("orientationchange",ie),be.observe(t),Ce(t,{type:"counter",getProgress:()=>R,getTrigger:()=>({tStart:oe,tEnd:Y})}),{destroy(){cancelAnimationFrame(M),be.disconnect(),window.removeEventListener("resize",ie),window.removeEventListener("orientationchange",ie),clearTimeout(se),$e(t);},replay(){w=-1,P=false,R=0,C=false,x(0);},pause(){C=true,cancelAnimationFrame(M);},resume(){C&&(C=false,D&&(M=requestAnimationFrame(fe)));},seek(p){let S=Math.min(1,Math.max(0,p));R=S,w=S,C=true,cancelAnimationFrame(M),x(S);},getProgress(){return R}}}var Bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return Bt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ge("scrollVideo: <video> element not found:",e),Bt;let t=r,{trigger:a={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",triggerElement:d,onReady:E,onComplete:V,onProgress:L}=n,re=d??t,Me=window.matchMedia("(prefers-reduced-motion: reduce)").matches,W=typeof s=="function"?s:te[s]??te.linear,ne=de(a.start??"top top"),oe=de(a.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Y=n.from??0,M=n.to,D=0,C=0,w=0,R=false,P=false,$=-1,T=0,X=false,x=false,fe=()=>u==="x"?window.scrollX:window.scrollY,be=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let A=re.getBoundingClientRect(),F=u==="x"?A.left:A.top,K=u==="x"?A.width:A.height,we=xe({top:F,height:K},fe(),be(),ne,oe);D=we.tStart,C=we.tEnd,x&&C===D&&ge("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let ie=NaN;function p(A){if(!x)return;let F=M??t.duration??0,K=Y+(F-Y)*A;K!==ie&&(ie=K,t.currentTime=K),t.style.setProperty("--scroll-draw-progress",String(A)),L?.(A);}function S(){if(!R||P||!x||Me)return;let A=W(J(fe(),D,C,1));c&&($=Math.max($,A),A=$),T=A,p(A),A>=1&&!X?(X=true,V?.()):A<1&&!c&&(X=false),w=requestAnimationFrame(S);}function g(){if(x=true,M===void 0&&(M=t.duration),Me){p(1),E?.();return}se(),E?.(),R&&!P&&(w=requestAnimationFrame(S));}t.readyState>=1?g():t.addEventListener("loadedmetadata",g,{once:true}),x||se();let O=new IntersectionObserver(A=>{A.forEach(F=>{R=F.isIntersecting,R&&!P&&x?w=requestAnimationFrame(S):cancelAnimationFrame(w);});}),ae;function ee(){clearTimeout(ae),ae=setTimeout(se,150);}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),O.observe(t),Ce(t,{type:"video",getProgress:()=>T,getTrigger:()=>({tStart:D,tEnd:C})}),{destroy(){cancelAnimationFrame(w),O.disconnect(),t.removeEventListener("loadedmetadata",g),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout(ae),$e(t);},replay(){$=-1,X=false,T=0,P=false,ie=NaN,p(0);},pause(){P=true,cancelAnimationFrame(w);},resume(){P&&(P=false,R&&x&&(w=requestAnimationFrame(S)));},seek(A){let F=Math.min(1,Math.max(0,A));T=F,$=F,P=true,cancelAnimationFrame(w),ie=NaN,p(F);},getProgress(){return T}}}function jt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function gr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Wt(e){let n=jt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],a=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of a){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let E=m.nextElementSibling;u.appendChild(m),d<c.length-1&&E&&E.style.whiteSpace==="pre"&&u.appendChild(E);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function yr(e,n,r,t){if(r<=1||t===0)return e;let a=(r-1)*t,s=n*t,c=s+(1-a);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function hr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Gt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return Gt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollText: element not found:",e),Gt;let t=r,{split:a="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:E}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof c=="function"?c:te[c]??te["ease-out"],re=de(m.start??"top 85%"),Me=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ne;a==="chars"?ne=gr(t):a==="lines"?ne=Wt(t):ne=jt(t);let oe=ne.length;function Y(g,O){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*O));let ae=hr(O,u);ae&&(g.style.transform=ae);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),ne.forEach((O,ae)=>{let ee=L(yr(g,ae,oe,s));Y(O,ee);});}if(V)return M(1),E?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let D=0,C=0,w=0,R=false,P=false,$=-1,T=0,X=false,x=()=>window.scrollY,fe=()=>window.innerHeight;function be(){let g=t.getBoundingClientRect(),O=xe({top:g.top,height:g.height},x(),fe(),re,Me);D=O.tStart,C=O.tEnd;}function se(){if(!R||P)return;let g=J(x(),D,C,1);d&&($=Math.max($,g),g=$),T=g,M(g),g>=1&&!X?(X=true,E?.()):g<1&&!d&&(X=false),w=requestAnimationFrame(se);}be();let ie=new IntersectionObserver(g=>{g.forEach(O=>{R=O.isIntersecting,R&&!P?w=requestAnimationFrame(se):cancelAnimationFrame(w);});}),p;function S(){clearTimeout(p),p=setTimeout(()=>{if(a==="lines"){let g=T;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),ne=Wt(t),M(g);}be();},150);}return window.addEventListener("resize",S),window.addEventListener("orientationchange",S),ie.observe(t),Ce(t,{type:"text",getProgress:()=>T,getTrigger:()=>({tStart:D,tEnd:C})}),{destroy(){cancelAnimationFrame(w),ie.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S),clearTimeout(p),t.innerHTML=W,t.removeAttribute("aria-label"),$e(t);},replay(){$=-1,X=false,T=0,P=false,M(0);},pause(){P=true,cancelAnimationFrame(w);},resume(){P&&(P=false,R&&(w=requestAnimationFrame(se)));},seek(g){let O=Math.min(1,Math.max(0,g));T=O,$=O,P=true,cancelAnimationFrame(w),M(O);},getProgress(){return T}}}var Ke=e=>typeof e=="function"?e():vue.unref(e);function Fe(e,n,r){let t=null,a=n(),s=()=>{t?.destroy(),t=e.value?r(e.value,Vt(a,()=>a)):null;};vue.onMounted(s),vue.watch(()=>Ht(a=n()),s),vue.onUnmounted(()=>{t?.destroy(),t=null;});}function En(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),mt),n}var Tn=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>{let t={};return e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete),t},mt),()=>vue.h("div",{ref:r},n.default?.())}});function xn(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),ft),n}var Mn=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options,ft),()=>vue.h("div",{ref:r},n.default?.())}});function An(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),dt),n}var Ln=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return Fe(n,()=>{let r={to:e.to};return e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete),r},dt),()=>vue.h("span",{ref:n})}});function Cn(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),gt),n}var $n=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let n=vue.ref(null);return Fe(n,()=>e.options??{},gt),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Pn(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),yt),n}var On=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options??{},yt),()=>vue.h(e.tag,{ref:r},n.default?.())}});exports.ScrollAnimate=Mn;exports.ScrollCounter=Ln;exports.ScrollDraw=Tn;exports.ScrollText=On;exports.ScrollVideo=$n;exports.useScrollAnimate=xn;exports.useScrollCounter=An;exports.useScrollDraw=En;exports.useScrollText=Pn;exports.useScrollVideo=Cn;
|
|
1
|
+
'use strict';var vue=require('vue');function mn({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(t),i=0,l=[];for(let d=0;d<n;d++){let T=Math.pow(s,d);l.push(T),i+=T;}let u=[0],m=0;for(let d=0;d<n;d++)m+=l[d]/i,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let T=0;T<n;T++)if(d<=u[T+1]){let D=(d-u[T])/(u[T+1]-u[T]);if(T===0)return D*(2-D);let A=1-Math.pow(t,T);return A+(1-A)*(2*D-1)*(2*D-1)}return 1}}function fn({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),s=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return i=>i<=0?0:i>=1?1:n*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/t)+1}var ce={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:mn(),elastic:fn()};function Rt(e,r,n){return Math.min(n,Math.max(r,e))}function be(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function It(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Ft(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function te(e,r,n,t){return n===r?0:Rt((e-r)/(n-r)*t,0,1)}function $e(e,r,n,t,s){let i=It(e.top,e.height,r,t.element)-Ft(t.viewport,n),l=It(e.top,e.height,r,s.element)-Ft(s.viewport,n);return {tStart:i,tEnd:l}}function lt(e,r,n){let t=e.getBoundingClientRect(),s=n==="x"?t.width:t.height;return r?{top:n==="x"?t.left-r.getBoundingClientRect().left+r.scrollLeft:t.top-r.getBoundingClientRect().top+r.scrollTop,height:s,scroll:0}:{top:n==="x"?t.left:t.top,height:s,scroll:n==="x"?window.scrollX:window.scrollY}}function Ue(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Dt(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function Ye(e,r,n){let t=Dt(e),s=Dt(r);return !t||!s?e:`rgb(${Math.round(t[0]+(s[0]-t[0])*n)},${Math.round(t[1]+(s[1]-t[1])*n)},${Math.round(t[2]+(s[2]-t[2])*n)})`}var Nt={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 Ke=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...r){Ke&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var pn="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",dn="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ht=33;function gn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function yn(e){let r=[];for(let n=0;n<Ht;n++){let t=n/(Ht-1);r.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${r.join(",")})`}function ct(e){switch(e){case "linear":return "linear";case "ease-in":return pn;case "ease-out":return dn;case "ease-in-out":return gn()?yn(ce["ease-in-out"]):null;default:return null}}var Vt=Symbol.for("svg-scroll-draw.registry");function zt(){let e=globalThis;return e[Vt]||(e[Vt]=new Map)}function ke(e,r){zt().set(e,r);}function Re(e){zt().delete(e);}var Qe,ut=new Set,mt=new WeakMap,Ze=new Map,_t=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function hn(e){let r=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let t=n;t;t=t.previousElementSibling)r.add(t);return r}function Fe(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>r();Qe??(Qe=new ResizeObserver(s=>{let i=false;for(let{target:l}of s)mt.get(l)!==_t(l)&&(i=true),mt.set(l,"");i&&ut.forEach(l=>l());})),ut.add(n);let t=hn(e);return [document.body,document.documentElement].forEach(s=>s&&t.add(s)),t.forEach(s=>{mt.has(s)||mt.set(s,_t(s)),Ze.set(s,(Ze.get(s)??0)+1),Qe.observe(s);}),()=>{ut.delete(n)&&(t.forEach(s=>{let i=(Ze.get(s)??1)-1;if(i)return void Ze.set(s,i);Ze.delete(s),Qe?.unobserve(s);}),ut.size||(Qe?.disconnect(),Qe=void 0));}}var bn=0;function wn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Bt(e,r){let n="";try{n=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return n||(e.getAttribute(r)??"").trim()}var Wt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function vn(e){if(!Ke)return;let r=Bt(e,"stroke");if(!r||r==="none"){we("Element has no stroke \u2014 path will not be visible.",e);return}let n=(e.getAttribute("fill")??"").trim();n&&!Wt.has(n)&&!Wt.has(Bt(e,"fill"))&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function En(e,r,n){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=n==="x"?window.scrollX:window.scrollY,l=e-i,u=r-i,m=n==="x";t.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${m?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
+
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",s,{passive:true}),s(),{el:t,destroy(){window.removeEventListener("scroll",s),t.remove();}}}var qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Gt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Sn(e,r,n){if(!Ke)return;let t=(e.match(Gt)??[]).join("").toUpperCase(),s=(r.match(Gt)??[]).join("").toUpperCase(),i=(e.match(qt)??[]).length,l=(r.match(qt)??[]).length;if(t!==s){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}i!==l&&we(`morphTo: coordinate count differs (${i} \u2192 ${l}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function yt(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let l=parseFloat(i),u=t[s++]??l;return String(+(l+(u-l)*n).toFixed(4))})}function ht(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,s=n?{...Nt[n],...t}:t,i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:l="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:T={},stagger:D=0,direction:A="forward",once:ne=false,debug:Pe=false,axis:G="y",scrollContainer:ue,autoReverse:re=false,delay:Y=0,strokeColor:N,strokeWidth:P,fillOpacity:k,waypoints:w,velocityScale:O=false,threshold:x=0,rootMargin:M="0px",repeat:E=0,repeatDelay:oe=0,morphTo:L,clip:se,autoplay:ve=false,duration:ge=1e3,native:ye=true,onProgress:H,onStart:$,onComplete:f,onEnter:p,onLeave:R,onEnterBack:W,onLeaveBack:Me}=s,v=se===true?"left":typeof se=="string"?se:false,V=typeof d=="function"?d:ce[d]??ce.linear,me=be(T.start??"top bottom"),He=be(T.end??"bottom top"),Ee=typeof ue=="string"?document.querySelector(ue):ue??null,Ae=Array.isArray(N)?N[0]:null,fe=Array.isArray(N)?N[1]:typeof N=="string"?N:null,X=Array.isArray(P)?P[0]:null,ie=Array.isArray(P)?P[1]:typeof P=="number"?P:null,ae=Array.isArray(k)?k[0]:null,K=Array.isArray(k)?k[1]:typeof k=="number"?k:null;function Ve(o){let a=o*100;switch(v){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=v?[]:Array.from(e.querySelectorAll(l)),I=[],pe=[],J=0,Se=0,c=D,h=0,_=false,q=false,C=0,ee=false,he=-1,ze=[],le=-1,j=false,Te=0,_e=0,Be,ft=null;function Tt(){ft?.destroy(),ft=null;}let We=new Set,xt=NaN,qe=true,nt=-1,Mt=performance.now(),Ge=NaN;function rt(){return Ee?G==="x"?Ee.scrollLeft:Ee.scrollTop:G==="x"?window.scrollX:window.scrollY}function At(){return Ee?G==="x"?Ee.clientWidth:Ee.clientHeight:G==="x"?window.innerWidth:window.innerHeight}function Lt(){let o=lt(e,Ee,G);return $e(o,o.scroll,At(),me,He)}function on(){let o=Se-J,a=z.length-1,y=Ee??document.documentElement,Q=G==="x"?"Width":"Height";if(c=D,D>0&&a>0&&o>0){let Le=y[`scroll${Q}`]-y[`client${Q}`]-1-J-o/u;Le>=0&&(c=Math.min(D,Le/(a*o)));}h=Se+a*c*o;}function Ct(){(({tStart:J,tEnd:Se}=Lt())),on(),Pe&&Ke&&(Tt(),ft=En(J,Se,G));}function pt(o,a=Lt){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let y=o.destroy;return o.destroy=()=>{y.call(o),Re(e);},o}function sn(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),v){let y=a==="reverse"?1-o:o;e.style.clipPath=Ve(y);return}z.forEach((y,Q)=>{y.style.strokeDashoffset=a==="reverse"?`${I[Q]*o}`:`${I[Q]*(1-o)}`,m&&(y.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Ae&&fe?y.style.stroke=Ye(Ae,fe,o):fe&&(y.style.stroke=fe),X!==null&&ie!==null?y.style.strokeWidth=`${X+(ie-X)*o}`:ie!==null&&(y.style.strokeWidth=`${ie}`),ae!==null&&K!==null?y.style.fillOpacity=`${ae+(K-ae)*o}`:K!==null&&(y.style.fillOpacity=`${K}`),L&&y.tagName.toLowerCase()==="path"&&pe[Q]&&y.setAttribute("d",yt(pe[Q],L,o));});}function ot(){if(e.style.setProperty("--scroll-draw-progress","0"),v){e.style.clipPath=Ve(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=A==="reverse"?"0":`${I[a]}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",Ae&&(o.style.stroke=Ae),X!==null&&(o.style.strokeWidth=`${X}`),ae!==null&&(o.style.fillOpacity=`${ae}`),L&&o.tagName.toLowerCase()==="path"&&pe[a]&&o.setAttribute("d",pe[a]);});}if(z.forEach(o=>{vn(o);let a=Ue(o);I.push(a);let y=o.tagName.toLowerCase()==="path";y?pe.push(o.getAttribute("d")??""):pe.push(""),L&&(y?Sn(pe[pe.length-1],L,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),i?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=A==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),fe&&(o.style.stroke=fe),ie!==null&&(o.style.strokeWidth=`${ie}`),K!==null&&(o.style.fillOpacity=`${K}`),L&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",L)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=A==="reverse"?"0":`${a}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",Ae&&(o.style.stroke=Ae),X!==null&&(o.style.strokeWidth=`${X}`),ae!==null&&(o.style.fillOpacity=`${ae}`));}),v){if(i)return e.style.clipPath=Ve(1),f?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ve(0);}else if(i)return f?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let $t=typeof d=="string"?ct(d):null;function an(){return !(ye===false||!wn()||!z.length||!$t||v||G!=="y"||Ee||u!==1||D!==0||ne||re||O!==false||L||w||E||Y>0||H||$||f||p||R||W||Me||N!=null||P!=null||k!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function ln(){let o=++bn,a=`svg-scroll-draw-${o}`,y=`svg-scroll-draw-host-${o}`,Q=`--svg-scroll-draw-${o}`,Le=A==="reverse"?"0":"var(--ssd-len)",Ie=A==="reverse"?"var(--ssd-len)":"0",Oe=`stroke-dashoffset:${Le};`,S=`stroke-dashoffset:${Ie};`;m&&(Oe+=`opacity:${A==="reverse"?1:0};`,S+=`opacity:${A==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Oe}}to{${S}}}.${y}{view-timeline-name:${Q};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${$t};animation-fill-mode:both;animation-timeline:${Q};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(y);function de(g,Z){g.style.setProperty("--ssd-len",String(I[Z])),g.style.strokeDasharray=`${I[Z]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(a);}z.forEach(de);let b=false,B=-1;function U(){if(B>=0)return B;let g=e.getBoundingClientRect(),{tStart:Z,tEnd:Ce}=$e({top:g.top,height:g.height},rt(),At(),me,He);return V(te(rt(),Z,Ce,u))}return {destroy(){e.classList.remove(y),z.forEach(g=>{g.classList.remove(a),g.style.removeProperty("--ssd-len"),g.style.animationPlayState="";}),F.remove();},replay(){b=false,B=-1,z.forEach(de);},pause(){b=true,z.forEach(g=>{g.style.animationPlayState="paused";});},resume(){b&&(b=false,z.forEach(g=>{g.style.animationPlayState="running";}));},seek(g){let Z=Math.min(1,Math.max(0,g));B=Z,b=true,z.forEach((Ce,xe)=>{Ce.classList.remove(a),Ce.style.strokeDashoffset=A==="reverse"?`${I[xe]*Z}`:`${I[xe]*(1-Z)}`,m&&(Ce.style.opacity=A==="reverse"?`${1-Z}`:`${Z}`);});},getProgress(){return U()},refresh(){z.forEach((g,Z)=>{I[Z]=Ue(g),g.style.setProperty("--ssd-len",String(I[Z])),g.style.strokeDasharray=`${I[Z]}`;});}}}if(an())return pt(ln());function cn(){let o=Math.max(1,ge),a=0,y=0,Q=false;function Le(b){let B=true;if(v){let U=Math.min(1,Math.max(0,b/o)),g=V(U);Te=g,e.style.setProperty("--scroll-draw-progress",String(g)),e.style.clipPath=Ve(A==="reverse"?1-g:g),H?.(g),U<1&&(B=false);}else z.forEach((U,g)=>{let Z=g*D*o,Ce=Math.min(1,Math.max(0,(b-Z)/o)),xe=V(Ce);U.style.strokeDashoffset=A==="reverse"?`${I[g]*xe}`:`${I[g]*(1-xe)}`,m&&(U.style.opacity=A==="reverse"?`${1-xe}`:`${xe}`),Ae&&fe?U.style.stroke=Ye(Ae,fe,xe):fe&&(U.style.stroke=fe),X!==null&&ie!==null?U.style.strokeWidth=`${X+(ie-X)*xe}`:ie!==null&&(U.style.strokeWidth=`${ie}`),ae!==null&&K!==null?U.style.fillOpacity=`${ae+(K-ae)*xe}`:K!==null&&(U.style.fillOpacity=`${K}`),L&&U.tagName.toLowerCase()==="path"&&pe[g]&&U.setAttribute("d",yt(pe[g],L,xe)),g===0&&(Te=xe,H?.(xe),e.style.setProperty("--scroll-draw-progress",String(xe))),Ce<1&&(B=false);});if(w){let U=Math.min(1,Math.max(0,b/o)),g=V(U);for(let Z in w){let Ce=parseFloat(Z);g>=Ce&&!We.has(Ce)&&(We.add(Ce),w[Z]?.());}}return B}function Ie(b){if(j)return;let B=b-a;q||(q=true,$?.());let U=Le(B);if(U&&!_){_=true,Le(o*(1+Math.max(0,z.length-1)*D)),f?.(),_e<(E==="infinite"?1/0:E??0)&&(_e++,Be=setTimeout(()=>{a=performance.now(),q=false,_=false,We.clear(),ot(),C=requestAnimationFrame(Ie);},oe));return}U||(C=requestAnimationFrame(Ie));}function Oe(){cancelAnimationFrame(C),clearTimeout(Be),a=performance.now(),y=0,j=false,q=false,_=false,_e=0,Q=true,Te=0,We.clear(),ot(),C=requestAnimationFrame(Ie);}let S=new IntersectionObserver(b=>{b.forEach(B=>{B.isIntersecting&&!(ne&&_)?Oe():!B.isIntersecting&&!ne&&!_&&(cancelAnimationFrame(C),clearTimeout(Be),Q=false);});},{root:Ee??null,threshold:x,rootMargin:M}),F;function de(){clearTimeout(F),F=setTimeout(()=>{z.forEach((b,B)=>{I[B]=Ue(b),b.style.strokeDasharray=`${I[B]}`;});},150);}return window.addEventListener("resize",de),window.addEventListener("orientationchange",de),Y>0?setTimeout(()=>S.observe(e),Y):S.observe(e),{destroy(){cancelAnimationFrame(C),clearTimeout(Be),S.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),clearTimeout(F);},replay(){_e=0,Oe();},pause(){j||!Q||(j=true,y=performance.now()-a,cancelAnimationFrame(C));},resume(){j&&(j=false,Q=true,a=performance.now()-y,C=requestAnimationFrame(Ie));},seek(b){let B=Math.min(1,Math.max(0,b));Te=B,j=true,y=B*o,a=performance.now()-y,cancelAnimationFrame(C),Le(y);},getProgress(){return Te},refresh(){clearTimeout(F),z.forEach((b,B)=>{I[B]=Ue(b),b.style.strokeDasharray=`${I[B]}`;});}}}if(ve)return pt(cn());Ct();function Pt(){if(j||!je)return;let o=performance.now(),a=rt();if(!qe&&O===false&&a===xt){dt(a);return}qe=false,xt=a;let y=u;if(O!==false){let S=o-Mt,F=S>0?Math.abs(a-(nt<0?a:nt))/S:0;y=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}nt=a,Mt=o;let Q=re?le===-1||a>=le?"forward":"reverse":A;le=a;let Le=Se-J,Ie=true,Oe=Le===0?0:(a-J)/Le;if(isNaN(Ge)||(Ge<=0&&Oe>0?p?.():Ge>0&&Oe<=0&&Me?.(),Ge<1&&Oe>=1?R?.():Ge>=1&&Oe<1&&W?.()),Ge=Oe,v){let S=V(te(a,J,Se,y));ne&&!re&&(he=Math.max(he,S),S=he),Te=S,e.style.setProperty("--scroll-draw-progress",String(S));let F=Q==="reverse"?1-S:S;e.style.clipPath=Ve(F),H?.(S),!q&&te(a,J,Se,y)>0&&(q=true,$?.()),S>=1&&!_?(_=true,f?.(),_e<(E==="infinite"?1/0:E??0)&&(_e++,Be=setTimeout(()=>{he=-1,q=false,_=false,e.style.clipPath=Ve(0);},oe))):S<1&&!ne&&(_=false),dt(a);return}if(z.forEach((S,F)=>{let de=F*c*Le,b=V(te(a,J+de,Se+de,y));ne&&!re&&(b=ze[F]=Math.max(ze[F]??he,b)),S.style.strokeDashoffset=Q==="reverse"?`${I[F]*b}`:`${I[F]*(1-b)}`,m&&(S.style.opacity=Q==="reverse"?`${1-b}`:`${b}`),Ae&&fe?S.style.stroke=Ye(Ae,fe,b):fe&&(S.style.stroke=fe),X!==null&&ie!==null?S.style.strokeWidth=`${X+(ie-X)*b}`:ie!==null&&(S.style.strokeWidth=`${ie}`),ae!==null&&K!==null?S.style.fillOpacity=`${ae+(K-ae)*b}`:K!==null&&(S.style.fillOpacity=`${K}`),L&&S.tagName.toLowerCase()==="path"&&pe[F]&&S.setAttribute("d",yt(pe[F],L,b)),F===0&&(Te=b,H?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Ie=false);}),w){let S=V(te(a,J,Se,y));for(let F in w){let de=parseFloat(F);S>=de&&!We.has(de)&&(We.add(de),w[F]?.());}}!q&&te(a,J,Se,y)>0&&(q=true,$?.()),Ie&&!_?(_=true,f?.(),_e<(E==="infinite"?1/0:E??0)&&(_e++,Be=setTimeout(()=>{he=-1,ze=[],q=false,_=false,We.clear(),ot(),qe=true;},oe))):!Ie&&!ne&&(_=false),dt(a);}function Ot(o){return o>=Se&&o<h}function dt(o){ee||Ot(o)?C=requestAnimationFrame(Pt):je=false;}let je=false;function st(){je||(je=true,C=requestAnimationFrame(function(){Pt();}));}function it(){je=false,cancelAnimationFrame(C);}let gt=new IntersectionObserver(o=>{o.forEach(a=>{ee=a.isIntersecting,ee&&!j?(qe=true,st()):je&&!j&&Ot(rt())||it();});},{root:Ee??null,threshold:x,rootMargin:M});function kt(){z.forEach((o,a)=>{I[a]=Ue(o),o.style.strokeDasharray=`${I[a]}`;}),Ct(),qe=true;}let at;function Xe(){clearTimeout(at),at=setTimeout(kt,150);}window.addEventListener("resize",Xe),window.addEventListener("orientationchange",Xe);let un=Fe([e],Xe);return Y>0?setTimeout(()=>gt.observe(e),Y):gt.observe(e),pt({destroy(){cancelAnimationFrame(C),clearTimeout(Be),it(),gt.disconnect(),un(),window.removeEventListener("resize",Xe),window.removeEventListener("orientationchange",Xe),clearTimeout(at),Tt();},replay(){he=-1,ze=[],le=-1,nt=-1,q=false,_=false,_e=0,j=false,Te=0,We.clear(),clearTimeout(Be),ot(),qe=true,ee&&st();},pause(){j=true,it();},resume(){j&&(j=false,qe=true,ee&&st());},seek(o){let a=Math.min(1,Math.max(0,o));Te=a,he=a,ze=[],j=true,it(),sn(a,A),qe=true;},getProgress(){return Te},refresh(){clearTimeout(at),kt(),ee&&!j&&st();}},()=>({tStart:J,tEnd:Se}))}var jt=new WeakMap,Tn=0;function Ut(e){return JSON.stringify(e,(r,n)=>{if(typeof n=="function")return "\u0192";if(typeof Element<"u"&&n instanceof Element){let t=jt.get(n);return t===void 0&&jt.set(n,t=++Tn),`el#${t}`}return n})}function Yt(e,r){let n={...e};for(let t of Object.keys(n))typeof n[t]=="function"&&(n[t]=(...s)=>r()[t]?.(...s));return n}function xn(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Xt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let s=[],i=[],l=t[2].trim();if(l)for(let u of l.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),i.push(m?m[2]:"");}r.push({fn:t[1],nums:s,units:i});}return r}function Mn(e,r,n){let t=Xt(e),s=Xt(r);return t.length===0||t.length!==s.length?n<1?e:r:t.map((i,l)=>{let u=s[l];return i.fn!==u.fn||i.nums.length!==u.nums.length?n<1?`${i.fn}(${i.nums.map((m,d)=>`${m}${i.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,d)=>`${m+(u.nums[d]-m)*n}${i.units[d]}`).join(", ")})`}).join(" ")}function Kt(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),s=String(r);if(xn(t))return Ye(t,s,n);if(t.includes("("))return Mn(t,s,n);let i=t.match(/^([-+]?[\d.]+)(.*)$/),l=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&l){let u=parseFloat(i[1]),m=parseFloat(l[1]);return `${u+(m-u)*n}${i[2]||l[2]}`}return n<1?t:s}function An(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Ln=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Cn=0,Qt="--scroll-draw-progress";function $n(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function bt(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:s={},easing:i="ease-out",speed:l=1,once:u=false,axis:m="y",scrollContainer:d,native:T=true,velocityScale:D=false,respectReducedMotion:A=true,triggerElement:ne,onProgress:Pe,onComplete:G,onEnter:ue,onLeave:re,onEnterBack:Y,onLeaveBack:N}=r,P=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,k=typeof i=="function"?i:ce[i]??ce["ease-out"],w=be(s.start??"top bottom"),O=be(s.end??"bottom top"),x=ne??e,M=typeof d=="string"?document.querySelector(d):d??null,E=Object.entries(t).map(([c,h])=>({prop:An(c),from:Array.isArray(h)?h[0]:"",to:Array.isArray(h)?h[1]:h}));function oe(){let c=window.getComputedStyle(e);for(let h of E)h.from===""&&(h.from=c.getPropertyValue(h.prop).trim()||"0");}function L(){for(let c of E)e.style.setProperty(c.prop,String(c.to));}let se=new Map;for(let c of [...E.map(h=>h.prop),Qt])se.set(c,e.style.getPropertyValue(c));function ve(){for(let[c,h]of se)h?e.style.setProperty(c,h):e.style.removeProperty(c);}if(P)return L(),G?.(),{...n,destroy:ve,getProgress:()=>1};oe();let ge=typeof i=="string"?ct(i):null;function ye(){if(!T||!$n()||!ge||m!=="y"||M||x!==e||u||l!==1||Pe||G||ue||re||Y||N||D!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let c of E)if(!Ln.has(c.prop))return false;return true}function H(){let c=`ssd-a-${++Cn}`,h=E.map(le=>`${le.prop}:${le.from}`).join(";"),_=E.map(le=>`${le.prop}:${le.to}`).join(";"),q=document.createElement("style");q.setAttribute("data-ssd-animate",""),q.textContent=`@keyframes ${c}{from{${h}}to{${_}}}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${ge};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(q),e.classList.add(c);let C=()=>m==="x"?window.scrollX:window.scrollY,ee=()=>m==="x"?window.innerWidth:window.innerHeight,he=()=>{let le=e.getBoundingClientRect();return $e({top:le.top,height:le.height},C(),ee(),w,O)};ke(e,{type:"animate",getProgress:()=>ze.getProgress(),getTrigger:he});let ze={refresh(){},destroy(){e.classList.remove(c),q.remove(),e.style.animationPlayState="",ve(),Re(e);},replay(){e.classList.remove(c),e.offsetWidth,e.classList.add(c);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(le){let j=Math.min(1,Math.max(0,le));e.classList.remove(c);for(let Te of E)e.style.setProperty(Te.prop,Kt(Te.from,Te.to,j));},getProgress(){let{tStart:le,tEnd:j}=he();return k(te(C(),le,j,l))}};return ze}if(ye())return H();let $=0,f=0,p=0,R=false,W=false,Me=-1,v=0,V=false,me=NaN,He=-1,Ee=0,Ae=()=>M?m==="x"?M.scrollLeft:M.scrollTop:m==="x"?window.scrollX:window.scrollY,fe=()=>M?m==="x"?M.clientWidth:M.clientHeight:m==="x"?window.innerWidth:window.innerHeight,X=x===e?E:[],ie=false;function ae(){let c=e.style,h=X.map(ee=>c.getPropertyValue(ee.prop)),_=c.transition;X.length&&(c.transition="none"),X.forEach(ee=>c.setProperty(ee.prop,se.get(ee.prop)??""));let q=lt(x,M,m);X.forEach((ee,he)=>c.setProperty(ee.prop,h[he])),X.length&&(e.offsetWidth,c.transition=_);let C=$e(q,q.scroll,fe(),w,O);ie&&Math.abs(C.tStart-$)<1&&Math.abs(C.tEnd-f)<1||(ie=true,$=C.tStart,f=C.tEnd);}function K(c){e.style.setProperty(Qt,String(c));for(let h of E)e.style.setProperty(h.prop,Kt(h.from,h.to,c));Pe?.(c);}function Ve(c){if(isNaN(me)){me=c;return}me<=0&&c>0?ue?.():me>0&&c<=0&&N?.(),me<1&&c>=1?re?.():me>=1&&c<1&&Y?.(),me=c;}function z(){if(!R||W)return;let c=performance.now(),h=Ae(),_=l;if(D!==false){let ee=c-Ee,he=ee>0?Math.abs(h-(He<0?h:He))/ee:0;_=l*Math.max(.2,1+he*(typeof D=="number"?D:1)*.04);}He=h,Ee=c;let q=f===$?0:(h-$)/(f-$);Ve(q);let C=k(te(h,$,f,_));u&&(Me=Math.max(Me,C),C=Me),v=C,K(C),C>=1&&!V?(V=true,G?.()):C<1&&!u&&(V=false),p=requestAnimationFrame(z);}ae(),f===$&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let c=k(te(Ae(),$,f,l));u&&c>0&&(Me=c),v=c,K(c);}let I=new IntersectionObserver(c=>{c.forEach(h=>{R=h.isIntersecting,R&&!W?p=requestAnimationFrame(z):cancelAnimationFrame(p);});},{root:M??null}),pe;function J(){clearTimeout(pe),pe=setTimeout(ae,150);}window.addEventListener("resize",J),window.addEventListener("orientationchange",J);let Se=Fe([x],J);return I.observe(e),ke(e,{type:"animate",getProgress:()=>v,getTrigger:()=>({tStart:$,tEnd:f})}),{destroy(){cancelAnimationFrame(p),I.disconnect(),window.removeEventListener("resize",J),window.removeEventListener("orientationchange",J),Se(),clearTimeout(pe),ve(),Re(e);},replay(){Me=-1,V=false,v=0,W=false,K(0);},pause(){W=true,cancelAnimationFrame(p);},resume(){W&&(W=false,R&&(p=requestAnimationFrame(z)));},seek(c){let h=Math.min(1,Math.max(0,c));v=h,Me=h,W=true,cancelAnimationFrame(p),K(h);},getProgress(){return v},refresh(){ae();}}}var wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function vt(e,r){if(typeof window>"u")return wt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return we("scrollCounter: element not found:",e),wt;let t=n,{from:s=0,to:i,format:l,easing:u="ease-out",trigger:m={},once:d=true,decimals:T,onComplete:D}=r,A=T!==void 0?f=>f.toFixed(T):l??(f=>String(Math.round(f))),ne=typeof u=="function"?u:ce[u]??ce["ease-out"],Pe=be(m.start??"top 80%"),G=be(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=A(i),D?.(),wt;let re=0,Y=0,N=false,P=0,k=false,w=false,O=-1,x=0,M=false,E=()=>window.scrollY,oe=()=>window.innerHeight;function L(){let f=t.getBoundingClientRect(),p=$e({top:f.top,height:f.height},E(),oe(),Pe,G);N&&Math.abs(p.tStart-re)<1&&Math.abs(p.tEnd-Y)<1||(N=true,re=p.tStart,Y=p.tEnd);}function se(f){t.textContent=A(s+(i-s)*f),t.style.setProperty("--scroll-draw-progress",String(f));}function ve(){if(!k||w)return;let f=ne(te(E(),re,Y,1));d&&(O=Math.max(O,f),f=O),x=f,se(f),f>=1&&!M?(M=true,D?.()):f<1&&!d&&(M=false),P=requestAnimationFrame(ve);}L();{let f=ne(te(E(),re,Y,1));d&&f>0&&(O=f),x=f,se(f);}let ge=new IntersectionObserver(f=>{f.forEach(p=>{k=p.isIntersecting,k&&!w?P=requestAnimationFrame(ve):cancelAnimationFrame(P);});}),ye;function H(){clearTimeout(ye),ye=setTimeout(L,150);}window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let $=Fe([t],H);return ge.observe(t),ke(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:re,tEnd:Y})}),{destroy(){cancelAnimationFrame(P),ge.disconnect(),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),$(),clearTimeout(ye),Re(t);},replay(){O=-1,M=false,x=0,w=false,se(0);},pause(){w=true,cancelAnimationFrame(P);},resume(){w&&(w=false,k&&(P=requestAnimationFrame(ve)));},seek(f){let p=Math.min(1,Math.max(0,f));x=p,O=p,w=true,cancelAnimationFrame(P),se(p);},getProgress(){return x}}}var Zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Et(e,r={}){if(typeof window>"u")return Zt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Zt;let t=n,{trigger:s={},easing:i="linear",once:l=false,axis:u="y",preload:m="auto",triggerElement:d,onReady:T,onComplete:D,onProgress:A}=r,ne=d??t,Pe=window.matchMedia("(prefers-reduced-motion: reduce)").matches,G=typeof i=="function"?i:ce[i]??ce.linear,ue=be(s.start??"top top"),re=be(s.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Y=r.from??0,N=r.to,P=0,k=0,w=0,O=false,x=false,M=-1,E=0,oe=false,L=false,se=()=>u==="x"?window.scrollX:window.scrollY,ve=()=>u==="x"?window.innerWidth:window.innerHeight;function ge(){let v=ne.getBoundingClientRect(),V=u==="x"?v.left:v.top,me=u==="x"?v.width:v.height,He=$e({top:V,height:me},se(),ve(),ue,re);P=He.tStart,k=He.tEnd,L&&k===P&&we("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let ye=NaN;function H(v){if(!L)return;let V=N??t.duration??0,me=Y+(V-Y)*v;me!==ye&&(ye=me,t.currentTime=me),t.style.setProperty("--scroll-draw-progress",String(v)),A?.(v);}function $(){if(!O||x||!L||Pe)return;let v=G(te(se(),P,k,1));l&&(M=Math.max(M,v),v=M),E=v,H(v),v>=1&&!oe?(oe=true,D?.()):v<1&&!l&&(oe=false),w=requestAnimationFrame($);}function f(){if(L=true,N===void 0&&(N=t.duration),Pe){H(1),T?.();return}ge(),T?.(),O&&!x&&(w=requestAnimationFrame($));}t.readyState>=1?f():t.addEventListener("loadedmetadata",f,{once:true}),L||ge();let p=new IntersectionObserver(v=>{v.forEach(V=>{O=V.isIntersecting,O&&!x&&L?w=requestAnimationFrame($):cancelAnimationFrame(w);});}),R;function W(){clearTimeout(R),R=setTimeout(ge,150);}window.addEventListener("resize",W),window.addEventListener("orientationchange",W);let Me=Fe([ne],W);return p.observe(t),ke(t,{type:"video",getProgress:()=>E,getTrigger:()=>({tStart:P,tEnd:k})}),{destroy(){cancelAnimationFrame(w),p.disconnect(),t.removeEventListener("loadedmetadata",f),window.removeEventListener("resize",W),window.removeEventListener("orientationchange",W),Me(),clearTimeout(R),Re(t);},replay(){M=-1,oe=false,E=0,x=false,ye=NaN,H(0);},pause(){x=true,cancelAnimationFrame(w);},resume(){x&&(x=false,O&&L&&(w=requestAnimationFrame($)));},seek(v){let V=Math.min(1,Math.max(0,v));E=V,M=V,x=true,cancelAnimationFrame(w),ye=NaN,H(V);},getProgress(){return E}}}function tn(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function Pn(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function Jt(e){let r=tn(e),n=new Map;for(let i of r){let l=i.offsetTop;n.has(l)||n.set(l,[]),n.get(l).push(i);}let t=[],s=Array.from(n.keys()).sort((i,l)=>i-l);for(let i of s){let l=n.get(i),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",l.forEach((m,d)=>{let T=m.nextElementSibling;u.appendChild(m),d<l.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((i,l)=>{e.appendChild(i),l<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function On(e,r,n,t){if(n<=1||t===0)return e;let s=(n-1)*t,i=r*t,l=i+(1-s);return l<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(l-i)))}function kn(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var en={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function St(e,r={}){if(typeof window>"u")return en;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return we("scrollText: element not found:",e),en;let t=n,{split:s="words",stagger:i=.04,easing:l="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:T}=r,D=window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof l=="function"?l:ce[l]??ce["ease-out"],ne=be(m.start??"top 85%"),Pe=be(m.end??"top 40%"),G=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ue;s==="chars"?ue=Pn(t):s==="lines"?ue=Jt(t):ue=tn(t);let re=ue.length;function Y(p,R){u?.opacity!==void 0&&(p.style.opacity=String(u.opacity+(1-u.opacity)*R));let W=kn(R,u);W&&(p.style.transform=W);}function N(p){t.style.setProperty("--scroll-draw-progress",String(p)),ue.forEach((R,W)=>{let Me=A(On(p,W,re,i));Y(R,Me);});}if(D)return N(1),T?.(),{destroy(){t.innerHTML=G,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};N(0);let P=0,k=0,w=0,O=false,x=false,M=-1,E=0,oe=false,L=()=>window.scrollY,se=()=>window.innerHeight;function ve(){let p=t.getBoundingClientRect(),R=$e({top:p.top,height:p.height},L(),se(),ne,Pe);P=R.tStart,k=R.tEnd;}function ge(){if(!O||x)return;let p=te(L(),P,k,1);d&&(M=Math.max(M,p),p=M),E=p,N(p),p>=1&&!oe?(oe=true,T?.()):p<1&&!d&&(oe=false),w=requestAnimationFrame(ge);}ve();let ye=new IntersectionObserver(p=>{p.forEach(R=>{O=R.isIntersecting,O&&!x?w=requestAnimationFrame(ge):cancelAnimationFrame(w);});}),H;function $(){clearTimeout(H),H=setTimeout(()=>{if(s==="lines"){let p=E;t.innerHTML=G,t.setAttribute("aria-label",t.textContent??""),ue=Jt(t),N(p);}ve();},150);}window.addEventListener("resize",$),window.addEventListener("orientationchange",$);let f=Fe([t],$);return ye.observe(t),ke(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:P,tEnd:k})}),{destroy(){cancelAnimationFrame(w),ye.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),f(),clearTimeout(H),t.innerHTML=G,t.removeAttribute("aria-label"),Re(t);},replay(){M=-1,oe=false,E=0,x=false,N(0);},pause(){x=true,cancelAnimationFrame(w);},resume(){x&&(x=false,O&&(w=requestAnimationFrame(ge)));},seek(p){let R=Math.min(1,Math.max(0,p));E=R,M=R,x=true,cancelAnimationFrame(w),N(R);},getProgress(){return E}}}var tt=e=>typeof e=="function"?e():vue.unref(e);function Ne(e,r,n){let t=null,s=r(),i=()=>{t?.destroy(),t=e.value?n(e.value,Yt(s,()=>s)):null;};vue.onMounted(i),vue.watch(()=>Ut(s=r()),i),vue.onUnmounted(()=>{t?.destroy(),t=null;});}function Wr(e={}){let r=vue.ref(null);return Ne(r,()=>tt(e),ht),r}var nn={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},Nn=[null,Boolean,[Boolean,String],[Boolean,Number]],rn=e=>({type:e,default:void 0}),qr=vue.defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(nn).map(([e,r])=>[e,r?rn(Nn[r]):null])),setup(e,{slots:r}){let n=vue.ref(null);return Ne(n,()=>{let t={};for(let s in nn){let i=e[s];i!=null&&(t[s]=i);}return t},ht),()=>vue.h("div",{ref:n},r.default?.())}});function Gr(e){let r=vue.ref(null);return Ne(r,()=>tt(e),bt),r}var jr=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let n=vue.ref(null);return Ne(n,()=>e.options,bt),()=>vue.h("div",{ref:n},r.default?.())}});function Ur(e){let r=vue.ref(null);return Ne(r,()=>tt(e),vt),r}var Yr=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:rn(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=vue.ref(null);return Ne(r,()=>{let n={to:e.to};return e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete),n},vt),()=>vue.h("span",{ref:r})}});function Xr(e={}){let r=vue.ref(null);return Ne(r,()=>tt(e),Et),r}var Kr=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=vue.ref(null);return Ne(r,()=>e.options??{},Et),()=>vue.h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Qr(e={}){let r=vue.ref(null);return Ne(r,()=>tt(e),St),r}var Zr=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let n=vue.ref(null);return Ne(n,()=>e.options??{},St),()=>vue.h(e.tag,{ref:n},r.default?.())}});exports.ScrollAnimate=jr;exports.ScrollCounter=Yr;exports.ScrollDraw=qr;exports.ScrollText=Zr;exports.ScrollVideo=Kr;exports.useScrollAnimate=Gr;exports.useScrollCounter=Ur;exports.useScrollDraw=Wr;exports.useScrollText=Qr;exports.useScrollVideo=Xr;
|