131 lines
7.8 KiB
TypeScript
131 lines
7.8 KiB
TypeScript
/* Metro module 4666; source: modules/native_permissions/NativePermissionBaseUtils.tsx; dependencies: [5, 6, 7, 4667, 4661, 661, 683, 4668, 1244, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import NativePermissionStore from './NativePermissionStore.tsx'; /* Metro dependency 4667 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativePermissionConstantsModule from './NativePermissionConstants.tsx'; /* Metro dependency 4661 */
|
|
|
|
function _fun40392(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:6, offset: 0x010ff425, size: 232 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = NativePermissionConstantsModule;
|
|
const env0_7 = value.NativePermissionTypes;
|
|
const env0_8 = value.NativePermissionStates;
|
|
const env0_9 = value.NativePermissionStatus;
|
|
value = _fun40393();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/native_permissions/NativePermissionBaseUtils.tsx');
|
|
exports.NativePermissionBaseUtils = value;
|
|
function _fun40393() { // fn#40393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:253, offset: 0x010ff50d, size: 172 bytes, params: 1, frame: 17
|
|
const NativePermissionBaseUtils2 = NativePermissionBaseUtils;
|
|
const env0_0 = Module00005(_fun40396);
|
|
return CreateClass(NativePermissionBaseUtils2, [{key: 'requestAuthorization', value: value_40397},
|
|
{key: 'requestPermission', value: value_40398}, {key: 'hasPermission', value: value_40399}, {key: 'showAlert',
|
|
value: value_40400}], [{key: 'defaultNativePermissionsRequestOptions', value: function(a0) {
|
|
var r0;
|
|
var object2;
|
|
var object = {showAuthorizationError: true};
|
|
if (a0 == null) {
|
|
r0 = object;
|
|
} else {
|
|
object2 = {};
|
|
copyDataProperties(object2, a0, copyDataProperties(object2, object, object));
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}}]);
|
|
function NativePermissionBaseUtils() { // fn#40394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:264, offset: 0x010ff5b9, size: 57 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
env1_4(this, NativePermissionBaseUtils);
|
|
this.storage = new NativePermissionStore();
|
|
}
|
|
|
|
function* _fun40396(a0, a1, a2) { // fn#40396, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:430, offset: 0x010ff5fb, size: 280 bytes, params: 4, frame: 20
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (typeof a1 !== 'function') {
|
|
throw new global.Error('requestAuthorization: Was provided with not a function for ' + a0 + '.');
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_1;
|
|
const value3 = binding(env2_2[6]);
|
|
const track = value3.track;
|
|
const PERMISSIONS_REQUESTED = env2_10.PERMISSIONS_REQUESTED;
|
|
Reflect.apply(track, value3, [PERMISSIONS_REQUESTED, {type: a0}]);
|
|
yield a1();
|
|
const value4 = undefined;
|
|
if (false) {
|
|
return value4;
|
|
}
|
|
const AUTHORIZED = env2_9.AUTHORIZED;
|
|
const r2 = value4 === AUTHORIZED || value4 === env2_9.LIMITED;
|
|
binding = env2_8;
|
|
env2_1(env2_2[7]).setPermission(a0, r2 ? binding.ACCEPTED : binding.DENIED);
|
|
if (!r2 && a2.showAuthorizationError) {
|
|
this.showAlert(a0);
|
|
}
|
|
return r2;
|
|
}
|
|
|
|
function value_40397() { // fn#40397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:764, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
function value_40398(a0, a1) { // fn#40398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:861, offset: 0x010ff713, size: 43 bytes, params: 3, frame: 13
|
|
return this.requestPermissionCore(a0, NativePermissionBaseUtils.defaultNativePermissionsRequestOptions(a1));
|
|
}
|
|
|
|
function value_40399(a0, a1) { // fn#40399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:1017, offset: 0x010ff73e, size: 43 bytes, params: 3, frame: 13
|
|
return this.hasPermissionCore(a0, NativePermissionBaseUtils.defaultNativePermissionsRequestOptions(a1));
|
|
}
|
|
|
|
function value_40400(a0) { // fn#40400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:1165, offset: 0x010ff769, size: 858 bytes, params: 2, frame: 28
|
|
var openAlertModal;
|
|
const env0_1 = a0;
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const value4 = '' + Reflect.apply(string, intl, [t['68G7fD']]) + '. ' + intl.string(t['5Jvu1R']);
|
|
let object = {};
|
|
const CAMERA = NativePermissionTypes.CAMERA;
|
|
object[CAMERA] = value4;
|
|
const HEADSET_CAMERA = NativePermissionTypes.HEADSET_CAMERA;
|
|
object[HEADSET_CAMERA] = value4;
|
|
const AUDIO = NativePermissionTypes.AUDIO;
|
|
object[AUDIO] = '' + intl.string(t.xisTfe) + '. ' + intl.string(t['5Jvu1R']);
|
|
const PHOTOS = NativePermissionTypes.PHOTOS;
|
|
object[PHOTOS] = '' + intl.string(t.jQHU4M) + '. ' + intl.string(t['5Jvu1R']);
|
|
const INPUT_MONITORING = NativePermissionTypes.INPUT_MONITORING;
|
|
string = intl.string;
|
|
const UIBqsS = t.UIBqsS;
|
|
object[INPUT_MONITORING] = '' + Reflect.apply(string, intl, [UIBqsS]) + '. ' + intl.string(t['5Jvu1R']);
|
|
const CONTACTS = NativePermissionTypes.CONTACTS;
|
|
object[CONTACTS] = '' + intl.string(t.kTtf7o) + '. ' + intl.string(t['5Jvu1R']);
|
|
const property = object[a0];
|
|
if (property != null) {
|
|
openAlertModal = this.openAlertModal;
|
|
object = {};
|
|
object.title = intl.string(t.u1Gxpu);
|
|
object.body = property;
|
|
object.onConfirm = onConfirm_40401;
|
|
object.cancelText = intl.string(t['ETE/oC']);
|
|
object.confirmText = intl.string(t['XgZk+u']);
|
|
Reflect.apply(openAlertModal, this, [object]);
|
|
}
|
|
function value_40400OnConfirm() { // fn#40401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4844:1813, owner: value_40400.onConfirm, offset: 0x010ffac3, size: 24 bytes, params: 1, frame: 11
|
|
return env0_0.openSettings(env0_1);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun40392, 4666, [5, 6, 7, 4667, 4661, 661, 683, 4668, 1244,
|
|
2]) /* metro module 4666, dependencies: [5, 6, 7, 4667, 4661, 661, 683, 4668, 1244, 2] */;
|