svg-scroll-draw 2.24.0 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +174 -30
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +60 -6
  4. package/dist/angular/index.d.ts +60 -6
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +2 -2
  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 +69 -31
  11. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  12. package/dist/chunk-5SJE7725.mjs +1 -0
  13. package/dist/{chunk-NX74KN5X.mjs → chunk-5U4JXBHR.mjs} +1 -1
  14. package/dist/chunk-7LDSB4FT.mjs +1 -0
  15. package/dist/chunk-ASCOHQQD.mjs +2 -0
  16. package/dist/chunk-GBFWTY5L.mjs +1 -0
  17. package/dist/chunk-HAGTU5EX.mjs +1 -0
  18. package/dist/chunk-HJTHOZK5.mjs +1 -0
  19. package/dist/chunk-IXR6RML7.mjs +1 -0
  20. package/dist/chunk-KN2YB54Z.mjs +1 -0
  21. package/dist/chunk-NJV6S5LD.mjs +1 -0
  22. package/dist/chunk-UBH4K5YD.mjs +1 -0
  23. package/dist/chunk-UF3MO5XQ.mjs +1 -0
  24. package/dist/chunk-XLXVGQ3P.mjs +3 -0
  25. package/dist/chunk-YOOPMYT6.mjs +1 -0
  26. package/dist/chunk-Z72TVDHY.mjs +1 -0
  27. package/dist/cinematic/index.cjs +2 -2
  28. package/dist/cinematic/index.d.mts +3 -1
  29. package/dist/cinematic/index.d.ts +3 -1
  30. package/dist/cinematic/index.mjs +1 -1
  31. package/dist/{engine-6VsjEwzb.d.ts → engine-Bi2x8-X-.d.mts} +2 -2
  32. package/dist/{engine-BLWKCfxC.d.mts → engine-DAlvk6i0.d.ts} +2 -2
  33. package/dist/frames/index.cjs +1 -1
  34. package/dist/frames/index.d.mts +2 -2
  35. package/dist/frames/index.d.ts +2 -2
  36. package/dist/frames/index.mjs +1 -1
  37. package/dist/group/index.cjs +3 -3
  38. package/dist/group/index.d.mts +3 -3
  39. package/dist/group/index.d.ts +3 -3
  40. package/dist/group/index.mjs +1 -1
  41. package/dist/horizontal/index.cjs +1 -1
  42. package/dist/horizontal/index.d.mts +2 -2
  43. package/dist/horizontal/index.d.ts +2 -2
  44. package/dist/horizontal/index.mjs +1 -1
  45. package/dist/{index-BN8yKeQ3.d.ts → index-BMMZ8aW7.d.mts} +2 -2
  46. package/dist/{index-hSQqLVbg.d.ts → index-CEMsUTEG.d.ts} +3 -3
  47. package/dist/{index-DAiRJgtF.d.mts → index-ClAFxNEp.d.mts} +3 -3
  48. package/dist/{index-DVjblK_4.d.mts → index-MdQ4ti_z.d.ts} +2 -2
  49. package/dist/index.cjs +4 -4
  50. package/dist/index.d.mts +6 -6
  51. package/dist/index.d.ts +6 -6
  52. package/dist/index.mjs +1 -1
  53. package/dist/lenis/index.cjs +1 -1
  54. package/dist/lenis/index.d.mts +15 -16
  55. package/dist/lenis/index.d.ts +15 -16
  56. package/dist/lenis/index.mjs +1 -1
  57. package/dist/nuxt/index.cjs +3 -3
  58. package/dist/nuxt/index.d.mts +8 -5
  59. package/dist/nuxt/index.d.ts +8 -5
  60. package/dist/nuxt/index.mjs +1 -1
  61. package/dist/progress/index.cjs +1 -1
  62. package/dist/progress/index.d.mts +2 -2
  63. package/dist/progress/index.d.ts +2 -2
  64. package/dist/progress/index.mjs +1 -1
  65. package/dist/react/index.cjs +3 -3
  66. package/dist/react/index.d.mts +21 -5
  67. package/dist/react/index.d.ts +21 -5
  68. package/dist/react/index.mjs +1 -1
  69. package/dist/reveal/index.cjs +1 -1
  70. package/dist/reveal/index.d.mts +2 -2
  71. package/dist/reveal/index.d.ts +2 -2
  72. package/dist/reveal/index.mjs +1 -1
  73. package/dist/{scroll-draw-Fzir8hlU.d.mts → scroll-draw-CKZysh22.d.mts} +1 -1
  74. package/dist/{scroll-draw-BsU_Ohmu.d.ts → scroll-draw-DbY8RUJE.d.ts} +1 -1
  75. package/dist/snap/index.cjs +1 -1
  76. package/dist/snap/index.d.mts +2 -2
  77. package/dist/snap/index.d.ts +2 -2
  78. package/dist/snap/index.mjs +1 -1
  79. package/dist/solid/index.cjs +3 -3
  80. package/dist/solid/index.d.mts +40 -4
  81. package/dist/solid/index.d.ts +40 -4
  82. package/dist/solid/index.mjs +1 -1
  83. package/dist/svelte/index.cjs +3 -3
  84. package/dist/svelte/index.d.mts +47 -4
  85. package/dist/svelte/index.d.ts +47 -4
  86. package/dist/svelte/index.mjs +1 -1
  87. package/dist/text/index.cjs +1 -1
  88. package/dist/text/index.d.mts +2 -2
  89. package/dist/text/index.d.ts +2 -2
  90. package/dist/text/index.mjs +1 -1
  91. package/dist/timeline/index.cjs +10 -10
  92. package/dist/timeline/index.d.mts +2 -2
  93. package/dist/timeline/index.d.ts +2 -2
  94. package/dist/timeline/index.mjs +2 -2
  95. package/dist/{types-9bcJdVcg.d.mts → types-iITMwrru.d.mts} +10 -2
  96. package/dist/{types-9bcJdVcg.d.ts → types-iITMwrru.d.ts} +10 -2
  97. package/dist/video/index.cjs +1 -1
  98. package/dist/video/index.d.mts +2 -2
  99. package/dist/video/index.d.ts +2 -2
  100. package/dist/video/index.mjs +1 -1
  101. package/dist/vue/index.cjs +3 -3
  102. package/dist/vue/index.d.mts +37 -4
  103. package/dist/vue/index.d.ts +37 -4
  104. package/dist/vue/index.mjs +1 -1
  105. package/dist/web-component/index.cjs +3 -3
  106. package/dist/web-component/index.mjs +1 -1
  107. package/dist/wrapper-BOHrDnBO.d.mts +8 -0
  108. package/dist/wrapper-Cm7JTIVl.d.ts +8 -0
  109. package/package.json +1 -1
  110. package/dist/chunk-32ZCSGFZ.mjs +0 -1
  111. package/dist/chunk-5SKWSPQT.mjs +0 -1
  112. package/dist/chunk-7USW2XFB.mjs +0 -1
  113. package/dist/chunk-7XOFQCQE.mjs +0 -3
  114. package/dist/chunk-BDXWPUBJ.mjs +0 -2
  115. package/dist/chunk-BRV2B2YW.mjs +0 -1
  116. package/dist/chunk-QZKYGS74.mjs +0 -1
  117. package/dist/chunk-THPTANES.mjs +0 -1
  118. package/dist/chunk-U5TKLHGW.mjs +0 -1
  119. package/dist/chunk-V3Z6G5JE.mjs +0 -1
  120. package/dist/chunk-XSVTHCLO.mjs +0 -1
@@ -1,3 +1,3 @@
1
- 'use strict';function jt({tension:e=2.5,friction:r=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,r)}function Yt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,r)),i=Math.sqrt(o),a=0,u=[];for(let d=0;d<n;d++){let p=Math.pow(i,d);u.push(p),a+=p;}let m=[0],y=0;for(let d=0;d<n;d++)y+=u[d]/a,m.push(y);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let p=0;p<n;p++)if(d<=m[p+1]){let E=(d-m[p])/(m[p+1]-m[p]);if(p===0)return E*(2-E);let g=1-Math.pow(o,p);return g+(1-g)*(2*E-1)*(2*E-1)}return 1}}function Xt({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),o=Math.max(.1,r),i=n<=1?o/4:o/(2*Math.PI)*Math.asin(1/n);return a=>a<=0?0:a>=1?1:n*Math.pow(2,-10*a)*Math.sin((a-i)*(2*Math.PI)/o)+1}var ve={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:jt(),bounce:Yt(),elastic:Xt()};function dt(e,r,n){return Math.min(n,Math.max(r,e))}function We(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",o="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:o}}var ht=(e,r)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:r;function pt(e,r,n,o){return e+n+r*ht(o,0)}function gt(e,r){return r*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:ht(e,1))}function U(e,r,n,o){return n===r?0:dt((e-r)/(n-r)*o,0,1)}function ze(e,r,n,o,i){let a=pt(e.top,e.height,r,o.element)-gt(o.viewport,n),u=pt(e.top,e.height,r,i.element)-gt(i.viewport,n);return {tStart:a,tEnd:u}}function yt(e,r,n){let o=e.getBoundingClientRect(),i=n==="x"?o.width:o.height;return r?{top:n==="x"?o.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:o.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:i,scroll:0}:{top:n==="x"?o.left:o.top,height:i,scroll:n==="x"?window.scrollX:window.scrollY}}function Pe(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let n=e.tagName.toLowerCase();if(n==="rect"){let o=parseFloat(e.getAttribute("width")??"0"),i=parseFloat(e.getAttribute("height")??"0");return 2*(o+i)}if(n==="circle"){let o=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*o}return e.getTotalLength()}function bt(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let o=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return o?[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]:null}function vt(e,r,n){let o=bt(e),i=bt(r);return !o||!i?e:`rgb(${Math.round(o[0]+(i[0]-o[0])*n)},${Math.round(o[1]+(i[1]-o[1])*n)},${Math.round(o[2]+(i[2]-o[2])*n)})`}var wt={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 ce=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function fe(e,...r){ce&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var Jt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Kt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Et=33;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function er(e){let r=[];for(let n=0;n<Et;n++){let o=n/(Et-1);r.push(String(Math.round(e(o)*1e5)/1e5));}return `linear(${r.join(",")})`}function St(e){switch(e){case "linear":return "linear";case "ease-in":return Jt;case "ease-out":return Kt;case "ease-in-out":return Zt()?er(ve["ease-in-out"]):null;default:return null}}var xt=Symbol.for("svg-scroll-draw.registry");function Mt(){let e=globalThis;return e[xt]||(e[xt]=new Map)}function Tt(e,r){Mt().set(e,r);}function At(e){Mt().delete(e);}function Lt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),n=i=>e(!!i.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",n),()=>r.removeEventListener("change",n);let o=r;return o.addListener?.(n),()=>o.removeListener?.(n)}function kt(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let n=r(e,false),o=Lt(a=>{if(!a)return;o();let u=(n.getProgress?.()??0)>=1;n.destroy(),n=r(u?{...e,onComplete:void 0}:e,true);}),i={};for(let a of Object.keys(n))i[a]=(...u)=>n[a]?.(...u);return i.destroy=()=>{o(),n.destroy();},i}var we,De=new Set,Ce=new WeakMap,Ee=new Map,$t=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function tr(e){let r=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let o=n;o;o=o.previousElementSibling)r.add(o);return r}function Pt(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>r();we??(we=new ResizeObserver(i=>{let a=false;for(let{target:u}of i)Ce.get(u)!==$t(u)&&(a=true),Ce.set(u,"");a&&De.forEach(u=>u());})),De.add(n);let o=tr(e);return [document.body,document.documentElement].forEach(i=>i&&o.add(i)),o.forEach(i=>{Ce.has(i)||Ce.set(i,$t(i)),Ee.set(i,(Ee.get(i)??0)+1),we.observe(i);}),()=>{De.delete(n)&&(o.forEach(i=>{let a=(Ee.get(i)??1)-1;if(a)return void Ee.set(i,a);Ee.delete(i),we?.unobserve(i);}),De.size||(we?.disconnect(),we=void 0));}}function Dt(e,r,n,o,i){let a,u=NaN,m,y,d=()=>{a=0,o(),!m&&!a&&(u=n())>0&&u<1&&(a=requestAnimationFrame(d));},p=()=>{!a&&!m&&n()!==u&&(a=requestAnimationFrame(d));},E=W=>{m=W,cancelAnimationFrame(a),a=u=NaN,p();},g=()=>{clearTimeout(y),i(),p();},N=()=>{clearTimeout(y),y=setTimeout(g,150);},Se=Pt(r,N),R=W=>{e[W]("scroll",p,{passive:true}),window[W]("resize",N),window[W]("orientationchange",N);};return R("addEventListener"),p(),{hold:E,remeasure:g,off(){E(true),R("removeEventListener"),Se(),clearTimeout(y);}}}var rr=0;function nr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ct(e,r){let n="";try{n=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return n||(e.getAttribute(r)??"").trim()}var Ot=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function or(e){if(!ce)return;let r=Ct(e,"stroke");if(!r||r==="none"){fe("Element has no stroke \u2014 path will not be visible.",e);return}let n=(e.getAttribute("fill")??"").trim();n&&!Ot.has(n)&&!Ot.has(Ct(e,"fill"))&&fe("Element has a fill \u2014 it may obscure the stroke animation.",e);}function sr(e,r,n){let o=document.createElement("div");o.setAttribute("data-svg-scroll-draw-debug",""),o.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function i(){let a=n==="x"?window.scrollX:window.scrollY,u=e-a,m=r-a,y=n==="x";o.innerHTML=`
2
- <div style="position:absolute;${y?`left:${u}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${u}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;${y?`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(o),window.addEventListener("scroll",i,{passive:true}),i(),{el:o,destroy(){window.removeEventListener("scroll",i),o.remove();}}}var Rt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,It=/[MmLlHhVvCcSsQqTtAaZz]/g;function ir(e,r,n){if(!ce)return;let o=(e.match(It)??[]).join("").toUpperCase(),i=(r.match(It)??[]).join("").toUpperCase(),a=(e.match(Rt)??[]).length,u=(r.match(Rt)??[]).length;if(o!==i){fe(`morphTo: command sequence differs (${o||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}a!==u&&fe(`morphTo: coordinate count differs (${a} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function ar(e,r,n){let o=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let u=parseFloat(a),m=o[i++]??u;return String(+(u+(m-u)*n).toFixed(4))})}function Nt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:kt(r,(n,o)=>lr(e,n,o))}function lr(e,r,n){let{preset:o,...i}=r,a=o?{...wt[o],...i}:i,{selector:u="path, polyline, line, polygon, rect, circle",speed:m=1,fade:y=false,easing:d="linear",trigger:p={},stagger:E=0,direction:g="forward",once:N=false,debug:Se=false,axis:R="y",scrollContainer:W,autoReverse:Oe=false,delay:me=0,strokeColor:j,strokeWidth:Y,fillOpacity:X,waypoints:J,velocityScale:de=false,threshold:Ft=0,rootMargin:_t="0px",repeat:pe=0,repeatDelay:qe=0,morphTo:F,clip:Re,autoplay:Be=false,duration:Vt=1e3,native:Ht=true,onProgress:ge,onStart:xe,onComplete:Me,onEnter:Qe,onLeave:Ue,onEnterBack:je,onLeaveBack:Ye}=a,_=Re===true?"left":typeof Re=="string"?Re:false,Q=typeof d=="function"?d:ve[d]??ve.linear,Xe=We(p.start||"top bottom"),Je=We(p.end||"bottom top"),I=typeof W=="string"?document.querySelector(W):W??null,ne=Array.isArray(j)?j[0]:null,oe=Array.isArray(j)?j[1]:typeof j=="string"?j:null,K=Array.isArray(Y)?Y[0]:null,se=Array.isArray(Y)?Y[1]:typeof Y=="number"?Y:null,Z=Array.isArray(X)?X[0]:null,ie=Array.isArray(X)?X[1]:typeof X=="number"?X:null;function ae(t){let s=t*100;switch(_){case "right":return `inset(0 0 0 ${100-s}%)`;case "top":return `inset(0 0 ${100-s}% 0)`;case "bottom":return `inset(${100-s}% 0 0 0)`;case "center":return `circle(${t*150}% at 50% 50%)`;default:return `inset(0 ${100-s}% 0 0)`}}let w=_?[]:Array.from(e.querySelectorAll(u)),P=[],V=[],L=0,H=0,Te=E,Ke=0,Ze=0,O=false,z=false,q=0,Ie=-1,Ae=[],Le=-1,D=false,G=0,ee=0,te,Ne=false,Fe=null;function et(){Fe?.destroy(),Fe=null;}let re=new Set,tt=NaN,le=true,ke=-1,rt=performance.now(),ue=NaN;function $e(){return I?R==="x"?I.scrollLeft:I.scrollTop:R==="x"?window.scrollX:window.scrollY}function nt(){return I?R==="x"?I.clientWidth:I.clientHeight:R==="x"?window.innerWidth:window.innerHeight}function ot(){let t=yt(e,I,R);return ze(t,t.scroll,nt(),Xe,Je)}function Gt(){let t=H-L,s=w.length-1,l=I??document.documentElement,f=R==="x"?"Width":"Height";if(Te=E,E>0&&s>0&&t>0){let x=l[`scroll${f}`]-l[`client${f}`]-1-L-t/m;x>=0&&(Te=Math.min(E,x/(s*t)));}let S=Math.max(0,s)*Te*t,k=t/Math.min(m,1);Ke=L+Math.min(0,S,k,S+k),Ze=L+Math.max(0,S,k,S+k);}function st(){(({tStart:L,tEnd:H}=ot())),Gt(),Se&&ce&&(et(),Fe=sr(L,H,R));}function _e(t,s=ot){Tt(e,{type:"draw",getProgress:()=>t.getProgress(),getTrigger:s});let l=t.destroy;return t.destroy=()=>{l.call(t),At(e);},t}function it(t,s){return N&&!Oe?Math.max(Ie,Q(Ae[t]=Math.max(Ae[t]??0,s))):Q(s)}function Wt(t,s){if(e.style.setProperty("--scroll-draw-progress",String(t)),_){let l=s==="reverse"?1-t:t;e.style.clipPath=ae(l);return}w.forEach((l,f)=>Ve(l,f,t,s));}function Ve(t,s,l,f){t.style.strokeDashoffset=f==="reverse"?`${P[s]*l}`:`${P[s]*(1-l)}`,y&&(t.style.opacity=f==="reverse"?`${1-l}`:`${l}`),ne&&oe?t.style.stroke=vt(ne,oe,l):oe&&(t.style.stroke=oe),K!==null&&se!==null?t.style.strokeWidth=`${K+(se-K)*l}`:se!==null&&(t.style.strokeWidth=`${se}`),Z!==null&&ie!==null?t.style.fillOpacity=`${Z+(ie-Z)*l}`:ie!==null&&(t.style.fillOpacity=`${ie}`),F&&t.tagName.toLowerCase()==="path"&&V[s]&&t.setAttribute("d",ar(V[s],F,l));}function He(){if(e.style.setProperty("--scroll-draw-progress","0"),_){e.style.clipPath=ae(g==="reverse"?1:0);return}w.forEach((t,s)=>{t.style.strokeDasharray=`${P[s]}`,t.style.strokeDashoffset=g==="reverse"?"0":`${P[s]}`,y?t.style.opacity=g==="reverse"?"1":"0":t.style.opacity="",ne&&(t.style.stroke=ne),K!==null&&(t.style.strokeWidth=`${K}`),Z!==null&&(t.style.fillOpacity=`${Z}`),F&&t.tagName.toLowerCase()==="path"&&V[s]&&t.setAttribute("d",V[s]);});}function he(t,s){let l=t.getAttribute("d"),f=Pe(t);if(F&&V[s]){t.setAttribute("d",F);let S=Pe(t);t.setAttribute("d",V[s]),f=Math.max(Pe(t),S),t.setAttribute("d",l);}P[s]=f,t.style.strokeDasharray=`${f}`;}if(w.forEach((t,s)=>{or(t);let l=t.tagName.toLowerCase()==="path";l?V.push(t.getAttribute("d")??""):V.push(""),he(t,s);let f=P[s];F&&(l?ir(V[V.length-1],F,t):fe(`morphTo only applies to <path> elements \u2014 ignored on <${t.tagName}>.`,t)),n?(t.style.strokeDashoffset=g==="reverse"?`${f}`:"0",y&&(t.style.opacity="1"),oe&&(t.style.stroke=oe),se!==null&&(t.style.strokeWidth=`${se}`),ie!==null&&(t.style.fillOpacity=`${ie}`),F&&t.tagName.toLowerCase()==="path"&&t.setAttribute("d",F)):(t.style.strokeDashoffset=g==="reverse"?"0":`${f}`,y?t.style.opacity=g==="reverse"?"1":"0":t.style.opacity="",ne&&(t.style.stroke=ne),K!==null&&(t.style.strokeWidth=`${K}`),Z!==null&&(t.style.fillOpacity=`${Z}`));}),n)return _&&(e.style.clipPath=ae(1)),Me?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};_&&(e.style.clipPath=ae(g==="reverse"?1:0));let at=typeof d=="string"?St(d):null;function zt(){return !(Ht===false||Be||Se&&ce||!nr()||!w.length||!at||_||R!=="y"||I||m!==1||E!==0||N||Oe||de!==false||F||J||pe||me>0||ge||xe||Me||Qe||Ue||je||Ye||j!=null||Y!=null||X!=null||(p.start||"top bottom").trim()!=="top bottom"||(p.end||"bottom top").trim()!=="bottom top")}function qt(){let t=++rr,s=`svg-scroll-draw-${t}`,l=`svg-scroll-draw-host-${t}`,f=`--svg-scroll-draw-${t}`,S=g==="reverse"?"0":"var(--ssd-len)",k=g==="reverse"?"var(--ssd-len)":"0",x=`stroke-dashoffset:${S};`,b=`stroke-dashoffset:${k};`;y&&(x+=`opacity:${g==="reverse"?1:0};`,b+=`opacity:${g==="reverse"?0:1};`);let v=document.createElement("style");v.setAttribute("data-svg-scroll-draw",""),v.textContent=`@keyframes ${s}{from{${x}}to{${b}}}.${l}{view-timeline-name:${f};view-timeline-axis:block;}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${at};animation-fill-mode:both;animation-timeline:${f};animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),e.classList.add(l);function A(c,h){c.style.setProperty("--ssd-len",String(P[h])),c.style.strokeDasharray=`${P[h]}`,c.style.strokeDashoffset="",c.style.opacity="",c.style.animationPlayState="",c.classList.add(s);}w.forEach(A);let M=false,$=-1;function C(){if($>=0)return $;let c=e.getBoundingClientRect(),{tStart:h,tEnd:T}=ze({top:c.top,height:c.height},$e(),nt(),Xe,Je);return Q(U($e(),h,T,m))}return {destroy(){e.classList.remove(l),w.forEach(c=>{c.classList.remove(s),c.style.removeProperty("--ssd-len"),c.style.animationPlayState="";}),v.remove();},replay(){M=false,$=-1,w.forEach(A);},pause(){M=true,w.forEach(c=>{c.style.animationPlayState="paused";});},resume(){M&&(M=false,w.forEach(c=>{c.style.animationPlayState="running";}));},seek(c){let h=Math.min(1,Math.max(0,c));$=h,M=true,w.forEach((T,B)=>{T.classList.remove(s),T.style.strokeDashoffset=g==="reverse"?`${P[B]*h}`:`${P[B]*(1-h)}`,y&&(T.style.opacity=g==="reverse"?`${1-h}`:`${h}`);});},getProgress(){return C()},refresh(){w.forEach((c,h)=>{he(c,h),c.style.setProperty("--ssd-len",String(P[h]));});}}}if(zt())return _e(qt());function Bt(){let t=Math.max(1,Vt),s=_?t:t*(1+Math.max(0,w.length-1)*E),l=0,f=0,S=false;function k($){let C=true,c=Math.min(1,Math.max(0,$/s));if(_){let h=Math.min(1,Math.max(0,$/t)),T=Q(h);G=T,e.style.setProperty("--scroll-draw-progress",String(T)),e.style.clipPath=ae(g==="reverse"?1-T:T),ge?.(T),h<1&&(C=false);}else {w.forEach((T,B)=>{let Ut=B*E*t,mt=Math.min(1,Math.max(0,($-Ut)/t));Ve(T,B,Q(mt),g),mt<1&&(C=false);});let h=Q(c);G=h,ge?.(h),e.style.setProperty("--scroll-draw-progress",String(h));}if(J){let h=Q(c);for(let T in J){let B=parseFloat(T);h>=B&&!re.has(B)&&(re.add(B),J[T]?.());}}return C}function x($){if(D)return;let C=$-l;z||(z=true,xe?.());let c=k(C);if(c&&!O){O=true,k(s),Me?.(),ee<(pe==="infinite"?1/0:pe??0)&&(ee++,te=setTimeout(()=>{l=performance.now(),z=false,O=false,re.clear(),He(),q=requestAnimationFrame(x);},qe));return}c||(q=requestAnimationFrame(x));}function b(){cancelAnimationFrame(q),clearTimeout(te),l=performance.now(),f=0,D=false,z=false,O=false,ee=0,S=true,G=0,re.clear(),He(),q=requestAnimationFrame(x);}let v=new IntersectionObserver($=>{$.forEach(C=>{C.isIntersecting&&!(N&&O)?b():!C.isIntersecting&&!N&&!O&&(cancelAnimationFrame(q),clearTimeout(te),S=false);});},{root:I??null,threshold:Ft,rootMargin:_t}),A;function M(){clearTimeout(A),A=setTimeout(()=>w.forEach(he),150);}return window.addEventListener("resize",M),window.addEventListener("orientationchange",M),me>0?setTimeout(()=>v.observe(e),me):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(te),v.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),clearTimeout(A);},replay(){ee=0,b();},pause(){D||!S||(D=true,f=performance.now()-l,cancelAnimationFrame(q));},resume(){D&&(D=false,S=true,l=performance.now()-f,q=requestAnimationFrame(x));},seek($){let C=Math.min(1,Math.max(0,$));G=C,D=true,f=C*s,l=performance.now()-f,cancelAnimationFrame(q),k(f);},getProgress(){return G},refresh(){clearTimeout(A),w.forEach(he);}}}if(Be)return _e(Bt());st();let lt=()=>U($e(),Ke,Ze,1);function ut(){O=true,Me?.(),ee<(pe==="infinite"?1/0:pe)&&(ee++,te=setTimeout(()=>{Ne=true;},qe));}function ct(){Ie=-1,Ae=[],z=false,O=false,Ne=false,re.clear(),He(),le=true;}function Qt(){let t=performance.now(),s=$e();if(Ne&&lt()%1&&ct(),!le&&de===false&&s===tt)return;le=false,tt=s;let l=m;if(de!==false){let b=t-rt,v=b>0?Math.abs(s-(ke<0?s:ke))/b:0;l=m*Math.max(.2,1+v*(typeof de=="number"?de:1)*.04);}ke=s,rt=t;let f=Oe?Le===-1||s>=Le?"forward":"reverse":g;Le=s;let S=H-L,k=true,x=S===0?0:(s-L)/S;if(isNaN(ue)||(ue<=0&&x>0&&Qe?.(),ue<1&&x>=1&&Ue?.(),ue>=1&&x<1&&je?.(),ue>0&&x<=0&&Ye?.()),ue=x,_){let b=it(0,U(s,L,H,l));G=b,e.style.setProperty("--scroll-draw-progress",String(b));let v=f==="reverse"?1-b:b;e.style.clipPath=ae(v),ge?.(b),!z&&U(s,L,H,l)>0&&(z=true,xe?.()),b>=1&&!O?ut():b<1&&!N&&(O=false);return}if(w.forEach((b,v)=>{let A=v*Te*S,M=it(v,U(s,L+A,H+A,l));Ve(b,v,M,f),v===0&&(G=M,ge?.(M),e.style.setProperty("--scroll-draw-progress",String(M))),M<1&&(k=false);}),J){let b=Q(U(s,L,H,l));for(let v in J){let A=parseFloat(v);b>=A&&!re.has(A)&&(re.add(A),J[v]?.());}}!z&&U(s,L,H,l)>0&&(z=true,xe?.()),k&&!O?ut():!k&&!N&&(O=false);}let ye=Dt(I??window,[e],lt,Qt,()=>{let t=P.join();w.forEach(he),st(),le=true,P.join()!==t&&be();}),Ge=me>0;function be(){ye.hold(D||Ge);}let ft;return Ge&&(ft=setTimeout(()=>{Ge=false,be();},me)),be(),_e({destroy(){clearTimeout(te),clearTimeout(ft),ye.off(),et();},replay(){ct(),Le=-1,ke=-1,ee=0,D=false,G=0,clearTimeout(te),be();},pause(){D=true,ye.hold(true);},resume(){D&&(D=false,le=true,be());},seek(t){let s=Math.min(1,Math.max(0,t));G=s,Ie=s,Ae=[],D=true,ye.hold(true),Wt(s,g),le=true;},getProgress(){return G},refresh:ye.remeasure},()=>({tStart:L,tEnd:H}))}if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class r extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(E=>this.getAttribute(E)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let a={},u=this.getAttribute("speed"),m=this.getAttribute("easing"),y=this.getAttribute("stagger"),d=this.getAttribute("direction"),p=this.getAttribute("selector");u&&(a.speed=parseFloat(u)),m&&(a.easing=m),y&&(a.stagger=parseFloat(y)),d&&(a.direction=d),p&&(a.selector=p),this.hasAttribute("fade")&&(a.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(a.once=this.getAttribute("once")!=="false"),this.instance=Nt(this,a);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}r.observedAttributes=e,customElements.define("scroll-draw",r);}
1
+ 'use strict';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 U(e,...r){fe&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function Kt({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Zt({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,r)),i=Math.sqrt(o),a=0,l=[];for(let d=0;d<t;d++){let p=Math.pow(i,d);l.push(p),a+=p;}let c=[0],g=0;for(let d=0;d<t;d++)g+=l[d]/a,c.push(g);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let p=0;p<t;p++)if(d<=c[p+1]){let E=(d-c[p])/(c[p+1]-c[p]);if(p===0)return E*(2-E);let h=1-Math.pow(o,p);return h+(1-h)*(2*E-1)*(2*E-1)}return 1}}function er({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),o=Math.max(.1,r),i=t<=1?o/4:o/(2*Math.PI)*Math.asin(1/t);return a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-i)*(2*Math.PI)/o)+1}var me={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:Kt(),bounce:Zt(),elastic:er()};function tr(e,r,t,o){let i=(a,l,c)=>((1+3*a-3*l)*c+3*l-6*a)*c*c+3*a*c;return a=>{if(a<=0||a>=1)return +(a>0);let l=a;for(let c=0;c<8;c++)l-=(i(e,t,l)-a)/((3*(1+3*e-3*t)*l+6*t-12*e)*l+3*e);if(!(l>=0&&l<=1&&Math.abs(i(e,t,l)-a)<1e-9))for(let c=0,g=0,d=1;c<30;c++)l=(g+d)/2,i(e,t,l)<a?g=l:d=l;return i(r,o,l)}}function We(e){let r=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=r?r[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [tr(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var gt=new Set;function ht(e,r="linear"){if(typeof e=="function")return e;if(e==null)return me[r];if({}.hasOwnProperty.call(me,e))return me[e];let t=We(String(e));return t?t[0]:(!gt.has(e)&&gt.add(e)&&U(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),me[r])}function yt(e,r,t){return Math.min(t,Math.max(r,e))}function qe(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",o="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:o}}var wt=(e,r)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:r;function bt(e,r,t,o){return e+t+r*wt(o,0)}function vt(e,r){return r*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:wt(e,1))}function j(e,r,t,o){return t===r?0:yt((e-r)/(t-r)*o,0,1)}function Be(e,r,t,o,i){let a=bt(e.top,e.height,r,o.element)-vt(o.viewport,t),l=bt(e.top,e.height,r,i.element)-vt(i.viewport,t);return {tStart:a,tEnd:l}}function Et(e,r,t){let o=e.getBoundingClientRect(),i=t==="x"?o.width:o.height;return r?{top:t==="x"?o.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:o.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:i,scroll:0}:{top:t==="x"?o.left:o.top,height:i,scroll:t==="x"?window.scrollX:window.scrollY}}function Pe(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let t=e.tagName.toLowerCase();if(t==="rect"){let o=parseFloat(e.getAttribute("width")??"0"),i=parseFloat(e.getAttribute("height")??"0");return 2*(o+i)}if(t==="circle"){let o=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*o}return e.getTotalLength()}function De(e){return `${e} ${e*2}`}function St(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 o=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return o?[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]:null}function Mt(e,r,t){let o=St(e),i=St(r);return !o||!i?e:`rgb(${Math.round(o[0]+(i[0]-o[0])*t)},${Math.round(o[1]+(i[1]-o[1])*t)},${Math.round(o[2]+(i[2]-o[2])*t)})`}var Tt={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 rr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",nr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",xt=33;function or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function sr(e){let r=[];for(let t=0;t<xt;t++){let o=t/(xt-1);r.push(String(Math.round(e(o)*1e5)/1e5));}return `linear(${r.join(",")})`}function At(e){switch(e){case "linear":return "linear";case "ease-in":return rr;case "ease-out":return nr;case "ease-in-out":return or()?sr(me["ease-in-out"]):null;default:return We(e)?.[1]??null}}var Lt=Symbol.for("svg-scroll-draw.registry");function kt(){let e=globalThis;return e[Lt]||(e[Lt]=new Map)}function $t(e,r){kt().set(e,r);}function Pt(e){kt().delete(e);}function Dt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=i=>e(!!i.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let o=r;return o.addListener?.(t),()=>o.removeListener?.(t)}function Ot(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),o=Dt(a=>{if(!a)return;o();let l=(t.getProgress?.()??0)>=1;t.destroy(),t=r(l?{...e,onComplete:void 0}:e,true);}),i={};for(let a of Object.keys(t))i[a]=(...l)=>t[a]?.(...l);return i.destroy=()=>{o(),t.destroy();},i}var we,Oe=new Set,Ce=new WeakMap,Ee=new Map,Ct=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function ir(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let o=t;o;o=o.previousElementSibling)r.add(o);return r}function Rt(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();we??(we=new ResizeObserver(i=>{let a=false;for(let{target:l}of i)Ce.get(l)!==Ct(l)&&(a=true),Ce.set(l,"");a&&Oe.forEach(l=>l());})),Oe.add(t);let o=ir(e);return [document.body,document.documentElement].forEach(i=>i&&o.add(i)),o.forEach(i=>{Ce.has(i)||Ce.set(i,Ct(i)),Ee.set(i,(Ee.get(i)??0)+1),we.observe(i);}),()=>{Oe.delete(t)&&(o.forEach(i=>{let a=(Ee.get(i)??1)-1;if(a)return void Ee.set(i,a);Ee.delete(i),we?.unobserve(i);}),Oe.size||(we?.disconnect(),we=void 0));}}function Nt(e,r,t,o,i){let a,l=NaN,c,g,d=()=>{a=0,o(),!c&&!a&&(l=t())>0&&l<1&&(a=requestAnimationFrame(d));},p=()=>{!a&&!c&&t()!==l&&(a=requestAnimationFrame(d));},E=G=>{c=G,cancelAnimationFrame(a),a=l=NaN,p();},h=()=>{clearTimeout(g),i(),p();},F=()=>{clearTimeout(g),g=setTimeout(h,150);},Se=Rt(r,F),R=G=>{e[G]("scroll",p,{passive:true}),window[G]("resize",F),window[G]("orientationchange",F);};return R("addEventListener"),p(),{hold:E,remeasure:h,off(){E(true),R("removeEventListener"),Se(),clearTimeout(g);}}}var ar=0;function lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ft(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var It=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function ur(e){if(!fe)return;let r=Ft(e,"stroke");if(!r||r==="none"){U("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!It.has(t)&&!It.has(Ft(e,"fill"))&&U("Element has a fill \u2014 it may obscure the stroke animation.",e);}function cr(e,r,t){let o=document.createElement("div");o.setAttribute("data-svg-scroll-draw-debug",""),o.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function i(){let a=t==="x"?window.scrollX:window.scrollY,l=e-a,c=r-a,g=t==="x";o.innerHTML=`
2
+ <div style="position:absolute;${g?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${g?`left:${c}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${c}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(o),window.addEventListener("scroll",i,{passive:true}),i(),{el:o,destroy(){window.removeEventListener("scroll",i),o.remove();}}}var _t=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function fr(e,r,t){if(!fe)return;let o=(e.match(zt)??[]).join("").toUpperCase(),i=(r.match(zt)??[]).join("").toUpperCase(),a=(e.match(_t)??[]).length,l=(r.match(_t)??[]).length;if(o!==i){U(`morphTo: command sequence differs (${o||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}a!==l&&U(`morphTo: coordinate count differs (${a} \u2192 ${l}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function mr(e,r,t){let o=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let l=parseFloat(a),c=o[i++]??l;return String(+(l+(c-l)*t).toFixed(4))})}function Vt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ot(r,(t,o)=>dr(e,t,o))}function dr(e,r,t){let{preset:o,...i}=r,a=o?{...Tt[o],...i}:i,{selector:l="path, polyline, line, polygon, rect, circle",speed:c=1,fade:g=false,easing:d="linear",trigger:p={},stagger:E=0,direction:h="forward",once:F=false,debug:Se=false,axis:R="y",scrollContainer:G,autoReverse:Re=false,delay:de=0,strokeColor:Y,strokeWidth:X,fillOpacity:J,waypoints:K,velocityScale:pe=false,threshold:Ht=0,rootMargin:Gt="0px",repeat:ge=0,repeatDelay:Qe=0,morphTo:I,clip:Ne,autoplay:Ue=false,duration:Wt=1e3,native:qt=true,onProgress:he,onStart:Me,onComplete:Te,onEnter:je,onLeave:Ye,onEnterBack:Xe,onLeaveBack:Je}=a,_=Ne===true?"left":typeof Ne=="string"?Ne:false,Q=ht(d),Ke=qe(p.start||"top bottom"),Ze=qe(p.end||"bottom top"),N=typeof G=="string"?document.querySelector(G):G??null,oe=Array.isArray(Y)?Y[0]:null,se=Array.isArray(Y)?Y[1]:typeof Y=="string"?Y:null,Z=Array.isArray(X)?X[0]:null,ie=Array.isArray(X)?X[1]:typeof X=="number"?X:null,ee=Array.isArray(J)?J[0]:null,ae=Array.isArray(J)?J[1]:typeof J=="number"?J:null;function le(n){let s=n*100;switch(_){case "right":return `inset(0 0 0 ${100-s}%)`;case "top":return `inset(0 0 ${100-s}% 0)`;case "bottom":return `inset(${100-s}% 0 0 0)`;case "center":return `circle(${n*150}% at 50% 50%)`;default:return `inset(0 ${100-s}% 0 0)`}}let w=_?[]:Array.from(e.querySelectorAll(l)),P=[],z=[],L=0,V=0,xe=E,et=0,tt=0,C=false,W=false,q=0,Fe=-1,Ae=[],Le=-1,D=false,H=0,te=0,re,Ie=false,_e=null;function rt(){_e?.destroy(),_e=null;}let ne=new Set,nt=NaN,ue=true,ke=-1,ot=performance.now(),ce=NaN;function $e(){return N?R==="x"?N.scrollLeft:N.scrollTop:R==="x"?window.scrollX:window.scrollY}function st(){return N?R==="x"?N.clientWidth:N.clientHeight:R==="x"?window.innerWidth:window.innerHeight}function it(){let n=Et(e,N,R);return Be(n,n.scroll,st(),Ke,Ze)}function Bt(){let n=V-L,s=w.length-1,u=N??document.documentElement,m=R==="x"?"Width":"Height";if(xe=E,E>0&&s>0&&n>0){let M=u[`scroll${m}`]-u[`client${m}`]-1-L-n/c;M>=0&&(xe=Math.min(E,M/(s*n)));}let S=Math.max(0,s)*xe*n,k=n/Math.min(c,1);et=L+Math.min(0,S,k,S+k),tt=L+Math.max(0,S,k,S+k);}function at(){(({tStart:L,tEnd:V}=it())),Bt(),Se&&fe&&(rt(),_e=cr(L,V,R));}function ze(n,s=it){$t(e,{type:"draw",getProgress:()=>n.getProgress(),getTrigger:s});let u=n.destroy;return n.destroy=()=>{u.call(n),Pt(e);},n}function lt(n,s){return F&&!Re?Math.max(Fe,Q(Ae[n]=Math.max(Ae[n]??0,s))):Q(s)}function Qt(n,s){if(e.style.setProperty("--scroll-draw-progress",String(n)),_){let u=s==="reverse"?1-n:n;e.style.clipPath=le(u);return}w.forEach((u,m)=>Ve(u,m,n,s));}function Ve(n,s,u,m){n.style.strokeDashoffset=m==="reverse"?`${P[s]*u}`:`${P[s]*(1-u)}`,g&&(n.style.opacity=m==="reverse"?`${1-u}`:`${u}`),oe&&se?n.style.stroke=Mt(oe,se,u):se&&(n.style.stroke=se),Z!==null&&ie!==null?n.style.strokeWidth=`${Z+(ie-Z)*u}`:ie!==null&&(n.style.strokeWidth=`${ie}`),ee!==null&&ae!==null?n.style.fillOpacity=`${ee+(ae-ee)*u}`:ae!==null&&(n.style.fillOpacity=`${ae}`),I&&n.tagName.toLowerCase()==="path"&&z[s]&&n.setAttribute("d",mr(z[s],I,u));}function He(){if(e.style.setProperty("--scroll-draw-progress","0"),_){e.style.clipPath=le(h==="reverse"?1:0);return}w.forEach((n,s)=>{n.style.strokeDasharray=De(P[s]),n.style.strokeDashoffset=h==="reverse"?"0":`${P[s]}`,g?n.style.opacity=h==="reverse"?"1":"0":n.style.opacity="",oe&&(n.style.stroke=oe),Z!==null&&(n.style.strokeWidth=`${Z}`),ee!==null&&(n.style.fillOpacity=`${ee}`),I&&n.tagName.toLowerCase()==="path"&&z[s]&&n.setAttribute("d",z[s]);});}function ye(n,s){let u=n.getAttribute("d"),m=Pe(n);if(I&&z[s]){n.setAttribute("d",I);let S=Pe(n);n.setAttribute("d",z[s]),m=Math.max(Pe(n),S),n.setAttribute("d",u);}P[s]=m,n.style.strokeDasharray=De(m);}if(w.forEach((n,s)=>{ur(n);let u=n.tagName.toLowerCase()==="path";u?z.push(n.getAttribute("d")??""):z.push(""),ye(n,s);let m=P[s];I&&(u?fr(z[z.length-1],I,n):U(`morphTo only applies to <path> elements \u2014 ignored on <${n.tagName}>.`,n)),t?(n.style.strokeDashoffset=h==="reverse"?`${m}`:"0",g&&(n.style.opacity="1"),se&&(n.style.stroke=se),ie!==null&&(n.style.strokeWidth=`${ie}`),ae!==null&&(n.style.fillOpacity=`${ae}`),I&&n.tagName.toLowerCase()==="path"&&n.setAttribute("d",I)):(n.style.strokeDashoffset=h==="reverse"?"0":`${m}`,g?n.style.opacity=h==="reverse"?"1":"0":n.style.opacity="",oe&&(n.style.stroke=oe),Z!==null&&(n.style.strokeWidth=`${Z}`),ee!==null&&(n.style.fillOpacity=`${ee}`));}),t)return _&&(e.style.clipPath=le(1)),Te?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};_&&(e.style.clipPath=le(h==="reverse"?1:0));let ut=typeof d=="string"?At(d):null;function Ut(){return !(qt===false||Ue||Se&&fe||!lr()||!w.length||!ut||_||R!=="y"||N||c!==1||E!==0||F||Re||pe!==false||I||K||ge||de>0||he||Me||Te||je||Ye||Xe||Je||Y!=null||X!=null||J!=null||(p.start||"top bottom").trim()!=="top bottom"||(p.end||"bottom top").trim()!=="bottom top")}function jt(){let n=++ar,s=`svg-scroll-draw-${n}`,u=`svg-scroll-draw-host-${n}`,m=`--svg-scroll-draw-${n}`,S=h==="reverse"?"0":"var(--ssd-len)",k=h==="reverse"?"var(--ssd-len)":"0",M=`stroke-dashoffset:${S};`,b=`stroke-dashoffset:${k};`;g&&(M+=`opacity:${h==="reverse"?1:0};`,b+=`opacity:${h==="reverse"?0:1};`);let v=document.createElement("style");v.setAttribute("data-svg-scroll-draw",""),v.textContent=`@keyframes ${s}{from{${M}}to{${b}}}.${u}{view-timeline-name:${m};view-timeline-axis:block;}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${ut};animation-fill-mode:both;animation-timeline:${m};animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),e.classList.add(u);function A(f,y){f.style.setProperty("--ssd-len",String(P[y])),f.style.strokeDasharray=De(P[y]),f.style.strokeDashoffset="",f.style.opacity="",f.style.animationPlayState="",f.classList.add(s);}w.forEach(A);let T=false,$=-1;function O(){if($>=0)return $;let f=e.getBoundingClientRect(),{tStart:y,tEnd:x}=Be({top:f.top,height:f.height},$e(),st(),Ke,Ze);return Q(j($e(),y,x,c))}return {destroy(){e.classList.remove(u),w.forEach(f=>{f.classList.remove(s),f.style.removeProperty("--ssd-len"),f.style.animationPlayState="";}),v.remove();},replay(){T=false,$=-1,w.forEach(A);},pause(){T=true,w.forEach(f=>{f.style.animationPlayState="paused";});},resume(){T&&(T=false,w.forEach(f=>{f.style.animationPlayState="running";}));},seek(f){let y=Math.min(1,Math.max(0,f));$=y,T=true,w.forEach((x,B)=>{x.classList.remove(s),x.style.strokeDashoffset=h==="reverse"?`${P[B]*y}`:`${P[B]*(1-y)}`,g&&(x.style.opacity=h==="reverse"?`${1-y}`:`${y}`);});},getProgress(){return O()},refresh(){w.forEach((f,y)=>{ye(f,y),f.style.setProperty("--ssd-len",String(P[y]));});}}}if(Ut())return ze(jt());function Yt(){let n=Math.max(1,Wt),s=_?n:n*(1+Math.max(0,w.length-1)*E),u=0,m=0,S=false;function k($){let O=true,f=Math.min(1,Math.max(0,$/s));if(_){let y=Math.min(1,Math.max(0,$/n)),x=Q(y);H=x,e.style.setProperty("--scroll-draw-progress",String(x)),e.style.clipPath=le(h==="reverse"?1-x:x),he?.(x),y<1&&(O=false);}else {w.forEach((x,B)=>{let Jt=B*E*n,pt=Math.min(1,Math.max(0,($-Jt)/n));Ve(x,B,Q(pt),h),pt<1&&(O=false);});let y=Q(f);H=y,he?.(y),e.style.setProperty("--scroll-draw-progress",String(y));}if(K){let y=Q(f);for(let x in K){let B=parseFloat(x);y>=B&&!ne.has(B)&&(ne.add(B),K[x]?.());}}return O}function M($){if(D)return;let O=$-u;W||(W=true,Me?.());let f=k(O);if(f&&!C){C=true,k(s),Te?.(),te<(ge==="infinite"?1/0:ge??0)&&(te++,re=setTimeout(()=>{u=performance.now(),W=false,C=false,ne.clear(),He(),q=requestAnimationFrame(M);},Qe));return}f||(q=requestAnimationFrame(M));}function b(){cancelAnimationFrame(q),clearTimeout(re),u=performance.now(),m=0,D=false,W=false,C=false,te=0,S=true,H=0,ne.clear(),He(),q=requestAnimationFrame(M);}let v=new IntersectionObserver($=>{$.forEach(O=>{O.isIntersecting&&!(F&&C)?b():!O.isIntersecting&&!F&&!C&&(cancelAnimationFrame(q),clearTimeout(re),S=false);});},{root:N??null,threshold:Ht,rootMargin:Gt}),A;function T(){clearTimeout(A),A=setTimeout(()=>w.forEach(ye),150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),de>0?setTimeout(()=>v.observe(e),de):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(re),v.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(A);},replay(){te=0,b();},pause(){D||!S||(D=true,m=performance.now()-u,cancelAnimationFrame(q));},resume(){D&&(D=false,S=true,u=performance.now()-m,q=requestAnimationFrame(M));},seek($){let O=Math.min(1,Math.max(0,$));H=O,D=true,m=O*s,u=performance.now()-m,cancelAnimationFrame(q),k(m);},getProgress(){return H},refresh(){clearTimeout(A),w.forEach(ye);}}}if(Ue)return ze(Yt());at();let ct=()=>j($e(),et,tt,1);function ft(){C=true,Te?.(),te<(ge==="infinite"?1/0:ge)&&(te++,re=setTimeout(()=>{Ie=true;},Qe));}function mt(){Fe=-1,Ae=[],W=false,C=false,Ie=false,ne.clear(),He(),ue=true;}function Xt(){let n=performance.now(),s=$e();if(Ie&&ct()%1&&mt(),!ue&&pe===false&&s===nt)return;ue=false,nt=s;let u=c;if(pe!==false){let b=n-ot,v=b>0?Math.abs(s-(ke<0?s:ke))/b:0;u=c*Math.max(.2,1+v*(typeof pe=="number"?pe:1)*.04);}ke=s,ot=n;let m=Re?Le===-1||s>=Le?"forward":"reverse":h;Le=s;let S=V-L,k=true,M=S===0?0:(s-L)/S;if(isNaN(ce)||(ce<=0&&M>0&&je?.(),ce<1&&M>=1&&Ye?.(),ce>=1&&M<1&&Xe?.(),ce>0&&M<=0&&Je?.()),ce=M,_){let b=lt(0,j(s,L,V,u));H=b,e.style.setProperty("--scroll-draw-progress",String(b));let v=m==="reverse"?1-b:b;e.style.clipPath=le(v),he?.(b),!W&&j(s,L,V,u)>0&&(W=true,Me?.()),b>=1&&!C?ft():b<1&&!F&&(C=false);return}if(w.forEach((b,v)=>{let A=v*xe*S,T=lt(v,j(s,L+A,V+A,u));Ve(b,v,T,m),v===0&&(H=T,he?.(T),e.style.setProperty("--scroll-draw-progress",String(T))),T<1&&(k=false);}),K){let b=Q(j(s,L,V,u));for(let v in K){let A=parseFloat(v);b>=A&&!ne.has(A)&&(ne.add(A),K[v]?.());}}!W&&j(s,L,V,u)>0&&(W=true,Me?.()),k&&!C?ft():!k&&!F&&(C=false);}let be=Nt(N??window,[e],ct,Xt,()=>{let n=P.join();w.forEach(ye),at(),ue=true,P.join()!==n&&ve();}),Ge=de>0;function ve(){be.hold(D||Ge);}let dt;return Ge&&(dt=setTimeout(()=>{Ge=false,ve();},de)),ve(),ze({destroy(){clearTimeout(re),clearTimeout(dt),be.off(),rt();},replay(){mt(),Le=-1,ke=-1,te=0,D=false,H=0,clearTimeout(re),ve();},pause(){D=true,be.hold(true);},resume(){D&&(D=false,ue=true,ve());},seek(n){let s=Math.min(1,Math.max(0,n));H=s,Fe=s,Ae=[],D=true,be.hold(true),Qt(s,h),ue=true;},getProgress(){return H},refresh:be.remeasure},()=>({tStart:L,tEnd:V}))}if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class r extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(E=>this.getAttribute(E)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let a={},l=this.getAttribute("speed"),c=this.getAttribute("easing"),g=this.getAttribute("stagger"),d=this.getAttribute("direction"),p=this.getAttribute("selector");l&&(a.speed=parseFloat(l)),c&&(a.easing=c),g&&(a.stagger=parseFloat(g)),d&&(a.direction=d),p&&(a.selector=p),this.hasAttribute("fade")&&(a.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(a.once=this.getAttribute("once")!=="false"),this.instance=Vt(this,a);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}r.observedAttributes=e,customElements.define("scroll-draw",r);}
@@ -1 +1 @@
1
- import {b}from'../chunk-7XOFQCQE.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-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class s extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(d=>this.getAttribute(d)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let t={},n=this.getAttribute("speed"),r=this.getAttribute("easing"),a=this.getAttribute("stagger"),c=this.getAttribute("direction"),o=this.getAttribute("selector");n&&(t.speed=parseFloat(n)),r&&(t.easing=r),a&&(t.stagger=parseFloat(a)),c&&(t.direction=c),o&&(t.selector=o),this.hasAttribute("fade")&&(t.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(t.once=this.getAttribute("once")!=="false"),this.instance=b(this,t);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}s.observedAttributes=e,customElements.define("scroll-draw",s);}
1
+ import {b}from'../chunk-XLXVGQ3P.mjs';import'../chunk-7LDSB4FT.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-YOOPMYT6.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class s extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(d=>this.getAttribute(d)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let t={},n=this.getAttribute("speed"),r=this.getAttribute("easing"),a=this.getAttribute("stagger"),c=this.getAttribute("direction"),o=this.getAttribute("selector");n&&(t.speed=parseFloat(n)),r&&(t.easing=r),a&&(t.stagger=parseFloat(a)),c&&(t.direction=c),o&&(t.selector=o),this.hasAttribute("fade")&&(t.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(t.once=this.getAttribute("once")!=="false"),this.instance=b(this,t);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}s.observedAttributes=e,customElements.define("scroll-draw",s);}
@@ -0,0 +1,8 @@
1
+ import { ScrollFramesOptions } from './frames/index.mjs';
2
+
3
+ /** The options as scrollFrames takes them, but `triggerElement` may be a selector. */
4
+ type FramesInput = Omit<ScrollFramesOptions, 'triggerElement'> & {
5
+ triggerElement?: Element | string | null;
6
+ };
7
+
8
+ export type { FramesInput as F };
@@ -0,0 +1,8 @@
1
+ import { ScrollFramesOptions } from './frames/index.js';
2
+
3
+ /** The options as scrollFrames takes them, but `triggerElement` may be a selector. */
4
+ type FramesInput = Omit<ScrollFramesOptions, 'triggerElement'> & {
5
+ triggerElement?: Element | string | null;
6
+ };
7
+
8
+ export type { FramesInput as F };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svg-scroll-draw",
3
- "version": "2.24.0",
3
+ "version": "2.26.0",
4
4
  "description": "SVG line drawing on scroll, on the browser's own scroll timeline (CSS animation-timeline, JS fallback). Drop-in for AOS, ScrollReveal and vivus. Plus reveal, pin, snap, text, video and image-sequence scrub. Zero dependencies. React, Vue, Svelte, Solid, Angular, Astro, vanilla JS",
5
5
  "keywords": [
6
6
  "svg",
@@ -1 +0,0 @@
1
- import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,e,c,b as b$2}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$3}from'./chunk-4DOJSIEQ.mjs';import {a as a$2,b as b$1}from'./chunk-EBU6E26L.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function G(e,o){let t=document.createElement("span");t.textContent=o,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function S(e=""){let o=document.createElement("span");return o.setAttribute("aria-hidden","true"),o.textContent=e,o}function W(e){let o=e.textContent??"";return e.textContent="",o.split(/(\s+)/).filter(Boolean).map(t=>{let n=e.appendChild(S(t)),i=/^\s+$/.test(t);return i?n.style.whiteSpace="pre":n.style.display="inline-block",i?null:n}).filter(t=>t!==null)}function X(e){let o=e.textContent??"";e.textContent="";let t=[],n=null;for(let i of o){let r=S(i),s=i===" ";s?r.style.whiteSpace="pre":(r.style.display="inline-block",t.push(r)),s||i>"\u0DFF"?n=null:n||(n=e.appendChild(S()),n.style.cssText="display:inline-block;white-space:nowrap"),(n??e).appendChild(r);}return t}function R(e){let o=W(e),t=new Map;for(let r of o){let s=r.offsetTop;t.has(s)||t.set(s,[]),t.get(s).push(r);}let n=[],i=Array.from(t.keys()).sort((r,s)=>r-s);for(let r of i){let s=t.get(r),p=S();p.style.display="inline-block",s.forEach((d,m)=>{let f=d.nextElementSibling;p.appendChild(d),m<s.length-1&&f&&f.style.whiteSpace==="pre"&&p.appendChild(f);}),n.push(p);}return e.textContent="",n.forEach((r,s)=>{e.appendChild(r),s<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function J(e,o,t,n){if(t<=1||n===0)return e;n=Math.min(n,1/t);let i=(t-1)*n,r=o*n,s=r+(1-i);return s<=r?e>=r?1:0:a$3((e-r)/(s-r),0,1)}function K(e,o){let t=[];if(o?.y!==void 0&&t.push(`translateY(${o.y*(1-e)}px)`),o?.x!==void 0&&t.push(`translateX(${o.x*(1-e)}px)`),o?.rotate!==void 0&&t.push(`rotate(${o.rotate*(1-e)}deg)`),o?.scale!==void 0){let n=o.scale+(1-o.scale)*e;t.push(`scale(${n})`);}return t.join(" ")}var v={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function se(e,o={}){if(typeof window>"u")return v;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),v;let n=t;return a(o,(i,r)=>Q(n,i,r))}function Q(e$1,o,t){let{split:n="words",stagger:i=.04,easing:r="ease-out",from:s={opacity:0,y:24},trigger:p={},once:d$1=true,onComplete:m}=o,f=typeof r=="function"?r:d[r]??d["ease-out"],_=a$1(p.start||"top 85%"),j=a$1(p.end||"top 40%"),b=e$1.innerHTML,I=e$1.textContent??"",a;n==="chars"?a=X(e$1):n==="lines"?a=R(e$1):a=W(e$1),G(e$1,I);let q=a.length;function z(l,T){s?.opacity!==void 0&&(l.style.opacity=String(s.opacity+(1-s.opacity)*T));let x=K(T,s);x&&(l.style.transform=x);}function c$1(l){e$1.style.setProperty("--scroll-draw-progress",String(l)),a.forEach((T,x)=>{let U=f(J(l,x,q,i));z(T,U);});}if(t)return c$1(1),m?.(),{...v,destroy:()=>{e$1.innerHTML=b;},getProgress:()=>1};c$1(0);let w=0,E=0,g=-1,u=0,h=false;function P(){({tStart:w,tEnd:E}=c(e$1.getBoundingClientRect(),window.scrollY,window.innerHeight,_,j));}let C=()=>b$2(window.scrollY,w,E,1);function F(){let l=d$1?g=Math.max(g,C()):C();u=l,c$1(l),l>=1&&!h?(h=true,m?.()):l<1&&!d$1&&(h=false);}P();let y=e(window,[e$1],C,F,()=>{n==="lines"&&(e$1.innerHTML=b,a=R(e$1),G(e$1,I),c$1(u)),P();});a$2(e$1,{type:"text",getProgress:()=>u,getTrigger:()=>({tStart:w,tEnd:E})});let k=()=>y.hold(false);return {destroy(){y.off(),e$1.innerHTML=b,b$1(e$1);},replay(){g=-1,h=false,u=0,c$1(0),k();},pause:()=>y.hold(true),resume:k,seek(l){y.hold(true),c$1(u=g=a$3(l,0,1));},getProgress(){return u}}}export{se as a};
@@ -1 +0,0 @@
1
- import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-BRV2B2YW.mjs';import {a as a$4}from'./chunk-32ZCSGFZ.mjs';import {a as a$2}from'./chunk-U5TKLHGW.mjs';import {a as a$1}from'./chunk-7USW2XFB.mjs';import {b as b$2}from'./chunk-7XOFQCQE.mjs';import {defineComponent,ref,h as h$1,onMounted,watch,onUnmounted,unref}from'vue';var u=e=>typeof e=="function"?e():unref(e);function r(e,t,o){let l=null,i=t(),s=()=>{l?.destroy(),l=e.value?o(e.value,b$1(i,()=>i)):null;};onMounted(s),watch(()=>a(i=t()),s),onUnmounted(()=>{l?.destroy(),l=null;});}function B(e={}){let t=ref(null);return r(t,()=>u(e),b$2),t}var g={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},b=[null,Boolean,[Boolean,String],[Boolean,Number]],T=e=>({type:e,default:void 0}),H=defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(g).map(([e,t])=>[e,t?T(b[t]):null])),setup(e,{slots:t}){let o=ref(null);return r(o,()=>{let l={};for(let i in g){let s=e[i];s!=null&&(l[i]=s);}return l},b$2),()=>h$1("div",{ref:o},t.default?.())}});function V(e){let t=ref(null);return r(t,()=>u(e),a$1),t}var j=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options,a$1),()=>h$1("div",{ref:o},t.default?.())}});function G(e){let t=ref(null);return r(t,()=>u(e),a$2),t}var h=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:T(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return r(t,()=>{let o={to:e.to};return e.from!=null&&(o.from=e.from),e.format!=null&&(o.format=e.format),e.easing!=null&&(o.easing=e.easing),e.trigger!=null&&(o.trigger=e.trigger),e.once!=null&&(o.once=e.once),e.decimals!=null&&(o.decimals=e.decimals),e.onComplete!=null&&(o.onComplete=e.onComplete),o},a$2),()=>h$1("span",{ref:t})}});function N(e={}){let t=ref(null);return r(t,()=>u(e),a$3),t}var F=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let t=ref(null);return r(t,()=>e.options??{},a$3),()=>h$1("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function q(e={}){let t=ref(null);return r(t,()=>u(e),a$4),t}var I=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options??{},a$4),()=>h$1(e.tag,{ref:o},t.default?.())}});export{B as a,H as b,V as c,j as d,G as e,h as f,N as g,F as h,q as i,I as j};
@@ -1 +0,0 @@
1
- import {b,a as a$4}from'./chunk-V3Z6G5JE.mjs';import {a as a$3}from'./chunk-UPWWULKI.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,e,b as b$1,c}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$2,b as b$3}from'./chunk-EBU6E26L.mjs';import {b as b$2}from'./chunk-LFSU6LR3.mjs';function wt(t){return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")}function ut(t){let i=[],l=/([\w]+)\(([^)]*)\)/g,s;for(;(s=l.exec(t))!==null;){let m=[],r=[],c=s[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let o=u.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(o?parseFloat(o[1]):0),r.push(o?o[2]:"");}i.push({fn:s[1],nums:m,units:r});}return i}function Mt(t,i,l){let s=ut(t),m=ut(i);return s.length===0||s.length!==m.length?l<1?t:i:s.map((r,c)=>{let u=m[c];return r.fn!==u.fn||r.nums.length!==u.nums.length?l<1?`${r.fn}(${r.nums.map((o,p)=>`${o}${r.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((o,p)=>`${o}${u.units[p]}`).join(", ")})`:`${r.fn}(${r.nums.map((o,p)=>`${o+(u.nums[p]-o)*l}${r.units[p]}`).join(", ")})`}).join(" ")}function ft(t,i,l){if(typeof t=="number"&&typeof i=="number")return String(t+(i-t)*l);let s=String(t),m=String(i);if(wt(s))return a$4(s,m,l);if(s.includes("("))return Mt(s,m,l);let r=s.match(/^([-+]?[\d.]+)(.*)$/),c=m.match(/^([-+]?[\d.]+)(.*)$/);if(r&&c){let u=parseFloat(r[1]),o=parseFloat(c[1]);return `${u+(o-u)*l}${r[2]||c[2]}`}return l<1?s:m}function Lt(t){return t.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}var $t=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),At=0,pt="--scroll-draw-progress";function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Wt(t,i){return typeof window>"u"?dt:i.respectReducedMotion===false?gt(t,i,false):a(i,(l,s)=>gt(t,l,s))}function gt(t,i,l){let{props:s,trigger:m={},easing:r="ease-out",speed:c$1=1,once:u=false,axis:o="y",scrollContainer:p,native:yt=true,velocityScale:H=false,triggerElement:ht,onProgress:q,onComplete:F,onEnter:U,onLeave:X,onEnterBack:Y,onLeaveBack:Z}=i,x=typeof r=="function"?r:d[r]??d["ease-out"],J=a$1(m.start||"top bottom"),K=a$1(m.end||"bottom top"),N=ht??t,y=typeof p=="string"?document.querySelector(p):p??null,h=Object.entries(s).map(([e,n])=>({prop:Lt(e),from:Array.isArray(n)?n[0]:"",to:Array.isArray(n)?n[1]:n}));function Et(){let e=window.getComputedStyle(t);for(let n of h)n.from===""&&(n.from=e.getPropertyValue(n.prop).trim()||"0");}function bt(){for(let e of h)t.style.setProperty(e.prop,String(e.to));}let V=new Map;for(let e of [...h.map(n=>n.prop),pt])V.set(e,t.style.getPropertyValue(e));function O(){for(let[e,n]of V)n?t.style.setProperty(e,n):t.style.removeProperty(e);}if(l)return bt(),F?.(),{...dt,destroy:O,getProgress:()=>1};Et();let M=()=>y?o==="x"?y.scrollLeft:y.scrollTop:o==="x"?window.scrollX:window.scrollY,Q=()=>y?o==="x"?y.clientWidth:y.clientHeight:o==="x"?window.innerWidth:window.innerHeight,tt=typeof r=="string"?b(r):null;function St(){if(!yt||!Ct()||!tt||o!=="y"||y||N!==t||u||c$1!==1||q||F||U||X||Y||Z||H!==false||(m.start||"top bottom").trim()!=="top bottom"||(m.end||"bottom top").trim()!=="bottom top")return false;for(let e of h)if(!$t.has(e.prop))return false;return true}function vt(){let e=`ssd-a-${++At}`,n=h.map(a=>`${a.prop}:${a.from}`).join(";"),w=h.map(a=>`${a.prop}:${a.to}`).join(";"),b=document.createElement("style");b.setAttribute("data-ssd-animate",""),b.textContent=`@keyframes ${e}{from{${n}}to{${w}}}.${e}{animation-name:${e};animation-duration:auto;animation-timing-function:${tt};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(b),t.classList.add(e);let d=()=>{let a=t.getBoundingClientRect();return c({top:a.top,height:a.height},M(),Q(),J,K)};a$2(t,{type:"animate",getProgress:()=>f.getProgress(),getTrigger:d});let f={refresh(){},destroy(){t.classList.remove(e),b.remove(),t.style.animationPlayState="",O(),b$3(t);},replay(){t.classList.remove(e),t.offsetWidth,t.classList.add(e);},pause(){t.style.animationPlayState="paused";},resume(){t.style.animationPlayState="";},seek(a){let A=Math.min(1,Math.max(0,a));t.classList.remove(e);for(let I of h)t.style.setProperty(I.prop,ft(I.from,I.to,A));},getProgress(){let{tStart:a,tEnd:A}=d();return x(b$1(M(),a,A,c$1))}};return f}if(St())return vt();let g=0,E=0,T=false,W=-1,P=0,S=0,R=false,v=NaN,B=-1,et=0,L=N===t?h:[],nt=false;function rt(){let e=t.style,n=L.map(f=>e.getPropertyValue(f.prop)),w=e.transition;L.length&&(e.transition="none"),L.forEach(f=>e.setProperty(f.prop,V.get(f.prop)??""));let b=a$3(N,y,o);L.forEach((f,a)=>e.setProperty(f.prop,n[a])),L.length&&(t.offsetWidth,e.transition=w);let d=c(b,b.scroll,Q(),J,K);nt&&Math.abs(d.tStart-g)<1&&Math.abs(d.tEnd-E)<1||(nt=true,g=d.tStart,E=d.tEnd);}function k(e){t.style.setProperty(pt,String(e));for(let n of h)t.style.setProperty(n.prop,ft(n.from,n.to,e));q?.(e);}function Tt(e){if(isNaN(v)){v=e;return}v<=0&&e>0&&U?.(),v<1&&e>=1&&X?.(),v>=1&&e<1&&Y?.(),v>0&&e<=0&&Z?.(),v=e;}function Pt(){if(T)return;let e=performance.now(),n=M(),w=c$1;if(H!==false){let a=e-et,A=a>0?Math.abs(n-(B<0?n:B))/a:0;w=c$1*Math.max(.2,1+A*(typeof H=="number"?H:1)*.04);}B=n,et=e;let b=E===g?0:(n-g)/(E-g);Tt(b);let d=b$1(n,g,E,w),f=u?Math.max(W,x(P=Math.max(P,d))):x(d);S=f,k(f),f>=1&&!R?(R=true,F?.()):f<1&&!u&&(R=false);}let $=e(y??window,[N],()=>b$1(M(),g,E,Math.min(c$1,1)),Pt,rt);rt(),E===g&&b$2("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",t),P=b$1(M(),g,E,c$1),S=x(P),k(S),a$2(t,{type:"animate",getProgress:()=>S,getTrigger:()=>({tStart:g,tEnd:E})});function ot(){T=true,$.hold(true);}return {destroy(){T=true,$.off(),O(),b$3(t);},replay(){W=-1,P=0,R=false,S=0,T=false,k(0),$.hold(false);},pause:ot,resume(){T&&(T=false,$.hold(false));},seek(e){let n=Math.min(1,Math.max(0,e));S=n,W=n,P=0,ot(),k(n);},getProgress(){return S},refresh:$.remeasure}}export{Wt as a};
@@ -1,3 +0,0 @@
1
- import {b as b$1,a as a$6}from'./chunk-V3Z6G5JE.mjs';import {a as a$2}from'./chunk-UPWWULKI.mjs';import {a as a$5}from'./chunk-XC5NR2MU.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,e,c,b as b$3}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$4,b as b$2}from'./chunk-EBU6E26L.mjs';import {b,a as a$3}from'./chunk-LFSU6LR3.mjs';var gt={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 Ct=0;function Ot(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function ht(r,p){let f="";try{f=getComputedStyle(r).getPropertyValue(p).trim();}catch{}return f||(r.getAttribute(p)??"").trim()}var vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Nt(r){if(!a$3)return;let p=ht(r,"stroke");if(!p||p==="none"){b("Element has no stroke \u2014 path will not be visible.",r);return}let f=(r.getAttribute("fill")??"").trim();f&&!vt.has(f)&&!vt.has(ht(r,"fill"))&&b("Element has a fill \u2014 it may obscure the stroke animation.",r);}function Ft(r,p,f){let d=document.createElement("div");d.setAttribute("data-svg-scroll-draw-debug",""),d.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 k(){let F=f==="x"?window.scrollX:window.scrollY,x=r-F,M=p-F,H=f==="x";d.innerHTML=`
2
- <div style="position:absolute;${H?`left:${x}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${x}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;${H?`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(d),window.addEventListener("scroll",k,{passive:true}),k(),{el:d,destroy(){window.removeEventListener("scroll",k),d.remove();}}}var wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,bt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Ht(r,p,f){if(!a$3)return;let d=(r.match(bt)??[]).join("").toUpperCase(),k=(p.match(bt)??[]).join("").toUpperCase(),F=(r.match(wt)??[]).length,x=(p.match(wt)??[]).length;if(d!==k){b(`morphTo: command sequence differs (${d||"\u2205"} \u2192 ${k||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,f);return}F!==x&&b(`morphTo: coordinate count differs (${F} \u2192 ${x}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,f);}function It(r,p,f){let d=(p.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),k=0;return r.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,F=>{let x=parseFloat(F),M=d[k++]??x;return String(+(x+(M-x)*f).toFixed(4))})}function Zt(r,p={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:a(p,(f,d)=>Rt(r,f,d))}function Rt(r,p,f){let{preset:d$1,...k}=p,F=d$1?{...gt[d$1],...k}:k,{selector:x="path, polyline, line, polygon, rect, circle",speed:M=1,fade:H=false,easing:le="linear",trigger:he={},stagger:q=0,direction:u="forward",once:K=false,debug:Ve=false,axis:W="y",scrollContainer:ke,autoReverse:xe=false,delay:fe=0,strokeColor:B,strokeWidth:_,fillOpacity:j,waypoints:U,velocityScale:ce=false,threshold:Et=0,rootMargin:St="0px",repeat:ue=0,repeatDelay:We=0,morphTo:L,clip:Me,autoplay:ze=false,duration:Tt=1e3,native:$t=true,onProgress:me,onStart:ve,onComplete:we,onEnter:Ge,onLeave:qe,onEnterBack:Be,onLeaveBack:_e}=F,D=Me===true?"left":typeof Me=="string"?Me:false,z=typeof le=="function"?le:d[le]??d.linear,je=a$1(he.start||"top bottom"),Ue=a$1(he.end||"bottom top"),P=typeof ke=="string"?document.querySelector(ke):ke??null,ee=Array.isArray(B)?B[0]:null,te=Array.isArray(B)?B[1]:typeof B=="string"?B:null,X=Array.isArray(_)?_[0]:null,re=Array.isArray(_)?_[1]:typeof _=="number"?_:null,Y=Array.isArray(j)?j[0]:null,se=Array.isArray(j)?j[1]:typeof j=="number"?j:null;function ne(e){let t=e*100;switch(D){case "right":return `inset(0 0 0 ${100-t}%)`;case "top":return `inset(0 0 ${100-t}% 0)`;case "bottom":return `inset(${100-t}% 0 0 0)`;case "center":return `circle(${e*150}% at 50% 50%)`;default:return `inset(0 ${100-t}% 0 0)`}}let c$1=D?[]:Array.from(r.querySelectorAll(x)),S=[],C=[],w=0,O=0,be=q,Xe=0,Ye=0,A=false,I=false,R=0,Pe=-1,Ee=[],Se=-1,T=false,N=0,Q=0,Z,Le=false,De=null;function Qe(){De?.destroy(),De=null;}let J=new Set,Ze=NaN,oe=true,Te=-1,Je=performance.now(),ie=NaN;function $e(){return P?W==="x"?P.scrollLeft:P.scrollTop:W==="x"?window.scrollX:window.scrollY}function Ke(){return P?W==="x"?P.clientWidth:P.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function et(){let e=a$2(r,P,W);return c(e,e.scroll,Ke(),je,Ue)}function At(){let e=O-w,t=c$1.length-1,s=P??document.documentElement,o=W==="x"?"Width":"Height";if(be=q,q>0&&t>0&&e>0){let y=s[`scroll${o}`]-s[`client${o}`]-1-w-e/M;y>=0&&(be=Math.min(q,y/(t*e)));}let m=Math.max(0,t)*be*e,b=e/Math.min(M,1);Xe=w+Math.min(0,m,b,m+b),Ye=w+Math.max(0,m,b,m+b);}function tt(){(({tStart:w,tEnd:O}=et())),At(),Ve&&a$3&&(Qe(),De=Ft(w,O,W));}function Ce(e,t=et){a$4(r,{type:"draw",getProgress:()=>e.getProgress(),getTrigger:t});let s=e.destroy;return e.destroy=()=>{s.call(e),b$2(r);},e}function rt(e,t){return K&&!xe?Math.max(Pe,z(Ee[e]=Math.max(Ee[e]??0,t))):z(t)}function kt(e,t){if(r.style.setProperty("--scroll-draw-progress",String(e)),D){let s=t==="reverse"?1-e:e;r.style.clipPath=ne(s);return}c$1.forEach((s,o)=>Oe(s,o,e,t));}function Oe(e,t,s,o){e.style.strokeDashoffset=o==="reverse"?`${S[t]*s}`:`${S[t]*(1-s)}`,H&&(e.style.opacity=o==="reverse"?`${1-s}`:`${s}`),ee&&te?e.style.stroke=a$6(ee,te,s):te&&(e.style.stroke=te),X!==null&&re!==null?e.style.strokeWidth=`${X+(re-X)*s}`:re!==null&&(e.style.strokeWidth=`${re}`),Y!==null&&se!==null?e.style.fillOpacity=`${Y+(se-Y)*s}`:se!==null&&(e.style.fillOpacity=`${se}`),L&&e.tagName.toLowerCase()==="path"&&C[t]&&e.setAttribute("d",It(C[t],L,s));}function Ne(){if(r.style.setProperty("--scroll-draw-progress","0"),D){r.style.clipPath=ne(u==="reverse"?1:0);return}c$1.forEach((e,t)=>{e.style.strokeDasharray=`${S[t]}`,e.style.strokeDashoffset=u==="reverse"?"0":`${S[t]}`,H?e.style.opacity=u==="reverse"?"1":"0":e.style.opacity="",ee&&(e.style.stroke=ee),X!==null&&(e.style.strokeWidth=`${X}`),Y!==null&&(e.style.fillOpacity=`${Y}`),L&&e.tagName.toLowerCase()==="path"&&C[t]&&e.setAttribute("d",C[t]);});}function pe(e,t){let s=e.getAttribute("d"),o=a$5(e);if(L&&C[t]){e.setAttribute("d",L);let m=a$5(e);e.setAttribute("d",C[t]),o=Math.max(a$5(e),m),e.setAttribute("d",s);}S[t]=o,e.style.strokeDasharray=`${o}`;}if(c$1.forEach((e,t)=>{Nt(e);let s=e.tagName.toLowerCase()==="path";s?C.push(e.getAttribute("d")??""):C.push(""),pe(e,t);let o=S[t];L&&(s?Ht(C[C.length-1],L,e):b(`morphTo only applies to <path> elements \u2014 ignored on <${e.tagName}>.`,e)),f?(e.style.strokeDashoffset=u==="reverse"?`${o}`:"0",H&&(e.style.opacity="1"),te&&(e.style.stroke=te),re!==null&&(e.style.strokeWidth=`${re}`),se!==null&&(e.style.fillOpacity=`${se}`),L&&e.tagName.toLowerCase()==="path"&&e.setAttribute("d",L)):(e.style.strokeDashoffset=u==="reverse"?"0":`${o}`,H?e.style.opacity=u==="reverse"?"1":"0":e.style.opacity="",ee&&(e.style.stroke=ee),X!==null&&(e.style.strokeWidth=`${X}`),Y!==null&&(e.style.fillOpacity=`${Y}`));}),f)return D&&(r.style.clipPath=ne(1)),we?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};D&&(r.style.clipPath=ne(u==="reverse"?1:0));let st=typeof le=="string"?b$1(le):null;function xt(){return !($t===false||ze||Ve&&a$3||!Ot()||!c$1.length||!st||D||W!=="y"||P||M!==1||q!==0||K||xe||ce!==false||L||U||ue||fe>0||me||ve||we||Ge||qe||Be||_e||B!=null||_!=null||j!=null||(he.start||"top bottom").trim()!=="top bottom"||(he.end||"bottom top").trim()!=="bottom top")}function Mt(){let e=++Ct,t=`svg-scroll-draw-${e}`,s=`svg-scroll-draw-host-${e}`,o=`--svg-scroll-draw-${e}`,m=u==="reverse"?"0":"var(--ssd-len)",b=u==="reverse"?"var(--ssd-len)":"0",y=`stroke-dashoffset:${m};`,a=`stroke-dashoffset:${b};`;H&&(y+=`opacity:${u==="reverse"?1:0};`,a+=`opacity:${u==="reverse"?0:1};`);let l=document.createElement("style");l.setAttribute("data-svg-scroll-draw",""),l.textContent=`@keyframes ${t}{from{${y}}to{${a}}}.${s}{view-timeline-name:${o};view-timeline-axis:block;}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${st};animation-fill-mode:both;animation-timeline:${o};animation-range:cover 0% cover 100%;}`,document.head.appendChild(l),r.classList.add(s);function v(n,i){n.style.setProperty("--ssd-len",String(S[i])),n.style.strokeDasharray=`${S[i]}`,n.style.strokeDashoffset="",n.style.opacity="",n.style.animationPlayState="",n.classList.add(t);}c$1.forEach(v);let g=false,E=-1;function $(){if(E>=0)return E;let n=r.getBoundingClientRect(),{tStart:i,tEnd:h}=c({top:n.top,height:n.height},$e(),Ke(),je,Ue);return z(b$3($e(),i,h,M))}return {destroy(){r.classList.remove(s),c$1.forEach(n=>{n.classList.remove(t),n.style.removeProperty("--ssd-len"),n.style.animationPlayState="";}),l.remove();},replay(){g=false,E=-1,c$1.forEach(v);},pause(){g=true,c$1.forEach(n=>{n.style.animationPlayState="paused";});},resume(){g&&(g=false,c$1.forEach(n=>{n.style.animationPlayState="running";}));},seek(n){let i=Math.min(1,Math.max(0,n));E=i,g=true,c$1.forEach((h,V)=>{h.classList.remove(t),h.style.strokeDashoffset=u==="reverse"?`${S[V]*i}`:`${S[V]*(1-i)}`,H&&(h.style.opacity=u==="reverse"?`${1-i}`:`${i}`);});},getProgress(){return $()},refresh(){c$1.forEach((n,i)=>{pe(n,i),n.style.setProperty("--ssd-len",String(S[i]));});}}}if(xt())return Ce(Mt());function Pt(){let e=Math.max(1,Tt),t=D?e:e*(1+Math.max(0,c$1.length-1)*q),s=0,o=0,m=false;function b(E){let $=true,n=Math.min(1,Math.max(0,E/t));if(D){let i=Math.min(1,Math.max(0,E/e)),h=z(i);N=h,r.style.setProperty("--scroll-draw-progress",String(h)),r.style.clipPath=ne(u==="reverse"?1-h:h),me?.(h),i<1&&($=false);}else {c$1.forEach((h,V)=>{let Dt=V*q*e,lt=Math.min(1,Math.max(0,(E-Dt)/e));Oe(h,V,z(lt),u),lt<1&&($=false);});let i=z(n);N=i,me?.(i),r.style.setProperty("--scroll-draw-progress",String(i));}if(U){let i=z(n);for(let h in U){let V=parseFloat(h);i>=V&&!J.has(V)&&(J.add(V),U[h]?.());}}return $}function y(E){if(T)return;let $=E-s;I||(I=true,ve?.());let n=b($);if(n&&!A){A=true,b(t),we?.(),Q<(ue==="infinite"?1/0:ue??0)&&(Q++,Z=setTimeout(()=>{s=performance.now(),I=false,A=false,J.clear(),Ne(),R=requestAnimationFrame(y);},We));return}n||(R=requestAnimationFrame(y));}function a(){cancelAnimationFrame(R),clearTimeout(Z),s=performance.now(),o=0,T=false,I=false,A=false,Q=0,m=true,N=0,J.clear(),Ne(),R=requestAnimationFrame(y);}let l=new IntersectionObserver(E=>{E.forEach($=>{$.isIntersecting&&!(K&&A)?a():!$.isIntersecting&&!K&&!A&&(cancelAnimationFrame(R),clearTimeout(Z),m=false);});},{root:P??null,threshold:Et,rootMargin:St}),v;function g(){clearTimeout(v),v=setTimeout(()=>c$1.forEach(pe),150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),fe>0?setTimeout(()=>l.observe(r),fe):l.observe(r),{destroy(){cancelAnimationFrame(R),clearTimeout(Z),l.disconnect(),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(v);},replay(){Q=0,a();},pause(){T||!m||(T=true,o=performance.now()-s,cancelAnimationFrame(R));},resume(){T&&(T=false,m=true,s=performance.now()-o,R=requestAnimationFrame(y));},seek(E){let $=Math.min(1,Math.max(0,E));N=$,T=true,o=$*t,s=performance.now()-o,cancelAnimationFrame(R),b(o);},getProgress(){return N},refresh(){clearTimeout(v),c$1.forEach(pe);}}}if(ze)return Ce(Pt());tt();let nt=()=>b$3($e(),Xe,Ye,1);function ot(){A=true,we?.(),Q<(ue==="infinite"?1/0:ue)&&(Q++,Z=setTimeout(()=>{Le=true;},We));}function it(){Pe=-1,Ee=[],I=false,A=false,Le=false,J.clear(),Ne(),oe=true;}function Lt(){let e=performance.now(),t=$e();if(Le&&nt()%1&&it(),!oe&&ce===false&&t===Ze)return;oe=false,Ze=t;let s=M;if(ce!==false){let a=e-Je,l=a>0?Math.abs(t-(Te<0?t:Te))/a:0;s=M*Math.max(.2,1+l*(typeof ce=="number"?ce:1)*.04);}Te=t,Je=e;let o=xe?Se===-1||t>=Se?"forward":"reverse":u;Se=t;let m=O-w,b=true,y=m===0?0:(t-w)/m;if(isNaN(ie)||(ie<=0&&y>0&&Ge?.(),ie<1&&y>=1&&qe?.(),ie>=1&&y<1&&Be?.(),ie>0&&y<=0&&_e?.()),ie=y,D){let a=rt(0,b$3(t,w,O,s));N=a,r.style.setProperty("--scroll-draw-progress",String(a));let l=o==="reverse"?1-a:a;r.style.clipPath=ne(l),me?.(a),!I&&b$3(t,w,O,s)>0&&(I=true,ve?.()),a>=1&&!A?ot():a<1&&!K&&(A=false);return}if(c$1.forEach((a,l)=>{let v=l*be*m,g=rt(l,b$3(t,w+v,O+v,s));Oe(a,l,g,o),l===0&&(N=g,me?.(g),r.style.setProperty("--scroll-draw-progress",String(g))),g<1&&(b=false);}),U){let a=z(b$3(t,w,O,s));for(let l in U){let v=parseFloat(l);a>=v&&!J.has(v)&&(J.add(v),U[l]?.());}}!I&&b$3(t,w,O,s)>0&&(I=true,ve?.()),b&&!A?ot():!b&&!K&&(A=false);}let de=e(P??window,[r],nt,Lt,()=>{let e=S.join();c$1.forEach(pe),tt(),oe=true,S.join()!==e&&ye();}),Fe=fe>0;function ye(){de.hold(T||Fe);}let at;return Fe&&(at=setTimeout(()=>{Fe=false,ye();},fe)),ye(),Ce({destroy(){clearTimeout(Z),clearTimeout(at),de.off(),Qe();},replay(){it(),Se=-1,Te=-1,Q=0,T=false,N=0,clearTimeout(Z),ye();},pause(){T=true,de.hold(true);},resume(){T&&(T=false,oe=true,ye());},seek(e){let t=Math.min(1,Math.max(0,e));N=t,Pe=t,Ee=[],T=true,de.hold(true),kt(t,u),oe=true;},getProgress(){return N},refresh:de.remeasure},()=>({tStart:w,tEnd:O}))}export{gt as a,Zt as b};
@@ -1,2 +0,0 @@
1
- import {e,b as b$2}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a,b as b$1}from'./chunk-EBU6E26L.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var x="http://www.w3.org/2000/svg",G="cinematic-photo",D=a=>a<0?0:a>1?1:a;function u(a){let i=parseFloat(a);return Number.isFinite(i)?D(i/100):0}function L(a){return d[a]??d.linear}var P=a=>({destroy(){},getProgress:()=>a}),R=class{constructor(i){if(typeof document>"u"){this.mount=null;return}this.mount=typeof i.wrapper=="string"?document.querySelector(i.wrapper):i.wrapper,this.mount||b("Cinematic: wrapper not found:",i.wrapper);}loadStory(i){let s=this.mount;if(typeof window>"u"||!s)return P(0);s.style.position="relative",s.style.height=i.totalHeight,s.style.display="block";let l=document.createElement("div");l.setAttribute("data-cinematic-stage",""),l.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",s.appendChild(l);let f=[];for(let t of i.scenes){if(t.background){let e=document.createElement("img");e.id=G,e.src=t.background,e.alt="",e.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",l.appendChild(e);}let n=t.animations.filter(e=>e.type==="draw");if(n.length){let e=document.createElementNS(x,"svg");e.setAttribute("viewBox",`0 0 ${i.canvas.width} ${i.canvas.height}`),e.setAttribute("preserveAspectRatio","xMidYMid meet"),e.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",l.appendChild(e);for(let o of n){let r=document.createElementNS(x,"path");r.id=o.target.replace(/^#/,""),r.setAttribute("d",o.d),r.setAttribute("fill","none"),r.setAttribute("stroke",o.stroke),r.setAttribute("stroke-width",String(o.strokeWidth)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");let h=o.length||r.getTotalLength?.()||0;r.style.strokeDasharray=String(h),r.style.strokeDashoffset=String(h),e.appendChild(r),f.push({kind:"draw",el:r,start:u(o.start),end:u(o.end),ease:L(o.easing),length:h});}}for(let e of t.animations){if(e.type!=="fade")continue;let o=l.querySelector(e.target)??document.querySelector(e.target);o&&(o.style.opacity=String(e.from),f.push({kind:"fade",el:o,start:u(e.start),end:u(e.end),ease:L("ease-in-out"),from:e.from,to:e.to}));}}let d=0,c=null;for(let t=s.parentElement;t?.parentElement;t=t.parentElement)if(/[ao]/.test(getComputedStyle(t).overflowY)&&t.scrollHeight>t.clientHeight&&(t!==document.body||/[aoh]/.test(getComputedStyle(t.parentElement).overflowY))){c=t;break}let m=0,p=0,b=()=>{let t=s.getBoundingClientRect().top;m=c?t-c.getBoundingClientRect().top-c.clientTop+c.scrollTop:t+window.scrollY,p=m+Math.max(0,s.offsetHeight-(c?c.clientHeight:window.innerHeight));},S=()=>{let t=c?c.scrollTop:window.scrollY;return p<=m?t>=m?1:0:b$2(t,m,p,1)},g=t=>{for(let n of f){let e=n.end-n.start,o=e<=0?t>=n.end?1:0:D((t-n.start)/e),r=n.ease(o);n.kind==="draw"?n.el.style.strokeDashoffset=String(n.length*(1-r)):n.el.style.opacity=String(n.from+(n.to-n.from)*r);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return g(1),P(1);let E=()=>{d=S(),g(d);};b(),E();let v=e(c||window,[s],S,E,b);a(s,{type:"draw",getProgress:()=>d,getTrigger:()=>({tStart:m,tEnd:p})});let k=a$1(t=>{t&&(k(),v.off(),b$1(s),d=1,g(1));});return {destroy(){k(),v.off(),b$1(s);},getProgress:()=>d}}};
2
- export{R as a};
@@ -1 +0,0 @@
1
- import {a,e,c,b as b$2}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'./chunk-EBU6E26L.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var X={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function se(c$1,h={}){if(typeof window>"u")return X;let y=typeof c$1=="string"?document.querySelector(c$1):c$1;if(!y||y.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",c$1),X;let t=y,{trigger:C={},easing:v="linear",once:V=false,axis:u="y",preload:Y="auto",triggerElement:j,onReady:L,onComplete:J,onProgress:K}=h,R=j??t,a$3=window.matchMedia("(prefers-reduced-motion: reduce)").matches,z=typeof v=="function"?v:d[v]??d.linear,Q=a(C.start||"top top"),U=a(C.end||"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=Y);let A=h.from??0,b$3=h.to,m=0,f=0,r=false,E=-1,g=0,n=0,p=false,i=false,I=()=>u==="x"?window.scrollX:window.scrollY,Z=()=>u==="x"?window.innerWidth:window.innerHeight;function S(){let e=R.getBoundingClientRect(),o=u==="x"?e.left:e.top,d=u==="x"?e.width:e.height,H=c({top:o,height:d},I(),Z(),Q,U);m=H.tStart,f=H.tEnd,i&&f===m&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let w=NaN;function s(e){if(!i)return;let o=b$3??t.duration??0,d=A+(o-A)*e;d!==w&&(w=d,t.currentTime=d),t.style.setProperty("--scroll-draw-progress",String(e)),K?.(e);}let O=()=>b$2(I(),m,f,1);function $(){if(!i||a$3)return;let e=O(),o=V?Math.max(E,z(g=Math.max(g,e))):z(e);n=o,s(o),o>=1&&!p?(p=true,J?.()):o<1&&!V&&(p=false);}let l=e(window,[R],O,$,S),x=()=>l.hold(r||!i||a$3);x();function N(){if(i=true,b$3===void 0&&(b$3=t.duration),a$3){s(1),L?.();return}S(),L?.(),r?s(n):x();}t.readyState>=1?N():t.addEventListener("loadedmetadata",N,{once:true}),i||S();let k=a$3?()=>{}:a$1(e=>{e&&(k(),a$3=true,l.hold(true),s(1));});a$2(t,{type:"video",getProgress:()=>n,getTrigger:()=>({tStart:m,tEnd:f})});function D(){r&&(r=false,x());}return {destroy(){l.off(),t.removeEventListener("loadedmetadata",N),k(),b$1(t);},replay(){E=-1,g=0,p=false,n=0,w=NaN,s(0),D();},pause(){r=true,l.hold(true);},resume:D,seek(e){let o=Math.min(1,Math.max(0,e));n=o,E=o,g=0,r=true,l.hold(true),w=NaN,s(o);},getProgress(){return n}}}export{se as a};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-7USW2XFB.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function b(e,o){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?a(r,o):(b$1("scrollAnimate: element not found:",e),n)}function P(e,o={}){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return b$1("scrollParallax: element not found:",e),n;let{speed:c=.3,axis:p="y",easing:f="linear",trigger:u,onProgress:g}=o,i=-c*100,s=r.style,m=!!r.ownerSVGElement,y=s.getPropertyValue("transform-box");m&&s.setProperty("transform-box","fill-box");let l=a(r,{props:p==="x"?{transform:["translateX(0%)",`translateX(${i}%)`]}:{transform:["translateY(0%)",`translateY(${i}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:f,native:false,onProgress:g});return m?{...l,destroy(){l.destroy(),s.setProperty("transform-box",y);}}:l}export{b as a,P as b};
@@ -1 +0,0 @@
1
- function M({tension:n=2.5,friction:a=2.2}={}){return t=>1-Math.cos(t*Math.PI*n)*Math.pow(1-t,a)}function p({bounces:n=3,decay:a=.5}={}){let t=Math.max(1,Math.round(n)),o=Math.max(.01,Math.min(.99,a)),c=Math.sqrt(o),u=0,m=[];for(let r=0;r<t;r++){let e=Math.pow(c,r);m.push(e),u+=e;}let s=[0],b=0;for(let r=0;r<t;r++)b+=m[r]/u,s.push(b);return r=>{if(r<=0)return 0;if(r>=1)return 1;for(let e=0;e<t;e++)if(r<=s[e+1]){let i=(r-s[e])/(s[e+1]-s[e]);if(e===0)return i*(2-i);let h=1-Math.pow(o,e);return h+(1-h)*(2*i-1)*(2*i-1)}return 1}}function f({amplitude:n=1,period:a=.4}={}){let t=Math.max(1,n),o=Math.max(.1,a),c=t<=1?o/4:o/(2*Math.PI)*Math.asin(1/t);return u=>u<=0?0:u>=1?1:t*Math.pow(2,-10*u)*Math.sin((u-c)*(2*Math.PI)/o)+1}var l={linear:n=>n,"ease-in":n=>n*n,"ease-out":n=>n*(2-n),"ease-in-out":n=>n<.5?2*n*n:-1+(4-2*n)*n,spring:M(),bounce:p(),elastic:f()};export{M as a,p as b,f as c,l as d};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,e,c}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$2,b as b$2}from'./chunk-EBU6E26L.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var C={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function U(t,p){if(typeof window>"u")return C;let a$1=typeof t=="string"?document.querySelector(t):t;return a$1?a(p,(l,c)=>B(a$1,l,c)):(b("scrollCounter: element not found:",t),C)}function B(t,p,a){let{from:l=0,to:c$1,format:F,easing:f="ease-out",trigger:P={},once:E=true,decimals:M,onComplete:v}=p,x=M!==void 0?e=>e.toFixed(M):F??(e=>String(Math.round(e))),d$1=typeof f=="function"?f:d[f]??d["ease-out"],G=a$1(P.start||"top 80%"),L=a$1(P.end||"top 20%");if(a)return t.textContent=x(c$1),v?.(),{...C,getProgress:()=>1};let s=0,i=0,T=false,h=-1,o=0,n=0,u=false,w=()=>window.scrollY,V=()=>window.innerHeight;function A(){let e=t.getBoundingClientRect(),r=c({top:e.top,height:e.height},w(),V(),G,L);T&&Math.abs(r.tStart-s)<1&&Math.abs(r.tEnd-i)<1||(T=true,s=r.tStart,i=r.tEnd);}let _=t.style.getPropertyValue("--scroll-draw-progress");function m(e){t.textContent=x(l+(c$1-l)*e),t.style.setProperty("--scroll-draw-progress",String(e));}let I=()=>b$1(w(),s,i,1);function q(){let e=I(),r=E?Math.max(h,d$1(o=Math.max(o,e))):d$1(e);n=r,m(r),r>=1&&!u?(u=true,v?.()):r<1&&!E&&(u=false);}A();{o=b$1(w(),s,i,1);let e=d$1(o);n=e,m(e);}let g=e(window,[t],I,q,A);a$2(t,{type:"counter",getProgress:()=>n,getTrigger:()=>({tStart:s,tEnd:i})});let O=()=>g.hold(false);return {destroy(){g.off(),t.style.setProperty("--scroll-draw-progress",_),b$2(t);},replay(){h=-1,o=0,u=false,n=0,m(0),O();},pause:()=>g.hold(true),resume:O,seek(e){let r=Math.min(1,Math.max(0,e));n=r,h=r,o=0,g.hold(true),m(r);},getProgress(){return n}}}export{U as a};
@@ -1 +0,0 @@
1
- import {d}from'./chunk-THPTANES.mjs';function u(t){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(t);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let e=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(e)return [parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(t);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function l(t,r,e){let n=u(t),s=u(r);return !n||!s?t:`rgb(${Math.round(n[0]+(s[0]-n[0])*e)},${Math.round(n[1]+(s[1]-n[1])*e)},${Math.round(n[2]+(s[2]-n[2])*e)})`}var o="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",c="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",a=33;function p(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function f(t){let r=[];for(let e=0;e<a;e++){let n=e/(a-1);r.push(String(Math.round(t(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function g(t){switch(t){case "linear":return "linear";case "ease-in":return o;case "ease-out":return c;case "ease-in-out":return p()?f(d["ease-in-out"]):null;default:return null}}export{l as a,g as b};
@@ -1 +0,0 @@
1
- var i=new WeakMap,u=0;function f(t){return JSON.stringify(t,(o,n)=>{if(typeof n=="function")return "\u0192";if(typeof Element<"u"&&n instanceof Element){let e=i.get(n);return e===void 0&&i.set(n,e=++u),`el#${e}`}return n})}function s(t,o){let n={...t};for(let e of Object.keys(n))typeof n[e]=="function"&&(n[e]=(...r)=>o()[e]?.(...r));return n}export{f as a,s as b};