react-native-inapp-inspector 2.5.12 → 2.5.13

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 (186) hide show
  1. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  2. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  3. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  4. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  5. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  6. package/android/.gradle/8.9/gc.properties +0 -0
  7. package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
  8. package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
  9. package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
  10. package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
  11. package/android/.gradle/9.2.0/gc.properties +0 -0
  12. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  13. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  14. package/android/.gradle/vcs-1/gc.properties +0 -0
  15. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  16. package/android/src/main/AndroidManifest.xml +11 -0
  17. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +379 -19
  18. package/android/src/main/res/xml/inappinspector_file_paths.xml +7 -0
  19. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +47 -49
  20. package/dist/commonjs/components/Inspector/BoxModelVisualizer.d.ts +8 -0
  21. package/dist/commonjs/components/Inspector/BoxModelVisualizer.js +76 -0
  22. package/dist/commonjs/components/Inspector/ConsoleExportModal.js +51 -51
  23. package/dist/commonjs/components/Inspector/CrashTab.js +17 -17
  24. package/dist/commonjs/components/Inspector/DebuggingTab.js +24 -24
  25. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +2 -2
  26. package/dist/commonjs/components/Inspector/FabLauncher.js +2 -2
  27. package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +2 -2
  28. package/dist/commonjs/components/Inspector/InspectorHeader.js +10 -10
  29. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +10 -10
  30. package/dist/commonjs/components/Inspector/MediaPreviewModal.d.ts +1 -0
  31. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +222 -222
  32. package/dist/commonjs/components/Inspector/NetworkExportModal.d.ts +10 -0
  33. package/dist/commonjs/components/Inspector/NetworkExportModal.js +333 -0
  34. package/dist/commonjs/components/Inspector/NetworkTab.js +48 -41
  35. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +11 -12
  36. package/dist/commonjs/components/Inspector/ReduxDetail.js +17 -19
  37. package/dist/commonjs/components/Inspector/ReduxTab.js +5 -5
  38. package/dist/commonjs/components/Inspector/SettingsPanel.js +3 -6
  39. package/dist/commonjs/components/Inspector/SocketCard.js +2 -2
  40. package/dist/commonjs/components/Inspector/SupportPage.js +5 -5
  41. package/dist/commonjs/components/Inspector/UiA11yAuditPanel.d.ts +7 -0
  42. package/dist/commonjs/components/Inspector/UiA11yAuditPanel.js +97 -0
  43. package/dist/commonjs/components/Inspector/UiInspectorDetail.d.ts +2 -0
  44. package/dist/commonjs/components/Inspector/UiInspectorDetail.js +485 -0
  45. package/dist/commonjs/components/Inspector/UiInspectorOverlay.d.ts +2 -0
  46. package/dist/commonjs/components/Inspector/UiInspectorOverlay.js +199 -0
  47. package/dist/commonjs/components/Inspector/UiInspectorTab.d.ts +2 -0
  48. package/dist/commonjs/components/Inspector/UiInspectorTab.js +117 -0
  49. package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.d.ts +10 -0
  50. package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.js +148 -0
  51. package/dist/commonjs/components/Inspector/index.d.ts +28 -0
  52. package/dist/commonjs/components/Inspector/index.js +1 -0
  53. package/dist/commonjs/components/LogCard.js +9 -7
  54. package/dist/commonjs/constants/index.js +1 -1
  55. package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
  56. package/dist/commonjs/constants/telemetryConfig.js +1 -1
  57. package/dist/commonjs/constants/version.d.ts +1 -1
  58. package/dist/commonjs/constants/version.js +1 -1
  59. package/dist/commonjs/customHooks/crashHandler.d.ts +1 -1
  60. package/dist/commonjs/customHooks/crashHandler.js +6 -6
  61. package/dist/commonjs/customHooks/uiInspectorManager.d.ts +22 -0
  62. package/dist/commonjs/customHooks/uiInspectorManager.js +1 -0
  63. package/dist/commonjs/helpers/index.js +1 -3
  64. package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -0
  65. package/dist/commonjs/helpers/searchQueryParser.js +7 -5
  66. package/dist/commonjs/helpers/shareFormatter.d.ts +16 -0
  67. package/dist/commonjs/helpers/shareFormatter.js +16 -9
  68. package/dist/commonjs/helpers/uiInspectorEngine.d.ts +62 -0
  69. package/dist/commonjs/helpers/uiInspectorEngine.js +19 -0
  70. package/dist/commonjs/i18n/locales/ar.json +1 -1
  71. package/dist/commonjs/i18n/locales/bn.json +1 -1
  72. package/dist/commonjs/i18n/locales/de.json +1 -1
  73. package/dist/commonjs/i18n/locales/en.json +1 -1
  74. package/dist/commonjs/i18n/locales/es.json +1 -1
  75. package/dist/commonjs/i18n/locales/fr.json +1 -1
  76. package/dist/commonjs/i18n/locales/gu.json +1 -1
  77. package/dist/commonjs/i18n/locales/hi.json +1 -1
  78. package/dist/commonjs/i18n/locales/id.json +1 -1
  79. package/dist/commonjs/i18n/locales/it.json +1 -1
  80. package/dist/commonjs/i18n/locales/ja.json +1 -1
  81. package/dist/commonjs/i18n/locales/kn.json +1 -1
  82. package/dist/commonjs/i18n/locales/ko.json +1 -1
  83. package/dist/commonjs/i18n/locales/ml.json +1 -1
  84. package/dist/commonjs/i18n/locales/mr.json +1 -1
  85. package/dist/commonjs/i18n/locales/nl.json +1 -1
  86. package/dist/commonjs/i18n/locales/pa.json +1 -1
  87. package/dist/commonjs/i18n/locales/pl.json +1 -1
  88. package/dist/commonjs/i18n/locales/pt.json +1 -1
  89. package/dist/commonjs/i18n/locales/ru.json +1 -1
  90. package/dist/commonjs/i18n/locales/ta.json +1 -1
  91. package/dist/commonjs/i18n/locales/te.json +1 -1
  92. package/dist/commonjs/i18n/locales/tr.json +1 -1
  93. package/dist/commonjs/i18n/locales/vi.json +1 -1
  94. package/dist/commonjs/i18n/locales/zh.json +1 -1
  95. package/dist/commonjs/index.d.ts +3 -1
  96. package/dist/commonjs/index.js +3 -3
  97. package/dist/commonjs/native/NativeInspector.d.ts +2 -0
  98. package/dist/commonjs/native/NativeInspector.js +1 -1
  99. package/dist/commonjs/native/NativeNetworkInspector.d.ts +2 -0
  100. package/dist/commonjs/types/editor.d.ts +31 -0
  101. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +73 -75
  102. package/dist/esm/components/Inspector/BoxModelVisualizer.d.ts +8 -0
  103. package/dist/esm/components/Inspector/BoxModelVisualizer.js +76 -0
  104. package/dist/esm/components/Inspector/ConsoleExportModal.js +67 -67
  105. package/dist/esm/components/Inspector/CrashTab.js +58 -58
  106. package/dist/esm/components/Inspector/DebuggingTab.js +89 -89
  107. package/dist/esm/components/Inspector/DeviceInfoTab.js +2 -2
  108. package/dist/esm/components/Inspector/FabLauncher.js +21 -21
  109. package/dist/esm/components/Inspector/FloatingCaptureWidget.js +23 -23
  110. package/dist/esm/components/Inspector/InspectorHeader.js +26 -26
  111. package/dist/esm/components/Inspector/MediaGalleryTab.js +151 -151
  112. package/dist/esm/components/Inspector/MediaPreviewModal.d.ts +1 -0
  113. package/dist/esm/components/Inspector/MediaPreviewModal.js +468 -468
  114. package/dist/esm/components/Inspector/NetworkExportModal.d.ts +10 -0
  115. package/dist/esm/components/Inspector/NetworkExportModal.js +333 -0
  116. package/dist/esm/components/Inspector/NetworkTab.js +118 -111
  117. package/dist/esm/components/Inspector/NpmStarPrompt.js +32 -33
  118. package/dist/esm/components/Inspector/ReduxDetail.js +54 -56
  119. package/dist/esm/components/Inspector/ReduxTab.js +9 -9
  120. package/dist/esm/components/Inspector/SettingsPanel.js +3 -6
  121. package/dist/esm/components/Inspector/SocketCard.js +13 -13
  122. package/dist/esm/components/Inspector/SupportPage.js +5 -5
  123. package/dist/esm/components/Inspector/UiA11yAuditPanel.d.ts +7 -0
  124. package/dist/esm/components/Inspector/UiA11yAuditPanel.js +97 -0
  125. package/dist/esm/components/Inspector/UiInspectorDetail.d.ts +2 -0
  126. package/dist/esm/components/Inspector/UiInspectorDetail.js +422 -0
  127. package/dist/esm/components/Inspector/UiInspectorOverlay.d.ts +2 -0
  128. package/dist/esm/components/Inspector/UiInspectorOverlay.js +138 -0
  129. package/dist/esm/components/Inspector/UiInspectorTab.d.ts +2 -0
  130. package/dist/esm/components/Inspector/UiInspectorTab.js +117 -0
  131. package/dist/esm/components/Inspector/UiLiveStyleTweaker.d.ts +10 -0
  132. package/dist/esm/components/Inspector/UiLiveStyleTweaker.js +148 -0
  133. package/dist/esm/components/Inspector/index.d.ts +28 -0
  134. package/dist/esm/components/Inspector/index.js +1 -0
  135. package/dist/esm/components/LogCard.js +57 -55
  136. package/dist/esm/constants/index.js +1 -1
  137. package/dist/esm/constants/telemetryConfig.d.ts +3 -3
  138. package/dist/esm/constants/telemetryConfig.js +1 -1
  139. package/dist/esm/constants/version.d.ts +1 -1
  140. package/dist/esm/constants/version.js +1 -1
  141. package/dist/esm/customHooks/crashHandler.d.ts +1 -1
  142. package/dist/esm/customHooks/crashHandler.js +6 -6
  143. package/dist/esm/customHooks/uiInspectorManager.d.ts +22 -0
  144. package/dist/esm/customHooks/uiInspectorManager.js +1 -0
  145. package/dist/esm/helpers/index.js +4 -6
  146. package/dist/esm/helpers/searchQueryParser.d.ts +1 -0
  147. package/dist/esm/helpers/searchQueryParser.js +7 -5
  148. package/dist/esm/helpers/shareFormatter.d.ts +16 -0
  149. package/dist/esm/helpers/shareFormatter.js +20 -13
  150. package/dist/esm/helpers/uiInspectorEngine.d.ts +48 -0
  151. package/dist/esm/helpers/uiInspectorEngine.js +19 -0
  152. package/dist/esm/i18n/locales/ar.json +1 -1
  153. package/dist/esm/i18n/locales/bn.json +1 -1
  154. package/dist/esm/i18n/locales/de.json +1 -1
  155. package/dist/esm/i18n/locales/en.json +1 -1
  156. package/dist/esm/i18n/locales/es.json +1 -1
  157. package/dist/esm/i18n/locales/fr.json +1 -1
  158. package/dist/esm/i18n/locales/gu.json +1 -1
  159. package/dist/esm/i18n/locales/hi.json +1 -1
  160. package/dist/esm/i18n/locales/id.json +1 -1
  161. package/dist/esm/i18n/locales/it.json +1 -1
  162. package/dist/esm/i18n/locales/ja.json +1 -1
  163. package/dist/esm/i18n/locales/kn.json +1 -1
  164. package/dist/esm/i18n/locales/ko.json +1 -1
  165. package/dist/esm/i18n/locales/ml.json +1 -1
  166. package/dist/esm/i18n/locales/mr.json +1 -1
  167. package/dist/esm/i18n/locales/nl.json +1 -1
  168. package/dist/esm/i18n/locales/pa.json +1 -1
  169. package/dist/esm/i18n/locales/pl.json +1 -1
  170. package/dist/esm/i18n/locales/pt.json +1 -1
  171. package/dist/esm/i18n/locales/ru.json +1 -1
  172. package/dist/esm/i18n/locales/ta.json +1 -1
  173. package/dist/esm/i18n/locales/te.json +1 -1
  174. package/dist/esm/i18n/locales/tr.json +1 -1
  175. package/dist/esm/i18n/locales/vi.json +1 -1
  176. package/dist/esm/i18n/locales/zh.json +1 -1
  177. package/dist/esm/index.d.ts +3 -1
  178. package/dist/esm/index.js +7 -7
  179. package/dist/esm/native/NativeInspector.d.ts +2 -0
  180. package/dist/esm/native/NativeInspector.js +1 -1
  181. package/dist/esm/native/NativeNetworkInspector.d.ts +2 -0
  182. package/dist/esm/types/editor.d.ts +31 -0
  183. package/ios/NetworkInspectorModule.mm +314 -16
  184. package/package.json +1 -1
  185. package/src/native/NativeInspector.ts +37 -0
  186. package/src/native/NativeNetworkInspector.ts +2 -0
@@ -1,6 +1,6 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,a,n){n===void 0&&(n=a);var r=Object.getOwnPropertyDescriptor(t,a);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,r)}):(function(e,t,a,n){n===void 0&&(n=a),e[n]=t[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(a){var n=[];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(n[n.length]=r);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var a={};if(t!=null)for(var n=e(t),r=0;r<n.length;r++)n[r]!=="default"&&__createBinding(a,t,n[r]);return __setModuleDefault(a,t),a}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),react_native_svg_1=__importStar(require("react-native-svg")),AppColors_1=require("../styles/AppColors"),constants_1=require("../constants"),helpers_1=require("../helpers"),NetworkIcons_1=require("./NetworkIcons"),AppFonts_1=require("../styles/AppFonts"),HighlightText_1=__importDefault(require("./HighlightText")),TouchableScale_1=__importDefault(require("./TouchableScale")),i18n_1=require("../i18n");function LogCard({item:e,onPress:t,timelineMinStart:a,timelineTotalRange:n,isNew:r,isSelected:h,onToggleSelect:_,searchStr:C,testID:b}){const{t:l}=(0,i18n_1.useTranslation)(),f=constants_1.METHOD_COLORS[e.method]??constants_1.METHOD_COLORS.ALL,s=(0,react_1.useMemo)(()=>{try{const o=new URL(e.url),g=o.host,w=o.pathname+(o.search?o.search:""),V=o.protocol==="https:";return{host:g,path:w||"/",isHttps:V}}catch{const o=e.url.toLowerCase().startsWith("https:"),g=(0,helpers_1.getPath)(e.url);return{host:(0,helpers_1.getBaseUrl)(e.url).replace(/^https?:\/\//,""),path:g||e.url,isHttps:o}}},[e.url]),y=o=>{o?.stopPropagation?.(),react_native_1.Alert.alert(l("common.openInBrowser")||"Open URL",`${l("common.openInBrowserPrompt")||"Choose how you want to open or inspect this URL:"}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,a,n){n===void 0&&(n=a);var r=Object.getOwnPropertyDescriptor(t,a);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(e,n,r)}):(function(e,t,a,n){n===void 0&&(n=a),e[n]=t[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(a){var n=[];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(n[n.length]=r);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var a={};if(t!=null)for(var n=e(t),r=0;r<n.length;r++)n[r]!=="default"&&__createBinding(a,t,n[r]);return __setModuleDefault(a,t),a}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),react_native_svg_1=__importStar(require("react-native-svg")),AppColors_1=require("../styles/AppColors"),constants_1=require("../constants"),helpers_1=require("../helpers"),NetworkIcons_1=require("./NetworkIcons"),AppFonts_1=require("../styles/AppFonts"),HighlightText_1=__importDefault(require("./HighlightText")),TouchableScale_1=__importDefault(require("./TouchableScale")),i18n_1=require("../i18n");function LogCard({item:e,onPress:t,timelineMinStart:a,timelineTotalRange:n,isNew:r,isSelected:h,onToggleSelect:_,searchStr:C,testID:b}){const{t:l}=(0,i18n_1.useTranslation)(),f=constants_1.METHOD_COLORS[e.method]??constants_1.METHOD_COLORS.ALL,s=(0,react_1.useMemo)(()=>{try{const o=new URL(e.url),g=o.host,w=o.pathname+(o.search?o.search:""),S=o.protocol==="https:";return{host:g,path:w||"/",isHttps:S}}catch{const o=e.url.toLowerCase().startsWith("https:"),g=(0,helpers_1.getPath)(e.url);return{host:(0,helpers_1.getBaseUrl)(e.url).replace(/^https?:\/\//,""),path:g||e.url,isHttps:o}}},[e.url]),y=o=>{o?.stopPropagation?.(),react_native_1.Alert.alert(l("common.openInBrowser")||"Open URL",`${l("common.openInBrowserPrompt")||"Choose how you want to open or inspect this URL:"}
2
2
 
3
- ${e.url}`,[{text:l("common.cancel")||"Cancel",style:"cancel"},{text:"Open in Postman",onPress:()=>(0,helpers_1.openWithPostman)(e)},{text:l("common.open")||"Browser",onPress:()=>{react_native_1.Linking.openURL(e.url).catch(()=>{react_native_1.Alert.alert(l("common.error")||"Error",l("common.cannotOpenUrl")||"Could not open URL")})}}])},x=o=>{o?.stopPropagation?.(),(0,helpers_1.openWithPostman)(e)},i=e.status===0||e.status!=null&&e.status>=400,p=e.status==null,d=(0,helpers_1.getStatusColor)(e.status),c=(0,helpers_1.getDurationColor)(e.duration),A=p?AppColors_1.AppColors.darkOrange:i?AppColors_1.AppColors.errorColor:AppColors_1.AppColors.greenColor,u=(0,react_1.useRef)(new react_native_1.Animated.Value(r?.35:0)).current;(0,react_1.useEffect)(()=>{r&&react_native_1.Animated.timing(u,{toValue:0,duration:1200,useNativeDriver:!0}).start()},[r,u]);const T=()=>{if(p)return"...";if(e.status===0||e.status==null)return l("network.statusFailed")||"FAILED";const o=typeof e.status=="number"?e.status:parseInt(String(e.status||0),10);return o===200?"200 OK":o===201?"201 Created":o===204?"204 No Content":o===304?"304 Not Modified":o===400?"400 Bad Req":o===401?"401 Unauth":o===403?"403 Forbidden":o===404?"404 Not Found":o===500?"500 Error":String(e.status)},v=()=>{if(p)return<NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.darkOrange}size={10}/>;const o=typeof e.status=="number"?e.status:parseInt(String(e.status||0),10);return o>=200&&o<300?<NetworkIcons_1.CircleCheckIcon color={AppColors_1.AppColors.greenColor}size={10}/>:o>=300&&o<400?<NetworkIcons_1.RepeatIcon color={AppColors_1.AppColors.amber700}size={10}/>:o>=400&&o<500?<NetworkIcons_1.CircleAlertIcon color={AppColors_1.AppColors.darkOrange}size={10}/>:<NetworkIcons_1.CircleXIcon color={AppColors_1.AppColors.errorColor}size={10}/>},m=(0,helpers_1.formatDateTime)(e.startTime),S=e.url.split("?")[0].toLowerCase().endsWith(".json");return<react_native_1.View style={styles.container}>
3
+ ${e.url}`,[{text:l("common.cancel")||"Cancel",style:"cancel"},{text:"Open in Postman",onPress:()=>(0,helpers_1.openWithPostman)(e)},{text:l("common.open")||"Browser",onPress:()=>{react_native_1.Linking.openURL(e.url).catch(()=>{react_native_1.Alert.alert(l("common.error")||"Error",l("common.cannotOpenUrl")||"Could not open URL")})}}])},x=o=>{o?.stopPropagation?.(),(0,helpers_1.openWithPostman)(e)},i=e.status===0||e.status!=null&&e.status>=400,p=e.status==null,d=(0,helpers_1.getStatusColor)(e.status),c=(0,helpers_1.getDurationColor)(e.duration),A=p?AppColors_1.AppColors.darkOrange:i?AppColors_1.AppColors.errorColor:AppColors_1.AppColors.greenColor,u=(0,react_1.useRef)(new react_native_1.Animated.Value(r?.35:0)).current;(0,react_1.useEffect)(()=>{r&&react_native_1.Animated.timing(u,{toValue:0,duration:1200,useNativeDriver:!0}).start()},[r,u]);const T=()=>{if(p)return"...";if(e.status===0||e.status==null)return l("network.statusFailed")||"FAILED";const o=typeof e.status=="number"?e.status:parseInt(String(e.status||0),10);return o===200?"200 OK":o===201?"201 Created":o===204?"204 No Content":o===304?"304 Not Modified":o===400?"400 Bad Req":o===401?"401 Unauth":o===403?"403 Forbidden":o===404?"404 Not Found":o===500?"500 Error":String(e.status)},v=()=>{if(p)return<NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.darkOrange}size={10}/>;const o=typeof e.status=="number"?e.status:parseInt(String(e.status||0),10);return o>=200&&o<300?<NetworkIcons_1.CircleCheckIcon color={AppColors_1.AppColors.greenColor}size={10}/>:o>=300&&o<400?<NetworkIcons_1.RepeatIcon color={AppColors_1.AppColors.amber700}size={10}/>:o>=400&&o<500?<NetworkIcons_1.CircleAlertIcon color={AppColors_1.AppColors.darkOrange}size={10}/>:<NetworkIcons_1.CircleXIcon color={AppColors_1.AppColors.errorColor}size={10}/>},m=(0,helpers_1.formatDateTime)(e.startTime),V=e.url.split("?")[0].toLowerCase().endsWith(".json");return<react_native_1.View style={styles.container}>
4
4
  <TouchableScale_1.default testID={b}onPress={t}style={[styles.card,{borderLeftWidth:3.5,borderLeftColor:A,backgroundColor:i?AppColors_1.AppColors.errorCardBg:AppColors_1.AppColors.white}]}>
5
5
  <react_native_1.View style={styles.cardBody}>
6
6
 
@@ -41,13 +41,15 @@ ${e.url}`,[{text:l("common.cancel")||"Cancel",style:"cancel"},{text:"Open in Pos
41
41
  {T()}
42
42
  </react_native_1.Text>
43
43
  </react_native_1.View>
44
- <react_native_1.Pressable onPress={y}hitSlop={8}style={styles.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
44
+ <react_native_1.Pressable onPress={y}hitSlop={{top:6,bottom:6,left:3,right:3}}style={styles.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
45
45
  <NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak}size={12}/>
46
46
  </react_native_1.Pressable>
47
- <react_native_1.Pressable onPress={x}hitSlop={8}style={[styles.globeBtn,{backgroundColor:"rgba(255, 108, 55, 0.12)",borderColor:"rgba(255, 108, 55, 0.28)"}]}accessibilityRole="button"accessibilityLabel="Open with Postman">
47
+ <react_native_1.Pressable onPress={x}hitSlop={{top:6,bottom:6,left:3,right:3}}style={[styles.globeBtn,{backgroundColor:"rgba(255, 108, 55, 0.12)",borderColor:"rgba(255, 108, 55, 0.28)"}]}accessibilityRole="button"accessibilityLabel="Open with Postman">
48
48
  <NetworkIcons_1.PostmanIcon color="#FF6C37"size={11}/>
49
49
  </react_native_1.Pressable>
50
- <NetworkIcons_1.ForwardChevronIcon color={AppColors_1.AppColors.grayTextWeak}size={13}/>
50
+ <react_native_1.View style={styles.chevronWrapper}>
51
+ <NetworkIcons_1.ForwardChevronIcon color={AppColors_1.AppColors.grayTextWeak}size={13}/>
52
+ </react_native_1.View>
51
53
  </react_native_1.View>
52
54
  </react_native_1.View>
53
55
 
@@ -64,7 +66,7 @@ ${e.url}`,[{text:l("common.cancel")||"Cancel",style:"cancel"},{text:"Open in Pos
64
66
  <HighlightText_1.default text={s.host||e.url}search={C}style={styles.hostText}highlightStyle={styles.highlight}numberOfLines={1}ellipsizeMode="tail"/>
65
67
  </react_native_1.View>
66
68
  <react_native_1.View style={styles.urlBadgeRow}>
67
- {S&&<react_native_1.View style={styles.jsonBadge}>
69
+ {V&&<react_native_1.View style={styles.jsonBadge}>
68
70
  <react_native_1.Text style={styles.jsonBadgeText}>.json</react_native_1.Text>
69
71
  </react_native_1.View>}
70
72
  {e.duplicateCount!=null&&e.duplicateCount>1&&<react_native_1.View style={styles.dupBadge}>
@@ -113,4 +115,4 @@ ${e.url}`,[{text:l("common.cancel")||"Cancel",style:"cancel"},{text:"Open in Pos
113
115
 
114
116
  {r&&<react_native_1.Animated.View pointerEvents="none"style={[react_native_1.StyleSheet.absoluteFill,{backgroundColor:f,opacity:u}]}/>}
115
117
  </TouchableScale_1.default>
116
- </react_native_1.View>}const styles=react_native_1.StyleSheet.create({container:{paddingHorizontal:8,paddingVertical:4,height:126,justifyContent:"center"},card:{height:118,alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,shadowColor:AppColors_1.AppColors.shadowColorString},cardBody:{height:"100%",paddingHorizontal:8,paddingTop:8,paddingBottom:6,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:4,gap:4.5,minWidth:0,overflow:"hidden"},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},smallCheckbox:{width:15,height:15,borderRadius:4,borderWidth:1.5,borderColor:AppColors_1.AppColors.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:AppColors_1.AppColors.white},smallCheckboxChecked:{backgroundColor:AppColors_1.AppColors.purple,borderColor:AppColors_1.AppColors.purple},serialNumber:{fontFamily:AppFonts_1.AppFonts.interBold,color:AppColors_1.AppColors.grayTextWeak,fontSize:10},methodBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,lineHeight:12,letterSpacing:.5,color:AppColors_1.AppColors.white},chip:{paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9,lineHeight:12},statusPill:{flexDirection:"row",alignItems:"center",gap:3.5,paddingHorizontal:6,paddingVertical:2,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,lineHeight:12},globeBtn:{padding:3,borderRadius:4,backgroundColor:`${AppColors_1.AppColors.grayTextWeak}12`,alignItems:"center",justifyContent:"center"},urlBox:{backgroundColor:AppColors_1.AppColors.grayBackground,borderRadius:7,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,paddingHorizontal:7,paddingVertical:4.5,height:48,minHeight:48,maxHeight:48,justifyContent:"center",gap:2.5,overflow:"hidden"},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:4,minHeight:16},hostRow:{flexDirection:"row",alignItems:"center",gap:5,flex:1,minWidth:0},protoBadge:{paddingHorizontal:4,paddingVertical:1,borderRadius:3.5,borderWidth:1},protoBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:8,lineHeight:10},hostText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:11.5,lineHeight:15,color:AppColors_1.AppColors.primaryBlack,flex:1},urlBadgeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},jsonBadge:{backgroundColor:`${AppColors_1.AppColors.darkOrange}14`,borderColor:`${AppColors_1.AppColors.darkOrange}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},jsonBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:8.5,color:AppColors_1.AppColors.darkOrange},dupBadge:{backgroundColor:`${AppColors_1.AppColors.purple}14`,borderColor:`${AppColors_1.AppColors.purple}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},dupBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:8.5,color:AppColors_1.AppColors.purple},slugRow:{flexDirection:"row",alignItems:"center",minHeight:15},pathText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:10.5,lineHeight:14,color:AppColors_1.AppColors.slate600||AppColors_1.AppColors.grayText,flex:1},highlight:{backgroundColor:AppColors_1.AppColors.yellowHighlight,color:AppColors_1.AppColors.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:4},footerLeft:{flexDirection:"row",alignItems:"center",gap:4.5,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3.5},cardDateText:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:10,lineHeight:13,color:AppColors_1.AppColors.slate400},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:AppColors_1.AppColors.violetSoftBg,borderColor:AppColors_1.AppColors.violetSoftBorder,borderWidth:1,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:AppFonts_1.AppFonts.interBold,color:AppColors_1.AppColors.violetSoftText,fontSize:9,lineHeight:12},waterfallContainer:{height:2.5,width:"100%",backgroundColor:AppColors_1.AppColors.graySurface,borderRadius:1.5,overflow:"hidden",marginTop:2},waterfallBar:{height:"100%",borderRadius:1.5}});function areLogCardPropsEqual(e,t){return e.item===t.item&&e.isSelected===t.isSelected&&e.isNew===t.isNew&&e.searchStr===t.searchStr&&e.timelineMinStart===t.timelineMinStart&&e.timelineTotalRange===t.timelineTotalRange&&e.onPress===t.onPress&&e.onToggleSelect===t.onToggleSelect}exports.default=react_1.default.memo(LogCard,areLogCardPropsEqual);
118
+ </react_native_1.View>}const styles=react_native_1.StyleSheet.create({container:{paddingHorizontal:8,paddingVertical:4,height:126,justifyContent:"center"},card:{height:118,alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,shadowColor:AppColors_1.AppColors.shadowColorString},cardBody:{height:"100%",paddingHorizontal:8,paddingTop:8,paddingBottom:6,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:4,gap:4.5,minWidth:0,overflow:"hidden"},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:7,flexShrink:0},smallCheckbox:{width:15,height:15,borderRadius:4,borderWidth:1.5,borderColor:AppColors_1.AppColors.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:AppColors_1.AppColors.white},smallCheckboxChecked:{backgroundColor:AppColors_1.AppColors.purple,borderColor:AppColors_1.AppColors.purple},serialNumber:{fontFamily:AppFonts_1.AppFonts.interBold,color:AppColors_1.AppColors.grayTextWeak,fontSize:10},methodBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,lineHeight:12,letterSpacing:.5,color:AppColors_1.AppColors.white},chip:{paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9,lineHeight:12},statusPill:{flexDirection:"row",alignItems:"center",gap:3.5,paddingHorizontal:6,paddingVertical:2,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,lineHeight:12},globeBtn:{width:26,height:22,borderRadius:5,backgroundColor:`${AppColors_1.AppColors.grayTextWeak}14`,borderWidth:1,borderColor:`${AppColors_1.AppColors.grayTextWeak}28`,alignItems:"center",justifyContent:"center"},chevronWrapper:{paddingLeft:2,alignItems:"center",justifyContent:"center"},urlBox:{backgroundColor:AppColors_1.AppColors.grayBackground,borderRadius:7,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,paddingHorizontal:7,paddingVertical:4.5,height:48,minHeight:48,maxHeight:48,justifyContent:"center",gap:2.5,overflow:"hidden"},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:4,minHeight:16},hostRow:{flexDirection:"row",alignItems:"center",gap:5,flex:1,minWidth:0},protoBadge:{paddingHorizontal:4,paddingVertical:1,borderRadius:3.5,borderWidth:1},protoBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:8,lineHeight:10},hostText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:11.5,lineHeight:15,color:AppColors_1.AppColors.primaryBlack,flex:1},urlBadgeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},jsonBadge:{backgroundColor:`${AppColors_1.AppColors.darkOrange}14`,borderColor:`${AppColors_1.AppColors.darkOrange}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},jsonBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:8.5,color:AppColors_1.AppColors.darkOrange},dupBadge:{backgroundColor:`${AppColors_1.AppColors.purple}14`,borderColor:`${AppColors_1.AppColors.purple}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},dupBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:8.5,color:AppColors_1.AppColors.purple},slugRow:{flexDirection:"row",alignItems:"center",minHeight:15},pathText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:10.5,lineHeight:14,color:AppColors_1.AppColors.slate600||AppColors_1.AppColors.grayText,flex:1},highlight:{backgroundColor:AppColors_1.AppColors.yellowHighlight,color:AppColors_1.AppColors.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:4},footerLeft:{flexDirection:"row",alignItems:"center",gap:4.5,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3.5},cardDateText:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:10,lineHeight:13,color:AppColors_1.AppColors.slate400},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:AppColors_1.AppColors.violetSoftBg,borderColor:AppColors_1.AppColors.violetSoftBorder,borderWidth:1,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:AppFonts_1.AppFonts.interBold,color:AppColors_1.AppColors.violetSoftText,fontSize:9,lineHeight:12},waterfallContainer:{height:2.5,width:"100%",backgroundColor:AppColors_1.AppColors.graySurface,borderRadius:1.5,overflow:"hidden",marginTop:2},waterfallBar:{height:"100%",borderRadius:1.5}});function areLogCardPropsEqual(e,t){return e.item===t.item&&e.isSelected===t.isSelected&&e.isNew===t.isNew&&e.searchStr===t.searchStr&&e.timelineMinStart===t.timelineMinStart&&e.timelineTotalRange===t.timelineTotalRange&&e.onPress===t.onPress&&e.onToggleSelect===t.onToggleSelect}exports.default=react_1.default.memo(LogCard,areLogCardPropsEqual);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=exports.DEFAULT_HIDDEN_URL_PATTERNS=exports.DURATION_SLOW_MS=exports.DURATION_FAST_MS=exports.DOMAIN_COLORS=exports.METHOD_COLORS=exports.STATUS_FILTERS=void 0;const AppColors_1=require("../styles/AppColors");exports.STATUS_FILTERS=["ALL","2xx","200","3xx","4xx","400","404","5xx","500","Failed"],exports.METHOD_COLORS={ALL:AppColors_1.AppColors.slate500,GET:AppColors_1.AppColors.emerald600,POST:AppColors_1.AppColors.blue600,PUT:AppColors_1.AppColors.amber600,PATCH:AppColors_1.AppColors.violet600,DELETE:AppColors_1.AppColors.red600,QUERY:AppColors_1.AppColors.sky600,OPTIONS:AppColors_1.AppColors.slate600,HEAD:AppColors_1.AppColors.cyan600},exports.DOMAIN_COLORS=AppColors_1.AppColors.domainColors,exports.DURATION_FAST_MS=200,exports.DURATION_SLOW_MS=800,exports.DEFAULT_HIDDEN_URL_PATTERNS=["https://google-analytics.com/g/collect","https://api.npmjs.org","https://api.github.com","https://registry.npmjs.org"];var version_1=require("./version");Object.defineProperty(exports,"LIB_VERSION",{enumerable:!0,get:function(){return version_1.LIB_VERSION}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=exports.DEFAULT_HIDDEN_URL_PATTERNS=exports.DURATION_SLOW_MS=exports.DURATION_FAST_MS=exports.DOMAIN_COLORS=exports.METHOD_COLORS=exports.STATUS_FILTERS=void 0;const AppColors_1=require("../styles/AppColors");exports.STATUS_FILTERS=["ALL","2xx","200","3xx","4xx","400","404","5xx","500","Failed"],exports.METHOD_COLORS={ALL:AppColors_1.AppColors.slate500,GET:AppColors_1.AppColors.emerald600,POST:AppColors_1.AppColors.blue600,PUT:AppColors_1.AppColors.amber600,PATCH:AppColors_1.AppColors.violet600,DELETE:AppColors_1.AppColors.red600,QUERY:AppColors_1.AppColors.sky600,OPTIONS:AppColors_1.AppColors.slate600,HEAD:AppColors_1.AppColors.cyan600},exports.DOMAIN_COLORS=AppColors_1.AppColors.domainColors,exports.DURATION_FAST_MS=200,exports.DURATION_SLOW_MS=800,exports.DEFAULT_HIDDEN_URL_PATTERNS=["https://google-analytics.com/g/collect","https://api.npmjs.org","https://api.github.com","https://registry.npmjs.org","clients3.google.com"];var version_1=require("./version");Object.defineProperty(exports,"LIB_VERSION",{enumerable:!0,get:function(){return version_1.LIB_VERSION}});
@@ -1,3 +1,3 @@
1
- export declare const ENC_MID = "";
2
- export declare const ENC_SEC = "";
3
- export declare const TELEMETRY_SALT = "";
1
+ export declare const ENC_MID = "df8ace0290a695bd05986213";
2
+ export declare const ENC_SEC = "db93cb0186b1f7bb0ba63a0d0a64997586849455ce37";
3
+ export declare const TELEMETRY_SALT = "rn-inapp-inspector-telemetry-v1";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TELEMETRY_SALT=exports.ENC_SEC=exports.ENC_MID=void 0,exports.ENC_MID="",exports.ENC_SEC="",exports.TELEMETRY_SALT="";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TELEMETRY_SALT=exports.ENC_SEC=exports.ENC_MID=void 0,exports.ENC_MID="df8ace0290a695bd05986213",exports.ENC_SEC="db93cb0186b1f7bb0ba63a0d0a64997586849455ce37",exports.TELEMETRY_SALT="rn-inapp-inspector-telemetry-v1";
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "2.5.12";
1
+ export declare const LIB_VERSION = "2.5.13";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.5.12";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.5.13";
@@ -37,7 +37,7 @@ export declare const getCrashRecords: () => CrashRecord[];
37
37
  export declare const clearCrashRecords: () => void;
38
38
  export declare const subscribeCrashEvents: (listener: CrashListener) => (() => void);
39
39
  export declare const emitCrashEvent: (payload: CrashEventPayload) => void;
40
- export declare const handleInterceptedCrash: (errorOrTitle: any, rawStack?: any, isFatal?: boolean, customType?: CrashType, componentStack?: string) => CrashRecord;
40
+ export declare const handleInterceptedCrash: (errorOrTitle: any, rawStack?: any, isFatal?: boolean, customType?: CrashType, componentStack?: string, bypassIgnoredCheck?: boolean) => CrashRecord;
41
41
  export declare const recordCustomCrash: (error: Error | string, options?: {
42
42
  isFatal?: boolean;
43
43
  type?: CrashType;
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setupGlobalCrashHandler=exports.exportCrashReport=exports.simulateTestCrash=exports.triggerGlobalCrashScreen=exports.recordCustomCrash=exports.handleInterceptedCrash=exports.emitCrashEvent=exports.subscribeCrashEvents=exports.clearCrashRecords=exports.getCrashRecords=exports.computeCrashFingerprint=exports.parseCrashStackTrace=exports.getCrashBreadcrumbs=exports.clearCrashBreadcrumbs=exports.recordUserActionBreadcrumb=exports.recordReduxBreadcrumb=exports.recordNetworkBreadcrumb=exports.recordNavigationBreadcrumb=exports.addCrashBreadcrumb=exports.pruneCrashRecords=exports.getMaxCrashLogsLimit=exports.setMaxCrashLogsLimit=exports.getCrashModuleEnabled=exports.setCrashModuleEnabled=exports.applyCrashPolicyPreset=exports.setCrashThrottleDuplicatesConfig=exports.getCrashModalTriggerPolicyConfig=exports.setCrashModalTriggerPolicyConfig=exports.getCrashIgnoredTypesConfig=exports.setCrashIgnoredTypesConfig=exports.DEFAULT_CRASH_IGNORED_TYPES=exports.CrashExportFormat=void 0;const react_native_1=require("react-native"),enums_1=require("../types/enums");Object.defineProperty(exports,"CrashExportFormat",{enumerable:!0,get:function(){return enums_1.CrashExportFormat}});const consoleLogger_1=require("./consoleLogger"),NativeInspector_1=require("../native/NativeInspector"),i18n_1=require("../i18n");exports.DEFAULT_CRASH_IGNORED_TYPES={js:!0,native:!1,render:!0,promise:!1,custom:!1};let crashListeners=[],isCrashHandlerInitialized=!1,lastHandledErrorTimestamp=0,lastHandledErrorFingerprint="",crashRecordsStore=[],breadcrumbsStore=[];const MAX_BREADCRUMBS=50;let maxStoredCrashes=100;const appStartTime=Date.now();let isCrashModuleEnabled=!1,crashIgnoredTypesConfig={...exports.DEFAULT_CRASH_IGNORED_TYPES},crashModalTriggerPolicyConfig="fatal_only",crashThrottleDuplicatesConfig=!0;const setCrashIgnoredTypesConfig=e=>{crashIgnoredTypesConfig={...crashIgnoredTypesConfig,...e}};exports.setCrashIgnoredTypesConfig=setCrashIgnoredTypesConfig;const getCrashIgnoredTypesConfig=()=>({...crashIgnoredTypesConfig});exports.getCrashIgnoredTypesConfig=getCrashIgnoredTypesConfig;const setCrashModalTriggerPolicyConfig=e=>{crashModalTriggerPolicyConfig=e};exports.setCrashModalTriggerPolicyConfig=setCrashModalTriggerPolicyConfig;const getCrashModalTriggerPolicyConfig=()=>crashModalTriggerPolicyConfig;exports.getCrashModalTriggerPolicyConfig=getCrashModalTriggerPolicyConfig;const setCrashThrottleDuplicatesConfig=e=>{crashThrottleDuplicatesConfig=e};exports.setCrashThrottleDuplicatesConfig=setCrashThrottleDuplicatesConfig;const applyCrashPolicyPreset=e=>{switch(e){case"max_shield":crashIgnoredTypesConfig={js:!1,native:!1,render:!1,promise:!1,custom:!1};break;case"silent":crashIgnoredTypesConfig={js:!0,native:!0,render:!0,promise:!0,custom:!0};break;default:crashIgnoredTypesConfig={...exports.DEFAULT_CRASH_IGNORED_TYPES};break}return{...crashIgnoredTypesConfig}};exports.applyCrashPolicyPreset=applyCrashPolicyPreset;const setCrashModuleEnabled=e=>{isCrashModuleEnabled=e};exports.setCrashModuleEnabled=setCrashModuleEnabled;const getCrashModuleEnabled=()=>isCrashModuleEnabled;exports.getCrashModuleEnabled=getCrashModuleEnabled;const setMaxCrashLogsLimit=e=>{maxStoredCrashes=Math.max(10,e),crashRecordsStore.length>maxStoredCrashes&&(crashRecordsStore=crashRecordsStore.slice(0,maxStoredCrashes))};exports.setMaxCrashLogsLimit=setMaxCrashLogsLimit;const getMaxCrashLogsLimit=()=>maxStoredCrashes;exports.getMaxCrashLogsLimit=getMaxCrashLogsLimit;const pruneCrashRecords=e=>{const r=e!==void 0?Math.max(0,e):Math.floor(crashRecordsStore.length/2),o=crashRecordsStore.length-r;return o>0&&(crashRecordsStore=crashRecordsStore.slice(0,r)),breadcrumbsStore.length>20&&(breadcrumbsStore=breadcrumbsStore.slice(0,20)),Math.max(0,o)};exports.pruneCrashRecords=pruneCrashRecords;const addCrashBreadcrumb=(e,r,o)=>{if(isCrashModuleEnabled)try{const s={type:e,message:r,timestamp:Date.now(),data:o};breadcrumbsStore.unshift(s),breadcrumbsStore.length>MAX_BREADCRUMBS&&(breadcrumbsStore=breadcrumbsStore.slice(0,MAX_BREADCRUMBS))}catch{}};exports.addCrashBreadcrumb=addCrashBreadcrumb;const recordNavigationBreadcrumb=(e,r)=>{(0,exports.addCrashBreadcrumb)("navigation",(0,i18n_1.t)("crash.breadcrumbNavigation",{from:e||"/",to:r||"/"}),{from:e,to:r})};exports.recordNavigationBreadcrumb=recordNavigationBreadcrumb;const recordNetworkBreadcrumb=(e,r,o,s)=>{const t=o!=null?` [${o}]`:"",a=s!=null?` (${Math.round(s)}ms)`:"";(0,exports.addCrashBreadcrumb)("network",`${r.toUpperCase()} ${e}${t}${a}`,{url:e,method:r,status:o,duration:s})};exports.recordNetworkBreadcrumb=recordNetworkBreadcrumb;const recordReduxBreadcrumb=(e,r)=>{(0,exports.addCrashBreadcrumb)("redux",(0,i18n_1.t)("crash.breadcrumbAction",{actionType:e}),{type:e,payloadSummary:typeof r=="object"&&r!==null?Object.keys(r):typeof r})};exports.recordReduxBreadcrumb=recordReduxBreadcrumb;const recordUserActionBreadcrumb=(e,r)=>{(0,exports.addCrashBreadcrumb)("user",e,r)};exports.recordUserActionBreadcrumb=recordUserActionBreadcrumb;const clearCrashBreadcrumbs=()=>{breadcrumbsStore=[]};exports.clearCrashBreadcrumbs=clearCrashBreadcrumbs;const getCrashBreadcrumbs=()=>[...breadcrumbsStore];exports.getCrashBreadcrumbs=getCrashBreadcrumbs;const parseCrashStackTrace=e=>{if(!e||typeof e!="string")return[];const r=e.split(`
2
- `),o=[];for(const s of r){const t=s.trim();if(!t||t.includes("crashHandler.ts")||t.includes("handleInterceptedCrash")||t.includes("addLogFromCrash")||t.includes("setupGlobalCrashHandler"))continue;const a=t.match(/^([^@]+)@(.*):(\d+):(\d+)$/);if(a){const[,i,n,u,h]=a,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("hermes")&&!n.includes("internal");o.push({method:i.trim(),file:m,lineNumber:parseInt(u,10),column:parseInt(h,10),raw:t,isAppCode:f});continue}const p=t.match(/^at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);if(p){const[,i,n,u,h]=p,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("internal");o.push({method:i.trim(),file:m,lineNumber:parseInt(u,10),column:parseInt(h,10),raw:t,isAppCode:f});continue}const d=t.match(/^at\s+(.+):(\d+):(\d+)$/);if(d){const[,i,n,u]=d,h=i.split("?")[0].split("/").pop()||i,m=!i.includes("node_modules")&&!i.includes("react-native");o.push({method:"<anonymous>",file:h,lineNumber:parseInt(n,10),column:parseInt(u,10),raw:t,isAppCode:m});continue}const l=t.match(/^at\s+([a-zA-Z0-9_$.]+)\(([a-zA-Z0-9_$]+\.java):(\d+)\)$/);if(l){const[,i,n,u]=l,h=!i.startsWith("com.facebook.react")&&!i.startsWith("android.");o.push({method:i,file:n,lineNumber:parseInt(u,10),column:0,raw:t,isAppCode:h});continue}const c=t.match(/^\d+\s+([^\s]+)\s+(0x[0-9a-fA-F]+)\s+(.+)$/);if(c){const[,i,,n]=c,u=!i.startsWith("lib")&&!i.startsWith("Core")&&!i.startsWith("React");o.push({method:n,file:i,lineNumber:0,column:0,raw:t,isAppCode:u});continue}o.push({method:t.startsWith("at ")?t.slice(3):t,file:"runtime",lineNumber:0,column:0,raw:t,isAppCode:!1})}return o};exports.parseCrashStackTrace=parseCrashStackTrace;const getMemoryDiagnostics=()=>{try{const e=globalThis.performance;if(e&&e.memory)return{usedJSHeapSize:Math.round(e.memory.usedJSHeapSize/(1024*1024)),totalJSHeapSize:Math.round(e.memory.totalJSHeapSize/(1024*1024))}}catch{}},getScreenDimensions=()=>{try{const e=react_native_1.Dimensions.get("window");return`${Math.round(e.width)}x${Math.round(e.height)} (${e.scale}x)`}catch{return(0,i18n_1.t)("crash.unknown")}},computeCrashFingerprint=e=>{const r=e.type||"js",o=e.name||"Error",s=e.parsedStack&&e.parsedStack.length>0?e.parsedStack[0]:null,t=s?`${s.file}:${s.lineNumber}`:"unknown";return`${r}_${o}_${t}`};exports.computeCrashFingerprint=computeCrashFingerprint;const getCrashRecords=()=>[...crashRecordsStore];exports.getCrashRecords=getCrashRecords;const clearCrashRecords=()=>{crashRecordsStore=[],(0,exports.emitCrashEvent)({error:null,message:"__CLEARED__",timestamp:Date.now()})};exports.clearCrashRecords=clearCrashRecords;const subscribeCrashEvents=e=>(crashListeners.push(e),()=>{crashListeners=crashListeners.filter(r=>r!==e)});exports.subscribeCrashEvents=subscribeCrashEvents;const emitCrashEvent=e=>{if(e.message!=="__CLEARED__"){const r=Date.now();if(r-lastHandledErrorTimestamp<250)return;lastHandledErrorTimestamp=r}crashListeners.forEach(r=>{try{r(e)}catch{}})};exports.emitCrashEvent=emitCrashEvent;const handleInterceptedCrash=(e,r,o=!1,s,t)=>{try{const a=e instanceof Error||typeof e=="object"&&e!==null?e:new Error(String(e||(0,i18n_1.t)("crash.runtimeException"))),p=a.message||(typeof e=="string"?e:(0,i18n_1.t)("crash.runtimeException"));let d="";typeof r=="string"?d=r:Array.isArray(r)?d=r.map(C=>`at ${C.methodName||"<anonymous>"} (${C.file||"unknown"}:${C.lineNumber||0}:${C.column||0})`).join(`
3
- `):d=a.stack||new Error().stack||"";let l=s||enums_1.CrashType.Js;const c=p.toLowerCase();if(s||(c.includes("native")||c.includes("sigsegv")||c.includes("nsrange")||c.includes("nullpointerexception")||c.includes("fatal signal")?l=enums_1.CrashType.Native:c.includes("promise")||c.includes("unhandled rejection")||c.includes("unhandledrejection")?l=enums_1.CrashType.Promise:c.includes("render")||c.includes("errorboundary")||t?l=enums_1.CrashType.Render:l=enums_1.CrashType.Js),!!crashIgnoredTypesConfig[l])return{id:`crash_ignored_${Date.now()}`,isFatal:o,type:l,message:p,timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()};const n=new Date,u=n.toLocaleDateString(),h=n.toLocaleTimeString(),m=(0,exports.parseCrashStackTrace)(d),f=`${l}_${p}_${d.slice(0,80)}`,b=Date.now();if(crashThrottleDuplicatesConfig&&f===lastHandledErrorFingerprint&&b-lastHandledErrorTimestamp<500)return crashRecordsStore.length>0&&(crashRecordsStore[0].duplicateCount=(crashRecordsStore[0].duplicateCount||1)+1),crashRecordsStore[0];lastHandledErrorFingerprint=f,lastHandledErrorTimestamp=b;const y=(0,consoleLogger_1.addLogFromCrash)(a,`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${p}`,d,o),$=typeof globalThis.HermesInternal<"u",S=typeof globalThis.nativeFabricUIManager<"u",x={id:`crash_${Date.now()}_${Math.random().toString(36).substr(2,6)}`,error:a,isFatal:o,type:l,message:p,name:a.name||(o?(0,i18n_1.t)("crash.errorNameFatal"):(0,i18n_1.t)("crash.errorNameUnhandled")),stack:d,parsedStack:m,componentStack:t||void 0,timestamp:Date.now(),dateStr:u,timeStr:h,deviceInfo:{platform:react_native_1.Platform.OS,osVersion:String(react_native_1.Platform.Version),rnVersion:react_native_1.Platform.constants?.reactNativeVersion?`${react_native_1.Platform.constants.reactNativeVersion.major}.${react_native_1.Platform.constants.reactNativeVersion.minor}.${react_native_1.Platform.constants.reactNativeVersion.patch}`:(0,i18n_1.t)("crash.unknown"),isHermes:$,isFabric:S,appState:react_native_1.AppState.currentState||"active"},memoryInfo:getMemoryDiagnostics(),breadcrumbs:[...breadcrumbsStore],logId:y?.id};crashRecordsStore.unshift(x),crashRecordsStore.length>maxStoredCrashes&&(crashRecordsStore=crashRecordsStore.slice(0,maxStoredCrashes));let g=!1;crashModalTriggerPolicyConfig==="all_errors"?g=!0:crashModalTriggerPolicyConfig==="fatal_only"?g=o||l===enums_1.CrashType.Native:crashModalTriggerPolicyConfig==="silent_tab_only"&&(g=!1),(0,exports.emitCrashEvent)({error:a,isFatal:o,message:`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${p}`,stack:d,timestamp:Date.now(),logId:y?.id,crashRecord:x,shouldShowModal:g});try{(0,NativeInspector_1.showNativeFloatingButton)(),(0,NativeInspector_1.setNativeFloatingButtonBadge)(!0)}catch{}return x}catch{return{id:`crash_${Date.now()}`,isFatal:!0,type:enums_1.CrashType.Js,message:String(e||(0,i18n_1.t)("crash.unknownException")),timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()}}};exports.handleInterceptedCrash=handleInterceptedCrash;const recordCustomCrash=(e,r)=>(0,exports.handleInterceptedCrash)(e,typeof e=="object"?e.stack:void 0,r?.isFatal??!1,r?.type||enums_1.CrashType.Custom,r?.componentStack);exports.recordCustomCrash=recordCustomCrash;const triggerGlobalCrashScreen=e=>{(0,exports.emitCrashEvent)({error:e.error||new Error(e.message),isFatal:!0,message:e.message,stack:e.stack,timestamp:e.timestamp||Date.now(),logId:e.logId,crashRecord:e})};exports.triggerGlobalCrashScreen=triggerGlobalCrashScreen;const simulateTestCrash=(e=enums_1.CrashType.Js,r,o,s=!0)=>{const t=new Error(r||_defaultSimMessage(e));return(0,exports.handleInterceptedCrash)(e===enums_1.CrashType.Native?t.message:t,o||t.stack,s,e,e===enums_1.CrashType.Render?_buildComponentStack():void 0)};exports.simulateTestCrash=simulateTestCrash;const _defaultSimMessage=e=>{switch(e){case"native":return(0,i18n_1.t)("crash.simNativeMessage");case"promise":return(0,i18n_1.t)("crash.simPromiseMessage");case"render":return(0,i18n_1.t)("crash.simRenderMessage");default:return(0,i18n_1.t)("crash.simJsMessage")}},_buildComponentStack=()=>{try{const e=new Error;if(e.stack)return e.stack.split(`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setupGlobalCrashHandler=exports.exportCrashReport=exports.simulateTestCrash=exports.triggerGlobalCrashScreen=exports.recordCustomCrash=exports.handleInterceptedCrash=exports.emitCrashEvent=exports.subscribeCrashEvents=exports.clearCrashRecords=exports.getCrashRecords=exports.computeCrashFingerprint=exports.parseCrashStackTrace=exports.getCrashBreadcrumbs=exports.clearCrashBreadcrumbs=exports.recordUserActionBreadcrumb=exports.recordReduxBreadcrumb=exports.recordNetworkBreadcrumb=exports.recordNavigationBreadcrumb=exports.addCrashBreadcrumb=exports.pruneCrashRecords=exports.getMaxCrashLogsLimit=exports.setMaxCrashLogsLimit=exports.getCrashModuleEnabled=exports.setCrashModuleEnabled=exports.applyCrashPolicyPreset=exports.setCrashThrottleDuplicatesConfig=exports.getCrashModalTriggerPolicyConfig=exports.setCrashModalTriggerPolicyConfig=exports.getCrashIgnoredTypesConfig=exports.setCrashIgnoredTypesConfig=exports.DEFAULT_CRASH_IGNORED_TYPES=exports.CrashExportFormat=void 0;const react_native_1=require("react-native"),enums_1=require("../types/enums");Object.defineProperty(exports,"CrashExportFormat",{enumerable:!0,get:function(){return enums_1.CrashExportFormat}});const consoleLogger_1=require("./consoleLogger"),NativeInspector_1=require("../native/NativeInspector"),i18n_1=require("../i18n");exports.DEFAULT_CRASH_IGNORED_TYPES={js:!0,native:!1,render:!0,promise:!1,custom:!1};let crashListeners=[],isCrashHandlerInitialized=!1,lastHandledErrorTimestamp=0,lastHandledErrorFingerprint="",crashRecordsStore=[],breadcrumbsStore=[];const MAX_BREADCRUMBS=50;let maxStoredCrashes=100;const appStartTime=Date.now();let isCrashModuleEnabled=!1,crashIgnoredTypesConfig={...exports.DEFAULT_CRASH_IGNORED_TYPES},crashModalTriggerPolicyConfig="fatal_only",crashThrottleDuplicatesConfig=!0;const setCrashIgnoredTypesConfig=e=>{crashIgnoredTypesConfig={...crashIgnoredTypesConfig,...e}};exports.setCrashIgnoredTypesConfig=setCrashIgnoredTypesConfig;const getCrashIgnoredTypesConfig=()=>({...crashIgnoredTypesConfig});exports.getCrashIgnoredTypesConfig=getCrashIgnoredTypesConfig;const setCrashModalTriggerPolicyConfig=e=>{crashModalTriggerPolicyConfig=e};exports.setCrashModalTriggerPolicyConfig=setCrashModalTriggerPolicyConfig;const getCrashModalTriggerPolicyConfig=()=>crashModalTriggerPolicyConfig;exports.getCrashModalTriggerPolicyConfig=getCrashModalTriggerPolicyConfig;const setCrashThrottleDuplicatesConfig=e=>{crashThrottleDuplicatesConfig=e};exports.setCrashThrottleDuplicatesConfig=setCrashThrottleDuplicatesConfig;const applyCrashPolicyPreset=e=>{switch(e){case"max_shield":crashIgnoredTypesConfig={js:!1,native:!1,render:!1,promise:!1,custom:!1};break;case"silent":crashIgnoredTypesConfig={js:!0,native:!0,render:!0,promise:!0,custom:!0};break;default:crashIgnoredTypesConfig={...exports.DEFAULT_CRASH_IGNORED_TYPES};break}return{...crashIgnoredTypesConfig}};exports.applyCrashPolicyPreset=applyCrashPolicyPreset;const setCrashModuleEnabled=e=>{isCrashModuleEnabled=e};exports.setCrashModuleEnabled=setCrashModuleEnabled;const getCrashModuleEnabled=()=>isCrashModuleEnabled;exports.getCrashModuleEnabled=getCrashModuleEnabled;const setMaxCrashLogsLimit=e=>{maxStoredCrashes=Math.max(10,e),crashRecordsStore.length>maxStoredCrashes&&(crashRecordsStore=crashRecordsStore.slice(0,maxStoredCrashes))};exports.setMaxCrashLogsLimit=setMaxCrashLogsLimit;const getMaxCrashLogsLimit=()=>maxStoredCrashes;exports.getMaxCrashLogsLimit=getMaxCrashLogsLimit;const pruneCrashRecords=e=>{const r=e!==void 0?Math.max(0,e):Math.floor(crashRecordsStore.length/2),o=crashRecordsStore.length-r;return o>0&&(crashRecordsStore=crashRecordsStore.slice(0,r)),breadcrumbsStore.length>20&&(breadcrumbsStore=breadcrumbsStore.slice(0,20)),Math.max(0,o)};exports.pruneCrashRecords=pruneCrashRecords;const addCrashBreadcrumb=(e,r,o)=>{if(isCrashModuleEnabled)try{const s={type:e,message:r,timestamp:Date.now(),data:o};breadcrumbsStore.unshift(s),breadcrumbsStore.length>MAX_BREADCRUMBS&&(breadcrumbsStore=breadcrumbsStore.slice(0,MAX_BREADCRUMBS))}catch{}};exports.addCrashBreadcrumb=addCrashBreadcrumb;const recordNavigationBreadcrumb=(e,r)=>{(0,exports.addCrashBreadcrumb)("navigation",(0,i18n_1.t)("crash.breadcrumbNavigation",{from:e||"/",to:r||"/"}),{from:e,to:r})};exports.recordNavigationBreadcrumb=recordNavigationBreadcrumb;const recordNetworkBreadcrumb=(e,r,o,s)=>{const t=o!=null?` [${o}]`:"",i=s!=null?` (${Math.round(s)}ms)`:"";(0,exports.addCrashBreadcrumb)("network",`${r.toUpperCase()} ${e}${t}${i}`,{url:e,method:r,status:o,duration:s})};exports.recordNetworkBreadcrumb=recordNetworkBreadcrumb;const recordReduxBreadcrumb=(e,r)=>{(0,exports.addCrashBreadcrumb)("redux",(0,i18n_1.t)("crash.breadcrumbAction",{actionType:e}),{type:e,payloadSummary:typeof r=="object"&&r!==null?Object.keys(r):typeof r})};exports.recordReduxBreadcrumb=recordReduxBreadcrumb;const recordUserActionBreadcrumb=(e,r)=>{(0,exports.addCrashBreadcrumb)("user",e,r)};exports.recordUserActionBreadcrumb=recordUserActionBreadcrumb;const clearCrashBreadcrumbs=()=>{breadcrumbsStore=[]};exports.clearCrashBreadcrumbs=clearCrashBreadcrumbs;const getCrashBreadcrumbs=()=>[...breadcrumbsStore];exports.getCrashBreadcrumbs=getCrashBreadcrumbs;const parseCrashStackTrace=e=>{if(!e||typeof e!="string")return[];const r=e.split(`
2
+ `),o=[];for(const s of r){const t=s.trim();if(!t||t.includes("crashHandler.ts")||t.includes("handleInterceptedCrash")||t.includes("addLogFromCrash")||t.includes("setupGlobalCrashHandler"))continue;const i=t.match(/^([^@]+)@(.*):(\d+):(\d+)$/);if(i){const[,a,n,d,h]=i,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("hermes")&&!n.includes("internal");o.push({method:a.trim(),file:m,lineNumber:parseInt(d,10),column:parseInt(h,10),raw:t,isAppCode:f});continue}const c=t.match(/^at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);if(c){const[,a,n,d,h]=c,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("internal");o.push({method:a.trim(),file:m,lineNumber:parseInt(d,10),column:parseInt(h,10),raw:t,isAppCode:f});continue}const u=t.match(/^at\s+(.+):(\d+):(\d+)$/);if(u){const[,a,n,d]=u,h=a.split("?")[0].split("/").pop()||a,m=!a.includes("node_modules")&&!a.includes("react-native");o.push({method:"<anonymous>",file:h,lineNumber:parseInt(n,10),column:parseInt(d,10),raw:t,isAppCode:m});continue}const l=t.match(/^at\s+([a-zA-Z0-9_$.]+)\(([a-zA-Z0-9_$]+\.java):(\d+)\)$/);if(l){const[,a,n,d]=l,h=!a.startsWith("com.facebook.react")&&!a.startsWith("android.");o.push({method:a,file:n,lineNumber:parseInt(d,10),column:0,raw:t,isAppCode:h});continue}const p=t.match(/^\d+\s+([^\s]+)\s+(0x[0-9a-fA-F]+)\s+(.+)$/);if(p){const[,a,,n]=p,d=!a.startsWith("lib")&&!a.startsWith("Core")&&!a.startsWith("React");o.push({method:n,file:a,lineNumber:0,column:0,raw:t,isAppCode:d});continue}o.push({method:t.startsWith("at ")?t.slice(3):t,file:"runtime",lineNumber:0,column:0,raw:t,isAppCode:!1})}return o};exports.parseCrashStackTrace=parseCrashStackTrace;const getMemoryDiagnostics=()=>{try{const e=globalThis.performance;if(e&&e.memory)return{usedJSHeapSize:Math.round(e.memory.usedJSHeapSize/(1024*1024)),totalJSHeapSize:Math.round(e.memory.totalJSHeapSize/(1024*1024))}}catch{}},getScreenDimensions=()=>{try{const e=react_native_1.Dimensions.get("window");return`${Math.round(e.width)}x${Math.round(e.height)} (${e.scale}x)`}catch{return(0,i18n_1.t)("crash.unknown")}},computeCrashFingerprint=e=>{const r=e.type||"js",o=e.name||"Error",s=e.parsedStack&&e.parsedStack.length>0?e.parsedStack[0]:null,t=s?`${s.file}:${s.lineNumber}`:"unknown";return`${r}_${o}_${t}`};exports.computeCrashFingerprint=computeCrashFingerprint;const getCrashRecords=()=>[...crashRecordsStore];exports.getCrashRecords=getCrashRecords;const clearCrashRecords=()=>{crashRecordsStore=[],(0,exports.emitCrashEvent)({error:null,message:"__CLEARED__",timestamp:Date.now()})};exports.clearCrashRecords=clearCrashRecords;const subscribeCrashEvents=e=>(crashListeners.push(e),()=>{crashListeners=crashListeners.filter(r=>r!==e)});exports.subscribeCrashEvents=subscribeCrashEvents;const emitCrashEvent=e=>{if(e.message!=="__CLEARED__"){const r=Date.now();if(r-lastHandledErrorTimestamp<250)return;lastHandledErrorTimestamp=r}crashListeners.forEach(r=>{try{r(e)}catch{}})};exports.emitCrashEvent=emitCrashEvent;const handleInterceptedCrash=(e,r,o=!1,s,t,i=!1)=>{try{const c=e instanceof Error||typeof e=="object"&&e!==null?e:new Error(String(e||(0,i18n_1.t)("crash.runtimeException"))),u=c.message||(typeof e=="string"?e:(0,i18n_1.t)("crash.runtimeException"));let l="";typeof r=="string"?l=r:Array.isArray(r)?l=r.map(g=>`at ${g.methodName||"<anonymous>"} (${g.file||"unknown"}:${g.lineNumber||0}:${g.column||0})`).join(`
3
+ `):l=c.stack||new Error().stack||"";let p=s||enums_1.CrashType.Js;const a=u.toLowerCase();if(s||(a.includes("native")||a.includes("sigsegv")||a.includes("nsrange")||a.includes("nullpointerexception")||a.includes("fatal signal")?p=enums_1.CrashType.Native:a.includes("promise")||a.includes("unhandled rejection")||a.includes("unhandledrejection")?p=enums_1.CrashType.Promise:a.includes("render")||a.includes("errorboundary")||t?p=enums_1.CrashType.Render:p=enums_1.CrashType.Js),!i&&!!crashIgnoredTypesConfig[p])return{id:`crash_ignored_${Date.now()}`,isFatal:o,type:p,message:u,timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()};const n=new Date,d=n.toLocaleDateString(),h=n.toLocaleTimeString(),m=(0,exports.parseCrashStackTrace)(l),f=`${p}_${u}_${l.slice(0,80)}`,b=Date.now();if(crashThrottleDuplicatesConfig&&f===lastHandledErrorFingerprint&&b-lastHandledErrorTimestamp<500)return crashRecordsStore.length>0&&(crashRecordsStore[0].duplicateCount=(crashRecordsStore[0].duplicateCount||1)+1),crashRecordsStore[0];lastHandledErrorFingerprint=f,lastHandledErrorTimestamp=b;const y=(0,consoleLogger_1.addLogFromCrash)(c,`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${u}`,l,o),$=typeof globalThis.HermesInternal<"u",S=typeof globalThis.nativeFabricUIManager<"u",x={id:`crash_${Date.now()}_${Math.random().toString(36).substr(2,6)}`,error:c,isFatal:o,type:p,message:u,name:c.name||(o?(0,i18n_1.t)("crash.errorNameFatal"):(0,i18n_1.t)("crash.errorNameUnhandled")),stack:l,parsedStack:m,componentStack:t||void 0,timestamp:Date.now(),dateStr:d,timeStr:h,deviceInfo:{platform:react_native_1.Platform.OS,osVersion:String(react_native_1.Platform.Version),rnVersion:react_native_1.Platform.constants?.reactNativeVersion?`${react_native_1.Platform.constants.reactNativeVersion.major}.${react_native_1.Platform.constants.reactNativeVersion.minor}.${react_native_1.Platform.constants.reactNativeVersion.patch}`:(0,i18n_1.t)("crash.unknown"),isHermes:$,isFabric:S,appState:react_native_1.AppState.currentState||"active"},memoryInfo:getMemoryDiagnostics(),breadcrumbs:[...breadcrumbsStore],logId:y?.id};crashRecordsStore.unshift(x),crashRecordsStore.length>maxStoredCrashes&&(crashRecordsStore=crashRecordsStore.slice(0,maxStoredCrashes));let C=!1;crashModalTriggerPolicyConfig==="all_errors"?C=!0:crashModalTriggerPolicyConfig==="fatal_only"?C=o||p===enums_1.CrashType.Native:crashModalTriggerPolicyConfig==="silent_tab_only"&&(C=!1),(0,exports.emitCrashEvent)({error:c,isFatal:o,message:`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${u}`,stack:l,timestamp:Date.now(),logId:y?.id,crashRecord:x,shouldShowModal:C});try{(0,NativeInspector_1.showNativeFloatingButton)(),(0,NativeInspector_1.setNativeFloatingButtonBadge)(!0)}catch{}return x}catch{return{id:`crash_${Date.now()}`,isFatal:!0,type:enums_1.CrashType.Js,message:String(e||(0,i18n_1.t)("crash.unknownException")),timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()}}};exports.handleInterceptedCrash=handleInterceptedCrash;const recordCustomCrash=(e,r)=>(0,exports.handleInterceptedCrash)(e,typeof e=="object"?e.stack:void 0,r?.isFatal??!1,r?.type||enums_1.CrashType.Custom,r?.componentStack);exports.recordCustomCrash=recordCustomCrash;const triggerGlobalCrashScreen=e=>{(0,exports.emitCrashEvent)({error:e.error||new Error(e.message),isFatal:!0,message:e.message,stack:e.stack,timestamp:e.timestamp||Date.now(),logId:e.logId,crashRecord:e})};exports.triggerGlobalCrashScreen=triggerGlobalCrashScreen;const simulateTestCrash=(e=enums_1.CrashType.Js,r,o,s=!0)=>{const t=new Error(r||_defaultSimMessage(e));return(0,exports.handleInterceptedCrash)(e===enums_1.CrashType.Native?t.message:t,o||t.stack,s,e,e===enums_1.CrashType.Render?_buildComponentStack():void 0,!0)};exports.simulateTestCrash=simulateTestCrash;const _defaultSimMessage=e=>{switch(e){case"native":return(0,i18n_1.t)("crash.simNativeMessage");case"promise":return(0,i18n_1.t)("crash.simPromiseMessage");case"render":return(0,i18n_1.t)("crash.simRenderMessage");default:return(0,i18n_1.t)("crash.simJsMessage")}},_buildComponentStack=()=>{try{const e=new Error;if(e.stack)return e.stack.split(`
4
4
  `).slice(1,6).map(r=>` ${r.trim()}`).join(`
5
- `)}catch{}},exportCrashReport=(e,r="text")=>{if(r==="json")return JSON.stringify(e,null,2);const o=Math.round((e.timestamp-appStartTime)/1e3);if(r==="markdown"){const t=[];return t.push(`## ${(0,i18n_1.t)("crash.mdReportTitle",{name:e.name||"Error"})}`),t.push(`> **${e.message}**`),t.push(""),t.push(`- **${(0,i18n_1.t)("crash.reportType")}** \`${e.type.toUpperCase()}\``),t.push(`- **${(0,i18n_1.t)("crash.reportFatal")}** \`${e.isFatal?(0,i18n_1.t)("crash.mdSeverityFatal"):(0,i18n_1.t)("crash.mdSeverityHandled")}\``),t.push(`- **${(0,i18n_1.t)("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),t.push(`- **${(0,i18n_1.t)("crash.reportUptime")}** ${o}s`),t.push(`- **${(0,i18n_1.t)("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),t.push(`- **${(0,i18n_1.t)("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),t.push(`- **${(0,i18n_1.t)("crash.jsEngine")}** ${e.deviceInfo?.isHermes?(0,i18n_1.t)("crash.hermesEngine"):(0,i18n_1.t)("crash.jsc")}`),t.push(`- **${(0,i18n_1.t)("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?(0,i18n_1.t)("crash.reportFabricNew"):(0,i18n_1.t)("crash.reportPaperLegacy")}`),e.memoryInfo&&t.push(`- **${(0,i18n_1.t)("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),t.push(""),t.push(`### ${(0,i18n_1.t)("crash.mdStackTrace")}`),t.push("```"),t.push(e.stack||(0,i18n_1.t)("crash.reportNoStackTrace")),t.push("```"),e.componentStack&&(t.push(""),t.push(`### ${(0,i18n_1.t)("crash.mdComponentHierarchy")}`),t.push("```"),t.push(e.componentStack),t.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(""),t.push(`### ${(0,i18n_1.t)("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(a=>{const p=new Date(a.timestamp).toLocaleTimeString();t.push(`- \`[${p}]\` **[${a.type.toUpperCase()}]** ${a.message}`)})),t.join(`
6
- `)}const s=[];return s.push("===================================================="),s.push(` ${(0,i18n_1.t)("crash.reportTitle")} `),s.push("===================================================="),s.push(`${(0,i18n_1.t)("crash.reportErrorName")} ${e.name||"Error"}`),s.push(`${(0,i18n_1.t)("crash.reportMessage")} ${e.message}`),s.push(`${(0,i18n_1.t)("crash.reportType")} ${e.type.toUpperCase()}`),s.push(`${(0,i18n_1.t)("crash.reportFatal")} ${e.isFatal?(0,i18n_1.t)("crash.reportFatalYes"):(0,i18n_1.t)("crash.reportFatalNo")}`),s.push(`${(0,i18n_1.t)("crash.reportTimestamp")} ${e.dateStr} ${e.timeStr} (${e.timestamp})`),s.push(`${(0,i18n_1.t)("crash.reportUptime")} ${(0,i18n_1.t)("crash.reportUptimeValue",{seconds:o})}`),s.push(`${(0,i18n_1.t)("crash.reportPlatform")} ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),s.push(`${(0,i18n_1.t)("crash.reportReactNative")} ${e.deviceInfo?.rnVersion||"N/A"}`),s.push(`${(0,i18n_1.t)("crash.reportHermes")} ${e.deviceInfo?.isHermes?(0,i18n_1.t)("crash.reportEnabled"):(0,i18n_1.t)("crash.reportDisabled")}`),s.push(`${(0,i18n_1.t)("crash.reportArchitecture")} ${e.deviceInfo?.isFabric?(0,i18n_1.t)("crash.reportFabricNew"):(0,i18n_1.t)("crash.reportPaperLegacy")}`),s.push(`${(0,i18n_1.t)("crash.reportScreenSize")} ${getScreenDimensions()}`),s.push(`${(0,i18n_1.t)("crash.reportAppState")} ${e.deviceInfo?.appState||"active"}`),e.memoryInfo&&s.push(`${(0,i18n_1.t)("crash.reportJsMemory")} ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportStackTrace")}`),s.push(e.stack||(0,i18n_1.t)("crash.reportNoStackTrace")),e.componentStack&&(s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportComponentHierarchy")}`),s.push(e.componentStack)),e.breadcrumbs&&e.breadcrumbs.length>0&&(s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportRecentBreadcrumbs")}`),e.breadcrumbs.forEach(t=>{const a=new Date(t.timestamp).toLocaleTimeString();s.push(` [${a}] [${t.type.toUpperCase()}] ${t.message}`)})),s.push("===================================================="),s.join(`
7
- `)};exports.exportCrashReport=exportCrashReport;const setupGlobalCrashHandler=()=>{if(!isCrashHandlerInitialized){isCrashHandlerInitialized=!0;try{react_native_1.LogBox&&typeof react_native_1.LogBox.ignoreAllLogs=="function"&&react_native_1.LogBox.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=react_native_1.NativeModules?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new react_native_1.NativeEventEmitter(e).addListener("onNativeCrash",o=>{const t=`[${(o?.platform||react_native_1.Platform.OS).toUpperCase()} ${(0,i18n_1.t)("crash.nativeCrashTitle")}] ${o?.message||(0,i18n_1.t)("crash.nativeUncaughtException")}`,a=o?.stack||"";(0,exports.handleInterceptedCrash)(t,a,!0,"native")}))}catch{}try{const e=react_native_1.TurboModuleRegistry||globalThis.__turboModuleProxy,r=react_native_1.NativeModules?.ExceptionsManager||(e?.get?e.get("ExceptionsManager"):null);if(r){r.reportFatalException=(s,t,a)=>{(0,exports.handleInterceptedCrash)(s,t,!0,"native");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportSoftException=(s,t,a)=>{(0,exports.handleInterceptedCrash)(s,t,!1,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportException=s=>{const t=s?.message||s?.title||(0,i18n_1.t)("crash.nativeException"),a=s?.stack||s?.rawStack;(0,exports.handleInterceptedCrash)(t,a,s?.isFatal??!0,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.updateExceptionMessage=()=>{};try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}}const o=react_native_1.NativeModules?.RedBox||react_native_1.NativeModules?.RCTRedBox||(e?.get?e.get("RedBox")||e.get("RCTRedBox"):null);o&&(typeof o.showErrorMessage=="function"&&(o.showErrorMessage=()=>{}),typeof o.showUserError=="function"&&(o.showUserError=()=>{}),typeof o.dismiss=="function"&&o.dismiss())}catch{}try{const r=globalThis.ErrorUtils;r&&(typeof r.setGlobalHandler=="function"&&r.setGlobalHandler((o,s)=>{(0,exports.handleInterceptedCrash)(o,o?.stack,s??!1,"js")}),typeof r.reportFatalError=="function"&&(r.reportFatalError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!0,"js")}),typeof r.reportError=="function"&&(r.reportError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!1,"js")}))}catch{}try{const e=globalThis,r=o=>{try{const s=o?.reason||o?.detail?.reason||o,t=s?.stack||(o?.stack??new Error().stack);(0,exports.handleInterceptedCrash)(s,t,!1,"promise")}catch{}};typeof e.addEventListener=="function"&&e.addEventListener("unhandledrejection",r),typeof e.onunhandledrejection<"u"&&(e.onunhandledrejection=r)}catch{}}};exports.setupGlobalCrashHandler=setupGlobalCrashHandler;
5
+ `)}catch{}},exportCrashReport=(e,r="text")=>{if(r==="json")return JSON.stringify(e,null,2);const o=Math.round((e.timestamp-appStartTime)/1e3);if(r==="markdown"){const t=[];return t.push(`## ${(0,i18n_1.t)("crash.mdReportTitle",{name:e.name||"Error"})}`),t.push(`> **${e.message}**`),t.push(""),t.push(`- **${(0,i18n_1.t)("crash.reportType")}** \`${e.type.toUpperCase()}\``),t.push(`- **${(0,i18n_1.t)("crash.reportFatal")}** \`${e.isFatal?(0,i18n_1.t)("crash.mdSeverityFatal"):(0,i18n_1.t)("crash.mdSeverityHandled")}\``),t.push(`- **${(0,i18n_1.t)("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),t.push(`- **${(0,i18n_1.t)("crash.reportUptime")}** ${o}s`),t.push(`- **${(0,i18n_1.t)("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),t.push(`- **${(0,i18n_1.t)("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),t.push(`- **${(0,i18n_1.t)("crash.jsEngine")}** ${e.deviceInfo?.isHermes?(0,i18n_1.t)("crash.hermesEngine"):(0,i18n_1.t)("crash.jsc")}`),t.push(`- **${(0,i18n_1.t)("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?(0,i18n_1.t)("crash.reportFabricNew"):(0,i18n_1.t)("crash.reportPaperLegacy")}`),e.memoryInfo&&t.push(`- **${(0,i18n_1.t)("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),t.push(""),t.push(`### ${(0,i18n_1.t)("crash.mdStackTrace")}`),t.push("```"),t.push(e.stack||(0,i18n_1.t)("crash.reportNoStackTrace")),t.push("```"),e.componentStack&&(t.push(""),t.push(`### ${(0,i18n_1.t)("crash.mdComponentHierarchy")}`),t.push("```"),t.push(e.componentStack),t.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(""),t.push(`### ${(0,i18n_1.t)("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(i=>{const c=new Date(i.timestamp).toLocaleTimeString();t.push(`- \`[${c}]\` **[${i.type.toUpperCase()}]** ${i.message}`)})),t.join(`
6
+ `)}const s=[];return s.push("===================================================="),s.push(` ${(0,i18n_1.t)("crash.reportTitle")} `),s.push("===================================================="),s.push(`${(0,i18n_1.t)("crash.reportErrorName")} ${e.name||"Error"}`),s.push(`${(0,i18n_1.t)("crash.reportMessage")} ${e.message}`),s.push(`${(0,i18n_1.t)("crash.reportType")} ${e.type.toUpperCase()}`),s.push(`${(0,i18n_1.t)("crash.reportFatal")} ${e.isFatal?(0,i18n_1.t)("crash.reportFatalYes"):(0,i18n_1.t)("crash.reportFatalNo")}`),s.push(`${(0,i18n_1.t)("crash.reportTimestamp")} ${e.dateStr} ${e.timeStr} (${e.timestamp})`),s.push(`${(0,i18n_1.t)("crash.reportUptime")} ${(0,i18n_1.t)("crash.reportUptimeValue",{seconds:o})}`),s.push(`${(0,i18n_1.t)("crash.reportPlatform")} ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),s.push(`${(0,i18n_1.t)("crash.reportReactNative")} ${e.deviceInfo?.rnVersion||"N/A"}`),s.push(`${(0,i18n_1.t)("crash.reportHermes")} ${e.deviceInfo?.isHermes?(0,i18n_1.t)("crash.reportEnabled"):(0,i18n_1.t)("crash.reportDisabled")}`),s.push(`${(0,i18n_1.t)("crash.reportArchitecture")} ${e.deviceInfo?.isFabric?(0,i18n_1.t)("crash.reportFabricNew"):(0,i18n_1.t)("crash.reportPaperLegacy")}`),s.push(`${(0,i18n_1.t)("crash.reportScreenSize")} ${getScreenDimensions()}`),s.push(`${(0,i18n_1.t)("crash.reportAppState")} ${e.deviceInfo?.appState||"active"}`),e.memoryInfo&&s.push(`${(0,i18n_1.t)("crash.reportJsMemory")} ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportStackTrace")}`),s.push(e.stack||(0,i18n_1.t)("crash.reportNoStackTrace")),e.componentStack&&(s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportComponentHierarchy")}`),s.push(e.componentStack)),e.breadcrumbs&&e.breadcrumbs.length>0&&(s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportRecentBreadcrumbs")}`),e.breadcrumbs.forEach(t=>{const i=new Date(t.timestamp).toLocaleTimeString();s.push(` [${i}] [${t.type.toUpperCase()}] ${t.message}`)})),s.push("===================================================="),s.join(`
7
+ `)};exports.exportCrashReport=exportCrashReport;const setupGlobalCrashHandler=()=>{if(!isCrashHandlerInitialized){isCrashHandlerInitialized=!0;try{react_native_1.LogBox&&typeof react_native_1.LogBox.ignoreAllLogs=="function"&&react_native_1.LogBox.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=react_native_1.NativeModules?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new react_native_1.NativeEventEmitter(e).addListener("onNativeCrash",o=>{const t=`[${(o?.platform||react_native_1.Platform.OS).toUpperCase()} ${(0,i18n_1.t)("crash.nativeCrashTitle")}] ${o?.message||(0,i18n_1.t)("crash.nativeUncaughtException")}`,i=o?.stack||"";(0,exports.handleInterceptedCrash)(t,i,!0,"native")}))}catch{}try{const e=react_native_1.TurboModuleRegistry||globalThis.__turboModuleProxy,r=react_native_1.NativeModules?.ExceptionsManager||(e?.get?e.get("ExceptionsManager"):null);if(r){r.reportFatalException=(s,t,i)=>{(0,exports.handleInterceptedCrash)(s,t,!0,"native");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportSoftException=(s,t,i)=>{(0,exports.handleInterceptedCrash)(s,t,!1,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportException=s=>{const t=s?.message||s?.title||(0,i18n_1.t)("crash.nativeException"),i=s?.stack||s?.rawStack;(0,exports.handleInterceptedCrash)(t,i,s?.isFatal??!0,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.updateExceptionMessage=()=>{};try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}}const o=react_native_1.NativeModules?.RedBox||react_native_1.NativeModules?.RCTRedBox||(e?.get?e.get("RedBox")||e.get("RCTRedBox"):null);o&&(typeof o.showErrorMessage=="function"&&(o.showErrorMessage=()=>{}),typeof o.showUserError=="function"&&(o.showUserError=()=>{}),typeof o.dismiss=="function"&&o.dismiss())}catch{}try{const r=globalThis.ErrorUtils;r&&(typeof r.setGlobalHandler=="function"&&r.setGlobalHandler((o,s)=>{(0,exports.handleInterceptedCrash)(o,o?.stack,s??!1,"js")}),typeof r.reportFatalError=="function"&&(r.reportFatalError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!0,"js")}),typeof r.reportError=="function"&&(r.reportError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!1,"js")}))}catch{}try{const e=globalThis,r=o=>{try{const s=o?.reason||o?.detail?.reason||o,t=s?.stack||(o?.stack??new Error().stack);(0,exports.handleInterceptedCrash)(s,t,!1,"promise")}catch{}};typeof e.addEventListener=="function"&&e.addEventListener("unhandledrejection",r),typeof e.onunhandledrejection<"u"&&(e.onunhandledrejection=r)}catch{}}};exports.setupGlobalCrashHandler=setupGlobalCrashHandler;
@@ -0,0 +1,22 @@
1
+ import { InspectedElementInfo, UiInspectorSubTab } from '../types';
2
+ type UiInspectorListener = (state: UiInspectorState) => void;
3
+ export interface UiInspectorState {
4
+ isInspectModeActive: boolean;
5
+ selectedElement: InspectedElementInfo | null;
6
+ activeSubTab: UiInspectorSubTab;
7
+ showAlignmentGrid: boolean;
8
+ showDistanceGuides: boolean;
9
+ history: InspectedElementInfo[];
10
+ tweakedStyles: Record<string, any>;
11
+ }
12
+ export declare function subscribeUiInspectorState(listener: UiInspectorListener): () => void;
13
+ export declare function getUiInspectorState(): UiInspectorState;
14
+ export declare function setInspectModeActive(active: boolean): void;
15
+ export declare function setSelectedUiElement(element: InspectedElementInfo | null): void;
16
+ export declare function setUiInspectorSubTab(subTab: UiInspectorSubTab): void;
17
+ export declare function toggleAlignmentGrid(show?: boolean): void;
18
+ export declare function toggleDistanceGuides(show?: boolean): void;
19
+ export declare function applyLiveStyleOverride(key: string, value: any): void;
20
+ export declare function resetLiveStyleOverrides(): void;
21
+ export declare function clearUiInspectorHistory(): void;
22
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeUiInspectorState=subscribeUiInspectorState,exports.getUiInspectorState=getUiInspectorState,exports.setInspectModeActive=setInspectModeActive,exports.setSelectedUiElement=setSelectedUiElement,exports.setUiInspectorSubTab=setUiInspectorSubTab,exports.toggleAlignmentGrid=toggleAlignmentGrid,exports.toggleDistanceGuides=toggleDistanceGuides,exports.applyLiveStyleOverride=applyLiveStyleOverride,exports.resetLiveStyleOverrides=resetLiveStyleOverrides,exports.clearUiInspectorHistory=clearUiInspectorHistory;let state={isInspectModeActive:!1,selectedElement:null,activeSubTab:"styles",showAlignmentGrid:!1,showDistanceGuides:!0,history:[],tweakedStyles:{}};const listeners=new Set;function notify(){const e={...state,history:[...state.history],tweakedStyles:{...state.tweakedStyles}};listeners.forEach(t=>{try{t(e)}catch(s){console.warn("[UIInspector] Listener notification error:",s)}})}function subscribeUiInspectorState(e){return listeners.add(e),e(state),()=>{listeners.delete(e)}}function getUiInspectorState(){return state}function setInspectModeActive(e){state.isInspectModeActive=e,notify()}function setSelectedUiElement(e){state.selectedElement=e,e?(state.tweakedStyles={...e.tweakedStyles},state.history.some(t=>t.id===e.id)||(state.history=[e,...state.history.slice(0,19)])):state.tweakedStyles={},notify()}function setUiInspectorSubTab(e){state.activeSubTab=e,notify()}function toggleAlignmentGrid(e){state.showAlignmentGrid=typeof e=="boolean"?e:!state.showAlignmentGrid,notify()}function toggleDistanceGuides(e){state.showDistanceGuides=typeof e=="boolean"?e:!state.showDistanceGuides,notify()}function applyLiveStyleOverride(e,t){state.tweakedStyles={...state.tweakedStyles,[e]:t},state.selectedElement&&(state.selectedElement={...state.selectedElement,tweakedStyles:{...state.tweakedStyles},flattenedStyles:{...state.selectedElement.originalStyles,...state.tweakedStyles}}),notify()}function resetLiveStyleOverrides(){state.tweakedStyles={},state.selectedElement&&(state.selectedElement={...state.selectedElement,tweakedStyles:{},flattenedStyles:{...state.selectedElement.originalStyles}}),notify()}function clearUiInspectorHistory(){state.history=[],notify()}
@@ -1,8 +1,6 @@
1
1
  "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,r,o){o===void 0&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}):(function(e,t,r,o){o===void 0&&(o=r),e[o]=t[r]})),__exportStar=this&&this.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&__createBinding(t,e,r)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.isUrlHidden=exports.getRuntimeDiagnostics=exports.getCategoryColors=exports.registerGAPlugin=exports.getEventCategory=exports.getEventColor=exports.ANALYTICS_EVENT_PALETTE=exports.openInVSCode=exports.getCleanCallerDisplay=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.openWithPostman=exports.getPostmanRequestJson=exports.getFetchCommand=exports.getCurlCommand=exports.getBaseUrl=exports.getPath=exports.copyImageOrMediaToClipboard=exports.copyToClipboard=exports.formatByteSize=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||"",r=t.startsWith("http://")||t.startsWith("https://")||t.includes(":8081")||t.includes(":8082");return e||r};exports.isLocalDebugEnvironment=isLocalDebugEnvironment;const getDomainColor=e=>{if(!e)return constants_1.DOMAIN_COLORS[0];let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((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),r=(u,c=2)=>String(u).padStart(c,"0"),o=r(t.getDate()),n=r(t.getMonth()+1),s=t.getFullYear(),i=r(t.getHours()),a=r(t.getMinutes()),p=r(t.getSeconds());return`${o}/${n}/${s} ${i}:${a}:${p}`};exports.formatDateTime=formatDateTime;const formatTimestamp=e=>{try{const t=new Date(e),r=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),n=t.getSeconds().toString().padStart(2,"0"),s=t.getMilliseconds().toString().padStart(3,"0");return`${r}:${o}:${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,r=["B","KB","MB","GB"],o=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,o)).toFixed(1))} ${r[o]||"B"}`};exports.formatBytes=formatBytes;const formatByteSize=e=>!e||e<=0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`;exports.formatByteSize=formatByteSize;const copyToClipboard=(e,t)=>{const r=typeof e=="function"?e():e;let o="";if(typeof r=="string")o=r;else try{o=JSON.stringify(r,null,2)}catch{o=String(r)}try{typeof clipboard_1.default?.setString=="function"?clipboard_1.default.setString(o):typeof clipboard_1.default?.default?.setString=="function"&&clipboard_1.default.default.setString(o)}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 r=!1;try{r=await(0,NativeInspector_1.copyMediaToClipboard)(e)}catch{r=!1}if(!r){(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(([r,o])=>{t+=` \\
2
2
  -H "${r}: ${o}"`}),e.request&&e.method!=="GET"){const r=typeof e.request=="string"?e.request:JSON.stringify(e.request);t+=` \\
3
- -d '${r.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 getPostmanRequestJson=e=>{let t;try{const s=new URL(e.url),i=s.hostname.split("."),a=s.pathname.replace(/^\//,"").split("/").filter(Boolean),p=[];s.searchParams.forEach((u,c)=>{p.push({key:c,value:u})}),t={raw:e.url,host:i,path:a,query:p.length>0?p:void 0}}catch{t={raw:e.url}}const r=[];e.requestHeaders&&typeof e.requestHeaders=="object"&&Object.entries(e.requestHeaders).forEach(([s,i])=>{r.push({key:s,value:String(i),type:"text"})});let o;if(e.request){const s=e.request;let i="";if(typeof s=="object")try{i=JSON.stringify(s,null,2)}catch{i=String(s)}else i=String(s);o={mode:"raw",raw:i,options:{raw:{language:"json"}}}}const n={info:{name:`${e.method} ${(0,exports.getPath)(e.url)||e.url}`,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",_exporter_id:"inapp-inspector"},item:[{name:`${e.method} ${(0,exports.getPath)(e.url)||e.url}`,request:{method:e.method||"GET",header:r,body:o,url:t,description:"Captured by React Native In-App Inspector"},response:[]}]};return JSON.stringify(n,null,2)};exports.getPostmanRequestJson=getPostmanRequestJson;const openWithPostman=async(e,t)=>{const r=(0,exports.getCurlCommand)(e);clipboard_1.default.setString(r);const o="postman://";try{if(await react_native_1.Linking.canOpenURL(o)){await react_native_1.Linking.openURL(o),t?t("Opened Postman (cURL copied to clipboard)"):(0,toast_1.showToast)("Opened Postman (cURL copied to clipboard)");return}}catch{}react_native_1.Alert.alert("Open with Postman",`cURL for "${e.method} ${(0,exports.getPath)(e.url)||e.url}" copied to clipboard!
4
-
5
- In Postman: Click "Import" > paste the cURL to load this request.`,[{text:"Done",style:"cancel"},{text:"Open Postman Web",onPress:()=>{react_native_1.Linking.openURL("https://web.postman.co/").catch(()=>{})}}])};exports.openWithPostman=openWithPostman;const deduplicateLogs=e=>{const t=new Map;return e.forEach(r=>{if(!t.has(r.id))t.set(r.id,r);else{const o=t.get(r.id);(o.status==null&&r.status!=null||(r.startTime??0)>=(o.startTime??0))&&t.set(r.id,r)}}),Array.from(t.values()).sort((r,o)=>o.id-r.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 r=typeof e.index=="number"&&e.index>=0&&e.index<e.routes.length?e.index:0,o=e.routes[r];if(!o)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const n=o.name?[...t,o.name]:t;return o?.state?(0,exports.getNavigationInfo)(o.state,n):{path:n.length>0?n.join(" \u2794 "):o.name||"",params:o.params||null}};exports.getNavigationInfo=getNavigationInfo;const getLogPageName=(e,t)=>{const r=t||e?.routeInfo;if(r&&r.path&&r.path!=="Navigators"){const o=r.path.split(" \u2794 ").map(n=>n.trim()).filter(Boolean);return o.length>0?o[o.length-1]:r.path}if(e.caller&&e.caller!=="Unknown")try{const o=e.caller.match(/([^/\\]+)\.(tsx|jsx|ts|js)/i);if(o&&o[1]){const n=o[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),p=["api","v1","v2","v3","v4","rest","graphql","json","data","service","app"],u=a.filter(c=>!p.includes(c.toLowerCase()));if(u.length>0){const c=u[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 r={};return typeof e=="object"&&e!==null?Array.isArray(e)?e.forEach((o,n)=>{Object.assign(r,(0,exports.flattenObject)(o,t?`${t}[${n}]`:`[${n}]`))}):Object.keys(e).forEach(o=>{Object.assign(r,(0,exports.flattenObject)(e[o],t?`${t}.${o}`:o))}):r[t||"root"]=e,r};exports.flattenObject=flattenObject;const getDiff=(e,t)=>{const r=(0,exports.flattenObject)(e),o=(0,exports.flattenObject)(t),n=[];return new Set([...Object.keys(r),...Object.keys(o)]).forEach(i=>{i in r?i in o?r[i]!==o[i]&&n.push({type:"changed",path:i,oldVal:r[i],newVal:o[i]}):n.push({type:"removed",path:i,oldVal:r[i]}):n.push({type:"added",path:i,newVal:o[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,r)=>e.replace("country-language",`${t?.toLowerCase()}-${r?.toLowerCase()}`);exports.getLocalizedFilePath=getLocalizedFilePath;const getLocalizedFilePathWithSlash=(e,t,r)=>e.replace("country/language",`${t?.toLowerCase()}/${r?.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 r=react_native_1.NativeModules.ExpoApplication;if(r&&typeof r.applicationId=="string")return r.applicationId;const o=react_native_1.NativeModules.SourceCode;if(o&&typeof o.scriptURL=="string"){const n=o.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 r=react_native_1.NativeModules.NetworkInspectorModule;if(r&&typeof r.appName=="string"&&r.appName.length>0&&r.appName!=="App")return r.appName;const o=react_native_1.NativeModules.ExpoApplication;if(o&&typeof o.applicationName=="string")return o.applicationName;const n=react_native_1.NativeModules.ExponentConstants;if(n&&n.manifest){const a=n.manifest;if(a.name)return a.name}const s=react_native_1.NativeModules.AppInfo;if(s&&typeof s.appName=="string")return s.appName;const i=(0,exports.getBundleIdentifier)();if(i&&i!=="org.reactjs.native.example"){const a=i.split("."),p=a[a.length-1];return p?p.charAt(0).toUpperCase()+p.slice(1):"App"}return"App"};exports.getAppName=getAppName;const getAppVersionAndBuild=()=>{let e="",t="";const r=react_native_1.NativeModules.NetworkInspectorModule;if(r&&(typeof r.appVersion=="string"&&r.appVersion.length>0&&(e=r.appVersion),typeof r.appBuild=="string"&&r.appBuild.length>0&&(t=r.appBuild)),!e||!t){const o=react_native_1.NativeModules.ExpoApplication;o&&(!e&&typeof o.nativeAppVersion=="string"&&(e=o.nativeAppVersion),!t&&typeof o.nativeBuildVersion=="string"&&(t=o.nativeBuildVersion))}if(!e||!t){const o=react_native_1.NativeModules.ExponentConstants;if(o){const n=o.manifest||o.expoConfig;n&&(!e&&n.version&&(e=String(n.version)),t||(n.ios?.buildNumber?t=String(n.ios.buildNumber):n.android?.versionCode&&(t=String(n.android.versionCode))))}}if(!e||!t){const o=react_native_1.NativeModules.RNDeviceInfo;if(o){if(!e){if(typeof o.appVersion=="string")e=o.appVersion;else if(typeof o.getVersion=="function")try{e=o.getVersion()}catch{}}if(!t){if(typeof o.buildNumber=="string")t=o.buildNumber;else if(typeof o.getBuildNumber=="function")try{t=o.getBuildNumber()}catch{}}}}if(!e||!t){const o=react_native_1.NativeModules.AppInfo;o&&(!e&&typeof o.versionName=="string"&&(e=o.versionName),!t&&typeof o.versionCode=="string"&&(t=o.versionCode))}if(!e){const o=react_native_1.Platform.constants||react_native_1.NativeModules.PlatformConstants;o&&o.Version&&typeof o.Version=="string"&&o.Version.includes(".")&&(e=o.Version)}return e||(e="1.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?
3
+ -d '${r.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 getPostmanRequestJson=e=>{let t;try{const s=new URL(e.url),i=s.hostname.split("."),a=s.pathname.replace(/^\//,"").split("/").filter(Boolean),p=[];s.searchParams.forEach((u,c)=>{p.push({key:c,value:u})}),t={raw:e.url,host:i,path:a,query:p.length>0?p:void 0}}catch{t={raw:e.url}}const r=[];e.requestHeaders&&typeof e.requestHeaders=="object"&&Object.entries(e.requestHeaders).forEach(([s,i])=>{r.push({key:s,value:String(i),type:"text"})});let o;if(e.request){const s=e.request;let i="";if(typeof s=="object")try{i=JSON.stringify(s,null,2)}catch{i=String(s)}else i=String(s);o={mode:"raw",raw:i,options:{raw:{language:"json"}}}}const n={info:{name:`${e.method} ${(0,exports.getPath)(e.url)||e.url}`,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",_exporter_id:"inapp-inspector"},item:[{name:`${e.method} ${(0,exports.getPath)(e.url)||e.url}`,request:{method:e.method||"GET",header:r,body:o,url:t,description:"Captured by React Native In-App Inspector"},response:[]}]};return JSON.stringify(n,null,2)};exports.getPostmanRequestJson=getPostmanRequestJson;const openWithPostman=async(e,t)=>{const r=(0,exports.getCurlCommand)(e);clipboard_1.default.setString(r);const o=s=>{t?t(s):(0,toast_1.showToast)(s)},n="postman://";try{if(await react_native_1.Linking.canOpenURL(n))try{await react_native_1.Linking.openURL(n),o("Opened Postman (cURL copied to clipboard)");return}catch{}}catch{}o("cURL copied! Ready to paste into Postman")};exports.openWithPostman=openWithPostman;const deduplicateLogs=e=>{const t=new Map;return e.forEach(r=>{if(!t.has(r.id))t.set(r.id,r);else{const o=t.get(r.id);(o.status==null&&r.status!=null||(r.startTime??0)>=(o.startTime??0))&&t.set(r.id,r)}}),Array.from(t.values()).sort((r,o)=>o.id-r.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 r=typeof e.index=="number"&&e.index>=0&&e.index<e.routes.length?e.index:0,o=e.routes[r];if(!o)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const n=o.name?[...t,o.name]:t;return o?.state?(0,exports.getNavigationInfo)(o.state,n):{path:n.length>0?n.join(" \u2794 "):o.name||"",params:o.params||null}};exports.getNavigationInfo=getNavigationInfo;const getLogPageName=(e,t)=>{const r=t||e?.routeInfo;if(r&&r.path&&r.path!=="Navigators"){const o=r.path.split(" \u2794 ").map(n=>n.trim()).filter(Boolean);return o.length>0?o[o.length-1]:r.path}if(e.caller&&e.caller!=="Unknown")try{const o=e.caller.match(/([^/\\]+)\.(tsx|jsx|ts|js)/i);if(o&&o[1]){const n=o[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),p=["api","v1","v2","v3","v4","rest","graphql","json","data","service","app"],u=a.filter(c=>!p.includes(c.toLowerCase()));if(u.length>0){const c=u[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 r={};return typeof e=="object"&&e!==null?Array.isArray(e)?e.forEach((o,n)=>{Object.assign(r,(0,exports.flattenObject)(o,t?`${t}[${n}]`:`[${n}]`))}):Object.keys(e).forEach(o=>{Object.assign(r,(0,exports.flattenObject)(e[o],t?`${t}.${o}`:o))}):r[t||"root"]=e,r};exports.flattenObject=flattenObject;const getDiff=(e,t)=>{const r=(0,exports.flattenObject)(e),o=(0,exports.flattenObject)(t),n=[];return new Set([...Object.keys(r),...Object.keys(o)]).forEach(i=>{i in r?i in o?r[i]!==o[i]&&n.push({type:"changed",path:i,oldVal:r[i],newVal:o[i]}):n.push({type:"removed",path:i,oldVal:r[i]}):n.push({type:"added",path:i,newVal:o[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,r)=>e.replace("country-language",`${t?.toLowerCase()}-${r?.toLowerCase()}`);exports.getLocalizedFilePath=getLocalizedFilePath;const getLocalizedFilePathWithSlash=(e,t,r)=>e.replace("country/language",`${t?.toLowerCase()}/${r?.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 r=react_native_1.NativeModules.ExpoApplication;if(r&&typeof r.applicationId=="string")return r.applicationId;const o=react_native_1.NativeModules.SourceCode;if(o&&typeof o.scriptURL=="string"){const n=o.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 r=react_native_1.NativeModules.NetworkInspectorModule;if(r&&typeof r.appName=="string"&&r.appName.length>0&&r.appName!=="App")return r.appName;const o=react_native_1.NativeModules.ExpoApplication;if(o&&typeof o.applicationName=="string")return o.applicationName;const n=react_native_1.NativeModules.ExponentConstants;if(n&&n.manifest){const a=n.manifest;if(a.name)return a.name}const s=react_native_1.NativeModules.AppInfo;if(s&&typeof s.appName=="string")return s.appName;const i=(0,exports.getBundleIdentifier)();if(i&&i!=="org.reactjs.native.example"){const a=i.split("."),p=a[a.length-1];return p?p.charAt(0).toUpperCase()+p.slice(1):"App"}return"App"};exports.getAppName=getAppName;const getAppVersionAndBuild=()=>{let e="",t="";const r=react_native_1.NativeModules.NetworkInspectorModule;if(r&&(typeof r.appVersion=="string"&&r.appVersion.length>0&&(e=r.appVersion),typeof r.appBuild=="string"&&r.appBuild.length>0&&(t=r.appBuild)),!e||!t){const o=react_native_1.NativeModules.ExpoApplication;o&&(!e&&typeof o.nativeAppVersion=="string"&&(e=o.nativeAppVersion),!t&&typeof o.nativeBuildVersion=="string"&&(t=o.nativeBuildVersion))}if(!e||!t){const o=react_native_1.NativeModules.ExponentConstants;if(o){const n=o.manifest||o.expoConfig;n&&(!e&&n.version&&(e=String(n.version)),t||(n.ios?.buildNumber?t=String(n.ios.buildNumber):n.android?.versionCode&&(t=String(n.android.versionCode))))}}if(!e||!t){const o=react_native_1.NativeModules.RNDeviceInfo;if(o){if(!e){if(typeof o.appVersion=="string")e=o.appVersion;else if(typeof o.getVersion=="function")try{e=o.getVersion()}catch{}}if(!t){if(typeof o.buildNumber=="string")t=o.buildNumber;else if(typeof o.getBuildNumber=="function")try{t=o.getBuildNumber()}catch{}}}}if(!e||!t){const o=react_native_1.NativeModules.AppInfo;o&&(!e&&typeof o.versionName=="string"&&(e=o.versionName),!t&&typeof o.versionCode=="string"&&(t=o.versionCode))}if(!e){const o=react_native_1.Platform.constants||react_native_1.NativeModules.PlatformConstants;o&&o.Version&&typeof o.Version=="string"&&o.Version.includes(".")&&(e=o.Version)}return e||(e="1.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?
6
4
 
7
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),r=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0");return`${r}:${o}:${n}`};exports.formatTimeShort=formatTimeShort;const formatTime=e=>{const t=new Date(e),r=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0"),s=String(t.getMilliseconds()).padStart(3,"0");return`${r}:${o}:${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 r=Math.floor(t/60),o=t%60;return o>0?`+${r}m ${o}s`:`+${r}m`};exports.formatGap=formatGap;const getJsonContent=e=>{if(!e)return null;const t=[];for(let r=0;r<e.length;r++)(e[r]==="{"||e[r]==="[")&&t.push(r);for(const r of t){const o=e.substring(r).trim();try{const n=JSON.parse(o);if(n!==null&&typeof n=="object")return{header:e.substring(0,r).trim(),data:n}}catch{}}return null};exports.getJsonContent=getJsonContent;const getJsonPreviewText=(e,t=4)=>{try{const r=JSON.stringify(e,null,2),o=r.split(`
8
6
  `);return o.length>t?{text:o.slice(0,t).join(`
@@ -5,3 +5,4 @@ export interface SearchQueryOptions {
5
5
  isCaseSensitive?: boolean;
6
6
  }
7
7
  export declare function matchNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string, options?: SearchQueryOptions): boolean;
8
+ export declare function scoreNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string, options?: SearchQueryOptions): number;
@@ -1,5 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.matchNetworkLogQuery=matchNetworkLogQuery;const telemetry_1=require("./telemetry"),PROXY_INFRA_HEADERS=new Set(["via","nel","report-to","reporting-endpoints","cf-ray","cf-cache-status","alt-svc","server","etag","date","x-powered-by","x-request-id","x-content-type-options","accept-ranges","transfer-encoding","connection","keep-alive"]);function tokenizeQuery(s){const o=[],w=/[^\s"']+|"([^"]*)"|'([^']*)'/g;let i;for(;(i=w.exec(s))!==null;)i[1]!=null?o.push(i[1]):i[2]!=null?o.push(i[2]):i[0]&&o.push(i[0]);return o}function matchNetworkLogQuery(s,o,w,i){if(!o||o.trim().length===0)return!0;(0,telemetry_1.markSearchFilterUsed)();const R=!!i?.isCaseSensitive,j=!!i?.isRegex,x=i?.scope||"all",b=s.method||"",y=s.url||"",d=s.status!=null?String(s.status):"pending",u=typeof s.status=="number"?s.status:s.status!=null?parseInt(String(s.status),10):null,k=s.client||"",B=s.caller||"",v=w||s?.routeInfo?.path||"",H=n=>{if(n==null)return"";if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return""}},m=H(s.request),C=H(s.response),p=(n,l=!1)=>{if(!n||typeof n!="object")return"";const r=Object.entries(n);return l?r.map(([t,f])=>`${t}: ${f}`).join(`
2
- `):r.filter(([t])=>!PROXY_INFRA_HEADERS.has(t.toLowerCase())).map(([t,f])=>`${t}: ${f}`).join(`
3
- `)},$=p(s.requestHeaders,x==="headers"),q=p(s.responseHeaders,x==="headers"),h=(n=>{switch(n){case"url":return y;case"reqBody":return m;case"resBody":return C;case"headers":return`${$}
4
- ${q}`;default:return[y,b,d,v,k,B,m,C,$,q].join(" ")}})(x),c=(n,l)=>{if(j)try{return new RegExp(l,R?"":"i").test(n)}catch{}return R?n.includes(l):n.toLowerCase().includes(l.toLowerCase())},L=tokenizeQuery(o);return L.length===0?!0:L.every(n=>{let l=!1,r=n;if(r.length>1&&(r.startsWith("-")||r.startsWith("!"))&&(l=!0,r=r.slice(1)),!r)return!0;let t=!1;const f=r.indexOf(":");if(f>0){const e=r.slice(0,f).toLowerCase(),a=r.slice(f+1);if(e==="url"||e==="u"||e==="path")t=c(y,a);else if(e==="method"||e==="m")t=c(b,a);else if(e==="status"||e==="s")if(a==="error"||a==="failed"||a==="err")t=s.status===0||u!==null&&u>=400;else if(a==="success"||a==="ok")t=u!==null&&u>=200&&u<300;else if(a.endsWith("xx")){const S=a[0];t=d.startsWith(S)}else t=d.includes(a);else if(e==="header"||e==="h"){const S=`${p(s.requestHeaders,!0)}
5
- ${p(s.responseHeaders,!0)}`;t=c(S,a)}else e==="body"||e==="b"?t=c(m,a)||c(C,a):e==="client"||e==="c"?t=c(k,a):e==="page"||e==="p"?t=c(v,a):t=c(h,r)}else{const e=r.toLowerCase();e==="error"||e==="failed"||e==="err"||e==="fail"?t=s.status===0||u!==null&&u>=400||c(h,r):e==="success"||e==="ok"||e==="2xx"?t=u!==null&&u>=200&&u<300||c(h,r):/^[1-5]xx$/.test(e)?t=d.startsWith(e[0]):t=c(h,r)}return l?!t:t})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.matchNetworkLogQuery=matchNetworkLogQuery,exports.scoreNetworkLogQuery=scoreNetworkLogQuery;const telemetry_1=require("./telemetry"),PROXY_INFRA_HEADERS=new Set(["via","nel","report-to","reporting-endpoints","cf-ray","cf-cache-status","alt-svc","server","etag","date","x-powered-by","x-request-id","x-content-type-options","accept-ranges","transfer-encoding","connection","keep-alive"]);function tokenizeQuery(t){const h=[],v=/[^\s"']+|"([^"]*)"|'([^']*)'/g;let p;for(;(p=v.exec(t))!==null;)p[1]!=null?h.push(p[1]):p[2]!=null?h.push(p[2]):p[0]&&h.push(p[0]);return h}function matchNetworkLogQuery(t,h,v,p){if(!h||h.trim().length===0)return!0;(0,telemetry_1.markSearchFilterUsed)();const N=!!p?.isCaseSensitive,P=!!p?.isRegex,B=p?.scope||"all",y=t.method||"",L=t.url||"",R=t.status!=null?String(t.status):"pending",m=typeof t.status=="number"?t.status:t.status!=null?parseInt(String(t.status),10):null,I=t.client||"",q=t.caller||"",O=v||t?.routeInfo?.path||"",H=o=>{if(o==null)return"";if(typeof o=="string")return o;try{return JSON.stringify(o)}catch{return""}},b=H(t.request),j=H(t.response),$=(o,w=!1)=>{if(!o||typeof o!="object")return"";const c=Object.entries(o);return w?c.map(([s,x])=>`${s}: ${x}`).join(`
2
+ `):c.filter(([s])=>!PROXY_INFRA_HEADERS.has(s.toLowerCase())).map(([s,x])=>`${s}: ${x}`).join(`
3
+ `)},k=$(t.requestHeaders,B==="headers"),g=$(t.responseHeaders,B==="headers"),u=(o=>{switch(o){case"url":return L;case"reqBody":return b;case"resBody":return j;case"headers":return`${k}
4
+ ${g}`;default:return[L,y,R,O,I,q,b,j,k,g].join(" ")}})(B),r=(o,w)=>{if(P)try{return new RegExp(w,N?"":"i").test(o)}catch{}return N?o.includes(w):o.toLowerCase().includes(w.toLowerCase())},S=tokenizeQuery(h);return S.length===0?!0:S.every(o=>{let w=!1,c=o;if(c.length>1&&(c.startsWith("-")||c.startsWith("!"))&&(w=!0,c=c.slice(1)),!c)return!0;let s=!1;const x=c.indexOf(":");if(x>0){const n=c.slice(0,x).toLowerCase(),f=c.slice(x+1);if(n==="url"||n==="u"||n==="path")s=r(L,f);else if(n==="method"||n==="m")s=r(y,f);else if(n==="status"||n==="s")if(f==="error"||f==="failed"||f==="err")s=t.status===0||m!==null&&m>=400;else if(f==="success"||f==="ok")s=m!==null&&m>=200&&m<300;else if(f.endsWith("xx")){const W=f[0];s=R.startsWith(W)}else s=R.includes(f);else if(n==="header"||n==="h"){const W=`${$(t.requestHeaders,!0)}
5
+ ${$(t.responseHeaders,!0)}`;s=r(W,f)}else n==="body"||n==="b"?s=r(b,f)||r(j,f):n==="client"||n==="c"?s=r(I,f):n==="page"||n==="p"?s=r(O,f):s=r(u,c)}else{const n=c.toLowerCase();n==="error"||n==="failed"||n==="err"||n==="fail"?s=t.status===0||m!==null&&m>=400||r(u,c):n==="success"||n==="ok"||n==="2xx"?s=m!==null&&m>=200&&m<300||r(u,c):/^[1-5]xx$/.test(n)?s=R.startsWith(n[0]):s=r(u,c)}return w?!s:s})}function scoreNetworkLogQuery(t,h,v,p){if(!h||h.trim().length===0)return 0;const N=!!p?.isCaseSensitive,P=p?.scope||"all",B=(t.method||"").trim(),y=(t.url||"").trim(),L=t.status!=null?String(t.status):"pending",R=t.client||"",m=t.caller||"",I=v||t?.routeInfo?.path||"";let q=y,O="",H="";try{const l=y.indexOf("?"),i=l>=0?y.slice(0,l):y;O=l>=0?y.slice(l+1):"";const C=i.indexOf("://"),a=C>=0?i.slice(C+3):i,d=a.indexOf("/");q=d>=0?a.slice(d):a;const F=q.split("/").filter(Boolean);H=F[F.length-1]||""}catch{q=y,H=y}const b=l=>{if(l==null)return"";if(typeof l=="string")return l;try{return JSON.stringify(l)}catch{return""}},j=b(t.request),$=b(t.response),k=(l,i=!1)=>{if(!l||typeof l!="object")return"";const C=Object.entries(l);return i?C.map(([a,d])=>`${a}: ${d}`).join(`
6
+ `):C.filter(([a])=>!PROXY_INFRA_HEADERS.has(a.toLowerCase())).map(([a,d])=>`${a}: ${d}`).join(`
7
+ `)},g=k(t.requestHeaders,P==="headers"),z=k(t.responseHeaders,P==="headers"),u=l=>N?l:l.toLowerCase(),r=u(h.trim()),S=u(H),o=u(q),w=u(y),c=u(B),s=u(L),x=u(I),n=u(R),f=u(m),W=u(O),E=u(g),_=u(z),M=u(j),U=u($);let e=0;return S===r?e+=500:S.startsWith(r)?e+=350:S.includes(r)&&(e+=250),o===r?e+=400:o.includes(r)&&(e+=180),w.includes(r)&&(e+=120),c===r&&(e+=100),s===r&&(e+=90),x.includes(r)&&(e+=80),W.includes(r)&&(e+=60),E.includes(r)&&(e+=40),M.includes(r)&&(e+=30),_.includes(r)&&(e+=20),U.includes(r)&&(e+=5),tokenizeQuery(h).forEach(l=>{if(!l||l.startsWith("-")||l.startsWith("!"))return;const i=u(l),C=i.indexOf(":");if(C>0){const a=i.slice(0,C),d=i.slice(C+1);a==="url"||a==="u"||a==="path"?o.includes(d)?e+=150:w.includes(d)&&(e+=100):a==="method"||a==="m"?c===d&&(e+=150):a==="status"||a==="s"?s.includes(d)&&(e+=150):a==="body"||a==="b"?(M.includes(d)&&(e+=80),U.includes(d)&&(e+=40)):(a==="header"||a==="h")&&(E.includes(d)||_.includes(d))&&(e+=80);return}S===i?e+=150:S.startsWith(i)?e+=100:S.includes(i)&&(e+=70),o.includes(i)?e+=40:w.includes(i)&&(e+=25),c===i&&(e+=50),s===i&&(e+=40),x.includes(i)&&(e+=30),(n.includes(i)||f.includes(i))&&(e+=20),E.includes(i)&&(e+=15),M.includes(i)&&(e+=10),_.includes(i)&&(e+=8),U.includes(i)&&(e+=2)}),e}
@@ -28,3 +28,19 @@ export declare function generateConsoleLogsFilename(format?: ConsoleLogExportFor
28
28
  export declare function formatConsoleLogsExport(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): string;
29
29
  export declare function estimateConsoleLogsExportSize(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): number;
30
30
  export declare function shareConsoleLogs(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions, customTitle?: string): Promise<void>;
31
+ export type NetworkLogExportFormat = 'txt' | 'log' | 'json' | 'curl';
32
+ export interface NetworkLogExportOptions {
33
+ includeRequestHeaders?: boolean;
34
+ includeRequestBody?: boolean;
35
+ includeResponseHeaders?: boolean;
36
+ includeResponseBody?: boolean;
37
+ includeCurlCommand?: boolean;
38
+ includeTimestamps?: boolean;
39
+ includeAppInfo?: boolean;
40
+ ignorePattern?: string;
41
+ }
42
+ export declare const DEFAULT_NETWORK_EXPORT_OPTIONS: NetworkLogExportOptions;
43
+ export declare function generateNetworkLogsFilename(format?: NetworkLogExportFormat): string;
44
+ export declare function formatNetworkLogsExport(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions): string;
45
+ export declare function estimateNetworkLogsExportSize(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions): number;
46
+ export declare function shareNetworkLogs(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions, customTitle?: string): Promise<void>;
@@ -1,15 +1,22 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_CONSOLE_EXPORT_OPTIONS=void 0,exports.formatApiReport=formatApiReport,exports.formatPushReport=formatPushReport,exports.formatCrashReport=formatCrashReport,exports.formatAnalyticsReport=formatAnalyticsReport,exports.formatReduxReport=formatReduxReport,exports.formatLogReport=formatLogReport,exports.shareApiReport=shareApiReport,exports.sharePushReport=sharePushReport,exports.shareCrashReport=shareCrashReport,exports.shareAnalyticsReport=shareAnalyticsReport,exports.shareReduxReport=shareReduxReport,exports.shareLogReport=shareLogReport,exports.formatSocketReport=formatSocketReport,exports.shareSocketReport=shareSocketReport,exports.generateConsoleLogsFilename=generateConsoleLogsFilename,exports.formatConsoleLogsExport=formatConsoleLogsExport,exports.estimateConsoleLogsExportSize=estimateConsoleLogsExportSize,exports.shareConsoleLogs=shareConsoleLogs;const react_native_1=require("react-native"),index_1=require("./index");function safeStringify(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function formatApiReport(e){const n=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",o=e.duration!=null?`${e.duration}ms`:"N/A",i=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=(0,index_1.getCurlCommand)(e),a=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${n}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${o}`,`\u{1F552} Time: ${i}`];return e.client&&a.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),a.push(`\u{1F310} URL: ${e.url||"N/A"}`),a.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(a.push("\u{1F4CB} Request Headers:"),a.push(safeStringify(e.requestHeaders)),a.push("")),e.request!=null&&e.request!==""&&(a.push("\u{1F4DD} Request Body:"),a.push(safeStringify(e.request)),a.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(a.push("\u{1F4D1} Response Headers:"),a.push(safeStringify(e.responseHeaders)),a.push("")),e.response!=null&&e.response!==""&&(a.push("\u{1F4E5} Response Data:"),a.push(safeStringify(e.response)),a.push("")),s&&(a.push("\u{1F4BB} cURL Command:"),a.push(s),a.push("")),a.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),a.push("Generated by React Native InApp Inspector"),a.join(`
2
- `)}function formatPushReport(e){const n=(0,index_1.formatDateTime)(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),o=(e.appState||"unknown").toUpperCase(),i=(e.action||"received").toUpperCase(),s=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${o}`,`\u{1F3AF} Action: ${i}`,`\u{1F552} Time: ${n}`];return e.subtitle&&s.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&s.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&s.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&s.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&s.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&s.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),s.push(""),e.data&&Object.keys(e.data).length>0&&(s.push("\u{1F4E6} Custom Data Payload:"),s.push(safeStringify(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(safeStringify(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(safeStringify(e.rawPayload)),s.push("")),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
3
- `)}function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${n}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(o=>{t.push(` \u2022 [${o.type}] ${o.message} (${(0,index_1.formatDateTime)(o.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_NETWORK_EXPORT_OPTIONS=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS=void 0,exports.formatApiReport=formatApiReport,exports.formatPushReport=formatPushReport,exports.formatCrashReport=formatCrashReport,exports.formatAnalyticsReport=formatAnalyticsReport,exports.formatReduxReport=formatReduxReport,exports.formatLogReport=formatLogReport,exports.shareApiReport=shareApiReport,exports.sharePushReport=sharePushReport,exports.shareCrashReport=shareCrashReport,exports.shareAnalyticsReport=shareAnalyticsReport,exports.shareReduxReport=shareReduxReport,exports.shareLogReport=shareLogReport,exports.formatSocketReport=formatSocketReport,exports.shareSocketReport=shareSocketReport,exports.generateConsoleLogsFilename=generateConsoleLogsFilename,exports.formatConsoleLogsExport=formatConsoleLogsExport,exports.estimateConsoleLogsExportSize=estimateConsoleLogsExportSize,exports.shareConsoleLogs=shareConsoleLogs,exports.generateNetworkLogsFilename=generateNetworkLogsFilename,exports.formatNetworkLogsExport=formatNetworkLogsExport,exports.estimateNetworkLogsExportSize=estimateNetworkLogsExportSize,exports.shareNetworkLogs=shareNetworkLogs;const react_native_1=require("react-native"),NativeInspector_1=require("../native/NativeInspector"),index_1=require("./index");function safeStringify(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function formatApiReport(e){const n=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",a=e.duration!=null?`${e.duration}ms`:"N/A",p=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=(0,index_1.getCurlCommand)(e),i=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${n}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${a}`,`\u{1F552} Time: ${p}`];return e.client&&i.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),i.push(`\u{1F310} URL: ${e.url||"N/A"}`),i.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(i.push("\u{1F4CB} Request Headers:"),i.push(safeStringify(e.requestHeaders)),i.push("")),e.request!=null&&e.request!==""&&(i.push("\u{1F4DD} Request Body:"),i.push(safeStringify(e.request)),i.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(i.push("\u{1F4D1} Response Headers:"),i.push(safeStringify(e.responseHeaders)),i.push("")),e.response!=null&&e.response!==""&&(i.push("\u{1F4E5} Response Data:"),i.push(safeStringify(e.response)),i.push("")),s&&(i.push("\u{1F4BB} cURL Command:"),i.push(s),i.push("")),i.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),i.push("Generated by React Native InApp Inspector"),i.join(`
2
+ `)}function formatPushReport(e){const n=(0,index_1.formatDateTime)(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),a=(e.appState||"unknown").toUpperCase(),p=(e.action||"received").toUpperCase(),s=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${a}`,`\u{1F3AF} Action: ${p}`,`\u{1F552} Time: ${n}`];return e.subtitle&&s.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&s.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&s.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&s.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&s.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&s.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),s.push(""),e.data&&Object.keys(e.data).length>0&&(s.push("\u{1F4E6} Custom Data Payload:"),s.push(safeStringify(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(safeStringify(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(safeStringify(e.rawPayload)),s.push("")),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
3
+ `)}function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${n}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(a=>{t.push(` \u2022 [${a.type}] ${a.message} (${(0,index_1.formatDateTime)(a.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
4
4
  `)}function formatAnalyticsReport(e){const n=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4CA} ANALYTICS EVENT REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Event Name: ${e.name||"Unknown"}`,`\u{1F3E2} Source: ${(e.source||"manual").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`];return e.screenName&&t.push(`\u{1F4F1} Screen Name: ${e.screenName}`),e.userId&&t.push(`\u{1F464} User ID: ${e.userId}`),e.trackingId&&t.push(`\u{1F194} Tracking ID: ${e.trackingId}`),t.push(""),e.params&&Object.keys(e.params).length>0&&(t.push("\u{1F4E6} Event Parameters:"),t.push(safeStringify(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(safeStringify(e.userProperties)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
5
5
  `)}function formatReduxReport(e){const n=typeof e.timestamp=="number"?(0,index_1.formatDateTime)(e.timestamp):e.timestamp,t=["\u{1F504} REDUX ACTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Action Type: ${e.type||"UNKNOWN"}`,`\u{1F552} Timestamp: ${n}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),e.originType&&t.push(`\u2699\uFE0F Origin: ${e.originType}`),e.affectedSlices&&e.affectedSlices.length>0&&t.push(`\u{1F370} Slices: ${e.affectedSlices.join(", ")}`),t.push(""),t.push("\u{1F4E6} Action Payload:"),t.push(safeStringify(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(safeStringify(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(safeStringify(e.nextState)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
6
6
  `)}function formatLogReport(e){const n=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4DC} CONSOLE LOG REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Level: ${(e.type||"info").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`,`\u{1F4AC} Message: ${e.message||""}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),t.push(""),e.rawArgs&&e.rawArgs.length>0&&(t.push("\u{1F4E6} Arguments:"),t.push(safeStringify(e.rawArgs)),t.push("")),(e.stack||e.errorStack)&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack||e.errorStack||""),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
7
- `)}async function triggerNativeShare(e,n){try{await react_native_1.Share.share({title:e,message:n},{dialogTitle:e})}catch(t){t?.message!=="User did not share"&&react_native_1.Alert.alert("Share Error",t?.message||"Failed to open share sheet")}}async function shareApiReport(e){const n=formatApiReport(e),t=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await triggerNativeShare(t,n)}async function sharePushReport(e){const n=formatPushReport(e),t=`Push: ${e.title||e.id||"Notification"}`;await triggerNativeShare(t,n)}async function shareCrashReport(e){const n=formatCrashReport(e),t=`Crash: ${e.name||e.message||"Error"}`;await triggerNativeShare(t,n)}async function shareAnalyticsReport(e){const n=formatAnalyticsReport(e),t=`Analytics: ${e.name||"Event"}`;await triggerNativeShare(t,n)}async function shareReduxReport(e){const n=formatReduxReport(e),t=`Redux: ${e.type||"Action"}`;await triggerNativeShare(t,n)}async function shareLogReport(e){const n=formatLogReport(e),t=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await triggerNativeShare(t,n)}function formatSocketReport(e){const n=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),o=e.duration!=null?`${e.duration}ms`:"Active / Open",i=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=["\u{1F50C} WEBSOCKET / SOCKET.IO REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4E1} Client: ${n}`,`\u{1F310} URL: ${e.url||"N/A"}`,`\u26A1 Status: ${t}`,`\u23F1\uFE0F Connected: ${i}`,`\u23F3 Duration: ${o}`,`\u{1F4E6} Total Frames: ${e.frames?.length||0} (${e.sentCount||0} sent, ${e.receivedCount||0} recvd)`,`\u{1F4CA} Data Size: ${(e.totalBytesSent||0)+(e.totalBytesReceived||0)} bytes`];return e.protocols&&s.push(`\u{1F4DC} Protocols: ${Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}`),e.closeCode!=null&&s.push(`\u{1F6D1} Close Code: ${e.closeCode} (${e.closeReason||"N/A"})`),e.error&&s.push(`\u274C Error: ${e.error}`),e.caller&&s.push(`\u{1F4CD} Caller: ${e.caller}`),e.query&&Object.keys(e.query).length>0&&(s.push(""),s.push("\u{1F50D} Query Parameters:"),s.push(safeStringify(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((a,h)=>{const S=a.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",c=a.eventName?` [${a.eventName}]`:"";s.push(`--- Frame #${h+1} (${S}${c}, ${a.type}, ${a.size||0}B) ---`),s.push(safeStringify(a.data))})),s.push(""),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
8
- `)}async function shareSocketReport(e){const n=formatSocketReport(e),t=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await triggerNativeShare(t,n)}exports.DEFAULT_CONSOLE_EXPORT_OPTIONS={includeStackTrace:!1,includeArguments:!1,includeCaller:!1,includeTimestamps:!1,includeAppInfo:!1,includeDuplicates:!1,ignorePattern:""};function generateConsoleLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),o=String(n.getMonth()+1).padStart(2,"0"),i=String(n.getFullYear()).slice(-2),s=Math.random().toString(36).substring(2,8).padEnd(6,"0");return`log_${t}${o}${i}_${s}.${e==="log"?"log":"txt"}`}function formatConsoleLogsExport(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return"No console logs to export.";const{includeStackTrace:o=!1,includeArguments:i=!1,includeCaller:s=!1,includeTimestamps:a=!1,includeAppInfo:h=!1,includeDuplicates:S=!1,ignorePattern:c=""}=t;let d=e;if(c&&c.trim().length>0)try{const r=new RegExp(c.trim(),"i");d=e.filter(m=>{const l=m.message||"",f=m.rawArgs?safeStringify(m.rawArgs):"",$=m.caller||"";return!r.test(l)&&!r.test(f)&&!r.test($)})}catch{}if(d.length===0)return"No console logs to export (all filtered out).";const R=new Date().toLocaleString(),u="********************************************************************************",y=[];h&&y.push(`/${u}`,` * \u{1F4DC} CONSOLE LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${R}`,` * \u{1F4CA} Total Logs: ${e.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${u}/`,"");const g=e.map((r,m)=>{const l=m+1,f=(0,index_1.formatDateTime)(r.timestamp),$=(r.type||"info").toUpperCase(),C=S&&r.duplicateCount&&r.duplicateCount>1?` [DUPLICATES: \xD7${r.duplicateCount}]`:"",p=[`/${u}`,` * \u{1F4CC} LOG #${l} Starts [${$}]${a?` - ${f}`:""}${C}`,` ${u}/`];if(s&&r.caller&&p.push(`\u{1F4CD} Caller: ${r.caller}`),a&&p.push(`\u{1F552} Time: ${f}`),p.push(`\u{1F3F7}\uFE0F Level: ${$}`),r.sourceMethod&&r.sourceMethod!==r.type&&p.push(`\u2699\uFE0F Method: console.${r.sourceMethod}()`),p.push(""),p.push("\u{1F4AC} Message:"),p.push(r.message||"(Empty message)"),i&&r.rawArgs&&r.rawArgs.length>0&&(p.push(""),p.push("\u{1F4E6} Arguments / Data:"),p.push(safeStringify(r.rawArgs))),o&&(r.stack||r.errorStack)){p.push(""),p.push("\u{1F4DC} Stack Trace & Frames:");const O=(r.stack||r.errorStack||"").split(`
9
- `).map(A=>` ${A}`).join(`
10
- `);p.push(O)}return p.push(""),p.push(`/${u}`),p.push(` * \u{1F3C1} LOG #${l} Ends`),p.push(` ${u}/`),p.join(`
7
+ `)}async function triggerNativeShare(e,n,t){try{const a=t||`export_${Date.now()}.txt`,p=await(0,NativeInspector_1.writeNativeExportFile)(a,n);if(p){const s=a.endsWith(".json")?"application/json":(a.endsWith(".log")||a.endsWith(".txt"),"text/plain");if(await(0,NativeInspector_1.shareNativeFile)(p,s,e))return}await react_native_1.Share.share({title:e,message:n,url:p||void 0},{dialogTitle:e,subject:e})}catch(a){a?.message!=="User did not share"&&react_native_1.Alert.alert("Share Error",a?.message||"Failed to open share sheet")}}async function shareApiReport(e){const n=formatApiReport(e),t=`api_${e.id??Date.now()}.txt`,a=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await triggerNativeShare(a,n,t)}async function sharePushReport(e){const n=formatPushReport(e),t=`push_${e.id??Date.now()}.txt`,a=`Push: ${e.title||e.id||"Notification"}`;await triggerNativeShare(a,n,t)}async function shareCrashReport(e){const n=formatCrashReport(e),t=`crash_${e.timestamp??Date.now()}.txt`,a=`Crash: ${e.name||e.message||"Error"}`;await triggerNativeShare(a,n,t)}async function shareAnalyticsReport(e){const n=formatAnalyticsReport(e),t=`analytics_${e.id??Date.now()}.txt`,a=`Analytics: ${e.name||"Event"}`;await triggerNativeShare(a,n,t)}async function shareReduxReport(e){const n=formatReduxReport(e),t=`redux_${e.id??Date.now()}.txt`,a=`Redux: ${e.type||"Action"}`;await triggerNativeShare(a,n,t)}async function shareLogReport(e){const n=formatLogReport(e),t=`log_${e.id??Date.now()}.txt`,a=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await triggerNativeShare(a,n,t)}function formatSocketReport(e){const n=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),a=e.duration!=null?`${e.duration}ms`:"Active / Open",p=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=["\u{1F50C} WEBSOCKET / SOCKET.IO REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4E1} Client: ${n}`,`\u{1F310} URL: ${e.url||"N/A"}`,`\u26A1 Status: ${t}`,`\u23F1\uFE0F Connected: ${p}`,`\u23F3 Duration: ${a}`,`\u{1F4E6} Total Frames: ${e.frames?.length||0} (${e.sentCount||0} sent, ${e.receivedCount||0} recvd)`,`\u{1F4CA} Data Size: ${(e.totalBytesSent||0)+(e.totalBytesReceived||0)} bytes`];return e.protocols&&s.push(`\u{1F4DC} Protocols: ${Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}`),e.closeCode!=null&&s.push(`\u{1F6D1} Close Code: ${e.closeCode} (${e.closeReason||"N/A"})`),e.error&&s.push(`\u274C Error: ${e.error}`),e.caller&&s.push(`\u{1F4CD} Caller: ${e.caller}`),e.query&&Object.keys(e.query).length>0&&(s.push(""),s.push("\u{1F50D} Query Parameters:"),s.push(safeStringify(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((i,T)=>{const E=i.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",S=i.eventName?` [${i.eventName}]`:"";s.push(`--- Frame #${T+1} (${E}${S}, ${i.type}, ${i.size||0}B) ---`),s.push(safeStringify(i.data))})),s.push(""),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
8
+ `)}async function shareSocketReport(e){const n=formatSocketReport(e),t=`socket_${e.id??Date.now()}.txt`,a=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await triggerNativeShare(a,n,t)}exports.DEFAULT_CONSOLE_EXPORT_OPTIONS={includeStackTrace:!1,includeArguments:!1,includeCaller:!1,includeTimestamps:!1,includeAppInfo:!1,includeDuplicates:!1,ignorePattern:""};function generateConsoleLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),a=String(n.getMonth()+1).padStart(2,"0"),p=String(n.getFullYear()).slice(-2),s=Math.random().toString(36).substring(2,8).padEnd(6,"0");return`log_${t}${a}${p}_${s}.${e==="log"?"log":"txt"}`}function formatConsoleLogsExport(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return"No console logs to export.";const{includeStackTrace:a=!1,includeArguments:p=!1,includeCaller:s=!1,includeTimestamps:i=!1,includeAppInfo:T=!1,includeDuplicates:E=!1,ignorePattern:S=""}=t;let N=e;if(S&&S.trim().length>0)try{const c=new RegExp(S.trim(),"i");N=e.filter(r=>{const o=r.message||"",l=r.rawArgs?safeStringify(r.rawArgs):"",h=r.caller||"";return!c.test(o)&&!c.test(l)&&!c.test(h)})}catch{}if(N.length===0)return"No console logs to export (all filtered out).";const C=new Date().toLocaleString(),f="********************************************************************************",d=[];T&&d.push(`/${f}`,` * \u{1F4DC} CONSOLE LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${C}`,` * \u{1F4CA} Total Logs: ${e.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${f}/`,"");const y=e.map((c,r)=>{const o=r+1,l=(0,index_1.formatDateTime)(c.timestamp),h=(c.type||"info").toUpperCase(),$=E&&c.duplicateCount&&c.duplicateCount>1?` [DUPLICATES: \xD7${c.duplicateCount}]`:"",m=[`/${f}`,` * \u{1F4CC} LOG #${o} Starts [${h}]${i?` - ${l}`:""}${$}`,` ${f}/`];if(s&&c.caller&&m.push(`\u{1F4CD} Caller: ${c.caller}`),i&&m.push(`\u{1F552} Time: ${l}`),m.push(`\u{1F3F7}\uFE0F Level: ${h}`),c.sourceMethod&&c.sourceMethod!==c.type&&m.push(`\u2699\uFE0F Method: console.${c.sourceMethod}()`),m.push(""),m.push("\u{1F4AC} Message:"),m.push(c.message||"(Empty message)"),p&&c.rawArgs&&c.rawArgs.length>0&&(m.push(""),m.push("\u{1F4E6} Arguments / Data:"),m.push(safeStringify(c.rawArgs))),a&&(c.stack||c.errorStack)){m.push(""),m.push("\u{1F4DC} Stack Trace & Frames:");const R=(c.stack||c.errorStack||"").split(`
9
+ `).map(u=>` ${u}`).join(`
10
+ `);m.push(R)}return m.push(""),m.push(`/${f}`),m.push(` * \u{1F3C1} LOG #${o} Ends`),m.push(` ${f}/`),m.join(`
11
11
  `)}).join(`
12
12
 
13
- `),T=h?["",`/${u}`," * \u{1F3C1} END OF CONSOLE LOGS EXPORT",` ${u}/`].join(`
13
+ `),x=T?["",`/${f}`," * \u{1F3C1} END OF CONSOLE LOGS EXPORT",` ${f}/`].join(`
14
+ `):"";return`${d.join(`
15
+ `)}${y}${x}`}function estimateConsoleLogsExportSize(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const a=Math.min(e.length,20),p=e.slice(0,a),i=formatConsoleLogsExport(p,n,t).length/a;return Math.round(i*e.length)}async function shareConsoleLogs(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS,a){const p=formatConsoleLogsExport(e,n,t),s=generateConsoleLogsFilename(n);await triggerNativeShare(a||s,p,s)}exports.DEFAULT_NETWORK_EXPORT_OPTIONS={includeRequestHeaders:!1,includeRequestBody:!1,includeResponseHeaders:!1,includeResponseBody:!1,includeCurlCommand:!1,includeTimestamps:!1,includeAppInfo:!1,ignorePattern:""};function generateNetworkLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),a=String(n.getMonth()+1).padStart(2,"0"),p=String(n.getFullYear()).slice(-2),s=Math.random().toString(36).substring(2,8).padEnd(6,"0");return`api_${t}${a}${p}_${s}.${e==="log"?"log":"txt"}`}function formatNetworkLogsExport(e,n="txt",t=exports.DEFAULT_NETWORK_EXPORT_OPTIONS){if(!e||e.length===0)return"No API requests to export.";const{includeRequestHeaders:a=!1,includeRequestBody:p=!1,includeResponseHeaders:s=!1,includeResponseBody:i=!1,includeCurlCommand:T=!1,includeTimestamps:E=!1,includeAppInfo:S=!1,ignorePattern:N=""}=t;let g=e;if(N&&N.trim().length>0)try{const r=new RegExp(N.trim(),"i");g=e.filter(o=>{const l=o.url||"",h=o.method||"",$=o.client||"",m=o.request?safeStringify(o.request):"",R=o.response?safeStringify(o.response):"",u=o.requestHeaders?safeStringify(o.requestHeaders):"",O=o.responseHeaders?safeStringify(o.responseHeaders):"";return!r.test(l)&&!r.test(h)&&!r.test($)&&!r.test(m)&&!r.test(R)&&!r.test(u)&&!r.test(O)})}catch{}if(g.length===0)return"No API requests to export (all filtered out).";const f=new Date().toLocaleString(),d="********************************************************************************";if(n==="json"){const r=g.map((o,l)=>{const h={index:l+1,id:o.id,url:o.url,method:(o.method||"GET").toUpperCase(),status:o.status,duration:o.duration,startTime:o.startTime,client:o.client};return a&&o.requestHeaders&&(h.requestHeaders=o.requestHeaders),p&&o.request!=null&&(h.request=o.request),s&&o.responseHeaders&&(h.responseHeaders=o.responseHeaders),i&&o.response!=null&&(h.response=o.response),T&&(h.curl=(0,index_1.getCurlCommand)(o)),h});return JSON.stringify(r,null,2)}if(n==="curl"){const r=["#!/usr/bin/env bash","# ============================================================================== ","# \u{1F680} API Network Logs - cURL Script Export",`# \u{1F552} Exported At: ${f}`,`# \u{1F4CA} Total Commands: ${g.length}`,"# \u2699\uFE0F Generator: React Native InApp Inspector",`# ==============================================================================
16
+ `];return g.forEach((o,l)=>{const h=l+1,$=(o.method||"GET").toUpperCase(),m=o.status===0?"Failed / Error":o.status!=null?String(o.status):"Pending",R=o.duration!=null?`${o.duration}ms`:"N/A",u=(0,index_1.formatDateTime)(o.startTime||Date.now());r.push(`# Request #${h}: [${$}] ${o.url||"N/A"} (Status: ${m}, ${R}, ${u})`);const O=(0,index_1.getCurlCommand)(o);O?r.push(O):r.push(`curl -X ${$} "${o.url||""}"`),r.push("")}),r.join(`
17
+ `)}const y=[];S&&y.push(`/${d}`,` * \u{1F680} API NETWORK LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${f}`,` * \u{1F4CA} Total Requests: ${g.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${d}/`,"");const x=g.map((r,o)=>{const l=o+1,h=(0,index_1.formatDateTime)(r.startTime||Date.now()),$=(r.method||"GET").toUpperCase(),m=r.status===0?"Failed / Network Error":r.status!=null?`${r.status} ${r.status===200?"OK":""}`.trim():"Pending",R=r.duration!=null?`${r.duration}ms`:"N/A",u=[`/${d}`,` * \u{1F4CC} REQUEST #${l} Starts [${$}] [${m}] [${R}]${E?` - ${h}`:""}`,` ${d}/`];if(u.push(`\u{1F310} URL: ${r.url||"N/A"}`),u.push(`\u{1F4CC} Method: ${$}`),u.push(`\u{1F4CA} Status: ${m}`),u.push(`\u23F1\uFE0F Duration: ${R}`),E&&u.push(`\u{1F552} Time: ${h}`),r.client&&u.push(`\u{1F50C} Client: ${r.client.toUpperCase()}`),a&&r.requestHeaders&&Object.keys(r.requestHeaders).length>0&&(u.push(""),u.push("\u{1F4CB} Request Headers:"),u.push(safeStringify(r.requestHeaders))),p&&r.request!=null&&r.request!==""&&(u.push(""),u.push("\u{1F4DD} Request Body:"),u.push(safeStringify(r.request))),s&&r.responseHeaders&&Object.keys(r.responseHeaders).length>0&&(u.push(""),u.push("\u{1F4D1} Response Headers:"),u.push(safeStringify(r.responseHeaders))),i&&r.response!=null&&r.response!==""&&(u.push(""),u.push("\u{1F4E5} Response Data:"),u.push(safeStringify(r.response))),T){const O=(0,index_1.getCurlCommand)(r);O&&(u.push(""),u.push("\u{1F4BB} cURL Command:"),u.push(O))}return u.push(""),u.push(`/${d}`),u.push(` * \u{1F3C1} REQUEST #${l} Ends`),u.push(` ${d}/`),u.join(`
18
+ `)}).join(`
19
+
20
+ `),c=S?["",`/${d}`," * \u{1F3C1} END OF API NETWORK LOGS EXPORT",` ${d}/`].join(`
14
21
  `):"";return`${y.join(`
15
- `)}${g}${T}`}function estimateConsoleLogsExportSize(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const o=Math.min(e.length,20),i=e.slice(0,o),a=formatConsoleLogsExport(i,n,t).length/o;return Math.round(a*e.length)}async function shareConsoleLogs(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS,o){const i=formatConsoleLogsExport(e,n,t),s=generateConsoleLogsFilename(n);await triggerNativeShare(o||s,i)}
22
+ `)}${x}${c}`}function estimateNetworkLogsExportSize(e,n="txt",t=exports.DEFAULT_NETWORK_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const a=Math.min(e.length,10),p=e.slice(0,a),i=formatNetworkLogsExport(p,n,t).length/a;return Math.round(i*e.length)}async function shareNetworkLogs(e,n="txt",t=exports.DEFAULT_NETWORK_EXPORT_OPTIONS,a){const p=formatNetworkLogsExport(e,n,t),s=generateNetworkLogsFilename(n);await triggerNativeShare(a||s,p,s)}