@ssgoi/core 3.4.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/animator/integrator/double-spring-integrator.d.ts +25 -0
  2. package/dist/animator/integrator/double-spring-integrator.d.ts.map +1 -0
  3. package/dist/animator/integrator/index.d.ts +13 -0
  4. package/dist/animator/integrator/index.d.ts.map +1 -0
  5. package/dist/animator/integrator/inertia-integrator.d.ts +19 -0
  6. package/dist/animator/integrator/inertia-integrator.d.ts.map +1 -0
  7. package/dist/animator/integrator/provider.d.ts +22 -0
  8. package/dist/animator/integrator/provider.d.ts.map +1 -0
  9. package/dist/animator/integrator/spring-integrator.d.ts +13 -0
  10. package/dist/animator/integrator/spring-integrator.d.ts.map +1 -0
  11. package/dist/animator/integrator/types.d.ts +34 -0
  12. package/dist/animator/integrator/types.d.ts.map +1 -0
  13. package/dist/animator/multi-animator.d.ts +2 -2
  14. package/dist/animator/multi-animator.d.ts.map +1 -1
  15. package/dist/animator/{animate → runner}/css-runner.d.ts +2 -2
  16. package/dist/animator/runner/css-runner.d.ts.map +1 -0
  17. package/dist/animator/runner/provider.d.ts +35 -0
  18. package/dist/animator/runner/provider.d.ts.map +1 -0
  19. package/dist/animator/{animate → runner}/tick-runner.d.ts +2 -2
  20. package/dist/animator/runner/tick-runner.d.ts.map +1 -0
  21. package/dist/animator/runner/ticker.d.ts.map +1 -0
  22. package/dist/animator/{animate → runner}/types.d.ts +6 -3
  23. package/dist/animator/runner/types.d.ts.map +1 -0
  24. package/dist/animator/{index.d.ts → single-animator.d.ts} +17 -9
  25. package/dist/animator/single-animator.d.ts.map +1 -0
  26. package/dist/animator/{animation.d.ts → types.d.ts} +2 -2
  27. package/dist/animator/types.d.ts.map +1 -0
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.d.ts +0 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +480 -535
  32. package/dist/provider-B6Xnh0BA.cjs +1 -0
  33. package/dist/provider-CMBovM_W.js +134 -0
  34. package/dist/transition/transition-strategy.d.ts +2 -2
  35. package/dist/transition/transition-strategy.d.ts.map +1 -1
  36. package/dist/transitions/blur.d.ts +4 -7
  37. package/dist/transitions/blur.d.ts.map +1 -1
  38. package/dist/transitions/bounce.d.ts +4 -7
  39. package/dist/transitions/bounce.d.ts.map +1 -1
  40. package/dist/transitions/fade.d.ts +4 -7
  41. package/dist/transitions/fade.d.ts.map +1 -1
  42. package/dist/transitions/fly.d.ts +2 -5
  43. package/dist/transitions/fly.d.ts.map +1 -1
  44. package/dist/transitions/index.cjs +1 -1
  45. package/dist/transitions/index.d.ts +5 -0
  46. package/dist/transitions/index.d.ts.map +1 -1
  47. package/dist/transitions/index.js +153 -194
  48. package/dist/transitions/mask.d.ts +2 -5
  49. package/dist/transitions/mask.d.ts.map +1 -1
  50. package/dist/transitions/none.d.ts +2 -5
  51. package/dist/transitions/none.d.ts.map +1 -1
  52. package/dist/transitions/rotate.d.ts +4 -7
  53. package/dist/transitions/rotate.d.ts.map +1 -1
  54. package/dist/transitions/scale.d.ts +4 -7
  55. package/dist/transitions/scale.d.ts.map +1 -1
  56. package/dist/transitions/slide.d.ts +4 -7
  57. package/dist/transitions/slide.d.ts.map +1 -1
  58. package/dist/transitions/utils.d.ts +8 -0
  59. package/dist/transitions/utils.d.ts.map +1 -0
  60. package/dist/types.cjs +1 -1
  61. package/dist/types.d.ts +59 -3
  62. package/dist/types.d.ts.map +1 -1
  63. package/dist/types.js +6 -6
  64. package/dist/view-transitions/blind.d.ts +2 -3
  65. package/dist/view-transitions/blind.d.ts.map +1 -1
  66. package/dist/view-transitions/curtain-reveal.d.ts +2 -3
  67. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -1
  68. package/dist/view-transitions/depth.d.ts +19 -0
  69. package/dist/view-transitions/depth.d.ts.map +1 -0
  70. package/dist/view-transitions/drill.d.ts +2 -2
  71. package/dist/view-transitions/drill.d.ts.map +1 -1
  72. package/dist/view-transitions/fade.d.ts +2 -3
  73. package/dist/view-transitions/fade.d.ts.map +1 -1
  74. package/dist/view-transitions/film.d.ts +2 -1
  75. package/dist/view-transitions/film.d.ts.map +1 -1
  76. package/dist/view-transitions/hero.d.ts +2 -2
  77. package/dist/view-transitions/hero.d.ts.map +1 -1
  78. package/dist/view-transitions/index.cjs +11 -11
  79. package/dist/view-transitions/index.d.ts +6 -2
  80. package/dist/view-transitions/index.d.ts.map +1 -1
  81. package/dist/view-transitions/index.js +1079 -681
  82. package/dist/view-transitions/instagram.d.ts +2 -2
  83. package/dist/view-transitions/instagram.d.ts.map +1 -1
  84. package/dist/view-transitions/jaemin.d.ts +2 -6
  85. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  86. package/dist/view-transitions/pinterest.d.ts +2 -2
  87. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  88. package/dist/view-transitions/rotate.d.ts +5 -2
  89. package/dist/view-transitions/rotate.d.ts.map +1 -1
  90. package/dist/view-transitions/scroll.d.ts +2 -2
  91. package/dist/view-transitions/scroll.d.ts.map +1 -1
  92. package/dist/view-transitions/sheet.d.ts +19 -0
  93. package/dist/view-transitions/sheet.d.ts.map +1 -0
  94. package/dist/view-transitions/slide.d.ts +2 -2
  95. package/dist/view-transitions/slide.d.ts.map +1 -1
  96. package/dist/view-transitions/snap.d.ts +14 -0
  97. package/dist/view-transitions/snap.d.ts.map +1 -0
  98. package/dist/view-transitions/strip.d.ts +6 -2
  99. package/dist/view-transitions/strip.d.ts.map +1 -1
  100. package/dist/view-transitions/swap.d.ts +13 -0
  101. package/dist/view-transitions/swap.d.ts.map +1 -0
  102. package/package.json +1 -1
  103. package/dist/animator/animate/css-runner.d.ts.map +0 -1
  104. package/dist/animator/animate/index.d.ts +0 -42
  105. package/dist/animator/animate/index.d.ts.map +0 -1
  106. package/dist/animator/animate/tick-runner.d.ts.map +0 -1
  107. package/dist/animator/animate/types.d.ts.map +0 -1
  108. package/dist/animator/animation.d.ts.map +0 -1
  109. package/dist/animator/index.d.ts.map +0 -1
  110. package/dist/animator/spring-core.d.ts +0 -82
  111. package/dist/animator/spring-core.d.ts.map +0 -1
  112. package/dist/animator/ticker.d.ts.map +0 -1
  113. package/dist/jaemin-BG8HRXG1.cjs +0 -1
  114. package/dist/jaemin-BWkrXq0V.js +0 -131
  115. /package/dist/animator/{ticker.d.ts → runner/ticker.d.ts} +0 -0
@@ -1,26 +1,46 @@
1
- import { p as b, g as x } from "../jaemin-BWkrXq0V.js";
2
- import { a as Ht } from "../jaemin-BWkrXq0V.js";
3
- const F = (t) => new Promise((n) => setTimeout(n, t));
4
- function T() {
5
- let t, n;
6
- return { promise: new Promise((d, a) => {
7
- t = d, n = a;
8
- }), resolve: t, reject: n };
1
+ const $ = (t, i) => {
2
+ var o;
3
+ t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((o = i == null ? void 0 : i.scrollOffset) == null ? void 0 : o.y) ?? 0)}px`, t.style.left = "0";
4
+ }, V = (t) => new Promise((i) => setTimeout(i, t));
5
+ function x(t, i) {
6
+ function o(s) {
7
+ let n = 0, e = 0;
8
+ const c = s.offsetWidth, y = s.offsetHeight;
9
+ let r = s;
10
+ for (; r; )
11
+ n += r.offsetTop, e += r.offsetLeft, r = r.offsetParent;
12
+ return n -= window.scrollY, e -= window.scrollX, { top: n, left: e, width: c, height: y };
13
+ }
14
+ const l = o(t), a = o(i);
15
+ return new DOMRect(
16
+ a.left - l.left,
17
+ a.top - l.top,
18
+ a.width,
19
+ a.height
20
+ );
21
+ }
22
+ function E() {
23
+ let t, i;
24
+ return { promise: new Promise((l, a) => {
25
+ t = l, i = a;
26
+ }), resolve: t, reject: i };
9
27
  }
10
- const N = { stiffness: 80, damping: 25 }, G = { stiffness: 75, damping: 25 }, q = 300, j = 10, K = "horizontal", Z = "#000000", It = (t = {}) => {
28
+ const N = {
29
+ spring: { stiffness: 80, damping: 25 }
30
+ }, j = {
31
+ spring: { stiffness: 75, damping: 25 }
32
+ }, G = 300, Z = 10, J = "horizontal", K = "#000000", Nt = (t = {}) => {
11
33
  const {
12
- inSpring: n = G,
13
- outSpring: i = N,
14
- transitionDelay: d = q,
15
- blindCount: a = j,
16
- direction: s = K,
17
- blindColor: l = Z
18
- } = t;
19
- let r, o = null;
20
- const c = (e, g, y = "left") => {
21
- window.getComputedStyle(e).position === "static" && (e.style.position = "relative");
22
- const p = document.createElement("div");
23
- p.className = "blind-container", p.style.cssText = `
34
+ transitionDelay: i = G,
35
+ blindCount: o = Z,
36
+ direction: l = J,
37
+ blindColor: a = K
38
+ } = t, s = t.physics ?? j, n = t.physics ?? N;
39
+ let e, c = null;
40
+ const y = (r, d, h = "left") => {
41
+ window.getComputedStyle(r).position === "static" && (r.style.position = "relative");
42
+ const f = document.createElement("div");
43
+ f.className = "blind-container", f.style.cssText = `
24
44
  position: absolute;
25
45
  top: 0;
26
46
  left: 0;
@@ -30,341 +50,555 @@ const N = { stiffness: 80, damping: 25 }, G = { stiffness: 75, damping: 25 }, q
30
50
  z-index: 9999;
31
51
  overflow: hidden;
32
52
  `;
33
- const u = [];
34
- for (let m = 0; m < a; m++) {
35
- const f = document.createElement("div");
36
- if (s === "horizontal") {
37
- const w = 100 / a, $ = `calc(${w}% + 1px)`;
38
- f.style.cssText = `
53
+ const p = [];
54
+ for (let w = 0; w < o; w++) {
55
+ const g = document.createElement("div");
56
+ if (l === "horizontal") {
57
+ const b = 100 / o, m = `calc(${b}% + 1px)`;
58
+ g.style.cssText = `
39
59
  position: absolute;
40
- top: ${w * m}%;
60
+ top: ${b * w}%;
41
61
  left: 0;
42
62
  width: 100%;
43
- height: ${$};
44
- background: ${l};
45
- transform: scaleX(${g === "hidden" ? 0 : 1});
46
- transform-origin: ${y} center;
63
+ height: ${m};
64
+ background: ${a};
65
+ transform: scaleX(${d === "hidden" ? 0 : 1});
66
+ transform-origin: ${h} center;
47
67
  will-change: transform;
48
68
  `;
49
69
  } else {
50
- const w = 100 / a, $ = `calc(${w}% + 1px)`;
51
- f.style.cssText = `
70
+ const b = 100 / o, m = `calc(${b}% + 1px)`;
71
+ g.style.cssText = `
52
72
  position: absolute;
53
73
  top: 0;
54
- left: ${w * m}%;
55
- width: ${$};
74
+ left: ${b * w}%;
75
+ width: ${m};
56
76
  height: 100%;
57
- background: ${l};
58
- transform: scaleY(${g === "hidden" ? 0 : 1});
59
- transform-origin: ${y === "left" ? "top" : "bottom"} center;
77
+ background: ${a};
78
+ transform: scaleY(${d === "hidden" ? 0 : 1});
79
+ transform-origin: ${h === "left" ? "top" : "bottom"} center;
60
80
  will-change: transform;
61
81
  `;
62
82
  }
63
- u.push(f), p.appendChild(f);
83
+ p.push(g), f.appendChild(g);
64
84
  }
65
- return e.appendChild(p), { container: p, blinds: u };
85
+ return r.appendChild(f), { container: f, blinds: p };
66
86
  };
67
87
  return {
68
88
  out: () => {
69
- let e = null;
70
- r = new Promise((h) => {
71
- o = h;
89
+ let r = null;
90
+ e = new Promise((u) => {
91
+ c = u;
72
92
  });
73
- const g = (h) => {
74
- const p = 1 - h;
93
+ const d = (u) => {
94
+ const f = 1 - u;
75
95
  return {
76
- transform: s === "horizontal" ? `scaleX(${p})` : `scaleY(${p})`
96
+ transform: l === "horizontal" ? `scaleX(${f})` : `scaleY(${f})`
77
97
  };
78
98
  };
79
99
  return {
80
- springs: Array.from({ length: a }, (h, p) => ({
81
- spring: i,
100
+ springs: Array.from({ length: o }, (u, f) => ({
101
+ physics: n,
82
102
  offset: 0.2,
83
103
  css: {
84
104
  // Use getter for lazy element access (evaluated after prepare)
85
105
  get element() {
86
- return e == null ? void 0 : e.blinds[p];
106
+ return r == null ? void 0 : r.blinds[f];
87
107
  },
88
- style: g
108
+ style: d
89
109
  }
90
110
  })),
91
111
  schedule: "stagger",
92
- prepare: (h) => {
93
- b(h), h.style.zIndex = "1000", e = c(h, "hidden", "left");
112
+ prepare: (u) => {
113
+ $(u), u.style.zIndex = "1000", r = y(u, "hidden", "left");
94
114
  },
95
115
  onStart: () => {
96
116
  },
97
117
  onEnd: () => {
98
- o && o();
118
+ c && c();
99
119
  }
100
120
  };
101
121
  },
102
122
  in: () => {
103
- let e = null;
104
- const g = (h) => {
105
- const p = 1 - h;
123
+ let r = null;
124
+ const d = (u) => {
125
+ const f = 1 - u;
106
126
  return {
107
- transform: s === "horizontal" ? `scaleX(${p})` : `scaleY(${p})`
127
+ transform: l === "horizontal" ? `scaleX(${f})` : `scaleY(${f})`
108
128
  };
109
129
  };
110
130
  return {
111
- springs: Array.from({ length: a }, (h, p) => ({
112
- spring: n,
131
+ springs: Array.from({ length: o }, (u, f) => ({
132
+ physics: s,
113
133
  offset: 0.2,
114
134
  css: {
115
135
  // Use getter for lazy element access (evaluated after prepare)
116
136
  get element() {
117
- return e == null ? void 0 : e.blinds[p];
137
+ return r == null ? void 0 : r.blinds[f];
118
138
  },
119
- style: g
139
+ style: d
120
140
  }
121
141
  })),
122
142
  schedule: "stagger",
123
- prepare: (h) => {
124
- h.style.position = "relative", h.style.zIndex = "0", e = c(h, "closed", "right");
143
+ prepare: (u) => {
144
+ u.style.position = "relative", u.style.zIndex = "0", r = y(u, "closed", "right");
125
145
  },
126
146
  onStart: () => {
127
147
  },
128
148
  wait: async () => {
129
- r && await r, await F(d);
149
+ e && await e, await V(i);
130
150
  },
131
151
  onEnd: () => {
132
- e && e.container && e.container.remove();
152
+ r && r.container && r.container.remove();
133
153
  }
134
154
  };
135
155
  }
136
156
  };
137
- }, J = {
138
- stiffness: 125,
139
- damping: 20,
140
- doubleSpring: 0.8
141
157
  }, Q = {
142
- stiffness: 130,
143
- damping: 20,
144
- doubleSpring: 0.8
145
- }, Ot = (t = {}) => {
146
- var s, l, r;
147
- const { opacity: n = !1, direction: i = "enter" } = t, d = i === "enter" ? J : Q, a = {
148
- stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? d.stiffness,
149
- damping: ((l = t.spring) == null ? void 0 : l.damping) ?? d.damping,
150
- doubleSpring: ((r = t.spring) == null ? void 0 : r.doubleSpring) ?? d.doubleSpring
158
+ spring: { stiffness: 1, damping: 1 }
159
+ }, R = {
160
+ spring: { stiffness: 20, damping: 25 }
161
+ }, tt = "#000000", st = "circle", v = "CURTAIN_REVEAL_OVERLAY_ID", nt = {
162
+ position: "fixed",
163
+ inset: "0",
164
+ width: "100vw",
165
+ height: "100%",
166
+ zIndex: "9999",
167
+ display: "flex",
168
+ alignItems: "center",
169
+ justifyContent: "center",
170
+ overflow: "hidden"
171
+ }, it = {
172
+ position: "relative",
173
+ display: "inline-block",
174
+ height: "5.5rem",
175
+ overflow: "hidden"
176
+ }, et = {
177
+ display: "flex",
178
+ height: "100%",
179
+ willChange: "transform",
180
+ transition: "transform 0.3s ease"
181
+ }, rt = {
182
+ display: "inline-flex",
183
+ alignItems: "center",
184
+ justifyContent: "center",
185
+ whiteSpace: "nowrap",
186
+ fontSize: "5.5rem",
187
+ fontWeight: "900",
188
+ letterSpacing: "0.02em",
189
+ color: "#FFFFFF"
190
+ }, at = 0.4, A = 0.5, ot = 0.2;
191
+ function lt(t, i) {
192
+ switch (t) {
193
+ case "circle":
194
+ return `circle(${i * 100}% at 50% 50%)`;
195
+ case "square":
196
+ return `inset(${(1 - i) * 50}% round ${10 * i}%)`;
197
+ case "triangle": {
198
+ const o = i * 100;
199
+ return `polygon(50% ${50 - o}%, ${50 - o}% ${50 + o}%, ${50 + o}% ${50 + o}%)`;
200
+ }
201
+ }
202
+ }
203
+ const ct = (t) => t.reduce((i, o) => i + o, 0), jt = (t = {}) => {
204
+ const {
205
+ background: i = tt,
206
+ texts: o = [],
207
+ shape: l = st,
208
+ textStyle: a = {}
209
+ } = t, s = t.physics ?? R, n = t.physics ?? Q;
210
+ return {
211
+ out: (e, c) => {
212
+ const y = e.style.opacity;
213
+ return {
214
+ physics: n,
215
+ from: 1,
216
+ to: 0,
217
+ prepare: (r) => {
218
+ $(r, c), r.style.opacity = "1";
219
+ },
220
+ tick: (r) => {
221
+ const d = Math.max(0, r - at);
222
+ e.style.opacity = String(d);
223
+ },
224
+ onEnd: () => {
225
+ e.style.opacity = y;
226
+ }
227
+ };
228
+ },
229
+ in: (e) => {
230
+ let c = null, y = null, r = null;
231
+ const d = document.body.style.overflow, h = document.getElementById(
232
+ v
233
+ );
234
+ let u = [];
235
+ const f = () => {
236
+ c = document.createElement("div"), c.id = v, Object.assign(c.style, nt, { background: i }), document.body.appendChild(c), y = document.createElement("div"), Object.assign(y.style, it), c.appendChild(y), r = document.createElement("div"), Object.assign(r.style, et), y.appendChild(r), o.forEach((p) => {
237
+ const w = document.createElement("div");
238
+ w.textContent = p, Object.assign(w.style, rt, a), r.appendChild(w);
239
+ }), u = Array.from(r.children).map(
240
+ (p) => p.getBoundingClientRect().width
241
+ );
242
+ };
243
+ return {
244
+ physics: s,
245
+ from: 0,
246
+ to: 1,
247
+ prepare: () => {
248
+ document.body.style.overflow = "hidden", e.style.opacity = "1", h == null || h.remove(), f(), c && y && (c.style.clipPath = "none", y.style.transform = "scale(1)");
249
+ },
250
+ tick: (p) => {
251
+ if (!(!c || !y || !r)) {
252
+ if (p <= A && o.length > 0) {
253
+ const w = p / A, g = Math.min(
254
+ Math.floor(w * o.length),
255
+ o.length - 1
256
+ ), b = u[g] ?? 0, m = ct(u.slice(0, g));
257
+ y.style.width = `${b}px`, r.style.transform = `translateX(-${m}px)`;
258
+ }
259
+ if (p > A) {
260
+ const g = 1 - Math.max(
261
+ 0,
262
+ Math.min(1, (p - A) / ot)
263
+ );
264
+ c.style.clipPath = lt(l, g), y.style.transform = `scale(${g})`;
265
+ }
266
+ }
267
+ },
268
+ onEnd: () => {
269
+ c == null || c.remove(), c = y = r = null, document.body.style.overflow = d;
270
+ }
271
+ };
272
+ }
151
273
  };
274
+ }, yt = {
275
+ inertia: {
276
+ acceleration: 50,
277
+ resistance: 1.5
278
+ }
279
+ }, ht = {
280
+ inertia: {
281
+ acceleration: 50,
282
+ resistance: 1
283
+ }
284
+ }, C = 0.05;
285
+ function S(t) {
286
+ const i = x(document.body, t.positionedParent), o = t.scroll.y, l = window.innerHeight - i.top;
287
+ return {
288
+ top: o,
289
+ left: 0,
290
+ width: i.width,
291
+ height: l
292
+ };
293
+ }
294
+ const Gt = (t = {}) => {
295
+ const { direction: i = "enter" } = t, o = t.physics ?? (i === "enter" ? yt : ht);
296
+ let { promise: l, resolve: a } = E();
152
297
  return i === "enter" ? {
153
- in: (o) => ({
154
- spring: a,
298
+ // Entering page: scales up from small (0.8 → 1) with fade in
299
+ in: (s, n) => {
300
+ const e = S(n), c = e.left + e.width / 2, y = e.top + e.height / 2;
301
+ return {
302
+ physics: o,
303
+ prepare: () => {
304
+ s.style.opacity = "0", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${c}px ${y}px`;
305
+ },
306
+ wait: async () => {
307
+ if (l) {
308
+ await l;
309
+ const r = E();
310
+ l = r.promise, a = r.resolve;
311
+ }
312
+ },
313
+ css: (r) => ({
314
+ transform: `scale(${1 - C + r * C})`,
315
+ opacity: r
316
+ }),
317
+ onEnd: () => {
318
+ s.style.opacity = "1", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
319
+ }
320
+ };
321
+ },
322
+ // Exiting page: scales up (1 → 1.2) with fade out, goes to back
323
+ out: (s, n) => {
324
+ const e = S(n), c = e.left + e.width / 2, y = e.top + e.height / 2 + n.scrollOffset.y;
325
+ return {
326
+ physics: o,
327
+ prepare: (r) => {
328
+ $(r, n), r.style.zIndex = "-1", r.style.willChange = "transform, opacity", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none", r.style.transformOrigin = `${c}px ${y}px`;
329
+ },
330
+ css: (r) => ({
331
+ transform: `scale(${1 + (1 - r) * C})`,
332
+ opacity: r
333
+ }),
334
+ onEnd: () => {
335
+ a && a();
336
+ }
337
+ };
338
+ }
339
+ } : {
340
+ // Entering page: scales down from large (1.2 → 1) with fade in
341
+ in: (s, n) => {
342
+ const e = S(n), c = e.left + e.width / 2, y = e.top + e.height / 2;
343
+ return {
344
+ physics: o,
345
+ prepare: () => {
346
+ s.style.opacity = "0", s.style.willChange = "transform, opacity", s.style.backfaceVisibility = "hidden", s.style.contain = "layout paint", s.style.transformOrigin = `${c}px ${y}px`;
347
+ },
348
+ wait: async () => {
349
+ if (l) {
350
+ await l;
351
+ const r = E();
352
+ l = r.promise, a = r.resolve;
353
+ }
354
+ },
355
+ css: (r) => ({
356
+ transform: `scale(${1 + C - r * C})`,
357
+ opacity: r
358
+ }),
359
+ onEnd: () => {
360
+ s.style.opacity = "1", s.style.willChange = "auto", s.style.backfaceVisibility = "", s.style.contain = "", s.style.transformOrigin = "";
361
+ }
362
+ };
363
+ },
364
+ // Exiting page: scales down to small (1 → 0.8) with fade out
365
+ out: (s, n) => {
366
+ const e = S(n), c = e.left + e.width / 2, y = e.top + e.height / 2 + n.scrollOffset.y;
367
+ return {
368
+ physics: o,
369
+ prepare: (r) => {
370
+ $(r, n), r.style.zIndex = "100", r.style.willChange = "transform, opacity", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none", r.style.transformOrigin = `${c}px ${y}px`;
371
+ },
372
+ css: (r) => ({
373
+ transform: `scale(${1 - (1 - r) * C})`,
374
+ opacity: r
375
+ }),
376
+ onEnd: () => {
377
+ a && a();
378
+ }
379
+ };
380
+ }
381
+ };
382
+ }, pt = {
383
+ inertia: {
384
+ acceleration: 20,
385
+ resistance: 1.5
386
+ }
387
+ }, dt = {
388
+ inertia: {
389
+ acceleration: 20,
390
+ resistance: 1
391
+ }
392
+ }, Zt = (t = {}) => {
393
+ const { opacity: i = !1, direction: o = "enter" } = t, l = t.physics ?? (o === "enter" ? pt : dt);
394
+ return o === "enter" ? {
395
+ in: (a) => ({
396
+ physics: l,
155
397
  prepare: () => {
156
- o.style.willChange = n ? "transform, opacity" : "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint";
398
+ a.style.willChange = i ? "transform, opacity" : "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint";
157
399
  },
158
- css: (c) => {
159
- const e = {
160
- transform: `translate3d(${(1 - c) * 100}%, 0, 0)`
400
+ css: (s) => {
401
+ const n = {
402
+ transform: `translate3d(${(1 - s) * 100}%, 0, 0)`
161
403
  };
162
- return n && (e.opacity = c), e;
404
+ return i && (n.opacity = s), n;
163
405
  },
164
406
  onEnd: () => {
165
- o.style.willChange = "auto", o.style.backfaceVisibility = "", o.style.contain = "";
407
+ a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transform = "", i && (a.style.opacity = "");
166
408
  }
167
409
  }),
168
- out: (o, c) => ({
169
- spring: a,
170
- prepare: (e) => {
171
- b(e, c), e.style.zIndex = "-1", e.style.willChange = n ? "transform, opacity" : "transform", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.pointerEvents = "none";
410
+ out: (a, s) => ({
411
+ physics: l,
412
+ prepare: (n) => {
413
+ $(n, s), n.style.zIndex = "-1", n.style.willChange = i ? "transform, opacity" : "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
172
414
  },
173
- css: (e) => {
174
- const g = {
175
- transform: `translate3d(${-(1 - e) * 20}%, 0, 0)`
415
+ css: (n) => {
416
+ const e = {
417
+ transform: `translate3d(${-(1 - n) * 20}%, 0, 0)`
176
418
  };
177
- return n && (g.opacity = e), g;
419
+ return i && (e.opacity = n), e;
178
420
  }
179
421
  })
180
422
  } : {
181
- in: (o) => ({
182
- spring: a,
423
+ in: (a) => ({
424
+ physics: l,
183
425
  prepare: () => {
184
- o.style.willChange = n ? "transform, opacity" : "transform", o.style.backfaceVisibility = "hidden", o.style.contain = "layout paint";
426
+ a.style.willChange = i ? "transform, opacity" : "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint";
185
427
  },
186
- css: (c) => {
187
- const e = {
188
- transform: `translate3d(${-(1 - c) * 20}%, 0, 0)`
428
+ css: (s) => {
429
+ const n = {
430
+ transform: `translate3d(${-(1 - s) * 20}%, 0, 0)`
189
431
  };
190
- return n && (e.opacity = c), e;
432
+ return i && (n.opacity = s), n;
191
433
  },
192
434
  onEnd: () => {
193
- o.style.willChange = "auto", o.style.backfaceVisibility = "", o.style.contain = "";
435
+ a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transform = "", i && (a.style.opacity = "");
194
436
  }
195
437
  }),
196
- out: (o, c) => ({
197
- spring: a,
198
- prepare: (e) => {
199
- b(e, c), e.style.zIndex = "100", e.style.willChange = n ? "transform, opacity" : "transform", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.pointerEvents = "none";
438
+ out: (a, s) => ({
439
+ physics: l,
440
+ prepare: (n) => {
441
+ $(n, s), n.style.zIndex = "100", n.style.willChange = i ? "transform, opacity" : "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
200
442
  },
201
- css: (e) => {
202
- const g = {
203
- transform: `translate3d(${(1 - e) * 100}%, 0, 0)`
443
+ css: (n) => {
444
+ const e = {
445
+ transform: `translate3d(${(1 - n) * 100}%, 0, 0)`
204
446
  };
205
- return n && (g.opacity = e), g;
447
+ return i && (e.opacity = n), e;
206
448
  }
207
449
  })
208
450
  };
209
- }, R = {
210
- stiffness: 180,
211
- damping: 20,
212
- doubleSpring: !0
213
- }, tt = {
214
- stiffness: 170,
215
- damping: 20,
216
- doubleSpring: !0
217
- }, nt = 0, Dt = (t = {}) => {
218
- const {
219
- inSpring: n = tt,
220
- outSpring: i = R,
221
- transitionDelay: d = nt
222
- } = t;
223
- let { promise: a, resolve: s } = T();
451
+ }, ut = {
452
+ spring: { stiffness: 180, damping: 20, doubleSpring: !0 }
453
+ }, ft = {
454
+ spring: { stiffness: 170, damping: 20, doubleSpring: !0 }
455
+ }, gt = 0, Jt = (t = {}) => {
456
+ const { transitionDelay: i = gt } = t, o = t.physics ?? ft, l = t.physics ?? ut;
457
+ let { promise: a, resolve: s } = E();
224
458
  return {
225
- in: (l) => ({
226
- spring: n,
459
+ in: (n) => ({
460
+ physics: o,
227
461
  prepare: () => {
228
- l.style.opacity = "0", l.style.willChange = "opacity";
462
+ n.style.opacity = "0", n.style.willChange = "opacity";
229
463
  },
230
464
  wait: async () => {
231
465
  if (a) {
232
466
  await a;
233
- const r = T();
234
- a = r.promise, s = r.resolve, await F(d);
467
+ const e = E();
468
+ a = e.promise, s = e.resolve, await V(i);
235
469
  }
236
470
  },
237
- css: (r) => ({
238
- opacity: r
471
+ css: (e) => ({
472
+ opacity: e
239
473
  }),
240
474
  onEnd: () => {
241
- l.style.willChange = "auto", l.style.opacity = "1";
475
+ n.style.willChange = "auto", n.style.opacity = "1";
242
476
  }
243
477
  }),
244
- out: (l, r) => ({
245
- spring: i,
246
- css: (o) => ({
247
- opacity: o
478
+ out: (n, e) => ({
479
+ physics: l,
480
+ css: (c) => ({
481
+ opacity: c
248
482
  }),
249
483
  prepare: () => {
250
- b(l, r), l.style.willChange = "opacity";
484
+ $(n, e), n.style.willChange = "opacity";
251
485
  },
252
486
  onEnd: () => {
253
- s && s(), l.style.willChange = "auto";
487
+ s && s(), n.style.willChange = "auto";
254
488
  }
255
489
  })
256
490
  };
257
- }, et = {
491
+ }, wt = {
258
492
  scaleDown: { stiffness: 20, damping: 7 },
259
493
  // Soft start for cinematic scale
260
494
  translate: { stiffness: 15, damping: 7 },
261
495
  // Medium for movement
262
496
  scaleUp: { stiffness: 20, damping: 7 }
263
497
  // Crisp return to full size
264
- }, E = {
498
+ }, O = {
265
499
  scaleDown: 0,
266
500
  // Start immediately
267
501
  translate: 0.2,
268
502
  // Start when scaleDown is 25% complete
269
503
  scaleUp: 0.8
270
504
  // Start when translate is 70% complete
271
- }, it = 0.8, st = "white", Pt = (t) => {
505
+ }, $t = 0.8, bt = "white", Kt = (t) => {
272
506
  var a;
273
- const n = et, i = it, d = ((a = t == null ? void 0 : t.border) == null ? void 0 : a.color) ?? st;
507
+ const i = wt, o = $t, l = ((a = t == null ? void 0 : t.border) == null ? void 0 : a.color) ?? bt;
274
508
  return {
275
- out: async (s, l) => {
276
- const r = k(l), o = x(document.body, l.positionedParent), c = at(d, {
277
- ...r,
278
- top: o.top
279
- }), e = {
509
+ out: async (s, n) => {
510
+ const e = _(n), c = x(document.body, n.positionedParent), y = Et(l, {
511
+ ...e,
512
+ top: c.top
513
+ }), r = {
280
514
  scale: 1,
281
- translateY: -r.top
282
- }, g = () => {
283
- s.style.transform = `translateY(${e.translateY}px) scale(${e.scale})`;
284
- const y = (r.width - r.width * e.scale) / 2, h = (r.height - r.height * e.scale) / 2;
285
- rt(c, y, h);
515
+ translateY: -e.top
516
+ }, d = () => {
517
+ s.style.transform = `translateY(${r.translateY}px) scale(${r.scale})`;
518
+ const h = (e.width - e.width * r.scale) / 2, u = (e.height - e.height * r.scale) / 2;
519
+ xt(y, h, u);
286
520
  };
287
521
  return {
288
522
  springs: [
289
523
  // Spring 1: Scale Down (1 → scale)
290
524
  {
291
- spring: n.scaleDown,
292
- offset: E.scaleDown,
293
- tick: (y) => {
294
- const h = 1 - y;
295
- e.scale = 1 - (1 - i) * h, g();
525
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleDown },
526
+ offset: O.scaleDown,
527
+ tick: (h) => {
528
+ const u = 1 - h;
529
+ r.scale = 1 - (1 - o) * u, d();
296
530
  }
297
531
  },
298
532
  // Spring 2: Translate (vertical movement)
299
533
  {
300
- spring: n.translate,
301
- offset: E.translate,
302
- tick: (y) => {
303
- const h = 1 - y;
304
- e.translateY = -r.top - r.height * h, g();
534
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.translate },
535
+ offset: O.translate,
536
+ tick: (h) => {
537
+ const u = 1 - h;
538
+ r.translateY = -e.top - e.height * u, d();
305
539
  }
306
540
  },
307
541
  // Spring 3: Scale Up (scale → 1)
308
542
  {
309
- spring: n.scaleUp,
310
- offset: E.scaleUp,
311
- tick: (y) => {
312
- const h = 1 - y;
313
- e.scale = i + (1 - i) * h, g();
543
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleUp },
544
+ offset: O.scaleUp,
545
+ tick: (h) => {
546
+ const u = 1 - h;
547
+ r.scale = o + (1 - o) * u, d();
314
548
  }
315
549
  }
316
550
  ],
317
551
  schedule: "stagger",
318
552
  prepare: () => {
319
- b(s), _(s, r), I(s, r), lt(s, r);
320
- for (const y of c)
321
- l.positionedParent.appendChild(y);
553
+ $(s), I(s, e), Y(s, e), mt(s, e);
554
+ for (const h of y)
555
+ n.positionedParent.appendChild(h);
322
556
  },
323
557
  onEnd: () => {
324
558
  s.style.clipPath = "", s.style.transformOrigin = "", setTimeout(() => {
325
- for (const y of c)
326
- l.positionedParent.removeChild(y);
559
+ for (const h of y)
560
+ n.positionedParent.removeChild(h);
327
561
  }, 1e3);
328
562
  }
329
563
  };
330
564
  },
331
- in: async (s, l) => {
332
- const r = k(l), o = {
333
- scale: i,
334
- translateY: -r.top + r.height
335
- }, c = () => {
336
- s.style.transform = `translateY(${o.translateY}px) scale(${o.scale})`;
565
+ in: async (s, n) => {
566
+ const e = _(n), c = {
567
+ scale: o,
568
+ translateY: -e.top + e.height
569
+ }, y = () => {
570
+ s.style.transform = `translateY(${c.translateY}px) scale(${c.scale})`;
337
571
  };
338
572
  return {
339
573
  springs: [
340
574
  // Spring 1: Scale Down (1 → scale) - element starts scaled, shrinks further
341
575
  {
342
- spring: n.scaleDown,
343
- offset: E.scaleDown,
344
- tick: (e) => {
345
- o.scale = 1 - (1 - i) * e, c();
576
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleDown },
577
+ offset: O.scaleDown,
578
+ tick: (r) => {
579
+ c.scale = 1 - (1 - o) * r, y();
346
580
  }
347
581
  },
348
582
  // Spring 2: Translate (vertical movement from bottom to top)
349
583
  {
350
- spring: n.translate,
351
- offset: E.translate,
352
- tick: (e) => {
353
- o.translateY = -r.top + r.height * (1 - e), c();
584
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.translate },
585
+ offset: O.translate,
586
+ tick: (r) => {
587
+ c.translateY = -e.top + e.height * (1 - r), y();
354
588
  }
355
589
  },
356
590
  // Spring 3: Scale Up (scale → 1) - element returns to full size
357
591
  {
358
- spring: n.scaleUp,
359
- offset: E.scaleUp,
360
- tick: (e) => {
361
- o.scale = i + (1 - i) * e, c();
592
+ physics: (t == null ? void 0 : t.physics) ?? { spring: i.scaleUp },
593
+ offset: O.scaleUp,
594
+ tick: (r) => {
595
+ c.scale = o + (1 - o) * r, y();
362
596
  }
363
597
  }
364
598
  ],
365
599
  schedule: "stagger",
366
600
  prepare: () => {
367
- _(s, r), I(s, r), s.style.transform = `translateY(${-r.top + r.height}px) scale(${i})`;
601
+ I(s, e), Y(s, e), s.style.transform = `translateY(${-e.top + e.height}px) scale(${o})`;
368
602
  },
369
603
  onEnd: () => {
370
604
  s.style.clipPath = "", s.style.transformOrigin = "", s.style.transform = "";
@@ -373,746 +607,910 @@ const N = { stiffness: 80, damping: 25 }, G = { stiffness: 75, damping: 25 }, q
373
607
  }
374
608
  };
375
609
  };
376
- function rt(t, n, i) {
377
- const d = n * 0.7, a = i * 0.7;
378
- t.topLeft.style.transform = `translate(${d}px, ${a}px)`, t.topRight.style.transform = `translate(${-d}px, ${a}px)`, t.bottomLeft.style.transform = `translate(${d}px, ${-a}px)`, t.bottomRight.style.transform = `translate(${-d}px, ${-a}px)`;
610
+ function xt(t, i, o) {
611
+ const l = i * 0.7, a = o * 0.7;
612
+ t.topLeft.style.transform = `translate(${l}px, ${a}px)`, t.topRight.style.transform = `translate(${-l}px, ${a}px)`, t.bottomLeft.style.transform = `translate(${l}px, ${-a}px)`, t.bottomRight.style.transform = `translate(${-l}px, ${-a}px)`;
379
613
  }
380
- function at(t = "white", n) {
614
+ function Et(t = "white", i) {
381
615
  const a = document.createElement("div");
382
- a.style.position = "fixed", a.style.pointerEvents = "none", a.style.zIndex = "9999", a.style.top = `${n.top - 1}px`, a.style.left = `${n.left - 1}px`, a.style.width = "15px", a.style.height = "15px";
616
+ a.style.position = "fixed", a.style.pointerEvents = "none", a.style.zIndex = "9999", a.style.top = `${i.top - 1}px`, a.style.left = `${i.left - 1}px`, a.style.width = "15px", a.style.height = "15px";
383
617
  const s = document.createElement("div");
384
618
  s.style.position = "absolute", s.style.width = "15px", s.style.height = "1px", s.style.backgroundColor = t, s.style.top = "0", s.style.left = "0";
385
- const l = document.createElement("div");
386
- l.style.position = "absolute", l.style.width = "1px", l.style.height = "15px", l.style.backgroundColor = t, l.style.top = "0", l.style.left = "0", a.appendChild(s), a.appendChild(l);
387
- const r = document.createElement("div");
388
- r.style.position = "fixed", r.style.pointerEvents = "none", r.style.zIndex = "9999", r.style.top = `${n.top - 1}px`, r.style.left = `${n.left + n.width - 15 + 1}px`, r.style.width = "15px", r.style.height = "15px";
389
- const o = document.createElement("div");
390
- o.style.position = "absolute", o.style.width = "15px", o.style.height = "1px", o.style.backgroundColor = t, o.style.top = "0", o.style.right = "0";
391
- const c = document.createElement("div");
392
- c.style.position = "absolute", c.style.width = "1px", c.style.height = "15px", c.style.backgroundColor = t, c.style.top = "0", c.style.right = "0", r.appendChild(o), r.appendChild(c);
619
+ const n = document.createElement("div");
620
+ n.style.position = "absolute", n.style.width = "1px", n.style.height = "15px", n.style.backgroundColor = t, n.style.top = "0", n.style.left = "0", a.appendChild(s), a.appendChild(n);
393
621
  const e = document.createElement("div");
394
- e.style.position = "fixed", e.style.pointerEvents = "none", e.style.zIndex = "9999", e.style.top = `${n.top + n.height - 15 + 1}px`, e.style.left = `${n.left - 1}px`, e.style.width = "15px", e.style.height = "15px";
395
- const g = document.createElement("div");
396
- g.style.position = "absolute", g.style.width = "15px", g.style.height = "1px", g.style.backgroundColor = t, g.style.bottom = "0", g.style.left = "0";
622
+ e.style.position = "fixed", e.style.pointerEvents = "none", e.style.zIndex = "9999", e.style.top = `${i.top - 1}px`, e.style.left = `${i.left + i.width - 15 + 1}px`, e.style.width = "15px", e.style.height = "15px";
623
+ const c = document.createElement("div");
624
+ c.style.position = "absolute", c.style.width = "15px", c.style.height = "1px", c.style.backgroundColor = t, c.style.top = "0", c.style.right = "0";
397
625
  const y = document.createElement("div");
398
- y.style.position = "absolute", y.style.width = "1px", y.style.height = "15px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.left = "0", e.appendChild(g), e.appendChild(y);
626
+ y.style.position = "absolute", y.style.width = "1px", y.style.height = "15px", y.style.backgroundColor = t, y.style.top = "0", y.style.right = "0", e.appendChild(c), e.appendChild(y);
627
+ const r = document.createElement("div");
628
+ r.style.position = "fixed", r.style.pointerEvents = "none", r.style.zIndex = "9999", r.style.top = `${i.top + i.height - 15 + 1}px`, r.style.left = `${i.left - 1}px`, r.style.width = "15px", r.style.height = "15px";
629
+ const d = document.createElement("div");
630
+ d.style.position = "absolute", d.style.width = "15px", d.style.height = "1px", d.style.backgroundColor = t, d.style.bottom = "0", d.style.left = "0";
399
631
  const h = document.createElement("div");
400
- h.style.position = "fixed", h.style.pointerEvents = "none", h.style.zIndex = "9999", h.style.top = `${n.top + n.height - 15 + 1}px`, h.style.left = `${n.left + n.width - 15 + 1}px`, h.style.width = "15px", h.style.height = "15px";
401
- const p = document.createElement("div");
402
- p.style.position = "absolute", p.style.width = "15px", p.style.height = "1px", p.style.backgroundColor = t, p.style.bottom = "0", p.style.right = "0";
632
+ h.style.position = "absolute", h.style.width = "1px", h.style.height = "15px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.left = "0", r.appendChild(d), r.appendChild(h);
403
633
  const u = document.createElement("div");
404
- return u.style.position = "absolute", u.style.width = "1px", u.style.height = "15px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.right = "0", h.appendChild(p), h.appendChild(u), {
634
+ u.style.position = "fixed", u.style.pointerEvents = "none", u.style.zIndex = "9999", u.style.top = `${i.top + i.height - 15 + 1}px`, u.style.left = `${i.left + i.width - 15 + 1}px`, u.style.width = "15px", u.style.height = "15px";
635
+ const f = document.createElement("div");
636
+ f.style.position = "absolute", f.style.width = "15px", f.style.height = "1px", f.style.backgroundColor = t, f.style.bottom = "0", f.style.right = "0";
637
+ const p = document.createElement("div");
638
+ return p.style.position = "absolute", p.style.width = "1px", p.style.height = "15px", p.style.backgroundColor = t, p.style.bottom = "0", p.style.right = "0", u.appendChild(f), u.appendChild(p), {
405
639
  topLeft: a,
406
- topRight: r,
407
- bottomLeft: e,
408
- bottomRight: h,
640
+ topRight: e,
641
+ bottomLeft: r,
642
+ bottomRight: u,
409
643
  *[Symbol.iterator]() {
410
- yield a, yield r, yield e, yield h;
644
+ yield a, yield e, yield r, yield u;
411
645
  }
412
646
  };
413
647
  }
414
- function k(t) {
415
- const n = x(document.body, t.positionedParent);
648
+ function _(t) {
649
+ const i = x(document.body, t.positionedParent);
416
650
  return {
417
651
  top: t.scroll.y,
418
652
  left: 0,
419
- width: n.width,
420
- height: window.innerHeight - n.top
653
+ width: i.width,
654
+ height: window.innerHeight - i.top
421
655
  };
422
656
  }
423
- function _(t, n) {
424
- const i = n.left + n.width / 2, d = n.top + n.height / 2;
425
- t.style.transformOrigin = `${i}px ${d}px`;
657
+ function I(t, i) {
658
+ const o = i.left + i.width / 2, l = i.top + i.height / 2;
659
+ t.style.transformOrigin = `${o}px ${l}px`;
426
660
  }
427
- function I(t, n) {
661
+ function Y(t, i) {
428
662
  t.style.clipPath = `polygon(
429
- ${n.left}px ${n.top}px,
430
- ${n.left + n.width}px ${n.top}px,
431
- ${n.left + n.width}px ${n.top + n.height}px,
432
- ${n.left}px ${n.top + n.height}px
663
+ ${i.left}px ${i.top}px,
664
+ ${i.left + i.width}px ${i.top}px,
665
+ ${i.left + i.width}px ${i.top + i.height}px,
666
+ ${i.left}px ${i.top + i.height}px
433
667
  )`;
434
668
  }
435
- function lt(t, n) {
436
- t.style.transform = `translateY(${-n.top}px)`;
669
+ function mt(t, i) {
670
+ t.style.transform = `translateY(${-i.top}px)`;
437
671
  }
438
- function ot(t, n) {
439
- return t.querySelector(`[data-hero-key="${n}"]`);
672
+ const Ct = {
673
+ spring: { stiffness: 300, damping: 30 }
674
+ };
675
+ function Ot(t, i) {
676
+ return t.querySelector(`[data-hero-key="${i}"]`);
440
677
  }
441
- const vt = (t = {}) => {
442
- var l, r;
443
- const n = {
444
- stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 300,
445
- damping: ((r = t.spring) == null ? void 0 : r.damping) ?? 30
446
- }, i = t.timeout ?? 300, d = t.maxDistance ?? 700;
678
+ const Qt = (t = {}) => {
679
+ const i = t.physics ?? Ct, o = t.timeout ?? 300, l = t.maxDistance ?? 700;
447
680
  let a = null, s = null;
448
681
  return {
449
- in: async (o, c) => {
450
- const e = o, g = Array.from(e.querySelectorAll("[data-hero-key]"));
451
- if (g.length === 0)
682
+ in: async (n, e) => {
683
+ const c = n, y = Array.from(c.querySelectorAll("[data-hero-key]"));
684
+ if (y.length === 0)
452
685
  return {
453
- spring: n,
686
+ physics: i,
454
687
  tick: () => {
455
688
  }
456
689
  // No hero elements, skip animation
457
690
  };
458
- if (!await new Promise((p) => {
459
- a ? p(!0) : (s = p, setTimeout(() => {
460
- s = null, p(!1);
461
- }, i));
691
+ if (!await new Promise((h) => {
692
+ a ? h(!0) : (s = h, setTimeout(() => {
693
+ s = null, h(!1);
694
+ }, o));
462
695
  }) || !a)
463
696
  return a = null, {
464
- spring: n,
697
+ physics: i,
465
698
  tick: () => {
466
699
  }
467
700
  // No fromNode, skip animation
468
701
  };
469
- const h = g.map((p) => {
470
- const u = p.getAttribute("data-hero-key");
702
+ const d = y.map((h) => {
703
+ const u = h.getAttribute("data-hero-key");
471
704
  if (!u) return null;
472
- const m = ot(a, u);
473
- if (!m) return null;
474
- const f = p, w = x(a, m), $ = x(e, f), Y = w.left - $.left - c.scrollOffset.x, U = w.top - $.top - c.scrollOffset.y, V = w.width / $.width, W = w.height / $.height, z = f.style.transform, X = f.style.position, M = f.style.transformOrigin, B = f.style.zIndex, H = f.style.willChange;
705
+ const f = Ot(a, u);
706
+ if (!f) return null;
707
+ const p = h, w = x(a, f), g = x(c, p), b = w.left - g.left - e.scrollOffset.x, m = w.top - g.top - e.scrollOffset.y, H = w.width / g.width, X = w.height / g.height, z = p.style.transform, M = p.style.position, W = p.style.transformOrigin, B = p.style.zIndex, q = p.style.willChange;
475
708
  return {
476
- toEl: f,
477
- dx: Y,
478
- dy: U,
479
- dw: V,
480
- dh: W,
709
+ toEl: p,
710
+ dx: b,
711
+ dy: m,
712
+ dw: H,
713
+ dh: X,
481
714
  originalTransform: z,
482
- originalPosition: X,
483
- originalTransformOrigin: M,
715
+ originalPosition: M,
716
+ originalTransformOrigin: W,
484
717
  originalZIndex: B,
485
- originalWillChange: H
718
+ originalWillChange: q
486
719
  };
487
720
  }).filter(
488
- (p) => p !== null && Math.abs(p.dy) <= d
721
+ (h) => h !== null && Math.abs(h.dy) <= l
489
722
  );
490
- return a = null, h.length === 0 ? {
491
- spring: n,
723
+ return a = null, d.length === 0 ? {
724
+ physics: i,
492
725
  tick: () => {
493
726
  }
494
727
  // No matching hero elements
495
728
  } : {
496
- springs: h.map(({ toEl: p, dx: u, dy: m, dw: f, dh: w }) => ({
497
- spring: n,
498
- tick: ($) => {
499
- p.style.transform = `translate(${(1 - $) * u}px, ${(1 - $) * m}px) scale(${$ + (1 - $) * f}, ${$ + (1 - $) * w})`;
729
+ springs: d.map(({ toEl: h, dx: u, dy: f, dw: p, dh: w }) => ({
730
+ physics: i,
731
+ tick: (g) => {
732
+ h.style.transform = `translate(${(1 - g) * u}px, ${(1 - g) * f}px) scale(${g + (1 - g) * p}, ${g + (1 - g) * w})`;
500
733
  }
501
734
  })),
502
735
  schedule: "parallel",
503
736
  prepare: () => {
504
- h.forEach(({ toEl: p }) => {
505
- p.style.position = "relative", p.style.transformOrigin = "top left", p.style.zIndex = "1000", p.style.willChange = "transform";
737
+ d.forEach(({ toEl: h }) => {
738
+ h.style.position = "relative", h.style.transformOrigin = "top left", h.style.zIndex = "1000", h.style.willChange = "transform";
506
739
  });
507
740
  },
508
741
  onEnd: () => {
509
- h.forEach(
742
+ d.forEach(
510
743
  ({
511
- toEl: p,
744
+ toEl: h,
512
745
  originalTransform: u,
513
- originalPosition: m,
514
- originalTransformOrigin: f,
746
+ originalPosition: f,
747
+ originalTransformOrigin: p,
515
748
  originalZIndex: w,
516
- originalWillChange: $
749
+ originalWillChange: g
517
750
  }) => {
518
- p.style.transform = u, p.style.position = m, p.style.transformOrigin = f, p.style.zIndex = w, p.style.willChange = $;
751
+ h.style.transform = u, h.style.position = f, h.style.transformOrigin = p, h.style.zIndex = w, h.style.willChange = g;
519
752
  }
520
753
  );
521
754
  }
522
755
  };
523
756
  },
524
- out: async (o) => ({
525
- spring: n,
757
+ out: async (n) => ({
758
+ physics: i,
526
759
  onStart: () => {
527
- a = o, s && (s(!0), s = null);
760
+ a = n, s && (s(!0), s = null);
528
761
  },
529
762
  tick: () => {
530
763
  },
531
- prepare: (c) => {
532
- b(c), c.style.opacity = "0";
764
+ prepare: (e) => {
765
+ $(e), e.style.opacity = "0";
533
766
  }
534
767
  })
535
768
  };
769
+ }, At = {
770
+ spring: { stiffness: 140, damping: 19, doubleSpring: 0.8 }
536
771
  };
537
- function ct({
772
+ function St({
538
773
  detailRect: t,
539
- galleryRect: n,
540
- pageRect: i,
541
- scrollOffset: d
774
+ galleryRect: i,
775
+ pageRect: o,
776
+ scrollOffset: l
542
777
  }) {
543
- const a = n.left - t.left + (n.width - t.width) / 2 - d.x, s = n.top - t.top + (n.height - t.height) / 2 - d.y, l = n.width / t.width, r = n.height / t.height, o = Math.max(l, r), c = t.top / i.height * 100, e = (i.width - (t.left + t.width)) / i.width * 100, g = (i.height - (t.top + t.height)) / i.height * 100, y = t.left / i.width * 100;
778
+ const a = i.left - t.left + (i.width - t.width) / 2 - l.x, s = i.top - t.top + (i.height - t.height) / 2 - l.y, n = i.width / t.width, e = i.height / t.height, c = Math.max(n, e), y = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, d = (o.height - (t.top + t.height)) / o.height * 100, h = t.left / o.width * 100;
544
779
  return {
545
780
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
546
- animate: (p) => {
547
- const u = 1 - p;
781
+ animate: (f) => {
782
+ const p = 1 - f;
548
783
  return {
549
- clipPath: `inset(${c * u}% ${e * u}% ${g * u}% ${y * u}%)`,
550
- transform: `translate(${a * u}px, ${s * u}px) scale(${1 + (o - 1) * u})`
784
+ clipPath: `inset(${y * p}% ${r * p}% ${d * p}% ${h * p}%)`,
785
+ transform: `translate(${a * p}px, ${s * p}px) scale(${1 + (c - 1) * p})`
551
786
  };
552
787
  }
553
788
  };
554
789
  }
555
- function dt({
790
+ function Tt({
556
791
  detailRect: t,
557
- galleryRect: n,
558
- pageRect: i,
559
- scrollOffset: d
792
+ galleryRect: i,
793
+ pageRect: o,
794
+ scrollOffset: l
560
795
  }) {
561
- const a = n.left - t.left + (n.width - t.width) / 2 + d.x, s = n.top - t.top + (n.height - t.height) / 2 + d.y, l = n.width / t.width, r = n.height / t.height, o = Math.min(l, r), c = t.top / i.height * 100, e = (i.width - (t.left + t.width)) / i.width * 100, g = (i.height - (t.top + t.height)) / i.height * 100, y = t.left / i.width * 100;
796
+ const a = i.left - t.left + (i.width - t.width) / 2 + l.x, s = i.top - t.top + (i.height - t.height) / 2 + l.y, n = i.width / t.width, e = i.height / t.height, c = Math.min(n, e), y = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, d = (o.height - (t.top + t.height)) / o.height * 100, h = t.left / o.width * 100;
562
797
  return {
563
798
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
564
- animate: (p) => {
565
- const u = 1 - p;
799
+ animate: (f) => {
800
+ const p = 1 - f;
566
801
  return {
567
- clipPath: `inset(${c * u}% ${e * u}% ${g * u}% ${y * u}%)`,
568
- transform: `translate(${a * u - d.x}px, ${s * u - d.y}px) scale(${1 + (o - 1) * u})`
802
+ clipPath: `inset(${y * p}% ${r * p}% ${d * p}% ${h * p}%)`,
803
+ transform: `translate(${a * p - l.x}px, ${s * p - l.y}px) scale(${1 + (c - 1) * p})`
569
804
  };
570
805
  }
571
806
  };
572
807
  }
573
- function pt(t, n, i) {
574
- const d = t.querySelector(
808
+ function kt(t, i, o) {
809
+ const l = t.querySelector(
575
810
  "[data-instagram-detail-key]"
576
- ), a = n.querySelector(
811
+ ), a = i.querySelector(
577
812
  "[data-instagram-detail-key]"
578
813
  );
579
- if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || n.querySelectorAll("[data-instagram-detail-key]").length > 1)
814
+ if (t.querySelectorAll("[data-instagram-detail-key]").length > 1 || i.querySelectorAll("[data-instagram-detail-key]").length > 1)
580
815
  return null;
581
- let s = null, l = null, r = !1;
582
- if (!d && a) {
583
- l = a;
584
- const e = l.getAttribute("data-instagram-detail-key");
585
- if (!e) return null;
816
+ let s = null, n = null, e = !1;
817
+ if (!l && a) {
818
+ n = a;
819
+ const r = n.getAttribute("data-instagram-detail-key");
820
+ if (!r) return null;
586
821
  s = t.querySelector(
587
- `[data-instagram-gallery-key="${e}"]`
588
- ), s && (r = !0);
589
- } else if (d && !a) {
590
- l = d;
591
- const e = l.getAttribute("data-instagram-detail-key");
592
- if (!e) return null;
593
- s = n.querySelector(
594
- `[data-instagram-gallery-key="${e}"]`
595
- ), s && (r = !1);
822
+ `[data-instagram-gallery-key="${r}"]`
823
+ ), s && (e = !0);
824
+ } else if (l && !a) {
825
+ n = l;
826
+ const r = n.getAttribute("data-instagram-detail-key");
827
+ if (!r) return null;
828
+ s = i.querySelector(
829
+ `[data-instagram-gallery-key="${r}"]`
830
+ ), s && (e = !1);
596
831
  }
597
- if (!s || !l)
832
+ if (!s || !n)
598
833
  return null;
599
- const o = x(r ? t : n, s), c = x(r ? n : t, l);
600
- if (r) {
601
- const e = ct({
602
- detailRect: c,
603
- galleryRect: o,
604
- pageRect: n.getBoundingClientRect(),
605
- scrollOffset: i
834
+ const c = x(e ? t : i, s), y = x(e ? i : t, n);
835
+ if (e) {
836
+ const r = St({
837
+ detailRect: y,
838
+ galleryRect: c,
839
+ pageRect: i.getBoundingClientRect(),
840
+ scrollOffset: o
606
841
  });
607
- return n.style.transformOrigin = e.transformOrigin, {
842
+ return i.style.transformOrigin = r.transformOrigin, {
608
843
  isEnterMode: !0,
609
- inAnimation: e.animate
844
+ inAnimation: r.animate
610
845
  // No outAnimation - gallery stays visible
611
846
  };
612
847
  } else {
613
- const e = dt({
614
- detailRect: c,
615
- galleryRect: o,
848
+ const r = Tt({
849
+ detailRect: y,
850
+ galleryRect: c,
616
851
  pageRect: t.getBoundingClientRect(),
617
- scrollOffset: i
852
+ scrollOffset: o
618
853
  });
619
- return t.style.transformOrigin = e.transformOrigin, {
854
+ return t.style.transformOrigin = r.transformOrigin, {
620
855
  isEnterMode: !1,
621
- outAnimation: e.animate
856
+ outAnimation: r.animate
622
857
  // No inAnimation - gallery stays visible
623
858
  };
624
859
  }
625
860
  }
626
- const Ft = (t = {}) => {
627
- var r, o, c;
628
- const n = {
629
- stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 150,
630
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? 20,
631
- doubleSpring: ((c = t.spring) == null ? void 0 : c.doubleSpring) ?? !0
632
- }, i = t.timeout ?? 300;
633
- let d = null, a = null, s = null, l = null;
861
+ const Rt = (t = {}) => {
862
+ const i = t.physics ?? At, o = t.timeout ?? 300;
863
+ let l = null, a = null, s = null, n = null;
634
864
  return {
635
- in: async (e, { scrollOffset: g }) => {
865
+ in: async (e, { scrollOffset: c }) => {
636
866
  const y = e;
637
- return !await new Promise((p) => {
638
- d ? p(!0) : (a = p, setTimeout(() => {
639
- a = null, p(!1);
640
- }, i));
641
- }) || !d ? (l == null || l(), l = null, d = null, {
642
- spring: n,
867
+ return !await new Promise((d) => {
868
+ l ? d(!0) : (a = d, setTimeout(() => {
869
+ a = null, d(!1);
870
+ }, o));
871
+ }) || !l ? (n == null || n(), n = null, l = null, {
872
+ physics: i,
643
873
  css: () => ({})
644
- }) : (s = pt(d, y, g), l == null || l(), l = null, s ? (d = null, {
645
- spring: n,
646
- css: (p) => s != null && s.inAnimation ? s.inAnimation(p) : {}
647
- }) : (d = null, {
648
- spring: n,
874
+ }) : (s = kt(l, y, c), n == null || n(), n = null, s ? (l = null, {
875
+ physics: i,
876
+ css: (d) => s != null && s.inAnimation ? s.inAnimation(d) : {}
877
+ }) : (l = null, {
878
+ physics: i,
649
879
  css: () => ({})
650
880
  }));
651
881
  },
652
- out: async (e, g) => {
653
- const y = new Promise((h) => {
654
- l = h;
882
+ out: async (e, c) => {
883
+ const y = new Promise((r) => {
884
+ n = r;
655
885
  });
656
886
  return {
657
- spring: n,
658
- prepare: (h) => {
659
- s != null && s.isEnterMode ? b(h) : (b(h, g), h.style.zIndex = "-1");
887
+ physics: i,
888
+ prepare: (r) => {
889
+ s != null && s.isEnterMode ? $(r) : ($(r, c), r.style.zIndex = "-1");
660
890
  },
661
891
  wait: async () => {
662
- d = e, a && (a(!0), a = null), await y;
892
+ l = e, a && (a(!0), a = null), await y;
663
893
  },
664
- css: (h) => s != null && s.outAnimation ? s.outAnimation(h) : {}
894
+ css: (r) => s != null && s.outAnimation ? s.outAnimation(r) : {}
665
895
  };
666
896
  }
667
897
  };
898
+ }, Pt = {
899
+ spring: { stiffness: 50, damping: 30 }
668
900
  };
669
- function ht({
901
+ function Lt(t) {
902
+ const i = x(document.body, t.positionedParent);
903
+ return {
904
+ top: t.scroll.y,
905
+ left: 0,
906
+ width: i.width,
907
+ height: window.innerHeight - i.top
908
+ };
909
+ }
910
+ const ts = (t = {}) => {
911
+ const i = t.physics ?? Pt, o = t.initialRotation ?? 45, l = t.initialScale ?? 0.01, a = t.rotationTriggerPoint ?? 0.8;
912
+ return {
913
+ out: async (s, n) => {
914
+ const e = s.style.opacity;
915
+ return {
916
+ physics: {
917
+ spring: {
918
+ stiffness: 80,
919
+ damping: 25
920
+ }
921
+ },
922
+ from: 1,
923
+ to: 0,
924
+ prepare: () => {
925
+ $(s, n), s.style.opacity = "1";
926
+ },
927
+ tick: (c) => {
928
+ s.style.opacity = String(c);
929
+ },
930
+ onEnd: () => {
931
+ s.style.opacity = e;
932
+ }
933
+ };
934
+ },
935
+ in: async (s, n) => {
936
+ const e = Lt(n), c = s.style.transform, y = s.style.transformOrigin, r = s.style.position, d = s.style.zIndex;
937
+ return {
938
+ physics: i,
939
+ from: 0,
940
+ to: 1,
941
+ prepare: () => {
942
+ const h = Math.min(e.width, e.height) * 0.4;
943
+ s.style.setProperty(
944
+ "--max-border-radius",
945
+ `${h}px`
946
+ ), s.style.setProperty("--border-radius-scale", "1"), s.style.willChange = "transform", s.style.backfaceVisibility = "hidden";
947
+ const u = e.left + e.width / 2, f = e.top + e.height / 2;
948
+ s.style.transformOrigin = `${u}px ${f}px`, s.style.position = "fixed", s.style.top = `${e.top}px`, s.style.left = `${e.left}px`, s.style.width = `${e.width}px`, s.style.height = `${e.height}px`, s.style.zIndex = "1000", s.style.overflow = "hidden", s.style.transform = `rotate(${o}deg) scale(${l}) translateZ(0)`, s.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", s.style.opacity = "1";
949
+ },
950
+ tick: (h) => {
951
+ let u;
952
+ if (h <= 0.05)
953
+ u = l;
954
+ else if (h <= a) {
955
+ const g = (h - 0.05) / (a - 0.05), b = Math.pow(g, 9);
956
+ u = l + (0.8 - l) * b;
957
+ } else {
958
+ const g = (h - a) / (1 - a);
959
+ u = 0.8 + 0.2 * (1 - Math.pow(1 - g, 3));
960
+ }
961
+ let f;
962
+ const p = 0.7;
963
+ if (h <= p)
964
+ f = o;
965
+ else {
966
+ const g = (h - p) / (1 - p), b = 1 - Math.pow(1 - g, 2);
967
+ f = o * (1 - b);
968
+ }
969
+ let w;
970
+ if (h <= p)
971
+ w = 1;
972
+ else {
973
+ const g = (h - p) / (1 - p);
974
+ w = 1 - Math.pow(g, 0.5);
975
+ }
976
+ s.style.transform = `rotate(${f.toFixed(2)}deg) scale(${u.toFixed(4)}) translateZ(0)`, s.style.setProperty(
977
+ "--border-radius-scale",
978
+ w.toFixed(4)
979
+ );
980
+ },
981
+ onEnd: () => {
982
+ s.style.willChange = "", s.style.backfaceVisibility = "", s.style.removeProperty("--max-border-radius"), s.style.removeProperty("--border-radius-scale"), s.style.transform = c, s.style.transformOrigin = y, s.style.position = r, s.style.zIndex = d, s.style.top = "", s.style.left = "", s.style.width = "", s.style.height = "", s.style.overflow = "", s.style.borderRadius = "";
983
+ }
984
+ };
985
+ }
986
+ };
987
+ }, vt = {
988
+ spring: { stiffness: 140, damping: 19, doubleSpring: 0.7 }
989
+ };
990
+ function _t({
670
991
  detailRect: t,
671
- galleryRect: n,
672
- pageRect: i,
673
- scrollOffset: d
992
+ galleryRect: i,
993
+ pageRect: o,
994
+ scrollOffset: l
674
995
  }) {
675
- const a = n.left - t.left + (n.width - t.width) / 2 - d.x, s = n.top - t.top + (n.height - t.height) / 2 - d.y, l = n.width / t.width, r = n.height / t.height, o = Math.max(l, r), c = t.top / i.height * 100, e = (i.width - (t.left + t.width)) / i.width * 100, g = (i.height - (t.top + t.height)) / i.height * 100, y = t.left / i.width * 100;
996
+ const a = i.left - t.left + (i.width - t.width) / 2 - l.x, s = i.top - t.top + (i.height - t.height) / 2 - l.y, n = i.width / t.width, e = i.height / t.height, c = Math.max(n, e), y = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, d = (o.height - (t.top + t.height)) / o.height * 100, h = t.left / o.width * 100;
676
997
  return {
677
998
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
678
- animate: (p) => {
679
- const u = 1 - p;
999
+ animate: (f) => {
1000
+ const p = 1 - f;
680
1001
  return {
681
- clipPath: `inset(${c * u}% ${e * u}% ${g * u}% ${y * u}%)`,
682
- transform: `translate(${a * u}px, ${s * u}px) scale(${1 + (o - 1) * u})`
1002
+ clipPath: `inset(${y * p}% ${r * p}% ${d * p}% ${h * p}%)`,
1003
+ transform: `translate(${a * p}px, ${s * p}px) scale(${1 + (c - 1) * p})`
683
1004
  };
684
1005
  }
685
1006
  };
686
1007
  }
687
- function yt({
1008
+ function It({
688
1009
  galleryRect: t,
689
- detailRect: n,
690
- scrollOffset: i
1010
+ detailRect: i,
1011
+ scrollOffset: o
691
1012
  }) {
692
- const d = n.left - t.left + (n.width - t.width) / 2 + i.x, a = n.top - t.top + (n.height - t.height) / 2 + i.y, s = n.width / t.width, l = n.height / t.height, r = Math.max(s, l);
1013
+ const l = i.left - t.left + (i.width - t.width) / 2 + o.x, a = i.top - t.top + (i.height - t.height) / 2 + o.y, s = i.width / t.width, n = i.height / t.height, e = Math.max(s, n);
693
1014
  return {
694
1015
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
695
- animate: (c) => {
696
- const e = 1 - c;
1016
+ animate: (y) => {
1017
+ const r = 1 - y;
697
1018
  return {
698
- transform: `translate(${d * e - i.x}px, ${a * e - i.y}px) scale(${1 + (r - 1) * e})`,
699
- opacity: `${1 - e}`
1019
+ transform: `translate(${l * r - o.x}px, ${a * r - o.y}px) scale(${1 + (e - 1) * r})`,
1020
+ opacity: `${1 - r}`
700
1021
  };
701
1022
  }
702
1023
  };
703
1024
  }
704
- function gt({
1025
+ function Yt({
705
1026
  galleryRect: t,
706
- detailRect: n,
707
- scrollOffset: i
1027
+ detailRect: i,
1028
+ scrollOffset: o
708
1029
  }) {
709
- const d = n.left - t.left + (n.width - t.width) / 2 - i.x, a = n.top - t.top + (n.height - t.height) / 2 - i.y, s = n.width / t.width, l = n.height / t.height, r = Math.max(s, l);
1030
+ const l = i.left - t.left + (i.width - t.width) / 2 - o.x, a = i.top - t.top + (i.height - t.height) / 2 - o.y, s = i.width / t.width, n = i.height / t.height, e = Math.max(s, n);
710
1031
  return {
711
1032
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
712
- animate: (c) => {
713
- const e = 1 - c, g = c;
1033
+ animate: (y) => {
1034
+ const r = 1 - y, d = y;
714
1035
  return {
715
- transform: `translate(${d * e}px, ${a * e}px) scale(${1 + (r - 1) * e})`,
716
- opacity: `${g}`
1036
+ transform: `translate(${l * r}px, ${a * r}px) scale(${1 + (e - 1) * r})`,
1037
+ opacity: `${d}`
717
1038
  };
718
1039
  }
719
1040
  };
720
1041
  }
721
- function ut({
1042
+ function Ft({
722
1043
  detailRect: t,
723
- galleryRect: n,
724
- pageRect: i,
725
- scrollOffset: d
1044
+ galleryRect: i,
1045
+ pageRect: o,
1046
+ scrollOffset: l
726
1047
  }) {
727
- const a = n.left - t.left + (n.width - t.width) / 2 + d.x, s = n.top - t.top + (n.height - t.height) / 2 + d.y, l = n.width / t.width, r = n.height / t.height, o = Math.min(l, r), c = t.top / i.height * 100, e = (i.width - (t.left + t.width)) / i.width * 100, g = (i.height - (t.top + t.height)) / i.height * 100, y = t.left / i.width * 100;
1048
+ const a = i.left - t.left + (i.width - t.width) / 2 + l.x, s = i.top - t.top + (i.height - t.height) / 2 + l.y, n = i.width / t.width, e = i.height / t.height, c = Math.min(n, e), y = t.top / o.height * 100, r = (o.width - (t.left + t.width)) / o.width * 100, d = (o.height - (t.top + t.height)) / o.height * 100, h = t.left / o.width * 100;
728
1049
  return {
729
1050
  transformOrigin: `${t.left + t.width / 2}px ${t.top + t.height / 2}px`,
730
- animate: (p) => {
731
- const u = 1 - p;
1051
+ animate: (f) => {
1052
+ const p = 1 - f;
732
1053
  return {
733
- clipPath: `inset(${c * u}% ${e * u}% ${g * u}% ${y * u}%)`,
734
- transform: `translate(${a * u - d.x}px, ${s * u - d.y}px) scale(${1 + (o - 1) * u})`
1054
+ clipPath: `inset(${y * p}% ${r * p}% ${d * p}% ${h * p}%)`,
1055
+ transform: `translate(${a * p - l.x}px, ${s * p - l.y}px) scale(${1 + (c - 1) * p})`
735
1056
  };
736
1057
  }
737
1058
  };
738
1059
  }
739
- function ft(t, n, i) {
740
- const d = t.querySelector(
1060
+ function Dt(t, i, o) {
1061
+ const l = t.querySelector(
741
1062
  "[data-pinterest-detail-key]"
742
- ), a = n.querySelector(
1063
+ ), a = i.querySelector(
743
1064
  "[data-pinterest-detail-key]"
744
1065
  );
745
- if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || n.querySelectorAll("[data-pinterest-detail-key]").length > 1)
1066
+ if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || i.querySelectorAll("[data-pinterest-detail-key]").length > 1)
746
1067
  return null;
747
- let s = null, l = null, r = !1;
748
- if (!d && a) {
749
- l = a;
750
- const e = l.getAttribute("data-pinterest-detail-key");
751
- if (!e) return null;
1068
+ let s = null, n = null, e = !1;
1069
+ if (!l && a) {
1070
+ n = a;
1071
+ const r = n.getAttribute("data-pinterest-detail-key");
1072
+ if (!r) return null;
752
1073
  s = t.querySelector(
753
- `[data-pinterest-gallery-key="${e}"]`
754
- ), s && (r = !0);
755
- } else if (d && !a) {
756
- l = d;
757
- const e = l.getAttribute("data-pinterest-detail-key");
758
- if (!e) return null;
759
- s = n.querySelector(
760
- `[data-pinterest-gallery-key="${e}"]`
761
- ), s && (r = !1);
1074
+ `[data-pinterest-gallery-key="${r}"]`
1075
+ ), s && (e = !0);
1076
+ } else if (l && !a) {
1077
+ n = l;
1078
+ const r = n.getAttribute("data-pinterest-detail-key");
1079
+ if (!r) return null;
1080
+ s = i.querySelector(
1081
+ `[data-pinterest-gallery-key="${r}"]`
1082
+ ), s && (e = !1);
762
1083
  }
763
- if (!s || !l)
1084
+ if (!s || !n)
764
1085
  return null;
765
- const o = x(r ? t : n, s), c = x(r ? n : t, l);
766
- if (r) {
767
- const e = ht({
768
- detailRect: c,
769
- galleryRect: o,
770
- pageRect: n.getBoundingClientRect(),
771
- scrollOffset: i
772
- }), g = yt({
773
- galleryRect: o,
774
- detailRect: c,
775
- scrollOffset: i
1086
+ const c = x(e ? t : i, s), y = x(e ? i : t, n);
1087
+ if (e) {
1088
+ const r = _t({
1089
+ detailRect: y,
1090
+ galleryRect: c,
1091
+ pageRect: i.getBoundingClientRect(),
1092
+ scrollOffset: o
1093
+ }), d = It({
1094
+ galleryRect: c,
1095
+ detailRect: y,
1096
+ scrollOffset: o
776
1097
  });
777
- return n.style.transformOrigin = e.transformOrigin, t.style.transformOrigin = g.transformOrigin, {
778
- inAnimation: e.animate,
779
- outAnimation: g.animate
1098
+ return i.style.transformOrigin = r.transformOrigin, t.style.transformOrigin = d.transformOrigin, {
1099
+ inAnimation: r.animate,
1100
+ outAnimation: d.animate
780
1101
  };
781
1102
  } else {
782
- const e = gt({
783
- galleryRect: o,
784
- detailRect: c,
785
- scrollOffset: i
786
- }), g = ut({
787
- detailRect: c,
788
- galleryRect: o,
1103
+ const r = Yt({
1104
+ galleryRect: c,
1105
+ detailRect: y,
1106
+ scrollOffset: o
1107
+ }), d = Ft({
1108
+ detailRect: y,
1109
+ galleryRect: c,
789
1110
  pageRect: t.getBoundingClientRect(),
790
- scrollOffset: i
1111
+ scrollOffset: o
791
1112
  });
792
- return n.style.transformOrigin = e.transformOrigin, t.style.transformOrigin = g.transformOrigin, {
793
- inAnimation: e.animate,
794
- outAnimation: g.animate
1113
+ return i.style.transformOrigin = r.transformOrigin, t.style.transformOrigin = d.transformOrigin, {
1114
+ inAnimation: r.animate,
1115
+ outAnimation: d.animate
795
1116
  };
796
1117
  }
797
1118
  }
798
- const Yt = (t = {}) => {
799
- var r, o, c;
800
- const n = {
801
- stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 30,
802
- damping: ((o = t.spring) == null ? void 0 : o.damping) ?? 10,
803
- doubleSpring: ((c = t.spring) == null ? void 0 : c.doubleSpring) ?? !0
804
- }, i = t.timeout ?? 300;
805
- let d = null, a = null, s = null, l = null;
1119
+ const ss = (t = {}) => {
1120
+ const i = t.physics ?? vt, o = t.timeout ?? 300;
1121
+ let l = null, a = null, s = null, n = null;
806
1122
  return {
807
- in: async (e, { scrollOffset: g }) => {
1123
+ in: async (e, { scrollOffset: c }) => {
808
1124
  const y = e;
809
- return !await new Promise((p) => {
810
- d ? p(!0) : (a = p, setTimeout(() => {
811
- a = null, p(!1);
812
- }, i));
813
- }) || !d ? (l == null || l(), l = null, d = null, {
814
- spring: n,
1125
+ return !await new Promise((d) => {
1126
+ l ? d(!0) : (a = d, setTimeout(() => {
1127
+ a = null, d(!1);
1128
+ }, o));
1129
+ }) || !l ? (n == null || n(), n = null, l = null, {
1130
+ physics: i,
815
1131
  css: () => ({})
816
- }) : (s = ft(d, y, g), l == null || l(), l = null, s ? (d = null, {
817
- spring: n,
818
- css: (p) => s ? s.inAnimation(p) : {}
819
- }) : (d = null, {
820
- spring: n,
1132
+ }) : (s = Dt(l, y, c), n == null || n(), n = null, s ? (l = null, {
1133
+ physics: i,
1134
+ css: (d) => s ? s.inAnimation(d) : {}
1135
+ }) : (l = null, {
1136
+ physics: i,
821
1137
  css: () => ({})
822
1138
  }));
823
1139
  },
824
1140
  out: async (e) => {
825
- const g = new Promise((y) => {
826
- l = y;
1141
+ const c = new Promise((y) => {
1142
+ n = y;
827
1143
  });
828
1144
  return {
829
- spring: n,
1145
+ physics: i,
830
1146
  prepare: (y) => {
831
- b(y), y.style.zIndex = "-1";
1147
+ $(y), y.style.zIndex = "-1";
832
1148
  },
833
1149
  wait: async () => {
834
- d = e, a && (a(!0), a = null), await g;
1150
+ l = e, a && (a(!0), a = null), await c;
835
1151
  },
836
1152
  css: (y) => s ? s.outAnimation(y) : {}
837
1153
  };
838
1154
  }
839
1155
  };
840
- }, O = { stiffness: 100, damping: 30 }, Ut = () => ({
841
- in: (t) => ({
842
- spring: O,
843
- prepare: () => {
844
- t.style.opacity = "0", t.style.transform = "rotate(-180deg)", t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
845
- },
846
- css: (n) => ({
847
- // -180deg → 0deg, show after 90deg (progress > 0.5)
848
- transform: `rotate(${(n - 1) * 180}deg)`,
849
- opacity: n > 0.5 ? 1 : 0
850
- }),
851
- onEnd: () => {
852
- t.style.willChange = "auto", t.style.transform = "", t.style.transformOrigin = "", t.style.opacity = "";
853
- }
854
- }),
855
- out: (t, n) => ({
856
- spring: O,
857
- prepare: () => {
858
- b(t, n), t.style.transformOrigin = "center center", t.style.willChange = "transform, opacity";
859
- },
860
- css: (i) => ({
861
- // 0deg → 180deg, hide after 90deg (progress < 0.5)
862
- transform: `rotate(${(1 - i) * 180}deg)`,
863
- opacity: i > 0.5 ? 1 : 0
1156
+ }, Ut = {
1157
+ spring: { stiffness: 100, damping: 30 }
1158
+ }, ns = (t = {}) => {
1159
+ const i = t.physics ?? Ut;
1160
+ return {
1161
+ in: (o) => ({
1162
+ physics: i,
1163
+ prepare: () => {
1164
+ o.style.opacity = "0", o.style.transform = "rotate(-180deg)", o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
1165
+ },
1166
+ css: (l) => ({
1167
+ // -180deg → 0deg, show after 90deg (progress > 0.5)
1168
+ transform: `rotate(${(l - 1) * 180}deg)`,
1169
+ opacity: l > 0.5 ? 1 : 0
1170
+ }),
1171
+ onEnd: () => {
1172
+ o.style.willChange = "auto", o.style.transform = "", o.style.transformOrigin = "", o.style.opacity = "";
1173
+ }
864
1174
  }),
865
- onEnd: () => {
866
- t.style.willChange = "auto";
867
- }
868
- })
869
- }), D = {
870
- stiffness: 5,
871
- damping: 4
872
- }, Vt = (t = {}) => {
873
- var o, c;
874
- const n = t.direction ?? "up", i = {
875
- stiffness: ((o = t.spring) == null ? void 0 : o.stiffness) ?? D.stiffness,
876
- damping: ((c = t.spring) == null ? void 0 : c.damping) ?? D.damping
877
- }, d = n === "up";
878
- let a = null, s = null, l = null;
879
- const r = () => {
1175
+ out: (o, l) => ({
1176
+ physics: i,
1177
+ prepare: () => {
1178
+ $(o, l), o.style.transformOrigin = "center center", o.style.willChange = "transform, opacity";
1179
+ },
1180
+ css: (a) => ({
1181
+ // 0deg → 180deg, hide after 90deg (progress < 0.5)
1182
+ transform: `rotate(${(1 - a) * 180}deg)`,
1183
+ opacity: a > 0.5 ? 1 : 0
1184
+ }),
1185
+ onEnd: () => {
1186
+ o.style.willChange = "auto";
1187
+ }
1188
+ })
1189
+ };
1190
+ }, Vt = {
1191
+ spring: { stiffness: 5, damping: 4 }
1192
+ }, is = (t = {}) => {
1193
+ const i = t.direction ?? "up", o = t.physics ?? Vt, l = i === "up";
1194
+ let a = null, s = null, n = null;
1195
+ const e = () => {
880
1196
  if (a === null || s === null)
881
1197
  return null;
882
- const e = Math.min(a, s), g = window.innerHeight;
883
- return Math.max(e, g);
1198
+ const c = Math.min(a, s), y = window.innerHeight;
1199
+ return Math.max(c, y);
884
1200
  };
885
1201
  return {
886
- in: (e) => (s = e.offsetHeight, a !== null && (l = r()), {
887
- spring: i,
1202
+ in: (c) => (s = c.offsetHeight, a !== null && (n = e()), {
1203
+ physics: o,
888
1204
  prepare: () => {
889
- e.style.willChange = "transform", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint";
1205
+ c.style.willChange = "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint";
890
1206
  },
891
- tick: (g) => {
892
- l === null && (l = r());
893
- const y = l ?? window.innerHeight, h = d ? (1 - g) * y : (1 - g) * -y;
894
- e.style.transform = `translate3d(0, ${h}px, 0)`;
1207
+ tick: (y) => {
1208
+ n === null && (n = e());
1209
+ const r = n ?? window.innerHeight, d = l ? (1 - y) * r : (1 - y) * -r;
1210
+ c.style.transform = `translate3d(0, ${d}px, 0)`;
895
1211
  },
896
1212
  onEnd: () => {
897
- e.style.willChange = "auto", e.style.backfaceVisibility = "", e.style.contain = "";
1213
+ c.style.willChange = "auto", c.style.backfaceVisibility = "", c.style.contain = "";
898
1214
  }
899
1215
  }),
900
- out: (e, g) => ({
901
- spring: i,
1216
+ out: (c, y) => ({
1217
+ physics: o,
902
1218
  onStart: () => {
903
- a = e.offsetHeight, s !== null && (l = r());
1219
+ a = c.offsetHeight, s !== null && (n = e());
904
1220
  },
905
- tick: (y) => {
906
- l === null && (l = r());
907
- const h = l ?? window.innerHeight, p = d ? (1 - y) * -h : (1 - y) * h;
908
- e.style.transform = `translate3d(0, ${p}px, 0)`;
1221
+ tick: (r) => {
1222
+ n === null && (n = e());
1223
+ const d = n ?? window.innerHeight, h = l ? (1 - r) * -d : (1 - r) * d;
1224
+ c.style.transform = `translate3d(0, ${h}px, 0)`;
909
1225
  },
910
- prepare: (y) => {
911
- b(y, g), y.style.zIndex = d ? "-1" : "1", y.style.willChange = "transform", y.style.backfaceVisibility = "hidden", y.style.contain = "layout paint", y.style.pointerEvents = "none";
1226
+ prepare: (r) => {
1227
+ $(r, y), r.style.zIndex = l ? "-1" : "1", r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint", r.style.pointerEvents = "none";
912
1228
  }
913
1229
  })
914
1230
  };
915
- }, S = {
916
- stiffness: 15,
917
- damping: 7,
918
- doubleSpring: !0
919
- }, Wt = (t = {}) => {
920
- var a, s, l;
921
- const n = t.direction ?? "left", i = {
922
- stiffness: ((a = t.spring) == null ? void 0 : a.stiffness) ?? S.stiffness,
923
- damping: ((s = t.spring) == null ? void 0 : s.damping) ?? S.damping,
924
- doubleSpring: ((l = t.spring) == null ? void 0 : l.doubleSpring) ?? S.doubleSpring
925
- }, d = n === "left";
1231
+ }, Ht = {
1232
+ inertia: {
1233
+ acceleration: 20,
1234
+ resistance: 1.5
1235
+ }
1236
+ }, Xt = {
1237
+ inertia: {
1238
+ acceleration: 20,
1239
+ resistance: 1
1240
+ }
1241
+ };
1242
+ function T(t) {
1243
+ const i = x(document.body, t.positionedParent), o = t.scroll.y, l = window.innerHeight - i.top;
1244
+ return {
1245
+ top: o,
1246
+ left: 0,
1247
+ width: i.width,
1248
+ height: l
1249
+ };
1250
+ }
1251
+ const es = (t = {}) => {
1252
+ const { direction: i = "enter" } = t, o = t.physics ?? (i === "enter" ? Ht : Xt);
1253
+ return i === "enter" ? {
1254
+ // Entering sheet: slides up from bottom
1255
+ in: (l, a) => {
1256
+ const n = T(a).height;
1257
+ return {
1258
+ physics: o,
1259
+ prepare: () => {
1260
+ l.style.willChange = "transform", l.style.backfaceVisibility = "hidden", l.style.contain = "layout paint";
1261
+ },
1262
+ css: (e) => ({
1263
+ transform: `translate3d(0, ${(1 - e) * n}px, 0)`
1264
+ }),
1265
+ onEnd: () => {
1266
+ l.style.willChange = "auto", l.style.backfaceVisibility = "", l.style.contain = "";
1267
+ }
1268
+ };
1269
+ },
1270
+ // Exiting background: scales down with fade
1271
+ out: (l, a) => {
1272
+ const s = T(a), n = s.left + s.width / 2, e = s.top + s.height / 2 + a.scrollOffset.y;
1273
+ return {
1274
+ physics: o,
1275
+ prepare: (c) => {
1276
+ $(c, a), c.style.zIndex = "-1", c.style.willChange = "transform, opacity", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint", c.style.pointerEvents = "none", c.style.transformOrigin = `${n}px ${e}px`;
1277
+ },
1278
+ css: (c) => ({
1279
+ transform: `scale(${0.8 + c * 0.2})`,
1280
+ opacity: c
1281
+ })
1282
+ };
1283
+ }
1284
+ } : {
1285
+ // Entering background: scales up with fade
1286
+ in: (l, a) => {
1287
+ const s = T(a), n = s.left + s.width / 2, e = s.top + s.height / 2;
1288
+ return {
1289
+ physics: o,
1290
+ prepare: () => {
1291
+ l.style.willChange = "transform, opacity", l.style.backfaceVisibility = "hidden", l.style.contain = "layout paint", l.style.transformOrigin = `${n}px ${e}px`;
1292
+ },
1293
+ css: (c) => ({
1294
+ transform: `scale(${0.8 + c * 0.2})`,
1295
+ opacity: c
1296
+ }),
1297
+ onEnd: () => {
1298
+ l.style.willChange = "auto", l.style.backfaceVisibility = "", l.style.contain = "", l.style.transformOrigin = "";
1299
+ }
1300
+ };
1301
+ },
1302
+ // Exiting sheet: slides down with high z-index
1303
+ out: (l, a) => {
1304
+ const n = T(a).height;
1305
+ return {
1306
+ physics: o,
1307
+ prepare: (e) => {
1308
+ $(e, a), e.style.zIndex = "100", e.style.willChange = "transform", e.style.backfaceVisibility = "hidden", e.style.contain = "layout paint", e.style.pointerEvents = "none";
1309
+ },
1310
+ css: (e) => ({
1311
+ transform: `translate3d(0, ${(1 - e) * n}px, 0)`
1312
+ })
1313
+ };
1314
+ }
1315
+ };
1316
+ }, zt = {
1317
+ spring: {
1318
+ stiffness: 140,
1319
+ damping: 19,
1320
+ doubleSpring: 0.8
1321
+ }
1322
+ }, rs = (t = {}) => {
1323
+ const i = t.direction ?? "left", o = t.physics ?? zt, l = i === "left";
926
1324
  return {
927
- in: (r) => ({
928
- spring: i,
1325
+ in: (a) => ({
1326
+ physics: o,
929
1327
  prepare: () => {
930
- r.style.willChange = "transform", r.style.backfaceVisibility = "hidden", r.style.contain = "layout paint";
1328
+ a.style.willChange = "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint";
931
1329
  },
932
- css: (o) => ({
933
- transform: `translate3d(${d ? (1 - o) * 100 : (1 - o) * -100}%, 0, 0)`
1330
+ css: (s) => ({
1331
+ transform: `translate3d(${l ? (1 - s) * 100 : (1 - s) * -100}%, 0, 0)`
934
1332
  }),
935
1333
  onEnd: () => {
936
- r.style.willChange = "auto", r.style.backfaceVisibility = "", r.style.contain = "";
1334
+ a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "";
937
1335
  }
938
1336
  }),
939
- out: (r, o) => ({
940
- spring: i,
941
- css: (c) => ({
942
- transform: `translate3d(${d ? (1 - c) * -100 : (1 - c) * 100}%, 0, 0)`
1337
+ out: (a, s) => ({
1338
+ physics: o,
1339
+ css: (n) => ({
1340
+ transform: `translate3d(${l ? (1 - n) * -100 : (1 - n) * 100}%, 0, 0)`
943
1341
  }),
944
- prepare: (c) => {
945
- b(c, o), c.style.willChange = "transform", c.style.backfaceVisibility = "hidden", c.style.contain = "layout paint", c.style.pointerEvents = "none";
1342
+ prepare: (n) => {
1343
+ $(n, s), n.style.willChange = "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
1344
+ }
1345
+ })
1346
+ };
1347
+ }, k = 6, F = 0, D = 1, Mt = {
1348
+ inertia: {
1349
+ acceleration: 50,
1350
+ resistance: 1.5
1351
+ }
1352
+ }, as = (t = {}) => {
1353
+ const i = t.direction ?? "left", o = t.physics ?? Mt, l = i === "left";
1354
+ let { promise: a, resolve: s } = E();
1355
+ return {
1356
+ // Entering page: fades in + slides from opposite direction
1357
+ in: (n) => ({
1358
+ physics: o,
1359
+ prepare: () => {
1360
+ n.style.opacity = "0", n.style.willChange = "transform, opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint";
1361
+ },
1362
+ wait: async () => {
1363
+ if (a) {
1364
+ await a;
1365
+ const e = E();
1366
+ a = e.promise, s = e.resolve;
1367
+ }
1368
+ },
1369
+ css: (e) => {
1370
+ const c = l ? (1 - e) * k : (1 - e) * -k, y = D + e * (1 - D);
1371
+ return {
1372
+ transform: `translate3d(${c}px, 0, 0)`,
1373
+ opacity: y
1374
+ };
1375
+ },
1376
+ onEnd: () => {
1377
+ n.style.opacity = "1", n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "";
1378
+ }
1379
+ }),
1380
+ // Exiting page: fade out + slide in same direction as navigation
1381
+ out: (n, e) => ({
1382
+ physics: o,
1383
+ prepare: () => {
1384
+ $(n, e), n.style.willChange = "transform, opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
1385
+ },
1386
+ css: (c) => {
1387
+ const y = l ? (1 - c) * -k : (1 - c) * k, r = F + c * (1 - F);
1388
+ return {
1389
+ transform: `translate3d(${y}px, 0, 0)`,
1390
+ opacity: r
1391
+ };
1392
+ },
1393
+ onEnd: () => {
1394
+ s && s(), n.style.willChange = "auto", n.style.backfaceVisibility = "", n.style.contain = "";
946
1395
  }
947
1396
  })
948
1397
  };
949
- }, P = { stiffness: 17, damping: 6 }, L = 20, C = 800, zt = () => {
950
- let t, n = null;
1398
+ }, Wt = {
1399
+ spring: { stiffness: 17, damping: 6 }
1400
+ }, L = 20, P = 800, os = (t = {}) => {
1401
+ const i = t.physics ?? Wt;
1402
+ let o, l = null;
951
1403
  return {
952
- in: (i) => ({
953
- spring: P,
1404
+ in: (a) => ({
1405
+ physics: i,
954
1406
  prepare: () => {
955
- i.style.willChange = "transform", i.style.backfaceVisibility = "hidden", i.style.contain = "layout paint", i.style.transform = `perspective(${C}px) rotateY(${L}deg) translate3d(-100%, 0, 0)`;
1407
+ a.style.willChange = "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.transform = `perspective(${P}px) rotateY(${L}deg) translate3d(-100%, 0, 0)`;
956
1408
  },
957
1409
  wait: async () => {
958
- t && await t;
1410
+ o && await o;
959
1411
  },
960
- css: (d) => {
961
- const a = (1 - d) * L, s = -(1 - d) * 100;
1412
+ css: (s) => {
1413
+ const n = (1 - s) * L, e = -(1 - s) * 100;
962
1414
  return {
963
- transform: `perspective(${C}px) rotateY(${a}deg) translate3d(${s}%, 0, 0)`
1415
+ transform: `perspective(${P}px) rotateY(${n}deg) translate3d(${e}%, 0, 0)`
964
1416
  };
965
1417
  },
966
1418
  onEnd: () => {
967
- i.style.transform = "", i.style.willChange = "auto", i.style.backfaceVisibility = "", i.style.contain = "";
1419
+ a.style.transform = "", a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "";
968
1420
  }
969
1421
  }),
970
- out: (i, d) => (t = new Promise((a) => {
971
- n = a;
1422
+ out: (a, s) => (o = new Promise((n) => {
1423
+ l = n;
972
1424
  }), {
973
- spring: P,
974
- prepare: (a) => {
975
- b(a, d), a.style.willChange = "transform", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.pointerEvents = "none", a.style.transform = `perspective(${C}px) rotateY(0deg) translate3d(0%, 0, 0)`;
1425
+ physics: i,
1426
+ prepare: (n) => {
1427
+ $(n, s), n.style.willChange = "transform", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none", n.style.transform = `perspective(${P}px) rotateY(0deg) translate3d(0%, 0, 0)`;
976
1428
  },
977
- css: (a) => {
978
- const s = 1 - a, l = s * L, r = s * 100;
1429
+ css: (n) => {
1430
+ const e = 1 - n, c = e * L, y = e * 100;
979
1431
  return {
980
- transform: `perspective(${C}px) rotateY(${-l}deg) translate3d(${r}%, 0, 0)`
1432
+ transform: `perspective(${P}px) rotateY(${-c}deg) translate3d(${y}%, 0, 0)`
981
1433
  };
982
1434
  },
983
1435
  onEnd: () => {
984
- n && n(), i.style.transform = "";
1436
+ l && l(), a.style.transform = "";
985
1437
  }
986
1438
  })
987
1439
  };
988
- }, $t = { stiffness: 1, damping: 1 }, mt = { stiffness: 20, damping: 25 }, wt = "#000000", bt = "circle", v = "CURTAIN_REVEAL_OVERLAY_ID", xt = {
989
- position: "fixed",
990
- inset: "0",
991
- width: "100vw",
992
- height: "100%",
993
- zIndex: "9999",
994
- display: "flex",
995
- alignItems: "center",
996
- justifyContent: "center",
997
- overflow: "hidden"
998
- }, Et = {
999
- position: "relative",
1000
- display: "inline-block",
1001
- height: "5.5rem",
1002
- overflow: "hidden"
1003
- }, Ct = {
1004
- display: "flex",
1005
- height: "100%",
1006
- willChange: "transform",
1007
- transition: "transform 0.3s ease"
1008
- }, At = {
1009
- display: "inline-flex",
1010
- alignItems: "center",
1011
- justifyContent: "center",
1012
- whiteSpace: "nowrap",
1013
- fontSize: "5.5rem",
1014
- fontWeight: "900",
1015
- letterSpacing: "0.02em",
1016
- color: "#FFFFFF"
1017
- }, St = 0.4, A = 0.5, Lt = 0.2;
1018
- function Tt(t, n) {
1019
- switch (t) {
1020
- case "circle":
1021
- return `circle(${n * 100}% at 50% 50%)`;
1022
- case "square":
1023
- return `inset(${(1 - n) * 50}% round ${10 * n}%)`;
1024
- case "triangle": {
1025
- const i = n * 100;
1026
- return `polygon(50% ${50 - i}%, ${50 - i}% ${50 + i}%, ${50 + i}% ${50 + i}%)`;
1027
- }
1440
+ }, Bt = {
1441
+ inertia: {
1442
+ acceleration: 50,
1443
+ resistance: 1.5
1028
1444
  }
1445
+ }, U = 0.05;
1446
+ function qt(t) {
1447
+ const i = x(document.body, t.positionedParent), o = t.scroll.y, l = window.innerHeight - i.top;
1448
+ return {
1449
+ top: o,
1450
+ left: 0,
1451
+ width: i.width,
1452
+ height: l
1453
+ };
1029
1454
  }
1030
- const kt = (t) => t.reduce((n, i) => n + i, 0), Xt = (t = {}) => {
1031
- const {
1032
- background: n = wt,
1033
- texts: i = [],
1034
- shape: d = bt,
1035
- inSpring: a = mt,
1036
- outSpring: s = $t,
1037
- textStyle: l = {}
1038
- } = t;
1455
+ const ls = (t = {}) => {
1456
+ const i = t.physics ?? Bt;
1457
+ let { promise: o, resolve: l } = E();
1039
1458
  return {
1040
- out: (r, o) => {
1041
- const c = r.style.opacity;
1459
+ // Entering page: scales up from small (0.95 → 1) with fade in
1460
+ in: (a, s) => {
1461
+ const n = qt(s), e = n.left + n.width / 2, c = n.top + n.height / 2;
1042
1462
  return {
1043
- spring: s,
1044
- from: 1,
1045
- to: 0,
1046
- prepare: (e) => {
1047
- b(e, o), e.style.opacity = "1";
1048
- },
1049
- tick: (e) => {
1050
- const g = Math.max(0, e - St);
1051
- r.style.opacity = String(g);
1052
- },
1053
- onEnd: () => {
1054
- r.style.opacity = c;
1055
- }
1056
- };
1057
- },
1058
- in: (r) => {
1059
- let o = null, c = null, e = null;
1060
- const g = document.body.style.overflow, y = document.getElementById(
1061
- v
1062
- );
1063
- let h = [];
1064
- const p = () => {
1065
- o = document.createElement("div"), o.id = v, Object.assign(o.style, xt, { background: n }), document.body.appendChild(o), c = document.createElement("div"), Object.assign(c.style, Et), o.appendChild(c), e = document.createElement("div"), Object.assign(e.style, Ct), c.appendChild(e), i.forEach((u) => {
1066
- const m = document.createElement("div");
1067
- m.textContent = u, Object.assign(m.style, At, l), e.appendChild(m);
1068
- }), h = Array.from(e.children).map(
1069
- (u) => u.getBoundingClientRect().width
1070
- );
1071
- };
1072
- return {
1073
- spring: a,
1074
- from: 0,
1075
- to: 1,
1463
+ physics: i,
1076
1464
  prepare: () => {
1077
- document.body.style.overflow = "hidden", r.style.opacity = "1", y == null || y.remove(), p(), o && c && (o.style.clipPath = "none", c.style.transform = "scale(1)");
1465
+ a.style.opacity = "0", a.style.willChange = "transform, opacity", a.style.backfaceVisibility = "hidden", a.style.contain = "layout paint", a.style.transformOrigin = `${e}px ${c}px`;
1078
1466
  },
1079
- tick: (u) => {
1080
- if (!(!o || !c || !e)) {
1081
- if (u <= A && i.length > 0) {
1082
- const m = u / A, f = Math.min(
1083
- Math.floor(m * i.length),
1084
- i.length - 1
1085
- ), w = h[f] ?? 0, $ = kt(h.slice(0, f));
1086
- c.style.width = `${w}px`, e.style.transform = `translateX(-${$}px)`;
1087
- }
1088
- if (u > A) {
1089
- const f = 1 - Math.max(
1090
- 0,
1091
- Math.min(1, (u - A) / Lt)
1092
- );
1093
- o.style.clipPath = Tt(d, f), c.style.transform = `scale(${f})`;
1094
- }
1467
+ wait: async () => {
1468
+ if (o) {
1469
+ await o;
1470
+ const y = E();
1471
+ o = y.promise, l = y.resolve;
1095
1472
  }
1096
1473
  },
1474
+ css: (y) => ({
1475
+ transform: `scale(${1 - U + y * U})`,
1476
+ opacity: y
1477
+ }),
1097
1478
  onEnd: () => {
1098
- o == null || o.remove(), o = c = e = null, document.body.style.overflow = g;
1479
+ a.style.opacity = "1", a.style.willChange = "auto", a.style.backfaceVisibility = "", a.style.contain = "", a.style.transformOrigin = "";
1099
1480
  }
1100
1481
  };
1101
- }
1482
+ },
1483
+ // Exiting page: fade out only (no scale)
1484
+ out: (a, s) => ({
1485
+ physics: i,
1486
+ prepare: (n) => {
1487
+ $(n, s), n.style.willChange = "opacity", n.style.backfaceVisibility = "hidden", n.style.contain = "layout paint", n.style.pointerEvents = "none";
1488
+ },
1489
+ css: (n) => ({
1490
+ opacity: n
1491
+ }),
1492
+ onEnd: () => {
1493
+ l && l();
1494
+ }
1495
+ })
1102
1496
  };
1103
1497
  };
1104
1498
  export {
1105
- It as blind,
1106
- Xt as curtainReveal,
1107
- Ot as drill,
1108
- Dt as fade,
1109
- Pt as film,
1110
- vt as hero,
1111
- Ft as instagram,
1112
- Ht as jaemin,
1113
- Yt as pinterest,
1114
- Ut as rotate,
1115
- Vt as scroll,
1116
- Wt as slide,
1117
- zt as strip
1499
+ Nt as blind,
1500
+ jt as curtainReveal,
1501
+ Gt as depth,
1502
+ Zt as drill,
1503
+ Jt as fade,
1504
+ Kt as film,
1505
+ Qt as hero,
1506
+ Rt as instagram,
1507
+ ts as jaemin,
1508
+ ss as pinterest,
1509
+ ns as rotate,
1510
+ is as scroll,
1511
+ es as sheet,
1512
+ rs as slide,
1513
+ as as snap,
1514
+ os as strip,
1515
+ ls as swap
1118
1516
  };