@ssgoi/core 6.7.0-beta.0 → 7.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -9
- package/dist/animation/animation.d.ts +2 -2
- package/dist/animation/frame-scheduler.d.ts +36 -0
- package/dist/animation/frame-scheduler.d.ts.map +1 -0
- package/dist/animation/multi-animation.d.ts +3 -2
- package/dist/animation/multi-animation.d.ts.map +1 -1
- package/dist/animation/web-animation.d.ts +16 -4
- package/dist/animation/web-animation.d.ts.map +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1282 -1125
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +502 -422
- package/dist/multi-animation-6124HEke.cjs +1 -0
- package/dist/multi-animation-ZFZBDBGr.js +439 -0
- package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
- package/dist/ssgoi-transition/navigation-direction.d.ts +13 -0
- package/dist/ssgoi-transition/navigation-direction.d.ts.map +1 -0
- package/dist/ssgoi-transition/path-pattern.d.ts +15 -0
- package/dist/ssgoi-transition/path-pattern.d.ts.map +1 -0
- package/dist/ssgoi-transition/resolve-transition-rule.d.ts +16 -0
- package/dist/ssgoi-transition/resolve-transition-rule.d.ts.map +1 -0
- package/dist/transitions/axis/index.d.ts +5 -7
- package/dist/transitions/axis/index.d.ts.map +1 -1
- package/dist/transitions/axis/types.d.ts +0 -1
- package/dist/transitions/axis/types.d.ts.map +1 -1
- package/dist/transitions/blind/index.d.ts +2 -3
- package/dist/transitions/blind/index.d.ts.map +1 -1
- package/dist/transitions/drill/index.d.ts +6 -7
- package/dist/transitions/drill/index.d.ts.map +1 -1
- package/dist/transitions/drill/provider/crossfade.d.ts.map +1 -1
- package/dist/transitions/drill/provider/parallax.d.ts.map +1 -1
- package/dist/transitions/drill/transition.d.ts.map +1 -1
- package/dist/transitions/drill/types.d.ts +0 -1
- package/dist/transitions/drill/types.d.ts.map +1 -1
- package/dist/transitions/fade/index.d.ts +3 -5
- package/dist/transitions/fade/index.d.ts.map +1 -1
- package/dist/transitions/film/index.d.ts +3 -5
- package/dist/transitions/film/index.d.ts.map +1 -1
- package/dist/transitions/hero/fit.d.ts +5 -0
- package/dist/transitions/hero/fit.d.ts.map +1 -0
- package/dist/transitions/hero/index.d.ts +3 -5
- package/dist/transitions/hero/index.d.ts.map +1 -1
- package/dist/transitions/hero/transition.d.ts +12 -1
- package/dist/transitions/hero/transition.d.ts.map +1 -1
- package/dist/transitions/hero/types.d.ts +2 -1
- package/dist/transitions/hero/types.d.ts.map +1 -1
- package/dist/transitions/jaemin/index.d.ts +3 -5
- package/dist/transitions/jaemin/index.d.ts.map +1 -1
- package/dist/transitions/media-geometry.d.ts +55 -0
- package/dist/transitions/media-geometry.d.ts.map +1 -0
- package/dist/transitions/rotate/index.d.ts +3 -5
- package/dist/transitions/rotate/index.d.ts.map +1 -1
- package/dist/transitions/scroll/index.d.ts +4 -5
- package/dist/transitions/scroll/index.d.ts.map +1 -1
- package/dist/transitions/scroll/transition.d.ts +1 -1
- package/dist/transitions/scroll/transition.d.ts.map +1 -1
- package/dist/transitions/sheet/index.d.ts +6 -7
- package/dist/transitions/sheet/index.d.ts.map +1 -1
- package/dist/transitions/sheet/provider/static.d.ts.map +1 -1
- package/dist/transitions/sheet/transition.d.ts.map +1 -1
- package/dist/transitions/sheet/types.d.ts +0 -1
- package/dist/transitions/sheet/types.d.ts.map +1 -1
- package/dist/transitions/slide/index.d.ts +3 -5
- package/dist/transitions/slide/index.d.ts.map +1 -1
- package/dist/transitions/slide/transition.d.ts +0 -1
- package/dist/transitions/slide/transition.d.ts.map +1 -1
- package/dist/transitions/strip/index.d.ts +3 -5
- package/dist/transitions/strip/index.d.ts.map +1 -1
- package/dist/transitions/utils.d.ts +3 -21
- package/dist/transitions/utils.d.ts.map +1 -1
- package/dist/transitions/zoom/index.d.ts +3 -4
- package/dist/transitions/zoom/index.d.ts.map +1 -1
- package/dist/transitions/zoom/provider/blur.d.ts.map +1 -1
- package/dist/transitions/zoom/transition.d.ts +6 -1
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/dist/transitions/zoom/types.d.ts +5 -0
- package/dist/transitions/zoom/types.d.ts.map +1 -1
- package/dist/transitions/zoom/zoom-element.d.ts +2 -2
- package/dist/transitions/zoom/zoom-element.d.ts.map +1 -1
- package/dist/types/index.d.ts +56 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/wait-paint.d.ts +8 -7
- package/dist/utils/wait-paint.d.ts.map +1 -1
- package/package.json +13 -14
- package/dist/multi-animation-1FueEz2Q.js +0 -367
- package/dist/multi-animation-qtH1IKNG.cjs +0 -1
- package/dist/ssgoi-transition/find-matching-transition.d.ts +0 -30
- package/dist/ssgoi-transition/find-matching-transition.d.ts.map +0 -1
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +0 -7
- package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ import { fade } from "@ssgoi/react/view-transitions";
|
|
|
50
50
|
import { SsgoiTransitionBoundary } from "./ssgoi-transition-boundary";
|
|
51
51
|
|
|
52
52
|
const config = {
|
|
53
|
-
transitions: [
|
|
53
|
+
transitions: [{ from: "/", to: "/about", transition: fade() }],
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export default function App() {
|
|
@@ -132,7 +132,8 @@ The value can be a hard-coded logical id; it only has to match your config.
|
|
|
132
132
|
|
|
133
133
|
### Route-based Transitions
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
Transition factories return one effect-only `TransitionConfig`. Put that
|
|
136
|
+
effect inside a flat route rule:
|
|
136
137
|
|
|
137
138
|
```tsx
|
|
138
139
|
import { fade, drill, zoom } from "@ssgoi/react/view-transitions";
|
|
@@ -140,22 +141,41 @@ import { fade, drill, zoom } from "@ssgoi/react/view-transitions";
|
|
|
140
141
|
const config = {
|
|
141
142
|
transitions: [
|
|
142
143
|
// Calm cross-fade between tabs
|
|
143
|
-
|
|
144
|
+
{ from: "/home", to: "/about", transition: fade() },
|
|
144
145
|
|
|
145
146
|
// iOS-style drill-in when entering details
|
|
146
|
-
|
|
147
|
+
{
|
|
148
|
+
on: "/products/**",
|
|
149
|
+
except: "/products",
|
|
150
|
+
transition: drill(),
|
|
151
|
+
},
|
|
147
152
|
|
|
148
153
|
// Card-to-detail zoom (needs matching data-zoom-*-key)
|
|
149
|
-
|
|
154
|
+
{
|
|
155
|
+
from: "/gallery",
|
|
156
|
+
to: "/photo/:id",
|
|
157
|
+
transition: zoom({ type: "expand" }),
|
|
158
|
+
},
|
|
150
159
|
],
|
|
151
160
|
};
|
|
152
161
|
```
|
|
153
162
|
|
|
154
|
-
|
|
163
|
+
Route rules come in three shapes:
|
|
155
164
|
|
|
156
|
-
- **`{
|
|
157
|
-
|
|
158
|
-
- **`{
|
|
165
|
+
- **`{ on, except?, transition }`** — a route family. Entering is forward,
|
|
166
|
+
leaving is backward, and internal navigation uses popstate/semantic history.
|
|
167
|
+
- **`{ from, to, transition, bidirectional? }`** — a precise pair. Arrays on
|
|
168
|
+
either side mean OR; reverse matching is enabled by default.
|
|
169
|
+
- **`{ ordered, transition }`** — both endpoints must be in the ordered list.
|
|
170
|
+
Increasing index is forward; decreasing index is backward.
|
|
171
|
+
|
|
172
|
+
Rules may set `priority` (default `0`). Candidates are chosen by higher
|
|
173
|
+
priority, then path specificity, then earlier declaration order. Patterns
|
|
174
|
+
support exact paths, `:id` (one dynamic segment), `*` (exactly one arbitrary
|
|
175
|
+
segment), and suffix `**` (zero or more segments).
|
|
176
|
+
|
|
177
|
+
Factories accept only their effect options: `{ type?, variant?, options? }`.
|
|
178
|
+
The dispatcher passes semantic direction through the transition context.
|
|
159
179
|
|
|
160
180
|
### Individual Element Animations
|
|
161
181
|
|
|
@@ -51,8 +51,8 @@ export declare abstract class Animation {
|
|
|
51
51
|
* Reads the live simulation value, so it advances frame-by-frame while
|
|
52
52
|
* playing. Useful for external inspection / debugging.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* `MultiAnimation` uses this live value for sequence/stagger triggering so
|
|
55
|
+
* delayed WAAPI startup is never mistaken for elapsed animation time.
|
|
56
56
|
*/
|
|
57
57
|
abstract get progress(): number;
|
|
58
58
|
/**
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not let one delayed rendering opportunity consume an unbounded amount of
|
|
3
|
+
* animation time while startup is still being stabilized. A 30 Hz display is
|
|
4
|
+
* still a normal cadence, so only gaps larger than two nominal 60 Hz frames
|
|
5
|
+
* are treated as catch-up.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_FRAME_DELTA: number;
|
|
8
|
+
export declare const STABLE_FRAME_THRESHOLD: number;
|
|
9
|
+
export type FrameTick = {
|
|
10
|
+
/** Frame time used by frame-paced animation drivers. */
|
|
11
|
+
delta: number;
|
|
12
|
+
/** Actual gap between rendering opportunities. */
|
|
13
|
+
rawDelta: number;
|
|
14
|
+
};
|
|
15
|
+
type FramePhase = "drive" | "observe";
|
|
16
|
+
type FrameCallback = (tick: FrameTick) => void;
|
|
17
|
+
/**
|
|
18
|
+
* One requestAnimationFrame loop shared by animation drivers and composition
|
|
19
|
+
* observers. Drivers always run first so observers see the pose that will be
|
|
20
|
+
* painted for the current rendering opportunity.
|
|
21
|
+
*/
|
|
22
|
+
declare class FrameScheduler {
|
|
23
|
+
private drivers;
|
|
24
|
+
private observers;
|
|
25
|
+
private frameRequest;
|
|
26
|
+
private previousTimestamp;
|
|
27
|
+
subscribe(callback: FrameCallback, phase?: FramePhase): () => void;
|
|
28
|
+
private requestFrame;
|
|
29
|
+
private tick;
|
|
30
|
+
private runPhase;
|
|
31
|
+
private hasCallbacks;
|
|
32
|
+
private stopIfIdle;
|
|
33
|
+
}
|
|
34
|
+
export declare const frameScheduler: FrameScheduler;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=frame-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-scheduler.d.ts","sourceRoot":"","sources":["../../src/lib/animation/frame-scheduler.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAY,CAAC;AACzC,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AACtC,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;AAE/C;;;;GAIG;AACH,cAAM,cAAc;IAClB,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,iBAAiB,CAAuB;IAEhD,SAAS,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,GAAE,UAAoB,GAAG,MAAM,IAAI;IAW3E,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,IAAI,CAkBV;IAEF,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;CAWnB;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
|
|
@@ -29,7 +29,7 @@ export declare class MultiAnimation extends Animation {
|
|
|
29
29
|
private startAt;
|
|
30
30
|
private pendingComplete;
|
|
31
31
|
private running;
|
|
32
|
-
private
|
|
32
|
+
private pendingStartObservers;
|
|
33
33
|
constructor(children: Animation[], opts?: MultiAnimationOptions);
|
|
34
34
|
play(): void;
|
|
35
35
|
reverse(): void;
|
|
@@ -47,7 +47,8 @@ export declare class MultiAnimation extends Animation {
|
|
|
47
47
|
set playbackRate(rate: number);
|
|
48
48
|
private startRun;
|
|
49
49
|
private scheduleStart;
|
|
50
|
-
private
|
|
50
|
+
private hasReachedThreshold;
|
|
51
|
+
private clearPendingStartObservers;
|
|
51
52
|
private handleChildComplete;
|
|
52
53
|
private handleFinished;
|
|
53
54
|
findTimeForProgress(_threshold: number): number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/multi-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/multi-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAC3C,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,qBAAqB,CAAyB;gBAE1C,QAAQ,EAAE,SAAS,EAAE,EAAE,IAAI,GAAE,qBAA0B;IAgBnE,IAAI,IAAI,IAAI;IAIZ,OAAO,IAAI,IAAI;IAIf,KAAK,IAAI,IAAI;IAMb,QAAQ,IAAI,IAAI;IAOhB,IAAI,QAAQ,IAAI,MAAM,CAKrB;IAED,OAAO,IAAI,IAAI,EAAE;IAIjB,WAAW,IAAI,QAAQ,EAAE;IAIzB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI;IAO/B,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,QAAQ,IAAI,OAAO,CAKtB;IACD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAG5B;IAID,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,aAAa;IA8BrB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,0BAA0B;IAKlC,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,cAAc;IAMtB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAOvD"}
|
|
@@ -19,9 +19,16 @@ export interface WebAnimationOptions {
|
|
|
19
19
|
* Lifecycle:
|
|
20
20
|
* 1. `play()` / `reverse()` calls `simulate()` from the current (position,
|
|
21
21
|
* velocity) toward the target bound, producing a frame list.
|
|
22
|
-
* 2. Frames are converted to WAAPI keyframes; `element.animate(...)` is
|
|
23
|
-
* at 0 ms
|
|
24
|
-
*
|
|
22
|
+
* 2. Frames are converted to WAAPI keyframes; `element.animate(...)` is held
|
|
23
|
+
* at 0 ms until the pending pause is acknowledged and the browser has had
|
|
24
|
+
* a rendering opportunity.
|
|
25
|
+
* 3. Startup is advanced by a shared frame clock until two rendering
|
|
26
|
+
* opportunities arrive without a long gap. Delayed mount work during
|
|
27
|
+
* this startup window therefore cannot be charged to the document
|
|
28
|
+
* timeline in one catch-up jump.
|
|
29
|
+
* 4. Playback is handed to native WAAPI once rendering is stable, preserving
|
|
30
|
+
* compositor playback for the remainder of the transition.
|
|
31
|
+
* 5. While playing, `getPose()` interpolates the live position from frames
|
|
25
32
|
* using WAAPI's `currentTime`, so browser setup latency is not counted as
|
|
26
33
|
* animation progress.
|
|
27
34
|
*
|
|
@@ -42,6 +49,8 @@ export declare class WebAnimation extends Animation {
|
|
|
42
49
|
private waitingForStart;
|
|
43
50
|
private startReady;
|
|
44
51
|
private pendingFirstFrame;
|
|
52
|
+
private stopStartupClock;
|
|
53
|
+
private startupStableFrames;
|
|
45
54
|
private running;
|
|
46
55
|
private paused;
|
|
47
56
|
private settled;
|
|
@@ -74,7 +83,10 @@ export declare class WebAnimation extends Animation {
|
|
|
74
83
|
private clearWaapi;
|
|
75
84
|
private captureLiveState;
|
|
76
85
|
private startWhenReady;
|
|
77
|
-
private
|
|
86
|
+
private startFramePacedPlayback;
|
|
87
|
+
private advanceFramePacedStartup;
|
|
88
|
+
private handOffToWaapi;
|
|
89
|
+
private finishFramePacedRun;
|
|
78
90
|
private applyStyleAt;
|
|
79
91
|
}
|
|
80
92
|
//# sourceMappingURL=web-animation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/web-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"web-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/web-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;IAC7C,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAQD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAa,SAAQ,SAAS;IACzC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,iBAAiB,CAAuB;IAChD,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,mBAAmB,CAAK;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,mBAAmB;IAYrC,IAAI,IAAI,IAAI;IAiBZ,OAAO,IAAI,IAAI;IAQf,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,IAAI;IAWhB;;;;;;OAMG;IACH,WAAW,IAAI,IAAI;IAInB,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,QAAQ,IAAI,MAAM,CAMrB;IAED,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAcrD,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAG5B;IAED,OAAO,IAAI,IAAI,EAAE;IAcjB,WAAW,IAAI,QAAQ,EAAE;IAczB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAS9B,OAAO,CAAC,SAAS;IAiEjB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,gBAAgB;YASV,cAAc;IAwB5B,OAAO,CAAC,uBAAuB;IA8B/B,OAAO,CAAC,wBAAwB;IAqChC,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,YAAY;CAQrB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ut=Object.defineProperty;var Nt=(e,t,n)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>Nt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./multi-animation-qtH1IKNG.cjs");function _(e,t){const n=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const i=e[s],l=e[o];!i||!l||n.push({from:i,to:l,transition:t(),symmetric:!0})}return n}function Tt(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function nt(e,t,n){const s=[];for(let o=0;o<e.length;o++)for(let i=o+1;i<e.length;i++){const l=e[o],a=e[i];!l||!a||s.push({from:l,to:a,transition:n(t.forward)},{from:a,to:l,transition:n(t.backward)})}return s}class H{constructor(t){E(this,"omega");E(this,"zeta");E(this,"restDelta");E(this,"restSpeed");const{stiffness:n,damping:s}=t,o=1;this.omega=Math.sqrt(n/o),this.zeta=s/(2*Math.sqrt(n*o)),this.restDelta=t.restDelta??u.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??u.VELOCITY_THRESHOLD}step(t,n,s){const o=Math.min(s,.033),{omega:i,zeta:l}=this,{position:a,velocity:r}=t,c=-2*o*l*i*r,d=o*i*i*(n-a),p=r+c+d;return{position:a+o*p,velocity:p}}isSettled(t,n){const s=Math.abs(n-t.position),o=Math.abs(t.velocity);return s<this.restDelta&&o<this.restSpeed}}class Vt{constructor(t){E(this,"leader");E(this,"follower");E(this,"restDelta");E(this,"restSpeed");this.restDelta=t.restDelta??u.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??u.VELOCITY_THRESHOLD,this.leader=new H({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,s,o,i;typeof t.follower=="number"?(n=t.stiffness*t.follower,s=t.damping):t.follower?(n=t.follower.stiffness,s=t.follower.damping,o=t.follower.restDelta,i=t.follower.restSpeed):(n=t.stiffness,s=t.damping),this.follower=new H({stiffness:n,damping:s,restDelta:o??this.restDelta,restSpeed:i??this.restSpeed})}step(t,n,s){const i=t._leader??{position:t.position,velocity:t.velocity},l=this.leader.step(i,n,s),a=this.follower.step(t,l.position,s);return{position:a.position,velocity:a.velocity,_leader:l}}isSettled(t,n){const s=t,o=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return s._leader?Math.abs(n-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&o:o}}const Xt=.01,Bt=500,Zt=10;class qt{constructor(t){E(this,"acceleration");E(this,"resistance");E(this,"resistanceType");E(this,"min");E(this,"max");E(this,"bounceStiffness");E(this,"bounceDamping");E(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??Bt,this.bounceDamping=t.bounceDamping??Zt,this.restDelta=t.restDelta??Xt}step(t,n,s){const o=Math.min(s,.033),{acceleration:i,resistance:l,resistanceType:a,min:r,max:c}=this,{position:d,velocity:p}=t,f=r!==void 0&&d<r,m=c!==void 0&&d>c;let y;if(f||m){const S=d-(f?r:c),x=-this.bounceStiffness*S,$=-this.bounceDamping*p;y=x+$}else{const w=n>d?1:-1;let S;a==="linear"?S=l*p:S=l*p*Math.abs(p),y=w*i-S}const h=p+y*o;let b=d+h*o;if(!f&&!m){const w=n>d?1:-1;(w>0&&b>n||w<0&&b<n)&&(b=n)}return{position:b,velocity:b===n?0:h}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class g{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new qt({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const s=n.doubleSpring;let o;return typeof s=="number"?o=s:typeof s=="object"&&(o={stiffness:s.stiffness,damping:s.damping}),new Vt({stiffness:n.stiffness,damping:n.damping,follower:o,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new H({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return g.from({spring:t})}}class jt{constructor(t){E(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,s){const o=n-t.position;if(o===0)return t;const i=Math.sign(o),l=Math.abs(o)/this.durationSec,a=i*l*s,r=t.position+a;return(i>0?r>=n:r<=n)?{position:n,velocity:0}:{position:r,velocity:i*l}}isSettled(t,n){return Math.abs(t.position-n)<u.POSITION_THRESHOLD}}function R(e,t){function n(i){let l=0,a=0;const r=i.offsetWidth,c=i.offsetHeight;let d=i;for(;d;)l+=d.offsetTop,a+=d.offsetLeft,d=d.offsetParent;return l-=window.scrollY,a-=window.scrollX,{top:l,left:a,width:r,height:c}}const s=n(e),o=n(t);return new DOMRect(o.left-s.left,o.top-s.top,o.width,o.height)}function ot(e,t){const n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=e.offsetWidth>0?n.width/e.offsetWidth:1,i=e.offsetHeight>0?n.height/e.offsetHeight:1;return new DOMRect((s.left-n.left)/o,(s.top-n.top)/i,s.width/o,s.height/i)}function O(e,t){const{scrollingElement:n,positionedParent:s}=e,o=n!==s&&n.contains(s)?R(n,s).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-o}}function Dt(e,t){const{scrollingElement:n,positionedParent:s}=e,o=n!==s&&n.contains(s)?R(n,s).top:0;return{top:e[t].scroll.y-o,height:n.clientHeight}}const it=8,rt={spring:{stiffness:1e3,damping:40,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function Kt({direction:e}){const t=e==="forward"?it:-it;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function Gt(){return{outPhysics:rt,inPhysics:rt,composition:{mode:"parallel",startAt:[0,0]},build:Kt}}const at=30,Jt={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Qt={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function te({direction:e}){const t=e==="forward"?1:-1,n=-at*t,s=at*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(${n*o}px, 0, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${s}px, 0, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(${s*(1-o)}px, 0, 0)`,opacity:`${o}`})}}}function ee(){return{outPhysics:Jt,inPhysics:Qt,composition:{mode:"sequence"},build:te}}const ne={snappy:Gt(),fluid:ee()},lt=8,se={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},oe={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function ie({direction:e}){const t=e==="forward"?1:-1,n=-lt*t,s=lt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(0, ${n*o}px, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${s}px, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(0, ${s*(1-o)}px, 0)`,opacity:`${o}`})}}}function re(){return{outPhysics:se,inPhysics:oe,composition:{mode:"sequence"},build:ie}}const ae=8,le={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ce={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function pe(e){const t=ae;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function de(){return{outPhysics:le,inPhysics:ce,composition:{mode:"sequence"},build:pe}}const ct=re(),fe={snappy:ct,directional:ct,"non-directional":de()},pt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},U=.1,N=1/3,dt=e=>Math.max(0,Math.min(1,e));function ye({direction:e}){const t=e==="forward"?1:-1,n=1-t*U;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`scale(${1+t*s*U})`,opacity:`${dt(1-s/N)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:s=>({transform:`scale(${n+t*s*U})`,opacity:`${dt((s-N)/(1-N))}`})}}}function he(){return{outPhysics:pt,inPhysics:pt,composition:{mode:"parallel"},build:ye}}const ft={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},V=.1,X=1/3,yt=e=>Math.max(0,Math.min(1,e));function ue(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${yt(1-e/X)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-V})`,opacity:"0"},animate:e=>({transform:`scale(${1-V+e*V})`,opacity:`${yt((e-X)/(1-X))}`})}}}function me(){return{outPhysics:ft,inPhysics:ft,composition:{mode:"parallel"},build:ue}}const ht=he(),ge={snappy:ht,directional:ht,"non-directional":me()},be={x:ne,y:fe,z:ge};function we(e,t){const n=be[e];return n[t]??n.snappy}const Se="x",$e="snappy";function ut(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}function Ft(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function Ce(e){Ft(e),e.style.pointerEvents=""}const Ee=(e={})=>{const t=e.direction??"forward",n=e.type??Se,s=e.feel??$e,o=we(n,s),i=o.build({direction:t});return{prepare:({from:l,to:a})=>(l.then(r=>{ut(r,i.out),r.style.pointerEvents="none"}),a.then(r=>{ut(r,i.in)}),{}),animation:({from:l,to:a,context:r})=>{if(n==="z"){const p=O(r,"from"),f=O(r,"to");l.style.clipPath=`inset(${p.top}px 0 calc(100% - ${p.top+p.height}px) 0)`,a.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`}const c=new u.WebAnimation({element:l,integrator:g.from(o.outPhysics),style:p=>i.out.animate(p),onComplete:()=>Ce(l)}),d=new u.WebAnimation({element:a,integrator:g.from(o.inPhysics),style:p=>i.in.animate(p),onComplete:()=>Ft(a)});return new u.MultiAnimation([c,d],o.composition)}}};function xe(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function Ae(e){const{paths:t}=e,n=e.type??"x",s=e.variant,o=e.feel,i=xe(n,s,o);return nt(t,{forward:"forward",backward:"backward"},l=>Ee({type:n,direction:l,feel:i}))}const Pe={spring:{stiffness:200,damping:22}},_e=10,Ie="horizontal",ve="#000000";function mt(e,t,n,s,o,i){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const a=document.createElement("div");a.style.cssText=`
|
|
1
|
+
"use strict";var te=Object.defineProperty;var ee=(e,t,n)=>t in e?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>ee(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./multi-animation-6124HEke.cjs");class U{constructor(t){E(this,"omega");E(this,"zeta");E(this,"restDelta");E(this,"restSpeed");const{stiffness:n,damping:i}=t,s=1;this.omega=Math.sqrt(n/s),this.zeta=i/(2*Math.sqrt(n*s)),this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD}step(t,n,i){const s=Math.min(i,.033),{omega:o,zeta:r}=this,{position:l,velocity:c}=t,a=-2*s*r*o*c,p=s*o*o*(n-l),u=c+a+p;return{position:l+s*u,velocity:u}}isSettled(t,n){const i=Math.abs(n-t.position),s=Math.abs(t.velocity);return i<this.restDelta&&s<this.restSpeed}}class ne{constructor(t){E(this,"leader");E(this,"follower");E(this,"restDelta");E(this,"restSpeed");this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD,this.leader=new U({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,i,s,o;typeof t.follower=="number"?(n=t.stiffness*t.follower,i=t.damping):t.follower?(n=t.follower.stiffness,i=t.follower.damping,s=t.follower.restDelta,o=t.follower.restSpeed):(n=t.stiffness,i=t.damping),this.follower=new U({stiffness:n,damping:i,restDelta:s??this.restDelta,restSpeed:o??this.restSpeed})}step(t,n,i){const o=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(o,n,i),l=this.follower.step(t,r.position,i);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const i=t,s=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return i._leader?Math.abs(n-i._leader.position)<this.restDelta&&Math.abs(i._leader.velocity)<this.restSpeed&&s:s}}const ie=.01,se=500,oe=10;class re{constructor(t){E(this,"acceleration");E(this,"resistance");E(this,"resistanceType");E(this,"min");E(this,"max");E(this,"bounceStiffness");E(this,"bounceDamping");E(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??se,this.bounceDamping=t.bounceDamping??oe,this.restDelta=t.restDelta??ie}step(t,n,i){const s=Math.min(i,.033),{acceleration:o,resistance:r,resistanceType:l,min:c,max:a}=this,{position:p,velocity:u}=t,d=c!==void 0&&p<c,h=a!==void 0&&p>a;let f;if(d||h){const b=p-(d?c:a),$=-this.bounceStiffness*b,x=-this.bounceDamping*u;f=$+x}else{const S=n>p?1:-1;let b;l==="linear"?b=r*u:b=r*u*Math.abs(u),f=S*o-b}const y=u+f*s;let g=p+y*s;if(!d&&!h){const S=n>p?1:-1;(S>0&&g>n||S<0&&g<n)&&(g=n)}return{position:g,velocity:g===n?0:y}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class w{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new re({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const i=n.doubleSpring;let s;return typeof i=="number"?s=i:typeof i=="object"&&(s={stiffness:i.stiffness,damping:i.damping}),new ne({stiffness:n.stiffness,damping:n.damping,follower:s,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new U({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return w.from({spring:t})}}class ae{constructor(t){E(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,i){const s=n-t.position;if(s===0)return t;const o=Math.sign(s),r=Math.abs(s)/this.durationSec,l=o*r*i,c=t.position+l;return(o>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:o*r}}isSettled(t,n){return Math.abs(t.position-n)<m.POSITION_THRESHOLD}}function Y(e,t){function n(o){let r=0,l=0;const c=o.offsetWidth,a=o.offsetHeight;let p=o;for(;p;)r+=p.offsetTop,l+=p.offsetLeft,p=p.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:c,height:a}}const i=n(e),s=n(t);return new DOMRect(s.left-i.left,s.top-i.top,s.width,s.height)}function N(e,t){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.offsetWidth>0?n.width/e.offsetWidth:1,o=e.offsetHeight>0?n.height/e.offsetHeight:1;return new DOMRect((i.left-n.left)/s,(i.top-n.top)/o,i.width/s,i.height/o)}function T(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?Y(n,i).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-s}}function Lt(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?Y(n,i).top:0;return{top:e[t].scroll.y-s,height:n.clientHeight}}const ct=8,pt={spring:{stiffness:800,damping:40,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function le({direction:e}){const t=e==="forward"?ct:-ct;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function ce(){return{outPhysics:pt,inPhysics:pt,composition:{mode:"parallel",startAt:[0,0]},build:le}}const ut=30,pe={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ue={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function de({direction:e}){const t=e==="forward"?1:-1,n=-ut*t,i=ut*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${n*s}px, 0, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${i}px, 0, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(${i*(1-s)}px, 0, 0)`,opacity:`${s}`})}}}function fe(){return{outPhysics:pe,inPhysics:ue,composition:{mode:"sequence"},build:de}}const he={snappy:ce(),fluid:fe()},dt=8,ye={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},me={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function ge({direction:e}){const t=e==="forward"?1:-1,n=-dt*t,i=dt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(0, ${n*s}px, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${i}px, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(0, ${i*(1-s)}px, 0)`,opacity:`${s}`})}}}function be(){return{outPhysics:ye,inPhysics:me,composition:{mode:"sequence"},build:ge}}const we=8,Se={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},xe={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Ce(e){const t=we;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function $e(){return{outPhysics:Se,inPhysics:xe,composition:{mode:"sequence"},build:Ce}}const ft=be(),Ee={snappy:ft,directional:ft,"non-directional":$e()},ht={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},X=.1,B=1/3,yt=e=>Math.max(0,Math.min(1,e));function Ae({direction:e}){const t=e==="forward"?1:-1,n=1-t*X;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`scale(${1+t*i*X})`,opacity:`${yt(1-i/B)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:i=>({transform:`scale(${n+t*i*X})`,opacity:`${yt((i-B)/(1-B))}`})}}}function Pe(){return{outPhysics:ht,inPhysics:ht,composition:{mode:"parallel"},build:Ae}}const mt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},Z=.1,G=1/3,gt=e=>Math.max(0,Math.min(1,e));function _e(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${gt(1-e/G)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-Z})`,opacity:"0"},animate:e=>({transform:`scale(${1-Z+e*Z})`,opacity:`${gt((e-G)/(1-G))}`})}}}function Ie(){return{outPhysics:mt,inPhysics:mt,composition:{mode:"parallel"},build:_e}}const bt=Pe(),Re={snappy:bt,directional:bt,"non-directional":Ie()},Oe={x:he,y:Ee,z:Re};function ve(e,t){const n=Oe[e];return n[t]??n.snappy}const Te="x",De="snappy";function wt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,i]of Object.entries(t.startStyle))e.style[n]=i}function Yt(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function Fe(e){Yt(e),e.style.pointerEvents=""}const Me=(e={})=>{const t=e.type??Te,n=e.feel??De,i=ve(t,n);return{prepare:({from:s,to:o,context:r})=>{const l=i.build({direction:r.direction});return s.then(c=>{wt(c,l.out),c.style.pointerEvents="none"}),o.then(c=>{wt(c,l.in)}),{}},animation:({from:s,to:o,context:r})=>{const l=i.build({direction:r.direction});if(t==="z"){const p=T(r,"from"),u=T(r,"to");s.style.clipPath=`inset(${p.top}px 0 calc(100% - ${p.top+p.height}px) 0)`,o.style.clipPath=`inset(${u.top}px 0 calc(100% - ${u.top+u.height}px) 0)`}const c=new m.WebAnimation({element:s,integrator:w.from(i.outPhysics),style:p=>l.out.animate(p),onComplete:()=>Fe(s)}),a=new m.WebAnimation({element:o,integrator:w.from(i.inPhysics),style:p=>l.in.animate(p),onComplete:()=>Yt(o)});return new m.MultiAnimation([c,a],i.composition)}}};function Le(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function Ye(e={}){const t=e.type??"x",n=e.variant,i=e.feel,s=Le(t,n,i);return Me({type:t,feel:s})}const ke={spring:{stiffness:200,damping:22}},He=10,Ne="horizontal",We="#000000";function St(e,t,n,i,s,o){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -7,29 +7,29 @@
|
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
z-index: 9999;
|
|
9
9
|
overflow: hidden;
|
|
10
|
-
`;const
|
|
10
|
+
`;const c=[];for(let a=0;a<t;a++){const p=document.createElement("div");if(n==="horizontal"){const u=100/t;p.style.cssText=`
|
|
11
11
|
position: absolute;
|
|
12
|
-
top: ${
|
|
12
|
+
top: ${u*a}%;
|
|
13
13
|
left: 0;
|
|
14
14
|
width: 100%;
|
|
15
|
-
height: calc(${
|
|
16
|
-
background: ${
|
|
17
|
-
transform: scaleX(${
|
|
18
|
-
transform-origin: ${
|
|
15
|
+
height: calc(${u}% + 1px);
|
|
16
|
+
background: ${i};
|
|
17
|
+
transform: scaleX(${s==="hidden"?0:1});
|
|
18
|
+
transform-origin: ${o} center;
|
|
19
19
|
will-change: transform;
|
|
20
|
-
`}else{const
|
|
20
|
+
`}else{const u=100/t;p.style.cssText=`
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0;
|
|
23
|
-
left: ${
|
|
24
|
-
width: calc(${
|
|
23
|
+
left: ${u*a}%;
|
|
24
|
+
width: calc(${u}% + 1px);
|
|
25
25
|
height: 100%;
|
|
26
|
-
background: ${
|
|
27
|
-
transform: scaleY(${
|
|
28
|
-
transform-origin: ${
|
|
26
|
+
background: ${i};
|
|
27
|
+
transform: scaleY(${s==="hidden"?0:1});
|
|
28
|
+
transform-origin: ${o==="left"?"top":"bottom"} center;
|
|
29
29
|
will-change: transform;
|
|
30
|
-
`}
|
|
30
|
+
`}c.push(p),l.appendChild(p)}return e.appendChild(l),{container:l,blinds:c}}const ze=(e={})=>{const t=e.blindCount??He,n=e.direction??Ne,i=e.blindColor??We,s=e.physics??ke;return{prepare:async({from:o,to:r})=>{const l=await o,c=await r;l.style.zIndex="1000";const a=St(l,t,n,i,"hidden","left");c.style.position="relative",c.style.zIndex="0";const p=St(c,t,n,i,"closed","right");return{fromEl:l,fromBlinds:a.blinds,fromContainer:a.container,toBlinds:p.blinds,toContainer:p.container}},animation:({fromEl:o,fromBlinds:r,fromContainer:l,toBlinds:c,toContainer:a})=>{const p=r.map(f=>new m.WebAnimation({element:f,integrator:w.from(s),style:y=>({transform:n==="horizontal"?`scaleX(${y})`:`scaleY(${y})`})})),u=c.map((f,y)=>new m.WebAnimation({element:f,integrator:w.from(s),style:(g,S)=>({transform:n==="horizontal"?`scaleX(${S})`:`scaleY(${S})`}),onComplete:y===c.length-1?()=>{a.remove(),l.remove(),o.style.zIndex="",o.style.position=""}:void 0})),d=new m.MultiAnimation(p,{mode:"parallel"}),h=new m.MultiAnimation(u,{mode:"parallel"});return new m.MultiAnimation([d,h],{mode:"sequence"})}}};function Ue(e={}){const{type:t="horizontal"}=e;return ze({direction:t})}const Ve={spring:{stiffness:250,damping:23,doubleSpring:.7}},L=.5;function Xe(e){const t=e==="enter"?-100:100,n=e==="enter"?100:-100;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`translate3d(${t*i}%, 0, 0)`,opacity:`${L+(1-L)*(1-i)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${n}%, 0, 0)`,opacity:`${L}`},animate:i=>({transform:`translate3d(${n*(1-i)}%, 0, 0)`,opacity:`${L+(1-L)*i}`})}}}function Be(){return{physics:Ve,build:Xe}}const Ze={spring:{stiffness:270,damping:25,doubleSpring:{stiffness:600,damping:50}}};function Ge(e){const t=e==="enter"?-20:100,n=e==="enter"?100:-20;return{out:{willChange:"transform",startStyle:{},animate:i=>({transform:`translate3d(${t*i}%, 0, 0)`})},in:{willChange:"transform",startStyle:{transform:`translate3d(${n}%, 0, 0)`},animate:i=>({transform:`translate3d(${n*(1-i)}%, 0, 0)`})}}}function je(){return{physics:Ze,build:Ge}}const qe={parallax:je(),crossfade:Be()},I="0",kt="1",R="2",Ke="parallax";function xt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,i]of Object.entries(t.startStyle))e.style[n]=i}const Je=(e={})=>{const t=qe[e.type??Ke],n=t.physics;return{prepare:({from:i,to:s,context:o})=>{const r=o.direction==="forward"?"enter":"exit",l=t.build(r),c=r==="enter"?I:R,a=r==="enter"?R:I;return i.then(p=>{xt(p,l.out),p.style.pointerEvents="none",p.style.zIndex=c}),s.then(p=>{xt(p,l.in),p.style.position="relative",p.style.zIndex=a}),{}},animation:({from:i,to:s,context:o})=>{const r=o.direction==="forward"?"enter":"exit",l=t.build(r),c=r==="enter"?R:I,a=new m.WebAnimation({element:i,integrator:w.from(n),style:u=>l.out.animate(u),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.opacity="",i.style.pointerEvents="",i.style.zIndex=""}}),p=new m.WebAnimation({element:s,integrator:w.from(n),style:u=>l.in.animate(u),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.opacity="",s.style.position==="relative"&&(s.style.position=""),s.style.zIndex===c&&(s.style.zIndex="")}});for(const u of[a,p]){const d=u.onComplete;u.onComplete=()=>{d==null||d(),u.releaseFill()}}return new m.MultiAnimation([a,p],{mode:"parallel"})}}};function Qe(e){return e==="slide"||e==="crossfade"?"crossfade":"parallax"}function tn(e={}){const t=e.type,n=Qe(t);return Je({type:n})}const en={spring:{stiffness:180,damping:20,doubleSpring:!0}},nn={spring:{stiffness:170,damping:20,doubleSpring:!0}},sn=(e={})=>{const t=e.physics??nn,n=e.physics??en;return{prepare:({to:i})=>(i.then(s=>{s.style.opacity="0",s.style.willChange="opacity"}),{}),animation:({from:i,to:s})=>{const o=new m.WebAnimation({element:i,integrator:w.from(n),style:(l,c)=>({opacity:c}),onComplete:()=>{i.style.willChange="auto",i.style.opacity=""}}),r=new m.WebAnimation({element:s,integrator:w.from(t),style:l=>({opacity:l}),onComplete:()=>{s.style.willChange="auto",s.style.opacity=""}});return new m.MultiAnimation([o,r],{mode:"sequence"})}}};function on(e={}){return sn()}const j={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},D={scaleDown:0,translate:.2,scaleUp:.8},rn=.8,an="white",Ct=1e3/60,ln=600;function cn(e){const{items:t,from:n,to:i,recordFrame:s}=e,o=Ct/1e3,r=Math.abs(i-n),l=t.map(a=>({item:a,integrator:new U({stiffness:a.spring.stiffness,damping:a.spring.damping}),state:{position:n,velocity:0},started:!1,settled:!1,settleTime:0}));for(let a=0;a<l.length;a++)(a===0||l[a].item.offset===0)&&(l[a].started=!0);s(0);let c=0;for(let a=1;a<=ln;a++){const p=a*Ct;c=p;for(const u of l)!u.started||u.settled||(u.state=u.integrator.step(u.state,i,o),u.integrator.isSettled(u.state,i)?(u.settleTime+=o,u.settleTime>=m.SETTLE_THRESHOLD&&(u.state={position:i,velocity:0},u.settled=!0)):u.settleTime=0,u.item.tick(u.state.position));for(let u=1;u<l.length;u++){const d=l[u];if(d.started)continue;const h=l[u-1];if(!h.started)continue;(r===0?1:Math.abs(h.state.position-n)/r)>=d.item.offset&&(d.started=!0)}if(s(p),l.every(u=>u.settled))return p}return c}function q(e,t){return e!=null&&e.spring?{stiffness:e.spring.stiffness,damping:e.spring.damping}:t}function $t(e){const{rect:t,scale:n,direction:i,override:s}=e,o=i==="out"?{scale:1,translateY:-t.top}:{scale:n,translateY:-t.top+t.height},r=q(s,j.scaleDown),l=q(s,j.translate),c=q(s,j.scaleUp),a=i==="out"?1:0,p=i==="out"?0:1,u=i==="out"?[{spring:r,offset:D.scaleDown,tick:f=>{const y=1-f;o.scale=1-(1-n)*y}},{spring:l,offset:D.translate,tick:f=>{const y=1-f;o.translateY=-t.top-t.height*y}},{spring:c,offset:D.scaleUp,tick:f=>{const y=1-f;o.scale=n+(1-n)*y}}]:[{spring:r,offset:D.scaleDown,tick:f=>{o.scale=1-(1-n)*f}},{spring:l,offset:D.translate,tick:f=>{o.translateY=-t.top+t.height*(1-f)}},{spring:c,offset:D.scaleUp,tick:f=>{o.scale=n+(1-n)*f}}],d=[],h=cn({items:u,from:a,to:p,recordFrame:f=>d.push({time:f,scale:o.scale,translateY:o.translateY})});return{snapshots:d,totalDuration:h}}function pn(e,t){if(e.length===0)return{time:0,scale:1,translateY:0};if(e.length===1||t<=0)return e[0];if(t>=1)return e[e.length-1];const n=t*(e.length-1),i=Math.floor(n),s=Math.ceil(n);if(i===s)return e[i];const o=e[i],r=e[s],l=n-i;return{time:o.time+(r.time-o.time)*l,scale:o.scale+(r.scale-o.scale)*l,translateY:o.translateY+(r.translateY-o.translateY)*l}}const un=[[1,1],[-1,1],[1,-1],[-1,-1]];function dn(e,t){const s=(o,r,l)=>{const c=document.createElement("div");Object.assign(c.style,{position:"fixed",pointerEvents:"none",zIndex:"9999",width:"15px",height:"15px",...o});const a=document.createElement("div");Object.assign(a.style,{position:"absolute",width:"15px",height:"1px",backgroundColor:e,[l]:"0",[r]:"0"});const p=document.createElement("div");return Object.assign(p.style,{position:"absolute",width:"1px",height:"15px",backgroundColor:e,[l]:"0",[r]:"0"}),c.appendChild(a),c.appendChild(p),c};return{topLeft:s({top:`${t.top-1}px`,left:`${t.left-1}px`},"left","top"),topRight:s({top:`${t.top-1}px`,left:`${t.left+t.width-15+1}px`},"right","top"),bottomLeft:s({top:`${t.top+t.height-15+1}px`,left:`${t.left-1}px`},"left","bottom"),bottomRight:s({top:`${t.top+t.height-15+1}px`,left:`${t.left+t.width-15+1}px`},"right","bottom")}}function Et(e,t){const n=t.left+t.width/2,i=t.top+t.height/2;e.style.transformOrigin=`${n}px ${i}px`}function At(e,t){e.style.clipPath=`polygon(
|
|
31
31
|
${t.left}px ${t.top}px,
|
|
32
32
|
${t.left+t.width}px ${t.top}px,
|
|
33
33
|
${t.left+t.width}px ${t.top+t.height}px,
|
|
34
34
|
${t.left}px ${t.top+t.height}px
|
|
35
|
-
)`}function q(e,t,n,s,o){const i=n/1e3;return new u.WebAnimation({element:e,integrator:new jt({durationSec:i}),lowerBound:0,upperBound:1,style:l=>s(Ge(t,l)),onComplete:o})}const tn=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??qe,n=Ze,s=e.physics;return{prepare:({from:i,to:l,context:a})=>{const r=O(a,"from"),c=O(a,"to"),d=R(document.body,a.positionedParent),p=Qe(t,{...r,top:d.top});for(const f of["topLeft","topRight","bottomLeft","bottomRight"])a.positionedParent.appendChild(p[f]);return i.then(f=>{St(f,r),$t(f,r),f.style.transform=`translateY(${-r.top}px)`}),l.then(f=>{St(f,c),$t(f,c),f.style.transform=`translateY(${-c.top+c.height}px) scale(${n})`}),{borders:p,fromRect:r,toRect:c}},animation:({from:i,to:l,context:a,borders:r,fromRect:c,toRect:d})=>{const p=wt({rect:c,scale:n,direction:"out",override:s}),f=wt({rect:d,scale:n,direction:"in",override:s}),m=q(i,p.snapshots,p.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin="",i.style.transform=""}),y=q(l,f.snapshots,f.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{l.style.clipPath="",l.style.transformOrigin="",l.style.transform=""}),h=Je.map(([S,x],$)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][$];return q(r[C],p.snapshots,p.totalDuration,P=>{const A=(c.width-c.width*P.scale)/2*.7*S,F=(c.height-c.height*P.scale)/2*.7*x;return{transform:`translate(${A}px, ${F}px)`}})}),b=new u.MultiAnimation([m,y,...h],{mode:"parallel"}),w=b.onComplete;return b.onComplete=()=>{w==null||w();const S=a.positionedParent;for(const x of["topLeft","topRight","bottomLeft","bottomRight"]){const $=r[x];$.parentElement===S&&S.removeChild($)}},b}}};function en(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>tn(s))}const Ct="data-hero-enter-key",Et="data-hero-exit-key",j="data-hero-key";class nn{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const sn=()=>new nn;class on{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,l=n.style.opacity,a=s.style.opacity,r=n.style.willChange,c=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=l,s.style.opacity=a,n.style.willChange=r,s.style.willChange=c}),[new u.WebAnimation({element:n,integrator:g.from(o),style:(d,p)=>({opacity:p})}),new u.WebAnimation({element:s,integrator:g.from(o),style:d=>({opacity:d})})]}}const rn=()=>new on,an={static:sn,fade:rn},ln={spring:{stiffness:320,damping:30}},cn=()=>ln,pn={spring:{stiffness:300,damping:30,doubleSpring:1}},dn=()=>pn,fn={default:cn,smooth:dn},yn=700,hn="data-hero-aspect-ratio",un="data-hero-radius";function mn(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||o<=0||i<=0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function xt(e){const t=e.getAttribute(un);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function W(e){return e.left+e.width/2}function z(e){return e.top+e.height/2}function gn(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function bn(e,t,n){const s=e.width/e.height;let o,i;return n==="contain"?s>t?(i=e.height,o=i*t):(o=e.width,i=o/t):s>t?(o=e.width,i=o/t):(i=e.height,o=i*t),{left:e.left+(e.width-o)/2,top:e.top+(e.height-i)/2,width:o,height:i}}function At(e,t,n){const s=R(e,t),o=mn(t.getAttribute(hn));if(o===null)return{bbox:s,content:s,window:s,clipInset:{top:0,right:0,bottom:0,left:0}};const i=bn(s,o,n),l=n==="cover"?s:i;return{bbox:s,content:i,window:l,clipInset:gn(i,l)}}function wn(e,t,n,s){const o=n.width/s,i=n.height/s,l=e.width/2+(W(n)-W(t))/s-o/2,a=e.height/2+(z(n)-z(t))/s-i/2;return{top:Math.max(0,a),right:Math.max(0,e.width-l-o),bottom:Math.max(0,e.height-a-i),left:Math.max(0,l)}}function L(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function Sn(e,t){const n=[],s=L(t,Ct),o=L(e,Et);for(const[a,r]of s){const c=o.get(a);c&&n.push({key:a,fromEl:c,toEl:r,fromFit:"cover",toFit:"contain"})}const i=L(e,Ct),l=L(t,Et);for(const[a,r]of i){const c=l.get(a);c&&n.push({key:a,fromEl:r,toEl:c,fromFit:"contain",toFit:"cover"})}return n}function $n(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${j}]`));for(const o of s){const i=o.getAttribute(j);if(!i)continue;const l=e.querySelector(`[${j}="${i}"]`);l&&n.push({key:i,fromEl:l,toEl:o,fromFit:"contain",toFit:"contain"})}return n}function Cn(e,t){const n=Sn(e,t);return n.length>0?n:$n(e,t)}function En(e,t,n){const{fromEl:s,toEl:o}=t,i=At(e,s,t.fromFit),l=At(e,o,t.toFit),a=i.content,r=i.window,c=l.content,d=l.window,p=l.clipInset,f=xt(s),m=xt(o);if(a.width===0||a.height===0||r.width===0||r.height===0||c.width===0||c.height===0||d.width===0||d.height===0)return null;const y=Math.max(a.width/c.width,a.height/c.height),h=W(a),b=z(a),w=W(c),S=z(c),x=h-w,$=b-S;if(Math.abs($)>n)return null;const C=wn(c,a,r,y);return{toContent:c,hasRadius:f>0||m>0,styleFor:(P,A)=>{const F=A*x,Y=A*$,T=P+A*y,Mt=(f*A+m*P)/T,Ht=C.top*A+p.top*P,Wt=C.right*A+p.right*P,zt=C.bottom*A+p.bottom*P,Rt=C.left*A+p.left*P;return{transform:`translate(${F}px, ${Y}px) scale(${T})`,clipPath:`inset(${Ht}px ${Wt}px ${zt}px ${Rt}px round ${Mt}px)`}}}}function xn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class An{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:l}=t,a=[];for(const r of n.pairs){const{fromEl:c,toEl:d}=r,p=En(o,r,i);if(!p)continue;const f=d.cloneNode(!0);f.style.position="absolute",f.style.left=`${p.toContent.left}px`,f.style.top=`${p.toContent.top}px`,f.style.width=`${p.toContent.width}px`,f.style.height=`${p.toContent.height}px`,f.style.margin="0",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",f.style.pointerEvents="none",f.style.maxWidth="none",f.style.maxHeight="none",p.hasRadius&&(f.style.borderRadius="0"),xn(f,p.styleFor(0,1)),o.appendChild(f);const m=c.style.opacity,y=d.style.opacity;c.style.opacity="0",d.style.opacity="0",l(()=>{c.style.opacity=m,d.style.opacity=y,f.parentElement&&f.parentElement.removeChild(f)}),a.push(new u.WebAnimation({element:f,integrator:g.from(s),style:p.styleFor}))}return a}}function Pn(e){return[new An,an[e.type]()]}const _n=e=>{const t=Pn(e),n=fn[e.variant](),s=yn;return{prepare:o=>{var a;const i=Promise.all([o.from,o.to]).then(([r,c])=>({pairs:Cn(r,c)})),l={from:o.from,to:o.to,resolved:i};for(const r of t)(a=r.prepare)==null||a.call(r,l);return i.then(r=>({resolved:r}))},animation:({from:o,to:i,context:l,resolved:a})=>{if(a.pairs.length===0)return new u.MultiAnimation([],{mode:"parallel"});const r=[],c=y=>{r.push(y)},d={from:o,to:i,resolved:a,physics:n,positionedParent:l.positionedParent,maxDistance:s,onComplete:c},p=[];for(const y of t)y.contribute&&p.push(...y.contribute(d));if(p.length===0)return new u.MultiAnimation([],{mode:"parallel"});const f=new u.MultiAnimation(p,{mode:"parallel"}),m=f.onComplete;return f.onComplete=()=>{m==null||m();for(const y of r)try{y()}catch(h){console.error("[hero] cleanup error",h)}},f}}};function In(e){const{paths:t}=e,n=e.type??"static",s=e.variant??"default";return _(t,()=>_n({type:n,variant:s}))}const vn={spring:{stiffness:50,damping:30}},On={spring:{stiffness:80,damping:25}},Tn=(e={})=>{const t=e.physics??vn,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:l,context:a})=>(i.then(r=>{r.style.opacity="1"}),l.then(r=>{const c=O(a,"to"),d=Math.min(c.width,c.height)*.4;r.style.setProperty("--max-border-radius",`${d}px`),r.style.setProperty("--border-radius-scale","1"),r.style.willChange="transform",r.style.backfaceVisibility="hidden";const p=c.left+c.width/2,f=c.top+c.height/2;r.style.transformOrigin=`${p}px ${f}px`,r.style.position="fixed",r.style.top=`${c.top}px`,r.style.left=`${c.left}px`,r.style.width=`${c.width}px`,r.style.height=`${c.height}px`,r.style.zIndex="1000",r.style.overflow="hidden",r.style.transform=`rotate(${n}deg) scale(${s}) translateZ(0)`,r.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",r.style.opacity="1"}),{}),animation:({from:i,to:l})=>{const a=new u.WebAnimation({element:i,integrator:g.from(On),style:(c,d)=>({opacity:d}),onComplete:()=>{i.style.opacity=""}}),r=new u.WebAnimation({element:l,integrator:g.from(t),style:c=>{let d;if(c<=.05)d=s;else if(c<=o){const y=(c-.05)/(o-.05),h=Math.pow(y,9);d=s+(.8-s)*h}else{const y=(c-o)/(1-o);d=.8+.2*(1-Math.pow(1-y,3))}const p=.7;let f;if(c<=p)f=n;else{const y=(c-p)/(1-p),h=1-Math.pow(1-y,2);f=n*(1-h)}let m;if(c<=p)m=1;else{const y=(c-p)/(1-p);m=1-Math.pow(y,.5)}return{transform:`rotate(${f.toFixed(2)}deg) scale(${d.toFixed(4)}) translateZ(0)`,"--border-radius-scale":m.toFixed(4)}},onComplete:()=>{l.style.willChange="",l.style.backfaceVisibility="",l.style.removeProperty("--max-border-radius"),l.style.removeProperty("--border-radius-scale"),l.style.transform="",l.style.transformOrigin="",l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.width="",l.style.height="",l.style.overflow="",l.style.borderRadius=""}});return new u.MultiAnimation([a,r],{mode:"parallel"})}}};function Dn(e){const{paths:t}=e;return _(t,()=>Tn())}const Fn={spring:{stiffness:100,damping:30}},kn=(e={})=>{const t=e.physics??Fn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:l=>({transform:`rotate(${l*180}deg)`,opacity:l<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(l,a)=>({transform:`rotate(${-a*180}deg)`,opacity:l>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new u.MultiAnimation([o,i],{mode:"parallel"})}}};function Yn(e){const{paths:t}=e;return _(t,()=>kn())}const Ln={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Pt=(e={})=>{const t=e.direction??"up",n=e.physics??Ln,s=t==="up",o=s?I:v,i=s?v:I;return{prepare:({from:l,to:a})=>(l.then(r=>{r.style.zIndex=o,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),a.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.position="relative",r.style.zIndex=i}),{}),animation:({from:l,to:a})=>{const r=l.offsetHeight,c=a.offsetHeight,d=window.innerHeight,p=Math.max(Math.min(r,c),d),f=new u.WebAnimation({element:l,integrator:g.from(n),style:y=>({transform:`translate3d(0, ${s?-p*y:p*y}px, 0)`}),onComplete:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain="",l.style.transform="",l.style.pointerEvents="",l.style.zIndex=""}}),m=new u.WebAnimation({element:a,integrator:g.from(n),style:(y,h)=>({transform:`translate3d(0, ${s?h*p:h*-p}px, 0)`}),onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.transform="",a.style.position==="relative"&&(a.style.position=""),a.style.zIndex===i&&(a.style.zIndex="")}});for(const y of[f,m]){const h=y.onComplete;y.onComplete=()=>{h==null||h(),y.releaseFill()}}return new u.MultiAnimation([f,m],{mode:"parallel"})}}};function Mn(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>Pt({direction:"up"})):nt(t,{forward:"up",backward:"down"},s=>Pt({direction:s}))}const Hn={spring:{stiffness:200,damping:24}},Wn={inertia:{acceleration:25,resistance:1.2}},K=.2;function zn(){return{enterPhysics:Hn,exitPhysics:Wn,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-K*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-K+K*e})`,opacity:e})}}}const Rn={spring:{stiffness:200,damping:24}},Un={inertia:{acceleration:25,resistance:1.2}},G=.08,Nn=16,J=.6,Vn=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function Xn(){return{enterPhysics:Rn,exitPhysics:Un,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-G*e})`,opacity:1-(1-J)*e}),exitStyle:e=>({transform:`scale(${1-G+G*e})`,opacity:J+(1-J)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=Vn(Nn*n);return{backdropFilter:s,WebkitBackdropFilter:s}}}}}const Bn={spring:{stiffness:300,damping:30}},Zn={inertia:{acceleration:30,resistance:1}};function qn(){return{enterPhysics:Bn,exitPhysics:Zn,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const jn={static:qn(),"background-scale":zn(),blur:Xn()},Kn="static",Gn="transform",Jn=(e={})=>{const t=e.direction??"enter",n=jn[e.type??Kn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=n.overlay,l=o.willChange!=="";return{prepare:({from:a,to:r,context:c,createElement:d})=>{const p=t==="enter"?r:a,f=t==="enter"?a:r;p.then(y=>{y.style.willChange=Gn,y.style.backfaceVisibility="hidden",y.style.contain="layout paint",y.style.zIndex=v,t==="enter"?y.style.position="relative":y.style.pointerEvents="none"}),f.then(y=>{l&&(y.style.willChange=o.willChange,y.style.backfaceVisibility="hidden",y.style.contain="layout paint"),y.style.zIndex=I,t==="enter"?y.style.pointerEvents="none":y.style.position="relative"});let m;return i&&(m=d("sheet-overlay"),Object.assign(m.style,i.initialStyle),m.style.willChange=i.willChange,c.positionedParent.appendChild(m)),{overlay:m}},animation:({from:a,to:r,context:c,overlay:d})=>{const p=t==="enter"?r:a,f=t==="enter"?a:r,m=O(c,t==="enter"?"to":"from"),y=()=>{a.style.pointerEvents="",a.style.zIndex=""},h=()=>{const $=t==="enter"?v:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===$&&(r.style.zIndex="")},b=$=>{const C=$.onComplete;$.onComplete=()=>{C==null||C(),$.releaseFill()}};p.style.clipPath=`inset(${m.top}px 0 calc(100% - ${m.top+m.height}px) 0)`;const w=t==="enter"?($,C)=>({transform:`translate3d(0, ${C*m.height}px, 0)`}):$=>({transform:`translate3d(0, ${$*m.height}px, 0)`}),S=new u.WebAnimation({element:p,integrator:g.from(s),style:w,onComplete:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transform="",y(),h()}});b(S);const x=[S];if(l){const $=f.scrollHeight;$>0&&(f.style.height=`${$}px`);const C=O(c,t==="enter"?"from":"to"),P=C.left+C.width/2,A=C.top+C.height/2;f.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,f.style.transformOrigin=`${P}px ${A}px`;const F=t==="enter"?(T,st)=>o.enterStyle(T,st):T=>o.exitStyle(T),Y=new u.WebAnimation({element:f,integrator:g.from(s),style:F,onComplete:()=>{f.style.willChange="auto",f.style.backfaceVisibility="",f.style.contain="",f.style.clipPath="",f.style.transformOrigin="",f.style.transform="",f.style.opacity="",f.style.height=""}});b(Y),x.push(Y)}if(d&&i){d.style.zIndex=kt;const $=Dt(c,"to");d.style.top=`${$.top}px`,d.style.height=`${$.height}px`,x.push(new u.WebAnimation({element:d,integrator:g.from(s),style:C=>i.style(t,C)}))}return new u.MultiAnimation(x,{mode:"parallel"})}}};function Qn(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function ts(e){const{enter:t,exit:n}=e,s=e.type,o=Qn(s);return Tt({enter:t,exit:n},i=>Jn({direction:i,type:o}))}const es={spring:{stiffness:170,damping:22,doubleSpring:.8}},ns=(e={})=>{const t=e.direction??"left",n=e.physics??es,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(l=>{l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint",l.style.pointerEvents="none"}),i.then(l=>{const a=s?100:-100;l.style.transform=`translate3d(${a}%, 0, 0)`,l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const l=new u.WebAnimation({element:o,integrator:g.from(n),style:r=>({transform:`translate3d(${s?-100*r:100*r}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents=""}}),a=new u.WebAnimation({element:i,integrator:g.from(n),style:(r,c)=>({transform:`translate3d(${s?c*100:c*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new u.MultiAnimation([l,a],{mode:"parallel"})}}};function ss(e){const{paths:t}=e;return nt(t,{forward:"left",backward:"right"},n=>ns({direction:n}))}const os={spring:{stiffness:17,damping:6}},Q=20,M=800,is=(e={})=>{const t=e.physics??os;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${M}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${M}px) rotateY(${Q}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:l=>{const a=-l*Q,r=l*100;return{transform:`perspective(${M}px) rotateY(${a}deg) translate3d(${r}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(l,a)=>{const r=a*Q,c=-a*100;return{transform:`perspective(${M}px) rotateY(${r}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new u.MultiAnimation([o,i],{mode:"sequence"})}}};function rs(e){const{paths:t}=e;return _(t,()=>is())}function as({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const l=t.left-e.left+(t.width-e.width)/2-s.x,a=t.top-e.top+(t.height-e.height)/2-s.y,r=t.width/e.width,c=t.height/e.height,d=e.top/n.height*100,p=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(r-1)*h,w=1+(c-1)*h,x=(i*h+o*(1-h))/((b+w)/2);return{clipPath:`inset(${d*h}% ${p*h}% ${f*h}% ${m*h}% round ${x}px)`,transform:`translate(${l*h}px, ${a*h}px) scale(${b}, ${w})`}}}}function ls({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const l=t.left-e.left+(t.width-e.width)/2+s.x,a=t.top-e.top+(t.height-e.height)/2+s.y,r=t.width/e.width,c=t.height/e.height,d=e.top/n.height*100,p=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(r-1)*h,w=1+(c-1)*h,x=(o*(1-h)+i*h)/((b+w)/2);return{clipPath:`inset(${d*h}% ${p*h}% ${f*h}% ${m*h}% round ${x}px)`,transform:`translate(${l*h-s.x}px, ${a*h}px) scale(${b}, ${w})`}}}}const cs={spring:{stiffness:430,damping:33,doubleSpring:1}},Yt=.12,ps=18;function ds(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Yt*t})`}}}}function fs(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Yt*t})`}}}}const tt={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${ps*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class ys{constructor(){E(this,"physics",cs)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,l=o.mode==="enter",a=l?n:s,r=l?ds():fs();return r&&(a.style.transformOrigin=r.transformOrigin),[new u.WebAnimation({element:a,integrator:g.from(i),style:l?(c,d)=>r.animate(d):c=>r.animate(c)})]}}class hs{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,tt.initialStyle),n.style.willChange=tt.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const s=Dt(t.context,"to");return n.style.top=`${s.top}px`,n.style.height=`${s.height}px`,[new u.WebAnimation({element:n,integrator:g.from(t.physics),style:o=>tt.style(t.resolved.mode,o)})]}}const us={spring:{stiffness:430,damping:33,doubleSpring:1}};function ms({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,l=e.height/t.height,a=Math.max(i,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:r=>{const c=1-r;return{transform:`translate(${s*c-n.x}px, ${o*c}px) scale(${1+(a-1)*c})`}}}}function gs({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,l=e.height/t.height,a=Math.max(i,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:r=>{const c=1-r;return{transform:`translate(${s*c}px, ${o*c}px) scale(${1+(a-1)*c})`}}}}class bs{constructor(){E(this,"physics",us)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:l}=t,a=o.mode==="enter",r=a?n:s,c=a?ms(i):gs(i);return c&&(r.style.transformOrigin=c.transformOrigin),[new u.WebAnimation({element:r,integrator:g.from(l),style:a?(d,p)=>c.animate(p):d=>c.animate(d)})]}}const ws={spring:{stiffness:530,damping:34,doubleSpring:1}};class Ss{constructor(){E(this,"physics",ws)}contribute(t){return[]}}const $s={expand:()=>new bs,static:()=>new Ss,blur:()=>new ys};function Cs(e){return $s[e]()}const et="data-zoom-enter-key",_t="data-zoom-exit-key",Es="data-zoom-radius";function It(e){const t=e.getAttribute(Es);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function xs(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function vt(e){const t=e.querySelectorAll(`[${et}]`);return t.length!==1?null:t[0]}function Ot(e,t){const n=e.querySelectorAll(`[${_t}]`);for(const s of n)if(s.getAttribute(_t)===t)return s;return null}function As(e,t){const n=vt(e),s=vt(t);if(!n&&s){const o=s.getAttribute(et);if(!o)return null;const i=Ot(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(et);if(!o)return null;const i=Ot(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function Ps(e,t,n,s){return{enterRect:ot(e.mode==="enter"?n:t,e.enterEl),exitRect:ot(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:It(e.enterEl),exitRadius:It(e.exitEl)}}class _s{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:l,onComplete:a}=t,r=o.mode==="enter",c=r?as(i):ls(i),d=r?s:n,p=r?"t":"u";c&&(d.style.transformOrigin=c.transformOrigin);const f=r?I:v,m=r?v:I,y=n.style.zIndex;n.style.zIndex=f;const h=s.style.zIndex,b=s.style.position;return s.style.zIndex=m,s.style.position="relative",a(()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.transformOrigin="",d.style.contain="",n.style.zIndex=y,s.style.zIndex===m&&(s.style.zIndex=h),s.style.position==="relative"&&(s.style.position=b),s.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new u.WebAnimation({element:d,integrator:g.from(l),style:p==="t"?w=>c.animate(w):(w,S)=>c.animate(S)})]}}class Is{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:l}=t,a=n.mode==="enter"?i:o,r=xs(a,n.enterEl);if(r.length===0)return[];const c=r.map(d=>d.style.opacity);if(n.mode==="enter")for(const d of r)d.style.opacity="0";return l(()=>{for(let d=0;d<r.length;d++){const p=r[d];p&&(p.style.opacity=c[d]??"")}}),r.map(d=>new u.WebAnimation({element:d,integrator:g.from(s),style:(p,f)=>({opacity:n.mode==="enter"?p:f})}))}}class Lt{contribute(){return[]}}const vs={default:()=>new Lt,fade:()=>new Is};function Os(e){return vs[e]()}class Ts extends Lt{}function Ds(e){const t=Cs(e.type);return{strategies:[new _s,t,Os(e.variant),new Ts,...e.type==="blur"?[new hs]:[]],physics:t.physics}}const Fs=e=>{const{strategies:t,physics:n}=Ds(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const l of t){if(!l.prepare)continue;const a=l.prepare(o);a&&Object.assign(i,a)}return i},animation:({from:s,to:o,context:i,...l})=>{const a=As(s,o);if(!a)return new u.MultiAnimation([],{mode:"parallel"});const r=Ps(a,s,o,i.scrollOffset),c=[],p={from:s,to:o,resolved:a,input:r,physics:n,context:i,extras:l,onComplete:y=>{c.push(y)}},f=[];for(const y of t)y.contribute&&f.push(...y.contribute(p));const m=f[0];if(m){const y=m.onComplete;m.onComplete=()=>{y==null||y();for(const h of c)try{h()}catch(b){console.error("[zoom] cleanup error",b)}}}for(const y of f){if(!(y instanceof u.WebAnimation))continue;const h=y.onComplete;y.onComplete=()=>{h==null||h(),y.releaseFill()}}return new u.MultiAnimation(f,{mode:"parallel"})}}};function ks(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function Ys(e){const t=ks(e);return _(e.paths,()=>Fs(t))}exports.Animation=u.Animation;exports.MultiAnimation=u.MultiAnimation;exports.WebAnimation=u.WebAnimation;exports.axis=Ae;exports.blind=Te;exports.drill=Ue;exports.fade=Be;exports.film=en;exports.hero=In;exports.jaemin=Dn;exports.rotate=Yn;exports.scroll=Mn;exports.sheet=ts;exports.slide=ss;exports.strip=rs;exports.zoom=Ys;
|
|
35
|
+
)`}function K(e,t,n,i,s){const o=n/1e3;return new m.WebAnimation({element:e,integrator:new ae({durationSec:o}),lowerBound:0,upperBound:1,style:r=>i(pn(t,r)),onComplete:s})}const fn=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??an,n=rn,i=e.physics;return{prepare:({from:o,to:r,context:l})=>{const c=T(l,"from"),a=T(l,"to"),p=Y(document.body,l.positionedParent),u=dn(t,{...c,top:p.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(u[d]);return o.then(d=>{Et(d,c),At(d,c),d.style.transform=`translateY(${-c.top}px)`}),r.then(d=>{Et(d,a),At(d,a),d.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:u,fromRect:c,toRect:a}},animation:({from:o,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const u=$t({rect:a,scale:n,direction:"out",override:i}),d=$t({rect:p,scale:n,direction:"in",override:i}),h=K(o,u.snapshots,u.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""}),f=K(r,d.snapshots,d.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),y=un.map(([b,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return K(c[C],u.snapshots,u.totalDuration,_=>{const P=(a.width-a.width*_.scale)/2*.7*b,A=(a.height-a.height*_.scale)/2*.7*$;return{transform:`translate(${P}px, ${A}px)`}})}),g=new m.MultiAnimation([h,f,...y],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const b=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=c[$];x.parentElement===b&&b.removeChild(x)}},g}}};function hn(e={}){const{options:t}=e,n=(t==null?void 0:t.borderColor)!==void 0?{border:{color:t.borderColor}}:void 0;return fn(n)}function yn(e){if(!e)return null;if(e.includes("/")){const n=e.split("/");if(n.length!==2)return null;const i=Number.parseFloat(n[0]??""),s=Number.parseFloat(n[1]??"");return Number.isFinite(i)&&Number.isFinite(s)&&i>0&&s>0?i/s:null}const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function mn(e){return e==="contain"||e==="cover"?e:null}function st(e){return e.tagName==="IMG"}function gn(e){if(st(e))return e;if(e.tagName==="PICTURE"||e.tagName==="VIDEO")return null;const t=[];for(const n of Array.from(e.children)){const i=n;st(i)&&t.push(i)}return t.length===1?t[0]??null:null}function bn(e){var c,a;if(!st(e))return null;const t=e,n=t.naturalWidth,i=t.naturalHeight;if(typeof n=="number"&&typeof i=="number"&&Number.isFinite(n)&&Number.isFinite(i)&&n>0&&i>0)return n/i;const s=((c=e.getAttribute("width"))==null?void 0:c.trim())??"",o=((a=e.getAttribute("height"))==null?void 0:a.trim())??"",r=s===""?Number.NaN:Number(s),l=o===""?Number.NaN:Number(o);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function wn(e){const t=e.trim().toLowerCase().replace(/\s+/g," ");return t===""||t==="center"||t==="center center"||t==="50% 50%"}function V(e){if(typeof getComputedStyle=="function")try{return getComputedStyle(e)}catch{}return e.style}function Sn(e){const t=V(e),n=wn(t.objectPosition??"");return{fit:n?mn(t.objectFit??null):null,centered:n}}function Ht(e){if(!e)return 0;const t=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(e.trim());if(!t)return null;const n=Number.parseFloat(t[1]??"");return Number.isFinite(n)&&n>=0?n:null}function Pt(e){const t=V(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius].map(Ht),i=n[0];if(i==null)return{radius:0,supported:!1};const s=n.every(o=>o!==null&&Math.abs(o-i)<.001);return{radius:s?i:0,supported:s}}function xn(e,t){var s;if(!t)return null;const n=(s=e.getAttribute(t))==null?void 0:s.trim();if(n==null||n==="")return null;const i=Number.parseFloat(n);return Number.isFinite(i)&&i>=0?i:null}function Cn(e){const t=V(e);return[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft,t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth].every(i=>i?Ht(i)===0:!0)}function $n(e){const t=V(e),n=i=>i==="hidden"||i==="clip";return n(t.overflowX)&&n(t.overflowY)}function O(e){return e.left+e.width/2}function v(e){return e.top+e.height/2}function lt(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function En(e,t){const n=Math.max(e.left,t.left),i=Math.max(e.top,t.top),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return s>n&&o>i?{left:n,top:i,width:s-n,height:o-i}:null}function _t(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function An(e,t,n){const i=e.width/e.height;let s,o;return n==="contain"?i>t?(o=e.height,s=o*t):(s=e.width,o=s/t):i>t?(s=e.width,o=s/t):(o=e.height,s=o*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-o)/2,width:s,height:o}}function Nt(e,t,n){const i=t!==null&&n!==null&&e.width>0&&e.height>0?An(e,t,n):e,s=n==="contain"?i:e;return{bbox:e,content:i,window:s,clipInset:lt(i,s),aspectRatio:t,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:t!==null&&n!==null,mediaElement:null}}function ot(e,t,n){return{...Nt(e,null,null),radius:t,radiusSource:n,bboxRadius:t,bboxRadiusSource:n}}function Wt(e,t){const n=e.aspectRatio,i=t.aspectRatio;return e.contentAware&&t.contentAware&&n!==null&&i!==null&&Math.abs(n-i)/Math.max(n,i)<.01}function It(e){return ot(e.bbox,e.bboxRadius,e.bboxRadiusSource)}function zt(e,t){return Wt(e,t)?[e,t]:[It(e),It(t)]}function rt(e,t,n,i){const s=gn(e),o=s?n(s):t,r=i.legacyAspectRatioAttribute?yn(e.getAttribute(i.legacyAspectRatioAttribute)??(s==null?void 0:s.getAttribute(i.legacyAspectRatioAttribute))??null):null,l=r??(s?bn(s):null),c=s?Sn(s):{fit:null,centered:!0},a=c.centered&&(s===null||Cn(s))?c.fit??(r!==null?i.fallbackFit??null:null):null,p=Nt(o,l,a),u=$n(e),h=s!==null&&s!==e&&u?En(p.window,t):p.window,f=xn(e,i.legacyRadiusAttribute),y=s===e||u,g=y?Pt(e):{radius:0,supported:!0},S=f??g.radius,b=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];h&&y&&_t(h,t)&&$.push(g),h&&s&&_t(h,o)&&$.push(Pt(s));const x=$.every(A=>A.supported),C=Math.max(0,...$.map(A=>A.radius)),_=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!h||P==="unsupported"?ot(t,S,b):{...p,bbox:t,window:h,clipInset:lt(p.content,h),radius:_,radiusSource:P,bboxRadius:S,bboxRadiusSource:b,mediaElement:p.contentAware?s:null}}function Ut(e,t,n,i,s){const o=n.width/i,r=n.height/s;return{left:O(e)+(O(n)-O(t))/i-o/2,top:v(e)+(v(n)-v(t))/s-r/2,width:o,height:r}}const Pn={enter:"contain",exit:"cover",legacy:"contain"};function F(e){return Pn[e]}const Rt="data-hero-enter-key",Ot="data-hero-exit-key",J="data-hero-key";class _n{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const In=()=>new _n;class Rn{contribute(t){const{from:n,to:i,physics:s,onComplete:o}=t,r=n.style.opacity,l=i.style.opacity,c=n.style.willChange,a=i.style.willChange;return i.style.opacity="0",n.style.willChange="opacity",i.style.willChange="opacity",o(()=>{n.style.opacity=r,i.style.opacity=l,n.style.willChange=c,i.style.willChange=a}),[new m.WebAnimation({element:n,integrator:w.from(s),style:(p,u)=>({opacity:u})}),new m.WebAnimation({element:i,integrator:w.from(s),style:p=>({opacity:p})})]}}const On=()=>new Rn,vn={static:In,fade:On},Tn={spring:{stiffness:320,damping:30}},Dn=()=>Tn,Fn={spring:{stiffness:300,damping:30,doubleSpring:1}},Mn=()=>Fn,Ln={default:Dn,smooth:Mn},Yn=700,kn="data-hero-aspect-ratio",Hn="data-hero-radius";function vt(e,t,n){const i=Y(e,t);return rt(t,i,s=>Y(e,s),{fallbackFit:n,legacyAspectRatioAttribute:kn,legacyRadiusAttribute:Hn})}function W(e,t){const n=new Map,i=e.querySelectorAll(`[${t}]`);for(const s of Array.from(i)){const o=s.getAttribute(t);o&&(n.has(o)||n.set(o,s))}return n}function Nn(e,t){const n=[],i=W(t,Rt),s=W(e,Ot);for(const[l,c]of i){const a=s.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:F("exit"),toFit:F("enter")})}const o=W(e,Rt),r=W(t,Ot);for(const[l,c]of o){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:F("enter"),toFit:F("exit")})}return n}function Wn(e,t){const n=[],i=Array.from(t.querySelectorAll(`[${J}]`));for(const s of i){const o=s.getAttribute(J);if(!o)continue;const r=e.querySelector(`[${J}="${o}"]`);r&&n.push({key:o,fromEl:r,toEl:s,fromFit:F("legacy"),toFit:F("legacy")})}return n}function zn(e,t){const n=Nn(e,t);return n.length>0?n:Wn(e,t)}function Un(e,t){return zt(e,t)}function Vn(e,t){return e.radiusSource==="unsupported"||t.radiusSource==="unsupported"?!1:e.mediaElement!==null||t.mediaElement!==null||e.radiusSource==="computed"||e.radiusSource==="legacy"||t.radiusSource==="computed"||t.radiusSource==="legacy"}function Xn(e,t,n){const{fromEl:i,toEl:s}=t,[o,r]=Un(vt(e,i,t.fromFit),vt(e,s,t.toFit)),l=o.content,c=o.window,a=r.content,p=r.window,u=r.clipInset,d=o.radiusSource==="unsupported"||r.radiusSource==="unsupported",h=d?0:o.radius,f=d?0:r.radius;if(l.width===0||l.height===0||c.width===0||c.height===0||a.width===0||a.height===0||p.width===0||p.height===0)return null;const y=Math.max(l.width/a.width,l.height/a.height),g=O(l),S=v(l),b=O(a),$=v(a),x=g-b,C=S-$;if(Math.abs(C)>n)return null;const _=lt(a,Ut(a,l,c,y,y));return{toContent:a,fromVisualEl:o.mediaElement??i,toVisualEl:r.mediaElement??s,resetCloneRadius:Vn(o,r),styleFor:(P,A)=>{const k=A*x,M=A*C,H=P+A*y,jt=Math.max(0,h*A+f*P)/Math.max(Math.abs(H),1e-6),qt=_.top*A+u.top*P,Kt=_.right*A+u.right*P,Jt=_.bottom*A+u.bottom*P,Qt=_.left*A+u.left*P;return{transform:`translate(${k}px, ${M}px) scale(${H})`,clipPath:`inset(${qt}px ${Kt}px ${Jt}px ${Qt}px round ${jt}px)`}}}}function Bn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class Zn{contribute(t){const{resolved:n,physics:i,positionedParent:s,maxDistance:o,onComplete:r}=t,l=[];for(const c of n.pairs){const a=Xn(s,c,o);if(!a)continue;const{fromVisualEl:p,toVisualEl:u}=a,d=u.cloneNode(!0);d.style.position="absolute",d.style.left=`${a.toContent.left}px`,d.style.top=`${a.toContent.top}px`,d.style.width=`${a.toContent.width}px`,d.style.height=`${a.toContent.height}px`,d.style.margin="0",d.style.transformOrigin="center center",d.style.zIndex="1000",d.style.willChange="transform, clip-path",d.style.pointerEvents="none",d.style.maxWidth="none",d.style.maxHeight="none",a.resetCloneRadius&&(d.style.borderRadius="0"),Bn(d,a.styleFor(0,1)),s.appendChild(d);const h=p.style.opacity,f=u.style.opacity;p.style.opacity="0",u.style.opacity="0",r(()=>{p.style.opacity=h,u.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:w.from(i),style:a.styleFor}))}return l}}function Gn(e){return[new Zn,vn[e.type]()]}const jn=e=>{const t=Gn(e),n=Ln[e.variant](),i=Yn;return{prepare:s=>{var l;const o=Promise.all([s.from,s.to]).then(([c,a])=>({pairs:zn(c,a)})),r={from:s.from,to:s.to,resolved:o};for(const c of t)(l=c.prepare)==null||l.call(c,r);return o.then(c=>({resolved:c}))},animation:({from:s,to:o,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const c=[],a=f=>{c.push(f)},p={from:s,to:o,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:i,onComplete:a},u=[];for(const f of t)f.contribute&&u.push(...f.contribute(p));if(u.length===0)return new m.MultiAnimation([],{mode:"parallel"});const d=new m.MultiAnimation(u,{mode:"parallel"}),h=d.onComplete;return d.onComplete=()=>{h==null||h();for(const f of c)try{f()}catch(y){console.error("[hero] cleanup error",y)}},d}}};function qn(e={}){const t=e.type??"static",n=e.variant??"default";return jn({type:t,variant:n})}const Kn={spring:{stiffness:50,damping:30}},Jn={spring:{stiffness:80,damping:25}},Qn=(e={})=>{const t=e.physics??Kn,n=e.initialRotation??45,i=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:o,to:r,context:l})=>(o.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=T(l,"to"),p=Math.min(a.width,a.height)*.4;c.style.setProperty("--max-border-radius",`${p}px`),c.style.setProperty("--border-radius-scale","1"),c.style.willChange="transform",c.style.backfaceVisibility="hidden";const u=a.left+a.width/2,d=a.top+a.height/2;c.style.transformOrigin=`${u}px ${d}px`,c.style.position="fixed",c.style.top=`${a.top}px`,c.style.left=`${a.left}px`,c.style.width=`${a.width}px`,c.style.height=`${a.height}px`,c.style.zIndex="1000",c.style.overflow="hidden",c.style.transform=`rotate(${n}deg) scale(${i}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:o,to:r})=>{const l=new m.WebAnimation({element:o,integrator:w.from(Jn),style:(a,p)=>({opacity:p}),onComplete:()=>{o.style.opacity=""}}),c=new m.WebAnimation({element:r,integrator:w.from(t),style:a=>{let p;if(a<=.05)p=i;else if(a<=s){const f=(a-.05)/(s-.05),y=Math.pow(f,9);p=i+(.8-i)*y}else{const f=(a-s)/(1-s);p=.8+.2*(1-Math.pow(1-f,3))}const u=.7;let d;if(a<=u)d=n;else{const f=(a-u)/(1-u),y=1-Math.pow(1-f,2);d=n*(1-y)}let h;if(a<=u)h=1;else{const f=(a-u)/(1-u);h=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":h.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new m.MultiAnimation([l,c],{mode:"parallel"})}}};function ti(e={}){return Qn()}const ei={spring:{stiffness:100,damping:30}},ni=(e={})=>{const t=e.physics??ei;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),i.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{i.style.willChange="auto",i.style.transform="",i.style.transformOrigin="",i.style.opacity=""}});return new m.MultiAnimation([s,o],{mode:"parallel"})}}};function ii(e={}){return ni()}const si={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},oi=(e={})=>{const t=e.physics??si,n=e.directional??!0;return{prepare:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?I:R,c=r?R:I;return i.then(a=>{a.style.zIndex=l,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),s.then(a=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.position="relative",a.style.zIndex=c}),{}},animation:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?R:I,c=i.offsetHeight,a=s.offsetHeight,p=window.innerHeight,u=Math.max(Math.min(c,a),p),d=new m.WebAnimation({element:i,integrator:w.from(t),style:f=>({transform:`translate3d(0, ${r?-u*f:u*f}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.pointerEvents="",i.style.zIndex=""}}),h=new m.WebAnimation({element:s,integrator:w.from(t),style:(f,y)=>({transform:`translate3d(0, ${r?y*u:y*-u}px, 0)`}),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.position==="relative"&&(s.style.position=""),s.style.zIndex===l&&(s.style.zIndex="")}});for(const f of[d,h]){const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation([d,h],{mode:"parallel"})}}};function ri(e={}){const{type:t="directional"}=e;return oi({directional:t==="directional"})}const ai={spring:{stiffness:200,damping:24}},li={inertia:{acceleration:25,resistance:1.2}},Q=.2;function ci(){return{enterPhysics:ai,exitPhysics:li,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-Q*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-Q+Q*e})`,opacity:e})}}}const pi={spring:{stiffness:200,damping:24}},ui={inertia:{acceleration:25,resistance:1.2}},tt=.08,di=16,et=.6,fi=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function hi(){return{enterPhysics:pi,exitPhysics:ui,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-tt*e})`,opacity:1-(1-et)*e}),exitStyle:e=>({transform:`scale(${1-tt+tt*e})`,opacity:et+(1-et)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=fi(di*n);return{backdropFilter:i,WebkitBackdropFilter:i}}}}}const yi={spring:{stiffness:230,damping:25}},mi={spring:{stiffness:230,damping:25}};function gi(){return{enterPhysics:yi,exitPhysics:mi,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const bi={static:gi(),"background-scale":ci(),blur:hi()},wi="static",Si="transform",xi=(e={})=>{const t=bi[e.type??wi],n=t.background,i=t.overlay,s=n.willChange!=="";return{prepare:({from:o,to:r,context:l,createElement:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?r:o,u=a==="enter"?o:r;p.then(h=>{h.style.willChange=Si,h.style.backfaceVisibility="hidden",h.style.contain="layout paint",h.style.zIndex=R,a==="enter"?h.style.position="relative":h.style.pointerEvents="none"}),u.then(h=>{s&&(h.style.willChange=n.willChange,h.style.backfaceVisibility="hidden",h.style.contain="layout paint"),h.style.zIndex=I,a==="enter"?h.style.pointerEvents="none":h.style.position="relative"});let d;return i&&(d=c("sheet-overlay"),Object.assign(d.style,i.initialStyle),d.style.willChange=i.willChange,l.positionedParent.appendChild(d)),{overlay:d}},animation:({from:o,to:r,context:l,overlay:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?t.enterPhysics:t.exitPhysics,u=a==="enter"?r:o,d=a==="enter"?o:r,h=T(l,a==="enter"?"to":"from"),f=()=>{o.style.pointerEvents="",o.style.zIndex=""},y=()=>{const x=a==="enter"?R:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===x&&(r.style.zIndex="")},g=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};u.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`;const S=a==="enter"?(x,C)=>({transform:`translate3d(0, ${C*h.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*h.height}px, 0)`}),b=new m.WebAnimation({element:u,integrator:w.from(p),style:S,onComplete:()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.contain="",u.style.clipPath="",u.style.transform="",f(),y()}});g(b);const $=[b];if(s){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=T(l,a==="enter"?"from":"to"),_=C.left+C.width/2,P=C.top+C.height/2;d.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,d.style.transformOrigin=`${_}px ${P}px`;const A=a==="enter"?(M,H)=>n.enterStyle(M,H):M=>n.exitStyle(M),k=new m.WebAnimation({element:d,integrator:w.from(p),style:A,onComplete:()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.contain="",d.style.clipPath="",d.style.transformOrigin="",d.style.transform="",d.style.opacity="",d.style.height=""}});g(k),$.push(k)}if(c&&i){c.style.zIndex=kt;const x=Lt(l,"to");c.style.top=`${x.top}px`,c.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:c,integrator:w.from(p),style:C=>i.style(a,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ci(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function $i(e={}){const t=e.type,n=Ci(t);return xi({type:n})}const Ei={spring:{stiffness:170,damping:22,doubleSpring:.8}},Ai=(e={})=>{const t=e.physics??Ei;return{prepare:({from:n,to:i,context:s})=>{const o=s.direction==="forward";return n.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const l=o?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}},animation:({from:n,to:i,context:s})=>{const o=s.direction==="forward",r=new m.WebAnimation({element:n,integrator:w.from(t),style:c=>({transform:`translate3d(${o?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.transform="",n.style.pointerEvents=""}}),l=new m.WebAnimation({element:i,integrator:w.from(t),style:(c,a)=>({transform:`translate3d(${o?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new m.MultiAnimation([r,l],{mode:"parallel"})}}};function Pi(e={}){return Ai()}const _i={spring:{stiffness:17,damping:6}},nt=20,z=800,Ii=(e={})=>{const t=e.physics??_i;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${z}px) rotateY(0deg) translate3d(0%, 0, 0)`}),i.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${z}px) rotateY(${nt}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>{const l=-r*nt,c=r*100;return{transform:`perspective(${z}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>{const c=l*nt,a=-l*100;return{transform:`perspective(${z}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{i.style.transform="",i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}});return new m.MultiAnimation([s,o],{mode:"sequence"})}}};function Ri(e={}){return Ii()}function Oi(e,t){return t.left>=e.left-.01&&t.top>=e.top-.01&&t.left+t.width<=e.left+e.width+.01&&t.top+t.height<=e.top+e.height+.01}function Vt(e){const t=()=>({enterContent:e.enterRect,exitContent:e.exitRect,startWindow:e.enterRect,scaleX:e.exitRect.width/e.enterRect.width,scaleY:e.exitRect.height/e.enterRect.height}),{enterMedia:n,exitMedia:i}=e;if(!n||!i||!Wt(n,i))return t();const s=n.content,o=i.content;if(s.width<=0||s.height<=0||o.width<=0||o.height<=0)return t();const r=o.width/s.width,l=o.height/s.height,c=Ut(s,o,i.window,r,l);return Oi(n.window,c)?{enterContent:s,exitContent:o,startWindow:c,scaleX:r,scaleY:l}:t()}function Xt(e,t){return{top:e.top/t.height*100,right:(t.width-(e.left+e.width))/t.width*100,bottom:(t.height-(e.top+e.height))/t.height*100,left:e.left/t.width*100}}function Bt(e,t,n){return{x:e/Math.max(Math.abs(t),1e-6),y:e/Math.max(Math.abs(n),1e-6)}}function vi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,s*y+i*(1-y)),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y}px, ${d*y}px) scale(${g}, ${S})`}}}}function Ti(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,i*(1-y)+s*y),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y-n.x}px, ${d*y}px) scale(${g}, ${S})`}}}}const Di={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}},Zt=.12,Fi=18;function Mi(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}function Li(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}const it={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=`blur(${Fi*n}px)`;return{backdropFilter:i,WebkitBackdropFilter:i}}};class Yi{constructor(){E(this,"physics",Di)}contribute(t){const{from:n,to:i,resolved:s,physics:o}=t,r=s.mode==="enter",l=r?n:i,c=r?Mi():Li();return c&&(l.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:l,integrator:w.from(o),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class ki{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,it.initialStyle),n.style.willChange=it.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const i=Lt(t.context,"to");return n.style.top=`${i.top}px`,n.style.height=`${i.height}px`,[new m.WebAnimation({element:n,integrator:w.from(t.physics),style:s=>it.style(t.resolved.mode,s)})]}}const Hi={spring:{stiffness:430,damping:33,doubleSpring:1}};function Ni({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a-n.x}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}function Wi({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}class zi{constructor(){E(this,"physics",Hi)}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r}=t,l=s.mode==="enter",c=l?n:i,a=l?Ni(o):Wi(o);return a&&(c.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:c,integrator:w.from(r),style:l?(p,u)=>a.animate(u):p=>a.animate(p)})]}}const Ui={spring:{stiffness:530,damping:34,doubleSpring:1}};class Vi{constructor(){E(this,"physics",Ui)}contribute(t){return[]}}const Xi={expand:()=>new zi,static:()=>new Vi,blur:()=>new Yi};function Bi(e){return Xi[e]()}const at="data-zoom-enter-key",Tt="data-zoom-exit-key",Dt="data-zoom-radius";function Zi(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Gi(e,t){const n=[];let i=t;for(;i&&i!==e;){const s=i.parentElement;if(!s)break;for(const o of Array.from(s.children))o!==i&&o instanceof HTMLElement&&n.push(o);i=s}return n}function Ft(e){const t=e.querySelectorAll(`[${at}]`);return t.length!==1?null:t[0]}function Mt(e,t){const n=e.querySelectorAll(`[${Tt}]`);for(const i of n)if(i.getAttribute(Tt)===t)return i;return null}function ji(e,t,n){if(n==="forward"){const r=Ft(t);if(!r)return null;const l=r.getAttribute(at);if(!l)return null;const c=Mt(e,l);return c?{mode:"enter",enterEl:r,exitEl:c}:null}const i=Ft(e);if(!i)return null;const s=i.getAttribute(at);if(!s)return null;const o=Mt(t,s);return o?{mode:"exit",enterEl:i,exitEl:o}:null}function qi(e,t,n,i){const s=e.mode==="enter"?n:t,o=e.mode==="enter"?t:n,r=N(s,e.enterEl),l=N(o,e.exitEl),c=rt(e.enterEl,r,g=>N(s,g),{legacyRadiusAttribute:Dt}),a=rt(e.exitEl,l,g=>N(o,g),{legacyRadiusAttribute:Dt}),[p,u]=zt(c,a),d=p.contentAware&&u.contentAware,h=e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),f={left:0,top:0,width:h.width,height:h.height},y=p.radiusSource==="legacy"||Zi(p.window,f)?p.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:p,exitMedia:u}:{},pageRect:h,scrollOffset:i,enterRadius:y,exitRadius:u.radius}}class Ki{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r,onComplete:l}=t,c=s.mode==="enter",a=c?vi(o):Ti(o),p=c?i:n,u=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const d=c?I:R,h=c?R:I,f=n.style.zIndex;n.style.zIndex=d;const y=i.style.zIndex,g=i.style.position;return i.style.zIndex=h,i.style.position="relative",l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=f,i.style.zIndex===h&&(i.style.zIndex=y),i.style.position==="relative"&&(i.style.position=g),i.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new m.WebAnimation({element:p,integrator:w.from(r),style:u==="t"?S=>a.animate(S):(S,b)=>a.animate(b)})]}}class Ji{contribute(t){const{resolved:n,physics:i,from:s,to:o,onComplete:r}=t,l=n.mode==="enter"?o:s,c=Gi(l,n.enterEl);if(c.length===0)return[];const a=c.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of c)p.style.opacity="0";return r(()=>{for(let p=0;p<c.length;p++){const u=c[p];u&&(u.style.opacity=a[p]??"")}}),c.map(p=>new m.WebAnimation({element:p,integrator:w.from(i),style:(u,d)=>({opacity:n.mode==="enter"?u:d})}))}}class Gt{contribute(){return[]}}const Qi={default:()=>new Gt,fade:()=>new Ji};function ts(e){return Qi[e]()}class es extends Gt{}function ns(e){const t=Bi(e.type);return{strategies:[new Ki,t,ts(e.variant),new es,...e.type==="blur"?[new ki]:[]],physics:t.physics}}const is=e=>{const{strategies:t,physics:n}=ns(e);return{prepare:i=>{const s={from:i.from,to:i.to,context:{positionedParent:i.context.positionedParent},createElement:i.createElement},o={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(o,l)}return o},animation:({from:i,to:s,context:o,...r})=>{const l=ji(i,s,o.direction);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const c=qi(l,i,s,o.scrollOffset),a=[],u={from:i,to:s,resolved:l,input:c,physics:n,context:o,extras:r,onComplete:f=>{a.push(f)}},d=[];for(const f of t)f.contribute&&d.push(...f.contribute(u));const h=d[0];if(h){const f=h.onComplete;h.onComplete=()=>{f==null||f();for(const y of a)try{y()}catch(g){console.error("[zoom] cleanup error",g)}}}for(const f of d){if(!(f instanceof m.WebAnimation))continue;const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function ss(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function os(e={}){const t=ss(e);return is(t)}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=Ye;exports.blind=Ue;exports.drill=tn;exports.fade=on;exports.film=hn;exports.hero=qn;exports.jaemin=ti;exports.rotate=ii;exports.scroll=ri;exports.sheet=$i;exports.slide=Pi;exports.strip=Ri;exports.zoom=os;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './transitions';
|
|
2
2
|
export { Animation, WebAnimation, MultiAnimation } from './animation';
|
|
3
3
|
export type { WebAnimationOptions, MultiAnimationOptions, MultiAnimationMode, } from './animation';
|
|
4
|
-
export type { SsgoiConfig,
|
|
4
|
+
export type { SsgoiConfig, SsgoiTransitionRule, SsgoiOnTransitionRule, SsgoiPairTransitionRule, SsgoiOrderedTransitionRule, PathPatterns, NavigationDirection, TransitionConfig, PrepareArgs, AnimationFactoryArgs, CreateElement, SsgoiTransitionContext, Pose, Timeline, TimelineFrame, StyleObject, PhysicsOptions, SpringConfig, InertiaConfig, } from './types/index.ts';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,WAAW,EACX,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,QAAQ,CAAC"}
|