415 lines
23 KiB
JavaScript
415 lines
23 KiB
JavaScript
/* Metro module 1203; source: unknown; dependencies: [6, 7, 15, 17, 18, 31, 27, 1204, 1010, 1205, 826, 1207, 1208, 1141, 1212, 1210, 1213] */
|
|
import ClassCallCheck from './module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from './module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from './module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from './module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from './module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as Module00826Module from './module-00826.js'; /* Metro dependency 826 */
|
|
import * as Module01204Module from './module-01204.js'; /* Metro dependency 1204 */
|
|
import * as Module01205Module from './module-01205.js'; /* Metro dependency 1205 */
|
|
|
|
function _fun13348(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:6, offset: 0x00de8b89, size: 310 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactNativeModule.Platform;
|
|
const env0_16 = (Module01204Module).isNativeDriverSupportedForColorAnimations();
|
|
const Component = ReactModule.Component;
|
|
exports.FeedbackWidgetProvider = _fun13352(Component);
|
|
function _isNativeReflectConstruct_13349() { // fn#13349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:286, offset: 0x00de8cbf, 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_13349_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun13352(a0) { // fn#13352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:565, offset: 0x00de8d1d, size: 137 bytes, params: 2, frame: 16
|
|
const FeedbackWidgetProvider2 = FeedbackWidgetProvider;
|
|
Inherits(FeedbackWidgetProvider2, a0);
|
|
return CreateClass(FeedbackWidgetProvider2, [{key: 'componentDidMount', value: function() {
|
|
var env0_0 = this;
|
|
this._themeListener = Appearance.addChangeListener(_fun13367);
|
|
}}, {key: 'componentWillUnmount', value: function() {
|
|
if (this._themeListener) {
|
|
this._themeListener.remove();
|
|
}
|
|
}}, {key: 'componentDidUpdate', value: value_13369}, {key: 'render', value: value_13371}]);
|
|
function FeedbackWidgetProvider(a0) { // fn#13353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:577, offset: 0x00de8da6, size: 454 bytes, params: 2, frame: 21
|
|
env1_2(this, FeedbackWidgetProvider);
|
|
let object = [a0];
|
|
const value3 = env1_5(FeedbackWidgetProvider);
|
|
const value6 = env1_4(this, _isNativeReflectConstruct_13349() ? global.Reflect.construct(value3, object,
|
|
env1_5(this).constructor) : value3.apply(this, object));
|
|
object = {'isButtonVisible': false, 'isScreenshotButtonVisible': false, 'isVisible': false,
|
|
'backgroundOpacity': null, 'panY': null, 'isScrollAtTop': true};
|
|
let Value = Animated.Value;
|
|
const value7 = Object.create(Value.prototype, {constructor: {value: Value}});
|
|
const value8 = new Value(0);
|
|
object.backgroundOpacity = value8 instanceof Object ? value8 : value7;
|
|
Value = Animated.Value;
|
|
const get = Dimensions.get;
|
|
const height = Reflect.apply(get, Dimensions, ['screen']).height;
|
|
const value10 = Object.create(Value.prototype, {constructor: {value: Value}});
|
|
const value11 = new Value(height);
|
|
object.panY = value11 instanceof Object ? value11 : value10;
|
|
value6.state = object;
|
|
value6._panResponder = PanResponder.create({onStartShouldSetPanResponder: onStartShouldSetPanResponder,
|
|
onMoveShouldSetPanResponder: onMoveShouldSetPanResponder, onPanResponderMove: onPanResponderMove,
|
|
onPanResponderRelease: onPanResponderRelease});
|
|
value6._handleScroll = _handleScroll_13359;
|
|
value6._setVisibilityFunction = _setVisibilityFunction;
|
|
value6._setButtonVisibilityFunction = _setButtonVisibilityFunction;
|
|
value6._setScreenshotButtonVisibilityFunction = _setScreenshotButtonVisibilityFunction;
|
|
value6._handleClose = function() {
|
|
var FeedbackWidgetManager = require(dependencyMap[9]).FeedbackWidgetManager;
|
|
FeedbackWidgetManager.hide();
|
|
};
|
|
const FeedbackButtonManager = (Module01205Module).FeedbackButtonManager;
|
|
let initialize = FeedbackButtonManager.initialize;
|
|
var _setButtonVisibilityFunction = value6._setButtonVisibilityFunction;
|
|
Reflect.apply(initialize, FeedbackButtonManager, [_setButtonVisibilityFunction]);
|
|
const ScreenshotButtonManager = (Module01205Module).ScreenshotButtonManager;
|
|
initialize = ScreenshotButtonManager.initialize;
|
|
var _setScreenshotButtonVisibilityFunction = value6._setScreenshotButtonVisibilityFunction;
|
|
Reflect.apply(initialize, ScreenshotButtonManager, [_setScreenshotButtonVisibilityFunction]);
|
|
let FeedbackWidgetManager = (Module01205Module).FeedbackWidgetManager;
|
|
initialize = FeedbackWidgetManager.initialize;
|
|
var _setVisibilityFunction = value6._setVisibilityFunction;
|
|
Reflect.apply(initialize, FeedbackWidgetManager, [_setVisibilityFunction]);
|
|
return value6;
|
|
function onStartShouldSetPanResponder(a0, a1) { // fn#13354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1040, owner: FeedbackWidgetProvider.onStartShouldSetPanResponder, offset: 0x00de8f6c, size: 76 bytes, params: 3, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(1010) /* metro dependency 1010 */;
|
|
value = value.notWeb();
|
|
return value && env0_0.state.isScrollAtTop && a1.dy > 0;
|
|
}
|
|
|
|
function onMoveShouldSetPanResponder(a0, a1) { // fn#13355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1167, owner: FeedbackWidgetProvider.onMoveShouldSetPanResponder, offset: 0x00de8f6c, size: 76 bytes, params: 3, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(1010) /* metro dependency 1010 */;
|
|
value = value.notWeb();
|
|
return value && env0_0.state.isScrollAtTop && a1.dy > 0;
|
|
}
|
|
|
|
function onPanResponderMove(a0, a1) { // fn#13356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1284, owner: FeedbackWidgetProvider.onPanResponderMove, offset: 0x00de8fb8, size: 54 bytes, params: 3, frame: 11
|
|
var panY;
|
|
if (a1.dy > 0) {
|
|
panY = env0_0.state.panY;
|
|
panY.setValue(a1.dy);
|
|
}
|
|
}
|
|
|
|
function onPanResponderRelease(a0, {dy}) { // fn#13357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1376, owner: FeedbackWidgetProvider.onPanResponderRelease, offset: 0x00de8fee, size: 220 bytes, params: 3, frame: 19
|
|
var environment;
|
|
var panY;
|
|
var timing;
|
|
var object;
|
|
const value = environment.__proto__.__proto__;
|
|
const PULL_DOWN_CLOSE_THRESHOLD = (require(1205) /* metro dependency 1205 */).PULL_DOWN_CLOSE_THRESHOLD;
|
|
if (dy > PULL_DOWN_CLOSE_THRESHOLD) {
|
|
timing = Animated.timing;
|
|
panY = env0_0.state.panY;
|
|
object = {};
|
|
object.toValue = Dimensions.get('screen').height;
|
|
object.duration = (require(1205) /* metro dependency 1205 */).SLIDE_ANIMATION_DURATION;
|
|
object.useNativeDriver = true;
|
|
Reflect.apply(timing, Animated, [panY, object]).start(_fun13358);
|
|
} else {
|
|
Animated.spring(env0_0.state.panY, {'toValue': 0, 'useNativeDriver': true}).start();
|
|
}
|
|
function _fun13358() { // fn#13358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1575, offset: 0x00de90ca, size: 21 bytes, params: 1, frame: 9
|
|
env1_0._handleClose();
|
|
}
|
|
|
|
}
|
|
|
|
function FeedbackWidgetProvider_handleScroll({nativeEvent}) { // fn#13359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1687, owner: FeedbackWidgetProvider._handleScroll, offset: 0x00de90df, size: 55 bytes, params: 2, frame: 13
|
|
env0_0.setState({isScrollAtTop: nativeEvent.contentOffset.y <= 0});
|
|
}
|
|
|
|
function _setVisibilityFunction(a0) { // fn#13360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1786, owner: FeedbackWidgetProvider._setVisibilityFunction, offset: 0x00de9116, size: 288 bytes, params: 2, frame: 25
|
|
var environment;
|
|
var value;
|
|
var parallel;
|
|
var timing;
|
|
var binding;
|
|
var state;
|
|
var panY;
|
|
var object;
|
|
var out;
|
|
var quad;
|
|
var backgroundOpacity;
|
|
var object2;
|
|
if (a0) {
|
|
updateState();
|
|
} else {
|
|
value = environment.__proto__.__proto__;
|
|
parallel = Animated.parallel;
|
|
timing = Animated.timing;
|
|
binding = a0;
|
|
state = binding.state;
|
|
panY = state.panY;
|
|
object = {};
|
|
object.toValue = Dimensions.get('screen').height;
|
|
object.duration = (require(1205) /* metro dependency 1205 */).SLIDE_ANIMATION_DURATION;
|
|
object.useNativeDriver = true;
|
|
out = Easing.out;
|
|
quad = Easing.quad;
|
|
object.easing = Reflect.apply(out, Easing, [quad]);
|
|
object = [Reflect.apply(timing, Animated, [panY, object])];
|
|
timing = Animated.timing;
|
|
state = binding.state;
|
|
backgroundOpacity = state.backgroundOpacity;
|
|
object2 = {toValue: 0};
|
|
object2.duration = (require(1205) /* metro dependency 1205 */).BACKGROUND_ANIMATION_DURATION;
|
|
object2.useNativeDriver = env2_16;
|
|
out = Easing.out;
|
|
quad = Easing.quad;
|
|
object2.easing = Reflect.apply(out, Easing, [quad]);
|
|
object[1] = Reflect.apply(timing, Animated, [backgroundOpacity, object2]);
|
|
value = Reflect.apply(parallel, Animated, [object]);
|
|
value.start(function() {
|
|
updateState();
|
|
});
|
|
}
|
|
function updateState() { // fn#13361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:1804, owner: FeedbackWidgetProvider._setVisibilityFunction.updateState, offset: 0x00de9236, size: 36 bytes, params: 1, frame: 12
|
|
env1_0.setState({isVisible: env0_0});
|
|
}
|
|
|
|
}
|
|
|
|
function _setButtonVisibilityFunction(a0) { // fn#13363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2203, owner: FeedbackWidgetProvider._setButtonVisibilityFunction, offset: 0x00de9269, size: 32 bytes, params: 2, frame: 12
|
|
env0_0.setState({isButtonVisible: a0});
|
|
}
|
|
|
|
function _setScreenshotButtonVisibilityFunction(a0) { // fn#13364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2289, owner: FeedbackWidgetProvider._setScreenshotButtonVisibilityFunction, offset: 0x00de9289, size: 32 bytes, params: 2, frame: 12
|
|
env0_0.setState({isScreenshotButtonVisible: a0});
|
|
}
|
|
|
|
}
|
|
|
|
function value_13366() { // fn#13366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2727, offset: 0x00de92d4, size: 42 bytes, params: 1, frame: 12
|
|
this._themeListener = Appearance.addChangeListener(_fun13367);
|
|
function _fun13367() { // fn#13367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2808, offset: 0x00de92fe, size: 21 bytes, params: 1, frame: 9
|
|
env0_0.forceUpdate();
|
|
}
|
|
|
|
}
|
|
|
|
function value_13369(a0, a1) { // fn#13369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:2990, offset: 0x00de9333, size: 314 bytes, params: 3, frame: 23
|
|
var environment;
|
|
var state;
|
|
var value;
|
|
var parallel;
|
|
var timing;
|
|
var backgroundOpacity;
|
|
var object;
|
|
var quad;
|
|
var panY;
|
|
var object2;
|
|
if (a1.isVisible) {
|
|
if (a1.isVisible && !this.state.isVisible) {
|
|
this.state.backgroundOpacity.setValue(0);
|
|
}
|
|
} else {
|
|
state = this.state;
|
|
if (state.isVisible) {
|
|
value = environment.__proto__;
|
|
parallel = Animated.parallel;
|
|
timing = Animated.timing;
|
|
state = this.state;
|
|
backgroundOpacity = state.backgroundOpacity;
|
|
object = {toValue: 1};
|
|
object.duration = (require(1205) /* metro dependency 1205 */).BACKGROUND_ANIMATION_DURATION;
|
|
object.useNativeDriver = env1_16;
|
|
quad = Easing.quad;
|
|
object.easing = Easing.in(quad);
|
|
value = Reflect.apply(timing, Animated, [backgroundOpacity, object]);
|
|
object = [value];
|
|
timing = Animated.timing;
|
|
state = this.state;
|
|
panY = state.panY;
|
|
object2 = {'toValue': 0, 'duration': null, 'useNativeDriver': true};
|
|
object2.duration = (require(1205) /* metro dependency 1205 */).SLIDE_ANIMATION_DURATION;
|
|
quad = Easing.quad;
|
|
object2.easing = Easing.in(quad);
|
|
object[1] = Reflect.apply(timing, Animated, [panY, object2]);
|
|
value = Reflect.apply(parallel, Animated, [object]);
|
|
value.start(function() {
|
|
require(dependencyMap[10]).debug.log('FeedbackWidgetProvider componentDidUpdate');
|
|
});
|
|
} else if (a1.isVisible && !this.state.isVisible) {
|
|
this.state.backgroundOpacity.setValue(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_13371() { // fn#13371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1330:3511, offset: 0x00de949f, size: 875 bytes, params: 1, frame: 43
|
|
var r7;
|
|
var r6;
|
|
var r1;
|
|
var binding;
|
|
var createElement;
|
|
var Fragment;
|
|
var children;
|
|
var theme;
|
|
var state;
|
|
var isButtonVisible;
|
|
var isScreenshotButtonVisible;
|
|
var isVisible;
|
|
var backgroundOpacity;
|
|
var object;
|
|
var value3;
|
|
var binding2;
|
|
var createElement2;
|
|
var FeedbackButton;
|
|
var Object;
|
|
var assign;
|
|
var binding3;
|
|
var createElement3;
|
|
var ScreenshotButton;
|
|
var binding4;
|
|
var createElement4;
|
|
var View2;
|
|
var items3;
|
|
var createElement5;
|
|
var object3;
|
|
var _handleClose;
|
|
var createElement6;
|
|
var object4;
|
|
var element3;
|
|
var createElement7;
|
|
var View3;
|
|
var items2;
|
|
var value7;
|
|
var createElement8;
|
|
var object8;
|
|
var createElement9;
|
|
var FeedbackWidget;
|
|
var object9;
|
|
let value = environment.__proto__;
|
|
if ((require(1204) /* metro dependency 1204 */).isModalSupported()) {
|
|
theme = (require(1207) /* metro dependency 1207 */).getTheme();
|
|
state = this.state;
|
|
isButtonVisible = state.isButtonVisible;
|
|
isScreenshotButtonVisible = state.isScreenshotButtonVisible;
|
|
isVisible = state.isVisible;
|
|
backgroundOpacity = state.backgroundOpacity;
|
|
object = {inputRange: [0, 1], outputRange: ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 0.9)']};
|
|
value3 = backgroundOpacity.interpolate(object);
|
|
binding = env1_7;
|
|
createElement = binding.createElement;
|
|
Fragment = binding.Fragment;
|
|
children = this.props.children;
|
|
if (isButtonVisible) {
|
|
binding2 = env1_7;
|
|
createElement2 = binding2.createElement;
|
|
FeedbackButton = (require(1208) /* metro dependency 1208 */).FeedbackButton;
|
|
Object = global.Object;
|
|
r7 = Reflect.apply(createElement2, binding2, [FeedbackButton, Object.assign({},
|
|
(require(1141) /* metro dependency 1141 */).getFeedbackButtonOptions())]);
|
|
} else {
|
|
r7 = isButtonVisible;
|
|
}
|
|
if (isScreenshotButtonVisible) {
|
|
binding3 = env1_7;
|
|
createElement3 = binding3.createElement;
|
|
ScreenshotButton = (require(1212) /* metro dependency 1212 */).ScreenshotButton;
|
|
Object = global.Object;
|
|
r6 = Reflect.apply(createElement3, binding3, [ScreenshotButton, Object.assign({},
|
|
(require(1141) /* metro dependency 1141 */).getScreenshotButtonOptions())]);
|
|
} else {
|
|
r6 = isScreenshotButtonVisible;
|
|
}
|
|
if (isVisible) {
|
|
binding4 = env1_7;
|
|
createElement4 = binding4.createElement;
|
|
View2 = Animated.View;
|
|
object = {};
|
|
items3 = [(require(1210) /* metro dependency 1210 */).modalWrapper];
|
|
items3[1] = {backgroundColor: value3};
|
|
object.style = items3;
|
|
createElement5 = binding4.createElement;
|
|
object3 = {'visible': null, 'transparent': true, 'animationType': 'none', 'onRequestClose': null,
|
|
'testID': 'feedback-form-modal'};
|
|
object3.visible = isVisible;
|
|
_handleClose = this._handleClose;
|
|
object3.onRequestClose = _handleClose;
|
|
createElement6 = binding4.createElement;
|
|
object4 = {};
|
|
object4.style = (require(1210) /* metro dependency 1210 */).topSpacer;
|
|
element3 = Reflect.apply(createElement6, binding4, [View, object4]);
|
|
createElement7 = binding4.createElement;
|
|
View3 = Animated.View;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
items2 = [(require(1210) /* metro dependency 1210 */).modalSheetContainer(theme)];
|
|
items2[1] = {transform: [{translateY: this.state.panY}]};
|
|
value7 = Reflect.apply(assign, Object, [{style: items2}, this._panResponder.panHandlers]);
|
|
createElement8 = binding4.createElement;
|
|
object8 = {'bounces': false, 'keyboardShouldPersistTaps': 'handled',
|
|
'automaticallyAdjustKeyboardInsets': false};
|
|
object8.onScroll = this._handleScroll;
|
|
createElement9 = binding4.createElement;
|
|
FeedbackWidget = (require(1213) /* metro dependency 1213 */).FeedbackWidget;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
value = require(1141) /* metro dependency 1141 */;
|
|
value = value.getFeedbackOptions();
|
|
object9 = {};
|
|
_handleClose = this._handleClose;
|
|
object9.onFormClose = _handleClose;
|
|
_handleClose = this._handleClose;
|
|
object9.onFormSubmitted = _handleClose;
|
|
value = Reflect.apply(createElement7, binding4, [View3, value7, Reflect.apply(createElement8, binding4,
|
|
[ScrollView,
|
|
object8, Reflect.apply(createElement9, binding4, [FeedbackWidget, Reflect.apply(assign, Object, [{},
|
|
value,
|
|
object9])])])]);
|
|
value = Reflect.apply(createElement5, binding4, [Modal, object3, element3, value]);
|
|
value = Reflect.apply(createElement4, binding4, [View2, object, value]);
|
|
r1 = value;
|
|
} else {
|
|
r1 = isVisible;
|
|
}
|
|
return Reflect.apply(createElement, binding, [Fragment, null, children, r7, r6, r1]);
|
|
}
|
|
(Module00826Module).debug.error('FeedbackWidget Modal is not supported in React Native < 0.71 with Fabric renderer.');
|
|
binding = env1_7;
|
|
createElement = binding.createElement;
|
|
Fragment = binding.Fragment;
|
|
return Reflect.apply(createElement, binding, [Fragment, null, this.props.children]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun13348, 1203, [6, 7, 15, 17, 18, 31, 27, 1204, 1010, 1205, 826, 1207, 1208, 1141, 1212, 1210,
|
|
1213]) /* metro module 1203, dependencies: [6, 7, 15, 17, 18, 31, 27, 1204, 1010, 1205, 826, 1207, 1208, 1141, 1212, 1210, 1213] */;
|