/* Metro module 4673; source: modules/image/native/ImagePicker.tsx; dependencies: [1310, 482, 477, 4674, 4675, 697, 4677, 1244, 2] */ import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */ import Module04677 from '../../../by-id/module-04677.js'; /* Metro dependency 4677 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */ import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as moduleValue2 from '../../../by-id/module-04675-launch.js'; /* Metro dependency 4675 */ function _fun40449(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:6, offset: 0x01100c6f, size: 195 bytes, params: 8, frame: 21 let env0_0 = require; const launchImageLibrary2 = launchImageLibrary; const launchCamera2 = launchCamera; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); object = {launchImageLibrary: launchImageLibrary2, launchImageLibraryAsync: function(a0) { var env0_0 = a0; var Promise = global.Promise; var value = Object.create(Promise.prototype, {constructor: {value: Promise}}); var value2 = new Promise(_fun40453); return value2 instanceof Object ? value2 : value; }, launchCamera: launchCamera2, launchCameraAsync: function(a0) { var env0_0 = a0; var Promise = global.Promise; var value = Object.create(Promise.prototype, {constructor: {value: Promise}}); var value2 = new Promise(_fun40456); return value2 instanceof Object ? value2 : value; }, launchCropper: launchCropper}; (FileImportTrackerModule).fileFinishedImporting('modules/image/native/ImagePicker.tsx'); exports.default = object; function launchImageLibrary(a0, a1) { // fn#40450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:127, offset: 0x01100d32, size: 261 bytes, params: 3, frame: 19 var value; let mediaType = a0.mediaType; if (mediaType !== 'any') { mediaType = a0.mediaType; } else { value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isIOS(); mediaType = value ? 'mixed' : a0.mediaType; } const r7 = a0.selections ?? []; const disableNewIOSPicker = a0.disableNewIOSPicker; const value3 = undefined; const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */; const r8 = platformUtilsModule.isIOS() ? 'pageSheet' : value3; value = !Reflect.apply((require(4674) /* metro dependency 4674: ImagePickerUtils */).isActionPickSupported, value, []); const launchImageLibrary = moduleValue2.launchImageLibrary; const object = {}; copyDataProperties(object, a0, mediaType); object['mediaType'] = mediaType; object['presentationStyle'] = r8; object['selection'] = r7; object['useNewIOSPicker'] = !disableNewIOSPicker; object['forceGetContent'] = value; Reflect.apply(launchImageLibrary, moduleValue2, [object, a1]); return value3; } function launchCamera(a0, a1) { // fn#40451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:469, offset: 0x01100e37, size: 45 bytes, params: 3, frame: 14 (moduleValue2).launchCamera(a0, a1); } function launchImageLibraryAsync(a0) { // fn#40452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:591, offset: 0x01100e64, size: 44 bytes, params: 2, frame: 11 const env0_0 = a0; const Promise = global.Promise; const value = Object.create(Promise.prototype, {constructor: {value: Promise}}); const promise = new Promise(function(a0) { launchImageLibrary(a0, _fun40454); }); return promise instanceof Object ? promise : value; function _fun40453(a0) { // fn#40453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:647, offset: 0x01100e90, size: 38 bytes, params: 2, frame: 13 launchImageLibrary(a0, _fun40454); function _fun40454(a0) { // fn#40454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:673, offset: 0x00cee816, size: 19 bytes, params: 2, frame: 11 env0_0(a0); } } } function launchCameraAsync(a0) { // fn#40455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:733, offset: 0x01100eb6, size: 44 bytes, params: 2, frame: 11 const env0_0 = a0; const Promise = global.Promise; const value = Object.create(Promise.prototype, {constructor: {value: Promise}}); const promise = new Promise(function(a0) { launchCamera(a0, _fun40457); }); return promise instanceof Object ? promise : value; function _fun40456(a0) { // fn#40456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:783, offset: 0x01100ee2, size: 38 bytes, params: 2, frame: 13 launchCamera(a0, _fun40457); function _fun40457(a0) { // fn#40457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:803, offset: 0x00cee816, size: 19 bytes, params: 2, frame: 11 env0_0(a0); } } } function launchCropper({uri, width, height, includeBase64, mimeType, freeStyleCropEnabled}) { // fn#40458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4851:833, offset: 0x01100f08, size: 821 bytes, params: 2, frame: 29 const theme = ThemeStore.theme; let internal = (importDefault(697) /* metro dependency 697: native */).internal; let resolveSemanticColor = internal.resolveSemanticColor; const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; const semanticColor = Reflect.apply(resolveSemanticColor, internal, [theme, BACKGROUND_BASE_LOW]); internal = (importDefault(697) /* metro dependency 697: native */).internal; resolveSemanticColor = internal.resolveSemanticColor; const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; const semanticColor2 = Reflect.apply(resolveSemanticColor, internal, [theme, BACKGROUND_SURFACE_HIGH]); internal = (importDefault(697) /* metro dependency 697: native */).internal; resolveSemanticColor = internal.resolveSemanticColor; const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY; const semanticColor3 = Reflect.apply(resolveSemanticColor, internal, [theme, MOBILE_TEXT_HEADING_PRIMARY]); internal = (importDefault(697) /* metro dependency 697: native */).internal; resolveSemanticColor = internal.resolveSemanticColor; const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED; const semanticColor4 = Reflect.apply(resolveSemanticColor, internal, [theme, TEXT_MUTED]); internal = (importDefault(697) /* metro dependency 697: native */).internal; resolveSemanticColor = internal.resolveSemanticColor; const TEXT_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_BRAND; const semanticColor5 = Reflect.apply(resolveSemanticColor, internal, [theme, TEXT_BRAND]); internal = (importDefault(697) /* metro dependency 697: native */).internal; resolveSemanticColor = internal.resolveSemanticColor; const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT; const semanticColor6 = Reflect.apply(resolveSemanticColor, internal, [theme, TEXT_DEFAULT]); const defaultImport = Module04677; const openCropper = defaultImport.openCropper; const object = {mediaType: 'photo', path: uri, width: width, height: height, includeBase64: includeBase64, mimeType: mimeType, freeStyleCropEnabled: freeStyleCropEnabled}; let LIGHT = ThemeTypes.LIGHT; object.cropperStatusBarLight = theme === LIGHT; LIGHT = ThemeTypes.LIGHT; object.cropperNavigationBarLight = theme === LIGHT; object.cropperActiveWidgetColor = semanticColor3; object.cropperInactiveWidgetColor = semanticColor4; object.cropperControlsColor = semanticColor2; object.cropperControlsBarColor = semanticColor; object.cropperChooseColor = semanticColor5; const intl = (IndexNativeModule).intl; let string = intl.string; const t = (IndexNativeModule).t; object.cropperChooseText = Reflect.apply(string, intl, [t['1Qm822']]); object.cropperCancelColor = semanticColor6; object.cropperCancelText = intl.string(t['ETE/oC']); object.cropperToolbarColor = semanticColor; object.cropperToolbarWidgetColor = semanticColor3; object.cropperToolbarTitle = intl.string(t.b0y3DL); string = intl.string; const Izf9u1 = t.Izf9u1; object.cropperRotateByAngleAccessibilityLabel = Reflect.apply(string, intl, [Izf9u1]); object.cropperResetRotationAccessibilityLabel = intl.string(t.iz4w1M); string = intl.string; const QHvDTL = t.QHvDTL; object.cropperClampButtonAccessibilityLabel = Reflect.apply(string, intl, [QHvDTL]); return Reflect.apply(openCropper, defaultImport, [object]); } } global.__d(_fun40449, 4673, [1310, 482, 477, 4674, 4675, 697, 4677, 1244, 2]) /* metro module 4673, dependencies: [1310, 482, 477, 4674, 4675, 697, 4677, 1244, 2] */;