273 lines
16 KiB
TypeScript
273 lines
16 KiB
TypeScript
/* Metro module 13620; source: modules/quests/native/QuestProgressIndicator.tsx; dependencies: [31, 27, 4502, 33, 4017, 7744, 4501, 697, 566, 4504, 5278, 1244, 6760, 13621, 9542, 2] */
|
|
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
|
|
import * as Module07744Module from '../../../by-id/module-07744.js'; /* Metro dependency 7744 */
|
|
|
|
function _fun104023(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:6, offset: 0x0227bf12, size: 371 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const env0_3 = value.useMemo;
|
|
const env0_4 = value.useEffect;
|
|
const env0_5 = value.useRef;
|
|
value = importDefault(31) /* metro dependency 31 */;
|
|
const env0_11 = ['#666777', '#535564'];
|
|
const createAnimatedComponent = ReanimatedRexport.createAnimatedComponent;
|
|
const Circle = (Module07744Module).Circle;
|
|
const env0_12 = Reflect.apply(createAnimatedComponent, ReanimatedRexport, [Circle]);
|
|
const env0_13 = (CreateStylesModule).createStyles(_fun104024);
|
|
object = {code: 'function QuestProgressIndicatorTsx1(){const{glowOpacity}=this.__closure;return{shadowOpacity:glowOpacity.get()};}'};
|
|
object = {code: 'function QuestProgressIndicatorTsx2(){const{circumference,animatedProgress}=this.__closure;return{strokeDashoffset:circumference-circumference*animatedProgress.get()};}'};
|
|
object = {code: 'function QuestProgressIndicatorTsx3(){const{underlayOpacity,styles}=this.__closure;return{opacity:underlayOpacity.get(),...styles.opacityMask};}'};
|
|
value = value.memo(QuestProgressIndicator);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestProgressIndicator.tsx');
|
|
exports.default = value;
|
|
function _fun104024(a0) { // fn#104024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:303, offset: 0x0227c085, size: 291 bytes, params: 2, frame: 15
|
|
const object = {};
|
|
object.wrapper = {position: 'relative'};
|
|
object.container = {'position': 'relative', 'display': 'flex', 'justifyContent': 'center', 'alignItems': 'center',
|
|
'zIndex': 1};
|
|
object.completionGlow = {'shadowOffset': null, 'shadowRadius': 20, 'shadowOpacity': 0, 'elevation': 4,
|
|
'shadowColor': '#30C77399', shadowOffset: {'width': 0, 'height': 0}};
|
|
object.canvas = {transform: [{rotate: '-90deg'}]};
|
|
const object4 = {position: 'absolute', height: 0.78 * a0, width: 0.78 * a0};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object4.overflow = 'hidden';
|
|
object.imageContainer = object4;
|
|
const GREEN_300 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_300;
|
|
object.progressPath = {color: GREEN_300};
|
|
object.confetti = {'position': 'absolute', 'pointerEvents': 'none'};
|
|
const CARD_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
|
|
object.opacityMask = {'backgroundColor': null, 'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0,
|
|
'zIndex': 2, backgroundColor: CARD_BACKGROUND_DEFAULT};
|
|
return object;
|
|
}
|
|
|
|
function QuestProgressIndicator({quest, size, progress, loading, hasConfetti, withAnimation, onPress, accessibilityLabel}) { // fn#104025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:1422, offset: 0x0227c1a8, size: 1735 bytes, params: 2, frame: 51
|
|
var r8;
|
|
var intl;
|
|
loading = !(loading === undefined) && loading;
|
|
hasConfetti = !(hasConfetti === undefined) && hasConfetti;
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const property = ({'x-sm': 3, 'sm': 3, 'md': 3, 'md-lg': 4, 'lg': 6})[size];
|
|
const property2 = ({'x-sm': 40, 'sm': 64, 'md': 70, 'md-lg': 100, 'lg': 128})[size];
|
|
const property3 = ({'x-sm': 1.6, 'sm': 1, 'md': 1.4, 'md-lg': 1.5, 'lg': 1.6})[size];
|
|
const value7 = property2 / 2 - property / 2;
|
|
let Math = global.Math;
|
|
const PI = Math.PI;
|
|
const value8 = 2 * PI * value7;
|
|
const styles = useStyles(property2);
|
|
const styles2 = styles;
|
|
const value9 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(progress);
|
|
const value12 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(loading ? 0.7 : 0);
|
|
const userStatus = quest.userStatus;
|
|
const value14 = userStatus?.completedAt != null;
|
|
const value15 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(value14 ? 1 : 0);
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
|
|
let closure = QuestProgressIndicatorI;
|
|
closure.__closure = {glowOpacity: value15};
|
|
closure.__workletHash = 17183837725505;
|
|
closure.__initData = env0_14;
|
|
const value16 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
|
|
const moduleValue6 = reanimatedRexportModule;
|
|
const useAnimatedProps = moduleValue6.useAnimatedProps;
|
|
closure = QuestProgressIndicatorG;
|
|
closure.__closure = {circumference: value8, animatedProgress: value9};
|
|
closure.__workletHash = 17281152506254;
|
|
closure.__initData = env0_15;
|
|
const value17 = Reflect.apply(useAnimatedProps, moduleValue6, [closure]);
|
|
const moduleValue7 = reanimatedRexportModule;
|
|
useAnimatedStyle = moduleValue7.useAnimatedStyle;
|
|
closure = QuestProgressIndicatorM;
|
|
closure.__closure = {underlayOpacity: value12, styles: styles};
|
|
closure.__workletHash = 4427598698568;
|
|
closure.__initData = env0_16;
|
|
const value18 = Reflect.apply(useAnimatedStyle, moduleValue7, [closure]);
|
|
useEffect(_fun104030, [value9, progress, useReducedMotion]);
|
|
useEffect(_fun104032, [value12, loading]);
|
|
const value19 = useRef(null);
|
|
const env0_11 = value19;
|
|
const value20 = useMemo(_fun104034, [styles.confetti, property3, property2]);
|
|
useEffect(_fun104035, [value14, value15, useReducedMotion]);
|
|
const PressableComponent = onPress == null ? styles2.Fragment : (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
Math = global.Math;
|
|
const value21 = Math.round(100 * progress);
|
|
const r2Props = {...(onPress == null ? {} : {onPress: onPress})};
|
|
const View2 = (ReanimatedRexport).View;
|
|
const items2 = [styles.wrapper];
|
|
items2[1] = styles.completionGlow;
|
|
items2[2] = value16;
|
|
if (accessibilityLabel != null) {
|
|
r8 = accessibilityLabel;
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r8 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.Gj8Jqn,
|
|
{percent: value21});
|
|
}
|
|
const object2 = {'min': 0, 'max': 100};
|
|
object2.now = value21;
|
|
const View3 = (ReanimatedRexport).View;
|
|
const view = <View3 style={value18} />;
|
|
const Svg = (Module07744Module).Svg;
|
|
const Defs = (Module07744Module).Defs;
|
|
const LinearGradient = (Module07744Module).LinearGradient;
|
|
const Stop = (Module07744Module).Stop;
|
|
const binding = env0_11;
|
|
const items4 = [
|
|
<Defs>
|
|
<LinearGradient
|
|
id="underlayGradient"
|
|
x1="0"
|
|
y1="0.5"
|
|
x2="1"
|
|
y2="0.5"
|
|
>
|
|
<Stop offset="0" stopColor={binding[0]} />
|
|
<Stop offset="1" stopColor={binding[1]} />
|
|
</LinearGradient>
|
|
</Defs>,
|
|
];
|
|
const Circle = (Module07744Module).Circle;
|
|
items4[1] = (
|
|
<Circle
|
|
cx={property2 / 2}
|
|
cy={property2 / 2}
|
|
r={value7}
|
|
fill="none"
|
|
stroke="url(#underlayGradient)"
|
|
strokeWidth={property}
|
|
/>
|
|
);
|
|
items4[2] = ((Component) => <Component cx={property2 / 2} cy={property2 / 2} r={value7} fill="none" stroke={styles.progressPath.color} strokeWidth={property} strokeDasharray={value8} strokeLinecap="round" animatedProps={value17} />)(env0_12);
|
|
return (
|
|
<PressableComponent {...r2Props}>
|
|
<View2
|
|
style={items2}
|
|
accessible
|
|
accessibilityRole="progressbar"
|
|
accessibilityLabel={r8}
|
|
accessibilityValue={object2}
|
|
>
|
|
{view}
|
|
<View style={styles.container}>
|
|
<Svg
|
|
height={property2}
|
|
width={property2}
|
|
style={styles.canvas}
|
|
>
|
|
{items4}
|
|
</Svg>
|
|
{
|
|
hasConfetti
|
|
? ((Component) => <Component ref={value19} style={value20} source={require(13621) /* metro dependency 13621 */} autoPlay={false} loop={false} />)(importDefault(6760) /* metro dependency 6760: LottieAnimationView */)
|
|
: null
|
|
}
|
|
<View style={styles.imageContainer}>
|
|
{((Component) => <Component quest={quest} height={0.78 * property2} width={0.78 * property2} withAnimation={withAnimation} accessibilityLabelPrefix={accessibilityLabel} />)(importDefault(9542) /* metro dependency 9542: QuestRewardTile */)}
|
|
</View>
|
|
</View>
|
|
</View2>
|
|
</PressableComponent>
|
|
);
|
|
function QuestProgressIndicatorI() { // fn#104027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:1978, owner: QuestProgressIndicator.I, offset: 0x0227c86f, size: 25 bytes, params: 1, frame: 10
|
|
const object = {};
|
|
object.shadowOpacity = JsxRuntimeModule.jsxs.get();
|
|
return object;
|
|
}
|
|
|
|
function QuestProgressIndicatorG() { // fn#104028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2115, owner: QuestProgressIndicator.G, offset: 0x0227c888, size: 37 bytes, params: 1, frame: 11
|
|
const binding = env0_5;
|
|
const get = ReactNativeModule.View.get;
|
|
return {strokeDashoffset: binding - binding * Reflect.apply(get, ReactNativeModule.View, [])};
|
|
}
|
|
|
|
function QuestProgressIndicatorM() { // fn#104029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2280, owner: QuestProgressIndicator.M, offset: 0x0227c8ad, size: 41 bytes, params: 1, frame: 13
|
|
const object = {};
|
|
const binding = env0_8;
|
|
object.opacity = binding.get();
|
|
copyDataProperties(object, styles.opacityMask, binding);
|
|
return object;
|
|
}
|
|
|
|
function _fun104030() { // fn#104030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2413, offset: 0x0227c8d6, size: 89 bytes, params: 1, frame: 17
|
|
const set = ReactNativeModule.View.set;
|
|
Reflect.apply(set, ReactNativeModule.View, [TimingModule.withTiming(progress, {duration: useReducedMotion ? 0 : 500})]);
|
|
return _fun104031;
|
|
function _fun104031() { // fn#104031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2466, offset: 0x0227c92f, size: 45 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
(ReanimatedRexportModule).cancelAnimation(env1_7);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun104032() { // fn#104032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2513, offset: 0x0227c95c, size: 95 bytes, params: 1, frame: 16
|
|
const binding = env0_8;
|
|
const set = binding.set;
|
|
Reflect.apply(set, binding, [TimingModule.withTiming(loading ? 0.7 : 0, {duration: 500})]);
|
|
return _fun104033;
|
|
function _fun104033() { // fn#104033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2567, offset: 0x0227c9bb, size: 45 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
(ReanimatedRexportModule).cancelAnimation(env1_8);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun104034() { // fn#104034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2628, offset: 0x0227c9e8, size: 78 bytes, params: 1, frame: 13
|
|
const object = {};
|
|
copyDataProperties(object, styles.confetti, undefined);
|
|
object['width'] = env0_3;
|
|
object['height'] = env0_3;
|
|
object['transform'] = [{scale: env0_4}];
|
|
return object;
|
|
}
|
|
|
|
function _fun104035() { // fn#104035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13817:2711, offset: 0x0227ca36, size: 154 bytes, params: 1, frame: 16
|
|
var binding;
|
|
var set;
|
|
var value2;
|
|
var moduleValue;
|
|
var current;
|
|
if (useReducedMotion) {
|
|
JsxRuntimeModule.jsxs.set(0);
|
|
current = env0_11.current;
|
|
if (current != null) {
|
|
current.reset();
|
|
}
|
|
} else if (JsxRuntimeModule.jsx) {
|
|
binding = JsxRuntimeModule.jsxs;
|
|
set = binding.set;
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(4504) /* metro dependency 4504: timing */;
|
|
Reflect.apply(set, binding, [moduleValue.withTiming(1, {duration: 500})]);
|
|
current = env0_11.current;
|
|
if (current != null) {
|
|
current.play();
|
|
}
|
|
} else {
|
|
JsxRuntimeModule.jsxs.set(0);
|
|
current = env0_11.current;
|
|
if (current != null) {
|
|
current.reset();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun104023, 13620, [31, 27, 4502, 33, 4017, 7744, 4501, 697, 566, 4504, 5278, 1244, 6760, 13621, 9542,
|
|
2]) /* metro module 13620, dependencies: [31, 27, 4502, 33, 4017, 7744, 4501, 697, 566, 4504, 5278, 1244, 6760, 13621, 9542, 2] */;
|