Files
2026-07-28 01:06:53 +03:00

103 lines
7.6 KiB
TypeScript

/* Metro module 13213; source: modules/user_profile/native/UserProfileEffectEditButton.tsx; dependencies: [31, 27, 6816, 8471, 482, 33, 4501, 697, 8402, 8461, 4080, 13214, 1962, 1244, 13209, 5461, 5475, 10117, 8474, 1305, 8411, 2] */
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 ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
import * as ConstantsModule2 from './Constants.tsx'; /* Metro dependency 6816 */
import * as ProfileCustomizationUtilsModule from '../../profile_customization/ProfileCustomizationUtils.tsx'; /* Metro dependency 8402 */
import * as CollectiblesPreviewConstantsModule from '../../collectibles/native/CollectiblesPreviewConstants.tsx'; /* Metro dependency 8471 */
import * as UserProfileEditFormControlsModule from './UserProfileEditFormControls.tsx'; /* Metro dependency 13209 */
function _fun100803(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13403:6, offset: 0x021f9a5b, size: 387 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const COLLECTIBLES_PREVIEW_SIZE = (ConstantsModule2).COLLECTIBLES_PREVIEW_SIZE;
const SAMPLE_PROFILE_ASPECT_RATIO = (CollectiblesPreviewConstantsModule).SAMPLE_PROFILE_ASPECT_RATIO;
let value = JsxRuntimeModule;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const object2 = {height: COLLECTIBLES_PREVIEW_SIZE, width: COLLECTIBLES_PREVIEW_SIZE};
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
object2.backgroundColor = BACKGROUND_MOD_MUTED;
object2.overflow = 'hidden';
object.profileEffectPreviewContainer = object2;
object.sampleProfile = {aspectRatio: SAMPLE_PROFILE_ASPECT_RATIO, width: '100%'};
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
object.noneIcon = {tintColor: TEXT_SUBTLE};
const env0_8 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileEffectEditButton.tsx');
exports.default = UserProfileEffectEditButton;
function UserProfileEffectEditButton({displayProfile, user, pendingProfileEffect, guildId, isTryItOut}) { // fn#100804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13403:607, offset: 0x021f9bde, size: 1025 bytes, params: 2, frame: 27
var r0;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const styles = useStyles();
const getProfilePreviewValue = ProfileCustomizationUtilsModule.getProfilePreviewValue;
let object = {pendingValue: pendingProfileEffect};
object.userValue = displayProfile == null || displayProfile._userProfile == null ? undefined : displayProfile._userProfile.profileEffect;
object.guildValue = displayProfile == null || displayProfile._guildMemberProfile == null ? undefined : displayProfile._guildMemberProfile.profileEffect;
object.guildId = guildId;
const value3 = Reflect.apply(getProfilePreviewValue, ProfileCustomizationUtilsModule, [object]);
const {product,
isFetching} = (require(8461) /* metro dependency 8461: useFetchCollectiblesProduct */).useFetchCollectiblesProduct(value3?.skuId);
const useUserProfileEffect = ProfileCustomizationUtilsModule.useUserProfileEffect;
const r1 = pendingProfileEffect === undefined ? Reflect.apply(useUserProfileEffect, ProfileCustomizationUtilsModule, [{user: user,
guildId: guildId}]) : pendingProfileEffect;
const value6 = r1.useCallback(_fun100805, [r1, guildId, user, isTryItOut]);
const r10 = product?.name ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PoWNfe);
const r8 = guildId == null || r1 != null ? r10 : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.ep5D4i,
{label: r10});
const UserProfileEditFormButton = (UserProfileEditFormControlsModule).UserProfileEditFormButton;
if (isFetching) {
object = {};
object.label = intl.string(t.wR5wOo);
object.buttonText = intl.string(t.MKDeyL);
object.onPress = NOOP;
object.leading = ((ActivityIndicator) => <ActivityIndicator animating size="large" />)((require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator);
object.loading = true;
object.disabled = true;
object.hideArrow = true;
r0 = object;
} else {
object = {};
object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.wR5wOo);
object.buttonText = r8;
object.accessibilityValue = {text: r8};
object.onPress = value6;
object.leading = (
value3 != null
? (
<View style={styles.profileEffectPreviewContainer}>
{((Component) => <Component source={{uri: importDefault(10117) /* metro dependency 10117: sample_profile_smallPng */}} style={styles.sampleProfile} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
{((Component) => <Component skuId={value3.skuId} bannerAdjustment={0} useThumbnail />)(importDefault(8474) /* metro dependency 8474: ProfileEffect */)}
</View>
)
: ((Icon) => <Icon source={importDefault(8411) /* metro dependency 8411 */} style={styles.noneIcon} />)((require(1305) /* metro dependency 1305: native */).Icon)
);
r0 = object;
}
return <UserProfileEditFormButton {...r0} />;
function _fun100805() { // fn#100805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13403:1110, offset: 0x021f9fdf, size: 119 bytes, params: 1, frame: 17
let value = environment.__proto__;
const defaultImport = importDefault(dependencyMap[10]);
const openLazy = defaultImport.openLazy;
value = require(dependencyMap[12]);
value = value(dependencyMap[11], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'Profile Effect', {user: user, currentProfileEffect: ReactModule,
guildId: guildId, isTryItOut: isTryItOut}]);
}
}
}
global.__d(_fun100803, 13213, [31, 27, 6816, 8471, 482, 33, 4501, 697, 8402, 8461, 4080, 13214, 1962, 1244, 13209,
5461, 5475, 10117, 8474, 1305, 8411,
2]) /* metro module 13213, dependencies: [31, 27, 6816, 8471, 482, 33, 4501, 697, 8402, 8461, 4080, 13214, 1962, 1244, 13209, 5461, 5475, 10117, 8474, 1305, 8411, 2] */;