motion 12.12.0 → 12.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -52,6 +52,10 @@ const MotionGlobalConfig = {};
52
52
  */
53
53
  const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
54
54
 
55
+ function isObject(value) {
56
+ return typeof value === "object" && value !== null;
57
+ }
58
+
55
59
  /**
56
60
  * Check if the value is a zero value string like "0px" or "0%"
57
61
  */
@@ -2596,6 +2600,14 @@ function canAnimate(keyframes, name, type, velocity) {
2596
2600
  ((type === "spring" || isGenerator(type)) && velocity));
2597
2601
  }
2598
2602
 
2603
+ /**
2604
+ * Checks if an element is an HTML element in a way
2605
+ * that works across iframes
2606
+ */
2607
+ function isHTMLElement(element) {
2608
+ return isObject(element) && "offsetHeight" in element;
2609
+ }
2610
+
2599
2611
  /**
2600
2612
  * A list of values that can be hardware-accelerated.
2601
2613
  */
@@ -2604,16 +2616,13 @@ const acceleratedValues$1 = new Set([
2604
2616
  "clipPath",
2605
2617
  "filter",
2606
2618
  "transform",
2607
- // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
2608
- // or until we implement support for linear() easing.
2619
+ // TODO: Could be re-enabled now we have support for linear() easing
2609
2620
  // "background-color"
2610
2621
  ]);
2611
2622
  const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
2612
2623
  function supportsBrowserAnimation(options) {
2613
2624
  const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
2614
- if (!motionValue ||
2615
- !motionValue.owner ||
2616
- !(motionValue.owner.current instanceof HTMLElement)) {
2625
+ if (!isHTMLElement(motionValue?.owner?.current)) {
2617
2626
  return false;
2618
2627
  }
2619
2628
  const { onUpdate, transformTemplate } = motionValue.owner.getProps();
@@ -4029,7 +4038,7 @@ function press(targetOrSelector, onPressStart, options = {}) {
4029
4038
  targets.forEach((target) => {
4030
4039
  const pointerDownTarget = options.useGlobalTarget ? window : target;
4031
4040
  pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions);
4032
- if (target instanceof HTMLElement) {
4041
+ if (isHTMLElement(target)) {
4033
4042
  target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions));
4034
4043
  if (!isElementKeyboardAccessible(target) &&
4035
4044
  !target.hasAttribute("tabindex")) {
@@ -4174,6 +4183,22 @@ function recordStats() {
4174
4183
  return reportStats;
4175
4184
  }
4176
4185
 
4186
+ /**
4187
+ * Checks if an element is an SVG element in a way
4188
+ * that works across iframes
4189
+ */
4190
+ function isSVGElement(element) {
4191
+ return isObject(element) && "ownerSVGElement" in element;
4192
+ }
4193
+
4194
+ /**
4195
+ * Checks if an element is specifically an SVGSVGElement (the root SVG element)
4196
+ * in a way that works across iframes
4197
+ */
4198
+ function isSVGSVGElement(element) {
4199
+ return isSVGElement(element) && element.tagName === "svg";
4200
+ }
4201
+
4177
4202
  function transform(...args) {
4178
4203
  const useImmediate = !Array.isArray(args[0]);
4179
4204
  const argOffset = useImmediate ? 0 : -1;
@@ -5332,10 +5357,6 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
5332
5357
  return animations;
5333
5358
  }
5334
5359
 
5335
- function isSVGElement(element) {
5336
- return element instanceof SVGElement && element.tagName !== "svg";
5337
- }
5338
-
5339
5360
  /**
5340
5361
  * Bounding boxes tend to be defined as top, left, right, bottom. For various operations
5341
5362
  * it's easier to consider each axis individually. This function returns a bounding box
@@ -6395,7 +6416,7 @@ function createDOMVisualElement(element) {
6395
6416
  latestValues: {},
6396
6417
  },
6397
6418
  };
6398
- const node = isSVGElement(element)
6419
+ const node = isSVGElement(element) && !isSVGSVGElement(element)
6399
6420
  ? new SVGVisualElement(options)
6400
6421
  : new HTMLVisualElement(options);
6401
6422
  node.mount(element);
@@ -6619,7 +6640,7 @@ function getElementSize(target, borderBoxSize) {
6619
6640
  const { inlineSize, blockSize } = borderBoxSize[0];
6620
6641
  return { width: inlineSize, height: blockSize };
6621
6642
  }
6622
- else if (target instanceof SVGElement && "getBBox" in target) {
6643
+ else if (isSVGElement(target) && "getBBox" in target) {
6623
6644
  return target.getBBox();
6624
6645
  }
6625
6646
  else {
@@ -6761,7 +6782,7 @@ function calcInset(element, container) {
6761
6782
  const inset = { x: 0, y: 0 };
6762
6783
  let current = element;
6763
6784
  while (current && current !== container) {
6764
- if (current instanceof HTMLElement) {
6785
+ if (isHTMLElement(current)) {
6765
6786
  inset.x += current.offsetLeft;
6766
6787
  inset.y += current.offsetTop;
6767
6788
  current = current.offsetParent;
@@ -7320,10 +7341,14 @@ exports.isDragActive = isDragActive;
7320
7341
  exports.isDragging = isDragging;
7321
7342
  exports.isEasingArray = isEasingArray;
7322
7343
  exports.isGenerator = isGenerator;
7344
+ exports.isHTMLElement = isHTMLElement;
7323
7345
  exports.isMotionValue = isMotionValue;
7324
7346
  exports.isNodeOrChild = isNodeOrChild;
7325
7347
  exports.isNumericalString = isNumericalString;
7348
+ exports.isObject = isObject;
7326
7349
  exports.isPrimaryPointer = isPrimaryPointer;
7350
+ exports.isSVGElement = isSVGElement;
7351
+ exports.isSVGSVGElement = isSVGSVGElement;
7327
7352
  exports.isWaapiSupportedEasing = isWaapiSupportedEasing;
7328
7353
  exports.isZeroValueString = isZeroValueString;
7329
7354
  exports.keyframes = keyframes;
@@ -91,6 +91,10 @@ const MotionGlobalConfig = {};
91
91
  */
92
92
  const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
93
93
 
94
+ function isObject(value) {
95
+ return typeof value === "object" && value !== null;
96
+ }
97
+
94
98
  /**
95
99
  * Check if the value is a zero value string like "0px" or "0%"
96
100
  */
@@ -2591,6 +2595,14 @@ function canAnimate(keyframes, name, type, velocity) {
2591
2595
  ((type === "spring" || isGenerator(type)) && velocity));
2592
2596
  }
2593
2597
 
2598
+ /**
2599
+ * Checks if an element is an HTML element in a way
2600
+ * that works across iframes
2601
+ */
2602
+ function isHTMLElement(element) {
2603
+ return isObject(element) && "offsetHeight" in element;
2604
+ }
2605
+
2594
2606
  /**
2595
2607
  * A list of values that can be hardware-accelerated.
2596
2608
  */
@@ -2599,16 +2611,13 @@ const acceleratedValues = new Set([
2599
2611
  "clipPath",
2600
2612
  "filter",
2601
2613
  "transform",
2602
- // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
2603
- // or until we implement support for linear() easing.
2614
+ // TODO: Could be re-enabled now we have support for linear() easing
2604
2615
  // "background-color"
2605
2616
  ]);
2606
2617
  const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
2607
2618
  function supportsBrowserAnimation(options) {
2608
2619
  const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
2609
- if (!motionValue ||
2610
- !motionValue.owner ||
2611
- !(motionValue.owner.current instanceof HTMLElement)) {
2620
+ if (!isHTMLElement(motionValue?.owner?.current)) {
2612
2621
  return false;
2613
2622
  }
2614
2623
  const { onUpdate, transformTemplate } = motionValue.owner.getProps();
@@ -3730,7 +3739,7 @@ function press(targetOrSelector, onPressStart, options = {}) {
3730
3739
  targets.forEach((target) => {
3731
3740
  const pointerDownTarget = options.useGlobalTarget ? window : target;
3732
3741
  pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions);
3733
- if (target instanceof HTMLElement) {
3742
+ if (isHTMLElement(target)) {
3734
3743
  target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions));
3735
3744
  if (!isElementKeyboardAccessible(target) &&
3736
3745
  !target.hasAttribute("tabindex")) {
@@ -3741,6 +3750,22 @@ function press(targetOrSelector, onPressStart, options = {}) {
3741
3750
  return cancelEvents;
3742
3751
  }
3743
3752
 
3753
+ /**
3754
+ * Checks if an element is an SVG element in a way
3755
+ * that works across iframes
3756
+ */
3757
+ function isSVGElement(element) {
3758
+ return isObject(element) && "ownerSVGElement" in element;
3759
+ }
3760
+
3761
+ /**
3762
+ * Checks if an element is specifically an SVGSVGElement (the root SVG element)
3763
+ * in a way that works across iframes
3764
+ */
3765
+ function isSVGSVGElement(element) {
3766
+ return isSVGElement(element) && element.tagName === "svg";
3767
+ }
3768
+
3744
3769
  const isMotionValue = (value) => Boolean(value && value.getVelocity);
3745
3770
 
3746
3771
  /**
@@ -5955,10 +5980,6 @@ function animateSingleValue(value, keyframes, options) {
5955
5980
  return motionValue$1.animation;
5956
5981
  }
5957
5982
 
5958
- function isSVGElement(element) {
5959
- return element instanceof SVGElement && element.tagName !== "svg";
5960
- }
5961
-
5962
5983
  const compareByDepth = (a, b) => a.depth - b.depth;
5963
5984
 
5964
5985
  class FlatTree {
@@ -6550,7 +6571,7 @@ function createProjectionNode$1({ attachResizeListener, defaultParent, measureSc
6550
6571
  mount(instance) {
6551
6572
  if (this.instance)
6552
6573
  return;
6553
- this.isSVG = isSVGElement(instance);
6574
+ this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);
6554
6575
  this.instance = instance;
6555
6576
  const { layoutId, layout, visualElement } = this.options;
6556
6577
  if (visualElement && !visualElement.current) {
@@ -1,8 +1,9 @@
1
- import { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';
2
1
  import { HTMLVisualElement } from '../../render/html/HTMLVisualElement.mjs';
3
2
  import { ObjectVisualElement } from '../../render/object/ObjectVisualElement.mjs';
4
3
  import { visualElementStore } from '../../render/store.mjs';
5
4
  import { SVGVisualElement } from '../../render/svg/SVGVisualElement.mjs';
5
+ import { isSVGElement } from '../../../../../motion-dom/dist/es/utils/is-svg-element.mjs';
6
+ import { isSVGSVGElement } from '../../../../../motion-dom/dist/es/utils/is-svg-svg-element.mjs';
6
7
 
7
8
  function createDOMVisualElement(element) {
8
9
  const options = {
@@ -19,7 +20,7 @@ function createDOMVisualElement(element) {
19
20
  latestValues: {},
20
21
  },
21
22
  };
22
- const node = isSVGElement(element)
23
+ const node = isSVGElement(element) && !isSVGSVGElement(element)
23
24
  ? new SVGVisualElement(options)
24
25
  : new HTMLVisualElement(options);
25
26
  node.mount(element);
@@ -3,6 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { useId, useRef, useContext, useInsertionEffect } from 'react';
5
5
  import { MotionConfigContext } from '../../context/MotionConfigContext.mjs';
6
+ import { isHTMLElement } from '../../../../../motion-dom/dist/es/utils/is-html-element.mjs';
6
7
 
7
8
  /**
8
9
  * Measurement functionality has to be within a separate component
@@ -13,7 +14,9 @@ class PopChildMeasure extends React.Component {
13
14
  const element = this.props.childRef.current;
14
15
  if (element && prevProps.isPresent && !this.props.isPresent) {
15
16
  const parent = element.offsetParent;
16
- const parentWidth = parent instanceof HTMLElement ? parent.offsetWidth || 0 : 0;
17
+ const parentWidth = isHTMLElement(parent)
18
+ ? parent.offsetWidth || 0
19
+ : 0;
17
20
  const size = this.props.sizeRef.current;
18
21
  size.height = element.offsetHeight || 0;
19
22
  size.width = element.offsetWidth || 0;
@@ -1,6 +1,5 @@
1
1
  import { animateSingleValue } from '../../animation/animate/single-value.mjs';
2
2
  import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';
3
- import { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';
4
3
  import { FlatTree } from '../../render/utils/flat-tree.mjs';
5
4
  import { delay } from '../../utils/delay.mjs';
6
5
  import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';
@@ -19,6 +18,8 @@ import { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.m
19
18
  import { globalProjectionState } from './state.mjs';
20
19
  import { statsBuffer } from '../../../../../motion-dom/dist/es/stats/buffer.mjs';
21
20
  import { SubscriptionManager } from '../../../../../motion-utils/dist/es/subscription-manager.mjs';
21
+ import { isSVGElement } from '../../../../../motion-dom/dist/es/utils/is-svg-element.mjs';
22
+ import { isSVGSVGElement } from '../../../../../motion-dom/dist/es/utils/is-svg-svg-element.mjs';
22
23
  import { getValueTransition } from '../../../../../motion-dom/dist/es/animation/utils/get-value-transition.mjs';
23
24
  import { cancelFrame, frameData, frameSteps, frame } from '../../../../../motion-dom/dist/es/frameloop/frame.mjs';
24
25
  import { time } from '../../../../../motion-dom/dist/es/frameloop/sync-time.mjs';
@@ -243,7 +244,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
243
244
  mount(instance) {
244
245
  if (this.instance)
245
246
  return;
246
- this.isSVG = isSVGElement(instance);
247
+ this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);
247
248
  this.instance = instance;
248
249
  const { layoutId, layout, visualElement } = this.options;
249
250
  if (visualElement && !visualElement.current) {
@@ -1,4 +1,5 @@
1
1
  import { resolveElements } from '../../../../../../motion-dom/dist/es/utils/resolve-elements.mjs';
2
+ import { isSVGElement } from '../../../../../../motion-dom/dist/es/utils/is-svg-element.mjs';
2
3
 
3
4
  const resizeHandlers = new WeakMap();
4
5
  let observer;
@@ -7,7 +8,7 @@ function getElementSize(target, borderBoxSize) {
7
8
  const { inlineSize, blockSize } = borderBoxSize[0];
8
9
  return { width: inlineSize, height: blockSize };
9
10
  }
10
- else if (target instanceof SVGElement && "getBBox" in target) {
11
+ else if (isSVGElement(target) && "getBBox" in target) {
11
12
  return target.getBBox();
12
13
  }
13
14
  else {
@@ -1,8 +1,10 @@
1
+ import { isHTMLElement } from '../../../../../../../motion-dom/dist/es/utils/is-html-element.mjs';
2
+
1
3
  function calcInset(element, container) {
2
4
  const inset = { x: 0, y: 0 };
3
5
  let current = element;
4
6
  while (current && current !== container) {
5
- if (current instanceof HTMLElement) {
7
+ if (isHTMLElement(current)) {
6
8
  inset.x += current.offsetLeft;
7
9
  inset.y += current.offsetTop;
8
10
  current = current.offsetParent;
@@ -59,6 +59,9 @@ export { recordStats } from '../../motion-dom/dist/es/stats/index.mjs';
59
59
  export { activeAnimations } from '../../motion-dom/dist/es/stats/animation-count.mjs';
60
60
  export { statsBuffer } from '../../motion-dom/dist/es/stats/buffer.mjs';
61
61
  export { interpolate } from '../../motion-dom/dist/es/utils/interpolate.mjs';
62
+ export { isHTMLElement } from '../../motion-dom/dist/es/utils/is-html-element.mjs';
63
+ export { isSVGElement } from '../../motion-dom/dist/es/utils/is-svg-element.mjs';
64
+ export { isSVGSVGElement } from '../../motion-dom/dist/es/utils/is-svg-svg-element.mjs';
62
65
  export { mix } from '../../motion-dom/dist/es/utils/mix/index.mjs';
63
66
  export { mixColor, mixLinearColor } from '../../motion-dom/dist/es/utils/mix/color.mjs';
64
67
  export { getMixer, mixArray, mixComplex, mixObject } from '../../motion-dom/dist/es/utils/mix/complex.mjs';
@@ -99,6 +102,7 @@ export { clamp } from '../../motion-utils/dist/es/clamp.mjs';
99
102
  export { invariant, warning } from '../../motion-utils/dist/es/errors.mjs';
100
103
  export { MotionGlobalConfig } from '../../motion-utils/dist/es/global-config.mjs';
101
104
  export { isNumericalString } from '../../motion-utils/dist/es/is-numerical-string.mjs';
105
+ export { isObject } from '../../motion-utils/dist/es/is-object.mjs';
102
106
  export { isZeroValueString } from '../../motion-utils/dist/es/is-zero-value-string.mjs';
103
107
  export { memo } from '../../motion-utils/dist/es/memo.mjs';
104
108
  export { noop } from '../../motion-utils/dist/es/noop.mjs';
@@ -82,6 +82,7 @@ export { addUniqueItem, moveItem, removeItem } from '../../motion-utils/dist/es/
82
82
  export { clamp } from '../../motion-utils/dist/es/clamp.mjs';
83
83
  export { invariant, warning } from '../../motion-utils/dist/es/errors.mjs';
84
84
  export { isNumericalString } from '../../motion-utils/dist/es/is-numerical-string.mjs';
85
+ export { isObject } from '../../motion-utils/dist/es/is-object.mjs';
85
86
  export { isZeroValueString } from '../../motion-utils/dist/es/is-zero-value-string.mjs';
86
87
  export { memo } from '../../motion-utils/dist/es/memo.mjs';
87
88
  export { noop } from '../../motion-utils/dist/es/noop.mjs';
@@ -157,6 +158,9 @@ export { recordStats } from '../../motion-dom/dist/es/stats/index.mjs';
157
158
  export { activeAnimations } from '../../motion-dom/dist/es/stats/animation-count.mjs';
158
159
  export { statsBuffer } from '../../motion-dom/dist/es/stats/buffer.mjs';
159
160
  export { interpolate } from '../../motion-dom/dist/es/utils/interpolate.mjs';
161
+ export { isHTMLElement } from '../../motion-dom/dist/es/utils/is-html-element.mjs';
162
+ export { isSVGElement } from '../../motion-dom/dist/es/utils/is-svg-element.mjs';
163
+ export { isSVGSVGElement } from '../../motion-dom/dist/es/utils/is-svg-svg-element.mjs';
160
164
  export { mix } from '../../motion-dom/dist/es/utils/mix/index.mjs';
161
165
  export { mixColor, mixLinearColor } from '../../motion-dom/dist/es/utils/mix/color.mjs';
162
166
  export { getMixer, mixArray, mixComplex, mixObject } from '../../motion-dom/dist/es/utils/mix/complex.mjs';
@@ -1,3 +1,4 @@
1
+ import { isHTMLElement } from '../../../utils/is-html-element.mjs';
1
2
  import { memo } from '../../../../../../motion-utils/dist/es/memo.mjs';
2
3
 
3
4
  /**
@@ -8,16 +9,13 @@ const acceleratedValues = new Set([
8
9
  "clipPath",
9
10
  "filter",
10
11
  "transform",
11
- // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
12
- // or until we implement support for linear() easing.
12
+ // TODO: Could be re-enabled now we have support for linear() easing
13
13
  // "background-color"
14
14
  ]);
15
15
  const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
16
16
  function supportsBrowserAnimation(options) {
17
17
  const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
18
- if (!motionValue ||
19
- !motionValue.owner ||
20
- !(motionValue.owner.current instanceof HTMLElement)) {
18
+ if (!isHTMLElement(motionValue?.owner?.current)) {
21
19
  return false;
22
20
  }
23
21
  const { onUpdate, transformTemplate } = motionValue.owner.getProps();
@@ -1,3 +1,4 @@
1
+ import { isHTMLElement } from '../../utils/is-html-element.mjs';
1
2
  import { isDragActive } from '../drag/state/is-active.mjs';
2
3
  import { isNodeOrChild } from '../utils/is-node-or-child.mjs';
3
4
  import { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';
@@ -68,7 +69,7 @@ function press(targetOrSelector, onPressStart, options = {}) {
68
69
  targets.forEach((target) => {
69
70
  const pointerDownTarget = options.useGlobalTarget ? window : target;
70
71
  pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions);
71
- if (target instanceof HTMLElement) {
72
+ if (isHTMLElement(target)) {
72
73
  target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions));
73
74
  if (!isElementKeyboardAccessible(target) &&
74
75
  !target.hasAttribute("tabindex")) {
@@ -0,0 +1,11 @@
1
+ import { isObject } from '../../../../motion-utils/dist/es/is-object.mjs';
2
+
3
+ /**
4
+ * Checks if an element is an HTML element in a way
5
+ * that works across iframes
6
+ */
7
+ function isHTMLElement(element) {
8
+ return isObject(element) && "offsetHeight" in element;
9
+ }
10
+
11
+ export { isHTMLElement };
@@ -0,0 +1,11 @@
1
+ import { isObject } from '../../../../motion-utils/dist/es/is-object.mjs';
2
+
3
+ /**
4
+ * Checks if an element is an SVG element in a way
5
+ * that works across iframes
6
+ */
7
+ function isSVGElement(element) {
8
+ return isObject(element) && "ownerSVGElement" in element;
9
+ }
10
+
11
+ export { isSVGElement };
@@ -0,0 +1,11 @@
1
+ import { isSVGElement } from './is-svg-element.mjs';
2
+
3
+ /**
4
+ * Checks if an element is specifically an SVGSVGElement (the root SVG element)
5
+ * in a way that works across iframes
6
+ */
7
+ function isSVGSVGElement(element) {
8
+ return isSVGElement(element) && element.tagName === "svg";
9
+ }
10
+
11
+ export { isSVGSVGElement };
@@ -0,0 +1,5 @@
1
+ function isObject(value) {
2
+ return typeof value === "object" && value !== null;
3
+ }
4
+
5
+ export { isObject };
@@ -54,6 +54,10 @@
54
54
  */
55
55
  const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v);
56
56
 
57
+ function isObject(value) {
58
+ return typeof value === "object" && value !== null;
59
+ }
60
+
57
61
  /**
58
62
  * Check if the value is a zero value string like "0px" or "0%"
59
63
  */
@@ -2597,6 +2601,14 @@
2597
2601
  ((type === "spring" || isGenerator(type)) && velocity));
2598
2602
  }
2599
2603
 
2604
+ /**
2605
+ * Checks if an element is an HTML element in a way
2606
+ * that works across iframes
2607
+ */
2608
+ function isHTMLElement(element) {
2609
+ return isObject(element) && "offsetHeight" in element;
2610
+ }
2611
+
2600
2612
  /**
2601
2613
  * A list of values that can be hardware-accelerated.
2602
2614
  */
@@ -2605,16 +2617,13 @@
2605
2617
  "clipPath",
2606
2618
  "filter",
2607
2619
  "transform",
2608
- // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
2609
- // or until we implement support for linear() easing.
2620
+ // TODO: Could be re-enabled now we have support for linear() easing
2610
2621
  // "background-color"
2611
2622
  ]);
2612
2623
  const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
2613
2624
  function supportsBrowserAnimation(options) {
2614
2625
  const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
2615
- if (!motionValue ||
2616
- !motionValue.owner ||
2617
- !(motionValue.owner.current instanceof HTMLElement)) {
2626
+ if (!isHTMLElement(motionValue?.owner?.current)) {
2618
2627
  return false;
2619
2628
  }
2620
2629
  const { onUpdate, transformTemplate } = motionValue.owner.getProps();
@@ -4030,7 +4039,7 @@
4030
4039
  targets.forEach((target) => {
4031
4040
  const pointerDownTarget = options.useGlobalTarget ? window : target;
4032
4041
  pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions);
4033
- if (target instanceof HTMLElement) {
4042
+ if (isHTMLElement(target)) {
4034
4043
  target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions));
4035
4044
  if (!isElementKeyboardAccessible(target) &&
4036
4045
  !target.hasAttribute("tabindex")) {
@@ -4175,6 +4184,22 @@
4175
4184
  return reportStats;
4176
4185
  }
4177
4186
 
4187
+ /**
4188
+ * Checks if an element is an SVG element in a way
4189
+ * that works across iframes
4190
+ */
4191
+ function isSVGElement(element) {
4192
+ return isObject(element) && "ownerSVGElement" in element;
4193
+ }
4194
+
4195
+ /**
4196
+ * Checks if an element is specifically an SVGSVGElement (the root SVG element)
4197
+ * in a way that works across iframes
4198
+ */
4199
+ function isSVGSVGElement(element) {
4200
+ return isSVGElement(element) && element.tagName === "svg";
4201
+ }
4202
+
4178
4203
  function transform(...args) {
4179
4204
  const useImmediate = !Array.isArray(args[0]);
4180
4205
  const argOffset = useImmediate ? 0 : -1;
@@ -5333,10 +5358,6 @@
5333
5358
  return animations;
5334
5359
  }
5335
5360
 
5336
- function isSVGElement(element) {
5337
- return element instanceof SVGElement && element.tagName !== "svg";
5338
- }
5339
-
5340
5361
  /**
5341
5362
  * Bounding boxes tend to be defined as top, left, right, bottom. For various operations
5342
5363
  * it's easier to consider each axis individually. This function returns a bounding box
@@ -6396,7 +6417,7 @@
6396
6417
  latestValues: {},
6397
6418
  },
6398
6419
  };
6399
- const node = isSVGElement(element)
6420
+ const node = isSVGElement(element) && !isSVGSVGElement(element)
6400
6421
  ? new SVGVisualElement(options)
6401
6422
  : new HTMLVisualElement(options);
6402
6423
  node.mount(element);
@@ -6620,7 +6641,7 @@
6620
6641
  const { inlineSize, blockSize } = borderBoxSize[0];
6621
6642
  return { width: inlineSize, height: blockSize };
6622
6643
  }
6623
- else if (target instanceof SVGElement && "getBBox" in target) {
6644
+ else if (isSVGElement(target) && "getBBox" in target) {
6624
6645
  return target.getBBox();
6625
6646
  }
6626
6647
  else {
@@ -6762,7 +6783,7 @@
6762
6783
  const inset = { x: 0, y: 0 };
6763
6784
  let current = element;
6764
6785
  while (current && current !== container) {
6765
- if (current instanceof HTMLElement) {
6786
+ if (isHTMLElement(current)) {
6766
6787
  inset.x += current.offsetLeft;
6767
6788
  inset.y += current.offsetTop;
6768
6789
  current = current.offsetParent;
@@ -7321,10 +7342,14 @@
7321
7342
  exports.isDragging = isDragging;
7322
7343
  exports.isEasingArray = isEasingArray;
7323
7344
  exports.isGenerator = isGenerator;
7345
+ exports.isHTMLElement = isHTMLElement;
7324
7346
  exports.isMotionValue = isMotionValue;
7325
7347
  exports.isNodeOrChild = isNodeOrChild;
7326
7348
  exports.isNumericalString = isNumericalString;
7349
+ exports.isObject = isObject;
7327
7350
  exports.isPrimaryPointer = isPrimaryPointer;
7351
+ exports.isSVGElement = isSVGElement;
7352
+ exports.isSVGSVGElement = isSVGSVGElement;
7328
7353
  exports.isWaapiSupportedEasing = isWaapiSupportedEasing;
7329
7354
  exports.isZeroValueString = isZeroValueString;
7330
7355
  exports.keyframes = keyframes;
package/dist/motion.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const s=(t,e,n)=>n>e?e:n<t?t:n;let i=()=>{};const r={},o=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,c=(t,e)=>n=>e(t(n)),h=(...t)=>t.reduce(c),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const f=t=>1e3*t,m=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=new Set;const v=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},w=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function b(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=w(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:w(i(t),e,s)}const T=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,x=t=>e=>1-t(1-e),M=b(.33,1.53,.69,.99),V=x(M),S=T(V),A=t=>(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),k=x(E),P=T(E),C=b(.42,0,1,1),F=b(0,0,.58,1),O=b(.42,0,.58,1);const R=t=>Array.isArray(t)&&"number"!=typeof t[0];function B(t,e){return R(t)?t[v(0,t.length,e)]:t}const D=t=>Array.isArray(t)&&"number"==typeof t[0],L={linear:u,easeIn:C,easeInOut:O,easeOut:F,circIn:E,circInOut:P,circOut:k,backIn:V,backInOut:S,backOut:M,anticipate:A},I=t=>{if(D(t)){t.length;const[e,n,s,i]=t;return b(e,n,s,i)}return"string"==typeof t?L[t]:t},W=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],N={value:null,addProjectionMetrics:null};function j(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=W.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&i?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&N.value&&N.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(o,e?n:void 0),t)),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const o=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:W.reduce(((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),o.schedule(e,r,a)),e}),{}),cancel:t=>{for(let e=0;e<W.length;e++)a[W[e]].cancel(t)},state:i,steps:a}}const{schedule:K,cancel:$,state:z,steps:U}=j("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let Y;function X(){Y=void 0}const H={now:()=>(void 0===Y&&H.set(z.isProcessing||r.useManualTiming?z.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(X)}},q={layout:0,mainThread:0,waapi:0},G=t=>e=>"string"==typeof e&&e.startsWith(t),Z=G("--"),_=G("var(--"),J=t=>!!_(t)&&Q.test(t.split("/*")[0].trim()),Q=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>s(0,1,t)},nt={...tt,default:1},st=t=>Math.round(1e5*t)/1e5,it=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const rt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ot=(t,e)=>n=>Boolean("string"==typeof n&&rt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(it);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>s(0,255,t))(t))},ut={test:ot("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+st(et.transform(s))+")"};const ct={test:ot("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ut.transform},ht=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ht("deg"),pt=ht("%"),ft=ht("px"),mt=ht("vh"),gt=ht("vw"),yt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:ot("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+pt.transform(st(e))+", "+pt.transform(st(n))+", "+st(et.transform(s))+")"},wt={test:t=>ut.test(t)||ct.test(t)||vt.test(t),parse:t=>ut.test(t)?ut.parse(t):vt.test(t)?vt.parse(t):ct.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ut.transform(t):vt.transform(t)},bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",xt="color",Mt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Vt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Mt,(t=>(wt.test(t)?(s.color.push(r),i.push(xt),n.push(wt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Tt),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function St(t){return Vt(t).values}function At(t){const{split:e,types:n}=Vt(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===Tt?st(t[r]):e===xt?wt.transform(t[r]):t[r]}return i}}const Et=t=>"number"==typeof t?0:t;const kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(it)?.length||0)+(t.match(bt)?.length||0)>0},parse:St,createTransformer:At,getAnimatableNone:function(t){const e=St(t);return At(t)(e.map(Et))}};function Pt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ct({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Pt(a,s,t+1/3),r=Pt(a,s,t),o=Pt(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}function Ft(t,e){return n=>n>0?e:t}const Ot=(t,e,n)=>t+(e-t)*n,Rt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Bt=[ct,ut,vt];function Dt(t){const e=(n=t,Bt.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===vt&&(s=Ct(s)),s}const Lt=(t,e)=>{const n=Dt(t),s=Dt(e);if(!n||!s)return Ft(t,e);const i={...n};return t=>(i.red=Rt(n.red,s.red,t),i.green=Rt(n.green,s.green,t),i.blue=Rt(n.blue,s.blue,t),i.alpha=Ot(n.alpha,s.alpha,t),ut.transform(i))},It=new Set(["none","hidden"]);function Wt(t,e){return It.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Nt(t,e){return n=>Ot(t,e,n)}function jt(t){return"number"==typeof t?Nt:"string"==typeof t?J(t)?Ft:wt.test(t)?Lt:zt:Array.isArray(t)?Kt:"object"==typeof t?wt.test(t)?Lt:$t:Ft}function Kt(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>jt(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function $t(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=jt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const zt=(t,e)=>{const n=kt.createTransformer(e),s=Vt(t),i=Vt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?It.has(t)&&!i.values.length||It.has(e)&&!s.values.length?Wt(t,e):h(Kt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Ft(t,e)};function Ut(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ot(t,e,n);return jt(t)(t,e)}const Yt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>K.update(e,t),stop:()=>$(e),now:()=>z.isProcessing?z.timestamp:H.now()}},Xt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},Ht=2e4;function qt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Ht;)e+=50,n=t.next(e);return e>=Ht?1/0:e}function Gt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(qt(s),Ht);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:m(i)}}function Zt(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}const _t=100,Jt=10,Qt=1,te=0,ee=800,ne=.3,se=.3,ie={granular:.01,default:2},re={granular:.005,default:.5},oe=.01,ae=10,le=.05,ue=1,ce=.001;function he({duration:t=ee,bounce:e=ne,velocity:n=te,mass:i=Qt}){let r,o,a=1-e;a=s(le,ue,a),t=s(oe,ae,m(t)),a<1?(r=e=>{const s=e*a,i=s*t,r=s-n,o=pe(e,a),l=Math.exp(-i);return ce-r/o*l},o=e=>{const s=e*a*t,i=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=pe(Math.pow(e,2),a);return(-r(e)+ce>0?-1:1)*((i-o)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const l=function(t,e,n){let s=n;for(let n=1;n<de;n++)s-=t(s)/e(s);return s}(r,o,5/t);if(t=f(t),isNaN(l))return{stiffness:_t,damping:Jt,duration:t};{const e=Math.pow(l,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}const de=12;function pe(t,e){return t*Math.sqrt(1-e*e)}const fe=["duration","bounce"],me=["stiffness","damping","mass"];function ge(t,e){return e.some((e=>void 0!==t[e]))}function ye(t=se,e=ne){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:g}=function(t){let e={velocity:te,stiffness:_t,damping:Jt,mass:Qt,isResolvedFromDuration:!1,...t};if(!ge(t,me)&&ge(t,fe))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),r=i*i,o=2*s(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Qt,stiffness:r,damping:o}}else{const n=he(t);e={...e,...n,mass:Qt},e.isResolvedFromDuration=!0}return e}({...n,velocity:-m(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(u*h)),w=a-o,b=m(Math.sqrt(u/h)),T=Math.abs(w)<5;let x;if(i||(i=T?ie.granular:ie.default),r||(r=T?re.granular:re.default),v<1){const t=pe(b,v);x=e=>{const n=Math.exp(-v*b*e);return a-n*((y+v*b*w)/t*Math.sin(t*e)+w*Math.cos(t*e))}}else if(1===v)x=t=>a-Math.exp(-b*t)*(w+(y+b*w)*t);else{const t=b*Math.sqrt(v*v-1);x=e=>{const n=Math.exp(-v*b*e),s=Math.min(t*e,300);return a-n*((y+v*b*w)*Math.sinh(s)+t*w*Math.cosh(s))/t}}const M={calculatedDuration:g&&d||null,next:t=>{const e=x(t);if(g)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?f(y):Zt(x,t,e));const s=Math.abs(n)<=i,o=Math.abs(a-e)<=r;l.done=s&&o}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(qt(M),Ht),e=Xt((e=>M.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return M}function ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=ye({keyframes:[d.value,p(d.value)],velocity:Zt(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}function we(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const a=t.length;if(e.length,1===a)return()=>e[0];if(2===a&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=function(t,e,n){const s=[],i=n||r.mix||Ut,o=t.length-1;for(let n=0;n<o;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;r=h(t,r)}s.push(r)}return s}(e,i,o),p=c.length,f=n=>{if(l&&n<t[0])return e[0];let s=0;if(p>1)for(;s<t.length-2&&!(n<t[s+1]);s++);const i=d(t[s],t[s+1],n);return c[s](i)};return n?e=>f(s(t[0],t[a-1],e)):f}function be(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Ot(n,1,i))}}function Te(t){const e=[0];return be(e,t.length-1),e}function xe(t,e){return t.map((t=>t*e))}function Me(t,e){return t.map((()=>e||O)).splice(0,t.length-1)}function Ve({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=R(s)?s.map(I):I(s),r={done:!1,value:e[0]},o=we(xe(n&&n.length===e.length?n:Te(e),t),e,{ease:Array.isArray(i)?i:Me(e,i)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}ye.applyToOptions=t=>{const e=Gt(t,100,ye);return t.ease=e.ease,t.duration=f(e.duration),t.type="keyframes",t};const Se=t=>null!==t;function Ae(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Se),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Ee={decay:ve,inertia:ve,tween:Ve,keyframes:Ve,spring:ye};function ke(t){"string"==typeof t.type&&(t.type=Ee[t.type])}class Pe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ce=t=>t/100;class Fe extends Pe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(t=!0)=>{if(t){const{motionValue:t}=this.options;t&&t.updatedAt!==H.now()&&this.tick(H.now())}this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},q.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ke(t);const{type:e=Ve,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Ve;a!==Ve&&"number"!=typeof o[0]&&(this.mixKeyframes=h(Ce,Ut(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=qt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w=this.currentTime,b=n;if(h){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(b=o)),w=s(0,1,n)*a}const T=v?{done:!1,value:c[0]}:b.next(w);r&&(T.value=r(T.value));let{done:x}=T;v||null===l||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const M=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return M&&f!==ve&&(T.value=Ae(c,this.options,g,this.speed)),m&&m(T.value),M&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return m(this.calculatedDuration)}get time(){return m(this.currentTime)}set time(t){t=f(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(H.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=m(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Yt,startTime:e}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(H.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,q.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Oe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Re=t=>180*t/Math.PI,Be=t=>{const e=Re(Math.atan2(t[1],t[0]));return Le(e)},De={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>Re(Math.atan(t[1])),skewY:t=>Re(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>((t%=360)<0&&(t+=360),t),Ie=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),We=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ne={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ie,scaleY:We,scale:t=>(Ie(t)+We(t))/2,rotateX:t=>Le(Re(Math.atan2(t[6],t[5]))),rotateY:t=>Le(Re(Math.atan2(-t[2],t[0]))),rotateZ:Be,rotate:Be,skewX:t=>Re(Math.atan(t[4])),skewY:t=>Re(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function je(t){return t.includes("scale")?1:0}function Ke(t,e){if(!t||"none"===t)return je(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ne,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=De,i=e}if(!i)return je(e);const r=s[e],o=i[1].split(",").map(ze);return"function"==typeof r?r(o):o[r]}const $e=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ke(n,e)};function ze(t){return parseFloat(t.trim())}const Ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ye=(()=>new Set(Ue))(),Xe=t=>t===tt||t===ft,He=new Set(["x","y","z"]),qe=Ue.filter((t=>!He.has(t)));const Ge={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ke(e,"x"),y:(t,{transform:e})=>Ke(e,"y")};Ge.translateX=Ge.x,Ge.translateY=Ge.y;const Ze=new Set;let _e=!1,Je=!1,Qe=!1;function tn(){if(Je){const t=Array.from(Ze).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return qe.forEach((n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Je=!1,_e=!1,Ze.forEach((t=>t.complete(Qe))),Ze.clear()}function en(){Ze.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Je=!0)}))}function nn(){Qe=!0,en(),tn(),Qe=!1}class sn{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Ze.add(this),_e||(_e=!0,K.read(en),K.resolveKeyframes(tn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}Oe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ze.delete(this)}cancel(){"scheduled"===this.state&&(Ze.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const rn=t=>t.startsWith("--");function on(t,e,n){rn(e)?t.style.setProperty(e,n):t.style[e]=n}const an=l((()=>void 0!==window.ScrollTimeline)),ln={};function un(t,e){const n=l(t);return()=>ln[e]??n()}const cn=un((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),hn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hn([0,.65,.55,1]),circOut:hn([.55,0,1,.45]),backIn:hn([.31,.01,.66,-.59]),backOut:hn([.33,1.53,.69,.99])};function pn(t,e){return t?"function"==typeof t?cn()?Xt(t,e):"ease-out":D(t)?hn(t):Array.isArray(t)?t.map((t=>pn(t,e)||dn.easeOut)):dn[t]:void 0}function fn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=pn(a,i);Array.isArray(h)&&(c.easing=h),N.value&&q.waapi++;const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return N.value&&p.finished.finally((()=>{q.waapi--})),p}function mn(t){return"function"==typeof t&&"applyToOptions"in t}function gn({type:t,...e}){return mn(t)&&cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class yn extends Pe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const l=gn(t);this.animation=fn(e,n,s,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=Ae(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):on(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return m(Number(t))}get time(){return m(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=f(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&an()?(this.animation.timeline=t,u):e(this)}}const vn={anticipate:A,backInOut:S,circInOut:P};function wn(t){"string"==typeof t.ease&&t.ease in vn&&(t.ease=vn[t.ease])}class bn extends yn{constructor(t){wn(t),ke(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new Fe({...r,autoplay:!1}),a=f(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const Tn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!kt.test(t)&&"0"!==t||t.startsWith("url(")));const xn=new Set(["opacity","clipPath","filter","transform"]),Mn=l((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));function Vn(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Mn()&&n&&xn.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}class Sn extends Pe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=H.now();const h={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||sn;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:h}=n;this.resolvedAt=H.now(),function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Tn(i,e),a=Tn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||mn(n))&&s)}(t,i,o,a)||(!r.instantAnimations&&l||h?.(Ae(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},p=!c&&Vn(d)?new bn({...d,element:d.motionValue.owner.current}):new Fe(d);p.finished.then((()=>this.notifyFinished())).catch(u),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(this.keyframeResolver?.resume(),nn()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class An{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map((e=>e.attachTimeline(t)));return()=>{e.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class En extends An{then(t,e){return this.finished.finally(t).then((()=>{}))}}class kn extends yn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Pn=new WeakMap,Cn=(t,e="")=>`${t}:${e}`;function Fn(t){const e=Pn.get(t)||new Map;return Pn.set(t,e),e}const On=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Rn(t){const e=On.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Bn(t,e,n=1){const[s,i]=Rn(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return o(t)?parseFloat(t):t}return J(i)?Bn(i,e,n+1):i}function Dn(t,e){return t?.[e]??t?.default??t}const Ln=new Set(["width","height","top","left","right","bottom",...Ue]),In=t=>e=>e.test(t),Wn=[tt,ft,pt,dt,gt,mt,{test:t=>"auto"===t,parse:t=>t}],Nn=t=>Wn.find(In(t));const jn=new Set(["brightness","contrast","saturate","opacity"]);function Kn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(it)||[];if(!s)return t;const i=n.replace(s,"");let r=jn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const $n=/\b([a-z-]*)\(.*?\)/gu,zn={...kt,getAnimatableNone:t=>{const e=t.match($n);return e?e.map(Kn).join(" "):t}},Un={...tt,transform:Math.round},Yn={rotate:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:ft,translateX:ft,translateY:ft,translateZ:ft,x:ft,y:ft,z:ft,perspective:ft,transformPerspective:ft,opacity:et,originX:yt,originY:yt,originZ:ft},Xn={borderWidth:ft,borderTopWidth:ft,borderRightWidth:ft,borderBottomWidth:ft,borderLeftWidth:ft,borderRadius:ft,radius:ft,borderTopLeftRadius:ft,borderTopRightRadius:ft,borderBottomRightRadius:ft,borderBottomLeftRadius:ft,width:ft,maxWidth:ft,height:ft,maxHeight:ft,top:ft,right:ft,bottom:ft,left:ft,padding:ft,paddingTop:ft,paddingRight:ft,paddingBottom:ft,paddingLeft:ft,margin:ft,marginTop:ft,marginRight:ft,marginBottom:ft,marginLeft:ft,backgroundPositionX:ft,backgroundPositionY:ft,...Yn,zIndex:Un,fillOpacity:et,strokeOpacity:et,numOctaves:Un},Hn={...Xn,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:zn,WebkitFilter:zn},qn=t=>Hn[t];function Gn(t,e){let n=qn(t);return n!==zn&&(n=kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Zn=new Set(["auto","none","0"]);class _n extends sn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),J(s))){const i=Bn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Ln.has(n)||2!==t.length)return;const[s,i]=t,r=Nn(s),o=Nn(i);if(r!==o)if(Xe(r)&&Xe(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Ge[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||a(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Zn.has(e)&&Vt(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Gn(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ge[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ge[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Jn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);function Qn(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&Jn.has(e)&&(t[n]=t[n]+"px")}const ts=l((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),es=new Set(["opacity","clipPath","filter","transform"]);function ns(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const ss={current:void 0};class is{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=H.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=H.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ss.current&&ss.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=H.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function rs(t,e){return new is(t,e)}const os=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class as{constructor(){this.latest={},this.values=new Map}set(t,e,n,s){const i=this.values.get(t);i&&i.onRemove();const r=()=>{this.latest[t]=os(e.get(),Xn[t]),n&&K.render(n)};r();const o=e.on("change",r);s&&e.addDependent(s);const a=()=>{o(),n&&$(n),this.values.delete(t),s&&e.removeDependent(s)};return this.values.set(t,{value:e,onRemove:a}),a}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}const ls={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const us=new WeakMap;function cs(t,e,n,s){let i,r;return Ye.has(n)?(e.get("transform")||e.set("transform",new is("none"),(()=>{t.style.transform=function(t){let e="",n=!0;for(let s=0;s<Ue.length;s++){const i=Ue[s],r=t.latest[i];if(void 0===r)continue;let o=!0;o="number"==typeof r?r===(i.startsWith("scale")?1:0):0===parseFloat(r),o||(n=!1,e+=`${ls[i]||i}(${t.latest[i]}) `)}return n?"none":e.trim()}(e)})),r=e.get("transform")):i=rn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,s,i,r)}const{schedule:hs,cancel:ds}=j(queueMicrotask,!1),ps={x:!1,y:!1};function fs(){return ps.x||ps.y}function ms(t,e){const n=ns(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function gs(t){return!("touch"===t.pointerType||fs())}const ys=(t,e)=>!!e&&(t===e||ys(t,e.parentElement)),vs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ws=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const bs=new WeakSet;function Ts(t){return e=>{"Enter"===e.key&&t(e)}}function xs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ms(t){return vs(t)&&!fs()}function Vs(t,e){const n=window.getComputedStyle(t);return rn(e)?n.getPropertyValue(e):n[e]}function Ss(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return K.preUpdate(s,!0),()=>$(s)}function As(){const{value:t}=N;null!==t?(t.frameloop.rate.push(z.delta),t.animations.mainThread.push(q.mainThread),t.animations.waapi.push(q.waapi),t.animations.layout.push(q.layout)):$(As)}function Es(t){return t.reduce(((t,e)=>t+e),0)/t.length}function ks(t,e=Es){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Ps=t=>Math.round(1e3/t);function Cs(){N.value=null,N.addProjectionMetrics=null}function Fs(){const{value:t}=N;if(!t)throw new Error("Stats are not being measured");Cs(),$(As);const e={frameloop:{setup:ks(t.frameloop.setup),rate:ks(t.frameloop.rate),read:ks(t.frameloop.read),resolveKeyframes:ks(t.frameloop.resolveKeyframes),preUpdate:ks(t.frameloop.preUpdate),update:ks(t.frameloop.update),preRender:ks(t.frameloop.preRender),render:ks(t.frameloop.render),postRender:ks(t.frameloop.postRender)},animations:{mainThread:ks(t.animations.mainThread),waapi:ks(t.animations.waapi),layout:ks(t.animations.layout)},layoutProjection:{nodes:ks(t.layoutProjection.nodes),calculatedTargetDeltas:ks(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:ks(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Ps(n.min),n.max=Ps(n.max),n.avg=Ps(n.avg),[n.min,n.max]=[n.max,n.min],e}function Os(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=we(t[1+n],t[2+n],t[3+n]);return e?i(s):i}function Rs(t){const e=[];ss.current=e;const n=t();ss.current=void 0;const s=rs(n);return function(t,e,n){const s=()=>e.set(n()),i=()=>K.preRender(s,!1,!0),r=t.map((t=>t.on("change",i)));e.on("destroy",(()=>{r.forEach((t=>t())),$(s)}))}(e,s,t),s}const Bs=t=>Boolean(t&&t.getVelocity);function Ds(t,e,n){const s=t.get();let i,r=null,o=s;const a="string"==typeof s?s.replace(/[\d.-]/g,""):void 0,l=()=>{r&&(r.stop(),r=null)},u=()=>{l(),r=new Fe({keyframes:[Is(t.get()),Is(o)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:i})};let c;return t.attach(((e,n)=>(o=e,i=t=>n(Ls(t,a)),K.postRender(u),t.get())),l),Bs(e)&&(c=e.on("change",(e=>t.set(Ls(e,a)))),t.on("destroy",c)),c}function Ls(t,e){return e?t+e:t}function Is(t){return"number"==typeof t?t:parseFloat(t)}const Ws=[...Wn,wt,kt],Ns=t=>Ws.find(In(t));function js(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Ks={},$s=null;const zs=(t,e)=>{Ks[t]=e},Us=()=>{$s||($s=document.createElement("style"),$s.id="motion-view");let t="";for(const e in Ks){const n=Ks[e];t+=`${e} {\n`;for(const[e,s]of Object.entries(n))t+=` ${e}: ${s};\n`;t+="}\n"}$s.textContent=t,document.head.appendChild($s),Ks={}},Ys=()=>{$s&&$s.parentElement&&$s.parentElement.removeChild($s)};function Xs(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Hs(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}const qs=["layout","enter","exit","new","old"];function Gs(t){const{update:e,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise((async t=>{await e(),t(new An([]))}));(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||zs(":root",{"view-transition-name":"none"}),zs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Us();const i=document.startViewTransition((async()=>{await e()}));return i.finished.finally((()=>{Ys()})),new Promise((t=>{i.ready.then((()=>{const e=document.getAnimations().filter(Hs),i=[];n.forEach(((t,e)=>{for(const n of qs){if(!t[n])continue;const{keyframes:r,options:o}=t[n];for(let[t,a]of Object.entries(r)){if(!a)continue;const r={...Dn(s,t),...Dn(o,t)},l=js(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=f(r.duration)),r.delay&&(r.delay=f(r.delay));const u=new yn({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});i.push(u)}}}));for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:r}=e;if(!r)continue;const o=Xs(r);if(!o)continue;const a=n.get(o.layer);if(a)Zs(a,"enter")&&Zs(a,"exit")&&e.getKeyframes().some((t=>t.mixBlendMode))?i.push(new kn(t)):t.cancel();else{const n="group"===o.type?"layout":"";let r={...Dn(s,n)};r.duration&&(r.duration=f(r.duration)),r=gn(r);const a=pn(r.ease,r.duration);e.updateTiming({delay:f(r.delay??0),duration:r.duration,easing:a}),i.push(new kn(t))}}t(new An(i))}))}))}function Zs(t,e){return t?.[e]?.keyframes.opacity}let _s=[],Js=null;function Qs(){Js=null;const[t]=_s;var e;t&&(n(_s,e=t),Js=e,Gs(e).then((t=>{e.notifyReady(t),t.finished.finally(Qs)})))}function ti(){for(let t=_s.length-1;t>=0;t--){const e=_s[t],{interrupt:n}=e.options;if("immediate"===n){const n=_s.slice(0,t+1).map((t=>t.update)),s=_s.slice(t+1);e.update=()=>{n.forEach((t=>t()))},_s=[e,...s];break}}Js&&"immediate"!==_s[0]?.options.interrupt||Qs()}class ei{constructor(t,e={}){var n;this.currentTarget="root",this.targets=new Map,this.notifyReady=u,this.readyPromise=new Promise((t=>{this.notifyReady=t})),this.update=t,this.options={interrupt:"wait",...e},n=this,_s.push(n),hs.render(ti)}get(t){return this.currentTarget=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentTarget:s,targets:i}=this;i.has(s)||i.set(s,{});i.get(s)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const ni=K,si=W.reduce(((t,e)=>(t[e]=t=>$(t),t)),{});function ii(t){return"object"==typeof t&&!Array.isArray(t)}function ri(t,e,n,s){return"string"==typeof t&&ii(e)?ns(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function oi(t,e,n){return t*(e+1)}function ai(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}function li(t,e,s,i,r,o){!function(t,e,s){for(let i=0;i<t.length;i++){const r=t[i];r.at>e&&r.at<s&&(n(t,r),i--)}}(t,r,o);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Ot(r,o,i[n]),easing:B(s,n)})}function ui(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function ci(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function hi(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function di(t,e){return e[t]||(e[t]=[]),e[t]}function pi(t){return Array.isArray(t)?t:[t]}function fi(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const mi=t=>"number"==typeof t,gi=t=>t.every(mi),yi=new WeakMap;function vi(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function wi(t,e,n,s){if("function"==typeof e){const[i,r]=vi(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=vi(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function bi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,rs(n))}function Ti(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function xi(t,e){const n=function(t,e,n){const s=t.getProps();return wi(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){bi(t,e,Ti(r[e]))}}function Mi(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Bs(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const Vi=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Si="data-"+Vi("framerAppearId");function Ai(t){return t.props[Si]}const Ei=t=>null!==t;const ki={type:"spring",stiffness:500,damping:25,restSpeed:10},Pi={type:"keyframes",duration:.8},Ci={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fi=(t,{keyframes:e})=>e.length>2?Pi:Ye.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ki:Ci;const Oi=(t,e,n,s={},i,o)=>a=>{const l=Dn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=f(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||Object.assign(h,Fi(t,h)),h.duration&&(h.duration=f(h.duration)),h.repeatDelay&&(h.repeatDelay=f(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,h.duration=0,h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Ei),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(h.keyframes,l);if(void 0!==t)return void K.update((()=>{h.onUpdate(t),h.onComplete()}))}return l.isSync?new Fe(h):new Sn(h)};function Ri({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Bi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||u&&Ri(u,e))continue;const o={delay:n,...Dn(r||{},e)},c=s.get();if(void 0!==c&&!s.isAnimating&&!Array.isArray(i)&&i===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=Ai(t);if(n){const t=window.MotionHandoffAnimation(n,e,K);null!==t&&(o.startTime=t,h=!0)}}Mi(t,e),s.start(Oi(e,s,i,t.shouldReduceMotion&&Ln.has(e)?{type:!1}:o,t,h));const d=s.animation;d&&l.push(d)}return o&&Promise.all(l).then((()=>{K.update((()=>{o&&xi(t,o)}))})),l}const Di={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Li={};for(const t in Di)Li[t]={isEnabled:e=>Di[t].some((t=>!!e[t]))};const Ii=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Wi="undefined"!=typeof window,Ni={current:null},ji={current:!1};const Ki=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function $i(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Ki.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const zi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ui{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=sn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=H.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=$i(e),this.isVariantNode=function(t){return Boolean($i(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Bs(e)&&e.set(a[t],!1)}}mount(t){this.current=t,yi.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),ji.current||function(){if(ji.current=!0,Wi)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ni.current=t.matches;t.addListener(e),e()}else Ni.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ni.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),$(this.notifyUpdate),$(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Ye.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&K.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),r&&r(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Li){const e=Li[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<zi.length;e++){const n=zi[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Bs(i))t.addValue(s,i);else if(Bs(r))t.addValue(s,rs(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,rs(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=rs(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(o(n)||a(n))?n=parseFloat(n):!Ns(n)&&kt.test(e)&&(n=Gn(t,e)),this.setBaseTarget(t,Bs(n)?n.get():n)),Bs(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=wi(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Bs(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Yi extends Ui{constructor(){super(...arguments),this.KeyframeResolver=_n}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Bs(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Xi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Hi=Ue.length;function qi(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Ye.has(t))o=!0;else if(Z(t))i[t]=n;else{const e=os(n,Xn[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<Hi;r++){const o=Ue[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=os(a,Xn[o]);l||(i=!1,s+=`${Xi[o]||o}(${t}) `),n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function Gi(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}const Zi={};function _i(t,{layout:e,layoutId:n}){return Ye.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Zi[t]||"opacity"===t)}function Ji(t,e,n){const{style:s}=t,i={};for(const r in s)(Bs(s[r])||e.style&&Bs(e.style[r])||_i(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(i[r]=s[r]);return i}class Qi extends Yi{constructor(){super(...arguments),this.type="html",this.renderInstance=Gi}readValueFromInstance(t,e){if(Ye.has(e))return this.projection?.isProjecting?je(e):$e(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(Z(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){qi(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ji(t,e,n)}}class tr extends Ui{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const er={offset:"stroke-dashoffset",array:"stroke-dasharray"},nr={offset:"strokeDashoffset",array:"strokeDasharray"};function sr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(qi(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==s&&(h.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?er:nr;t[r.offset]=ft.transform(-s);const o=ft.transform(e),a=ft.transform(n);t[r.array]=`${o} ${a}`}(h,i,r,o,!1)}const ir=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class rr extends Yi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ii}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ye.has(e)){const t=qn(e);return t&&t.default||0}return e=ir.has(e)?e:Vi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Ji(t,e,n);for(const n in t)(Bs(t[n])||Bs(e[n]))&&(s[-1!==Ue.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){sr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){Gi(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(ir.has(n)?n:Vi(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function or(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new rr(e):new Qi(e);n.mount(t),yi.set(t,n)}function ar(t){const e=new tr({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),yi.set(t,e)}function lr(t,e,n,s){const i=[];if(function(t,e){return Bs(t)||"number"==typeof t||"string"==typeof t&&!ii(e)}(t,e))i.push(function(t,e,n){const s=Bs(t)?t:rs(t);return s.start(Oi("",s,e,n)),s.animation}(t,ii(e)&&e.default||e,n&&n.default||n));else{const r=ri(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?or:ar;yi.has(s)||a(s);const l=yi.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...Bi(l,{...e,transition:u},{}))}}return i}function ur(t,e,n){const s=[],i=function(t,{defaultTransition:e={},...n}={},s,i){const r=e.duration||.3,o=new Map,a=new Map,l={},u=new Map;let c=0,h=0,p=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){u.set(o,h);continue}if(!Array.isArray(o)){u.set(o.name,ai(h,o.at,c,u));continue}let[d,m,g={}]=o;void 0!==g.at&&(h=ai(h,g.at,c,u));let y=0;const v=(t,n,s,o=0,a=0)=>{const l=pi(t),{delay:u=0,times:c=Te(l),type:d="keyframes",repeat:m,repeatType:g,repeatDelay:v=0,...w}=n;let{ease:b=e.ease||"easeOut",duration:T}=n;const x="function"==typeof u?u(o,a):u,M=l.length,V=mn(d)?d:i?.[d];if(M<=2&&V){let t=100;if(2===M&&gi(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...w};void 0!==T&&(e.duration=f(T));const n=Gt(e,t,V);b=n.ease,T=n.duration}T??(T=r);const S=h+x;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&be(c,A),1===l.length&&l.unshift(null),m){T=oi(T,m);const t=[...l],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let s=0;s<m;s++){l.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),b.push(0===i?"linear":B(n,i-1))}ui(c,m)}const E=S+T;li(s,l,b,c,S,E),y=Math.max(x+T,y),p=Math.max(E,p)};if(Bs(d))v(m,g,di("default",hi(d,a)));else{const t=ri(d,m,s,l),e=t.length;for(let n=0;n<e;n++){const s=hi(t[n],a);for(const t in m)v(m[t],fi(g,t),di(t,s),n,e)}}c=h,h+=y}return a.forEach(((t,s)=>{for(const i in t){const r=t[i];r.sort(ci);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,p,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const c=o.get(s);c.keyframes[i]=a,c.transition[i]={...e,duration:p,ease:u,times:l,...n}}})),o}(t,e,n,{spring:ye});return i.forEach((({keyframes:t,transition:e},n)=>{s.push(...lr(n,t,e))})),s}function cr(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?ur(e,n,t):lr(e,n,s,t);const o=new En(i);return t&&t.animations.push(o),o}}const hr=cr();const dr=t=>function(e,n,s){return new En(function(t,e,n,s){const i=ns(t,s),r=i.length,o=[];for(let t=0;t<r;t++){const s=i[t],a={...n};"function"==typeof a.delay&&(a.delay=a.delay(t,r));for(const t in e){let n=e[t];Array.isArray(n)||(n=[n]);const i={...Dn(a,t)};i.duration&&(i.duration=f(i.duration)),i.delay&&(i.delay=f(i.delay));const r=Fn(s),l=Cn(t,i.pseudoElement||""),u=r.get(l);u&&u.stop(),o.push({map:r,key:l,unresolvedKeyframes:n,options:{...i,element:s,name:t,allowFlatten:!a.type&&!a.ease}})}}for(let t=0;t<o.length;t++){const{unresolvedKeyframes:e,options:n}=o[t],{element:s,name:i,pseudoElement:r}=n;r||null!==e[0]||(e[0]=Vs(s,i)),Oe(e),Qn(e,i),!r&&e.length<2&&e.unshift(Vs(s,i)),n.keyframes=e}const a=[];for(let t=0;t<o.length;t++){const{map:e,key:n,options:s}=o[t],i=new yn(s);e.set(n,i),i.finished.finally((()=>e.delete(n))),a.push(i)}return a}(e,n,s,t))},pr=dr(),fr=new WeakMap;let mr;function gr({target:t,contentRect:e,borderBoxSize:n}){fr.get(t)?.forEach((s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function yr(t){t.forEach(gr)}function vr(t,e){mr||"undefined"!=typeof ResizeObserver&&(mr=new ResizeObserver(yr));const n=ns(t);return n.forEach((t=>{let n=fr.get(t);n||(n=new Set,fr.set(t,n)),n.add(e),mr?.observe(t)})),()=>{n.forEach((t=>{const n=fr.get(t);n?.delete(e),n?.size||mr?.unobserve(t)}))}}const wr=new Set;let br;function Tr(t){return wr.add(t),br||(br=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};wr.forEach((t=>t(e)))},window.addEventListener("resize",br)),()=>{wr.delete(t),!wr.size&&br&&(br=void 0)}}const xr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Mr(t,e,n,s){const i=n[e],{length:r,position:o}=xr[e],a=i.current,l=n.time;i.current=t[`scroll${o}`],i.scrollLength=t[`scroll${r}`]-t[`client${r}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=d(0,i.scrollLength,i.current);const u=s-l;i.velocity=u>50?0:g(i.current-a,u)}const Vr={start:0,center:.5,end:1};function Sr(t,e,n=0){let s=0;if(t in Vr&&(t=Vr[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const Ar=[0,0];function Er(t,e,n,s){let i=Array.isArray(t)?t:Ar,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Vr[t]?t:"0"]),r=Sr(i[0],n,s),o=Sr(i[1],e),r-o}const kr={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Pr={x:0,y:0};function Cr(t,e,n){const{offset:i=kr.All}=n,{target:r=t,axis:o="y"}=n,a="y"===o?"height":"width",l=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(r,t):Pr,u=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let h=!e[o].interpolate;const d=i.length;for(let t=0;t<d;t++){const n=Er(i[t],c[a],u[a],l[o]);h||n===e[o].interpolatorOffsets[t]||(h=!0),e[o].offset[t]=n}h&&(e[o].interpolate=we(e[o].offset,Te(i),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=s(0,1,e[o].interpolate(e[o].current))}function Fr(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){Mr(t,"x",e,n),Mr(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Cr(t,n,s)},notify:()=>e(n)}}const Or=new WeakMap,Rr=new WeakMap,Br=new WeakMap,Dr=t=>t===document.scrollingElement?window:t;function Lr(t,{container:e=document.scrollingElement,...n}={}){if(!e)return u;let s=Br.get(e);s||(s=new Set,Br.set(e,s));const i=Fr(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!Or.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(z.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{K.read(t),K.read(n),K.preUpdate(i)};Or.set(e,a);const l=Dr(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Rr.set(e,(o=a,"function"==typeof(r=e)?Tr(r):vr(r,o))),l.addEventListener("scroll",a,{passive:!0}),a()}var r,o;const a=Or.get(e);return K.read(a,!1,!0),()=>{$(a);const t=Br.get(e);if(!t)return;if(t.delete(i),t.size)return;const n=Or.get(e);Or.delete(e),n&&(Dr(e).removeEventListener("scroll",n),Rr.get(e)?.(),window.removeEventListener("resize",n))}}const Ir=new Map;function Wr({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const i=Ir.get(e)??new Map;Ir.set(e,i);const r=n.target??"self",o=i.get(r)??{},a=s+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&an()?new ScrollTimeline({source:e,axis:s}):function(t){const e={value:0},n=Lr((n=>{e.value=100*n[t.axis].progress}),t);return{currentTime:e,cancel:n}}({container:e,...n})),o[a]}const Nr={some:0,all:1};const jr=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Sn,t.DOMKeyframesResolver=_n,t.GroupAnimation=An,t.GroupAnimationWithThen=En,t.JSAnimation=Fe,t.KeyframeResolver=sn,t.MotionGlobalConfig=r,t.MotionValue=is,t.NativeAnimation=yn,t.NativeAnimationExtended=bn,t.NativeAnimationWrapper=kn,t.SubscriptionManager=p,t.ViewTransitionBuilder=ei,t.acceleratedValues=es,t.activeAnimations=q,t.addUniqueItem=e,t.alpha=et,t.analyseComplexValue=Vt,t.animate=hr,t.animateMini=pr,t.animateValue=function(t){return new Fe(t)},t.animateView=function(t,e={}){return new ei(t,e)},t.animationMapKey=Cn,t.anticipate=A,t.applyPxDefaults=Qn,t.attachSpring=Ds,t.backIn=V,t.backInOut=S,t.backOut=M,t.calcGeneratorDuration=qt,t.cancelFrame=$,t.cancelMicrotask=ds,t.cancelSync=si,t.circIn=E,t.circInOut=P,t.circOut=k,t.clamp=s,t.collectMotionValues=ss,t.color=wt,t.complex=kt,t.convertOffsetToTimes=xe,t.createGeneratorEasing=Gt,t.createRenderBatcher=j,t.createScopedAnimate=cr,t.cubicBezier=b,t.cubicBezierAsString=hn,t.defaultEasing=Me,t.defaultOffset=Te,t.defaultTransformValue=je,t.defaultValueTypes=Hn,t.degrees=dt,t.delay=function(t,e){return function(t,e){const n=H.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&($(s),t(r-e))};return K.setup(s,!0),()=>$(s)}(t,f(e))},t.dimensionValueTypes=Wn,t.distance=jr,t.distance2D=function(t,e){const n=jr(t.x,e.x),s=jr(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=C,t.easeInOut=O,t.easeOut=F,t.easingDefinitionToFunction=I,t.fillOffset=be,t.fillWildcards=Oe,t.findDimensionValueType=Nn,t.findValueType=Ns,t.flushKeyframeResolvers=nn,t.frame=K,t.frameData=z,t.frameSteps=U,t.generateLinearEasing=Xt,t.getAnimatableNone=Gn,t.getAnimationMap=Fn,t.getComputedStyle=Vs,t.getDefaultValueType=qn,t.getEasingForSegment=B,t.getMixer=jt,t.getValueAsType=os,t.getValueTransition=Dn,t.getVariableValue=Bn,t.hasWarned=function(t){return y.has(t)},t.hex=ct,t.hover=function(t,e,n={}){const[s,i,r]=ms(t,n),o=t=>{if(!gs(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{gs(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r},t.hsla=vt,t.hslaToRgba=Ct,t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=ns(t),o=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))}))}),{root:n,rootMargin:s,threshold:"number"==typeof i?i:Nr[i]});return r.forEach((t=>a.observe(t))),()=>a.disconnect()},t.inertia=ve,t.interpolate=we,t.invariant=i,t.invisibleValues=It,t.isBezierDefinition=D,t.isCSSVariableName=Z,t.isCSSVariableToken=J,t.isDragActive=fs,t.isDragging=ps,t.isEasingArray=R,t.isGenerator=mn,t.isMotionValue=Bs,t.isNodeOrChild=ys,t.isNumericalString=o,t.isPrimaryPointer=vs,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&cn()||!e||"string"==typeof e&&(e in dn||cn())||D(e)||Array.isArray(e)&&e.every(t))},t.isZeroValueString=a,t.keyframes=Ve,t.mapEasingToNativeEasing=pn,t.mapValue=function(t,e,n,s){const i=Os(e,n,s);return Rs((()=>i(t.get())))},t.maxGeneratorDuration=Ht,t.memo=l,t.microtask=hs,t.millisecondsToSeconds=m,t.mirrorEasing=T,t.mix=Ut,t.mixArray=Kt,t.mixColor=Lt,t.mixComplex=zt,t.mixImmediate=Ft,t.mixLinearColor=Rt,t.mixNumber=Ot,t.mixObject=$t,t.mixVisibility=Wt,t.motionValue=rs,t.moveItem=function([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&s<t.length){const s=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(s,0,i)}return t},t.noop=u,t.number=tt,t.numberValueTypes=Xn,t.observeTimeline=Ss,t.parseCSSVariable=Rn,t.parseValueFromTransform=Ke,t.percent=pt,t.pipe=h,t.positionalKeys=Ln,t.press=function(t,e,n={}){const[s,i,r]=ms(t,n),o=t=>{const s=t.currentTarget;if(!Ms(t))return;bs.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),bs.has(s)&&bs.delete(s),Ms(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||ys(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ts((()=>{if(bs.has(n))return;xs(n,"down");const t=Ts((()=>{xs(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>xs(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,ws.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r},t.progress=d,t.progressPercentage=yt,t.px=ft,t.readTransformValue=$e,t.recordStats=function(){if(N.value)throw Cs(),new Error("Stats are already being measured");const t=N;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},K.postRender(As,!0),Fs},t.removeItem=n,t.resolveElements=ns,t.reverseEasing=x,t.rgbUnit=lt,t.rgba=ut,t.scale=nt,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...s}={}){if(!n)return u;const i={axis:e,container:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?Lr((n=>{t(n[e.axis].progress,n)}),e):Ss(t,Wr(e))}(t,i):function(t,e){const n=Wr(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),Ss((e=>{t.time=t.duration*e}),n))})}(t,i)},t.scrollInfo=Lr,t.secondsToMilliseconds=f,t.setDragLock=function(t){return"x"===t||"y"===t?ps[t]?null:(ps[t]=!0,()=>{ps[t]=!1}):ps.x||ps.y?null:(ps.x=ps.y=!0,()=>{ps.x=ps.y=!1})},t.setStyle=on,t.spring=ye,t.springValue=function(t,e){const n=rs(Bs(t)?t.get():t);return Ds(n,t,e),n},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=I(s)(l/e)*e}return e+l}},t.startWaapiAnimation=fn,t.statsBuffer=N,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(i):Math.ceil(i);return s(0,1,r/t)}},t.styleEffect=function(t,e){const n=ns(t),s=[];for(let t=0;t<n.length;t++){const i=n[t],r=us.get(i)??new as;us.set(i,r);for(const t in e){const n=cs(i,r,t,e[t]);s.push(n)}}return()=>{for(const t of s)t()}},t.supportedWaapiEasing=dn,t.supportsBrowserAnimation=Vn,t.supportsFlags=ln,t.supportsLinearEasing=cn,t.supportsPartialKeyframes=ts,t.supportsScrollTimeline=an,t.sync=ni,t.testValueType=In,t.time=H,t.transform=Os,t.transformPropOrder=Ue,t.transformProps=Ye,t.transformValue=Rs,t.transformValueTypes=Yn,t.velocityPerSecond=g,t.vh=mt,t.vw=gt,t.warnOnce=function(t,e,n){t||y.has(e)||(console.warn(e),n&&console.warn(n),y.add(e))},t.warning=()=>{},t.wrap=v}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const s=(t,e,n)=>n>e?e:n<t?t:n;let i=()=>{};const r={},o=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function a(t){return"object"==typeof t&&null!==t}const l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t,h=(t,e)=>n=>e(t(n)),d=(...t)=>t.reduce(h),p=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class f{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const m=t=>1e3*t,g=t=>t/1e3;function y(t,e){return e?t*(1e3/e):0}const v=new Set;const w=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},b=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function T(t,e,n,s){if(t===e&&n===s)return c;const i=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=b(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:b(i(t),e,s)}const x=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,V=t=>e=>1-t(1-e),M=T(.33,1.53,.69,.99),S=V(M),A=x(S),k=t=>(t*=2)<1?.5*S(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),P=V(E),C=x(E),F=T(.42,0,1,1),O=T(0,0,.58,1),R=T(.42,0,.58,1);const B=t=>Array.isArray(t)&&"number"!=typeof t[0];function D(t,e){return B(t)?t[w(0,t.length,e)]:t}const L=t=>Array.isArray(t)&&"number"==typeof t[0],I={linear:c,easeIn:F,easeInOut:R,easeOut:O,circIn:E,circInOut:C,circOut:P,backIn:S,backInOut:A,backOut:M,anticipate:k},W=t=>{if(L(t)){t.length;const[e,n,s,i]=t;return T(e,n,s,i)}return"string"==typeof t?I[t]:t},N=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],j={value:null,addProjectionMetrics:null};function K(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=N.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&i?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&j.value&&j.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(t)))}};return c}(o,e?n:void 0),t)),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const o=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:N.reduce(((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),o.schedule(e,r,a)),e}),{}),cancel:t=>{for(let e=0;e<N.length;e++)a[N[e]].cancel(t)},state:i,steps:a}}const{schedule:$,cancel:z,state:U,steps:Y}=K("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let X;function H(){X=void 0}const q={now:()=>(void 0===X&&q.set(U.isProcessing||r.useManualTiming?U.timestamp:performance.now()),X),set:t=>{X=t,queueMicrotask(H)}},G={layout:0,mainThread:0,waapi:0},Z=t=>e=>"string"==typeof e&&e.startsWith(t),_=Z("--"),J=Z("var(--"),Q=t=>!!J(t)&&tt.test(t.split("/*")[0].trim()),tt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,et={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},nt={...et,transform:t=>s(0,1,t)},st={...et,default:1},it=t=>Math.round(1e5*t)/1e5,rt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ot=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,at=(t,e)=>n=>Boolean("string"==typeof n&&ot.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),lt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(rt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ut={...et,transform:t=>Math.round((t=>s(0,255,t))(t))},ct={test:at("rgb","red"),parse:lt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ut.transform(t)+", "+ut.transform(e)+", "+ut.transform(n)+", "+it(nt.transform(s))+")"};const ht={test:at("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ct.transform},dt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),pt=dt("deg"),ft=dt("%"),mt=dt("px"),gt=dt("vh"),yt=dt("vw"),vt=(()=>({...ft,parse:t=>ft.parse(t)/100,transform:t=>ft.transform(100*t)}))(),wt={test:at("hsl","hue"),parse:lt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ft.transform(it(e))+", "+ft.transform(it(n))+", "+it(nt.transform(s))+")"},bt={test:t=>ct.test(t)||ht.test(t)||wt.test(t),parse:t=>ct.test(t)?ct.parse(t):wt.test(t)?wt.parse(t):ht.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ct.transform(t):wt.transform(t)},Tt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const xt="number",Vt="color",Mt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function St(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Mt,(t=>(bt.test(t)?(s.color.push(r),i.push(Vt),n.push(bt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(xt),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function At(t){return St(t).values}function kt(t){const{split:e,types:n}=St(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===xt?it(t[r]):e===Vt?bt.transform(t[r]):t[r]}return i}}const Et=t=>"number"==typeof t?0:t;const Pt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(rt)?.length||0)+(t.match(Tt)?.length||0)>0},parse:At,createTransformer:kt,getAnimatableNone:function(t){const e=At(t);return kt(t)(e.map(Et))}};function Ct(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ft({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Ct(a,s,t+1/3),r=Ct(a,s,t),o=Ct(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}function Ot(t,e){return n=>n>0?e:t}const Rt=(t,e,n)=>t+(e-t)*n,Bt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Dt=[ht,ct,wt];function Lt(t){const e=(n=t,Dt.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===wt&&(s=Ft(s)),s}const It=(t,e)=>{const n=Lt(t),s=Lt(e);if(!n||!s)return Ot(t,e);const i={...n};return t=>(i.red=Bt(n.red,s.red,t),i.green=Bt(n.green,s.green,t),i.blue=Bt(n.blue,s.blue,t),i.alpha=Rt(n.alpha,s.alpha,t),ct.transform(i))},Wt=new Set(["none","hidden"]);function Nt(t,e){return Wt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jt(t,e){return n=>Rt(t,e,n)}function Kt(t){return"number"==typeof t?jt:"string"==typeof t?Q(t)?Ot:bt.test(t)?It:Ut:Array.isArray(t)?$t:"object"==typeof t?bt.test(t)?It:zt:Ot}function $t(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>Kt(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function zt(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Kt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Ut=(t,e)=>{const n=Pt.createTransformer(e),s=St(t),i=St(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Wt.has(t)&&!i.values.length||Wt.has(e)&&!s.values.length?Nt(t,e):d($t(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Ot(t,e)};function Yt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Rt(t,e,n);return Kt(t)(t,e)}const Xt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>z(e),now:()=>U.isProcessing?U.timestamp:q.now()}},Ht=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},qt=2e4;function Gt(t){let e=0;let n=t.next(e);for(;!n.done&&e<qt;)e+=50,n=t.next(e);return e>=qt?1/0:e}function Zt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Gt(s),qt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:g(i)}}function _t(t,e,n){const s=Math.max(e-5,0);return y(n-t(s),e-s)}const Jt=100,Qt=10,te=1,ee=0,ne=800,se=.3,ie=.3,re={granular:.01,default:2},oe={granular:.005,default:.5},ae=.01,le=10,ue=.05,ce=1,he=.001;function de({duration:t=ne,bounce:e=se,velocity:n=ee,mass:i=te}){let r,o,a=1-e;a=s(ue,ce,a),t=s(ae,le,g(t)),a<1?(r=e=>{const s=e*a,i=s*t,r=s-n,o=fe(e,a),l=Math.exp(-i);return he-r/o*l},o=e=>{const s=e*a*t,i=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=fe(Math.pow(e,2),a);return(-r(e)+he>0?-1:1)*((i-o)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const l=function(t,e,n){let s=n;for(let n=1;n<pe;n++)s-=t(s)/e(s);return s}(r,o,5/t);if(t=m(t),isNaN(l))return{stiffness:Jt,damping:Qt,duration:t};{const e=Math.pow(l,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}const pe=12;function fe(t,e){return t*Math.sqrt(1-e*e)}const me=["duration","bounce"],ge=["stiffness","damping","mass"];function ye(t,e){return e.some((e=>void 0!==t[e]))}function ve(t=ie,e=se){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:f}=function(t){let e={velocity:ee,stiffness:Jt,damping:Qt,mass:te,isResolvedFromDuration:!1,...t};if(!ye(t,ge)&&ye(t,me))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),r=i*i,o=2*s(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:te,stiffness:r,damping:o}}else{const n=de(t);e={...e,...n,mass:te},e.isResolvedFromDuration=!0}return e}({...n,velocity:-g(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(u*h)),w=a-o,b=g(Math.sqrt(u/h)),T=Math.abs(w)<5;let x;if(i||(i=T?re.granular:re.default),r||(r=T?oe.granular:oe.default),v<1){const t=fe(b,v);x=e=>{const n=Math.exp(-v*b*e);return a-n*((y+v*b*w)/t*Math.sin(t*e)+w*Math.cos(t*e))}}else if(1===v)x=t=>a-Math.exp(-b*t)*(w+(y+b*w)*t);else{const t=b*Math.sqrt(v*v-1);x=e=>{const n=Math.exp(-v*b*e),s=Math.min(t*e,300);return a-n*((y+v*b*w)*Math.sinh(s)+t*w*Math.cosh(s))/t}}const V={calculatedDuration:f&&d||null,next:t=>{const e=x(t);if(f)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?m(y):_t(x,t,e));const s=Math.abs(n)<=i,o=Math.abs(a-e)<=r;l.done=s&&o}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(Gt(V),qt),e=Ht((e=>V.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return V}function we({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=ve({keyframes:[d.value,p(d.value)],velocity:_t(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}function be(t,e,{clamp:n=!0,ease:i,mixer:o}={}){const a=t.length;if(e.length,1===a)return()=>e[0];if(2===a&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const u=function(t,e,n){const s=[],i=n||r.mix||Yt,o=t.length-1;for(let n=0;n<o;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||c:e;r=d(t,r)}s.push(r)}return s}(e,i,o),h=u.length,f=n=>{if(l&&n<t[0])return e[0];let s=0;if(h>1)for(;s<t.length-2&&!(n<t[s+1]);s++);const i=p(t[s],t[s+1],n);return u[s](i)};return n?e=>f(s(t[0],t[a-1],e)):f}function Te(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=p(0,e,s);t.push(Rt(n,1,i))}}function xe(t){const e=[0];return Te(e,t.length-1),e}function Ve(t,e){return t.map((t=>t*e))}function Me(t,e){return t.map((()=>e||R)).splice(0,t.length-1)}function Se({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=B(s)?s.map(W):W(s),r={done:!1,value:e[0]},o=be(Ve(n&&n.length===e.length?n:xe(e),t),e,{ease:Array.isArray(i)?i:Me(e,i)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}ve.applyToOptions=t=>{const e=Zt(t,100,ve);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};const Ae=t=>null!==t;function ke(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ae),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Ee={decay:we,inertia:we,tween:Se,keyframes:Se,spring:ve};function Pe(t){"string"==typeof t.type&&(t.type=Ee[t.type])}class Ce{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Fe=t=>t/100;class Oe extends Ce{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(t=!0)=>{if(t){const{motionValue:t}=this.options;t&&t.updatedAt!==q.now()&&this.tick(q.now())}this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},G.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=Se,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Se;a!==Se&&"number"!=typeof o[0]&&(this.mixKeyframes=d(Fe,Yt(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Gt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w=this.currentTime,b=n;if(h){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(b=o)),w=s(0,1,n)*a}const T=v?{done:!1,value:c[0]}:b.next(w);r&&(T.value=r(T.value));let{done:x}=T;v||null===l||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const V=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return V&&f!==we&&(T.value=ke(c,this.options,g,this.speed)),m&&m(T.value),V&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return g(this.calculatedDuration)}get time(){return g(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(q.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=g(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Xt,startTime:e}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(q.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,G.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Re(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Be=t=>180*t/Math.PI,De=t=>{const e=Be(Math.atan2(t[1],t[0]));return Ie(e)},Le={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:De,rotateZ:De,skewX:t=>Be(Math.atan(t[1])),skewY:t=>Be(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ie=t=>((t%=360)<0&&(t+=360),t),We=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ne=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),je={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:We,scaleY:Ne,scale:t=>(We(t)+Ne(t))/2,rotateX:t=>Ie(Be(Math.atan2(t[6],t[5]))),rotateY:t=>Ie(Be(Math.atan2(-t[2],t[0]))),rotateZ:De,rotate:De,skewX:t=>Be(Math.atan(t[4])),skewY:t=>Be(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ke(t){return t.includes("scale")?1:0}function $e(t,e){if(!t||"none"===t)return Ke(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=je,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Le,i=e}if(!i)return Ke(e);const r=s[e],o=i[1].split(",").map(Ue);return"function"==typeof r?r(o):o[r]}const ze=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $e(n,e)};function Ue(t){return parseFloat(t.trim())}const Ye=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xe=(()=>new Set(Ye))(),He=t=>t===et||t===mt,qe=new Set(["x","y","z"]),Ge=Ye.filter((t=>!qe.has(t)));const Ze={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>$e(e,"x"),y:(t,{transform:e})=>$e(e,"y")};Ze.translateX=Ze.x,Ze.translateY=Ze.y;const _e=new Set;let Je=!1,Qe=!1,tn=!1;function en(){if(Qe){const t=Array.from(_e).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return Ge.forEach((n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Qe=!1,Je=!1,_e.forEach((t=>t.complete(tn))),_e.clear()}function nn(){_e.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Qe=!0)}))}function sn(){tn=!0,nn(),en(),tn=!1}class rn{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(_e.add(this),Je||(Je=!0,$.read(nn),$.resolveKeyframes(en))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}Re(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_e.delete(this)}cancel(){"scheduled"===this.state&&(_e.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const on=t=>t.startsWith("--");function an(t,e,n){on(e)?t.style.setProperty(e,n):t.style[e]=n}const ln=u((()=>void 0!==window.ScrollTimeline)),un={};function cn(t,e){const n=u(t);return()=>un[e]??n()}const hn=cn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),dn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,pn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dn([0,.65,.55,1]),circOut:dn([.55,0,1,.45]),backIn:dn([.31,.01,.66,-.59]),backOut:dn([.33,1.53,.69,.99])};function fn(t,e){return t?"function"==typeof t?hn()?Ht(t,e):"ease-out":L(t)?dn(t):Array.isArray(t)?t.map((t=>fn(t,e)||pn.easeOut)):pn[t]:void 0}function mn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=fn(a,i);Array.isArray(h)&&(c.easing=h),j.value&&G.waapi++;const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return j.value&&p.finished.finally((()=>{G.waapi--})),p}function gn(t){return"function"==typeof t&&"applyToOptions"in t}function yn({type:t,...e}){return gn(t)&&hn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class vn extends Ce{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const l=yn(t);this.animation=mn(e,n,s,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ke(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):an(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return g(Number(t))}get time(){return g(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=m(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ln()?(this.animation.timeline=t,c):e(this)}}const wn={anticipate:k,backInOut:A,circInOut:C};function bn(t){"string"==typeof t.ease&&t.ease in wn&&(t.ease=wn[t.ease])}class Tn extends vn{constructor(t){bn(t),Pe(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new Oe({...r,autoplay:!1}),a=m(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const xn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Pt.test(t)&&"0"!==t||t.startsWith("url(")));function Vn(t){return a(t)&&"offsetHeight"in t}const Mn=new Set(["opacity","clipPath","filter","transform"]),Sn=u((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));function An(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!Vn(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Sn()&&n&&Mn.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}class kn extends Ce{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=q.now();const h={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||rn;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:h}=n;this.resolvedAt=q.now(),function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=xn(i,e),a=xn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||gn(n))&&s)}(t,i,o,a)||(!r.instantAnimations&&l||h?.(ke(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},p=!u&&An(d)?new Tn({...d,element:d.motionValue.owner.current}):new Oe(d);p.finished.then((()=>this.notifyFinished())).catch(c),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(this.keyframeResolver?.resume(),sn()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class En{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map((e=>e.attachTimeline(t)));return()=>{e.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Pn extends En{then(t,e){return this.finished.finally(t).then((()=>{}))}}class Cn extends vn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Fn=new WeakMap,On=(t,e="")=>`${t}:${e}`;function Rn(t){const e=Fn.get(t)||new Map;return Fn.set(t,e),e}const Bn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dn(t){const e=Bn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Ln(t,e,n=1){const[s,i]=Dn(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return o(t)?parseFloat(t):t}return Q(i)?Ln(i,e,n+1):i}function In(t,e){return t?.[e]??t?.default??t}const Wn=new Set(["width","height","top","left","right","bottom",...Ye]),Nn=t=>e=>e.test(t),jn=[et,mt,ft,pt,yt,gt,{test:t=>"auto"===t,parse:t=>t}],Kn=t=>jn.find(Nn(t));const $n=new Set(["brightness","contrast","saturate","opacity"]);function zn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(rt)||[];if(!s)return t;const i=n.replace(s,"");let r=$n.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Un=/\b([a-z-]*)\(.*?\)/gu,Yn={...Pt,getAnimatableNone:t=>{const e=t.match(Un);return e?e.map(zn).join(" "):t}},Xn={...et,transform:Math.round},Hn={rotate:pt,rotateX:pt,rotateY:pt,rotateZ:pt,scale:st,scaleX:st,scaleY:st,scaleZ:st,skew:pt,skewX:pt,skewY:pt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:nt,originX:vt,originY:vt,originZ:mt},qn={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,radius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,top:mt,right:mt,bottom:mt,left:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,backgroundPositionX:mt,backgroundPositionY:mt,...Hn,zIndex:Xn,fillOpacity:nt,strokeOpacity:nt,numOctaves:Xn},Gn={...qn,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:Yn,WebkitFilter:Yn},Zn=t=>Gn[t];function _n(t,e){let n=Zn(t);return n!==Yn&&(n=Pt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Jn=new Set(["auto","none","0"]);class Qn extends rn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),Q(s))){const i=Ln(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Wn.has(n)||2!==t.length)return;const[s,i]=t,r=Kn(s),o=Kn(i);if(r!==o)if(He(r)&&He(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Ze[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||l(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Jn.has(e)&&St(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=_n(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ze[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ze[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const ts=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);function es(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&ts.has(e)&&(t[n]=t[n]+"px")}const ns=u((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),ss=new Set(["opacity","clipPath","filter","transform"]);function is(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const rs={current:void 0};class os{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=q.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=q.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new f);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return rs.current&&rs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=q.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return y(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function as(t,e){return new os(t,e)}const ls=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class us{constructor(){this.latest={},this.values=new Map}set(t,e,n,s){const i=this.values.get(t);i&&i.onRemove();const r=()=>{this.latest[t]=ls(e.get(),qn[t]),n&&$.render(n)};r();const o=e.on("change",r);s&&e.addDependent(s);const a=()=>{o(),n&&z(n),this.values.delete(t),s&&e.removeDependent(s)};return this.values.set(t,{value:e,onRemove:a}),a}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}const cs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const hs=new WeakMap;function ds(t,e,n,s){let i,r;return Xe.has(n)?(e.get("transform")||e.set("transform",new os("none"),(()=>{t.style.transform=function(t){let e="",n=!0;for(let s=0;s<Ye.length;s++){const i=Ye[s],r=t.latest[i];if(void 0===r)continue;let o=!0;o="number"==typeof r?r===(i.startsWith("scale")?1:0):0===parseFloat(r),o||(n=!1,e+=`${cs[i]||i}(${t.latest[i]}) `)}return n?"none":e.trim()}(e)})),r=e.get("transform")):i=on(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,s,i,r)}const{schedule:ps,cancel:fs}=K(queueMicrotask,!1),ms={x:!1,y:!1};function gs(){return ms.x||ms.y}function ys(t,e){const n=is(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function vs(t){return!("touch"===t.pointerType||gs())}const ws=(t,e)=>!!e&&(t===e||ws(t,e.parentElement)),bs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ts=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const xs=new WeakSet;function Vs(t){return e=>{"Enter"===e.key&&t(e)}}function Ms(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ss(t){return bs(t)&&!gs()}function As(t,e){const n=window.getComputedStyle(t);return on(e)?n.getPropertyValue(e):n[e]}function ks(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return $.preUpdate(s,!0),()=>z(s)}function Es(){const{value:t}=j;null!==t?(t.frameloop.rate.push(U.delta),t.animations.mainThread.push(G.mainThread),t.animations.waapi.push(G.waapi),t.animations.layout.push(G.layout)):z(Es)}function Ps(t){return t.reduce(((t,e)=>t+e),0)/t.length}function Cs(t,e=Ps){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Fs=t=>Math.round(1e3/t);function Os(){j.value=null,j.addProjectionMetrics=null}function Rs(){const{value:t}=j;if(!t)throw new Error("Stats are not being measured");Os(),z(Es);const e={frameloop:{setup:Cs(t.frameloop.setup),rate:Cs(t.frameloop.rate),read:Cs(t.frameloop.read),resolveKeyframes:Cs(t.frameloop.resolveKeyframes),preUpdate:Cs(t.frameloop.preUpdate),update:Cs(t.frameloop.update),preRender:Cs(t.frameloop.preRender),render:Cs(t.frameloop.render),postRender:Cs(t.frameloop.postRender)},animations:{mainThread:Cs(t.animations.mainThread),waapi:Cs(t.animations.waapi),layout:Cs(t.animations.layout)},layoutProjection:{nodes:Cs(t.layoutProjection.nodes),calculatedTargetDeltas:Cs(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:Cs(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Fs(n.min),n.max=Fs(n.max),n.avg=Fs(n.avg),[n.min,n.max]=[n.max,n.min],e}function Bs(t){return a(t)&&"ownerSVGElement"in t}function Ds(t){return Bs(t)&&"svg"===t.tagName}function Ls(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=be(t[1+n],t[2+n],t[3+n]);return e?i(s):i}function Is(t){const e=[];rs.current=e;const n=t();rs.current=void 0;const s=as(n);return function(t,e,n){const s=()=>e.set(n()),i=()=>$.preRender(s,!1,!0),r=t.map((t=>t.on("change",i)));e.on("destroy",(()=>{r.forEach((t=>t())),z(s)}))}(e,s,t),s}const Ws=t=>Boolean(t&&t.getVelocity);function Ns(t,e,n){const s=t.get();let i,r=null,o=s;const a="string"==typeof s?s.replace(/[\d.-]/g,""):void 0,l=()=>{r&&(r.stop(),r=null)},u=()=>{l(),r=new Oe({keyframes:[Ks(t.get()),Ks(o)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:i})};let c;return t.attach(((e,n)=>(o=e,i=t=>n(js(t,a)),$.postRender(u),t.get())),l),Ws(e)&&(c=e.on("change",(e=>t.set(js(e,a)))),t.on("destroy",c)),c}function js(t,e){return e?t+e:t}function Ks(t){return"number"==typeof t?t:parseFloat(t)}const $s=[...jn,bt,Pt],zs=t=>$s.find(Nn(t));function Us(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Ys={},Xs=null;const Hs=(t,e)=>{Ys[t]=e},qs=()=>{Xs||(Xs=document.createElement("style"),Xs.id="motion-view");let t="";for(const e in Ys){const n=Ys[e];t+=`${e} {\n`;for(const[e,s]of Object.entries(n))t+=` ${e}: ${s};\n`;t+="}\n"}Xs.textContent=t,document.head.appendChild(Xs),Ys={}},Gs=()=>{Xs&&Xs.parentElement&&Xs.parentElement.removeChild(Xs)};function Zs(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function _s(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}const Js=["layout","enter","exit","new","old"];function Qs(t){const{update:e,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise((async t=>{await e(),t(new En([]))}));(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Hs(":root",{"view-transition-name":"none"}),Hs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),qs();const i=document.startViewTransition((async()=>{await e()}));return i.finished.finally((()=>{Gs()})),new Promise((t=>{i.ready.then((()=>{const e=document.getAnimations().filter(_s),i=[];n.forEach(((t,e)=>{for(const n of Js){if(!t[n])continue;const{keyframes:r,options:o}=t[n];for(let[t,a]of Object.entries(r)){if(!a)continue;const r={...In(s,t),...In(o,t)},l=Us(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=m(r.duration)),r.delay&&(r.delay=m(r.delay));const u=new vn({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});i.push(u)}}}));for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:r}=e;if(!r)continue;const o=Zs(r);if(!o)continue;const a=n.get(o.layer);if(a)ti(a,"enter")&&ti(a,"exit")&&e.getKeyframes().some((t=>t.mixBlendMode))?i.push(new Cn(t)):t.cancel();else{const n="group"===o.type?"layout":"";let r={...In(s,n)};r.duration&&(r.duration=m(r.duration)),r=yn(r);const a=fn(r.ease,r.duration);e.updateTiming({delay:m(r.delay??0),duration:r.duration,easing:a}),i.push(new Cn(t))}}t(new En(i))}))}))}function ti(t,e){return t?.[e]?.keyframes.opacity}let ei=[],ni=null;function si(){ni=null;const[t]=ei;var e;t&&(n(ei,e=t),ni=e,Qs(e).then((t=>{e.notifyReady(t),t.finished.finally(si)})))}function ii(){for(let t=ei.length-1;t>=0;t--){const e=ei[t],{interrupt:n}=e.options;if("immediate"===n){const n=ei.slice(0,t+1).map((t=>t.update)),s=ei.slice(t+1);e.update=()=>{n.forEach((t=>t()))},ei=[e,...s];break}}ni&&"immediate"!==ei[0]?.options.interrupt||si()}class ri{constructor(t,e={}){var n;this.currentTarget="root",this.targets=new Map,this.notifyReady=c,this.readyPromise=new Promise((t=>{this.notifyReady=t})),this.update=t,this.options={interrupt:"wait",...e},n=this,ei.push(n),ps.render(ii)}get(t){return this.currentTarget=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentTarget:s,targets:i}=this;i.has(s)||i.set(s,{});i.get(s)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const oi=$,ai=N.reduce(((t,e)=>(t[e]=t=>z(t),t)),{});function li(t){return"object"==typeof t&&!Array.isArray(t)}function ui(t,e,n,s){return"string"==typeof t&&li(e)?is(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function ci(t,e,n){return t*(e+1)}function hi(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}function di(t,e,s,i,r,o){!function(t,e,s){for(let i=0;i<t.length;i++){const r=t[i];r.at>e&&r.at<s&&(n(t,r),i--)}}(t,r,o);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Rt(r,o,i[n]),easing:D(s,n)})}function pi(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function fi(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function mi(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function gi(t,e){return e[t]||(e[t]=[]),e[t]}function yi(t){return Array.isArray(t)?t:[t]}function vi(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const wi=t=>"number"==typeof t,bi=t=>t.every(wi),Ti=new WeakMap;function xi(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function Vi(t,e,n,s){if("function"==typeof e){const[i,r]=xi(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=xi(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function Mi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,as(n))}function Si(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Ai(t,e){const n=function(t,e,n){const s=t.getProps();return Vi(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Mi(t,e,Si(r[e]))}}function ki(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Ws(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const Ei=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Pi="data-"+Ei("framerAppearId");function Ci(t){return t.props[Pi]}const Fi=t=>null!==t;const Oi={type:"spring",stiffness:500,damping:25,restSpeed:10},Ri={type:"keyframes",duration:.8},Bi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Di=(t,{keyframes:e})=>e.length>2?Ri:Xe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Oi:Bi;const Li=(t,e,n,s={},i,o)=>a=>{const l=In(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=m(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||Object.assign(h,Di(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,h.duration=0,h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Fi),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(h.keyframes,l);if(void 0!==t)return void $.update((()=>{h.onUpdate(t),h.onComplete()}))}return l.isSync?new Oe(h):new kn(h)};function Ii({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Wi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||u&&Ii(u,e))continue;const o={delay:n,...In(r||{},e)},c=s.get();if(void 0!==c&&!s.isAnimating&&!Array.isArray(i)&&i===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=Ci(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(o.startTime=t,h=!0)}}ki(t,e),s.start(Li(e,s,i,t.shouldReduceMotion&&Wn.has(e)?{type:!1}:o,t,h));const d=s.animation;d&&l.push(d)}return o&&Promise.all(l).then((()=>{$.update((()=>{o&&Ai(t,o)}))})),l}const Ni={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ji={};for(const t in Ni)ji[t]={isEnabled:e=>Ni[t].some((t=>!!e[t]))};const Ki=()=>({x:{min:0,max:0},y:{min:0,max:0}}),$i="undefined"!=typeof window,zi={current:null},Ui={current:!1};const Yi=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Xi(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Yi.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const Hi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class qi{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=q.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,$.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Xi(e),this.isVariantNode=function(t){return Boolean(Xi(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&Ws(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ti.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Ui.current||function(){if(Ui.current=!0,$i)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>zi.current=t.matches;t.addListener(e),e()}else zi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||zi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),z(this.notifyUpdate),z(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Xe.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),r&&r(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ji){const e=ji[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Hi.length;e++){const n=Hi[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Ws(i))t.addValue(s,i);else if(Ws(r))t.addValue(s,as(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,as(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=as(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(o(n)||l(n))?n=parseFloat(n):!zs(n)&&Pt.test(e)&&(n=_n(t,e)),this.setBaseTarget(t,Ws(n)?n.get():n)),Ws(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=Vi(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Ws(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new f),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Gi extends qi{constructor(){super(...arguments),this.KeyframeResolver=Qn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ws(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Zi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_i=Ye.length;function Ji(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Xe.has(t))o=!0;else if(_(t))i[t]=n;else{const e=ls(n,qn[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<_i;r++){const o=Ye[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=ls(a,qn[o]);l||(i=!1,s+=`${Zi[o]||o}(${t}) `),n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function Qi(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}const tr={};function er(t,{layout:e,layoutId:n}){return Xe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!tr[t]||"opacity"===t)}function nr(t,e,n){const{style:s}=t,i={};for(const r in s)(Ws(s[r])||e.style&&Ws(e.style[r])||er(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(i[r]=s[r]);return i}class sr extends Gi{constructor(){super(...arguments),this.type="html",this.renderInstance=Qi}readValueFromInstance(t,e){if(Xe.has(e))return this.projection?.isProjecting?Ke(e):ze(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(_(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ji(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return nr(t,e,n)}}class ir extends qi{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const rr={offset:"stroke-dashoffset",array:"stroke-dasharray"},or={offset:"strokeDashoffset",array:"strokeDasharray"};function ar(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(Ji(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==s&&(h.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?rr:or;t[r.offset]=mt.transform(-s);const o=mt.transform(e),a=mt.transform(n);t[r.array]=`${o} ${a}`}(h,i,r,o,!1)}const lr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class ur extends Gi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ki}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Xe.has(e)){const t=Zn(e);return t&&t.default||0}return e=lr.has(e)?e:Ei(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=nr(t,e,n);for(const n in t)(Ws(t[n])||Ws(e[n]))&&(s[-1!==Ye.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){ar(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){Qi(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(lr.has(n)?n:Ei(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function cr(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Bs(t)&&!Ds(t)?new ur(e):new sr(e);n.mount(t),Ti.set(t,n)}function hr(t){const e=new ir({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Ti.set(t,e)}function dr(t,e,n,s){const i=[];if(function(t,e){return Ws(t)||"number"==typeof t||"string"==typeof t&&!li(e)}(t,e))i.push(function(t,e,n){const s=Ws(t)?t:as(t);return s.start(Li("",s,e,n)),s.animation}(t,li(e)&&e.default||e,n&&n.default||n));else{const r=ui(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?cr:hr;Ti.has(s)||a(s);const l=Ti.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...Wi(l,{...e,transition:u},{}))}}return i}function pr(t,e,n){const s=[],i=function(t,{defaultTransition:e={},...n}={},s,i){const r=e.duration||.3,o=new Map,a=new Map,l={},u=new Map;let c=0,h=0,d=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){u.set(o,h);continue}if(!Array.isArray(o)){u.set(o.name,hi(h,o.at,c,u));continue}let[p,f,g={}]=o;void 0!==g.at&&(h=hi(h,g.at,c,u));let y=0;const v=(t,n,s,o=0,a=0)=>{const l=yi(t),{delay:u=0,times:c=xe(l),type:p="keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...w}=n;let{ease:b=e.ease||"easeOut",duration:T}=n;const x="function"==typeof u?u(o,a):u,V=l.length,M=gn(p)?p:i?.[p];if(V<=2&&M){let t=100;if(2===V&&bi(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...w};void 0!==T&&(e.duration=m(T));const n=Zt(e,t,M);b=n.ease,T=n.duration}T??(T=r);const S=h+x;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&Te(c,A),1===l.length&&l.unshift(null),f){T=ci(T,f);const t=[...l],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let s=0;s<f;s++){l.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),b.push(0===i?"linear":D(n,i-1))}pi(c,f)}const k=S+T;di(s,l,b,c,S,k),y=Math.max(x+T,y),d=Math.max(k,d)};if(Ws(p))v(f,g,gi("default",mi(p,a)));else{const t=ui(p,f,s,l),e=t.length;for(let n=0;n<e;n++){const s=mi(t[n],a);for(const t in f)v(f[t],vi(g,t),gi(t,s),n,e)}}c=h,h+=y}return a.forEach(((t,s)=>{for(const i in t){const r=t[i];r.sort(fi);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(p(0,d,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const c=o.get(s);c.keyframes[i]=a,c.transition[i]={...e,duration:d,ease:u,times:l,...n}}})),o}(t,e,n,{spring:ve});return i.forEach((({keyframes:t,transition:e},n)=>{s.push(...dr(n,t,e))})),s}function fr(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&r.some(Array.isArray)?pr(e,n,t):dr(e,n,s,t);const o=new Pn(i);return t&&t.animations.push(o),o}}const mr=fr();const gr=t=>function(e,n,s){return new Pn(function(t,e,n,s){const i=is(t,s),r=i.length,o=[];for(let t=0;t<r;t++){const s=i[t],a={...n};"function"==typeof a.delay&&(a.delay=a.delay(t,r));for(const t in e){let n=e[t];Array.isArray(n)||(n=[n]);const i={...In(a,t)};i.duration&&(i.duration=m(i.duration)),i.delay&&(i.delay=m(i.delay));const r=Rn(s),l=On(t,i.pseudoElement||""),u=r.get(l);u&&u.stop(),o.push({map:r,key:l,unresolvedKeyframes:n,options:{...i,element:s,name:t,allowFlatten:!a.type&&!a.ease}})}}for(let t=0;t<o.length;t++){const{unresolvedKeyframes:e,options:n}=o[t],{element:s,name:i,pseudoElement:r}=n;r||null!==e[0]||(e[0]=As(s,i)),Re(e),es(e,i),!r&&e.length<2&&e.unshift(As(s,i)),n.keyframes=e}const a=[];for(let t=0;t<o.length;t++){const{map:e,key:n,options:s}=o[t],i=new vn(s);e.set(n,i),i.finished.finally((()=>e.delete(n))),a.push(i)}return a}(e,n,s,t))},yr=gr(),vr=new WeakMap;let wr;function br({target:t,contentRect:e,borderBoxSize:n}){vr.get(t)?.forEach((s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return Bs(t)&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function Tr(t){t.forEach(br)}function xr(t,e){wr||"undefined"!=typeof ResizeObserver&&(wr=new ResizeObserver(Tr));const n=is(t);return n.forEach((t=>{let n=vr.get(t);n||(n=new Set,vr.set(t,n)),n.add(e),wr?.observe(t)})),()=>{n.forEach((t=>{const n=vr.get(t);n?.delete(e),n?.size||wr?.unobserve(t)}))}}const Vr=new Set;let Mr;function Sr(t){return Vr.add(t),Mr||(Mr=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Vr.forEach((t=>t(e)))},window.addEventListener("resize",Mr)),()=>{Vr.delete(t),!Vr.size&&Mr&&(Mr=void 0)}}const Ar={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function kr(t,e,n,s){const i=n[e],{length:r,position:o}=Ar[e],a=i.current,l=n.time;i.current=t[`scroll${o}`],i.scrollLength=t[`scroll${r}`]-t[`client${r}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=p(0,i.scrollLength,i.current);const u=s-l;i.velocity=u>50?0:y(i.current-a,u)}const Er={start:0,center:.5,end:1};function Pr(t,e,n=0){let s=0;if(t in Er&&(t=Er[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const Cr=[0,0];function Fr(t,e,n,s){let i=Array.isArray(t)?t:Cr,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Er[t]?t:"0"]),r=Pr(i[0],n,s),o=Pr(i[1],e),r-o}const Or={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Rr={x:0,y:0};function Br(t,e,n){const{offset:i=Or.All}=n,{target:r=t,axis:o="y"}=n,a="y"===o?"height":"width",l=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(Vn(s))n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(r,t):Rr,u=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let h=!e[o].interpolate;const d=i.length;for(let t=0;t<d;t++){const n=Fr(i[t],c[a],u[a],l[o]);h||n===e[o].interpolatorOffsets[t]||(h=!0),e[o].offset[t]=n}h&&(e[o].interpolate=be(e[o].offset,xe(i),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=s(0,1,e[o].interpolate(e[o].current))}function Dr(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){kr(t,"x",e,n),kr(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Br(t,n,s)},notify:()=>e(n)}}const Lr=new WeakMap,Ir=new WeakMap,Wr=new WeakMap,Nr=t=>t===document.scrollingElement?window:t;function jr(t,{container:e=document.scrollingElement,...n}={}){if(!e)return c;let s=Wr.get(e);s||(s=new Set,Wr.set(e,s));const i=Dr(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!Lr.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(U.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{$.read(t),$.read(n),$.preUpdate(i)};Lr.set(e,a);const l=Nr(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Ir.set(e,(o=a,"function"==typeof(r=e)?Sr(r):xr(r,o))),l.addEventListener("scroll",a,{passive:!0}),a()}var r,o;const a=Lr.get(e);return $.read(a,!1,!0),()=>{z(a);const t=Wr.get(e);if(!t)return;if(t.delete(i),t.size)return;const n=Lr.get(e);Lr.delete(e),n&&(Nr(e).removeEventListener("scroll",n),Ir.get(e)?.(),window.removeEventListener("resize",n))}}const Kr=new Map;function $r({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const i=Kr.get(e)??new Map;Kr.set(e,i);const r=n.target??"self",o=i.get(r)??{},a=s+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&ln()?new ScrollTimeline({source:e,axis:s}):function(t){const e={value:0},n=jr((n=>{e.value=100*n[t.axis].progress}),t);return{currentTime:e,cancel:n}}({container:e,...n})),o[a]}const zr={some:0,all:1};const Ur=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=kn,t.DOMKeyframesResolver=Qn,t.GroupAnimation=En,t.GroupAnimationWithThen=Pn,t.JSAnimation=Oe,t.KeyframeResolver=rn,t.MotionGlobalConfig=r,t.MotionValue=os,t.NativeAnimation=vn,t.NativeAnimationExtended=Tn,t.NativeAnimationWrapper=Cn,t.SubscriptionManager=f,t.ViewTransitionBuilder=ri,t.acceleratedValues=ss,t.activeAnimations=G,t.addUniqueItem=e,t.alpha=nt,t.analyseComplexValue=St,t.animate=mr,t.animateMini=yr,t.animateValue=function(t){return new Oe(t)},t.animateView=function(t,e={}){return new ri(t,e)},t.animationMapKey=On,t.anticipate=k,t.applyPxDefaults=es,t.attachSpring=Ns,t.backIn=S,t.backInOut=A,t.backOut=M,t.calcGeneratorDuration=Gt,t.cancelFrame=z,t.cancelMicrotask=fs,t.cancelSync=ai,t.circIn=E,t.circInOut=C,t.circOut=P,t.clamp=s,t.collectMotionValues=rs,t.color=bt,t.complex=Pt,t.convertOffsetToTimes=Ve,t.createGeneratorEasing=Zt,t.createRenderBatcher=K,t.createScopedAnimate=fr,t.cubicBezier=T,t.cubicBezierAsString=dn,t.defaultEasing=Me,t.defaultOffset=xe,t.defaultTransformValue=Ke,t.defaultValueTypes=Gn,t.degrees=pt,t.delay=function(t,e){return function(t,e){const n=q.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(z(s),t(r-e))};return $.setup(s,!0),()=>z(s)}(t,m(e))},t.dimensionValueTypes=jn,t.distance=Ur,t.distance2D=function(t,e){const n=Ur(t.x,e.x),s=Ur(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=F,t.easeInOut=R,t.easeOut=O,t.easingDefinitionToFunction=W,t.fillOffset=Te,t.fillWildcards=Re,t.findDimensionValueType=Kn,t.findValueType=zs,t.flushKeyframeResolvers=sn,t.frame=$,t.frameData=U,t.frameSteps=Y,t.generateLinearEasing=Ht,t.getAnimatableNone=_n,t.getAnimationMap=Rn,t.getComputedStyle=As,t.getDefaultValueType=Zn,t.getEasingForSegment=D,t.getMixer=Kt,t.getValueAsType=ls,t.getValueTransition=In,t.getVariableValue=Ln,t.hasWarned=function(t){return v.has(t)},t.hex=ht,t.hover=function(t,e,n={}){const[s,i,r]=ys(t,n),o=t=>{if(!vs(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{vs(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r},t.hsla=wt,t.hslaToRgba=Ft,t.inView=function(t,e,{root:n,margin:s,amount:i="some"}={}){const r=is(t),o=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))}))}),{root:n,rootMargin:s,threshold:"number"==typeof i?i:zr[i]});return r.forEach((t=>a.observe(t))),()=>a.disconnect()},t.inertia=we,t.interpolate=be,t.invariant=i,t.invisibleValues=Wt,t.isBezierDefinition=L,t.isCSSVariableName=_,t.isCSSVariableToken=Q,t.isDragActive=gs,t.isDragging=ms,t.isEasingArray=B,t.isGenerator=gn,t.isHTMLElement=Vn,t.isMotionValue=Ws,t.isNodeOrChild=ws,t.isNumericalString=o,t.isObject=a,t.isPrimaryPointer=bs,t.isSVGElement=Bs,t.isSVGSVGElement=Ds,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&hn()||!e||"string"==typeof e&&(e in pn||hn())||L(e)||Array.isArray(e)&&e.every(t))},t.isZeroValueString=l,t.keyframes=Se,t.mapEasingToNativeEasing=fn,t.mapValue=function(t,e,n,s){const i=Ls(e,n,s);return Is((()=>i(t.get())))},t.maxGeneratorDuration=qt,t.memo=u,t.microtask=ps,t.millisecondsToSeconds=g,t.mirrorEasing=x,t.mix=Yt,t.mixArray=$t,t.mixColor=It,t.mixComplex=Ut,t.mixImmediate=Ot,t.mixLinearColor=Bt,t.mixNumber=Rt,t.mixObject=zt,t.mixVisibility=Nt,t.motionValue=as,t.moveItem=function([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&s<t.length){const s=n<0?t.length+n:n,[i]=t.splice(e,1);t.splice(s,0,i)}return t},t.noop=c,t.number=et,t.numberValueTypes=qn,t.observeTimeline=ks,t.parseCSSVariable=Dn,t.parseValueFromTransform=$e,t.percent=ft,t.pipe=d,t.positionalKeys=Wn,t.press=function(t,e,n={}){const[s,i,r]=ys(t,n),o=t=>{const s=t.currentTarget;if(!Ss(t))return;xs.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),xs.has(s)&&xs.delete(s),Ss(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||ws(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),Vn(t)&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Vs((()=>{if(xs.has(n))return;Ms(n,"down");const t=Vs((()=>{Ms(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>Ms(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,Ts.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r},t.progress=p,t.progressPercentage=vt,t.px=mt,t.readTransformValue=ze,t.recordStats=function(){if(j.value)throw Os(),new Error("Stats are already being measured");const t=j;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},$.postRender(Es,!0),Rs},t.removeItem=n,t.resolveElements=is,t.reverseEasing=V,t.rgbUnit=ut,t.rgba=ct,t.scale=st,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...s}={}){if(!n)return c;const i={axis:e,container:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?jr((n=>{t(n[e.axis].progress,n)}),e):ks(t,$r(e))}(t,i):function(t,e){const n=$r(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),ks((e=>{t.time=t.duration*e}),n))})}(t,i)},t.scrollInfo=jr,t.secondsToMilliseconds=m,t.setDragLock=function(t){return"x"===t||"y"===t?ms[t]?null:(ms[t]=!0,()=>{ms[t]=!1}):ms.x||ms.y?null:(ms.x=ms.y=!0,()=>{ms.x=ms.y=!1})},t.setStyle=an,t.spring=ve,t.springValue=function(t,e){const n=as(Ws(t)?t.get():t);return Ns(n,t,e),n},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=W(s)(l/e)*e}return e+l}},t.startWaapiAnimation=mn,t.statsBuffer=j,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(i):Math.ceil(i);return s(0,1,r/t)}},t.styleEffect=function(t,e){const n=is(t),s=[];for(let t=0;t<n.length;t++){const i=n[t],r=hs.get(i)??new us;hs.set(i,r);for(const t in e){const n=ds(i,r,t,e[t]);s.push(n)}}return()=>{for(const t of s)t()}},t.supportedWaapiEasing=pn,t.supportsBrowserAnimation=An,t.supportsFlags=un,t.supportsLinearEasing=hn,t.supportsPartialKeyframes=ns,t.supportsScrollTimeline=ln,t.sync=oi,t.testValueType=Nn,t.time=q,t.transform=Ls,t.transformPropOrder=Ye,t.transformProps=Xe,t.transformValue=Is,t.transformValueTypes=Hn,t.velocityPerSecond=y,t.vh=gt,t.vw=yt,t.warnOnce=function(t,e,n){t||v.has(e)||(console.warn(e),n&&console.warn(n),v.add(e))},t.warning=()=>{},t.wrap=w}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "12.12.0",
3
+ "version": "12.12.1",
4
4
  "description": "An animation library for JavaScript and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/motion/lib/index.mjs",
@@ -76,7 +76,7 @@
76
76
  "postpublish": "git push --tags"
77
77
  },
78
78
  "dependencies": {
79
- "framer-motion": "^12.12.0",
79
+ "framer-motion": "^12.12.1",
80
80
  "tslib": "^2.4.0"
81
81
  },
82
82
  "peerDependencies": {
@@ -95,5 +95,5 @@
95
95
  "optional": true
96
96
  }
97
97
  },
98
- "gitHead": "a18e65cd651d6551a4917c3cd06699273ad441aa"
98
+ "gitHead": "88761b3d127265d3ba7047093612d1fb8a55d2cd"
99
99
  }
@@ -1,5 +0,0 @@
1
- function isSVGElement(element) {
2
- return element instanceof SVGElement && element.tagName !== "svg";
3
- }
4
-
5
- export { isSVGElement };