react-native-inapp-inspector 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +18 -18
- package/dist/commonjs/components/Inspector/ConsoleTab.js +12 -12
- package/dist/commonjs/components/Inspector/CrashTab.js +20 -20
- package/dist/commonjs/components/Inspector/NetworkTab.js +11 -11
- package/dist/commonjs/components/Inspector/PushTab.js +12 -12
- package/dist/commonjs/components/Inspector/ReduxTab.js +15 -15
- package/dist/commonjs/components/Inspector/StorageTab.js +16 -16
- package/dist/commonjs/components/LogCard.js +9 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/index.js +1 -1
- package/dist/esm/components/Inspector/AnalyticsTab.js +31 -31
- package/dist/esm/components/Inspector/ConsoleTab.js +31 -31
- package/dist/esm/components/Inspector/CrashTab.js +23 -23
- package/dist/esm/components/Inspector/NetworkTab.js +11 -11
- package/dist/esm/components/Inspector/PushTab.js +26 -26
- package/dist/esm/components/Inspector/ReduxTab.js +40 -40
- package/dist/esm/components/Inspector/StorageTab.js +51 -51
- package/dist/esm/components/LogCard.js +25 -22
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/index.js +3 -3
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import ee,{useEffect as re,useRef as oe,useMemo as te}from"react";import{Alert as ne,Animated as
|
|
1
|
+
import ee,{useEffect as re,useRef as oe,useMemo as te}from"react";import{Alert as ne,Animated as O,Linking as W,View as C,Pressable as M,Text as T,StyleSheet as A}from"react-native";import Ce,{Path as Te}from"react-native-svg";import{AppColors as e}from"../styles/AppColors";import{METHOD_COLORS as U}from"../constants";import{getStatusColor as Be,getDurationColor as Se,formatDateTime as Re,getSize as He,getPath as Ve,getBaseUrl as ze}from"../helpers";import{CalendarIcon as Ie,ClockIcon as E,SizeIcon as Le,CircleCheckIcon as $e,CircleAlertIcon as Oe,CircleXIcon as We,RepeatIcon as De,ForwardChevronIcon as Fe,GlobeIcon as Pe}from"./NetworkIcons";import{AppFonts as B}from"../styles/AppFonts";import Me from"./HighlightText";import Ae from"./TouchableScale";import{useTranslation as Ue}from"../i18n";const Ee=ee.memo(function({item:r,onPress:q,timelineMinStart:Ne,timelineTotalRange:Ge,isNew:L,isSelected:D,onToggleSelect:N,searchStr:G}){const{t:V}=Ue(),F=U[r.method]??U.ALL,R=te(()=>{try{const t=new URL(r.url),I=t.host,v=t.pathname+(t.search?t.search:""),Z=t.protocol==="https:";return{host:I,path:v||"/",isHttps:Z}}catch{const t=r.url.toLowerCase().startsWith("https:"),I=Ve(r.url);return{host:ze(r.url).replace(/^https?:\/\//,""),path:I||r.url,isHttps:t}}},[r.url]),J=t=>{t?.stopPropagation?.(),ne.alert(V("common.openInBrowser")||"Open in Browser",`${V("common.openInBrowserPrompt")||"Are you sure you want to open this URL in your external browser?"}
|
|
2
2
|
|
|
3
|
-
${r.url}`,[{text:V("common.cancel")||"Cancel",style:"cancel"},{text:V("common.open")||"Open",onPress:()=>{
|
|
4
|
-
<
|
|
3
|
+
${r.url}`,[{text:V("common.cancel")||"Cancel",style:"cancel"},{text:V("common.open")||"Open",onPress:()=>{W.canOpenURL(r.url).then(I=>{I?W.openURL(r.url):W.openURL(r.url).catch(()=>{})}).catch(()=>{})}}])},S=r.status===0||r.status!=null&&r.status>=400,H=r.status==null,$=Be(r.status),z=Se(r.duration),K=H?e.darkOrange:S?e.errorColor:e.greenColor,P=oe(new O.Value(L?.35:0)).current;re(()=>{L&&O.timing(P,{toValue:0,duration:1200,useNativeDriver:!1}).start()},[L]);const Q=()=>{if(H)return"...";if(r.status===0||r.status==null)return V("network.statusFailed")||"FAILED";const t=typeof r.status=="number"?r.status:parseInt(String(r.status||0),10);return t===200?"200 OK":t===201?"201 Created":t===204?"204 No Content":t===304?"304 Not Modified":t===400?"400 Bad Req":t===401?"401 Unauth":t===403?"403 Forbidden":t===404?"404 Not Found":t===500?"500 Error":String(r.status)},X=()=>{if(H)return<E color={e.darkOrange}size={10}/>;const t=typeof r.status=="number"?r.status:parseInt(String(r.status||0),10);return t>=200&&t<300?<$e color={e.greenColor}size={10}/>:t>=300&&t<400?<De color={e.amber700}size={10}/>:t>=400&&t<500?<Oe color={e.darkOrange}size={10}/>:<We color={e.errorColor}size={10}/>},_=Re(r.startTime),Y=r.url.split("?")[0].toLowerCase().endsWith(".json");return<C style={o.container}>
|
|
4
|
+
<Ae onPress={q}style={[o.card,{borderLeftWidth:3.5,borderLeftColor:K,backgroundColor:S?e.errorCardBg:e.white}]}>
|
|
5
5
|
<C style={o.cardBody}>
|
|
6
6
|
|
|
7
7
|
<C style={o.cardHeaderRow}>
|
|
8
8
|
<C style={o.cardHeaderLeft}>
|
|
9
|
-
<M onPress={()=>N(r.id)}hitSlop={12}style={[o.smallCheckbox,
|
|
10
|
-
{
|
|
9
|
+
<M onPress={()=>N(r.id)}hitSlop={12}style={[o.smallCheckbox,D&&o.smallCheckboxChecked]}>
|
|
10
|
+
{D&&<Ce width={9}height={9}viewBox="0 0 24 24"fill="none">
|
|
11
11
|
<Te d="M20 6L9 17l-5-5"stroke={e.white}strokeWidth="4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
12
|
</Ce>}
|
|
13
13
|
</M>
|
|
14
14
|
|
|
15
15
|
<T style={o.serialNumber}>#{r.id+1}</T>
|
|
16
16
|
|
|
17
|
-
<C style={[o.methodBadge,{backgroundColor:
|
|
17
|
+
<C style={[o.methodBadge,{backgroundColor:F}]}>
|
|
18
18
|
<T style={o.methodBadgeText}>
|
|
19
19
|
{r.method}
|
|
20
20
|
</T>
|
|
@@ -35,20 +35,23 @@ ${r.url}`,[{text:V("common.cancel")||"Cancel",style:"cancel"},{text:V("common.op
|
|
|
35
35
|
</C>
|
|
36
36
|
|
|
37
37
|
<C style={o.cardHeaderRight}>
|
|
38
|
-
<C style={[o.statusPill,{backgroundColor:S?`${e.errorColor}14`:
|
|
38
|
+
<C style={[o.statusPill,{backgroundColor:S?`${e.errorColor}14`:H?`${e.darkOrange}14`:`${$}14`,borderColor:S?`${e.errorColor}33`:H?`${e.darkOrange}33`:`${$}33`}]}>
|
|
39
39
|
{X()}
|
|
40
|
-
<T style={[o.statusPillText,{color:S?e.errorColor:
|
|
40
|
+
<T style={[o.statusPillText,{color:S?e.errorColor:H?e.darkOrange:$}]}>
|
|
41
41
|
{Q()}
|
|
42
42
|
</T>
|
|
43
43
|
</C>
|
|
44
|
-
<
|
|
44
|
+
<M onPress={J}hitSlop={8}style={o.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
|
|
45
|
+
<Pe color={e.grayTextWeak}size={12}/>
|
|
46
|
+
</M>
|
|
47
|
+
<Fe color={e.grayTextWeak}size={13}/>
|
|
45
48
|
</C>
|
|
46
49
|
</C>
|
|
47
50
|
|
|
48
51
|
|
|
49
|
-
<
|
|
52
|
+
<C style={o.urlBox}>
|
|
50
53
|
<C style={o.urlMainRow}>
|
|
51
|
-
<
|
|
54
|
+
<Me text={R.path}search={G}style={o.pathText}highlightStyle={o.highlight}numberOfLines={1}ellipsizeMode="middle"/>
|
|
52
55
|
<C style={o.urlBadgeRow}>
|
|
53
56
|
{Y&&<C style={o.jsonBadge}>
|
|
54
57
|
<T style={o.jsonBadgeText}>.json</T>
|
|
@@ -60,31 +63,31 @@ ${r.url}`,[{text:V("common.cancel")||"Cancel",style:"cancel"},{text:V("common.op
|
|
|
60
63
|
</C>
|
|
61
64
|
|
|
62
65
|
<C style={o.hostRow}>
|
|
63
|
-
<C style={[o.protoBadge,{backgroundColor:
|
|
64
|
-
<T style={[o.protoBadgeText,{color:
|
|
65
|
-
{
|
|
66
|
+
<C style={[o.protoBadge,{backgroundColor:R.isHttps?`${e.emerald600}12`:`${e.amber600}12`,borderColor:R.isHttps?`${e.emerald600}2B`:`${e.amber600}2B`}]}>
|
|
67
|
+
<T style={[o.protoBadgeText,{color:R.isHttps?e.emerald600:e.amber700}]}>
|
|
68
|
+
{R.isHttps?"HTTPS":"HTTP"}
|
|
66
69
|
</T>
|
|
67
70
|
</C>
|
|
68
71
|
<T style={o.hostText}numberOfLines={1}ellipsizeMode="tail">
|
|
69
|
-
{
|
|
72
|
+
{R.host||r.url}
|
|
70
73
|
</T>
|
|
71
74
|
</C>
|
|
72
|
-
</
|
|
75
|
+
</C>
|
|
73
76
|
|
|
74
77
|
|
|
75
78
|
<C style={o.cardFooterRow}>
|
|
76
79
|
<C style={o.footerLeft}>
|
|
77
80
|
<C style={o.cardDateRow}>
|
|
78
|
-
<
|
|
81
|
+
<Ie color={e.grayTextWeak}size={10}/>
|
|
79
82
|
<T style={o.cardDateText}numberOfLines={1}>{_}</T>
|
|
80
83
|
</C>
|
|
81
84
|
</C>
|
|
82
85
|
|
|
83
86
|
<C style={o.footerRight}>
|
|
84
87
|
{r.response!=null&&<C style={o.metaStatChip}>
|
|
85
|
-
<
|
|
88
|
+
<Le color={e.purple}size={9}/>
|
|
86
89
|
<T style={o.metaStatText}>
|
|
87
|
-
{
|
|
90
|
+
{He(r.response)}
|
|
88
91
|
</T>
|
|
89
92
|
</C>}
|
|
90
93
|
|
|
@@ -103,6 +106,6 @@ ${r.url}`,[{text:V("common.cancel")||"Cancel",style:"cancel"},{text:V("common.op
|
|
|
103
106
|
</C>
|
|
104
107
|
</C>
|
|
105
108
|
|
|
106
|
-
{
|
|
107
|
-
</
|
|
108
|
-
</C>}),o=A.create({container:{paddingHorizontal:8,paddingVertical:4,height:126,justifyContent:"center"},card:{height:118,alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:e.dividerColor,shadowColor:e.shadowColorString},cardBody:{height:"100%",paddingHorizontal:12,paddingTop:9,paddingBottom:7,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:8,gap:6,minWidth:0,overflow:"hidden"},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:0},smallCheckbox:{width:15,height:15,borderRadius:4,borderWidth:1.5,borderColor:e.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:e.white},smallCheckboxChecked:{backgroundColor:e.purple,borderColor:e.purple},serialNumber:{fontFamily:B.interBold,color:e.grayTextWeak,fontSize:10},methodBadge:{paddingHorizontal:7,paddingVertical:2.5,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:B.interBold,fontSize:9.5,lineHeight:12,letterSpacing:.5,color:e.white},chip:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},chipText:{fontFamily:B.interBold,fontSize:9,lineHeight:12},statusPill:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:2.5,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:B.interBold,fontSize:10,lineHeight:13},urlBox:{backgroundColor:e.grayBackground,borderRadius:7,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:9,paddingVertical:5,height:48,minHeight:48,maxHeight:48,justifyContent:"center",gap:3,overflow:"hidden"},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6},pathText:{fontFamily:B.interBold,fontSize:12,lineHeight:16,color:e.primaryBlack,flex:1},urlBadgeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},jsonBadge:{backgroundColor:`${e.darkOrange}14`,borderColor:`${e.darkOrange}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},jsonBadgeText:{fontFamily:B.interBold,fontSize:8.5,color:e.darkOrange},dupBadge:{backgroundColor:`${e.purple}14`,borderColor:`${e.purple}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},dupBadgeText:{fontFamily:B.interBold,fontSize:8.5,color:e.purple},hostRow:{flexDirection:"row",alignItems:"center",gap:5,minHeight:15},protoBadge:{paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5,borderWidth:1},protoBadgeText:{fontFamily:B.interBold,fontSize:8,lineHeight:10},hostText:{fontFamily:B.interMedium,fontSize:10,lineHeight:13,color:e.grayTextWeak,flex:1},highlight:{backgroundColor:e.yellowHighlight,color:e.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:6},footerLeft:{flexDirection:"row",alignItems:"center",gap:6,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3.5},cardDateText:{fontFamily:B.interRegular,fontSize:10,lineHeight:13,color:e.slate400},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:e.violetSoftBg,borderColor:e.violetSoftBorder,borderWidth:1,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:B.interBold,color:e.violetSoftText,fontSize:9,lineHeight:12},waterfallContainer:{height:2.5,width:"100%",backgroundColor:e.graySurface,borderRadius:1.5,overflow:"hidden",marginTop:2},waterfallBar:{height:"100%",borderRadius:1.5}});export default
|
|
109
|
+
{L&&<O.View pointerEvents="none"style={[A.absoluteFill,{backgroundColor:F,opacity:P}]}/>}
|
|
110
|
+
</Ae>
|
|
111
|
+
</C>}),o=A.create({container:{paddingHorizontal:8,paddingVertical:4,height:126,justifyContent:"center"},card:{height:118,alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:e.dividerColor,shadowColor:e.shadowColorString},cardBody:{height:"100%",paddingHorizontal:12,paddingTop:9,paddingBottom:7,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:8,gap:6,minWidth:0,overflow:"hidden"},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:0},smallCheckbox:{width:15,height:15,borderRadius:4,borderWidth:1.5,borderColor:e.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:e.white},smallCheckboxChecked:{backgroundColor:e.purple,borderColor:e.purple},serialNumber:{fontFamily:B.interBold,color:e.grayTextWeak,fontSize:10},methodBadge:{paddingHorizontal:7,paddingVertical:2.5,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:B.interBold,fontSize:9.5,lineHeight:12,letterSpacing:.5,color:e.white},chip:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},chipText:{fontFamily:B.interBold,fontSize:9,lineHeight:12},statusPill:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:2.5,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:B.interBold,fontSize:10,lineHeight:13},globeBtn:{padding:3,borderRadius:4,backgroundColor:`${e.grayTextWeak}12`,alignItems:"center",justifyContent:"center"},urlBox:{backgroundColor:e.grayBackground,borderRadius:7,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:9,paddingVertical:5,height:48,minHeight:48,maxHeight:48,justifyContent:"center",gap:3,overflow:"hidden"},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6},pathText:{fontFamily:B.interBold,fontSize:12,lineHeight:16,color:e.primaryBlack,flex:1},urlBadgeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},jsonBadge:{backgroundColor:`${e.darkOrange}14`,borderColor:`${e.darkOrange}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},jsonBadgeText:{fontFamily:B.interBold,fontSize:8.5,color:e.darkOrange},dupBadge:{backgroundColor:`${e.purple}14`,borderColor:`${e.purple}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},dupBadgeText:{fontFamily:B.interBold,fontSize:8.5,color:e.purple},hostRow:{flexDirection:"row",alignItems:"center",gap:5,minHeight:15},protoBadge:{paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5,borderWidth:1},protoBadgeText:{fontFamily:B.interBold,fontSize:8,lineHeight:10},hostText:{fontFamily:B.interMedium,fontSize:10,lineHeight:13,color:e.grayTextWeak,flex:1},highlight:{backgroundColor:e.yellowHighlight,color:e.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:6},footerLeft:{flexDirection:"row",alignItems:"center",gap:6,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3.5},cardDateText:{fontFamily:B.interRegular,fontSize:10,lineHeight:13,color:e.slate400},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:e.violetSoftBg,borderColor:e.violetSoftBorder,borderWidth:1,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:B.interBold,color:e.violetSoftText,fontSize:9,lineHeight:12},waterfallContainer:{height:2.5,width:"100%",backgroundColor:e.graySurface,borderRadius:1.5,overflow:"hidden",marginTop:2},waterfallBar:{height:"100%",borderRadius:1.5}});export default Ee;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.4.
|
|
1
|
+
export declare const LIB_VERSION = "2.4.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION="2.4.
|
|
1
|
+
export const LIB_VERSION="2.4.1";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Ot,{useEffect as i,useMemo as h,useRef as g,useState as o,useCallback as T}from"react";import{Alert as ue,Animated as c,Easing as yr,PanResponder as nn,Platform as _t,UIManager as on,LogBox as Cr}from"react-native";import{NavigationContext as an}from"@react-navigation/native";import{I18nextProvider as Cn,i18n as xn}from"./i18n";import Sn from"./components/ErrorBoundary";import Ln from"./components/Inspector/MainScreen";import{InspectorContext as bn,animateNextLayout as wn}from"./components/Inspector/InspectorContext";import{formatDisplayUrl as Rn,getNavigationInfo as xr,getLogPageName as Sr,deduplicateLogs as Bt,getDomainColor as vn,getEventCategory as An,matchNetworkLogQuery as Nn,setupMemoryWarningHandler as Mn}from"./helpers";import{loadSettings as Pn,saveSettings as Tn,setCustomStorage as En,clearPersistedSettings as In,calculateRamBasedLimits as Lr}from"./helpers/settingsStore";import{getNativeSystemMetrics as Dn,pushNativeLogRecord as Re,fetchNativeCachedPage as Fn}from"./native/NativeInspector";import{setupNetworkLogger as On,clearNetworkLogs as Vt,subscribeNetworkLogs as _n,setNetworkModuleEnabled as Bn,setMaxNetworkLogsLimit as Vn,setRouteInfoProvider as br}from"./customHooks/networkLogger";import{setupConsoleLogger as kn,clearConsoleLogs as wr,subscribeConsoleLogs as qn,setConsoleModuleEnabled as Hn}from"./customHooks/consoleLogger";import{IGNORED_LOG_PREFIXES as ce}from"./customHooks/logFilters";import{setupGlobalCrashHandler as Un,subscribeCrashEvents as jn,getCrashRecords as nt,clearCrashRecords as Rr,setMaxCrashLogsLimit as vr,setCrashModuleEnabled as zn}from"./customHooks/crashHandler";import{subscribePushEvents as $n,getPushRecords as Wn,clearPushRecords as Gn,setMaxPushRecordsLimit as Jn,simulateTestPush as Qn}from"./customHooks/pushNotificationLogger";import{trackActiveTelemetryHeartbeat as Xn,setTelemetryEnabled as Ar,trackInspectorTabView as Nr,trackInspectorScreenView as Yn}from"./helpers/telemetry";import{subscribeAnalyticsEvents as Zn,clearAnalyticsEvents as Mr,autoSetupAnalyticsLogger as Kn,isAnalyticsConnected as kt,setAnalyticsModuleEnabled as eo}from"./customHooks/analyticsLogger";import{getReduxState as qt,subscribeReduxState as to,setReduxAutoRefresh as so,getLastActionForReducer as Ht,clearActionHistory as ro,isReduxConnected as Ut,setReduxModuleEnabled as no}from"./customHooks/reduxLogger";import{hideNativeFloatingButton as ve,subscribeNativeFloatingButtonPress as oo,subscribeNativeDeviceShake as ao,isNativeModuleAvailable as io}from"./native/NativeInspector";import{fetchRemoteConfigModuleStatus as lo}from"./helpers/remoteConfig";import{ScreenCapture as uo}from"./capture";import{LIB_VERSION as co}from"./constants";import{toggleGlobalTheme as Pr}from"./styles";const Co=({enabled:N=!0,storage:B,navigationRef:b,appIcon:jt,environment:zt,initialVisible:Tr=!1,visible:Ae,remoteConfig:Ne})=>{En(B||null);const[Me,ot]=o(!1),[$t,Pe]=o(null),[Wt,Te]=o({}),[Ee,at]=o(90),[Ie,it]=o("slide"),[C,W]=o([]),[y,Q]=o(Ae??Tr??!1),[Gt,lt]=o(!1),Er=T(()=>{lt(!0),Q(!1)},[]);i(()=>{Ae!==void 0&&Q(Ae)},[Ae]);const[Jt,Qt]=o(!1),[p,ut]=o(null),[De,fe]=o(new Set),[X,Xt]=o(""),[Fe,Ir]=o("all"),[Oe,Dr]=o(!1),[_e,Fr]=o(!1),[E,Or]=o("all"),[Yt,ct]=o(""),[Zt,_r]=o(""),[Kt,ft]=o(null),[es,dt]=o(null),[ts,Br]=o("state"),[ss,rs]=o("response");i(()=>(Cr.ignoreAllLogs(N),()=>{Cr.ignoreAllLogs(!1)}),[N]),i(()=>{p&&(rs("response"),ct(""))},[p]);const[de,pt]=o(new Set),[pe,mt]=o(new Set),[ns,ht]=o({}),[gt,yt]=o(()=>new Map),[os,Ct]=o({}),[as,Vr]=o(!0),[Be,kr]=o("newest"),[Ve,qr]=o("newest"),[is,ls]=o(!0),[us,cs]=o(!0),[fs,ds]=o(!1),[ps,ms]=o(!1),[f,G]=o("apis"),[ke,Y]=o([]),[J,Z]=o([]),xt=g([]),St=g([]),Lt=g([]),[hs,bt]=o(null),[gs,ys]=o(0),[Cs,xs]=o(0),[Ss,Ls]=o(0),[bs,ws]=o(0),qe=T(async()=>{try{const t=await uo.getMediaList(),e=t?t.length:0;return ws(e),e}catch{return ws(0),0}},[]);i(()=>{y&&qe()},[y,qe]);const[me,V]=o(()=>nt()),[Rs,K]=o(null),[k,He]=o(50);i(()=>{vr(k)},[k]),i(()=>{y&&(f==="apis"&&xs(C.length),f==="logs"&&ys(J.length),f==="crash"&&Ls(me.length))},[y]),i(()=>{f==="apis"&&xs(C.length)},[f,C.length]),i(()=>{f==="logs"&&ys(J.length)},[f,J.length]),i(()=>{f==="crash"&&Ls(me.length)},[f,me.length]);const[q,vs]=o(()=>Wn()),[As,Ns]=o(null),[he,Hr]=o(""),[_,Ur]=o("all"),[Ue,jr]=o(0),[je,wt]=o(50);i(()=>{Jn(je)},[je]),i(()=>$n(e=>{vs(e)}),[]);const Ms=h(()=>f==="push"?0:Math.max(0,q.length-Ue),[f,q.length,Ue]);i(()=>{y&&f==="push"&&jr(q.length)},[y,f,q.length]);const Ps=h(()=>{let t=q;if(_!=="all"){if(_==="foreground")t=t.filter(e=>(e.appState||"").toLowerCase()==="foreground");else if(_==="background")t=t.filter(e=>(e.appState||"").toLowerCase()==="background");else if(_==="opened")t=t.filter(e=>e.action==="opened");else if(_.startsWith("source:")){const e=_.replace("source:","").toLowerCase();t=t.filter(r=>(r.source||"").toLowerCase()===e)}}if(he.trim()){const e=he.trim().toLowerCase();t=t.filter(r=>!!(r.title&&r.title.toLowerCase().includes(e)||r.body&&r.body.toLowerCase().includes(e)||r.id&&r.id.toLowerCase().includes(e)||r.source&&r.source.toLowerCase().includes(e)||r.domain&&r.domain.toLowerCase().includes(e)||r.channelId&&r.channelId.toLowerCase().includes(e)||r.data&&JSON.stringify(r.data).toLowerCase().includes(e)))}return t},[q,_,he]),[ee,ze]=o(300),[H,Rt]=o({info:!0,warn:!0,error:!0}),U=h(()=>J.filter(e=>{const r=e.type;if(r==="info"&&!H?.info||r==="warn"&&!H?.warn||r==="error"&&!H?.error)return!1;const s=e.message||"";return![...ce&&ce.info||[],...ce&&ce.warn||[],...ce&&ce.error||[]].filter(d=>typeof d=="string"&&d.trim().length>0).some(d=>s.toLowerCase().trim().startsWith(d.toLowerCase().trim())||s.toLowerCase().trim().includes(d.toLowerCase().trim()))}).slice(0,ee),[J,H,ee]),[I,Ts]=o(""),[D,Es]=o(new Set(["all"])),[Is,zr]=o(null),[Ds,$r]=o(!1),[Fs,Wr]=o("module"),[M,$e]=o({apis:!0,logs:!0,analytics:!1,redux:!1,crash:!1,push:!0,device:!1,storage:!1,debugging:!1,media:!0}),[te,We]=o(250),[se,Ge]=o(150),[re,vt]=o(!0),[At,Gr]=o(1800),[ne,Nt]=o(!0),[Je,Mt]=o(1),[j,Qe]=o("apis"),[z,Pt]=o(!1),[Tt,Et]=o(!0);i(()=>{Bn(!!M.apis),Hn(!!M.logs),eo(!!M.analytics),no(!!M.redux),zn(!!M.crash)},[M]),i(()=>{Dn().then(t=>{if(t){const e=t.totalPhysicalRamMb-t.residentRamMb,r=Math.max(200,Math.round(e>0?e:1500));if(Gr(r),re){const s=Lr(r);We(s.maxNetworkLogs),ze(s.maxConsoleLogs),Ge(s.maxAnalyticsEvents),He(s.maxCrashRecords),wt(s.maxPushRecords)}}}).catch(()=>{})},[re]);const Jr=async()=>{await In(),ot(!1),Pr(!1),at(90),it("slide"),$e({apis:!0,logs:!0,analytics:!1,redux:!1,crash:!1,push:!0,device:!1,storage:!1,debugging:!1,media:!0}),Qe("apis"),vt(!0);const t=Lr(At);He(t.maxCrashRecords),We(t.maxNetworkLogs),ze(t.maxConsoleLogs),Ge(t.maxAnalyticsEvents),wt(t.maxPushRecords),Rt({info:!0,warn:!0,error:!0}),Nt(!0),Mt(1),Pt(!1),Et(!0),ue.alert("Settings Reset","All settings have been reset to default values.")},Os=g(!1);i(()=>{let t=!1;return Pn().then(e=>{if(!t){if(e.isDark!=null&&(ot(e.isDark),Pr(e.isDark)),e.modalHeightPercent!=null&&at(e.modalHeightPercent),e.modalAnimationType&&it(e.modalAnimationType),e.tabVisibility&&$e(r=>({...r,...e.tabVisibility,apis:!0})),e.defaultTab&&Qe(e.defaultTab),e.isAutoRamLimitEnabled!=null&&vt(e.isAutoRamLimitEnabled),e.maxNetworkLogs!=null&&We(e.maxNetworkLogs),e.maxConsoleLogs!=null&&ze(e.maxConsoleLogs),e.maxAnalyticsEventsLimit!=null&&Ge(e.maxAnalyticsEventsLimit),e.maxCrashLogs!=null&&He(e.maxCrashLogs),e.showConsoleLevels&&Rt(e.showConsoleLevels),e.reduxAutoRefresh!=null&&Nt(e.reduxAutoRefresh),e.reduxExpandDepth!=null&&Mt(e.reduxExpandDepth),e.showDuplicateLogs!=null&&Pt(e.showDuplicateLogs),e.showUpdateToast!=null&&Et(e.showUpdateToast),e.defaultTab){const r=e.defaultTab,s={apis:!0,logs:!0,analytics:!1,redux:!1,crash:!1,device:!1,storage:!1,...e.tabVisibility||{},apis:!0};G(s[r]?r:"apis")}Os.current=!0}}),()=>{t=!0}},[]),i(()=>{let t=!0;if(Ne!==!1)return lo(typeof Ne=="object"?Ne:void 0).then(e=>{t&&e&&$e(r=>({...r,...e,apis:e.apis??!0}))}).catch(()=>{}),()=>{t=!1}},[Ne]),i(()=>{Os.current&&Tn({isDark:Me,modalHeightPercent:Ee,modalAnimationType:Ie,tabVisibility:M,defaultTab:j,maxNetworkLogs:te,maxConsoleLogs:ee,maxAnalyticsEventsLimit:se,maxCrashLogs:k,isAutoRamLimitEnabled:re,showConsoleLevels:H,reduxAutoRefresh:ne,reduxExpandDepth:Je,showDuplicateLogs:z,showUpdateToast:Tt})},[Me,Ee,Ie,M,j,te,ee,se,k,re,H,ne,Je,z]);const[ge,Qr]=o(null),_s=h(()=>{if(!ge)return!1;const t=s=>s.replace(/^v/,"").split(".").map(n=>parseInt(n,10)||0),e=t(co),r=t(ge);for(let s=0;s<3;s++){if((r[s]||0)>(e[s]||0))return!0;if((r[s]||0)<(e[s]||0))return!1}return!1},[ge]);i(()=>{if(typeof __DEV__>"u"||!__DEV__)return;let t=!1;return fetch("https://registry.npmjs.org/react-native-inapp-inspector/latest").then(e=>e.ok?e.json():null).then(e=>{!t&&e&&typeof e.version=="string"&&Qr(e.version)}).catch(()=>{}),()=>{t=!0}},[]),i(()=>{so(ne)},[ne]),i(()=>{f==="redux"&&!Ut()&&G("apis"),f==="analytics"&&!kt()&&G("apis")},[f]);const Bs=t=>{t!=="apis"&&(t==="redux"&&!Ut()||t==="analytics"&&!kt()||$e(e=>{const r=!e[t],s={...e,[t]:r};return!r&&f===t&&(wn(),G("apis")),!r&&j===t&&Qe("apis"),s}))},It=T(async(t,e="")=>{if(t==="apis"||t==="logs"||t==="analytics"||t==="crash"){const r=await Fn(t,0,100,e);r&&r.items&&r.items.length>0&&(t==="apis"?W(r.items):t==="logs"?Z(r.items):t==="analytics"?Y(r.items):t==="crash"&&V(r.items))}},[]),Vs=T(t=>{t==="redux"&&!Ut()||t==="analytics"&&!kt()||(ut(null),Xe(null),bt(null),ft(null),dt(null),K(null),typeof Ot.startTransition=="function"?Ot.startTransition(()=>{G(t),It(t)}):(G(t),It(t)),Nr(t))},[It]),[ks,Xe]=o(null),[oe,qs]=o(""),[a,Hs]=o({categories:new Set(["all"]),screens:new Set,sources:new Set(["all"]),userTypes:new Set(["all"]),timeWindow:"all",payloadComplexity:"all",hasRevenue:!1,hasItems:!1,hasUserProps:!1,hasParams:!1,onlyDuplicates:!1,onlyConversions:!1,sortBy:"time_desc"}),Us=h(()=>!!(a.categories.size>0&&!a.categories.has("all")||a.screens.size>0||a.sources.size>0&&!a.sources.has("all")||a.userTypes.size>0&&!a.userTypes.has("all")||a.timeWindow!=="all"||a.payloadComplexity!=="all"||a.hasRevenue||a.hasItems||a.hasUserProps||a.hasParams||a.onlyDuplicates||a.onlyConversions||a.sortBy!=="time_desc"),[a]),js=T(()=>{Hs({categories:new Set(["all"]),screens:new Set,sources:new Set(["all"]),userTypes:new Set(["all"]),timeWindow:"all",payloadComplexity:"all",hasRevenue:!1,hasItems:!1,hasUserProps:!1,hasParams:!1,onlyDuplicates:!1,onlyConversions:!1,sortBy:"time_desc"})},[]),[zs,Xr]=o(!1),[$s,Yr]=o(!1),[Ws,Gs]=o(new Set),ye=g(new Set),[Ye,Dt]=o(null),Js=Ot.useContext(an)!==void 0,F=g({path:"",params:null});i(()=>(br(()=>F.current),()=>{br(null)}),[]),i(()=>{if(Ye){const t=xr(Ye);t?.path&&(F.current=t)}},[Ye]),i(()=>{if(!b)return;const t=()=>{try{if(typeof b.isReady=="function"&&b.isReady()){const r=typeof b.getCurrentRoute=="function"?b.getCurrentRoute():null;r?.name&&(F.current={path:r.name,params:r.params||null});const s=b.getRootState();if(s){Dt(s);const n=xr(s);n?.path&&(F.current=n)}}}catch{}};t();const e=typeof b.addListener=="function"?b.addListener("state",()=>{t()}):null;return()=>{e&&e()}},[b]);const w=g(new Map),ae=g(new Set),[Qs,Xs]=o(new Set),Ce=g(new c.Value(1)).current,xe=g(new c.Value(.4)).current,Se=g(new c.Value(1)).current,Le=g(new c.Value(0)).current,be=g(new c.Value(0)).current,S=g(new c.ValueXY({x:0,y:0})).current,Ze=g({x:0,y:0});i(()=>{const t=S.x.addListener(r=>Ze.current.x=r.value),e=S.y.addListener(r=>Ze.current.y=r.value);return()=>{S.x.removeListener(t),S.y.removeListener(e)}},[S]);const Ke=g(!1),Ys=g(nn.create({onStartShouldSetPanResponder:()=>!1,onMoveShouldSetPanResponder:(t,e)=>Math.abs(e.dx)>4||Math.abs(e.dy)>4,onPanResponderGrant:()=>{Ke.current=!0,S.setOffset({x:Ze.current.x,y:Ze.current.y}),S.setValue({x:0,y:0})},onPanResponderMove:c.event([null,{dx:S.x,dy:S.y}],{useNativeDriver:!1}),onPanResponderRelease:()=>{S.flattenOffset(),setTimeout(()=>{Ke.current=!1},50)},onPanResponderTerminate:()=>{S.flattenOffset(),Ke.current=!1}})).current,Zs=T(()=>{c.sequence([c.timing(be,{toValue:1,duration:320,useNativeDriver:!1}),c.timing(be,{toValue:0,duration:0,useNativeDriver:!1})]).start(),Kr()},[be]);i(()=>{_t.OS==="android"&&on.setLayoutAnimationEnabledExperimental?.(!0)},[]),i(()=>{if(y)return;const t=c.loop(c.sequence([c.timing(Ce,{toValue:1.2,duration:800,useNativeDriver:!1}),c.timing(Ce,{toValue:1,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[Ce,y]),i(()=>{if(y)return;const t=c.loop(c.sequence([c.timing(Le,{toValue:1,duration:3200,easing:yr.inOut(yr.ease),useNativeDriver:!1}),c.delay(3500),c.timing(Le,{toValue:0,duration:0,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[Le,y]),i(()=>{const t=c.loop(c.sequence([c.timing(xe,{toValue:1,duration:1200,useNativeDriver:!1}),c.timing(xe,{toValue:.4,duration:1200,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[xe]),i(()=>{const t=c.loop(c.sequence([c.timing(Se,{toValue:1.3,duration:800,useNativeDriver:!1}),c.timing(Se,{toValue:.8,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[Se]);const Zr=h(()=>io(),[]),$=(_t.OS==="ios"||_t.OS==="android")&&Zr;i(()=>{$&&ve().catch(()=>{})},[$,y]),i(()=>{if(!$)return;const t=oo(()=>{ve().catch(()=>{}),Q(!0)});return()=>{t()}},[$]),i(()=>{if(!$)return;const t=ao(()=>{Q(e=>{const r=!e;return r&&ve().catch(()=>{}),r})});return()=>{t()}},[$]);const Ks=g(y);i(()=>{if(Ks.current=y,y){Yn("InspectorModal");const t=j==="apis"||M?.[j]?j:"apis";if(G(t),Nr(t),xt.current.length>0){const n=Bt(xt.current),u=new Set(n.map(d=>d.id));ae.current=u,W(n)}St.current.length>0&&Z(St.current),Lt.current.length>0&&Y(Lt.current);const e=qt();e&&(Pe(typeof e=="object"?{...e}:e),Te({...Ht()}));const r=nt();r.length>0&&V(r);const s=requestAnimationFrame(()=>{Qt(!0)});return()=>{cancelAnimationFrame(s)}}else Qt(!1),fe(new Set)},[y]),i(()=>{On(),Vt(),kn(),Kn(),Un();const t=Mn(),e=Ks,r=jn(l=>{if(l.message==="__CLEARED__"){V([]),K(null);return}const x=nt();x.length>0&&Re("crash",JSON.stringify(x[0])),e.current&&V(x)}),s=nt();s.length>0&&(s.forEach(l=>Re("crash",JSON.stringify(l))),V(s));let n,u=!0;const d=_n(l=>{if(xt.current=l,l.length>0&&Re("apis",JSON.stringify(l[0])),!e.current)return;clearTimeout(n);const x=()=>{const A=Bt(l),P=new Set(A.map(O=>O.id)),m=new Set;P.forEach(O=>{ae.current.has(O)||m.add(O)}),ae.current=P,m.size>0&&(m.forEach(O=>{if(!w.current.has(O)){const sn=A.find(rn=>rn.id===O)?.routeInfo||F.current;w.current.set(O,sn)}}),Xs(m),setTimeout(()=>Xs(new Set),1200)),W(A)};if(u){u=!1;const A=Bt(l),P=new Set(A.map(m=>m.id));ae.current=P,A.forEach(m=>{if(!w.current.has(m.id)){const O=m?.routeInfo||F.current;w.current.set(m.id,O)}}),W(A)}else n=setTimeout(x,250)});let L,we=!0;const Ft=Zn(l=>{if(Lt.current=l,l.length>0&&Re("analytics",JSON.stringify(l[0])),!e.current)return;clearTimeout(L);const x=()=>{const A=new Set(l.map(m=>m.id)),P=new Set;A.forEach(m=>{ye.current.has(m)||P.add(m)}),ye.current=A,P.size>0&&(P.forEach(m=>{w.current.has(m+1e6)||w.current.set(m+1e6,F.current)}),Gs(P),setTimeout(()=>Gs(new Set),1200)),Y(l)};if(we){we=!1;const A=new Set(l.map(P=>P.id));ye.current=A,Y(l)}else L=setTimeout(x,200)});let v,ie=!0;const st=qn(l=>{St.current=l,l.length>0&&Re("logs",JSON.stringify(l[0])),e.current&&(clearTimeout(v),ie?(ie=!1,Z(l)):v=setTimeout(()=>{Z(l)},200))}),le=qt();le&&(Pe(typeof le=="object"?{...le}:le),Te({...Ht()}));const rt=to(()=>{if(!e.current)return;const l=qt();Pe(l&&typeof l=="object"?{...l}:l),Te({...Ht()})});return()=>{d(),clearTimeout(n),Ft(),clearTimeout(L),st(),clearTimeout(v),rt(),r(),t()}},[]),i(()=>{Vn(te)},[te]),i(()=>{vr(k)},[k]),i(()=>{ls(!0),cs(!0),ds(!1),ms(!1),ct("")},[p]);const R=h(()=>{let t=C.filter(e=>{if(E&&E!=="all"){if(E==="errors"){if(!(e.status===0||e.status==null||typeof e.status=="number"&&e.status>=400))return!1}else if(E==="success"){if(!(typeof e.status=="number"&&e.status>=200&&e.status<400))return!1}else if(E==="slow"){if((e.duration||0)<500)return!1}else if(E==="graphql"){if(!((e.url||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("apollo")))return!1}else if(e.method?.toUpperCase()!==E.toUpperCase())return!1}if(de.size>0&&![...de].some(s=>{if(s==="ALL")return!0;if(s==="Failed")return e.status===0||e.status==null;const n=parseInt(s,10);return isNaN(n)?String(e.status)[0]===s[0]:Number(e.status)===n})||pe.size>0&&![...pe].some(s=>s==="ALL"?!0:e.method?.toUpperCase()===s))return!1;if(X&&X.trim().length>0){const r=w.current.get(e.id)?.path||"";if(!Nn(e,X,r,{scope:Fe,isRegex:Oe,isCaseSensitive:_e}))return!1}return!0});if(Be==="oldest"&&(t=[...t].reverse()),!z){const e=[];for(const r of t){const s=e[e.length-1];s&&s.method===r.method&&s.url===r.url&&s.status===r.status?e[e.length-1]={...s,duplicateCount:(s.duplicateCount||1)+1}:e.push({...r,duplicateCount:1})}t=e}return t},[C,X,Fe,Oe,_e,E,de,pe,Be,z]),er=h(()=>{const t=new Set;return C.forEach(e=>{e.method&&t.add(e.method.toUpperCase())}),["ALL",...Array.from(t)]},[C]),tr=T((t,e)=>{ht(r=>{const s=r[t]||new Set(["success","failed","loading"]),n=new Set(s);return n.has(e)?n.delete(e):n.add(e),{...r,[t]:n}})},[]),et=h(()=>{if(F.current?.path){const t=F.current.path.split(" \u2794 ").map(e=>e.trim()).filter(Boolean);return t.length>0?t[t.length-1]:F.current.path}if(R.length>0){const t=R[0],e=w.current.get(t.id)||t?.routeInfo;return Sr(t,e)}return""},[R,Ye]),sr=T(t=>{yt(e=>{const r=new Map(e),s=r.has(t)?r.get(t):t===et;return r.set(t,!s),r})},[et]),rr=T((t,e=50)=>{Ct(r=>({...r,[t]:(r[t]||50)+e}))},[]),nr=h(()=>{const t=[],e=new Map;for(let s=0;s<R.length;s++){const n=R[s],u=w.current.get(n.id)||n?.routeInfo,d=Sr(n,u);let L=e.get(d);L||(L={pageName:d,color:vn(d),logs:[]},e.set(d,L)),L.logs.push(n)}let r=0;return e.forEach(s=>{let n=0,u=0,d=0;s.logs.forEach(v=>{v.status==null?d++:v.status===0||v.status>=400?u++:n++});const L=ns[s.pageName]||new Set(["success","failed","loading"]),we=gt.has(s.pageName)?!gt.get(s.pageName):s.pageName!==et,Ft=s.logs[0]?.startTime||0;if(t.push({type:"header",id:`hdr-${s.pageName}`,pageName:s.pageName,color:s.color,stats:{success:n,failed:u,loading:d},timestamp:Ft,activeFilters:L,isCollapsed:we,isFirst:r===0}),r++,!we){const v=s.logs.filter(x=>x.status==null?L.has("loading"):x.status===0||x.status>=400?L.has("failed"):L.has("success")),ie=os[s.pageName]||50,st=v.slice(0,ie),le=v.length>ie;st.forEach(x=>{t.push({type:"log",id:`log-${x.id}`,log:x,isLast:!1,color:s.color})});const rt=Math.max(0,v.length-ie),l=Math.min(rt||50,50);t.push({type:"loadMore",id:`loadmore-${s.pageName}`,pageName:s.pageName,color:s.color,remainingCount:rt,totalCount:v.length,loadedCount:st.length,loadMoreStep:l,hasMore:le})}}),t},[R,C,ns,gt,et,os]),{minStart:or,totalRange:ar}=h(()=>{if(R.length===0)return{minStart:0,totalRange:0};const t=Math.min(...R.map(r=>r.startTime)),e=Math.max(...R.map(r=>r.startTime+(r.duration||10)));return{minStart:t,totalRange:e-t}},[R]),tt=h(()=>{if(!p)return null;const t=C.findIndex(e=>e.id===p.id);if(t===-1)return null;for(let e=t+1;e<C.length;e++){const r=C[e];if(r.url===p.url&&r.method===p.method)return r}return null},[p,C]),ir=tt?tt.request:null,lr=tt?tt.response:null,ur=h(()=>{let t=ke;if(oe&&oe.trim().length>0){const s=oe.trim().toLowerCase().split(/\s+/).filter(Boolean);t=t.filter(n=>{const u=[n.name||"",JSON.stringify(n.params||""),JSON.stringify(n.userProperties||""),n.screenName||"",n.pageTitle||"",n.userId||"",n.source||""].join(" ").toLowerCase();return s.every(d=>u.includes(d))})}if(a.categories.size>0&&!a.categories.has("all")&&(t=t.filter(s=>{const n=An(s.name);return a.categories.has(n)})),a.timeWindow!=="all"){const s=Date.now(),n=a.timeWindow==="1m"?s-60*1e3:a.timeWindow==="5m"?s-300*1e3:a.timeWindow==="15m"?s-900*1e3:s-3600*1e3;t=t.filter(u=>u.timestamp>=n)}if(a.sources.size>0&&!a.sources.has("all")&&(t=t.filter(s=>a.sources.has(s.source||"manual"))),a.userTypes.size>0&&!a.userTypes.has("all")&&(t=t.filter(s=>{const n=!!(s.userId&&s.userId.trim()!=="");return!!(a.userTypes.has("identified")&&n||a.userTypes.has("anonymous")&&!n)})),a.payloadComplexity!=="all"&&(a.payloadComplexity==="none"?t=t.filter(s=>!s.params||Object.keys(s.params).length===0):a.payloadComplexity==="simple"?t=t.filter(s=>s.params&&Object.keys(s.params).length<=3):a.payloadComplexity==="heavy"&&(t=t.filter(s=>s.params&&Object.keys(s.params).length>3))),a.onlyConversions){const s=["purchase","item_purchase","ecommerce_purchase","sign_up","login","lead","generate_lead","tutorial_complete","add_payment_info","begin_checkout","spend_virtual_currency"];t=t.filter(n=>s.some(u=>n.name.toLowerCase().includes(u)))}a.screens.size>0&&(t=t.filter(s=>{const n=s.screenName||s.params?.firebase_screen||s.params?.screen_name||s.params?.firebase_screen_class||s.screenClass||"";return a.screens.has(n)})),a.hasRevenue&&(t=t.filter(s=>s.params?.value!=null&&!isNaN(Number(s.params.value))||s.params?.price!=null&&!isNaN(Number(s.params.price)))),a.hasItems&&(t=t.filter(s=>Array.isArray(s.params?.items)&&s.params.items.length>0)),a.hasUserProps&&(t=t.filter(s=>s.userProperties&&Object.keys(s.userProperties).length>0)),a.hasParams&&(t=t.filter(s=>s.params&&Object.keys(s.params).length>0));const e=[];for(const s of t){if(e.length===0){e.push({...s,count:1});continue}const n=e[e.length-1];n.name===s.name&&JSON.stringify(n.params)===JSON.stringify(s.params)&&JSON.stringify(n.userProperties)===JSON.stringify(s.userProperties)?(n.count=(n.count||1)+1,n.timestamp=s.timestamp,n.id=s.id):e.push({...s,count:1})}let r=e;return a.onlyDuplicates&&(r=r.filter(s=>(s.count||1)>1)),a.sortBy==="time_asc"?r=[...r].sort((s,n)=>s.timestamp-n.timestamp):a.sortBy==="revenue_desc"?r=[...r].sort((s,n)=>{const u=Number(s.params?.value??s.params?.price??0);return Number(n.params?.value??n.params?.price??0)-u}):a.sortBy==="count_desc"&&(r=[...r].sort((s,n)=>(n.count||1)-(s.count||1))),r.slice(0,se)},[ke,oe,a,se]),cr=h(()=>{let t=U;if(D.size>0&&!D.has("all")&&(t=t.filter(e=>!!(D.has("user-log")&&e.sourceMethod==="log"||D.has("info")&&(e.sourceMethod==="info"||e.type==="info"&&e.sourceMethod!=="log")||D.has("warn")&&(e.type==="warn"||e.sourceMethod==="warn")||D.has("error")&&(e.type==="error"||e.sourceMethod==="error")||D.has("analytics")&&e.message?.toLowerCase().includes("[analytics error]")))),I&&I.trim().length>0){const e=I.trim().toLowerCase().split(/\s+/).filter(Boolean);t=t.filter(r=>{const s=[r.message||"",r.caller||"",r.type||"",r.sourceMethod||"",r.stack||""].join(" ").toLowerCase();return e.every(n=>n==="error"||n==="err"?r.type==="error"||s.includes(n):n==="warn"||n==="warning"?r.type==="warn"||s.includes(n):n==="info"&&r.type==="info"||s.includes(n))})}if(t=[...t].sort((e,r)=>Ve==="newest"?r.timestamp-e.timestamp:e.timestamp-r.timestamp),!z){const e=[];for(const r of t){const s=e[e.length-1];s&&s.type===r.type&&s.sourceMethod===r.sourceMethod&&s.message===r.message?e[e.length-1]={...s,duplicateCount:(s.duplicateCount||1)+1}:e.push({...r,duplicateCount:1})}t=e}return t},[U,D,I,Ve,z]),fr=h(()=>{let t=U;if(I&&I.trim().length>0){const r=I.trim().toLowerCase().split(/\s+/).filter(Boolean);t=U.filter(s=>{const n=[s.message||"",s.caller||"",s.type||"",s.sourceMethod||"",s.stack||""].join(" ").toLowerCase();return r.every(u=>u==="error"||u==="err"?s.type==="error"||n.includes(u):u==="warn"||u==="warning"?s.type==="warn"||n.includes(u):u==="info"&&s.type==="info"||n.includes(u))})}const e=U.length;return{all:`${t.length}/${e}`,info:`${t.filter(r=>r.sourceMethod==="info"||r.type==="info"&&r.sourceMethod!=="log").length}/${e}`,warn:`${t.filter(r=>r.type==="warn"||r.sourceMethod==="warn").length}/${e}`,error:`${t.filter(r=>r.type==="error"||r.sourceMethod==="error").length}/${e}`,"user-log":`${t.filter(r=>r.sourceMethod==="log").length}/${e}`,analytics:`${t.filter(r=>r.message.toLowerCase().includes("[analytics error]")).length}/${e}`}},[U,I]),dr=T(()=>{Q(!1),lt(!1),setTimeout(()=>{ut(null),Xe(null),bt(null),ft(null),dt(null),K(null)},300)},[]);function Kr(){Vt(),W([]),fe(new Set),ht({}),yt(new Map),Ct({}),pt(new Set),mt(new Set),Xt(""),ae.current=new Set,w.current=new Map,Mr(),Y([]),qs(""),ye.current=new Set,wr(),Z([]),Es(new Set(["all"])),Ts("")}function pr(){if(f==="logs"){ue.alert("Clear Logs","Are you sure you want to clear all console logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{wr(),Z([])},style:"destructive"}]);return}if(f==="analytics"){ue.alert("Clear Analytics","Are you sure you want to clear all analytics events?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{Mr(),Y([]),Xe(null),ye.current=new Set},style:"destructive"}]);return}if(f==="redux"){ue.alert("Clear Redux Timeline","Are you sure you want to clear the dispatched action history?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{ro(),Te({})},style:"destructive"}]);return}if(f==="crash"){ue.alert("Clear Crash History","Are you sure you want to clear all intercepted crash records?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{Rr(),V([]),K(null)},style:"destructive"}]);return}De.size>0?(W(t=>t.filter(e=>!De.has(e.id))),fe(new Set)):ue.alert("Clear Logs","Are you sure you want to clear all network logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:en,style:"destructive"}])}function en(){Vt(),W([]),fe(new Set),ht({}),yt(new Map),Ct({}),pt(new Set),mt(new Set),ae.current=new Set,w.current=new Map}const mr=h(()=>{if(!p)return"";try{const e=new URL(p.url).pathname.split("/").filter(Boolean);return e.length>0?`/${e.slice(-2).join("/")}`:"/"}catch{const t=p.url.split("/").filter(Boolean);return t.length>0?`/${t.slice(-2).join("/")}`:p.url}},[p]),hr=h(()=>p?Rn(p.url):"",[p]),gr=T(t=>{fe(e=>{const r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},[]),tn=h(()=>({visible:y,setVisible:Q,closeModal:dr,isMinimized:Gt,setIsMinimized:lt,minimizeInspector:Er,isReady:Jt,enabled:N,isEnabled:N,appIcon:jt,environment:zt,modalHeightPercent:Ee,setModalHeightPercent:at,modalAnimationType:Ie,setModalAnimationType:it,hasNavigationContext:Js,setNavState:Dt,activeTab:f,switchActiveTab:Vs,tabVisibility:M,toggleTabVisibility:Bs,lastReadApisCount:Cs,lastReadLogsCount:gs,mediaCount:bs,refreshMediaCount:qe,selected:p,setSelected:ut,selectedEvent:ks,setSelectedEvent:Xe,selectedLog:hs,setSelectedLog:bt,showHeaderInfo:as,setShowHeaderInfo:Vr,settingsPage:Is,setSettingsPage:zr,isAboutOpen:Ds,setIsAboutOpen:$r,updateAvailable:_s,latestNpmVersion:ge,clearAnim:be,activePulseAnim:xe,unreadPulseAnim:Se,runClearAllWithAnimation:Zs,useNativeFab:$,fabPan:S,fabPanResponder:Ys,fabDraggedRef:Ke,pulseAnim:Ce,fabShineAnim:Le,logs:C,filteredLogs:R,groupedData:nr,search:X,setSearch:Xt,searchScope:Fe,setSearchScope:Ir,isRegexSearch:Oe,setIsRegexSearch:Dr,isCaseSensitive:_e,setIsCaseSensitive:Fr,quickFilter:E,setQuickFilter:Or,statusFilters:de,setStatusFilters:pt,methodFilters:pe,setMethodFilters:mt,availableMethods:er,sortOrder:Be,setSortOrder:kr,selectedLogs:De,toggleSelect:gr,minStart:or,totalRange:ar,newLogIds:Qs,toggleSectionFilter:tr,toggleSectionCollapse:sr,loadMoreSection:rr,handleDelete:pr,detailTitle:mr,detailDisplayUrl:hr,apiDetailActiveTab:ss,setApiDetailActiveTab:rs,detailSearch:Yt,setDetailSearch:ct,reqExpanded:is,setReqExpanded:ls,resExpanded:us,setResExpanded:cs,showReqDiff:fs,setShowReqDiff:ds,showResDiff:ps,setShowResDiff:ms,prevRequestData:ir,prevResponseData:lr,logRouteMapRef:w,consoleLogs:J,visibleConsoleLogs:U,filteredConsoleLogs:cr,logSearch:I,setLogSearch:Ts,logFilters:D,setLogFilters:Es,logCounts:fr,logSortOrder:Ve,setLogSortOrder:qr,analyticsEvents:ke,filteredAnalyticsEvents:ur,analyticsSearch:oe,setAnalyticsSearch:qs,analyticsFilters:a,setAnalyticsFilters:Hs,isAnalyticsFilterApplied:Us,resetAnalyticsFilters:js,newEventIds:Ws,isAnalyticsLayoutReady:zs,setIsAnalyticsLayoutReady:Xr,analyticsHeaderExpanded:$s,setAnalyticsHeaderExpanded:Yr,reduxState:$t,setReduxState:Pe,reduxLastActionMap:Wt,reduxSearch:Zt,setReduxSearch:_r,selectedReduxSlice:Kt,setSelectedReduxSlice:ft,selectedReduxAction:es,setSelectedReduxAction:dt,reduxActiveSubTab:ts,setReduxActiveSubTab:Br,crashRecords:me,setCrashRecords:V,selectedCrash:Rs,setSelectedCrash:K,lastReadCrashesCount:Ss,maxCrashLogs:k,setMaxCrashLogs:He,clearAllCrashes:()=>{Rr(),V([]),K(null)},pushRecords:q,filteredPushRecords:Ps,selectedPush:As,setSelectedPush:Ns,pushSearch:he,setPushSearch:Hr,pushQuickFilter:_,setPushQuickFilter:Ur,lastReadPushCount:Ue,unreadPushCount:Ms,maxPushLogs:je,setMaxPushLogs:wt,clearAllPushLogs:()=>{Gn(),vs([]),Ns(null)},simulatePush:(t,e)=>{Qn(t,e)},settingsActiveSubTab:Fs,setSettingsActiveSubTab:Wr,defaultTab:j,setDefaultTab:Qe,isDark:Me,setIsDark:ot,showDuplicateLogs:z,setShowDuplicateLogs:Pt,showUpdateToast:Tt,setShowUpdateToast:Et,showConsoleLevels:H,setShowConsoleLevels:Rt,resetToDefaults:Jr,storage:B,maxNetworkLogs:te,setMaxNetworkLogs:We,maxConsoleLogs:ee,setMaxConsoleLogs:ze,maxAnalyticsEventsLimit:se,setMaxAnalyticsEventsLimit:Ge,isAutoRamLimitEnabled:re,setIsAutoRamLimitEnabled:vt,deviceFreeRamMb:At,reduxAutoRefresh:ne,setReduxAutoRefreshState:Nt,reduxExpandDepth:Je,setReduxExpandDepth:Mt}),[y,dr,Jt,N,jt,zt,Ee,Ie,Js,Dt,f,Vs,M,Bs,Cs,gs,bs,qe,p,ks,hs,as,Is,Ds,_s,ge,be,xe,Se,Zs,$,S,Ys,Ce,Le,C,R,nr,X,Fe,Oe,_e,E,de,pe,er,Be,De,gr,or,ar,Qs,tr,sr,rr,pr,mr,hr,ss,Yt,is,us,fs,ps,ir,lr,J,U,cr,I,D,fr,Ve,ke,ur,oe,a,Us,js,Ws,zs,$s,$t,Wt,Zt,Kt,es,ts,me,Rs,Ss,k,q,Ps,As,he,_,Ue,Ms,je,Fs,j,Me,z,Tt,H,B,te,ee,se,re,At,ne,Je,Gt]);return<bn.Provider value={tn}>
|
|
1
|
+
import Ot,{useEffect as i,useMemo as g,useRef as y,useState as o,useCallback as E}from"react";import{Alert as ce,Animated as c,Easing as yr,PanResponder as nn,Platform as _t,UIManager as on,LogBox as Cr}from"react-native";import{NavigationContext as an}from"@react-navigation/native";import{I18nextProvider as Cn,i18n as xn}from"./i18n";import Sn from"./components/ErrorBoundary";import Ln from"./components/Inspector/MainScreen";import{InspectorContext as bn,animateNextLayout as wn}from"./components/Inspector/InspectorContext";import{formatDisplayUrl as Rn,getNavigationInfo as xr,getLogPageName as Sr,deduplicateLogs as Bt,getDomainColor as vn,getEventCategory as An,matchNetworkLogQuery as Nn,setupMemoryWarningHandler as Mn}from"./helpers";import{loadSettings as Pn,saveSettings as Tn,setCustomStorage as En,clearPersistedSettings as In,calculateRamBasedLimits as Lr}from"./helpers/settingsStore";import{getNativeSystemMetrics as Dn,pushNativeLogRecord as Ne,fetchNativeCachedPage as Fn}from"./native/NativeInspector";import{setupNetworkLogger as On,clearNetworkLogs as Vt,subscribeNetworkLogs as _n,setNetworkModuleEnabled as Bn,setMaxNetworkLogsLimit as Vn,setRouteInfoProvider as br}from"./customHooks/networkLogger";import{setupConsoleLogger as kn,clearConsoleLogs as wr,subscribeConsoleLogs as qn,setConsoleModuleEnabled as Hn}from"./customHooks/consoleLogger";import{IGNORED_LOG_PREFIXES as fe}from"./customHooks/logFilters";import{setupGlobalCrashHandler as Un,subscribeCrashEvents as jn,getCrashRecords as nt,clearCrashRecords as Rr,setMaxCrashLogsLimit as vr,setCrashModuleEnabled as zn}from"./customHooks/crashHandler";import{subscribePushEvents as $n,getPushRecords as Wn,clearPushRecords as Gn,setMaxPushRecordsLimit as Jn,simulateTestPush as Qn}from"./customHooks/pushNotificationLogger";import{trackActiveTelemetryHeartbeat as Xn,setTelemetryEnabled as Ar,trackInspectorTabView as Nr,trackInspectorScreenView as Yn}from"./helpers/telemetry";import{subscribeAnalyticsEvents as Zn,clearAnalyticsEvents as Mr,autoSetupAnalyticsLogger as Kn,isAnalyticsConnected as kt,setAnalyticsModuleEnabled as eo}from"./customHooks/analyticsLogger";import{getReduxState as qt,subscribeReduxState as to,setReduxAutoRefresh as so,getLastActionForReducer as Ht,clearActionHistory as ro,isReduxConnected as Ut,setReduxModuleEnabled as no}from"./customHooks/reduxLogger";import{hideNativeFloatingButton as Me,subscribeNativeFloatingButtonPress as oo,subscribeNativeDeviceShake as ao,isNativeModuleAvailable as io}from"./native/NativeInspector";import{fetchRemoteConfigModuleStatus as lo}from"./helpers/remoteConfig";import{ScreenCapture as uo}from"./capture";import{LIB_VERSION as co}from"./constants";import{toggleGlobalTheme as Pr}from"./styles";const Co=({enabled:A=!0,storage:V,navigationRef:b,appIcon:jt,environment:zt,initialVisible:Tr=!1,visible:Pe,remoteConfig:Te})=>{En(V||null);const[Ee,ot]=o(!1),[$t,Ie]=o(null),[Wt,De]=o({}),[Fe,at]=o(90),[Oe,it]=o("slide"),[x,G]=o([]),[C,Z]=o(Pe??Tr??!1),[Gt,lt]=o(!1),Er=E(()=>{lt(!0),Z(!1)},[]);i(()=>{Pe!==void 0&&Z(Pe)},[Pe]);const[Jt,Qt]=o(!1),[m,ut]=o(null),[_e,de]=o(new Set),[J,Xt]=o(""),[pe,Ir]=o("all"),[me,Dr]=o(!1),[he,Fr]=o(!1),[N,Or]=o("all"),[Yt,ct]=o(""),[Zt,_r]=o(""),[Kt,ft]=o(null),[es,dt]=o(null),[ts,Br]=o("state"),[ss,rs]=o("response");i(()=>(Cr.ignoreAllLogs(A),()=>{Cr.ignoreAllLogs(!1)}),[A]),i(()=>{m&&(rs("response"),ct(""))},[m]);const[K,pt]=o(new Set),[ee,mt]=o(new Set),[ns,ht]=o({}),[gt,yt]=o(()=>new Map),[os,Be]=o({}),[as,Vr]=o(!0),[Ve,kr]=o("newest"),[ke,qr]=o("newest"),[is,ls]=o(!0),[us,cs]=o(!0),[fs,ds]=o(!1),[ps,ms]=o(!1),[f,Q]=o("apis"),[qe,te]=o([]),[X,se]=o([]),Ct=y([]),xt=y([]),St=y([]),[hs,Lt]=o(null),[gs,ys]=o(0),[Cs,xs]=o(0),[Ss,Ls]=o(0),[bs,ws]=o(0),He=E(async()=>{try{const t=await uo.getMediaList(),e=t?t.length:0;return ws(e),e}catch{return ws(0),0}},[]);i(()=>{C&&He()},[C,He]);const[ge,k]=o(()=>nt()),[Rs,re]=o(null),[q,Ue]=o(50);i(()=>{vr(q)},[q]),i(()=>{C&&(f==="apis"&&xs(x.length),f==="logs"&&ys(X.length),f==="crash"&&Ls(ge.length))},[C]),i(()=>{f==="apis"&&xs(x.length)},[f,x.length]),i(()=>{f==="logs"&&ys(X.length)},[f,X.length]),i(()=>{f==="crash"&&Ls(ge.length)},[f,ge.length]);const[H,vs]=o(()=>Wn()),[As,Ns]=o(null),[ye,Hr]=o(""),[_,Ur]=o("all"),[je,jr]=o(0),[ze,bt]=o(50);i(()=>{Jn(ze)},[ze]),i(()=>$n(e=>{vs(e)}),[]);const Ms=g(()=>f==="push"?0:Math.max(0,H.length-je),[f,H.length,je]);i(()=>{C&&f==="push"&&jr(H.length)},[C,f,H.length]);const Ps=g(()=>{let t=H;if(_!=="all"){if(_==="foreground")t=t.filter(e=>(e.appState||"").toLowerCase()==="foreground");else if(_==="background")t=t.filter(e=>(e.appState||"").toLowerCase()==="background");else if(_==="opened")t=t.filter(e=>e.action==="opened");else if(_.startsWith("source:")){const e=_.replace("source:","").toLowerCase();t=t.filter(r=>(r.source||"").toLowerCase()===e)}}if(ye.trim()){const e=ye.trim().toLowerCase();t=t.filter(r=>!!(r.title&&r.title.toLowerCase().includes(e)||r.body&&r.body.toLowerCase().includes(e)||r.id&&r.id.toLowerCase().includes(e)||r.source&&r.source.toLowerCase().includes(e)||r.domain&&r.domain.toLowerCase().includes(e)||r.channelId&&r.channelId.toLowerCase().includes(e)||r.data&&JSON.stringify(r.data).toLowerCase().includes(e)))}return t},[H,_,ye]),[ne,$e]=o(300),[U,wt]=o({info:!0,warn:!0,error:!0}),j=g(()=>X.filter(e=>{const r=e.type;if(r==="info"&&!U?.info||r==="warn"&&!U?.warn||r==="error"&&!U?.error)return!1;const s=e.message||"";return![...fe&&fe.info||[],...fe&&fe.warn||[],...fe&&fe.error||[]].filter(d=>typeof d=="string"&&d.trim().length>0).some(d=>s.toLowerCase().trim().startsWith(d.toLowerCase().trim())||s.toLowerCase().trim().includes(d.toLowerCase().trim()))}).slice(0,ne),[X,U,ne]),[I,Ts]=o(""),[D,Es]=o(new Set(["all"])),[Is,zr]=o(null),[Ds,$r]=o(!1),[Fs,Wr]=o("module"),[M,We]=o({apis:!0,logs:!0,analytics:!1,redux:!1,crash:!1,push:!0,device:!1,storage:!1,debugging:!1,media:!0}),[P,Ge]=o(250),[oe,Je]=o(150),[ae,Rt]=o(!0),[vt,Gr]=o(1800),[ie,At]=o(!0),[Qe,Nt]=o(1),[z,Xe]=o("apis"),[$,Mt]=o(!1),[Pt,Tt]=o(!0);i(()=>{Bn(!!M.apis),Hn(!!M.logs),eo(!!M.analytics),no(!!M.redux),zn(!!M.crash)},[M]),i(()=>{Dn().then(t=>{if(t){const e=t.totalPhysicalRamMb-t.residentRamMb,r=Math.max(200,Math.round(e>0?e:1500));if(Gr(r),ae){const s=Lr(r);Ge(s.maxNetworkLogs),$e(s.maxConsoleLogs),Je(s.maxAnalyticsEvents),Ue(s.maxCrashRecords),bt(s.maxPushRecords)}}}).catch(()=>{})},[ae]);const Jr=async()=>{await In(),ot(!1),Pr(!1),at(90),it("slide"),We({apis:!0,logs:!0,analytics:!1,redux:!1,crash:!1,push:!0,device:!1,storage:!1,debugging:!1,media:!0}),Xe("apis"),Rt(!0);const t=Lr(vt);Ue(t.maxCrashRecords),Ge(t.maxNetworkLogs),$e(t.maxConsoleLogs),Je(t.maxAnalyticsEvents),bt(t.maxPushRecords),wt({info:!0,warn:!0,error:!0}),At(!0),Nt(1),Mt(!1),Tt(!0),ce.alert("Settings Reset","All settings have been reset to default values.")},Os=y(!1);i(()=>{let t=!1;return Pn().then(e=>{if(!t){if(e.isDark!=null&&(ot(e.isDark),Pr(e.isDark)),e.modalHeightPercent!=null&&at(e.modalHeightPercent),e.modalAnimationType&&it(e.modalAnimationType),e.tabVisibility&&We(r=>({...r,...e.tabVisibility,apis:!0})),e.defaultTab&&Xe(e.defaultTab),e.isAutoRamLimitEnabled!=null&&Rt(e.isAutoRamLimitEnabled),e.maxNetworkLogs!=null&&Ge(e.maxNetworkLogs),e.maxConsoleLogs!=null&&$e(e.maxConsoleLogs),e.maxAnalyticsEventsLimit!=null&&Je(e.maxAnalyticsEventsLimit),e.maxCrashLogs!=null&&Ue(e.maxCrashLogs),e.showConsoleLevels&&wt(e.showConsoleLevels),e.reduxAutoRefresh!=null&&At(e.reduxAutoRefresh),e.reduxExpandDepth!=null&&Nt(e.reduxExpandDepth),e.showDuplicateLogs!=null&&Mt(e.showDuplicateLogs),e.showUpdateToast!=null&&Tt(e.showUpdateToast),e.defaultTab){const r=e.defaultTab,s={apis:!0,logs:!0,analytics:!1,redux:!1,crash:!1,device:!1,storage:!1,...e.tabVisibility||{},apis:!0};Q(s[r]?r:"apis")}Os.current=!0}}),()=>{t=!0}},[]),i(()=>{let t=!0;if(Te!==!1)return lo(typeof Te=="object"?Te:void 0).then(e=>{t&&e&&We(r=>({...r,...e,apis:e.apis??!0}))}).catch(()=>{}),()=>{t=!1}},[Te]),i(()=>{Os.current&&Tn({isDark:Ee,modalHeightPercent:Fe,modalAnimationType:Oe,tabVisibility:M,defaultTab:z,maxNetworkLogs:P,maxConsoleLogs:ne,maxAnalyticsEventsLimit:oe,maxCrashLogs:q,isAutoRamLimitEnabled:ae,showConsoleLevels:U,reduxAutoRefresh:ie,reduxExpandDepth:Qe,showDuplicateLogs:$,showUpdateToast:Pt})},[Ee,Fe,Oe,M,z,P,ne,oe,q,ae,U,ie,Qe,$]);const[Ce,Qr]=o(null),_s=g(()=>{if(!Ce)return!1;const t=s=>s.replace(/^v/,"").split(".").map(n=>parseInt(n,10)||0),e=t(co),r=t(Ce);for(let s=0;s<3;s++){if((r[s]||0)>(e[s]||0))return!0;if((r[s]||0)<(e[s]||0))return!1}return!1},[Ce]);i(()=>{if(typeof __DEV__>"u"||!__DEV__)return;let t=!1;return fetch("https://registry.npmjs.org/react-native-inapp-inspector/latest").then(e=>e.ok?e.json():null).then(e=>{!t&&e&&typeof e.version=="string"&&Qr(e.version)}).catch(()=>{}),()=>{t=!0}},[]),i(()=>{so(ie)},[ie]),i(()=>{f==="redux"&&!Ut()&&Q("apis"),f==="analytics"&&!kt()&&Q("apis")},[f]);const Bs=t=>{t!=="apis"&&(t==="redux"&&!Ut()||t==="analytics"&&!kt()||We(e=>{const r=!e[t],s={...e,[t]:r};return!r&&f===t&&(wn(),Q("apis")),!r&&z===t&&Xe("apis"),s}))},Et=E(async(t,e="")=>{if(t==="apis"||t==="logs"||t==="analytics"||t==="crash"){const r=await Fn(t,0,100,e);r&&r.items&&r.items.length>0&&(t==="apis"?G(r.items):t==="logs"?se(r.items):t==="analytics"?te(r.items):t==="crash"&&k(r.items))}},[]),Vs=E(t=>{t==="redux"&&!Ut()||t==="analytics"&&!kt()||(ut(null),Ye(null),Lt(null),ft(null),dt(null),re(null),typeof Ot.startTransition=="function"?Ot.startTransition(()=>{Q(t),Et(t)}):(Q(t),Et(t)),Nr(t))},[Et]),[ks,Ye]=o(null),[le,qs]=o(""),[a,Hs]=o({categories:new Set(["all"]),screens:new Set,sources:new Set(["all"]),userTypes:new Set(["all"]),timeWindow:"all",payloadComplexity:"all",hasRevenue:!1,hasItems:!1,hasUserProps:!1,hasParams:!1,onlyDuplicates:!1,onlyConversions:!1,sortBy:"time_desc"}),Us=g(()=>!!(a.categories.size>0&&!a.categories.has("all")||a.screens.size>0||a.sources.size>0&&!a.sources.has("all")||a.userTypes.size>0&&!a.userTypes.has("all")||a.timeWindow!=="all"||a.payloadComplexity!=="all"||a.hasRevenue||a.hasItems||a.hasUserProps||a.hasParams||a.onlyDuplicates||a.onlyConversions||a.sortBy!=="time_desc"),[a]),js=E(()=>{Hs({categories:new Set(["all"]),screens:new Set,sources:new Set(["all"]),userTypes:new Set(["all"]),timeWindow:"all",payloadComplexity:"all",hasRevenue:!1,hasItems:!1,hasUserProps:!1,hasParams:!1,onlyDuplicates:!1,onlyConversions:!1,sortBy:"time_desc"})},[]),[zs,Xr]=o(!1),[$s,Yr]=o(!1),[Ws,Gs]=o(new Set),xe=y(new Set),[Ze,It]=o(null),Js=Ot.useContext(an)!==void 0,F=y({path:"",params:null});i(()=>(br(()=>F.current),()=>{br(null)}),[]),i(()=>{if(Ze){const t=xr(Ze);t?.path&&(F.current=t)}},[Ze]),i(()=>{if(!b)return;const t=()=>{try{if(typeof b.isReady=="function"&&b.isReady()){const r=typeof b.getCurrentRoute=="function"?b.getCurrentRoute():null;r?.name&&(F.current={path:r.name,params:r.params||null});const s=b.getRootState();if(s){It(s);const n=xr(s);n?.path&&(F.current=n)}}}catch{}};t();const e=typeof b.addListener=="function"?b.addListener("state",()=>{t()}):null;return()=>{e&&e()}},[b]);const w=y(new Map),ue=y(new Set),[Qs,Xs]=o(new Set),Se=y(new c.Value(1)).current,Le=y(new c.Value(.4)).current,be=y(new c.Value(1)).current,we=y(new c.Value(0)).current,Re=y(new c.Value(0)).current,S=y(new c.ValueXY({x:0,y:0})).current,Ke=y({x:0,y:0});i(()=>{const t=S.x.addListener(r=>Ke.current.x=r.value),e=S.y.addListener(r=>Ke.current.y=r.value);return()=>{S.x.removeListener(t),S.y.removeListener(e)}},[S]);const et=y(!1),Ys=y(nn.create({onStartShouldSetPanResponder:()=>!1,onMoveShouldSetPanResponder:(t,e)=>Math.abs(e.dx)>4||Math.abs(e.dy)>4,onPanResponderGrant:()=>{et.current=!0,S.setOffset({x:Ke.current.x,y:Ke.current.y}),S.setValue({x:0,y:0})},onPanResponderMove:c.event([null,{dx:S.x,dy:S.y}],{useNativeDriver:!1}),onPanResponderRelease:()=>{S.flattenOffset(),setTimeout(()=>{et.current=!1},50)},onPanResponderTerminate:()=>{S.flattenOffset(),et.current=!1}})).current,Zs=E(()=>{c.sequence([c.timing(Re,{toValue:1,duration:320,useNativeDriver:!1}),c.timing(Re,{toValue:0,duration:0,useNativeDriver:!1})]).start(),Kr()},[Re]);i(()=>{_t.OS==="android"&&on.setLayoutAnimationEnabledExperimental?.(!0)},[]),i(()=>{if(C)return;const t=c.loop(c.sequence([c.timing(Se,{toValue:1.2,duration:800,useNativeDriver:!1}),c.timing(Se,{toValue:1,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[Se,C]),i(()=>{if(C)return;const t=c.loop(c.sequence([c.timing(we,{toValue:1,duration:3200,easing:yr.inOut(yr.ease),useNativeDriver:!1}),c.delay(3500),c.timing(we,{toValue:0,duration:0,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[we,C]),i(()=>{const t=c.loop(c.sequence([c.timing(Le,{toValue:1,duration:1200,useNativeDriver:!1}),c.timing(Le,{toValue:.4,duration:1200,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[Le]),i(()=>{const t=c.loop(c.sequence([c.timing(be,{toValue:1.3,duration:800,useNativeDriver:!1}),c.timing(be,{toValue:.8,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[be]);const Zr=g(()=>io(),[]),W=(_t.OS==="ios"||_t.OS==="android")&&Zr;i(()=>{W&&Me().catch(()=>{})},[W,C]),i(()=>{if(!W)return;const t=oo(()=>{Me().catch(()=>{}),Z(!0)});return()=>{t()}},[W]),i(()=>{if(!W)return;const t=ao(()=>{Z(e=>{const r=!e;return r&&Me().catch(()=>{}),r})});return()=>{t()}},[W]);const Ks=y(C);i(()=>{if(Ks.current=C,C){Yn("InspectorModal");const t=z==="apis"||M?.[z]?z:"apis";if(Q(t),Nr(t),Ct.current.length>0){const n=Bt(Ct.current),u=new Set(n.map(d=>d.id));ue.current=u,G(n)}xt.current.length>0&&se(xt.current),St.current.length>0&&te(St.current);const e=qt();e&&(Ie(typeof e=="object"?{...e}:e),De({...Ht()}));const r=nt();r.length>0&&k(r);const s=requestAnimationFrame(()=>{Qt(!0)});return()=>{cancelAnimationFrame(s)}}else Qt(!1),de(new Set)},[C]),i(()=>{On(),Vt(),kn(),Kn(),Un();const t=Mn(),e=Ks,r=jn(l=>{if(l.message==="__CLEARED__"){k([]),re(null);return}const B=nt();B.length>0&&Ne("crash",JSON.stringify(B[0])),e.current&&k(B)}),s=nt();s.length>0&&(s.forEach(l=>Ne("crash",JSON.stringify(l))),k(s));let n,u=!0;const d=_n(l=>{if(Ct.current=l,l.length>0&&Ne("apis",JSON.stringify(l[0])),!e.current)return;clearTimeout(n);const B=()=>{const p=Bt(l),T=new Set(p.map(O=>O.id)),h=new Set;T.forEach(O=>{ue.current.has(O)||h.add(O)}),ue.current=T,h.size>0&&(h.forEach(O=>{if(!w.current.has(O)){const sn=p.find(rn=>rn.id===O)?.routeInfo||F.current;w.current.set(O,sn)}}),Xs(h),setTimeout(()=>Xs(new Set),1200)),G(p)};if(u){u=!1;const p=Bt(l),T=new Set(p.map(h=>h.id));ue.current=T,p.forEach(h=>{if(!w.current.has(h.id)){const O=h?.routeInfo||F.current;w.current.set(h.id,O)}}),G(p)}else n=setTimeout(B,250)});let L,ve=!0;const Dt=Zn(l=>{if(St.current=l,l.length>0&&Ne("analytics",JSON.stringify(l[0])),!e.current)return;clearTimeout(L);const B=()=>{const p=new Set(l.map(h=>h.id)),T=new Set;p.forEach(h=>{xe.current.has(h)||T.add(h)}),xe.current=p,T.size>0&&(T.forEach(h=>{w.current.has(h+1e6)||w.current.set(h+1e6,F.current)}),Gs(T),setTimeout(()=>Gs(new Set),1200)),te(l)};if(ve){ve=!1;const p=new Set(l.map(T=>T.id));xe.current=p,te(l)}else L=setTimeout(B,200)});let v,rt=!0;const Ae=qn(l=>{xt.current=l,l.length>0&&Ne("logs",JSON.stringify(l[0])),e.current&&(clearTimeout(v),rt?(rt=!1,se(l)):v=setTimeout(()=>{se(l)},200))}),Y=qt();Y&&(Ie(typeof Y=="object"?{...Y}:Y),De({...Ht()}));const Ft=to(()=>{if(!e.current)return;const l=qt();Ie(l&&typeof l=="object"?{...l}:l),De({...Ht()})});return()=>{d(),clearTimeout(n),Dt(),clearTimeout(L),Ae(),clearTimeout(v),Ft(),r(),t()}},[]),i(()=>{Vn(P)},[P]),i(()=>{vr(q)},[q]),i(()=>{ls(!0),cs(!0),ds(!1),ms(!1),ct("")},[m]);const R=g(()=>{let t=x.filter(e=>{if(N&&N!=="all"){if(N==="errors"){if(!(e.status===0||e.status==null||typeof e.status=="number"&&e.status>=400))return!1}else if(N==="success"){if(!(typeof e.status=="number"&&e.status>=200&&e.status<400))return!1}else if(N==="slow"){if((e.duration||0)<500)return!1}else if(N==="graphql"){if(!((e.url||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("apollo")))return!1}else if(e.method?.toUpperCase()!==N.toUpperCase())return!1}if(K.size>0&&![...K].some(s=>{if(s==="ALL")return!0;if(s==="Failed")return e.status===0||e.status==null;const n=parseInt(s,10);return isNaN(n)?String(e.status)[0]===s[0]:Number(e.status)===n})||ee.size>0&&![...ee].some(s=>s==="ALL"?!0:e.method?.toUpperCase()===s))return!1;if(J&&J.trim().length>0){const r=w.current.get(e.id)?.path||"";if(!Nn(e,J,r,{scope:pe,isRegex:me,isCaseSensitive:he}))return!1}return!0});if(Ve==="oldest"&&(t=[...t].reverse()),!$){const e=[];for(const r of t){const s=e[e.length-1];s&&s.method===r.method&&s.url===r.url&&s.status===r.status?e[e.length-1]={...s,duplicateCount:(s.duplicateCount||1)+1}:e.push({...r,duplicateCount:1})}t=e}return t},[x,J,pe,me,he,N,K,ee,Ve,$]),er=g(()=>{const t=new Set;return x.forEach(e=>{e.method&&t.add(e.method.toUpperCase())}),["ALL",...Array.from(t)]},[x]),tr=E((t,e)=>{ht(r=>{const s=r[t]||new Set(["success","failed","loading"]),n=new Set(s);return n.has(e)?n.delete(e):n.add(e),{...r,[t]:n}})},[]),tt=g(()=>{if(F.current?.path){const t=F.current.path.split(" \u2794 ").map(e=>e.trim()).filter(Boolean);return t.length>0?t[t.length-1]:F.current.path}if(R.length>0){const t=R[0],e=w.current.get(t.id)||t?.routeInfo;return Sr(t,e)}return""},[R,Ze]),sr=E(t=>{yt(e=>{const r=new Map(e),s=r.has(t)?r.get(t):t===tt;return r.set(t,!s),r})},[tt]);i(()=>{Be({})},[J,pe,me,he,N,K,ee,P]);const rr=E((t,e=10)=>{Be(r=>({...r,[t]:(r[t]||P||50)+e}))},[P]),nr=g(()=>{const t=[],e=new Map;for(let s=0;s<R.length;s++){const n=R[s],u=w.current.get(n.id)||n?.routeInfo,d=Sr(n,u);let L=e.get(d);L||(L={pageName:d,color:vn(d),logs:[]},e.set(d,L)),L.logs.push(n)}let r=0;return e.forEach(s=>{let n=0,u=0,d=0;s.logs.forEach(v=>{v.status==null?d++:v.status===0||v.status>=400?u++:n++});const L=ns[s.pageName]||new Set(["success","failed","loading"]),ve=gt.has(s.pageName)?!gt.get(s.pageName):s.pageName!==tt,Dt=s.logs[0]?.startTime||0;if(t.push({type:"header",id:`hdr-${s.pageName}`,pageName:s.pageName,color:s.color,stats:{success:n,failed:u,loading:d},timestamp:Dt,activeFilters:L,isCollapsed:ve,isFirst:r===0}),r++,!ve){const v=s.logs.filter(p=>p.status==null?L.has("loading"):p.status===0||p.status>=400?L.has("failed"):L.has("success")),rt=P||50,Ae=os[s.pageName]||rt,Y=v.slice(0,Ae),Ft=v.length>Ae;Y.forEach(p=>{t.push({type:"log",id:`log-${p.id}`,log:p,isLast:!1,color:s.color})});const l=Math.max(0,v.length-Ae),B=Math.min(l||10,10);t.push({type:"loadMore",id:`loadmore-${s.pageName}`,pageName:s.pageName,color:s.color,remainingCount:l,totalCount:v.length,loadedCount:Y.length,loadMoreStep:B,hasMore:Ft})}}),t},[R,x,ns,gt,tt,os,P]),{minStart:or,totalRange:ar}=g(()=>{if(R.length===0)return{minStart:0,totalRange:0};const t=Math.min(...R.map(r=>r.startTime)),e=Math.max(...R.map(r=>r.startTime+(r.duration||10)));return{minStart:t,totalRange:e-t}},[R]),st=g(()=>{if(!m)return null;const t=x.findIndex(e=>e.id===m.id);if(t===-1)return null;for(let e=t+1;e<x.length;e++){const r=x[e];if(r.url===m.url&&r.method===m.method)return r}return null},[m,x]),ir=st?st.request:null,lr=st?st.response:null,ur=g(()=>{let t=qe;if(le&&le.trim().length>0){const s=le.trim().toLowerCase().split(/\s+/).filter(Boolean);t=t.filter(n=>{const u=[n.name||"",JSON.stringify(n.params||""),JSON.stringify(n.userProperties||""),n.screenName||"",n.pageTitle||"",n.userId||"",n.source||""].join(" ").toLowerCase();return s.every(d=>u.includes(d))})}if(a.categories.size>0&&!a.categories.has("all")&&(t=t.filter(s=>{const n=An(s.name);return a.categories.has(n)})),a.timeWindow!=="all"){const s=Date.now(),n=a.timeWindow==="1m"?s-60*1e3:a.timeWindow==="5m"?s-300*1e3:a.timeWindow==="15m"?s-900*1e3:s-3600*1e3;t=t.filter(u=>u.timestamp>=n)}if(a.sources.size>0&&!a.sources.has("all")&&(t=t.filter(s=>a.sources.has(s.source||"manual"))),a.userTypes.size>0&&!a.userTypes.has("all")&&(t=t.filter(s=>{const n=!!(s.userId&&s.userId.trim()!=="");return!!(a.userTypes.has("identified")&&n||a.userTypes.has("anonymous")&&!n)})),a.payloadComplexity!=="all"&&(a.payloadComplexity==="none"?t=t.filter(s=>!s.params||Object.keys(s.params).length===0):a.payloadComplexity==="simple"?t=t.filter(s=>s.params&&Object.keys(s.params).length<=3):a.payloadComplexity==="heavy"&&(t=t.filter(s=>s.params&&Object.keys(s.params).length>3))),a.onlyConversions){const s=["purchase","item_purchase","ecommerce_purchase","sign_up","login","lead","generate_lead","tutorial_complete","add_payment_info","begin_checkout","spend_virtual_currency"];t=t.filter(n=>s.some(u=>n.name.toLowerCase().includes(u)))}a.screens.size>0&&(t=t.filter(s=>{const n=s.screenName||s.params?.firebase_screen||s.params?.screen_name||s.params?.firebase_screen_class||s.screenClass||"";return a.screens.has(n)})),a.hasRevenue&&(t=t.filter(s=>s.params?.value!=null&&!isNaN(Number(s.params.value))||s.params?.price!=null&&!isNaN(Number(s.params.price)))),a.hasItems&&(t=t.filter(s=>Array.isArray(s.params?.items)&&s.params.items.length>0)),a.hasUserProps&&(t=t.filter(s=>s.userProperties&&Object.keys(s.userProperties).length>0)),a.hasParams&&(t=t.filter(s=>s.params&&Object.keys(s.params).length>0));const e=[];for(const s of t){if(e.length===0){e.push({...s,count:1});continue}const n=e[e.length-1];n.name===s.name&&JSON.stringify(n.params)===JSON.stringify(s.params)&&JSON.stringify(n.userProperties)===JSON.stringify(s.userProperties)?(n.count=(n.count||1)+1,n.timestamp=s.timestamp,n.id=s.id):e.push({...s,count:1})}let r=e;return a.onlyDuplicates&&(r=r.filter(s=>(s.count||1)>1)),a.sortBy==="time_asc"?r=[...r].sort((s,n)=>s.timestamp-n.timestamp):a.sortBy==="revenue_desc"?r=[...r].sort((s,n)=>{const u=Number(s.params?.value??s.params?.price??0);return Number(n.params?.value??n.params?.price??0)-u}):a.sortBy==="count_desc"&&(r=[...r].sort((s,n)=>(n.count||1)-(s.count||1))),r.slice(0,oe)},[qe,le,a,oe]),cr=g(()=>{let t=j;if(D.size>0&&!D.has("all")&&(t=t.filter(e=>!!(D.has("user-log")&&e.sourceMethod==="log"||D.has("info")&&(e.sourceMethod==="info"||e.type==="info"&&e.sourceMethod!=="log")||D.has("warn")&&(e.type==="warn"||e.sourceMethod==="warn")||D.has("error")&&(e.type==="error"||e.sourceMethod==="error")||D.has("analytics")&&e.message?.toLowerCase().includes("[analytics error]")))),I&&I.trim().length>0){const e=I.trim().toLowerCase().split(/\s+/).filter(Boolean);t=t.filter(r=>{const s=[r.message||"",r.caller||"",r.type||"",r.sourceMethod||"",r.stack||""].join(" ").toLowerCase();return e.every(n=>n==="error"||n==="err"?r.type==="error"||s.includes(n):n==="warn"||n==="warning"?r.type==="warn"||s.includes(n):n==="info"&&r.type==="info"||s.includes(n))})}if(t=[...t].sort((e,r)=>ke==="newest"?r.timestamp-e.timestamp:e.timestamp-r.timestamp),!$){const e=[];for(const r of t){const s=e[e.length-1];s&&s.type===r.type&&s.sourceMethod===r.sourceMethod&&s.message===r.message?e[e.length-1]={...s,duplicateCount:(s.duplicateCount||1)+1}:e.push({...r,duplicateCount:1})}t=e}return t},[j,D,I,ke,$]),fr=g(()=>{let t=j;if(I&&I.trim().length>0){const r=I.trim().toLowerCase().split(/\s+/).filter(Boolean);t=j.filter(s=>{const n=[s.message||"",s.caller||"",s.type||"",s.sourceMethod||"",s.stack||""].join(" ").toLowerCase();return r.every(u=>u==="error"||u==="err"?s.type==="error"||n.includes(u):u==="warn"||u==="warning"?s.type==="warn"||n.includes(u):u==="info"&&s.type==="info"||n.includes(u))})}const e=j.length;return{all:`${t.length}/${e}`,info:`${t.filter(r=>r.sourceMethod==="info"||r.type==="info"&&r.sourceMethod!=="log").length}/${e}`,warn:`${t.filter(r=>r.type==="warn"||r.sourceMethod==="warn").length}/${e}`,error:`${t.filter(r=>r.type==="error"||r.sourceMethod==="error").length}/${e}`,"user-log":`${t.filter(r=>r.sourceMethod==="log").length}/${e}`,analytics:`${t.filter(r=>r.message.toLowerCase().includes("[analytics error]")).length}/${e}`}},[j,I]),dr=E(()=>{Z(!1),lt(!1),setTimeout(()=>{ut(null),Ye(null),Lt(null),ft(null),dt(null),re(null)},300)},[]);function Kr(){Vt(),G([]),de(new Set),ht({}),yt(new Map),Be({}),pt(new Set),mt(new Set),Xt(""),ue.current=new Set,w.current=new Map,Mr(),te([]),qs(""),xe.current=new Set,wr(),se([]),Es(new Set(["all"])),Ts("")}function pr(){if(f==="logs"){ce.alert("Clear Logs","Are you sure you want to clear all console logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{wr(),se([])},style:"destructive"}]);return}if(f==="analytics"){ce.alert("Clear Analytics","Are you sure you want to clear all analytics events?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{Mr(),te([]),Ye(null),xe.current=new Set},style:"destructive"}]);return}if(f==="redux"){ce.alert("Clear Redux Timeline","Are you sure you want to clear the dispatched action history?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{ro(),De({})},style:"destructive"}]);return}if(f==="crash"){ce.alert("Clear Crash History","Are you sure you want to clear all intercepted crash records?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{Rr(),k([]),re(null)},style:"destructive"}]);return}_e.size>0?(G(t=>t.filter(e=>!_e.has(e.id))),de(new Set)):ce.alert("Clear Logs","Are you sure you want to clear all network logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:en,style:"destructive"}])}function en(){Vt(),G([]),de(new Set),ht({}),yt(new Map),Be({}),pt(new Set),mt(new Set),ue.current=new Set,w.current=new Map}const mr=g(()=>{if(!m)return"";try{const e=new URL(m.url).pathname.split("/").filter(Boolean);return e.length>0?`/${e.slice(-2).join("/")}`:"/"}catch{const t=m.url.split("/").filter(Boolean);return t.length>0?`/${t.slice(-2).join("/")}`:m.url}},[m]),hr=g(()=>m?Rn(m.url):"",[m]),gr=E(t=>{de(e=>{const r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},[]),tn=g(()=>({visible:C,setVisible:Z,closeModal:dr,isMinimized:Gt,setIsMinimized:lt,minimizeInspector:Er,isReady:Jt,enabled:A,isEnabled:A,appIcon:jt,environment:zt,modalHeightPercent:Fe,setModalHeightPercent:at,modalAnimationType:Oe,setModalAnimationType:it,hasNavigationContext:Js,setNavState:It,activeTab:f,switchActiveTab:Vs,tabVisibility:M,toggleTabVisibility:Bs,lastReadApisCount:Cs,lastReadLogsCount:gs,mediaCount:bs,refreshMediaCount:He,selected:m,setSelected:ut,selectedEvent:ks,setSelectedEvent:Ye,selectedLog:hs,setSelectedLog:Lt,showHeaderInfo:as,setShowHeaderInfo:Vr,settingsPage:Is,setSettingsPage:zr,isAboutOpen:Ds,setIsAboutOpen:$r,updateAvailable:_s,latestNpmVersion:Ce,clearAnim:Re,activePulseAnim:Le,unreadPulseAnim:be,runClearAllWithAnimation:Zs,useNativeFab:W,fabPan:S,fabPanResponder:Ys,fabDraggedRef:et,pulseAnim:Se,fabShineAnim:we,logs:x,filteredLogs:R,groupedData:nr,search:J,setSearch:Xt,searchScope:pe,setSearchScope:Ir,isRegexSearch:me,setIsRegexSearch:Dr,isCaseSensitive:he,setIsCaseSensitive:Fr,quickFilter:N,setQuickFilter:Or,statusFilters:K,setStatusFilters:pt,methodFilters:ee,setMethodFilters:mt,availableMethods:er,sortOrder:Ve,setSortOrder:kr,selectedLogs:_e,toggleSelect:gr,minStart:or,totalRange:ar,newLogIds:Qs,toggleSectionFilter:tr,toggleSectionCollapse:sr,loadMoreSection:rr,handleDelete:pr,detailTitle:mr,detailDisplayUrl:hr,apiDetailActiveTab:ss,setApiDetailActiveTab:rs,detailSearch:Yt,setDetailSearch:ct,reqExpanded:is,setReqExpanded:ls,resExpanded:us,setResExpanded:cs,showReqDiff:fs,setShowReqDiff:ds,showResDiff:ps,setShowResDiff:ms,prevRequestData:ir,prevResponseData:lr,logRouteMapRef:w,consoleLogs:X,visibleConsoleLogs:j,filteredConsoleLogs:cr,logSearch:I,setLogSearch:Ts,logFilters:D,setLogFilters:Es,logCounts:fr,logSortOrder:ke,setLogSortOrder:qr,analyticsEvents:qe,filteredAnalyticsEvents:ur,analyticsSearch:le,setAnalyticsSearch:qs,analyticsFilters:a,setAnalyticsFilters:Hs,isAnalyticsFilterApplied:Us,resetAnalyticsFilters:js,newEventIds:Ws,isAnalyticsLayoutReady:zs,setIsAnalyticsLayoutReady:Xr,analyticsHeaderExpanded:$s,setAnalyticsHeaderExpanded:Yr,reduxState:$t,setReduxState:Ie,reduxLastActionMap:Wt,reduxSearch:Zt,setReduxSearch:_r,selectedReduxSlice:Kt,setSelectedReduxSlice:ft,selectedReduxAction:es,setSelectedReduxAction:dt,reduxActiveSubTab:ts,setReduxActiveSubTab:Br,crashRecords:ge,setCrashRecords:k,selectedCrash:Rs,setSelectedCrash:re,lastReadCrashesCount:Ss,maxCrashLogs:q,setMaxCrashLogs:Ue,clearAllCrashes:()=>{Rr(),k([]),re(null)},pushRecords:H,filteredPushRecords:Ps,selectedPush:As,setSelectedPush:Ns,pushSearch:ye,setPushSearch:Hr,pushQuickFilter:_,setPushQuickFilter:Ur,lastReadPushCount:je,unreadPushCount:Ms,maxPushLogs:ze,setMaxPushLogs:bt,clearAllPushLogs:()=>{Gn(),vs([]),Ns(null)},simulatePush:(t,e)=>{Qn(t,e)},settingsActiveSubTab:Fs,setSettingsActiveSubTab:Wr,defaultTab:z,setDefaultTab:Xe,isDark:Ee,setIsDark:ot,showDuplicateLogs:$,setShowDuplicateLogs:Mt,showUpdateToast:Pt,setShowUpdateToast:Tt,showConsoleLevels:U,setShowConsoleLevels:wt,resetToDefaults:Jr,storage:V,maxNetworkLogs:P,setMaxNetworkLogs:Ge,maxConsoleLogs:ne,setMaxConsoleLogs:$e,maxAnalyticsEventsLimit:oe,setMaxAnalyticsEventsLimit:Je,isAutoRamLimitEnabled:ae,setIsAutoRamLimitEnabled:Rt,deviceFreeRamMb:vt,reduxAutoRefresh:ie,setReduxAutoRefreshState:At,reduxExpandDepth:Qe,setReduxExpandDepth:Nt}),[C,dr,Jt,A,jt,zt,Fe,Oe,Js,It,f,Vs,M,Bs,Cs,gs,bs,He,m,ks,hs,as,Is,Ds,_s,Ce,Re,Le,be,Zs,W,S,Ys,Se,we,x,R,nr,J,pe,me,he,N,K,ee,er,Ve,_e,gr,or,ar,Qs,tr,sr,rr,pr,mr,hr,ss,Yt,is,us,fs,ps,ir,lr,X,j,cr,I,D,fr,ke,qe,ur,le,a,Us,js,Ws,zs,$s,$t,Wt,Zt,Kt,es,ts,ge,Rs,Ss,q,H,Ps,As,ye,_,je,Ms,ze,Fs,z,Ee,$,Pt,U,V,P,ne,oe,ae,vt,ie,Qe,Gt]);return<bn.Provider value={tn}>
|
|
2
2
|
<Ln/>
|
|
3
|
-
</bn.Provider>},xo=
|
|
3
|
+
</bn.Provider>},xo=A=>{const V=A?.enabled??!0,b=A?.telemetry??!0;return i(()=>(V?b?Xn(!0,A?.environment):Ar(!1):(Me().catch(()=>{}),Ar(!1)),()=>{Me().catch(()=>{})}),[V,b,A?.environment]),V?<Cn i18n={xn}>
|
|
4
4
|
<Sn fallbackType="inline">
|
|
5
|
-
<Co{...
|
|
5
|
+
<Co{...A}enabled={V}/>
|
|
6
6
|
</Sn>
|
|
7
7
|
</Cn>:null};export default xo;export{setupNetworkLogger,clearNetworkLogs,subscribeNetworkLogs,addAxiosInterceptors}from"./customHooks/networkLogger";export{setupConsoleLogger,clearConsoleLogs,subscribeConsoleLogs}from"./customHooks/consoleLogger";export{setupAnalyticsLogger,logAnalyticsEvent,subscribeAnalyticsEvents,clearAnalyticsEvents,getCurrentUserProperties,getCurrentUserId,getDefaultEventParameters,getCollectionEnabled}from"./customHooks/analyticsLogger";export{setupGlobalCrashHandler,subscribeCrashEvents,emitCrashEvent,getCrashRecords,clearCrashRecords,simulateTestCrash,exportCrashReport,parseCrashStackTrace,recordCustomCrash,addCrashBreadcrumb,recordNavigationBreadcrumb,recordNetworkBreadcrumb,recordReduxBreadcrumb,recordUserActionBreadcrumb,computeCrashFingerprint}from"./customHooks/crashHandler";export{default as CrashTab}from"./components/Inspector/CrashTab";export{default as ErrorBoundary}from"./components/ErrorBoundary";export{connectReduxStore,inspectorReduxMiddleware,getReduxState,subscribeReduxState,getActionHistory,clearActionHistory,getLastActionForReducer}from"./customHooks/reduxLogger";export{getEventCategory,registerGAPlugin}from"./helpers/gaAnalyticsRegistry";export{InspectLog,InspectTrackTime,InspectCatch}from"./decorators";export{getNativeDeviceMetrics,enableNativeCrashProtection,subscribeNativeCrashes,showNativeFloatingButton,hideNativeFloatingButton,setNativeFloatingButtonBadge,subscribeNativeFloatingButtonPress,subscribeNativeDeviceShake,startNativeFpsMonitoring,stopNativeFpsMonitoring,getNativeFpsMetrics,getNativeStorageItem,setNativeStorageItem,isNativeModuleAvailable}from"./native/NativeInspector";export{setupMemoryWarningHandler,pruneAllLogs,subscribeMemoryWarning}from"./helpers";export{setMaxNetworkLogsLimit,getMaxNetworkLogsLimit,pruneNetworkLogs}from"./customHooks/networkLogger";export{setMaxConsoleLogsLimit,getMaxConsoleLogsLimit,pruneConsoleLogs}from"./customHooks/consoleLogger";export{setMaxReduxHistoryLimit,getMaxReduxHistoryLimit,pruneReduxHistory}from"./customHooks/reduxLogger";export{setMaxAnalyticsLogsLimit,getMaxAnalyticsLogsLimit,pruneAnalyticsLogs}from"./customHooks/analyticsLogger";export{getMaxCrashLogsLimit,pruneCrashRecords}from"./customHooks/crashHandler";export{recordPushNotification,recordSalesforcePush,getPushRecords,clearPushRecords,subscribePushEvents,simulateTestPush,autoSetupPushLogger,setMaxPushRecordsLimit,getDiscoveredPushSources,prunePushRecords}from"./customHooks/pushNotificationLogger";export{shareApiReport,sharePushReport,shareCrashReport,shareAnalyticsReport,shareReduxReport,shareLogReport,formatApiReport,formatPushReport,formatCrashReport,formatAnalyticsReport,formatReduxReport,formatLogReport}from"./helpers/shareFormatter";export{BrandCircleIcon,BellIcon,CloudPushIcon}from"./components/NetworkIcons";export{ModuleErrorBoundary}from"./components/ModuleErrorBoundary";export{connectAsyncStorage,connectMMKV,isAsyncStorageConnected,isMMKVConnected,getRegisteredMMKVInstanceIds,fetchStorageEntries,setStorageEntry,removeStorageEntry,clearStorageDriver,subscribeToStorageChanges}from"./customHooks/storageInspector";export{ActiveTab,Method,StatusFilter,SortOrder,LocalFilter,ModalAnimationType,SettingsPage,SettingsSubTab,LogFilter,ConsoleLogType,AnalyticsEventSource,GAEventCategory,StackFrameType,DiffResultType,CrashType,CrashExportFormat,CrashDetailSubTab,CrashFilterType,BreadcrumbType,PushAppState,PushActionType,PushDetailSubTab,PushFilterType}from"./types";export{AppFonts,setAppFonts}from"./styles/AppFonts";export{AppColors,setAppColors,getThemeColors,updateAppColorsTheme}from"./styles/AppColors";export{t,i18n,useTranslation,setLanguage,addTranslations,setTranslations,I18nextProvider,SUPPORTED_LANGUAGES}from"./i18n";export{fetchRemoteConfigModuleStatus,isFirebaseRemoteConfigAvailable}from"./helpers/remoteConfig";export{ScreenCapture,ScreenRecorder}from"./capture";export{LIB_VERSION}from"./constants/version";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-inapp-inspector",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "The zero-config, all-in-one in-app debugger & network logger for React Native & Expo (Flipper / Chucker alternative). Inspect Network (fetch/Axios/GraphQL), Console logs with Metro Symbolication, Redux State, Firebase Analytics, Storage (AsyncStorage/MMKV), Hardware Telemetry, and JS Bundle size directly on device.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|