/* Metro module 11143; source: modules/media/native/AttachmentPreview.tsx; dependencies: [31, 27, 33, 4501, 697, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 11151, 11152, 11153, 11154, 11155, 11156, 11157, 4655, 4573, 477, 5475, 1305, 9783, 9543, 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 CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as FileUtilsModule from '../../../utils/FileUtils.tsx'; /* Metro dependency 4655 */ function _fun85201(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:6, offset: 0x01f66fee, size: 651 bytes, params: 8, frame: 24 const env0_0 = require; const AttachmentIcon_852022 = AttachmentIcon_85202; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const createStyles = CreateStylesModule.createStyles; const object2 = {'flexDirection': 'row', 'alignItems': 'center', 'overflow': 'hidden', 'borderRadius': null, 'height': 75, 'padding': 12, 'flex': 1}; object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm; const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object2.gap = PX_8; const env0_8 = Reflect.apply(createStyles, CreateStylesModule, [{fileInfoAttachmentPreviewFile: object2, attachmentFileIcon: {'height': 32, 'width': 24}, attachmentFileName: {'paddingRight': 4, 'paddingLeft': 4, 'maxWidth': 136}, videoIcon: {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0, 'alignItems': 'center', 'justifyContent': 'center'}}]); object = {archive: importDefault(11144) /* metro dependency 11144 */, acrobat: importDefault(11145) /* metro dependency 11145 */, ae: importDefault(11146) /* metro dependency 11146 */, ai: importDefault(11147) /* metro dependency 11147 */, audio: importDefault(11148) /* metro dependency 11148 */, code: importDefault(11149) /* metro dependency 11149 */, document: importDefault(11150) /* metro dependency 11150 */, image: importDefault(11151) /* metro dependency 11151 */, photoshop: importDefault(11152) /* metro dependency 11152 */, sketch: importDefault(11153) /* metro dependency 11153 */, spreadsheet: importDefault(11154) /* metro dependency 11154 */, unknown: importDefault(11155) /* metro dependency 11155 */, video: importDefault(11156) /* metro dependency 11156 */, webcode: importDefault(11157) /* metro dependency 11157 */}; const env0_10 = ReactModule.memo(_fun85206); (FileImportTrackerModule).fileFinishedImporting('modules/media/native/AttachmentPreview.tsx'); exports.default = AttachmentPreview; exports.AttachmentIcon = AttachmentIcon_852022; function AttachmentIcon_85202({fileName}) { // fn#85202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:792, offset: 0x01f67279, size: 90 bytes, params: 2, frame: 17 const styles = useStyles(); return ; function _fun85203() { // fn#85203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:853, offset: 0x01f672d3, size: 94 bytes, params: 1, frame: 16 const value = environment.__proto__; return env1_9[FileUtilsModule.classifyFileName(fileName ?? '')] ?? (importDefault(11155) /* metro dependency 11155 */); } } function FilenameText({fileName}) { // fn#85204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:996, offset: 0x01f67331, size: 289 bytes, params: 2, frame: 23 const Text = (TextModule).Text; const styles = useStyles(); const regexp = RegExp('(?:\\.([^.]+))?$', ''); const value2 = ''; const value3 = regexp.exec(fileName ?? value2); return ( {fileName != null && value2 !== fileName && {fileName}} {value3 != null && value3[1] != null ? value3[1].toUpperCase() : 'UNKNOWN'} ); } function DefaultAttachmentPreview({fileName, maxFileWidth, borderRadius}) { // fn#85205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:1436, offset: 0x01f67452, size: 142 bytes, params: 2, frame: 19 const styles = useStyles(); return ( ); } function _fun85206({uri, width, height, borderRadius, style, fileName}) { // fn#85206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:1691, offset: 0x01f674e0, size: 423 bytes, params: 2, frame: 22 var r0; const object = {uri: uri, width: width, height: height}; const object2 = {width: width, height: height, borderRadius: borderRadius}; let value = fileName != null; let r1 = value && fileName !== '' && RegExp('\\.gif$', 'i').test(fileName); if (r1) { r0 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && uri.startsWith('ph://'); if (!r0) { value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isAndroid(); r0 = value && uri.startsWith('content://'); } r1 = r0; } const viewProps = {style: [object2, style, {overflow: 'hidden'}]}; if (r1) { viewProps.children = ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */); } else { viewProps.children = ((ThumbnailImage) => )((require(1305) /* metro dependency 1305: native */).ThumbnailImage); } return ; } function AttachmentPreview({uri, isImage, isVideo, width, height, maxFileWidth, fileName, borderRadius = importDefault(dependencyMap[4]).radii.sm, showPlayOnVideoPreview, defaultPreview = , style}) { // fn#85207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:2322, offset: 0x01f67687, size: 676 bytes, params: 2, frame: 30 var r0; var moduleValue; var moduleValue2; var moduleValue3; width = width === undefined ? 75 : width; height = height === undefined ? 75 : height; showPlayOnVideoPreview = !(showPlayOnVideoPreview === undefined) && showPlayOnVideoPreview; const styles = useStyles(); if (isImage) { r0 = ((Component) => )(env0_10); } else if (isVideo) { moduleValue = require(477) /* metro dependency 477: PlatformUtils */; if (moduleValue.isAndroid()) { r0 = ( showPlayOnVideoPreview ? ( {((Component) => )(env0_10)} {((CirclePlayIcon) => )((require(9783) /* metro dependency 9783: CirclePlayIcon */).CirclePlayIcon)} ) : ((Component) => )(env0_10) ); } else { moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */; if (moduleValue2.isIOS()) { if (uri.startsWith('ph://')) { r0 = ( showPlayOnVideoPreview ? ( {((Component) => )(env0_10)} {((CirclePlayIcon) => )((require(9783) /* metro dependency 9783: CirclePlayIcon */).CirclePlayIcon)} ) : ((Component) => )(env0_10) ); } else if (isVideo) { moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */; r0 = ( moduleValue3.isIOS() ? ( {((VideoComponent) => )((require(9543) /* metro dependency 9543: Video */).VideoComponent)} ) : defaultPreview ); } else { r0 = defaultPreview; } } else if (isVideo) { moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */; r0 = ( moduleValue3.isIOS() ? ( {((VideoComponent) => )((require(9543) /* metro dependency 9543: Video */).VideoComponent)} ) : defaultPreview ); } else { r0 = defaultPreview; } } } else { moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */; if (moduleValue2.isIOS()) { if (uri.startsWith('ph://')) { r0 = ( showPlayOnVideoPreview ? ( {((Component) => )(env0_10)} {((CirclePlayIcon) => )((require(9783) /* metro dependency 9783: CirclePlayIcon */).CirclePlayIcon)} ) : ((Component) => )(env0_10) ); } else if (isVideo) { moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */; r0 = ( moduleValue3.isIOS() ? ( {((VideoComponent) => )((require(9543) /* metro dependency 9543: Video */).VideoComponent)} ) : defaultPreview ); } else { r0 = defaultPreview; } } else if (isVideo) { moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */; r0 = ( moduleValue3.isIOS() ? ( {((VideoComponent) => )((require(9543) /* metro dependency 9543: Video */).VideoComponent)} ) : defaultPreview ); } else { r0 = defaultPreview; } } return r0; } } global.__d(_fun85201, 11143, [31, 27, 33, 4501, 697, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 11151, 11152, 11153, 11154, 11155, 11156, 11157, 4655, 4573, 477, 5475, 1305, 9783, 9543, 2]) /* metro module 11143, dependencies: [31, 27, 33, 4501, 697, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 11151, 11152, 11153, 11154, 11155, 11156, 11157, 4655, 4573, 477, 5475, 1305, 9783, 9543, 2] */;