Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
120 lines
4.6 KiB
TypeScript
120 lines
4.6 KiB
TypeScript
// Module ID: 5354
|
|
// Function ID: 5355
|
|
// Name: NativePermissionBaseUtils
|
|
// Dependencies: [5, 5355, 4965, 1074, 1241, 5356, 1115, 2]
|
|
|
|
// Module 5354 (NativePermissionBaseUtils)
|
|
import util from "util" /* 1115 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import NativePermissionStore from "NativePermissionStore" /* 5355 */;
|
|
|
|
require = fn;
|
|
const NativePermissionConstants = fn(4965);
|
|
({ NativePermissionTypes: hasOwnProperty, NativePermissionStates: metroRequire, NativePermissionStatus: closure_7 } = NativePermissionConstants);
|
|
const AnalyticEvents = fn(1074).AnalyticEvents;
|
|
let NativePermissionBaseUtils;
|
|
class NativePermissionBaseUtils {
|
|
constructor() {
|
|
merged = Object.assign({ storage: null });
|
|
tmp2 = new closure_4();
|
|
merged[0] = tmp2;
|
|
return merged;
|
|
}
|
|
}
|
|
const prototype = NativePermissionBaseUtils.prototype;
|
|
prototype["requestAuthorization"] = function requestAuthorization(arg0, hasPermissionLookup, arg2) {
|
|
closure_0 = arg0;
|
|
closure_1 = hasPermissionLookup;
|
|
closure_2 = arg2;
|
|
const self = this;
|
|
return self(function*() {
|
|
const type = tmp2;
|
|
if (typeof tmp5 !== "function") {
|
|
const _Error = Error;
|
|
const _HermesInternal = HermesInternal;
|
|
const error = new Error("requestAuthorization: Was provided with not a function for " + type + ".");
|
|
throw error;
|
|
}
|
|
tmp5(1241).track(constants2.PERMISSIONS_REQUESTED, { type });
|
|
closure_128_0 = yield tmp45();
|
|
let tmp10 = closure_128_0 === constants.AUTHORIZED;
|
|
if (!tmp10) {
|
|
tmp10 = closure_128_0 === constants.LIMITED;
|
|
}
|
|
closure_128_1 = tmp10;
|
|
if (closure_128_1) {
|
|
let DENIED = tmp14.ACCEPTED;
|
|
} else {
|
|
DENIED = tmp14.DENIED;
|
|
}
|
|
closure_128_2 = DENIED;
|
|
tmp5(5356).setPermission(closure_129_0, closure_128_2);
|
|
let showAuthorizationError = !closure_128_1;
|
|
if (!closure_128_1) {
|
|
showAuthorizationError = closure_129_2.showAuthorizationError;
|
|
}
|
|
if (showAuthorizationError) {
|
|
closure_129_3.showAlert(closure_129_0);
|
|
}
|
|
return closure_128_1;
|
|
})();
|
|
};
|
|
prototype["requestPermission"] = function requestPermission(arg0, arg1) {
|
|
return this.requestPermissionCore(arg0, NativePermissionBaseUtils.defaultNativePermissionsRequestOptions(arg1));
|
|
};
|
|
prototype["hasPermission"] = function hasPermission(arg0, arg1) {
|
|
return this.hasPermissionCore(arg0, NativePermissionBaseUtils.defaultNativePermissionsRequestOptions(arg1));
|
|
};
|
|
prototype["showAlert"] = function showAlert(arg0) {
|
|
const self = this;
|
|
closure_0 = arg0;
|
|
const intl = util.intl;
|
|
const intl2 = util.intl;
|
|
const combined = "" + intl.string(util.t["68G7fD"]) + ". " + intl2.string(util.t["5Jvu1R"]);
|
|
const obj = { [closure_1_5.CAMERA]: combined, [closure_1_5.HEADSET_CAMERA]: combined };
|
|
const intl3 = util.intl;
|
|
const stringResult = intl.string(util.t["68G7fD"]);
|
|
const intl4 = util.intl;
|
|
obj[constants.AUDIO] = "" + intl3.string(util.t.xisTfe) + ". " + intl4.string(util.t["5Jvu1R"]);
|
|
const intl5 = util.intl;
|
|
const stringResult1 = intl3.string(util.t.xisTfe);
|
|
const intl6 = util.intl;
|
|
obj[constants.PHOTOS] = "" + intl5.string(util.t.jQHU4M) + ". " + intl6.string(util.t["5Jvu1R"]);
|
|
const intl7 = util.intl;
|
|
const stringResult2 = intl5.string(util.t.jQHU4M);
|
|
const intl8 = util.intl;
|
|
obj[constants.INPUT_MONITORING] = "" + intl7.string(util.t.UIBqsS) + ". " + intl8.string(util.t["5Jvu1R"]);
|
|
const intl9 = util.intl;
|
|
const stringResult3 = intl7.string(util.t.UIBqsS);
|
|
const intl10 = util.intl;
|
|
obj[constants.CONTACTS] = "" + intl9.string(util.t.kTtf7o) + ". " + intl10.string(util.t["5Jvu1R"]);
|
|
if (null != obj[arg0]) {
|
|
const obj2 = { title: null, body: null, onConfirm: null, cancelText: null, confirmText: null };
|
|
const intl11 = tmp(1115).intl;
|
|
obj2.title = intl11.string(tmp(1115).t.u1Gxpu);
|
|
obj2.body = tmp9;
|
|
obj2.onConfirm = function onConfirm() {
|
|
return self.openSettings(closure_0);
|
|
};
|
|
const intl12 = tmp(1115).intl;
|
|
obj2.cancelText = intl12.string(tmp(1115).t["ETE/oC"]);
|
|
const intl13 = tmp(1115).intl;
|
|
obj2.confirmText = intl13.string(tmp(1115).t["XgZk+u"]);
|
|
self.openAlertModal(obj2);
|
|
}
|
|
};
|
|
NativePermissionBaseUtils["defaultNativePermissionsRequestOptions"] = function defaultNativePermissionsRequestOptions(arg0) {
|
|
const obj = { showAuthorizationError: true };
|
|
let tmp = obj;
|
|
if (null != arg0) {
|
|
const obj2 = {};
|
|
const merged = Object.assign(obj);
|
|
const merged1 = Object.assign(arg0);
|
|
tmp = obj2;
|
|
}
|
|
return tmp;
|
|
};
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/native_permissions/NativePermissionBaseUtils.tsx");
|
|
|
|
export { NativePermissionBaseUtils };
|