This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,88 @@
// Metro module 14850 (f14851).
import { View } from "react-native";
import { useScreenRecordingStore } from "./ScreenRecordingStore";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { Text } from "../../../design/components/Text/native/Text";
import { Button } from "../../../design/components/Button/native/Button.native";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables";
import { XSmallIcon } from "../../../design/components/Icon/native/redesign/generated/XSmallIcon";
import MarkupUtils from "../../markup/MarkupUtils";
import { ActionSheet } from "../../../design/components/Sheet/native/ActionSheet.native";
const useStyles = createStyles({
container: {
justifyContent: "center",
alignItems: "center",
gap: Module712.space.PX_16,
paddingVertical: Module712.space.PX_16,
paddingHorizontal: Module712.space.PX_8,
borderRadius: Module712.radii.xl
},
closeButton: {
position: "absolute",
top: Module712.space.PX_8,
right: Module712.space.PX_8
},
buttonContainer: {
display: "flex",
flexDirection: "row",
gap: Module712.space.PX_8
}
});
export default function ScreenRecordingActionSheet() {
let screenRecordingStore, screenRecordingStore2;
const styles = useStyles();
const screenRecordingStore5 = useScreenRecordingStore((a0) => a0.isUploading);
const screenRecordingStore4 = useScreenRecordingStore((a0) => a0.isCompleted);
const screenRecordingStore3 = useScreenRecordingStore((a0) => a0.currentStep);
const screenRecordingStore6 = useScreenRecordingStore((a0) => a0.currentSurveyConfig);
screenRecordingStore = useScreenRecordingStore((a0) => a0.nextStep);
screenRecordingStore2 = useScreenRecordingStore((a0) => a0.completeActionSheet);
let r29 = screenRecordingStore6?.steps;
if (r29 == null) {
r29 = [];
}
const r18 = r29.length > screenRecordingStore3 ? r29[screenRecordingStore3] : null;
let r13 = screenRecordingStore6 == null ? void 0 : screenRecordingStore6.useIsStepCompleted(screenRecordingStore3);
if (r13 == null) {
r13 = false;
}
let r12 = screenRecordingStore6?.completedTitle;
if (r12 == null) {
r12 = "Complete";
}
let r17 = screenRecordingStore6?.completedInstructions;
if (r17 == null) {
r17 = "Thanks for your feedback!";
}
if (r18 == null && screenRecordingStore4 == null) {
return null;
}
const r56 = <View style={styles.container}>
<Text variant="heading-xl/bold">{r12}</Text>
<Text variant="text-md/normal">{r17}</Text>
<Button disabled={screenRecordingStore5} text="Done" loading={screenRecordingStore5} onPress={function onPress() {
screenRecordingStore2();
ActionSheetActionCreators.hideActionSheet();
}} />
</View>;
let r98 = <View style={styles.container}>
<PressableOpacity style={styles.closeButton} onPress={() => ActionSheetActionCreators.hideActionSheet()} accessibilityLabel="close">
<XSmallIcon size="md" color="text-default" />
</PressableOpacity>
<Text variant="heading-xl/bold">{r18.title}</Text>
<Text variant="text-md/normal">
{MarkupUtils.parse(r18.instructions)}
</Text>
<View style={styles.buttonContainer}>
<Button disabled={r13 ? screenRecordingStore5 : !r13} text="Next" loading={screenRecordingStore5} onPress={function onPress() {
screenRecordingStore();
}} />
</View>
</View>;
if (screenRecordingStore4) {
r98 = r56;
}
return <ActionSheet>{r98}</ActionSheet>;
};
@@ -0,0 +1,13 @@
// Metro module 14848 (f14849).
import { NativeModules } from "react-native";
const DCDScreenRecordingManager = NativeModules.DCDScreenRecordingManager;
const r16 = {
requestPermissions: () => DCDScreenRecordingManager.requestPermissions(),
startRecording: () => DCDScreenRecordingManager.startRecording(),
stopRecording: () => DCDScreenRecordingManager.stopRecording(),
isRecording: () => DCDScreenRecordingManager.isRecording(),
getLatestRecording: () => DCDScreenRecordingManager.getLatestRecording(),
setRecordingQuality: (a0) => DCDScreenRecordingManager.setRecordingQuality(a0),
getRecordingQuality: () => DCDScreenRecordingManager.getRecordingQuality()
};
export default r16;
@@ -0,0 +1,243 @@
// Metro module 14845 (f14846).
import { useCallback, useState, useEffect } from "react";
import { View } from "react-native";
import { useScreenRecordingStore } from "./ScreenRecordingStore";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../reanimated/ReanimatedRexport";
import useSafeAreaInsetsSharedValue_native from "../../safe_area/useSafeAreaInsetsSharedValue.native";
import useWindowDimensionsSharedValue_native from "../../screen/useWindowDimensionsSharedValue.native";
import { Gesture, GestureDetector } from "../../../_bundle/Module5273";
import * as _spring from "../../../design/animation/reanimated/spring/spring";
import * as _springPresets from "../../../design/animation/reanimated/spring/springPresets";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import VEVOO from "../../visual_effect_view/native/overrides/VEVOO";
import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables";
import { Text } from "../../../design/components/Text/native/Text";
import { Button } from "../../../design/components/Button/native/Button.native";
import { CheckmarkLargeIcon } from "../../../design/components/Icon/native/redesign/generated/CheckmarkLargeIcon";
import { StopIcon } from "../../../design/components/Icon/native/redesign/generated/StopIcon";
let contentWidth, useStyles, __initData, __initData2, __initData3, __initData4, __initData5, ScreenRecordingPip;
const DraggableContainer = function DraggableContainer(props) {
let callback;
const r14 = props.x;
let c21398_0 = r14;
const r13 = props.y;
let c21398_1 = r13;
const { contentWidth: contentWidth2, contentHeight, dragBoundsPadding = 0 } = props;
let c21398_4 = dragBoundsPadding;
const { onChangePosition, children } = props;
callback = void 0;
const styles = useStyles();
const sharedValue = useSharedValue(r14.get());
const sharedValue2 = useSharedValue(r13.get());
const safeAreaInsetsSharedValue_native = useSafeAreaInsetsSharedValue_native();
let c21398_8 = safeAreaInsetsSharedValue_native;
const windowDimensionsSharedValue_native = useWindowDimensionsSharedValue_native();
let c21398_9 = windowDimensionsSharedValue_native;
const C = function C(a0, a1) {
const r13 = c21398_9.get();
const { width, height } = r13;
const r7 = c21398_8.get();
const left = r7.left;
return {
x: _ReanimatedRexport.clamp(a0, left + c21398_4, width - r7.right - contentWidth2 - c21398_4),
y: _ReanimatedRexport.clamp(a1, r7.top + c21398_4, height - r7.bottom - contentHeight - c21398_4)
};
};
C.__closure = {
windowDimensionsSharedValue: windowDimensionsSharedValue_native,
insetsSharedValue: safeAreaInsetsSharedValue_native,
clamp: _ReanimatedRexport.clamp,
dragBoundsPadding,
contentWidth: contentWidth2,
contentHeight
};
C.__workletHash = 5314404716267;
C.__initData = __initData;
callback = useCallback(C, [contentHeight, contentWidth2, dragBoundsPadding, safeAreaInsetsSharedValue_native, windowDimensionsSharedValue_native]);
const r49 = Gesture.Pan();
const X = function X() {
sharedValue.set(c21398_0.get());
sharedValue2.set(c21398_1.get());
};
X.__closure = {
originalX: sharedValue,
x: r14,
originalY: sharedValue2,
y: r13
};
X.__workletHash = 7766704092529;
X.__initData = __initData4;
const r55 = r49.onStart(X);
const v = function v(a0) {
const r14 = callback(sharedValue.get() + a0.translationX, sharedValue2.get() + a0.translationY);
const { x: r15, y: r16 } = r14;
c21398_0.set(r15);
c21398_1.set(r16);
};
v.__closure = {
getClampedPosition: callback,
originalX: sharedValue,
originalY: sharedValue2,
x: r14,
y: r13
};
v.__workletHash = 3428194988690;
v.__initData = __initData3;
const r61 = r55.onUpdate(v);
const f = function f() {
_ReanimatedRexport.runOnJS(onChangePosition)({
x: c21398_0.get(),
y: c21398_1.get()
});
};
f.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
onChangePosition,
x: r14,
y: r13
};
f.__workletHash = 144401388839;
f.__initData = __initData2;
const gesture = r61.onEnd(f);
const b = function b() {
const r14 = callback(c21398_0.get(), c21398_1.get());
const { x: r9, y: r7 } = r14;
return {
transform: [{
translateX: _spring.withSpring(r9, _springPresets.springUnclamped)
}, {
translateY: _spring.withSpring(r7, _springPresets.springUnclamped)
}]
};
};
b.__closure = {
getClampedPosition: callback,
x: r14,
y: r13,
withSpring: _spring.withSpring,
springUnclamped: _springPresets.springUnclamped
};
b.__workletHash = 5273315246744;
b.__initData = __initData5;
return <GestureDetector gesture={gesture}>
<ReanimatedRexport.View style={[styles.widgetContainer, useAnimatedStyle(b)]}>{children}</ReanimatedRexport.View>
</GestureDetector>;
};
ScreenRecordingPip = function ScreenRecordingPip(props) {
let r107, props2;
let state, sharedValue3, sharedValue4;
const surveyConfig = props.surveyConfig;
state = void 0;
sharedValue3 = void 0;
sharedValue4 = void 0;
const styles = useStyles();
const windowDimensionsSharedValue_native = useWindowDimensionsSharedValue_native();
let c21399_0 = windowDimensionsSharedValue_native;
const safeAreaInsetsSharedValue_native = useSafeAreaInsetsSharedValue_native();
let c21399_1 = safeAreaInsetsSharedValue_native;
const screenRecordingStore3 = useScreenRecordingStore((a0) => a0.isRecording);
const screenRecordingStore2 = useScreenRecordingStore((a0) => a0.currentStep);
const screenRecordingStore = useScreenRecordingStore((a0) => a0.isUploading);
const isStepCompleted = surveyConfig.useIsStepCompleted(screenRecordingStore2);
let onChangePosition2;
[state, onChangePosition2] = useState(useCallback(() => {
const width = c21399_0.get().width;
const r10 = c21399_1.get();
return {
x: width - r10.right - contentWidth - Module712.space.PX_16,
y: r10.top + Module712.space.PX_16
};
}, [windowDimensionsSharedValue_native, safeAreaInsetsSharedValue_native]));
sharedValue3 = useSharedValue(state.x);
sharedValue4 = useSharedValue(state.y);
useEffect(() => {
sharedValue3.set(state.x);
sharedValue4.set(state.y);
}, [state.x, state.y, sharedValue3, sharedValue4]);
const callback2 = useCallback(() => {
ActionSheetActionCreators.openLazy(import("./ScreenRecordingActionSheet"), "ScreenRecordingActionSheet");
}, []);
let r60 = null;
if (screenRecordingStore3) {
const r68 = [<VEVOO x={sharedValue3} y={sharedValue4} />, ,];
const r91 = [<Text variant="text-xs/semibold" color="text-overlay-light" style={styles.stepText}>
{screenRecordingStore ? "Uploading..." : `Step ${screenRecordingStore2 + 1}`}
</Text>, ,];
if (screenRecordingStore) {
r107 = <Button loading text="" onPress={() => {}} />;
} else {
const r93 = {
style: null,
children: null
};
if (isStepCompleted) {
r93.style = styles.doneButton;
r93.children = <CheckmarkLargeIcon size="md" color="status-positive" />;
props2 = r93;
} else {
r93.style = styles.stopButton;
r93.children = <StopIcon size="md" color="text-feedback-critical" />;
props2 = r93;
}
r107 = <View {...props2} />;
}
r91[1] = r107;
r68[1] = <DraggableContainer x={sharedValue3} y={sharedValue4} contentWidth={contentWidth} contentHeight={contentWidth} dragBoundsPadding={Module712.space.PX_4} onChangePosition={onChangePosition2}>
<PressableOpacity style={styles.widget} accessibilityRole="button" onPress={callback2} activeOpacity={0.5}>{r91}</PressableOpacity>
</DraggableContainer>;
r60 = <>{r68}</>;
}
return r60;
};
contentWidth = 100;
useStyles = createStyles({
widgetContainer: {
position: "absolute"
},
widget: {
backgroundColor: Module712.colors.BACKGROUND_BRAND,
justifyContent: "center",
alignItems: "center",
height: 100,
width: 100,
gap: Module712.space.PX_8,
padding: Module712.space.PX_8,
borderRadius: Module712.radii.xl,
...Module712.shadows.SHADOW_MOBILE_NAVIGATOR_X
},
stepText: {
textAlign: "center",
maxWidth: 68
},
stopButton: {
padding: Module712.space.PX_8,
borderWidth: 1,
borderColor: Module712.colors.WHITE,
borderRadius: Module712.radii.round
},
doneButton: {
padding: Module712.space.PX_8
}
});
__initData = {
code: "function ScreenRecordingPipTsx1(x,y){const{windowDimensionsSharedValue,insetsSharedValue,clamp,dragBoundsPadding,contentWidth,contentHeight}=this.__closure;const{width:windowWidth,height:windowHeight}=windowDimensionsSharedValue.get();const insets=insetsSharedValue.get();return{x:clamp(x,insets.left+dragBoundsPadding,windowWidth-insets.right-contentWidth-dragBoundsPadding),y:clamp(y,insets.top+dragBoundsPadding,windowHeight-insets.bottom-contentHeight-dragBoundsPadding)};}"
};
__initData2 = {
code: "function ScreenRecordingPipTsx2(){const{runOnJS,onChangePosition,x,y}=this.__closure;runOnJS(onChangePosition)({x:x.get(),y:y.get()});}"
};
__initData3 = {
code: "function ScreenRecordingPipTsx3(event){const{getClampedPosition,originalX,originalY,x,y}=this.__closure;const{x:xClamped,y:yClamped}=getClampedPosition(originalX.get()+event.translationX,originalY.get()+event.translationY);x.set(xClamped);y.set(yClamped);}"
};
__initData4 = {
code: "function ScreenRecordingPipTsx4(){const{originalX,x,originalY,y}=this.__closure;originalX.set(x.get());originalY.set(y.get());}"
};
__initData5 = {
code: "function ScreenRecordingPipTsx5(){const{getClampedPosition,x,y,withSpring,springUnclamped}=this.__closure;const{x:translateX,y:translateY}=getClampedPosition(x.get(),y.get());return{transform:[{translateX:withSpring(translateX,springUnclamped)},{translateY:withSpring(translateY,springUnclamped)}]};}"
};
export default function ScreenRecordingPipConnected() {
const screenRecordingStore = useScreenRecordingStore((a0) => a0.currentSurveyConfig);
return screenRecordingStore != null ? <ScreenRecordingPip surveyConfig={screenRecordingStore} /> : null;
};
@@ -0,0 +1,60 @@
// Metro module 14846 (f14847).
import { create } from "../../../_bundle/Module644";
import { handleStopAndSend } from "./ScreenRecordingUtils";
const r15 = create((c21400_0, c21400_1) => ({
isRecording: false,
microphoneEnabled: false,
isUploading: false,
currentStep: 0,
stepStartedTime: null,
isCompleted: false,
currentSurveyId: null,
currentSurveyConfig: null,
startRecording: function startRecording(microphoneEnabled = false, currentSurveyId = null, currentSurveyConfig = null) {
return c21400_0({
isRecording: true,
microphoneEnabled,
currentSurveyId,
currentSurveyConfig,
stepStartedTime: Date.now()
});
},
stopRecording: () => c21400_0({
isRecording: false,
microphoneEnabled: false,
currentStep: 0,
stepStartedTime: null,
isCompleted: false
}),
setIsUploading: (a0) => c21400_0({
isUploading: a0
}),
nextStep: () => {
const r8 = c21400_1();
const currentStep = r8.currentStep + 1;
let r10 = r8.currentSurveyConfig?.steps;
if (r10 == null) {
r10 = [];
}
c21400_0(currentStep >= r10.length ? {
isCompleted: true
} : {
currentStep,
stepStartedTime: Date.now()
});
},
resetActionSheet: () => c21400_0({
currentStep: 0,
stepStartedTime: Date.now(),
isCompleted: false
}),
completeActionSheet: () => {
handleStopAndSend();
c21400_0({
currentStep: 0,
stepStartedTime: null,
isCompleted: false
});
}
}));
export { r15 as useScreenRecordingStore };
@@ -0,0 +1,535 @@
// Metro module 14847 (f14848).
import * as _Module17 from "react-native";
import { useScreenRecordingStore } from "./ScreenRecordingStore";
import AlertActionCreators from "../../../actions/AlertActionCreators";
import ScreenRecordingManager_ios from "./ScreenRecordingManager.ios";
import { getSurveyConfig } from "./StudyConfig";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import "../../../_bundle/asyncRequire";
import { fetchBugReportConfig, submitReport } from "../../bug_reporter/BugReportUtils";
import Upload, { UploadPlatform } from "../../../lib/uploader/Upload";
import { writeFile } from "../../../utils/FileManagerUtils.android";
import { getAttachments } from "../../bug_reporter/native/BugReportUtils";
import { getWindowDimensions } from "../../screen/useWindowDimensions.native";
function $mk116787($env) {
return (a0) => {
const r4 = $env;
const name = a0.name;
let r2 = name == null ? void 0 : name.toLowerCase().includes(r4[2].uploadConfig.featureName.toLowerCase());
if (!r2) {
const squad = a0.squad;
r2 = squad == null ? void 0 : squad.toLowerCase().includes(r4[2].uploadConfig.squadName.toLowerCase());
}
return r2;
};
}
function $mk116788($env) {
return function getLatestVideo() {
return $env[7].apply(this, arguments);
};
}
function $mk116793($env) {
return function startRecordingProcess() {
return $env[9].apply(this, arguments);
};
}
let DCDPhotos, c10489_6;
let env10489 = {};
env10489[7] = function _getLatestVideo() {
const r8 = async () => {
let r49;
let c27828_2;
let c27828_3 = 0;
let c30785_0, c30785_1;
let r10 = "Failed to get latest video from photo gallery, error: ";
try {
c30785_0 = void 0;
c27828_3 = 1;
const photos = await DCDPhotos.getPhotos({
first: 1,
groupTypes: "Recents",
assetType: "Videos",
include: ["filename", "fileSize", "playableDuration", "imageSize"]
});
r10 = "Failed to get latest video from photo gallery, error: ";
c30785_0 = photos;
r49 = c30785_0 ? c30785_0.edges ? c30785_0.edges.length > 0 ? c30785_0.edges[0] : null : null : null;
c27828_3 = 0;
} catch ($e) {
const r26 = $e;
let r7 = r26;
c27828_2 = r26;
if (c27828_3 !== 0) {
while (true) {
try {
const r68 = c27828_2;
c27828_3 = 0;
c30785_1 = r68;
AlertActionCreators.show({
title: "Error",
body: HermesInternal.concat.call(r10, c30785_1)
});
} catch (r64) {
r7 = r64;
c27828_2 = r64;
if (c27828_3 === 0) {
break;
}
continue;
}
return null;
}
}
throw r7;
}
return r49;
};
env10489[7] = r8;
return r8.apply(this, arguments);
};
env10489[8] = function _checkAndRequestPermissions() {
const r8 = async () => {
let r66;
let c27829_2;
let c27829_3 = 0;
let c30786_0, c30786_1;
try {
c30786_0 = void 0;
c27829_3 = 1;
c30786_0 = await ScreenRecordingManager_ios.requestPermissions();
if (c30786_0.photosGranted) {
const r58 = !!c30786_0.microphoneGranted;
if (r58) {
r66 = r58;
c27829_3 = 0;
} else {
AlertActionCreators.show({
title: "Error",
body: "Microphone permission is required to record audio"
});
r66 = 0;
c27829_3 = 0;
}
} else {
AlertActionCreators.show({
title: "Error",
body: "Photos permission is required to save recordings"
});
r66 = false;
c27829_3 = 0;
}
} catch ($e) {
const r26 = $e;
let r7 = r26;
c27829_2 = r26;
if (c27829_3 !== 0) {
while (true) {
try {
const r84 = c27829_2;
c27829_3 = 0;
c30786_1 = r84;
AlertActionCreators.show({
title: "Error",
body: `Failed to check permissions, error: ${c30786_1}`
});
} catch (r80) {
r7 = r80;
c27829_2 = r80;
if (c27829_3 === 0) {
break;
}
continue;
}
return false;
}
}
throw r7;
}
return r66;
};
env10489[8] = r8;
return r8.apply(this, arguments);
};
env10489[9] = function _startRecordingProcess() {
const r8 = async (c27830_0) => {
let r102;
let c27830_3;
let c27830_4 = 0;
let c30787_0, c30787_1, c30787_2, c30787_3;
L14: {
try {
c30787_0 = c27830_0;
c30787_1 = void 0;
c30787_2 = void 0;
c27830_4 = 1;
c30787_1 = await ScreenRecordingManager_ios.startRecording();
if (c30787_1.success) {
c30787_2 = c30787_0 !== void 0 ? getSurveyConfig(c30787_0) : null;
useScreenRecordingStore.getState().startRecording(c30787_1.microphoneEnabled, c30787_0, c30787_2);
useScreenRecordingStore.getState().resetActionSheet();
ActionSheetActionCreators.openLazy(import("./ScreenRecordingActionSheet"), "ScreenRecordingActionSheet");
r102 = {
success: true,
microphoneEnabled: c30787_1.microphoneEnabled
};
c27830_4 = 0;
break L14;
}
AlertActionCreators.show({
title: "Error",
body: "Failed to start screen recording"
});
c27830_4 = 0;
} catch ($e) {
const r31 = $e;
let r7 = r31;
c27830_3 = r31;
if (c27830_4 !== 0) {
while (true) {
try {
const r118 = c27830_3;
c27830_4 = 0;
c30787_3 = r118;
AlertActionCreators.show({
title: "Error",
body: `Failed to start screen recording, error: ${c30787_3}`
});
useScreenRecordingStore.getState().stopRecording();
} catch (r114) {
r7 = r114;
c27830_3 = r114;
if (c27830_4 === 0) {
break;
}
continue;
}
return {
success: false
};
}
}
throw r7;
}
return {
success: false
};
}
return r102;
};
env10489[9] = r8;
return r8.apply(this, arguments);
};
env10489[10] = function _stopRecordingProcess() {
const r8 = async () => {
let r54;
let c27831_2;
let c27831_3 = 0;
let c30788_0;
try {
c27831_3 = 1;
r54 = !!(await ScreenRecordingManager_ios.stopRecording()).success;
if (r54) {
c27831_3 = 0;
} else {
AlertActionCreators.show({
title: "Error",
body: "Failed to stop screen recording, but not error"
});
r54 = false;
c27831_3 = 0;
}
} catch ($e) {
const r27 = $e;
let r7 = r27;
c27831_2 = r27;
if (c27831_3 !== 0) {
while (true) {
try {
const r69 = c27831_2;
c27831_3 = 0;
c30788_0 = r69;
AlertActionCreators.show({
title: "Error",
body: `Failed to stop screen recording, error: ${c30788_0}`
});
useScreenRecordingStore.getState().stopRecording();
} catch (r66) {
r7 = r66;
c27831_2 = r66;
if (c27831_3 === 0) {
break;
}
continue;
}
return false;
}
}
throw r7;
}
return r54;
};
env10489[10] = r8;
return r8.apply(this, arguments);
};
env10489[11] = function _submitBugReportWithScreenRecording() {
const r8 = async (c27832_0, c27832_1) => {
let r273;
let id, c27832_3, feature, c27832_5, c27832_6, c27832_7;
let c27832_8 = 0;
const r21 = env10489;
L48: {
L45: {
L47: {
L46: {
try {
let env30789;
c27832_6 = r21;
const r27 = env30789 = {
$parent: r21
};
c27832_5 = r27;
env30789[0] = c27832_0;
env30789[1] = c27832_1;
env30789[2] = void 0;
env30789[3] = void 0;
env30789[4] = void 0;
env30789[5] = void 0;
env30789[6] = void 0;
env30789[7] = void 0;
env30789[8] = void 0;
env30789[9] = void 0;
env30789[10] = void 0;
env30789[11] = void 0;
env30789[12] = void 0;
env30789[13] = void 0;
env30789[14] = void 0;
c27832_8 = 1;
const currentSurveyId = useScreenRecordingStore.getState().currentSurveyId;
if (currentSurveyId != null && currentSurveyId !== "") {
const surveyConfig = getSurveyConfig(currentSurveyId);
env30789[2] = surveyConfig;
if (surveyConfig == null) {
AlertActionCreators.show({
title: "Submission Failed",
body: "Survey configuration not found"
});
c27832_8 = 0;
break L47;
}
env30789[3] = (await fetchBugReportConfig()).features.find($mk116787(c27832_5));
env30789[4] = [];
env30789[5] = await $mk116788(env10489)();
if (env30789[5] != null) {
const id2 = env30789[5].node.id;
id = id2;
if (id2 == null) {
id = env30789[5].node.image.uri;
}
env30789[6] = new Upload({
id,
uri: env30789[5].node.image.uri,
originalUri: env30789[5].node.image.uri,
mimeType: env30789[5].node.image.mimeType,
width: env30789[5].node.image.width,
height: env30789[5].node.image.height,
filename: env30789[5].node.image.filename,
playableDuration: env30789[5].node.image.playableDuration,
platform: UploadPlatform.REACT_NATIVE
});
env30789[4].push(env30789[6]);
}
if (env30789[1] != null) {
if (env30789[1] !== "") {
const r221 = env30789[1].split("/").pop();
c27832_3 = r221;
if (r221 == null) {
c27832_3 = `audio_${Date.now()}.wav`;
}
env30789[7] = c27832_3;
env30789[8] = new Upload({
id: `audio_${Date.now()}`,
uri: `file://${env30789[1]}`,
originalUri: `file://${env30789[1]}`,
mimeType: "audio/wav",
filename: env30789[7],
platform: UploadPlatform.REACT_NATIVE
});
env30789[4].push(env30789[8]);
}
}
if (env30789[0] !== void 0 && env30789[0].length > 0) {
env30789[9] = (function formatTranscription(a0) {
return JSON.stringify({
generated: new Date().toISOString(),
totalSegments: a0.length,
segments: a0.map((item) => ({
text: item.text,
startTime: item.startTime,
duration: item.duration
}))
}, null, 2);
})(env30789[0]);
env30789[10] = `transcription_${Date.now()}.json`;
env30789[11] = await writeFile("cache", env30789[10], env30789[9], "utf8");
if (env30789[11] != null) {
if (env30789[11] !== "") {
env30789[12] = new Upload({
id: `transcription_${Date.now()}`,
uri: env30789[11],
originalUri: env30789[11],
mimeType: "application/json",
filename: env30789[10],
platform: UploadPlatform.REACT_NATIVE
});
env30789[4].push(env30789[12]);
}
}
r273 = getAttachments(env30789[4]);
} else {
r273 = getAttachments(env30789[4]);
}
env30789[13] = await r273;
if (env30789[13] == null) {
AlertActionCreators.show({
title: "Submission Failed",
body: "Something went wrong and there's no way to fix it. Thanks anyway!"
});
c27832_8 = 0;
break L46;
}
feature = env30789[3];
if (feature == null) {
feature = {
name: env30789[2].uploadConfig.featureName,
squad: env30789[2].uploadConfig.squadName,
asana_inbox_id: void 0
};
}
env30789[14] = {
name: env30789[2].uploadConfig.reportTitle,
description: env30789[2].uploadConfig.reportDescription,
priority: env30789[2].uploadConfig.priority,
feature,
url: ""
};
if ((await submitReport(env30789[14], {
overridePlatformInformation: false
}, env30789[13])).ok) {
AlertActionCreators.show({
title: env30789[2].uploadConfig.successTitle,
body: env30789[2].uploadConfig.successMessage
});
} else {
AlertActionCreators.show({
title: "Submission Failed",
body: "Something went wrong and there's no way to fix it. Thanks anyway!"
});
}
c27832_8 = 0;
break L45;
}
AlertActionCreators.show({
title: "Submission Failed",
body: "No survey selected"
});
c27832_8 = 0;
break L48;
} catch ($e) {
const r50 = $e;
let r7 = r50;
c27832_7 = r50;
if (c27832_8 !== 0) {
while (true) {
try {
c27832_8 = 0;
AlertActionCreators.show({
title: "Submission Failed",
body: "Something went wrong and there's no way to fix it. Thanks anyway!"
});
break L45;
} catch (r499) {
r7 = r499;
c27832_7 = r499;
if (c27832_8 === 0) {
break;
}
}
}
}
throw r7;
}
}
return void 0;
}
return void 0;
}
return void 0;
}
};
env10489[11] = r8;
return r8.apply(this, arguments);
};
const { NativeModules, NativeEventEmitter } = _Module17;
DCDPhotos = NativeModules.DCDPhotos;
c10489_6 = new NativeEventEmitter(NativeModules.DCDScreenRecordingManager);
export async function handleStopAndSend(c27833_0) {
let c30790_0 = c27833_0;
let c30790_1 = c10489_6.addListener("ScreenRecordingPreviewFinished", (a0) => {
c30790_1.remove();
if (a0.saved) {
setTimeout(async () => {
let c32062_0;
c32062_0 = void 0;
if (c30790_0 != null) {
c30790_0();
}
await (function submitBugReportWithScreenRecording() {
return env10489[11].apply(this, arguments);
})(a0.timestampedTranscription, a0.audioFilePath);
useScreenRecordingStore.getState().setIsUploading(false);
useScreenRecordingStore.getState().stopRecording();
}, 1000);
} else {
AlertActionCreators.show({
title: "Recording Not Sent",
body: a0.action === "cancelled" ? "Recording was cancelled and not saved." : "Recording was shared but not saved to Photos, so it cannot be sent."
});
}
});
useScreenRecordingStore.getState().setIsUploading(true);
await (function stopRecordingProcess() {
return env10489[10].apply(this, arguments);
})();
}
export async function handleRecordingPhase(c27834_0) {
let env30791;
const r28 = env10489;
let c27834_2 = r28;
const r11 = env30791 = {
$parent: r28
};
let c27834_1 = r11;
env30791[0] = c27834_0;
env30791[1] = void 0;
env30791[2] = void 0;
env30791[3] = void 0;
env30791[4] = void 0;
env30791[5] = void 0;
env30791[1] = await (function checkAndRequestPermissions() {
return env10489[8].apply(this, arguments);
})();
if (env30791[1]) {
env30791[2] = getWindowDimensions();
env30791[3] = env30791[2].width;
env30791[4] = env30791[2].height;
await ScreenRecordingManager_ios.setRecordingQuality({
width: env30791[3],
height: env30791[4],
bitrate: 50000,
frameRate: 15
});
const r79 = env30791[0];
env30791[5] = await $mk116793(env10489)(r79);
env30791[5].success;
}
}
@@ -0,0 +1,28 @@
// Metro module 14849 (f14850).
let c10491_0 = {};
export { c10491_0 as SURVEY_CONFIGS };
export function getSurveyConfig(a0) {
let r4 = c10491_0[a0];
if (r4 == null) {
r4 = null;
}
return r4;
}
export function getSurveyConfigSafe(a0) {
const r1 = a0 == null;
let r2 = null;
if (!r1) {
r2 = null;
if (a0 !== "") {
let r7 = c10491_0[a0];
if (r7 == null) {
r7 = null;
}
r2 = r7;
}
}
return r2;
}
export function getAvailableSurveys() {
return Object.values(c10491_0).filter((item) => item.predicate());
}