225 lines
9.9 KiB
React
225 lines
9.9 KiB
React
/* Metro module 1149; source: unknown; dependencies: [6, 7, 15, 17, 18, 31, 1032, 1145, 1150, 826, 1148] */
|
|
function _fun12733(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:6, offset: 0x00dd3eb8, size: 232 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const env0_2 = require(6) /* metro dependency 6 */;
|
|
const env0_3 = require(7) /* metro dependency 7 */;
|
|
const env0_4 = require(15) /* metro dependency 15 */;
|
|
const env0_5 = require(17) /* metro dependency 17 */;
|
|
const env0_6 = require(18) /* metro dependency 18 */;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
const value = require(31) /* metro dependency 31 */;
|
|
const env0_8 = {'componentStack': null, 'error': null, 'eventId': null};
|
|
const Component = value.Component;
|
|
exports.ErrorBoundary = _fun12737(Component);
|
|
exports.UNKNOWN_COMPONENT = 'unknown';
|
|
exports.withErrorBoundary = withErrorBoundary;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_12734() { // fn#12734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:85, offset: 0x00dd3fa0, 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_12734_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun12737(a0) { // fn#12737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:442, offset: 0x00dd3ffe, size: 162 bytes, params: 2, frame: 16
|
|
const closure = ErrorBoundary;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'componentDidCatch', value: value_12740}, {key: 'componentDidMount',
|
|
value: function() {
|
|
var onMount = this.props.onMount;
|
|
if (onMount) {
|
|
onMount();
|
|
}
|
|
}}, {key: 'componentWillUnmount', value: value_12743}, {key: 'resetErrorBoundary', value: value_12744},
|
|
{key: 'render', value: value_12745}]);
|
|
}
|
|
|
|
function withErrorBoundary(a0, a1) { // fn#12747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:2669, offset: 0x00dd45ac, size: 131 bytes, params: 3, frame: 16
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
let r6 = a0.displayName || a0.name;
|
|
r6 = !r6 ? 'unknown' : r6;
|
|
const value2 = env0_7.memo(_fun12748);
|
|
value2.displayName = 'errorBoundary(' + r6 + ')';
|
|
(require(1148) /* metro dependency 1148 */).hoistNonReactStatics(value2, a0);
|
|
return value2;
|
|
}
|
|
|
|
function ErrorBoundary(a0) { // fn#12738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:467, offset: 0x00dd40a0, size: 225 bytes, params: 2, frame: 22
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
env1_2(this, ErrorBoundary);
|
|
const items2 = [a0];
|
|
const value3 = env1_5(ErrorBoundary);
|
|
const value6 = env1_4(this, _isNativeReflectConstruct_12734() ? global.Reflect.construct(value3, items2,
|
|
env1_5(this).constructor) : value3.apply(this, items2));
|
|
value6.state = env1_8;
|
|
value6._openFallbackReportDialog = true;
|
|
value = require(1032) /* metro dependency 1032 */;
|
|
value = value.getClient();
|
|
if (value && a0.showDialog) {
|
|
value6._openFallbackReportDialog = false;
|
|
value6._cleanupHook = value.on('afterSendEvent', _fun12739);
|
|
}
|
|
return value6;
|
|
}
|
|
|
|
function value_12740(a0, a1) { // fn#12740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:1071, offset: 0x00dd4215, size: 123 bytes, params: 3, frame: 12
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_3 = a1.componentStack;
|
|
const props = this.props;
|
|
const env0_4 = props.beforeCapture;
|
|
const env0_5 = props.onError;
|
|
const env0_6 = props.showDialog;
|
|
const env0_7 = props.dialogOptions;
|
|
const value = environment.__proto__;
|
|
(require(1032) /* metro dependency 1032 */).withScope(_fun12741);
|
|
}
|
|
|
|
function value_12743() { // fn#12743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:1721, offset: 0x00dd43eb, size: 108 bytes, params: 1, frame: 17
|
|
var value;
|
|
let state = this.state;
|
|
const error = state.error;
|
|
const componentStack = state.componentStack;
|
|
const eventId = state.eventId;
|
|
const onUnmount = this.props.onUnmount;
|
|
if (onUnmount) {
|
|
state = this.state;
|
|
value = environment.__proto__;
|
|
if (state === env1_8) {
|
|
onUnmount(null, null, null);
|
|
} else {
|
|
onUnmount(error, componentStack, eventId);
|
|
}
|
|
}
|
|
if (this._cleanupHook) {
|
|
this._cleanupHook();
|
|
this._cleanupHook = undefined;
|
|
}
|
|
}
|
|
|
|
function value_12744() { // fn#12744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:1981, offset: 0x00dd4457, size: 70 bytes, params: 1, frame: 16
|
|
const onReset = this.props.onReset;
|
|
const state = this.state;
|
|
if (onReset) {
|
|
onReset(state.error, state.componentStack, state.eventId);
|
|
}
|
|
this.setState(env1_8);
|
|
}
|
|
|
|
function value_12745() { // fn#12745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:2141, offset: 0x00dd449d, size: 250 bytes, params: 1, frame: 19
|
|
var r0;
|
|
var binding;
|
|
const {fallback, children} = this.props;
|
|
const state = this.state;
|
|
const componentStack = state.componentStack;
|
|
const value = null;
|
|
if (value === componentStack) {
|
|
r0 = typeof children !== 'function' ? children : children();
|
|
} else {
|
|
r0 = typeof fallback !== 'function' ? fallback : env1_7.createElement(fallback, {error: state.error,
|
|
componentStack: state.componentStack, resetError: resetError, eventId: state.eventId});
|
|
binding = env1_7;
|
|
if (!binding.isValidElement(r0)) {
|
|
if (fallback && (require(1150) /* metro dependency 1150 */).DEBUG_BUILD) {
|
|
(require(826) /* metro dependency 826 */).debug.warn('fallback did not produce a valid ReactElement');
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun12748(a0) { // fn#12748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:2742, offset: 0x00dd462f, size: 92 bytes, params: 2, frame: 20
|
|
const binding = env1_7;
|
|
const createElement = binding.createElement;
|
|
const binding2 = env1_9;
|
|
let Object = global.Object;
|
|
const value2 = Object.assign({}, require);
|
|
const createElement2 = binding.createElement;
|
|
const binding3 = env0_0;
|
|
Object = global.Object;
|
|
return Reflect.apply(createElement, binding, [binding2, value2, Reflect.apply(createElement2, binding, [binding3,
|
|
Object.assign({}, a0)])]);
|
|
}
|
|
|
|
function _fun12739(a0) { // fn#12739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:840, offset: 0x00dd4181, size: 148 bytes, params: 2, frame: 17
|
|
var showReportDialog;
|
|
var Object;
|
|
const type = a0.type;
|
|
let value = !type;
|
|
if ((type ? value : env0_1._lastEventId) && a0.event_id === env0_1._lastEventId) {
|
|
value = environment.__proto__.__proto__;
|
|
value = require(1032) /* metro dependency 1032 */;
|
|
showReportDialog = value.showReportDialog;
|
|
Object = global.Object;
|
|
Reflect.apply(showReportDialog, value, [Object.assign({}, env0_0.dialogOptions,
|
|
{eventId: env0_1._lastEventId})]);
|
|
}
|
|
}
|
|
|
|
function _fun12741(a0) { // fn#12741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:1228, offset: 0x00dd4290, size: 320 bytes, params: 2, frame: 20
|
|
var binding;
|
|
var moduleValue2;
|
|
var showReportDialog;
|
|
var Object;
|
|
if (beforeCapture) {
|
|
beforeCapture(a0, env0_0, componentStack);
|
|
}
|
|
const r9 = env0_2.props.handled ?? !!env0_2.props.fallback;
|
|
const moduleValue = require(1145) /* metro dependency 1145 */;
|
|
const value4 = moduleValue.captureReactException(env0_0, require, {mechanism: {handled: r9,
|
|
type: 'auto.function.react.error_boundary'}});
|
|
if (onError) {
|
|
onError(env0_0, componentStack, value4);
|
|
}
|
|
if (showDialog) {
|
|
binding = env0_2;
|
|
binding._lastEventId = value4;
|
|
if (binding._openFallbackReportDialog) {
|
|
moduleValue2 = require(1032) /* metro dependency 1032 */;
|
|
showReportDialog = moduleValue2.showReportDialog;
|
|
Object = global.Object;
|
|
Reflect.apply(showReportDialog, moduleValue2, [Object.assign({}, dialogOptions, {eventId: value4})]);
|
|
}
|
|
}
|
|
env0_2.setState({error: env0_0, componentStack: componentStack, eventId: value4});
|
|
}
|
|
|
|
function resetError() { // fn#12746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1276:2385, owner: value_12745.resetError, offset: 0x00dd4597, size: 21 bytes, params: 1, frame: 9
|
|
return env0_0.resetErrorBoundary();
|
|
}
|
|
|