@ssgoi/core 2.5.0 → 2.5.2

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.
@@ -1,23 +1,20 @@
1
- import { p as b, g as A } from "../jaemin-BAi8PTrj.js";
2
- import { a as Lt } from "../jaemin-BAi8PTrj.js";
3
- const N = (t) => new Promise((e) => setTimeout(e, t)), B = { stiffness: 80, damping: 25 }, G = { stiffness: 75, damping: 25 }, M = 300, q = 10, V = "horizontal", j = "#000000", pt = (t = {}) => {
1
+ import { p as b, g as T } from "../jaemin-BAi8PTrj.js";
2
+ import { a as Wt } from "../jaemin-BAi8PTrj.js";
3
+ const G = (t) => new Promise((e) => setTimeout(e, t)), M = { stiffness: 80, damping: 25 }, V = { stiffness: 75, damping: 25 }, q = 300, j = 10, K = "horizontal", Z = "#000000", St = (t = {}) => {
4
4
  const {
5
- inSpring: e = G,
6
- outSpring: o = B,
7
- transitionDelay: a = M,
8
- blindCount: i = q,
9
- direction: s = V,
10
- staggerDelay: r = 100,
11
- blindColor: n = j
5
+ inSpring: e = V,
6
+ outSpring: r = M,
7
+ transitionDelay: c = q,
8
+ blindCount: s = j,
9
+ direction: o = K,
10
+ staggerDelay: l = 100,
11
+ blindColor: n = Z
12
12
  } = t;
13
- let l, c = null;
14
- const d = (y, p, h, g = !1) => {
15
- const f = Math.min(0.5, r * h / 1e3), $ = 1 - f, x = (g ? h - 1 - p : p) / h * f, w = x + $;
16
- return y <= x ? 0 : y >= w ? 1 : (y - x) / $;
17
- }, u = (y, p, h = "left") => {
18
- window.getComputedStyle(y).position === "static" && (y.style.position = "relative");
19
- const f = document.createElement("div");
20
- f.className = "blind-container", f.style.cssText = `
13
+ let i, d = null;
14
+ const a = (h, g, y = "left") => {
15
+ window.getComputedStyle(h).position === "static" && (h.style.position = "relative");
16
+ const p = document.createElement("div");
17
+ p.className = "blind-container", p.style.cssText = `
21
18
  position: absolute;
22
19
  top: 0;
23
20
  left: 0;
@@ -27,330 +24,328 @@ const N = (t) => new Promise((e) => setTimeout(e, t)), B = { stiffness: 80, damp
27
24
  z-index: 9999;
28
25
  overflow: hidden;
29
26
  `;
30
- const $ = [];
31
- for (let m = 0; m < i; m++) {
32
- const x = document.createElement("div");
33
- if (s === "horizontal") {
34
- const w = 100 / i, S = `calc(${w}% + 1px)`;
35
- x.style.cssText = `
27
+ const f = [];
28
+ for (let $ = 0; $ < s; $++) {
29
+ const m = document.createElement("div");
30
+ if (o === "horizontal") {
31
+ const x = 100 / s, S = `calc(${x}% + 1px)`;
32
+ m.style.cssText = `
36
33
  position: absolute;
37
- top: ${w * m}%;
34
+ top: ${x * $}%;
38
35
  left: 0;
39
36
  width: 100%;
40
37
  height: ${S};
41
38
  background: ${n};
42
- transform: scaleX(${p === "hidden" ? 0 : 1});
43
- transform-origin: ${h} center;
39
+ transform: scaleX(${g === "hidden" ? 0 : 1});
40
+ transform-origin: ${y} center;
44
41
  will-change: transform;
45
42
  `;
46
43
  } else {
47
- const w = 100 / i, S = `calc(${w}% + 1px)`;
48
- x.style.cssText = `
44
+ const x = 100 / s, S = `calc(${x}% + 1px)`;
45
+ m.style.cssText = `
49
46
  position: absolute;
50
47
  top: 0;
51
- left: ${w * m}%;
48
+ left: ${x * $}%;
52
49
  width: ${S};
53
50
  height: 100%;
54
51
  background: ${n};
55
- transform: scaleY(${p === "hidden" ? 0 : 1});
56
- transform-origin: ${h === "left" ? "top" : "bottom"} center;
52
+ transform: scaleY(${g === "hidden" ? 0 : 1});
53
+ transform-origin: ${y === "left" ? "top" : "bottom"} center;
57
54
  will-change: transform;
58
55
  `;
59
56
  }
60
- $.push(x), f.appendChild(x);
57
+ f.push(m), p.appendChild(m);
61
58
  }
62
- return y.appendChild(f), { container: f, blinds: $ };
59
+ return h.appendChild(p), { container: p, blinds: f };
63
60
  };
64
61
  return {
65
62
  out: () => {
66
- let y = null;
67
- return l = new Promise((p) => {
68
- c = p;
63
+ let h = null;
64
+ return i = new Promise((y) => {
65
+ d = y;
69
66
  }), {
70
- spring: o,
71
- prepare: (p) => {
72
- b(p), p.style.zIndex = "1000", y = u(p, "hidden", "left");
67
+ springs: Array.from({ length: s }, (y, u) => ({
68
+ from: 0,
69
+ to: 1,
70
+ spring: r,
71
+ offset: u * l,
72
+ tick: (p) => {
73
+ if (!h) return;
74
+ const f = h.blinds[u];
75
+ f && (o === "horizontal" ? f.style.transform = `scaleX(${p})` : f.style.transform = `scaleY(${p})`);
76
+ }
77
+ })),
78
+ schedule: "chain",
79
+ prepare: (y) => {
80
+ b(y), y.style.zIndex = "1000", h = a(y, "hidden", "left");
73
81
  },
74
82
  onStart: () => {
75
83
  },
76
- tick: (p) => {
77
- if (!y) return;
78
- const h = 1 - p;
79
- y.blinds.forEach((g, f) => {
80
- const $ = d(
81
- h,
82
- f,
83
- i,
84
- !1
85
- // not reversed - left to right
86
- );
87
- s === "horizontal" ? g.style.transform = `scaleX(${$})` : g.style.transform = `scaleY(${$})`;
88
- });
89
- },
90
84
  onEnd: () => {
91
- c && c();
85
+ d && d();
92
86
  }
93
87
  };
94
88
  },
95
89
  in: () => {
96
- let y = null;
90
+ let h = null;
97
91
  return {
98
- spring: e,
99
- prepare: (p) => {
100
- p.style.position = "relative", p.style.zIndex = "0", y = u(p, "closed", "right");
92
+ springs: Array.from({ length: s }, (y, u) => ({
93
+ from: 1,
94
+ to: 0,
95
+ spring: e,
96
+ offset: u * l,
97
+ tick: (p) => {
98
+ if (!h) return;
99
+ const f = h.blinds[u];
100
+ f && (o === "horizontal" ? f.style.transform = `scaleX(${p})` : f.style.transform = `scaleY(${p})`);
101
+ }
102
+ })),
103
+ schedule: "chain",
104
+ prepare: (y) => {
105
+ y.style.position = "relative", y.style.zIndex = "0", h = a(y, "closed", "right");
101
106
  },
102
107
  onStart: () => {
103
108
  },
104
109
  wait: async () => {
105
- l && await l, await N(a);
106
- },
107
- tick: (p) => {
108
- y && y.blinds.forEach((h, g) => {
109
- const f = d(
110
- p,
111
- g,
112
- i,
113
- !1
114
- // same direction as OUT - left to right
115
- );
116
- s === "horizontal" ? h.style.transform = `scaleX(${1 - f})` : h.style.transform = `scaleY(${1 - f})`;
117
- });
110
+ i && await i, await G(c);
118
111
  },
119
112
  onEnd: () => {
120
- y && y.container && y.container.remove();
113
+ h && h.container && h.container.remove();
121
114
  }
122
115
  };
123
116
  }
124
117
  };
125
- }, yt = (t = {}) => {
126
- var i, s;
127
- const { opacity: e = !1, direction: o = "enter" } = t, a = {
128
- stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? 150,
129
- damping: ((s = t.spring) == null ? void 0 : s.damping) ?? 20
118
+ }, _t = (t = {}) => {
119
+ var s, o;
120
+ const { opacity: e = !1, direction: r = "enter" } = t, c = {
121
+ stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? 150,
122
+ damping: ((o = t.spring) == null ? void 0 : o.damping) ?? 20
130
123
  };
131
- return o === "enter" ? {
132
- in: (r) => ({
133
- spring: a,
124
+ return r === "enter" ? {
125
+ in: (l) => ({
126
+ spring: c,
134
127
  tick: (n) => {
135
- r.style.transform = `translateX(${(1 - n) * 100}%)`, e && (r.style.opacity = n.toString());
128
+ l.style.transform = `translateX(${(1 - n) * 100}%)`, e && (l.style.opacity = n.toString());
136
129
  }
137
130
  }),
138
- out: (r, n) => ({
139
- spring: a,
140
- prepare: (l) => {
141
- b(l, n), l.style.zIndex = "-1";
131
+ out: (l, n) => ({
132
+ spring: c,
133
+ prepare: (i) => {
134
+ b(i, n), i.style.zIndex = "-1";
142
135
  },
143
- tick: (l) => {
144
- r.style.transform = `translateX(${-(1 - l) * 20}%)`, e && (r.style.opacity = l.toString());
136
+ tick: (i) => {
137
+ l.style.transform = `translateX(${-(1 - i) * 20}%)`, e && (l.style.opacity = i.toString());
145
138
  }
146
139
  })
147
140
  } : {
148
- in: (r) => ({
141
+ in: (l) => ({
149
142
  spring: {
150
143
  stiffness: 100,
151
144
  damping: 20
152
145
  },
153
146
  tick: (n) => {
154
- r.style.transform = `translateX(${-(1 - n) * 20}%)`, e && (r.style.opacity = n.toString());
147
+ l.style.transform = `translateX(${-(1 - n) * 20}%)`, e && (l.style.opacity = n.toString());
155
148
  }
156
149
  }),
157
- out: (r, n) => ({
150
+ out: (l, n) => ({
158
151
  spring: {
159
152
  stiffness: 100,
160
153
  damping: 20
161
154
  },
162
- prepare: (l) => {
163
- b(l, n), l.style.zIndex = "100";
155
+ prepare: (i) => {
156
+ b(i, n), i.style.zIndex = "100";
164
157
  },
165
- tick: (l) => {
166
- r.style.transform = `translateX(${(1 - l) * 100}%)`, e && (r.style.opacity = l.toString());
158
+ tick: (i) => {
159
+ l.style.transform = `translateX(${(1 - i) * 100}%)`, e && (l.style.opacity = i.toString());
167
160
  }
168
161
  })
169
162
  };
170
- }, Z = (t) => new Promise((e) => setTimeout(e, t)), J = { stiffness: 400, damping: 20 }, K = { stiffness: 40, damping: 8 }, Q = 100, ut = (t = {}) => {
163
+ }, J = (t) => new Promise((e) => setTimeout(e, t)), Q = { stiffness: 7, damping: 4 }, R = { stiffness: 8, damping: 4 }, tt = 0, Ct = (t = {}) => {
171
164
  const {
172
- inSpring: e = K,
173
- outSpring: o = J,
174
- transitionDelay: a = Q
165
+ inSpring: e = R,
166
+ outSpring: r = Q,
167
+ transitionDelay: c = tt
175
168
  } = t;
176
- let i, s = null;
169
+ let s, o = null;
177
170
  return {
178
- in: (r) => ({
171
+ in: (l) => ({
179
172
  spring: e,
180
173
  prepare: (n) => {
181
- n.style.opacity = "0";
174
+ n.style.opacity = "0", n.style.willChange = "opacity";
182
175
  },
183
176
  wait: async () => {
184
- i && (await i, await Z(a));
177
+ s && (await s, await J(c));
185
178
  },
186
179
  tick: (n) => {
187
- r.style.opacity = n.toString();
180
+ l.style.opacity = n.toString();
188
181
  }
189
182
  }),
190
- out: (r, n) => (i = new Promise((l) => {
191
- s = l;
183
+ out: (l, n) => (s = new Promise((i) => {
184
+ o = i;
192
185
  }), {
193
- spring: o,
194
- tick: (l) => {
195
- r.style.opacity = l.toString();
186
+ spring: r,
187
+ tick: (i) => {
188
+ l.style.opacity = i.toString();
189
+ },
190
+ prepare: (i) => {
191
+ b(i, n), i.style.willChange = "opacity";
196
192
  },
197
- prepare: (l) => b(l, n),
198
193
  onEnd: () => {
199
- s && s();
194
+ o && o();
200
195
  }
201
196
  })
202
197
  };
203
- }, R = {
198
+ }, et = {
204
199
  stiffness: 5,
205
200
  // Lower stiffness for smoother motion
206
201
  damping: 3.5
207
202
  // Lower damping for more fluid movement
208
- }, tt = 0.8, et = "white", E = {
203
+ }, nt = 0.8, it = "white", w = {
209
204
  start: 0,
210
205
  end: 0.45
211
- }, L = {
206
+ }, E = {
212
207
  start: 0.85,
213
208
  end: 1
214
- }, k = {
209
+ }, L = {
215
210
  start: 0.2,
216
211
  end: 0.9
217
- }, gt = (t) => {
218
- var i;
219
- const e = (t == null ? void 0 : t.spring) ?? R, o = (t == null ? void 0 : t.scale) ?? tt, a = ((i = t == null ? void 0 : t.border) == null ? void 0 : i.color) ?? et;
212
+ }, kt = (t) => {
213
+ var s;
214
+ const e = (t == null ? void 0 : t.spring) ?? et, r = (t == null ? void 0 : t.scale) ?? nt, c = ((s = t == null ? void 0 : t.border) == null ? void 0 : s.color) ?? it;
220
215
  return {
221
- out: async (s, r) => {
222
- const n = I(r), l = A(document.body, r.positionedParent), c = it(a, {
216
+ out: async (o, l) => {
217
+ const n = P(l), i = T(document.body, l.positionedParent), d = rt(c, {
223
218
  ...n,
224
- top: l.top
219
+ top: i.top
225
220
  });
226
- let d = 1, u = -n.top;
221
+ let a = 1, h = -n.top;
227
222
  return {
228
223
  spring: e,
229
224
  prepare: () => {
230
- b(s), D(s, n), v(s, n), st(s, n);
231
- for (const y of c)
232
- r.positionedParent.appendChild(y);
225
+ b(o), I(o, n), D(o, n), ot(o, n);
226
+ for (const g of d)
227
+ l.positionedParent.appendChild(g);
233
228
  },
234
229
  onEnd: () => {
235
- s.style.clipPath = "", s.style.transformOrigin = "", setTimeout(() => {
236
- for (const y of c)
237
- r.positionedParent.removeChild(y);
230
+ o.style.clipPath = "", o.style.transformOrigin = "", setTimeout(() => {
231
+ for (const g of d)
232
+ l.positionedParent.removeChild(g);
238
233
  }, 1e3);
239
234
  },
240
- tick: (y) => {
241
- const p = 1 - y;
242
- if (E.start <= p && p <= E.end) {
243
- const f = T(
244
- p,
235
+ tick: (g) => {
236
+ const y = 1 - g;
237
+ if (w.start <= y && y <= w.end) {
238
+ const f = A(
239
+ y,
240
+ w.start,
241
+ w.end
242
+ );
243
+ a = 1 - (1 - r) * f;
244
+ }
245
+ if (E.start <= y && y <= E.end) {
246
+ const f = A(
247
+ y,
245
248
  E.start,
246
249
  E.end
247
250
  );
248
- d = 1 - (1 - o) * f;
251
+ a = r + (1 - r) * f;
249
252
  }
250
- if (L.start <= p && p <= L.end) {
251
- const f = T(
252
- p,
253
+ if (L.start <= y && y <= L.end) {
254
+ const f = A(
255
+ y,
253
256
  L.start,
254
257
  L.end
255
258
  );
256
- d = o + (1 - o) * f;
259
+ h = -n.top - n.height * f;
257
260
  }
258
- if (k.start <= p && p <= k.end) {
259
- const f = T(
260
- p,
261
- k.start,
262
- k.end
263
- );
264
- u = -n.top - n.height * f;
265
- }
266
- s.style.transform = `translateY(${u}px) scale(${d})`;
267
- const h = (n.width - n.width * d) / 2, g = (n.height - n.height * d) / 2;
268
- nt(c, h, g);
261
+ o.style.transform = `translateY(${h}px) scale(${a})`;
262
+ const u = (n.width - n.width * a) / 2, p = (n.height - n.height * a) / 2;
263
+ st(d, u, p);
269
264
  }
270
265
  };
271
266
  },
272
- in: async (s, r) => {
273
- const n = I(r);
274
- let l = o, c = -n.top + n.height;
267
+ in: async (o, l) => {
268
+ const n = P(l);
269
+ let i = r, d = -n.top + n.height;
275
270
  return {
276
271
  spring: e,
277
272
  prepare: () => {
278
- D(s, n), v(s, n), s.style.transform = `translateY(${-n.top + n.height}px) scale(${o})`;
273
+ I(o, n), D(o, n), o.style.transform = `translateY(${-n.top + n.height}px) scale(${r})`;
279
274
  },
280
275
  onEnd: () => {
281
- s.style.clipPath = "", s.style.transformOrigin = "", s.style.transform = "";
276
+ o.style.clipPath = "", o.style.transformOrigin = "", o.style.transform = "";
282
277
  },
283
- tick: (d) => {
284
- if (E.start <= d && d <= E.end) {
285
- const u = T(
286
- d,
278
+ tick: (a) => {
279
+ if (w.start <= a && a <= w.end) {
280
+ const h = A(
281
+ a,
282
+ w.start,
283
+ w.end
284
+ );
285
+ i = 1 - (1 - r) * h;
286
+ }
287
+ if (E.start <= a && a <= E.end) {
288
+ const h = A(
289
+ a,
287
290
  E.start,
288
291
  E.end
289
292
  );
290
- l = 1 - (1 - o) * u;
293
+ i = r + (1 - r) * h;
291
294
  }
292
- if (L.start <= d && d <= L.end) {
293
- const u = T(
294
- d,
295
+ if (L.start <= a && a <= L.end) {
296
+ const h = A(
297
+ a,
295
298
  L.start,
296
299
  L.end
297
300
  );
298
- l = o + (1 - o) * u;
299
- }
300
- if (k.start <= d && d <= k.end) {
301
- const u = T(
302
- d,
303
- k.start,
304
- k.end
305
- );
306
- c = -n.top + n.height * (1 - u);
301
+ d = -n.top + n.height * (1 - h);
307
302
  }
308
- s.style.transform = `translateY(${c}px) scale(${l})`;
303
+ o.style.transform = `translateY(${d}px) scale(${i})`;
309
304
  }
310
305
  };
311
306
  }
312
307
  };
313
308
  };
314
- function nt(t, e, o) {
315
- const a = e * 0.7, i = o * 0.7;
316
- t.topLeft.style.transform = `translate(${a}px, ${i}px)`, t.topRight.style.transform = `translate(${-a}px, ${i}px)`, t.bottomLeft.style.transform = `translate(${a}px, ${-i}px)`, t.bottomRight.style.transform = `translate(${-a}px, ${-i}px)`;
309
+ function st(t, e, r) {
310
+ const c = e * 0.7, s = r * 0.7;
311
+ t.topLeft.style.transform = `translate(${c}px, ${s}px)`, t.topRight.style.transform = `translate(${-c}px, ${s}px)`, t.bottomLeft.style.transform = `translate(${c}px, ${-s}px)`, t.bottomRight.style.transform = `translate(${-c}px, ${-s}px)`;
317
312
  }
318
- function it(t = "white", e) {
319
- const i = document.createElement("div");
320
- i.style.position = "fixed", i.style.pointerEvents = "none", i.style.zIndex = "9999", i.style.top = `${e.top - 1}px`, i.style.left = `${e.left - 1}px`, i.style.width = "15px", i.style.height = "15px";
313
+ function rt(t = "white", e) {
321
314
  const s = document.createElement("div");
322
- s.style.position = "absolute", s.style.width = "15px", s.style.height = "1px", s.style.backgroundColor = t, s.style.top = "0", s.style.left = "0";
323
- const r = document.createElement("div");
324
- r.style.position = "absolute", r.style.width = "1px", r.style.height = "15px", r.style.backgroundColor = t, r.style.top = "0", r.style.left = "0", i.appendChild(s), i.appendChild(r);
315
+ s.style.position = "fixed", s.style.pointerEvents = "none", s.style.zIndex = "9999", s.style.top = `${e.top - 1}px`, s.style.left = `${e.left - 1}px`, s.style.width = "15px", s.style.height = "15px";
316
+ const o = document.createElement("div");
317
+ o.style.position = "absolute", o.style.width = "15px", o.style.height = "1px", o.style.backgroundColor = t, o.style.top = "0", o.style.left = "0";
318
+ const l = document.createElement("div");
319
+ l.style.position = "absolute", l.style.width = "1px", l.style.height = "15px", l.style.backgroundColor = t, l.style.top = "0", l.style.left = "0", s.appendChild(o), s.appendChild(l);
325
320
  const n = document.createElement("div");
326
321
  n.style.position = "fixed", n.style.pointerEvents = "none", n.style.zIndex = "9999", n.style.top = `${e.top - 1}px`, n.style.left = `${e.left + e.width - 15 + 1}px`, n.style.width = "15px", n.style.height = "15px";
327
- const l = document.createElement("div");
328
- l.style.position = "absolute", l.style.width = "15px", l.style.height = "1px", l.style.backgroundColor = t, l.style.top = "0", l.style.right = "0";
329
- const c = document.createElement("div");
330
- c.style.position = "absolute", c.style.width = "1px", c.style.height = "15px", c.style.backgroundColor = t, c.style.top = "0", c.style.right = "0", n.appendChild(l), n.appendChild(c);
322
+ const i = document.createElement("div");
323
+ i.style.position = "absolute", i.style.width = "15px", i.style.height = "1px", i.style.backgroundColor = t, i.style.top = "0", i.style.right = "0";
331
324
  const d = document.createElement("div");
332
- d.style.position = "fixed", d.style.pointerEvents = "none", d.style.zIndex = "9999", d.style.top = `${e.top + e.height - 15 + 1}px`, d.style.left = `${e.left - 1}px`, d.style.width = "15px", d.style.height = "15px";
333
- const u = document.createElement("div");
334
- u.style.position = "absolute", u.style.width = "15px", u.style.height = "1px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.left = "0";
335
- const y = document.createElement("div");
336
- y.style.position = "absolute", y.style.width = "1px", y.style.height = "15px", y.style.backgroundColor = t, y.style.bottom = "0", y.style.left = "0", d.appendChild(u), d.appendChild(y);
337
- const p = document.createElement("div");
338
- p.style.position = "fixed", p.style.pointerEvents = "none", p.style.zIndex = "9999", p.style.top = `${e.top + e.height - 15 + 1}px`, p.style.left = `${e.left + e.width - 15 + 1}px`, p.style.width = "15px", p.style.height = "15px";
325
+ d.style.position = "absolute", d.style.width = "1px", d.style.height = "15px", d.style.backgroundColor = t, d.style.top = "0", d.style.right = "0", n.appendChild(i), n.appendChild(d);
326
+ const a = document.createElement("div");
327
+ a.style.position = "fixed", a.style.pointerEvents = "none", a.style.zIndex = "9999", a.style.top = `${e.top + e.height - 15 + 1}px`, a.style.left = `${e.left - 1}px`, a.style.width = "15px", a.style.height = "15px";
339
328
  const h = document.createElement("div");
340
- h.style.position = "absolute", h.style.width = "15px", h.style.height = "1px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.right = "0";
329
+ h.style.position = "absolute", h.style.width = "15px", h.style.height = "1px", h.style.backgroundColor = t, h.style.bottom = "0", h.style.left = "0";
341
330
  const g = document.createElement("div");
342
- return g.style.position = "absolute", g.style.width = "1px", g.style.height = "15px", g.style.backgroundColor = t, g.style.bottom = "0", g.style.right = "0", p.appendChild(h), p.appendChild(g), {
343
- topLeft: i,
331
+ g.style.position = "absolute", g.style.width = "1px", g.style.height = "15px", g.style.backgroundColor = t, g.style.bottom = "0", g.style.left = "0", a.appendChild(h), a.appendChild(g);
332
+ const y = document.createElement("div");
333
+ y.style.position = "fixed", y.style.pointerEvents = "none", y.style.zIndex = "9999", y.style.top = `${e.top + e.height - 15 + 1}px`, y.style.left = `${e.left + e.width - 15 + 1}px`, y.style.width = "15px", y.style.height = "15px";
334
+ const u = document.createElement("div");
335
+ u.style.position = "absolute", u.style.width = "15px", u.style.height = "1px", u.style.backgroundColor = t, u.style.bottom = "0", u.style.right = "0";
336
+ const p = document.createElement("div");
337
+ 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", y.appendChild(u), y.appendChild(p), {
338
+ topLeft: s,
344
339
  topRight: n,
345
- bottomLeft: d,
346
- bottomRight: p,
340
+ bottomLeft: a,
341
+ bottomRight: y,
347
342
  *[Symbol.iterator]() {
348
- yield i, yield n, yield d, yield p;
343
+ yield s, yield n, yield a, yield y;
349
344
  }
350
345
  };
351
346
  }
352
- function I(t) {
353
- const e = A(document.body, t.positionedParent);
347
+ function P(t) {
348
+ const e = T(document.body, t.positionedParent);
354
349
  return {
355
350
  top: t.scroll.y,
356
351
  left: 0,
@@ -358,11 +353,11 @@ function I(t) {
358
353
  height: window.innerHeight - e.top
359
354
  };
360
355
  }
361
- function D(t, e) {
362
- const o = e.left + e.width / 2, a = e.top + e.height / 2;
363
- t.style.transformOrigin = `${o}px ${a}px`;
356
+ function I(t, e) {
357
+ const r = e.left + e.width / 2, c = e.top + e.height / 2;
358
+ t.style.transformOrigin = `${r}px ${c}px`;
364
359
  }
365
- function v(t, e) {
360
+ function D(t, e) {
366
361
  t.style.clipPath = `polygon(
367
362
  ${e.left}px ${e.top}px,
368
363
  ${e.left + e.width}px ${e.top}px,
@@ -370,64 +365,64 @@ function v(t, e) {
370
365
  ${e.left}px ${e.top + e.height}px
371
366
  )`;
372
367
  }
373
- function st(t, e) {
368
+ function ot(t, e) {
374
369
  t.style.transform = `translateY(${-e.top}px)`;
375
370
  }
376
- function T(t, e, o) {
377
- return t <= e ? 0 : t >= o ? 1 : (t - e) / (o - e);
371
+ function A(t, e, r) {
372
+ return t <= e ? 0 : t >= r ? 1 : (t - e) / (r - e);
378
373
  }
379
- function rt(t, e) {
374
+ function lt(t, e) {
380
375
  return t.querySelector(`[data-hero-key="${e}"]`);
381
376
  }
382
- const ft = (t = {}) => {
383
- var r, n;
377
+ const Pt = (t = {}) => {
378
+ var l, n;
384
379
  const e = {
385
- stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 300,
380
+ stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 300,
386
381
  damping: ((n = t.spring) == null ? void 0 : n.damping) ?? 30
387
- }, o = t.timeout ?? 300, a = t.maxDistance ?? 700;
388
- let i = null, s = null;
382
+ }, r = t.timeout ?? 300, c = t.maxDistance ?? 700;
383
+ let s = null, o = null;
389
384
  return {
390
- in: async (l, c) => {
391
- const d = l, u = Array.from(d.querySelectorAll("[data-hero-key]"));
392
- if (u.length === 0)
385
+ in: async (i, d) => {
386
+ const a = i, h = Array.from(a.querySelectorAll("[data-hero-key]"));
387
+ if (h.length === 0)
393
388
  return {
394
389
  spring: e,
395
390
  tick: () => {
396
391
  }
397
392
  // No hero elements, skip animation
398
393
  };
399
- if (!await new Promise((h) => {
400
- i ? h(!0) : (s = h, setTimeout(() => {
401
- s = null, h(!1);
402
- }, o));
403
- }) || !i)
404
- return i = null, {
394
+ if (!await new Promise((u) => {
395
+ s ? u(!0) : (o = u, setTimeout(() => {
396
+ o = null, u(!1);
397
+ }, r));
398
+ }) || !s)
399
+ return s = null, {
405
400
  spring: e,
406
401
  tick: () => {
407
402
  }
408
403
  // No fromNode, skip animation
409
404
  };
410
- const p = u.map((h) => {
411
- const g = h.getAttribute("data-hero-key");
412
- if (!g) return null;
413
- const f = rt(i, g);
405
+ const y = h.map((u) => {
406
+ const p = u.getAttribute("data-hero-key");
407
+ if (!p) return null;
408
+ const f = lt(s, p);
414
409
  if (!f) return null;
415
- const $ = h, m = A(i, f), x = A(d, $), w = m.left - x.left - c.scrollOffset.x, S = m.top - x.top - c.scrollOffset.y, X = m.width / x.width, O = m.height / x.height, U = $.style.transform, W = $.style.position, z = $.style.transformOrigin, H = $.style.zIndex;
410
+ const $ = u, m = T(s, f), x = T(a, $), S = m.left - x.left - d.scrollOffset.x, U = m.top - x.top - d.scrollOffset.y, W = m.width / x.width, X = m.height / x.height, N = $.style.transform, z = $.style.position, H = $.style.transformOrigin, B = $.style.zIndex;
416
411
  return {
417
412
  toEl: $,
418
- dx: w,
419
- dy: S,
420
- dw: X,
421
- dh: O,
422
- originalTransform: U,
423
- originalPosition: W,
424
- originalTransformOrigin: z,
425
- originalZIndex: H
413
+ dx: S,
414
+ dy: U,
415
+ dw: W,
416
+ dh: X,
417
+ originalTransform: N,
418
+ originalPosition: z,
419
+ originalTransformOrigin: H,
420
+ originalZIndex: B
426
421
  };
427
422
  }).filter(
428
- (h) => h !== null && Math.abs(h.dy) <= a
423
+ (u) => u !== null && Math.abs(u.dy) <= c
429
424
  );
430
- return i = null, p.length === 0 ? {
425
+ return s = null, y.length === 0 ? {
431
426
  spring: e,
432
427
  tick: () => {
433
428
  }
@@ -435,156 +430,156 @@ const ft = (t = {}) => {
435
430
  } : {
436
431
  spring: e,
437
432
  prepare: () => {
438
- p.forEach(({ toEl: h }) => {
439
- h.style.position = "relative", h.style.transformOrigin = "top left", h.style.zIndex = "1000";
433
+ y.forEach(({ toEl: u }) => {
434
+ u.style.position = "relative", u.style.transformOrigin = "top left", u.style.zIndex = "1000";
440
435
  });
441
436
  },
442
- tick: (h) => {
443
- p.forEach(({ toEl: g, dx: f, dy: $, dw: m, dh: x }) => {
444
- g.style.transform = `translate(${(1 - h) * f}px,${(1 - h) * $}px) scale(${h + (1 - h) * m}, ${h + (1 - h) * x})`;
437
+ tick: (u) => {
438
+ y.forEach(({ toEl: p, dx: f, dy: $, dw: m, dh: x }) => {
439
+ p.style.transform = `translate(${(1 - u) * f}px,${(1 - u) * $}px) scale(${u + (1 - u) * m}, ${u + (1 - u) * x})`;
445
440
  });
446
441
  },
447
442
  onEnd: () => {
448
- p.forEach(
443
+ y.forEach(
449
444
  ({
450
- toEl: h,
451
- originalTransform: g,
445
+ toEl: u,
446
+ originalTransform: p,
452
447
  originalPosition: f,
453
448
  originalTransformOrigin: $,
454
449
  originalZIndex: m
455
450
  }) => {
456
- h.style.transform = g, h.style.position = f, h.style.transformOrigin = $, h.style.zIndex = m;
451
+ u.style.transform = p, u.style.position = f, u.style.transformOrigin = $, u.style.zIndex = m;
457
452
  }
458
453
  );
459
454
  }
460
455
  };
461
456
  },
462
- out: async (l) => ({
457
+ out: async (i) => ({
463
458
  onStart: () => {
464
- i = l, s && (s(!0), s = null);
459
+ s = i, o && (o(!0), o = null);
465
460
  },
466
- prepare: (c) => {
467
- b(c), c.style.opacity = "0";
461
+ prepare: (d) => {
462
+ b(d), d.style.opacity = "0";
468
463
  }
469
464
  })
470
465
  };
471
466
  };
472
- function lt({
467
+ function at({
473
468
  detailRect: t,
474
469
  galleryRect: e,
475
- pageRect: o,
476
- scrollOffset: a
477
- }, i) {
478
- const s = e.left - t.left + (e.width - t.width) / 2 - a.x, r = e.top - t.top + (e.height - t.height) / 2 - a.y, n = e.width / t.width, l = e.height / t.height, c = Math.max(n, l), d = t.top / o.height * 100, u = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, p = t.left / o.width * 100;
479
- return i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (h) => {
480
- const g = 1 - h, f = d * g, $ = u * g, m = y * g, x = p * g;
481
- i.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, i.style.transform = `translate(${s * g}px, ${r * g}px) scale(${1 + (c - 1) * g})`;
470
+ pageRect: r,
471
+ scrollOffset: c
472
+ }, s) {
473
+ const o = e.left - t.left + (e.width - t.width) / 2 - c.x, l = e.top - t.top + (e.height - t.height) / 2 - c.y, n = e.width / t.width, i = e.height / t.height, d = Math.max(n, i), a = t.top / r.height * 100, h = (r.width - (t.left + t.width)) / r.width * 100, g = (r.height - (t.top + t.height)) / r.height * 100, y = t.left / r.width * 100;
474
+ return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (u) => {
475
+ const p = 1 - u, f = a * p, $ = h * p, m = g * p, x = y * p;
476
+ s.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, s.style.transform = `translate(${o * p}px, ${l * p}px) scale(${1 + (d - 1) * p})`;
482
477
  };
483
478
  }
484
- function ot({
479
+ function dt({
485
480
  galleryRect: t,
486
481
  detailRect: e,
487
- scrollOffset: o
488
- }, a) {
489
- const i = e.left - t.left + (e.width - t.width) / 2 + o.x, s = e.top - t.top + (e.height - t.height) / 2 + o.y, r = e.width / t.width, n = e.height / t.height, l = Math.max(r, n);
490
- return (c) => {
491
- a.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
492
- const d = 1 - c;
493
- a.style.transform = `translate(${i * d - o.x}px, ${s * d - o.y}px) scale(${1 + (l - 1) * d})`, a.style.opacity = `${1 - d}`;
482
+ scrollOffset: r
483
+ }, c) {
484
+ const s = e.left - t.left + (e.width - t.width) / 2 + r.x, o = e.top - t.top + (e.height - t.height) / 2 + r.y, l = e.width / t.width, n = e.height / t.height, i = Math.max(l, n);
485
+ return (d) => {
486
+ c.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`;
487
+ const a = 1 - d;
488
+ c.style.transform = `translate(${s * a - r.x}px, ${o * a - r.y}px) scale(${1 + (i - 1) * a})`, c.style.opacity = `${1 - a}`;
494
489
  };
495
490
  }
496
- function at({
491
+ function ct({
497
492
  galleryRect: t,
498
493
  detailRect: e,
499
- scrollOffset: o
500
- }, a) {
501
- const i = e.left - t.left + (e.width - t.width) / 2 - o.x, s = e.top - t.top + (e.height - t.height) / 2 - o.y, r = e.width / t.width, n = e.height / t.height, l = Math.max(r, n);
502
- return (c) => {
503
- const d = 1 - c, u = c;
504
- a.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, a.style.transform = `translate(${i * d}px, ${s * d}px) scale(${1 + (l - 1) * d})`, a.style.opacity = `${u}`;
494
+ scrollOffset: r
495
+ }, c) {
496
+ const s = e.left - t.left + (e.width - t.width) / 2 - r.x, o = e.top - t.top + (e.height - t.height) / 2 - r.y, l = e.width / t.width, n = e.height / t.height, i = Math.max(l, n);
497
+ return (d) => {
498
+ const a = 1 - d, h = d;
499
+ c.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, c.style.transform = `translate(${s * a}px, ${o * a}px) scale(${1 + (i - 1) * a})`, c.style.opacity = `${h}`;
505
500
  };
506
501
  }
507
- function dt({
502
+ function ht({
508
503
  detailRect: t,
509
504
  galleryRect: e,
510
- pageRect: o,
511
- scrollOffset: a
512
- }, i) {
513
- const s = e.left - t.left + (e.width - t.width) / 2 + a.x, r = e.top - t.top + (e.height - t.height) / 2 + a.y, n = e.width / t.width, l = e.height / t.height, c = Math.min(n, l), d = t.top / o.height * 100, u = (o.width - (t.left + t.width)) / o.width * 100, y = (o.height - (t.top + t.height)) / o.height * 100, p = t.left / o.width * 100;
514
- return i.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (h) => {
515
- const g = 1 - h, f = d * g, $ = u * g, m = y * g, x = p * g;
516
- i.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, i.style.transform = `translate(${s * g - a.x}px, ${r * g - a.y}px) scale(${1 + (c - 1) * g})`;
505
+ pageRect: r,
506
+ scrollOffset: c
507
+ }, s) {
508
+ const o = e.left - t.left + (e.width - t.width) / 2 + c.x, l = e.top - t.top + (e.height - t.height) / 2 + c.y, n = e.width / t.width, i = e.height / t.height, d = Math.min(n, i), a = t.top / r.height * 100, h = (r.width - (t.left + t.width)) / r.width * 100, g = (r.height - (t.top + t.height)) / r.height * 100, y = t.left / r.width * 100;
509
+ return s.style.transformOrigin = `${t.left + t.width / 2}px ${t.top + t.height / 2}px`, (u) => {
510
+ const p = 1 - u, f = a * p, $ = h * p, m = g * p, x = y * p;
511
+ s.style.clipPath = `inset(${f}% ${$}% ${m}% ${x}%)`, s.style.transform = `translate(${o * p - c.x}px, ${l * p - c.y}px) scale(${1 + (d - 1) * p})`;
517
512
  };
518
513
  }
519
- function ht(t, e, o) {
520
- const a = t.querySelector(
514
+ function pt(t, e, r) {
515
+ const c = t.querySelector(
521
516
  "[data-pinterest-detail-key]"
522
- ), i = e.querySelector(
517
+ ), s = e.querySelector(
523
518
  "[data-pinterest-detail-key]"
524
519
  );
525
520
  if (t.querySelectorAll("[data-pinterest-detail-key]").length > 1 || e.querySelectorAll("[data-pinterest-detail-key]").length > 1)
526
521
  return null;
527
- let s = null, r = null, n = !1;
528
- if (!a && i) {
529
- r = i;
530
- const u = r.getAttribute("data-pinterest-detail-key");
531
- if (!u) return null;
532
- s = t.querySelector(
533
- `[data-pinterest-gallery-key="${u}"]`
534
- ), s && (n = !0);
535
- } else if (a && !i) {
536
- r = a;
537
- const u = r.getAttribute("data-pinterest-detail-key");
538
- if (!u) return null;
539
- s = e.querySelector(
540
- `[data-pinterest-gallery-key="${u}"]`
541
- ), s && (n = !1);
522
+ let o = null, l = null, n = !1;
523
+ if (!c && s) {
524
+ l = s;
525
+ const h = l.getAttribute("data-pinterest-detail-key");
526
+ if (!h) return null;
527
+ o = t.querySelector(
528
+ `[data-pinterest-gallery-key="${h}"]`
529
+ ), o && (n = !0);
530
+ } else if (c && !s) {
531
+ l = c;
532
+ const h = l.getAttribute("data-pinterest-detail-key");
533
+ if (!h) return null;
534
+ o = e.querySelector(
535
+ `[data-pinterest-gallery-key="${h}"]`
536
+ ), o && (n = !1);
542
537
  }
543
- if (!s || !r)
538
+ if (!o || !l)
544
539
  return null;
545
- const l = A(n ? t : e, s), c = A(n ? e : t, r), d = e.getBoundingClientRect();
540
+ const i = T(n ? t : e, o), d = T(n ? e : t, l), a = e.getBoundingClientRect();
546
541
  return n ? {
547
- inAnimation: lt(
548
- { detailRect: c, galleryRect: l, pageRect: d, scrollOffset: o },
542
+ inAnimation: at(
543
+ { detailRect: d, galleryRect: i, pageRect: a, scrollOffset: r },
549
544
  e
550
545
  ),
551
- outAnimation: ot(
552
- { galleryRect: l, detailRect: c, scrollOffset: o },
546
+ outAnimation: dt(
547
+ { galleryRect: i, detailRect: d, scrollOffset: r },
553
548
  t
554
549
  )
555
550
  } : {
556
- inAnimation: at(
557
- { galleryRect: l, detailRect: c, scrollOffset: o },
551
+ inAnimation: ct(
552
+ { galleryRect: i, detailRect: d, scrollOffset: r },
558
553
  e
559
554
  ),
560
- outAnimation: dt(
561
- { detailRect: c, galleryRect: l, pageRect: d, scrollOffset: o },
555
+ outAnimation: ht(
556
+ { detailRect: d, galleryRect: i, pageRect: a, scrollOffset: r },
562
557
  t
563
558
  )
564
559
  };
565
560
  }
566
- const $t = (t = {}) => {
567
- var r, n;
561
+ const It = (t = {}) => {
562
+ var l, n;
568
563
  const e = {
569
- stiffness: ((r = t.spring) == null ? void 0 : r.stiffness) ?? 50,
564
+ stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? 30,
570
565
  damping: ((n = t.spring) == null ? void 0 : n.damping) ?? 10
571
- }, o = t.timeout ?? 300;
572
- let a = null, i = null, s = null;
566
+ }, r = t.timeout ?? 300;
567
+ let c = null, s = null, o = null;
573
568
  return {
574
- in: async (l, { scrollOffset: c }) => {
575
- const d = l;
576
- return !await new Promise((y) => {
577
- a ? y(!0) : (i = y, setTimeout(() => {
578
- i = null, y(!1);
579
- }, o));
580
- }) || !a ? (a = null, {
569
+ in: async (i, { scrollOffset: d }) => {
570
+ const a = i;
571
+ return !await new Promise((g) => {
572
+ c ? g(!0) : (s = g, setTimeout(() => {
573
+ s = null, g(!1);
574
+ }, r));
575
+ }) || !c ? (c = null, {
581
576
  spring: e,
582
577
  tick: () => {
583
578
  }
584
- }) : (s = ht(a, d, c), s ? (a = null, {
579
+ }) : (o = pt(c, a, d), o ? (c = null, {
585
580
  spring: e,
586
- tick: (y) => {
587
- s && s.inAnimation(y);
581
+ tick: (g) => {
582
+ o && o.inAnimation(g);
588
583
  }
589
584
  }) : {
590
585
  spring: e,
@@ -592,134 +587,250 @@ const $t = (t = {}) => {
592
587
  }
593
588
  });
594
589
  },
595
- out: async (l) => ({
590
+ out: async (i) => ({
596
591
  spring: e,
597
592
  onStart: () => {
598
- a = l, i && (i(!0), i = null);
593
+ c = i, s && (s(!0), s = null);
599
594
  },
600
- prepare: (c) => {
601
- b(c), c.style.zIndex = "-1";
595
+ prepare: (d) => {
596
+ b(d), d.style.zIndex = "-1";
602
597
  },
603
- tick: (c) => {
604
- s && s.outAnimation(c);
598
+ tick: (d) => {
599
+ o && o.outAnimation(d);
605
600
  }
606
601
  })
607
602
  };
608
- }, Y = {
609
- stiffness: 30,
610
- damping: 7
611
- }, xt = (t = {}) => {
612
- var l, c;
613
- const e = t.direction ?? "up", o = {
614
- stiffness: ((l = t.spring) == null ? void 0 : l.stiffness) ?? Y.stiffness,
615
- damping: ((c = t.spring) == null ? void 0 : c.damping) ?? Y.damping
616
- }, a = e === "up";
617
- let i = null, s = null, r = null;
603
+ }, v = {
604
+ stiffness: 5,
605
+ damping: 4
606
+ }, Dt = (t = {}) => {
607
+ var i, d;
608
+ const e = t.direction ?? "up", r = {
609
+ stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? v.stiffness,
610
+ damping: ((d = t.spring) == null ? void 0 : d.damping) ?? v.damping
611
+ }, c = e === "up";
612
+ let s = null, o = null, l = null;
618
613
  const n = () => {
619
- if (i === null || s === null)
614
+ if (s === null || o === null)
620
615
  return null;
621
- const d = Math.min(i, s), u = window.innerHeight;
622
- return Math.max(d, u);
616
+ const a = Math.min(s, o), h = window.innerHeight;
617
+ return Math.max(a, h);
623
618
  };
624
619
  return {
625
- in: (d) => (s = d.offsetHeight, i !== null && (r = n()), {
626
- spring: o,
627
- tick: (u) => {
628
- if (r === null && (r = n(), r === null))
620
+ in: (a) => (o = a.offsetHeight, s !== null && (l = n()), {
621
+ spring: r,
622
+ tick: (h) => {
623
+ if (l === null && (l = n(), l === null))
629
624
  return;
630
- const y = a ? (1 - u) * r : (1 - u) * -r;
631
- d.style.transform = `translateY(${y}px)`;
625
+ const g = c ? (1 - h) * l : (1 - h) * -l;
626
+ a.style.transform = `translateY(${g}px)`;
632
627
  }
633
628
  }),
634
- out: (d) => ({
635
- spring: o,
629
+ out: (a) => ({
630
+ spring: r,
636
631
  onStart: () => {
637
- i = d.offsetHeight, s !== null && (r = n());
632
+ s = a.offsetHeight, o !== null && (l = n());
638
633
  },
639
- tick: (u) => {
640
- if (r === null && (r = n(), r === null))
634
+ tick: (h) => {
635
+ if (l === null && (l = n(), l === null))
641
636
  return;
642
- const y = a ? (1 - u) * -r : (1 - u) * r;
643
- d.style.transform = `translateY(${y}px)`;
637
+ const g = c ? (1 - h) * -l : (1 - h) * l;
638
+ a.style.transform = `translateY(${g}px)`;
644
639
  },
645
- prepare: (u) => {
646
- b(u), u.style.zIndex = a ? "-1" : "1";
640
+ prepare: (h) => {
641
+ b(h), h.style.zIndex = c ? "-1" : "1";
647
642
  }
648
643
  })
649
644
  };
650
- }, _ = {
651
- stiffness: 30,
645
+ }, F = {
646
+ stiffness: 15,
652
647
  damping: 7
653
- }, mt = (t = {}) => {
654
- var i, s;
655
- const e = t.direction ?? "left", o = {
656
- stiffness: ((i = t.spring) == null ? void 0 : i.stiffness) ?? _.stiffness,
657
- damping: ((s = t.spring) == null ? void 0 : s.damping) ?? _.damping
658
- }, a = e === "left";
648
+ }, vt = (t = {}) => {
649
+ var s, o;
650
+ const e = t.direction ?? "left", r = {
651
+ stiffness: ((s = t.spring) == null ? void 0 : s.stiffness) ?? F.stiffness,
652
+ damping: ((o = t.spring) == null ? void 0 : o.damping) ?? F.damping
653
+ }, c = e === "left";
659
654
  return {
660
- in: (r) => ({
661
- spring: o,
655
+ in: (l) => ({
656
+ spring: r,
662
657
  tick: (n) => {
663
- const l = a ? (1 - n) * 100 : (1 - n) * -100;
664
- r.style.transform = `translateX(${l}%)`;
658
+ const i = c ? (1 - n) * 100 : (1 - n) * -100;
659
+ l.style.transform = `translateX(${i}%)`;
665
660
  }
666
661
  }),
667
- out: (r, n) => ({
668
- spring: o,
669
- tick: (l) => {
670
- const c = a ? (1 - l) * -100 : (1 - l) * 100;
671
- r.style.transform = `translateX(${c}%)`;
662
+ out: (l, n) => ({
663
+ spring: r,
664
+ tick: (i) => {
665
+ const d = c ? (1 - i) * -100 : (1 - i) * 100;
666
+ l.style.transform = `translateX(${d}%)`;
672
667
  },
673
- prepare: (l) => {
674
- b(l, n), l.style.zIndex = a ? "-1" : "1";
668
+ prepare: (i) => {
669
+ b(i, n), i.style.zIndex = c ? "-1" : "1";
675
670
  }
676
671
  })
677
672
  };
678
- }, F = { stiffness: 300, damping: 30 }, C = 20, P = 800, bt = () => {
673
+ }, O = { stiffness: 17, damping: 6 }, C = 20, k = 800, Ft = () => {
679
674
  let t, e = null;
680
675
  return {
681
- in: (o) => ({
682
- spring: F,
683
- prepare: (a) => {
684
- a.style.transform = `perspective(${P}px) rotateY(${C}deg) translateX(-100%)`;
676
+ in: (r) => ({
677
+ spring: O,
678
+ prepare: (c) => {
679
+ c.style.transform = `perspective(${k}px) rotateY(${C}deg) translateX(-100%)`;
685
680
  },
686
681
  wait: async () => {
687
682
  t && await t;
688
683
  },
689
- tick: (a) => {
690
- const i = (1 - a) * C, s = -(1 - a) * 100;
691
- o.style.transform = `perspective(${P}px) rotateY(${i}deg) translateX(${s}%)`;
684
+ tick: (c) => {
685
+ const s = (1 - c) * C, o = -(1 - c) * 100;
686
+ r.style.transform = `perspective(${k}px) rotateY(${s}deg) translateX(${o}%)`;
692
687
  },
693
688
  onEnd: () => {
694
- o.style.transform = "";
689
+ r.style.transform = "";
695
690
  }
696
691
  }),
697
- out: (o, a) => (t = new Promise((i) => {
698
- e = i;
692
+ out: (r, c) => (t = new Promise((s) => {
693
+ e = s;
699
694
  }), {
700
- spring: F,
701
- prepare: (i) => {
702
- b(i, a);
695
+ spring: O,
696
+ prepare: (s) => {
697
+ b(s, c);
703
698
  },
704
- tick: (i) => {
705
- const s = 1 - i, r = s * C, n = s * 100;
706
- o.style.transform = `perspective(${P}px) rotateY(${-r}deg) translateX(${n}%)`;
699
+ tick: (s) => {
700
+ const o = 1 - s, l = o * C, n = o * 100;
701
+ r.style.transform = `perspective(${k}px) rotateY(${-l}deg) translateX(${n}%)`;
707
702
  },
708
703
  onEnd: () => {
709
- e && e(), o.style.transform = "";
704
+ e && e(), r.style.transform = "";
710
705
  }
711
706
  })
712
707
  };
708
+ }, yt = { stiffness: 1, damping: 1 }, ut = { stiffness: 20, damping: 25 }, gt = "#000000", ft = "circle", Y = "CURTAIN_REVEAL_OVERLAY_ID", $t = {
709
+ position: "fixed",
710
+ inset: "0",
711
+ width: "100vw",
712
+ height: "100%",
713
+ zIndex: "9999",
714
+ display: "flex",
715
+ alignItems: "center",
716
+ justifyContent: "center",
717
+ overflow: "hidden"
718
+ }, mt = {
719
+ position: "relative",
720
+ display: "inline-block",
721
+ height: "5.5rem",
722
+ overflow: "hidden"
723
+ }, xt = {
724
+ display: "flex",
725
+ height: "100%",
726
+ willChange: "transform",
727
+ transition: "transform 0.3s ease"
728
+ }, bt = {
729
+ display: "inline-flex",
730
+ alignItems: "center",
731
+ justifyContent: "center",
732
+ whiteSpace: "nowrap",
733
+ fontSize: "5.5rem",
734
+ fontWeight: "900",
735
+ letterSpacing: "0.02em",
736
+ color: "#FFFFFF"
737
+ }, wt = 0.4, _ = 0.5, Et = 0.2;
738
+ function Lt(t, e) {
739
+ switch (t) {
740
+ case "circle":
741
+ return `circle(${e * 100}% at 50% 50%)`;
742
+ case "square":
743
+ return `inset(${(1 - e) * 50}% round ${10 * e}%)`;
744
+ case "triangle": {
745
+ const r = e * 100;
746
+ return `polygon(50% ${50 - r}%, ${50 - r}% ${50 + r}%, ${50 + r}% ${50 + r}%)`;
747
+ }
748
+ }
749
+ }
750
+ const At = (t) => t.reduce((e, r) => e + r, 0), Ot = (t = {}) => {
751
+ const {
752
+ background: e = gt,
753
+ texts: r = [],
754
+ shape: c = ft,
755
+ inSpring: s = ut,
756
+ outSpring: o = yt,
757
+ textStyle: l = {}
758
+ } = t;
759
+ return {
760
+ out: (n, i) => {
761
+ const d = n.style.opacity;
762
+ return {
763
+ spring: o,
764
+ from: 1,
765
+ to: 0,
766
+ prepare: (a) => {
767
+ b(a, i), a.style.opacity = "1";
768
+ },
769
+ tick: (a) => {
770
+ const h = Math.max(0, a - wt);
771
+ n.style.opacity = String(h);
772
+ },
773
+ onEnd: () => {
774
+ n.style.opacity = d;
775
+ }
776
+ };
777
+ },
778
+ in: (n) => {
779
+ let i = null, d = null, a = null;
780
+ const h = document.body.style.overflow, g = document.getElementById(
781
+ Y
782
+ );
783
+ let y = [];
784
+ const u = () => {
785
+ i = document.createElement("div"), i.id = Y, Object.assign(i.style, $t, { background: e }), document.body.appendChild(i), d = document.createElement("div"), Object.assign(d.style, mt), i.appendChild(d), a = document.createElement("div"), Object.assign(a.style, xt), d.appendChild(a), r.forEach((p) => {
786
+ const f = document.createElement("div");
787
+ f.textContent = p, Object.assign(f.style, bt, l), a.appendChild(f);
788
+ }), y = Array.from(a.children).map(
789
+ (p) => p.getBoundingClientRect().width
790
+ );
791
+ };
792
+ return {
793
+ spring: s,
794
+ from: 0,
795
+ to: 1,
796
+ prepare: () => {
797
+ document.body.style.overflow = "hidden", n.style.opacity = "1", g == null || g.remove(), u(), i && d && (i.style.clipPath = "none", d.style.transform = "scale(1)");
798
+ },
799
+ tick: (p) => {
800
+ if (!(!i || !d || !a)) {
801
+ if (p <= _ && r.length > 0) {
802
+ const f = p / _, $ = Math.min(
803
+ Math.floor(f * r.length),
804
+ r.length - 1
805
+ ), m = y[$] ?? 0, x = At(y.slice(0, $));
806
+ d.style.width = `${m}px`, a.style.transform = `translateX(-${x}px)`;
807
+ }
808
+ if (p > _) {
809
+ const $ = 1 - Math.max(
810
+ 0,
811
+ Math.min(1, (p - _) / Et)
812
+ );
813
+ i.style.clipPath = Lt(c, $), d.style.transform = `scale(${$})`;
814
+ }
815
+ }
816
+ },
817
+ onEnd: () => {
818
+ i == null || i.remove(), i = d = a = null, document.body.style.overflow = h;
819
+ }
820
+ };
821
+ }
822
+ };
713
823
  };
714
824
  export {
715
- pt as blind,
716
- yt as drill,
717
- ut as fade,
718
- gt as film,
719
- ft as hero,
720
- Lt as jaemin,
721
- $t as pinterest,
722
- xt as scroll,
723
- mt as slide,
724
- bt as strip
825
+ St as blind,
826
+ Ot as curtainReveal,
827
+ _t as drill,
828
+ Ct as fade,
829
+ kt as film,
830
+ Pt as hero,
831
+ Wt as jaemin,
832
+ It as pinterest,
833
+ Dt as scroll,
834
+ vt as slide,
835
+ Ft as strip
725
836
  };