/* Metro module 4496; source: actions/native/AlertActionCreators.tsx; dependencies: [31, 33, 4080, 694, 4497, 1244, 1357, 4500, 4596, 4596, 1962, 2] */
function _fun38356(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#38356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:6, offset: 0x010bdb3a, size: 202 bytes, params: 8, frame: 18
var object2;
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(33) /* metro dependency 33 */;
const env0_3 = value.jsx;
const env0_4 = value.Fragment;
const env0_5 = value.jsxs;
object2 = {openLazy: function(a0) {
var importer = a0.importer;
var hideActionSheet = a0.hideActionSheet;
var env0_0 = !(hideActionSheet !== undefined) || hideActionSheet;
var isDismissable = a0.isDismissable;
var env0_1 = isDismissable !== undefined ? isDismissable : false;
return importer().then(_fun38358);
}, close: close_38359, show: show_38360, confirm: function(a0) {
var env0_0 = this;
var env0_1 = a0;
var Promise = global.Promise;
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
var value2 = new Promise(_fun38368);
return value2 instanceof Object ? value2 : value;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/native/AlertActionCreators.tsx');
exports.default = object2;
}
function openLazy_38357({importer, hideActionSheet, isDismissable}) { // fn#38357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:171, offset: 0x010bdc04, size: 66 bytes, params: 2, frame: 14
if (hideActionSheet !== undefined) {
}
if (isDismissable !== undefined) {
}
return importer().then(_fun38358);
}
function close_38359() { // fn#38359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:335, offset: 0x010bdcb5, size: 100 bytes, params: 1, frame: 13
if (env0_6 != null) {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).dismissAlert(env0_6);
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ALERT_CLOSE'});
}
function show_38360(a0) { // fn#38360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:425, offset: 0x010bdd19, size: 1086 bytes, params: 2, frame: 36
var r18;
var r10;
var r8;
var value;
var intl;
var object3;
var body;
var title;
var binding;
var value25;
var value26;
var children;
var confirmColor;
var cancelText;
var moduleValue3;
var openAlert;
var AlertModal;
var jsxRuntimeEnv0_4Binding;
var items2;
let hideActionSheet = a0.hideActionSheet;
hideActionSheet = hideActionSheet === undefined || hideActionSheet;
const isDismissable = a0.isDismissable;
let confirmText = a0.confirmText;
if (confirmText !== undefined) {
r18 = confirmText;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.BddRzS);
r18 = value;
}
let object4 = {'hideActionSheet': 0, 'isDismissable': 0, 'confirmText': 0};
silentSetPrototypeOf(object4, null, undefined);
const value2 = copyDataProperties({}, a0, object4, undefined);
var env0_3;
var env0_4;
const mobileVisualRefreshExperimentModule = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */;
if (mobileVisualRefreshExperimentModule.isMobileVisualRefreshEnabled('AlertActionCreators')) {
object3 = {};
copyDataProperties(object3, value2, object4);
object3['confirmText'] = r18;
object3['isDismissable'] = isDismissable;
body = object3.body;
confirmText = object3.confirmText;
r10 = value != body && typeof body !== 'string';
r10 = r10 && !global.Array.isArray(body);
title = object3.title;
r8 = value == title || object3.title === '';
r8 = !r8 ? value != confirmText && typeof confirmText !== 'string' : r8;
r8 = !r8 ? r10 : r8;
r8 = !r8 ? value != object3.footer : r8;
r8 = !r8 ? value != object3.helpText : r8;
r8 = !r8 ? value != object3.renderConfirmButton : r8;
r8 = !r8 ? value != object3.renderConfirmIcon : r8;
r8 = !r8 ? value != object3.renderConfirmRightIcon : r8;
r8 = !r8 ? object3.noDefaultButtons === true : r8;
r8 = !r8 ? value != object3.secondaryConfirmText : r8;
r8 = !r8 ? value != object3.onConfirmSecondary : r8;
r8 = !r8 ? object3.isConfirmButtonDisabled === true : r8;
r8 = !r8 ? value != object3.confirming : r8;
r8 = !r8 ? value != object3.style : r8;
r8 = !r8 ? object3.fillCancelText === true : r8;
r8 = !r8 ? object3.autoCloseOnConfirm === false : r8;
r8 = !r8 ? value != object3.onClose : r8;
if (r8) {
if (value != env0_6) {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).dismissAlert(env0_6);
}
this.openLazy({importer: importer_38364, hideActionSheet: hideActionSheet, isDismissable: isDismissable});
} else {
if (hideActionSheet) {
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
}
if (value != env0_6) {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).dismissAlert(env0_6);
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ALERT_CLOSE'});
binding = env0_7;
value25 = typeof binding === 'bigint' ? binding : +binding;
env0_7 = typeof value25 === 'bigint' ? value25 + 1n : +value25 + 1;
value26 = 'legacy-alert-' + value25;
title = value2.title;
body = value2.body;
children = value2.children;
confirmColor = value2.confirmColor;
cancelText = value2.cancelText;
env0_3 = value2.onConfirm;
env0_4 = value2.onCancel;
moduleValue3 = require(4497) /* metro dependency 4497: useAlertStoreNative */;
openAlert = moduleValue3.openAlert;
AlertModal = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertModal;
object4 = {title: title, content: body, extraContent: children};
jsxRuntimeEnv0_4Binding = jsxRuntimeEnv0_4;
items2 = [((AlertActionButton) => )((require(4500) /* metro dependency 4500: AlertModalNative */).AlertActionButton)];
items2[1] = value != cancelText ? ((AlertActionButton) => )((require(4500) /* metro dependency 4500: AlertModalNative */).AlertActionButton) : value;
object4.actions = <>{items2}>;
value = ;
Reflect.apply(openAlert, moduleValue3, [value26, value, _fun38363, {dismissable: isDismissable === true}]);
}
} else {
if (value != env0_6) {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).dismissAlert(env0_6);
}
this.openLazy({importer: importer_38364, hideActionSheet: hideActionSheet, isDismissable: isDismissable});
}
}
function confirm(a0) { // fn#38367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:1966, offset: 0x010be265, size: 51 bytes, params: 2, frame: 11
const env0_1 = a0;
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun38368);
return promise instanceof Object ? promise : value;
}
function _fun38358(a0) { // fn#38358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:237, offset: 0x010bdc46, size: 111 bytes, params: 2, frame: 14
var value2;
if (hideActionSheet) {
value2 = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
}
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ALERT_OPEN', alert: a0,
isDismissable: isDismissable});
}
function show_38360OnPress_38362() { // fn#38362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:1670, owner: show_38360.onPress, offset: 0x010be178, size: 33 bytes, params: 1, frame: 10
if (onCancel != null) {
onCancel();
}
}
function _fun38363() { // fn#38363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:1713, offset: 0x010be199, size: 58 bytes, params: 1, frame: 11
if (!(env0_5 || onCancel == null)) {
onCancel();
}
if (env1_6 !== env0_2) {
}
}
function show_38360Importer() { // fn#38364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:1845, owner: show_38360.importer, offset: 0x010be1d3, size: 62 bytes, params: 1, frame: 13
var environment;
let value = environment.__proto__;
value = require(dependencyMap[10]);
value = value(dependencyMap[9], dependencyMap.paths);
return value.then(function({default: env0_0}) {
return _fun38366;
});
}
function _fun38368(a0) { // fn#38368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:1997, offset: 0x010be298, size: 127 bytes, params: 2, frame: 20
const binding = a0;
const show = binding.show;
const object2 = {onConfirm: onConfirm};
const intl = require(dependencyMap[5]).intl;
object2.cancelText = intl.string(require(dependencyMap[5]).t['ETE/oC']);
object2.onCancel = onCancel;
copyDataProperties(object2, env0_1, dependencyMap);
Reflect.apply(show, binding, [object2]);
}
function _fun38365({default: env0_0}) { // fn#38365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:1878, offset: 0x010be211, size: 21 bytes, params: 2, frame: 2
return _fun38366;
}
function _fun38366(a0) { // fn#38366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4674:1893, offset: 0x010be226, size: 63 bytes, params: 2, frame: 14
return ((Component) => )(env0_0);
}