/* Metro module 10760; source: modules/sound_playback/native/SoundUtils.tsx; dependencies: [6, 7, 27, 1581, 477, 2] */ function _fun82759(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:6, offset: 0x01f00c9a, size: 687 bytes, params: 8, frame: 20 var object3; const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(6) /* metro dependency 6 */; const env0_3 = importDefault(7) /* metro dependency 7 */; const env0_4 = (require(27) /* metro dependency 27 */).NativeModules; const env0_6 = _fun82760(); object3 = {NOTIFICATION: 'notification', VOICE: 'voice', RING_TONE: 'ring_tone', MEDIA: 'media', NOTIFICATION_NO_VIBRATION: 'notification_no_vibration'}; const object4 = {}; let VOICE = object3.VOICE; object4.call_calling = VOICE; let value = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */; object4.call_ringing = value.isMetaQuest() ? object3.MEDIA : object3.RING_TONE; value = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */; object4.call_ringing_halloween = value.isMetaQuest() ? object3.MEDIA : object3.RING_TONE; VOICE = object3.VOICE; object4.camera_on = VOICE; VOICE = object3.VOICE; object4.camera_off = VOICE; VOICE = object3.VOICE; object4.deafen = VOICE; VOICE = object3.VOICE; object4.disconnect = VOICE; let NOTIFICATION = object3.NOTIFICATION; object4.mention1 = NOTIFICATION; NOTIFICATION = object3.NOTIFICATION; object4.mention2 = NOTIFICATION; NOTIFICATION = object3.NOTIFICATION; object4.mention3 = NOTIFICATION; NOTIFICATION = object3.NOTIFICATION; object4.message1 = NOTIFICATION; NOTIFICATION = object3.NOTIFICATION; object4.message2 = NOTIFICATION; NOTIFICATION = object3.NOTIFICATION; object4.message3 = NOTIFICATION; VOICE = object3.VOICE; object4.mute = VOICE; VOICE = object3.VOICE; object4.ptt_start = VOICE; VOICE = object3.VOICE; object4.ptt_stop = VOICE; VOICE = object3.VOICE; object4.reconnect = VOICE; VOICE = object3.VOICE; object4.stage_waiting = VOICE; VOICE = object3.VOICE; object4.stream_ended = VOICE; VOICE = object3.VOICE; object4.stream_started = VOICE; VOICE = object3.VOICE; object4.stream_user_joined = VOICE; VOICE = object3.VOICE; object4.stream_user_left = VOICE; VOICE = object3.VOICE; object4.soundboard_sound = VOICE; VOICE = object3.VOICE; object4.undeafen = VOICE; VOICE = object3.VOICE; object4.unmute = VOICE; VOICE = object3.VOICE; object4.user_join = VOICE; VOICE = object3.VOICE; object4.user_leave = VOICE; VOICE = object3.VOICE; object4.user_moved = VOICE; const MEDIA = object3.MEDIA; object4.vibing_wumpus = MEDIA; let NOTIFICATION_NO_VIBRATION = object3.NOTIFICATION_NO_VIBRATION; object4.activity_end = NOTIFICATION_NO_VIBRATION; NOTIFICATION_NO_VIBRATION = object3.NOTIFICATION_NO_VIBRATION; object4.activity_launch = NOTIFICATION_NO_VIBRATION; NOTIFICATION_NO_VIBRATION = object3.NOTIFICATION_NO_VIBRATION; object4.activity_user_join = NOTIFICATION_NO_VIBRATION; NOTIFICATION_NO_VIBRATION = object3.NOTIFICATION_NO_VIBRATION; object4.activity_user_left = NOTIFICATION_NO_VIBRATION; value = _fun82773(); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/sound_playback/native/SoundUtils.tsx'); exports.MobileAudioSound = value; } function _fun82760() { // fn#82760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:146, offset: 0x01f00f49, size: 260 bytes, params: 1, frame: 15 return env0_3(RNSound, [{key: '_createSound', value: function(a0, a1, a2) { var env0_0 = this; var env0_1 = a2; var DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.prepare(a0, a1, this._key, _fun82763); }}, {key: 'play', value: value_82764}, {key: 'pause', value: value_82765}, {key: 'stop', value: value_82766}, {key: 'release', value: value_82767}, {key: 'volume', get: function() { return this._volume; }, set: set_82769}, {key: 'duration', get: function() { return this._duration; }}, {key: 'numberOfLoops', get: function() { return this._numberOfLoops; }, set: set_82772}]); } function _fun82773() { // fn#82773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2334, offset: 0x01f012c0, size: 247 bytes, params: 1, frame: 15 return env0_3(MobileAudioSound, [{key: 'volume', get: function() { return this._volume; }, set: function(a0) { var env0_0 = a0; this._volume = a0; this.ensureSound().then(_fun82777); }}, {key: 'loop', value: function() { this.ensureSound().then(_fun82779); }}, {key: 'play', value: function() { this.ensureSound().then(_fun82781); }}, {key: 'playWithListener', value: function() { var env0_0 = this; var Promise = global.Promise; var value = Object.create(Promise.prototype, {constructor: {value: Promise}}); var value2 = new Promise(_fun82783); return value2 instanceof Object ? value2 : value; }}, {key: 'pause', value: function() { if (this.soundPromise != null) { this.soundPromise.then(_fun82788); } }}, {key: 'stop', value: function() { this.destroyAudio(); }}, {key: 'destroyAudio', value: function() { var env0_0 = this; if (this.soundPromise != null) { this.soundPromise.then(_fun82791); } }}, {key: 'ensureSound', value: function() { var env0_0 = this; this.soundPromise = this.soundPromise ?? new global.Promise(_fun82793); return this.soundPromise; }}]); } function RNSound(a0, a1, a2, a3) { // fn#82761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:167, offset: 0x01f0104d, size: 137 bytes, params: 5, frame: 16 let binding = env1_2; binding(this, RNSound); this._volume = a2; this._loaded = false; binding = env1_5; const value3 = typeof binding === 'bigint' ? binding : +binding; env1_5 = typeof value3 === 'bigint' ? value3 + 1n : +value3 + 1; this._key = value3; this._duration = -1; this._numberOfChannels = -1; this._volume = 1; this._pan = 0; this._numberOfLoops = 0; this._sound = this._createSound(a0, a1, a3); } function value_82762(a0, a1, a2) { // fn#82762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:413, offset: 0x01f010d6, size: 65 bytes, params: 4, frame: 17 const env0_1 = a2; const DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.prepare(a0, a1, this._key, _fun82763); } function value_82764() { // fn#82764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:615, offset: 0x01f0116d, size: 46 bytes, params: 1, frame: 11 var value; var DCDSoundManager; if (this._loaded) { value = environment.__proto__; DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.play(this._key); } } function value_82765() { // fn#82765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:695, offset: 0x01f0119b, size: 46 bytes, params: 1, frame: 11 var value; var DCDSoundManager; if (this._loaded) { value = environment.__proto__; DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.pause(this._key); } } function value_82766() { // fn#82766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:775, offset: 0x01f011c9, size: 46 bytes, params: 1, frame: 11 var value; var DCDSoundManager; if (this._loaded) { value = environment.__proto__; DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.stop(this._key); } } function value_82767() { // fn#82767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:857, offset: 0x01f011f7, size: 54 bytes, params: 1, frame: 12 var value; var DCDSoundManager; if (this._loaded) { value = environment.__proto__; DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.release(this._key); } this._loaded = false; } function set_82769(a0) { // fn#82769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:991, offset: 0x01f01238, size: 56 bytes, params: 2, frame: 13 var value; var DCDSoundManager; this._volume = a0; if (this._loaded) { value = environment.__proto__; DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.setVolume(this._key, a0); } } function set_82772(a0) { // fn#82772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:1198, offset: 0x01f01286, size: 58 bytes, params: 2, frame: 13 var value; var DCDSoundManager; this._numberOfLoops = a0; if (this._loaded) { value = environment.__proto__; DCDSoundManager = NativeModules.DCDSoundManager; DCDSoundManager.setNumberOfLoops(this._key, a0); } } function MobileAudioSound(a0, a1, a2, a3) { // fn#82774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2355, offset: 0x01f013b7, size: 71 bytes, params: 5, frame: 14 env1_2(this, MobileAudioSound); this.name = a0; this.usage = env1_7[a1]; this._volume = a2; this.outputChannel = a3; } function set_82776(a0) { // fn#82776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2536, offset: 0x01f013fe, size: 49 bytes, params: 2, frame: 12 const env0_0 = a0; this._volume = a0; this.ensureSound().then(_fun82777); } function value_82778() { // fn#82778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2626, offset: 0x01f01443, size: 36 bytes, params: 1, frame: 11 this.ensureSound().then(function(a0) { a0.numberOfLoops = -1; a0.play(); }); } function value_82780() { // fn#82780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2717, offset: 0x01f01486, size: 36 bytes, params: 1, frame: 11 this.ensureSound().then(function(a0) { a0.play(); }); } function value_82782() { // fn#82782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2801, offset: 0x01f014bb, size: 46 bytes, params: 1, frame: 11 const Promise = global.Promise; const value = Object.create(Promise.prototype, {constructor: {value: Promise}}); const promise = new Promise(_fun82783); return promise instanceof Object ? promise : value; } function value_82787() { // fn#82787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3052, offset: 0x01f015d1, size: 44 bytes, params: 1, frame: 11 if (this.soundPromise != null) { this.soundPromise.then(function(a0) { return a0.pause(); }); } } function value_82790() { // fn#82790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3206, offset: 0x01f0161f, size: 48 bytes, params: 1, frame: 12 if (this.soundPromise != null) { this.soundPromise.then(_fun82791); } } function value_82792() { // fn#82792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3344, offset: 0x01f01679, size: 70 bytes, params: 1, frame: 13 this.soundPromise = this.soundPromise ?? new global.Promise(_fun82793); return this.soundPromise; } function _fun82763(a0, a1) { // fn#82763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:470, offset: 0x01f01117, size: 86 bytes, params: 3, frame: 12 var binding; if (a1) { binding = env0_0; binding._duration = a1.duration; binding._numberOfChannels = a1.numberOfChannels; } if (a0 == null) { env0_0._loaded = true; } if (importDefault != null) { importDefault(a0); } } function _fun82777(a0) { // fn#82777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2588, offset: 0x01f0142f, size: 20 bytes, params: 2, frame: 2 a0.volume = env0_0; } function _fun82783(a0, a1) { // fn#82783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2832, offset: 0x01f014e9, size: 72 bytes, params: 3, frame: 12 const env0_0 = a0; const env0_1 = a1; let value = env0_0.ensureSound(); value = value.then(_fun82784); value.catch(function(a0) { require(a0); }); } function _fun82791(a0) { // fn#82791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3266, offset: 0x01f0164f, size: 42 bytes, params: 2, frame: 9 a0.stop(); a0.release(); env0_0.soundPromise = null; } function _fun82793(a0, a1) { // fn#82793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3429, offset: 0x01f016bf, size: 82 bytes, params: 3, frame: 18 var environment; const env0_0 = a0; const env0_1 = a1; const value = environment.__proto__.__proto__; const binding = env2_6; const {name, usage, _volume} = env0_0; const value2 = new binding(name, usage, _volume, _fun82794); } function _fun82784(a0) { // fn#82784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2865, offset: 0x01f01531, size: 142 bytes, params: 2, frame: 13 var environment; if (!(a0.duration != null && a0.duration !== 0)) { require('sound has no duration'); } a0.play(); value = environment.__proto__.__proto__.__proto__; value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isIOS(); global.setTimeout(_fun82785, a0.duration * (value ? 1000 : 1)); } function _fun82794(a0) { // fn#82794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:3484, offset: 0x01f01711, size: 55 bytes, params: 2, frame: 12 if (a0 == null) { env0_0(env0_2); } else if (a0 !== '') { require(a0); } else { env0_0(env0_2); } } function _fun82785() { // fn#82785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10946:2979, offset: 0x01f015bf, size: 18 bytes, params: 1, frame: 11 env1_0(true); }