400 lines
21 KiB
TypeScript
400 lines
21 KiB
TypeScript
/* Metro module 15699; source: modules/feedback/native/FeedbackActionSheetV2.tsx; dependencies: [57, 31, 27, 9906, 33, 4501, 697, 4080, 22, 6266, 4594, 5080, 9928, 1962, 1244, 4573, 9910, 8950, 6231, 6238, 4578, 1585, 6275, 6758, 6806, 6277, 2] */
|
|
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import UsePrevious from '../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as UseMountEffectModule from '../../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
|
|
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
|
|
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as Module06277Module from '../../../by-id/module-06277.js'; /* Metro dependency 6277 */
|
|
import * as BottomSheetTitleHeaderNativeModule from '../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 9906 */
|
|
|
|
function _fun120503(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:6, offset: 0x0252cf71, size: 347 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.Fragment;
|
|
const env0_9 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.container = {padding: PX_16};
|
|
object.ratingsBody = {textAlign: 'center'};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.problemsList = {marginBottom: PX_16};
|
|
const env0_10 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/feedback/native/FeedbackActionSheetV2.tsx');
|
|
exports.default = FeedbackActionSheetV2;
|
|
function closeActionSheet_120504() { // fn#120504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:347, offset: 0x01e08208, size: 37 bytes, params: 1, frame: 11
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
}
|
|
|
|
function shuffleOptionsTree(a0) { // fn#120505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:425, offset: 0x0252d0cc, size: 60 bytes, params: 2, frame: 13
|
|
return Module00022.shuffle(a0.map(_fun120506));
|
|
function _fun120506(a0) { // fn#120506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:452, offset: 0x0252d108, size: 94 bytes, params: 2, frame: 14
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
let value = environment.__proto__;
|
|
value = Reflect.apply((importDefault(22) /* metro dependency 22 */).shuffle, value, [a0.problemOptions]);
|
|
value = value.concat(a0.freeformConfig ?? []);
|
|
object['problemOptions'] = value;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function FeedbackActionSheetV2({headerLabel, ratingBody, ratingOptions, showHeaderCloseButton, hideDontShowAgainCheckbox, categoriesHeader, initialRating, optionsTree, onMount, trackOpen, trackReport}) { // fn#120507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:663, offset: 0x0252d166, size: 1737 bytes, params: 2, frame: 43
|
|
var r7;
|
|
var r16;
|
|
var r13;
|
|
var problemsHeader;
|
|
var jsxRuntimeEnv0_8Binding;
|
|
var items4;
|
|
const Button = (ButtonNativeModule).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var items2;
|
|
var items3;
|
|
var TableCheckboxRow;
|
|
initialRating = initialRating === undefined ? null : initialRating;
|
|
let env0_4 = undefined;
|
|
const styles = useStyles();
|
|
let binding = env0_4;
|
|
const value5 = binding.useRef(null);
|
|
env0_4 = value5;
|
|
const value6 = (UsePrevious)(optionsTree);
|
|
let useState = binding.useState;
|
|
const value7 = Reflect.apply(useState, binding, [shuffleOptionsTree(optionsTree)]);
|
|
const binding2 = trackReport;
|
|
const value8 = binding2(value7, 2);
|
|
const property = value8[0];
|
|
const env0_7 = value8[1];
|
|
binding.useEffect(_fun120508, [optionsTree, value6]);
|
|
useState = binding.useState;
|
|
const value10 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property2 = value10[0];
|
|
const env0_9 = value10[1];
|
|
useState = binding.useState;
|
|
const value11 = binding2(Reflect.apply(useState, binding, [initialRating]), 2);
|
|
const property3 = value11[0];
|
|
const env0_11 = value11[1];
|
|
const value12 = binding.useState(property.length !== 1 ? null : property[0]);
|
|
binding = trackReport;
|
|
const value13 = binding(value12, 2);
|
|
const property5 = value13[0];
|
|
const env0_13 = value13[1];
|
|
const binding3 = env0_4;
|
|
useState = binding3.useState;
|
|
const value14 = binding(Reflect.apply(useState, binding3, [null]), 2);
|
|
const property6 = value14[0];
|
|
const env0_15 = value14[1];
|
|
useState = binding3.useState;
|
|
const value15 = binding(Reflect.apply(useState, binding3, [false]), 2);
|
|
const env0_16 = value15[0];
|
|
const env0_17 = value15[1];
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
|
|
if (onMount != null) {
|
|
onMount();
|
|
}
|
|
trackOpen();
|
|
});
|
|
(UseMountEffectModule).useUnmountEffect(_fun120510);
|
|
const value16 = binding3.useCallback(_fun120512, []);
|
|
const env0_18 = binding3.useCallback(_fun120513, []);
|
|
const env0_19 = binding3.useCallback(_fun120514, [property5]);
|
|
if (property3 == null) {
|
|
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
|
|
if (ratingBody != null) {
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
r16 = (
|
|
<Text
|
|
style={styles.ratingsBody}
|
|
variant="text-md/medium"
|
|
color="text-default"
|
|
>
|
|
{ratingBody}
|
|
</Text>
|
|
);
|
|
} else {
|
|
r16 = null;
|
|
}
|
|
items3 = [r16];
|
|
items3[1] = ((Component) => <Component ratingOptions={ratingOptions} selectedRating={property3} onChangeRating={value16} />)(importDefault(9910) /* metro dependency 9910: RatingSelector */);
|
|
if (hideDontShowAgainCheckbox) {
|
|
r16 = null;
|
|
} else {
|
|
TableCheckboxRow = (require(8950) /* metro dependency 8950: TableCheckboxRowNative */).TableCheckboxRow;
|
|
r16 = (
|
|
<TableCheckboxRow
|
|
start
|
|
end
|
|
checked={property2}
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5E9SB9'])}
|
|
onPress={onPress_120515}
|
|
/>
|
|
);
|
|
}
|
|
items3[2] = r16;
|
|
r7 = (
|
|
<>
|
|
{items3}
|
|
</>
|
|
);
|
|
r13 = headerLabel;
|
|
} else if (property3 === FeedbackRating.GOOD) {
|
|
if (property5 != null && property6 == null) {
|
|
problemsHeader = property5.problemsHeader;
|
|
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
|
|
items4 = [
|
|
<View style={styles.problemsList}>
|
|
{((TableRowGroup) => <TableRowGroup hasIcons={false}>{property5.problemOptions.map(_fun120519)}</TableRowGroup>)((require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup)}
|
|
</View>,
|
|
];
|
|
items4[1] = (
|
|
<Button
|
|
variant="secondary"
|
|
size="sm"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])}
|
|
onPress={onPress_120521}
|
|
/>
|
|
);
|
|
r7 = (
|
|
<>
|
|
{items4}
|
|
</>
|
|
);
|
|
r13 = problemsHeader;
|
|
} else {
|
|
r7 = undefined;
|
|
r13 = headerLabel;
|
|
}
|
|
} else if (property5 == null) {
|
|
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
|
|
items2 = [
|
|
<View style={styles.problemsList}>
|
|
{((TableRowGroup) => <TableRowGroup hasIcons={false}>{property.map(_fun120516)}</TableRowGroup>)((require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup)}
|
|
</View>,
|
|
];
|
|
items2[1] = (
|
|
<Button
|
|
variant="secondary"
|
|
size="sm"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])}
|
|
onPress={onPress_120518}
|
|
/>
|
|
);
|
|
r7 = (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
r13 = categoriesHeader;
|
|
} else if (property5 != null && property6 == null) {
|
|
problemsHeader = property5.problemsHeader;
|
|
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
|
|
items4 = [
|
|
<View style={styles.problemsList}>
|
|
{((TableRowGroup) => <TableRowGroup hasIcons={false}>{property5.problemOptions.map(_fun120519)}</TableRowGroup>)((require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup)}
|
|
</View>,
|
|
];
|
|
items4[1] = (
|
|
<Button
|
|
variant="secondary"
|
|
size="sm"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])}
|
|
onPress={onPress_120521}
|
|
/>
|
|
);
|
|
r7 = (
|
|
<>
|
|
{items4}
|
|
</>
|
|
);
|
|
r13 = problemsHeader;
|
|
} else {
|
|
r7 = undefined;
|
|
r13 = headerLabel;
|
|
}
|
|
const bottom = (UseSafeAreaInsetsNative)().bottom;
|
|
const value27 = 232 + (hideDontShowAgainCheckbox ? 0 : 48) + bottom;
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const bottomSheetProps = {scrollable: true, ref: value5, startHeight: value27,
|
|
maxHeight: property3 == null ? value27 : undefined};
|
|
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
|
|
bottomSheetProps.header = (
|
|
<BottomSheetTitleHeader
|
|
title={r13}
|
|
trailing={showHeaderCloseButton
|
|
? ((ActionSheetCloseButton) => <ActionSheetCloseButton onPress={closeActionSheet_120504} />)((require(6806) /* metro dependency 6806: ActionSheetCloseButtonNative */).ActionSheetCloseButton)
|
|
: null}
|
|
/>
|
|
);
|
|
const BottomSheetScrollView = (Module06277Module).BottomSheetScrollView;
|
|
return (
|
|
<BottomSheet {...bottomSheetProps}>
|
|
<BottomSheetScrollView
|
|
contentContainerStyle={[styles.container, {paddingBottom: styles.container.padding + bottom}]}
|
|
>
|
|
{r7}
|
|
</BottomSheetScrollView>
|
|
</BottomSheet>
|
|
);
|
|
function _fun120508() { // fn#120508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:995, offset: 0x0252d82f, size: 75 bytes, params: 1, frame: 16
|
|
const defaultImport = Module00022;
|
|
if (!defaultImport.isEqual(ReactNativeModule.View, optionsTree)) {
|
|
env0_7(shuffleOptionsTree(optionsTree));
|
|
}
|
|
}
|
|
|
|
function _fun120510() { // fn#120510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:1345, offset: 0x0252d89d, size: 388 bytes, params: 1, frame: 21
|
|
var environment;
|
|
var r4;
|
|
var trackReportBinding;
|
|
var object;
|
|
var value2;
|
|
var value5;
|
|
var value6;
|
|
var defaultImport;
|
|
var pushLazy;
|
|
var value7;
|
|
var intl;
|
|
if (env0_16) {
|
|
value5 = environment.__proto__;
|
|
value6 = undefined;
|
|
defaultImport = importDefault(dependencyMap[11]);
|
|
pushLazy = defaultImport.pushLazy;
|
|
value7 = require(dependencyMap[13])(dependencyMap[12], dependencyMap.paths);
|
|
object = {};
|
|
object.result = {rating: env0_10, category: env0_12 == null ? value6 : env0_12.value, reason: env0_14,
|
|
dontShowAgain: env0_8};
|
|
object.trackReport = trackReport_120511;
|
|
object.titleLabel = env0_12 == null ? value6 : env0_12.problemsHeader;
|
|
intl = require(dependencyMap[14]).intl;
|
|
object.descriptionLabel = intl.string(require(dependencyMap[14]).t.h95hcn);
|
|
object.hideHelpdeskLink = env0_12 == null || env0_12.freeformConfig == null ? value6 : env0_12.freeformConfig.hideHelpdeskLink;
|
|
Reflect.apply(pushLazy, defaultImport, [value7, object]);
|
|
} else {
|
|
trackReportBinding = trackReport;
|
|
value2 = null;
|
|
r4 = value2 == env0_12 ? undefined : env0_12.value;
|
|
trackReportBinding({rating: env0_10, category: value2 != r4 ? r4 : value2, reason: env0_14,
|
|
dontShowAgain: env0_8,
|
|
feedback: ''});
|
|
}
|
|
function trackReport_120511({rating, category, reason, dontShowAgain, feedback}) { // fn#120511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:1491, offset: 0x0252da21, size: 90 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
trackReport({rating: rating, category: category, reason: reason, dontShowAgain: dontShowAgain,
|
|
feedback: feedback ?? ''});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun120512(a0) { // fn#120512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:1931, offset: 0x0252da7b, size: 102 bytes, params: 2, frame: 13
|
|
var current;
|
|
env0_11(a0);
|
|
const GOOD = FeedbackRating.GOOD;
|
|
if (a0 === GOOD) {
|
|
env0_13(null);
|
|
env0_15(null);
|
|
env0_17(false);
|
|
closeActionSheet_120504();
|
|
} else {
|
|
current = env0_4.current;
|
|
if (current != null) {
|
|
current.expandActionSheet();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun120513(a0) { // fn#120513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:2069, offset: 0x0252dae1, size: 53 bytes, params: 2, frame: 12
|
|
env0_13(a0);
|
|
env0_15(null);
|
|
const current = env0_4.current;
|
|
if (current != null) {
|
|
current.expandActionSheet();
|
|
}
|
|
}
|
|
|
|
function _fun120514(a0) { // fn#120514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:2159, offset: 0x0252db16, size: 101 bytes, params: 2, frame: 14
|
|
var freeformConfig;
|
|
const value2 = undefined;
|
|
env0_15(a0);
|
|
if (env0_12 == null) {
|
|
env0_17(false);
|
|
} else if (a0 == null) {
|
|
env0_17(false);
|
|
} else {
|
|
freeformConfig = env0_12.freeformConfig;
|
|
if ((freeformConfig == null ? value2 : freeformConfig.value) === a0.value) {
|
|
env0_17(true);
|
|
} else {
|
|
env0_17(false);
|
|
}
|
|
}
|
|
closeActionSheet_120504();
|
|
return value2;
|
|
}
|
|
|
|
function FeedbackActionSheetV2OnPress() { // fn#120515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:2607, owner: FeedbackActionSheetV2.onPress, offset: 0x0252db7b, size: 23 bytes, params: 1, frame: 11
|
|
return env0_9(!env0_8);
|
|
}
|
|
|
|
function _fun120516(a0, a1) { // fn#120516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:2754, offset: 0x0252db92, size: 86 bytes, params: 3, frame: 16
|
|
const env0_0 = a0;
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
return (
|
|
<TableRow
|
|
label={a0.label}
|
|
labelLineClamp={2}
|
|
onPress={onPress_120517}
|
|
key={a1}
|
|
/>
|
|
);
|
|
function onPress_120517() { // fn#120517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:2821, offset: 0x0252dbe8, size: 23 bytes, params: 1, frame: 11
|
|
return env1_18(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function FeedbackActionSheetV2OnPress_120518() { // fn#120518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:2946, owner: FeedbackActionSheetV2.onPress, offset: 0x0252dbff, size: 18 bytes, params: 1, frame: 11
|
|
return env0_11(null);
|
|
}
|
|
|
|
function _fun120519(a0, a1) { // fn#120519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:3124, offset: 0x0252dc11, size: 86 bytes, params: 3, frame: 16
|
|
const env0_0 = a0;
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
return (
|
|
<TableRow
|
|
label={a0.label}
|
|
labelLineClamp={2}
|
|
onPress={onPress_120520}
|
|
key={a1}
|
|
/>
|
|
);
|
|
function onPress_120520() { // fn#120520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:3191, offset: 0x0252dc67, size: 23 bytes, params: 1, frame: 11
|
|
return env1_19(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function FeedbackActionSheetV2OnPress_120521() { // fn#120521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15907:3316, owner: FeedbackActionSheetV2.onPress, offset: 0x0252dc7e, size: 49 bytes, params: 1, frame: 12
|
|
return ConstantsModule.FeedbackRating.length === 1 ? env0_11(null) : env0_13(null);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun120503, 15699, [57, 31, 27, 9906, 33, 4501, 697, 4080, 22, 6266, 4594, 5080, 9928, 1962, 1244, 4573,
|
|
9910, 8950, 6231, 6238, 4578, 1585, 6275, 6758, 6806, 6277,
|
|
2]) /* metro module 15699, dependencies: [57, 31, 27, 9906, 33, 4501, 697, 4080, 22, 6266, 4594, 5080, 9928, 1962, 1244, 4573, 9910, 8950, 6231, 6238, 4578, 1585, 6275, 6758, 6806, 6277, 2] */;
|