svg-scroll-draw 2.23.3 → 2.23.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +12 -12
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +3 -3
  4. package/dist/angular/index.d.ts +3 -3
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +3 -3
  7. package/dist/astro/index.d.mts +3 -3
  8. package/dist/astro/index.d.ts +3 -3
  9. package/dist/astro/index.mjs +1 -1
  10. package/dist/cdn/svg-scroll-draw.dev.global.js +222 -292
  11. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  12. package/dist/{chunk-BLY6F6EC.mjs → chunk-22B37AWY.mjs} +1 -1
  13. package/dist/{chunk-YNNA33A5.mjs → chunk-BSW7W2Y5.mjs} +1 -1
  14. package/dist/{chunk-ETACBG7W.mjs → chunk-CZLUBJAI.mjs} +1 -1
  15. package/dist/chunk-K6VATIJH.mjs +3 -0
  16. package/dist/chunk-NV6YTPHI.mjs +1 -0
  17. package/dist/chunk-NYQJPPMP.mjs +1 -0
  18. package/dist/{chunk-4I7MLTP5.mjs → chunk-OSGWGHQJ.mjs} +1 -1
  19. package/dist/chunk-PAGN26EH.mjs +1 -0
  20. package/dist/chunk-THPTANES.mjs +1 -0
  21. package/dist/{chunk-OJFWQ6CU.mjs → chunk-V3Z6G5JE.mjs} +1 -1
  22. package/dist/chunk-VJ5ZU55P.mjs +1 -0
  23. package/dist/chunk-XC5NR2MU.mjs +1 -0
  24. package/dist/chunk-XNM3VKEK.mjs +1 -0
  25. package/dist/cinematic/index.cjs +2 -2
  26. package/dist/cinematic/index.mjs +1 -1
  27. package/dist/{engine-B7UpB4fT.d.ts → engine-6VsjEwzb.d.ts} +1 -1
  28. package/dist/{engine-o1VSQ1lX.d.mts → engine-BLWKCfxC.d.mts} +1 -1
  29. package/dist/group/index.cjs +2 -2
  30. package/dist/group/index.d.mts +3 -3
  31. package/dist/group/index.d.ts +3 -3
  32. package/dist/group/index.mjs +1 -1
  33. package/dist/horizontal/index.cjs +1 -1
  34. package/dist/horizontal/index.d.mts +11 -8
  35. package/dist/horizontal/index.d.ts +11 -8
  36. package/dist/horizontal/index.mjs +1 -1
  37. package/dist/{index-D3o4vT3e.d.ts → index-BN8yKeQ3.d.ts} +1 -1
  38. package/dist/{index-BY-CNE8c.d.mts → index-DAiRJgtF.d.mts} +2 -2
  39. package/dist/{index-CdaBYn3A.d.mts → index-DVjblK_4.d.mts} +1 -1
  40. package/dist/{index-DqXXiDIk.d.ts → index-hSQqLVbg.d.ts} +2 -2
  41. package/dist/index.cjs +3 -3
  42. package/dist/index.d.mts +6 -6
  43. package/dist/index.d.ts +6 -6
  44. package/dist/index.mjs +1 -1
  45. package/dist/nuxt/index.cjs +3 -3
  46. package/dist/nuxt/index.d.mts +3 -3
  47. package/dist/nuxt/index.d.ts +3 -3
  48. package/dist/nuxt/index.mjs +1 -1
  49. package/dist/progress/index.cjs +1 -1
  50. package/dist/progress/index.d.mts +1 -1
  51. package/dist/progress/index.d.ts +1 -1
  52. package/dist/progress/index.mjs +1 -1
  53. package/dist/react/index.cjs +2 -2
  54. package/dist/react/index.d.mts +6 -4
  55. package/dist/react/index.d.ts +6 -4
  56. package/dist/react/index.mjs +1 -1
  57. package/dist/reveal/index.cjs +1 -1
  58. package/dist/reveal/index.d.mts +10 -4
  59. package/dist/reveal/index.d.ts +10 -4
  60. package/dist/reveal/index.mjs +1 -1
  61. package/dist/{scroll-draw-DsBMkwrX.d.ts → scroll-draw-BsU_Ohmu.d.ts} +1 -1
  62. package/dist/{scroll-draw-Dej-GIRP.d.mts → scroll-draw-Fzir8hlU.d.mts} +1 -1
  63. package/dist/snap/index.cjs +1 -1
  64. package/dist/snap/index.d.mts +1 -1
  65. package/dist/snap/index.d.ts +1 -1
  66. package/dist/snap/index.mjs +1 -1
  67. package/dist/solid/index.cjs +2 -2
  68. package/dist/solid/index.d.mts +3 -3
  69. package/dist/solid/index.d.ts +3 -3
  70. package/dist/solid/index.mjs +1 -1
  71. package/dist/svelte/index.cjs +2 -2
  72. package/dist/svelte/index.d.mts +3 -3
  73. package/dist/svelte/index.d.ts +3 -3
  74. package/dist/svelte/index.mjs +1 -1
  75. package/dist/text/index.cjs +1 -1
  76. package/dist/text/index.d.mts +1 -1
  77. package/dist/text/index.d.ts +1 -1
  78. package/dist/text/index.mjs +1 -1
  79. package/dist/timeline/index.cjs +9 -9
  80. package/dist/timeline/index.d.mts +1 -1
  81. package/dist/timeline/index.d.ts +1 -1
  82. package/dist/timeline/index.mjs +8 -8
  83. package/dist/{types-MswK0erX.d.mts → types-9bcJdVcg.d.mts} +6 -2
  84. package/dist/{types-MswK0erX.d.ts → types-9bcJdVcg.d.ts} +6 -2
  85. package/dist/video/index.cjs +1 -1
  86. package/dist/video/index.d.mts +1 -1
  87. package/dist/video/index.d.ts +1 -1
  88. package/dist/video/index.mjs +1 -1
  89. package/dist/vue/index.cjs +3 -3
  90. package/dist/vue/index.d.mts +3 -3
  91. package/dist/vue/index.d.ts +3 -3
  92. package/dist/vue/index.mjs +1 -1
  93. package/dist/web-component/index.cjs +3 -3
  94. package/dist/web-component/index.mjs +1 -1
  95. package/package.json +1 -1
  96. package/dist/chunk-23EALNDF.mjs +0 -3
  97. package/dist/chunk-4H2SGMAQ.mjs +0 -1
  98. package/dist/chunk-A4JCC3QQ.mjs +0 -1
  99. package/dist/chunk-DM6EDKWH.mjs +0 -1
  100. package/dist/chunk-GMBIGV3M.mjs +0 -1
  101. package/dist/chunk-LGJQWZHH.mjs +0 -1
  102. package/dist/chunk-V4L3ELVC.mjs +0 -1
  103. package/dist/chunk-YZV4Z3EQ.mjs +0 -1
@@ -1,6 +1,6 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-MswK0erX.mjs';
2
- import { S as ScrollParallaxOptions } from '../index-BY-CNE8c.mjs';
3
- import { S as ScrollAnimateOptions } from '../engine-o1VSQ1lX.mjs';
1
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.mjs';
2
+ import { S as ScrollParallaxOptions } from '../index-DAiRJgtF.mjs';
3
+ import { S as ScrollAnimateOptions } from '../engine-BLWKCfxC.mjs';
4
4
 
5
5
  /**
6
6
  * Animate multiple SVG containers simultaneously with the same options.
@@ -1,6 +1,6 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-MswK0erX.js';
2
- import { S as ScrollParallaxOptions } from '../index-DqXXiDIk.js';
3
- import { S as ScrollAnimateOptions } from '../engine-B7UpB4fT.js';
1
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.js';
2
+ import { S as ScrollParallaxOptions } from '../index-hSQqLVbg.js';
3
+ import { S as ScrollAnimateOptions } from '../engine-6VsjEwzb.js';
4
4
 
5
5
  /**
6
6
  * Animate multiple SVG containers simultaneously with the same options.
@@ -1 +1 @@
1
- import {b as b$1}from'../chunk-ETACBG7W.mjs';import {a as a$1}from'../chunk-V4L3ELVC.mjs';import {b}from'../chunk-23EALNDF.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
1
+ import {b as b$1}from'../chunk-CZLUBJAI.mjs';import {a as a$1}from'../chunk-VJ5ZU55P.mjs';import {b}from'../chunk-K6VATIJH.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
@@ -1 +1 @@
1
- 'use strict';function Be({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),s=0,a=[];for(let c=0;c<n;c++){let p=Math.pow(o,c);a.push(p),s+=p;}let f=[0],m=0;for(let c=0;c<n;c++)m+=a[c]/s,f.push(m);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let p=0;p<n;p++)if(c<=f[p+1]){let E=(c-f[p])/(f[p+1]-f[p]);if(p===0)return E*(2-E);let x=1-Math.pow(r,p);return x+(1-x)*(2*E-1)*(2*E-1)}return 1}}function Qe({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/r)+1}var q={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:Be(),elastic:Qe()};function we(e,t,n){return Math.min(n,Math.max(t,e))}function le(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}function ve(e,t,n,r){switch(r){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function Se(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 te(e,t,n,r){return n===t?0:we((e-t)/(n-t)*r,0,1)}function me(e,t,n,r,o){let s=ve(e.top,e.height,t,r.element)-Se(r.viewport,n),a=ve(e.top,e.height,t,o.element)-Se(o.viewport,n);return {tStart:s,tEnd:a}}function Me(e,t,n){let r=e.getBoundingClientRect(),o=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left-t.clientLeft+t.scrollLeft:r.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function Le(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let 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 r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function Te(e,t,n){let r=Le(e),o=Le(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var qe="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",je="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",xe=33;function Ge(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ue(e){let t=[];for(let n=0;n<xe;n++){let r=n/(xe-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Pe(e){switch(e){case "linear":return "linear";case "ease-in":return qe;case "ease-out":return je;case "ease-in-out":return Ge()?Ue(q["ease-in-out"]):null;default:return null}}var Re=Symbol.for("svg-scroll-draw.registry");function $e(){let e=globalThis;return e[Re]||(e[Re]=new Map)}function fe(e,t){$e().set(e,t);}function de(e){$e().delete(e);}var Xe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function j(e,...t){Xe&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var G,ne=new Set,re=new WeakMap,U=new Map,Ae=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ke(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function oe(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();G??(G=new ResizeObserver(o=>{let s=false;for(let{target:a}of o)re.get(a)!==Ae(a)&&(s=true),re.set(a,"");s&&ne.forEach(a=>a());})),ne.add(n);let r=Ke(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{re.has(o)||re.set(o,Ae(o)),U.set(o,(U.get(o)??0)+1),G.observe(o);}),()=>{ne.delete(n)&&(r.forEach(o=>{let s=(U.get(o)??1)-1;if(s)return void U.set(o,s);U.delete(o),G?.unobserve(o);}),ne.size||(G?.disconnect(),G=void 0));}}function Ce(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 r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function Ie(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=Ce(s=>{if(!s)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(n))o[s]=(...a)=>n[s]?.(...a);return o.destroy=()=>{r(),n.destroy();},o}function Ye(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _e(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],s=[],a=r[2].trim();if(a)for(let f of a.split(/[\s,]+/)){let m=f.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}t.push({fn:r[1],nums:o,units:s});}return t}function Ze(e,t,n){let r=_e(e),o=_e(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((s,a)=>{let f=o[a];return s.fn!==f.fn||s.nums.length!==f.nums.length?n<1?`${s.fn}(${s.nums.map((m,c)=>`${m}${s.units[c]}`).join(", ")})`:`${f.fn}(${f.nums.map((m,c)=>`${m}${f.units[c]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,c)=>`${m+(f.nums[c]-m)*n}${s.units[c]}`).join(", ")})`}).join(" ")}function Oe(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Ye(r))return Te(r,o,n);if(r.includes("("))return Ze(r,o,n);let s=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let f=parseFloat(s[1]),m=parseFloat(a[1]);return `${f+(m-f)*n}${s[2]||a[2]}`}return n<1?r:o}function Je(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var et=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),tt=0,ke="--scroll-draw-progress";function nt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pe(e,t){return typeof window>"u"?ze:t.respectReducedMotion===false?He(e,t,false):Ie(t,(n,r)=>He(e,n,r))}function He(e,t,n){let{props:r,trigger:o={},easing:s="ease-out",speed:a=1,once:f=false,axis:m="y",scrollContainer:c,native:p=true,velocityScale:E=false,triggerElement:x,onProgress:k,onComplete:$,onEnter:v,onLeave:y,onEnterBack:F,onLeaveBack:M}=t,A=typeof s=="function"?s:q[s]??q["ease-out"],H=le(o.start||"top bottom"),W=le(o.end||"bottom top"),P=x??e,w=typeof c=="string"?document.querySelector(c):c??null,b=Object.entries(r).map(([i,u])=>({prop:Je(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function D(){let i=window.getComputedStyle(e);for(let u of b)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function X(){for(let i of b)e.style.setProperty(i.prop,String(i.to));}let l=new Map;for(let i of [...b.map(u=>u.prop),ke])l.set(i,e.style.getPropertyValue(i));function g(){for(let[i,u]of l)u?e.style.setProperty(i,u):e.style.removeProperty(i);}if(n)return X(),$?.(),{...ze,destroy:g,getProgress:()=>1};D();let K=()=>w?m==="x"?w.scrollLeft:w.scrollTop:m==="x"?window.scrollX:window.scrollY,ge=()=>w?m==="x"?w.clientWidth:w.clientHeight:m==="x"?window.innerWidth:window.innerHeight,be=typeof s=="string"?Pe(s):null;function Fe(){if(!p||!nt()||!be||m!=="y"||w||P!==e||f||a!==1||k||$||v||y||F||M||E!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let i of b)if(!et.has(i.prop))return false;return true}function We(){let i=`ssd-a-${++tt}`,u=b.map(d=>`${d.prop}:${d.from}`).join(";"),N=b.map(d=>`${d.prop}:${d.to}`).join(";"),T=document.createElement("style");T.setAttribute("data-ssd-animate",""),T.textContent=`@keyframes ${i}{from{${u}}to{${N}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${be};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(T),e.classList.add(i);let S=()=>{let d=e.getBoundingClientRect();return me({top:d.top,height:d.height},K(),ge(),H,W)};fe(e,{type:"animate",getProgress:()=>h.getProgress(),getTrigger:S});let h={refresh(){},destroy(){e.classList.remove(i),T.remove(),e.style.animationPlayState="",g(),de(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(d){let Q=Math.min(1,Math.max(0,d));e.classList.remove(i);for(let ee of b)e.style.setProperty(ee.prop,Oe(ee.from,ee.to,Q));},getProgress(){let{tStart:d,tEnd:Q}=S();return A(te(K(),d,Q,a))}};return h}if(Fe())return We();let L=0,R=0,C=0,Y=false,I=false,ie=-1,z=0,_=0,Z=false,O=NaN,se=-1,ye=0,V=P===e?b:[],he=false;function ae(){let i=e.style,u=V.map(h=>i.getPropertyValue(h.prop)),N=i.transition;V.length&&(i.transition="none"),V.forEach(h=>i.setProperty(h.prop,l.get(h.prop)??""));let T=Me(P,w,m);V.forEach((h,d)=>i.setProperty(h.prop,u[d])),V.length&&(e.offsetWidth,i.transition=N);let S=me(T,T.scroll,ge(),H,W);he&&Math.abs(S.tStart-L)<1&&Math.abs(S.tEnd-R)<1||(he=true,L=S.tStart,R=S.tEnd);}function J(i){e.style.setProperty(ke,String(i));for(let u of b)e.style.setProperty(u.prop,Oe(u.from,u.to,i));k?.(i);}function De(i){if(isNaN(O)){O=i;return}O<=0&&i>0?v?.():O>0&&i<=0&&M?.(),O<1&&i>=1?y?.():O>=1&&i<1&&F?.(),O=i;}function ue(){if(!Y||I)return;let i=performance.now(),u=K(),N=a;if(E!==false){let d=i-ye,Q=d>0?Math.abs(u-(se<0?u:se))/d:0;N=a*Math.max(.2,1+Q*(typeof E=="number"?E:1)*.04);}se=u,ye=i;let T=R===L?0:(u-L)/(R-L);De(T);let S=te(u,L,R,N),h=f?Math.max(ie,A(z=Math.max(z,S))):A(S);_=h,J(h),h>=1&&!Z?(Z=true,$?.()):h<1&&!f&&(Z=false),C=requestAnimationFrame(ue);}ae(),R===L&&j("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e),z=te(K(),L,R,a),_=A(z),J(_);let Ee=new IntersectionObserver(i=>{i.forEach(u=>{Y=u.isIntersecting,Y&&!I?C=requestAnimationFrame(ue):cancelAnimationFrame(C);});},{root:w??null}),ce;function B(){clearTimeout(ce),ce=setTimeout(ae,150);}window.addEventListener("resize",B),window.addEventListener("orientationchange",B);let Ve=oe([P],B);return Ee.observe(e),fe(e,{type:"animate",getProgress:()=>_,getTrigger:()=>({tStart:L,tEnd:R})}),{destroy(){cancelAnimationFrame(C),Ee.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),Ve(),clearTimeout(ce),g(),de(e);},replay(){ie=-1,z=0,Z=false,_=0,I=false,J(0);},pause(){I=true,cancelAnimationFrame(C);},resume(){I&&(I=false,Y&&(C=requestAnimationFrame(ue)));},seek(i){let u=Math.min(1,Math.max(0,i));_=u,ie=u,z=0,I=true,cancelAnimationFrame(C),J(u);},getProgress(){return _},refresh(){ae();}}}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function At(e,t={}){if(typeof window>"u")return Ne;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return j("scrollHorizontal: track element not found:",e),Ne;let r=n,{easing:o="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:a,respectReducedMotion:f=false,onProgress:m}=t,c=typeof a=="string"?document.querySelector(a):a??null;function p(){for(let l=r.parentElement;l;l=l.parentElement)if(window.getComputedStyle(l).position==="sticky")return l;return null}function E(){let l=p();if(l){let g=window.getComputedStyle(l);return l.clientWidth-(parseFloat(g.paddingLeft)||0)-(parseFloat(g.paddingRight)||0)}return c?c.clientWidth:document.documentElement.clientWidth||window.innerWidth}function x(){return t.distance??r.scrollWidth-E()}function k(){if(t.triggerElement!==void 0){let g=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(g)return g;j("scrollHorizontal: triggerElement not found:",t.triggerElement);}let l=p();return l?l.parentElement??l:r}let $=x(),v=k(),y=pe(r,A($,v)),F=H(),M=null;function A(l,g){return {props:{transform:["translateX(0px)",`translateX(${-l}px)`]},trigger:s,easing:o,native:false,respectReducedMotion:f,...g!==r&&{triggerElement:g},...a!==void 0&&{scrollContainer:a},...m!==void 0&&{onProgress:m}}}function H(){let l=v.getBoundingClientRect(),g=c?l.top-c.getBoundingClientRect().top+c.scrollTop:l.top+window.scrollY;return `${x()} ${Math.round(g)} ${Math.round(l.height)}`}function W(){y.destroy();let l=k(),g=l!==v;$=x(),v=l,y=pe(r,A($,v)),F=H(),M!==null&&y.seek(M),g&&X();}let P;function w(){(k()!==v||H()!==F)&&W();}function b(){clearTimeout(P),P=setTimeout(w,150);}window.addEventListener("resize",b),window.addEventListener("orientationchange",b);let D=()=>{};function X(){D(),D=oe([r,v],b);}return X(),{destroy(){clearTimeout(P),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),D(),y.destroy();},replay(){M=null,y.replay();},pause(){y.pause(),M=y.getProgress();},resume(){M=null,y.resume();},seek(l){y.seek(l),M=y.getProgress();},getProgress(){return y.getProgress()},refresh(){W();}}}exports.scrollHorizontal=At;
1
+ 'use strict';function Fe({tension:e=2.5,friction:t=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,t)}function Ve({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),i=0,a=[];for(let u=0;u<n;u++){let d=Math.pow(o,u);a.push(d),i+=d;}let f=[0],c=0;for(let u=0;u<n;u++)c+=a[u]/i,f.push(c);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let d=0;d<n;d++)if(u<=f[d+1]){let h=(u-f[d])/(f[d+1]-f[d]);if(d===0)return h*(2-h);let w=1-Math.pow(r,d);return w+(1-w)*(2*h-1)*(2*h-1)}return 1}}function Be({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return i=>i<=0?0:i>=1?1:n*Math.pow(2,-10*i)*Math.sin((i-o)*(2*Math.PI)/r)+1}var Q={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:Fe(),bounce:Ve(),elastic:Be()};function be(e,t,n){return Math.min(n,Math.max(t,e))}function ie(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}var Ee=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function ye(e,t,n,r){return e+n+t*Ee(r,0)}function he(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Ee(e,1))}function q(e,t,n,r){return n===t?0:be((e-t)/(n-t)*r,0,1)}function se(e,t,n,r,o){let i=ye(e.top,e.height,t,r.element)-he(r.viewport,n),a=ye(e.top,e.height,t,o.element)-he(o.viewport,n);return {tStart:i,tEnd:a}}function ve(e,t,n){let r=e.getBoundingClientRect(),o=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left-t.clientLeft+t.scrollLeft:r.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function we(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let 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 r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function Se(e,t,n){let r=we(e),o=we(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var Ge="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Qe="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Me=33;function qe(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function je(e){let t=[];for(let n=0;n<Me;n++){let r=n/(Me-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Le(e){switch(e){case "linear":return "linear";case "ease-in":return Ge;case "ease-out":return Qe;case "ease-in-out":return qe()?je(Q["ease-in-out"]):null;default:return null}}var Te=Symbol.for("svg-scroll-draw.registry");function xe(){let e=globalThis;return e[Te]||(e[Te]=new Map)}function ae(e,t){xe().set(e,t);}function ue(e){xe().delete(e);}var Ye=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function j(e,...t){Ye&&console.warn(`[svg-scroll-draw] ${e}`,...t);}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 r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function Re(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=Pe(i=>{if(!i)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),o={};for(let i of Object.keys(n))o[i]=(...a)=>n[i]?.(...a);return o.destroy=()=>{r(),n.destroy();},o}var Y,ee=new Set,te=new WeakMap,U=new Map,$e=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ue(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function ne(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();Y??(Y=new ResizeObserver(o=>{let i=false;for(let{target:a}of o)te.get(a)!==$e(a)&&(i=true),te.set(a,"");i&&ee.forEach(a=>a());})),ee.add(n);let r=Ue(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{te.has(o)||te.set(o,$e(o)),U.set(o,(U.get(o)??0)+1),Y.observe(o);}),()=>{ee.delete(n)&&(r.forEach(o=>{let i=(U.get(o)??1)-1;if(i)return void U.set(o,i);U.delete(o),Y?.unobserve(o);}),ee.size||(Y?.disconnect(),Y=void 0));}}function Ce(e,t,n,r,o){let i,a=NaN,f,c,u=()=>{i=0,r(),!f&&!i&&(a=n())>0&&a<1&&(i=requestAnimationFrame(u));},d=()=>{!i&&!f&&n()!==a&&(i=requestAnimationFrame(u));},h=p=>{f=p,cancelAnimationFrame(i),i=a=NaN,d();},w=()=>{clearTimeout(c),o(),d();},M=()=>{clearTimeout(c),c=setTimeout(w,150);},x=ne(t,M),v=p=>{e[p]("scroll",d,{passive:true}),window[p]("resize",M),window[p]("orientationchange",M);};return v("addEventListener"),d(),{hold:h,remeasure:w,off(){h(true),v("removeEventListener"),x(),clearTimeout(c);}}}function Xe(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ae(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],i=[],a=r[2].trim();if(a)for(let f of a.split(/[\s,]+/)){let c=f.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(c?parseFloat(c[1]):0),i.push(c?c[2]:"");}t.push({fn:r[1],nums:o,units:i});}return t}function Ke(e,t,n){let r=Ae(e),o=Ae(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((i,a)=>{let f=o[a];return i.fn!==f.fn||i.nums.length!==f.nums.length?n<1?`${i.fn}(${i.nums.map((c,u)=>`${c}${i.units[u]}`).join(", ")})`:`${f.fn}(${f.nums.map((c,u)=>`${c}${f.units[u]}`).join(", ")})`:`${i.fn}(${i.nums.map((c,u)=>`${c+(f.nums[u]-c)*n}${i.units[u]}`).join(", ")})`}).join(" ")}function Ie(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Xe(r))return Se(r,o,n);if(r.includes("("))return Ke(r,o,n);let i=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let f=parseFloat(i[1]),c=parseFloat(a[1]);return `${f+(c-f)*n}${i[2]||a[2]}`}return n<1?r:o}function Ze(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Je=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),et=0,_e="--scroll-draw-progress";function tt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ke={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(e,t){return typeof window>"u"?ke:t.respectReducedMotion===false?He(e,t,false):Re(t,(n,r)=>He(e,n,r))}function He(e,t,n){let{props:r,trigger:o={},easing:i="ease-out",speed:a=1,once:f=false,axis:c="y",scrollContainer:u,native:d=true,velocityScale:h=false,triggerElement:w,onProgress:M,onComplete:x,onEnter:v,onLeave:p,onEnterBack:z,onLeaveBack:P}=t,A=typeof i=="function"?i:Q[i]??Q["ease-out"],H=ie(o.start||"top bottom"),W=ie(o.end||"bottom top"),C=w??e,S=typeof u=="string"?document.querySelector(u):u??null,y=Object.entries(r).map(([s,l])=>({prop:Ze(s),from:Array.isArray(l)?l[0]:"",to:Array.isArray(l)?l[1]:l}));function D(){let s=window.getComputedStyle(e);for(let l of y)l.from===""&&(l.from=s.getPropertyValue(l.prop).trim()||"0");}function X(){for(let s of y)e.style.setProperty(s.prop,String(s.to));}let m=new Map;for(let s of [...y.map(l=>l.prop),_e])m.set(s,e.style.getPropertyValue(s));function b(){for(let[s,l]of m)l?e.style.setProperty(s,l):e.style.removeProperty(s);}if(n)return X(),x?.(),{...ke,destroy:b,getProgress:()=>1};D();let F=()=>S?c==="x"?S.scrollLeft:S.scrollTop:c==="x"?window.scrollX:window.scrollY,ce=()=>S?c==="x"?S.clientWidth:S.clientHeight:c==="x"?window.innerWidth:window.innerHeight,me=typeof i=="string"?Le(i):null;function Oe(){if(!d||!tt()||!me||c!=="y"||S||C!==e||f||a!==1||M||x||v||p||z||P||h!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let s of y)if(!Je.has(s.prop))return false;return true}function ze(){let s=`ssd-a-${++et}`,l=y.map(g=>`${g.prop}:${g.from}`).join(";"),O=y.map(g=>`${g.prop}:${g.to}`).join(";"),$=document.createElement("style");$.setAttribute("data-ssd-animate",""),$.textContent=`@keyframes ${s}{from{${l}}to{${O}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${me};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild($),e.classList.add(s);let T=()=>{let g=e.getBoundingClientRect();return se({top:g.top,height:g.height},F(),ce(),H,W)};ae(e,{type:"animate",getProgress:()=>E.getProgress(),getTrigger:T});let E={refresh(){},destroy(){e.classList.remove(s),$.remove(),e.style.animationPlayState="",b(),ue(e);},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(g){let G=Math.min(1,Math.max(0,g));e.classList.remove(s);for(let J of y)e.style.setProperty(J.prop,Ie(J.from,J.to,G));},getProgress(){let{tStart:g,tEnd:G}=T();return A(q(F(),g,G,a))}};return E}if(Oe())return ze();let L=0,R=0,k=false,re=-1,N=0,I=0,K=false,_=NaN,oe=-1,fe=0,V=C===e?y:[],de=false;function pe(){let s=e.style,l=V.map(E=>s.getPropertyValue(E.prop)),O=s.transition;V.length&&(s.transition="none"),V.forEach(E=>s.setProperty(E.prop,m.get(E.prop)??""));let $=ve(C,S,c);V.forEach((E,g)=>s.setProperty(E.prop,l[g])),V.length&&(e.offsetWidth,s.transition=O);let T=se($,$.scroll,ce(),H,W);de&&Math.abs(T.tStart-L)<1&&Math.abs(T.tEnd-R)<1||(de=true,L=T.tStart,R=T.tEnd);}function Z(s){e.style.setProperty(_e,String(s));for(let l of y)e.style.setProperty(l.prop,Ie(l.from,l.to,s));M?.(s);}function We(s){if(isNaN(_)){_=s;return}_<=0&&s>0&&v?.(),_<1&&s>=1&&p?.(),_>=1&&s<1&&z?.(),_>0&&s<=0&&P?.(),_=s;}function De(){if(k)return;let s=performance.now(),l=F(),O=a;if(h!==false){let g=s-fe,G=g>0?Math.abs(l-(oe<0?l:oe))/g:0;O=a*Math.max(.2,1+G*(typeof h=="number"?h:1)*.04);}oe=l,fe=s;let $=R===L?0:(l-L)/(R-L);We($);let T=q(l,L,R,O),E=f?Math.max(re,A(N=Math.max(N,T))):A(T);I=E,Z(E),E>=1&&!K?(K=true,x?.()):E<1&&!f&&(K=false);}let B=Ce(S??window,[C],()=>q(F(),L,R,Math.min(a,1)),De,pe);pe(),R===L&&j("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),N=q(F(),L,R,a),I=A(N),Z(I),ae(e,{type:"animate",getProgress:()=>I,getTrigger:()=>({tStart:L,tEnd:R})});function ge(){k=true,B.hold(true);}return {destroy(){k=true,B.off(),b(),ue(e);},replay(){re=-1,N=0,K=false,I=0,k=false,Z(0),B.hold(false);},pause:ge,resume(){k&&(k=false,B.hold(false));},seek(s){let l=Math.min(1,Math.max(0,s));I=l,re=l,N=0,ge(),Z(l);},getProgress(){return I},refresh:B.remeasure}}var Ne={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function At(e,t={}){if(typeof window>"u")return Ne;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return j("scrollHorizontal: track element not found:",e),Ne;let r=n,{easing:o="linear",trigger:i={start:"top top",end:"bottom bottom"},scrollContainer:a,respectReducedMotion:f=false,onProgress:c}=t,u=typeof a=="string"?document.querySelector(a):a??null;function d(){for(let m=r.parentElement;m;m=m.parentElement)if(window.getComputedStyle(m).position==="sticky")return m;return null}function h(){let m=d();if(m){let b=window.getComputedStyle(m);return m.clientWidth-(parseFloat(b.paddingLeft)||0)-(parseFloat(b.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function w(){return t.distance??r.scrollWidth-h()}function M(){if(t.triggerElement!==void 0){let b=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(b)return b;j("scrollHorizontal: triggerElement not found:",t.triggerElement);}let m=d();return m?m.parentElement??m:r}let x=w(),v=M(),p=le(r,A(x,v)),z=H(),P=null;function A(m,b){return {props:{transform:["translateX(0px)",`translateX(${-m}px)`]},trigger:i,easing:o,native:false,respectReducedMotion:f,...b!==r&&{triggerElement:b},...a!==void 0&&{scrollContainer:a},...c!==void 0&&{onProgress:c}}}function H(){let m=v.getBoundingClientRect(),b=u?m.top-u.getBoundingClientRect().top+u.scrollTop:m.top+window.scrollY;return `${w()} ${Math.round(b)} ${Math.round(m.height)}`}function W(){p.destroy();let m=M(),b=m!==v;x=w(),v=m,p=le(r,A(x,v)),z=H(),P!==null&&p.seek(P),b&&X();}let C;function S(){(M()!==v||H()!==z)&&W();}function y(){clearTimeout(C),C=setTimeout(S,150);}window.addEventListener("resize",y),window.addEventListener("orientationchange",y);let D=()=>{};function X(){D(),D=ne([r,v],y);}return X(),{destroy(){clearTimeout(C),window.removeEventListener("resize",y),window.removeEventListener("orientationchange",y),D(),p.destroy();},replay(){P=null,p.replay();},pause(){p.pause(),P=p.getProgress();},resume(){P=null,p.resume();},seek(m){p.seek(m),P=p.getProgress();},getProgress(){return p.getProgress()},refresh(){W();}}}exports.scrollHorizontal=At;
@@ -1,4 +1,4 @@
1
- import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-MswK0erX.mjs';
1
+ import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-9bcJdVcg.mjs';
2
2
 
3
3
  interface ScrollHorizontalOptions {
4
4
  /**
@@ -43,7 +43,7 @@ interface ScrollHorizontalOptions {
43
43
  * motion. It advances only as the user scrolls, 1:1 with their input, so it is
44
44
  * direct manipulation rather than something that plays at them. And the
45
45
  * alternative is worse than the motion — the panels are only reachable *via*
46
- * the transform, inside a sticky `overflow: hidden` container, so applying a
46
+ * the transform, inside a sticky `overflow: clip` stage, so applying a
47
47
  * final state (or none at all) silently hides all of the content except one
48
48
  * panel from exactly the users who asked for less motion.
49
49
  *
@@ -69,15 +69,18 @@ interface ScrollHorizontalInstance extends ScrollDrawInstance {
69
69
  *
70
70
  * Minimal CSS setup:
71
71
  * .outer { height: 400vh; }
72
- * .sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
72
+ * .sticky { position: sticky; top: 0; height: 100vh; overflow: clip; }
73
73
  * .track { display: flex; width: max-content; }
74
74
  *
75
+ * `overflow: clip`, not `hidden`: a hidden stage is still a scroll container,
76
+ * so Tab to a panel off to the side scrolls the stage itself and leaves the
77
+ * strip shifted against the page. Keyboard users then need the page scrolled
78
+ * to the focused panel; the horizontal-scroll generator writes that handler.
79
+ *
75
80
  * @example
76
- * scrollHorizontal('.track', {
77
- * distance: 3 * window.innerWidth,
78
- * trigger: { start: 'top top', end: 'bottom bottom' },
79
- * easing: 'linear',
80
- * });
81
+ * // Measures its own travel (the track's width less the stage's) and follows
82
+ * // the layout: pass `distance` only for a fixed number of pixels.
83
+ * scrollHorizontal('.track');
81
84
  */
82
85
  declare function scrollHorizontal(track: string | Element, options?: ScrollHorizontalOptions): ScrollHorizontalInstance;
83
86
 
@@ -1,4 +1,4 @@
1
- import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-MswK0erX.js';
1
+ import { S as ScrollDrawInstance, T as TriggerConfig, E as EasingName } from '../types-9bcJdVcg.js';
2
2
 
3
3
  interface ScrollHorizontalOptions {
4
4
  /**
@@ -43,7 +43,7 @@ interface ScrollHorizontalOptions {
43
43
  * motion. It advances only as the user scrolls, 1:1 with their input, so it is
44
44
  * direct manipulation rather than something that plays at them. And the
45
45
  * alternative is worse than the motion — the panels are only reachable *via*
46
- * the transform, inside a sticky `overflow: hidden` container, so applying a
46
+ * the transform, inside a sticky `overflow: clip` stage, so applying a
47
47
  * final state (or none at all) silently hides all of the content except one
48
48
  * panel from exactly the users who asked for less motion.
49
49
  *
@@ -69,15 +69,18 @@ interface ScrollHorizontalInstance extends ScrollDrawInstance {
69
69
  *
70
70
  * Minimal CSS setup:
71
71
  * .outer { height: 400vh; }
72
- * .sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
72
+ * .sticky { position: sticky; top: 0; height: 100vh; overflow: clip; }
73
73
  * .track { display: flex; width: max-content; }
74
74
  *
75
+ * `overflow: clip`, not `hidden`: a hidden stage is still a scroll container,
76
+ * so Tab to a panel off to the side scrolls the stage itself and leaves the
77
+ * strip shifted against the page. Keyboard users then need the page scrolled
78
+ * to the focused panel; the horizontal-scroll generator writes that handler.
79
+ *
75
80
  * @example
76
- * scrollHorizontal('.track', {
77
- * distance: 3 * window.innerWidth,
78
- * trigger: { start: 'top top', end: 'bottom bottom' },
79
- * easing: 'linear',
80
- * });
81
+ * // Measures its own travel (the track's width less the stage's) and follows
82
+ * // the layout: pass `distance` only for a fixed number of pixels.
83
+ * scrollHorizontal('.track');
81
84
  */
82
85
  declare function scrollHorizontal(track: string | Element, options?: ScrollHorizontalOptions): ScrollHorizontalInstance;
83
86
 
@@ -1 +1 @@
1
- import {a}from'../chunk-V4L3ELVC.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
1
+ import {a}from'../chunk-VJ5ZU55P.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
@@ -1,4 +1,4 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-MswK0erX.js';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.js';
2
2
 
3
3
  interface ScrollCounterOptions {
4
4
  from?: number;
@@ -1,5 +1,5 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-MswK0erX.mjs';
2
- import { S as ScrollAnimateOptions } from './engine-o1VSQ1lX.mjs';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.mjs';
2
+ import { S as ScrollAnimateOptions } from './engine-BLWKCfxC.mjs';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
@@ -1,4 +1,4 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-MswK0erX.mjs';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.mjs';
2
2
 
3
3
  interface ScrollCounterOptions {
4
4
  from?: number;
@@ -1,5 +1,5 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-MswK0erX.js';
2
- import { S as ScrollAnimateOptions } from './engine-B7UpB4fT.js';
1
+ import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from './types-9bcJdVcg.js';
2
+ import { S as ScrollAnimateOptions } from './engine-6VsjEwzb.js';
3
3
 
4
4
  interface ScrollParallaxOptions {
5
5
  speed?: number;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';function lr({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Ot({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),a=0,c=[];for(let p=0;p<t;p++){let T=Math.pow(s,p);c.push(T),a+=T;}let m=[0],u=0;for(let p=0;p<t;p++)u+=c[p]/a,m.push(u);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<t;T++)if(p<=m[T+1]){let A=(p-m[T])/(m[T+1]-m[T]);if(T===0)return A*(2-A);let b=1-Math.pow(n,T);return b+(1-b)*(2*A-1)*(2*A-1)}return 1}}function Rt({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-s)*(2*Math.PI)/n)+1}var Z={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Ot(),elastic:Rt()};function Ft(e,r,t){return Math.min(t,Math.max(r,e))}function Pe(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}function Nt(e,r,t,n){switch(n){case "top":return e+t;case "center":return e+t+r/2;case "bottom":return e+t+r;default:return e+t}}function Ht(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 re(e,r,t,n){return t===r?0:Ft((e-r)/(t-r)*n,0,1)}function Ne(e,r,t,n,s){let a=Nt(e.top,e.height,r,n.element)-Ht(n.viewport,t),c=Nt(e.top,e.height,r,s.element)-Ht(s.viewport,t);return {tStart:a,tEnd:c}}function nt(e,r,t){let n=e.getBoundingClientRect(),s=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:n.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function We(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function _t(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function ot(e,r,t){let n=_t(e),s=_t(r);return !n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var bt={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 Ye=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function G(e,...r){Ye&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var cr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",ur="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Vt=33;function mr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function fr(e){let r=[];for(let t=0;t<Vt;t++){let n=t/(Vt-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function st(e){switch(e){case "linear":return "linear";case "ease-in":return cr;case "ease-out":return ur;case "ease-in-out":return mr()?fr(Z["ease-in-out"]):null;default:return null}}var zt=Symbol.for("svg-scroll-draw.registry");function qt(){let e=globalThis;return e[zt]||(e[zt]=new Map)}function $e(e,r){qt().set(e,r);}function ve(e){qt().delete(e);}var Xe,it=new Set,at=new WeakMap,Ze=new Map,Wt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function pr(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function Be(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();Xe??(Xe=new ResizeObserver(s=>{let a=false;for(let{target:c}of s)at.get(c)!==Wt(c)&&(a=true),at.set(c,"");a&&it.forEach(c=>c());})),it.add(t);let n=pr(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{at.has(s)||at.set(s,Wt(s)),Ze.set(s,(Ze.get(s)??0)+1),Xe.observe(s);}),()=>{it.delete(t)&&(n.forEach(s=>{let a=(Ze.get(s)??1)-1;if(a)return void Ze.set(s,a);Ze.delete(s),Xe?.unobserve(s);}),it.size||(Xe?.disconnect(),Xe=void 0));}}function lt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function Ge(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=lt(a=>{if(!a)return;n();let c=(t.getProgress?.()??0)>=1;t.destroy(),t=r(c?{...e,onComplete:void 0}:e,true);}),s={};for(let a of Object.keys(t))s[a]=(...c)=>t[a]?.(...c);return s.destroy=()=>{n(),t.destroy();},s}var dr=0;function gr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Bt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var Gt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function yr(e){if(!Ye)return;let r=Bt(e,"stroke");if(!r||r==="none"){G("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Gt.has(t)&&!Gt.has(Bt(e,"fill"))&&G("Element has a fill \u2014 it may obscure the stroke animation.",e);}function hr(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let a=t==="x"?window.scrollX:window.scrollY,c=e-a,m=r-a,u=t==="x";n.innerHTML=`
1
+ 'use strict';function Dt({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Ot({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,c=[];for(let p=0;p<t;p++){let v=Math.pow(s,p);c.push(v),i+=v;}let m=[0],u=0;for(let p=0;p<t;p++)u+=c[p]/i,m.push(u);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let v=0;v<t;v++)if(p<=m[v+1]){let S=(p-m[v])/(m[v+1]-m[v]);if(v===0)return S*(2-S);let h=1-Math.pow(n,v);return h+(1-h)*(2*S-1)*(2*S-1)}return 1}}function It({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var U={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:Dt(),bounce:Ot(),elastic:It()};function Rt(e,r,t){return Math.min(t,Math.max(r,e))}function Te(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}var Ft=(e,r)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:r;function Nt(e,r,t,n){return e+t+r*Ft(n,0)}function Ht(e,r){return r*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Ft(e,1))}function X(e,r,t,n){return t===r?0:Rt((e-r)/(t-r)*n,0,1)}function $e(e,r,t,n,s){let i=Nt(e.top,e.height,r,n.element)-Ht(n.viewport,t),c=Nt(e.top,e.height,r,s.element)-Ht(s.viewport,t);return {tStart:i,tEnd:c}}function Ke(e,r,t){let n=e.getBoundingClientRect(),s=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:n.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function Je(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(n+s)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function _t(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function et(e,r,t){let n=_t(e),s=_t(r);return !n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var dt={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 Fe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function W(e,...r){Fe&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var cr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",ur="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Vt=33;function mr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function fr(e){let r=[];for(let t=0;t<Vt;t++){let n=t/(Vt-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function tt(e){switch(e){case "linear":return "linear";case "ease-in":return cr;case "ease-out":return ur;case "ease-in-out":return mr()?fr(U["ease-in-out"]):null;default:return null}}var Gt=Symbol.for("svg-scroll-draw.registry");function Wt(){let e=globalThis;return e[Gt]||(e[Gt]=new Map)}function Me(e,r){Wt().set(e,r);}function pe(e){Wt().delete(e);}function rt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function _e(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=rt(i=>{if(!i)return;n();let c=(t.getProgress?.()??0)>=1;t.destroy(),t=r(c?{...e,onComplete:void 0}:e,true);}),s={};for(let i of Object.keys(t))s[i]=(...c)=>t[i]?.(...c);return s.destroy=()=>{n(),t.destroy();},s}var je,nt=new Set,ot=new WeakMap,Qe=new Map,zt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function pr(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function Bt(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();je??(je=new ResizeObserver(s=>{let i=false;for(let{target:c}of s)ot.get(c)!==zt(c)&&(i=true),ot.set(c,"");i&&nt.forEach(c=>c());})),nt.add(t);let n=pr(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{ot.has(s)||ot.set(s,zt(s)),Qe.set(s,(Qe.get(s)??0)+1),je.observe(s);}),()=>{nt.delete(t)&&(n.forEach(s=>{let i=(Qe.get(s)??1)-1;if(i)return void Qe.set(s,i);Qe.delete(s),je?.unobserve(s);}),nt.size||(je?.disconnect(),je=void 0));}}function Ve(e,r,t,n,s){let i,c=NaN,m,u,p=()=>{i=0,n(),!m&&!i&&(c=t())>0&&c<1&&(i=requestAnimationFrame(p));},v=()=>{!i&&!m&&t()!==c&&(i=requestAnimationFrame(p));},S=y=>{m=y,cancelAnimationFrame(i),i=c=NaN,v();},h=()=>{clearTimeout(u),s(),v();},O=()=>{clearTimeout(u),u=setTimeout(h,150);},ee=Bt(r,O),A=y=>{e[y]("scroll",v,{passive:true}),window[y]("resize",O),window[y]("orientationchange",O);};return A("addEventListener"),v(),{hold:S,remeasure:h,off(){S(true),A("removeEventListener"),ee(),clearTimeout(u);}}}var dr=0;function gr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function qt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var jt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function yr(e){if(!Fe)return;let r=qt(e,"stroke");if(!r||r==="none"){W("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!jt.has(t)&&!jt.has(qt(e,"fill"))&&W("Element has a fill \u2014 it may obscure the stroke animation.",e);}function hr(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=t==="x"?window.scrollX:window.scrollY,c=e-i,m=r-i,u=t==="x";n.innerHTML=`
2
2
  <div style="position:absolute;${u?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${u?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var jt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Qt=/[MmLlHhVvCcSsQqTtAaZz]/g;function br(e,r,t){if(!Ye)return;let n=(e.match(Qt)??[]).join("").toUpperCase(),s=(r.match(Qt)??[]).join("").toUpperCase(),a=(e.match(jt)??[]).length,c=(r.match(jt)??[]).length;if(n!==s){G(`morphTo: command sequence differs (${n||"\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.`,t);return}a!==c&&G(`morphTo: coordinate count differs (${a} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function wr(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let c=parseFloat(a),m=n[s++]??c;return String(+(c+(m-c)*t).toFixed(4))})}function Ut(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(r,(t,n)=>vr(e,t,n))}function vr(e,r,t){let{preset:n,...s}=r,a=n?{...bt[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:m=1,fade:u=false,easing:p="linear",trigger:T={},stagger:A=0,direction:b="forward",once:K=false,debug:se=false,axis:R="y",scrollContainer:v,autoReverse:M=false,delay:f=0,strokeColor:w,strokeWidth:y,fillOpacity:z,waypoints:_,velocityScale:$=false,threshold:q=0,rootMargin:ke="0px",repeat:ce=0,repeatDelay:fe=0,morphTo:W,clip:ie,autoplay:Ce=false,duration:Ie=1e3,native:Ee=true,onProgress:Se,onStart:h,onComplete:E,onEnter:pe,onLeave:He,onEnterBack:de,onLeaveBack:Ve}=a,B=ie===true?"left":typeof ie=="string"?ie:false,j=typeof p=="function"?p:Z[p]??Z.linear,_e=Pe(T.start||"top bottom"),ge=Pe(T.end||"bottom top"),J=typeof v=="string"?document.querySelector(v):v??null,xe=Array.isArray(w)?w[0]:null,ae=Array.isArray(w)?w[1]:typeof w=="string"?w:null,ye=Array.isArray(y)?y[0]:null,he=Array.isArray(y)?y[1]:typeof y=="number"?y:null,le=Array.isArray(z)?z[0]:null,De=Array.isArray(z)?z[1]:typeof z=="number"?z:null;function be(o){let i=o*100;switch(B){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let D=B?[]:Array.from(e.querySelectorAll(c)),k=[],ee=[],te=0,l=0,d=A,Te=0,L=false,C=false,x=0,I=false,ue=-1,me=[],Ke=-1,Q=false,we=0,Me=0,Oe,mt=null;function xt(){mt?.destroy(),mt=null;}let Re=new Set,Tt=NaN,Fe=true,Je=-1,Mt=performance.now(),ze=NaN;function je(){return J?R==="x"?J.scrollLeft:J.scrollTop:R==="x"?window.scrollX:window.scrollY}function At(){return J?R==="x"?J.clientWidth:J.clientHeight:R==="x"?window.innerWidth:window.innerHeight}function Lt(){let o=nt(e,J,R);return Ne(o,o.scroll,At(),_e,ge)}function tr(){let o=l-te,i=D.length-1,g=J??document.documentElement,F=R==="x"?"Width":"Height";if(d=A,A>0&&i>0&&o>0){let ne=g[`scroll${F}`]-g[`client${F}`]-1-te-o/m;ne>=0&&(d=Math.min(A,ne/(i*o)));}Te=l+i*d*o;}function Pt(){(({tStart:te,tEnd:l}=Lt())),tr(),se&&Ye&&(xt(),mt=hr(te,l,R));}function ft(o,i=Lt){$e(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:i});let g=o.destroy;return o.destroy=()=>{g.call(o),ve(e);},o}function $t(o,i){return K&&!M?Math.max(ue,j(me[o]=Math.max(me[o]??0,i))):j(i)}function rr(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),B){let g=i==="reverse"?1-o:o;e.style.clipPath=be(g);return}D.forEach((g,F)=>pt(g,F,o,i));}function pt(o,i,g,F){o.style.strokeDashoffset=F==="reverse"?`${k[i]*g}`:`${k[i]*(1-g)}`,u&&(o.style.opacity=F==="reverse"?`${1-g}`:`${g}`),xe&&ae?o.style.stroke=ot(xe,ae,g):ae&&(o.style.stroke=ae),ye!==null&&he!==null?o.style.strokeWidth=`${ye+(he-ye)*g}`:he!==null&&(o.style.strokeWidth=`${he}`),le!==null&&De!==null?o.style.fillOpacity=`${le+(De-le)*g}`:De!==null&&(o.style.fillOpacity=`${De}`),W&&o.tagName.toLowerCase()==="path"&&ee[i]&&o.setAttribute("d",wr(ee[i],W,g));}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),B){e.style.clipPath=be(b==="reverse"?1:0);return}D.forEach((o,i)=>{o.style.strokeDasharray=`${k[i]}`,o.style.strokeDashoffset=b==="reverse"?"0":`${k[i]}`,u?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",xe&&(o.style.stroke=xe),ye!==null&&(o.style.strokeWidth=`${ye}`),le!==null&&(o.style.fillOpacity=`${le}`),W&&o.tagName.toLowerCase()==="path"&&ee[i]&&o.setAttribute("d",ee[i]);});}if(D.forEach(o=>{yr(o);let i=We(o);k.push(i);let g=o.tagName.toLowerCase()==="path";g?ee.push(o.getAttribute("d")??""):ee.push(""),W&&(g?br(ee[ee.length-1],W,o):G(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=b==="reverse"?`${i}`:"0",u&&(o.style.opacity="1"),ae&&(o.style.stroke=ae),he!==null&&(o.style.strokeWidth=`${he}`),De!==null&&(o.style.fillOpacity=`${De}`),W&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",W)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=b==="reverse"?"0":`${i}`,u?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",xe&&(o.style.stroke=xe),ye!==null&&(o.style.strokeWidth=`${ye}`),le!==null&&(o.style.fillOpacity=`${le}`));}),t)return B&&(e.style.clipPath=be(1)),E?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};B&&(e.style.clipPath=be(b==="reverse"?1:0));let kt=typeof p=="string"?st(p):null;function nr(){return !(Ee===false||Ce||se||!gr()||!D.length||!kt||B||R!=="y"||J||m!==1||A!==0||K||M||$!==false||W||_||ce||f>0||Se||h||E||pe||He||de||Ve||w!=null||y!=null||z!=null||(T.start||"top bottom").trim()!=="top bottom"||(T.end||"bottom top").trim()!=="bottom top")}function or(){let o=++dr,i=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,F=`--svg-scroll-draw-${o}`,ne=b==="reverse"?"0":"var(--ssd-len)",Ae=b==="reverse"?"var(--ssd-len)":"0",oe=`stroke-dashoffset:${ne};`,O=`stroke-dashoffset:${Ae};`;u&&(oe+=`opacity:${b==="reverse"?1:0};`,O+=`opacity:${b==="reverse"?0:1};`);let N=document.createElement("style");N.setAttribute("data-svg-scroll-draw",""),N.textContent=`@keyframes ${i}{from{${oe}}to{${O}}}.${g}{view-timeline-name:${F};view-timeline-axis:block;}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${kt};animation-fill-mode:both;animation-timeline:${F};animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(g);function U(S,P){S.style.setProperty("--ssd-len",String(k[P])),S.style.strokeDasharray=`${k[P]}`,S.style.strokeDashoffset="",S.style.opacity="",S.style.animationPlayState="",S.classList.add(i);}D.forEach(U);let Y=false,H=-1;function V(){if(H>=0)return H;let S=e.getBoundingClientRect(),{tStart:P,tEnd:X}=Ne({top:S.top,height:S.height},je(),At(),_e,ge);return j(re(je(),P,X,m))}return {destroy(){e.classList.remove(g),D.forEach(S=>{S.classList.remove(i),S.style.removeProperty("--ssd-len"),S.style.animationPlayState="";}),N.remove();},replay(){Y=false,H=-1,D.forEach(U);},pause(){Y=true,D.forEach(S=>{S.style.animationPlayState="paused";});},resume(){Y&&(Y=false,D.forEach(S=>{S.style.animationPlayState="running";}));},seek(S){let P=Math.min(1,Math.max(0,S));H=P,Y=true,D.forEach((X,Le)=>{X.classList.remove(i),X.style.strokeDashoffset=b==="reverse"?`${k[Le]*P}`:`${k[Le]*(1-P)}`,u&&(X.style.opacity=b==="reverse"?`${1-P}`:`${P}`);});},getProgress(){return V()},refresh(){D.forEach((S,P)=>{k[P]=We(S),S.style.setProperty("--ssd-len",String(k[P])),S.style.strokeDasharray=`${k[P]}`;});}}}if(nr())return ft(or());function sr(){let o=Math.max(1,Ie),i=B?o:o*(1+Math.max(0,D.length-1)*A),g=0,F=0,ne=false;function Ae(H){let V=true,S=Math.min(1,Math.max(0,H/i));if(B){let P=Math.min(1,Math.max(0,H/o)),X=j(P);we=X,e.style.setProperty("--scroll-draw-progress",String(X)),e.style.clipPath=be(b==="reverse"?1-X:X),Se?.(X),P<1&&(V=false);}else {D.forEach((X,Le)=>{let ar=Le*A*o,Dt=Math.min(1,Math.max(0,(H-ar)/o));pt(X,Le,j(Dt),b),Dt<1&&(V=false);});let P=j(S);we=P,Se?.(P),e.style.setProperty("--scroll-draw-progress",String(P));}if(_){let P=j(S);for(let X in _){let Le=parseFloat(X);P>=Le&&!Re.has(Le)&&(Re.add(Le),_[X]?.());}}return V}function oe(H){if(Q)return;let V=H-g;C||(C=true,h?.());let S=Ae(V);if(S&&!L){L=true,Ae(i),E?.(),Me<(ce==="infinite"?1/0:ce??0)&&(Me++,Oe=setTimeout(()=>{g=performance.now(),C=false,L=false,Re.clear(),Qe(),x=requestAnimationFrame(oe);},fe));return}S||(x=requestAnimationFrame(oe));}function O(){cancelAnimationFrame(x),clearTimeout(Oe),g=performance.now(),F=0,Q=false,C=false,L=false,Me=0,ne=true,we=0,Re.clear(),Qe(),x=requestAnimationFrame(oe);}let N=new IntersectionObserver(H=>{H.forEach(V=>{V.isIntersecting&&!(K&&L)?O():!V.isIntersecting&&!K&&!L&&(cancelAnimationFrame(x),clearTimeout(Oe),ne=false);});},{root:J??null,threshold:q,rootMargin:ke}),U;function Y(){clearTimeout(U),U=setTimeout(()=>{D.forEach((H,V)=>{k[V]=We(H),H.style.strokeDasharray=`${k[V]}`;});},150);}return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),f>0?setTimeout(()=>N.observe(e),f):N.observe(e),{destroy(){cancelAnimationFrame(x),clearTimeout(Oe),N.disconnect(),window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y),clearTimeout(U);},replay(){Me=0,O();},pause(){Q||!ne||(Q=true,F=performance.now()-g,cancelAnimationFrame(x));},resume(){Q&&(Q=false,ne=true,g=performance.now()-F,x=requestAnimationFrame(oe));},seek(H){let V=Math.min(1,Math.max(0,H));we=V,Q=true,F=V*i,g=performance.now()-F,cancelAnimationFrame(x),Ae(F);},getProgress(){return we},refresh(){clearTimeout(U),D.forEach((H,V)=>{k[V]=We(H),H.style.strokeDasharray=`${k[V]}`;});}}}if(Ce)return ft(sr());Pt();function Ct(){if(Q||!qe)return;let o=performance.now(),i=je();if(!Fe&&$===false&&i===Tt){gt(i);return}Fe=false,Tt=i;let g=m;if($!==false){let O=o-Mt,N=O>0?Math.abs(i-(Je<0?i:Je))/O:0;g=m*Math.max(.2,1+N*(typeof $=="number"?$:1)*.04);}Je=i,Mt=o;let F=M?Ke===-1||i>=Ke?"forward":"reverse":b;Ke=i;let ne=l-te,Ae=true,oe=ne===0?0:(i-te)/ne;if(isNaN(ze)||(ze<=0&&oe>0?pe?.():ze>0&&oe<=0&&Ve?.(),ze<1&&oe>=1?He?.():ze>=1&&oe<1&&de?.()),ze=oe,B){let O=$t(0,re(i,te,l,g));we=O,e.style.setProperty("--scroll-draw-progress",String(O));let N=F==="reverse"?1-O:O;e.style.clipPath=be(N),Se?.(O),!C&&re(i,te,l,g)>0&&(C=true,h?.()),O>=1&&!L?(L=true,E?.(),Me<(ce==="infinite"?1/0:ce??0)&&(Me++,Oe=setTimeout(()=>{ue=-1,me=[],C=false,L=false,Qe();},fe))):O<1&&!K&&(L=false),gt(i);return}if(D.forEach((O,N)=>{let U=N*d*ne,Y=$t(N,re(i,te+U,l+U,g));pt(O,N,Y,F),N===0&&(we=Y,Se?.(Y),e.style.setProperty("--scroll-draw-progress",String(Y))),Y<1&&(Ae=false);}),_){let O=j(re(i,te,l,g));for(let N in _){let U=parseFloat(N);O>=U&&!Re.has(U)&&(Re.add(U),_[N]?.());}}!C&&re(i,te,l,g)>0&&(C=true,h?.()),Ae&&!L?(L=true,E?.(),Me<(ce==="infinite"?1/0:ce??0)&&(Me++,Oe=setTimeout(()=>{ue=-1,me=[],C=false,L=false,Re.clear(),Qe(),Fe=true;},fe))):!Ae&&!K&&(L=false),gt(i);}function dt(o){return o>=l&&o<Te}function gt(o){I||dt(o)?x=requestAnimationFrame(Ct):qe=false;}function yt(){return I||dt(je())}let qe=false;function et(){qe||(qe=true,x=requestAnimationFrame(function(){Ct();}));}function tt(){qe=false,cancelAnimationFrame(x);}let ht=new IntersectionObserver(o=>{o.forEach(i=>{I=i.isIntersecting,I&&!Q?(Fe=true,et()):qe&&!Q&&dt(je())||tt();});},{root:J??null,threshold:q,rootMargin:ke});function It(){D.forEach((o,i)=>{k[i]=We(o),o.style.strokeDasharray=`${k[i]}`;}),Pt(),Fe=true;}let rt;function Ue(){clearTimeout(rt),rt=setTimeout(It,150);}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let ir=Be([e],Ue);return f>0?setTimeout(()=>ht.observe(e),f):ht.observe(e),ft({destroy(){cancelAnimationFrame(x),clearTimeout(Oe),tt(),ht.disconnect(),ir(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(rt),xt();},replay(){ue=-1,me=[],Ke=-1,Je=-1,C=false,L=false,Me=0,Q=false,we=0,Re.clear(),clearTimeout(Oe),Qe(),Fe=true,yt()&&et();},pause(){Q=true,tt();},resume(){Q&&(Q=false,Fe=true,yt()&&et());},seek(o){let i=Math.min(1,Math.max(0,o));we=i,ue=i,me=[],Q=true,tt(),rr(i,b),Fe=true;},getProgress(){return we},refresh(){clearTimeout(rt),It(),yt()&&!Q&&et();}},()=>({tStart:te,tEnd:l}))}function Er(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?Ut(n,r):(G("Container not found:",e),t)}function Sr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Yt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],a=[],c=n[2].trim();if(c)for(let m of c.split(/[\s,]+/)){let u=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),a.push(u?u[2]:"");}r.push({fn:n[1],nums:s,units:a});}return r}function xr(e,r,t){let n=Yt(e),s=Yt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((a,c)=>{let m=s[c];return a.fn!==m.fn||a.nums.length!==m.nums.length?t<1?`${a.fn}(${a.nums.map((u,p)=>`${u}${a.units[p]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,p)=>`${u}${m.units[p]}`).join(", ")})`:`${a.fn}(${a.nums.map((u,p)=>`${u+(m.nums[p]-u)*t}${a.units[p]}`).join(", ")})`}).join(" ")}function Xt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(Sr(n))return ot(n,s,t);if(n.includes("("))return xr(n,s,t);let a=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(a&&c){let m=parseFloat(a[1]),u=parseFloat(c[1]);return `${m+(u-m)*t}${a[2]||c[2]}`}return t<1?n:s}function Tr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Mr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ar=0,Zt="--scroll-draw-progress";function Lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,r){return typeof window>"u"?Jt:r.respectReducedMotion===false?Kt(e,r,false):Ge(r,(t,n)=>Kt(e,t,n))}function Kt(e,r,t){let{props:n,trigger:s={},easing:a="ease-out",speed:c=1,once:m=false,axis:u="y",scrollContainer:p,native:T=true,velocityScale:A=false,triggerElement:b,onProgress:K,onComplete:se,onEnter:R,onLeave:v,onEnterBack:M,onLeaveBack:f}=r,w=typeof a=="function"?a:Z[a]??Z["ease-out"],y=Pe(s.start||"top bottom"),z=Pe(s.end||"bottom top"),_=b??e,$=typeof p=="string"?document.querySelector(p):p??null,q=Object.entries(n).map(([l,d])=>({prop:Tr(l),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function ke(){let l=window.getComputedStyle(e);for(let d of q)d.from===""&&(d.from=l.getPropertyValue(d.prop).trim()||"0");}function ce(){for(let l of q)e.style.setProperty(l.prop,String(l.to));}let fe=new Map;for(let l of [...q.map(d=>d.prop),Zt])fe.set(l,e.style.getPropertyValue(l));function W(){for(let[l,d]of fe)d?e.style.setProperty(l,d):e.style.removeProperty(l);}if(t)return ce(),se?.(),{...Jt,destroy:W,getProgress:()=>1};ke();let ie=()=>$?u==="x"?$.scrollLeft:$.scrollTop:u==="x"?window.scrollX:window.scrollY,Ce=()=>$?u==="x"?$.clientWidth:$.clientHeight:u==="x"?window.innerWidth:window.innerHeight,Ie=typeof a=="string"?st(a):null;function Ee(){if(!T||!Lr()||!Ie||u!=="y"||$||_!==e||m||c!==1||K||se||R||v||M||f||A!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let l of q)if(!Mr.has(l.prop))return false;return true}function Se(){let l=`ssd-a-${++Ar}`,d=q.map(I=>`${I.prop}:${I.from}`).join(";"),Te=q.map(I=>`${I.prop}:${I.to}`).join(";"),L=document.createElement("style");L.setAttribute("data-ssd-animate",""),L.textContent=`@keyframes ${l}{from{${d}}to{${Te}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ie};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(L),e.classList.add(l);let C=()=>{let I=e.getBoundingClientRect();return Ne({top:I.top,height:I.height},ie(),Ce(),y,z)};$e(e,{type:"animate",getProgress:()=>x.getProgress(),getTrigger:C});let x={refresh(){},destroy(){e.classList.remove(l),L.remove(),e.style.animationPlayState="",W(),ve(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(I){let ue=Math.min(1,Math.max(0,I));e.classList.remove(l);for(let me of q)e.style.setProperty(me.prop,Xt(me.from,me.to,ue));},getProgress(){let{tStart:I,tEnd:ue}=C();return w(re(ie(),I,ue,c))}};return x}if(Ee())return Se();let h=0,E=0,pe=0,He=false,de=false,Ve=-1,B=0,j=0,_e=false,ge=NaN,J=-1,xe=0,ae=_===e?q:[],ye=false;function he(){let l=e.style,d=ae.map(x=>l.getPropertyValue(x.prop)),Te=l.transition;ae.length&&(l.transition="none"),ae.forEach(x=>l.setProperty(x.prop,fe.get(x.prop)??""));let L=nt(_,$,u);ae.forEach((x,I)=>l.setProperty(x.prop,d[I])),ae.length&&(e.offsetWidth,l.transition=Te);let C=Ne(L,L.scroll,Ce(),y,z);ye&&Math.abs(C.tStart-h)<1&&Math.abs(C.tEnd-E)<1||(ye=true,h=C.tStart,E=C.tEnd);}function le(l){e.style.setProperty(Zt,String(l));for(let d of q)e.style.setProperty(d.prop,Xt(d.from,d.to,l));K?.(l);}function De(l){if(isNaN(ge)){ge=l;return}ge<=0&&l>0?R?.():ge>0&&l<=0&&f?.(),ge<1&&l>=1?v?.():ge>=1&&l<1&&M?.(),ge=l;}function be(){if(!He||de)return;let l=performance.now(),d=ie(),Te=c;if(A!==false){let I=l-xe,ue=I>0?Math.abs(d-(J<0?d:J))/I:0;Te=c*Math.max(.2,1+ue*(typeof A=="number"?A:1)*.04);}J=d,xe=l;let L=E===h?0:(d-h)/(E-h);De(L);let C=re(d,h,E,Te),x=m?Math.max(Ve,w(B=Math.max(B,C))):w(C);j=x,le(x),x>=1&&!_e?(_e=true,se?.()):x<1&&!m&&(_e=false),pe=requestAnimationFrame(be);}he(),E===h&&G("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e),B=re(ie(),h,E,c),j=w(B),le(j);let D=new IntersectionObserver(l=>{l.forEach(d=>{He=d.isIntersecting,He&&!de?pe=requestAnimationFrame(be):cancelAnimationFrame(pe);});},{root:$??null}),k;function ee(){clearTimeout(k),k=setTimeout(he,150);}window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee);let te=Be([_],ee);return D.observe(e),$e(e,{type:"animate",getProgress:()=>j,getTrigger:()=>({tStart:h,tEnd:E})}),{destroy(){cancelAnimationFrame(pe),D.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),te(),clearTimeout(k),W(),ve(e);},replay(){Ve=-1,B=0,_e=false,j=0,de=false,le(0);},pause(){de=true,cancelAnimationFrame(pe);},resume(){de&&(de=false,He&&(pe=requestAnimationFrame(be)));},seek(l){let d=Math.min(1,Math.max(0,l));j=d,Ve=d,B=0,de=true,cancelAnimationFrame(pe),le(d);},getProgress(){return j},refresh(){he();}}}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Pr(e,r){if(typeof window>"u")return ct;let t=typeof e=="string"?document.querySelector(e):e;return t?wt(t,r):(G("scrollAnimate: element not found:",e),ct)}function $r(e,r={}){if(typeof window>"u")return ct;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return G("scrollParallax: element not found:",e),ct;let{speed:n=.3,axis:s="y",easing:a="linear",trigger:c,onProgress:m}=r,u=-n*100,p=t.style,T=!!t.ownerSVGElement,A=p.getPropertyValue("transform-box");T&&p.setProperty("transform-box","fill-box");let b=wt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:m});return T?{...b,destroy(){b.destroy(),p.setProperty("transform-box",A);}}:b}var vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function kr(e,r){if(typeof window>"u")return vt;let t=typeof e=="string"?document.querySelector(e):e;return t?Ge(r,(n,s)=>Cr(t,n,s)):(G("scrollCounter: element not found:",e),vt)}function Cr(e,r,t){let{from:n=0,to:s,format:a,easing:c="ease-out",trigger:m={},once:u=true,decimals:p,onComplete:T}=r,A=p!==void 0?h=>h.toFixed(p):a??(h=>String(Math.round(h))),b=typeof c=="function"?c:Z[c]??Z["ease-out"],K=Pe(m.start||"top 80%"),se=Pe(m.end||"top 20%");if(t)return e.textContent=A(s),T?.(),{...vt,getProgress:()=>1};let R=0,v=0,M=false,f=0,w=false,y=false,z=-1,_=0,$=0,q=false,ke=()=>window.scrollY,ce=()=>window.innerHeight;function fe(){let h=e.getBoundingClientRect(),E=Ne({top:h.top,height:h.height},ke(),ce(),K,se);M&&Math.abs(E.tStart-R)<1&&Math.abs(E.tEnd-v)<1||(M=true,R=E.tStart,v=E.tEnd);}function W(h){e.textContent=A(n+(s-n)*h),e.style.setProperty("--scroll-draw-progress",String(h));}function ie(){if(!w||y)return;let h=re(ke(),R,v,1),E=u?Math.max(z,b(_=Math.max(_,h))):b(h);$=E,W(E),E>=1&&!q?(q=true,T?.()):E<1&&!u&&(q=false),f=requestAnimationFrame(ie);}fe();{_=re(ke(),R,v,1);let h=b(_);$=h,W(h);}let Ce=new IntersectionObserver(h=>{h.forEach(E=>{w=E.isIntersecting,w&&!y?f=requestAnimationFrame(ie):cancelAnimationFrame(f);});}),Ie;function Ee(){clearTimeout(Ie),Ie=setTimeout(fe,150);}window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee);let Se=Be([e],Ee);return Ce.observe(e),$e(e,{type:"counter",getProgress:()=>$,getTrigger:()=>({tStart:R,tEnd:v})}),{destroy(){cancelAnimationFrame(f),Ce.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),Se(),clearTimeout(Ie),ve(e);},replay(){z=-1,_=0,q=false,$=0,y=false,W(0);},pause(){y=true,cancelAnimationFrame(f);},resume(){y&&(y=false,w&&(f=requestAnimationFrame(ie)));},seek(h){let E=Math.min(1,Math.max(0,h));$=E,z=E,_=0,y=true,cancelAnimationFrame(f),W(E);},getProgress(){return $}}}var er="http://www.w3.org/2000/svg",Ir="cinematic-photo",Et=e=>e<0?0:e>1?1:e;function ut(e){let r=parseFloat(e);return Number.isFinite(r)?Et(r/100):0}function Dr(e){return Z[e]??Z.linear}var Or={destroy:()=>{},getProgress:()=>0},St=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||G("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return Or;t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let s=[];for(let v of r.scenes){if(v.background){let f=document.createElement("img");f.id=Ir,f.src=v.background,f.alt="",f.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(f);}let M=v.animations.filter(f=>f.type==="draw");if(M.length){let f=document.createElementNS(er,"svg");f.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),f.setAttribute("preserveAspectRatio","xMidYMid meet"),f.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(f);for(let w of M){let y=document.createElementNS(er,"path");y.id=w.target.replace(/^#/,""),y.setAttribute("d",w.d),y.setAttribute("fill","none"),y.setAttribute("stroke",w.stroke),y.setAttribute("stroke-width",String(w.strokeWidth)),y.setAttribute("stroke-linecap","round"),y.setAttribute("stroke-linejoin","round");let z=w.length||y.getTotalLength?.()||0;y.style.strokeDasharray=String(z),y.style.strokeDashoffset=String(z),f.appendChild(y),s.push({kind:"draw",el:y,start:ut(w.start),end:ut(w.end),ease:Dr(w.easing),length:z});}}for(let f of v.animations){if(f.type!=="fade")continue;let w=n.querySelector(f.target)??document.querySelector(f.target);w&&(w.style.opacity=String(f.from),s.push({kind:"fade",el:w,start:ut(f.start),end:ut(f.end),ease:Z["ease-in-out"]??Z.linear,from:f.from,to:f.to}));}}let a=0,c=()=>{let v=t.offsetHeight-window.innerHeight;return v<=0?t.getBoundingClientRect().top<=0?1:0:Et(-t.getBoundingClientRect().top/v)},m=v=>{for(let M of s){let f=M.end-M.start,w=f<=0?v>=M.end?1:0:Et((v-M.start)/f),y=M.ease(w);M.kind==="draw"?M.el.style.strokeDashoffset=String(M.length*(1-y)):M.el.style.opacity=String(M.from+(M.to-M.from)*y);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let u=0,p=false,T=false,A=()=>{a=c(),m(a),p&&(u=requestAnimationFrame(A));},b=()=>{p||(p=true,u=requestAnimationFrame(A));},K=()=>{p=false,cancelAnimationFrame(u);},se=new IntersectionObserver(v=>{for(let M of v)T=M.isIntersecting,T?b():K();},{threshold:0});se.observe(n),a=c(),m(a),$e(t,{type:"draw",getProgress:()=>a,getTrigger:()=>{let v=t.getBoundingClientRect().top+window.scrollY;return {tStart:v,tEnd:v+Math.max(0,t.offsetHeight-window.innerHeight)}}});let R=lt(v=>{v&&(R(),K(),se.disconnect(),ve(t),a=1,m(1));});return {destroy(){R(),K(),se.disconnect(),ve(t);},getProgress:()=>a}}};
4
- exports.Cinematic=St;exports.PRESETS=bt;exports.createBounce=Ot;exports.createElastic=Rt;exports.createSpring=lr;exports.scrollAnimate=Pr;exports.scrollCounter=kr;exports.scrollDraw=Er;exports.scrollParallax=$r;
3
+ <div style="position:absolute;${u?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var Qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Yt=/[MmLlHhVvCcSsQqTtAaZz]/g;function br(e,r,t){if(!Fe)return;let n=(e.match(Yt)??[]).join("").toUpperCase(),s=(r.match(Yt)??[]).join("").toUpperCase(),i=(e.match(Qt)??[]).length,c=(r.match(Qt)??[]).length;if(n!==s){W(`morphTo: command sequence differs (${n||"\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.`,t);return}i!==c&&W(`morphTo: coordinate count differs (${i} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function wr(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let c=parseFloat(i),m=n[s++]??c;return String(+(c+(m-c)*t).toFixed(4))})}function Ut(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:_e(r,(t,n)=>vr(e,t,n))}function vr(e,r,t){let{preset:n,...s}=r,i=n?{...dt[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:m=1,fade:u=false,easing:p="linear",trigger:v={},stagger:S=0,direction:h="forward",once:O=false,debug:ee=false,axis:A="y",scrollContainer:y,autoReverse:x=false,delay:g=0,strokeColor:b,strokeWidth:w,fillOpacity:I,waypoints:z,velocityScale:N=false,threshold:te=0,rootMargin:Ge="0px",repeat:le=0,repeatDelay:de=0,morphTo:B,clip:re,autoplay:Ae=false,duration:L=1e3,native:H=true,onProgress:ke,onStart:Z,onComplete:ne,onEnter:ge,onLeave:Ie,onEnterBack:ye,onLeaveBack:me}=i,K=re===true?"left":typeof re=="string"?re:false,q=typeof p=="function"?p:U[p]??U.linear,Re=Te(v.start||"top bottom"),We=Te(v.end||"bottom top"),F=typeof y=="string"?document.querySelector(y):y??null,he=Array.isArray(b)?b[0]:null,be=Array.isArray(b)?b[1]:typeof b=="string"?b:null,ce=Array.isArray(w)?w[0]:null,Pe=Array.isArray(w)?w[1]:typeof w=="number"?w:null,we=Array.isArray(I)?I[0]:null,ue=Array.isArray(I)?I[1]:typeof I=="number"?I:null;function ve(o){let l=o*100;switch(K){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 a=K?[]:Array.from(e.querySelectorAll(c)),f=[],_=[],M=0,$=0,R=S,k=0,Le=0,V=false,Se=false,Ee=0,at=-1,Ye=[],Ue=-1,ie=false,fe=0,Ce=0,De,lt=false,ct=null;function wt(){ct?.destroy(),ct=null;}let Oe=new Set,vt=NaN,Ne=true,Xe=-1,St=performance.now(),He=NaN;function Ze(){return F?A==="x"?F.scrollLeft:F.scrollTop:A==="x"?window.scrollX:window.scrollY}function Et(){return F?A==="x"?F.clientWidth:F.clientHeight:A==="x"?window.innerWidth:window.innerHeight}function xt(){let o=Ke(e,F,A);return $e(o,o.scroll,Et(),Re,We)}function rr(){let o=$-M,l=a.length-1,d=F??document.documentElement,T=A==="x"?"Width":"Height";if(R=S,S>0&&l>0&&o>0){let j=d[`scroll${T}`]-d[`client${T}`]-1-M-o/m;j>=0&&(R=Math.min(S,j/(l*o)));}let G=Math.max(0,l)*R*o,oe=o/Math.min(m,1);k=M+Math.min(0,G,oe,G+oe),Le=M+Math.max(0,G,oe,G+oe);}function Tt(){(({tStart:M,tEnd:$}=xt())),rr(),ee&&Fe&&(wt(),ct=hr(M,$,A));}function ut(o,l=xt){Me(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let d=o.destroy;return o.destroy=()=>{d.call(o),pe(e);},o}function Mt(o,l){return O&&!x?Math.max(at,q(Ye[o]=Math.max(Ye[o]??0,l))):q(l)}function nr(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),K){let d=l==="reverse"?1-o:o;e.style.clipPath=ve(d);return}a.forEach((d,T)=>mt(d,T,o,l));}function mt(o,l,d,T){o.style.strokeDashoffset=T==="reverse"?`${f[l]*d}`:`${f[l]*(1-d)}`,u&&(o.style.opacity=T==="reverse"?`${1-d}`:`${d}`),he&&be?o.style.stroke=et(he,be,d):be&&(o.style.stroke=be),ce!==null&&Pe!==null?o.style.strokeWidth=`${ce+(Pe-ce)*d}`:Pe!==null&&(o.style.strokeWidth=`${Pe}`),we!==null&&ue!==null?o.style.fillOpacity=`${we+(ue-we)*d}`:ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&_[l]&&o.setAttribute("d",wr(_[l],B,d));}function ft(){if(e.style.setProperty("--scroll-draw-progress","0"),K){e.style.clipPath=ve(h==="reverse"?1:0);return}a.forEach((o,l)=>{o.style.strokeDasharray=`${f[l]}`,o.style.strokeDashoffset=h==="reverse"?"0":`${f[l]}`,u?o.style.opacity=h==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`),B&&o.tagName.toLowerCase()==="path"&&_[l]&&o.setAttribute("d",_[l]);});}function ze(o,l){let d=o.getAttribute("d"),T=Je(o);if(B&&_[l]){o.setAttribute("d",B);let G=Je(o);o.setAttribute("d",_[l]),T=Math.max(Je(o),G),o.setAttribute("d",d);}f[l]=T,o.style.strokeDasharray=`${T}`;}if(a.forEach((o,l)=>{yr(o);let d=o.tagName.toLowerCase()==="path";d?_.push(o.getAttribute("d")??""):_.push(""),ze(o,l);let T=f[l];B&&(d?br(_[_.length-1],B,o):W(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDashoffset=h==="reverse"?`${T}`:"0",u&&(o.style.opacity="1"),be&&(o.style.stroke=be),Pe!==null&&(o.style.strokeWidth=`${Pe}`),ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDashoffset=h==="reverse"?"0":`${T}`,u?o.style.opacity=h==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`));}),t)return K&&(e.style.clipPath=ve(1)),ne?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};K&&(e.style.clipPath=ve(h==="reverse"?1:0));let At=typeof p=="string"?tt(p):null;function or(){return !(H===false||Ae||ee&&Fe||!gr()||!a.length||!At||K||A!=="y"||F||m!==1||S!==0||O||x||N!==false||B||z||le||g>0||ke||Z||ne||ge||Ie||ye||me||b!=null||w!=null||I!=null||(v.start||"top bottom").trim()!=="top bottom"||(v.end||"bottom top").trim()!=="bottom top")}function sr(){let o=++dr,l=`svg-scroll-draw-${o}`,d=`svg-scroll-draw-host-${o}`,T=`--svg-scroll-draw-${o}`,G=h==="reverse"?"0":"var(--ssd-len)",oe=h==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${G};`,C=`stroke-dashoffset:${oe};`;u&&(j+=`opacity:${h==="reverse"?1:0};`,C+=`opacity:${h==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${l}{from{${j}}to{${C}}}.${d}{view-timeline-name:${T};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${At};animation-fill-mode:both;animation-timeline:${T};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(d);function J(E,P){E.style.setProperty("--ssd-len",String(f[P])),E.style.strokeDasharray=`${f[P]}`,E.style.strokeDashoffset="",E.style.opacity="",E.style.animationPlayState="",E.classList.add(l);}a.forEach(J);let Q=false,se=-1;function ae(){if(se>=0)return se;let E=e.getBoundingClientRect(),{tStart:P,tEnd:Y}=$e({top:E.top,height:E.height},Ze(),Et(),Re,We);return q(X(Ze(),P,Y,m))}return {destroy(){e.classList.remove(d),a.forEach(E=>{E.classList.remove(l),E.style.removeProperty("--ssd-len"),E.style.animationPlayState="";}),D.remove();},replay(){Q=false,se=-1,a.forEach(J);},pause(){Q=true,a.forEach(E=>{E.style.animationPlayState="paused";});},resume(){Q&&(Q=false,a.forEach(E=>{E.style.animationPlayState="running";}));},seek(E){let P=Math.min(1,Math.max(0,E));se=P,Q=true,a.forEach((Y,xe)=>{Y.classList.remove(l),Y.style.strokeDashoffset=h==="reverse"?`${f[xe]*P}`:`${f[xe]*(1-P)}`,u&&(Y.style.opacity=h==="reverse"?`${1-P}`:`${P}`);});},getProgress(){return ae()},refresh(){a.forEach((E,P)=>{ze(E,P),E.style.setProperty("--ssd-len",String(f[P]));});}}}if(or())return ut(sr());function ir(){let o=Math.max(1,L),l=K?o:o*(1+Math.max(0,a.length-1)*S),d=0,T=0,G=false;function oe(se){let ae=true,E=Math.min(1,Math.max(0,se/l));if(K){let P=Math.min(1,Math.max(0,se/o)),Y=q(P);fe=Y,e.style.setProperty("--scroll-draw-progress",String(Y)),e.style.clipPath=ve(h==="reverse"?1-Y:Y),ke?.(Y),P<1&&(ae=false);}else {a.forEach((Y,xe)=>{let lr=xe*S*o,Ct=Math.min(1,Math.max(0,(se-lr)/o));mt(Y,xe,q(Ct),h),Ct<1&&(ae=false);});let P=q(E);fe=P,ke?.(P),e.style.setProperty("--scroll-draw-progress",String(P));}if(z){let P=q(E);for(let Y in z){let xe=parseFloat(Y);P>=xe&&!Oe.has(xe)&&(Oe.add(xe),z[Y]?.());}}return ae}function j(se){if(ie)return;let ae=se-d;Se||(Se=true,Z?.());let E=oe(ae);if(E&&!V){V=true,oe(l),ne?.(),Ce<(le==="infinite"?1/0:le??0)&&(Ce++,De=setTimeout(()=>{d=performance.now(),Se=false,V=false,Oe.clear(),ft(),Ee=requestAnimationFrame(j);},de));return}E||(Ee=requestAnimationFrame(j));}function C(){cancelAnimationFrame(Ee),clearTimeout(De),d=performance.now(),T=0,ie=false,Se=false,V=false,Ce=0,G=true,fe=0,Oe.clear(),ft(),Ee=requestAnimationFrame(j);}let D=new IntersectionObserver(se=>{se.forEach(ae=>{ae.isIntersecting&&!(O&&V)?C():!ae.isIntersecting&&!O&&!V&&(cancelAnimationFrame(Ee),clearTimeout(De),G=false);});},{root:F??null,threshold:te,rootMargin:Ge}),J;function Q(){clearTimeout(J),J=setTimeout(()=>a.forEach(ze),150);}return window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q),g>0?setTimeout(()=>D.observe(e),g):D.observe(e),{destroy(){cancelAnimationFrame(Ee),clearTimeout(De),D.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),clearTimeout(J);},replay(){Ce=0,C();},pause(){ie||!G||(ie=true,T=performance.now()-d,cancelAnimationFrame(Ee));},resume(){ie&&(ie=false,G=true,d=performance.now()-T,Ee=requestAnimationFrame(j));},seek(se){let ae=Math.min(1,Math.max(0,se));fe=ae,ie=true,T=ae*l,d=performance.now()-T,cancelAnimationFrame(Ee),oe(T);},getProgress(){return fe},refresh(){clearTimeout(J),a.forEach(ze);}}}if(Ae)return ut(ir());Tt();let Pt=()=>X(Ze(),k,Le,1);function Lt(){V=true,ne?.(),Ce<(le==="infinite"?1/0:le)&&(Ce++,De=setTimeout(()=>{lt=true;},de));}function $t(){at=-1,Ye=[],Se=false,V=false,lt=false,Oe.clear(),ft(),Ne=true;}function ar(){let o=performance.now(),l=Ze();if(lt&&Pt()%1&&$t(),!Ne&&N===false&&l===vt)return;Ne=false,vt=l;let d=m;if(N!==false){let C=o-St,D=C>0?Math.abs(l-(Xe<0?l:Xe))/C:0;d=m*Math.max(.2,1+D*(typeof N=="number"?N:1)*.04);}Xe=l,St=o;let T=x?Ue===-1||l>=Ue?"forward":"reverse":h;Ue=l;let G=$-M,oe=true,j=G===0?0:(l-M)/G;if(isNaN(He)||(He<=0&&j>0&&ge?.(),He<1&&j>=1&&Ie?.(),He>=1&&j<1&&ye?.(),He>0&&j<=0&&me?.()),He=j,K){let C=Mt(0,X(l,M,$,d));fe=C,e.style.setProperty("--scroll-draw-progress",String(C));let D=T==="reverse"?1-C:C;e.style.clipPath=ve(D),ke?.(C),!Se&&X(l,M,$,d)>0&&(Se=true,Z?.()),C>=1&&!V?Lt():C<1&&!O&&(V=false);return}if(a.forEach((C,D)=>{let J=D*R*G,Q=Mt(D,X(l,M+J,$+J,d));mt(C,D,Q,T),D===0&&(fe=Q,ke?.(Q),e.style.setProperty("--scroll-draw-progress",String(Q))),Q<1&&(oe=false);}),z){let C=q(X(l,M,$,d));for(let D in z){let J=parseFloat(D);C>=J&&!Oe.has(J)&&(Oe.add(J),z[D]?.());}}!Se&&X(l,M,$,d)>0&&(Se=true,Z?.()),oe&&!V?Lt():!oe&&!O&&(V=false);}let Be=Ve(F??window,[e],Pt,ar,()=>{let o=f.join();a.forEach(ze),Tt(),Ne=true,f.join()!==o&&qe();}),pt=g>0;function qe(){Be.hold(ie||pt);}let kt;return pt&&(kt=setTimeout(()=>{pt=false,qe();},g)),qe(),ut({destroy(){clearTimeout(De),clearTimeout(kt),Be.off(),wt();},replay(){$t(),Ue=-1,Xe=-1,Ce=0,ie=false,fe=0,clearTimeout(De),qe();},pause(){ie=true,Be.hold(true);},resume(){ie&&(ie=false,Ne=true,qe());},seek(o){let l=Math.min(1,Math.max(0,o));fe=l,at=l,Ye=[],ie=true,Be.hold(true),nr(l,h),Ne=true;},getProgress(){return fe},refresh:Be.remeasure},()=>({tStart:M,tEnd:$}))}function Sr(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?Ut(n,r):(W("Container not found:",e),t)}function Er(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Xt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],c=n[2].trim();if(c)for(let m of c.split(/[\s,]+/)){let u=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"");}r.push({fn:n[1],nums:s,units:i});}return r}function xr(e,r,t){let n=Xt(e),s=Xt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,c)=>{let m=s[c];return i.fn!==m.fn||i.nums.length!==m.nums.length?t<1?`${i.fn}(${i.nums.map((u,p)=>`${u}${i.units[p]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,p)=>`${u}${m.units[p]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,p)=>`${u+(m.nums[p]-u)*t}${i.units[p]}`).join(", ")})`}).join(" ")}function Zt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(Er(n))return et(n,s,t);if(n.includes("("))return xr(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&c){let m=parseFloat(i[1]),u=parseFloat(c[1]);return `${m+(u-m)*t}${i[2]||c[2]}`}return t<1?n:s}function Tr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Mr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ar=0,Kt="--scroll-draw-progress";function Pr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var er={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,r){return typeof window>"u"?er:r.respectReducedMotion===false?Jt(e,r,false):_e(r,(t,n)=>Jt(e,t,n))}function Jt(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:c=1,once:m=false,axis:u="y",scrollContainer:p,native:v=true,velocityScale:S=false,triggerElement:h,onProgress:O,onComplete:ee,onEnter:A,onLeave:y,onEnterBack:x,onLeaveBack:g}=r,b=typeof i=="function"?i:U[i]??U["ease-out"],w=Te(s.start||"top bottom"),I=Te(s.end||"bottom top"),z=h??e,N=typeof p=="string"?document.querySelector(p):p??null,te=Object.entries(n).map(([a,f])=>({prop:Tr(a),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function Ge(){let a=window.getComputedStyle(e);for(let f of te)f.from===""&&(f.from=a.getPropertyValue(f.prop).trim()||"0");}function le(){for(let a of te)e.style.setProperty(a.prop,String(a.to));}let de=new Map;for(let a of [...te.map(f=>f.prop),Kt])de.set(a,e.style.getPropertyValue(a));function B(){for(let[a,f]of de)f?e.style.setProperty(a,f):e.style.removeProperty(a);}if(t)return le(),ee?.(),{...er,destroy:B,getProgress:()=>1};Ge();let re=()=>N?u==="x"?N.scrollLeft:N.scrollTop:u==="x"?window.scrollX:window.scrollY,Ae=()=>N?u==="x"?N.clientWidth:N.clientHeight:u==="x"?window.innerWidth:window.innerHeight,L=typeof i=="string"?tt(i):null;function H(){if(!v||!Pr()||!L||u!=="y"||N||z!==e||m||c!==1||O||ee||A||y||x||g||S!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let a of te)if(!Mr.has(a.prop))return false;return true}function ke(){let a=`ssd-a-${++Ar}`,f=te.map(k=>`${k.prop}:${k.from}`).join(";"),_=te.map(k=>`${k.prop}:${k.to}`).join(";"),M=document.createElement("style");M.setAttribute("data-ssd-animate",""),M.textContent=`@keyframes ${a}{from{${f}}to{${_}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${L};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(a);let $=()=>{let k=e.getBoundingClientRect();return $e({top:k.top,height:k.height},re(),Ae(),w,I)};Me(e,{type:"animate",getProgress:()=>R.getProgress(),getTrigger:$});let R={refresh(){},destroy(){e.classList.remove(a),M.remove(),e.style.animationPlayState="",B(),pe(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(k){let Le=Math.min(1,Math.max(0,k));e.classList.remove(a);for(let V of te)e.style.setProperty(V.prop,Zt(V.from,V.to,Le));},getProgress(){let{tStart:k,tEnd:Le}=$();return b(X(re(),k,Le,c))}};return R}if(H())return ke();let Z=0,ne=0,ge=false,Ie=-1,ye=0,me=0,K=false,q=NaN,Re=-1,We=0,F=z===e?te:[],he=false;function be(){let a=e.style,f=F.map(R=>a.getPropertyValue(R.prop)),_=a.transition;F.length&&(a.transition="none"),F.forEach(R=>a.setProperty(R.prop,de.get(R.prop)??""));let M=Ke(z,N,u);F.forEach((R,k)=>a.setProperty(R.prop,f[k])),F.length&&(e.offsetWidth,a.transition=_);let $=$e(M,M.scroll,Ae(),w,I);he&&Math.abs($.tStart-Z)<1&&Math.abs($.tEnd-ne)<1||(he=true,Z=$.tStart,ne=$.tEnd);}function ce(a){e.style.setProperty(Kt,String(a));for(let f of te)e.style.setProperty(f.prop,Zt(f.from,f.to,a));O?.(a);}function Pe(a){if(isNaN(q)){q=a;return}q<=0&&a>0&&A?.(),q<1&&a>=1&&y?.(),q>=1&&a<1&&x?.(),q>0&&a<=0&&g?.(),q=a;}function we(){if(ge)return;let a=performance.now(),f=re(),_=c;if(S!==false){let k=a-We,Le=k>0?Math.abs(f-(Re<0?f:Re))/k:0;_=c*Math.max(.2,1+Le*(typeof S=="number"?S:1)*.04);}Re=f,We=a;let M=ne===Z?0:(f-Z)/(ne-Z);Pe(M);let $=X(f,Z,ne,_),R=m?Math.max(Ie,b(ye=Math.max(ye,$))):b($);me=R,ce(R),R>=1&&!K?(K=true,ee?.()):R<1&&!m&&(K=false);}let ue=Ve(N??window,[z],()=>X(re(),Z,ne,Math.min(c,1)),we,be);be(),ne===Z&&W("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ye=X(re(),Z,ne,c),me=b(ye),ce(me),Me(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:Z,tEnd:ne})});function ve(){ge=true,ue.hold(true);}return {destroy(){ge=true,ue.off(),B(),pe(e);},replay(){Ie=-1,ye=0,K=false,me=0,ge=false,ce(0),ue.hold(false);},pause:ve,resume(){ge&&(ge=false,ue.hold(false));},seek(a){let f=Math.min(1,Math.max(0,a));me=f,Ie=f,ye=0,ve(),ce(f);},getProgress(){return me},refresh:ue.remeasure}}var st={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Lr(e,r){if(typeof window>"u")return st;let t=typeof e=="string"?document.querySelector(e):e;return t?gt(t,r):(W("scrollAnimate: element not found:",e),st)}function $r(e,r={}){if(typeof window>"u")return st;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return W("scrollParallax: element not found:",e),st;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:c,onProgress:m}=r,u=-n*100,p=t.style,v=!!t.ownerSVGElement,S=p.getPropertyValue("transform-box");v&&p.setProperty("transform-box","fill-box");let h=gt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:i,native:false,onProgress:m});return v?{...h,destroy(){h.destroy(),p.setProperty("transform-box",S);}}:h}var yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function kr(e,r){if(typeof window>"u")return yt;let t=typeof e=="string"?document.querySelector(e):e;return t?_e(r,(n,s)=>Cr(t,n,s)):(W("scrollCounter: element not found:",e),yt)}function Cr(e,r,t){let{from:n=0,to:s,format:i,easing:c="ease-out",trigger:m={},once:u=true,decimals:p,onComplete:v}=r,S=p!==void 0?L=>L.toFixed(p):i??(L=>String(Math.round(L))),h=typeof c=="function"?c:U[c]??U["ease-out"],O=Te(m.start||"top 80%"),ee=Te(m.end||"top 20%");if(t)return e.textContent=S(s),v?.(),{...yt,getProgress:()=>1};let A=0,y=0,x=false,g=-1,b=0,w=0,I=false,z=()=>window.scrollY,N=()=>window.innerHeight;function te(){let L=e.getBoundingClientRect(),H=$e({top:L.top,height:L.height},z(),N(),O,ee);x&&Math.abs(H.tStart-A)<1&&Math.abs(H.tEnd-y)<1||(x=true,A=H.tStart,y=H.tEnd);}let Ge=e.style.getPropertyValue("--scroll-draw-progress");function le(L){e.textContent=S(n+(s-n)*L),e.style.setProperty("--scroll-draw-progress",String(L));}let de=()=>X(z(),A,y,1);function B(){let L=de(),H=u?Math.max(g,h(b=Math.max(b,L))):h(L);w=H,le(H),H>=1&&!I?(I=true,v?.()):H<1&&!u&&(I=false);}te();{b=X(z(),A,y,1);let L=h(b);w=L,le(L);}let re=Ve(window,[e],de,B,te);Me(e,{type:"counter",getProgress:()=>w,getTrigger:()=>({tStart:A,tEnd:y})});let Ae=()=>re.hold(false);return {destroy(){re.off(),e.style.setProperty("--scroll-draw-progress",Ge),pe(e);},replay(){g=-1,b=0,I=false,w=0,le(0),Ae();},pause:()=>re.hold(true),resume:Ae,seek(L){let H=Math.min(1,Math.max(0,L));w=H,g=H,b=0,re.hold(true),le(H);},getProgress(){return w}}}var tr="http://www.w3.org/2000/svg",Dr="cinematic-photo",ht=e=>e<0?0:e>1?1:e;function it(e){let r=parseFloat(e);return Number.isFinite(r)?ht(r/100):0}function Or(e){return U[e]??U.linear}var Ir={destroy:()=>{},getProgress:()=>0},bt=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||W("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return Ir;t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let s=[];for(let y of r.scenes){if(y.background){let g=document.createElement("img");g.id=Dr,g.src=y.background,g.alt="",g.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(g);}let x=y.animations.filter(g=>g.type==="draw");if(x.length){let g=document.createElementNS(tr,"svg");g.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),g.setAttribute("preserveAspectRatio","xMidYMid meet"),g.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(g);for(let b of x){let w=document.createElementNS(tr,"path");w.id=b.target.replace(/^#/,""),w.setAttribute("d",b.d),w.setAttribute("fill","none"),w.setAttribute("stroke",b.stroke),w.setAttribute("stroke-width",String(b.strokeWidth)),w.setAttribute("stroke-linecap","round"),w.setAttribute("stroke-linejoin","round");let I=b.length||w.getTotalLength?.()||0;w.style.strokeDasharray=String(I),w.style.strokeDashoffset=String(I),g.appendChild(w),s.push({kind:"draw",el:w,start:it(b.start),end:it(b.end),ease:Or(b.easing),length:I});}}for(let g of y.animations){if(g.type!=="fade")continue;let b=n.querySelector(g.target)??document.querySelector(g.target);b&&(b.style.opacity=String(g.from),s.push({kind:"fade",el:b,start:it(g.start),end:it(g.end),ease:U["ease-in-out"]??U.linear,from:g.from,to:g.to}));}}let i=0,c=()=>{let y=t.offsetHeight-window.innerHeight;return y<=0?t.getBoundingClientRect().top<=0?1:0:ht(-t.getBoundingClientRect().top/y)},m=y=>{for(let x of s){let g=x.end-x.start,b=g<=0?y>=x.end?1:0:ht((y-x.start)/g),w=x.ease(b);x.kind==="draw"?x.el.style.strokeDashoffset=String(x.length*(1-w)):x.el.style.opacity=String(x.from+(x.to-x.from)*w);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let u=0,p=false,v=false,S=()=>{i=c(),m(i),p&&(u=requestAnimationFrame(S));},h=()=>{p||(p=true,u=requestAnimationFrame(S));},O=()=>{p=false,cancelAnimationFrame(u);},ee=new IntersectionObserver(y=>{for(let x of y)v=x.isIntersecting,v?h():O();},{threshold:0});ee.observe(n),i=c(),m(i),Me(t,{type:"draw",getProgress:()=>i,getTrigger:()=>{let y=t.getBoundingClientRect().top+window.scrollY;return {tStart:y,tEnd:y+Math.max(0,t.offsetHeight-window.innerHeight)}}});let A=rt(y=>{y&&(A(),O(),ee.disconnect(),pe(t),i=1,m(1));});return {destroy(){A(),O(),ee.disconnect(),pe(t);},getProgress:()=>i}}};
4
+ exports.Cinematic=bt;exports.PRESETS=dt;exports.createBounce=Ot;exports.createElastic=It;exports.createSpring=Dt;exports.scrollAnimate=Lr;exports.scrollCounter=kr;exports.scrollDraw=Sr;exports.scrollParallax=$r;
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { a as ScrollDrawOptions } from './types-MswK0erX.mjs';
2
- export { P as PresetName, S as ScrollDrawInstance } from './types-MswK0erX.mjs';
3
- export { s as scrollDraw } from './scroll-draw-Dej-GIRP.mjs';
4
- export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-BY-CNE8c.mjs';
5
- export { S as ScrollCounterOptions, s as scrollCounter } from './index-CdaBYn3A.mjs';
1
+ import { a as ScrollDrawOptions } from './types-9bcJdVcg.mjs';
2
+ export { P as PresetName, S as ScrollDrawInstance } from './types-9bcJdVcg.mjs';
3
+ export { s as scrollDraw } from './scroll-draw-Fzir8hlU.mjs';
4
+ export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-DAiRJgtF.mjs';
5
+ export { S as ScrollCounterOptions, s as scrollCounter } from './index-DVjblK_4.mjs';
6
6
  export { Cinematic, CinematicInstance, CinematicOptions, DrawAnimation, FadeAnimation, Story, StoryAnimation, StoryEasing, StoryScene } from './cinematic/index.mjs';
7
- export { S as ScrollAnimateOptions } from './engine-o1VSQ1lX.mjs';
7
+ export { S as ScrollAnimateOptions } from './engine-BLWKCfxC.mjs';
8
8
 
9
9
  type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
10
10
  /**
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { a as ScrollDrawOptions } from './types-MswK0erX.js';
2
- export { P as PresetName, S as ScrollDrawInstance } from './types-MswK0erX.js';
3
- export { s as scrollDraw } from './scroll-draw-DsBMkwrX.js';
4
- export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-DqXXiDIk.js';
5
- export { S as ScrollCounterOptions, s as scrollCounter } from './index-D3o4vT3e.js';
1
+ import { a as ScrollDrawOptions } from './types-9bcJdVcg.js';
2
+ export { P as PresetName, S as ScrollDrawInstance } from './types-9bcJdVcg.js';
3
+ export { s as scrollDraw } from './scroll-draw-BsU_Ohmu.js';
4
+ export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-hSQqLVbg.js';
5
+ export { S as ScrollCounterOptions, s as scrollCounter } from './index-BN8yKeQ3.js';
6
6
  export { Cinematic, CinematicInstance, CinematicOptions, DrawAnimation, FadeAnimation, Story, StoryAnimation, StoryEasing, StoryScene } from './cinematic/index.js';
7
- export { S as ScrollAnimateOptions } from './engine-B7UpB4fT.js';
7
+ export { S as ScrollAnimateOptions } from './engine-6VsjEwzb.js';
8
8
 
9
9
  type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
10
10
  /**
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export{a as scrollAnimate,b as scrollParallax}from'./chunk-ETACBG7W.mjs';export{a as Cinematic}from'./chunk-YNNA33A5.mjs';export{a as scrollDraw}from'./chunk-BLY6F6EC.mjs';export{a as scrollCounter}from'./chunk-LGJQWZHH.mjs';import'./chunk-V4L3ELVC.mjs';export{a as PRESETS}from'./chunk-23EALNDF.mjs';import'./chunk-OJFWQ6CU.mjs';import'./chunk-UPWWULKI.mjs';import'./chunk-YZV4Z3EQ.mjs';import'./chunk-2PYLM3E7.mjs';import'./chunk-A4JCC3QQ.mjs';export{b as createBounce,c as createElastic,a as createSpring}from'./chunk-DM6EDKWH.mjs';import'./chunk-5PJEKEEP.mjs';import'./chunk-4DOJSIEQ.mjs';import'./chunk-BCV4RAIX.mjs';import'./chunk-LFSU6LR3.mjs';
1
+ export{a as scrollAnimate,b as scrollParallax}from'./chunk-CZLUBJAI.mjs';export{a as Cinematic}from'./chunk-BSW7W2Y5.mjs';export{a as scrollDraw}from'./chunk-22B37AWY.mjs';export{a as scrollCounter}from'./chunk-PAGN26EH.mjs';import'./chunk-VJ5ZU55P.mjs';export{a as PRESETS}from'./chunk-K6VATIJH.mjs';import'./chunk-V3Z6G5JE.mjs';import'./chunk-UPWWULKI.mjs';import'./chunk-XC5NR2MU.mjs';import'./chunk-2PYLM3E7.mjs';import'./chunk-NV6YTPHI.mjs';export{b as createBounce,c as createElastic,a as createSpring}from'./chunk-THPTANES.mjs';import'./chunk-5PJEKEEP.mjs';import'./chunk-4DOJSIEQ.mjs';import'./chunk-BCV4RAIX.mjs';import'./chunk-LFSU6LR3.mjs';