107 lines
6.4 KiB
TypeScript
107 lines
6.4 KiB
TypeScript
/* Metro module 4667; source: modules/native_permissions/NativePermissionStore.tsx; dependencies: [6, 7, 15, 17, 18, 4661, 661, 694, 683, 566, 2] */
|
|
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 PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as NativePermissionConstantsModule from './NativePermissionConstants.tsx'; /* Metro dependency 4661 */
|
|
|
|
function _fun40403(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:6, offset: 0x010ffb0b, size: 289 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {permissionStates: {}};
|
|
const DeviceSettingsStore = (Flux).DeviceSettingsStore;
|
|
const value = _fun40407(DeviceSettingsStore);
|
|
value.displayName = 'NativePermissionStore';
|
|
value.persistKey = 'NativePermissionsStore';
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/native_permissions/NativePermissionStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_40404() { // fn#40404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:206, offset: 0x010ffc2c, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_40404_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun40407(a0) { // fn#40407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:429, offset: 0x010ffc8a, size: 139 bytes, params: 2, frame: 16
|
|
const NativePermissionStore2 = NativePermissionStore;
|
|
Inherits(NativePermissionStore2, a0);
|
|
return CreateClass(NativePermissionStore2, [{key: 'initialize', value: value_40410}, {key: 'getUserAgnosticState',
|
|
value: value_40411}, {key: 'hasPermission', value: value_40412}, {key: 'handleSetNativePermission',
|
|
value: value_40413}]);
|
|
function NativePermissionStore() { // fn#40408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:441, offset: 0x010ffd15, size: 154 bytes, params: 1, frame: 20
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
env1_2(this, NativePermissionStore);
|
|
const items2 = [Dispatcher];
|
|
items2[1] = {SET_NATIVE_PERMISSION: SET_NATIVE_PERMISSION_40409};
|
|
const value3 = env1_5(NativePermissionStore);
|
|
return env1_4(this, _isNativeReflectConstruct_40404() ? global.Reflect.construct(value3, items2,
|
|
env1_5(this).constructor) : value3.apply(this, items2));
|
|
function NativePermissionStoreSET_NATIVE_PERMISSION(a0) { // fn#40409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:710, owner: NativePermissionStore.SET_NATIVE_PERMISSION, offset: 0x010ffdaf, size: 25 bytes, params: 2, frame: 11
|
|
return env0_0.handleSetNativePermission(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function value_40410(a0) { // fn#40410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:830, offset: 0x010ffdc8, size: 27 bytes, params: 2, frame: 2
|
|
const r1 = a0 ?? env1_9;
|
|
value = environment.__proto__;
|
|
}
|
|
|
|
function value_40411() { // fn#40411, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
|
|
return env1_9;
|
|
}
|
|
|
|
function value_40412(a0) { // fn#40412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:941, offset: 0x010ffde3, size: 45 bytes, params: 2, frame: 4
|
|
const value = environment.__proto__;
|
|
const property = env1_9.permissionStates[a0];
|
|
return property != null && property === NativePermissionStates.ACCEPTED;
|
|
}
|
|
|
|
function value_40413({state, permissionType}) { // fn#40413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:1053, offset: 0x010ffe10, size: 119 bytes, params: 2, frame: 17
|
|
var defaultImport;
|
|
const permissionStates = env1_9.permissionStates;
|
|
const property = permissionStates[permissionType];
|
|
permissionStates[permissionType] = state;
|
|
if (property !== state) {
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.PERMISSIONS_ACKED, {type: permissionType, action: state,
|
|
previous_action: property ?? NativePermissionStates.NONE});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun40403, 4667, [6, 7, 15, 17, 18, 4661, 661, 694, 683, 566,
|
|
2]) /* metro module 4667, dependencies: [6, 7, 15, 17, 18, 4661, 661, 694, 683, 566, 2] */;
|