(t0)
| 43 | * - Transforming options to Select-compatible format |
| 44 | */ |
| 45 | export function PermissionPrompt(t0) { |
| 46 | const $ = _c(54); |
| 47 | const { |
| 48 | options, |
| 49 | onSelect, |
| 50 | onCancel, |
| 51 | question: t1, |
| 52 | toolAnalyticsContext |
| 53 | } = t0; |
| 54 | const question = t1 === undefined ? "Do you want to proceed?" : t1; |
| 55 | const setAppState = useSetAppState(); |
| 56 | const [acceptFeedback, setAcceptFeedback] = useState(""); |
| 57 | const [rejectFeedback, setRejectFeedback] = useState(""); |
| 58 | const [acceptInputMode, setAcceptInputMode] = useState(false); |
| 59 | const [rejectInputMode, setRejectInputMode] = useState(false); |
| 60 | const [focusedValue, setFocusedValue] = useState(null); |
| 61 | const [acceptFeedbackModeEntered, setAcceptFeedbackModeEntered] = useState(false); |
| 62 | const [rejectFeedbackModeEntered, setRejectFeedbackModeEntered] = useState(false); |
| 63 | let t2; |
| 64 | if ($[0] !== focusedValue || $[1] !== options) { |
| 65 | let t3; |
| 66 | if ($[3] !== focusedValue) { |
| 67 | t3 = opt => opt.value === focusedValue; |
| 68 | $[3] = focusedValue; |
| 69 | $[4] = t3; |
| 70 | } else { |
| 71 | t3 = $[4]; |
| 72 | } |
| 73 | t2 = options.find(t3); |
| 74 | $[0] = focusedValue; |
| 75 | $[1] = options; |
| 76 | $[2] = t2; |
| 77 | } else { |
| 78 | t2 = $[2]; |
| 79 | } |
| 80 | const focusedOption = t2; |
| 81 | const focusedFeedbackType = focusedOption?.feedbackConfig?.type; |
| 82 | const showTabHint = focusedFeedbackType === "accept" && !acceptInputMode || focusedFeedbackType === "reject" && !rejectInputMode; |
| 83 | let t3; |
| 84 | if ($[5] !== acceptInputMode || $[6] !== options || $[7] !== rejectInputMode) { |
| 85 | let t4; |
| 86 | if ($[9] !== acceptInputMode || $[10] !== rejectInputMode) { |
| 87 | t4 = opt_0 => { |
| 88 | const { |
| 89 | value, |
| 90 | label, |
| 91 | feedbackConfig |
| 92 | } = opt_0; |
| 93 | if (!feedbackConfig) { |
| 94 | return { |
| 95 | label, |
| 96 | value |
| 97 | }; |
| 98 | } |
| 99 | const { |
| 100 | type, |
| 101 | placeholder |
| 102 | } = feedbackConfig; |
nothing calls this directly
no test coverage detected