svg-scroll-draw 2.23.3 → 2.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +3 -3
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +64 -59
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/chunk-6TWFLRUB.mjs +3 -0
- package/dist/{chunk-BLY6F6EC.mjs → chunk-DSFD227B.mjs} +1 -1
- package/dist/chunk-I73SOXBN.mjs +1 -0
- package/dist/chunk-NLPSVYFP.mjs +1 -0
- package/dist/chunk-OPXWNJBG.mjs +1 -0
- package/dist/chunk-QFSTKVA3.mjs +1 -0
- package/dist/chunk-XC5NR2MU.mjs +1 -0
- package/dist/{chunk-ETACBG7W.mjs → chunk-XTPAW6XR.mjs} +1 -1
- package/dist/{chunk-4I7MLTP5.mjs → chunk-ZNCZYV3Q.mjs} +1 -1
- package/dist/group/index.cjs +3 -3
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +10 -7
- package/dist/horizontal/index.d.ts +10 -7
- package/dist/horizontal/index.mjs +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.mjs +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.mts +3 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +9 -3
- package/dist/reveal/index.d.ts +9 -3
- package/dist/reveal/index.mjs +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +1 -1
- package/dist/timeline/index.mjs +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-23EALNDF.mjs +0 -3
- package/dist/chunk-4H2SGMAQ.mjs +0 -1
- package/dist/chunk-GMBIGV3M.mjs +0 -1
- package/dist/chunk-LGJQWZHH.mjs +0 -1
- package/dist/chunk-V4L3ELVC.mjs +0 -1
- package/dist/chunk-YZV4Z3EQ.mjs +0 -1
|
@@ -162,6 +162,8 @@ var SvgScrollDraw = (() => {
|
|
|
162
162
|
|
|
163
163
|
// src/core/geometry.ts
|
|
164
164
|
function getElementLength(el) {
|
|
165
|
+
const declared = parseFloat(el.getAttribute("pathLength") ?? "");
|
|
166
|
+
if (declared > 0) return declared;
|
|
165
167
|
const tag = el.tagName.toLowerCase();
|
|
166
168
|
if (tag === "rect") {
|
|
167
169
|
const w = parseFloat(el.getAttribute("width") ?? "0");
|
|
@@ -676,13 +678,26 @@ var SvgScrollDraw = (() => {
|
|
|
676
678
|
el.setAttribute("d", originalDs[i]);
|
|
677
679
|
});
|
|
678
680
|
}
|
|
679
|
-
|
|
681
|
+
function measure(el, i) {
|
|
682
|
+
const d = el.getAttribute("d");
|
|
683
|
+
let len = getElementLength(el);
|
|
684
|
+
if (morphTo && originalDs[i]) {
|
|
685
|
+
el.setAttribute("d", morphTo);
|
|
686
|
+
const target = getElementLength(el);
|
|
687
|
+
el.setAttribute("d", originalDs[i]);
|
|
688
|
+
len = Math.max(getElementLength(el), target);
|
|
689
|
+
el.setAttribute("d", d);
|
|
690
|
+
}
|
|
691
|
+
lengths[i] = len;
|
|
692
|
+
el.style.strokeDasharray = `${len}`;
|
|
693
|
+
}
|
|
694
|
+
paths.forEach((el, i) => {
|
|
680
695
|
checkElement(el);
|
|
681
|
-
const len = getElementLength(el);
|
|
682
|
-
lengths.push(len);
|
|
683
696
|
const isPath = el.tagName.toLowerCase() === "path";
|
|
684
697
|
if (isPath) originalDs.push(el.getAttribute("d") ?? "");
|
|
685
698
|
else originalDs.push("");
|
|
699
|
+
measure(el, i);
|
|
700
|
+
const len = lengths[i];
|
|
686
701
|
if (morphTo) {
|
|
687
702
|
if (!isPath) {
|
|
688
703
|
warn(`morphTo only applies to <path> elements \u2014 ignored on <${el.tagName}>.`, el);
|
|
@@ -691,7 +706,6 @@ var SvgScrollDraw = (() => {
|
|
|
691
706
|
}
|
|
692
707
|
}
|
|
693
708
|
if (prefersReduced) {
|
|
694
|
-
el.style.strokeDasharray = `${len}`;
|
|
695
709
|
el.style.strokeDashoffset = direction === "reverse" ? `${len}` : "0";
|
|
696
710
|
if (fade) el.style.opacity = "1";
|
|
697
711
|
if (colorTo) el.style.stroke = colorTo;
|
|
@@ -699,7 +713,6 @@ var SvgScrollDraw = (() => {
|
|
|
699
713
|
if (fillOpacityTo !== null) el.style.fillOpacity = `${fillOpacityTo}`;
|
|
700
714
|
if (morphTo && el.tagName.toLowerCase() === "path") el.setAttribute("d", morphTo);
|
|
701
715
|
} else {
|
|
702
|
-
el.style.strokeDasharray = `${len}`;
|
|
703
716
|
el.style.strokeDashoffset = direction === "reverse" ? "0" : `${len}`;
|
|
704
717
|
if (fade) el.style.opacity = direction === "reverse" ? "1" : "0";
|
|
705
718
|
else el.style.opacity = "";
|
|
@@ -723,7 +736,7 @@ var SvgScrollDraw = (() => {
|
|
|
723
736
|
function nativeEligible() {
|
|
724
737
|
if (native === false) return false;
|
|
725
738
|
if (autoplay) return false;
|
|
726
|
-
if (debug) return false;
|
|
739
|
+
if (debug && IS_DEV) return false;
|
|
727
740
|
if (!supportsNativeTimeline()) return false;
|
|
728
741
|
if (!paths.length) return false;
|
|
729
742
|
if (!cssTiming) return false;
|
|
@@ -837,9 +850,8 @@ var SvgScrollDraw = (() => {
|
|
|
837
850
|
*/
|
|
838
851
|
refresh() {
|
|
839
852
|
paths.forEach((el, i) => {
|
|
840
|
-
|
|
853
|
+
measure(el, i);
|
|
841
854
|
el.style.setProperty("--ssd-len", String(lengths[i]));
|
|
842
|
-
el.style.strokeDasharray = `${lengths[i]}`;
|
|
843
855
|
});
|
|
844
856
|
}
|
|
845
857
|
};
|
|
@@ -946,12 +958,7 @@ var SvgScrollDraw = (() => {
|
|
|
946
958
|
let resizeTimer2;
|
|
947
959
|
function onResize2() {
|
|
948
960
|
clearTimeout(resizeTimer2);
|
|
949
|
-
resizeTimer2 = setTimeout(() =>
|
|
950
|
-
paths.forEach((el, i) => {
|
|
951
|
-
lengths[i] = getElementLength(el);
|
|
952
|
-
el.style.strokeDasharray = `${lengths[i]}`;
|
|
953
|
-
});
|
|
954
|
-
}, 150);
|
|
961
|
+
resizeTimer2 = setTimeout(() => paths.forEach(measure), 150);
|
|
955
962
|
}
|
|
956
963
|
window.addEventListener("resize", onResize2);
|
|
957
964
|
window.addEventListener("orientationchange", onResize2);
|
|
@@ -998,10 +1005,7 @@ var SvgScrollDraw = (() => {
|
|
|
998
1005
|
/** No trigger window on this path — it runs on time — so lengths only. */
|
|
999
1006
|
refresh() {
|
|
1000
1007
|
clearTimeout(resizeTimer2);
|
|
1001
|
-
paths.forEach(
|
|
1002
|
-
lengths[i] = getElementLength(el);
|
|
1003
|
-
el.style.strokeDasharray = `${lengths[i]}`;
|
|
1004
|
-
});
|
|
1008
|
+
paths.forEach(measure);
|
|
1005
1009
|
}
|
|
1006
1010
|
};
|
|
1007
1011
|
}
|
|
@@ -1152,10 +1156,7 @@ var SvgScrollDraw = (() => {
|
|
|
1152
1156
|
{ root: scrollEl ?? null, threshold, rootMargin }
|
|
1153
1157
|
);
|
|
1154
1158
|
function remeasure() {
|
|
1155
|
-
paths.forEach(
|
|
1156
|
-
lengths[i] = getElementLength(el);
|
|
1157
|
-
el.style.strokeDasharray = `${lengths[i]}`;
|
|
1158
|
-
});
|
|
1159
|
+
paths.forEach(measure);
|
|
1159
1160
|
cacheTriggers();
|
|
1160
1161
|
dirty = true;
|
|
1161
1162
|
}
|
|
@@ -1483,7 +1484,7 @@ var SvgScrollDraw = (() => {
|
|
|
1483
1484
|
let tStart = 0;
|
|
1484
1485
|
let tEnd = 0;
|
|
1485
1486
|
let rafId = 0;
|
|
1486
|
-
let
|
|
1487
|
+
let painted = NaN;
|
|
1487
1488
|
let paused = false;
|
|
1488
1489
|
let frozenAlpha = -1;
|
|
1489
1490
|
let frozenRaw = 0;
|
|
@@ -1530,8 +1531,12 @@ var SvgScrollDraw = (() => {
|
|
|
1530
1531
|
else if (prevRawProgress >= 1 && raw < 1) onEnterBack?.();
|
|
1531
1532
|
prevRawProgress = raw;
|
|
1532
1533
|
}
|
|
1534
|
+
const gate = (scroll) => computeProgress(scroll, tStart, tEnd, Math.min(speed, 1));
|
|
1535
|
+
function wake() {
|
|
1536
|
+
if (!rafId && !paused && gate(scrollPos()) !== painted) rafId = requestAnimationFrame(update);
|
|
1537
|
+
}
|
|
1533
1538
|
function update() {
|
|
1534
|
-
if (
|
|
1539
|
+
if (paused) return;
|
|
1535
1540
|
const now = performance.now();
|
|
1536
1541
|
const currentScroll = scrollPos();
|
|
1537
1542
|
let effectiveSpeed = speed;
|
|
@@ -1555,48 +1560,49 @@ var SvgScrollDraw = (() => {
|
|
|
1555
1560
|
} else if (alpha < 1 && !once) {
|
|
1556
1561
|
completed = false;
|
|
1557
1562
|
}
|
|
1558
|
-
|
|
1563
|
+
if (paused) return;
|
|
1564
|
+
painted = gate(currentScroll);
|
|
1565
|
+
rafId = painted > 0 && painted < 1 ? requestAnimationFrame(update) : 0;
|
|
1559
1566
|
}
|
|
1560
1567
|
cacheTriggers();
|
|
1561
1568
|
if (tEnd === tStart) {
|
|
1562
|
-
warn(
|
|
1563
|
-
"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`.",
|
|
1564
|
-
el
|
|
1565
|
-
);
|
|
1569
|
+
warn("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.", el);
|
|
1566
1570
|
}
|
|
1567
1571
|
{
|
|
1568
1572
|
frozenRaw = computeProgress(scrollPos(), tStart, tEnd, speed);
|
|
1569
1573
|
currentAlpha = easeFn(frozenRaw);
|
|
1570
1574
|
applyAlpha(currentAlpha);
|
|
1571
1575
|
}
|
|
1572
|
-
|
|
1573
|
-
(
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
if (isVisible && !paused) rafId = requestAnimationFrame(update);
|
|
1577
|
-
else cancelAnimationFrame(rafId);
|
|
1578
|
-
});
|
|
1579
|
-
},
|
|
1580
|
-
{ root: scrollEl ?? null }
|
|
1581
|
-
);
|
|
1576
|
+
function remeasure() {
|
|
1577
|
+
cacheTriggers();
|
|
1578
|
+
wake();
|
|
1579
|
+
}
|
|
1582
1580
|
let resizeTimer;
|
|
1583
1581
|
function onResize() {
|
|
1584
1582
|
clearTimeout(resizeTimer);
|
|
1585
|
-
resizeTimer = setTimeout(
|
|
1583
|
+
resizeTimer = setTimeout(remeasure, 150);
|
|
1586
1584
|
}
|
|
1585
|
+
const scroller = scrollEl ?? window;
|
|
1586
|
+
scroller.addEventListener("scroll", wake, { passive: true });
|
|
1587
1587
|
window.addEventListener("resize", onResize);
|
|
1588
1588
|
window.addEventListener("orientationchange", onResize);
|
|
1589
1589
|
const unwatch = watchLayout([triggerEl], onResize);
|
|
1590
|
-
|
|
1590
|
+
wake();
|
|
1591
1591
|
_register(el, {
|
|
1592
1592
|
type: "animate",
|
|
1593
1593
|
getProgress: () => currentAlpha,
|
|
1594
1594
|
getTrigger: () => ({ tStart, tEnd })
|
|
1595
1595
|
});
|
|
1596
|
+
function halt() {
|
|
1597
|
+
paused = true;
|
|
1598
|
+
cancelAnimationFrame(rafId);
|
|
1599
|
+
rafId = 0;
|
|
1600
|
+
painted = NaN;
|
|
1601
|
+
}
|
|
1596
1602
|
return {
|
|
1597
1603
|
destroy() {
|
|
1598
|
-
|
|
1599
|
-
|
|
1604
|
+
halt();
|
|
1605
|
+
scroller.removeEventListener("scroll", wake);
|
|
1600
1606
|
window.removeEventListener("resize", onResize);
|
|
1601
1607
|
window.removeEventListener("orientationchange", onResize);
|
|
1602
1608
|
unwatch();
|
|
@@ -1611,31 +1617,27 @@ var SvgScrollDraw = (() => {
|
|
|
1611
1617
|
currentAlpha = 0;
|
|
1612
1618
|
paused = false;
|
|
1613
1619
|
applyAlpha(0);
|
|
1620
|
+
painted = 0;
|
|
1621
|
+
wake();
|
|
1614
1622
|
},
|
|
1615
|
-
pause
|
|
1616
|
-
paused = true;
|
|
1617
|
-
cancelAnimationFrame(rafId);
|
|
1618
|
-
},
|
|
1623
|
+
pause: halt,
|
|
1619
1624
|
resume() {
|
|
1620
1625
|
if (!paused) return;
|
|
1621
1626
|
paused = false;
|
|
1622
|
-
|
|
1627
|
+
wake();
|
|
1623
1628
|
},
|
|
1624
1629
|
seek(p) {
|
|
1625
1630
|
const clamped = Math.min(1, Math.max(0, p));
|
|
1626
1631
|
currentAlpha = clamped;
|
|
1627
1632
|
frozenAlpha = clamped;
|
|
1628
1633
|
frozenRaw = 0;
|
|
1629
|
-
|
|
1630
|
-
cancelAnimationFrame(rafId);
|
|
1634
|
+
halt();
|
|
1631
1635
|
applyAlpha(clamped);
|
|
1632
1636
|
},
|
|
1633
1637
|
getProgress() {
|
|
1634
1638
|
return currentAlpha;
|
|
1635
1639
|
},
|
|
1636
|
-
refresh
|
|
1637
|
-
cacheTriggers();
|
|
1638
|
-
}
|
|
1640
|
+
refresh: remeasure
|
|
1639
1641
|
};
|
|
1640
1642
|
}
|
|
1641
1643
|
|
|
@@ -1758,6 +1760,7 @@ var SvgScrollDraw = (() => {
|
|
|
1758
1760
|
tStart = result.tStart;
|
|
1759
1761
|
tEnd = result.tEnd;
|
|
1760
1762
|
}
|
|
1763
|
+
const savedVar = el.style.getPropertyValue("--scroll-draw-progress");
|
|
1761
1764
|
function applyAlpha(alpha) {
|
|
1762
1765
|
el.textContent = fmt(from + (to - from) * alpha);
|
|
1763
1766
|
el.style.setProperty("--scroll-draw-progress", String(alpha));
|
|
@@ -1806,6 +1809,11 @@ var SvgScrollDraw = (() => {
|
|
|
1806
1809
|
getProgress: () => currentAlpha,
|
|
1807
1810
|
getTrigger: () => ({ tStart, tEnd })
|
|
1808
1811
|
});
|
|
1812
|
+
function resume() {
|
|
1813
|
+
if (!paused) return;
|
|
1814
|
+
paused = false;
|
|
1815
|
+
if (isVisible) rafId = requestAnimationFrame(update);
|
|
1816
|
+
}
|
|
1809
1817
|
return {
|
|
1810
1818
|
destroy() {
|
|
1811
1819
|
cancelAnimationFrame(rafId);
|
|
@@ -1814,6 +1822,7 @@ var SvgScrollDraw = (() => {
|
|
|
1814
1822
|
window.removeEventListener("orientationchange", onResize);
|
|
1815
1823
|
unwatch();
|
|
1816
1824
|
clearTimeout(resizeTimer);
|
|
1825
|
+
el.style.setProperty("--scroll-draw-progress", savedVar);
|
|
1817
1826
|
_unregister(el);
|
|
1818
1827
|
},
|
|
1819
1828
|
replay() {
|
|
@@ -1821,18 +1830,14 @@ var SvgScrollDraw = (() => {
|
|
|
1821
1830
|
frozenRaw = 0;
|
|
1822
1831
|
completed = false;
|
|
1823
1832
|
currentAlpha = 0;
|
|
1824
|
-
paused = false;
|
|
1825
1833
|
applyAlpha(0);
|
|
1834
|
+
resume();
|
|
1826
1835
|
},
|
|
1827
1836
|
pause() {
|
|
1828
1837
|
paused = true;
|
|
1829
1838
|
cancelAnimationFrame(rafId);
|
|
1830
1839
|
},
|
|
1831
|
-
resume
|
|
1832
|
-
if (!paused) return;
|
|
1833
|
-
paused = false;
|
|
1834
|
-
if (isVisible) rafId = requestAnimationFrame(update);
|
|
1835
|
-
},
|
|
1840
|
+
resume,
|
|
1836
1841
|
seek(p) {
|
|
1837
1842
|
const clamped = Math.min(1, Math.max(0, p));
|
|
1838
1843
|
currentAlpha = clamped;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var SvgScrollDraw=(()=>{var
|
|
2
|
-
<div style="position:absolute;${
|
|
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:!0}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove()}}}var Yt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Xt=/[MmLlHhVvCcSsQqTtAaZz]/g;function kr(e,t,r){if(!!1)return;let n=(e.match(Xt)??[]).join("").toUpperCase(),s=(t.match(Xt)??[]).join("").toUpperCase(),i=(e.match(Yt)??[]).length,c=(t.match(Yt)??[]).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.`,r);return}i!==c&&G(`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.`,r)}function $r(e,t,r){let n=(t.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)*r).toFixed(4))})}function ct(e,t={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(t,(r,n)=>Cr(e,r,n))}function Cr(e,t,r){let{preset:n,...s}=t,i=n?{...ot[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:m=1,fade:u=!1,easing:f="linear",trigger:v={},stagger:A=0,direction:b="forward",once:J=!1,debug:se=!1,axis:R="y",scrollContainer:E,autoReverse:M=!1,delay:p=0,strokeColor:w,strokeWidth:y,fillOpacity:z,waypoints:_,velocityScale:k=!1,threshold:q=0,rootMargin:$e="0px",repeat:ce=0,repeatDelay:fe=0,morphTo:W,clip:ie,autoplay:Ce=!1,duration:De=1e3,native:Ee=!0,onProgress:Se,onStart:h,onComplete:S,onEnter:pe,onLeave:He,onEnterBack:de,onLeaveBack:Ve}=i,B=ie===!0?"left":typeof ie=="string"?ie:!1,j=typeof f=="function"?f:Z[f]??Z.linear,_e=Pe(v.start||"top bottom"),ge=Pe(v.end||"bottom top"),K=typeof E=="string"?document.querySelector(E):E??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,Ie=Array.isArray(z)?z[1]:typeof z=="number"?z:null;function be(o){let a=o*100;switch(B){case"right":return`inset(0 0 0 ${100-a}%)`;case"top":return`inset(0 0 ${100-a}% 0)`;case"bottom":return`inset(${100-a}% 0 0 0)`;case"center":return`circle(${o*150}% at 50% 50%)`;default:return`inset(0 ${100-a}% 0 0)`}}let I=B?[]:Array.from(e.querySelectorAll(c)),$=[],ee=[],te=0,l=0,d=A,Te=0,L=!1,C=!1,T=0,D=!1,ue=-1,me=[],Ze=-1,Q=!1,we=0,Ae=0,Oe,pt=null;function Lt(){pt?.destroy(),pt=null}let Re=new Set,Pt=NaN,Fe=!0,Je=-1,kt=performance.now(),ze=NaN;function je(){return K?R==="x"?K.scrollLeft:K.scrollTop:R==="x"?window.scrollX:window.scrollY}function $t(){return K?R==="x"?K.clientWidth:K.clientHeight:R==="x"?window.innerWidth:window.innerHeight}function Ct(){let o=rt(e,K,R);return Ne(o,o.scroll,$t(),_e,ge)}function ar(){let o=l-te,a=I.length-1,g=K??document.documentElement,F=R==="x"?"Width":"Height";if(d=A,A>0&&a>0&&o>0){let ne=g[`scroll${F}`]-g[`client${F}`]-1-te-o/m;ne>=0&&(d=Math.min(A,ne/(a*o)))}Te=l+a*d*o}function Dt(){({tStart:te,tEnd:l}=Ct()),ar(),se&&!1&&(Lt(),pt=Pr(te,l,R))}function dt(o,a=Ct){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let g=o.destroy;return o.destroy=()=>{g.call(o),ve(e)},o}function It(o,a){return J&&!M?Math.max(ue,j(me[o]=Math.max(me[o]??0,a))):j(a)}function lr(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),B){let g=a==="reverse"?1-o:o;e.style.clipPath=be(g);return}I.forEach((g,F)=>gt(g,F,o,a))}function gt(o,a,g,F){o.style.strokeDashoffset=F==="reverse"?`${$[a]*g}`:`${$[a]*(1-g)}`,u&&(o.style.opacity=F==="reverse"?`${1-g}`:`${g}`),xe&&ae?o.style.stroke=nt(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&&Ie!==null?o.style.fillOpacity=`${le+(Ie-le)*g}`:Ie!==null&&(o.style.fillOpacity=`${Ie}`),W&&o.tagName.toLowerCase()==="path"&&ee[a]&&o.setAttribute("d",$r(ee[a],W,g))}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),B){e.style.clipPath=be(b==="reverse"?1:0);return}I.forEach((o,a)=>{o.style.strokeDasharray=`${$[a]}`,o.style.strokeDashoffset=b==="reverse"?"0":`${$[a]}`,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[a]&&o.setAttribute("d",ee[a])})}if(I.forEach(o=>{Lr(o);let a=We(o);$.push(a);let g=o.tagName.toLowerCase()==="path";g?ee.push(o.getAttribute("d")??""):ee.push(""),W&&(g?kr(ee[ee.length-1],W,o):G(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),r?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=b==="reverse"?`${a}`:"0",u&&(o.style.opacity="1"),ae&&(o.style.stroke=ae),he!==null&&(o.style.strokeWidth=`${he}`),Ie!==null&&(o.style.fillOpacity=`${Ie}`),W&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",W)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=b==="reverse"?"0":`${a}`,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}`))}),r)return B&&(e.style.clipPath=be(1)),S?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};B&&(e.style.clipPath=be(b==="reverse"?1:0));let Ot=typeof f=="string"?st(f):null;function cr(){return!(Ee===!1||Ce||se||!Mr()||!I.length||!Ot||B||R!=="y"||K||m!==1||A!==0||J||M||k!==!1||W||_||ce||p>0||Se||h||S||pe||He||de||Ve||w!=null||y!=null||z!=null||(v.start||"top bottom").trim()!=="top bottom"||(v.end||"bottom top").trim()!=="bottom top")}function ur(){let o=++Ar,a=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,F=`--svg-scroll-draw-${o}`,ne=b==="reverse"?"0":"var(--ssd-len)",Me=b==="reverse"?"var(--ssd-len)":"0",oe=`stroke-dashoffset:${ne};`,O=`stroke-dashoffset:${Me};`;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 ${a}{from{${oe}}to{${O}}}.${g}{view-timeline-name:${F};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Ot};animation-fill-mode:both;animation-timeline:${F};animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(g);function U(x,P){x.style.setProperty("--ssd-len",String($[P])),x.style.strokeDasharray=`${$[P]}`,x.style.strokeDashoffset="",x.style.opacity="",x.style.animationPlayState="",x.classList.add(a)}I.forEach(U);let Y=!1,H=-1;function V(){if(H>=0)return H;let x=e.getBoundingClientRect(),{tStart:P,tEnd:X}=Ne({top:x.top,height:x.height},je(),$t(),_e,ge);return j(re(je(),P,X,m))}return{destroy(){e.classList.remove(g),I.forEach(x=>{x.classList.remove(a),x.style.removeProperty("--ssd-len"),x.style.animationPlayState=""}),N.remove()},replay(){Y=!1,H=-1,I.forEach(U)},pause(){Y=!0,I.forEach(x=>{x.style.animationPlayState="paused"})},resume(){Y&&(Y=!1,I.forEach(x=>{x.style.animationPlayState="running"}))},seek(x){let P=Math.min(1,Math.max(0,x));H=P,Y=!0,I.forEach((X,Le)=>{X.classList.remove(a),X.style.strokeDashoffset=b==="reverse"?`${$[Le]*P}`:`${$[Le]*(1-P)}`,u&&(X.style.opacity=b==="reverse"?`${1-P}`:`${P}`)})},getProgress(){return V()},refresh(){I.forEach((x,P)=>{$[P]=We(x),x.style.setProperty("--ssd-len",String($[P])),x.style.strokeDasharray=`${$[P]}`})}}}if(cr())return dt(ur());function mr(){let o=Math.max(1,De),a=B?o:o*(1+Math.max(0,I.length-1)*A),g=0,F=0,ne=!1;function Me(H){let V=!0,x=Math.min(1,Math.max(0,H/a));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=!1)}else{I.forEach((X,Le)=>{let pr=Le*A*o,Nt=Math.min(1,Math.max(0,(H-pr)/o));gt(X,Le,j(Nt),b),Nt<1&&(V=!1)});let P=j(x);we=P,Se?.(P),e.style.setProperty("--scroll-draw-progress",String(P))}if(_){let P=j(x);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=!0,h?.());let x=Me(V);if(x&&!L){L=!0,Me(a),S?.(),Ae<(ce==="infinite"?1/0:ce??0)&&(Ae++,Oe=setTimeout(()=>{g=performance.now(),C=!1,L=!1,Re.clear(),Qe(),T=requestAnimationFrame(oe)},fe));return}x||(T=requestAnimationFrame(oe))}function O(){cancelAnimationFrame(T),clearTimeout(Oe),g=performance.now(),F=0,Q=!1,C=!1,L=!1,Ae=0,ne=!0,we=0,Re.clear(),Qe(),T=requestAnimationFrame(oe)}let N=new IntersectionObserver(H=>{H.forEach(V=>{V.isIntersecting&&!(J&&L)?O():!V.isIntersecting&&!J&&!L&&(cancelAnimationFrame(T),clearTimeout(Oe),ne=!1)})},{root:K??null,threshold:q,rootMargin:$e}),U;function Y(){clearTimeout(U),U=setTimeout(()=>{I.forEach((H,V)=>{$[V]=We(H),H.style.strokeDasharray=`${$[V]}`})},150)}return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),p>0?setTimeout(()=>N.observe(e),p):N.observe(e),{destroy(){cancelAnimationFrame(T),clearTimeout(Oe),N.disconnect(),window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y),clearTimeout(U)},replay(){Ae=0,O()},pause(){Q||!ne||(Q=!0,F=performance.now()-g,cancelAnimationFrame(T))},resume(){Q&&(Q=!1,ne=!0,g=performance.now()-F,T=requestAnimationFrame(oe))},seek(H){let V=Math.min(1,Math.max(0,H));we=V,Q=!0,F=V*a,g=performance.now()-F,cancelAnimationFrame(T),Me(F)},getProgress(){return we},refresh(){clearTimeout(U),I.forEach((H,V)=>{$[V]=We(H),H.style.strokeDasharray=`${$[V]}`})}}}if(Ce)return dt(mr());Dt();function Rt(){if(Q||!qe)return;let o=performance.now(),a=je();if(!Fe&&k===!1&&a===Pt){ht(a);return}Fe=!1,Pt=a;let g=m;if(k!==!1){let O=o-kt,N=O>0?Math.abs(a-(Je<0?a:Je))/O:0;g=m*Math.max(.2,1+N*(typeof k=="number"?k:1)*.04)}Je=a,kt=o;let F=M?Ze===-1||a>=Ze?"forward":"reverse":b;Ze=a;let ne=l-te,Me=!0,oe=ne===0?0:(a-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=It(0,re(a,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(a,te,l,g)>0&&(C=!0,h?.()),O>=1&&!L?(L=!0,S?.(),Ae<(ce==="infinite"?1/0:ce??0)&&(Ae++,Oe=setTimeout(()=>{ue=-1,me=[],C=!1,L=!1,Qe()},fe))):O<1&&!J&&(L=!1),ht(a);return}if(I.forEach((O,N)=>{let U=N*d*ne,Y=It(N,re(a,te+U,l+U,g));gt(O,N,Y,F),N===0&&(we=Y,Se?.(Y),e.style.setProperty("--scroll-draw-progress",String(Y))),Y<1&&(Me=!1)}),_){let O=j(re(a,te,l,g));for(let N in _){let U=parseFloat(N);O>=U&&!Re.has(U)&&(Re.add(U),_[N]?.())}}!C&&re(a,te,l,g)>0&&(C=!0,h?.()),Me&&!L?(L=!0,S?.(),Ae<(ce==="infinite"?1/0:ce??0)&&(Ae++,Oe=setTimeout(()=>{ue=-1,me=[],C=!1,L=!1,Re.clear(),Qe(),Fe=!0},fe))):!Me&&!J&&(L=!1),ht(a)}function yt(o){return o>=l&&o<Te}function ht(o){D||yt(o)?T=requestAnimationFrame(Rt):qe=!1}function bt(){return D||yt(je())}let qe=!1;function Ke(){qe||(qe=!0,T=requestAnimationFrame(function(){Rt()}))}function et(){qe=!1,cancelAnimationFrame(T)}let wt=new IntersectionObserver(o=>{o.forEach(a=>{D=a.isIntersecting,D&&!Q?(Fe=!0,Ke()):qe&&!Q&&yt(je())||et()})},{root:K??null,threshold:q,rootMargin:$e});function Ft(){I.forEach((o,a)=>{$[a]=We(o),o.style.strokeDasharray=`${$[a]}`}),Dt(),Fe=!0}let tt;function Ue(){clearTimeout(tt),tt=setTimeout(Ft,150)}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let fr=Be([e],Ue);return p>0?setTimeout(()=>wt.observe(e),p):wt.observe(e),dt({destroy(){cancelAnimationFrame(T),clearTimeout(Oe),et(),wt.disconnect(),fr(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(tt),Lt()},replay(){ue=-1,me=[],Ze=-1,Je=-1,C=!1,L=!1,Ae=0,Q=!1,we=0,Re.clear(),clearTimeout(Oe),Qe(),Fe=!0,bt()&&Ke()},pause(){Q=!0,et()},resume(){Q&&(Q=!1,Fe=!0,bt()&&Ke())},seek(o){let a=Math.min(1,Math.max(0,o));we=a,ue=a,me=[],Q=!0,et(),lr(a,b),Fe=!0},getProgress(){return we},refresh(){clearTimeout(tt),Ft(),bt()&&!Q&&Ke()}},()=>({tStart:te,tEnd:l}))}function Zt(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let n=typeof e=="string"?document.querySelector(e):e;return n?ct(n,t):(G("Container not found:",e),r)}function Dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Jt(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.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]:"")}t.push({fn:n[1],nums:s,units:i})}return t}function Ir(e,t,r){let n=Jt(e),s=Jt(t);return n.length===0||n.length!==s.length?r<1?e:t:n.map((i,c)=>{let m=s[c];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((u,f)=>`${u}${i.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,f)=>`${u}${m.units[f]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,f)=>`${u+(m.nums[f]-u)*r}${i.units[f]}`).join(", ")})`}).join(" ")}function Kt(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),s=String(t);if(Dr(n))return nt(n,s,r);if(n.includes("("))return Ir(n,s,r);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)*r}${i[2]||c[2]}`}return r<1?n:s}function Or(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Rr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fr=0,er="--scroll-draw-progress";function Nr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var rr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Tt(e,t){return typeof window>"u"?rr:t.respectReducedMotion===!1?tr(e,t,!1):Ge(t,(r,n)=>tr(e,r,n))}function tr(e,t,r){let{props:n,trigger:s={},easing:i="ease-out",speed:c=1,once:m=!1,axis:u="y",scrollContainer:f,native:v=!0,velocityScale:A=!1,triggerElement:b,onProgress:J,onComplete:se,onEnter:R,onLeave:E,onEnterBack:M,onLeaveBack:p}=t,w=typeof i=="function"?i:Z[i]??Z["ease-out"],y=Pe(s.start||"top bottom"),z=Pe(s.end||"bottom top"),_=b??e,k=typeof f=="string"?document.querySelector(f):f??null,q=Object.entries(n).map(([l,d])=>({prop:Or(l),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function $e(){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),er])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(r)return ce(),se?.(),{...rr,destroy:W,getProgress:()=>1};$e();let ie=()=>k?u==="x"?k.scrollLeft:k.scrollTop:u==="x"?window.scrollX:window.scrollY,Ce=()=>k?u==="x"?k.clientWidth:k.clientHeight:u==="x"?window.innerWidth:window.innerHeight,De=typeof i=="string"?st(i):null;function Ee(){if(!v||!Nr()||!De||u!=="y"||k||_!==e||m||c!==1||J||se||R||E||M||p||A!==!1||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return!1;for(let l of q)if(!Rr.has(l.prop))return!1;return!0}function Se(){let l=`ssd-a-${++Fr}`,d=q.map(D=>`${D.prop}:${D.from}`).join(";"),Te=q.map(D=>`${D.prop}:${D.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:${De};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(L),e.classList.add(l);let C=()=>{let D=e.getBoundingClientRect();return Ne({top:D.top,height:D.height},ie(),Ce(),y,z)};ke(e,{type:"animate",getProgress:()=>T.getProgress(),getTrigger:C});let T={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(D){let ue=Math.min(1,Math.max(0,D));e.classList.remove(l);for(let me of q)e.style.setProperty(me.prop,Kt(me.from,me.to,ue))},getProgress(){let{tStart:D,tEnd:ue}=C();return w(re(ie(),D,ue,c))}};return T}if(Ee())return Se();let h=0,S=0,pe=0,He=!1,de=!1,Ve=-1,B=0,j=0,_e=!1,ge=NaN,K=-1,xe=0,ae=_===e?q:[],ye=!1;function he(){let l=e.style,d=ae.map(T=>l.getPropertyValue(T.prop)),Te=l.transition;ae.length&&(l.transition="none"),ae.forEach(T=>l.setProperty(T.prop,fe.get(T.prop)??""));let L=rt(_,k,u);ae.forEach((T,D)=>l.setProperty(T.prop,d[D])),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-S)<1||(ye=!0,h=C.tStart,S=C.tEnd)}function le(l){e.style.setProperty(er,String(l));for(let d of q)e.style.setProperty(d.prop,Kt(d.from,d.to,l));J?.(l)}function Ie(l){if(isNaN(ge)){ge=l;return}ge<=0&&l>0?R?.():ge>0&&l<=0&&p?.(),ge<1&&l>=1?E?.():ge>=1&&l<1&&M?.(),ge=l}function be(){if(!He||de)return;let l=performance.now(),d=ie(),Te=c;if(A!==!1){let D=l-xe,ue=D>0?Math.abs(d-(K<0?d:K))/D:0;Te=c*Math.max(.2,1+ue*(typeof A=="number"?A:1)*.04)}K=d,xe=l;let L=S===h?0:(d-h)/(S-h);Ie(L);let C=re(d,h,S,Te),T=m?Math.max(Ve,w(B=Math.max(B,C))):w(C);j=T,le(T),T>=1&&!_e?(_e=!0,se?.()):T<1&&!m&&(_e=!1),pe=requestAnimationFrame(be)}he(),S===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,S,c),j=w(B),le(j);let I=new IntersectionObserver(l=>{l.forEach(d=>{He=d.isIntersecting,He&&!de?pe=requestAnimationFrame(be):cancelAnimationFrame(pe)})},{root:k??null}),$;function ee(){clearTimeout($),$=setTimeout(he,150)}window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee);let te=Be([_],ee);return I.observe(e),ke(e,{type:"animate",getProgress:()=>j,getTrigger:()=>({tStart:h,tEnd:S})}),{destroy(){cancelAnimationFrame(pe),I.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),te(),clearTimeout($),W(),ve(e)},replay(){Ve=-1,B=0,_e=!1,j=0,de=!1,le(0)},pause(){de=!0,cancelAnimationFrame(pe)},resume(){de&&(de=!1,He&&(pe=requestAnimationFrame(be)))},seek(l){let d=Math.min(1,Math.max(0,l));j=d,Ve=d,B=0,de=!0,cancelAnimationFrame(pe),le(d)},getProgress(){return j},refresh(){he()}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nr(e,t){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;return r?Tt(r,t):(G("scrollAnimate: element not found:",e),ut)}function or(e,t={}){if(typeof window>"u")return ut;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return G("scrollParallax: element not found:",e),ut;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:c,onProgress:m}=t,u=-n*100,f=r.style,v=!!r.ownerSVGElement,A=f.getPropertyValue("transform-box");v&&f.setProperty("transform-box","fill-box");let b=Tt(r,{props:s==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:i,native:!1,onProgress:m});return v?{...b,destroy(){b.destroy(),f.setProperty("transform-box",A)}}:b}var At={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function sr(e,t){if(typeof window>"u")return At;let r=typeof e=="string"?document.querySelector(e):e;return r?Ge(t,(n,s)=>Hr(r,n,s)):(G("scrollCounter: element not found:",e),At)}function Hr(e,t,r){let{from:n=0,to:s,format:i,easing:c="ease-out",trigger:m={},once:u=!0,decimals:f,onComplete:v}=t,A=f!==void 0?h=>h.toFixed(f):i??(h=>String(Math.round(h))),b=typeof c=="function"?c:Z[c]??Z["ease-out"],J=Pe(m.start||"top 80%"),se=Pe(m.end||"top 20%");if(r)return e.textContent=A(s),v?.(),{...At,getProgress:()=>1};let R=0,E=0,M=!1,p=0,w=!1,y=!1,z=-1,_=0,k=0,q=!1,$e=()=>window.scrollY,ce=()=>window.innerHeight;function fe(){let h=e.getBoundingClientRect(),S=Ne({top:h.top,height:h.height},$e(),ce(),J,se);M&&Math.abs(S.tStart-R)<1&&Math.abs(S.tEnd-E)<1||(M=!0,R=S.tStart,E=S.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($e(),R,E,1),S=u?Math.max(z,b(_=Math.max(_,h))):b(h);k=S,W(S),S>=1&&!q?(q=!0,v?.()):S<1&&!u&&(q=!1),p=requestAnimationFrame(ie)}fe();{_=re($e(),R,E,1);let h=b(_);k=h,W(h)}let Ce=new IntersectionObserver(h=>{h.forEach(S=>{w=S.isIntersecting,w&&!y?p=requestAnimationFrame(ie):cancelAnimationFrame(p)})}),De;function Ee(){clearTimeout(De),De=setTimeout(fe,150)}window.addEventListener("resize",Ee),window.addEventListener("orientationchange",Ee);let Se=Be([e],Ee);return Ce.observe(e),ke(e,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:R,tEnd:E})}),{destroy(){cancelAnimationFrame(p),Ce.disconnect(),window.removeEventListener("resize",Ee),window.removeEventListener("orientationchange",Ee),Se(),clearTimeout(De),ve(e)},replay(){z=-1,_=0,q=!1,k=0,y=!1,W(0)},pause(){y=!0,cancelAnimationFrame(p)},resume(){y&&(y=!1,w&&(p=requestAnimationFrame(ie)))},seek(h){let S=Math.min(1,Math.max(0,h));k=S,z=S,_=0,y=!0,cancelAnimationFrame(p),W(S)},getProgress(){return k}}}var ir="http://www.w3.org/2000/svg",_r="cinematic-photo",Mt=e=>e<0?0:e>1?1:e;function mt(e){let t=parseFloat(e);return Number.isFinite(t)?Mt(t/100):0}function Vr(e){return Z[e]??Z.linear}var zr={destroy:()=>{},getProgress:()=>0},ft=class{constructor(t){if(typeof document>"u"){this.mount=null;return}this.mount=typeof t.wrapper=="string"?document.querySelector(t.wrapper):t.wrapper,this.mount||G("Cinematic: wrapper not found:",t.wrapper)}loadStory(t){let r=this.mount;if(typeof window>"u"||!r)return zr;r.style.position="relative",r.style.height=t.totalHeight,r.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;",r.appendChild(n);let s=[];for(let E of t.scenes){if(E.background){let p=document.createElement("img");p.id=_r,p.src=E.background,p.alt="",p.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(p)}let M=E.animations.filter(p=>p.type==="draw");if(M.length){let p=document.createElementNS(ir,"svg");p.setAttribute("viewBox",`0 0 ${t.canvas.width} ${t.canvas.height}`),p.setAttribute("preserveAspectRatio","xMidYMid meet"),p.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(p);for(let w of M){let y=document.createElementNS(ir,"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),p.appendChild(y),s.push({kind:"draw",el:y,start:mt(w.start),end:mt(w.end),ease:Vr(w.easing),length:z})}}for(let p of E.animations){if(p.type!=="fade")continue;let w=n.querySelector(p.target)??document.querySelector(p.target);w&&(w.style.opacity=String(p.from),s.push({kind:"fade",el:w,start:mt(p.start),end:mt(p.end),ease:Z["ease-in-out"]??Z.linear,from:p.from,to:p.to}))}}let i=0,c=()=>{let E=r.offsetHeight-window.innerHeight;return E<=0?r.getBoundingClientRect().top<=0?1:0:Mt(-r.getBoundingClientRect().top/E)},m=E=>{for(let M of s){let p=M.end-M.start,w=p<=0?E>=M.end?1:0:Mt((E-M.start)/p),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,f=!1,v=!1,A=()=>{i=c(),m(i),f&&(u=requestAnimationFrame(A))},b=()=>{f||(f=!0,u=requestAnimationFrame(A))},J=()=>{f=!1,cancelAnimationFrame(u)},se=new IntersectionObserver(E=>{for(let M of E)v=M.isIntersecting,v?b():J()},{threshold:0});se.observe(n),i=c(),m(i),ke(r,{type:"draw",getProgress:()=>i,getTrigger:()=>{let E=r.getBoundingClientRect().top+window.scrollY;return{tStart:E,tEnd:E+Math.max(0,r.offsetHeight-window.innerHeight)}}});let R=lt(E=>{E&&(R(),J(),se.disconnect(),ve(r),i=1,m(1))});return{destroy(){R(),J(),se.disconnect(),ve(r)},getProgress:()=>i}}};if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class t extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key=""}connectedCallback(){this.build()}attributeChangedCallback(){this.instance&&this.build()}build(){let s=JSON.stringify(e.map(A=>this.getAttribute(A)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},c=this.getAttribute("speed"),m=this.getAttribute("easing"),u=this.getAttribute("stagger"),f=this.getAttribute("direction"),v=this.getAttribute("selector");c&&(i.speed=parseFloat(c)),m&&(i.easing=m),u&&(i.stagger=parseFloat(u)),f&&(i.direction=f),v&&(i.selector=v),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=ct(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}t.observedAttributes=e,customElements.define("scroll-draw",t)}return wr(qr);})();
|
|
1
|
+
"use strict";var SvgScrollDraw=(()=>{var St=Object.defineProperty;var gr=Object.getOwnPropertyDescriptor;var yr=Object.getOwnPropertyNames;var hr=Object.prototype.hasOwnProperty;var br=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:!0})},wr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of yr(t))!hr.call(e,s)&&s!==r&&St(e,s,{get:()=>t[s],enumerable:!(n=gr(t,s))||n.enumerable});return e};var vr=e=>wr(St({},"__esModule",{value:!0}),e);var Wr={};br(Wr,{Cinematic:()=>dt,PRESETS:()=>st,createBounce:()=>xt,createElastic:()=>Tt,createSpring:()=>_t,scrollAnimate:()=>or,scrollCounter:()=>ir,scrollDraw:()=>Jt,scrollParallax:()=>sr});function _t({tension:e=2.5,friction:t=2.2}={}){return r=>1-Math.cos(r*Math.PI*e)*Math.pow(1-r,t)}function xt({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),s=Math.sqrt(n),i=0,c=[];for(let p=0;p<r;p++){let v=Math.pow(s,p);c.push(v),i+=v}let f=[0],m=0;for(let p=0;p<r;p++)m+=c[p]/i,f.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let v=0;v<r;v++)if(p<=f[v+1]){let T=(p-f[v])/(f[v+1]-f[v]);if(v===0)return T*(2-T);let b=1-Math.pow(n,v);return b+(1-b)*(2*T-1)*(2*T-1)}return 1}}function Tt({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),s=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var J={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:xt(),elastic:Tt()};function Vt(e,t,r){return Math.min(r,Math.max(t,e))}function Pe(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return{element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return{element:r,viewport:n}}function zt(e,t,r,n){switch(n){case"top":return e+r;case"center":return e+r+t/2;case"bottom":return e+r+t;default:return e+r}}function qt(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 ne(e,t,r,n){return r===t?0:Vt((e-t)/(r-t)*n,0,1)}function Re(e,t,r,n,s){let i=zt(e.top,e.height,t,n.element)-qt(n.viewport,r),c=zt(e.top,e.height,t,s.element)-qt(s.viewport,r);return{tStart:i,tEnd:c}}function rt(e,t,r){let n=e.getBoundingClientRect(),s=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left-t.clientLeft+t.scrollLeft:n.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:s,scroll:0}:{top:r==="x"?n.left:n.top,height:s,scroll:r==="x"?window.scrollX:window.scrollY}}function nt(e){let t=parseFloat(e.getAttribute("pathLength")??"");if(t>0)return t;let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(n+s)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Wt(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function ot(e,t,r){let n=Wt(e),s=Wt(t);return!n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*r)},${Math.round(n[1]+(s[1]-n[1])*r)},${Math.round(n[2]+(s[2]-n[2])*r)})`}var st={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:!1},reveal:{easing:"ease-out",fade:!0,speed:1.2,once:!0},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:!0,speed:.75},spring:{easing:"spring",speed:1.1}};function G(e,...t){}var Er="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Sr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Gt=33;function xr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Tr(e){let t=[];for(let r=0;r<Gt;r++){let n=r/(Gt-1);t.push(String(Math.round(e(n)*1e5)/1e5))}return`linear(${t.join(",")})`}function it(e){switch(e){case"linear":return"linear";case"ease-in":return Er;case"ease-out":return Sr;case"ease-in-out":return xr()?Tr(J["ease-in-out"]):null;default:return null}}var Bt=Symbol.for("svg-scroll-draw.registry");function jt(){let e=globalThis;return e[Bt]||(e[Bt]=new Map)}function ke(e,t){jt().set(e,t)}function Ee(e){jt().delete(e)}var Ye,at=new Set,lt=new WeakMap,Xe=new Map,Qt=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ar(e){let t=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let n=r;n;n=n.previousElementSibling)t.add(n);return t}function We(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return()=>{};let r=()=>t();Ye??(Ye=new ResizeObserver(s=>{let i=!1;for(let{target:c}of s)lt.get(c)!==Qt(c)&&(i=!0),lt.set(c,"");i&&at.forEach(c=>c())})),at.add(r);let n=Ar(e);return[document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{lt.has(s)||lt.set(s,Qt(s)),Xe.set(s,(Xe.get(s)??0)+1),Ye.observe(s)}),()=>{at.delete(r)&&(n.forEach(s=>{let i=(Xe.get(s)??1)-1;if(i)return void Xe.set(s,i);Xe.delete(s),Ye?.unobserve(s)}),at.size||(Ye?.disconnect(),Ye=void 0))}}function ct(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),r=s=>e(!!s.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",r),()=>t.removeEventListener("change",r);let n=t;return n.addListener?.(r),()=>n.removeListener?.(r)}function Ge(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,!0);let r=t(e,!1),n=ct(i=>{if(!i)return;n();let c=(r.getProgress?.()??0)>=1;r.destroy(),r=t(c?{...e,onComplete:void 0}:e,!0)}),s={};for(let i of Object.keys(r))s[i]=(...c)=>r[i]?.(...c);return s.destroy=()=>{n(),r.destroy()},s}var Mr=0;function Lr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ut(e,t){let r="";try{r=getComputedStyle(e).getPropertyValue(t).trim()}catch{}return r||(e.getAttribute(t)??"").trim()}var Yt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Pr(e){if(!!1)return;let t=Ut(e,"stroke");if(!t||t==="none"){G("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Yt.has(r)&&!Yt.has(Ut(e,"fill"))&&G("Element has a fill \u2014 it may obscure the stroke animation.",e)}function kr(e,t,r){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=r==="x"?window.scrollX:window.scrollY,c=e-i,f=t-i,m=r==="x";n.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
+
<div style="position:absolute;${m?`left:${f}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${f}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:!0}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove()}}}var Xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Cr(e,t,r){if(!!1)return;let n=(e.match(Zt)??[]).join("").toUpperCase(),s=(t.match(Zt)??[]).join("").toUpperCase(),i=(e.match(Xt)??[]).length,c=(t.match(Xt)??[]).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.`,r);return}i!==c&&G(`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.`,r)}function $r(e,t,r){let n=(t.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let c=parseFloat(i),f=n[s++]??c;return String(+(c+(f-c)*r).toFixed(4))})}function mt(e,t={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(t,(r,n)=>Ir(e,r,n))}function Ir(e,t,r){let{preset:n,...s}=t,i=n?{...st[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:f=1,fade:m=!1,easing:p="linear",trigger:v={},stagger:T=0,direction:b="forward",once:K=!1,debug:fe=!1,axis:I="y",scrollContainer:E,autoReverse:A=!1,delay:d=0,strokeColor:w,strokeWidth:h,fillOpacity:F,waypoints:O,velocityScale:C=!1,threshold:V=0,rootMargin:Ce="0px",repeat:ge=0,repeatDelay:he=0,morphTo:B,clip:oe,autoplay:Se=!1,duration:Ne=1e3,native:Fe=!0,onProgress:le,onStart:z,onComplete:H,onEnter:S,onLeave:L,onEnterBack:be,onLeaveBack:Ve}=i,q=oe===!0?"left":typeof oe=="string"?oe:!1,j=typeof p=="function"?p:J[p]??J.linear,He=Pe(v.start||"top bottom"),we=Pe(v.end||"bottom top"),ee=typeof E=="string"?document.querySelector(E):E??null,xe=Array.isArray(w)?w[0]:null,pe=Array.isArray(w)?w[1]:typeof w=="string"?w:null,ve=Array.isArray(h)?h[0]:null,Te=Array.isArray(h)?h[1]:typeof h=="number"?h:null,de=Array.isArray(F)?F[0]:null,$e=Array.isArray(F)?F[1]:typeof F=="number"?F:null;function Ae(o){let a=o*100;switch(q){case"right":return`inset(0 0 0 ${100-a}%)`;case"top":return`inset(0 0 ${100-a}% 0)`;case"bottom":return`inset(${100-a}% 0 0 0)`;case"center":return`circle(${o*150}% at 50% 50%)`;default:return`inset(0 ${100-a}% 0 0)`}}let P=q?[]:Array.from(e.querySelectorAll(c)),se=[],ce=[],Q=0,_=0,_e=T,Ze=0,R=!1,l=!1,u=0,ye=!1,te=-1,W=[],N=-1,y=!1,U=0,ie=0,Ie,gt=null;function Pt(){gt?.destroy(),gt=null}let De=new Set,kt=NaN,Oe=!0,Je=-1,Ct=performance.now(),ze=NaN;function Be(){return ee?I==="x"?ee.scrollLeft:ee.scrollTop:I==="x"?window.scrollX:window.scrollY}function $t(){return ee?I==="x"?ee.clientWidth:ee.clientHeight:I==="x"?window.innerWidth:window.innerHeight}function It(){let o=rt(e,ee,I);return Re(o,o.scroll,$t(),He,we)}function lr(){let o=_-Q,a=P.length-1,g=ee??document.documentElement,M=I==="x"?"Width":"Height";if(_e=T,T>0&&a>0&&o>0){let re=g[`scroll${M}`]-g[`client${M}`]-1-Q-o/f;re>=0&&(_e=Math.min(T,re/(a*o)))}Ze=_+a*_e*o}function Dt(){({tStart:Q,tEnd:_}=It()),lr(),fe&&!1&&(Pt(),gt=kr(Q,_,I))}function yt(o,a=It){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let g=o.destroy;return o.destroy=()=>{g.call(o),Ee(e)},o}function Ot(o,a){return K&&!A?Math.max(te,j(W[o]=Math.max(W[o]??0,a))):j(a)}function cr(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),q){let g=a==="reverse"?1-o:o;e.style.clipPath=Ae(g);return}P.forEach((g,M)=>ht(g,M,o,a))}function ht(o,a,g,M){o.style.strokeDashoffset=M==="reverse"?`${se[a]*g}`:`${se[a]*(1-g)}`,m&&(o.style.opacity=M==="reverse"?`${1-g}`:`${g}`),xe&&pe?o.style.stroke=ot(xe,pe,g):pe&&(o.style.stroke=pe),ve!==null&&Te!==null?o.style.strokeWidth=`${ve+(Te-ve)*g}`:Te!==null&&(o.style.strokeWidth=`${Te}`),de!==null&&$e!==null?o.style.fillOpacity=`${de+($e-de)*g}`:$e!==null&&(o.style.fillOpacity=`${$e}`),B&&o.tagName.toLowerCase()==="path"&&ce[a]&&o.setAttribute("d",$r(ce[a],B,g))}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),q){e.style.clipPath=Ae(b==="reverse"?1:0);return}P.forEach((o,a)=>{o.style.strokeDasharray=`${se[a]}`,o.style.strokeDashoffset=b==="reverse"?"0":`${se[a]}`,m?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",xe&&(o.style.stroke=xe),ve!==null&&(o.style.strokeWidth=`${ve}`),de!==null&&(o.style.fillOpacity=`${de}`),B&&o.tagName.toLowerCase()==="path"&&ce[a]&&o.setAttribute("d",ce[a])})}function Qe(o,a){let g=o.getAttribute("d"),M=nt(o);if(B&&ce[a]){o.setAttribute("d",B);let re=nt(o);o.setAttribute("d",ce[a]),M=Math.max(nt(o),re),o.setAttribute("d",g)}se[a]=M,o.style.strokeDasharray=`${M}`}if(P.forEach((o,a)=>{Pr(o);let g=o.tagName.toLowerCase()==="path";g?ce.push(o.getAttribute("d")??""):ce.push(""),Qe(o,a);let M=se[a];B&&(g?Cr(ce[ce.length-1],B,o):G(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),r?(o.style.strokeDashoffset=b==="reverse"?`${M}`:"0",m&&(o.style.opacity="1"),pe&&(o.style.stroke=pe),Te!==null&&(o.style.strokeWidth=`${Te}`),$e!==null&&(o.style.fillOpacity=`${$e}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDashoffset=b==="reverse"?"0":`${M}`,m?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",xe&&(o.style.stroke=xe),ve!==null&&(o.style.strokeWidth=`${ve}`),de!==null&&(o.style.fillOpacity=`${de}`))}),r)return q&&(e.style.clipPath=Ae(1)),H?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};q&&(e.style.clipPath=Ae(b==="reverse"?1:0));let Rt=typeof p=="string"?it(p):null;function ur(){return!(Fe===!1||Se||fe&&!1||!Lr()||!P.length||!Rt||q||I!=="y"||ee||f!==1||T!==0||K||A||C!==!1||B||O||ge||d>0||le||z||H||S||L||be||Ve||w!=null||h!=null||F!=null||(v.start||"top bottom").trim()!=="top bottom"||(v.end||"bottom top").trim()!=="bottom top")}function mr(){let o=++Mr,a=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,M=`--svg-scroll-draw-${o}`,re=b==="reverse"?"0":"var(--ssd-len)",Me=b==="reverse"?"var(--ssd-len)":"0",ue=`stroke-dashoffset:${re};`,$=`stroke-dashoffset:${Me};`;m&&(ue+=`opacity:${b==="reverse"?1:0};`,$+=`opacity:${b==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${a}{from{${ue}}to{${$}}}.${g}{view-timeline-name:${M};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Rt};animation-fill-mode:both;animation-timeline:${M};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(g);function Y(x,k){x.style.setProperty("--ssd-len",String(se[k])),x.style.strokeDasharray=`${se[k]}`,x.style.strokeDashoffset="",x.style.opacity="",x.style.animationPlayState="",x.classList.add(a)}P.forEach(Y);let X=!1,ae=-1;function me(){if(ae>=0)return ae;let x=e.getBoundingClientRect(),{tStart:k,tEnd:Z}=Re({top:x.top,height:x.height},Be(),$t(),He,we);return j(ne(Be(),k,Z,f))}return{destroy(){e.classList.remove(g),P.forEach(x=>{x.classList.remove(a),x.style.removeProperty("--ssd-len"),x.style.animationPlayState=""}),D.remove()},replay(){X=!1,ae=-1,P.forEach(Y)},pause(){X=!0,P.forEach(x=>{x.style.animationPlayState="paused"})},resume(){X&&(X=!1,P.forEach(x=>{x.style.animationPlayState="running"}))},seek(x){let k=Math.min(1,Math.max(0,x));ae=k,X=!0,P.forEach((Z,Le)=>{Z.classList.remove(a),Z.style.strokeDashoffset=b==="reverse"?`${se[Le]*k}`:`${se[Le]*(1-k)}`,m&&(Z.style.opacity=b==="reverse"?`${1-k}`:`${k}`)})},getProgress(){return me()},refresh(){P.forEach((x,k)=>{Qe(x,k),x.style.setProperty("--ssd-len",String(se[k]))})}}}if(ur())return yt(mr());function fr(){let o=Math.max(1,Ne),a=q?o:o*(1+Math.max(0,P.length-1)*T),g=0,M=0,re=!1;function Me(ae){let me=!0,x=Math.min(1,Math.max(0,ae/a));if(q){let k=Math.min(1,Math.max(0,ae/o)),Z=j(k);U=Z,e.style.setProperty("--scroll-draw-progress",String(Z)),e.style.clipPath=Ae(b==="reverse"?1-Z:Z),le?.(Z),k<1&&(me=!1)}else{P.forEach((Z,Le)=>{let dr=Le*T*o,Ht=Math.min(1,Math.max(0,(ae-dr)/o));ht(Z,Le,j(Ht),b),Ht<1&&(me=!1)});let k=j(x);U=k,le?.(k),e.style.setProperty("--scroll-draw-progress",String(k))}if(O){let k=j(x);for(let Z in O){let Le=parseFloat(Z);k>=Le&&!De.has(Le)&&(De.add(Le),O[Z]?.())}}return me}function ue(ae){if(y)return;let me=ae-g;l||(l=!0,z?.());let x=Me(me);if(x&&!R){R=!0,Me(a),H?.(),ie<(ge==="infinite"?1/0:ge??0)&&(ie++,Ie=setTimeout(()=>{g=performance.now(),l=!1,R=!1,De.clear(),je(),u=requestAnimationFrame(ue)},he));return}x||(u=requestAnimationFrame(ue))}function $(){cancelAnimationFrame(u),clearTimeout(Ie),g=performance.now(),M=0,y=!1,l=!1,R=!1,ie=0,re=!0,U=0,De.clear(),je(),u=requestAnimationFrame(ue)}let D=new IntersectionObserver(ae=>{ae.forEach(me=>{me.isIntersecting&&!(K&&R)?$():!me.isIntersecting&&!K&&!R&&(cancelAnimationFrame(u),clearTimeout(Ie),re=!1)})},{root:ee??null,threshold:V,rootMargin:Ce}),Y;function X(){clearTimeout(Y),Y=setTimeout(()=>P.forEach(Qe),150)}return window.addEventListener("resize",X),window.addEventListener("orientationchange",X),d>0?setTimeout(()=>D.observe(e),d):D.observe(e),{destroy(){cancelAnimationFrame(u),clearTimeout(Ie),D.disconnect(),window.removeEventListener("resize",X),window.removeEventListener("orientationchange",X),clearTimeout(Y)},replay(){ie=0,$()},pause(){y||!re||(y=!0,M=performance.now()-g,cancelAnimationFrame(u))},resume(){y&&(y=!1,re=!0,g=performance.now()-M,u=requestAnimationFrame(ue))},seek(ae){let me=Math.min(1,Math.max(0,ae));U=me,y=!0,M=me*a,g=performance.now()-M,cancelAnimationFrame(u),Me(M)},getProgress(){return U},refresh(){clearTimeout(Y),P.forEach(Qe)}}}if(Se)return yt(fr());Dt();function Nt(){if(y||!qe)return;let o=performance.now(),a=Be();if(!Oe&&C===!1&&a===kt){wt(a);return}Oe=!1,kt=a;let g=f;if(C!==!1){let $=o-Ct,D=$>0?Math.abs(a-(Je<0?a:Je))/$:0;g=f*Math.max(.2,1+D*(typeof C=="number"?C:1)*.04)}Je=a,Ct=o;let M=A?N===-1||a>=N?"forward":"reverse":b;N=a;let re=_-Q,Me=!0,ue=re===0?0:(a-Q)/re;if(isNaN(ze)||(ze<=0&&ue>0?S?.():ze>0&&ue<=0&&Ve?.(),ze<1&&ue>=1?L?.():ze>=1&&ue<1&&be?.()),ze=ue,q){let $=Ot(0,ne(a,Q,_,g));U=$,e.style.setProperty("--scroll-draw-progress",String($));let D=M==="reverse"?1-$:$;e.style.clipPath=Ae(D),le?.($),!l&&ne(a,Q,_,g)>0&&(l=!0,z?.()),$>=1&&!R?(R=!0,H?.(),ie<(ge==="infinite"?1/0:ge??0)&&(ie++,Ie=setTimeout(()=>{te=-1,W=[],l=!1,R=!1,je()},he))):$<1&&!K&&(R=!1),wt(a);return}if(P.forEach(($,D)=>{let Y=D*_e*re,X=Ot(D,ne(a,Q+Y,_+Y,g));ht($,D,X,M),D===0&&(U=X,le?.(X),e.style.setProperty("--scroll-draw-progress",String(X))),X<1&&(Me=!1)}),O){let $=j(ne(a,Q,_,g));for(let D in O){let Y=parseFloat(D);$>=Y&&!De.has(Y)&&(De.add(Y),O[D]?.())}}!l&&ne(a,Q,_,g)>0&&(l=!0,z?.()),Me&&!R?(R=!0,H?.(),ie<(ge==="infinite"?1/0:ge??0)&&(ie++,Ie=setTimeout(()=>{te=-1,W=[],l=!1,R=!1,De.clear(),je(),Oe=!0},he))):!Me&&!K&&(R=!1),wt(a)}function bt(o){return o>=_&&o<Ze}function wt(o){ye||bt(o)?u=requestAnimationFrame(Nt):qe=!1}function vt(){return ye||bt(Be())}let qe=!1;function Ke(){qe||(qe=!0,u=requestAnimationFrame(function(){Nt()}))}function et(){qe=!1,cancelAnimationFrame(u)}let Et=new IntersectionObserver(o=>{o.forEach(a=>{ye=a.isIntersecting,ye&&!y?(Oe=!0,Ke()):qe&&!y&&bt(Be())||et()})},{root:ee??null,threshold:V,rootMargin:Ce});function Ft(){P.forEach(Qe),Dt(),Oe=!0}let tt;function Ue(){clearTimeout(tt),tt=setTimeout(Ft,150)}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let pr=We([e],Ue);return d>0?setTimeout(()=>Et.observe(e),d):Et.observe(e),yt({destroy(){cancelAnimationFrame(u),clearTimeout(Ie),et(),Et.disconnect(),pr(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(tt),Pt()},replay(){te=-1,W=[],N=-1,Je=-1,l=!1,R=!1,ie=0,y=!1,U=0,De.clear(),clearTimeout(Ie),je(),Oe=!0,vt()&&Ke()},pause(){y=!0,et()},resume(){y&&(y=!1,Oe=!0,vt()&&Ke())},seek(o){let a=Math.min(1,Math.max(0,o));U=a,te=a,W=[],y=!0,et(),cr(a,b),Oe=!0},getProgress(){return U},refresh(){clearTimeout(tt),Ft(),vt()&&!y&&Ke()}},()=>({tStart:Q,tEnd:_}))}function Jt(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let n=typeof e=="string"?document.querySelector(e):e;return n?mt(n,t):(G("Container not found:",e),r)}function Dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Kt(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let s=[],i=[],c=n[2].trim();if(c)for(let f of c.split(/[\s,]+/)){let m=f.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),i.push(m?m[2]:"")}t.push({fn:n[1],nums:s,units:i})}return t}function Or(e,t,r){let n=Kt(e),s=Kt(t);return n.length===0||n.length!==s.length?r<1?e:t:n.map((i,c)=>{let f=s[c];return i.fn!==f.fn||i.nums.length!==f.nums.length?r<1?`${i.fn}(${i.nums.map((m,p)=>`${m}${i.units[p]}`).join(", ")})`:`${f.fn}(${f.nums.map((m,p)=>`${m}${f.units[p]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,p)=>`${m+(f.nums[p]-m)*r}${i.units[p]}`).join(", ")})`}).join(" ")}function er(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),s=String(t);if(Dr(n))return ot(n,s,r);if(n.includes("("))return Or(n,s,r);let i=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&c){let f=parseFloat(i[1]),m=parseFloat(c[1]);return`${f+(m-f)*r}${i[2]||c[2]}`}return r<1?n:s}function Rr(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Nr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fr=0,tr="--scroll-draw-progress";function Hr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var nr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function At(e,t){return typeof window>"u"?nr:t.respectReducedMotion===!1?rr(e,t,!1):Ge(t,(r,n)=>rr(e,r,n))}function rr(e,t,r){let{props:n,trigger:s={},easing:i="ease-out",speed:c=1,once:f=!1,axis:m="y",scrollContainer:p,native:v=!0,velocityScale:T=!1,triggerElement:b,onProgress:K,onComplete:fe,onEnter:I,onLeave:E,onEnterBack:A,onLeaveBack:d}=t,w=typeof i=="function"?i:J[i]??J["ease-out"],h=Pe(s.start||"top bottom"),F=Pe(s.end||"bottom top"),O=b??e,C=typeof p=="string"?document.querySelector(p):p??null,V=Object.entries(n).map(([l,u])=>({prop:Rr(l),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function Ce(){let l=window.getComputedStyle(e);for(let u of V)u.from===""&&(u.from=l.getPropertyValue(u.prop).trim()||"0")}function ge(){for(let l of V)e.style.setProperty(l.prop,String(l.to))}let he=new Map;for(let l of[...V.map(u=>u.prop),tr])he.set(l,e.style.getPropertyValue(l));function B(){for(let[l,u]of he)u?e.style.setProperty(l,u):e.style.removeProperty(l)}if(r)return ge(),fe?.(),{...nr,destroy:B,getProgress:()=>1};Ce();let oe=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,Se=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight,Ne=typeof i=="string"?it(i):null;function Fe(){if(!v||!Hr()||!Ne||m!=="y"||C||O!==e||f||c!==1||K||fe||I||E||A||d||T!==!1||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return!1;for(let l of V)if(!Nr.has(l.prop))return!1;return!0}function le(){let l=`ssd-a-${++Fr}`,u=V.map(y=>`${y.prop}:${y.from}`).join(";"),ye=V.map(y=>`${y.prop}:${y.to}`).join(";"),te=document.createElement("style");te.setAttribute("data-ssd-animate",""),te.textContent=`@keyframes ${l}{from{${u}}to{${ye}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ne};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(te),e.classList.add(l);let W=()=>{let y=e.getBoundingClientRect();return Re({top:y.top,height:y.height},oe(),Se(),h,F)};ke(e,{type:"animate",getProgress:()=>N.getProgress(),getTrigger:W});let N={refresh(){},destroy(){e.classList.remove(l),te.remove(),e.style.animationPlayState="",B(),Ee(e)},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l)},pause(){e.style.animationPlayState="paused"},resume(){e.style.animationPlayState=""},seek(y){let U=Math.min(1,Math.max(0,y));e.classList.remove(l);for(let ie of V)e.style.setProperty(ie.prop,er(ie.from,ie.to,U))},getProgress(){let{tStart:y,tEnd:U}=W();return w(ne(oe(),y,U,c))}};return N}if(Fe())return le();let z=0,H=0,S=0,L=NaN,be=!1,Ve=-1,q=0,j=0,He=!1,we=NaN,ee=-1,xe=0,pe=O===e?V:[],ve=!1;function Te(){let l=e.style,u=pe.map(N=>l.getPropertyValue(N.prop)),ye=l.transition;pe.length&&(l.transition="none"),pe.forEach(N=>l.setProperty(N.prop,he.get(N.prop)??""));let te=rt(O,C,m);pe.forEach((N,y)=>l.setProperty(N.prop,u[y])),pe.length&&(e.offsetWidth,l.transition=ye);let W=Re(te,te.scroll,Se(),h,F);ve&&Math.abs(W.tStart-z)<1&&Math.abs(W.tEnd-H)<1||(ve=!0,z=W.tStart,H=W.tEnd)}function de(l){e.style.setProperty(tr,String(l));for(let u of V)e.style.setProperty(u.prop,er(u.from,u.to,l));K?.(l)}function $e(l){if(isNaN(we)){we=l;return}we<=0&&l>0?I?.():we>0&&l<=0&&d?.(),we<1&&l>=1?E?.():we>=1&&l<1&&A?.(),we=l}let Ae=l=>ne(l,z,H,Math.min(c,1));function P(){!S&&!be&&Ae(oe())!==L&&(S=requestAnimationFrame(se))}function se(){if(be)return;let l=performance.now(),u=oe(),ye=c;if(T!==!1){let y=l-xe,U=y>0?Math.abs(u-(ee<0?u:ee))/y:0;ye=c*Math.max(.2,1+U*(typeof T=="number"?T:1)*.04)}ee=u,xe=l;let te=H===z?0:(u-z)/(H-z);$e(te);let W=ne(u,z,H,ye),N=f?Math.max(Ve,w(q=Math.max(q,W))):w(W);j=N,de(N),N>=1&&!He?(He=!0,fe?.()):N<1&&!f&&(He=!1),!be&&(L=Ae(u),S=L>0&&L<1?requestAnimationFrame(se):0)}Te(),H===z&&G("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),q=ne(oe(),z,H,c),j=w(q),de(j);function ce(){Te(),P()}let Q;function _(){clearTimeout(Q),Q=setTimeout(ce,150)}let _e=C??window;_e.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",_),window.addEventListener("orientationchange",_);let Ze=We([O],_);P(),ke(e,{type:"animate",getProgress:()=>j,getTrigger:()=>({tStart:z,tEnd:H})});function R(){be=!0,cancelAnimationFrame(S),S=0,L=NaN}return{destroy(){R(),_e.removeEventListener("scroll",P),window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_),Ze(),clearTimeout(Q),B(),Ee(e)},replay(){Ve=-1,q=0,He=!1,j=0,be=!1,de(0),L=0,P()},pause:R,resume(){be&&(be=!1,P())},seek(l){let u=Math.min(1,Math.max(0,l));j=u,Ve=u,q=0,R(),de(u)},getProgress(){return j},refresh:ce}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function or(e,t){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;return r?At(r,t):(G("scrollAnimate: element not found:",e),ft)}function sr(e,t={}){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return G("scrollParallax: element not found:",e),ft;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:c,onProgress:f}=t,m=-n*100,p=r.style,v=!!r.ownerSVGElement,T=p.getPropertyValue("transform-box");v&&p.setProperty("transform-box","fill-box");let b=At(r,{props:s==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:i,native:!1,onProgress:f});return v?{...b,destroy(){b.destroy(),p.setProperty("transform-box",T)}}:b}var Mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ir(e,t){if(typeof window>"u")return Mt;let r=typeof e=="string"?document.querySelector(e):e;return r?Ge(t,(n,s)=>_r(r,n,s)):(G("scrollCounter: element not found:",e),Mt)}function _r(e,t,r){let{from:n=0,to:s,format:i,easing:c="ease-out",trigger:f={},once:m=!0,decimals:p,onComplete:v}=t,T=p!==void 0?S=>S.toFixed(p):i??(S=>String(Math.round(S))),b=typeof c=="function"?c:J[c]??J["ease-out"],K=Pe(f.start||"top 80%"),fe=Pe(f.end||"top 20%");if(r)return e.textContent=T(s),v?.(),{...Mt,getProgress:()=>1};let I=0,E=0,A=!1,d=0,w=!1,h=!1,F=-1,O=0,C=0,V=!1,Ce=()=>window.scrollY,ge=()=>window.innerHeight;function he(){let S=e.getBoundingClientRect(),L=Re({top:S.top,height:S.height},Ce(),ge(),K,fe);A&&Math.abs(L.tStart-I)<1&&Math.abs(L.tEnd-E)<1||(A=!0,I=L.tStart,E=L.tEnd)}let B=e.style.getPropertyValue("--scroll-draw-progress");function oe(S){e.textContent=T(n+(s-n)*S),e.style.setProperty("--scroll-draw-progress",String(S))}function Se(){if(!w||h)return;let S=ne(Ce(),I,E,1),L=m?Math.max(F,b(O=Math.max(O,S))):b(S);C=L,oe(L),L>=1&&!V?(V=!0,v?.()):L<1&&!m&&(V=!1),d=requestAnimationFrame(Se)}he();{O=ne(Ce(),I,E,1);let S=b(O);C=S,oe(S)}let Ne=new IntersectionObserver(S=>{S.forEach(L=>{w=L.isIntersecting,w&&!h?d=requestAnimationFrame(Se):cancelAnimationFrame(d)})}),Fe;function le(){clearTimeout(Fe),Fe=setTimeout(he,150)}window.addEventListener("resize",le),window.addEventListener("orientationchange",le);let z=We([e],le);Ne.observe(e),ke(e,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:I,tEnd:E})});function H(){h&&(h=!1,w&&(d=requestAnimationFrame(Se)))}return{destroy(){cancelAnimationFrame(d),Ne.disconnect(),window.removeEventListener("resize",le),window.removeEventListener("orientationchange",le),z(),clearTimeout(Fe),e.style.setProperty("--scroll-draw-progress",B),Ee(e)},replay(){F=-1,O=0,V=!1,C=0,oe(0),H()},pause(){h=!0,cancelAnimationFrame(d)},resume:H,seek(S){let L=Math.min(1,Math.max(0,S));C=L,F=L,O=0,h=!0,cancelAnimationFrame(d),oe(L)},getProgress(){return C}}}var ar="http://www.w3.org/2000/svg",Vr="cinematic-photo",Lt=e=>e<0?0:e>1?1:e;function pt(e){let t=parseFloat(e);return Number.isFinite(t)?Lt(t/100):0}function zr(e){return J[e]??J.linear}var qr={destroy:()=>{},getProgress:()=>0},dt=class{constructor(t){if(typeof document>"u"){this.mount=null;return}this.mount=typeof t.wrapper=="string"?document.querySelector(t.wrapper):t.wrapper,this.mount||G("Cinematic: wrapper not found:",t.wrapper)}loadStory(t){let r=this.mount;if(typeof window>"u"||!r)return qr;r.style.position="relative",r.style.height=t.totalHeight,r.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;",r.appendChild(n);let s=[];for(let E of t.scenes){if(E.background){let d=document.createElement("img");d.id=Vr,d.src=E.background,d.alt="",d.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(d)}let A=E.animations.filter(d=>d.type==="draw");if(A.length){let d=document.createElementNS(ar,"svg");d.setAttribute("viewBox",`0 0 ${t.canvas.width} ${t.canvas.height}`),d.setAttribute("preserveAspectRatio","xMidYMid meet"),d.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(d);for(let w of A){let h=document.createElementNS(ar,"path");h.id=w.target.replace(/^#/,""),h.setAttribute("d",w.d),h.setAttribute("fill","none"),h.setAttribute("stroke",w.stroke),h.setAttribute("stroke-width",String(w.strokeWidth)),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round");let F=w.length||h.getTotalLength?.()||0;h.style.strokeDasharray=String(F),h.style.strokeDashoffset=String(F),d.appendChild(h),s.push({kind:"draw",el:h,start:pt(w.start),end:pt(w.end),ease:zr(w.easing),length:F})}}for(let d of E.animations){if(d.type!=="fade")continue;let w=n.querySelector(d.target)??document.querySelector(d.target);w&&(w.style.opacity=String(d.from),s.push({kind:"fade",el:w,start:pt(d.start),end:pt(d.end),ease:J["ease-in-out"]??J.linear,from:d.from,to:d.to}))}}let i=0,c=()=>{let E=r.offsetHeight-window.innerHeight;return E<=0?r.getBoundingClientRect().top<=0?1:0:Lt(-r.getBoundingClientRect().top/E)},f=E=>{for(let A of s){let d=A.end-A.start,w=d<=0?E>=A.end?1:0:Lt((E-A.start)/d),h=A.ease(w);A.kind==="draw"?A.el.style.strokeDashoffset=String(A.length*(1-h)):A.el.style.opacity=String(A.from+(A.to-A.from)*h)}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return f(1),{destroy:()=>{},getProgress:()=>1};let m=0,p=!1,v=!1,T=()=>{i=c(),f(i),p&&(m=requestAnimationFrame(T))},b=()=>{p||(p=!0,m=requestAnimationFrame(T))},K=()=>{p=!1,cancelAnimationFrame(m)},fe=new IntersectionObserver(E=>{for(let A of E)v=A.isIntersecting,v?b():K()},{threshold:0});fe.observe(n),i=c(),f(i),ke(r,{type:"draw",getProgress:()=>i,getTrigger:()=>{let E=r.getBoundingClientRect().top+window.scrollY;return{tStart:E,tEnd:E+Math.max(0,r.offsetHeight-window.innerHeight)}}});let I=ct(E=>{E&&(I(),K(),fe.disconnect(),Ee(r),i=1,f(1))});return{destroy(){I(),K(),fe.disconnect(),Ee(r)},getProgress:()=>i}}};if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class t extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key=""}connectedCallback(){this.build()}attributeChangedCallback(){this.instance&&this.build()}build(){let s=JSON.stringify(e.map(T=>this.getAttribute(T)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},c=this.getAttribute("speed"),f=this.getAttribute("easing"),m=this.getAttribute("stagger"),p=this.getAttribute("direction"),v=this.getAttribute("selector");c&&(i.speed=parseFloat(c)),f&&(i.easing=f),m&&(i.stagger=parseFloat(m)),p&&(i.direction=p),v&&(i.selector=v),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=mt(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}t.observedAttributes=e,customElements.define("scroll-draw",t)}return vr(Wr);})();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {b as b$1,a as a$6}from'./chunk-OJFWQ6CU.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,d as d$1,c,b as b$3}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$4,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b,a as a$3}from'./chunk-LFSU6LR3.mjs';var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Nt=0;function Ht(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function St(r,m){let f="";try{f=getComputedStyle(r).getPropertyValue(m).trim();}catch{}return f||(r.getAttribute(m)??"").trim()}var Tt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function It(r){if(!a$3)return;let m=St(r,"stroke");if(!m||m==="none"){b("Element has no stroke \u2014 path will not be visible.",r);return}let f=(r.getAttribute("fill")??"").trim();f&&!Tt.has(f)&&!Tt.has(St(r,"fill"))&&b("Element has a fill \u2014 it may obscure the stroke animation.",r);}function Rt(r,m,f){let p=document.createElement("div");p.setAttribute("data-svg-scroll-draw-debug",""),p.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 x(){let H=f==="x"?window.scrollX:window.scrollY,k=r-H,D=m-H,I=f==="x";p.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${I?`left:${k}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${k}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;${I?`left:${D}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${D}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(p),window.addEventListener("scroll",x,{passive:true}),x(),{el:p,destroy(){window.removeEventListener("scroll",x),p.remove();}}}var $t=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,At=/[MmLlHhVvCcSsQqTtAaZz]/g;function zt(r,m,f){if(!a$3)return;let p=(r.match(At)??[]).join("").toUpperCase(),x=(m.match(At)??[]).join("").toUpperCase(),H=(r.match($t)??[]).length,k=(m.match($t)??[]).length;if(p!==x){b(`morphTo: command sequence differs (${p||"\u2205"} \u2192 ${x||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,f);return}H!==k&&b(`morphTo: coordinate count differs (${H} \u2192 ${k}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,f);}function Vt(r,m,f){let p=(m.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),x=0;return r.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,H=>{let k=parseFloat(H),D=p[x++]??k;return String(+(k+(D-k)*f).toFixed(4))})}function er(r,m={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:a(m,(f,p)=>Wt(r,f,p))}function Wt(r,m,f){let{preset:p,...x}=m,H=p?{...Et[p],...x}:x,{selector:k="path, polyline, line, polygon, rect, circle",speed:D=1,fade:I=false,easing:ue="linear",trigger:Se={},stagger:U=0,direction:u="forward",once:te=false,debug:Ue=false,axis:W="y",scrollContainer:Ce,autoReverse:Oe=false,delay:me=0,strokeColor:j,strokeWidth:X,fillOpacity:Y,waypoints:Q,velocityScale:pe=false,threshold:je=0,rootMargin:Xe="0px",repeat:Z=0,repeatDelay:Fe=0,morphTo:C,clip:Ne,autoplay:Ye=false,duration:xt=1e3,native:kt=true,onProgress:de,onStart:Te,onComplete:ye,onEnter:Qe,onLeave:Ze,onEnterBack:Je,onLeaveBack:Ke}=H,O=Ne===true?"left":typeof Ne=="string"?Ne:false,q=typeof ue=="function"?ue:d[ue]??d.linear,et=a$1(Se.start||"top bottom"),tt=a$1(Se.end||"bottom top"),P=typeof Ce=="string"?document.querySelector(Ce):Ce??null,re=Array.isArray(j)?j[0]:null,se=Array.isArray(j)?j[1]:typeof j=="string"?j:null,J=Array.isArray(X)?X[0]:null,ne=Array.isArray(X)?X[1]:typeof X=="number"?X:null,K=Array.isArray(Y)?Y[0]:null,oe=Array.isArray(Y)?Y[1]:typeof Y=="number"?Y:null;function ie(e){let t=e*100;switch(O){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=O?[]:Array.from(r.querySelectorAll(k)),L=[],F=[],$=0,A=0,$e=U,rt=0,v=false,M=false,E=0,Ae=false,ge=-1,ae=[],xe=-1,d$2=false,N=0,R=0,G,He=null;function st(){He?.destroy(),He=null;}let B=new Set,nt=NaN,_=true,ke=-1,ot=performance.now(),le=NaN;function he(){return P?W==="x"?P.scrollLeft:P.scrollTop:W==="x"?window.scrollX:window.scrollY}function it(){return P?W==="x"?P.clientWidth:P.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function at(){let e=a$2(r,P,W);return c(e,e.scroll,it(),et,tt)}function Pt(){let e=A-$,t=c$1.length-1,s=P??document.documentElement,o=W==="x"?"Width":"Height";if($e=U,U>0&&t>0&&e>0){let w=s[`scroll${o}`]-s[`client${o}`]-1-$-e/D;w>=0&&($e=Math.min(U,w/(t*e)));}rt=A+t*$e*e;}function lt(){(({tStart:$,tEnd:A}=at())),Pt(),Ue&&a$3&&(st(),He=Rt($,A,W));}function Ie(e,t=at){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 ft(e,t){return te&&!Oe?Math.max(ge,q(ae[e]=Math.max(ae[e]??0,t))):q(t)}function Lt(e,t){if(r.style.setProperty("--scroll-draw-progress",String(e)),O){let s=t==="reverse"?1-e:e;r.style.clipPath=ie(s);return}c$1.forEach((s,o)=>Re(s,o,e,t));}function Re(e,t,s,o){e.style.strokeDashoffset=o==="reverse"?`${L[t]*s}`:`${L[t]*(1-s)}`,I&&(e.style.opacity=o==="reverse"?`${1-s}`:`${s}`),re&&se?e.style.stroke=a$6(re,se,s):se&&(e.style.stroke=se),J!==null&&ne!==null?e.style.strokeWidth=`${J+(ne-J)*s}`:ne!==null&&(e.style.strokeWidth=`${ne}`),K!==null&&oe!==null?e.style.fillOpacity=`${K+(oe-K)*s}`:oe!==null&&(e.style.fillOpacity=`${oe}`),C&&e.tagName.toLowerCase()==="path"&&F[t]&&e.setAttribute("d",Vt(F[t],C,s));}function ve(){if(r.style.setProperty("--scroll-draw-progress","0"),O){r.style.clipPath=ie(u==="reverse"?1:0);return}c$1.forEach((e,t)=>{e.style.strokeDasharray=`${L[t]}`,e.style.strokeDashoffset=u==="reverse"?"0":`${L[t]}`,I?e.style.opacity=u==="reverse"?"1":"0":e.style.opacity="",re&&(e.style.stroke=re),J!==null&&(e.style.strokeWidth=`${J}`),K!==null&&(e.style.fillOpacity=`${K}`),C&&e.tagName.toLowerCase()==="path"&&F[t]&&e.setAttribute("d",F[t]);});}function we(e,t){let s=e.getAttribute("d"),o=a$5(e);if(C&&F[t]){e.setAttribute("d",C);let w=a$5(e);e.setAttribute("d",F[t]),o=Math.max(a$5(e),w),e.setAttribute("d",s);}L[t]=o,e.style.strokeDasharray=`${o}`;}if(c$1.forEach((e,t)=>{It(e);let s=e.tagName.toLowerCase()==="path";s?F.push(e.getAttribute("d")??""):F.push(""),we(e,t);let o=L[t];C&&(s?zt(F[F.length-1],C,e):b(`morphTo only applies to <path> elements \u2014 ignored on <${e.tagName}>.`,e)),f?(e.style.strokeDashoffset=u==="reverse"?`${o}`:"0",I&&(e.style.opacity="1"),se&&(e.style.stroke=se),ne!==null&&(e.style.strokeWidth=`${ne}`),oe!==null&&(e.style.fillOpacity=`${oe}`),C&&e.tagName.toLowerCase()==="path"&&e.setAttribute("d",C)):(e.style.strokeDashoffset=u==="reverse"?"0":`${o}`,I?e.style.opacity=u==="reverse"?"1":"0":e.style.opacity="",re&&(e.style.stroke=re),J!==null&&(e.style.strokeWidth=`${J}`),K!==null&&(e.style.fillOpacity=`${K}`));}),f)return O&&(r.style.clipPath=ie(1)),ye?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};O&&(r.style.clipPath=ie(u==="reverse"?1:0));let ct=typeof ue=="string"?b$1(ue):null;function Mt(){return !(kt===false||Ye||Ue&&a$3||!Ht()||!c$1.length||!ct||O||W!=="y"||P||D!==1||U!==0||te||Oe||pe!==false||C||Q||Z||me>0||de||Te||ye||Qe||Ze||Je||Ke||j!=null||X!=null||Y!=null||(Se.start||"top bottom").trim()!=="top bottom"||(Se.end||"bottom top").trim()!=="bottom top")}function Dt(){let e=++Nt,t=`svg-scroll-draw-${e}`,s=`svg-scroll-draw-host-${e}`,o=`--svg-scroll-draw-${e}`,w=u==="reverse"?"0":"var(--ssd-len)",z=u==="reverse"?"var(--ssd-len)":"0",S=`stroke-dashoffset:${w};`,a=`stroke-dashoffset:${z};`;I&&(S+=`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{${S}}to{${a}}}.${s}{view-timeline-name:${o};view-timeline-axis:block;}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${ct};animation-fill-mode:both;animation-timeline:${o};animation-range:cover 0% cover 100%;}`,document.head.appendChild(l),r.classList.add(s);function y(n,i){n.style.setProperty("--ssd-len",String(L[i])),n.style.strokeDasharray=`${L[i]}`,n.style.strokeDashoffset="",n.style.opacity="",n.style.animationPlayState="",n.classList.add(t);}c$1.forEach(y);let g=false,b=-1;function T(){if(b>=0)return b;let n=r.getBoundingClientRect(),{tStart:i,tEnd:h}=c({top:n.top,height:n.height},he(),it(),et,tt);return q(b$3(he(),i,h,D))}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,b=-1,c$1.forEach(y);},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));b=i,g=true,c$1.forEach((h,V)=>{h.classList.remove(t),h.style.strokeDashoffset=u==="reverse"?`${L[V]*i}`:`${L[V]*(1-i)}`,I&&(h.style.opacity=u==="reverse"?`${1-i}`:`${i}`);});},getProgress(){return T()},refresh(){c$1.forEach((n,i)=>{we(n,i),n.style.setProperty("--ssd-len",String(L[i]));});}}}if(Mt())return Ie(Dt());function Ct(){let e=Math.max(1,xt),t=O?e:e*(1+Math.max(0,c$1.length-1)*U),s=0,o=0,w=false;function z(b){let T=true,n=Math.min(1,Math.max(0,b/t));if(O){let i=Math.min(1,Math.max(0,b/e)),h=q(i);N=h,r.style.setProperty("--scroll-draw-progress",String(h)),r.style.clipPath=ie(u==="reverse"?1-h:h),de?.(h),i<1&&(T=false);}else {c$1.forEach((h,V)=>{let Ft=V*U*e,pt=Math.min(1,Math.max(0,(b-Ft)/e));Re(h,V,q(pt),u),pt<1&&(T=false);});let i=q(n);N=i,de?.(i),r.style.setProperty("--scroll-draw-progress",String(i));}if(Q){let i=q(n);for(let h in Q){let V=parseFloat(h);i>=V&&!B.has(V)&&(B.add(V),Q[h]?.());}}return T}function S(b){if(d$2)return;let T=b-s;M||(M=true,Te?.());let n=z(T);if(n&&!v){v=true,z(t),ye?.(),R<(Z==="infinite"?1/0:Z??0)&&(R++,G=setTimeout(()=>{s=performance.now(),M=false,v=false,B.clear(),ve(),E=requestAnimationFrame(S);},Fe));return}n||(E=requestAnimationFrame(S));}function a(){cancelAnimationFrame(E),clearTimeout(G),s=performance.now(),o=0,d$2=false,M=false,v=false,R=0,w=true,N=0,B.clear(),ve(),E=requestAnimationFrame(S);}let l=new IntersectionObserver(b=>{b.forEach(T=>{T.isIntersecting&&!(te&&v)?a():!T.isIntersecting&&!te&&!v&&(cancelAnimationFrame(E),clearTimeout(G),w=false);});},{root:P??null,threshold:je,rootMargin:Xe}),y;function g(){clearTimeout(y),y=setTimeout(()=>c$1.forEach(we),150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),me>0?setTimeout(()=>l.observe(r),me):l.observe(r),{destroy(){cancelAnimationFrame(E),clearTimeout(G),l.disconnect(),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(y);},replay(){R=0,a();},pause(){d$2||!w||(d$2=true,o=performance.now()-s,cancelAnimationFrame(E));},resume(){d$2&&(d$2=false,w=true,s=performance.now()-o,E=requestAnimationFrame(S));},seek(b){let T=Math.min(1,Math.max(0,b));N=T,d$2=true,o=T*t,s=performance.now()-o,cancelAnimationFrame(E),z(o);},getProgress(){return N},refresh(){clearTimeout(y),c$1.forEach(we);}}}if(Ye)return Ie(Ct());lt();function ut(){if(d$2||!fe)return;let e=performance.now(),t=he();if(!_&&pe===false&&t===nt){Ve(t);return}_=false,nt=t;let s=D;if(pe!==false){let a=e-ot,l=a>0?Math.abs(t-(ke<0?t:ke))/a:0;s=D*Math.max(.2,1+l*(typeof pe=="number"?pe:1)*.04);}ke=t,ot=e;let o=Oe?xe===-1||t>=xe?"forward":"reverse":u;xe=t;let w=A-$,z=true,S=w===0?0:(t-$)/w;if(isNaN(le)||(le<=0&&S>0?Qe?.():le>0&&S<=0&&Ke?.(),le<1&&S>=1?Ze?.():le>=1&&S<1&&Je?.()),le=S,O){let a=ft(0,b$3(t,$,A,s));N=a,r.style.setProperty("--scroll-draw-progress",String(a));let l=o==="reverse"?1-a:a;r.style.clipPath=ie(l),de?.(a),!M&&b$3(t,$,A,s)>0&&(M=true,Te?.()),a>=1&&!v?(v=true,ye?.(),R<(Z==="infinite"?1/0:Z??0)&&(R++,G=setTimeout(()=>{ge=-1,ae=[],M=false,v=false,ve();},Fe))):a<1&&!te&&(v=false),Ve(t);return}if(c$1.forEach((a,l)=>{let y=l*$e*w,g=ft(l,b$3(t,$+y,A+y,s));Re(a,l,g,o),l===0&&(N=g,de?.(g),r.style.setProperty("--scroll-draw-progress",String(g))),g<1&&(z=false);}),Q){let a=q(b$3(t,$,A,s));for(let l in Q){let y=parseFloat(l);a>=y&&!B.has(y)&&(B.add(y),Q[l]?.());}}!M&&b$3(t,$,A,s)>0&&(M=true,Te?.()),z&&!v?(v=true,ye?.(),R<(Z==="infinite"?1/0:Z??0)&&(R++,G=setTimeout(()=>{ge=-1,ae=[],M=false,v=false,B.clear(),ve(),_=true;},Fe))):!z&&!te&&(v=false),Ve(t);}function ze(e){return e>=A&&e<rt}function Ve(e){Ae||ze(e)?E=requestAnimationFrame(ut):fe=false;}function We(){return Ae||ze(he())}let fe=false;function Pe(){fe||(fe=true,E=requestAnimationFrame(function(){ut();}));}function Le(){fe=false,cancelAnimationFrame(E);}let qe=new IntersectionObserver(e=>{e.forEach(t=>{Ae=t.isIntersecting,Ae&&!d$2?(_=true,Pe()):fe&&!d$2&&ze(he())||Le();});},{root:P??null,threshold:je,rootMargin:Xe});function mt(){c$1.forEach(we),lt(),_=true;}let Me;function be(){clearTimeout(Me),Me=setTimeout(mt,150);}window.addEventListener("resize",be),window.addEventListener("orientationchange",be);let Ot=d$1([r],be);return me>0?setTimeout(()=>qe.observe(r),me):qe.observe(r),Ie({destroy(){cancelAnimationFrame(E),clearTimeout(G),Le(),qe.disconnect(),Ot(),window.removeEventListener("resize",be),window.removeEventListener("orientationchange",be),clearTimeout(Me),st();},replay(){ge=-1,ae=[],xe=-1,ke=-1,M=false,v=false,R=0,d$2=false,N=0,B.clear(),clearTimeout(G),ve(),_=true,We()&&Pe();},pause(){d$2=true,Le();},resume(){d$2&&(d$2=false,_=true,We()&&Pe());},seek(e){let t=Math.min(1,Math.max(0,e));N=t,ge=t,ae=[],d$2=true,Le(),Lt(t,u),_=true;},getProgress(){return N},refresh(){clearTimeout(Me),mt(),We()&&!d$2&&Pe();}},()=>({tStart:$,tEnd:A}))}export{Et as a,er as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-6TWFLRUB.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function l(r,s){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let o=typeof r=="string"?document.querySelector(r):r;return o?b(o,s):(b$1("Container not found:",r),n)}export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var P={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function te(t,w){if(typeof window>"u")return P;let u=typeof t=="string"?document.querySelector(t):t;return u?a(w,(m,f)=>K(u,m,f)):(b("scrollCounter: element not found:",t),P)}function K(t,w,u){let{from:m=0,to:f,format:B,easing:h="ease-out",trigger:F={},once:M=true,decimals:x,onComplete:I}=w,z=x!==void 0?e=>e.toFixed(x):B??(e=>String(Math.round(e))),y=typeof h=="function"?h:d[h]??d["ease-out"],G=a$1(F.start||"top 80%"),W=a$1(F.end||"top 20%");if(u)return t.textContent=z(f),I?.(),{...P,getProgress:()=>1};let a=0,c$1=0,L=false,n=0,g=false,o=false,b=-1,s=0,i=0,p=false,v=()=>window.scrollY,Y=()=>window.innerHeight;function O(){let e=t.getBoundingClientRect(),r=c({top:e.top,height:e.height},v(),Y(),G,W);L&&Math.abs(r.tStart-a)<1&&Math.abs(r.tEnd-c$1)<1||(L=true,a=r.tStart,c$1=r.tEnd);}let j=t.style.getPropertyValue("--scroll-draw-progress");function d$2(e){t.textContent=z(m+(f-m)*e),t.style.setProperty("--scroll-draw-progress",String(e));}function S(){if(!g||o)return;let e=b$1(v(),a,c$1,1),r=M?Math.max(b,y(s=Math.max(s,e))):y(e);i=r,d$2(r),r>=1&&!p?(p=true,I?.()):r<1&&!M&&(p=false),n=requestAnimationFrame(S);}O();{s=b$1(v(),a,c$1,1);let e=y(s);i=e,d$2(e);}let R=new IntersectionObserver(e=>{e.forEach(r=>{g=r.isIntersecting,g&&!o?n=requestAnimationFrame(S):cancelAnimationFrame(n);});}),C;function l(){clearTimeout(C),C=setTimeout(O,150);}window.addEventListener("resize",l),window.addEventListener("orientationchange",l);let J=d$1([t],l);R.observe(t),a$2(t,{type:"counter",getProgress:()=>i,getTrigger:()=>({tStart:a,tEnd:c$1})});function q(){o&&(o=false,g&&(n=requestAnimationFrame(S)));}return {destroy(){cancelAnimationFrame(n),R.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),J(),clearTimeout(C),t.style.setProperty("--scroll-draw-progress",j),b$2(t);},replay(){b=-1,s=0,p=false,i=0,d$2(0),q();},pause(){o=true,cancelAnimationFrame(n);},resume:q,seek(e){let r=Math.min(1,Math.max(0,e));i=r,b=r,s=0,o=true,cancelAnimationFrame(n),d$2(r);},getProgress(){return i}}}export{te as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function _(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 G(e){let o=e.textContent??"";return e.textContent="",o.split(/(\s+)/).filter(Boolean).map(t=>{let n=e.appendChild(S(t)),a=/^\s+$/.test(t);return a?n.style.whiteSpace="pre":n.style.display="inline-block",a?null:n}).filter(t=>t!==null)}function ee(e){let o=e.textContent??"";e.textContent="";let t=[],n=null;for(let a of o){let r=S(a),i=a===" ";i?r.style.whiteSpace="pre":(r.style.display="inline-block",t.push(r)),i||a>"\u0DFF"?n=null:n||(n=e.appendChild(S()),n.style.cssText="display:inline-block;white-space:nowrap"),(n??e).appendChild(r);}return t}function j(e){let o=G(e),t=new Map;for(let r of o){let i=r.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(r);}let n=[],a=Array.from(t.keys()).sort((r,i)=>r-i);for(let r of a){let i=t.get(r),l=S();l.style.display="inline-block",i.forEach((g,w)=>{let h=g.nextElementSibling;l.appendChild(g),w<i.length-1&&h&&h.style.whiteSpace==="pre"&&l.appendChild(h);}),n.push(l);}return e.textContent="",n.forEach((r,i)=>{e.appendChild(r),i<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function te(e,o,t,n){if(t<=1||n===0)return e;n=Math.min(n,1/t);let a=(t-1)*n,r=o*n,i=r+(1-a);return i<=r?e>=r?1:0:Math.min(1,Math.max(0,(e-r)/(i-r)))}function ne(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 F={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pe(e,o={}){if(typeof window>"u")return F;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),F;let n=t;return a(o,(a,r)=>oe(n,a,r))}function oe(e,o,t){let{split:n="words",stagger:a=.04,easing:r="ease-out",from:i={opacity:0,y:24},trigger:l={},once:g=true,onComplete:w}=o,h=typeof r=="function"?r:d[r]??d["ease-out"],U=a$1(l.start||"top 85%"),V=a$1(l.end||"top 40%"),M=e.innerHTML,P=e.textContent??"",u;n==="chars"?u=ee(e):n==="lines"?u=j(e):u=G(e),_(e,P);let X=u.length;function J(s,c){i?.opacity!==void 0&&(s.style.opacity=String(i.opacity+(1-i.opacity)*c));let E=ne(c,i);E&&(s.style.transform=E);}function m(s){e.style.setProperty("--scroll-draw-progress",String(s)),u.forEach((c,E)=>{let Z=h(te(s,E,X,a));J(c,Z);});}if(t)return m(1),w?.(),{...F,destroy:()=>{e.innerHTML=M;},getProgress:()=>1};m(0);let L=0,C=0,p=0,b=false,d$2=false,y=-1,f=0,x=false,O=()=>window.scrollY,K=()=>window.innerHeight;function k(){let s=e.getBoundingClientRect(),c$1=c({top:s.top,height:s.height},O(),K(),U,V);L=c$1.tStart,C=c$1.tEnd;}function v(){if(!b||d$2)return;let s=b$2(O(),L,C,1);g&&(y=Math.max(y,s),s=y),f=s,m(s),s>=1&&!x?(x=true,w?.()):s<1&&!g&&(x=false),p=requestAnimationFrame(v);}k();let z=new IntersectionObserver(s=>{s.forEach(c=>{b=c.isIntersecting,b&&!d$2?p=requestAnimationFrame(v):cancelAnimationFrame(p);});}),H;function T(){clearTimeout(H),H=setTimeout(()=>{if(n==="lines"){let s=f;e.innerHTML=M,u=j(e),_(e,P),m(s);}k();},150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let Q=d$1([e],T);z.observe(e),a$2(e,{type:"text",getProgress:()=>f,getTrigger:()=>({tStart:L,tEnd:C})});function D(){d$2&&(d$2=false,b&&(p=requestAnimationFrame(v)));}return {destroy(){cancelAnimationFrame(p),z.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),Q(),clearTimeout(H),e.innerHTML=M,b$1(e);},replay(){y=-1,x=false,f=0,m(0),D();},pause(){d$2=true,cancelAnimationFrame(p);},resume:D,seek(s){let c=Math.min(1,Math.max(0,s));f=c,y=c,d$2=true,cancelAnimationFrame(p),m(c);},getProgress(){return f}}}export{pe as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,a as a$4}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-UPWWULKI.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$2,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$3}from'./chunk-BCV4RAIX.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function Ne(t){return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")}function ve(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 Re(t,i,l){let s=ve(t),m=ve(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 be(t,i,l){if(typeof t=="number"&&typeof i=="number")return String(t+(i-t)*l);let s=String(t),m=String(i);if(Ne(s))return a$4(s,m,l);if(s.includes("("))return Re(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 Fe(t){return t.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}var ke=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ie=0,Se="--scroll-draw-progress";function Ve(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Te={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ue(t,i){return typeof window>"u"?Te:i.respectReducedMotion===false?we(t,i,false):a(i,(l,s)=>we(t,l,s))}function we(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:Le=true,velocityScale:R=false,triggerElement:Pe,onProgress:J,onComplete:O,onEnter:K,onLeave:Q,onEnterBack:ee,onLeaveBack:te}=i,F=typeof r=="function"?r:d[r]??d["ease-out"],ne=a$1(m.start||"top bottom"),re=a$1(m.end||"bottom top"),k=Pe??t,y=typeof p=="string"?document.querySelector(p):p??null,h=Object.entries(s).map(([e,n])=>({prop:Fe(e),from:Array.isArray(n)?n[0]:"",to:Array.isArray(n)?n[1]:n}));function Me(){let e=window.getComputedStyle(t);for(let n of h)n.from===""&&(n.from=e.getPropertyValue(n.prop).trim()||"0");}function $e(){for(let e of h)t.style.setProperty(e.prop,String(e.to));}let W=new Map;for(let e of [...h.map(n=>n.prop),Se])W.set(e,t.style.getPropertyValue(e));function B(){for(let[e,n]of W)n?t.style.setProperty(e,n):t.style.removeProperty(e);}if(l)return $e(),O?.(),{...Te,destroy:B,getProgress:()=>1};Me();let $=()=>y?o==="x"?y.scrollLeft:y.scrollTop:o==="x"?window.scrollX:window.scrollY,oe=()=>y?o==="x"?y.clientWidth:y.clientHeight:o==="x"?window.innerWidth:window.innerHeight,se=typeof r=="string"?b(r):null;function Ae(){if(!Le||!Ve()||!se||o!=="y"||y||k!==t||u||c$1!==1||J||O||K||Q||ee||te||R!==false||(m.start||"top bottom").trim()!=="top bottom"||(m.end||"bottom top").trim()!=="bottom top")return false;for(let e of h)if(!ke.has(e.prop))return false;return true}function Ce(){let e=`ssd-a-${++Ie}`,n=h.map(a=>`${a.prop}:${a.from}`).join(";"),M=h.map(a=>`${a.prop}:${a.to}`).join(";"),v=document.createElement("style");v.setAttribute("data-ssd-animate",""),v.textContent=`@keyframes ${e}{from{${n}}to{${M}}}.${e}{animation-name:${e};animation-duration:auto;animation-timing-function:${se};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),t.classList.add(e);let d=()=>{let a=t.getBoundingClientRect();return c({top:a.top,height:a.height},$(),oe(),ne,re)};a$2(t,{type:"animate",getProgress:()=>f.getProgress(),getTrigger:d});let f={refresh(){},destroy(){t.classList.remove(e),v.remove(),t.style.animationPlayState="",B(),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 x=Math.min(1,Math.max(0,a));t.classList.remove(e);for(let z of h)t.style.setProperty(z.prop,be(z.from,z.to,x));},getProgress(){let{tStart:a,tEnd:x}=d();return F(b$2($(),a,x,c$1))}};return f}if(Ae())return Ce();let g=0,E=0,A=0,T=NaN,b$4=false,j=-1,L=0,S=0,I=false,w=NaN,D=-1,ie=0,C=k===t?h:[],ae=false;function le(){let e=t.style,n=C.map(f=>e.getPropertyValue(f.prop)),M=e.transition;C.length&&(e.transition="none"),C.forEach(f=>e.setProperty(f.prop,W.get(f.prop)??""));let v=a$3(k,y,o);C.forEach((f,a)=>e.setProperty(f.prop,n[a])),C.length&&(t.offsetWidth,e.transition=M);let d=c(v,v.scroll,oe(),ne,re);ae&&Math.abs(d.tStart-g)<1&&Math.abs(d.tEnd-E)<1||(ae=true,g=d.tStart,E=d.tEnd);}function V(e){t.style.setProperty(Se,String(e));for(let n of h)t.style.setProperty(n.prop,be(n.from,n.to,e));J?.(e);}function He(e){if(isNaN(w)){w=e;return}w<=0&&e>0?K?.():w>0&&e<=0&&te?.(),w<1&&e>=1?Q?.():w>=1&&e<1&&ee?.(),w=e;}let me=e=>b$2(e,g,E,Math.min(c$1,1));function P(){!A&&!b$4&&me($())!==T&&(A=requestAnimationFrame(ce));}function ce(){if(b$4)return;let e=performance.now(),n=$(),M=c$1;if(R!==false){let a=e-ie,x=a>0?Math.abs(n-(D<0?n:D))/a:0;M=c$1*Math.max(.2,1+x*(typeof R=="number"?R:1)*.04);}D=n,ie=e;let v=E===g?0:(n-g)/(E-g);He(v);let d=b$2(n,g,E,M),f=u?Math.max(j,F(L=Math.max(L,d))):F(d);S=f,V(f),f>=1&&!I?(I=true,O?.()):f<1&&!u&&(I=false),!b$4&&(T=me(n),A=T>0&&T<1?requestAnimationFrame(ce):0);}le(),E===g&&b$1("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",t),L=b$2($(),g,E,c$1),S=F(L),V(S);function ue(){le(),P();}let _;function H(){clearTimeout(_),_=setTimeout(ue,150);}let fe=y??window;fe.addEventListener("scroll",P,{passive:true}),window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let xe=d$1([k],H);P(),a$2(t,{type:"animate",getProgress:()=>S,getTrigger:()=>({tStart:g,tEnd:E})});function q(){b$4=true,cancelAnimationFrame(A),A=0,T=NaN;}return {destroy(){q(),fe.removeEventListener("scroll",P),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),xe(),clearTimeout(_),B(),b$3(t);},replay(){j=-1,L=0,I=false,S=0,b$4=false,V(0),T=0,P();},pause:q,resume(){b$4&&(b$4=false,P());},seek(e){let n=Math.min(1,Math.max(0,e));S=n,j=n,L=0,q(),V(n);},getProgress(){return S},refresh:ue}}export{Ue as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var J={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ce(m,E={}){if(typeof window>"u")return J;let b$3=typeof m=="string"?document.querySelector(m):m;if(!b$3||b$3.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",m),J;let t=b$3,{trigger:P={},easing:T="linear",once:C=false,axis:u="y",preload:K="auto",triggerElement:Q,onReady:I,onComplete:U,onProgress:Z}=E,R=Q??t,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches,V=typeof T=="function"?T:d[T]??d.linear,$=a(P.start||"top top"),ee=a(P.end||"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=K);let q=E.from??0,A=E.to,g=0,p=0,o=0,l=false,n=false,S=-1,w=0,a$3=0,v=false,i=false,O=()=>u==="x"?window.scrollX:window.scrollY,te=()=>u==="x"?window.innerWidth:window.innerHeight;function x(){let e=R.getBoundingClientRect(),r=u==="x"?e.left:e.top,d=u==="x"?e.width:e.height,_=c({top:r,height:d},O(),te(),$,ee);g=_.tStart,p=_.tEnd,i&&p===g&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let h=NaN;function s(e){if(!i)return;let r=A??t.duration??0,d=q+(r-q)*e;d!==h&&(h=d,t.currentTime=d),t.style.setProperty("--scroll-draw-progress",String(e)),Z?.(e);}function y(){if(!l||n||!i||f)return;let e=b$2(O(),g,p,1),r=C?Math.max(S,V(w=Math.max(w,e))):V(e);a$3=r,s(r),r>=1&&!v?(v=true,U?.()):r<1&&!C&&(v=false),o=requestAnimationFrame(y);}function L(){if(i=true,A===void 0&&(A=t.duration),f){s(1),I?.();return}x(),I?.(),n?s(a$3):l&&(o=requestAnimationFrame(y));}t.readyState>=1?L():t.addEventListener("loadedmetadata",L,{once:true}),i||x();let k=f?()=>{}:a$1(e=>{e&&(k(),f=true,cancelAnimationFrame(o),s(1));}),D=new IntersectionObserver(e=>{e.forEach(r=>{l=r.isIntersecting,l&&!n&&i?o=requestAnimationFrame(y):cancelAnimationFrame(o);});}),N;function c$1(){clearTimeout(N),N=setTimeout(x,150);}window.addEventListener("resize",c$1),window.addEventListener("orientationchange",c$1);let re=d$1([R],c$1);D.observe(t),a$2(t,{type:"video",getProgress:()=>a$3,getTrigger:()=>({tStart:g,tEnd:p})});function H(){n&&(n=false,l&&i&&(o=requestAnimationFrame(y)));}return {destroy(){cancelAnimationFrame(o),D.disconnect(),t.removeEventListener("loadedmetadata",L),window.removeEventListener("resize",c$1),window.removeEventListener("orientationchange",c$1),re(),k(),clearTimeout(N),b$1(t);},replay(){S=-1,w=0,v=false,a$3=0,h=NaN,s(0),H();},pause(){n=true,cancelAnimationFrame(o);},resume:H,seek(e){let r=Math.min(1,Math.max(0,e));a$3=r,S=r,w=0,n=true,cancelAnimationFrame(o),h=NaN,s(r);},getProgress(){return a$3}}}export{ce as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(t){let r=parseFloat(t.getAttribute("pathLength")??"");if(r>0)return r;let n=t.tagName.toLowerCase();if(n==="rect"){let e=parseFloat(t.getAttribute("width")??"0"),a=parseFloat(t.getAttribute("height")??"0");return 2*(e+a)}if(n==="circle"){let e=parseFloat(t.getAttribute("r")??"0");return 2*Math.PI*e}return t.getTotalLength()}export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-OPXWNJBG.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 +1 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-
|
|
1
|
+
import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-QFSTKVA3.mjs';import {a as a$4}from'./chunk-NLPSVYFP.mjs';import {a as a$2}from'./chunk-I73SOXBN.mjs';import {a as a$1}from'./chunk-OPXWNJBG.mjs';import {b as b$2}from'./chunk-6TWFLRUB.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};
|