152 lines
7.2 KiB
TypeScript
152 lines
7.2 KiB
TypeScript
/* Metro module 13203; source: modules/user_profile/native/ProfileGIFSelectActionSheet.tsx; dependencies: [57, 5, 31, 27, 33, 4501, 697, 4680, 8403, 7613, 8400, 8402, 4080, 6275, 6758, 1244, 7954, 11034, 2] */
|
|
function _fun100752(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13393:6, offset: 0x021f6da2, size: 426 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
const env0_6 = (require(27) /* metro dependency 27 */).View;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object3 = {flex: 1};
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object3.marginTop = PX_4;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.marginLeft = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.marginRight = PX_8;
|
|
const env0_9 = Reflect.apply(createStyles, value, [{titleWrapper: {flex: 0},
|
|
titleContainer: {justifyContent: 'flex-start'}, gifPicker: object3}]);
|
|
object2 = {AVATAR: 0};
|
|
object2[0] = 'AVATAR';
|
|
object2.BANNER = 1;
|
|
object2[1] = 'BANNER';
|
|
const object6 = {PROFILE_EDIT: 0};
|
|
object6[0] = 'PROFILE_EDIT';
|
|
object6.PROFILE_TRY_IT_OUT = 1;
|
|
object6[1] = 'PROFILE_TRY_IT_OUT';
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/ProfileGIFSelectActionSheet.tsx');
|
|
exports.default = ProfileGIFSelectActionSheet;
|
|
exports.ProfileAssetType = object2;
|
|
exports.GIFSelectionContext = object6;
|
|
}
|
|
|
|
function ProfileGIFSelectActionSheet({profileAssetType, selectionContext, guildId}) { // fn#100753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13393:562, offset: 0x021f6f4c, size: 349 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const value2 = env0_5.useRef(null);
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const object = {};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['xsC+/y']);
|
|
const NitroWheelIcon = (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon;
|
|
object.trailing = <NitroWheelIcon />;
|
|
object.titleWrapperStyle = styles.titleWrapper;
|
|
object.titleContainerStyle = styles.titleContainer;
|
|
return (
|
|
<BottomSheet
|
|
ref={value2}
|
|
scrollable
|
|
startExpanded
|
|
>
|
|
<BottomSheetTitleHeader {...object} />
|
|
<View style={styles.gifPicker}>
|
|
{((Component) => <Component bottomSheetRef={value2} onPressGIF={function(a0) {
|
|
return _onPressGIF.apply(this, arguments);
|
|
}} />)(importDefault(11034) /* metro dependency 11034: GIFPicker */)}
|
|
</View>
|
|
</BottomSheet>
|
|
);
|
|
}
|
|
|
|
function _onPressGIF() { // fn#100754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13393:677, owner: ProfileGIFSelectActionSheet._onPressGIF, offset: 0x021f70a9, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return env1_4(_fun100756).apply(this, arguments);
|
|
}
|
|
|
|
function* _fun100756(a0) { // fn#100756, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13393:722, offset: 0x021f70e9, size: 620 bytes, params: 2, frame: 24
|
|
var environment;
|
|
var binding2;
|
|
var value10;
|
|
var createPendingImage;
|
|
var pendingImage;
|
|
var binding3;
|
|
if (true) {
|
|
yield global.fetch(a0.gifSrc ?? a0.src);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
yield value.blob();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var Promise = global.Promise;
|
|
var all = Promise.all;
|
|
var Promise2 = global.Promise;
|
|
var value5 = Object.create(Promise2.prototype, {constructor: {value: Promise2}});
|
|
var promise = new Promise2(_fun100757);
|
|
var object = [promise instanceof Object ? promise : value5];
|
|
var binding = env3_1;
|
|
value = binding(env3_2[7]).fromBlob(value);
|
|
object[1] = value.catch(function() {
|
|
return null;
|
|
});
|
|
yield Reflect.apply(all, Promise, [object]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = env3_3(value, 2);
|
|
var property = value[0];
|
|
var property2 = value[1];
|
|
value = environment.__proto__.__proto__;
|
|
var AVATAR = env3_10.AVATAR;
|
|
if (AVATAR === require) {
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
value10 = binding(binding2[8]);
|
|
createPendingImage = value10.createPendingImage;
|
|
object = {imageUri: property};
|
|
object.description = binding(binding2[8]).generateAvatarDescription();
|
|
object.originalMd5 = property2;
|
|
pendingImage = Reflect.apply(createPendingImage, value10, [object]);
|
|
if (importDefault === env3_11.PROFILE_TRY_IT_OUT) {
|
|
env3_0(env3_2[9]).setTryItOutAvatar(pendingImage);
|
|
} else {
|
|
binding = env3_0;
|
|
binding3 = env3_2;
|
|
binding(binding3[10]).setPendingChanges({guildId: dependencyMap, avatar: pendingImage});
|
|
binding(binding3[11]).announcePendingAvatarChange('set');
|
|
}
|
|
} else if (env3_10.BANNER === require) {
|
|
if (importDefault === env3_11.PROFILE_TRY_IT_OUT) {
|
|
env3_0(env3_2[9]).setTryItOutBanner(property);
|
|
} else {
|
|
value = env3_0(env3_2[10]);
|
|
value.setPendingChanges({banner: property, bannerOriginalMd5: property2});
|
|
}
|
|
}
|
|
env3_1(env3_2[12]).hideActionSheet();
|
|
}
|
|
}
|
|
|
|
function _fun100757(a0) { // fn#100757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13393:845, offset: 0x021f7355, size: 72 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
const FileReader = global.FileReader;
|
|
const fileReader = new FileReader();
|
|
fileReader.onload = onload_100758;
|
|
fileReader.readAsDataURL(env0_0);
|
|
}
|
|
|
|
function onload_100758({target}) { // fn#100758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13393:879, offset: 0x021f739d, size: 60 bytes, params: 2, frame: 14
|
|
const result = target?.result;
|
|
env0_0(typeof result !== 'string' ? '' : result);
|
|
}
|
|
|