decord/source/modules/virtual_currency/native/BalanceCounter.tsx

166 lines
6 KiB
TypeScript
Raw Normal View History

// Module ID: 11251
// Function ID: 11252
2026-07-20 16:05:17 +00:00
// Name: BalanceCounter
// Dependencies: [32, 19, 21, 4374, 4358, 5059, 11252, 4634, 2]
2026-07-20 16:05:17 +00:00
// Module 11251 (BalanceCounter)
import AccessibilityPreferencesContext from "AccessibilityPreferencesContext" /* 4358 */;
import ReanimatedRexport from "ReanimatedRexport" /* 4374 */;
import spring from "spring" /* 5059 */;
import _slicedToArray from "module_32" /* 32 */;
import noop_mod from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const Text_Text = tmp(4634);
require = fn;
let noop = fn(19);
({ useState: closure_4, useEffect: hasOwnProperty, useRef: metroRequire, useCallback: closure_7 } = noop);
let noop = noop_mod;
let jsx = fn(21).jsx;
2026-07-20 16:05:17 +00:00
let closure_10 = { code: "function BalanceCounterTsx1(){const{runOnJS,setIsAnimating}=this.__closure;runOnJS(setIsAnimating)(false);}" };
let closure_11 = { code: "function BalanceCounterTsx2(){const{isAnimating,animatedValue,runOnJS,setDisplayValue,setMaxDigits}=this.__closure;if(isAnimating){const roundedValue=Math.round(animatedValue.get());runOnJS(setDisplayValue)(roundedValue);runOnJS(setMaxDigits)(roundedValue.toString().length);}return{};}" };
class BalanceCounter {
constructor(arg0) {
value = global.value;
2026-07-23 10:11:24 +00:00
closure_0 = value;
2026-07-20 16:05:17 +00:00
onValueChange = global.onValueChange;
2026-08-24 06:08:38 +00:00
closure_2 = undefined;
closure_3 = undefined;
closure_4 = undefined;
2026-07-29 08:29:29 +00:00
enabled = undefined;
2026-08-24 06:08:38 +00:00
closure_6 = undefined;
closure_7 = undefined;
closure_8 = undefined;
closure_9 = undefined;
closure_10 = undefined;
2026-07-20 16:05:17 +00:00
clearAnimationTimeout = function clearAnimationTimeout() {
if (null != ref2.current) {
const _clearTimeout = clearTimeout;
2026-07-29 08:29:29 +00:00
clearTimeout(tmp.current);
tmp.current = null;
2026-07-20 16:05:17 +00:00
}
setIsAnimating(false);
2026-07-20 16:05:17 +00:00
};
({ onValueReached, style } = global);
2026-08-24 06:08:38 +00:00
closure_2 = closure_6(null);
tmp2 = closure_2;
2026-07-29 08:29:29 +00:00
tmp = closure_0;
obj = closure_0(closure_2[3]);
sharedValue = obj.useSharedValue(0);
2026-08-24 06:08:38 +00:00
closure_3 = sharedValue;
closure_4 = closure_6(null);
enabled = closure_8.useContext(closure_0(closure_2[4]).AccessibilityPreferencesContext).reducedMotion.enabled;
tmp4 = closure_3(closure_4(0), 2);
2026-07-29 08:29:29 +00:00
[obj2, tmp5] = tmp4;
2026-08-24 06:08:38 +00:00
closure_6 = tmp5;
tmp6 = closure_3(closure_4(1), 2);
2026-07-29 08:29:29 +00:00
tmp7 = tmp6[1];
2026-08-24 06:08:38 +00:00
closure_7 = tmp7;
tmp8 = closure_3(closure_4(false), 2);
2026-07-29 08:29:29 +00:00
first = tmp8[0];
2026-08-24 06:08:38 +00:00
closure_8 = first;
closure_9 = tmp8[1];
tmp10 = closure_7((set, targetHeight, duration) => {
setIsAnimating(true);
2026-07-20 16:05:17 +00:00
const fn = function l() {
value(closure_2[3]).runOnJS(setIsAnimating)(false);
2026-07-20 16:05:17 +00:00
};
const obj = spring;
const obj2 = { duration, damping: 15, stiffness: 150, mass: 1 };
fn.__closure = { runOnJS: ReanimatedRexport.runOnJS, setIsAnimating };
2026-07-20 16:05:17 +00:00
fn.__workletHash = 16153226572520;
fn.__initData = __initData;
const result = set.set(obj.withSpring(targetHeight, obj2, "respect-motion-settings", fn));
2026-07-20 16:05:17 +00:00
}, []);
2026-08-24 06:08:38 +00:00
closure_10 = tmp10;
2026-07-20 16:05:17 +00:00
items = [, , , , , ];
items[0] = value;
items[1] = onValueChange;
items[2] = onValueReached;
items[3] = sharedValue;
2026-07-29 08:29:29 +00:00
items[4] = tmp10;
2026-07-20 16:05:17 +00:00
items[5] = enabled;
2026-07-29 08:29:29 +00:00
tmp11 = enabled(() => {
2026-07-23 10:11:24 +00:00
if (null !== duration) {
2026-07-20 16:05:17 +00:00
if (null !== ref.current) {
if (!enabled) {
2026-07-29 08:29:29 +00:00
if (tmp !== tmp2.current) {
const diff = tmp - tmp2.current;
2026-07-20 16:05:17 +00:00
onValueChange(diff);
2026-07-29 08:29:29 +00:00
tmp2.current = tmp;
const obj2 = { targetTime: value(ref[6]).EXPECTED_ORB_LOTTIE_ANIMATION_DURATION_MS };
const orbBalanceCounterAnimationConfigs = value(ref[6]).getOrbBalanceCounterAnimationConfigs(diff, obj2);
2026-08-27 16:17:25 +00:00
duration = orbBalanceCounterAnimationConfigs.duration;
2026-07-29 08:29:29 +00:00
if (null != ref2.current) {
const _clearTimeout = clearTimeout;
clearTimeout(tmp12.current);
tmp12.current = null;
}
setIsAnimating(false);
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout;
2026-07-29 08:29:29 +00:00
ref2.current = setTimeout(() => {
closure_10(sharedValue, value, duration);
closure_4.current = null;
2026-08-27 16:17:25 +00:00
}, orbBalanceCounterAnimationConfigs.delay);
2026-07-20 16:05:17 +00:00
return clearAnimationTimeout;
} else {
2026-07-29 08:29:29 +00:00
_undefined(tmp);
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
_undefined(tmp);
const result = sharedValue.set(tmp);
ref.current = tmp;
2026-07-20 16:05:17 +00:00
}
}, items);
tmp12 = closure_0(closure_2[3]);
2026-07-20 16:05:17 +00:00
class F {
constructor() {
2026-08-24 06:08:38 +00:00
if (closure_8) {
2026-07-20 16:05:17 +00:00
tmp = globalThis;
_Math = Math;
2026-08-24 06:08:38 +00:00
tmp2 = closure_3;
str = Math.round(closure_3.get());
tmp3 = closure_0;
2026-08-24 06:08:38 +00:00
tmp4 = closure_2;
obj = closure_0(closure_2[3]);
2026-08-24 06:08:38 +00:00
tmp5 = closure_6;
tmp6 = obj.runOnJS(closure_6)(str);
obj2 = closure_0(closure_2[3]);
2026-08-24 06:08:38 +00:00
tmp7 = closure_7;
runOnJSResult = obj2.runOnJS(closure_7);
2026-07-20 16:05:17 +00:00
tmp8Result = runOnJSResult(str.toString().length);
}
return {};
}
}
obj1 = { isAnimating: first, animatedValue: sharedValue, runOnJS: closure_0(closure_2[3]).runOnJS, setDisplayValue: tmp5, setMaxDigits: tmp7 };
F.__closure = obj1;
2026-07-20 16:05:17 +00:00
F.__workletHash = 4408542396979;
F.__initData = clearAnimationTimeout;
2026-07-29 08:29:29 +00:00
tmp14 = null;
2026-07-20 16:05:17 +00:00
if (null !== value) {
2026-08-24 06:08:38 +00:00
tmp15 = closure_9;
2026-07-29 08:29:29 +00:00
tmp16 = onValueChange;
obj7 = { style: null, children: null };
2026-07-20 16:05:17 +00:00
items1 = [, ];
2026-07-29 08:29:29 +00:00
items1[0] = tmp13;
obj8 = { minWidth: null };
2026-07-20 16:05:17 +00:00
num = 7;
obj8.minWidth = 7 * tmp6[0];
items1[1] = obj8;
obj7.style = items1;
obj9 = { variant: "text-sm/semibold", style: null, maxFontSizeMultiplier: 2, children: null };
obj9.style = style;
obj9.children = obj2.toFixed(0);
obj7.children = closure_9(tmp(tmp2[7]).Text, obj9);
tmp14 = closure_9(onValueChange(tmp2[3]).View, obj7);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp14;
2026-07-20 16:05:17 +00:00
}
}
const size = fn(2);
let result = size.fileFinishedImporting("modules/virtual_currency/native/BalanceCounter.tsx");
2026-07-20 16:05:17 +00:00
export default BalanceCounter;
export { BalanceCounter };