103 lines
5.4 KiB
TypeScript
103 lines
5.4 KiB
TypeScript
/* Metro module 13626; source: modules/quests/native/VideoQuestModal/VideoQuestTranscriptActionSheet.tsx; dependencies: [31, 27, 7095, 33, 4501, 697, 1585, 9495, 9484, 6805, 6758, 1244, 6277, 4572, 4573, 2] */
|
|
function _fun104066(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13823:6, offset: 0x022832c5, size: 280 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).ActivityIndicator;
|
|
let value = require(7095) /* metro dependency 7095: VideoQuestUIStore */;
|
|
const env0_5 = value.FetchStatus;
|
|
const env0_6 = value.useVideoQuestUIStore;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
const env0_9 = Reflect.apply(createStyles, value, [{content: {paddingBottom: PX_8}, loadingSpinner: {height: 100}}]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/VideoQuestModal/VideoQuestTranscriptActionSheet.tsx');
|
|
exports.default = VideoQuestTranscriptActionSheet;
|
|
}
|
|
|
|
function VideoQuestTranscriptActionSheet({quest}) { // fn#104067, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13823:429, offset: 0x022833dd, size: 489 bytes, params: 2, frame: 27
|
|
var object3;
|
|
const styles = useStyles();
|
|
const value3 = useVideoQuestUIStore(function(a0) {
|
|
return a0.transcript;
|
|
});
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const binding = env0_3;
|
|
binding.useEffect(_fun104069, [quest, value3]);
|
|
const value4 = binding.useMemo(_fun104070, [value3?.text]);
|
|
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
|
|
object3 = {scrollable: true};
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object3.header = <BottomSheetTitleHeader title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1YS80z'])} />;
|
|
const BottomSheetScrollView = (require(6277) /* metro dependency 6277 */).BottomSheetScrollView;
|
|
const object2 = {paddingBottom: bottom};
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const fetchStatus = value3?.fetchStatus;
|
|
const FETCHING = FetchStatus.FETCHING;
|
|
const items2 = [fetchStatus === FETCHING && <ActivityIndicator style={styles.loadingSpinner} size="large" />];
|
|
items2[1] = value4.length > 0 && value4.map(_fun104073);
|
|
return (
|
|
<ActionSheet {...object3}>
|
|
<BottomSheetScrollView contentContainerStyle={object2}>
|
|
<Stack spacing={16} style={styles.content}>
|
|
{items2}
|
|
</Stack>
|
|
</BottomSheetScrollView>
|
|
</ActionSheet>
|
|
);
|
|
}
|
|
|
|
function _fun104069() { // fn#104069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13823:547, offset: 0x022835d1, size: 239 bytes, params: 1, frame: 20
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const assetUtilsModule = require(9495) /* metro dependency 9495: AssetUtils */;
|
|
const getQuestAsset = assetUtilsModule.getQuestAsset;
|
|
const questBinding = quest;
|
|
const QuestAssetType = assetUtilsModule.QuestAssetType;
|
|
const VIDEO_PLAYER_TRANSCRIPT = QuestAssetType.VIDEO_PLAYER_TRANSCRIPT;
|
|
const value4 = Reflect.apply(getQuestAsset, assetUtilsModule, [questBinding, VIDEO_PLAYER_TRANSCRIPT, value2, true]);
|
|
let r3 = env0_1 == null || env0_1.questId !== quest.id;
|
|
r3 = !r3 ? env0_1.fetchStatus === FetchStatus.NONE : r3;
|
|
r3 = !r3 ? env0_1.fetchStatus === FetchStatus.SUCCESS && (value4 == null ? value2 : value4.url) !== env0_1.url : r3;
|
|
if (r3) {
|
|
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
value.fetchVideoTranscript(quest, true);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function _fun104070() { // fn#104070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13823:813, offset: 0x022836c0, size: 98 bytes, params: 1, frame: 13
|
|
var r0;
|
|
var value;
|
|
if (env0_1?.text == null) {
|
|
r0 = [];
|
|
} else {
|
|
value = env0_1.text.split('\n');
|
|
value = value.map(function(a0) {
|
|
return a0.trim();
|
|
});
|
|
value = value.filter(_fun104072);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun104073(a0, a1) { // fn#104073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13823:1329, offset: 0x02283722, size: 67 bytes, params: 3, frame: 15
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text
|
|
variant="heading-md/normal"
|
|
color="text-muted"
|
|
key={a1}
|
|
>
|
|
{a0}
|
|
</Text>
|
|
);
|
|
}
|
|
|