@tamagui/animations-reanimated 3.0.7 → 3.0.8

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.
@@ -39,7 +39,7 @@ var import_normalize_colors = __toESM(require("@react-native/normalize-colors"),
39
39
  var import_react = __toESM(require("react"), 1);
40
40
  var import_react_native_reanimated = __toESM(require("react-native-reanimated"), 1);
41
41
  var NON_ANIMATABLE_VALUE = /^(auto|min-content|max-content|fit-content|stretch|inherit|initial|unset)\b|^calc\(/;
42
- var getDefaultExport = function(module2) {
42
+ var getDefaultExport = function getDefaultExport2(module2) {
43
43
  var mod = module2;
44
44
  if (mod.__esModule || mod[Symbol.toStringTag] === "Module") {
45
45
  return mod.default || mod;
@@ -47,7 +47,7 @@ var getDefaultExport = function(module2) {
47
47
  return mod;
48
48
  };
49
49
  var Animated = getDefaultExport(import_react_native_reanimated.default);
50
- var silenceAnimatedComponentDevCheck = function(style) {
50
+ var silenceAnimatedComponentDevCheck = function silenceAnimatedComponentDevCheck2(style) {
51
51
  if (process.env.NODE_ENV !== "development" || import_core.isWeb || !style || typeof style !== "object") {
52
52
  return;
53
53
  }
@@ -57,7 +57,7 @@ var silenceAnimatedComponentDevCheck = function(style) {
57
57
  value: true
58
58
  });
59
59
  };
60
- var resolveDynamicValue = function(value, isDark) {
60
+ var resolveDynamicValue = function resolveDynamicValue2(value, isDark) {
61
61
  if (value !== null && typeof value === "object" && "dynamic" in value && typeof value.dynamic === "object") {
62
62
  var dynamic = value.dynamic;
63
63
  return isDark ? dynamic.dark : dynamic.light;
@@ -76,7 +76,7 @@ var updateMapperState = import_core.isWeb ? function(state, emitted, ownedStatic
76
76
  return current;
77
77
  }, false);
78
78
  };
79
- var cloneAnimationValue = function(value) {
79
+ var cloneAnimationValue = function cloneAnimationValue1(value) {
80
80
  if (Array.isArray(value)) {
81
81
  return value.map(cloneAnimationValue);
82
82
  }
@@ -89,23 +89,23 @@ var cloneAnimationValue = function(value) {
89
89
  }
90
90
  return value;
91
91
  };
92
- var cloneStyleRecord = function(style) {
92
+ var cloneStyleRecord = function cloneStyleRecord2(style) {
93
93
  var next = {};
94
94
  for (var key in style) {
95
95
  next[key] = cloneAnimationValue(style[key]);
96
96
  }
97
97
  return next;
98
98
  };
99
- var cloneTransitionConfig = function(config) {
99
+ var cloneTransitionConfig = function cloneTransitionConfig2(config) {
100
100
  return cloneAnimationValue(config);
101
101
  };
102
- var getAnimatedTransforms = function(value) {
102
+ var getAnimatedTransforms = function getAnimatedTransforms2(value) {
103
103
  if (!Array.isArray(value)) return [];
104
104
  return value.filter(function(item) {
105
105
  return item !== null && typeof item === "object" && !Array.isArray(item);
106
106
  });
107
107
  };
108
- var getRemovedAnimatedKeys = function(current, previous) {
108
+ var getRemovedAnimatedKeys = function getRemovedAnimatedKeys2(current, previous) {
109
109
  var removedKeys = {};
110
110
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
111
111
  try {
@@ -129,7 +129,7 @@ var getRemovedAnimatedKeys = function(current, previous) {
129
129
  }
130
130
  return removedKeys;
131
131
  };
132
- var getImplicitDefault = function(key, targetValue) {
132
+ var getImplicitDefault = function getImplicitDefault2(key, targetValue) {
133
133
  "worklet";
134
134
  var value = key === "opacity" || key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
135
135
  if (typeof targetValue !== "string") return value;
@@ -145,11 +145,11 @@ var getImplicitDefault = function(key, targetValue) {
145
145
  }
146
146
  return suffixIndex > 0 ? `${value}${targetValue.slice(suffixIndex)}` : value;
147
147
  };
148
- var getLeadingRatio = function(metrics) {
148
+ var getLeadingRatio = function getLeadingRatio2(metrics) {
149
149
  var ratio = metrics === null || metrics === void 0 ? void 0 : metrics.lineHeight;
150
150
  return typeof ratio === "number" && Number.isFinite(ratio) && ratio >= 0 ? ratio : void 0;
151
151
  };
152
- var derivesLeadingProduct = function(style, ratio, inheritsFontSize, resolved) {
152
+ var derivesLeadingProduct = function derivesLeadingProduct2(style, ratio, inheritsFontSize, resolved) {
153
153
  return ratio !== void 0 && (inheritsFontSize || typeof style.lineHeight === "number" && typeof style.fontSize === "number" && (!!(0, import_animation_helpers.getTransitionForKey)(resolved, "fontSize") || !!(0, import_animation_helpers.getTransitionForKey)(resolved, "lineHeight")));
154
154
  };
155
155
  var COLOR_STYLE_KEYS = {
@@ -161,7 +161,7 @@ var COLOR_STYLE_KEYS = {
161
161
  borderBottomColor: true,
162
162
  color: true
163
163
  };
164
- var toReanimatedColor = function(value) {
164
+ var toReanimatedColor = function toReanimatedColor2(value) {
165
165
  "worklet";
166
166
  if (typeof value === "number") {
167
167
  var color = value >>> 0;
@@ -176,12 +176,12 @@ var toReanimatedColor = function(value) {
176
176
  if (trimmed === "transparent") return "rgba(0, 0, 0, 0)";
177
177
  return trimmed;
178
178
  };
179
- var isReanimatedColorHistory = function(value) {
179
+ var isReanimatedColorHistory = function isReanimatedColorHistory2(value) {
180
180
  "worklet";
181
181
  var normalized = toReanimatedColor(value);
182
182
  return typeof normalized === "string" && normalized.startsWith("rgba(");
183
183
  };
184
- var normalizeAnimationColor = function(value) {
184
+ var normalizeAnimationColor = function normalizeAnimationColor2(value) {
185
185
  if (typeof value === "number") {
186
186
  return toReanimatedColor(value);
187
187
  }
@@ -194,7 +194,7 @@ var normalizeAnimationColor = function(value) {
194
194
  var alpha = (color & 255) / 255;
195
195
  return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
196
196
  };
197
- var buildSnapshot = function(animated, statics, transforms, previousKeys, lastPainted) {
197
+ var buildSnapshot = function buildSnapshot2(animated, statics, transforms, previousKeys, lastPainted) {
198
198
  var derivesLeading = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
199
199
  var snapshotAnimated = {};
200
200
  var snapshotStatics = cloneStyleRecord(statics);
@@ -271,7 +271,7 @@ var buildSnapshot = function(animated, statics, transforms, previousKeys, lastPa
271
271
  try {
272
272
  for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
273
273
  var key4 = _step2.value;
274
- var _seeds_key, _ref;
274
+ var _ref, _seeds_key;
275
275
  var value2 = previousKeys.has(key4) ? (_ref = (_seeds_key = seeds[key4]) !== null && _seeds_key !== void 0 ? _seeds_key : snapshotStatics[key4]) !== null && _ref !== void 0 ? _ref : lastPainted[key4] : lastPainted[key4];
276
276
  if (typeof value2 !== "number" && typeof value2 !== "string") {
277
277
  delete seeds[key4];
@@ -386,10 +386,10 @@ var buildSnapshot = function(animated, statics, transforms, previousKeys, lastPa
386
386
  keys
387
387
  };
388
388
  };
389
- var getGatedKeys = function(snapshot) {
389
+ var getGatedKeys = function getGatedKeys2(snapshot) {
390
390
  return Object.keys(snapshot.gatedKeys);
391
391
  };
392
- var createReanimatedConfig = function(config) {
392
+ var createReanimatedConfig = function createReanimatedConfig2(config) {
393
393
  "worklet";
394
394
  var next = {};
395
395
  var source = config;
@@ -402,7 +402,7 @@ var createReanimatedConfig = function(config) {
402
402
  }
403
403
  return next;
404
404
  };
405
- var applyAnimation = function(targetValue, config, callback, seedValue) {
405
+ var applyAnimation = function applyAnimation2(targetValue, config, callback, seedValue) {
406
406
  "worklet";
407
407
  var validateStartAsColor = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, publishTo = arguments.length > 5 ? arguments[5] : void 0;
408
408
  var delay = config.delay;
@@ -447,7 +447,7 @@ var applyAnimation = function(targetValue, config, callback, seedValue) {
447
447
  }
448
448
  return animatedValue;
449
449
  };
450
- var animateSnapshotValue = function(key, implicitKey, targetValue, config, previouslyEmitted, seedValue, gated, currentlyExiting, exitCycleId, currentlyCompletingEnter, enterCycleId, currentlyCompletingUpdate, updateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone) {
450
+ var animateSnapshotValue = function animateSnapshotValue2(key, implicitKey, targetValue, config, previouslyEmitted, seedValue, gated, currentlyExiting, exitCycleId, currentlyCompletingEnter, enterCycleId, currentlyCompletingUpdate, updateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone) {
451
451
  "worklet";
452
452
  var validateStartAsColor = arguments.length > 16 && arguments[16] !== void 0 ? arguments[16] : false, publishTo = arguments.length > 17 ? arguments[17] : void 0;
453
453
  var cycleGated = gated && (currentlyExiting || currentlyCompletingEnter || currentlyCompletingUpdate);
@@ -457,17 +457,17 @@ var animateSnapshotValue = function(key, implicitKey, targetValue, config, previ
457
457
  }
458
458
  var callback;
459
459
  if (gated && currentlyExiting) {
460
- callback = function(finished) {
460
+ callback = function callback2(finished) {
461
461
  "worklet";
462
462
  (0, import_react_native_reanimated.runOnJS)(markExitKeyDone)(key, exitCycleId, finished !== null && finished !== void 0 ? finished : false);
463
463
  };
464
464
  } else if (gated && currentlyCompletingEnter) {
465
- callback = function() {
465
+ callback = function callback2() {
466
466
  "worklet";
467
467
  (0, import_react_native_reanimated.runOnJS)(markEnterKeyDone)(key, enterCycleId);
468
468
  };
469
469
  } else if (gated && currentlyCompletingUpdate) {
470
- callback = function(finished) {
470
+ callback = function callback2(finished) {
471
471
  "worklet";
472
472
  (0, import_react_native_reanimated.runOnJS)(markUpdateKeyDone)(key, updateCycleId, finished !== null && finished !== void 0 ? finished : false);
473
473
  };
@@ -529,12 +529,12 @@ var ANIMATABLE_PROPERTIES = {
529
529
  flexGrow: true,
530
530
  flexShrink: true
531
531
  };
532
- var canAnimateProperty = function(key, value) {
532
+ var canAnimateProperty = function canAnimateProperty2(key, value) {
533
533
  if (!ANIMATABLE_PROPERTIES[key]) return false;
534
534
  if (typeof value === "string" && NON_ANIMATABLE_VALUE.test(value)) return false;
535
535
  return true;
536
536
  };
537
- var splitAnimationStyles = function(style, isDark, disableAnimation) {
537
+ var splitAnimationStyles = function splitAnimationStyles2(style, isDark, disableAnimation) {
538
538
  var animated = {};
539
539
  var statics = {};
540
540
  for (var key in style) {
@@ -554,6 +554,7 @@ var splitAnimationStyles = function(style, isDark, disableAnimation) {
554
554
  function createWebAnimatedComponent(defaultTag) {
555
555
  var isText = defaultTag === "span";
556
556
  var Component = Animated.createAnimatedComponent((0, import_core.createRefComponent)(function(propsIn, ref) {
557
+ var _ref, _ref1, _ref2;
557
558
  var _hooks_usePropsTransform;
558
559
  var { forwardedRef, render = defaultTag, ...rest } = propsIn;
559
560
  var hostRef = (0, import_react.useRef)(null);
@@ -562,13 +563,11 @@ function createWebAnimatedComponent(defaultTag) {
562
563
  return hostRef.current;
563
564
  } });
564
565
  var [, themeState] = (0, import_internal_runtime.useThemeWithState)({});
565
- var _themeState_theme, _themeState_name;
566
- var result = (0, import_core.getSplitStyles)(rest, isText ? import_core.Text.staticConfig : import_core.View.staticConfig, (_themeState_theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme) !== null && _themeState_theme !== void 0 ? _themeState_theme : {}, (_themeState_name = themeState === null || themeState === void 0 ? void 0 : themeState.name) !== null && _themeState_name !== void 0 ? _themeState_name : "", { unmounted: false }, {
566
+ var result = (0, import_core.getSplitStyles)(rest, isText ? import_core.Text.staticConfig : import_core.View.staticConfig, (_ref = themeState === null || themeState === void 0 ? void 0 : themeState.theme) !== null && _ref !== void 0 ? _ref : {}, (_ref1 = themeState === null || themeState === void 0 ? void 0 : themeState.name) !== null && _ref1 !== void 0 ? _ref1 : "", { unmounted: false }, {
567
567
  isAnimated: false,
568
568
  noClass: true
569
569
  });
570
- var _result_viewProps;
571
- var viewProps = (_result_viewProps = result === null || result === void 0 ? void 0 : result.viewProps) !== null && _result_viewProps !== void 0 ? _result_viewProps : {};
570
+ var viewProps = (_ref2 = result === null || result === void 0 ? void 0 : result.viewProps) !== null && _ref2 !== void 0 ? _ref2 : {};
572
571
  var Element = render;
573
572
  var transformedProps = (_hooks_usePropsTransform = import_core.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_core.hooks, render, viewProps, stateRef, false);
574
573
  var { nativeID, ...webProps } = transformedProps !== null && transformedProps !== void 0 ? transformedProps : viewProps;
@@ -640,7 +639,7 @@ function buildTransitionConfig(transition, animations, animationState, styleKeys
640
639
  resolved
641
640
  };
642
641
  }
643
- var instantConfig = function() {
642
+ var instantConfig = function instantConfig2() {
644
643
  return {
645
644
  type: "timing",
646
645
  duration: 0
@@ -740,7 +739,7 @@ function createAnimations(animations) {
740
739
  animations,
741
740
  usePresence: import_use_presence.usePresence,
742
741
  ResetPresence: import_use_presence.ResetPresence,
743
- useTextMetrics: function(param) {
742
+ useTextMetrics: function useTextMetrics(param) {
744
743
  var { inheritedText, lineHeight } = param;
745
744
  var node = (inheritedText === null || inheritedText === void 0 ? void 0 : inheritedText.driver) === "reanimated" ? inheritedText.fontSize : null;
746
745
  var ratio = typeof lineHeight === "number" ? lineHeight : null;
@@ -852,6 +851,7 @@ function createAnimations(animations) {
852
851
  return animatedStyle;
853
852
  },
854
853
  useAnimations(animationProps) {
854
+ var _ref, _exitSeedRef_current;
855
855
  var { props, presence, style, componentState, useStyleEmitter, themeName, stateRef, styleState, onTransition, inheritedText } = animationProps;
856
856
  var isHydrating = componentState.unmounted === true;
857
857
  var isMounting = componentState.unmounted === "should-enter";
@@ -862,8 +862,7 @@ function createAnimations(animations) {
862
862
  import_react.default.useEffect(function() {
863
863
  wasEnteringRef.current = isEntering;
864
864
  });
865
- var _styleState_effectiveTransition;
866
- var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
865
+ var effectiveTransition = (_ref = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _ref !== void 0 ? _ref : props.transition;
867
866
  var leadingRatio = getLeadingRatio(styleState === null || styleState === void 0 ? void 0 : styleState.nativeTextMetrics);
868
867
  var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
869
868
  var resolvedTransition = (0, import_animation_helpers.forAnimationState)((0, import_animation_helpers.resolveTransition)(effectiveTransition, { animations }), animationState);
@@ -880,7 +879,7 @@ function createAnimations(animations) {
880
879
  var leadingFontSize = inheritedFontSize !== null && inheritedFontSize !== void 0 ? inheritedFontSize : fontSizeShared;
881
880
  var leadingRatioShared = (0, import_react_native_reanimated.useSharedValue)(leadingRatio !== null && leadingRatio !== void 0 ? leadingRatio : 0);
882
881
  var paintedRatioRef = (0, import_react.useRef)(leadingRatio);
883
- var applyLeadingRatio = function(ratio, config) {
882
+ var applyLeadingRatio = function applyLeadingRatio2(ratio, config) {
884
883
  var previous = paintedRatioRef.current;
885
884
  if (previous === ratio) return;
886
885
  paintedRatioRef.current = ratio;
@@ -891,7 +890,7 @@ function createAnimations(animations) {
891
890
  var sendExitComplete = presence === null || presence === void 0 ? void 0 : presence[1];
892
891
  var onTransitionRef = (0, import_react.useRef)(onTransition);
893
892
  onTransitionRef.current = onTransition;
894
- var emit = function(phase, cause, finished) {
893
+ var emit = function emit2(phase, cause, finished) {
895
894
  var _onTransitionRef_current;
896
895
  (_onTransitionRef_current = onTransitionRef.current) === null || _onTransitionRef_current === void 0 ? void 0 : _onTransitionRef_current.call(onTransitionRef, phase === "end" ? {
897
896
  phase,
@@ -1009,7 +1008,6 @@ function createAnimations(animations) {
1009
1008
  var lastPaintedRef = (0, import_react.useRef)({});
1010
1009
  var carryRef = (0, import_react.useRef)({});
1011
1010
  var exitSeedRef = (0, import_react.useRef)(null);
1012
- var _exitSeedRef_current;
1013
1011
  var paintedPredecessor = isExiting ? (_exitSeedRef_current = exitSeedRef.current) !== null && _exitSeedRef_current !== void 0 ? _exitSeedRef_current : lastPaintedRef.current : lastPaintedRef.current;
1014
1012
  (0, import_core.useIsomorphicLayoutEffect)(function() {
1015
1013
  exitSeedRef.current = isExiting ? paintedPredecessor : null;
@@ -1144,7 +1142,7 @@ function createAnimations(animations) {
1144
1142
  };
1145
1143
  var configRef = (0, import_react_native_reanimated.useSharedValue)(renderConfig);
1146
1144
  var writtenConfigRef = (0, import_react.useRef)(renderConfig);
1147
- var writeConfig = function(next) {
1145
+ var writeConfig = function writeConfig2(next) {
1148
1146
  if (sameDriverConfig(writtenConfigRef.current, next)) return;
1149
1147
  writtenConfigRef.current = next;
1150
1148
  configRef.value = next;
@@ -1158,11 +1156,12 @@ function createAnimations(animations) {
1158
1156
  isHydrating
1159
1157
  ]);
1160
1158
  (0, import_core.useIsomorphicLayoutEffect)(function() {
1161
- if (emitterSnapshotRef.value !== null) return;
1162
1159
  var _propertyConfigs_lineHeight;
1160
+ if (emitterSnapshotRef.value !== null) return;
1163
1161
  applyLeadingRatio(leadingRatio, (_propertyConfigs_lineHeight = propertyConfigs.lineHeight) !== null && _propertyConfigs_lineHeight !== void 0 ? _propertyConfigs_lineHeight : baseConfig);
1164
1162
  });
1165
- var onEmittedStyle = function(nextStyle, effectiveTransition2, pseudoActive, nextMetrics) {
1163
+ var onEmittedStyle = function onEmittedStyle2(nextStyle, effectiveTransition2, pseudoActive, nextMetrics) {
1164
+ var _emitterKeysRef_current, _newPropertyConfigs_lineHeight;
1166
1165
  if (isExitingJSRef.current) return;
1167
1166
  pseudoActiveRef.current = pseudoActive === true;
1168
1167
  var transitionToUse = effectiveTransition2 !== null && effectiveTransition2 !== void 0 ? effectiveTransition2 : props.transition;
@@ -1175,11 +1174,9 @@ function createAnimations(animations) {
1175
1174
  disableAnimation: written.disableAnimation,
1176
1175
  isHydrating: written.isHydrating
1177
1176
  });
1178
- var _emitterKeysRef_current;
1179
1177
  var previousKeys = (_emitterKeysRef_current = emitterKeysRef.current) !== null && _emitterKeysRef_current !== void 0 ? _emitterKeysRef_current : committedRenderKeysRef.current;
1180
1178
  var { animated, statics } = splitAnimationStyles(nextStyle, isDark, written.disableAnimation);
1181
1179
  var emittedDerivesLeading = derivesLeadingProduct(animated, emittedLeadingRatio, !!inheritedFontSize, emittedResolved);
1182
- var _newPropertyConfigs_lineHeight;
1183
1180
  applyLeadingRatio(emittedLeadingRatio, (_newPropertyConfigs_lineHeight = newPropertyConfigs.lineHeight) !== null && _newPropertyConfigs_lineHeight !== void 0 ? _newPropertyConfigs_lineHeight : newBase);
1184
1181
  var snapshot = buildSnapshot(animated, statics, getAnimatedTransforms(animated.transform), previousKeys, lastPaintedRef.current, emittedDerivesLeading);
1185
1182
  emitterSnapshotRef.value = snapshot.value;
@@ -1321,6 +1318,7 @@ function createAnimations(animations) {
1321
1318
  }
1322
1319
  }
1323
1320
  for (var key2 in animatedValues) {
1321
+ var _config_propertyConfigs_key;
1324
1322
  if (key2 === "transform") continue;
1325
1323
  var targetValue = animatedValues[key2];
1326
1324
  emitted[key2] = true;
@@ -1329,7 +1327,6 @@ function createAnimations(animations) {
1329
1327
  result[key2] = targetValue;
1330
1328
  continue;
1331
1329
  }
1332
- var _config_propertyConfigs_key;
1333
1330
  result[key2] = animateSnapshotValue(key2, key2, targetValue, (_config_propertyConfigs_key = config.propertyConfigs[key2]) !== null && _config_propertyConfigs_key !== void 0 ? _config_propertyConfigs_key : config.baseConfig, !!previouslyEmitted[key2], snapshot.seeds[key2], !!snapshot.gatedKeys[key2], currentlyExiting, currentCycleId, currentlyCompletingEnter, currentEnterCycleId, currentlyCompletingUpdate, currentUpdateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone, !!COLOR_STYLE_KEYS[key2], key2 === "fontSize" ? fontSizeShared : void 0);
1334
1331
  }
1335
1332
  if (snapshot.derivesLeading) {
@@ -39,7 +39,7 @@ var import_normalize_colors = __toESM(require("@react-native/normalize-colors"),
39
39
  var import_react = __toESM(require("react"), 1);
40
40
  var import_react_native_reanimated = __toESM(require("react-native-reanimated"), 1);
41
41
  var NON_ANIMATABLE_VALUE = /^(auto|min-content|max-content|fit-content|stretch|inherit|initial|unset)\b|^calc\(/;
42
- var getDefaultExport = function(module2) {
42
+ var getDefaultExport = function getDefaultExport2(module2) {
43
43
  var mod = module2;
44
44
  if (mod.__esModule || mod[Symbol.toStringTag] === "Module") {
45
45
  return mod.default || mod;
@@ -47,7 +47,7 @@ var getDefaultExport = function(module2) {
47
47
  return mod;
48
48
  };
49
49
  var Animated = getDefaultExport(import_react_native_reanimated.default);
50
- var silenceAnimatedComponentDevCheck = function(style) {
50
+ var silenceAnimatedComponentDevCheck = function silenceAnimatedComponentDevCheck2(style) {
51
51
  if (process.env.NODE_ENV !== "development" || import_core.isWeb || !style || typeof style !== "object") {
52
52
  return;
53
53
  }
@@ -57,7 +57,7 @@ var silenceAnimatedComponentDevCheck = function(style) {
57
57
  value: true
58
58
  });
59
59
  };
60
- var resolveDynamicValue = function(value, isDark) {
60
+ var resolveDynamicValue = function resolveDynamicValue2(value, isDark) {
61
61
  if (value !== null && typeof value === "object" && "dynamic" in value && typeof value.dynamic === "object") {
62
62
  var dynamic = value.dynamic;
63
63
  return isDark ? dynamic.dark : dynamic.light;
@@ -76,7 +76,7 @@ var updateMapperState = import_core.isWeb ? function(state, emitted, ownedStatic
76
76
  return current;
77
77
  }, false);
78
78
  };
79
- var cloneAnimationValue = function(value) {
79
+ var cloneAnimationValue = function cloneAnimationValue1(value) {
80
80
  if (Array.isArray(value)) {
81
81
  return value.map(cloneAnimationValue);
82
82
  }
@@ -89,23 +89,23 @@ var cloneAnimationValue = function(value) {
89
89
  }
90
90
  return value;
91
91
  };
92
- var cloneStyleRecord = function(style) {
92
+ var cloneStyleRecord = function cloneStyleRecord2(style) {
93
93
  var next = {};
94
94
  for (var key in style) {
95
95
  next[key] = cloneAnimationValue(style[key]);
96
96
  }
97
97
  return next;
98
98
  };
99
- var cloneTransitionConfig = function(config) {
99
+ var cloneTransitionConfig = function cloneTransitionConfig2(config) {
100
100
  return cloneAnimationValue(config);
101
101
  };
102
- var getAnimatedTransforms = function(value) {
102
+ var getAnimatedTransforms = function getAnimatedTransforms2(value) {
103
103
  if (!Array.isArray(value)) return [];
104
104
  return value.filter(function(item) {
105
105
  return item !== null && typeof item === "object" && !Array.isArray(item);
106
106
  });
107
107
  };
108
- var getRemovedAnimatedKeys = function(current, previous) {
108
+ var getRemovedAnimatedKeys = function getRemovedAnimatedKeys2(current, previous) {
109
109
  var removedKeys = {};
110
110
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
111
111
  try {
@@ -129,7 +129,7 @@ var getRemovedAnimatedKeys = function(current, previous) {
129
129
  }
130
130
  return removedKeys;
131
131
  };
132
- var getImplicitDefault = function(key, targetValue) {
132
+ var getImplicitDefault = function getImplicitDefault2(key, targetValue) {
133
133
  "worklet";
134
134
  var value = key === "opacity" || key === "scale" || key === "scaleX" || key === "scaleY" ? 1 : 0;
135
135
  if (typeof targetValue !== "string") return value;
@@ -145,11 +145,11 @@ var getImplicitDefault = function(key, targetValue) {
145
145
  }
146
146
  return suffixIndex > 0 ? `${value}${targetValue.slice(suffixIndex)}` : value;
147
147
  };
148
- var getLeadingRatio = function(metrics) {
148
+ var getLeadingRatio = function getLeadingRatio2(metrics) {
149
149
  var ratio = metrics === null || metrics === void 0 ? void 0 : metrics.lineHeight;
150
150
  return typeof ratio === "number" && Number.isFinite(ratio) && ratio >= 0 ? ratio : void 0;
151
151
  };
152
- var derivesLeadingProduct = function(style, ratio, inheritsFontSize, resolved) {
152
+ var derivesLeadingProduct = function derivesLeadingProduct2(style, ratio, inheritsFontSize, resolved) {
153
153
  return ratio !== void 0 && (inheritsFontSize || typeof style.lineHeight === "number" && typeof style.fontSize === "number" && (!!(0, import_animation_helpers.getTransitionForKey)(resolved, "fontSize") || !!(0, import_animation_helpers.getTransitionForKey)(resolved, "lineHeight")));
154
154
  };
155
155
  var COLOR_STYLE_KEYS = {
@@ -161,7 +161,7 @@ var COLOR_STYLE_KEYS = {
161
161
  borderBottomColor: true,
162
162
  color: true
163
163
  };
164
- var toReanimatedColor = function(value) {
164
+ var toReanimatedColor = function toReanimatedColor2(value) {
165
165
  "worklet";
166
166
  if (typeof value === "number") {
167
167
  var color = value >>> 0;
@@ -176,12 +176,12 @@ var toReanimatedColor = function(value) {
176
176
  if (trimmed === "transparent") return "rgba(0, 0, 0, 0)";
177
177
  return trimmed;
178
178
  };
179
- var isReanimatedColorHistory = function(value) {
179
+ var isReanimatedColorHistory = function isReanimatedColorHistory2(value) {
180
180
  "worklet";
181
181
  var normalized = toReanimatedColor(value);
182
182
  return typeof normalized === "string" && normalized.startsWith("rgba(");
183
183
  };
184
- var normalizeAnimationColor = function(value) {
184
+ var normalizeAnimationColor = function normalizeAnimationColor2(value) {
185
185
  if (typeof value === "number") {
186
186
  return toReanimatedColor(value);
187
187
  }
@@ -194,7 +194,7 @@ var normalizeAnimationColor = function(value) {
194
194
  var alpha = (color & 255) / 255;
195
195
  return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
196
196
  };
197
- var buildSnapshot = function(animated, statics, transforms, previousKeys, lastPainted) {
197
+ var buildSnapshot = function buildSnapshot2(animated, statics, transforms, previousKeys, lastPainted) {
198
198
  var derivesLeading = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
199
199
  var snapshotAnimated = {};
200
200
  var snapshotStatics = cloneStyleRecord(statics);
@@ -271,7 +271,7 @@ var buildSnapshot = function(animated, statics, transforms, previousKeys, lastPa
271
271
  try {
272
272
  for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
273
273
  var key4 = _step2.value;
274
- var _seeds_key, _ref;
274
+ var _ref, _seeds_key;
275
275
  var value2 = previousKeys.has(key4) ? (_ref = (_seeds_key = seeds[key4]) !== null && _seeds_key !== void 0 ? _seeds_key : snapshotStatics[key4]) !== null && _ref !== void 0 ? _ref : lastPainted[key4] : lastPainted[key4];
276
276
  if (typeof value2 !== "number" && typeof value2 !== "string") {
277
277
  delete seeds[key4];
@@ -386,10 +386,10 @@ var buildSnapshot = function(animated, statics, transforms, previousKeys, lastPa
386
386
  keys
387
387
  };
388
388
  };
389
- var getGatedKeys = function(snapshot) {
389
+ var getGatedKeys = function getGatedKeys2(snapshot) {
390
390
  return Object.keys(snapshot.gatedKeys);
391
391
  };
392
- var createReanimatedConfig = function(config) {
392
+ var createReanimatedConfig = function createReanimatedConfig2(config) {
393
393
  "worklet";
394
394
  var next = {};
395
395
  var source = config;
@@ -402,7 +402,7 @@ var createReanimatedConfig = function(config) {
402
402
  }
403
403
  return next;
404
404
  };
405
- var applyAnimation = function(targetValue, config, callback, seedValue) {
405
+ var applyAnimation = function applyAnimation2(targetValue, config, callback, seedValue) {
406
406
  "worklet";
407
407
  var validateStartAsColor = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, publishTo = arguments.length > 5 ? arguments[5] : void 0;
408
408
  var delay = config.delay;
@@ -447,7 +447,7 @@ var applyAnimation = function(targetValue, config, callback, seedValue) {
447
447
  }
448
448
  return animatedValue;
449
449
  };
450
- var animateSnapshotValue = function(key, implicitKey, targetValue, config, previouslyEmitted, seedValue, gated, currentlyExiting, exitCycleId, currentlyCompletingEnter, enterCycleId, currentlyCompletingUpdate, updateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone) {
450
+ var animateSnapshotValue = function animateSnapshotValue2(key, implicitKey, targetValue, config, previouslyEmitted, seedValue, gated, currentlyExiting, exitCycleId, currentlyCompletingEnter, enterCycleId, currentlyCompletingUpdate, updateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone) {
451
451
  "worklet";
452
452
  var validateStartAsColor = arguments.length > 16 && arguments[16] !== void 0 ? arguments[16] : false, publishTo = arguments.length > 17 ? arguments[17] : void 0;
453
453
  var cycleGated = gated && (currentlyExiting || currentlyCompletingEnter || currentlyCompletingUpdate);
@@ -457,17 +457,17 @@ var animateSnapshotValue = function(key, implicitKey, targetValue, config, previ
457
457
  }
458
458
  var callback;
459
459
  if (gated && currentlyExiting) {
460
- callback = function(finished) {
460
+ callback = function callback2(finished) {
461
461
  "worklet";
462
462
  (0, import_react_native_reanimated.runOnJS)(markExitKeyDone)(key, exitCycleId, finished !== null && finished !== void 0 ? finished : false);
463
463
  };
464
464
  } else if (gated && currentlyCompletingEnter) {
465
- callback = function() {
465
+ callback = function callback2() {
466
466
  "worklet";
467
467
  (0, import_react_native_reanimated.runOnJS)(markEnterKeyDone)(key, enterCycleId);
468
468
  };
469
469
  } else if (gated && currentlyCompletingUpdate) {
470
- callback = function(finished) {
470
+ callback = function callback2(finished) {
471
471
  "worklet";
472
472
  (0, import_react_native_reanimated.runOnJS)(markUpdateKeyDone)(key, updateCycleId, finished !== null && finished !== void 0 ? finished : false);
473
473
  };
@@ -529,12 +529,12 @@ var ANIMATABLE_PROPERTIES = {
529
529
  flexGrow: true,
530
530
  flexShrink: true
531
531
  };
532
- var canAnimateProperty = function(key, value) {
532
+ var canAnimateProperty = function canAnimateProperty2(key, value) {
533
533
  if (!ANIMATABLE_PROPERTIES[key]) return false;
534
534
  if (typeof value === "string" && NON_ANIMATABLE_VALUE.test(value)) return false;
535
535
  return true;
536
536
  };
537
- var splitAnimationStyles = function(style, isDark, disableAnimation) {
537
+ var splitAnimationStyles = function splitAnimationStyles2(style, isDark, disableAnimation) {
538
538
  var animated = {};
539
539
  var statics = {};
540
540
  for (var key in style) {
@@ -554,6 +554,7 @@ var splitAnimationStyles = function(style, isDark, disableAnimation) {
554
554
  function createWebAnimatedComponent(defaultTag) {
555
555
  var isText = defaultTag === "span";
556
556
  var Component = Animated.createAnimatedComponent((0, import_core.createRefComponent)(function(propsIn, ref) {
557
+ var _ref, _ref1, _ref2;
557
558
  var _hooks_usePropsTransform;
558
559
  var { forwardedRef, render = defaultTag, ...rest } = propsIn;
559
560
  var hostRef = (0, import_react.useRef)(null);
@@ -562,13 +563,11 @@ function createWebAnimatedComponent(defaultTag) {
562
563
  return hostRef.current;
563
564
  } });
564
565
  var [, themeState] = (0, import_internal_runtime.useThemeWithState)({});
565
- var _themeState_theme, _themeState_name;
566
- var result = (0, import_core.getSplitStyles)(rest, isText ? import_core.Text.staticConfig : import_core.View.staticConfig, (_themeState_theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme) !== null && _themeState_theme !== void 0 ? _themeState_theme : {}, (_themeState_name = themeState === null || themeState === void 0 ? void 0 : themeState.name) !== null && _themeState_name !== void 0 ? _themeState_name : "", { unmounted: false }, {
566
+ var result = (0, import_core.getSplitStyles)(rest, isText ? import_core.Text.staticConfig : import_core.View.staticConfig, (_ref = themeState === null || themeState === void 0 ? void 0 : themeState.theme) !== null && _ref !== void 0 ? _ref : {}, (_ref1 = themeState === null || themeState === void 0 ? void 0 : themeState.name) !== null && _ref1 !== void 0 ? _ref1 : "", { unmounted: false }, {
567
567
  isAnimated: false,
568
568
  noClass: true
569
569
  });
570
- var _result_viewProps;
571
- var viewProps = (_result_viewProps = result === null || result === void 0 ? void 0 : result.viewProps) !== null && _result_viewProps !== void 0 ? _result_viewProps : {};
570
+ var viewProps = (_ref2 = result === null || result === void 0 ? void 0 : result.viewProps) !== null && _ref2 !== void 0 ? _ref2 : {};
572
571
  var Element = render;
573
572
  var transformedProps = (_hooks_usePropsTransform = import_core.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_core.hooks, render, viewProps, stateRef, false);
574
573
  var { nativeID, ...webProps } = transformedProps !== null && transformedProps !== void 0 ? transformedProps : viewProps;
@@ -640,7 +639,7 @@ function buildTransitionConfig(transition, animations, animationState, styleKeys
640
639
  resolved
641
640
  };
642
641
  }
643
- var instantConfig = function() {
642
+ var instantConfig = function instantConfig2() {
644
643
  return {
645
644
  type: "timing",
646
645
  duration: 0
@@ -740,7 +739,7 @@ function createAnimations(animations) {
740
739
  animations,
741
740
  usePresence: import_use_presence.usePresence,
742
741
  ResetPresence: import_use_presence.ResetPresence,
743
- useTextMetrics: function(param) {
742
+ useTextMetrics: function useTextMetrics(param) {
744
743
  var { inheritedText, lineHeight } = param;
745
744
  var node = (inheritedText === null || inheritedText === void 0 ? void 0 : inheritedText.driver) === "reanimated" ? inheritedText.fontSize : null;
746
745
  var ratio = typeof lineHeight === "number" ? lineHeight : null;
@@ -852,6 +851,7 @@ function createAnimations(animations) {
852
851
  return animatedStyle;
853
852
  },
854
853
  useAnimations(animationProps) {
854
+ var _ref, _exitSeedRef_current;
855
855
  var { props, presence, style, componentState, useStyleEmitter, themeName, stateRef, styleState, onTransition, inheritedText } = animationProps;
856
856
  var isHydrating = componentState.unmounted === true;
857
857
  var isMounting = componentState.unmounted === "should-enter";
@@ -862,8 +862,7 @@ function createAnimations(animations) {
862
862
  import_react.default.useEffect(function() {
863
863
  wasEnteringRef.current = isEntering;
864
864
  });
865
- var _styleState_effectiveTransition;
866
- var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
865
+ var effectiveTransition = (_ref = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _ref !== void 0 ? _ref : props.transition;
867
866
  var leadingRatio = getLeadingRatio(styleState === null || styleState === void 0 ? void 0 : styleState.nativeTextMetrics);
868
867
  var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
869
868
  var resolvedTransition = (0, import_animation_helpers.forAnimationState)((0, import_animation_helpers.resolveTransition)(effectiveTransition, { animations }), animationState);
@@ -880,7 +879,7 @@ function createAnimations(animations) {
880
879
  var leadingFontSize = inheritedFontSize !== null && inheritedFontSize !== void 0 ? inheritedFontSize : fontSizeShared;
881
880
  var leadingRatioShared = (0, import_react_native_reanimated.useSharedValue)(leadingRatio !== null && leadingRatio !== void 0 ? leadingRatio : 0);
882
881
  var paintedRatioRef = (0, import_react.useRef)(leadingRatio);
883
- var applyLeadingRatio = function(ratio, config) {
882
+ var applyLeadingRatio = function applyLeadingRatio2(ratio, config) {
884
883
  var previous = paintedRatioRef.current;
885
884
  if (previous === ratio) return;
886
885
  paintedRatioRef.current = ratio;
@@ -891,7 +890,7 @@ function createAnimations(animations) {
891
890
  var sendExitComplete = presence === null || presence === void 0 ? void 0 : presence[1];
892
891
  var onTransitionRef = (0, import_react.useRef)(onTransition);
893
892
  onTransitionRef.current = onTransition;
894
- var emit = function(phase, cause, finished) {
893
+ var emit = function emit2(phase, cause, finished) {
895
894
  var _onTransitionRef_current;
896
895
  (_onTransitionRef_current = onTransitionRef.current) === null || _onTransitionRef_current === void 0 ? void 0 : _onTransitionRef_current.call(onTransitionRef, phase === "end" ? {
897
896
  phase,
@@ -1009,7 +1008,6 @@ function createAnimations(animations) {
1009
1008
  var lastPaintedRef = (0, import_react.useRef)({});
1010
1009
  var carryRef = (0, import_react.useRef)({});
1011
1010
  var exitSeedRef = (0, import_react.useRef)(null);
1012
- var _exitSeedRef_current;
1013
1011
  var paintedPredecessor = isExiting ? (_exitSeedRef_current = exitSeedRef.current) !== null && _exitSeedRef_current !== void 0 ? _exitSeedRef_current : lastPaintedRef.current : lastPaintedRef.current;
1014
1012
  (0, import_core.useIsomorphicLayoutEffect)(function() {
1015
1013
  exitSeedRef.current = isExiting ? paintedPredecessor : null;
@@ -1144,7 +1142,7 @@ function createAnimations(animations) {
1144
1142
  };
1145
1143
  var configRef = (0, import_react_native_reanimated.useSharedValue)(renderConfig);
1146
1144
  var writtenConfigRef = (0, import_react.useRef)(renderConfig);
1147
- var writeConfig = function(next) {
1145
+ var writeConfig = function writeConfig2(next) {
1148
1146
  if (sameDriverConfig(writtenConfigRef.current, next)) return;
1149
1147
  writtenConfigRef.current = next;
1150
1148
  configRef.value = next;
@@ -1158,11 +1156,12 @@ function createAnimations(animations) {
1158
1156
  isHydrating
1159
1157
  ]);
1160
1158
  (0, import_core.useIsomorphicLayoutEffect)(function() {
1161
- if (emitterSnapshotRef.value !== null) return;
1162
1159
  var _propertyConfigs_lineHeight;
1160
+ if (emitterSnapshotRef.value !== null) return;
1163
1161
  applyLeadingRatio(leadingRatio, (_propertyConfigs_lineHeight = propertyConfigs.lineHeight) !== null && _propertyConfigs_lineHeight !== void 0 ? _propertyConfigs_lineHeight : baseConfig);
1164
1162
  });
1165
- var onEmittedStyle = function(nextStyle, effectiveTransition2, pseudoActive, nextMetrics) {
1163
+ var onEmittedStyle = function onEmittedStyle2(nextStyle, effectiveTransition2, pseudoActive, nextMetrics) {
1164
+ var _emitterKeysRef_current, _newPropertyConfigs_lineHeight;
1166
1165
  if (isExitingJSRef.current) return;
1167
1166
  pseudoActiveRef.current = pseudoActive === true;
1168
1167
  var transitionToUse = effectiveTransition2 !== null && effectiveTransition2 !== void 0 ? effectiveTransition2 : props.transition;
@@ -1175,11 +1174,9 @@ function createAnimations(animations) {
1175
1174
  disableAnimation: written.disableAnimation,
1176
1175
  isHydrating: written.isHydrating
1177
1176
  });
1178
- var _emitterKeysRef_current;
1179
1177
  var previousKeys = (_emitterKeysRef_current = emitterKeysRef.current) !== null && _emitterKeysRef_current !== void 0 ? _emitterKeysRef_current : committedRenderKeysRef.current;
1180
1178
  var { animated, statics } = splitAnimationStyles(nextStyle, isDark, written.disableAnimation);
1181
1179
  var emittedDerivesLeading = derivesLeadingProduct(animated, emittedLeadingRatio, !!inheritedFontSize, emittedResolved);
1182
- var _newPropertyConfigs_lineHeight;
1183
1180
  applyLeadingRatio(emittedLeadingRatio, (_newPropertyConfigs_lineHeight = newPropertyConfigs.lineHeight) !== null && _newPropertyConfigs_lineHeight !== void 0 ? _newPropertyConfigs_lineHeight : newBase);
1184
1181
  var snapshot = buildSnapshot(animated, statics, getAnimatedTransforms(animated.transform), previousKeys, lastPaintedRef.current, emittedDerivesLeading);
1185
1182
  emitterSnapshotRef.value = snapshot.value;
@@ -1321,6 +1318,7 @@ function createAnimations(animations) {
1321
1318
  }
1322
1319
  }
1323
1320
  for (var key2 in animatedValues) {
1321
+ var _config_propertyConfigs_key;
1324
1322
  if (key2 === "transform") continue;
1325
1323
  var targetValue = animatedValues[key2];
1326
1324
  emitted[key2] = true;
@@ -1329,7 +1327,6 @@ function createAnimations(animations) {
1329
1327
  result[key2] = targetValue;
1330
1328
  continue;
1331
1329
  }
1332
- var _config_propertyConfigs_key;
1333
1330
  result[key2] = animateSnapshotValue(key2, key2, targetValue, (_config_propertyConfigs_key = config.propertyConfigs[key2]) !== null && _config_propertyConfigs_key !== void 0 ? _config_propertyConfigs_key : config.baseConfig, !!previouslyEmitted[key2], snapshot.seeds[key2], !!snapshot.gatedKeys[key2], currentlyExiting, currentCycleId, currentlyCompletingEnter, currentEnterCycleId, currentlyCompletingUpdate, currentUpdateCycleId, markExitKeyDone, markEnterKeyDone, markUpdateKeyDone, !!COLOR_STYLE_KEYS[key2], key2 === "fontSize" ? fontSizeShared : void 0);
1334
1331
  }
1335
1332
  if (snapshot.derivesLeading) {