react-native-inapp-inspector 2.3.20 → 2.3.22

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.
Files changed (61) hide show
  1. package/README.md +14 -14
  2. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +58 -1
  3. package/dist/commonjs/components/AppHeaderLogo.js +2 -2
  4. package/dist/commonjs/components/ConsoleLogCard.js +1 -1
  5. package/dist/commonjs/components/HighlightText.js +13 -13
  6. package/dist/commonjs/components/Inspector/AboutModal.js +143 -251
  7. package/dist/commonjs/components/Inspector/DebuggingTab.js +19 -13
  8. package/dist/commonjs/components/Inspector/InspectorHeader.js +54 -80
  9. package/dist/commonjs/components/Inspector/MainScreen.js +13 -23
  10. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +4 -4
  11. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +1 -1
  12. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +1 -1
  13. package/dist/commonjs/components/Inspector/TabBar.js +7 -7
  14. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +23 -24
  15. package/dist/commonjs/components/LogCard.js +16 -16
  16. package/dist/commonjs/components/NetworkIcons.d.ts +10 -0
  17. package/dist/commonjs/components/NetworkIcons.js +46 -4
  18. package/dist/commonjs/components/QRCodeView.js +2 -2
  19. package/dist/commonjs/components/TreeNode.js +16 -16
  20. package/dist/commonjs/constants/version.d.ts +1 -1
  21. package/dist/commonjs/constants/version.js +1 -1
  22. package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -1
  23. package/dist/commonjs/helpers/index.d.ts +1 -0
  24. package/dist/commonjs/helpers/index.js +2 -2
  25. package/dist/commonjs/index.js +1 -1
  26. package/dist/commonjs/native/NativeInspector.d.ts +1 -0
  27. package/dist/commonjs/native/NativeInspector.js +1 -1
  28. package/dist/commonjs/types/interfaces.d.ts +0 -2
  29. package/dist/esm/components/AppHeaderLogo.js +6 -6
  30. package/dist/esm/components/ConsoleLogCard.js +6 -6
  31. package/dist/esm/components/HighlightText.js +17 -17
  32. package/dist/esm/components/Inspector/AboutModal.js +205 -313
  33. package/dist/esm/components/Inspector/DebuggingTab.js +32 -26
  34. package/dist/esm/components/Inspector/InspectorHeader.js +96 -122
  35. package/dist/esm/components/Inspector/MainScreen.js +66 -76
  36. package/dist/esm/components/Inspector/MediaGalleryTab.js +19 -19
  37. package/dist/esm/components/Inspector/MediaPreviewModal.js +18 -18
  38. package/dist/esm/components/Inspector/NpmStarPrompt.js +1 -1
  39. package/dist/esm/components/Inspector/TabBar.js +21 -21
  40. package/dist/esm/components/Inspector/UpdateAvailableModal.js +65 -66
  41. package/dist/esm/components/LogCard.js +43 -43
  42. package/dist/esm/components/NetworkIcons.d.ts +10 -0
  43. package/dist/esm/components/NetworkIcons.js +191 -149
  44. package/dist/esm/components/QRCodeView.js +4 -4
  45. package/dist/esm/components/TreeNode.js +53 -53
  46. package/dist/esm/constants/version.d.ts +1 -1
  47. package/dist/esm/constants/version.js +1 -1
  48. package/dist/esm/customHooks/bundleAnalyzer.js +1 -1
  49. package/dist/esm/helpers/index.d.ts +1 -0
  50. package/dist/esm/helpers/index.js +4 -4
  51. package/dist/esm/index.js +7 -7
  52. package/dist/esm/native/NativeInspector.d.ts +1 -0
  53. package/dist/esm/native/NativeInspector.js +1 -1
  54. package/dist/esm/types/interfaces.d.ts +0 -2
  55. package/ios/NetworkInspectorModule.mm +39 -3
  56. package/package.json +1 -1
  57. package/src/native/NativeInspector.ts +18 -0
  58. package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +0 -16
  59. package/dist/commonjs/components/Inspector/FeedbackModal.js +0 -198
  60. package/dist/esm/components/Inspector/FeedbackModal.d.ts +0 -16
  61. package/dist/esm/components/Inspector/FeedbackModal.js +0 -198
@@ -1,14 +1,14 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(_,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(_,i,n)}):(function(_,e,t,i){i===void 0&&(i=t),_[i]=e[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(_,e){Object.defineProperty(_,"default",{enumerable:!0,value:e})}):function(_,e){_.default=e}),__importStar=this&&this.__importStar||(function(){var _=function(e){return _=Object.getOwnPropertyNames||function(t){var i=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[i.length]=n);return i},_(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=_(e),n=0;n<i.length;n++)i[n]!=="default"&&__createBinding(t,e,i[n]);return __setModuleDefault(t,e),t}})();Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),helpers_1=require("../helpers"),NetworkIcons_1=require("./NetworkIcons"),AppColors_1=require("../styles/AppColors"),monoFont=react_native_1.Platform.select({ios:"Menlo",android:"monospace",default:"monospace"}),IndentGuides=react_1.default.memo(({level:_})=>{if(_<=0)return null;const e=[];for(let t=0;t<_;t++)e.push(<react_native_1.View key={t}style={nodeStyles.indentGuideCell}>
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(_,e,t,i){i===void 0&&(i=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(_,i,o)}):(function(_,e,t,i){i===void 0&&(i=t),_[i]=e[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(_,e){Object.defineProperty(_,"default",{enumerable:!0,value:e})}):function(_,e){_.default=e}),__importStar=this&&this.__importStar||(function(){var _=function(e){return _=Object.getOwnPropertyNames||function(t){var i=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(i[i.length]=o);return i},_(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=_(e),o=0;o<i.length;o++)i[o]!=="default"&&__createBinding(t,e,i[o]);return __setModuleDefault(t,e),t}})();Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),helpers_1=require("../helpers"),NetworkIcons_1=require("./NetworkIcons"),AppColors_1=require("../styles/AppColors"),monoFont=react_native_1.Platform.select({ios:"Menlo",android:"monospace",default:"monospace"}),IndentGuides=react_1.default.memo(({level:_})=>{if(_<=0)return null;const e=[];for(let t=0;t<_;t++)e.push(<react_native_1.View key={t}style={nodeStyles.indentGuideCell}>
2
2
  <react_native_1.View style={nodeStyles.indentGuideLine}/>
3
- </react_native_1.View>);return<react_native_1.View style={nodeStyles.indentGuidesContainer}>{e}</react_native_1.View>}),TreeNode=react_1.default.memo(function _({data:e,name:t,level:i=0,search:n,forceOpen:p,defaultExpandDepth:x=1}){const[C,F]=(0,react_1.useState)(()=>p!==void 0?p:x!==void 0?i<x:i<1),b=C;(0,react_1.useEffect)(()=>{p!==void 0&&F(p)},[p]);const T=typeof e=="object"&&e!==null,v=Array.isArray(e);function P(r){return r==null?nodeStyles.syntaxNull:typeof r=="number"?nodeStyles.syntaxNumber:typeof r=="boolean"?nodeStyles.syntaxBoolean:nodeStyles.syntaxString}function N(r,w){const V=P(w);if(r==="null"||r==="undefined")return[<react_native_1.Text key="nil"style={nodeStyles.syntaxNull}>
3
+ </react_native_1.View>);return<react_native_1.View style={nodeStyles.indentGuidesContainer}>{e}</react_native_1.View>}),TreeNode=react_1.default.memo(function _({data:e,name:t,level:i=0,search:o,forceOpen:x,defaultExpandDepth:b=1}){const[P,T]=(0,react_1.useState)(()=>x!==void 0?x:b!==void 0?i<b:i<1),m=P;(0,react_1.useEffect)(()=>{x!==void 0&&T(x)},[x]);const S=typeof e=="object"&&e!==null,v=Array.isArray(e);function N(r){return r==null?nodeStyles.syntaxNull:typeof r=="number"?nodeStyles.syntaxNumber:typeof r=="boolean"?nodeStyles.syntaxBoolean:nodeStyles.syntaxString}function j(r,w){const V=N(w);if(r==="null"||r==="undefined")return[<react_native_1.Text key="nil"style={nodeStyles.syntaxNull}>
4
4
  {r}
5
- </react_native_1.Text>];if(!n)return[<react_native_1.Text key="plain"style={V}>
5
+ </react_native_1.Text>];if(!o)return[<react_native_1.Text key="plain"style={V}>
6
6
  {r}
7
- </react_native_1.Text>];const j=new RegExp(`(${(0,helpers_1.escapeRegex)(n)})`,"gi");return r.split(j).map((h,S)=>h.toLowerCase()===n.toLowerCase()?<react_native_1.Text key={S}style={nodeStyles.highlight}>
7
+ </react_native_1.Text>];const B=new RegExp(`(${(0,helpers_1.escapeRegex)(o)})`,"gi");return r.split(B).map((h,A)=>h.toLowerCase()===o.toLowerCase()?<react_native_1.Text key={A}style={nodeStyles.highlight}>
8
8
  {h}
9
- </react_native_1.Text>:<react_native_1.Text key={S}style={V}>
9
+ </react_native_1.Text>:<react_native_1.Text key={A}style={V}>
10
10
  {h}
11
- </react_native_1.Text>)}if(T&&e._isFile){const r=e,w=r.type?.includes("image");return<react_native_1.View style={nodeStyles.treeNodeWrapper}>
11
+ </react_native_1.Text>)}if(S&&e._isFile){const r=e,w=r.type?.includes("image");return<react_native_1.View style={nodeStyles.treeNodeWrapper}>
12
12
  <IndentGuides level={i}/>
13
13
  <react_native_1.View style={nodeStyles.filePreviewNode}>
14
14
  {t!==void 0&&<react_native_1.Text style={[nodeStyles.codeKey,{marginBottom:4}]}>{`"${String(t)}": `}</react_native_1.Text>}
@@ -24,37 +24,37 @@
24
24
  </react_native_1.View>
25
25
  </react_native_1.View>
26
26
  </react_native_1.View>
27
- </react_native_1.View>}if(!T){const r=JSON.stringify(e)??String(e),w=t!==void 0?`"${String(t)}": `:null;return<react_native_1.View style={nodeStyles.treeNodeWrapper}>
27
+ </react_native_1.View>}if(!S){const r=JSON.stringify(e)??String(e),w=t!==void 0?`"${String(t)}": `:null;return<react_native_1.View style={nodeStyles.treeNodeWrapper}>
28
28
  <IndentGuides level={i}/>
29
29
  <react_native_1.View style={nodeStyles.leafRow}>
30
30
  <react_native_1.Text selectable={!0}style={nodeStyles.codeLine}>
31
31
  {w&&<react_native_1.Text style={nodeStyles.codeKey}>{w}</react_native_1.Text>}
32
- {N(r,e)}
32
+ {j(r,e)}
33
33
  </react_native_1.Text>
34
34
  </react_native_1.View>
35
- </react_native_1.View>}const m=v?e.map((r,w)=>[w,r]):Object.entries(e),B=v?`[${m.length}]`:`{${m.length}}`;return<react_native_1.View>
35
+ </react_native_1.View>}const C=v?e.map((r,w)=>[w,r]):Object.entries(e),z=v?`[${C.length}]`:`{${C.length}}`;return<react_native_1.View>
36
36
  <react_native_1.View style={nodeStyles.treeNodeWrapper}>
37
37
  <IndentGuides level={i}/>
38
- <react_native_1.Pressable style={nodeStyles.treeRow}onPress={()=>F(r=>!r)}hitSlop={{top:8,bottom:8,left:8,right:8}}>
39
- <react_native_1.View style={{transform:[{rotate:b?"180deg":"0deg"}],marginRight:6}}>
40
- <NetworkIcons_1.ChevronIcon color="#64748B"size={11}/>
38
+ <react_native_1.Pressable style={nodeStyles.treeRow}onPress={()=>T(r=>!r)}hitSlop={{top:8,bottom:8,left:8,right:8}}>
39
+ <react_native_1.View style={{transform:[{rotate:m?"180deg":"0deg"}],marginRight:6}}>
40
+ <NetworkIcons_1.ChevronIcon color={AppColors_1.AppColors.grayTextWeak}size={11}/>
41
41
  </react_native_1.View>
42
42
  {t!==void 0&&<react_native_1.Text style={[nodeStyles.codeKey,nodeStyles.treeKeyMargin]}>{`"${String(t)}": `}</react_native_1.Text>}
43
43
  <react_native_1.Text style={nodeStyles.codeSyntax}>{v?"[":"{"}</react_native_1.Text>
44
44
  <react_native_1.View style={v?nodeStyles.arrayBadge:nodeStyles.objectBadge}>
45
45
  <react_native_1.Text style={v?nodeStyles.arrayBadgeText:nodeStyles.objectBadgeText}>
46
- {B}
46
+ {z}
47
47
  </react_native_1.Text>
48
48
  </react_native_1.View>
49
49
  </react_native_1.Pressable>
50
50
  </react_native_1.View>
51
51
 
52
- {b&&m.map(([r,w])=><_ key={String(r)}name={r}data={w}level={i+1}search={n}forceOpen={p}defaultExpandDepth={x}/>)}
52
+ {m&&C.map(([r,w])=><_ key={String(r)}name={r}data={w}level={i+1}search={o}forceOpen={x}defaultExpandDepth={b}/>)}
53
53
 
54
- {b&&<react_native_1.View style={nodeStyles.treeNodeWrapper}>
54
+ {m&&<react_native_1.View style={nodeStyles.treeNodeWrapper}>
55
55
  <IndentGuides level={i}/>
56
56
  <react_native_1.View style={{paddingLeft:18}}>
57
57
  <react_native_1.Text style={nodeStyles.codeSyntax}>{v?"]":"}"}</react_native_1.Text>
58
58
  </react_native_1.View>
59
59
  </react_native_1.View>}
60
- </react_native_1.View>}),nodeStyles=react_native_1.StyleSheet.create({treeNodeWrapper:{flexDirection:"row",alignItems:"stretch"},indentGuidesContainer:{flexDirection:"row",alignItems:"stretch"},indentGuideCell:{width:14,alignItems:"flex-start",justifyContent:"center",position:"relative"},indentGuideLine:{position:"absolute",left:4,top:0,bottom:0,width:1,backgroundColor:"#E2E8F0"},leafRow:{paddingVertical:2,flex:1},treeRow:{flexDirection:"row",alignItems:"center",paddingVertical:3,flex:1},treeKeyMargin:{marginRight:2},codeLine:{fontFamily:monoFont,fontSize:12,lineHeight:18,color:"#0F172A"},codeKey:{fontFamily:monoFont,fontSize:12,color:"#4F46E5",fontWeight:"600"},codeSyntax:{fontFamily:monoFont,fontSize:12,color:"#64748B"},syntaxString:{fontFamily:monoFont,fontSize:12,color:"#059669"},syntaxNumber:{fontFamily:monoFont,fontSize:12,color:"#D97706"},syntaxBoolean:{fontFamily:monoFont,fontSize:12,color:"#DB2777"},syntaxNull:{fontFamily:monoFont,fontSize:12,color:"#E11D48",fontStyle:"italic"},highlight:{backgroundColor:"#FEF08A",color:"#854D0E",fontFamily:monoFont,fontWeight:"700",borderRadius:2},arrayBadge:{backgroundColor:"#EEF2FF",borderColor:"#C7D2FE",borderWidth:1,borderRadius:5,paddingHorizontal:5,paddingVertical:1,marginLeft:6},arrayBadgeText:{fontFamily:monoFont,color:"#4F46E5",fontSize:10,fontWeight:"600"},objectBadge:{backgroundColor:"#F1F5F9",borderColor:"#CBD5E1",borderWidth:1,borderRadius:5,paddingHorizontal:5,paddingVertical:1,marginLeft:6},objectBadgeText:{fontFamily:monoFont,color:"#475569",fontSize:10,fontWeight:"600"},filePreviewNode:{marginVertical:4},filePreviewCard:{flexDirection:"row",alignItems:"center",backgroundColor:"#FFFFFF",borderRadius:8,borderWidth:1,borderColor:"#E2E8F0",padding:8,gap:8,marginTop:2},filePreviewThumb:{width:36,height:36,borderRadius:4},filePreviewDoc:{width:36,height:36,borderRadius:4,backgroundColor:"#F1F5F9",alignItems:"center",justifyContent:"center"},filePreviewName:{fontFamily:monoFont,fontSize:11.5,color:"#0F172A"},filePreviewType:{fontFamily:monoFont,fontSize:10,color:"#64748B",marginTop:2}});exports.default=TreeNode;
60
+ </react_native_1.View>}),nodeStyles=react_native_1.StyleSheet.create({treeNodeWrapper:{flexDirection:"row",alignItems:"stretch"},indentGuidesContainer:{flexDirection:"row",alignItems:"stretch"},indentGuideCell:{width:14,alignItems:"flex-start",justifyContent:"center",position:"relative"},indentGuideLine:{position:"absolute",left:4,top:0,bottom:0,width:1,backgroundColor:AppColors_1.AppColors.dividerColor},leafRow:{paddingVertical:2,flex:1},treeRow:{flexDirection:"row",alignItems:"center",paddingVertical:3,flex:1},treeKeyMargin:{marginRight:2},codeLine:{fontFamily:monoFont,fontSize:12,lineHeight:18,color:AppColors_1.AppColors.primaryBlack},codeKey:{fontFamily:monoFont,fontSize:12,color:AppColors_1.AppColors.brandPurple,fontWeight:"600"},codeSyntax:{fontFamily:monoFont,fontSize:12,color:AppColors_1.AppColors.grayTextWeak},syntaxString:{fontFamily:monoFont,fontSize:12,color:AppColors_1.AppColors.emerald600},syntaxNumber:{fontFamily:monoFont,fontSize:12,color:AppColors_1.AppColors.amber600},syntaxBoolean:{fontFamily:monoFont,fontSize:12,color:AppColors_1.AppColors.pink600},syntaxNull:{fontFamily:monoFont,fontSize:12,color:AppColors_1.AppColors.rose600,fontStyle:"italic"},highlight:{backgroundColor:AppColors_1.AppColors.yellow200,color:AppColors_1.AppColors.yellow800,fontFamily:monoFont,fontWeight:"700",borderRadius:2},arrayBadge:{backgroundColor:AppColors_1.AppColors.purple50,borderColor:AppColors_1.AppColors.purple200,borderWidth:1,borderRadius:5,paddingHorizontal:5,paddingVertical:1,marginLeft:6},arrayBadgeText:{fontFamily:monoFont,color:AppColors_1.AppColors.brandPurple,fontSize:10,fontWeight:"600"},objectBadge:{backgroundColor:AppColors_1.AppColors.graySurface,borderColor:AppColors_1.AppColors.grayBorderSecondary,borderWidth:1,borderRadius:5,paddingHorizontal:5,paddingVertical:1,marginLeft:6},objectBadgeText:{fontFamily:monoFont,color:AppColors_1.AppColors.grayText,fontSize:10,fontWeight:"600"},filePreviewNode:{marginVertical:4},filePreviewCard:{flexDirection:"row",alignItems:"center",backgroundColor:AppColors_1.AppColors.primaryLight,borderRadius:8,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,padding:8,gap:8,marginTop:2},filePreviewThumb:{width:36,height:36,borderRadius:4},filePreviewDoc:{width:36,height:36,borderRadius:4,backgroundColor:AppColors_1.AppColors.graySurface,alignItems:"center",justifyContent:"center"},filePreviewName:{fontFamily:monoFont,fontSize:11.5,color:AppColors_1.AppColors.primaryBlack},filePreviewType:{fontFamily:monoFont,fontSize:10,color:AppColors_1.AppColors.grayTextWeak,marginTop:2}});exports.default=TreeNode;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "2.3.20";
1
+ export declare const LIB_VERSION = "2.3.22";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.3.20";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.3.22";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCachedBundleAnalysis=exports.clearCachedBundleAnalysis=exports.analyzeHostAppBundle=exports.getInitialBundleAnalysis=exports.parseBundleSource=exports.trackRuntimeDefine=exports.trackRuntimeModuleExecution=exports.getHostScriptURL=exports.getBundleModuleEnabled=exports.setBundleModuleEnabled=void 0;const AppColors_1=require("../styles/AppColors"),i18n_1=require("../i18n"),react_native_1=require("react-native");let cachedAnalysis=null,isAnalyzing=!1;const subscribers=[];let isBundleModuleEnabled=!1;const setBundleModuleEnabled=e=>{isBundleModuleEnabled=e};exports.setBundleModuleEnabled=setBundleModuleEnabled;const getBundleModuleEnabled=()=>isBundleModuleEnabled;exports.getBundleModuleEnabled=getBundleModuleEnabled;const getSourceCodeModule=()=>{try{const e=react_native_1.NativeModules?.SourceCode,o=e?.scriptURL||e?.getConstants?.()?.scriptURL;if(typeof o=="string"&&o.length>0)return{scriptURL:o}}catch{}try{const e=react_native_1.TurboModuleRegistry?.get?.("SourceCode"),o=e?.getConstants?.(),n=e?.scriptURL||o?.scriptURL;if(typeof n=="string"&&n.length>0)return{scriptURL:n}}catch{}return null},getHostScriptURL=()=>{try{const e=getSourceCodeModule()?.scriptURL;if(typeof e=="string"&&e.length>0)return e}catch{}try{const e=react_native_1.NativeModules?.PlatformConstants?.serverHost||react_native_1.NativeModules?.AndroidConstants?.serverHost||react_native_1.NativeModules?.DevSettings?.serverHost||react_native_1.NativeModules?.DevSettings?.getConstants?.()?.serverHost;if(typeof e=="string"&&e.length>0)return`${e.startsWith("http")?e:`http://${e}`}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`}catch{}try{const e=globalThis?.__DEV_SERVER_URL__||globalThis?.__METRO_SERVER_HOST__||globalThis?.__DEV_SERVER_PORT__||globalThis?.__METRO_PORT__;if(typeof e=="number")return`http://${react_native_1.Platform.OS==="android"?"10.0.2.2":"localhost"}:${e}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`;if(typeof e=="string"&&e.length>0)return/^\d+$/.test(e)?`http://${react_native_1.Platform.OS==="android"?"10.0.2.2":"localhost"}:${e}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`:e.startsWith("http")?e:`http://${e}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`}catch{}return""};exports.getHostScriptURL=getHostScriptURL;const DYNAMIC_DEV_PORTS=[8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,19e3,19001,3e3],extractHostAndPort=e=>{if(!e||typeof e!="string")return{host:null,port:null};const o=e.match(/^https?:\/\/([^:/]+)(?::(\d+))?/);return o?{host:o[1]||null,port:o[2]?parseInt(o[2],10):null}:{host:null,port:null}},probeCandidateUrlsInParallel=async(e,o=3e3)=>{const{host:n,port:c}=extractHostAndPort(e);if(e&&e.startsWith("http"))try{const m=new AbortController,g=setTimeout(()=>m.abort(),o),b=await fetch(e,{signal:m.signal});if(clearTimeout(g),b.ok){const h=b.headers.get("content-length"),f=await b.text();if(f&&f.length>0){const x=h&&parseInt(h,10)||f.length;return{text:f,bytes:x,url:e}}}}catch{}const a=n?[n,"localhost","127.0.0.1",...react_native_1.Platform.OS==="android"?["10.0.2.2","10.0.3.2"]:[]]:["localhost","127.0.0.1",...react_native_1.Platform.OS==="android"?["10.0.2.2","10.0.3.2"]:[]],p=Array.from(new Set(a)),u=c?Array.from(new Set([c,...DYNAMIC_DEV_PORTS])):DYNAMIC_DEV_PORTS,i=[];for(const m of p)for(const g of u)i.push(new Promise(async(b,h)=>{const f=new AbortController,x=setTimeout(()=>f.abort(),700);try{const S=await fetch(`http://${m}:${g}/status`,{signal:f.signal});if(clearTimeout(x),S.ok){const M=await S.text();if(M&&M.includes("packager-status:running")){b({host:m,port:g});return}}}catch{clearTimeout(x)}h(new Error("unreachable"))}));let d=null;try{d=await new Promise((m,g)=>{let b=i.length;if(b===0){g(new Error("No candidate hosts"));return}i.forEach(h=>{h.then(m).catch(()=>{b--,b===0&&g(new Error("All probes failed"))})})})}catch{d=null}if(d){const m=`http://${d.host}:${d.port}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`;try{const g=new AbortController,b=setTimeout(()=>g.abort(),o),h=await fetch(m,{signal:g.signal});if(clearTimeout(b),h.ok){const f=h.headers.get("content-length"),x=await h.text();if(x&&x.length>0){const S=f&&parseInt(f,10)||x.length;return{text:x,bytes:S,url:m}}}}catch{}}return null},executedModuleIds=new Set,runtimeModules=new Map,trackRuntimeModuleExecution=()=>{try{const e=globalThis,o=e.__r;if(typeof o=="function"&&!o.__inspectorTracked){const n=function(c,...a){return executedModuleIds.add(Number(c)),o.call(this,c,...a)};Object.defineProperty(n,"__inspectorTracked",{value:!0,enumerable:!1}),e.__r=n}}catch{}};exports.trackRuntimeModuleExecution=trackRuntimeModuleExecution;const trackRuntimeDefine=()=>{try{const e=globalThis,o=e.__d;if(typeof o=="function"&&!o.__inspectorTracked){const n=function(c,a,p,u,...i){return typeof u=="string"&&u.length>0&&runtimeModules.set(Number(a),{id:Number(a),path:u}),o.call(this,c,a,p,u,...i)};Object.defineProperty(n,"__inspectorTracked",{value:!0,enumerable:!1}),e.__d=n}}catch{}};exports.trackRuntimeDefine=trackRuntimeDefine,(0,exports.trackRuntimeModuleExecution)(),(0,exports.trackRuntimeDefine)();const DEFAULT_BASELINE_MODULES=[{id:1,deps:[2,3,4],path:"index.js"},{id:2,deps:[4,5,13,14,15,16],path:"App.tsx"},{id:3,deps:[],path:"node_modules/react-native/index.js"},{id:4,deps:[],path:"node_modules/react/index.js"},{id:5,deps:[6,7],path:"node_modules/@react-navigation/native/src/index.ts"},{id:6,deps:[],path:"node_modules/react-native-screens/src/index.ts"},{id:7,deps:[],path:"node_modules/react-native-safe-area-context/src/index.ts"},{id:8,deps:[],path:"node_modules/react-native-svg/src/index.ts"},{id:9,deps:[],path:"node_modules/axios/index.js"},{id:10,deps:[],path:"node_modules/i18next/dist/esm/i18next.js"},{id:11,deps:[12],path:"node_modules/react-redux/src/index.ts"},{id:12,deps:[],path:"node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js"},{id:13,deps:[],path:"src/components/Inspector/BundleTab.tsx"},{id:14,deps:[],path:"src/navigation/RootNavigator.tsx"},{id:15,deps:[],path:"src/screens/HomeScreen.tsx"},{id:16,deps:[],path:"src/store/index.ts"},{id:17,deps:[],path:"assets/images/logo.png"},{id:18,deps:[],path:"package.json"}],extractBundleModules=e=>{const o=[],n=new Set;if(e&&e.length>0){const c=/\/\/[#@]\s*sourceURL=(?:https?:\/\/[^\s\r\n/]+\/|file:\/\/)?([^\s\r\n?#]+)/g;let a,p=9e5;for(;(a=c.exec(e))!==null;){const d=a[1];if(d&&d.length>0&&!d.endsWith(".bundle")){const m=p++;n.has(m)||(n.add(m),o.push({id:m,deps:[],path:d}))}}const u=/,\s*(\d+)\s*,\s*(?:\[[^\]\r\n]{0,500}\]|\{[^}\r\n]{0,500}\})\s*,\s*["']([^"'\r\n]+)["']\s*\)/g;let i;for(;(i=u.exec(e))!==null;){const d=parseInt(i[1],10),m=i[2]||"";!n.has(d)&&m.length>0&&(n.add(d),o.push({id:d,deps:[],path:m}))}}return runtimeModules.forEach((c,a)=>{n.has(a)||(n.add(a),o.push({id:a,deps:[],path:c.path}))}),o.length===0?DEFAULT_BASELINE_MODULES:o},getStaticStartupModuleIds=e=>{const o=new Set;if(!e)return o;const n=/__r\s*\(\s*(\d+)\s*\)/g;let c;for(;(c=n.exec(e))!==null;)o.add(parseInt(c[1],10));return o},detectProjectRoot=e=>{const o=e.map(i=>i.replace(/\\/g,"/"));for(const i of o){const d=i.indexOf("/node_modules/");if(d!==-1)return i.slice(0,d+1)}for(const i of o){const d=i.match(/^(.*\/)(?:index\.[jt]sx?|app\.[jt]sx?|package\.json)(?:[?#].*)?$/i);if(d&&d[1])return d[1]}const n=o.filter(i=>i.startsWith("/")&&!i.includes("/node_modules/"));if(n.length===0)return"";if(n.length===1){const i=n[0].lastIndexOf("/");return i>0?n[0].slice(0,i+1):""}const c=n.map(i=>i.split("/"));let a=0;const p=c[0],u=Math.min(...c.map(i=>i.length));for(;a<u-1;){const i=p[a];if(c.every(d=>d[a]===i))a++;else break}return a>0?p.slice(0,a).join("/")+"/":""},normalizeProjectRelativePath=(e,o)=>{let n=e.replace(/\\/g,"/");const c=n.search(/[?#]/);return c!==-1&&(n=n.slice(0,c)),n=n.replace(/^(?:https?:\/\/[^/]+\/|file:\/\/)/,""),o&&n.startsWith(o)&&(n=n.slice(o.length)),n=n.replace(/^(\.\.\/)+/,"").replace(/^\.\//,"").replace(/^\/+/,""),n||(n=e.split("/").pop()||e),n},isExternalPackage=e=>{if(e.includes("node_modules/")){const o=e.match(/node_modules\/(?:@([^/]+)\/([^/]+)|([^/]+))/);return o?{isPkg:!0,pkgName:o[1]&&o[2]?`@${o[1]}/${o[2]}`:o[3]}:{isPkg:!0}}return e.includes("react-native-inapp-inspector")?{isPkg:!0,pkgName:"react-native-inapp-inspector"}:e.includes(".yarn/")||e.includes(".pnpm/")?{isPkg:!0}:e.includes("/dist/esm/")||e.includes("/dist/commonjs/")||e.includes("/dist/cjs/")||e.startsWith("dist/esm/")||e.startsWith("dist/commonjs/")||e.startsWith("dist/")||e.includes("/react-native-inapp-inspector/dist/")?{isPkg:!0,pkgName:"react-native-inapp-inspector"}:{isPkg:!1}},isInternalModule=e=>e.startsWith("<<")||e.startsWith("[metro]")||e.includes("metro-runtime")||e.includes("polyfills/require.js")||e.includes("prelude_commonjs")||e.includes("Libraries/Core/InitializeCore.js")||e.includes("@babel/runtime"),parseBundleSource=(e,o,n,c=!0)=>{const a=!!globalThis.HermesInternal,p=Number((o/(1024*1024)).toFixed(2)),u=Math.round(o/1024),i=extractBundleModules(e),d=getStaticStartupModuleIds(e),m=new Map;for(const t of i)m.set(t.id,t);const g=new Set,b=[],h=t=>{g.has(t)||(g.add(t),b.push(t))};h(0),d.forEach(t=>h(t)),executedModuleIds.forEach(t=>h(t));for(const t of i){const s=t.path.toLowerCase().replace(/\\/g,"/");(s.endsWith("/index.js")||s.endsWith("/index.ts")||s.endsWith("/index.tsx")||s==="index.js"||s.endsWith("/app.tsx")||s.endsWith("/app.js")||s.endsWith("/app.jsx")||s==="app.tsx"||s==="app.js"||s.endsWith("app.json"))&&h(t.id)}for(;b.length>0;){const t=b.shift(),s=m.get(t);if(s&&s.deps)for(const r of s.deps)h(r)}const f=new Map,x=[];for(const t of i){const s=t.path.replace(/\\/g,"/"),{isPkg:r,pkgName:v}=isExternalPackage(s);if(r){v&&!v.startsWith(".")&&f.set(v,(f.get(v)||0)+1);continue}isInternalModule(s)||x.push({mod:t,rawPath:s})}const S=detectProjectRoot(i.map(t=>t.path)),M=[];let oe=0;for(const{mod:t,rawPath:s}of x){const r=normalizeProjectRelativePath(s,S);if(!(r.endsWith(".tsx")||r.endsWith(".ts")||r.endsWith(".jsx")||r.endsWith(".js")||r.endsWith(".mjs")||r.endsWith(".cjs")||r.endsWith(".json")||r.endsWith(".png")||r.endsWith(".jpg")||r.endsWith(".jpeg")||r.endsWith(".gif")||r.endsWith(".webp")||r.endsWith(".svg")||r.endsWith(".bmp")||r.endsWith(".ico")||r.endsWith(".ttf")||r.endsWith(".otf")||r.endsWith(".woff")||r.endsWith(".woff2")||r.endsWith(".css")||r.endsWith(".scss")||r.endsWith(".html")||r.endsWith(".md")||r.endsWith(".graphql")||r.endsWith(".gql")))continue;const l=r.split(".").pop()?.toUpperCase()||"JS",j=r.split("/").pop()||r;let A="javascript",N=AppColors_1.AppColors.indigo500;l==="TSX"||l==="TS"?(A="typescript",N=AppColors_1.AppColors.sky500):l==="PNG"||l==="JPG"||l==="JPEG"||l==="GIF"||l==="WEBP"||l==="SVG"||l==="BMP"||l==="ICO"?(A="image",N=AppColors_1.AppColors.pink500):l==="TTF"||l==="OTF"||l==="WOFF"||l==="WOFF2"?(A="font",N=AppColors_1.AppColors.purple500):(l==="JSON"||l==="CSS"||l==="SCSS"||l==="HTML"||l==="MD"||l==="GRAPHQL"||l==="GQL")&&(A="json",N=AppColors_1.AppColors.emerald500);const X=Math.max(2,Math.round(u*.15/Math.max(i.length,20))),Y=!(r.includes(".test.")||r.includes(".spec.")||r.includes("__tests__")||r.includes("__mocks__")||r.includes(".stories.")||r.includes("fixtures/"));M.push({id:`host-file-${oe++}`,name:j,path:r,ext:l,category:A,sizeKb:X,meta:`Active Host App Module \u2022 ${A.toUpperCase()}`,color:N,status:Y?"optimal":"warning",advice:Y?"In-Use: Bundled and active in host application dependency tree":"Not consumed: Test fixture or orphaned file packaged in bundle",isConsumed:Y})}const ne=t=>{const s=[AppColors_1.AppColors.indigo500,AppColors_1.AppColors.sky500,AppColors_1.AppColors.pink500,AppColors_1.AppColors.purple500,AppColors_1.AppColors.emerald500,AppColors_1.AppColors.amber500,AppColors_1.AppColors.red500,AppColors_1.AppColors.teal500,"#3B82F6",AppColors_1.AppColors.fuchsia500,AppColors_1.AppColors.orange500,AppColors_1.AppColors.lime500,"#06B6D4","#A855F7",AppColors_1.AppColors.errorColor];let r=0;for(let v=0;v<t.length;v++)r=t.charCodeAt(v)+((r<<5)-r);return s[Math.abs(r)%s.length]},re=t=>{const s=t.toLowerCase();return s.includes("navigation")||s.includes("router")||s.includes("screen")?"navigation":s.includes("ui")||s.includes("reanimated")||s.includes("gesture")||s.includes("svg")||s.includes("lottie")||s.includes("vector")||s.includes("icon")||s.includes("image")||s.includes("gradient")?"ui":s.includes("axios")||s.includes("fetch")||s.includes("query")||s.includes("apollo")||s.includes("network")||s.includes("socket")||s.includes("http")?"network":s==="react"||s==="react-native"||s.includes("metro")||s.includes("babel")||s.includes("core")?"core":"utils"},ie=t=>t.startsWith("@react-navigation/")?t==="@react-navigation/native"?null:"@react-navigation/native":t.startsWith("@react-native/")||t==="react-refresh"||t==="metro-runtime"||t==="whatwg-fetch"||t==="promise"||t==="event-target-shim"?"react-native":t==="scheduler"||t==="loose-envify"||t==="object-assign"?"react":t==="use-sync-external-store"||t==="reselect"||t==="redux-thunk"||t==="immer"?"react-redux":t==="follow-redirects"||t==="form-data"||t==="proxy-from-env"?"axios":t==="clone-deep"||t==="html-parse-stringify"||t==="@babel/runtime"?"i18next":t==="css-select"||t==="css-tree"||t==="entities"?"react-native-svg":null,Z=Array.from(f.entries()),ae=Z.reduce((t,[,s])=>t+s,0)||1,k=[];Z.forEach(([t,s],r)=>{const v=re(t),l=ne(t),j=ie(t)||void 0,A=!j,N=Math.max(8,Math.round(u*.52*s/Math.max(ae,1))),X=Number((N/Math.max(u,1)*100).toFixed(1));k.push({id:`host-pkg-${r}`,name:t,version:"",latestVersion:"",sizeKb:N,percentage:X,type:A?"direct":"transitive",isDirectDefined:A,parentPackageName:j,subpackages:[],category:v,color:l,description:`${s} bundled ${s===1?"module":"modules"}`,npmUrl:`https://www.npmjs.com/package/${t}`,isDeprecated:!1,lastActive:`${s} modules`})});const E=new Map;k.forEach(t=>{t.isDirectDefined&&E.set(t.name,t)}),k.forEach(t=>{if(t.parentPackageName&&E.has(t.parentPackageName)){const s=E.get(t.parentPackageName);s.subpackages||(s.subpackages=[]),s.subpackages.push(t)}}),k.sort((t,s)=>s.sizeKb-t.sizeKb);let R=0;for(const t of k)R+=t.sizeKb||0;let B=0,I=0;for(const t of M)t.category==="image"||t.category==="font"?I+=t.sizeKb||0:B+=t.sizeKb||0;const T=B>0?B:Math.round(u*.18),w=R>0?R:Math.round(u*.58),P=I>0?I:Math.round(u*.08),ee=Math.max(0,u-T-w-P),C=Number((u*.38/1024).toFixed(2)),D=Number((w/1024).toFixed(2)),O=Number((P/1024).toFixed(2)),W=Math.min(k.length,55),z=Number((48+W*.35+D*.9).toFixed(1)),H=Number((38+W*.22+D*.6).toFixed(1)),L=Number((30+O*2.2).toFixed(1)),$=6.4,_=Number((C+z+H+L+$).toFixed(1)),ce=Number((_*.655).toFixed(1)),U=Number((20+W*.12+D*.4).toFixed(1)),K=Number((14+W*.08+D*.25).toFixed(1)),q=Number((16+O*1.5).toFixed(1)),y=Number((C+U+K+q+3.8).toFixed(1)),te=Number((y*.54).toFixed(1)),V=Number((195+W*.55+D*1.6).toFixed(1)),G=Number((54+W*.2+D*.6).toFixed(1)),J=Number((58+O*2.8).toFixed(1)),Q=8.5,F=Number((C+V+G+J+Q).toFixed(1)),de=Number(F.toFixed(1)),le=[{id:"ios-c1",name:(0,i18n_1.t)("bundle.iosComp1Name"),category:"frameworks",sizeMb:z,pct:Number((z/_*100).toFixed(1)),color:AppColors_1.AppColors.indigo500,description:(0,i18n_1.t)("bundle.iosComp1Desc",{count:k.length}),advice:(0,i18n_1.t)("bundle.iosComp1Advice")},{id:"ios-c2",name:(0,i18n_1.t)("bundle.iosComp2Name"),category:"native",sizeMb:H,pct:Number((H/_*100).toFixed(1)),color:AppColors_1.AppColors.sky500,description:(0,i18n_1.t)("bundle.iosComp2Desc"),advice:(0,i18n_1.t)("bundle.iosComp2Advice")},{id:"ios-c3",name:(0,i18n_1.t)("bundle.iosComp3Name"),category:"assets",sizeMb:L,pct:Number((L/_*100).toFixed(1)),color:AppColors_1.AppColors.pink500,description:(0,i18n_1.t)("bundle.iosComp3Desc"),advice:(0,i18n_1.t)("bundle.iosComp3Advice")},{id:"ios-c4",name:(0,i18n_1.t)("bundle.iosComp4Name"),category:"js",sizeMb:C,pct:Number((C/_*100).toFixed(1)),color:AppColors_1.AppColors.emerald500,description:(0,i18n_1.t)("bundle.iosComp4Desc",{count:M.length}),advice:(0,i18n_1.t)("bundle.iosComp4Advice")},{id:"ios-c5",name:(0,i18n_1.t)("bundle.iosComp5Name"),category:"meta",sizeMb:$,pct:Number(($/_*100).toFixed(1)),color:AppColors_1.AppColors.amber500,description:(0,i18n_1.t)("bundle.iosComp5Desc"),advice:(0,i18n_1.t)("bundle.iosComp5Advice")}],se=[{id:"and-c1",name:(0,i18n_1.t)("bundle.andComp1Name"),category:"native",sizeMb:U,pct:Number((U/y*100).toFixed(1)),color:AppColors_1.AppColors.sky500,description:(0,i18n_1.t)("bundle.andComp1Desc",{count:k.length}),advice:(0,i18n_1.t)("bundle.andComp1Advice")},{id:"and-c2",name:(0,i18n_1.t)("bundle.andComp2Name"),category:"frameworks",sizeMb:K,pct:Number((K/y*100).toFixed(1)),color:AppColors_1.AppColors.indigo500,description:(0,i18n_1.t)("bundle.andComp2Desc"),advice:(0,i18n_1.t)("bundle.andComp2Advice")},{id:"and-c3",name:(0,i18n_1.t)("bundle.andComp3Name"),category:"assets",sizeMb:q,pct:Number((q/y*100).toFixed(1)),color:AppColors_1.AppColors.pink500,description:(0,i18n_1.t)("bundle.andComp3Desc"),advice:(0,i18n_1.t)("bundle.andComp3Advice")},{id:"and-c4",name:(0,i18n_1.t)("bundle.andComp4Name"),category:"js",sizeMb:C,pct:Number((C/y*100).toFixed(1)),color:AppColors_1.AppColors.emerald500,description:(0,i18n_1.t)("bundle.andComp4Desc",{count:M.length}),advice:(0,i18n_1.t)("bundle.andComp4Advice")},{id:"and-c5",name:(0,i18n_1.t)("bundle.andComp5Name"),category:"meta",sizeMb:3.8,pct:Number((3.8/y*100).toFixed(1)),color:AppColors_1.AppColors.amber500,description:(0,i18n_1.t)("bundle.andComp5Desc"),advice:(0,i18n_1.t)("bundle.andComp5Advice")}],pe=[{id:"apk-c1",name:(0,i18n_1.t)("bundle.apkComp1Name"),category:"native",sizeMb:V,pct:Number((V/F*100).toFixed(1)),color:AppColors_1.AppColors.sky500,description:(0,i18n_1.t)("bundle.apkComp1Desc"),advice:(0,i18n_1.t)("bundle.apkComp1Advice")},{id:"apk-c2",name:(0,i18n_1.t)("bundle.apkComp2Name"),category:"frameworks",sizeMb:G,pct:Number((G/F*100).toFixed(1)),color:AppColors_1.AppColors.indigo500,description:(0,i18n_1.t)("bundle.apkComp2Desc"),advice:(0,i18n_1.t)("bundle.apkComp2Advice")},{id:"apk-c3",name:(0,i18n_1.t)("bundle.apkComp3Name"),category:"assets",sizeMb:J,pct:Number((J/F*100).toFixed(1)),color:AppColors_1.AppColors.pink500,description:(0,i18n_1.t)("bundle.apkComp3Desc"),advice:(0,i18n_1.t)("bundle.apkComp3Advice")},{id:"apk-c4",name:(0,i18n_1.t)("bundle.apkComp4Name"),category:"js",sizeMb:C,pct:Number((C/F*100).toFixed(1)),color:AppColors_1.AppColors.emerald500,description:(0,i18n_1.t)("bundle.apkComp4Desc",{count:M.length}),advice:(0,i18n_1.t)("bundle.apkComp4Advice")},{id:"apk-c5",name:(0,i18n_1.t)("bundle.apkComp5Name"),category:"meta",sizeMb:Q,pct:Number((Q/F*100).toFixed(1)),color:AppColors_1.AppColors.amber500,description:(0,i18n_1.t)("bundle.apkComp5Desc"),advice:(0,i18n_1.t)("bundle.apkComp5Advice")}];return{isLive:c,scriptURL:n,totalDevBytes:o,totalDevMb:p,totalDevKb:u,isHermes:a,moduleCount:i.length||M.length+k.length,packageCount:k.length,filesCount:M.length,splitUp:{appSource:{kb:T,mb:Number((T/1024).toFixed(2)),pct:15},nodeModules:{kb:w,mb:Number((w/1024).toFixed(2)),pct:52},assetsMedia:{kb:P,mb:Number((P/1024).toFixed(2)),pct:12},metroDevOverhead:{kb:ee,mb:Number((ee/1024).toFixed(2)),pct:21}},files:M,packages:k,production:{ios:{totalInstallMb:_,totalDownloadMb:ce,compressionRatioPct:Number(((p-C)/Math.max(p,1)*100).toFixed(1)),components:le},androidAab:{totalInstallMb:y,totalDownloadMb:te,compressionRatioPct:Number(((p-C)/Math.max(p,1)*100).toFixed(1)),components:se},androidApk:{totalInstallMb:F,totalDownloadMb:de,compressionRatioPct:Number(((p-C)/Math.max(p,1)*.7).toFixed(1)),components:pe},android:{totalInstallMb:y,totalDownloadMb:te,compressionRatioPct:Number(((p-C)/Math.max(p,1)*100).toFixed(1)),components:se}}}};exports.parseBundleSource=parseBundleSource;const getInitialBundleAnalysis=()=>{if(cachedAnalysis)return cachedAnalysis;const e=(0,exports.getHostScriptURL)();return(0,exports.parseBundleSource)("",684e4,e||"unknown",!1)};exports.getInitialBundleAnalysis=getInitialBundleAnalysis;const analyzeHostAppBundle=async(e=!1)=>{if(e&&(cachedAnalysis=null),cachedAnalysis&&!e)return cachedAnalysis;if(isAnalyzing)return new Promise(a=>{subscribers.push(a)});isAnalyzing=!0;const o=(0,exports.getHostScriptURL)();try{const a=await probeCandidateUrlsInParallel(o,2500);if(a&&a.text&&a.text.length>0){const p=(0,exports.parseBundleSource)(a.text,a.bytes,a.url);return cachedAnalysis=p,isAnalyzing=!1,subscribers.forEach(u=>u(p)),subscribers.length=0,p}}catch{}const c=(0,exports.parseBundleSource)("",684e4,o||"unknown",!1);return cachedAnalysis=c,isAnalyzing=!1,subscribers.forEach(a=>a(c)),subscribers.length=0,c};exports.analyzeHostAppBundle=analyzeHostAppBundle;const clearCachedBundleAnalysis=()=>{cachedAnalysis=null};exports.clearCachedBundleAnalysis=clearCachedBundleAnalysis;const getCachedBundleAnalysis=()=>cachedAnalysis;exports.getCachedBundleAnalysis=getCachedBundleAnalysis;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCachedBundleAnalysis=exports.clearCachedBundleAnalysis=exports.analyzeHostAppBundle=exports.getInitialBundleAnalysis=exports.parseBundleSource=exports.trackRuntimeDefine=exports.trackRuntimeModuleExecution=exports.getHostScriptURL=exports.getBundleModuleEnabled=exports.setBundleModuleEnabled=void 0;const AppColors_1=require("../styles/AppColors"),i18n_1=require("../i18n"),react_native_1=require("react-native");let cachedAnalysis=null,isAnalyzing=!1;const subscribers=[];let isBundleModuleEnabled=!1;const setBundleModuleEnabled=e=>{isBundleModuleEnabled=e};exports.setBundleModuleEnabled=setBundleModuleEnabled;const getBundleModuleEnabled=()=>isBundleModuleEnabled;exports.getBundleModuleEnabled=getBundleModuleEnabled;const getSourceCodeModule=()=>{try{const e=react_native_1.NativeModules?.SourceCode,o=e?.scriptURL||e?.getConstants?.()?.scriptURL;if(typeof o=="string"&&o.length>0)return{scriptURL:o}}catch{}try{const e=react_native_1.TurboModuleRegistry?.get?.("SourceCode"),o=e?.getConstants?.(),n=e?.scriptURL||o?.scriptURL;if(typeof n=="string"&&n.length>0)return{scriptURL:n}}catch{}return null},getHostScriptURL=()=>{try{const e=getSourceCodeModule()?.scriptURL;if(typeof e=="string"&&e.length>0)return e}catch{}try{const e=react_native_1.NativeModules?.PlatformConstants?.serverHost||react_native_1.NativeModules?.AndroidConstants?.serverHost||react_native_1.NativeModules?.DevSettings?.serverHost||react_native_1.NativeModules?.DevSettings?.getConstants?.()?.serverHost;if(typeof e=="string"&&e.length>0)return`${e.startsWith("http")?e:`http://${e}`}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`}catch{}try{const e=globalThis?.__DEV_SERVER_URL__||globalThis?.__METRO_SERVER_HOST__||globalThis?.__DEV_SERVER_PORT__||globalThis?.__METRO_PORT__;if(typeof e=="number")return`http://${react_native_1.Platform.OS==="android"?"10.0.2.2":"localhost"}:${e}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`;if(typeof e=="string"&&e.length>0)return/^\d+$/.test(e)?`http://${react_native_1.Platform.OS==="android"?"10.0.2.2":"localhost"}:${e}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`:e.startsWith("http")?e:`http://${e}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`}catch{}return""};exports.getHostScriptURL=getHostScriptURL;const DYNAMIC_DEV_PORTS=[8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,19e3,19001,3e3],extractHostAndPort=e=>{if(!e||typeof e!="string")return{host:null,port:null};const o=e.match(/^https?:\/\/([^:/]+)(?::(\d+))?/);return o?{host:o[1]||null,port:o[2]?parseInt(o[2],10):null}:{host:null,port:null}},probeCandidateUrlsInParallel=async(e,o=3e3)=>{const{host:n,port:c}=extractHostAndPort(e);if(e&&e.startsWith("http"))try{const m=new AbortController,g=setTimeout(()=>m.abort(),o),b=await fetch(e,{signal:m.signal});if(clearTimeout(g),b.ok){const h=b.headers.get("content-length"),f=await b.text();if(f&&f.length>0){const x=h&&parseInt(h,10)||f.length;return{text:f,bytes:x,url:e}}}}catch{}const a=n?[n,"localhost","127.0.0.1",...react_native_1.Platform.OS==="android"?["10.0.2.2","10.0.3.2"]:[]]:["localhost","127.0.0.1",...react_native_1.Platform.OS==="android"?["10.0.2.2","10.0.3.2"]:[]],p=Array.from(new Set(a)),u=c?Array.from(new Set([c,...DYNAMIC_DEV_PORTS])):DYNAMIC_DEV_PORTS,i=[];for(const m of p)for(const g of u)i.push(new Promise(async(b,h)=>{const f=new AbortController,x=setTimeout(()=>f.abort(),700);try{const S=await fetch(`http://${m}:${g}/status`,{signal:f.signal});if(clearTimeout(x),S.ok){const M=await S.text();if(M&&M.includes("packager-status:running")){b({host:m,port:g});return}}}catch{clearTimeout(x)}h(new Error("unreachable"))}));let d=null;try{d=await new Promise((m,g)=>{let b=i.length;if(b===0){g(new Error("No candidate hosts"));return}i.forEach(h=>{h.then(m).catch(()=>{b--,b===0&&g(new Error("All probes failed"))})})})}catch{d=null}if(d){const m=`http://${d.host}:${d.port}/index.bundle?platform=${react_native_1.Platform.OS}&dev=true`;try{const g=new AbortController,b=setTimeout(()=>g.abort(),o),h=await fetch(m,{signal:g.signal});if(clearTimeout(b),h.ok){const f=h.headers.get("content-length"),x=await h.text();if(x&&x.length>0){const S=f&&parseInt(f,10)||x.length;return{text:x,bytes:S,url:m}}}}catch{}}return null},executedModuleIds=new Set,runtimeModules=new Map,trackRuntimeModuleExecution=()=>{try{const e=globalThis,o=e.__r;if(typeof o=="function"&&!o.__inspectorTracked){const n=function(c,...a){return executedModuleIds.add(Number(c)),o.call(this,c,...a)};Object.defineProperty(n,"__inspectorTracked",{value:!0,enumerable:!1}),e.__r=n}}catch{}};exports.trackRuntimeModuleExecution=trackRuntimeModuleExecution;const trackRuntimeDefine=()=>{try{const e=globalThis,o=e.__d;if(typeof o=="function"&&!o.__inspectorTracked){const n=function(c,a,p,u,...i){return typeof u=="string"&&u.length>0&&runtimeModules.set(Number(a),{id:Number(a),path:u}),o.call(this,c,a,p,u,...i)};Object.defineProperty(n,"__inspectorTracked",{value:!0,enumerable:!1}),e.__d=n}}catch{}};exports.trackRuntimeDefine=trackRuntimeDefine,(0,exports.trackRuntimeModuleExecution)(),(0,exports.trackRuntimeDefine)();const DEFAULT_BASELINE_MODULES=[{id:1,deps:[2,3,4],path:"index.js"},{id:2,deps:[4,5,13,14,15,16],path:"App.tsx"},{id:3,deps:[],path:"node_modules/react-native/index.js"},{id:4,deps:[],path:"node_modules/react/index.js"},{id:5,deps:[6,7],path:"node_modules/@react-navigation/native/src/index.ts"},{id:6,deps:[],path:"node_modules/react-native-screens/src/index.ts"},{id:7,deps:[],path:"node_modules/react-native-safe-area-context/src/index.ts"},{id:8,deps:[],path:"node_modules/react-native-svg/src/index.ts"},{id:9,deps:[],path:"node_modules/axios/index.js"},{id:10,deps:[],path:"node_modules/i18next/dist/esm/i18next.js"},{id:11,deps:[12],path:"node_modules/react-redux/src/index.ts"},{id:12,deps:[],path:"node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js"},{id:13,deps:[],path:"src/components/Inspector/BundleTab.tsx"},{id:14,deps:[],path:"src/navigation/RootNavigator.tsx"},{id:15,deps:[],path:"src/screens/HomeScreen.tsx"},{id:16,deps:[],path:"src/store/index.ts"},{id:17,deps:[],path:"assets/images/logo.png"},{id:18,deps:[],path:"package.json"}],extractBundleModules=e=>{const o=[],n=new Set;if(e&&e.length>0){const c=/\/\/[#@]\s*sourceURL=(?:https?:\/\/[^\s\r\n/]+\/|file:\/\/)?([^\s\r\n?#]+)/g;let a,p=9e5;for(;(a=c.exec(e))!==null;){const d=a[1];if(d&&d.length>0&&!d.endsWith(".bundle")){const m=p++;n.has(m)||(n.add(m),o.push({id:m,deps:[],path:d}))}}const u=/,\s*(\d+)\s*,\s*(?:\[[^\]\r\n]{0,500}\]|\{[^}\r\n]{0,500}\})\s*,\s*["']([^"'\r\n]+)["']\s*\)/g;let i;for(;(i=u.exec(e))!==null;){const d=parseInt(i[1],10),m=i[2]||"";!n.has(d)&&m.length>0&&(n.add(d),o.push({id:d,deps:[],path:m}))}}return runtimeModules.forEach((c,a)=>{n.has(a)||(n.add(a),o.push({id:a,deps:[],path:c.path}))}),o.length===0?DEFAULT_BASELINE_MODULES:o},getStaticStartupModuleIds=e=>{const o=new Set;if(!e)return o;const n=/__r\s*\(\s*(\d+)\s*\)/g;let c;for(;(c=n.exec(e))!==null;)o.add(parseInt(c[1],10));return o},detectProjectRoot=e=>{const o=e.map(i=>i.replace(/\\/g,"/"));for(const i of o){const d=i.indexOf("/node_modules/");if(d!==-1)return i.slice(0,d+1)}for(const i of o){const d=i.match(/^(.*\/)(?:index\.[jt]sx?|app\.[jt]sx?|package\.json)(?:[?#].*)?$/i);if(d&&d[1])return d[1]}const n=o.filter(i=>i.startsWith("/")&&!i.includes("/node_modules/"));if(n.length===0)return"";if(n.length===1){const i=n[0].lastIndexOf("/");return i>0?n[0].slice(0,i+1):""}const c=n.map(i=>i.split("/"));let a=0;const p=c[0],u=Math.min(...c.map(i=>i.length));for(;a<u-1;){const i=p[a];if(c.every(d=>d[a]===i))a++;else break}return a>0?p.slice(0,a).join("/")+"/":""},normalizeProjectRelativePath=(e,o)=>{let n=e.replace(/\\/g,"/");const c=n.search(/[?#]/);return c!==-1&&(n=n.slice(0,c)),n=n.replace(/^(?:https?:\/\/[^/]+\/|file:\/\/)/,""),o&&n.startsWith(o)&&(n=n.slice(o.length)),n=n.replace(/^(\.\.\/)+/,"").replace(/^\.\//,"").replace(/^\/+/,""),n||(n=e.split("/").pop()||e),n},isExternalPackage=e=>{if(e.includes("node_modules/")){const o=e.match(/node_modules\/(?:@([^/]+)\/([^/]+)|([^/]+))/);return o?{isPkg:!0,pkgName:o[1]&&o[2]?`@${o[1]}/${o[2]}`:o[3]}:{isPkg:!0}}return e.includes("react-native-inapp-inspector")?{isPkg:!0,pkgName:"react-native-inapp-inspector"}:e.includes(".yarn/")||e.includes(".pnpm/")?{isPkg:!0}:e.includes("/dist/esm/")||e.includes("/dist/commonjs/")||e.includes("/dist/cjs/")||e.startsWith("dist/esm/")||e.startsWith("dist/commonjs/")||e.startsWith("dist/")||e.includes("/react-native-inapp-inspector/dist/")?{isPkg:!0,pkgName:"react-native-inapp-inspector"}:{isPkg:!1}},isInternalModule=e=>e.startsWith("<<")||e.startsWith("[metro]")||e.includes("metro-runtime")||e.includes("polyfills/require.js")||e.includes("prelude_commonjs")||e.includes("Libraries/Core/InitializeCore.js")||e.includes("@babel/runtime"),parseBundleSource=(e,o,n,c=!0)=>{const a=!!globalThis.HermesInternal,p=Number((o/(1024*1024)).toFixed(2)),u=Math.round(o/1024),i=extractBundleModules(e),d=getStaticStartupModuleIds(e),m=new Map;for(const t of i)m.set(t.id,t);const g=new Set,b=[],h=t=>{g.has(t)||(g.add(t),b.push(t))};h(0),d.forEach(t=>h(t)),executedModuleIds.forEach(t=>h(t));for(const t of i){const s=t.path.toLowerCase().replace(/\\/g,"/");(s.endsWith("/index.js")||s.endsWith("/index.ts")||s.endsWith("/index.tsx")||s==="index.js"||s.endsWith("/app.tsx")||s.endsWith("/app.js")||s.endsWith("/app.jsx")||s==="app.tsx"||s==="app.js"||s.endsWith("app.json"))&&h(t.id)}for(;b.length>0;){const t=b.shift(),s=m.get(t);if(s&&s.deps)for(const r of s.deps)h(r)}const f=new Map,x=[];for(const t of i){const s=t.path.replace(/\\/g,"/"),{isPkg:r,pkgName:v}=isExternalPackage(s);if(r){v&&!v.startsWith(".")&&f.set(v,(f.get(v)||0)+1);continue}isInternalModule(s)||x.push({mod:t,rawPath:s})}const S=detectProjectRoot(i.map(t=>t.path)),M=[];let oe=0;for(const{mod:t,rawPath:s}of x){const r=normalizeProjectRelativePath(s,S);if(!(r.endsWith(".tsx")||r.endsWith(".ts")||r.endsWith(".jsx")||r.endsWith(".js")||r.endsWith(".mjs")||r.endsWith(".cjs")||r.endsWith(".json")||r.endsWith(".png")||r.endsWith(".jpg")||r.endsWith(".jpeg")||r.endsWith(".gif")||r.endsWith(".webp")||r.endsWith(".svg")||r.endsWith(".bmp")||r.endsWith(".ico")||r.endsWith(".ttf")||r.endsWith(".otf")||r.endsWith(".woff")||r.endsWith(".woff2")||r.endsWith(".css")||r.endsWith(".scss")||r.endsWith(".html")||r.endsWith(".md")||r.endsWith(".graphql")||r.endsWith(".gql")))continue;const l=r.split(".").pop()?.toUpperCase()||"JS",j=r.split("/").pop()||r;let A="javascript",N=AppColors_1.AppColors.indigo500;l==="TSX"||l==="TS"?(A="typescript",N=AppColors_1.AppColors.sky500):l==="PNG"||l==="JPG"||l==="JPEG"||l==="GIF"||l==="WEBP"||l==="SVG"||l==="BMP"||l==="ICO"?(A="image",N=AppColors_1.AppColors.pink500):l==="TTF"||l==="OTF"||l==="WOFF"||l==="WOFF2"?(A="font",N=AppColors_1.AppColors.purple500):(l==="JSON"||l==="CSS"||l==="SCSS"||l==="HTML"||l==="MD"||l==="GRAPHQL"||l==="GQL")&&(A="json",N=AppColors_1.AppColors.emerald500);const X=Math.max(2,Math.round(u*.15/Math.max(i.length,20))),Y=!(r.includes(".test.")||r.includes(".spec.")||r.includes("__tests__")||r.includes("__mocks__")||r.includes(".stories.")||r.includes("fixtures/"));M.push({id:`host-file-${oe++}`,name:j,path:r,ext:l,category:A,sizeKb:X,meta:`Active Host App Module \u2022 ${A.toUpperCase()}`,color:N,status:Y?"optimal":"warning",advice:Y?"In-Use: Bundled and active in host application dependency tree":"Not consumed: Test fixture or orphaned file packaged in bundle",isConsumed:Y})}const ne=t=>{const s=[AppColors_1.AppColors.indigo500,AppColors_1.AppColors.sky500,AppColors_1.AppColors.pink500,AppColors_1.AppColors.purple500,AppColors_1.AppColors.emerald500,AppColors_1.AppColors.amber500,AppColors_1.AppColors.red500,AppColors_1.AppColors.teal500,AppColors_1.AppColors.blue500,AppColors_1.AppColors.fuchsia500,AppColors_1.AppColors.orange500,AppColors_1.AppColors.lime500,AppColors_1.AppColors.cyan500,AppColors_1.AppColors.purple900,AppColors_1.AppColors.errorColor];let r=0;for(let v=0;v<t.length;v++)r=t.charCodeAt(v)+((r<<5)-r);return s[Math.abs(r)%s.length]},re=t=>{const s=t.toLowerCase();return s.includes("navigation")||s.includes("router")||s.includes("screen")?"navigation":s.includes("ui")||s.includes("reanimated")||s.includes("gesture")||s.includes("svg")||s.includes("lottie")||s.includes("vector")||s.includes("icon")||s.includes("image")||s.includes("gradient")?"ui":s.includes("axios")||s.includes("fetch")||s.includes("query")||s.includes("apollo")||s.includes("network")||s.includes("socket")||s.includes("http")?"network":s==="react"||s==="react-native"||s.includes("metro")||s.includes("babel")||s.includes("core")?"core":"utils"},ie=t=>t.startsWith("@react-navigation/")?t==="@react-navigation/native"?null:"@react-navigation/native":t.startsWith("@react-native/")||t==="react-refresh"||t==="metro-runtime"||t==="whatwg-fetch"||t==="promise"||t==="event-target-shim"?"react-native":t==="scheduler"||t==="loose-envify"||t==="object-assign"?"react":t==="use-sync-external-store"||t==="reselect"||t==="redux-thunk"||t==="immer"?"react-redux":t==="follow-redirects"||t==="form-data"||t==="proxy-from-env"?"axios":t==="clone-deep"||t==="html-parse-stringify"||t==="@babel/runtime"?"i18next":t==="css-select"||t==="css-tree"||t==="entities"?"react-native-svg":null,Z=Array.from(f.entries()),ae=Z.reduce((t,[,s])=>t+s,0)||1,k=[];Z.forEach(([t,s],r)=>{const v=re(t),l=ne(t),j=ie(t)||void 0,A=!j,N=Math.max(8,Math.round(u*.52*s/Math.max(ae,1))),X=Number((N/Math.max(u,1)*100).toFixed(1));k.push({id:`host-pkg-${r}`,name:t,version:"",latestVersion:"",sizeKb:N,percentage:X,type:A?"direct":"transitive",isDirectDefined:A,parentPackageName:j,subpackages:[],category:v,color:l,description:`${s} bundled ${s===1?"module":"modules"}`,npmUrl:`https://www.npmjs.com/package/${t}`,isDeprecated:!1,lastActive:`${s} modules`})});const E=new Map;k.forEach(t=>{t.isDirectDefined&&E.set(t.name,t)}),k.forEach(t=>{if(t.parentPackageName&&E.has(t.parentPackageName)){const s=E.get(t.parentPackageName);s.subpackages||(s.subpackages=[]),s.subpackages.push(t)}}),k.sort((t,s)=>s.sizeKb-t.sizeKb);let R=0;for(const t of k)R+=t.sizeKb||0;let B=0,I=0;for(const t of M)t.category==="image"||t.category==="font"?I+=t.sizeKb||0:B+=t.sizeKb||0;const T=B>0?B:Math.round(u*.18),w=R>0?R:Math.round(u*.58),P=I>0?I:Math.round(u*.08),ee=Math.max(0,u-T-w-P),C=Number((u*.38/1024).toFixed(2)),D=Number((w/1024).toFixed(2)),O=Number((P/1024).toFixed(2)),W=Math.min(k.length,55),z=Number((48+W*.35+D*.9).toFixed(1)),H=Number((38+W*.22+D*.6).toFixed(1)),L=Number((30+O*2.2).toFixed(1)),$=6.4,_=Number((C+z+H+L+$).toFixed(1)),ce=Number((_*.655).toFixed(1)),U=Number((20+W*.12+D*.4).toFixed(1)),K=Number((14+W*.08+D*.25).toFixed(1)),q=Number((16+O*1.5).toFixed(1)),y=Number((C+U+K+q+3.8).toFixed(1)),te=Number((y*.54).toFixed(1)),V=Number((195+W*.55+D*1.6).toFixed(1)),G=Number((54+W*.2+D*.6).toFixed(1)),J=Number((58+O*2.8).toFixed(1)),Q=8.5,F=Number((C+V+G+J+Q).toFixed(1)),de=Number(F.toFixed(1)),le=[{id:"ios-c1",name:(0,i18n_1.t)("bundle.iosComp1Name"),category:"frameworks",sizeMb:z,pct:Number((z/_*100).toFixed(1)),color:AppColors_1.AppColors.indigo500,description:(0,i18n_1.t)("bundle.iosComp1Desc",{count:k.length}),advice:(0,i18n_1.t)("bundle.iosComp1Advice")},{id:"ios-c2",name:(0,i18n_1.t)("bundle.iosComp2Name"),category:"native",sizeMb:H,pct:Number((H/_*100).toFixed(1)),color:AppColors_1.AppColors.sky500,description:(0,i18n_1.t)("bundle.iosComp2Desc"),advice:(0,i18n_1.t)("bundle.iosComp2Advice")},{id:"ios-c3",name:(0,i18n_1.t)("bundle.iosComp3Name"),category:"assets",sizeMb:L,pct:Number((L/_*100).toFixed(1)),color:AppColors_1.AppColors.pink500,description:(0,i18n_1.t)("bundle.iosComp3Desc"),advice:(0,i18n_1.t)("bundle.iosComp3Advice")},{id:"ios-c4",name:(0,i18n_1.t)("bundle.iosComp4Name"),category:"js",sizeMb:C,pct:Number((C/_*100).toFixed(1)),color:AppColors_1.AppColors.emerald500,description:(0,i18n_1.t)("bundle.iosComp4Desc",{count:M.length}),advice:(0,i18n_1.t)("bundle.iosComp4Advice")},{id:"ios-c5",name:(0,i18n_1.t)("bundle.iosComp5Name"),category:"meta",sizeMb:$,pct:Number(($/_*100).toFixed(1)),color:AppColors_1.AppColors.amber500,description:(0,i18n_1.t)("bundle.iosComp5Desc"),advice:(0,i18n_1.t)("bundle.iosComp5Advice")}],se=[{id:"and-c1",name:(0,i18n_1.t)("bundle.andComp1Name"),category:"native",sizeMb:U,pct:Number((U/y*100).toFixed(1)),color:AppColors_1.AppColors.sky500,description:(0,i18n_1.t)("bundle.andComp1Desc",{count:k.length}),advice:(0,i18n_1.t)("bundle.andComp1Advice")},{id:"and-c2",name:(0,i18n_1.t)("bundle.andComp2Name"),category:"frameworks",sizeMb:K,pct:Number((K/y*100).toFixed(1)),color:AppColors_1.AppColors.indigo500,description:(0,i18n_1.t)("bundle.andComp2Desc"),advice:(0,i18n_1.t)("bundle.andComp2Advice")},{id:"and-c3",name:(0,i18n_1.t)("bundle.andComp3Name"),category:"assets",sizeMb:q,pct:Number((q/y*100).toFixed(1)),color:AppColors_1.AppColors.pink500,description:(0,i18n_1.t)("bundle.andComp3Desc"),advice:(0,i18n_1.t)("bundle.andComp3Advice")},{id:"and-c4",name:(0,i18n_1.t)("bundle.andComp4Name"),category:"js",sizeMb:C,pct:Number((C/y*100).toFixed(1)),color:AppColors_1.AppColors.emerald500,description:(0,i18n_1.t)("bundle.andComp4Desc",{count:M.length}),advice:(0,i18n_1.t)("bundle.andComp4Advice")},{id:"and-c5",name:(0,i18n_1.t)("bundle.andComp5Name"),category:"meta",sizeMb:3.8,pct:Number((3.8/y*100).toFixed(1)),color:AppColors_1.AppColors.amber500,description:(0,i18n_1.t)("bundle.andComp5Desc"),advice:(0,i18n_1.t)("bundle.andComp5Advice")}],pe=[{id:"apk-c1",name:(0,i18n_1.t)("bundle.apkComp1Name"),category:"native",sizeMb:V,pct:Number((V/F*100).toFixed(1)),color:AppColors_1.AppColors.sky500,description:(0,i18n_1.t)("bundle.apkComp1Desc"),advice:(0,i18n_1.t)("bundle.apkComp1Advice")},{id:"apk-c2",name:(0,i18n_1.t)("bundle.apkComp2Name"),category:"frameworks",sizeMb:G,pct:Number((G/F*100).toFixed(1)),color:AppColors_1.AppColors.indigo500,description:(0,i18n_1.t)("bundle.apkComp2Desc"),advice:(0,i18n_1.t)("bundle.apkComp2Advice")},{id:"apk-c3",name:(0,i18n_1.t)("bundle.apkComp3Name"),category:"assets",sizeMb:J,pct:Number((J/F*100).toFixed(1)),color:AppColors_1.AppColors.pink500,description:(0,i18n_1.t)("bundle.apkComp3Desc"),advice:(0,i18n_1.t)("bundle.apkComp3Advice")},{id:"apk-c4",name:(0,i18n_1.t)("bundle.apkComp4Name"),category:"js",sizeMb:C,pct:Number((C/F*100).toFixed(1)),color:AppColors_1.AppColors.emerald500,description:(0,i18n_1.t)("bundle.apkComp4Desc",{count:M.length}),advice:(0,i18n_1.t)("bundle.apkComp4Advice")},{id:"apk-c5",name:(0,i18n_1.t)("bundle.apkComp5Name"),category:"meta",sizeMb:Q,pct:Number((Q/F*100).toFixed(1)),color:AppColors_1.AppColors.amber500,description:(0,i18n_1.t)("bundle.apkComp5Desc"),advice:(0,i18n_1.t)("bundle.apkComp5Advice")}];return{isLive:c,scriptURL:n,totalDevBytes:o,totalDevMb:p,totalDevKb:u,isHermes:a,moduleCount:i.length||M.length+k.length,packageCount:k.length,filesCount:M.length,splitUp:{appSource:{kb:T,mb:Number((T/1024).toFixed(2)),pct:15},nodeModules:{kb:w,mb:Number((w/1024).toFixed(2)),pct:52},assetsMedia:{kb:P,mb:Number((P/1024).toFixed(2)),pct:12},metroDevOverhead:{kb:ee,mb:Number((ee/1024).toFixed(2)),pct:21}},files:M,packages:k,production:{ios:{totalInstallMb:_,totalDownloadMb:ce,compressionRatioPct:Number(((p-C)/Math.max(p,1)*100).toFixed(1)),components:le},androidAab:{totalInstallMb:y,totalDownloadMb:te,compressionRatioPct:Number(((p-C)/Math.max(p,1)*100).toFixed(1)),components:se},androidApk:{totalInstallMb:F,totalDownloadMb:de,compressionRatioPct:Number(((p-C)/Math.max(p,1)*.7).toFixed(1)),components:pe},android:{totalInstallMb:y,totalDownloadMb:te,compressionRatioPct:Number(((p-C)/Math.max(p,1)*100).toFixed(1)),components:se}}}};exports.parseBundleSource=parseBundleSource;const getInitialBundleAnalysis=()=>{if(cachedAnalysis)return cachedAnalysis;const e=(0,exports.getHostScriptURL)();return(0,exports.parseBundleSource)("",684e4,e||"unknown",!1)};exports.getInitialBundleAnalysis=getInitialBundleAnalysis;const analyzeHostAppBundle=async(e=!1)=>{if(e&&(cachedAnalysis=null),cachedAnalysis&&!e)return cachedAnalysis;if(isAnalyzing)return new Promise(a=>{subscribers.push(a)});isAnalyzing=!0;const o=(0,exports.getHostScriptURL)();try{const a=await probeCandidateUrlsInParallel(o,2500);if(a&&a.text&&a.text.length>0){const p=(0,exports.parseBundleSource)(a.text,a.bytes,a.url);return cachedAnalysis=p,isAnalyzing=!1,subscribers.forEach(u=>u(p)),subscribers.length=0,p}}catch{}const c=(0,exports.parseBundleSource)("",684e4,o||"unknown",!1);return cachedAnalysis=c,isAnalyzing=!1,subscribers.forEach(a=>a(c)),subscribers.length=0,c};exports.analyzeHostAppBundle=analyzeHostAppBundle;const clearCachedBundleAnalysis=()=>{cachedAnalysis=null};exports.clearCachedBundleAnalysis=clearCachedBundleAnalysis;const getCachedBundleAnalysis=()=>cachedAnalysis;exports.getCachedBundleAnalysis=getCachedBundleAnalysis;
@@ -11,6 +11,7 @@ export declare const getDurationColor: (duration: number | null) => string;
11
11
  export declare const getSize: (data: unknown) => string;
12
12
  export declare const formatBytes: (bytes: number) => string;
13
13
  export declare const copyToClipboard: (value: unknown, label?: string) => void;
14
+ export declare const copyImageOrMediaToClipboard: (uri: string, label?: string) => Promise<void>;
14
15
  export declare const getPath: (url: string) => string;
15
16
  export declare const getBaseUrl: (url: string) => string;
16
17
  export declare const getCurlCommand: (log: NetworkLog) => string;
@@ -1,8 +1,8 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,o,r){r===void 0&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}):(function(e,t,o,r){r===void 0&&(r=o),e[r]=t[o]})),__exportStar=this&&this.__exportStar||function(e,t){for(var o in e)o!=="default"&&!Object.prototype.hasOwnProperty.call(t,o)&&__createBinding(t,e,o)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getRuntimeDiagnostics=exports.getCategoryColors=exports.registerGAPlugin=exports.getEventCategory=exports.getEventColor=exports.ANALYTICS_EVENT_PALETTE=exports.openInVSCode=exports.parseStackLine=exports.getJsonPreviewText=exports.getJsonContent=exports.formatGap=exports.formatTime=exports.formatTimeShort=exports.handleOpenExternalLink=exports.getAppVersionAndBuild=exports.getAppName=exports.getBundleIdentifier=exports.formatDateTimeToAnalytics=exports.isAllValuesEmpty=exports.getLocalizedFilePathWithSlash=exports.getLocalizedFilePath=exports.formatDisplayUrl=exports.getDiff=exports.flattenObject=exports.getLogPageName=exports.getNavigationInfo=exports.escapeRegex=exports.deduplicateLogs=exports.getFetchCommand=exports.getCurlCommand=exports.getBaseUrl=exports.getPath=exports.copyToClipboard=exports.formatBytes=exports.getSize=exports.getDurationColor=exports.getStatusColor=exports.formatTimestamp=exports.formatDateTime=exports.getDomainColor=exports.isLocalDebugEnvironment=void 0;const react_native_1=require("react-native"),clipboard_1=__importDefault(require("@react-native-clipboard/clipboard")),toast_1=require("./toast"),AppColors_1=require("../styles/AppColors"),constants_1=require("../constants");__exportStar(require("./searchQueryParser"),exports),__exportStar(require("./memoryManager"),exports),__exportStar(require("./toast"),exports);const isLocalDebugEnvironment=()=>{const e=typeof __DEV__<"u"&&!!__DEV__,t=react_native_1.NativeModules.SourceCode?.scriptURL||"",o=t.startsWith("http://")||t.startsWith("https://")||t.includes(":8081")||t.includes(":8082");return e||o};exports.isLocalDebugEnvironment=isLocalDebugEnvironment;const getDomainColor=e=>{if(!e)return constants_1.DOMAIN_COLORS[0];let t=0;for(let o=0;o<e.length;o++)t=e.charCodeAt(o)+((t<<5)-t);return constants_1.DOMAIN_COLORS[Math.abs(t)%constants_1.DOMAIN_COLORS.length]};exports.getDomainColor=getDomainColor;const formatDateTime=e=>{const t=new Date(e),o=(d,c=2)=>String(d).padStart(c,"0"),r=o(t.getDate()),n=o(t.getMonth()+1),s=t.getFullYear(),i=o(t.getHours()),a=o(t.getMinutes()),l=o(t.getSeconds());return`${r}/${n}/${s} ${i}:${a}:${l}`};exports.formatDateTime=formatDateTime;const formatTimestamp=e=>{try{const t=new Date(e),o=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),n=t.getSeconds().toString().padStart(2,"0"),s=t.getMilliseconds().toString().padStart(3,"0");return`${o}:${r}:${n}.${s}`}catch{return"\u2014"}};exports.formatTimestamp=formatTimestamp;const getStatusColor=e=>!e||e===0||e>=500?AppColors_1.AppColors.errorColor:e>=400?AppColors_1.AppColors.darkOrange:e>=300?AppColors_1.AppColors.warningIconGold:AppColors_1.AppColors.greenColor;exports.getStatusColor=getStatusColor;const getDurationColor=e=>e==null?AppColors_1.AppColors.grayTextWeak:e<constants_1.DURATION_FAST_MS?AppColors_1.AppColors.greenColor:e<constants_1.DURATION_SLOW_MS?AppColors_1.AppColors.lightOrange:AppColors_1.AppColors.errorColor;exports.getDurationColor=getDurationColor;const getSize=e=>{try{const t=JSON.stringify(e)?.length??0;return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}catch{return"\u2014"}};exports.getSize=getSize;const formatBytes=e=>{if(e===0||!e||isNaN(e))return"0 B";const t=1024,o=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(1))} ${o[r]||"B"}`};exports.formatBytes=formatBytes;const copyToClipboard=(e,t)=>{const o=typeof e=="function"?e():e;let r="";if(typeof o=="string")r=o;else try{r=JSON.stringify(o,null,2)}catch{r=String(o)}try{typeof clipboard_1.default?.setString=="function"?clipboard_1.default.setString(r):typeof clipboard_1.default?.default?.setString=="function"&&clipboard_1.default.default.setString(r)}catch(n){__DEV__&&console.warn("[NetworkInspector] Clipboard.setString failed:",n)}try{(0,toast_1.showToast)(t?`${t} copied to clipboard`:"Copied to clipboard")}catch{}try{react_native_1.Platform.OS==="android"&&react_native_1.ToastAndroid?.show&&react_native_1.ToastAndroid.show(t?`${t} copied to clipboard`:"Copied to clipboard",react_native_1.ToastAndroid.SHORT)}catch{}};exports.copyToClipboard=copyToClipboard;const getPath=e=>{try{const t=new URL(e);return t.pathname+(t.search?t.search:"")}catch{return e.replace(/^https?:\/\/[^/?#]+/,"")||"/"}};exports.getPath=getPath;const getBaseUrl=e=>{try{const t=new URL(e);return`${t.protocol}//${t.host}`}catch{const t=e.match(/^(https?:\/\/[^/]+)/);return t?t[1]:""}};exports.getBaseUrl=getBaseUrl;const getCurlCommand=e=>{let t=`curl -X ${e.method} "${e.url}"`;if(e.requestHeaders&&Object.entries(e.requestHeaders).forEach(([o,r])=>{t+=` \\
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,o,r){r===void 0&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}):(function(e,t,o,r){r===void 0&&(r=o),e[r]=t[o]})),__exportStar=this&&this.__exportStar||function(e,t){for(var o in e)o!=="default"&&!Object.prototype.hasOwnProperty.call(t,o)&&__createBinding(t,e,o)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getRuntimeDiagnostics=exports.getCategoryColors=exports.registerGAPlugin=exports.getEventCategory=exports.getEventColor=exports.ANALYTICS_EVENT_PALETTE=exports.openInVSCode=exports.parseStackLine=exports.getJsonPreviewText=exports.getJsonContent=exports.formatGap=exports.formatTime=exports.formatTimeShort=exports.handleOpenExternalLink=exports.getAppVersionAndBuild=exports.getAppName=exports.getBundleIdentifier=exports.formatDateTimeToAnalytics=exports.isAllValuesEmpty=exports.getLocalizedFilePathWithSlash=exports.getLocalizedFilePath=exports.formatDisplayUrl=exports.getDiff=exports.flattenObject=exports.getLogPageName=exports.getNavigationInfo=exports.escapeRegex=exports.deduplicateLogs=exports.getFetchCommand=exports.getCurlCommand=exports.getBaseUrl=exports.getPath=exports.copyImageOrMediaToClipboard=exports.copyToClipboard=exports.formatBytes=exports.getSize=exports.getDurationColor=exports.getStatusColor=exports.formatTimestamp=exports.formatDateTime=exports.getDomainColor=exports.isLocalDebugEnvironment=void 0;const react_native_1=require("react-native"),clipboard_1=__importDefault(require("@react-native-clipboard/clipboard")),toast_1=require("./toast"),NativeInspector_1=require("../native/NativeInspector"),AppColors_1=require("../styles/AppColors"),constants_1=require("../constants");__exportStar(require("./searchQueryParser"),exports),__exportStar(require("./memoryManager"),exports),__exportStar(require("./toast"),exports);const isLocalDebugEnvironment=()=>{const e=typeof __DEV__<"u"&&!!__DEV__,t=react_native_1.NativeModules.SourceCode?.scriptURL||"",o=t.startsWith("http://")||t.startsWith("https://")||t.includes(":8081")||t.includes(":8082");return e||o};exports.isLocalDebugEnvironment=isLocalDebugEnvironment;const getDomainColor=e=>{if(!e)return constants_1.DOMAIN_COLORS[0];let t=0;for(let o=0;o<e.length;o++)t=e.charCodeAt(o)+((t<<5)-t);return constants_1.DOMAIN_COLORS[Math.abs(t)%constants_1.DOMAIN_COLORS.length]};exports.getDomainColor=getDomainColor;const formatDateTime=e=>{const t=new Date(e),o=(d,c=2)=>String(d).padStart(c,"0"),r=o(t.getDate()),n=o(t.getMonth()+1),s=t.getFullYear(),i=o(t.getHours()),a=o(t.getMinutes()),l=o(t.getSeconds());return`${r}/${n}/${s} ${i}:${a}:${l}`};exports.formatDateTime=formatDateTime;const formatTimestamp=e=>{try{const t=new Date(e),o=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),n=t.getSeconds().toString().padStart(2,"0"),s=t.getMilliseconds().toString().padStart(3,"0");return`${o}:${r}:${n}.${s}`}catch{return"\u2014"}};exports.formatTimestamp=formatTimestamp;const getStatusColor=e=>!e||e===0||e>=500?AppColors_1.AppColors.errorColor:e>=400?AppColors_1.AppColors.darkOrange:e>=300?AppColors_1.AppColors.warningIconGold:AppColors_1.AppColors.greenColor;exports.getStatusColor=getStatusColor;const getDurationColor=e=>e==null?AppColors_1.AppColors.grayTextWeak:e<constants_1.DURATION_FAST_MS?AppColors_1.AppColors.greenColor:e<constants_1.DURATION_SLOW_MS?AppColors_1.AppColors.lightOrange:AppColors_1.AppColors.errorColor;exports.getDurationColor=getDurationColor;const getSize=e=>{try{const t=JSON.stringify(e)?.length??0;return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}catch{return"\u2014"}};exports.getSize=getSize;const formatBytes=e=>{if(e===0||!e||isNaN(e))return"0 B";const t=1024,o=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(1))} ${o[r]||"B"}`};exports.formatBytes=formatBytes;const copyToClipboard=(e,t)=>{const o=typeof e=="function"?e():e;let r="";if(typeof o=="string")r=o;else try{r=JSON.stringify(o,null,2)}catch{r=String(o)}try{typeof clipboard_1.default?.setString=="function"?clipboard_1.default.setString(r):typeof clipboard_1.default?.default?.setString=="function"&&clipboard_1.default.default.setString(r)}catch(n){__DEV__&&console.warn("[NetworkInspector] Clipboard.setString failed:",n)}try{(0,toast_1.showToast)(t?`${t} copied to clipboard`:"Copied to clipboard")}catch{}try{react_native_1.Platform.OS==="android"&&react_native_1.ToastAndroid?.show&&react_native_1.ToastAndroid.show(t?`${t} copied to clipboard`:"Copied to clipboard",react_native_1.ToastAndroid.SHORT)}catch{}};exports.copyToClipboard=copyToClipboard;const copyImageOrMediaToClipboard=async(e,t="Image")=>{if(!e)return;let o=!1;try{o=await(0,NativeInspector_1.copyMediaToClipboard)(e)}catch{o=!1}if(!o){(0,exports.copyToClipboard)(e,t);return}try{(0,toast_1.showToast)(`${t} copied to clipboard`)}catch{}try{react_native_1.Platform.OS==="android"&&react_native_1.ToastAndroid?.show&&react_native_1.ToastAndroid.show(`${t} copied to clipboard`,react_native_1.ToastAndroid.SHORT)}catch{}};exports.copyImageOrMediaToClipboard=copyImageOrMediaToClipboard;const getPath=e=>{try{const t=new URL(e);return t.pathname+(t.search?t.search:"")}catch{return e.replace(/^https?:\/\/[^/?#]+/,"")||"/"}};exports.getPath=getPath;const getBaseUrl=e=>{try{const t=new URL(e);return`${t.protocol}//${t.host}`}catch{const t=e.match(/^(https?:\/\/[^/]+)/);return t?t[1]:""}};exports.getBaseUrl=getBaseUrl;const getCurlCommand=e=>{let t=`curl -X ${e.method} "${e.url}"`;if(e.requestHeaders&&Object.entries(e.requestHeaders).forEach(([o,r])=>{t+=` \\
2
2
  -H "${o}: ${r}"`}),e.request&&e.method!=="GET"){const o=typeof e.request=="string"?e.request:JSON.stringify(e.request);t+=` \\
3
3
  -d '${o.replace(/'/g,"'\\''")}'`}return t};exports.getCurlCommand=getCurlCommand;const getFetchCommand=e=>{const t={method:e.method};return e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(t.headers=e.requestHeaders),e.request&&e.method!=="GET"&&(t.body=JSON.stringify(e.request)),`fetch("${e.url}", ${JSON.stringify(t,null,2)})`};exports.getFetchCommand=getFetchCommand;const deduplicateLogs=e=>{const t=new Map;return e.forEach(o=>{if(!t.has(o.id))t.set(o.id,o);else{const r=t.get(o.id);(r.status==null&&o.status!=null||(o.startTime??0)>=(r.startTime??0))&&t.set(o.id,o)}}),Array.from(t.values()).sort((o,r)=>r.id-o.id)};exports.deduplicateLogs=deduplicateLogs;const escapeRegex=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");exports.escapeRegex=escapeRegex;const getNavigationInfo=(e,t=[])=>{if(!e)return{path:t.length>0?t.join(" \u2794 "):"",params:null};if(e.name&&!e.routes)return{path:t.length>0?[...t,e.name].join(" \u2794 "):e.name,params:e.params||null};if(!e.routes||!Array.isArray(e.routes)||e.routes.length===0)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const o=typeof e.index=="number"&&e.index>=0&&e.index<e.routes.length?e.index:0,r=e.routes[o];if(!r)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const n=r.name?[...t,r.name]:t;return r?.state?(0,exports.getNavigationInfo)(r.state,n):{path:n.length>0?n.join(" \u2794 "):r.name||"",params:r.params||null}};exports.getNavigationInfo=getNavigationInfo;const getLogPageName=(e,t)=>{const o=t||e?.routeInfo;if(o&&o.path&&o.path!=="Navigators"){const r=o.path.split(" \u2794 ").map(n=>n.trim()).filter(Boolean);return r.length>0?r[r.length-1]:o.path}if(e.caller&&e.caller!=="Unknown")try{const r=e.caller.match(/([^/\\]+)\.(tsx|jsx|ts|js)/i);if(r&&r[1]){const n=r[1];if(!["networklogger","fetch","axios","apiclient","request","http","index","nativeinspector","inappinspector","bundleanalyzer"].includes(n.toLowerCase()))return n}}catch{}if(e.url)try{const n=e.url.split("?")[0].split("#")[0].replace(/^https?:\/\//i,""),s=n.indexOf("/");if(s!==-1){const a=n.substring(s+1).split("/").filter(Boolean),l=["api","v1","v2","v3","v4","rest","graphql","json","data","service","app"],d=a.filter(c=>!l.includes(c.toLowerCase()));if(d.length>0){const c=d[0];return c.charAt(0).toUpperCase()+c.slice(1)}}const i=n.split("/")[0];if(i)return i}catch{}return"General"};exports.getLogPageName=getLogPageName;const flattenObject=(e,t="")=>{let o={};return typeof e=="object"&&e!==null?Array.isArray(e)?e.forEach((r,n)=>{Object.assign(o,(0,exports.flattenObject)(r,t?`${t}[${n}]`:`[${n}]`))}):Object.keys(e).forEach(r=>{Object.assign(o,(0,exports.flattenObject)(e[r],t?`${t}.${r}`:r))}):o[t||"root"]=e,o};exports.flattenObject=flattenObject;const getDiff=(e,t)=>{const o=(0,exports.flattenObject)(e),r=(0,exports.flattenObject)(t),n=[];return new Set([...Object.keys(o),...Object.keys(r)]).forEach(i=>{i in o?i in r?o[i]!==r[i]&&n.push({type:"changed",path:i,oldVal:o[i],newVal:r[i]}):n.push({type:"removed",path:i,oldVal:o[i]}):n.push({type:"added",path:i,newVal:r[i]})}),n.sort((i,a)=>i.path.localeCompare(a.path))};exports.getDiff=getDiff;const formatDisplayUrl=e=>e?e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`:"";exports.formatDisplayUrl=formatDisplayUrl;const getLocalizedFilePath=(e,t,o)=>e.replace("country-language",`${t?.toLowerCase()}-${o?.toLowerCase()}`);exports.getLocalizedFilePath=getLocalizedFilePath;const getLocalizedFilePathWithSlash=(e,t,o)=>e.replace("country/language",`${t?.toLowerCase()}/${o?.toLowerCase()}`);exports.getLocalizedFilePathWithSlash=getLocalizedFilePathWithSlash;const isAllValuesEmpty=e=>!e||typeof e!="object"?!0:Object.values(e).every(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0);exports.isAllValuesEmpty=isAllValuesEmpty;const formatDateTimeToAnalytics=e=>new Date(e)?.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"});exports.formatDateTimeToAnalytics=formatDateTimeToAnalytics;const getBundleIdentifier=()=>{const e=react_native_1.NativeModules.RNDeviceInfo;if(e&&typeof e.bundleId=="string")return e.bundleId;if(e&&typeof e.getBundleId=="function")try{const n=e.getBundleId();if(typeof n=="string")return n}catch{}const t=react_native_1.NativeModules.ExponentConstants;if(t&&t.manifest){const n=t.manifest;if(n.ios&&n.ios.bundleIdentifier)return n.ios.bundleIdentifier;if(n.android&&n.android.package)return n.android.package}const o=react_native_1.NativeModules.ExpoApplication;if(o&&typeof o.applicationId=="string")return o.applicationId;const r=react_native_1.NativeModules.SourceCode;if(r&&typeof r.scriptURL=="string"){const n=r.scriptURL;if(n.includes("assets/"))try{const s=n.match(/assets\/([^/?#]+)/);if(s&&s[1])return s[1]}catch{}}return"org.reactjs.native.example"};exports.getBundleIdentifier=getBundleIdentifier;const getAppName=()=>{const e=react_native_1.NativeModules.PlatformConstants;e&&e.interfaceIdiom;const t=react_native_1.NativeModules.RNDeviceInfo;if(t&&typeof t.appName=="string")return t.appName;const o=react_native_1.NativeModules.ExpoApplication;if(o&&typeof o.applicationName=="string")return o.applicationName;const r=react_native_1.NativeModules.ExponentConstants;if(r&&r.manifest){const i=r.manifest;if(i.name)return i.name}const n=react_native_1.NativeModules.AppInfo;if(n&&typeof n.appName=="string")return n.appName;const s=(0,exports.getBundleIdentifier)();if(s&&s!=="org.reactjs.native.example"){const i=s.split("."),a=i[i.length-1];return a?a.charAt(0).toUpperCase()+a.slice(1):"App"}return"App"};exports.getAppName=getAppName;const getAppVersionAndBuild=()=>{let e="",t="";const o=react_native_1.NativeModules.ExpoApplication;o&&(typeof o.nativeAppVersion=="string"&&(e=o.nativeAppVersion),typeof o.nativeBuildVersion=="string"&&(t=o.nativeBuildVersion));const r=react_native_1.NativeModules.ExponentConstants;if(r){const a=r.manifest||r.expoConfig;a&&(!e&&a.version&&(e=String(a.version)),t||(a.ios?.buildNumber?t=String(a.ios.buildNumber):a.android?.versionCode&&(t=String(a.android.versionCode))))}const n=react_native_1.NativeModules.RNDeviceInfo;if(n){if(!e){if(typeof n.appVersion=="string")e=n.appVersion;else if(typeof n.getVersion=="function")try{e=n.getVersion()}catch{}}if(!t){if(typeof n.buildNumber=="string")t=n.buildNumber;else if(typeof n.getBuildNumber=="function")try{t=n.getBuildNumber()}catch{}}}const s=react_native_1.Platform.constants||react_native_1.NativeModules.PlatformConstants;if(s&&(!e&&s.Version&&typeof s.Version=="string"&&s.Version.includes(".")&&(e=s.Version),!e&&s.reactNativeVersion)){const a=s.reactNativeVersion;a.major!==void 0&&(e=`${a.major}.${a.minor}.${a.patch}`)}const i=react_native_1.NativeModules.AppInfo;return i&&(!e&&typeof i.versionName=="string"&&(e=i.versionName),!t&&typeof i.versionCode=="string"&&(t=i.versionCode)),e||(e="1.0.0"),t||(t="1"),{version:e,build:t,formatted:`${e} (${t})`}};exports.getAppVersionAndBuild=getAppVersionAndBuild;const handleOpenExternalLink=e=>{if(!e)return;const t=(0,exports.formatDisplayUrl)(e);react_native_1.Alert.alert("Open Link",`Do you want to open this link in your web browser?
4
4
 
5
5
  ${t}`,[{text:"Cancel",style:"cancel"},{text:"Open",onPress:()=>{react_native_1.Linking.openURL(t).catch(()=>{})}}])};exports.handleOpenExternalLink=handleOpenExternalLink;const formatTimeShort=e=>{const t=new Date(e),o=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0");return`${o}:${r}:${n}`};exports.formatTimeShort=formatTimeShort;const formatTime=e=>{const t=new Date(e),o=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0"),s=String(t.getMilliseconds()).padStart(3,"0");return`${o}:${r}:${n}.${s}`};exports.formatTime=formatTime;const formatGap=e=>{if(e<1e3)return`+${e}ms`;const t=Math.round(e/1e3);if(t<60)return`+${t}s`;const o=Math.floor(t/60),r=t%60;return r>0?`+${o}m ${r}s`:`+${o}m`};exports.formatGap=formatGap;const getJsonContent=e=>{if(!e)return null;const t=[];for(let o=0;o<e.length;o++)(e[o]==="{"||e[o]==="[")&&t.push(o);for(const o of t){const r=e.substring(o).trim();try{const n=JSON.parse(r);if(n!==null&&typeof n=="object")return{header:e.substring(0,o).trim(),data:n}}catch{}}return null};exports.getJsonContent=getJsonContent;const getJsonPreviewText=(e,t=4)=>{try{const o=JSON.stringify(e,null,2),r=o.split(`
6
6
  `);return r.length>t?{text:r.slice(0,t).join(`
7
7
  `)+`
8
- ...`,hasMore:!0}:{text:o,hasMore:!1}}catch{return{text:String(e),hasMore:!1}}};exports.getJsonPreviewText=getJsonPreviewText;const parseStackLine=(e,t=!1)=>{let o=e.trim().replace(/^at /,"");if(o.includes("@")){const S=o.indexOf("@"),b=o.substring(0,S).trim(),v=o.substring(S+1).trim();o=b?`${b} (${v})`:v}const r=o.match(/^(.*?)\s*\((.*?)\)$/);let n="<anonymous>",s=o;r&&(n=r[1].trim()||"<anonymous>",s=r[2].trim()),(n.startsWith("?anon_")||n==="?")&&(n="anonymous"),s=s.replace(/^address at /,"");const i=s.match(/^(.*?):(\d+):(\d+)$/);let a=s,l,d;i&&(a=i[1],l=i[2],d=i[3]);let c=a.split("?")[0].split("&")[0].replace(/[)]+$/,"").replace(/\/\/+$/,"");c=c.replace(/^(?:https?:\/\/[^\/]+\/|file:\/\/\/|webpack:\/\/\/?)/,"");const g=c.split("/").filter(Boolean).pop()||c,m=g.match(/\.([a-z0-9]+)$/i),p=m?m[1].toLowerCase():"",f=p==="tsx"||p==="jsx"||p==="ts"||p==="js"?p:"other",h=s==="native"||c==="native",x=c.includes("InternalBytecode")||c.includes("metro-runtime")||c.includes("regenerator-runtime")||n==="tryCallOne"||n==="asyncGeneratorStep"||n==="_next"||n==="next"&&h,y=c.includes("node_modules")||c.includes("react-native/Libraries")||c.includes("react-native-inapp-inspector")&&!c.includes("/example/"),C=!h&&!x&&!y&&(f==="tsx"||f==="jsx"||f==="ts"||f==="js"||!g.includes(".bundle")),A=C?"app":y?"dependency":h?"native":"runtime",N=x||h||n==="asyncGeneratorStep"||n==="_next";let u=c;u.includes("/example/")?u=u.substring(u.indexOf("/example/")+9):u.includes("/src/")?u=u.substring(u.indexOf("/src/")+1):u.includes("/node_modules/")&&(u=u.substring(u.indexOf("/node_modules/")+14));const $=l?`${g}:${l}${d?`:${d}`:""}`:g;return{raw:e,functionName:n,fileName:g,fullPath:u,rawFilePath:a,fileExt:f,frameType:A,isUserCode:C,isRuntimeNoise:N,lineNumber:l,columnNumber:d,isOrigin:t,copyableLocation:$}};exports.parseStackLine=parseStackLine;const openInVSCode=(e,t,o)=>{const r=t?Number(t):1,n=o?Number(o):1,s=t?`:${t}`:"",i=o?`:${o}`:"",a=e.replace(/^file:\/\//,"");let l=null;try{const p=react_native_1.NativeModules?.SourceCode?.scriptURL||react_native_1.NativeModules?.PlatformConstants?.serverHost||react_native_1.NativeModules?.DevSettings?.serverHost;if(typeof p=="string"&&p.length>0){const f=p.match(/^(https?:\/\/[^/]+)/);f?l=f[1]:!p.startsWith("http")&&p.includes(":")&&(l=`http://${p}`)}}catch{}Array.from(new Set([...l?[l]:[],"http://localhost:8081","http://127.0.0.1:8081","http://10.0.2.2:8081"])).forEach(p=>{try{fetch(`${p}/open-stack-frame`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:a,lineNumber:r,column:n})}).catch(()=>{})}catch{}});const c=`vscode://file/${a.replace(/^\/+/,"")}${s}${i}`,g=`cursor://file/${a.replace(/^\/+/,"")}${s}${i}`,m=`vscode-insiders://file/${a.replace(/^\/+/,"")}${s}${i}`;react_native_1.Linking.openURL(c).catch(()=>{react_native_1.Linking.openURL(g).catch(()=>{react_native_1.Linking.openURL(m).catch(()=>{(0,exports.copyToClipboard)(`${a}${s}${i}`,"Location")})})})};exports.openInVSCode=openInVSCode,exports.ANALYTICS_EVENT_PALETTE=[AppColors_1.AppColors.googleBlue,AppColors_1.AppColors.googleGreen,AppColors_1.AppColors.googlePurple,AppColors_1.AppColors.googleTeal,AppColors_1.AppColors.googleRed,AppColors_1.AppColors.googleOrange,AppColors_1.AppColors.blue700,AppColors_1.AppColors.materialGreen];const getEventColor=e=>{const t=typeof e=="string"?e:String(e||"");let o=0;for(let r=0;r<t.length;r++)o=o*31+t.charCodeAt(r)|0;return exports.ANALYTICS_EVENT_PALETTE[Math.abs(o)%exports.ANALYTICS_EVENT_PALETTE.length]};exports.getEventColor=getEventColor;var gaAnalyticsRegistry_1=require("./gaAnalyticsRegistry");Object.defineProperty(exports,"getEventCategory",{enumerable:!0,get:function(){return gaAnalyticsRegistry_1.getEventCategory}}),Object.defineProperty(exports,"registerGAPlugin",{enumerable:!0,get:function(){return gaAnalyticsRegistry_1.registerGAPlugin}});const getCategoryColors=e=>{switch(e){case"page_view":case"Page View":return{bg:AppColors_1.AppColors.blueBg,border:AppColors_1.AppColors.blueBorder,text:AppColors_1.AppColors.blue800};case"ecommerce":case"Ecommerce":return{bg:AppColors_1.AppColors.greenBg,border:AppColors_1.AppColors.greenBorder,text:AppColors_1.AppColors.materialGreen};case"system":case"System":return{bg:AppColors_1.AppColors.greyBg,border:AppColors_1.AppColors.greyBorder,text:AppColors_1.AppColors.grey600};default:return{bg:AppColors_1.AppColors.purpleBg,border:AppColors_1.AppColors.purpleBorder,text:AppColors_1.AppColors.purpleText}}};exports.getCategoryColors=getCategoryColors;const getRuntimeDiagnostics=()=>{const e=typeof global.HermesInternal<"u",t=typeof global._v8runtime<"u",o=e?"hermes":t?"v8":"jsc",n=typeof global.nativeFabricUIManager<"u"||!!global.__turboModuleProxy?"fabric":"paper";let s=32.4,i=64;try{const a=global.HermesInternal?.getInstrumentedStats?.();a?.js_heap_size?(s=Number((a.js_heap_size/(1024*1024)).toFixed(1)),i=Number(((a.js_allocated_bytes||a.js_heap_size*1.6)/(1024*1024)).toFixed(1))):global.performance?.memory?.usedJSHeapSize&&(s=Number((global.performance.memory.usedJSHeapSize/(1024*1024)).toFixed(1)),i=Number((global.performance.memory.totalJSHeapSize/(1024*1024)).toFixed(1)))}catch{}return{engineType:o,archType:n,usedHeapMb:s,totalAllocMb:i}};exports.getRuntimeDiagnostics=getRuntimeDiagnostics;
8
+ ...`,hasMore:!0}:{text:o,hasMore:!1}}catch{return{text:String(e),hasMore:!1}}};exports.getJsonPreviewText=getJsonPreviewText;const parseStackLine=(e,t=!1)=>{let o=e.trim().replace(/^at /,"");if(o.includes("@")){const b=o.indexOf("@"),S=o.substring(0,b).trim(),v=o.substring(b+1).trim();o=S?`${S} (${v})`:v}const r=o.match(/^(.*?)\s*\((.*?)\)$/);let n="<anonymous>",s=o;r&&(n=r[1].trim()||"<anonymous>",s=r[2].trim()),(n.startsWith("?anon_")||n==="?")&&(n="anonymous"),s=s.replace(/^address at /,"");const i=s.match(/^(.*?):(\d+):(\d+)$/);let a=s,l,d;i&&(a=i[1],l=i[2],d=i[3]);let c=a.split("?")[0].split("&")[0].replace(/[)]+$/,"").replace(/\/\/+$/,"");c=c.replace(/^(?:https?:\/\/[^\/]+\/|file:\/\/\/|webpack:\/\/\/?)/,"");const g=c.split("/").filter(Boolean).pop()||c,m=g.match(/\.([a-z0-9]+)$/i),p=m?m[1].toLowerCase():"",f=p==="tsx"||p==="jsx"||p==="ts"||p==="js"?p:"other",h=s==="native"||c==="native",x=c.includes("InternalBytecode")||c.includes("metro-runtime")||c.includes("regenerator-runtime")||n==="tryCallOne"||n==="asyncGeneratorStep"||n==="_next"||n==="next"&&h,y=c.includes("node_modules")||c.includes("react-native/Libraries")||c.includes("react-native-inapp-inspector")&&!c.includes("/example/"),C=!h&&!x&&!y&&(f==="tsx"||f==="jsx"||f==="ts"||f==="js"||!g.includes(".bundle")),A=C?"app":y?"dependency":h?"native":"runtime",N=x||h||n==="asyncGeneratorStep"||n==="_next";let u=c;u.includes("/example/")?u=u.substring(u.indexOf("/example/")+9):u.includes("/src/")?u=u.substring(u.indexOf("/src/")+1):u.includes("/node_modules/")&&(u=u.substring(u.indexOf("/node_modules/")+14));const $=l?`${g}:${l}${d?`:${d}`:""}`:g;return{raw:e,functionName:n,fileName:g,fullPath:u,rawFilePath:a,fileExt:f,frameType:A,isUserCode:C,isRuntimeNoise:N,lineNumber:l,columnNumber:d,isOrigin:t,copyableLocation:$}};exports.parseStackLine=parseStackLine;const openInVSCode=(e,t,o)=>{const r=t?Number(t):1,n=o?Number(o):1,s=t?`:${t}`:"",i=o?`:${o}`:"",a=e.replace(/^file:\/\//,"");let l=null;try{const p=react_native_1.NativeModules?.SourceCode?.scriptURL||react_native_1.NativeModules?.PlatformConstants?.serverHost||react_native_1.NativeModules?.DevSettings?.serverHost;if(typeof p=="string"&&p.length>0){const f=p.match(/^(https?:\/\/[^/]+)/);f?l=f[1]:!p.startsWith("http")&&p.includes(":")&&(l=`http://${p}`)}}catch{}Array.from(new Set([...l?[l]:[],"http://localhost:8081","http://127.0.0.1:8081","http://10.0.2.2:8081"])).forEach(p=>{try{fetch(`${p}/open-stack-frame`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:a,lineNumber:r,column:n})}).catch(()=>{})}catch{}});const c=`vscode://file/${a.replace(/^\/+/,"")}${s}${i}`,g=`cursor://file/${a.replace(/^\/+/,"")}${s}${i}`,m=`vscode-insiders://file/${a.replace(/^\/+/,"")}${s}${i}`;react_native_1.Linking.openURL(c).catch(()=>{react_native_1.Linking.openURL(g).catch(()=>{react_native_1.Linking.openURL(m).catch(()=>{(0,exports.copyToClipboard)(`${a}${s}${i}`,"Location")})})})};exports.openInVSCode=openInVSCode,exports.ANALYTICS_EVENT_PALETTE=[AppColors_1.AppColors.googleBlue,AppColors_1.AppColors.googleGreen,AppColors_1.AppColors.googlePurple,AppColors_1.AppColors.googleTeal,AppColors_1.AppColors.googleRed,AppColors_1.AppColors.googleOrange,AppColors_1.AppColors.blue700,AppColors_1.AppColors.materialGreen];const getEventColor=e=>{const t=typeof e=="string"?e:String(e||"");let o=0;for(let r=0;r<t.length;r++)o=o*31+t.charCodeAt(r)|0;return exports.ANALYTICS_EVENT_PALETTE[Math.abs(o)%exports.ANALYTICS_EVENT_PALETTE.length]};exports.getEventColor=getEventColor;var gaAnalyticsRegistry_1=require("./gaAnalyticsRegistry");Object.defineProperty(exports,"getEventCategory",{enumerable:!0,get:function(){return gaAnalyticsRegistry_1.getEventCategory}}),Object.defineProperty(exports,"registerGAPlugin",{enumerable:!0,get:function(){return gaAnalyticsRegistry_1.registerGAPlugin}});const getCategoryColors=e=>{switch(e){case"page_view":case"Page View":return{bg:AppColors_1.AppColors.blueBg,border:AppColors_1.AppColors.blueBorder,text:AppColors_1.AppColors.blue800};case"ecommerce":case"Ecommerce":return{bg:AppColors_1.AppColors.greenBg,border:AppColors_1.AppColors.greenBorder,text:AppColors_1.AppColors.materialGreen};case"system":case"System":return{bg:AppColors_1.AppColors.greyBg,border:AppColors_1.AppColors.greyBorder,text:AppColors_1.AppColors.grey600};default:return{bg:AppColors_1.AppColors.purpleBg,border:AppColors_1.AppColors.purpleBorder,text:AppColors_1.AppColors.purpleText}}};exports.getCategoryColors=getCategoryColors;const getRuntimeDiagnostics=()=>{const e=typeof global.HermesInternal<"u",t=typeof global._v8runtime<"u",o=e?"hermes":t?"v8":"jsc",n=typeof global.nativeFabricUIManager<"u"||!!global.__turboModuleProxy?"fabric":"paper";let s=32.4,i=64;try{const a=global.HermesInternal?.getInstrumentedStats?.();a?.js_heap_size?(s=Number((a.js_heap_size/(1024*1024)).toFixed(1)),i=Number(((a.js_allocated_bytes||a.js_heap_size*1.6)/(1024*1024)).toFixed(1))):global.performance?.memory?.usedJSHeapSize&&(s=Number((global.performance.memory.usedJSHeapSize/(1024*1024)).toFixed(1)),i=Number((global.performance.memory.totalJSHeapSize/(1024*1024)).toFixed(1)))}catch{}return{engineType:o,archType:n,usedHeapMb:s,totalAllocMb:i}};exports.getRuntimeDiagnostics=getRuntimeDiagnostics;
@@ -1,4 +1,4 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(a,i,l,d){d===void 0&&(d=l);var b=Object.getOwnPropertyDescriptor(i,l);(!b||("get"in b?!i.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return i[l]}}),Object.defineProperty(a,d,b)}):(function(a,i,l,d){d===void 0&&(d=l),a[d]=i[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),__importStar=this&&this.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(l){var d=[];for(var b in l)Object.prototype.hasOwnProperty.call(l,b)&&(d[d.length]=b);return d},a(i)};return function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var d=a(i),b=0;b<d.length;b++)d[b]!=="default"&&__createBinding(l,i,d[b]);return __setModuleDefault(l,i),l}})(),__importDefault=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.registerComponentProfile=exports.getHermesMemoryStats=exports.measureAsync=exports.trackHeavyTask=exports.trackNavigationTransition=exports.trackComponentRender=exports.useNavigationProfiler=exports.useComponentProfiler=exports.usePerformanceTracker=exports.registerGAPlugin=exports.getEventCategory=exports.getLastActionForReducer=exports.clearActionHistory=exports.getActionHistory=exports.subscribeReduxState=exports.getReduxState=exports.inspectorReduxMiddleware=exports.connectReduxStore=exports.ErrorBoundary=exports.CrashTab=exports.computeCrashFingerprint=exports.recordUserActionBreadcrumb=exports.recordReduxBreadcrumb=exports.recordNetworkBreadcrumb=exports.recordNavigationBreadcrumb=exports.addCrashBreadcrumb=exports.recordCustomCrash=exports.parseCrashStackTrace=exports.exportCrashReport=exports.simulateTestCrash=exports.clearCrashRecords=exports.getCrashRecords=exports.emitCrashEvent=exports.subscribeCrashEvents=exports.setupGlobalCrashHandler=exports.getCollectionEnabled=exports.getDefaultEventParameters=exports.getCurrentUserId=exports.getCurrentUserProperties=exports.clearAnalyticsEvents=exports.subscribeAnalyticsEvents=exports.logAnalyticsEvent=exports.setupAnalyticsLogger=exports.subscribeConsoleLogs=exports.clearConsoleLogs=exports.setupConsoleLogger=exports.addAxiosInterceptors=exports.subscribeNetworkLogs=exports.clearNetworkLogs=exports.setupNetworkLogger=void 0,exports.connectMMKV=exports.connectAsyncStorage=exports.BrandCircleIcon=exports.BrandSquareIcon=exports.prunePerformanceEvents=exports.getMaxPerformanceEventsLimit=exports.setMaxPerformanceEventsLimit=exports.pruneCrashRecords=exports.getMaxCrashLogsLimit=exports.pruneAnalyticsLogs=exports.getMaxAnalyticsLogsLimit=exports.setMaxAnalyticsLogsLimit=exports.pruneReduxHistory=exports.getMaxReduxHistoryLimit=exports.setMaxReduxHistoryLimit=exports.pruneConsoleLogs=exports.getMaxConsoleLogsLimit=exports.setMaxConsoleLogsLimit=exports.pruneNetworkLogs=exports.getMaxNetworkLogsLimit=exports.setMaxNetworkLogsLimit=exports.subscribeMemoryWarning=exports.pruneAllLogs=exports.setupMemoryWarningHandler=exports.isNativeModuleAvailable=exports.setNativeStorageItem=exports.getNativeStorageItem=exports.getNativeFpsMetrics=exports.stopNativeFpsMonitoring=exports.startNativeFpsMonitoring=exports.subscribeNativeDeviceShake=exports.subscribeNativeFloatingButtonPress=exports.setNativeFloatingButtonBadge=exports.hideNativeFloatingButton=exports.showNativeFloatingButton=exports.subscribeNativeCrashes=exports.enableNativeCrashProtection=exports.getNativeDeviceMetrics=exports.InspectCatch=exports.InspectTrackTime=exports.InspectLog=exports.generateFixSnippet=exports.getInitialPerformanceEvents=exports.getInitialRenderProfiles=exports.getPerformanceEvents=exports.subscribePerformanceEvents=exports.clearPerformanceEvents=exports.logPerformanceEvent=exports.getRenderProfiles=exports.subscribeRenderProfiles=void 0,exports.LIB_VERSION=exports.ScreenRecorder=exports.ScreenCapture=exports.isFirebaseRemoteConfigAvailable=exports.fetchRemoteConfigModuleStatus=exports.I18nextProvider=exports.setTranslations=exports.addTranslations=exports.setLanguage=exports.useTranslation=exports.i18n=exports.t=exports.updateAppColorsTheme=exports.getThemeColors=exports.setAppColors=exports.AppColors=exports.setAppFonts=exports.AppFonts=exports.BreadcrumbType=exports.CrashFilterType=exports.CrashDetailSubTab=exports.CrashExportFormat=exports.CrashType=exports.PerformanceSubTab=exports.BundleSubTab=exports.DiffResultType=exports.StackFrameType=exports.GAEventCategory=exports.AnalyticsEventSource=exports.ConsoleLogType=exports.LogFilter=exports.SettingsSubTab=exports.SettingsPage=exports.ModalAnimationType=exports.LocalFilter=exports.SortOrder=exports.StatusFilter=exports.Method=exports.ActiveTab=exports.subscribeToStorageChanges=exports.clearStorageDriver=exports.removeStorageEntry=exports.setStorageEntry=exports.fetchStorageEntries=exports.getRegisteredMMKVInstanceIds=exports.isMMKVConnected=exports.isAsyncStorageConnected=void 0;const react_1=__importStar(require("react")),react_native_1=require("react-native"),native_1=require("@react-navigation/native"),i18n_1=require("./i18n"),ErrorBoundary_1=__importDefault(require("./components/ErrorBoundary")),MainScreen_1=__importDefault(require("./components/Inspector/MainScreen")),InspectorContext_1=require("./components/Inspector/InspectorContext"),helpers_1=require("./helpers"),settingsStore_1=require("./helpers/settingsStore"),NativeInspector_1=require("./native/NativeInspector"),networkLogger_1=require("./customHooks/networkLogger"),consoleLogger_1=require("./customHooks/consoleLogger"),logFilters_1=require("./customHooks/logFilters"),crashHandler_1=require("./customHooks/crashHandler"),telemetry_1=require("./helpers/telemetry"),analyticsLogger_1=require("./customHooks/analyticsLogger"),reduxLogger_1=require("./customHooks/reduxLogger"),performanceTracker_1=require("./customHooks/performanceTracker"),bundleAnalyzer_1=require("./customHooks/bundleAnalyzer"),NativeInspector_2=require("./native/NativeInspector"),remoteConfig_1=require("./helpers/remoteConfig"),capture_1=require("./capture"),constants_1=require("./constants"),styles_1=require("./styles"),NetworkInspector=({enabled:a=!0,storage:i,navigationRef:l,appIcon:d,environment:b,initialVisible:Gr=!1,visible:Se,remoteConfig:Ce})=>{(0,settingsStore_1.setCustomStorage)(i||null);const[ve,$e]=(0,react_1.useState)(!1),[ht,Pe]=(0,react_1.useState)(null),[St,Le]=(0,react_1.useState)({}),[Ae,Je]=(0,react_1.useState)(90),[Re,Xe]=(0,react_1.useState)("slide"),[y,j]=(0,react_1.useState)([]),[x,$]=(0,react_1.useState)(Se??Gr??!1),[Ct,Ke]=(0,react_1.useState)(!1),Ur=(0,react_1.useCallback)(()=>{Ke(!0),$(!1)},[]);(0,react_1.useEffect)(()=>{Se!==void 0&&$(Se)},[Se]);const[vt,Pt]=(0,react_1.useState)(!1),[g,Qe]=(0,react_1.useState)(null),[Oe,oe]=(0,react_1.useState)(new Set),[J,Lt]=(0,react_1.useState)(""),[Ee,zr]=(0,react_1.useState)("all"),[we,Wr]=(0,react_1.useState)(!1),[Ne,$r]=(0,react_1.useState)(!1),[A,Jr]=(0,react_1.useState)("all"),[At,Ye]=(0,react_1.useState)(""),[Rt,Xr]=(0,react_1.useState)(""),[Ot,Ze]=(0,react_1.useState)(null),[Et,et]=(0,react_1.useState)(null),[wt,Kr]=(0,react_1.useState)("state"),[Nt,Mt]=(0,react_1.useState)("response");(0,react_1.useEffect)(()=>(react_native_1.LogBox.ignoreAllLogs(a),()=>{react_native_1.LogBox.ignoreAllLogs(!1)}),[a]),(0,react_1.useEffect)(()=>{g&&(Mt("response"),Ye(""))},[g]);const[ae,tt]=(0,react_1.useState)(new Set),[ie,rt]=(0,react_1.useState)(new Set),[jt,st]=(0,react_1.useState)({}),[Tt,nt]=(0,react_1.useState)(new Set),[It,Qr]=(0,react_1.useState)(!0),[Me,Yr]=(0,react_1.useState)("newest"),[je,Zr]=(0,react_1.useState)("newest"),[_t,kt]=(0,react_1.useState)(!0),[Ft,Dt]=(0,react_1.useState)(!0),[Bt,qt]=(0,react_1.useState)(!1),[Ht,Vt]=(0,react_1.useState)(!1),[p,H]=(0,react_1.useState)("apis"),[Te,V]=(0,react_1.useState)([]),[G,U]=(0,react_1.useState)([]),[Gt,ot]=(0,react_1.useState)(null),[X,es]=(0,react_1.useState)(!1),Ut=(0,react_1.useRef)(X);Ut.current=X;const ue=(0,react_1.useRef)([]),[K,ts]=(0,react_1.useState)(!1),zt=(0,react_1.useRef)(K);zt.current=K;const ce=(0,react_1.useRef)([]),[Q,rs]=(0,react_1.useState)(!1),Wt=(0,react_1.useRef)(Q);Wt.current=Q;const le=(0,react_1.useRef)([]),[$t,Jt]=(0,react_1.useState)(0),[Xt,Kt]=(0,react_1.useState)(0),[Qt,Yt]=(0,react_1.useState)(0),[Zt,er]=(0,react_1.useState)(0),Ie=(0,react_1.useCallback)(async()=>{try{const t=await capture_1.ScreenCapture.getMediaList(),e=t?t.length:0;return er(e),e}catch{return er(0),0}},[]);(0,react_1.useEffect)(()=>{x&&Ie()},[x,Ie]);const[fe,T]=(0,react_1.useState)(()=>(0,crashHandler_1.getCrashRecords)()),[tr,Y]=(0,react_1.useState)(null),[I,_e]=(0,react_1.useState)(50);(0,react_1.useEffect)(()=>{(0,crashHandler_1.setMaxCrashLogsLimit)(I)},[I]),(0,react_1.useEffect)(()=>{x&&(p==="apis"&&Kt(y.length),p==="logs"&&Jt(G.length),p==="crash"&&Yt(fe.length))},[x]),(0,react_1.useEffect)(()=>{p==="apis"&&Kt(y.length)},[p,y.length]),(0,react_1.useEffect)(()=>{p==="logs"&&Jt(G.length)},[p,G.length]),(0,react_1.useEffect)(()=>{p==="crash"&&Yt(fe.length)},[p,fe.length]);const[Z,ke]=(0,react_1.useState)(100),[_,at]=(0,react_1.useState)({info:!0,warn:!0,error:!0}),k=(0,react_1.useMemo)(()=>G.filter(e=>{const s=e.type;if(s==="info"&&!_?.info||s==="warn"&&!_?.warn||s==="error"&&!_?.error)return!1;const r=e.message||"";return![...logFilters_1.IGNORED_LOG_PREFIXES&&logFilters_1.IGNORED_LOG_PREFIXES.info||[],...logFilters_1.IGNORED_LOG_PREFIXES&&logFilters_1.IGNORED_LOG_PREFIXES.warn||[],...logFilters_1.IGNORED_LOG_PREFIXES&&logFilters_1.IGNORED_LOG_PREFIXES.error||[]].filter(f=>typeof f=="string"&&f.trim().length>0).some(f=>r.toLowerCase().trim().startsWith(f.toLowerCase().trim())||r.toLowerCase().trim().includes(f.toLowerCase().trim()))}).slice(0,Z),[G,_,Z]),[R,rr]=(0,react_1.useState)(""),[O,sr]=(0,react_1.useState)(new Set(["all"])),[nr,ss]=(0,react_1.useState)(null),[or,ns]=(0,react_1.useState)(!1),[ar,os]=(0,react_1.useState)(!1),[ir,as]=(0,react_1.useState)("module"),[h,Fe]=(0,react_1.useState)({apis:!0,logs:!0,analytics:!1,redux:!1,bundle:!1,performance:!1,crash:!1,device:!1,storage:!1,debugging:!1,media:!0}),[F,De]=(0,react_1.useState)(250),[ee,Be]=(0,react_1.useState)(150),[te,it]=(0,react_1.useState)(!0),[ut,is]=(0,react_1.useState)(1800),[re,ct]=(0,react_1.useState)(!0),[qe,lt]=(0,react_1.useState)(1),[D,He]=(0,react_1.useState)("apis"),[B,ft]=(0,react_1.useState)(!1),[pt,dt]=(0,react_1.useState)(!0);(0,react_1.useEffect)(()=>{(0,networkLogger_1.setNetworkModuleEnabled)(!!h.apis),(0,consoleLogger_1.setConsoleModuleEnabled)(!!h.logs),(0,analyticsLogger_1.setAnalyticsModuleEnabled)(!!h.analytics),(0,reduxLogger_1.setReduxModuleEnabled)(!!h.redux),(0,performanceTracker_1.setPerformanceModuleEnabled)(!!h.performance),(0,crashHandler_1.setCrashModuleEnabled)(!!h.crash),(0,bundleAnalyzer_1.setBundleModuleEnabled)(!!h.bundle)},[h]),(0,react_1.useEffect)(()=>{(0,NativeInspector_1.getNativeSystemMetrics)().then(t=>{if(t){const e=t.totalPhysicalRamMb-t.residentRamMb,s=Math.max(200,Math.round(e>0?e:1500));if(is(s),te){const r=(0,settingsStore_1.calculateRamBasedLimits)(s);De(r.maxNetworkLogs),ke(r.maxConsoleLogs),Be(r.maxAnalyticsEvents),_e(r.maxCrashRecords)}}}).catch(()=>{})},[te]);const us=async()=>{await(0,settingsStore_1.clearPersistedSettings)(),$e(!1),(0,styles_1.toggleGlobalTheme)(!1),Je(90),Xe("slide"),Fe({apis:!0,logs:!0,analytics:!1,redux:!1,bundle:!1,performance:!1,crash:!1,device:!1,storage:!1,debugging:!1,media:!0}),He("apis"),it(!0);const t=(0,settingsStore_1.calculateRamBasedLimits)(ut);_e(t.maxCrashRecords),De(t.maxNetworkLogs),ke(t.maxConsoleLogs),Be(t.maxAnalyticsEvents),at({info:!0,warn:!0,error:!0}),ct(!0),lt(1),ft(!1),dt(!0),react_native_1.Alert.alert("Settings Reset","All settings have been reset to default values.")},ur=(0,react_1.useRef)(!1);(0,react_1.useEffect)(()=>{let t=!1;return(0,settingsStore_1.loadSettings)().then(e=>{if(!t){if(e.isDark!=null&&($e(e.isDark),(0,styles_1.toggleGlobalTheme)(e.isDark)),e.modalHeightPercent!=null&&Je(e.modalHeightPercent),e.modalAnimationType&&Xe(e.modalAnimationType),e.tabVisibility&&Fe(s=>({...s,...e.tabVisibility,apis:!0})),e.defaultTab&&He(e.defaultTab),e.isAutoRamLimitEnabled!=null&&it(e.isAutoRamLimitEnabled),e.maxNetworkLogs!=null&&De(e.maxNetworkLogs),e.maxConsoleLogs!=null&&ke(e.maxConsoleLogs),e.maxAnalyticsEventsLimit!=null&&Be(e.maxAnalyticsEventsLimit),e.maxCrashLogs!=null&&_e(e.maxCrashLogs),e.showConsoleLevels&&at(e.showConsoleLevels),e.reduxAutoRefresh!=null&&ct(e.reduxAutoRefresh),e.reduxExpandDepth!=null&&lt(e.reduxExpandDepth),e.showDuplicateLogs!=null&&ft(e.showDuplicateLogs),e.showUpdateToast!=null&&dt(e.showUpdateToast),e.defaultTab){const s=e.defaultTab,r={apis:!0,logs:!0,analytics:!1,redux:!1,bundle:!1,performance:!1,crash:!1,device:!1,storage:!1,...e.tabVisibility||{},apis:!0};H(r[s]?s:"apis")}ur.current=!0}}),()=>{t=!0}},[]),(0,react_1.useEffect)(()=>{let t=!0;if(Ce!==!1)return(0,remoteConfig_1.fetchRemoteConfigModuleStatus)(typeof Ce=="object"?Ce:void 0).then(e=>{t&&e&&Fe(s=>({...s,...e,apis:e.apis??!0}))}).catch(()=>{}),()=>{t=!1}},[Ce]),(0,react_1.useEffect)(()=>{ur.current&&(0,settingsStore_1.saveSettings)({isDark:ve,modalHeightPercent:Ae,modalAnimationType:Re,tabVisibility:h,defaultTab:D,maxNetworkLogs:F,maxConsoleLogs:Z,maxAnalyticsEventsLimit:ee,maxCrashLogs:I,isAutoRamLimitEnabled:te,showConsoleLevels:_,reduxAutoRefresh:re,reduxExpandDepth:qe,showDuplicateLogs:B,showUpdateToast:pt})},[ve,Ae,Re,h,D,F,Z,ee,I,te,_,re,qe,B]);const[pe,cs]=(0,react_1.useState)(null),cr=(0,react_1.useMemo)(()=>{if(!pe)return!1;const t=r=>r.replace(/^v/,"").split(".").map(n=>parseInt(n,10)||0),e=t(constants_1.LIB_VERSION),s=t(pe);for(let r=0;r<3;r++){if((s[r]||0)>(e[r]||0))return!0;if((s[r]||0)<(e[r]||0))return!1}return!1},[pe]);(0,react_1.useEffect)(()=>{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"&&cs(e.version)}).catch(()=>{}),()=>{t=!0}},[]),(0,react_1.useEffect)(()=>{(0,reduxLogger_1.setReduxAutoRefresh)(re)},[re]),(0,react_1.useEffect)(()=>{p==="redux"&&!(0,reduxLogger_1.isReduxConnected)()&&H("apis"),p==="analytics"&&!(0,analyticsLogger_1.isAnalyticsConnected)()&&H("apis")},[p]);const lr=t=>{t!=="apis"&&(t==="redux"&&!(0,reduxLogger_1.isReduxConnected)()||t==="analytics"&&!(0,analyticsLogger_1.isAnalyticsConnected)()||Fe(e=>{const s=!e[t],r={...e,[t]:s};return!s&&p===t&&((0,InspectorContext_1.animateNextLayout)(),H("apis")),!s&&D===t&&He("apis"),r}))},gt=(0,react_1.useCallback)(async(t,e="")=>{if(t==="apis"||t==="logs"||t==="analytics"||t==="crash"){const s=await(0,NativeInspector_1.fetchNativeCachedPage)(t,0,100,e);s&&s.items&&s.items.length>0&&(t==="apis"?j(s.items):t==="logs"?U(s.items):t==="analytics"?V(s.items):t==="crash"&&T(s.items))}},[]),fr=(0,react_1.useCallback)(t=>{t==="redux"&&!(0,reduxLogger_1.isReduxConnected)()||t==="analytics"&&!(0,analyticsLogger_1.isAnalyticsConnected)()||(Qe(null),Ve(null),ot(null),Ze(null),et(null),Y(null),typeof react_1.default.startTransition=="function"?react_1.default.startTransition(()=>{H(t),gt(t)}):(H(t),gt(t)),(0,telemetry_1.trackInspectorTabView)(t))},[gt]),[pr,Ve]=(0,react_1.useState)(null),[se,dr]=(0,react_1.useState)(""),[o,gr]=(0,react_1.useState)({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"}),mr=(0,react_1.useMemo)(()=>!!(o.categories.size>0&&!o.categories.has("all")||o.screens.size>0||o.sources.size>0&&!o.sources.has("all")||o.userTypes.size>0&&!o.userTypes.has("all")||o.timeWindow!=="all"||o.payloadComplexity!=="all"||o.hasRevenue||o.hasItems||o.hasUserProps||o.hasParams||o.onlyDuplicates||o.onlyConversions||o.sortBy!=="time_desc"),[o]),br=(0,react_1.useCallback)(()=>{gr({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"})},[]),[xr,ls]=(0,react_1.useState)(!1),[yr,fs]=(0,react_1.useState)(!1),[hr,Sr]=(0,react_1.useState)(new Set),de=(0,react_1.useRef)(new Set),[mt,bt]=(0,react_1.useState)(null),Cr=react_1.default.useContext(native_1.NavigationContext)!==void 0,z=(0,react_1.useRef)({path:"",params:null});(0,react_1.useEffect)(()=>((0,networkLogger_1.setRouteInfoProvider)(()=>z.current),()=>{(0,networkLogger_1.setRouteInfoProvider)(null)}),[]),(0,react_1.useEffect)(()=>{if(mt){const t=(0,helpers_1.getNavigationInfo)(mt);t?.path&&(z.current=t)}},[mt]),(0,react_1.useEffect)(()=>{if(!l)return;const t=()=>{try{if(typeof l.isReady=="function"&&l.isReady()){const s=typeof l.getCurrentRoute=="function"?l.getCurrentRoute():null;s?.name&&(z.current={path:s.name,params:s.params||null});const r=l.getRootState();if(r){bt(r);const n=(0,helpers_1.getNavigationInfo)(r);n?.path&&(z.current=n)}}}catch{}};t();const e=typeof l.addListener=="function"?l.addListener("state",()=>{t()}):null;return()=>{e&&e()}},[l]);const P=(0,react_1.useRef)(new Map),ne=(0,react_1.useRef)(new Set),[vr,Pr]=(0,react_1.useState)(new Set),ge=(0,react_1.useRef)(new react_native_1.Animated.Value(1)).current,me=(0,react_1.useRef)(new react_native_1.Animated.Value(.4)).current,be=(0,react_1.useRef)(new react_native_1.Animated.Value(1)).current,xe=(0,react_1.useRef)(new react_native_1.Animated.Value(0)).current,ye=(0,react_1.useRef)(new react_native_1.Animated.Value(0)).current,S=(0,react_1.useRef)(new react_native_1.Animated.ValueXY({x:0,y:0})).current,Ge=(0,react_1.useRef)({x:0,y:0});(0,react_1.useEffect)(()=>{const t=S.x.addListener(s=>Ge.current.x=s.value),e=S.y.addListener(s=>Ge.current.y=s.value);return()=>{S.x.removeListener(t),S.y.removeListener(e)}},[S]);const Ue=(0,react_1.useRef)(!1),Lr=(0,react_1.useRef)(react_native_1.PanResponder.create({onStartShouldSetPanResponder:()=>!1,onMoveShouldSetPanResponder:(t,e)=>Math.abs(e.dx)>4||Math.abs(e.dy)>4,onPanResponderGrant:()=>{Ue.current=!0,S.setOffset({x:Ge.current.x,y:Ge.current.y}),S.setValue({x:0,y:0})},onPanResponderMove:react_native_1.Animated.event([null,{dx:S.x,dy:S.y}],{useNativeDriver:!1}),onPanResponderRelease:()=>{S.flattenOffset(),setTimeout(()=>{Ue.current=!1},50)},onPanResponderTerminate:()=>{S.flattenOffset(),Ue.current=!1}})).current,Ar=(0,react_1.useCallback)(()=>{react_native_1.Animated.sequence([react_native_1.Animated.timing(ye,{toValue:1,duration:320,useNativeDriver:!1}),react_native_1.Animated.timing(ye,{toValue:0,duration:0,useNativeDriver:!1})]).start(),ds()},[ye]);(0,react_1.useEffect)(()=>{react_native_1.Platform.OS==="android"&&react_native_1.UIManager.setLayoutAnimationEnabledExperimental?.(!0)},[]),(0,react_1.useEffect)(()=>{if(x)return;const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(ge,{toValue:1.2,duration:800,useNativeDriver:!1}),react_native_1.Animated.timing(ge,{toValue:1,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[ge,x]),(0,react_1.useEffect)(()=>{if(x)return;const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(xe,{toValue:1,duration:3200,easing:react_native_1.Easing.inOut(react_native_1.Easing.ease),useNativeDriver:!1}),react_native_1.Animated.delay(3500),react_native_1.Animated.timing(xe,{toValue:0,duration:0,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[xe,x]),(0,react_1.useEffect)(()=>{const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(me,{toValue:1,duration:1200,useNativeDriver:!1}),react_native_1.Animated.timing(me,{toValue:.4,duration:1200,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[me]),(0,react_1.useEffect)(()=>{const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(be,{toValue:1.3,duration:800,useNativeDriver:!1}),react_native_1.Animated.timing(be,{toValue:.8,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[be]);const ps=(0,react_1.useMemo)(()=>(0,NativeInspector_2.isNativeModuleAvailable)(),[]),q=(react_native_1.Platform.OS==="ios"||react_native_1.Platform.OS==="android")&&ps;(0,react_1.useEffect)(()=>{q&&(0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{})},[q,x]),(0,react_1.useEffect)(()=>{if(!q)return;const t=(0,NativeInspector_2.subscribeNativeFloatingButtonPress)(()=>{(0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{}),$(!0)});return()=>{t()}},[q]),(0,react_1.useEffect)(()=>{if(!q)return;const t=(0,NativeInspector_2.subscribeNativeDeviceShake)(()=>{$(e=>{const s=!e;return s&&(0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{}),s})});return()=>{t()}},[q]);const Rr=(0,react_1.useRef)(x);(0,react_1.useEffect)(()=>{if(Rr.current=x,x){(0,telemetry_1.trackInspectorScreenView)("InspectorModal");const t=D==="apis"||h?.[D]?D:"apis";if(H(t),(0,telemetry_1.trackInspectorTabView)(t),ue.current.length>0){const n=(0,helpers_1.deduplicateLogs)(ue.current),u=new Set(n.map(f=>f.id));ne.current=u,j(n)}ce.current.length>0&&U(ce.current),le.current.length>0&&V(le.current);const e=(0,reduxLogger_1.getReduxState)();e&&(Pe(typeof e=="object"?{...e}:e),Le({...(0,reduxLogger_1.getLastActionForReducer)()}));const s=(0,crashHandler_1.getCrashRecords)();s.length>0&&T(s);const r=requestAnimationFrame(()=>{Pt(!0)});return()=>{cancelAnimationFrame(r)}}else Pt(!1),oe(new Set)},[x]),(0,react_1.useEffect)(()=>{(0,networkLogger_1.setupNetworkLogger)(),(0,networkLogger_1.clearNetworkLogs)(),(0,consoleLogger_1.setupConsoleLogger)(),(0,analyticsLogger_1.autoSetupAnalyticsLogger)(),(0,crashHandler_1.setupGlobalCrashHandler)();const t=(0,helpers_1.setupMemoryWarningHandler)(),e=Rr,s=(0,crashHandler_1.subscribeCrashEvents)(c=>{if(c.message==="__CLEARED__"){T([]),Y(null);return}const W=(0,crashHandler_1.getCrashRecords)();W.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("crash",JSON.stringify(W[0])),e.current&&T(W)}),r=(0,crashHandler_1.getCrashRecords)();r.length>0&&(r.forEach(c=>(0,NativeInspector_1.pushNativeLogRecord)("crash",JSON.stringify(c))),T(r));let n,u=!0;const f=(0,networkLogger_1.subscribeNetworkLogs)(c=>{if(ue.current=c,c.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("apis",JSON.stringify(c[0])),Ut.current||!e.current)return;clearTimeout(n);const W=()=>{const v=(0,helpers_1.deduplicateLogs)(c),L=new Set(v.map(w=>w.id)),m=new Set;L.forEach(w=>{ne.current.has(w)||m.add(w)}),ne.current=L,m.size>0&&(m.forEach(w=>{if(!P.current.has(w)){const xs=v.find(ys=>ys.id===w)?.routeInfo||z.current;P.current.set(w,xs)}}),Pr(m),setTimeout(()=>Pr(new Set),1200)),j(v)};if(u){u=!1;const v=(0,helpers_1.deduplicateLogs)(c),L=new Set(v.map(m=>m.id));ne.current=L,v.forEach(m=>{if(!P.current.has(m.id)){const w=m?.routeInfo||z.current;P.current.set(m.id,w)}}),j(v)}else n=setTimeout(W,250)});let C,he=!0;const xt=(0,analyticsLogger_1.subscribeAnalyticsEvents)(c=>{if(le.current=c,c.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("analytics",JSON.stringify(c[0])),Wt.current||!e.current)return;clearTimeout(C);const W=()=>{const v=new Set(c.map(m=>m.id)),L=new Set;v.forEach(m=>{de.current.has(m)||L.add(m)}),de.current=v,L.size>0&&(L.forEach(m=>{P.current.has(m+1e6)||P.current.set(m+1e6,z.current)}),Sr(L),setTimeout(()=>Sr(new Set),1200)),V(c)};if(he){he=!1;const v=new Set(c.map(L=>L.id));de.current=v,V(c)}else C=setTimeout(W,200)});let E,M=!0;const yt=(0,consoleLogger_1.subscribeConsoleLogs)(c=>{ce.current=c,c.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("logs",JSON.stringify(c[0])),!zt.current&&e.current&&(clearTimeout(E),M?(M=!1,U(c)):E=setTimeout(()=>{U(c)},200))}),We=(0,reduxLogger_1.getReduxState)();We&&(Pe(typeof We=="object"?{...We}:We),Le({...(0,reduxLogger_1.getLastActionForReducer)()}));const bs=(0,reduxLogger_1.subscribeReduxState)(()=>{if(!e.current)return;const c=(0,reduxLogger_1.getReduxState)();Pe(c&&typeof c=="object"?{...c}:c),Le({...(0,reduxLogger_1.getLastActionForReducer)()})});return()=>{f(),clearTimeout(n),xt(),clearTimeout(C),yt(),clearTimeout(E),bs(),s(),t()}},[]),(0,react_1.useEffect)(()=>{(0,networkLogger_1.setMaxNetworkLogsLimit)(F)},[F]),(0,react_1.useEffect)(()=>{(0,crashHandler_1.setMaxCrashLogsLimit)(I)},[I]),(0,react_1.useEffect)(()=>{if(!X&&ue.current.length>0){const t=(0,helpers_1.deduplicateLogs)(ue.current);j(t)}},[X]),(0,react_1.useEffect)(()=>{!Q&&le.current.length>0&&V(le.current)},[Q]),(0,react_1.useEffect)(()=>{!K&&ce.current.length>0&&U(ce.current)},[K]),(0,react_1.useEffect)(()=>{kt(!0),Dt(!0),qt(!1),Vt(!1),Ye("")},[g]);const N=(0,react_1.useMemo)(()=>{let t=y.filter(e=>{if(A&&A!=="all"){if(A==="errors"){if(!(e.status===0||e.status==null||typeof e.status=="number"&&e.status>=400))return!1}else if(A==="success"){if(!(typeof e.status=="number"&&e.status>=200&&e.status<400))return!1}else if(A==="slow"){if((e.duration||0)<500)return!1}else if(A==="graphql"){if(!((e.url||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("apollo")))return!1}else if(e.method?.toUpperCase()!==A.toUpperCase())return!1}if(ae.size>0&&![...ae].some(r=>{if(r==="ALL")return!0;if(r==="Failed")return e.status===0||e.status==null;const n=parseInt(r,10);return isNaN(n)?String(e.status)[0]===r[0]:Number(e.status)===n})||ie.size>0&&![...ie].some(r=>r==="ALL"?!0:e.method?.toUpperCase()===r))return!1;if(J&&J.trim().length>0){const s=P.current.get(e.id)?.path||"";if(!(0,helpers_1.matchNetworkLogQuery)(e,J,s,{scope:Ee,isRegex:we,isCaseSensitive:Ne}))return!1}return!0});if(Me==="oldest"&&(t=[...t].reverse()),!B){const e=[];for(const s of t){const r=e[e.length-1];r&&r.method===s.method&&r.url===s.url&&r.status===s.status?e[e.length-1]={...r,duplicateCount:(r.duplicateCount||1)+1}:e.push({...s,duplicateCount:1})}t=e}return t.slice(0,F)},[y,J,Ee,we,Ne,A,ae,ie,Me,F,B]),Or=(0,react_1.useMemo)(()=>{const t=new Set;return y.forEach(e=>{e.method&&t.add(e.method.toUpperCase())}),["ALL",...Array.from(t)]},[y]),Er=(0,react_1.useCallback)((t,e)=>{st(s=>{const r=s[t]||new Set(["success","failed","loading"]),n=new Set(r);return n.has(e)?n.delete(e):n.add(e),{...s,[t]:n}})},[]),wr=(0,react_1.useCallback)(t=>{nt(e=>{const s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},[]),Nr=(0,react_1.useMemo)(()=>{const t=[],e=new Map;for(let r=0;r<N.length;r++){const n=N[r],u=P.current.get(n.id)||n?.routeInfo,f=(0,helpers_1.getLogPageName)(n,u);let C=e.get(f);C||(C={pageName:f,color:(0,helpers_1.getDomainColor)(f),logs:[]},e.set(f,C)),C.logs.push(n)}let s=0;return e.forEach(r=>{let n=0,u=0,f=0;r.logs.forEach(E=>{E.status==null?f++:E.status===0||E.status>=400?u++:n++});const C=jt[r.pageName]||new Set(["success","failed","loading"]),he=Tt.has(r.pageName),xt=r.logs[0]?.startTime||0;if(t.push({type:"header",id:`hdr-${r.pageName}`,pageName:r.pageName,color:r.color,stats:{success:n,failed:u,loading:f},timestamp:xt,activeFilters:C,isCollapsed:he,isFirst:s===0}),s++,!he){const E=r.logs.filter(M=>M.status==null?C.has("loading"):M.status===0||M.status>=400?C.has("failed"):C.has("success"));E.forEach((M,yt)=>{t.push({type:"log",id:`log-${M.id}`,log:M,isLast:yt===E.length-1,color:r.color})})}}),t},[N,y,jt,Tt]),{minStart:Mr,totalRange:jr}=(0,react_1.useMemo)(()=>{if(N.length===0)return{minStart:0,totalRange:0};const t=Math.min(...N.map(s=>s.startTime)),e=Math.max(...N.map(s=>s.startTime+(s.duration||10)));return{minStart:t,totalRange:e-t}},[N]),ze=(0,react_1.useMemo)(()=>{if(!g)return null;const t=y.findIndex(e=>e.id===g.id);if(t===-1)return null;for(let e=t+1;e<y.length;e++){const s=y[e];if(s.url===g.url&&s.method===g.method)return s}return null},[g,y]),Tr=ze?ze.request:null,Ir=ze?ze.response:null,_r=(0,react_1.useMemo)(()=>{let t=Te;if(se&&se.trim().length>0){const r=se.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 r.every(f=>u.includes(f))})}if(o.categories.size>0&&!o.categories.has("all")&&(t=t.filter(r=>{const n=(0,helpers_1.getEventCategory)(r.name);return o.categories.has(n)})),o.timeWindow!=="all"){const r=Date.now(),n=o.timeWindow==="1m"?r-60*1e3:o.timeWindow==="5m"?r-300*1e3:o.timeWindow==="15m"?r-900*1e3:r-3600*1e3;t=t.filter(u=>u.timestamp>=n)}if(o.sources.size>0&&!o.sources.has("all")&&(t=t.filter(r=>o.sources.has(r.source||"manual"))),o.userTypes.size>0&&!o.userTypes.has("all")&&(t=t.filter(r=>{const n=!!(r.userId&&r.userId.trim()!=="");return!!(o.userTypes.has("identified")&&n||o.userTypes.has("anonymous")&&!n)})),o.payloadComplexity!=="all"&&(o.payloadComplexity==="none"?t=t.filter(r=>!r.params||Object.keys(r.params).length===0):o.payloadComplexity==="simple"?t=t.filter(r=>r.params&&Object.keys(r.params).length<=3):o.payloadComplexity==="heavy"&&(t=t.filter(r=>r.params&&Object.keys(r.params).length>3))),o.onlyConversions){const r=["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=>r.some(u=>n.name.toLowerCase().includes(u)))}o.screens.size>0&&(t=t.filter(r=>{const n=r.screenName||r.params?.firebase_screen||r.params?.screen_name||r.params?.firebase_screen_class||r.screenClass||"";return o.screens.has(n)})),o.hasRevenue&&(t=t.filter(r=>r.params?.value!=null&&!isNaN(Number(r.params.value))||r.params?.price!=null&&!isNaN(Number(r.params.price)))),o.hasItems&&(t=t.filter(r=>Array.isArray(r.params?.items)&&r.params.items.length>0)),o.hasUserProps&&(t=t.filter(r=>r.userProperties&&Object.keys(r.userProperties).length>0)),o.hasParams&&(t=t.filter(r=>r.params&&Object.keys(r.params).length>0));const e=[];for(const r of t){if(e.length===0){e.push({...r,count:1});continue}const n=e[e.length-1];n.name===r.name&&JSON.stringify(n.params)===JSON.stringify(r.params)&&JSON.stringify(n.userProperties)===JSON.stringify(r.userProperties)?(n.count=(n.count||1)+1,n.timestamp=r.timestamp,n.id=r.id):e.push({...r,count:1})}let s=e;return o.onlyDuplicates&&(s=s.filter(r=>(r.count||1)>1)),o.sortBy==="time_asc"?s=[...s].sort((r,n)=>r.timestamp-n.timestamp):o.sortBy==="revenue_desc"?s=[...s].sort((r,n)=>{const u=Number(r.params?.value??r.params?.price??0);return Number(n.params?.value??n.params?.price??0)-u}):o.sortBy==="count_desc"&&(s=[...s].sort((r,n)=>(n.count||1)-(r.count||1))),s.slice(0,ee)},[Te,se,o,ee]),kr=(0,react_1.useMemo)(()=>{let t=k;if(O.size>0&&!O.has("all")&&(t=t.filter(e=>!!(O.has("user-log")&&e.sourceMethod==="log"||O.has("info")&&(e.sourceMethod==="info"||e.type==="info"&&e.sourceMethod!=="log")||O.has("warn")&&(e.type==="warn"||e.sourceMethod==="warn")||O.has("error")&&(e.type==="error"||e.sourceMethod==="error")||O.has("analytics")&&e.message?.toLowerCase().includes("[analytics error]")))),R&&R.trim().length>0){const e=R.trim().toLowerCase().split(/\s+/).filter(Boolean);t=t.filter(s=>{const r=[s.message||"",s.caller||"",s.type||"",s.sourceMethod||"",s.stack||""].join(" ").toLowerCase();return e.every(n=>n==="error"||n==="err"?s.type==="error"||r.includes(n):n==="warn"||n==="warning"?s.type==="warn"||r.includes(n):n==="info"&&s.type==="info"||r.includes(n))})}if(t=[...t].sort((e,s)=>je==="newest"?s.timestamp-e.timestamp:e.timestamp-s.timestamp),!B){const e=[];for(const s of t){const r=e[e.length-1];r&&r.type===s.type&&r.sourceMethod===s.sourceMethod&&r.message===s.message?e[e.length-1]={...r,duplicateCount:(r.duplicateCount||1)+1}:e.push({...s,duplicateCount:1})}t=e}return t},[k,O,R,je,B]),Fr=(0,react_1.useMemo)(()=>{let t=k;if(R&&R.trim().length>0){const s=R.trim().toLowerCase().split(/\s+/).filter(Boolean);t=k.filter(r=>{const n=[r.message||"",r.caller||"",r.type||"",r.sourceMethod||"",r.stack||""].join(" ").toLowerCase();return s.every(u=>u==="error"||u==="err"?r.type==="error"||n.includes(u):u==="warn"||u==="warning"?r.type==="warn"||n.includes(u):u==="info"&&r.type==="info"||n.includes(u))})}const e=k.length;return{all:`${t.length}/${e}`,info:`${t.filter(s=>s.sourceMethod==="info"||s.type==="info"&&s.sourceMethod!=="log").length}/${e}`,warn:`${t.filter(s=>s.type==="warn"||s.sourceMethod==="warn").length}/${e}`,error:`${t.filter(s=>s.type==="error"||s.sourceMethod==="error").length}/${e}`,"user-log":`${t.filter(s=>s.sourceMethod==="log").length}/${e}`,analytics:`${t.filter(s=>s.message.toLowerCase().includes("[analytics error]")).length}/${e}`}},[k,R]),Dr=(0,react_1.useCallback)(()=>{$(!1),Ke(!1),setTimeout(()=>{Qe(null),Ve(null),ot(null),Ze(null),et(null),Y(null)},300)},[]);function ds(){(0,networkLogger_1.clearNetworkLogs)(),j([]),oe(new Set),st({}),nt(new Set),tt(new Set),rt(new Set),Lt(""),ne.current=new Set,P.current=new Map,(0,analyticsLogger_1.clearAnalyticsEvents)(),V([]),dr(""),de.current=new Set,(0,consoleLogger_1.clearConsoleLogs)(),U([]),sr(new Set(["all"])),rr("")}function Br(){if(p==="logs"){react_native_1.Alert.alert("Clear Logs","Are you sure you want to clear all console logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,consoleLogger_1.clearConsoleLogs)(),U([])},style:"destructive"}]);return}if(p==="analytics"){react_native_1.Alert.alert("Clear Analytics","Are you sure you want to clear all analytics events?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,analyticsLogger_1.clearAnalyticsEvents)(),V([]),Ve(null),de.current=new Set},style:"destructive"}]);return}if(p==="redux"){react_native_1.Alert.alert("Clear Redux Timeline","Are you sure you want to clear the dispatched action history?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,reduxLogger_1.clearActionHistory)(),Le({})},style:"destructive"}]);return}if(p==="crash"){react_native_1.Alert.alert("Clear Crash History","Are you sure you want to clear all intercepted crash records?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,crashHandler_1.clearCrashRecords)(),T([]),Y(null)},style:"destructive"}]);return}Oe.size>0?(j(t=>t.filter(e=>!Oe.has(e.id))),oe(new Set)):react_native_1.Alert.alert("Clear Logs","Are you sure you want to clear all network logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:gs,style:"destructive"}])}function gs(){(0,networkLogger_1.clearNetworkLogs)(),j([]),oe(new Set),st({}),nt(new Set),tt(new Set),rt(new Set),ne.current=new Set,P.current=new Map}const qr=(0,react_1.useMemo)(()=>{if(!g)return"";try{const e=new URL(g.url).pathname.split("/").filter(Boolean);return e.length>0?`/${e.slice(-2).join("/")}`:"/"}catch{const t=g.url.split("/").filter(Boolean);return t.length>0?`/${t.slice(-2).join("/")}`:g.url}},[g]),Hr=(0,react_1.useMemo)(()=>g?(0,helpers_1.formatDisplayUrl)(g.url):"",[g]),Vr=(0,react_1.useCallback)(t=>{oe(e=>{const s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},[]),ms=(0,react_1.useMemo)(()=>({visible:x,setVisible:$,closeModal:Dr,isMinimized:Ct,setIsMinimized:Ke,minimizeInspector:Ur,isReady:vt,enabled:a,isEnabled:a,appIcon:d,environment:b,modalHeightPercent:Ae,setModalHeightPercent:Je,modalAnimationType:Re,setModalAnimationType:Xe,hasNavigationContext:Cr,setNavState:bt,activeTab:p,switchActiveTab:fr,tabVisibility:h,toggleTabVisibility:lr,lastReadApisCount:Xt,lastReadLogsCount:$t,mediaCount:Zt,refreshMediaCount:Ie,selected:g,setSelected:Qe,selectedEvent:pr,setSelectedEvent:Ve,selectedLog:Gt,setSelectedLog:ot,showHeaderInfo:It,setShowHeaderInfo:Qr,settingsPage:nr,setSettingsPage:ss,isFeedbackOpen:or,setIsFeedbackOpen:ns,isAboutOpen:ar,setIsAboutOpen:os,updateAvailable:cr,latestNpmVersion:pe,clearAnim:ye,activePulseAnim:me,unreadPulseAnim:be,runClearAllWithAnimation:Ar,useNativeFab:q,fabPan:S,fabPanResponder:Lr,fabDraggedRef:Ue,pulseAnim:ge,fabShineAnim:xe,logs:y,filteredLogs:N,groupedData:Nr,search:J,setSearch:Lt,searchScope:Ee,setSearchScope:zr,isRegexSearch:we,setIsRegexSearch:Wr,isCaseSensitive:Ne,setIsCaseSensitive:$r,quickFilter:A,setQuickFilter:Jr,statusFilters:ae,setStatusFilters:tt,methodFilters:ie,setMethodFilters:rt,availableMethods:Or,sortOrder:Me,setSortOrder:Yr,selectedLogs:Oe,toggleSelect:Vr,minStart:Mr,totalRange:jr,newLogIds:vr,toggleSectionFilter:Er,toggleSectionCollapse:wr,handleDelete:Br,isNetworkPaused:X,setIsNetworkPaused:es,detailTitle:qr,detailDisplayUrl:Hr,apiDetailActiveTab:Nt,setApiDetailActiveTab:Mt,detailSearch:At,setDetailSearch:Ye,reqExpanded:_t,setReqExpanded:kt,resExpanded:Ft,setResExpanded:Dt,showReqDiff:Bt,setShowReqDiff:qt,showResDiff:Ht,setShowResDiff:Vt,prevRequestData:Tr,prevResponseData:Ir,logRouteMapRef:P,consoleLogs:G,visibleConsoleLogs:k,filteredConsoleLogs:kr,logSearch:R,setLogSearch:rr,logFilters:O,setLogFilters:sr,logCounts:Fr,logSortOrder:je,setLogSortOrder:Zr,isConsolePaused:K,setIsConsolePaused:ts,analyticsEvents:Te,filteredAnalyticsEvents:_r,analyticsSearch:se,setAnalyticsSearch:dr,analyticsFilters:o,setAnalyticsFilters:gr,isAnalyticsFilterApplied:mr,resetAnalyticsFilters:br,newEventIds:hr,isAnalyticsLayoutReady:xr,setIsAnalyticsLayoutReady:ls,analyticsHeaderExpanded:yr,setAnalyticsHeaderExpanded:fs,isAnalyticsPaused:Q,setIsAnalyticsPaused:rs,reduxState:ht,setReduxState:Pe,reduxLastActionMap:St,reduxSearch:Rt,setReduxSearch:Xr,selectedReduxSlice:Ot,setSelectedReduxSlice:Ze,selectedReduxAction:Et,setSelectedReduxAction:et,reduxActiveSubTab:wt,setReduxActiveSubTab:Kr,crashRecords:fe,setCrashRecords:T,selectedCrash:tr,setSelectedCrash:Y,lastReadCrashesCount:Qt,maxCrashLogs:I,setMaxCrashLogs:_e,clearAllCrashes:()=>{(0,crashHandler_1.clearCrashRecords)(),T([]),Y(null)},settingsActiveSubTab:ir,setSettingsActiveSubTab:as,defaultTab:D,setDefaultTab:He,isDark:ve,setIsDark:$e,showDuplicateLogs:B,setShowDuplicateLogs:ft,showUpdateToast:pt,setShowUpdateToast:dt,showConsoleLevels:_,setShowConsoleLevels:at,resetToDefaults:us,storage:i,maxNetworkLogs:F,setMaxNetworkLogs:De,maxConsoleLogs:Z,setMaxConsoleLogs:ke,maxAnalyticsEventsLimit:ee,setMaxAnalyticsEventsLimit:Be,isAutoRamLimitEnabled:te,setIsAutoRamLimitEnabled:it,deviceFreeRamMb:ut,reduxAutoRefresh:re,setReduxAutoRefreshState:ct,reduxExpandDepth:qe,setReduxExpandDepth:lt}),[x,Dr,vt,a,d,b,Ae,Re,Cr,bt,p,fr,h,lr,Xt,$t,Zt,Ie,g,pr,Gt,It,nr,or,ar,cr,pe,ye,me,be,Ar,q,S,Lr,ge,xe,y,N,Nr,J,Ee,we,Ne,A,ae,ie,Or,Me,Oe,Vr,Mr,jr,vr,Er,wr,Br,X,qr,Hr,Nt,At,_t,Ft,Bt,Ht,Tr,Ir,G,k,kr,R,O,Fr,je,K,Te,_r,se,o,mr,br,hr,xr,yr,Q,ht,St,Rt,Ot,Et,wt,fe,tr,Qt,I,ir,D,ve,B,pt,_,i,F,Z,ee,te,ut,re,qe,Ct]);return<InspectorContext_1.InspectorContext.Provider value={ms}>
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(a,i,l,d){d===void 0&&(d=l);var b=Object.getOwnPropertyDescriptor(i,l);(!b||("get"in b?!i.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return i[l]}}),Object.defineProperty(a,d,b)}):(function(a,i,l,d){d===void 0&&(d=l),a[d]=i[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(a,i){Object.defineProperty(a,"default",{enumerable:!0,value:i})}):function(a,i){a.default=i}),__importStar=this&&this.__importStar||(function(){var a=function(i){return a=Object.getOwnPropertyNames||function(l){var d=[];for(var b in l)Object.prototype.hasOwnProperty.call(l,b)&&(d[d.length]=b);return d},a(i)};return function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var d=a(i),b=0;b<d.length;b++)d[b]!=="default"&&__createBinding(l,i,d[b]);return __setModuleDefault(l,i),l}})(),__importDefault=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.registerComponentProfile=exports.getHermesMemoryStats=exports.measureAsync=exports.trackHeavyTask=exports.trackNavigationTransition=exports.trackComponentRender=exports.useNavigationProfiler=exports.useComponentProfiler=exports.usePerformanceTracker=exports.registerGAPlugin=exports.getEventCategory=exports.getLastActionForReducer=exports.clearActionHistory=exports.getActionHistory=exports.subscribeReduxState=exports.getReduxState=exports.inspectorReduxMiddleware=exports.connectReduxStore=exports.ErrorBoundary=exports.CrashTab=exports.computeCrashFingerprint=exports.recordUserActionBreadcrumb=exports.recordReduxBreadcrumb=exports.recordNetworkBreadcrumb=exports.recordNavigationBreadcrumb=exports.addCrashBreadcrumb=exports.recordCustomCrash=exports.parseCrashStackTrace=exports.exportCrashReport=exports.simulateTestCrash=exports.clearCrashRecords=exports.getCrashRecords=exports.emitCrashEvent=exports.subscribeCrashEvents=exports.setupGlobalCrashHandler=exports.getCollectionEnabled=exports.getDefaultEventParameters=exports.getCurrentUserId=exports.getCurrentUserProperties=exports.clearAnalyticsEvents=exports.subscribeAnalyticsEvents=exports.logAnalyticsEvent=exports.setupAnalyticsLogger=exports.subscribeConsoleLogs=exports.clearConsoleLogs=exports.setupConsoleLogger=exports.addAxiosInterceptors=exports.subscribeNetworkLogs=exports.clearNetworkLogs=exports.setupNetworkLogger=void 0,exports.connectMMKV=exports.connectAsyncStorage=exports.BrandCircleIcon=exports.BrandSquareIcon=exports.prunePerformanceEvents=exports.getMaxPerformanceEventsLimit=exports.setMaxPerformanceEventsLimit=exports.pruneCrashRecords=exports.getMaxCrashLogsLimit=exports.pruneAnalyticsLogs=exports.getMaxAnalyticsLogsLimit=exports.setMaxAnalyticsLogsLimit=exports.pruneReduxHistory=exports.getMaxReduxHistoryLimit=exports.setMaxReduxHistoryLimit=exports.pruneConsoleLogs=exports.getMaxConsoleLogsLimit=exports.setMaxConsoleLogsLimit=exports.pruneNetworkLogs=exports.getMaxNetworkLogsLimit=exports.setMaxNetworkLogsLimit=exports.subscribeMemoryWarning=exports.pruneAllLogs=exports.setupMemoryWarningHandler=exports.isNativeModuleAvailable=exports.setNativeStorageItem=exports.getNativeStorageItem=exports.getNativeFpsMetrics=exports.stopNativeFpsMonitoring=exports.startNativeFpsMonitoring=exports.subscribeNativeDeviceShake=exports.subscribeNativeFloatingButtonPress=exports.setNativeFloatingButtonBadge=exports.hideNativeFloatingButton=exports.showNativeFloatingButton=exports.subscribeNativeCrashes=exports.enableNativeCrashProtection=exports.getNativeDeviceMetrics=exports.InspectCatch=exports.InspectTrackTime=exports.InspectLog=exports.generateFixSnippet=exports.getInitialPerformanceEvents=exports.getInitialRenderProfiles=exports.getPerformanceEvents=exports.subscribePerformanceEvents=exports.clearPerformanceEvents=exports.logPerformanceEvent=exports.getRenderProfiles=exports.subscribeRenderProfiles=void 0,exports.LIB_VERSION=exports.ScreenRecorder=exports.ScreenCapture=exports.isFirebaseRemoteConfigAvailable=exports.fetchRemoteConfigModuleStatus=exports.I18nextProvider=exports.setTranslations=exports.addTranslations=exports.setLanguage=exports.useTranslation=exports.i18n=exports.t=exports.updateAppColorsTheme=exports.getThemeColors=exports.setAppColors=exports.AppColors=exports.setAppFonts=exports.AppFonts=exports.BreadcrumbType=exports.CrashFilterType=exports.CrashDetailSubTab=exports.CrashExportFormat=exports.CrashType=exports.PerformanceSubTab=exports.BundleSubTab=exports.DiffResultType=exports.StackFrameType=exports.GAEventCategory=exports.AnalyticsEventSource=exports.ConsoleLogType=exports.LogFilter=exports.SettingsSubTab=exports.SettingsPage=exports.ModalAnimationType=exports.LocalFilter=exports.SortOrder=exports.StatusFilter=exports.Method=exports.ActiveTab=exports.subscribeToStorageChanges=exports.clearStorageDriver=exports.removeStorageEntry=exports.setStorageEntry=exports.fetchStorageEntries=exports.getRegisteredMMKVInstanceIds=exports.isMMKVConnected=exports.isAsyncStorageConnected=void 0;const react_1=__importStar(require("react")),react_native_1=require("react-native"),native_1=require("@react-navigation/native"),i18n_1=require("./i18n"),ErrorBoundary_1=__importDefault(require("./components/ErrorBoundary")),MainScreen_1=__importDefault(require("./components/Inspector/MainScreen")),InspectorContext_1=require("./components/Inspector/InspectorContext"),helpers_1=require("./helpers"),settingsStore_1=require("./helpers/settingsStore"),NativeInspector_1=require("./native/NativeInspector"),networkLogger_1=require("./customHooks/networkLogger"),consoleLogger_1=require("./customHooks/consoleLogger"),logFilters_1=require("./customHooks/logFilters"),crashHandler_1=require("./customHooks/crashHandler"),telemetry_1=require("./helpers/telemetry"),analyticsLogger_1=require("./customHooks/analyticsLogger"),reduxLogger_1=require("./customHooks/reduxLogger"),performanceTracker_1=require("./customHooks/performanceTracker"),bundleAnalyzer_1=require("./customHooks/bundleAnalyzer"),NativeInspector_2=require("./native/NativeInspector"),remoteConfig_1=require("./helpers/remoteConfig"),capture_1=require("./capture"),constants_1=require("./constants"),styles_1=require("./styles"),NetworkInspector=({enabled:a=!0,storage:i,navigationRef:l,appIcon:d,environment:b,initialVisible:Vr=!1,visible:Se,remoteConfig:Ce})=>{(0,settingsStore_1.setCustomStorage)(i||null);const[ve,$e]=(0,react_1.useState)(!1),[ht,Pe]=(0,react_1.useState)(null),[St,Le]=(0,react_1.useState)({}),[Ae,Je]=(0,react_1.useState)(90),[Re,Xe]=(0,react_1.useState)("slide"),[y,j]=(0,react_1.useState)([]),[x,$]=(0,react_1.useState)(Se??Vr??!1),[Ct,Ke]=(0,react_1.useState)(!1),Gr=(0,react_1.useCallback)(()=>{Ke(!0),$(!1)},[]);(0,react_1.useEffect)(()=>{Se!==void 0&&$(Se)},[Se]);const[vt,Pt]=(0,react_1.useState)(!1),[g,Qe]=(0,react_1.useState)(null),[Oe,oe]=(0,react_1.useState)(new Set),[J,Lt]=(0,react_1.useState)(""),[Ee,Ur]=(0,react_1.useState)("all"),[we,zr]=(0,react_1.useState)(!1),[Ne,Wr]=(0,react_1.useState)(!1),[A,$r]=(0,react_1.useState)("all"),[At,Ye]=(0,react_1.useState)(""),[Rt,Jr]=(0,react_1.useState)(""),[Ot,Ze]=(0,react_1.useState)(null),[Et,et]=(0,react_1.useState)(null),[wt,Xr]=(0,react_1.useState)("state"),[Nt,Mt]=(0,react_1.useState)("response");(0,react_1.useEffect)(()=>(react_native_1.LogBox.ignoreAllLogs(a),()=>{react_native_1.LogBox.ignoreAllLogs(!1)}),[a]),(0,react_1.useEffect)(()=>{g&&(Mt("response"),Ye(""))},[g]);const[ae,tt]=(0,react_1.useState)(new Set),[ie,rt]=(0,react_1.useState)(new Set),[jt,st]=(0,react_1.useState)({}),[Tt,nt]=(0,react_1.useState)(new Set),[It,Kr]=(0,react_1.useState)(!0),[Me,Qr]=(0,react_1.useState)("newest"),[je,Yr]=(0,react_1.useState)("newest"),[_t,kt]=(0,react_1.useState)(!0),[Ft,Dt]=(0,react_1.useState)(!0),[Bt,qt]=(0,react_1.useState)(!1),[Ht,Vt]=(0,react_1.useState)(!1),[p,H]=(0,react_1.useState)("apis"),[Te,V]=(0,react_1.useState)([]),[G,U]=(0,react_1.useState)([]),[Gt,ot]=(0,react_1.useState)(null),[X,Zr]=(0,react_1.useState)(!1),Ut=(0,react_1.useRef)(X);Ut.current=X;const ue=(0,react_1.useRef)([]),[K,es]=(0,react_1.useState)(!1),zt=(0,react_1.useRef)(K);zt.current=K;const ce=(0,react_1.useRef)([]),[Q,ts]=(0,react_1.useState)(!1),Wt=(0,react_1.useRef)(Q);Wt.current=Q;const le=(0,react_1.useRef)([]),[$t,Jt]=(0,react_1.useState)(0),[Xt,Kt]=(0,react_1.useState)(0),[Qt,Yt]=(0,react_1.useState)(0),[Zt,er]=(0,react_1.useState)(0),Ie=(0,react_1.useCallback)(async()=>{try{const t=await capture_1.ScreenCapture.getMediaList(),e=t?t.length:0;return er(e),e}catch{return er(0),0}},[]);(0,react_1.useEffect)(()=>{x&&Ie()},[x,Ie]);const[fe,T]=(0,react_1.useState)(()=>(0,crashHandler_1.getCrashRecords)()),[tr,Y]=(0,react_1.useState)(null),[I,_e]=(0,react_1.useState)(50);(0,react_1.useEffect)(()=>{(0,crashHandler_1.setMaxCrashLogsLimit)(I)},[I]),(0,react_1.useEffect)(()=>{x&&(p==="apis"&&Kt(y.length),p==="logs"&&Jt(G.length),p==="crash"&&Yt(fe.length))},[x]),(0,react_1.useEffect)(()=>{p==="apis"&&Kt(y.length)},[p,y.length]),(0,react_1.useEffect)(()=>{p==="logs"&&Jt(G.length)},[p,G.length]),(0,react_1.useEffect)(()=>{p==="crash"&&Yt(fe.length)},[p,fe.length]);const[Z,ke]=(0,react_1.useState)(100),[_,at]=(0,react_1.useState)({info:!0,warn:!0,error:!0}),k=(0,react_1.useMemo)(()=>G.filter(e=>{const s=e.type;if(s==="info"&&!_?.info||s==="warn"&&!_?.warn||s==="error"&&!_?.error)return!1;const r=e.message||"";return![...logFilters_1.IGNORED_LOG_PREFIXES&&logFilters_1.IGNORED_LOG_PREFIXES.info||[],...logFilters_1.IGNORED_LOG_PREFIXES&&logFilters_1.IGNORED_LOG_PREFIXES.warn||[],...logFilters_1.IGNORED_LOG_PREFIXES&&logFilters_1.IGNORED_LOG_PREFIXES.error||[]].filter(f=>typeof f=="string"&&f.trim().length>0).some(f=>r.toLowerCase().trim().startsWith(f.toLowerCase().trim())||r.toLowerCase().trim().includes(f.toLowerCase().trim()))}).slice(0,Z),[G,_,Z]),[R,rr]=(0,react_1.useState)(""),[O,sr]=(0,react_1.useState)(new Set(["all"])),[nr,rs]=(0,react_1.useState)(null),[or,ss]=(0,react_1.useState)(!1),[ar,ns]=(0,react_1.useState)("module"),[h,Fe]=(0,react_1.useState)({apis:!0,logs:!0,analytics:!1,redux:!1,bundle:!1,performance:!1,crash:!1,device:!1,storage:!1,debugging:!1,media:!0}),[F,De]=(0,react_1.useState)(250),[ee,Be]=(0,react_1.useState)(150),[te,it]=(0,react_1.useState)(!0),[ut,os]=(0,react_1.useState)(1800),[re,ct]=(0,react_1.useState)(!0),[qe,lt]=(0,react_1.useState)(1),[D,He]=(0,react_1.useState)("apis"),[B,ft]=(0,react_1.useState)(!1),[pt,dt]=(0,react_1.useState)(!0);(0,react_1.useEffect)(()=>{(0,networkLogger_1.setNetworkModuleEnabled)(!!h.apis),(0,consoleLogger_1.setConsoleModuleEnabled)(!!h.logs),(0,analyticsLogger_1.setAnalyticsModuleEnabled)(!!h.analytics),(0,reduxLogger_1.setReduxModuleEnabled)(!!h.redux),(0,performanceTracker_1.setPerformanceModuleEnabled)(!!h.performance),(0,crashHandler_1.setCrashModuleEnabled)(!!h.crash),(0,bundleAnalyzer_1.setBundleModuleEnabled)(!!h.bundle)},[h]),(0,react_1.useEffect)(()=>{(0,NativeInspector_1.getNativeSystemMetrics)().then(t=>{if(t){const e=t.totalPhysicalRamMb-t.residentRamMb,s=Math.max(200,Math.round(e>0?e:1500));if(os(s),te){const r=(0,settingsStore_1.calculateRamBasedLimits)(s);De(r.maxNetworkLogs),ke(r.maxConsoleLogs),Be(r.maxAnalyticsEvents),_e(r.maxCrashRecords)}}}).catch(()=>{})},[te]);const as=async()=>{await(0,settingsStore_1.clearPersistedSettings)(),$e(!1),(0,styles_1.toggleGlobalTheme)(!1),Je(90),Xe("slide"),Fe({apis:!0,logs:!0,analytics:!1,redux:!1,bundle:!1,performance:!1,crash:!1,device:!1,storage:!1,debugging:!1,media:!0}),He("apis"),it(!0);const t=(0,settingsStore_1.calculateRamBasedLimits)(ut);_e(t.maxCrashRecords),De(t.maxNetworkLogs),ke(t.maxConsoleLogs),Be(t.maxAnalyticsEvents),at({info:!0,warn:!0,error:!0}),ct(!0),lt(1),ft(!1),dt(!0),react_native_1.Alert.alert("Settings Reset","All settings have been reset to default values.")},ir=(0,react_1.useRef)(!1);(0,react_1.useEffect)(()=>{let t=!1;return(0,settingsStore_1.loadSettings)().then(e=>{if(!t){if(e.isDark!=null&&($e(e.isDark),(0,styles_1.toggleGlobalTheme)(e.isDark)),e.modalHeightPercent!=null&&Je(e.modalHeightPercent),e.modalAnimationType&&Xe(e.modalAnimationType),e.tabVisibility&&Fe(s=>({...s,...e.tabVisibility,apis:!0})),e.defaultTab&&He(e.defaultTab),e.isAutoRamLimitEnabled!=null&&it(e.isAutoRamLimitEnabled),e.maxNetworkLogs!=null&&De(e.maxNetworkLogs),e.maxConsoleLogs!=null&&ke(e.maxConsoleLogs),e.maxAnalyticsEventsLimit!=null&&Be(e.maxAnalyticsEventsLimit),e.maxCrashLogs!=null&&_e(e.maxCrashLogs),e.showConsoleLevels&&at(e.showConsoleLevels),e.reduxAutoRefresh!=null&&ct(e.reduxAutoRefresh),e.reduxExpandDepth!=null&&lt(e.reduxExpandDepth),e.showDuplicateLogs!=null&&ft(e.showDuplicateLogs),e.showUpdateToast!=null&&dt(e.showUpdateToast),e.defaultTab){const s=e.defaultTab,r={apis:!0,logs:!0,analytics:!1,redux:!1,bundle:!1,performance:!1,crash:!1,device:!1,storage:!1,...e.tabVisibility||{},apis:!0};H(r[s]?s:"apis")}ir.current=!0}}),()=>{t=!0}},[]),(0,react_1.useEffect)(()=>{let t=!0;if(Ce!==!1)return(0,remoteConfig_1.fetchRemoteConfigModuleStatus)(typeof Ce=="object"?Ce:void 0).then(e=>{t&&e&&Fe(s=>({...s,...e,apis:e.apis??!0}))}).catch(()=>{}),()=>{t=!1}},[Ce]),(0,react_1.useEffect)(()=>{ir.current&&(0,settingsStore_1.saveSettings)({isDark:ve,modalHeightPercent:Ae,modalAnimationType:Re,tabVisibility:h,defaultTab:D,maxNetworkLogs:F,maxConsoleLogs:Z,maxAnalyticsEventsLimit:ee,maxCrashLogs:I,isAutoRamLimitEnabled:te,showConsoleLevels:_,reduxAutoRefresh:re,reduxExpandDepth:qe,showDuplicateLogs:B,showUpdateToast:pt})},[ve,Ae,Re,h,D,F,Z,ee,I,te,_,re,qe,B]);const[pe,is]=(0,react_1.useState)(null),ur=(0,react_1.useMemo)(()=>{if(!pe)return!1;const t=r=>r.replace(/^v/,"").split(".").map(n=>parseInt(n,10)||0),e=t(constants_1.LIB_VERSION),s=t(pe);for(let r=0;r<3;r++){if((s[r]||0)>(e[r]||0))return!0;if((s[r]||0)<(e[r]||0))return!1}return!1},[pe]);(0,react_1.useEffect)(()=>{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"&&is(e.version)}).catch(()=>{}),()=>{t=!0}},[]),(0,react_1.useEffect)(()=>{(0,reduxLogger_1.setReduxAutoRefresh)(re)},[re]),(0,react_1.useEffect)(()=>{p==="redux"&&!(0,reduxLogger_1.isReduxConnected)()&&H("apis"),p==="analytics"&&!(0,analyticsLogger_1.isAnalyticsConnected)()&&H("apis")},[p]);const cr=t=>{t!=="apis"&&(t==="redux"&&!(0,reduxLogger_1.isReduxConnected)()||t==="analytics"&&!(0,analyticsLogger_1.isAnalyticsConnected)()||Fe(e=>{const s=!e[t],r={...e,[t]:s};return!s&&p===t&&((0,InspectorContext_1.animateNextLayout)(),H("apis")),!s&&D===t&&He("apis"),r}))},gt=(0,react_1.useCallback)(async(t,e="")=>{if(t==="apis"||t==="logs"||t==="analytics"||t==="crash"){const s=await(0,NativeInspector_1.fetchNativeCachedPage)(t,0,100,e);s&&s.items&&s.items.length>0&&(t==="apis"?j(s.items):t==="logs"?U(s.items):t==="analytics"?V(s.items):t==="crash"&&T(s.items))}},[]),lr=(0,react_1.useCallback)(t=>{t==="redux"&&!(0,reduxLogger_1.isReduxConnected)()||t==="analytics"&&!(0,analyticsLogger_1.isAnalyticsConnected)()||(Qe(null),Ve(null),ot(null),Ze(null),et(null),Y(null),typeof react_1.default.startTransition=="function"?react_1.default.startTransition(()=>{H(t),gt(t)}):(H(t),gt(t)),(0,telemetry_1.trackInspectorTabView)(t))},[gt]),[fr,Ve]=(0,react_1.useState)(null),[se,pr]=(0,react_1.useState)(""),[o,dr]=(0,react_1.useState)({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"}),gr=(0,react_1.useMemo)(()=>!!(o.categories.size>0&&!o.categories.has("all")||o.screens.size>0||o.sources.size>0&&!o.sources.has("all")||o.userTypes.size>0&&!o.userTypes.has("all")||o.timeWindow!=="all"||o.payloadComplexity!=="all"||o.hasRevenue||o.hasItems||o.hasUserProps||o.hasParams||o.onlyDuplicates||o.onlyConversions||o.sortBy!=="time_desc"),[o]),mr=(0,react_1.useCallback)(()=>{dr({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"})},[]),[br,us]=(0,react_1.useState)(!1),[xr,cs]=(0,react_1.useState)(!1),[yr,hr]=(0,react_1.useState)(new Set),de=(0,react_1.useRef)(new Set),[mt,bt]=(0,react_1.useState)(null),Sr=react_1.default.useContext(native_1.NavigationContext)!==void 0,z=(0,react_1.useRef)({path:"",params:null});(0,react_1.useEffect)(()=>((0,networkLogger_1.setRouteInfoProvider)(()=>z.current),()=>{(0,networkLogger_1.setRouteInfoProvider)(null)}),[]),(0,react_1.useEffect)(()=>{if(mt){const t=(0,helpers_1.getNavigationInfo)(mt);t?.path&&(z.current=t)}},[mt]),(0,react_1.useEffect)(()=>{if(!l)return;const t=()=>{try{if(typeof l.isReady=="function"&&l.isReady()){const s=typeof l.getCurrentRoute=="function"?l.getCurrentRoute():null;s?.name&&(z.current={path:s.name,params:s.params||null});const r=l.getRootState();if(r){bt(r);const n=(0,helpers_1.getNavigationInfo)(r);n?.path&&(z.current=n)}}}catch{}};t();const e=typeof l.addListener=="function"?l.addListener("state",()=>{t()}):null;return()=>{e&&e()}},[l]);const P=(0,react_1.useRef)(new Map),ne=(0,react_1.useRef)(new Set),[Cr,vr]=(0,react_1.useState)(new Set),ge=(0,react_1.useRef)(new react_native_1.Animated.Value(1)).current,me=(0,react_1.useRef)(new react_native_1.Animated.Value(.4)).current,be=(0,react_1.useRef)(new react_native_1.Animated.Value(1)).current,xe=(0,react_1.useRef)(new react_native_1.Animated.Value(0)).current,ye=(0,react_1.useRef)(new react_native_1.Animated.Value(0)).current,S=(0,react_1.useRef)(new react_native_1.Animated.ValueXY({x:0,y:0})).current,Ge=(0,react_1.useRef)({x:0,y:0});(0,react_1.useEffect)(()=>{const t=S.x.addListener(s=>Ge.current.x=s.value),e=S.y.addListener(s=>Ge.current.y=s.value);return()=>{S.x.removeListener(t),S.y.removeListener(e)}},[S]);const Ue=(0,react_1.useRef)(!1),Pr=(0,react_1.useRef)(react_native_1.PanResponder.create({onStartShouldSetPanResponder:()=>!1,onMoveShouldSetPanResponder:(t,e)=>Math.abs(e.dx)>4||Math.abs(e.dy)>4,onPanResponderGrant:()=>{Ue.current=!0,S.setOffset({x:Ge.current.x,y:Ge.current.y}),S.setValue({x:0,y:0})},onPanResponderMove:react_native_1.Animated.event([null,{dx:S.x,dy:S.y}],{useNativeDriver:!1}),onPanResponderRelease:()=>{S.flattenOffset(),setTimeout(()=>{Ue.current=!1},50)},onPanResponderTerminate:()=>{S.flattenOffset(),Ue.current=!1}})).current,Lr=(0,react_1.useCallback)(()=>{react_native_1.Animated.sequence([react_native_1.Animated.timing(ye,{toValue:1,duration:320,useNativeDriver:!1}),react_native_1.Animated.timing(ye,{toValue:0,duration:0,useNativeDriver:!1})]).start(),fs()},[ye]);(0,react_1.useEffect)(()=>{react_native_1.Platform.OS==="android"&&react_native_1.UIManager.setLayoutAnimationEnabledExperimental?.(!0)},[]),(0,react_1.useEffect)(()=>{if(x)return;const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(ge,{toValue:1.2,duration:800,useNativeDriver:!1}),react_native_1.Animated.timing(ge,{toValue:1,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[ge,x]),(0,react_1.useEffect)(()=>{if(x)return;const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(xe,{toValue:1,duration:3200,easing:react_native_1.Easing.inOut(react_native_1.Easing.ease),useNativeDriver:!1}),react_native_1.Animated.delay(3500),react_native_1.Animated.timing(xe,{toValue:0,duration:0,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[xe,x]),(0,react_1.useEffect)(()=>{const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(me,{toValue:1,duration:1200,useNativeDriver:!1}),react_native_1.Animated.timing(me,{toValue:.4,duration:1200,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[me]),(0,react_1.useEffect)(()=>{const t=react_native_1.Animated.loop(react_native_1.Animated.sequence([react_native_1.Animated.timing(be,{toValue:1.3,duration:800,useNativeDriver:!1}),react_native_1.Animated.timing(be,{toValue:.8,duration:800,useNativeDriver:!1})]));return t.start(),()=>t.stop()},[be]);const ls=(0,react_1.useMemo)(()=>(0,NativeInspector_2.isNativeModuleAvailable)(),[]),q=(react_native_1.Platform.OS==="ios"||react_native_1.Platform.OS==="android")&&ls;(0,react_1.useEffect)(()=>{q&&(0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{})},[q,x]),(0,react_1.useEffect)(()=>{if(!q)return;const t=(0,NativeInspector_2.subscribeNativeFloatingButtonPress)(()=>{(0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{}),$(!0)});return()=>{t()}},[q]),(0,react_1.useEffect)(()=>{if(!q)return;const t=(0,NativeInspector_2.subscribeNativeDeviceShake)(()=>{$(e=>{const s=!e;return s&&(0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{}),s})});return()=>{t()}},[q]);const Ar=(0,react_1.useRef)(x);(0,react_1.useEffect)(()=>{if(Ar.current=x,x){(0,telemetry_1.trackInspectorScreenView)("InspectorModal");const t=D==="apis"||h?.[D]?D:"apis";if(H(t),(0,telemetry_1.trackInspectorTabView)(t),ue.current.length>0){const n=(0,helpers_1.deduplicateLogs)(ue.current),u=new Set(n.map(f=>f.id));ne.current=u,j(n)}ce.current.length>0&&U(ce.current),le.current.length>0&&V(le.current);const e=(0,reduxLogger_1.getReduxState)();e&&(Pe(typeof e=="object"?{...e}:e),Le({...(0,reduxLogger_1.getLastActionForReducer)()}));const s=(0,crashHandler_1.getCrashRecords)();s.length>0&&T(s);const r=requestAnimationFrame(()=>{Pt(!0)});return()=>{cancelAnimationFrame(r)}}else Pt(!1),oe(new Set)},[x]),(0,react_1.useEffect)(()=>{(0,networkLogger_1.setupNetworkLogger)(),(0,networkLogger_1.clearNetworkLogs)(),(0,consoleLogger_1.setupConsoleLogger)(),(0,analyticsLogger_1.autoSetupAnalyticsLogger)(),(0,crashHandler_1.setupGlobalCrashHandler)();const t=(0,helpers_1.setupMemoryWarningHandler)(),e=Ar,s=(0,crashHandler_1.subscribeCrashEvents)(c=>{if(c.message==="__CLEARED__"){T([]),Y(null);return}const W=(0,crashHandler_1.getCrashRecords)();W.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("crash",JSON.stringify(W[0])),e.current&&T(W)}),r=(0,crashHandler_1.getCrashRecords)();r.length>0&&(r.forEach(c=>(0,NativeInspector_1.pushNativeLogRecord)("crash",JSON.stringify(c))),T(r));let n,u=!0;const f=(0,networkLogger_1.subscribeNetworkLogs)(c=>{if(ue.current=c,c.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("apis",JSON.stringify(c[0])),Ut.current||!e.current)return;clearTimeout(n);const W=()=>{const v=(0,helpers_1.deduplicateLogs)(c),L=new Set(v.map(w=>w.id)),m=new Set;L.forEach(w=>{ne.current.has(w)||m.add(w)}),ne.current=L,m.size>0&&(m.forEach(w=>{if(!P.current.has(w)){const ms=v.find(bs=>bs.id===w)?.routeInfo||z.current;P.current.set(w,ms)}}),vr(m),setTimeout(()=>vr(new Set),1200)),j(v)};if(u){u=!1;const v=(0,helpers_1.deduplicateLogs)(c),L=new Set(v.map(m=>m.id));ne.current=L,v.forEach(m=>{if(!P.current.has(m.id)){const w=m?.routeInfo||z.current;P.current.set(m.id,w)}}),j(v)}else n=setTimeout(W,250)});let C,he=!0;const xt=(0,analyticsLogger_1.subscribeAnalyticsEvents)(c=>{if(le.current=c,c.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("analytics",JSON.stringify(c[0])),Wt.current||!e.current)return;clearTimeout(C);const W=()=>{const v=new Set(c.map(m=>m.id)),L=new Set;v.forEach(m=>{de.current.has(m)||L.add(m)}),de.current=v,L.size>0&&(L.forEach(m=>{P.current.has(m+1e6)||P.current.set(m+1e6,z.current)}),hr(L),setTimeout(()=>hr(new Set),1200)),V(c)};if(he){he=!1;const v=new Set(c.map(L=>L.id));de.current=v,V(c)}else C=setTimeout(W,200)});let E,M=!0;const yt=(0,consoleLogger_1.subscribeConsoleLogs)(c=>{ce.current=c,c.length>0&&(0,NativeInspector_1.pushNativeLogRecord)("logs",JSON.stringify(c[0])),!zt.current&&e.current&&(clearTimeout(E),M?(M=!1,U(c)):E=setTimeout(()=>{U(c)},200))}),We=(0,reduxLogger_1.getReduxState)();We&&(Pe(typeof We=="object"?{...We}:We),Le({...(0,reduxLogger_1.getLastActionForReducer)()}));const gs=(0,reduxLogger_1.subscribeReduxState)(()=>{if(!e.current)return;const c=(0,reduxLogger_1.getReduxState)();Pe(c&&typeof c=="object"?{...c}:c),Le({...(0,reduxLogger_1.getLastActionForReducer)()})});return()=>{f(),clearTimeout(n),xt(),clearTimeout(C),yt(),clearTimeout(E),gs(),s(),t()}},[]),(0,react_1.useEffect)(()=>{(0,networkLogger_1.setMaxNetworkLogsLimit)(F)},[F]),(0,react_1.useEffect)(()=>{(0,crashHandler_1.setMaxCrashLogsLimit)(I)},[I]),(0,react_1.useEffect)(()=>{if(!X&&ue.current.length>0){const t=(0,helpers_1.deduplicateLogs)(ue.current);j(t)}},[X]),(0,react_1.useEffect)(()=>{!Q&&le.current.length>0&&V(le.current)},[Q]),(0,react_1.useEffect)(()=>{!K&&ce.current.length>0&&U(ce.current)},[K]),(0,react_1.useEffect)(()=>{kt(!0),Dt(!0),qt(!1),Vt(!1),Ye("")},[g]);const N=(0,react_1.useMemo)(()=>{let t=y.filter(e=>{if(A&&A!=="all"){if(A==="errors"){if(!(e.status===0||e.status==null||typeof e.status=="number"&&e.status>=400))return!1}else if(A==="success"){if(!(typeof e.status=="number"&&e.status>=200&&e.status<400))return!1}else if(A==="slow"){if((e.duration||0)<500)return!1}else if(A==="graphql"){if(!((e.url||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("graphql")||(e.client||"").toLowerCase().includes("apollo")))return!1}else if(e.method?.toUpperCase()!==A.toUpperCase())return!1}if(ae.size>0&&![...ae].some(r=>{if(r==="ALL")return!0;if(r==="Failed")return e.status===0||e.status==null;const n=parseInt(r,10);return isNaN(n)?String(e.status)[0]===r[0]:Number(e.status)===n})||ie.size>0&&![...ie].some(r=>r==="ALL"?!0:e.method?.toUpperCase()===r))return!1;if(J&&J.trim().length>0){const s=P.current.get(e.id)?.path||"";if(!(0,helpers_1.matchNetworkLogQuery)(e,J,s,{scope:Ee,isRegex:we,isCaseSensitive:Ne}))return!1}return!0});if(Me==="oldest"&&(t=[...t].reverse()),!B){const e=[];for(const s of t){const r=e[e.length-1];r&&r.method===s.method&&r.url===s.url&&r.status===s.status?e[e.length-1]={...r,duplicateCount:(r.duplicateCount||1)+1}:e.push({...s,duplicateCount:1})}t=e}return t.slice(0,F)},[y,J,Ee,we,Ne,A,ae,ie,Me,F,B]),Rr=(0,react_1.useMemo)(()=>{const t=new Set;return y.forEach(e=>{e.method&&t.add(e.method.toUpperCase())}),["ALL",...Array.from(t)]},[y]),Or=(0,react_1.useCallback)((t,e)=>{st(s=>{const r=s[t]||new Set(["success","failed","loading"]),n=new Set(r);return n.has(e)?n.delete(e):n.add(e),{...s,[t]:n}})},[]),Er=(0,react_1.useCallback)(t=>{nt(e=>{const s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},[]),wr=(0,react_1.useMemo)(()=>{const t=[],e=new Map;for(let r=0;r<N.length;r++){const n=N[r],u=P.current.get(n.id)||n?.routeInfo,f=(0,helpers_1.getLogPageName)(n,u);let C=e.get(f);C||(C={pageName:f,color:(0,helpers_1.getDomainColor)(f),logs:[]},e.set(f,C)),C.logs.push(n)}let s=0;return e.forEach(r=>{let n=0,u=0,f=0;r.logs.forEach(E=>{E.status==null?f++:E.status===0||E.status>=400?u++:n++});const C=jt[r.pageName]||new Set(["success","failed","loading"]),he=Tt.has(r.pageName),xt=r.logs[0]?.startTime||0;if(t.push({type:"header",id:`hdr-${r.pageName}`,pageName:r.pageName,color:r.color,stats:{success:n,failed:u,loading:f},timestamp:xt,activeFilters:C,isCollapsed:he,isFirst:s===0}),s++,!he){const E=r.logs.filter(M=>M.status==null?C.has("loading"):M.status===0||M.status>=400?C.has("failed"):C.has("success"));E.forEach((M,yt)=>{t.push({type:"log",id:`log-${M.id}`,log:M,isLast:yt===E.length-1,color:r.color})})}}),t},[N,y,jt,Tt]),{minStart:Nr,totalRange:Mr}=(0,react_1.useMemo)(()=>{if(N.length===0)return{minStart:0,totalRange:0};const t=Math.min(...N.map(s=>s.startTime)),e=Math.max(...N.map(s=>s.startTime+(s.duration||10)));return{minStart:t,totalRange:e-t}},[N]),ze=(0,react_1.useMemo)(()=>{if(!g)return null;const t=y.findIndex(e=>e.id===g.id);if(t===-1)return null;for(let e=t+1;e<y.length;e++){const s=y[e];if(s.url===g.url&&s.method===g.method)return s}return null},[g,y]),jr=ze?ze.request:null,Tr=ze?ze.response:null,Ir=(0,react_1.useMemo)(()=>{let t=Te;if(se&&se.trim().length>0){const r=se.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 r.every(f=>u.includes(f))})}if(o.categories.size>0&&!o.categories.has("all")&&(t=t.filter(r=>{const n=(0,helpers_1.getEventCategory)(r.name);return o.categories.has(n)})),o.timeWindow!=="all"){const r=Date.now(),n=o.timeWindow==="1m"?r-60*1e3:o.timeWindow==="5m"?r-300*1e3:o.timeWindow==="15m"?r-900*1e3:r-3600*1e3;t=t.filter(u=>u.timestamp>=n)}if(o.sources.size>0&&!o.sources.has("all")&&(t=t.filter(r=>o.sources.has(r.source||"manual"))),o.userTypes.size>0&&!o.userTypes.has("all")&&(t=t.filter(r=>{const n=!!(r.userId&&r.userId.trim()!=="");return!!(o.userTypes.has("identified")&&n||o.userTypes.has("anonymous")&&!n)})),o.payloadComplexity!=="all"&&(o.payloadComplexity==="none"?t=t.filter(r=>!r.params||Object.keys(r.params).length===0):o.payloadComplexity==="simple"?t=t.filter(r=>r.params&&Object.keys(r.params).length<=3):o.payloadComplexity==="heavy"&&(t=t.filter(r=>r.params&&Object.keys(r.params).length>3))),o.onlyConversions){const r=["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=>r.some(u=>n.name.toLowerCase().includes(u)))}o.screens.size>0&&(t=t.filter(r=>{const n=r.screenName||r.params?.firebase_screen||r.params?.screen_name||r.params?.firebase_screen_class||r.screenClass||"";return o.screens.has(n)})),o.hasRevenue&&(t=t.filter(r=>r.params?.value!=null&&!isNaN(Number(r.params.value))||r.params?.price!=null&&!isNaN(Number(r.params.price)))),o.hasItems&&(t=t.filter(r=>Array.isArray(r.params?.items)&&r.params.items.length>0)),o.hasUserProps&&(t=t.filter(r=>r.userProperties&&Object.keys(r.userProperties).length>0)),o.hasParams&&(t=t.filter(r=>r.params&&Object.keys(r.params).length>0));const e=[];for(const r of t){if(e.length===0){e.push({...r,count:1});continue}const n=e[e.length-1];n.name===r.name&&JSON.stringify(n.params)===JSON.stringify(r.params)&&JSON.stringify(n.userProperties)===JSON.stringify(r.userProperties)?(n.count=(n.count||1)+1,n.timestamp=r.timestamp,n.id=r.id):e.push({...r,count:1})}let s=e;return o.onlyDuplicates&&(s=s.filter(r=>(r.count||1)>1)),o.sortBy==="time_asc"?s=[...s].sort((r,n)=>r.timestamp-n.timestamp):o.sortBy==="revenue_desc"?s=[...s].sort((r,n)=>{const u=Number(r.params?.value??r.params?.price??0);return Number(n.params?.value??n.params?.price??0)-u}):o.sortBy==="count_desc"&&(s=[...s].sort((r,n)=>(n.count||1)-(r.count||1))),s.slice(0,ee)},[Te,se,o,ee]),_r=(0,react_1.useMemo)(()=>{let t=k;if(O.size>0&&!O.has("all")&&(t=t.filter(e=>!!(O.has("user-log")&&e.sourceMethod==="log"||O.has("info")&&(e.sourceMethod==="info"||e.type==="info"&&e.sourceMethod!=="log")||O.has("warn")&&(e.type==="warn"||e.sourceMethod==="warn")||O.has("error")&&(e.type==="error"||e.sourceMethod==="error")||O.has("analytics")&&e.message?.toLowerCase().includes("[analytics error]")))),R&&R.trim().length>0){const e=R.trim().toLowerCase().split(/\s+/).filter(Boolean);t=t.filter(s=>{const r=[s.message||"",s.caller||"",s.type||"",s.sourceMethod||"",s.stack||""].join(" ").toLowerCase();return e.every(n=>n==="error"||n==="err"?s.type==="error"||r.includes(n):n==="warn"||n==="warning"?s.type==="warn"||r.includes(n):n==="info"&&s.type==="info"||r.includes(n))})}if(t=[...t].sort((e,s)=>je==="newest"?s.timestamp-e.timestamp:e.timestamp-s.timestamp),!B){const e=[];for(const s of t){const r=e[e.length-1];r&&r.type===s.type&&r.sourceMethod===s.sourceMethod&&r.message===s.message?e[e.length-1]={...r,duplicateCount:(r.duplicateCount||1)+1}:e.push({...s,duplicateCount:1})}t=e}return t},[k,O,R,je,B]),kr=(0,react_1.useMemo)(()=>{let t=k;if(R&&R.trim().length>0){const s=R.trim().toLowerCase().split(/\s+/).filter(Boolean);t=k.filter(r=>{const n=[r.message||"",r.caller||"",r.type||"",r.sourceMethod||"",r.stack||""].join(" ").toLowerCase();return s.every(u=>u==="error"||u==="err"?r.type==="error"||n.includes(u):u==="warn"||u==="warning"?r.type==="warn"||n.includes(u):u==="info"&&r.type==="info"||n.includes(u))})}const e=k.length;return{all:`${t.length}/${e}`,info:`${t.filter(s=>s.sourceMethod==="info"||s.type==="info"&&s.sourceMethod!=="log").length}/${e}`,warn:`${t.filter(s=>s.type==="warn"||s.sourceMethod==="warn").length}/${e}`,error:`${t.filter(s=>s.type==="error"||s.sourceMethod==="error").length}/${e}`,"user-log":`${t.filter(s=>s.sourceMethod==="log").length}/${e}`,analytics:`${t.filter(s=>s.message.toLowerCase().includes("[analytics error]")).length}/${e}`}},[k,R]),Fr=(0,react_1.useCallback)(()=>{$(!1),Ke(!1),setTimeout(()=>{Qe(null),Ve(null),ot(null),Ze(null),et(null),Y(null)},300)},[]);function fs(){(0,networkLogger_1.clearNetworkLogs)(),j([]),oe(new Set),st({}),nt(new Set),tt(new Set),rt(new Set),Lt(""),ne.current=new Set,P.current=new Map,(0,analyticsLogger_1.clearAnalyticsEvents)(),V([]),pr(""),de.current=new Set,(0,consoleLogger_1.clearConsoleLogs)(),U([]),sr(new Set(["all"])),rr("")}function Dr(){if(p==="logs"){react_native_1.Alert.alert("Clear Logs","Are you sure you want to clear all console logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,consoleLogger_1.clearConsoleLogs)(),U([])},style:"destructive"}]);return}if(p==="analytics"){react_native_1.Alert.alert("Clear Analytics","Are you sure you want to clear all analytics events?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,analyticsLogger_1.clearAnalyticsEvents)(),V([]),Ve(null),de.current=new Set},style:"destructive"}]);return}if(p==="redux"){react_native_1.Alert.alert("Clear Redux Timeline","Are you sure you want to clear the dispatched action history?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,reduxLogger_1.clearActionHistory)(),Le({})},style:"destructive"}]);return}if(p==="crash"){react_native_1.Alert.alert("Clear Crash History","Are you sure you want to clear all intercepted crash records?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:()=>{(0,crashHandler_1.clearCrashRecords)(),T([]),Y(null)},style:"destructive"}]);return}Oe.size>0?(j(t=>t.filter(e=>!Oe.has(e.id))),oe(new Set)):react_native_1.Alert.alert("Clear Logs","Are you sure you want to clear all network logs?",[{text:"Cancel",style:"cancel"},{text:"Clear All",onPress:ps,style:"destructive"}])}function ps(){(0,networkLogger_1.clearNetworkLogs)(),j([]),oe(new Set),st({}),nt(new Set),tt(new Set),rt(new Set),ne.current=new Set,P.current=new Map}const Br=(0,react_1.useMemo)(()=>{if(!g)return"";try{const e=new URL(g.url).pathname.split("/").filter(Boolean);return e.length>0?`/${e.slice(-2).join("/")}`:"/"}catch{const t=g.url.split("/").filter(Boolean);return t.length>0?`/${t.slice(-2).join("/")}`:g.url}},[g]),qr=(0,react_1.useMemo)(()=>g?(0,helpers_1.formatDisplayUrl)(g.url):"",[g]),Hr=(0,react_1.useCallback)(t=>{oe(e=>{const s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},[]),ds=(0,react_1.useMemo)(()=>({visible:x,setVisible:$,closeModal:Fr,isMinimized:Ct,setIsMinimized:Ke,minimizeInspector:Gr,isReady:vt,enabled:a,isEnabled:a,appIcon:d,environment:b,modalHeightPercent:Ae,setModalHeightPercent:Je,modalAnimationType:Re,setModalAnimationType:Xe,hasNavigationContext:Sr,setNavState:bt,activeTab:p,switchActiveTab:lr,tabVisibility:h,toggleTabVisibility:cr,lastReadApisCount:Xt,lastReadLogsCount:$t,mediaCount:Zt,refreshMediaCount:Ie,selected:g,setSelected:Qe,selectedEvent:fr,setSelectedEvent:Ve,selectedLog:Gt,setSelectedLog:ot,showHeaderInfo:It,setShowHeaderInfo:Kr,settingsPage:nr,setSettingsPage:rs,isAboutOpen:or,setIsAboutOpen:ss,updateAvailable:ur,latestNpmVersion:pe,clearAnim:ye,activePulseAnim:me,unreadPulseAnim:be,runClearAllWithAnimation:Lr,useNativeFab:q,fabPan:S,fabPanResponder:Pr,fabDraggedRef:Ue,pulseAnim:ge,fabShineAnim:xe,logs:y,filteredLogs:N,groupedData:wr,search:J,setSearch:Lt,searchScope:Ee,setSearchScope:Ur,isRegexSearch:we,setIsRegexSearch:zr,isCaseSensitive:Ne,setIsCaseSensitive:Wr,quickFilter:A,setQuickFilter:$r,statusFilters:ae,setStatusFilters:tt,methodFilters:ie,setMethodFilters:rt,availableMethods:Rr,sortOrder:Me,setSortOrder:Qr,selectedLogs:Oe,toggleSelect:Hr,minStart:Nr,totalRange:Mr,newLogIds:Cr,toggleSectionFilter:Or,toggleSectionCollapse:Er,handleDelete:Dr,isNetworkPaused:X,setIsNetworkPaused:Zr,detailTitle:Br,detailDisplayUrl:qr,apiDetailActiveTab:Nt,setApiDetailActiveTab:Mt,detailSearch:At,setDetailSearch:Ye,reqExpanded:_t,setReqExpanded:kt,resExpanded:Ft,setResExpanded:Dt,showReqDiff:Bt,setShowReqDiff:qt,showResDiff:Ht,setShowResDiff:Vt,prevRequestData:jr,prevResponseData:Tr,logRouteMapRef:P,consoleLogs:G,visibleConsoleLogs:k,filteredConsoleLogs:_r,logSearch:R,setLogSearch:rr,logFilters:O,setLogFilters:sr,logCounts:kr,logSortOrder:je,setLogSortOrder:Yr,isConsolePaused:K,setIsConsolePaused:es,analyticsEvents:Te,filteredAnalyticsEvents:Ir,analyticsSearch:se,setAnalyticsSearch:pr,analyticsFilters:o,setAnalyticsFilters:dr,isAnalyticsFilterApplied:gr,resetAnalyticsFilters:mr,newEventIds:yr,isAnalyticsLayoutReady:br,setIsAnalyticsLayoutReady:us,analyticsHeaderExpanded:xr,setAnalyticsHeaderExpanded:cs,isAnalyticsPaused:Q,setIsAnalyticsPaused:ts,reduxState:ht,setReduxState:Pe,reduxLastActionMap:St,reduxSearch:Rt,setReduxSearch:Jr,selectedReduxSlice:Ot,setSelectedReduxSlice:Ze,selectedReduxAction:Et,setSelectedReduxAction:et,reduxActiveSubTab:wt,setReduxActiveSubTab:Xr,crashRecords:fe,setCrashRecords:T,selectedCrash:tr,setSelectedCrash:Y,lastReadCrashesCount:Qt,maxCrashLogs:I,setMaxCrashLogs:_e,clearAllCrashes:()=>{(0,crashHandler_1.clearCrashRecords)(),T([]),Y(null)},settingsActiveSubTab:ar,setSettingsActiveSubTab:ns,defaultTab:D,setDefaultTab:He,isDark:ve,setIsDark:$e,showDuplicateLogs:B,setShowDuplicateLogs:ft,showUpdateToast:pt,setShowUpdateToast:dt,showConsoleLevels:_,setShowConsoleLevels:at,resetToDefaults:as,storage:i,maxNetworkLogs:F,setMaxNetworkLogs:De,maxConsoleLogs:Z,setMaxConsoleLogs:ke,maxAnalyticsEventsLimit:ee,setMaxAnalyticsEventsLimit:Be,isAutoRamLimitEnabled:te,setIsAutoRamLimitEnabled:it,deviceFreeRamMb:ut,reduxAutoRefresh:re,setReduxAutoRefreshState:ct,reduxExpandDepth:qe,setReduxExpandDepth:lt}),[x,Fr,vt,a,d,b,Ae,Re,Sr,bt,p,lr,h,cr,Xt,$t,Zt,Ie,g,fr,Gt,It,nr,or,ur,pe,ye,me,be,Lr,q,S,Pr,ge,xe,y,N,wr,J,Ee,we,Ne,A,ae,ie,Rr,Me,Oe,Hr,Nr,Mr,Cr,Or,Er,Dr,X,Br,qr,Nt,At,_t,Ft,Bt,Ht,jr,Tr,G,k,_r,R,O,kr,je,K,Te,Ir,se,o,gr,mr,yr,br,xr,Q,ht,St,Rt,Ot,Et,wt,fe,tr,Qt,I,ar,D,ve,B,pt,_,i,F,Z,ee,te,ut,re,qe,Ct]);return<InspectorContext_1.InspectorContext.Provider value={ds}>
2
2
  <MainScreen_1.default/>
3
3
  </InspectorContext_1.InspectorContext.Provider>},NetworkInspectorWrapper=a=>{const i=a?.enabled??!0,l=a?.telemetry??!0;return(0,react_1.useEffect)(()=>(i?l?(0,telemetry_1.trackActiveTelemetryHeartbeat)(!0,a?.environment):(0,telemetry_1.setTelemetryEnabled)(!1):((0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{}),(0,telemetry_1.setTelemetryEnabled)(!1)),()=>{(0,NativeInspector_2.hideNativeFloatingButton)().catch(()=>{})}),[i,l,a?.environment]),i?<i18n_1.I18nextProvider i18n={i18n_1.i18n}>
4
4
  <ErrorBoundary_1.default fallbackType="inline">
@@ -137,3 +137,4 @@ export declare const convertNativeVideoToGif: (videoUri: string, options?: GifCo
137
137
  export declare const fetchCapturedMediaList: () => Promise<CapturedMediaItem[]>;
138
138
  export declare const deleteCapturedMediaFile: (uri: string) => Promise<boolean>;
139
139
  export declare const clearAllCapturedMediaFiles: () => Promise<boolean>;
140
+ export declare const copyMediaToClipboard: (filePath: string) => Promise<boolean>;
@@ -1 +1 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.clearAllCapturedMediaFiles=exports.deleteCapturedMediaFile=exports.fetchCapturedMediaList=exports.convertNativeVideoToGif=exports.playNativeVideo=exports.isNativeRecordingActive=exports.stopNativeVideoRecording=exports.startNativeVideoRecording=exports.takeNativeScreenshot=exports.fetchNativeCachedPage=exports.pushNativeLogRecord=exports.getNativeSystemMetrics=exports.triggerNativeHaptic=exports.setNativeStorageItem=exports.getNativeStorageItem=exports.subscribeNativeDeviceShake=exports.getNativeFpsMetrics=exports.stopNativeFpsMonitoring=exports.startNativeFpsMonitoring=exports.subscribeNativeFloatingButtonPress=exports.setNativeFloatingButtonBadge=exports.hideNativeFloatingButton=exports.showNativeFloatingButton=exports.subscribeNativeCrashes=exports.enableNativeCrashProtection=exports.getNativeDeviceMetrics=exports.isNativeModuleAvailable=void 0;const react_native_1=require("react-native"),NativeNetworkInspector_1=__importDefault(require("./NativeNetworkInspector")),NativeModule=NativeNetworkInspector_1.default||react_native_1.NativeModules.NetworkInspectorModule,isNativeModuleAvailable=()=>!!NativeModule;exports.isNativeModuleAvailable=isNativeModuleAvailable;const getNativeEmitter=()=>{try{if(react_native_1.NativeModules&&react_native_1.NativeModules.NetworkInspectorModule)return new react_native_1.NativeEventEmitter(react_native_1.NativeModules.NetworkInspectorModule)}catch{}return null},nativeEmitter=getNativeEmitter(),getNativeDeviceMetrics=async()=>{if(!NativeModule||!NativeModule.getDeviceMetrics)return null;try{return await NativeModule.getDeviceMetrics()}catch{return null}};exports.getNativeDeviceMetrics=getNativeDeviceMetrics;const enableNativeCrashProtection=async t=>{if(!NativeModule||!NativeModule.enableNativeCrashProtection)return!1;try{const e=await NativeModule.enableNativeCrashProtection();return t?.showFloatingButton===!0&&await(0,exports.showNativeFloatingButton)(),!!e}catch{return!1}};exports.enableNativeCrashProtection=enableNativeCrashProtection;const subscribeNativeCrashes=t=>{const e=[];try{const r=react_native_1.DeviceEventEmitter.addListener("onNativeCrash",t);e.push(()=>r.remove())}catch{}if(nativeEmitter)try{const r=nativeEmitter.addListener("onNativeCrash",t);e.push(()=>r.remove())}catch{}return()=>{e.forEach(r=>{try{r()}catch{}})}};exports.subscribeNativeCrashes=subscribeNativeCrashes;const showNativeFloatingButton=async t=>{if(!NativeModule||!NativeModule.showFloatingButton)return!1;try{return!!await NativeModule.showFloatingButton(t||{})}catch{return!1}};exports.showNativeFloatingButton=showNativeFloatingButton;const hideNativeFloatingButton=async()=>{if(!NativeModule||!NativeModule.hideFloatingButton)return!1;try{return!!await NativeModule.hideFloatingButton()}catch{return!1}};exports.hideNativeFloatingButton=hideNativeFloatingButton;const setNativeFloatingButtonBadge=async t=>{if(!NativeModule||!NativeModule.setFloatingButtonBadge)return!1;try{return!!await NativeModule.setFloatingButtonBadge(t)}catch{return!1}};exports.setNativeFloatingButtonBadge=setNativeFloatingButtonBadge;const subscribeNativeFloatingButtonPress=t=>{const e=[];try{const s=react_native_1.DeviceEventEmitter.addListener("onFloatingButtonPress",t);e.push(()=>s.remove())}catch{}if(nativeEmitter)try{const s=nativeEmitter.addListener("onFloatingButtonPress",t);e.push(()=>s.remove())}catch{}const r=setInterval(async()=>{if(NativeModule&&NativeModule.checkFloatingButtonPress)try{await NativeModule.checkFloatingButtonPress()&&t()}catch{}},180);return e.push(()=>clearInterval(r)),()=>{e.forEach(s=>{try{s()}catch{}})}};exports.subscribeNativeFloatingButtonPress=subscribeNativeFloatingButtonPress;const startNativeFpsMonitoring=async()=>{if(!NativeModule||!NativeModule.startFpsMonitoring)return!1;try{return!!await NativeModule.startFpsMonitoring()}catch{return!1}};exports.startNativeFpsMonitoring=startNativeFpsMonitoring;const stopNativeFpsMonitoring=async()=>{if(!NativeModule||!NativeModule.stopFpsMonitoring)return!1;try{return!!await NativeModule.stopFpsMonitoring()}catch{return!1}};exports.stopNativeFpsMonitoring=stopNativeFpsMonitoring;const getNativeFpsMetrics=async()=>{if(!NativeModule||!NativeModule.getFpsMetrics)return{fps:60,targetFps:60};try{const t=await NativeModule.getFpsMetrics();return{fps:typeof t?.fps=="number"?t.fps:60,targetFps:typeof t?.targetFps=="number"?t.targetFps:60}}catch{return{fps:60,targetFps:60}}};exports.getNativeFpsMetrics=getNativeFpsMetrics;const subscribeNativeDeviceShake=t=>{if(!nativeEmitter)return()=>{};try{const e=nativeEmitter.addListener("onDeviceShake",t);return()=>{e.remove()}}catch{return()=>{}}};exports.subscribeNativeDeviceShake=subscribeNativeDeviceShake;const getNativeStorageItem=async t=>{if(!NativeModule||!NativeModule.getNativeStorageItem)return null;try{const e=await NativeModule.getNativeStorageItem(t);return typeof e=="string"?e:null}catch{return null}};exports.getNativeStorageItem=getNativeStorageItem;const setNativeStorageItem=async(t,e)=>{if(!NativeModule||!NativeModule.setNativeStorageItem)return!1;try{return!!await NativeModule.setNativeStorageItem(t,e)}catch{return!1}};exports.setNativeStorageItem=setNativeStorageItem;const triggerNativeHaptic=async(t="light")=>{if(!NativeModule||!NativeModule.triggerHaptic)return!1;try{return!!await NativeModule.triggerHaptic(t)}catch{return!1}};exports.triggerNativeHaptic=triggerNativeHaptic;const getNativeSystemMetrics=async()=>{if(!NativeModule||!NativeModule.getNativeSystemMetrics)return null;try{return await NativeModule.getNativeSystemMetrics()}catch{return null}};exports.getNativeSystemMetrics=getNativeSystemMetrics;const pushNativeLogRecord=async(t,e)=>{if(!NativeModule||!NativeModule.pushNativeLogRecord)return!1;try{return!!await NativeModule.pushNativeLogRecord(t,e)}catch{return!1}};exports.pushNativeLogRecord=pushNativeLogRecord;const fetchNativeCachedPage=async(t,e=0,r=50,s="")=>{if(!NativeModule||!NativeModule.getNativeCachedPage)return null;try{const i=await NativeModule.getNativeCachedPage(t,e,r,s);if(!i)return null;const a=JSON.parse(i),n=(a.items||[]).map(o=>typeof o=="string"?JSON.parse(o):o);return{pageKey:a.pageKey||t,total:a.total||0,offset:a.offset||e,items:n}}catch{return null}};exports.fetchNativeCachedPage=fetchNativeCachedPage;const takeNativeScreenshot=async t=>{if(!NativeModule||!NativeModule.takeScreenshot)return null;try{return await NativeModule.takeScreenshot(t||{})}catch{return null}};exports.takeNativeScreenshot=takeNativeScreenshot;const startNativeVideoRecording=async t=>{if(!NativeModule||!NativeModule.startVideoRecording)return!1;try{return!!await NativeModule.startVideoRecording(t||{})}catch{return!1}};exports.startNativeVideoRecording=startNativeVideoRecording;const stopNativeVideoRecording=async()=>{if(!NativeModule||!NativeModule.stopVideoRecording)return null;try{return await NativeModule.stopVideoRecording()}catch{return null}};exports.stopNativeVideoRecording=stopNativeVideoRecording;const isNativeRecordingActive=async()=>{if(!NativeModule||!NativeModule.isRecording)return!1;try{return!!await NativeModule.isRecording()}catch{return!1}};exports.isNativeRecordingActive=isNativeRecordingActive;const playNativeVideo=async t=>{if(!NativeModule||!NativeModule.playVideo)return!1;try{return!!await NativeModule.playVideo(t)}catch{return!1}};exports.playNativeVideo=playNativeVideo;const convertNativeVideoToGif=async(t,e)=>{if(!NativeModule||!NativeModule.convertToGif)return null;try{return await NativeModule.convertToGif(t,e||{})}catch{return null}};exports.convertNativeVideoToGif=convertNativeVideoToGif;const fetchCapturedMediaList=async()=>{if(!NativeModule||!NativeModule.getCapturedMedia)return[];try{const t=await NativeModule.getCapturedMedia();if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}};exports.fetchCapturedMediaList=fetchCapturedMediaList;const deleteCapturedMediaFile=async t=>{if(!NativeModule||!NativeModule.deleteCapturedMedia)return!1;try{return!!await NativeModule.deleteCapturedMedia(t)}catch{return!1}};exports.deleteCapturedMediaFile=deleteCapturedMediaFile;const clearAllCapturedMediaFiles=async()=>{if(!NativeModule||!NativeModule.clearAllCapturedMedia)return!1;try{return!!await NativeModule.clearAllCapturedMedia()}catch{return!1}};exports.clearAllCapturedMediaFiles=clearAllCapturedMediaFiles;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.copyMediaToClipboard=exports.clearAllCapturedMediaFiles=exports.deleteCapturedMediaFile=exports.fetchCapturedMediaList=exports.convertNativeVideoToGif=exports.playNativeVideo=exports.isNativeRecordingActive=exports.stopNativeVideoRecording=exports.startNativeVideoRecording=exports.takeNativeScreenshot=exports.fetchNativeCachedPage=exports.pushNativeLogRecord=exports.getNativeSystemMetrics=exports.triggerNativeHaptic=exports.setNativeStorageItem=exports.getNativeStorageItem=exports.subscribeNativeDeviceShake=exports.getNativeFpsMetrics=exports.stopNativeFpsMonitoring=exports.startNativeFpsMonitoring=exports.subscribeNativeFloatingButtonPress=exports.setNativeFloatingButtonBadge=exports.hideNativeFloatingButton=exports.showNativeFloatingButton=exports.subscribeNativeCrashes=exports.enableNativeCrashProtection=exports.getNativeDeviceMetrics=exports.isNativeModuleAvailable=void 0;const react_native_1=require("react-native"),NativeNetworkInspector_1=__importDefault(require("./NativeNetworkInspector")),NativeModule=NativeNetworkInspector_1.default||react_native_1.NativeModules.NetworkInspectorModule,isNativeModuleAvailable=()=>!!NativeModule;exports.isNativeModuleAvailable=isNativeModuleAvailable;const getNativeEmitter=()=>{try{if(react_native_1.NativeModules&&react_native_1.NativeModules.NetworkInspectorModule)return new react_native_1.NativeEventEmitter(react_native_1.NativeModules.NetworkInspectorModule)}catch{}return null},nativeEmitter=getNativeEmitter(),getNativeDeviceMetrics=async()=>{if(!NativeModule||!NativeModule.getDeviceMetrics)return null;try{return await NativeModule.getDeviceMetrics()}catch{return null}};exports.getNativeDeviceMetrics=getNativeDeviceMetrics;const enableNativeCrashProtection=async t=>{if(!NativeModule||!NativeModule.enableNativeCrashProtection)return!1;try{const e=await NativeModule.enableNativeCrashProtection();return t?.showFloatingButton===!0&&await(0,exports.showNativeFloatingButton)(),!!e}catch{return!1}};exports.enableNativeCrashProtection=enableNativeCrashProtection;const subscribeNativeCrashes=t=>{const e=[];try{const r=react_native_1.DeviceEventEmitter.addListener("onNativeCrash",t);e.push(()=>r.remove())}catch{}if(nativeEmitter)try{const r=nativeEmitter.addListener("onNativeCrash",t);e.push(()=>r.remove())}catch{}return()=>{e.forEach(r=>{try{r()}catch{}})}};exports.subscribeNativeCrashes=subscribeNativeCrashes;const showNativeFloatingButton=async t=>{if(!NativeModule||!NativeModule.showFloatingButton)return!1;try{return!!await NativeModule.showFloatingButton(t||{})}catch{return!1}};exports.showNativeFloatingButton=showNativeFloatingButton;const hideNativeFloatingButton=async()=>{if(!NativeModule||!NativeModule.hideFloatingButton)return!1;try{return!!await NativeModule.hideFloatingButton()}catch{return!1}};exports.hideNativeFloatingButton=hideNativeFloatingButton;const setNativeFloatingButtonBadge=async t=>{if(!NativeModule||!NativeModule.setFloatingButtonBadge)return!1;try{return!!await NativeModule.setFloatingButtonBadge(t)}catch{return!1}};exports.setNativeFloatingButtonBadge=setNativeFloatingButtonBadge;const subscribeNativeFloatingButtonPress=t=>{const e=[];try{const s=react_native_1.DeviceEventEmitter.addListener("onFloatingButtonPress",t);e.push(()=>s.remove())}catch{}if(nativeEmitter)try{const s=nativeEmitter.addListener("onFloatingButtonPress",t);e.push(()=>s.remove())}catch{}const r=setInterval(async()=>{if(NativeModule&&NativeModule.checkFloatingButtonPress)try{await NativeModule.checkFloatingButtonPress()&&t()}catch{}},180);return e.push(()=>clearInterval(r)),()=>{e.forEach(s=>{try{s()}catch{}})}};exports.subscribeNativeFloatingButtonPress=subscribeNativeFloatingButtonPress;const startNativeFpsMonitoring=async()=>{if(!NativeModule||!NativeModule.startFpsMonitoring)return!1;try{return!!await NativeModule.startFpsMonitoring()}catch{return!1}};exports.startNativeFpsMonitoring=startNativeFpsMonitoring;const stopNativeFpsMonitoring=async()=>{if(!NativeModule||!NativeModule.stopFpsMonitoring)return!1;try{return!!await NativeModule.stopFpsMonitoring()}catch{return!1}};exports.stopNativeFpsMonitoring=stopNativeFpsMonitoring;const getNativeFpsMetrics=async()=>{if(!NativeModule||!NativeModule.getFpsMetrics)return{fps:60,targetFps:60};try{const t=await NativeModule.getFpsMetrics();return{fps:typeof t?.fps=="number"?t.fps:60,targetFps:typeof t?.targetFps=="number"?t.targetFps:60}}catch{return{fps:60,targetFps:60}}};exports.getNativeFpsMetrics=getNativeFpsMetrics;const subscribeNativeDeviceShake=t=>{if(!nativeEmitter)return()=>{};try{const e=nativeEmitter.addListener("onDeviceShake",t);return()=>{e.remove()}}catch{return()=>{}}};exports.subscribeNativeDeviceShake=subscribeNativeDeviceShake;const getNativeStorageItem=async t=>{if(!NativeModule||!NativeModule.getNativeStorageItem)return null;try{const e=await NativeModule.getNativeStorageItem(t);return typeof e=="string"?e:null}catch{return null}};exports.getNativeStorageItem=getNativeStorageItem;const setNativeStorageItem=async(t,e)=>{if(!NativeModule||!NativeModule.setNativeStorageItem)return!1;try{return!!await NativeModule.setNativeStorageItem(t,e)}catch{return!1}};exports.setNativeStorageItem=setNativeStorageItem;const triggerNativeHaptic=async(t="light")=>{if(!NativeModule||!NativeModule.triggerHaptic)return!1;try{return!!await NativeModule.triggerHaptic(t)}catch{return!1}};exports.triggerNativeHaptic=triggerNativeHaptic;const getNativeSystemMetrics=async()=>{if(!NativeModule||!NativeModule.getNativeSystemMetrics)return null;try{return await NativeModule.getNativeSystemMetrics()}catch{return null}};exports.getNativeSystemMetrics=getNativeSystemMetrics;const pushNativeLogRecord=async(t,e)=>{if(!NativeModule||!NativeModule.pushNativeLogRecord)return!1;try{return!!await NativeModule.pushNativeLogRecord(t,e)}catch{return!1}};exports.pushNativeLogRecord=pushNativeLogRecord;const fetchNativeCachedPage=async(t,e=0,r=50,s="")=>{if(!NativeModule||!NativeModule.getNativeCachedPage)return null;try{const i=await NativeModule.getNativeCachedPage(t,e,r,s);if(!i)return null;const a=JSON.parse(i),n=(a.items||[]).map(o=>typeof o=="string"?JSON.parse(o):o);return{pageKey:a.pageKey||t,total:a.total||0,offset:a.offset||e,items:n}}catch{return null}};exports.fetchNativeCachedPage=fetchNativeCachedPage;const takeNativeScreenshot=async t=>{if(!NativeModule||!NativeModule.takeScreenshot)return null;try{return await NativeModule.takeScreenshot(t||{})}catch{return null}};exports.takeNativeScreenshot=takeNativeScreenshot;const startNativeVideoRecording=async t=>{if(!NativeModule||!NativeModule.startVideoRecording)return!1;try{return!!await NativeModule.startVideoRecording(t||{})}catch{return!1}};exports.startNativeVideoRecording=startNativeVideoRecording;const stopNativeVideoRecording=async()=>{if(!NativeModule||!NativeModule.stopVideoRecording)return null;try{return await NativeModule.stopVideoRecording()}catch{return null}};exports.stopNativeVideoRecording=stopNativeVideoRecording;const isNativeRecordingActive=async()=>{if(!NativeModule||!NativeModule.isRecording)return!1;try{return!!await NativeModule.isRecording()}catch{return!1}};exports.isNativeRecordingActive=isNativeRecordingActive;const playNativeVideo=async t=>{if(!NativeModule||!NativeModule.playVideo)return!1;try{return!!await NativeModule.playVideo(t)}catch{return!1}};exports.playNativeVideo=playNativeVideo;const convertNativeVideoToGif=async(t,e)=>{if(!NativeModule||!NativeModule.convertToGif)return null;try{return await NativeModule.convertToGif(t,e||{})}catch{return null}};exports.convertNativeVideoToGif=convertNativeVideoToGif;const fetchCapturedMediaList=async()=>{if(!NativeModule||!NativeModule.getCapturedMedia)return[];try{const t=await NativeModule.getCapturedMedia();if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}};exports.fetchCapturedMediaList=fetchCapturedMediaList;const deleteCapturedMediaFile=async t=>{if(!NativeModule||!NativeModule.deleteCapturedMedia)return!1;try{return!!await NativeModule.deleteCapturedMedia(t)}catch{return!1}};exports.deleteCapturedMediaFile=deleteCapturedMediaFile;const clearAllCapturedMediaFiles=async()=>{if(!NativeModule||!NativeModule.clearAllCapturedMedia)return!1;try{return!!await NativeModule.clearAllCapturedMedia()}catch{return!1}};exports.clearAllCapturedMediaFiles=clearAllCapturedMediaFiles;const copyMediaToClipboard=async t=>{if(!t||!NativeModule||!NativeModule.copyMediaToClipboard)return!1;try{return!!(await NativeModule.copyMediaToClipboard(t))?.success}catch{return!1}};exports.copyMediaToClipboard=copyMediaToClipboard;