(t0)
| 35 | }; |
| 36 | const HasAppStateContext = React.createContext<boolean>(false); |
| 37 | export function AppStateProvider(t0) { |
| 38 | const $ = _c(13); |
| 39 | const { |
| 40 | children, |
| 41 | initialState, |
| 42 | onChangeAppState |
| 43 | } = t0; |
| 44 | const hasAppStateContext = useContext(HasAppStateContext); |
| 45 | if (hasAppStateContext) { |
| 46 | throw new Error("AppStateProvider can not be nested within another AppStateProvider"); |
| 47 | } |
| 48 | let t1; |
| 49 | if ($[0] !== initialState || $[1] !== onChangeAppState) { |
| 50 | t1 = () => createStore(initialState ?? getDefaultAppState(), onChangeAppState); |
| 51 | $[0] = initialState; |
| 52 | $[1] = onChangeAppState; |
| 53 | $[2] = t1; |
| 54 | } else { |
| 55 | t1 = $[2]; |
| 56 | } |
| 57 | const [store] = useState(t1); |
| 58 | let t2; |
| 59 | if ($[3] !== store) { |
| 60 | t2 = () => { |
| 61 | const { |
| 62 | toolPermissionContext |
| 63 | } = store.getState(); |
| 64 | if (toolPermissionContext.isBypassPermissionsModeAvailable && isBypassPermissionsModeDisabled()) { |
| 65 | logForDebugging("Disabling bypass permissions mode on mount (remote settings loaded before mount)"); |
| 66 | store.setState(_temp); |
| 67 | } |
| 68 | }; |
| 69 | $[3] = store; |
| 70 | $[4] = t2; |
| 71 | } else { |
| 72 | t2 = $[4]; |
| 73 | } |
| 74 | let t3; |
| 75 | if ($[5] === Symbol.for("react.memo_cache_sentinel")) { |
| 76 | t3 = []; |
| 77 | $[5] = t3; |
| 78 | } else { |
| 79 | t3 = $[5]; |
| 80 | } |
| 81 | useEffect(t2, t3); |
| 82 | let t4; |
| 83 | if ($[6] !== store.setState) { |
| 84 | t4 = source => applySettingsChange(source, store.setState); |
| 85 | $[6] = store.setState; |
| 86 | $[7] = t4; |
| 87 | } else { |
| 88 | t4 = $[7]; |
| 89 | } |
| 90 | const onSettingsChange = useEffectEvent(t4); |
| 91 | useSettingsChange(onSettingsChange); |
| 92 | let t5; |
| 93 | if ($[8] !== children) { |
| 94 | t5 = <MailboxProvider><VoiceProvider>{children}</VoiceProvider></MailboxProvider>; |
nothing calls this directly
no test coverage detected