@cliquify.me/transitions 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,28 +1,28 @@
1
- import { interpolate as D, spring as ce, measureSpring as me, AbsoluteFill as c, Internals as Z, Sequence as M, useVideoConfig as de, useCurrentFrame as fe, Freeze as Y, random as B } from "remotion";
2
- import { jsx as o, Fragment as ee, jsxs as W } from "react/jsx-runtime";
3
- import C, { useMemo as h, Children as pe, useState as A } from "react";
4
- import { getBoundingBox as he, translatePath as te } from "@remotion/paths";
5
- import { makeStar as ge, makePie as ye } from "@remotion/shapes";
6
- const T = (n) => ({
1
+ import { interpolate as z, spring as mt, measureSpring as ft, AbsoluteFill as u, Internals as tt, Sequence as L, useVideoConfig as dt, useCurrentFrame as ht, Freeze as Y, random as B } from "remotion";
2
+ import { jsx as o, Fragment as et, jsxs as A } from "react/jsx-runtime";
3
+ import M, { useMemo as h, Children as pt, useState as X } from "react";
4
+ import { getBoundingBox as gt, translatePath as _ } from "@remotion/paths";
5
+ import { makeStar as yt, makePie as nt } from "@remotion/shapes";
6
+ const w = (n) => ({
7
7
  getDurationInFrames: () => n.durationInFrames,
8
- getProgress: ({ frame: t }) => D(t, [0, n.durationInFrames], [0, 1], {
8
+ getProgress: ({ frame: e }) => z(e, [0, n.durationInFrames], [0, 1], {
9
9
  easing: n.easing,
10
10
  extrapolateLeft: "clamp",
11
11
  extrapolateRight: "clamp"
12
12
  })
13
- }), at = (n = {}) => ({
14
- getDurationInFrames: ({ fps: t }) => n.durationInFrames ? n.durationInFrames : me({
13
+ }), ue = (n = {}) => ({
14
+ getDurationInFrames: ({ fps: e }) => n.durationInFrames ? n.durationInFrames : ft({
15
15
  config: n.config,
16
16
  threshold: n.durationRestThreshold,
17
- fps: t
17
+ fps: e
18
18
  }),
19
- getProgress: ({ fps: t, frame: e }) => {
20
- const r = n.reverse ? 0 : 1, s = n.reverse ? 1 : 0;
21
- return ce({
22
- fps: t,
23
- frame: e,
19
+ getProgress: ({ fps: e, frame: t }) => {
20
+ const r = n.reverse ? 0 : 1, a = n.reverse ? 1 : 0;
21
+ return mt({
22
+ fps: e,
23
+ frame: t,
24
24
  to: r,
25
- from: s,
25
+ from: a,
26
26
  config: n.config,
27
27
  durationInFrames: n.durationInFrames,
28
28
  durationRestThreshold: n.durationRestThreshold,
@@ -31,7 +31,7 @@ const T = (n) => ({
31
31
  }
32
32
  });
33
33
  typeof window < "u" && (window.remotion_renderReady = !1, window.remotion_delayRenderTimeouts || (window.remotion_delayRenderTimeouts = {}), window.remotion_delayRenderHandles = []);
34
- var $e = {
34
+ var $t = {
35
35
  "style.transformOrigin": {
36
36
  type: "transform-origin",
37
37
  step: 1,
@@ -67,7 +67,7 @@ var $e = {
67
67
  description: "Opacity",
68
68
  hiddenFromList: !1
69
69
  }
70
- }, we = {
70
+ }, bt = {
71
71
  "style.borderWidth": {
72
72
  type: "number",
73
73
  default: void 0,
@@ -98,7 +98,7 @@ var $e = {
98
98
  default: void 0,
99
99
  description: "Border color"
100
100
  }
101
- }, Te = {
101
+ }, wt = {
102
102
  "style.borderRadius": {
103
103
  type: "number",
104
104
  default: 0,
@@ -140,13 +140,13 @@ var $e = {
140
140
  description: "Bottom left radius",
141
141
  hiddenFromList: !1
142
142
  }
143
- }, be = {
143
+ }, Tt = {
144
144
  "style.backgroundColor": {
145
145
  type: "color",
146
146
  default: "transparent",
147
147
  description: "Color"
148
148
  }
149
- }, Se = {
149
+ }, St = {
150
150
  premountFor: {
151
151
  type: "number",
152
152
  default: 0,
@@ -164,9 +164,9 @@ var $e = {
164
164
  hiddenFromList: !0,
165
165
  keyframable: !1
166
166
  }
167
- }, Fe = {
168
- ...Se
169
- }, ve = {
167
+ }, Ft = {
168
+ ...St
169
+ }, vt = {
170
170
  cropLeft: {
171
171
  type: "number",
172
172
  default: 0,
@@ -207,66 +207,66 @@ var $e = {
207
207
  hiddenFromList: !1,
208
208
  keyframable: !0
209
209
  }
210
- }, xe = ve, Ie = {
211
- ...xe,
212
- ...$e,
213
- ...be,
214
- ...we,
215
- ...Te,
216
- ...Fe
217
- }, Ee = {
210
+ }, xt = vt, It = {
211
+ ...xt,
212
+ ...$t,
213
+ ...Tt,
214
+ ...bt,
215
+ ...wt,
216
+ ...Ft
217
+ }, kt = {
218
218
  layout: {
219
219
  type: "enum",
220
220
  default: "absolute-fill",
221
221
  description: "Layout",
222
222
  variants: {
223
- "absolute-fill": Ie,
223
+ "absolute-fill": It,
224
224
  none: {}
225
225
  }
226
226
  }
227
227
  };
228
228
  ({
229
- ...Ee.layout
229
+ ...kt.layout
230
230
  });
231
- function Pe(n, t) {
232
- const { allowFloats: e, component: r } = t;
231
+ function Et(n, e) {
232
+ const { allowFloats: t, component: r } = e;
233
233
  if (typeof n > "u")
234
234
  throw new Error(`The "durationInFrames" prop ${r} is missing.`);
235
235
  if (typeof n != "number")
236
236
  throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof n}`);
237
237
  if (n <= 0)
238
238
  throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${n}.`);
239
- if (!e && n % 1 !== 0)
239
+ if (!t && n % 1 !== 0)
240
240
  throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${n}.`);
241
241
  if (!Number.isFinite(n))
242
242
  throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${n}.`);
243
243
  }
244
- var qe = {
245
- validateDurationInFrames: Pe
244
+ var Ct = {
245
+ validateDurationInFrames: Et
246
246
  };
247
- const ne = C.createContext(null), re = C.createContext(null), K = ({ presentationProgress: n, children: t }) => {
248
- const e = h(() => ({
247
+ const rt = M.createContext(null), ot = M.createContext(null), Q = ({ presentationProgress: n, children: e }) => {
248
+ const t = h(() => ({
249
249
  enteringProgress: n
250
250
  }), [n]);
251
- return /* @__PURE__ */ o(ne.Provider, { value: e, children: t });
252
- }, G = ({ presentationProgress: n, children: t }) => {
253
- const e = h(() => ({
251
+ return /* @__PURE__ */ o(rt.Provider, { value: t, children: e });
252
+ }, Z = ({ presentationProgress: n, children: e }) => {
253
+ const t = h(() => ({
254
254
  exitingProgress: n
255
255
  }), [n]);
256
- return /* @__PURE__ */ o(re.Provider, { value: e, children: t });
257
- }, oe = (n) => C.Children.toArray(n).reduce((e, r) => r.type === C.Fragment ? e.concat(
258
- oe(
256
+ return /* @__PURE__ */ o(ot.Provider, { value: t, children: e });
257
+ }, it = (n) => M.Children.toArray(n).reduce((t, r) => r.type === M.Fragment ? t.concat(
258
+ it(
259
259
  r.props.children
260
260
  )
261
- ) : (e.push(r), e), []), Re = 0.01, ke = ({
261
+ ) : (t.push(r), t), []), qt = 0.01, Rt = ({
262
262
  children: n,
263
- presentationProgress: t,
264
- presentationDirection: e,
265
- passedProps: { direction: r = "from-left", enterStyle: s, exitStyle: l }
263
+ presentationProgress: e,
264
+ presentationDirection: t,
265
+ passedProps: { direction: r = "from-left", enterStyle: a, exitStyle: c }
266
266
  }) => {
267
- const u = h(() => {
268
- const i = t === 1 ? t * 100 : t * 100 - Re;
269
- if (e === "exiting")
267
+ const l = h(() => {
268
+ const i = e === 1 ? e * 100 : e * 100 - qt;
269
+ if (t === "exiting")
270
270
  switch (r) {
271
271
  case "from-left":
272
272
  return {
@@ -274,7 +274,7 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
274
274
  };
275
275
  case "from-right":
276
276
  return {
277
- transform: `translateX(${-t * 100}%)`
277
+ transform: `translateX(${-e * 100}%)`
278
278
  };
279
279
  case "from-top":
280
280
  return {
@@ -282,7 +282,7 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
282
282
  };
283
283
  case "from-bottom":
284
284
  return {
285
- transform: `translateY(${-t * 100}%)`
285
+ transform: `translateY(${-e * 100}%)`
286
286
  };
287
287
  default:
288
288
  throw new Error(`Invalid direction: ${r}`);
@@ -290,7 +290,7 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
290
290
  switch (r) {
291
291
  case "from-left":
292
292
  return {
293
- transform: `translateX(${-100 + t * 100}%)`
293
+ transform: `translateX(${-100 + e * 100}%)`
294
294
  };
295
295
  case "from-right":
296
296
  return {
@@ -298,7 +298,7 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
298
298
  };
299
299
  case "from-top":
300
300
  return {
301
- transform: `translateY(${-100 + t * 100}%)`
301
+ transform: `translateY(${-100 + e * 100}%)`
302
302
  };
303
303
  case "from-bottom":
304
304
  return {
@@ -307,132 +307,132 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
307
307
  default:
308
308
  throw new Error(`Invalid direction: ${r}`);
309
309
  }
310
- }, [e, t, r]), a = h(() => ({
310
+ }, [t, e, r]), s = h(() => ({
311
311
  width: "100%",
312
312
  height: "100%",
313
313
  justifyContent: "center",
314
314
  alignItems: "center",
315
- ...u,
316
- ...e === "entering" ? s : l
317
- }), [u, s, l, e]);
318
- return /* @__PURE__ */ o(c, { style: a, children: n });
315
+ ...l,
316
+ ...t === "entering" ? a : c
317
+ }), [l, a, c, t]);
318
+ return /* @__PURE__ */ o(u, { style: s, children: n });
319
319
  }, N = (n) => ({
320
- component: ke,
320
+ component: Rt,
321
321
  props: {}
322
- }), Ce = qe.validateDurationInFrames, L = function(n) {
322
+ }), Mt = Ct.validateDurationInFrames, W = function(n) {
323
323
  return null;
324
- }, z = ({ children: n }) => /* @__PURE__ */ o(ee, { children: n }), Me = ({
324
+ }, j = ({ children: n }) => /* @__PURE__ */ o(et, { children: n }), Lt = ({
325
325
  children: n
326
326
  }) => {
327
- const { fps: t } = de(), e = fe(), r = h(() => {
328
- let s = 0, l = 0;
329
- const u = oe(n);
330
- return pe.map(u, (a, i) => {
331
- const f = a;
332
- if (typeof f == "string") {
333
- if (f.trim() === "")
327
+ const { fps: e } = dt(), t = ht(), r = h(() => {
328
+ let a = 0, c = 0;
329
+ const l = it(n);
330
+ return pt.map(l, (s, i) => {
331
+ const m = s;
332
+ if (typeof m == "string") {
333
+ if (m.trim() === "")
334
334
  return null;
335
335
  throw new TypeError(
336
- `The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> components as its children, but you passed a string "${f}"`
336
+ `The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> components as its children, but you passed a string "${m}"`
337
337
  );
338
338
  }
339
- const d = u[i - 1], $ = u[i + 1], p = typeof d == "string" || typeof d > "u" ? null : d.type === L ? d : null, g = typeof $ == "string" || typeof $ > "u" ? null : $.type === L ? $ : null, _ = typeof d == "string" || typeof d > "u" ? !1 : d.type === L;
340
- if (f.type === L) {
341
- if (_)
339
+ const d = l[i - 1], y = l[i + 1], f = typeof d == "string" || typeof d > "u" ? null : d.type === W ? d : null, g = typeof y == "string" || typeof y > "u" ? null : y.type === W ? y : null, V = typeof d == "string" || typeof d > "u" ? !1 : d.type === W;
340
+ if (m.type === W) {
341
+ if (V)
342
342
  throw new TypeError(
343
343
  `A <TransitionSeries.Transition /> component must not be followed by another <TransitionSeries.Transition /> component (nth children = ${i - 1} and ${i})`
344
344
  );
345
345
  return null;
346
346
  }
347
- if (f.type !== z)
347
+ if (m.type !== j)
348
348
  throw new TypeError(
349
- `The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> and <TransitionSeries.Transition /> components as its children, but got ${f} instead`
349
+ `The <TransitionSeries /> component only accepts a list of <TransitionSeries.Sequence /> and <TransitionSeries.Transition /> components as its children, but got ${m} instead`
350
350
  );
351
- const E = f, R = `index = ${i}, duration = ${E.props.durationInFrames}`;
352
- if (!(E != null && E.props.children))
351
+ const k = m, q = `index = ${i}, duration = ${k.props.durationInFrames}`;
352
+ if (!(k != null && k.props.children))
353
353
  throw new TypeError(
354
- `A <TransitionSeries.Sequence /> component (${R}) was detected to not have any children. Delete it to fix this error.`
354
+ `A <TransitionSeries.Sequence /> component (${q}) was detected to not have any children. Delete it to fix this error.`
355
355
  );
356
- const w = E.props.durationInFrames, {
357
- durationInFrames: b,
358
- children: tt,
356
+ const b = k.props.durationInFrames, {
357
+ durationInFrames: T,
358
+ children: oe,
359
359
  ...F
360
- } = E.props;
361
- Ce(w, {
360
+ } = k.props;
361
+ Mt(b, {
362
362
  component: "of a <TransitionSeries.Sequence /> component",
363
363
  allowFloats: !0
364
364
  });
365
- const P = E.props.offset ?? 0;
366
- if (Number.isNaN(P))
365
+ const E = k.props.offset ?? 0;
366
+ if (Number.isNaN(E))
367
367
  throw new TypeError(
368
- `The "offset" property of a <TransitionSeries.Sequence /> must not be NaN, but got NaN (${R}).`
368
+ `The "offset" property of a <TransitionSeries.Sequence /> must not be NaN, but got NaN (${q}).`
369
369
  );
370
- if (!Number.isFinite(P))
370
+ if (!Number.isFinite(E))
371
371
  throw new TypeError(
372
- `The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${P} (${R}).`
372
+ `The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${E} (${q}).`
373
373
  );
374
- if (P % 1 !== 0)
374
+ if (E % 1 !== 0)
375
375
  throw new TypeError(
376
- `The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${P} (${R}).`
376
+ `The "offset" property of a <TransitionSeries.Sequence /> must be finite, but got ${E} (${q}).`
377
377
  );
378
- const ie = l + P;
379
- let X = 0;
380
- p && (X = p.props.timing.getDurationInFrames({
381
- fps: t
382
- }), s -= X / 2);
383
- let m = ie - X / 2;
384
- l += w + P, m < 0 && (m = 0);
385
- const O = g ? g.props.timing.getProgress({
386
- frame: e - m - b + g.props.timing.getDurationInFrames({ fps: t }) / 2 + s,
387
- fps: t
388
- }) : null, k = p ? p.props.timing.getProgress({
389
- frame: e - m,
390
- fps: t
391
- }) : null, se = p ? p.props.timing.getProgress({
392
- frame: e - (m + b),
393
- fps: t
378
+ const at = c + E;
379
+ let O = 0;
380
+ f && (O = f.props.timing.getDurationInFrames({
381
+ fps: e
382
+ }), a -= O / 2);
383
+ let p = at - O / 2;
384
+ c += b + E, p < 0 && (p = 0);
385
+ const P = g ? g.props.timing.getProgress({
386
+ frame: t - p - T + g.props.timing.getDurationInFrames({ fps: e }) / 2 + a,
387
+ fps: e
388
+ }) : null, R = f ? f.props.timing.getProgress({
389
+ frame: t - p,
390
+ fps: e
391
+ }) : null, st = f ? f.props.timing.getProgress({
392
+ frame: t - (p + T),
393
+ fps: e
394
394
  }) : null;
395
- if (g && w < g.props.timing.getDurationInFrames({ fps: t }) / 2)
395
+ if (g && b < g.props.timing.getDurationInFrames({ fps: e }) / 2)
396
396
  throw new Error(
397
397
  `The duration of a <TransitionSeries.Sequence /> must not be shorter than the duration of the next <TransitionSeries.Transition />. The transition is ${g.props.timing.getDurationInFrames(
398
- { fps: t }
399
- )} frames long, but the sequence is only ${w} frames long (${R})`
398
+ { fps: e }
399
+ )} frames long, but the sequence is only ${b} frames long (${q})`
400
400
  );
401
- if (p && w < p.props.timing.getDurationInFrames({ fps: t }) / 2)
401
+ if (f && b < f.props.timing.getDurationInFrames({ fps: e }) / 2)
402
402
  throw new Error(
403
- `The duration of a <TransitionSeries.Sequence /> must not be shorter than the duration of the previous <TransitionSeries.Transition />. The transition is ${p.props.timing.getDurationInFrames(
404
- { fps: t }
405
- )} frames long, but the sequence is only ${w} frames long (${R})`
403
+ `The duration of a <TransitionSeries.Sequence /> must not be shorter than the duration of the previous <TransitionSeries.Transition />. The transition is ${f.props.timing.getDurationInFrames(
404
+ { fps: e }
405
+ )} frames long, but the sequence is only ${b} frames long (${q})`
406
406
  );
407
- if (g && p && se !== null && k !== null) {
408
- const v = g.props.presentation ?? N(), x = p.props.presentation ?? N(), I = p.props.timing.getDurationInFrames({
409
- fps: t
407
+ if (g && f && st !== null && R !== null) {
408
+ const v = g.props.presentation ?? N(), x = f.props.presentation ?? N(), I = f.props.timing.getDurationInFrames({
409
+ fps: e
410
410
  }), S = g.props.timing.getDurationInFrames({
411
- fps: t
412
- }), q = v.component, U = x.component, j = e < +Math.floor(m) + I / 2, V = e > Math.floor(m) + Math.floor(b) + I / 2, ae = V ? Math.floor(m) + Math.floor(b) + Math.floor(S / 2) : Math.floor(m), H = j ? Math.floor(m) : Math.floor(m) + I / 2, J = g.props.timing.getProgress({
413
- frame: e - (H + b - S / 2),
414
- fps: t
415
- }), le = e > m, ue = e < m + b + S / 2 + I / 2;
411
+ fps: e
412
+ }), C = v.component, U = x.component, H = t < +Math.floor(p) + I / 2, J = t > Math.floor(p) + Math.floor(T) + I / 2, lt = J ? Math.floor(p) + Math.floor(T) + Math.floor(S / 2) : Math.floor(p), K = H ? Math.floor(p) : Math.floor(p) + I / 2, G = g.props.timing.getProgress({
413
+ frame: t - (K + T - S / 2),
414
+ fps: e
415
+ }), ct = t > p, ut = t < p + T + S / 2 + I / 2;
416
416
  return /* @__PURE__ */ o(
417
417
  Y,
418
418
  {
419
- active: ue && le && (j || V),
420
- frame: ae,
419
+ active: ut && ct && (H || J),
420
+ frame: lt,
421
421
  children: /* @__PURE__ */ o(
422
- M,
422
+ L,
423
423
  {
424
- from: H,
425
- durationInFrames: w + S / 2,
424
+ from: K,
425
+ durationInFrames: b + S / 2,
426
426
  ...F,
427
427
  name: F.name || "<TS.Sequence>",
428
428
  children: /* @__PURE__ */ o(
429
- q,
429
+ C,
430
430
  {
431
431
  passedProps: v.props ?? {},
432
432
  presentationDirection: "exiting",
433
- presentationProgress: J,
433
+ presentationProgress: G,
434
434
  presentationDurationInFrames: g.props.timing.getDurationInFrames(
435
- { fps: t }
435
+ { fps: e }
436
436
  ),
437
437
  onElementImage: () => {
438
438
  },
@@ -440,17 +440,17 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
440
440
  },
441
441
  bothEnteringAndExiting: !1,
442
442
  children: /* @__PURE__ */ o(
443
- G,
443
+ Z,
444
444
  {
445
- presentationProgress: J,
445
+ presentationProgress: G,
446
446
  children: /* @__PURE__ */ o(
447
447
  U,
448
448
  {
449
449
  passedProps: x.props ?? {},
450
450
  presentationDirection: "entering",
451
- presentationProgress: k,
452
- presentationDurationInFrames: p.props.timing.getDurationInFrames(
453
- { fps: t }
451
+ presentationProgress: R,
452
+ presentationDurationInFrames: f.props.timing.getDurationInFrames(
453
+ { fps: e }
454
454
  ),
455
455
  onElementImage: () => {
456
456
  },
@@ -458,10 +458,10 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
458
458
  },
459
459
  bothEnteringAndExiting: !1,
460
460
  children: /* @__PURE__ */ o(
461
- K,
461
+ Q,
462
462
  {
463
- presentationProgress: k,
464
- children: a
463
+ presentationProgress: R,
464
+ children: s
465
465
  }
466
466
  )
467
467
  }
@@ -477,18 +477,18 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
477
477
  i
478
478
  );
479
479
  }
480
- if (k !== null && p) {
481
- const v = p.props.timing.getDurationInFrames({ fps: t }) / 2, x = p.props.presentation ?? N(), I = x.component, S = e < m + v, q = S ? Math.floor(m) : Math.floor(m) + v, U = e > q;
480
+ if (R !== null && f) {
481
+ const v = f.props.timing.getDurationInFrames({ fps: e }) / 2, x = f.props.presentation ?? N(), I = x.component, S = t < p + v, C = S ? Math.floor(p) : Math.floor(p) + v, U = t > C;
482
482
  return /* @__PURE__ */ o(
483
483
  Y,
484
484
  {
485
485
  active: U && S,
486
- frame: q,
486
+ frame: C,
487
487
  children: /* @__PURE__ */ o(
488
- M,
488
+ L,
489
489
  {
490
- from: q,
491
- durationInFrames: w,
490
+ from: C,
491
+ durationInFrames: b,
492
492
  ...F,
493
493
  name: F.name || "<TS.Sequence>",
494
494
  children: /* @__PURE__ */ o(
@@ -496,9 +496,9 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
496
496
  {
497
497
  passedProps: x.props ?? {},
498
498
  presentationDirection: "entering",
499
- presentationProgress: k,
500
- presentationDurationInFrames: p.props.timing.getDurationInFrames(
501
- { fps: t }
499
+ presentationProgress: R,
500
+ presentationDurationInFrames: f.props.timing.getDurationInFrames(
501
+ { fps: e }
502
502
  ),
503
503
  onElementImage: () => {
504
504
  },
@@ -506,10 +506,10 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
506
506
  },
507
507
  bothEnteringAndExiting: !1,
508
508
  children: /* @__PURE__ */ o(
509
- K,
509
+ Q,
510
510
  {
511
- presentationProgress: k,
512
- children: a
511
+ presentationProgress: R,
512
+ children: s
513
513
  }
514
514
  )
515
515
  }
@@ -521,18 +521,18 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
521
521
  i
522
522
  );
523
523
  }
524
- if (O !== null && g) {
525
- const v = g.props.timing.getDurationInFrames({ fps: t }) / 2, x = g.props.presentation ?? N(), I = x.component, S = e > Math.floor(b) + Math.floor(m), q = e < Math.floor(b) + Math.floor(m) + v;
524
+ if (P !== null && g) {
525
+ const v = g.props.timing.getDurationInFrames({ fps: e }) / 2, x = g.props.presentation ?? N(), I = x.component, S = t > Math.floor(T) + Math.floor(p), C = t < Math.floor(T) + Math.floor(p) + v;
526
526
  return /* @__PURE__ */ o(
527
527
  Y,
528
528
  {
529
- active: q && S,
530
- frame: Math.floor(b),
529
+ active: C && S,
530
+ frame: Math.floor(T),
531
531
  children: /* @__PURE__ */ o(
532
- M,
532
+ L,
533
533
  {
534
- from: Math.floor(m),
535
- durationInFrames: w + v,
534
+ from: Math.floor(p),
535
+ durationInFrames: b + v,
536
536
  ...F,
537
537
  name: F.name || "<TS.Sequence>",
538
538
  children: /* @__PURE__ */ o(
@@ -540,9 +540,9 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
540
540
  {
541
541
  passedProps: x.props ?? {},
542
542
  presentationDirection: "exiting",
543
- presentationProgress: O,
543
+ presentationProgress: P,
544
544
  presentationDurationInFrames: g.props.timing.getDurationInFrames(
545
- { fps: t }
545
+ { fps: e }
546
546
  ),
547
547
  onElementImage: () => {
548
548
  },
@@ -550,10 +550,10 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
550
550
  },
551
551
  bothEnteringAndExiting: !1,
552
552
  children: /* @__PURE__ */ o(
553
- G,
553
+ Z,
554
554
  {
555
- presentationProgress: O,
556
- children: a
555
+ presentationProgress: P,
556
+ children: s
557
557
  }
558
558
  )
559
559
  }
@@ -566,157 +566,276 @@ const ne = C.createContext(null), re = C.createContext(null), K = ({ presentatio
566
566
  );
567
567
  }
568
568
  return /* @__PURE__ */ o(
569
- M,
569
+ L,
570
570
  {
571
- from: Math.floor(m),
572
- durationInFrames: w,
571
+ from: Math.floor(p),
572
+ durationInFrames: b,
573
573
  ...F,
574
574
  name: F.name || "<TS.Sequence>",
575
- children: a
575
+ children: s
576
576
  },
577
577
  i
578
578
  );
579
579
  });
580
- }, [n, t, e]);
581
- return /* @__PURE__ */ o(ee, { children: r });
582
- }, y = ({ children: n, name: t, layout: e, ...r }) => /* @__PURE__ */ o(M, { name: t ?? "<TransitionSeries>", layout: e ?? "absolute-fill", ...r, children: /* @__PURE__ */ o(Me, { children: n }) });
583
- y.Sequence = z;
584
- y.Transition = L;
585
- Z.addSequenceStackTraces(y);
586
- Z.addSequenceStackTraces(z);
587
- const lt = () => {
588
- const n = C.useContext(ne), t = C.useContext(re);
589
- return !n && !t ? {
580
+ }, [n, e, t]);
581
+ return /* @__PURE__ */ o(et, { children: r });
582
+ }, $ = ({ children: n, name: e, layout: t, ...r }) => /* @__PURE__ */ o(L, { name: e ?? "<TransitionSeries>", layout: t ?? "absolute-fill", ...r, children: /* @__PURE__ */ o(Lt, { children: n }) });
583
+ $.Sequence = j;
584
+ $.Transition = W;
585
+ tt.addSequenceStackTraces($);
586
+ tt.addSequenceStackTraces(j);
587
+ const me = () => {
588
+ const n = M.useContext(rt), e = M.useContext(ot);
589
+ return !n && !e ? {
590
590
  isInTransitionSeries: !1,
591
591
  entering: 1,
592
592
  exiting: 0
593
593
  } : {
594
594
  isInTransitionSeries: !0,
595
595
  entering: (n == null ? void 0 : n.enteringProgress) ?? 1,
596
- exiting: (t == null ? void 0 : t.exitingProgress) ?? 0
596
+ exiting: (e == null ? void 0 : e.exitingProgress) ?? 0
597
597
  };
598
- }, Le = ({
598
+ }, Wt = ({
599
599
  children: n,
600
- presentationDirection: t,
601
- presentationProgress: e,
600
+ presentationDirection: e,
601
+ presentationProgress: t,
602
602
  passedProps: r
603
603
  }) => {
604
- const l = Math.sqrt(r.width ** 2 + r.height ** 2) / 2 * e, u = Be(
605
- r.width / 2,
606
- r.height / 2,
607
- l
608
- ), [a] = A(() => String(B(null))), i = h(() => ({
604
+ const { width: a, height: c, direction: l = "center" } = r;
605
+ let s = a / 2, i = c / 2, m = Math.hypot(a / 2, c / 2);
606
+ l === "from-left" ? (s = 0, i = c / 2, m = Math.hypot(a, c / 2)) : l === "from-right" ? (s = a, i = c / 2, m = Math.hypot(a, c / 2)) : l === "from-top" ? (s = a / 2, i = 0, m = Math.hypot(a / 2, c)) : l === "from-bottom" && (s = a / 2, i = c, m = Math.hypot(a / 2, c));
607
+ const d = m * t, y = Bt(s, i, d), [f] = X(() => String(B(null))), g = h(() => ({
609
608
  width: "100%",
610
609
  height: "100%",
611
- clipPath: t === "exiting" ? void 0 : `url(#${a})`
612
- }), [a, t]);
613
- return /* @__PURE__ */ W(c, { children: [
614
- /* @__PURE__ */ o(c, { style: i, children: n }),
615
- t === "exiting" ? null : /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o("svg", { width: r.width, height: r.height, children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: a, children: /* @__PURE__ */ o("path", { d: u, fill: "black" }) }) }) }) })
610
+ clipPath: e === "exiting" ? void 0 : `url(#${f})`
611
+ }), [f, e]);
612
+ return /* @__PURE__ */ A(u, { children: [
613
+ /* @__PURE__ */ o(u, { style: g, children: n }),
614
+ e === "exiting" ? null : /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o("svg", { width: r.width, height: r.height, children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: f, children: /* @__PURE__ */ o("path", { d: y, fill: "black" }) }) }) }) })
616
615
  ] });
617
- }, Ne = (n) => ({ component: Le, props: n }), Be = (n, t, e) => `M ${n}, ${t}
618
- m -${e}, 0
619
- a ${e},${e} 0 1,0 ${e * 2},0
620
- a ${e},${e} 0 1,0 -${e * 2},0`, We = ({
616
+ }, Nt = (n) => ({ component: Wt, props: n }), Bt = (n, e, t) => `M ${n}, ${e}
617
+ m -${t}, 0
618
+ a ${t},${t} 0 1,0 ${t * 2},0
619
+ a ${t},${t} 0 1,0 -${t * 2},0`, At = ({
621
620
  children: n,
622
- presentationDirection: t,
623
- presentationProgress: e,
621
+ presentationDirection: e,
622
+ presentationProgress: t,
624
623
  passedProps: r
625
624
  }) => {
626
- const { width: s, height: l } = r, u = s * e, a = l * e, i = s / 2 - u / 2, f = l / 2 - a / 2, [d] = A(() => String(B(null))), $ = h(() => ({
625
+ const { width: a, height: c } = r, l = a * t, s = c * t, i = a / 2 - l / 2, m = c / 2 - s / 2, [d] = X(() => String(B(null))), y = h(() => ({
627
626
  width: "100%",
628
627
  height: "100%",
629
- clipPath: t === "exiting" ? void 0 : `url(#${d})`
630
- }), [d, t]);
631
- return /* @__PURE__ */ W(c, { children: [
632
- /* @__PURE__ */ o(c, { style: $, children: n }),
633
- t === "exiting" ? null : /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o("svg", { children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: d, children: /* @__PURE__ */ o(
628
+ clipPath: e === "exiting" ? void 0 : `url(#${d})`
629
+ }), [d, e]);
630
+ return /* @__PURE__ */ A(u, { children: [
631
+ /* @__PURE__ */ o(u, { style: y, children: n }),
632
+ e === "exiting" ? null : /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o("svg", { children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: d, children: /* @__PURE__ */ o(
634
633
  "rect",
635
634
  {
636
635
  x: i,
637
- y: f,
638
- width: u,
639
- height: a,
636
+ y: m,
637
+ width: l,
638
+ height: s,
640
639
  fill: "black"
641
640
  }
642
641
  ) }) }) }) })
643
642
  ] });
644
- }, Ae = (n) => ({ component: We, props: n }), Xe = ({
643
+ }, Xt = (n) => ({ component: At, props: n }), Ot = ({
645
644
  children: n,
646
- presentationDirection: t,
647
- presentationProgress: e,
645
+ presentationDirection: e,
646
+ presentationProgress: t,
648
647
  passedProps: r
649
648
  }) => {
650
- const s = Math.sqrt(r.width ** 2 + r.height ** 2) / 2, l = s * e, u = s * 2 * e, { path: a } = ge({
651
- innerRadius: l,
652
- outerRadius: u,
649
+ const a = Math.sqrt(r.width ** 2 + r.height ** 2) / 2, c = a * t, l = a * 2 * t, { path: s } = yt({
650
+ innerRadius: c,
651
+ outerRadius: l,
653
652
  points: 5
654
- }), i = he(a), f = te(
655
- a,
653
+ }), i = gt(s), m = _(
654
+ s,
656
655
  r.width / 2 - i.width / 2,
657
656
  r.height / 2 - i.height / 2
658
- ), [d] = A(() => String(B(null))), $ = h(() => ({
657
+ ), [d] = X(() => String(B(null))), y = h(() => ({
659
658
  width: "100%",
660
659
  height: "100%",
661
- clipPath: t === "exiting" ? void 0 : `url(#${d})`
662
- }), [d, t]);
663
- return /* @__PURE__ */ W(c, { children: [
664
- /* @__PURE__ */ o(c, { style: $, children: n }),
665
- t === "exiting" ? null : /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o("svg", { children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: d, children: /* @__PURE__ */ o("path", { d: f, fill: "black" }) }) }) }) })
660
+ clipPath: e === "exiting" ? void 0 : `url(#${d})`
661
+ }), [d, e]);
662
+ return /* @__PURE__ */ A(u, { children: [
663
+ /* @__PURE__ */ o(u, { style: y, children: n }),
664
+ e === "exiting" ? null : /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o("svg", { children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: d, children: /* @__PURE__ */ o("path", { d: m, fill: "black" }) }) }) }) })
666
665
  ] });
667
- }, Oe = (n) => ({ component: Xe, props: n }), Ue = ({
666
+ }, Pt = (n) => ({ component: Ot, props: n }), Ut = ({
668
667
  children: n,
669
- presentationDirection: t,
670
- presentationProgress: e,
668
+ presentationDirection: e,
669
+ presentationProgress: t,
671
670
  passedProps: r
672
671
  }) => {
673
- const { width: s, height: l } = r, u = s * e, a = s / 2 - u / 2, [i] = A(() => String(B(null))), f = h(() => ({
672
+ const { width: a, height: c } = r, l = a * t, s = a / 2 - l / 2, [i] = X(() => String(B(null))), m = h(() => ({
674
673
  width: "100%",
675
674
  height: "100%",
676
- clipPath: t === "exiting" ? void 0 : `url(#${i})`
677
- }), [i, t]);
678
- return /* @__PURE__ */ W(c, { children: [
679
- /* @__PURE__ */ o(c, { style: f, children: n }),
680
- t === "exiting" ? null : /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o("svg", { children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: i, children: /* @__PURE__ */ o(
675
+ clipPath: e === "exiting" ? void 0 : `url(#${i})`
676
+ }), [i, e]);
677
+ return /* @__PURE__ */ A(u, { children: [
678
+ /* @__PURE__ */ o(u, { style: m, children: n }),
679
+ e === "exiting" ? null : /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o("svg", { children: /* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("clipPath", { id: i, children: /* @__PURE__ */ o(
681
680
  "rect",
682
681
  {
683
- x: a,
682
+ x: s,
684
683
  y: 0,
685
- width: u,
686
- height: l,
684
+ width: l,
685
+ height: c,
687
686
  fill: "black"
688
687
  }
689
688
  ) }) }) }) })
690
689
  ] });
691
- }, Ye = (n) => ({ component: Ue, props: n });
692
- var De = ({ children: n, presentationDirection: t, presentationProgress: e, passedProps: r }) => {
693
- const s = t === "entering", l = h(() => ({
694
- opacity: s ? e : r.shouldFadeOutExitingScene ? 1 - e : 1,
695
- ...t === "entering" ? r.enterStyle : r.exitStyle
690
+ }, Yt = (n) => ({ component: Ut, props: n }), zt = ({
691
+ children: n,
692
+ presentationDirection: e,
693
+ presentationProgress: t,
694
+ passedProps: r
695
+ }) => {
696
+ const { direction: a = "from-left" } = r, c = h(() => {
697
+ let l = 0, s = 0;
698
+ switch (a) {
699
+ case "from-left":
700
+ l = e === "entering" ? -100 + t * 100 : t * 100;
701
+ break;
702
+ case "from-right":
703
+ l = e === "entering" ? 100 - t * 100 : -t * 100;
704
+ break;
705
+ case "from-top":
706
+ s = e === "entering" ? -100 + t * 100 : t * 100;
707
+ break;
708
+ case "from-bottom":
709
+ s = e === "entering" ? 100 - t * 100 : -t * 100;
710
+ break;
711
+ case "top-left":
712
+ l = e === "entering" ? -100 + t * 100 : t * 100, s = e === "entering" ? -100 + t * 100 : t * 100;
713
+ break;
714
+ case "top-right":
715
+ l = e === "entering" ? 100 - t * 100 : -t * 100, s = e === "entering" ? -100 + t * 100 : t * 100;
716
+ break;
717
+ case "bottom-left":
718
+ l = e === "entering" ? -100 + t * 100 : t * 100, s = e === "entering" ? 100 - t * 100 : -t * 100;
719
+ break;
720
+ case "bottom-right":
721
+ l = e === "entering" ? 100 - t * 100 : -t * 100, s = e === "entering" ? 100 - t * 100 : -t * 100;
722
+ break;
723
+ }
724
+ return {
725
+ width: "100%",
726
+ height: "100%",
727
+ transform: `translate3d(${l}%, ${s}%, 0)`
728
+ };
729
+ }, [a, e, t]);
730
+ return /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(u, { style: c, children: n }) });
731
+ }, _t = (n = {}) => ({
732
+ component: zt,
733
+ props: n
734
+ }), jt = ({
735
+ children: n,
736
+ presentationDirection: e,
737
+ presentationProgress: t,
738
+ passedProps: r
739
+ }) => {
740
+ const { direction: a = "from-left" } = r, c = h(() => {
741
+ if (e === "exiting")
742
+ return { width: "100%", height: "100%" };
743
+ const l = t * 100;
744
+ let s = "inset(0 0 0 0)";
745
+ switch (a) {
746
+ case "from-left":
747
+ s = `inset(0 ${100 - l}% 0 0)`;
748
+ break;
749
+ case "from-right":
750
+ s = `inset(0 0 0 ${100 - l}%)`;
751
+ break;
752
+ case "from-top":
753
+ s = `inset(0 0 ${100 - l}% 0)`;
754
+ break;
755
+ case "from-bottom":
756
+ s = `inset(${100 - l}% 0 0 0)`;
757
+ break;
758
+ case "top-left": {
759
+ const i = t * 200;
760
+ s = `polygon(0 0, ${i}% 0, 0 ${i}%)`;
761
+ break;
762
+ }
763
+ case "top-right": {
764
+ const i = t * 200;
765
+ s = `polygon(100% 0, ${100 - i}% 0, 100% ${i}%)`;
766
+ break;
767
+ }
768
+ case "bottom-left": {
769
+ const i = t * 200;
770
+ s = `polygon(0 100%, ${i}% 100%, 0 ${100 - i}%)`;
771
+ break;
772
+ }
773
+ case "bottom-right": {
774
+ const i = t * 200;
775
+ s = `polygon(100% 100%, ${100 - i}% 100%, 100% ${100 - i}%)`;
776
+ break;
777
+ }
778
+ default:
779
+ s = `inset(0 ${100 - l}% 0 0)`;
780
+ break;
781
+ }
782
+ return {
783
+ width: "100%",
784
+ height: "100%",
785
+ clipPath: s
786
+ };
787
+ }, [a, e, t]);
788
+ return /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(u, { style: c, children: n }) });
789
+ }, Vt = (n = {}) => ({
790
+ component: jt,
791
+ props: n
792
+ }), Ht = ({ children: n, presentationDirection: e, presentationProgress: t, passedProps: r }) => {
793
+ const a = r.direction === "counter-clockwise" || r.direction === "counterclockwise", c = Math.sqrt(r.width ** 2 + r.height ** 2) / 2, { path: l } = nt({
794
+ radius: c,
795
+ progress: t,
796
+ counterClockwise: a
797
+ }), s = _(
798
+ l,
799
+ -(c * 2 - r.width) / 2,
800
+ -(c * 2 - r.height) / 2
801
+ ), i = h(() => ({
802
+ width: "100%",
803
+ height: "100%",
804
+ clipPath: e === "exiting" ? void 0 : `path("${s}")`
805
+ }), [s, e]);
806
+ return /* @__PURE__ */ o(u, { children: /* @__PURE__ */ o(u, { style: i, children: n }) });
807
+ }, Jt = (n) => ({
808
+ component: Ht,
809
+ props: n ?? { width: 1920, height: 1080 }
810
+ });
811
+ var Kt = ({ children: n, presentationDirection: e, presentationProgress: t, passedProps: r }) => {
812
+ const a = e === "entering", c = h(() => ({
813
+ opacity: a ? t : r.shouldFadeOutExitingScene ? 1 - t : 1,
814
+ ...e === "entering" ? r.enterStyle : r.exitStyle
696
815
  }), [
697
- s,
816
+ a,
698
817
  r.enterStyle,
699
818
  r.exitStyle,
700
819
  r.shouldFadeOutExitingScene,
701
- t,
702
- e
820
+ e,
821
+ t
703
822
  ]);
704
- return /* @__PURE__ */ o(c, {
705
- style: l,
823
+ return /* @__PURE__ */ o(u, {
824
+ style: c,
706
825
  children: n
707
826
  });
708
- }, Q = (n) => ({
709
- component: De,
827
+ }, D = (n) => ({
828
+ component: Kt,
710
829
  props: n ?? {}
711
- }), ze = 0.01, _e = ({
830
+ }), Gt = 0.01, Qt = ({
712
831
  children: n,
713
- presentationProgress: t,
714
- presentationDirection: e,
715
- passedProps: { direction: r = "from-left", enterStyle: s, exitStyle: l }
832
+ presentationProgress: e,
833
+ presentationDirection: t,
834
+ passedProps: { direction: r = "from-left", enterStyle: a, exitStyle: c }
716
835
  }) => {
717
- const u = h(() => {
718
- const i = t === 1 ? t * 100 : t * 100 - ze;
719
- if (e === "exiting")
836
+ const l = h(() => {
837
+ const i = e === 1 ? e * 100 : e * 100 - Gt;
838
+ if (t === "exiting")
720
839
  switch (r) {
721
840
  case "from-left":
722
841
  return {
@@ -724,7 +843,7 @@ var De = ({ children: n, presentationDirection: t, presentationProgress: e, pass
724
843
  };
725
844
  case "from-right":
726
845
  return {
727
- transform: `translateX(${-t * 100}%)`
846
+ transform: `translateX(${-e * 100}%)`
728
847
  };
729
848
  case "from-top":
730
849
  return {
@@ -732,7 +851,7 @@ var De = ({ children: n, presentationDirection: t, presentationProgress: e, pass
732
851
  };
733
852
  case "from-bottom":
734
853
  return {
735
- transform: `translateY(${-t * 100}%)`
854
+ transform: `translateY(${-e * 100}%)`
736
855
  };
737
856
  default:
738
857
  throw new Error(`Invalid direction: ${r}`);
@@ -740,7 +859,7 @@ var De = ({ children: n, presentationDirection: t, presentationProgress: e, pass
740
859
  switch (r) {
741
860
  case "from-left":
742
861
  return {
743
- transform: `translateX(${-100 + t * 100}%)`
862
+ transform: `translateX(${-100 + e * 100}%)`
744
863
  };
745
864
  case "from-right":
746
865
  return {
@@ -748,7 +867,7 @@ var De = ({ children: n, presentationDirection: t, presentationProgress: e, pass
748
867
  };
749
868
  case "from-top":
750
869
  return {
751
- transform: `translateY(${-100 + t * 100}%)`
870
+ transform: `translateY(${-100 + e * 100}%)`
752
871
  };
753
872
  case "from-bottom":
754
873
  return {
@@ -757,264 +876,271 @@ var De = ({ children: n, presentationDirection: t, presentationProgress: e, pass
757
876
  default:
758
877
  throw new Error(`Invalid direction: ${r}`);
759
878
  }
760
- }, [e, t, r]), a = h(() => ({
879
+ }, [t, e, r]), s = h(() => ({
761
880
  width: "100%",
762
881
  height: "100%",
763
882
  justifyContent: "center",
764
883
  alignItems: "center",
765
- ...u,
766
- ...e === "entering" ? s : l
767
- }), [u, s, l, e]);
768
- return /* @__PURE__ */ o(c, {
769
- style: a,
884
+ ...l,
885
+ ...t === "entering" ? a : c
886
+ }), [l, a, c, t]);
887
+ return /* @__PURE__ */ o(u, {
888
+ style: s,
770
889
  children: n
771
890
  });
772
- }, je = (n) => ({
773
- component: _e,
891
+ }, fe = (n) => ({
892
+ component: Qt,
774
893
  props: n ?? {}
775
- }), Ve = (n, t) => {
776
- const e = n * 100;
777
- switch (t) {
894
+ }), Zt = (n, e) => {
895
+ const t = n * 100;
896
+ switch (e) {
778
897
  case "from-left":
779
- return `polygon(0% 0%, ${e}% 0%, ${e}% 100%, 0% 100%)`;
898
+ return `polygon(0% 0%, ${t}% 0%, ${t}% 100%, 0% 100%)`;
780
899
  case "from-top-left":
781
- return `polygon(0% 0%, ${e * 2}% 0%, 0% ${e * 2}%)`;
900
+ return `polygon(0% 0%, ${t * 2}% 0%, 0% ${t * 2}%)`;
782
901
  case "from-top":
783
- return `polygon(0% 0%, 100% 0%, 100% ${e}%, 0% ${e}%)`;
902
+ return `polygon(0% 0%, 100% 0%, 100% ${t}%, 0% ${t}%)`;
784
903
  case "from-top-right":
785
- return `polygon(100% 0%, ${100 - e * 2}% 0%, 100% ${e * 2}%)`;
904
+ return `polygon(100% 0%, ${100 - t * 2}% 0%, 100% ${t * 2}%)`;
786
905
  case "from-right":
787
- return `polygon(100% 0%, 100% 100%, ${100 - e}% 100%, ${100 - e}% 0%)`;
906
+ return `polygon(100% 0%, 100% 100%, ${100 - t}% 100%, ${100 - t}% 0%)`;
788
907
  case "from-bottom-right":
789
- return `polygon(100% 100%, ${100 - e * 2}% 100%, 100% ${100 - e * 2}%)`;
908
+ return `polygon(100% 100%, ${100 - t * 2}% 100%, 100% ${100 - t * 2}%)`;
790
909
  case "from-bottom":
791
- return `polygon(0% 100%, 100% 100%, 100% ${100 - e}%, 0% ${100 - e}%)`;
910
+ return `polygon(0% 100%, 100% 100%, 100% ${100 - t}%, 0% ${100 - t}%)`;
792
911
  case "from-bottom-left":
793
- return `polygon(0% 100%, 0% ${100 - e * 2}%, ${e * 2}% 100%)`;
912
+ return `polygon(0% 100%, 0% ${100 - t * 2}%, ${t * 2}% 100%)`;
794
913
  default:
795
- throw new Error(`Unknown direction ${JSON.stringify(t)}`);
914
+ throw new Error(`Unknown direction ${JSON.stringify(e)}`);
796
915
  }
797
- }, He = (n, t) => {
798
- const e = n * 100;
799
- switch (t) {
916
+ }, Dt = (n, e) => {
917
+ const t = n * 100;
918
+ switch (e) {
800
919
  case "from-left":
801
- return `polygon(100% 100%, ${100 - e}% 100%, ${100 - e}% 0%, 100% 0%)`;
920
+ return `polygon(100% 100%, ${100 - t}% 100%, ${100 - t}% 0%, 100% 0%)`;
802
921
  case "from-top-left":
803
- return `polygon(100% 100%, ${100 - e * 2}% 100%, 100% ${100 - e * 2}%)`;
922
+ return `polygon(100% 100%, ${100 - t * 2}% 100%, 100% ${100 - t * 2}%)`;
804
923
  case "from-top":
805
- return `polygon(100% 100%, 0% 100%, 0% ${100 - e}%, 100% ${100 - e}%)`;
924
+ return `polygon(100% 100%, 0% 100%, 0% ${100 - t}%, 100% ${100 - t}%)`;
806
925
  case "from-top-right":
807
- return `polygon(0% 100%, ${e * 2}% 100%, 0% ${100 - e * 2}%)`;
926
+ return `polygon(0% 100%, ${t * 2}% 100%, 0% ${100 - t * 2}%)`;
808
927
  case "from-right":
809
- return `polygon(0% 0%, ${e}% 0%, ${e}% 100%, 0% 100%)`;
928
+ return `polygon(0% 0%, ${t}% 0%, ${t}% 100%, 0% 100%)`;
810
929
  case "from-bottom-right":
811
- return `polygon(0% 0%, ${e * 2}% 0%, 0% ${e * 2}%)`;
930
+ return `polygon(0% 0%, ${t * 2}% 0%, 0% ${t * 2}%)`;
812
931
  case "from-bottom":
813
- return `polygon(100% 0%, 0% 0%, 0% ${e}%, 100% ${e}%)`;
932
+ return `polygon(100% 0%, 0% 0%, 0% ${t}%, 100% ${t}%)`;
814
933
  case "from-bottom-left":
815
- return `polygon(100% 0%, ${100 - e * 2}% 0%, 100% ${e * 2}%)`;
934
+ return `polygon(100% 0%, ${100 - t * 2}% 0%, 100% ${t * 2}%)`;
816
935
  default:
817
- throw new Error(`Unknown direction ${JSON.stringify(t)}`);
936
+ throw new Error(`Unknown direction ${JSON.stringify(e)}`);
818
937
  }
819
- }, Je = ({
938
+ }, te = ({
820
939
  children: n,
821
- presentationProgress: t,
822
- presentationDirection: e,
940
+ presentationProgress: e,
941
+ presentationDirection: t,
823
942
  passedProps: {
824
943
  direction: r = "from-left",
825
- innerEnterStyle: s,
826
- innerExitStyle: l,
827
- outerEnterStyle: u,
828
- outerExitStyle: a
944
+ innerEnterStyle: a,
945
+ innerExitStyle: c,
946
+ outerEnterStyle: l,
947
+ outerExitStyle: s
829
948
  }
830
949
  }) => {
831
- const i = e === "entering" ? t : 1 - t, f = e === "entering" ? Ve(i, r) : He(i, r), d = h(() => ({
950
+ const i = t === "entering" ? e : 1 - e, m = t === "entering" ? Zt(i, r) : Dt(i, r), d = h(() => ({
832
951
  width: "100%",
833
952
  height: "100%",
834
953
  justifyContent: "center",
835
954
  alignItems: "center",
836
- clipPath: f,
837
- ...e === "entering" ? s : l
838
- }), [f, s, l, e]), $ = h(() => e === "entering" ? u : a, [u, a, e]);
839
- return /* @__PURE__ */ o(c, {
840
- style: $,
841
- children: /* @__PURE__ */ o(c, {
955
+ clipPath: m,
956
+ ...t === "entering" ? a : c
957
+ }), [m, a, c, t]), y = h(() => t === "entering" ? l : s, [l, s, t]);
958
+ return /* @__PURE__ */ o(u, {
959
+ style: y,
960
+ children: /* @__PURE__ */ o(u, {
842
961
  style: d,
843
962
  children: n
844
963
  })
845
964
  });
846
- }, Ke = (n) => ({
847
- component: Je,
965
+ }, de = (n) => ({
966
+ component: te,
848
967
  props: n ?? {}
849
- }), Ge = ({
968
+ }), ee = ({
850
969
  children: n,
851
- presentationDirection: t,
852
- presentationProgress: e,
970
+ presentationDirection: e,
971
+ presentationProgress: t,
853
972
  passedProps: {
854
973
  direction: r = "from-left",
855
- perspective: s = 1e3,
856
- innerEnterStyle: l,
857
- innerExitStyle: u,
858
- outerEnterStyle: a,
974
+ perspective: a = 1e3,
975
+ innerEnterStyle: c,
976
+ innerExitStyle: l,
977
+ outerEnterStyle: s,
859
978
  outerExitStyle: i
860
979
  }
861
980
  }) => {
862
- const f = h(() => {
863
- const g = t === "entering" ? D(e, [0, 1], [r === "from-right" || r === "from-top" ? 180 : -180, 0]) : D(e, [0, 1], [0, r === "from-right" || r === "from-top" ? -180 : 180]);
981
+ const m = h(() => {
982
+ const g = e === "entering" ? z(t, [0, 1], [r === "from-right" || r === "from-top" ? 180 : -180, 0]) : z(t, [0, 1], [0, r === "from-right" || r === "from-top" ? -180 : 180]);
864
983
  return {
865
984
  width: "100%",
866
985
  height: "100%",
867
986
  transform: `${r === "from-top" || r === "from-bottom" ? "rotateX" : "rotateY"}(${g}deg)`,
868
987
  backfaceVisibility: "hidden",
869
988
  WebkitBackfaceVisibility: "hidden",
870
- ...t === "entering" ? l : u
989
+ ...e === "entering" ? c : l
871
990
  };
872
991
  }, [
873
992
  r,
993
+ c,
874
994
  l,
875
- u,
876
- t,
877
- e
995
+ e,
996
+ t
878
997
  ]), d = h(() => ({
879
- perspective: s,
998
+ perspective: a,
880
999
  transformStyle: "preserve-3d",
881
- ...t === "entering" ? a : i
882
- }), [a, i, s, t]);
883
- return /* @__PURE__ */ o(c, {
1000
+ ...e === "entering" ? s : i
1001
+ }), [s, i, a, e]);
1002
+ return /* @__PURE__ */ o(u, {
884
1003
  style: d,
885
- children: /* @__PURE__ */ o(c, {
886
- style: f,
1004
+ children: /* @__PURE__ */ o(u, {
1005
+ style: m,
887
1006
  children: n
888
1007
  })
889
1008
  });
890
- }, Qe = (n) => ({ component: Ge, props: n ?? {} }), Ze = ({ children: n, presentationDirection: t, presentationProgress: e, passedProps: r }) => {
891
- const s = Math.sqrt(r.width ** 2 + r.height ** 2) / 2, { path: l } = ye({
892
- radius: s,
893
- progress: e
894
- }), u = te(l, -(s * 2 - r.width) / 2, -(s * 2 - r.height) / 2), a = h(() => ({
1009
+ }, ne = (n) => ({ component: ee, props: n ?? {} }), re = ({ children: n, presentationDirection: e, presentationProgress: t, passedProps: r }) => {
1010
+ const a = Math.sqrt(r.width ** 2 + r.height ** 2) / 2, { path: c } = nt({
1011
+ radius: a,
1012
+ progress: t
1013
+ }), l = _(c, -(a * 2 - r.width) / 2, -(a * 2 - r.height) / 2), s = h(() => ({
895
1014
  width: "100%",
896
1015
  height: "100%",
897
- clipPath: t === "exiting" ? void 0 : `path("${u}")`,
898
- ...t === "entering" ? r.innerEnterStyle : r.innerExitStyle
1016
+ clipPath: e === "exiting" ? void 0 : `path("${l}")`,
1017
+ ...e === "entering" ? r.innerEnterStyle : r.innerExitStyle
899
1018
  }), [
900
- u,
1019
+ l,
901
1020
  r.innerEnterStyle,
902
1021
  r.innerExitStyle,
903
- t
904
- ]), i = h(() => t === "entering" ? r.outerEnterStyle : r.outerExitStyle, [
1022
+ e
1023
+ ]), i = h(() => e === "entering" ? r.outerEnterStyle : r.outerExitStyle, [
905
1024
  r.outerEnterStyle,
906
1025
  r.outerExitStyle,
907
- t
1026
+ e
908
1027
  ]);
909
- return /* @__PURE__ */ o(c, {
1028
+ return /* @__PURE__ */ o(u, {
910
1029
  style: i,
911
- children: /* @__PURE__ */ o(c, {
912
- style: a,
1030
+ children: /* @__PURE__ */ o(u, {
1031
+ style: s,
913
1032
  children: n
914
1033
  })
915
1034
  });
916
- }, et = (n) => ({ component: Ze, props: n ?? {} });
917
- const ut = {
1035
+ }, he = (n) => ({ component: re, props: n ?? {} });
1036
+ const pe = {
918
1037
  none: ({ id: n }) => /* @__PURE__ */ o(
919
- y.Transition,
1038
+ $.Transition,
920
1039
  {
921
- presentation: Q(),
922
- timing: T({ durationInFrames: 1 })
1040
+ presentation: D(),
1041
+ timing: w({ durationInFrames: 1 })
923
1042
  },
924
1043
  n
925
1044
  ),
926
- fade: ({ durationInFrames: n, id: t }) => /* @__PURE__ */ o(
927
- y.Transition,
1045
+ fade: ({ durationInFrames: n, id: e }) => /* @__PURE__ */ o(
1046
+ $.Transition,
928
1047
  {
929
- presentation: Q(),
930
- timing: T({ durationInFrames: n })
1048
+ presentation: D(),
1049
+ timing: w({ durationInFrames: n })
931
1050
  },
932
- t
1051
+ e
933
1052
  ),
934
- slide: ({ durationInFrames: n, id: t, direction: e }) => /* @__PURE__ */ o(
935
- y.Transition,
1053
+ slide: ({ durationInFrames: n, id: e, direction: t }) => /* @__PURE__ */ o(
1054
+ $.Transition,
936
1055
  {
937
- presentation: je({ direction: e }),
938
- timing: T({ durationInFrames: n })
1056
+ presentation: _t({ direction: t || "from-left" }),
1057
+ timing: w({ durationInFrames: n })
939
1058
  },
940
- t
1059
+ e
941
1060
  ),
942
- wipe: ({ durationInFrames: n, id: t, direction: e }) => /* @__PURE__ */ o(
943
- y.Transition,
1061
+ wipe: ({ durationInFrames: n, id: e, direction: t }) => /* @__PURE__ */ o(
1062
+ $.Transition,
944
1063
  {
945
- presentation: Ke({ direction: e }),
946
- timing: T({ durationInFrames: n })
1064
+ presentation: Vt({ direction: t || "from-left" }),
1065
+ timing: w({ durationInFrames: n })
947
1066
  },
948
- t
1067
+ e
949
1068
  ),
950
- flip: ({ durationInFrames: n, id: t }) => /* @__PURE__ */ o(
951
- y.Transition,
1069
+ flip: ({ durationInFrames: n, id: e, direction: t }) => /* @__PURE__ */ o(
1070
+ $.Transition,
952
1071
  {
953
- presentation: Qe(),
954
- timing: T({ durationInFrames: n })
1072
+ presentation: ne({ direction: t || "from-left" }),
1073
+ timing: w({ durationInFrames: n })
955
1074
  },
956
- t
1075
+ e
957
1076
  ),
958
- clockWipe: ({ width: n, height: t, durationInFrames: e, id: r }) => /* @__PURE__ */ o(
959
- y.Transition,
1077
+ clockWipe: ({ width: n, height: e, durationInFrames: t, id: r, direction: a }) => /* @__PURE__ */ o(
1078
+ $.Transition,
960
1079
  {
961
- presentation: et({ width: n, height: t }),
962
- timing: T({ durationInFrames: e })
1080
+ presentation: Jt({ width: n, height: e, direction: a }),
1081
+ timing: w({ durationInFrames: t })
963
1082
  },
964
1083
  r
965
1084
  ),
966
- star: ({ width: n, height: t, durationInFrames: e, id: r }) => /* @__PURE__ */ o(
967
- y.Transition,
1085
+ star: ({ width: n, height: e, durationInFrames: t, id: r }) => /* @__PURE__ */ o(
1086
+ $.Transition,
968
1087
  {
969
- presentation: Oe({ width: n, height: t }),
970
- timing: T({ durationInFrames: e })
1088
+ presentation: Pt({ width: n, height: e }),
1089
+ timing: w({ durationInFrames: t })
971
1090
  },
972
1091
  r
973
1092
  ),
974
- circle: ({ width: n, height: t, durationInFrames: e, id: r }) => /* @__PURE__ */ o(
975
- y.Transition,
1093
+ circle: ({ width: n, height: e, durationInFrames: t, id: r, direction: a }) => /* @__PURE__ */ o(
1094
+ $.Transition,
976
1095
  {
977
- presentation: Ne({ width: n, height: t }),
978
- timing: T({ durationInFrames: e })
1096
+ presentation: Nt({
1097
+ width: n,
1098
+ height: e,
1099
+ direction: a
1100
+ }),
1101
+ timing: w({ durationInFrames: t })
979
1102
  },
980
1103
  r
981
1104
  ),
982
- rectangle: ({ width: n, height: t, durationInFrames: e, id: r }) => /* @__PURE__ */ o(
983
- y.Transition,
1105
+ rectangle: ({ width: n, height: e, durationInFrames: t, id: r }) => /* @__PURE__ */ o(
1106
+ $.Transition,
984
1107
  {
985
- presentation: Ae({ width: n, height: t }),
986
- timing: T({ durationInFrames: e })
1108
+ presentation: Xt({ width: n, height: e }),
1109
+ timing: w({ durationInFrames: t })
987
1110
  },
988
1111
  r
989
1112
  ),
990
1113
  slidingDoors: ({
991
1114
  width: n,
992
- height: t,
993
- durationInFrames: e,
1115
+ height: e,
1116
+ durationInFrames: t,
994
1117
  id: r
995
1118
  }) => /* @__PURE__ */ o(
996
- y.Transition,
1119
+ $.Transition,
997
1120
  {
998
- presentation: Ye({ width: n, height: t }),
999
- timing: T({ durationInFrames: e })
1121
+ presentation: Yt({ width: n, height: e }),
1122
+ timing: w({ durationInFrames: t })
1000
1123
  },
1001
1124
  r
1002
1125
  )
1003
1126
  };
1004
1127
  export {
1005
- y as TransitionSeries,
1006
- ut as Transitions,
1007
- Ne as circle,
1008
- et as clockWipe,
1009
- Q as fade,
1010
- Qe as flip,
1011
- T as linearTiming,
1012
- Ae as rectangle,
1013
- je as slide,
1014
- Ye as slidingDoors,
1015
- at as springTiming,
1016
- Oe as star,
1017
- lt as useTransitionProgress,
1018
- Ke as wipe
1128
+ $ as TransitionSeries,
1129
+ pe as Transitions,
1130
+ Nt as circle,
1131
+ he as clockWipe,
1132
+ Jt as customClockWipe,
1133
+ _t as customSlide,
1134
+ Vt as customWipe,
1135
+ D as fade,
1136
+ ne as flip,
1137
+ w as linearTiming,
1138
+ Xt as rectangle,
1139
+ fe as slide,
1140
+ Yt as slidingDoors,
1141
+ ue as springTiming,
1142
+ Pt as star,
1143
+ me as useTransitionProgress,
1144
+ de as wipe
1019
1145
  };
1020
1146
  //# sourceMappingURL=index.es.js.map