@buoy-gg/console 7.0.77 → 7.0.79

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ConsoleLogList=ConsoleLogList;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _useConsoleLogs=require("../hooks/useConsoleLogs");var _sharedUi=require("@buoy-gg/shared-ui");var _consoleLogStore=require("../store/consoleLogStore");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const LEVEL_COLOR={verbose:"#9b9b9b",info:_sharedUi.night.color.text,warning:"#e2c08d",error:"#f48771"};function formatTime(t){const o=new Date(t);const e=(r,n=2)=>String(r).padStart(n,"0");return`${e(o.getHours())}:${e(o.getMinutes())}:${e(o.getSeconds())}.${e(o.getMilliseconds(),3)}`}function ConsoleLogList(){const{logs:t}=(0,_useConsoleLogs.useConsoleLogs)();const o=({item:e})=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.time,children:formatTime(e.timestamp)}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.level,{color:LEVEL_COLOR[e.level]}],children:e.level.toUpperCase()}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.message,{color:LEVEL_COLOR[e.level]}],numberOfLines:3,children:e.message})]});return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.headerTitle,children:["Console (",t.length,")"]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>(0,_consoleLogStore.clearEntries)(),style:styles.clearButton,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.clearText,children:"Clear"})})]}),(0,_jsxRuntime.jsx)(_reactNative.FlatList,{data:t,keyExtractor:e=>String(e.id),renderItem:o,ListEmptyComponent:(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-console-empty",otto:"printing",title:"No console logs captured yet",message:"console.log, .warn and .error from your app land here as they run."}),contentContainerStyle:t.length===0?styles.emptyContainer:void 0})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:8,borderBottomWidth:_reactNative.StyleSheet.hairlineWidth,borderBottomColor:_sharedUi.night.color.border},headerTitle:{color:_sharedUi.night.color.text,fontSize:13,fontWeight:"600"},clearButton:{paddingHorizontal:10,paddingVertical:4,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},clearText:{color:_sharedUi.night.color.text,fontSize:12},row:{flexDirection:"row",paddingHorizontal:12,paddingVertical:4,borderBottomWidth:_reactNative.StyleSheet.hairlineWidth,borderBottomColor:_sharedUi.night.color.separator,gap:8},time:{color:_sharedUi.night.color.textTertiary,fontSize:11,fontVariant:["tabular-nums"],minWidth:86},level:{fontSize:11,fontWeight:"700",minWidth:44},message:{flex:1,fontSize:12,fontFamily:_sharedUi.monoFont},empty:{color:_sharedUi.night.color.textTertiary,fontSize:13,textAlign:"center"},emptyContainer:{flexGrow:1,alignItems:"center",justifyContent:"center"}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ConsoleLogList=ConsoleLogList;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _useConsoleLogs=require("../hooks/useConsoleLogs");var _sharedUi=require("@buoy-gg/shared-ui");var _consoleLogStore=require("../store/consoleLogStore");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const LEVEL_COLOR={verbose:"#9b9b9b",info:_sharedUi.night.color.text,warning:"#e2c08d",error:"#f48771"};function formatTime(t){const o=new Date(t);const e=(r,n=2)=>String(r).padStart(n,"0");return`${e(o.getHours())}:${e(o.getMinutes())}:${e(o.getSeconds())}.${e(o.getMilliseconds(),3)}`}function ConsoleLogList(){const{logs:t}=(0,_useConsoleLogs.useConsoleLogs)();const o=({item:e})=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.time,children:formatTime(e.timestamp)}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.level,{color:LEVEL_COLOR[e.level]}],children:e.level.toUpperCase()}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.message,{color:LEVEL_COLOR[e.level]}],numberOfLines:3,children:e.message})]});return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.headerTitle,children:["Console (",t.length,")"]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>(0,_consoleLogStore.clearEntries)(),style:styles.clearButton,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.clearText,children:"Clear"})})]}),(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",data:t,keyExtractor:e=>String(e.id),renderItem:o,ListEmptyComponent:(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-console-empty",otto:"printing",title:"No console logs captured yet",message:"console.log, .warn and .error from your app land here as they run."}),contentContainerStyle:t.length===0?styles.emptyContainer:void 0})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:8,borderBottomWidth:_reactNative.StyleSheet.hairlineWidth,borderBottomColor:_sharedUi.night.color.border},headerTitle:{color:_sharedUi.night.color.text,fontSize:13,fontWeight:"600"},clearButton:{paddingHorizontal:10,paddingVertical:4,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},clearText:{color:_sharedUi.night.color.text,fontSize:12},row:{flexDirection:"row",paddingHorizontal:12,paddingVertical:4,borderBottomWidth:_reactNative.StyleSheet.hairlineWidth,borderBottomColor:_sharedUi.night.color.separator,gap:8},time:{color:_sharedUi.night.color.textTertiary,fontSize:11,fontVariant:["tabular-nums"],minWidth:86},level:{fontSize:11,fontWeight:"700",minWidth:44},message:{flex:1,fontSize:12,fontFamily:_sharedUi.monoFont},empty:{color:_sharedUi.night.color.textTertiary,fontSize:13,textAlign:"center"},emptyContainer:{flexGrow:1,alignItems:"center",justifyContent:"center"}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ConsoleBody=ConsoleBody;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _ConsoleMessageRow=require("./ConsoleMessageRow");var _consoleFilter=require("./consoleFilter");var _consoleLogStore=require("../store/consoleLogStore");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var s=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(t,c){if(!c&&t&&t.__esModule)return t;var n,i,l={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return l;if(n=c?o:s){if(n.has(t))return n.get(t);n.set(t,l)}for(const a in t)"default"!==a&&{}.hasOwnProperty.call(t,a)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,a))&&(i.get||i.set)?n(l,a,i):l[a]=t[a]);return l})(e,r)}function ConsoleBody({c:e}){if(e.view==="filters")return(0,_jsxRuntime.jsx)(FiltersView,{c:e});return(0,_jsxRuntime.jsx)(ConsoleList,{c:e})}function ConsoleList({c:e}){const r=(0,_react.useRef)(null);const s=(0,_react.useRef)(true);const o=(0,_react.useCallback)(({item:t})=>(0,_jsxRuntime.jsx)(_ConsoleMessageRow.ConsoleMessageRow,{row:t,showTimestamps:e.showTimestamps,onToggleGroup:e.onToggleGroup,onToggleCluster:e.onToggleCluster}),[e.showTimestamps,e.onToggleGroup,e.onToggleCluster]);return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{testID:"buoy-console-list",ref:r,data:e.rows,keyExtractor:t=>t.key,renderItem:o,style:styles.list,..._sharedUi.LOG_LIST_PRESET,onContentSizeChange:()=>{if(s.current)r.current?.scrollToEnd({animated:false})},onScroll:t=>{const{contentOffset:c,contentSize:n,layoutMeasurement:i}=t.nativeEvent;const l=n.height-(c.y+i.height);s.current=l<40},scrollEventThrottle:100})}function CheckRow({testID:e,on:r,label:s,subtext:o,onPress:t}){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{testID:e,style:styles.row,onPress:t,activeOpacity:.7,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.checkbox,r&&styles.checkboxOn],children:r?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:12,color:_sharedUi.night.color.onAccent,strokeWidth:3}):null}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowTextCol,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:s}),o?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowSubtext,children:o}):null]})]})}function SectionLabel({text:e}){return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionLabel,children:e})}function FiltersView({c:e}){const r=(0,_react.useSyncExternalStore)(_consoleLogStore.subscribePreserveLog,_consoleLogStore.getPreserveLog,_consoleLogStore.getPreserveLog);const s=o=>e.setLevelsMask({...e.levelsMask,[o]:!e.levelsMask[o]});return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{testID:"buoy-console-filters",style:styles.subView,contentContainerStyle:styles.subViewContent,children:[(0,_jsxRuntime.jsx)(SectionLabel,{text:"Log levels"}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-console-levels-default",style:styles.presetRow,onPress:()=>e.setLevelsMask({..._consoleFilter.DEFAULT_LEVELS}),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.presetText,children:"Default (hide verbose)"})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-console-levels-all",style:styles.presetRow,onPress:()=>e.setLevelsMask({..._consoleFilter.ALL_LEVELS}),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.presetText,children:"All levels"})}),_consoleFilter.LEVEL_ORDER.map(o=>(0,_jsxRuntime.jsx)(CheckRow,{testID:`buoy-console-level-${o}`,on:e.levelsMask[o],label:_consoleFilter.LEVEL_LABEL[o],onPress:()=>s(o)},o)),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.divider}),(0,_jsxRuntime.jsx)(SectionLabel,{text:"Settings"}),(0,_jsxRuntime.jsx)(CheckRow,{testID:"buoy-console-timestamps",on:e.showTimestamps,label:"Show timestamps",onPress:()=>e.setShowTimestamps(o=>!o)}),(0,_jsxRuntime.jsx)(CheckRow,{testID:"buoy-console-preserve",on:r,label:"Preserve log",subtext:"Do not clear log on reload",onPress:()=>(0,_consoleLogStore.setPreserveLog)(!r)})]})}const styles=_reactNative.StyleSheet.create({list:{flex:1,backgroundColor:"transparent"},subView:{flex:1,backgroundColor:"transparent"},subViewContent:{padding:12},sectionLabel:{color:_sharedUi.night.color.textTertiary,fontSize:11,textTransform:"uppercase",letterSpacing:.5,marginTop:4,marginBottom:4,paddingHorizontal:8},presetRow:{paddingVertical:10,paddingHorizontal:8},presetText:{color:_sharedUi.night.color.accent,fontSize:14,fontWeight:"600"},divider:{height:_reactNative.StyleSheet.hairlineWidth,backgroundColor:_sharedUi.night.color.border,marginVertical:6},row:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:8,gap:12},rowTextCol:{flexDirection:"column",flex:1},rowLabel:{color:_sharedUi.night.color.text,fontSize:14},rowSubtext:{color:_sharedUi.night.color.textTertiary,fontSize:12,marginTop:1},checkbox:{width:18,height:18,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.fillTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:_sharedUi.night.color.accent,borderColor:_sharedUi.night.color.accent}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ConsoleBody=ConsoleBody;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _ConsoleMessageRow=require("./ConsoleMessageRow");var _consoleFilter=require("./consoleFilter");var _consoleLogStore=require("../store/consoleLogStore");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(e,r){if("function"==typeof WeakMap)var s=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(t,c){if(!c&&t&&t.__esModule)return t;var n,i,l={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return l;if(n=c?o:s){if(n.has(t))return n.get(t);n.set(t,l)}for(const a in t)"default"!==a&&{}.hasOwnProperty.call(t,a)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,a))&&(i.get||i.set)?n(l,a,i):l[a]=t[a]);return l})(e,r)}function ConsoleBody({c:e}){if(e.view==="filters")return(0,_jsxRuntime.jsx)(FiltersView,{c:e});return(0,_jsxRuntime.jsx)(ConsoleList,{c:e})}function ConsoleList({c:e}){const r=(0,_react.useRef)(null);const s=(0,_react.useRef)(true);const o=(0,_react.useCallback)(({item:t})=>(0,_jsxRuntime.jsx)(_ConsoleMessageRow.ConsoleMessageRow,{row:t,showTimestamps:e.showTimestamps,onToggleGroup:e.onToggleGroup,onToggleCluster:e.onToggleCluster}),[e.showTimestamps,e.onToggleGroup,e.onToggleCluster]);return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",testID:"buoy-console-list",ref:r,data:e.rows,keyExtractor:t=>t.key,renderItem:o,style:styles.list,..._sharedUi.LOG_LIST_PRESET,onContentSizeChange:()=>{if(s.current)r.current?.scrollToEnd({animated:false})},onScroll:t=>{const{contentOffset:c,contentSize:n,layoutMeasurement:i}=t.nativeEvent;const l=n.height-(c.y+i.height);s.current=l<40},scrollEventThrottle:100})}function CheckRow({testID:e,on:r,label:s,subtext:o,onPress:t}){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{testID:e,style:styles.row,onPress:t,activeOpacity:.7,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.checkbox,r&&styles.checkboxOn],children:r?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:12,color:_sharedUi.night.color.onAccent,strokeWidth:3}):null}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.rowTextCol,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowLabel,children:s}),o?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.rowSubtext,children:o}):null]})]})}function SectionLabel({text:e}){return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionLabel,children:e})}function FiltersView({c:e}){const r=(0,_react.useSyncExternalStore)(_consoleLogStore.subscribePreserveLog,_consoleLogStore.getPreserveLog,_consoleLogStore.getPreserveLog);const s=o=>e.setLevelsMask({...e.levelsMask,[o]:!e.levelsMask[o]});return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",testID:"buoy-console-filters",style:styles.subView,contentContainerStyle:styles.subViewContent,children:[(0,_jsxRuntime.jsx)(SectionLabel,{text:"Log levels"}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-console-levels-default",style:styles.presetRow,onPress:()=>e.setLevelsMask({..._consoleFilter.DEFAULT_LEVELS}),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.presetText,children:"Default (hide verbose)"})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{testID:"buoy-console-levels-all",style:styles.presetRow,onPress:()=>e.setLevelsMask({..._consoleFilter.ALL_LEVELS}),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.presetText,children:"All levels"})}),_consoleFilter.LEVEL_ORDER.map(o=>(0,_jsxRuntime.jsx)(CheckRow,{testID:`buoy-console-level-${o}`,on:e.levelsMask[o],label:_consoleFilter.LEVEL_LABEL[o],onPress:()=>s(o)},o)),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.divider}),(0,_jsxRuntime.jsx)(SectionLabel,{text:"Settings"}),(0,_jsxRuntime.jsx)(CheckRow,{testID:"buoy-console-timestamps",on:e.showTimestamps,label:"Show timestamps",onPress:()=>e.setShowTimestamps(o=>!o)}),(0,_jsxRuntime.jsx)(CheckRow,{testID:"buoy-console-preserve",on:r,label:"Preserve log",subtext:"Do not clear log on reload",onPress:()=>(0,_consoleLogStore.setPreserveLog)(!r)})]})}const styles=_reactNative.StyleSheet.create({list:{flex:1,backgroundColor:"transparent"},subView:{flex:1,backgroundColor:"transparent"},subViewContent:{padding:12},sectionLabel:{color:_sharedUi.night.color.textTertiary,fontSize:11,textTransform:"uppercase",letterSpacing:.5,marginTop:4,marginBottom:4,paddingHorizontal:8},presetRow:{paddingVertical:10,paddingHorizontal:8},presetText:{color:_sharedUi.night.color.accent,fontSize:14,fontWeight:"600"},divider:{height:_reactNative.StyleSheet.hairlineWidth,backgroundColor:_sharedUi.night.color.border,marginVertical:6},row:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:8,gap:12},rowTextCol:{flexDirection:"column",flex:1},rowLabel:{color:_sharedUi.night.color.text,fontSize:14},rowSubtext:{color:_sharedUi.night.color.textTertiary,fontSize:12,marginTop:1},checkbox:{width:18,height:18,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.fillTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:_sharedUi.night.color.accent,borderColor:_sharedUi.night.color.accent}});
@@ -1 +1 @@
1
- "use strict";import S from"react";import{View as s,Text as i,FlatList as p,TouchableOpacity as f,StyleSheet as c}from"react-native";import{useConsoleLogs as h}from"../hooks/useConsoleLogs";import{night as o,ToolEmptyState as y,monoFont as u}from"@buoy-gg/shared-ui";import{clearEntries as x}from"../store/consoleLogStore";import{jsx as r,jsxs as a}from"react/jsx-runtime";const d={verbose:"#9b9b9b",info:o.color.text,warning:"#e2c08d",error:"#f48771"};function b(l){const n=new Date(l);const e=(m,g=2)=>String(m).padStart(g,"0");return`${e(n.getHours())}:${e(n.getMinutes())}:${e(n.getSeconds())}.${e(n.getMilliseconds(),3)}`}export function ConsoleLogList(){const{logs:l}=h();const n=({item:e})=>a(s,{style:t.row,children:[r(i,{style:t.time,children:b(e.timestamp)}),r(i,{style:[t.level,{color:d[e.level]}],children:e.level.toUpperCase()}),r(i,{style:[t.message,{color:d[e.level]}],numberOfLines:3,children:e.message})]});return a(s,{style:t.container,children:[a(s,{style:t.header,children:[a(i,{style:t.headerTitle,children:["Console (",l.length,")"]}),r(f,{onPress:()=>x(),style:t.clearButton,children:r(i,{style:t.clearText,children:"Clear"})})]}),r(p,{data:l,keyExtractor:e=>String(e.id),renderItem:n,ListEmptyComponent:r(y,{testID:"buoy-console-empty",otto:"printing",title:"No console logs captured yet",message:"console.log, .warn and .error from your app land here as they run."}),contentContainerStyle:l.length===0?t.emptyContainer:void 0})]})}const t=c.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:8,borderBottomWidth:c.hairlineWidth,borderBottomColor:o.color.border},headerTitle:{color:o.color.text,fontSize:13,fontWeight:"600"},clearButton:{paddingHorizontal:10,paddingVertical:4,borderRadius:4,backgroundColor:o.color.surfaceElevated},clearText:{color:o.color.text,fontSize:12},row:{flexDirection:"row",paddingHorizontal:12,paddingVertical:4,borderBottomWidth:c.hairlineWidth,borderBottomColor:o.color.separator,gap:8},time:{color:o.color.textTertiary,fontSize:11,fontVariant:["tabular-nums"],minWidth:86},level:{fontSize:11,fontWeight:"700",minWidth:44},message:{flex:1,fontSize:12,fontFamily:u},empty:{color:o.color.textTertiary,fontSize:13,textAlign:"center"},emptyContainer:{flexGrow:1,alignItems:"center",justifyContent:"center"}});
1
+ "use strict";import S from"react";import{View as s,Text as i,FlatList as g,TouchableOpacity as f,StyleSheet as c}from"react-native";import{useConsoleLogs as h}from"../hooks/useConsoleLogs";import{night as o,ToolEmptyState as y,monoFont as u}from"@buoy-gg/shared-ui";import{clearEntries as x}from"../store/consoleLogStore";import{jsx as r,jsxs as a}from"react/jsx-runtime";const d={verbose:"#9b9b9b",info:o.color.text,warning:"#e2c08d",error:"#f48771"};function b(l){const n=new Date(l);const e=(m,p=2)=>String(m).padStart(p,"0");return`${e(n.getHours())}:${e(n.getMinutes())}:${e(n.getSeconds())}.${e(n.getMilliseconds(),3)}`}export function ConsoleLogList(){const{logs:l}=h();const n=({item:e})=>a(s,{style:t.row,children:[r(i,{style:t.time,children:b(e.timestamp)}),r(i,{style:[t.level,{color:d[e.level]}],children:e.level.toUpperCase()}),r(i,{style:[t.message,{color:d[e.level]}],numberOfLines:3,children:e.message})]});return a(s,{style:t.container,children:[a(s,{style:t.header,children:[a(i,{style:t.headerTitle,children:["Console (",l.length,")"]}),r(f,{onPress:()=>x(),style:t.clearButton,children:r(i,{style:t.clearText,children:"Clear"})})]}),r(g,{keyboardShouldPersistTaps:"handled",data:l,keyExtractor:e=>String(e.id),renderItem:n,ListEmptyComponent:r(y,{testID:"buoy-console-empty",otto:"printing",title:"No console logs captured yet",message:"console.log, .warn and .error from your app land here as they run."}),contentContainerStyle:l.length===0?t.emptyContainer:void 0})]})}const t=c.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:8,borderBottomWidth:c.hairlineWidth,borderBottomColor:o.color.border},headerTitle:{color:o.color.text,fontSize:13,fontWeight:"600"},clearButton:{paddingHorizontal:10,paddingVertical:4,borderRadius:4,backgroundColor:o.color.surfaceElevated},clearText:{color:o.color.text,fontSize:12},row:{flexDirection:"row",paddingHorizontal:12,paddingVertical:4,borderBottomWidth:c.hairlineWidth,borderBottomColor:o.color.separator,gap:8},time:{color:o.color.textTertiary,fontSize:11,fontVariant:["tabular-nums"],minWidth:86},level:{fontSize:11,fontWeight:"700",minWidth:44},message:{flex:1,fontSize:12,fontFamily:u},empty:{color:o.color.textTertiary,fontSize:13,textAlign:"center"},emptyContainer:{flexGrow:1,alignItems:"center",justifyContent:"center"}});
@@ -1 +1 @@
1
- "use strict";import j,{useCallback as L,useRef as m,useSyncExternalStore as T}from"react";import{View as a,Text as c,FlatList as S,TouchableOpacity as u,ScrollView as C,StyleSheet as h}from"react-native";import{night as s,Check as k,LOG_LIST_PRESET as v}from"@buoy-gg/shared-ui";import{ConsoleMessageRow as E}from"./ConsoleMessageRow";import{ALL_LEVELS as D,DEFAULT_LEVELS as V,LEVEL_LABEL as I,LEVEL_ORDER as R}from"./consoleFilter";import{getPreserveLog as p,setPreserveLog as P,subscribePreserveLog as z}from"../store/consoleLogStore";import{jsx as o,jsxs as d}from"react/jsx-runtime";export function ConsoleBody({c:e}){if(e.view==="filters")return o(_,{c:e});return o(M,{c:e})}function M({c:e}){const l=m(null);const i=m(true);const t=L(({item:n})=>o(E,{row:n,showTimestamps:e.showTimestamps,onToggleGroup:e.onToggleGroup,onToggleCluster:e.onToggleCluster}),[e.showTimestamps,e.onToggleGroup,e.onToggleCluster]);return o(S,{testID:"buoy-console-list",ref:l,data:e.rows,keyExtractor:n=>n.key,renderItem:t,style:r.list,...v,onContentSizeChange:()=>{if(i.current)l.current?.scrollToEnd({animated:false})},onScroll:n=>{const{contentOffset:f,contentSize:y,layoutMeasurement:w}=n.nativeEvent;const x=y.height-(f.y+w.height);i.current=x<40},scrollEventThrottle:100})}function g({testID:e,on:l,label:i,subtext:t,onPress:n}){return d(u,{testID:e,style:r.row,onPress:n,activeOpacity:.7,children:[o(a,{style:[r.checkbox,l&&r.checkboxOn],children:l?o(k,{size:12,color:s.color.onAccent,strokeWidth:3}):null}),d(a,{style:r.rowTextCol,children:[o(c,{style:r.rowLabel,children:i}),t?o(c,{style:r.rowSubtext,children:t}):null]})]})}function b({text:e}){return o(c,{style:r.sectionLabel,children:e})}function _({c:e}){const l=T(z,p,p);const i=t=>e.setLevelsMask({...e.levelsMask,[t]:!e.levelsMask[t]});return d(C,{testID:"buoy-console-filters",style:r.subView,contentContainerStyle:r.subViewContent,children:[o(b,{text:"Log levels"}),o(u,{testID:"buoy-console-levels-default",style:r.presetRow,onPress:()=>e.setLevelsMask({...V}),children:o(c,{style:r.presetText,children:"Default (hide verbose)"})}),o(u,{testID:"buoy-console-levels-all",style:r.presetRow,onPress:()=>e.setLevelsMask({...D}),children:o(c,{style:r.presetText,children:"All levels"})}),R.map(t=>o(g,{testID:`buoy-console-level-${t}`,on:e.levelsMask[t],label:I[t],onPress:()=>i(t)},t)),o(a,{style:r.divider}),o(b,{text:"Settings"}),o(g,{testID:"buoy-console-timestamps",on:e.showTimestamps,label:"Show timestamps",onPress:()=>e.setShowTimestamps(t=>!t)}),o(g,{testID:"buoy-console-preserve",on:l,label:"Preserve log",subtext:"Do not clear log on reload",onPress:()=>P(!l)})]})}const r=h.create({list:{flex:1,backgroundColor:"transparent"},subView:{flex:1,backgroundColor:"transparent"},subViewContent:{padding:12},sectionLabel:{color:s.color.textTertiary,fontSize:11,textTransform:"uppercase",letterSpacing:.5,marginTop:4,marginBottom:4,paddingHorizontal:8},presetRow:{paddingVertical:10,paddingHorizontal:8},presetText:{color:s.color.accent,fontSize:14,fontWeight:"600"},divider:{height:h.hairlineWidth,backgroundColor:s.color.border,marginVertical:6},row:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:8,gap:12},rowTextCol:{flexDirection:"column",flex:1},rowLabel:{color:s.color.text,fontSize:14},rowSubtext:{color:s.color.textTertiary,fontSize:12,marginTop:1},checkbox:{width:18,height:18,borderRadius:4,borderWidth:1,borderColor:s.color.fillTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:s.color.accent,borderColor:s.color.accent}});
1
+ "use strict";import j,{useCallback as x,useRef as h,useSyncExternalStore as L}from"react";import{View as c,Text as a,FlatList as S,TouchableOpacity as d,ScrollView as k,StyleSheet as m}from"react-native";import{night as s,Check as C,LOG_LIST_PRESET as v}from"@buoy-gg/shared-ui";import{ConsoleMessageRow as E}from"./ConsoleMessageRow";import{ALL_LEVELS as D,DEFAULT_LEVELS as V,LEVEL_LABEL as I,LEVEL_ORDER as P}from"./consoleFilter";import{getPreserveLog as p,setPreserveLog as R,subscribePreserveLog as z}from"../store/consoleLogStore";import{jsx as o,jsxs as u}from"react/jsx-runtime";export function ConsoleBody({c:e}){if(e.view==="filters")return o(_,{c:e});return o(M,{c:e})}function M({c:e}){const l=h(null);const i=h(true);const t=x(({item:n})=>o(E,{row:n,showTimestamps:e.showTimestamps,onToggleGroup:e.onToggleGroup,onToggleCluster:e.onToggleCluster}),[e.showTimestamps,e.onToggleGroup,e.onToggleCluster]);return o(S,{keyboardShouldPersistTaps:"handled",testID:"buoy-console-list",ref:l,data:e.rows,keyExtractor:n=>n.key,renderItem:t,style:r.list,...v,onContentSizeChange:()=>{if(i.current)l.current?.scrollToEnd({animated:false})},onScroll:n=>{const{contentOffset:f,contentSize:y,layoutMeasurement:T}=n.nativeEvent;const w=y.height-(f.y+T.height);i.current=w<40},scrollEventThrottle:100})}function g({testID:e,on:l,label:i,subtext:t,onPress:n}){return u(d,{testID:e,style:r.row,onPress:n,activeOpacity:.7,children:[o(c,{style:[r.checkbox,l&&r.checkboxOn],children:l?o(C,{size:12,color:s.color.onAccent,strokeWidth:3}):null}),u(c,{style:r.rowTextCol,children:[o(a,{style:r.rowLabel,children:i}),t?o(a,{style:r.rowSubtext,children:t}):null]})]})}function b({text:e}){return o(a,{style:r.sectionLabel,children:e})}function _({c:e}){const l=L(z,p,p);const i=t=>e.setLevelsMask({...e.levelsMask,[t]:!e.levelsMask[t]});return u(k,{keyboardShouldPersistTaps:"handled",testID:"buoy-console-filters",style:r.subView,contentContainerStyle:r.subViewContent,children:[o(b,{text:"Log levels"}),o(d,{testID:"buoy-console-levels-default",style:r.presetRow,onPress:()=>e.setLevelsMask({...V}),children:o(a,{style:r.presetText,children:"Default (hide verbose)"})}),o(d,{testID:"buoy-console-levels-all",style:r.presetRow,onPress:()=>e.setLevelsMask({...D}),children:o(a,{style:r.presetText,children:"All levels"})}),P.map(t=>o(g,{testID:`buoy-console-level-${t}`,on:e.levelsMask[t],label:I[t],onPress:()=>i(t)},t)),o(c,{style:r.divider}),o(b,{text:"Settings"}),o(g,{testID:"buoy-console-timestamps",on:e.showTimestamps,label:"Show timestamps",onPress:()=>e.setShowTimestamps(t=>!t)}),o(g,{testID:"buoy-console-preserve",on:l,label:"Preserve log",subtext:"Do not clear log on reload",onPress:()=>R(!l)})]})}const r=m.create({list:{flex:1,backgroundColor:"transparent"},subView:{flex:1,backgroundColor:"transparent"},subViewContent:{padding:12},sectionLabel:{color:s.color.textTertiary,fontSize:11,textTransform:"uppercase",letterSpacing:.5,marginTop:4,marginBottom:4,paddingHorizontal:8},presetRow:{paddingVertical:10,paddingHorizontal:8},presetText:{color:s.color.accent,fontSize:14,fontWeight:"600"},divider:{height:m.hairlineWidth,backgroundColor:s.color.border,marginVertical:6},row:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:8,gap:12},rowTextCol:{flexDirection:"column",flex:1},rowLabel:{color:s.color.text,fontSize:14},rowSubtext:{color:s.color.textTertiary,fontSize:12,marginTop:1},checkbox:{width:18,height:18,borderRadius:4,borderWidth:1,borderColor:s.color.fillTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:s.color.accent,borderColor:s.color.accent}});
package/lib/web/index.mjs CHANGED
@@ -14,4 +14,4 @@ ${at(s.componentStack)}`:"";Ee({id:k.allocId(),method:"error",level:"error",args
14
14
  This error is located at:
15
15
  ${at(e.componentStack)}`:"",a=`${t} ${r}${n}`;Ee({id:k.allocId(),method:"error",level:"error",args:[t,r,...n?[n.trim()]:[]],message:a,timestamp:Date.now(),stack:Lr(e),fatal:true},o)}function Ir(){let e=globalThis.RN$registerExceptionListener;return typeof e!="function"?false:(e(t=>{try{re||Ar(t)}catch{}}),true)}function Or(){let e=globalThis;if(ot||false||typeof e.addEventListener!="function")return;ot=true;let t=(r,o)=>{if(!re){if(r instanceof Error){if(rt.has(r)||ke.has(r))return;ke.add(r)}try{ct(r,o)}catch{}}};e.addEventListener("error",r=>t(r.error??r.message,"[UNCAUGHT]")),e.addEventListener("unhandledrejection",r=>t(r.reason,"[UNHANDLED REJECTION]"))}function Te(){if(Or(),we)return;let e=Ir(),t=globalThis.ErrorUtils;if(typeof t?.setGlobalHandler!="function"){we=e;return}we=true;let r=typeof t.getGlobalHandler=="function"?t.getGlobalHandler():void 0;t.setGlobalHandler((o,n)=>{try{re||ct(o,n===false?"[UNCAUGHT]":"[FATAL]")}catch{}typeof r=="function"&&r(o,n)})}function fe(){if(nr().status!=="locked"&&(re=false,Te(),!de)){de=true;for(let e of tt){let t=console[e];typeof t=="function"&&(xe[e]=t,console[e]=function r(...o){it(e,o,r),t.apply(console,o)})}}}function $e(){if(re=true,!!de){de=false;for(let e of tt){let t=xe[e];t&&(console[e]=t),delete xe[e]}}}function ge(e){return k.subscribe(e)}function K(){return k.getSnapshot()}function oe(){Ie(),k.clear()}function Dr(e){k.set(e.filter(t=>!ye(t.args??[t.message])))}function Nr(e){return k.onClear(e)}var ut="@react_buoy_console_preserve",Le="@react_buoy_console_buffer",Br=600,M=false,ne=false,U=0,J=Promise.resolve(),Ae=new Set,pe=null;function dt(){for(let e of Ae)e()}function ft(){!M||!_()||(pe&&clearTimeout(pe),pe=setTimeout(gt,Br))}async function gt(){if(pe=null,!(!M||!_()))try{let e=k.getSnapshot().map(r=>({...r,args:Ze(r.args)})),t=U;J=J.then(async()=>{t!==U||!M||!_()||await ee.setItem(Le,JSON.stringify(e))}).catch(()=>{}),await J}catch{}}async function Ie(){U++,ne=false;try{J=J.then(()=>ee.removeItem(Le)).catch(()=>{}),await J}catch{}}async function pt(){if(ne||!_())return;ne=true;let e=U;try{M=await ee.getItem(ut)==="true"}catch{M=false}if(e!==U||!_()){ne=false;return}if(dt(),!M){await Ie();return}try{let t=await ee.getItem(Le);if(e!==U||!_()){ne=false;return}if(t){let r=JSON.parse(t);Array.isArray(r)&&r.length&&(k.update(o=>[...r,...o].filter(n=>!ye(n.args??[n.message]))),k.bumpIdAbove(Math.max(...r.map(o=>o.id))))}}catch{}}function Oe(){return M}function mt(e){M!==e&&(M=e,dt(),ee.setItem(ut,String(e)).catch(()=>{}),e?gt():Ie())}function ht(e){return Ae.add(e),()=>{Ae.delete(e)}}var De={verbose:true,info:true,warning:true,error:true},Ne={...De,verbose:false},Mr=/^([\w-]+):(.+)$/,Hr=/^\/(.+)\/$/;function jr(e){let t=[];for(let r of e.split(/\s+/)){if(!r)continue;let o=r,n=false;o.startsWith("-")&&o.length>1&&(n=true,o=o.slice(1));let a=o.match(Mr);if(a){t.push({key:a[1].toLowerCase(),text:a[2],negative:n});continue}let l=o.match(Hr);if(l)try{t.push({regex:new RegExp(l[1],"im"),negative:n});continue}catch{}t.push({text:o,negative:n})}return t}function Rr(e,t){return e.message.toLowerCase().includes(t.toLowerCase())}function Pr(e,t){for(let r of t)if(r.regex){if(r.regex.test(e.message)===r.negative)return false}else if(r.text&&Rr(e,r.text)===r.negative)return false;return true}function zr(e,t,r){return e.method==="groupEnd"?true:t[e.level]?Pr(e,r):false}var yt={verbose:"Verbose",info:"Info",warning:"Warnings",error:"Errors"},Be=["verbose","info","warning","error"];function bt(e,t){return Be.every(r=>e[r]===t[r])}function Wr(e){if(bt(e,De))return"All levels";if(bt(e,Ne))return"Default levels";let t=Be.filter(r=>e[r]);return t.length===0?"Hide all":t.length===1?`${yt[t[0]]} only`:"Custom levels"}var Me=5,Fr=5;function Gr(e,t){for(let r of e){let o=hr(r.entry.origin,t);r.sourceKey=o,r.originColor=o?Xe(o):void 0,r.originLabel=t==="off"?void 0:yr(r.entry.origin,t)}}function Vr(e){for(let t=0;t<e.length;t++){let r=e[t].sourceKey;if(r==null){e[t].bracketGlyph=void 0;continue}let o=t>0&&e[t-1].sourceKey===r,n=t<e.length-1&&e[t+1].sourceKey===r,a=!o&&!n?"single":o?n?"mid":"bottom":"top";e[t].bracketGlyph=et(a)}}function _r(e,t){let r=[],o=new Map;for(let a of e){let l=a.sourceKey??"\u2014",s=o.get(l);s||(s=[],o.set(l,s),r.push(l)),s.push(a)}let n=[];for(let a of r){let l=o.get(a);for(let u of l)u.depth=0;let s=l.length>Fr,i=t[a]??false;s&&(n.push({key:`cluster:${a}`,entry:l[0].entry,depth:0,repeatCount:1,isGroupHeader:false,sourceKey:a,originColor:l[0].originColor,originLabel:l[0].originLabel,clusterHeader:{key:a,count:l.length,expanded:i}}),!i)||l.forEach((u,c)=>{let d=l.length===1?"single":c===0?"top":c===l.length-1?"bottom":"mid";u.bracketGlyph=et(d),n.push(u)})}return n}function Kr(e){let t=new Map,r=new Map;e.forEach((s,i)=>{let u=s.sourceKey;u!=null&&(t.has(u)||t.set(u,i),r.set(u,i))});let o=[...t.keys()].sort((s,i)=>t.get(s)-t.get(i)),n=new Map,a=[];for(let s of o){let i=a.findIndex(u=>u<t.get(s));i===-1&&(i=a.length<Me?a.length:Me-1,i>=a.length&&a.push(0)),n.set(s,i),a[i]=Math.max(a[i]??0,r.get(s))}let l=Math.max(1,Math.min(a.length,Me));e.forEach((s,i)=>{let u=Array.from({length:l},()=>({glyph:" "}));for(let c of o){let d=n.get(c);d>=l||i>=t.get(c)&&i<=r.get(c)&&(u[d]={glyph:s.sourceKey===c?"\u25CF":"\u2502",color:Xe(c)})}s.lanes=u})}var Ur=new Set(["group","groupCollapsed"]);function Jr(e,t){let{levelsMask:r,query:o,showTimestamps:n,collapsedOverrides:a}=t,l=jr(o.trim()),s=[],i={verbose:0,info:0,warning:0,error:0},u=0,c=[],d=()=>c.some(f=>f.collapsed);for(let f of e){if(i[f.level]++,f.method==="groupEnd"){c.pop();continue}let O=Ur.has(f.method),V=d();if(!zr(f,r,l))u++;else if(!V){let L=s[s.length-1];!n&&!O&&L&&!L.isGroupHeader&&L.depth===c.length&&L.entry.method===f.method&&L.entry.message===f.message?L.repeatCount++:s.push({key:String(f.id),entry:f,depth:c.length,repeatCount:1,isGroupHeader:O,groupId:O?f.id:void 0,groupCollapsed:void 0})}if(O){let L=f.method==="groupCollapsed",F=a[f.id]??L,j=s[s.length-1];j&&j.groupId===f.id&&(j.groupCollapsed=F),c.push({id:f.id,collapsed:F||V})}}Gr(s,t.groupDimension);let v=s;return t.groupDimension!=="off"&&(t.layoutMode==="cluster"?v=_r(s,t.clusterExpanded):t.layoutMode==="swimlane"?Kr(s):Vr(s)),{rows:v,hiddenCount:u,levelCounts:i,totalCount:e.length}}function vt(e){let t=or(ge,K,K);return rr(()=>Jr(t,e),[t,e.levelsMask,e.query,e.showTimestamps,e.collapsedOverrides,e.groupDimension,e.layoutMode,e.clusterExpanded])}function wt(){let[e,t]=R(""),[r,o]=R(false),[n,a]=R({...Ne}),[l,s]=R(false),[i,u]=R({}),[c,d]=R("chrono"),[v,f]=R("list"),[O,V]=R({}),{rows:L,hiddenCount:F}=vt({levelsMask:n,query:e,showTimestamps:l,collapsedOverrides:i,groupDimension:"function",layoutMode:c,clusterExpanded:O}),j=he((se,ce)=>{u(Yt=>({...Yt,[se]:!ce}))},[]),le=he(se=>{V(ce=>({...ce,[se]:!(ce[se]??false)}))},[]),h=he(()=>{oe(),u({})},[]),C=Wr(n);return{query:e,setQuery:t,searchActive:r,setSearchActive:o,levelsMask:n,setLevelsMask:a,showTimestamps:l,setShowTimestamps:s,layoutMode:c,setLayoutMode:d,view:v,setView:f,rows:L,hiddenCount:F,onToggleGroup:j,onToggleCluster:le,clear:h,levelSummary:C,isLevelCustom:C!=="All levels"&&C!=="Default levels"}}var xt={};Xt(xt,{AccessibilityInfo:()=>Zr,ActivityIndicator:()=>tn,Alert:()=>nn,Animated:()=>Jo,AppRegistry:()=>eo,AppState:()=>to,Appearance:()=>Xr,BackHandler:()=>ro,Button:()=>rn,CheckBox:()=>vo,Clipboard:()=>oo,DeviceEventEmitter:()=>Bo,Dimensions:()=>no,Easing:()=>ao,FlatList:()=>He,I18nManager:()=>io,Image:()=>wo,ImageBackground:()=>xo,InteractionManager:()=>so,Keyboard:()=>lo,KeyboardAvoidingView:()=>ko,LayoutAnimation:()=>co,Linking:()=>uo,LogBox:()=>No,Modal:()=>Xo,NativeEventEmitter:()=>fo,NativeModules:()=>Qr,PanResponder:()=>go,Picker:()=>So,PixelRatio:()=>po,Platform:()=>mo,Pressable:()=>Zo,ProgressBar:()=>Co,RefreshControl:()=>Eo,SafeAreaView:()=>To,ScrollView:()=>Tt,SectionList:()=>$o,Share:()=>ho,StatusBar:()=>Lo,StyleSheet:()=>T,Switch:()=>en,Text:()=>g,TextInput:()=>Yo,Touchable:()=>Ao,TouchableHighlight:()=>qo,TouchableNativeFeedback:()=>Io,TouchableOpacity:()=>$,TouchableWithoutFeedback:()=>Qo,UIManager:()=>yo,Vibration:()=>bo,View:()=>y,VirtualizedList:()=>Oo,YellowBox:()=>Do,findNodeHandle:()=>on,unstable_createElement:()=>qr,useColorScheme:()=>Mo,useLocaleContext:()=>Ho,useWindowDimensions:()=>jo});er(xt,Yr);import*as Yr from"react-native-web";import{unstable_createElement as qr,NativeModules as Qr,AccessibilityInfo as Zr,Appearance as Xr,AppRegistry as eo,AppState as to,BackHandler as ro,Clipboard as oo,Dimensions as no,Easing as ao,I18nManager as io,Keyboard as lo,InteractionManager as so,LayoutAnimation as co,Linking as uo,NativeEventEmitter as fo,PanResponder as go,PixelRatio as po,Platform as mo,Share as ho,UIManager as yo,Vibration as bo,CheckBox as vo,FlatList as He,Image as wo,ImageBackground as xo,KeyboardAvoidingView as ko,Picker as So,ProgressBar as Co,RefreshControl as Eo,SafeAreaView as To,SectionList as $o,StatusBar as Lo,Touchable as Ao,TouchableNativeFeedback as Io,VirtualizedList as Oo,YellowBox as Do,LogBox as No,DeviceEventEmitter as Bo,useColorScheme as Mo,useLocaleContext as Ho,useWindowDimensions as jo}from"react-native-web";import*as E from"react-native-web";import{createElement as je,forwardRef as kt,useCallback as Ro,useRef as Po}from"react";import{useEffect as zo,useState as Wo}from"react";import{createPortal as Fo}from"react-dom";var Go='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Vo}from"react/jsx-runtime";var ae=Symbol.for("@buoy-gg/portal-host"),St=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function Ct(){let e=document;if(e[ae])return e[ae].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Go});let r=()=>{let c=document.fullscreenElement,d=c&&c.tagName!=="CANVAS"?c:document.body;t.parentElement!==d&&d.appendChild(t)},o=new Map,n=c=>{(!t.contains(c.target)||!St(c.target))&&o.set(c.code||c.key,{key:c.key,code:c.code,location:c.location,keyCode:c.keyCode,which:c.which,altKey:c.altKey,ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey})},a=c=>{o.delete(c.code||c.key)},l=()=>o.clear(),s=()=>{let c=[...o.values()];o.clear();for(let d of c)document.dispatchEvent(new KeyboardEvent("keyup",{...d,bubbles:true}))},i=c=>{St(c.target)&&c.stopPropagation()},u=c=>c.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",n,true),document.addEventListener("keyup",a,true),window.addEventListener("blur",l),t.addEventListener("focusin",s),t.addEventListener("keydown",i),t.addEventListener("keyup",i),t.addEventListener("keypress",i),t.addEventListener("wheel",u,{passive:true}),e[ae]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",n,true),document.removeEventListener("keyup",a,true),window.removeEventListener("blur",l),t.remove(),delete e[ae]}},t}function _o({children:e}){let[t,r]=Wo(null);return zo(()=>{let o=Ct(),n=document[ae];return n.users++,r(o),()=>{--n.users===0&&n.dispose()}},[]),t?Fo(Vo("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var Y=E,Ko=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],q=e=>typeof e=="number"?`${e}px`:e;function Re(e){if(Array.isArray(e)){let d=e.map(Re);return d.some((v,f)=>v!==e[f])?d:e}if(!e||typeof e!="object"||!Ko.some(d=>e[d]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:n,textShadowColor:a,textShadowOffset:l,textShadowRadius:s,...i}=e;if(t!=null||r!=null||o!=null||n!=null){let d=t??"black",v=o==null?d:`color-mix(in srgb, ${d} ${Math.min(o,1)*100}%, transparent)`,f=`${q(r?.width??0)} ${q(r?.height??0)} ${q(n??0)} ${v}`;i.boxShadow=typeof i.boxShadow=="string"?`${i.boxShadow}, ${f}`:i.boxShadow??f}let{width:u=0,height:c=0}=l??{};if(a&&(u||c||s)){let d=`${q(u)} ${q(c)} ${q(s??0)} ${a}`;i.textShadow=i.textShadow?`${i.textShadow}, ${d}`:d}return i}var Uo=Y.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Et(e,t){if(typeof e=="function")return o=>Et(e(o),t);let r=Re(e);return t?[r,Uo[t]]:r}var T={...Y.StyleSheet,create:e=>Y.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Re(r)])))};function A(e){let t=kt((o,n)=>{let{accessibilityState:a,accessibilityValue:l,pointerEvents:s,...i}=o;for(let c of["busy","checked","disabled","expanded","selected"])a?.[c]!==void 0&&i[`aria-${c}`]===void 0&&(i[`aria-${c}`]=a[c]);for(let[c,d]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))l?.[c]!==void 0&&i[`aria-${d}`]===void 0&&(i[`aria-${d}`]=l[c]);let u=Et(i.style,s);return u!==i.style&&(i.style=u),je(e,{...i,ref:n})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var y=A(E.View),g=A(E.Text),Jo={...Y.Animated,View:Y.Animated.createAnimatedComponent(y),Text:Y.Animated.createAnimatedComponent(g)},Yo=A(E.TextInput),$=A(E.TouchableOpacity),qo=A(E.TouchableHighlight),Qo=A(E.TouchableWithoutFeedback),Zo=A(E.Pressable),Tt=A(E.ScrollView),$t=kt((e,t)=>{let r=Po(null),o=Ro(n=>{if(n){let a=n;for(;a.parentElement&&a.parentElement!==document.body;)a=a.parentElement;a.parentElement===document.body&&(r.current=a,Object.assign(a.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Ct().appendChild(a))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(n):t&&(t.current=n)},[t]);return je(_o,null,je(E.Modal,{...e,ref:o}))});$t.displayName="Modal";var Xo=A($t),en=A(E.Switch),tn=A(E.ActivityIndicator),rn=A(E.Button),on=E.findNodeHandle,nn={alert(e,t,r,o){if(typeof document>"u")return;let n=document.createElement("dialog");n.dataset.buoyRoot="",n.setAttribute("aria-label",e),n.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let a=document.createElement("h2");if(a.textContent=e,a.style.cssText="font-size:18px;margin:0 0 12px",n.appendChild(a),t){let u=document.createElement("p");u.textContent=t,u.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",n.appendChild(u)}let l=document.createElement("div");l.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let s=r?.length?r:[{text:"OK"}],i=()=>{n.close?.(),n.remove()};for(let u of s){let c=document.createElement("button");c.type="button",c.textContent=u.text??"OK",c.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,c.onclick=()=>{i(),u.onPress?.()},l.appendChild(c)}n.addEventListener("cancel",u=>{u.preventDefault(),o?.cancelable!==false&&(i(),o?.onDismiss?.())}),n.appendChild(l),document.body.appendChild(n),n.showModal?n.showModal():n.setAttribute("open","")}};import{ModalHeader as P,TabSelector as an,night as N,Search as ln,Filter as sn,Trash2 as cn}from"@buoy-gg/shared-ui/web";import{jsx as I,jsxs as Pe}from"react/jsx-runtime";var un=[{key:"chrono",label:"Timeline"},{key:"cluster",label:"Grouped"}];function Lt({c:e,onBack:t}){if(e.view==="filters")return Pe(P,{children:[I(P.Navigation,{onBack:()=>e.setView("list")}),I(P.Content,{title:"Filters"})]});let r=e.rows.length>0;return Pe(P,{children:[t?I(P.Navigation,{onBack:t}):null,I(P.Content,{title:"",noMargin:true,children:e.searchActive?I(P.Search,{testID:"buoy-console-search",value:e.query,onChangeText:e.setQuery,onCancel:()=>e.setQuery(""),clearOnlyWhenText:true,placeholder:"Filter logs\u2026 /regex/ -exclude",iconSize:14,inputProps:{onSubmitEditing:()=>e.setSearchActive(false)}}):I(an,{testIDPrefix:"buoy-console-tab",tabs:un,activeTab:e.layoutMode,onTabChange:o=>e.setLayoutMode(o)})}),Pe(P.Actions,{children:[I($,{onPress:()=>e.setSearchActive(o=>!o),style:[Q.actionBtn,e.searchActive&&Q.actionBtnActive],testID:"buoy-console-search-open",accessibilityLabel:"Search logs",children:I(ln,{size:14,color:e.searchActive?N.color.accent:N.color.textSecondary})}),I($,{onPress:()=>e.setView("filters"),style:[Q.actionBtn,e.isLevelCustom&&Q.actionBtnActive],testID:"buoy-console-filters-open",accessibilityLabel:"Filters",children:I(sn,{size:14,color:e.isLevelCustom?N.color.accent:N.color.textSecondary})}),I($,{onPress:e.clear,disabled:!r,style:[Q.actionBtn,!r&&Q.actionBtnDisabled],testID:"buoy-console-clear",accessibilityLabel:"Clear console",children:I(cn,{size:14,color:r?N.color.textSecondary:N.color.textTertiary})})]})]})}var Q=T.create({actionBtn:{width:32,height:32,borderRadius:8,backgroundColor:N.color.buttonSurface,borderWidth:1,borderColor:N.color.border,alignItems:"center",justifyContent:"center"},actionBtnActive:{backgroundColor:N.color.accentSoft,borderColor:N.color.accentBorderStrong},actionBtnDisabled:{opacity:.55}});import{useCallback as dn,useRef as At,useSyncExternalStore as fn}from"react";import{night as H,Check as gn,LOG_LIST_PRESET as pn}from"@buoy-gg/shared-ui/web";import{memo as mn}from"react";import{useState as hn}from"react";import{monoFont as z,night as ie}from"@buoy-gg/shared-ui/web";var yn={baseContainer:"#0A0A0C",surfaceError:"rgba(255,69,58,0.15)",surfaceYellow:"rgba(255,235,59,0.13)",divider:ie.color.fillTertiary,inputBackground:ie.color.surfaceElevated,menuBackground:ie.color.surface,onSurface:ie.color.text,onSurfaceYellow:"#FFE9A3",onErrorContainer:"#FFB4AB",tokenSubtle:ie.color.textSecondary,primary:"#40CCFF",valueNumber:"#FF9F1C",valueString:"#7EE787",valueBigint:"#A1A1A6",valueNode:"#F5F5F7",valueNullish:"#8E8E93",valuePreview:"#A1A1A6"},m=yn,bn={black:"#000",red:"rgb(237 78 76)",green:"rgb(1 200 1)",yellow:"rgb(210 192 87)",blue:"rgb(39 116 240)",magenta:"rgb(161 66 244)",cyan:"rgb(18 181 203)",gray:"rgb(207 208 208)",darkgray:"rgb(137 137 137)",lightred:"rgb(242 139 130)",lightgreen:"rgb(161 247 181)",lightyellow:"rgb(221 251 85)",lightblue:"rgb(102 157 246)",lightmagenta:"rgb(214 112 214)",lightcyan:"rgb(132 240 255)",white:"#fff"},It={verbose:{text:m.tokenSubtle},info:{text:m.onSurface},warning:{background:m.surfaceYellow,text:m.onSurfaceYellow,icon:"warning"},error:{background:m.surfaceError,text:m.onErrorContainer,icon:"error"}};var Ot=["black","red","green","yellow","blue","magenta","cyan","gray"],Dt=["darkgray","lightred","lightgreen","lightyellow","lightblue","lightmagenta","lightcyan","white"];function Nt(e){if(typeof e=="string")return e;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="function")return`\u0192 ${e.name||"(anonymous)"}`;try{return JSON.stringify(e)}catch{return String(e)}}var ze=/%([%_Oocsdfi])|\x1B\[([\d;]*)m/;function vn(e){return ze.test(e)}function Bt(e){let t={},r=false;for(let o of e.split(";")){let n=o.indexOf(":");if(n===-1)continue;let a=o.slice(0,n).trim().toLowerCase(),l=o.slice(n+1).trim();if(!l)continue;let s=l.match(/var\(--console-color-([a-z]+)\)/);switch(s&&(l=bn[s[1]]??l),a){case"color":t.color=l,r=true;break;case"background-color":case"background":t.backgroundColor=l,r=true;break;case"font-weight":t.fontWeight=l==="lighter"?"300":l,r=true;break;case"font-style":l==="italic"&&(t.fontStyle="italic",r=true);break;case"font-size":{let i=parseFloat(l);Number.isNaN(i)||(t.fontSize=i,r=true);break}case"text-decoration":case"text-decoration-line":l.includes("underline")&&l.includes("line-through")?t.textDecorationLine="underline line-through":l.includes("underline")?t.textDecorationLine="underline":l.includes("line-through")&&(t.textDecorationLine="line-through"),r=true;break;default:break}}return r?t:void 0}function wn(e,t){let r=n=>{let a=t.get("text-decoration")??"";a.includes(n)||t.set("text-decoration",`${a} ${n}`)},o=n=>{let a=t.get("text-decoration")?.replace(` ${n}`,"");a?t.set("text-decoration",a):t.delete("text-decoration")};for(;e.length;){let n=e.shift();switch(n){case 0:t.clear();break;case 1:t.set("font-weight","bold");break;case 2:t.set("font-weight","lighter");break;case 3:t.set("font-style","italic");break;case 4:r("underline");break;case 9:r("line-through");break;case 22:t.delete("font-weight");break;case 23:t.delete("font-style");break;case 24:o("underline");break;case 29:o("line-through");break;case 38:case 48:if(e.shift()===2){let a=e.shift()??0,l=e.shift()??0,s=e.shift()??0;t.set(n===38?"color":"background-color",`rgb(${a},${l},${s})`)}break;case 39:case 49:t.delete(n===39?"color":"background-color");break;default:{let a=Ot[n-30]??Dt[n-90];if(a!==void 0)t.set("color",`var(--console-color-${a})`);else{let l=Ot[n-40]??Dt[n-100];l!==void 0&&t.set("background-color",`var(--console-color-${l})`)}break}}}}function xn(e,t){let r=e,o=[],n=new Map,a,l=i=>{if(!i)return;let u=o[o.length-1];if(u&&u.type==="string"&&kn(u.style,a)){u.value+=i;return}o.push({type:"string",value:i,style:a})},s=0;for(let i=ze.exec(r);i!==null;i=ze.exec(r)){l(i.input.substring(0,i.index));let u,c=i[1];switch(c){case"%":l("%"),u="";break;case"s":s<t.length&&(u=Nt(t[s++]));break;case"c":s<t.length&&(a=Bt(Nt(t[s++])),u="");break;case"o":case"O":s<t.length&&(o.push({type:"value",value:t[s++],mode:c==="O"?"generic":"optimal"}),u="");break;case"_":s<t.length&&(s++,u="");break;case"d":case"f":case"i":{if(s<t.length){let d=t[s++],v=typeof d!="number"?NaN:d;c!=="f"&&(v=Math.floor(v)),u=v}break}case void 0:{let d=(i[2]||"0").split(";").map(f=>f?parseInt(f,10):0);wn(d,n);let v=[...n.entries()].map(([f,O])=>`${f}:${O.trimStart()}`).join(";");a=Bt(v),u="";break}}u===void 0&&(l(i[0]),u=""),r=u+i.input.substring(i.index+i[0].length)}return l(r),{tokens:o,rest:t.slice(s)}}function kn(e,t){return e===t?true:!e||!t?false:JSON.stringify(e)===JSON.stringify(t)}function Sn(e){if(e.length===0)return[];let t=[],r=e;if(typeof e[0]=="string"&&vn(e[0])){let o=xn(e[0],e.slice(1));t=o.tokens,r=o.rest}for(let o of r)t.length>0&&t.push({type:"string",value:" "}),typeof o=="string"?t.push({type:"string",value:o}):t.push({type:"value",value:o,mode:"optimal"});return t}import{useState as Cn}from"react";import{jsx as D,jsxs as Z}from"react/jsx-runtime";var Mt=5,Ht=6;function We(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(e instanceof Error)return"error";let t=typeof e;return t==="number"?"number":t==="bigint"?"bigint":t==="boolean"?"boolean":t==="string"?"string":t==="function"?"function":t==="symbol"?"symbol":"object"}var En={number:m.valueNumber,bigint:m.valueBigint,boolean:m.valueNumber,string:m.valueString,null:m.valueNullish,undefined:m.valueNullish,symbol:m.valueString,function:m.valueNode};function jt(e){if(Array.isArray(e))return"";let t=Object.getPrototypeOf(e);if(!t)return"Object";let r=t.constructor?.name;return!r||r==="Object"?"":r}function Fe(e){switch(We(e)){case"string":return`'${e}'`;case"function":return`\u0192 ${e.name||""}`.trimEnd();case"symbol":return e.toString();case"bigint":return`${String(e)}n`;case"array":return`Array(${e.length})`;case"error":return e.name;case"object":{let t=jt(e);return t?`${t} {\u2026}`:"{\u2026}"}default:return String(e)}}function Tn(e){if(Array.isArray(e)){let a=e.slice(0,Ht).map(s=>Fe(s)).join(", "),l=e.length>Ht?", \u2026":"";return`(${e.length}) [${a}${l}]`}let t=Object.entries(e),r=t.slice(0,Mt).map(([a,l])=>`${a}: ${Fe(l)}`).join(", "),o=t.length>Mt?", \u2026":"",n=jt(e);return`${n?`${n} `:""}{${r}${o}}`}function $n(e){let t=We(e);return t==="array"?e.length>0:t==="object"?Object.keys(e).length>0:t==="error"}var Rt=({open:e})=>D(g,{style:[w.triangle,e&&w.triangleOpen],children:"\u25B6"});function Ge({value:e,depth:t=0,testID:r}){let[o,n]=Cn(false),a=We(e);if(a==="error"){let i=e,u=`${i.name}: ${i.message}`.split(`
16
16
  `)[0],c=i.stack&&i.stack.trim()!==u.trim()?i.stack:void 0;return c?Z(y,{style:w.objectContainer,children:[Z($,{testID:r,style:w.objectHeader,activeOpacity:.6,onPress:()=>n(d=>!d),children:[D(Rt,{open:o}),D(g,{style:[w.mono,w.errorHead],numberOfLines:o?void 0:1,children:u})]}),o?D(g,{style:[w.mono,w.errorStack],children:c}):null]}):D(g,{style:[w.mono,{color:m.onErrorContainer}],numberOfLines:1,children:u})}if(!$n(e)){let i=En[a]??m.onSurface;return D(g,{testID:r,style:[w.mono,{color:i}],children:Fe(e)})}let l=e,s=Array.isArray(l)?l.map((i,u)=>[String(u),i]):Object.entries(l);return Z(y,{style:w.objectContainer,children:[Z($,{testID:r,onPress:()=>n(i=>!i),activeOpacity:.6,style:w.objectHeader,children:[D(Rt,{open:o}),D(g,{style:[w.mono,w.preview],numberOfLines:o?void 0:1,children:Tn(l)})]}),o&&t<6?D(y,{testID:r?`${r}-children`:void 0,style:w.children,children:s.map(([i,u])=>Z(y,{style:w.propertyRow,children:[Z(g,{style:[w.mono,w.propertyKey],children:[i,":"]}),D(y,{style:w.propertyValue,children:D(Ge,{testID:r?`${r}-${i}`:void 0,value:u,depth:t+1})})]},i))}):null]})}var Ln={fontFamily:z,fontSize:12,lineHeight:16},w=T.create({mono:Ln,objectContainer:{flexDirection:"column"},objectHeader:{flexDirection:"row",alignItems:"flex-start"},triangle:{color:m.tokenSubtle,fontSize:8,lineHeight:16,width:12},triangleOpen:{transform:[{rotate:"90deg"}]},preview:{color:m.valuePreview,fontStyle:"italic",flexShrink:1},errorHead:{color:m.onErrorContainer,flexShrink:1},errorStack:{color:m.tokenSubtle,marginLeft:14,marginTop:1},children:{marginLeft:14,flexDirection:"column"},propertyRow:{flexDirection:"row",alignItems:"flex-start"},propertyKey:{color:m.valueNode,marginRight:6},propertyValue:{flexShrink:1}});import{jsx as b,jsxs as X}from"react/jsx-runtime";function An(e){let t=new Date(e),r=(o,n=2)=>String(o).padStart(n,"0");return`${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}.${r(t.getMilliseconds(),3)}`}function In({icon:e,color:t}){return b(g,{style:[p.levelIcon,{color:t}],children:e==="warning"?"\u26A0":"\u2298"})}function On({count:e,color:t}){return b(y,{style:[p.repeatBadge,{borderColor:t}],children:b(g,{testID:"buoy-console-repeat-count",style:[p.repeatBadgeText,{color:t}],children:e})})}var Pt=mn(function({row:e,showTimestamps:t,onToggleGroup:r,onToggleCluster:o}){let{entry:n}=e,a=It[n.level],l=n.level==="error"||n.level==="warning",s=a.text,[i,u]=hn(n.method==="trace");if(e.clusterHeader){let h=e.clusterHeader;return b($,{testID:`buoy-console-cluster-${e.originLabel}`,style:[p.wrapper,p.dividerTop],activeOpacity:.7,onPress:()=>o(h.key),children:X(y,{style:p.rowWrapper,children:[b(g,{style:[p.originGutter,{color:e.originColor}],children:h.expanded?"\u25BC":"\u25B6"}),b(y,{style:p.messageColumn,children:X(y,{style:p.messageLine,children:[b(g,{style:[p.text,p.clusterTitle,{color:e.originColor}],children:e.originLabel}),X(g,{testID:"buoy-console-cluster-count",style:p.clusterCount,children:[" \xB7 ",h.count," logs"]})]})})]})})}let c=Sn(n.args),d=!!n.stack&&(l||n.method==="trace"),v=b(y,{testID:i?"buoy-console-content-expanded":"buoy-console-content-collapsed",style:[p.contentWrap,!i&&p.contentWrapClamped],children:c.map((h,C)=>h.type==="string"?b(g,{testID:`buoy-console-text-${C}`,style:[p.text,{color:s},e.isGroupHeader&&p.groupTitle,h.style],children:h.value},C):b(Ge,{testID:`buoy-console-value-${C}`,value:h.value,generic:h.mode==="generic"},C))}),f=X(y,{style:p.messageColumn,children:[e.originLabel?b(g,{testID:"buoy-console-origin",style:[p.originLabel,{color:e.originColor}],numberOfLines:1,children:e.originLabel}):null,X(y,{style:p.messageLine,children:[e.isGroupHeader?b(g,{style:[p.groupTriangle,{color:s}],children:e.groupCollapsed?"\u25B6":"\u25BC"}):null,a.icon?b(In,{icon:a.icon,color:s}):null,t?b(g,{testID:"buoy-console-timestamp",style:p.timestamp,children:An(n.timestamp)}):null,d?b(g,{style:[p.stackTriangle,{color:s}],children:i?"\u25BC":"\u25B6"}):null,v,e.repeatCount>1?b(On,{count:e.repeatCount,color:s}):null]}),d&&i?b(y,{testID:"buoy-console-stack",style:p.stackTrace,children:(n.stack??"").split(`
17
- `).filter(h=>h.trim()).map((h,C)=>b(g,{style:p.stackFrame,children:h.trim()},C))}):null]}),O=[p.wrapper,a.background?{backgroundColor:a.background}:p.dividerTop],V=Array.from({length:e.depth},(h,C)=>b(y,{style:p.nestingMarker},C)),L=e.lanes?b(y,{style:p.laneGutter,children:e.lanes.map((h,C)=>b(g,{style:[p.laneCell,h.color?{color:h.color}:null],children:h.glyph},C))}):e.bracketGlyph?b(g,{style:[p.originGutter,{color:e.originColor}],children:e.bracketGlyph}):null,F=X(y,{style:p.rowWrapper,children:[L,V,f]}),j=`buoy-console-row-${String(n.args[0])}`,le=[e.originLabel,c.find(h=>h.type==="string")?.value].filter(Boolean).join(" \u2014 ").slice(0,80);if(e.isGroupHeader&&e.groupId!==void 0){let h=e.groupId;return b($,{style:O,activeOpacity:.7,onPress:()=>r(h,!!e.groupCollapsed),testID:j,accessibilityLabel:le||"Console group",children:F})}return b($,{style:O,activeOpacity:.7,onPress:()=>u(h=>!h),testID:j,accessibilityLabel:le||"Console message",children:F})},(e,t)=>e.row.key===t.row.key&&e.row.lanes===t.row.lanes&&e.row.repeatCount===t.row.repeatCount&&e.row.groupCollapsed===t.row.groupCollapsed&&e.row.depth===t.row.depth&&e.row.bracketGlyph===t.row.bracketGlyph&&e.row.originLabel===t.row.originLabel&&e.row.clusterHeader?.count===t.row.clusterHeader?.count&&e.row.clusterHeader?.expanded===t.row.clusterHeader?.expanded&&e.showTimestamps===t.showTimestamps&&e.onToggleGroup===t.onToggleGroup&&e.onToggleCluster===t.onToggleCluster),p=T.create({wrapper:{paddingVertical:2,paddingRight:8,minHeight:18},dividerTop:{borderTopWidth:T.hairlineWidth,borderTopColor:m.divider},rowWrapper:{flexDirection:"row",alignItems:"flex-start"},originGutter:{width:11,fontFamily:z,fontSize:13,lineHeight:18,textAlign:"center"},laneGutter:{flexDirection:"row"},laneCell:{width:9,fontFamily:z,fontSize:13,lineHeight:18,textAlign:"center"},originLabel:{fontFamily:z,fontSize:10,lineHeight:16,marginBottom:1,opacity:.9},nestingMarker:{width:14,alignSelf:"stretch",borderRightWidth:T.hairlineWidth,borderRightColor:m.divider,marginLeft:2},messageColumn:{flex:1,flexDirection:"column",paddingLeft:6},messageLine:{flexDirection:"row",flexWrap:"wrap",alignItems:"flex-start"},contentWrap:{flexDirection:"row",flexWrap:"wrap",alignItems:"flex-start",flexShrink:1},contentWrapClamped:{flexWrap:"nowrap",overflow:"hidden",maxHeight:16},text:{fontFamily:z,fontSize:12,lineHeight:16},groupTitle:{fontWeight:"bold"},clusterTitle:{fontWeight:"600"},clusterCount:{color:m.tokenSubtle,fontFamily:z,fontSize:12,lineHeight:16},groupTriangle:{fontSize:9,lineHeight:16,marginRight:4},stackTriangle:{fontSize:8,lineHeight:16,marginRight:4},levelIcon:{fontSize:12,lineHeight:16,marginRight:5},timestamp:{color:m.tokenSubtle,fontFamily:z,fontSize:11,lineHeight:16,marginRight:6},repeatBadge:{borderWidth:1,borderRadius:9,paddingHorizontal:5,minWidth:16,alignItems:"center",justifyContent:"center",marginLeft:6,marginTop:1},repeatBadgeText:{fontSize:10,fontWeight:"700",lineHeight:14},stackTrace:{marginTop:2,marginLeft:12},stackFrame:{color:m.tokenSubtle,fontFamily:z,fontSize:11,lineHeight:15}});import{jsx as x,jsxs as Ve}from"react/jsx-runtime";function zt({c:e}){return e.view==="filters"?x(Nn,{c:e}):x(Dn,{c:e})}function Dn({c:e}){let t=At(null),r=At(true),o=dn(({item:n})=>x(Pt,{row:n,showTimestamps:e.showTimestamps,onToggleGroup:e.onToggleGroup,onToggleCluster:e.onToggleCluster}),[e.showTimestamps,e.onToggleGroup,e.onToggleCluster]);return x(He,{testID:"buoy-console-list",ref:t,data:e.rows,keyExtractor:n=>n.key,renderItem:o,style:S.list,...pn,onContentSizeChange:()=>{r.current&&t.current?.scrollToEnd({animated:false})},onScroll:n=>{let{contentOffset:a,contentSize:l,layoutMeasurement:s}=n.nativeEvent,i=l.height-(a.y+s.height);r.current=i<40},scrollEventThrottle:100})}function _e({testID:e,on:t,label:r,subtext:o,onPress:n}){return Ve($,{testID:e,style:S.row,onPress:n,activeOpacity:.7,children:[x(y,{style:[S.checkbox,t&&S.checkboxOn],children:t?x(gn,{size:12,color:H.color.onAccent,strokeWidth:3}):null}),Ve(y,{style:S.rowTextCol,children:[x(g,{style:S.rowLabel,children:r}),o?x(g,{style:S.rowSubtext,children:o}):null]})]})}function Wt({text:e}){return x(g,{style:S.sectionLabel,children:e})}function Nn({c:e}){let t=fn(ht,Oe,Oe),r=o=>e.setLevelsMask({...e.levelsMask,[o]:!e.levelsMask[o]});return Ve(Tt,{testID:"buoy-console-filters",style:S.subView,contentContainerStyle:S.subViewContent,children:[x(Wt,{text:"Log levels"}),x($,{testID:"buoy-console-levels-default",style:S.presetRow,onPress:()=>e.setLevelsMask({...Ne}),children:x(g,{style:S.presetText,children:"Default (hide verbose)"})}),x($,{testID:"buoy-console-levels-all",style:S.presetRow,onPress:()=>e.setLevelsMask({...De}),children:x(g,{style:S.presetText,children:"All levels"})}),Be.map(o=>x(_e,{testID:`buoy-console-level-${o}`,on:e.levelsMask[o],label:yt[o],onPress:()=>r(o)},o)),x(y,{style:S.divider}),x(Wt,{text:"Settings"}),x(_e,{testID:"buoy-console-timestamps",on:e.showTimestamps,label:"Show timestamps",onPress:()=>e.setShowTimestamps(o=>!o)}),x(_e,{testID:"buoy-console-preserve",on:t,label:"Preserve log",subtext:"Do not clear log on reload",onPress:()=>mt(!t)})]})}var S=T.create({list:{flex:1,backgroundColor:"transparent"},subView:{flex:1,backgroundColor:"transparent"},subViewContent:{padding:12},sectionLabel:{color:H.color.textTertiary,fontSize:11,textTransform:"uppercase",letterSpacing:.5,marginTop:4,marginBottom:4,paddingHorizontal:8},presetRow:{paddingVertical:10,paddingHorizontal:8},presetText:{color:H.color.accent,fontSize:14,fontWeight:"600"},divider:{height:T.hairlineWidth,backgroundColor:H.color.border,marginVertical:6},row:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:8,gap:12},rowTextCol:{flexDirection:"column",flex:1},rowLabel:{color:H.color.text,fontSize:14},rowSubtext:{color:H.color.textTertiary,fontSize:12,marginTop:1},checkbox:{width:18,height:18,borderRadius:4,borderWidth:1,borderColor:H.color.fillTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:H.color.accent,borderColor:H.color.accent}});import{jsx as Ke}from"react/jsx-runtime";function Ft({visible:e,onClose:t,onBack:r,onMinimize:o,persistenceKey:n="@react_buoy_console_modal"}){let a=wt();return Ke(tr,{visible:e,onClose:t,onMinimize:o,persistenceKey:n,header:{showToggleButton:true,customContent:Ke(Lt,{c:a,onBack:r})},enablePersistence:true,initialMode:"bottomSheet",disableScrollWrapper:true,children:Ke(zt,{c:a})})}import{createToolFactory as Bn,defineToolPreset as Mn}from"@buoy-gg/shared-ui/web";import{jsx as Hn}from"react/jsx-runtime";var Gt=globalThis,jn=typeof Gt.ErrorUtils?.setGlobalHandler=="function"||typeof Gt.RN$registerExceptionListener=="function";jn&&typeof ue<"u"&&ue?fe():typeof ue<"u"&&ue&&Te();var Vt=Mn({id:"console",name:"CONSOLE",description:"Captured console.* output",slot:"both",color:Qe,icon:({size:e})=>Hn(qe,{size:e}),component:Ft}),Rn=Bn(Vt);import{useEffect as Pn}from"react";import{getAccountAccess as zn,subscribeAccountAccess as Wn}from"@buoy-gg/shared-ui/web";var _t=0;function Fn(){return Pn(()=>{++_t;let e=true,t=()=>{if(!e)return;let o=zn();if(o.status==="locked"){$e(),oe();return}fe(),o.status==="admitted"&&pt()},r=Wn(t);return t(),()=>{e=false,r(),--_t===0&&$e()}},[]),null}import{macOSColors as Gn,windowDragProps as Vn}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as _n}from"react/jsx-runtime";function Kn(){let e=wt();return _n(y,{style:Kt.container,children:[Ue(y,{style:Kt.headerBar,...Vn,children:Ue(Lt,{c:e})}),Ue(zt,{c:e})]})}var Kt=T.create({container:{flex:1,backgroundColor:"transparent"},headerBar:{paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent",borderBottomWidth:T.hairlineWidth,borderBottomColor:Gn.border.default}});import{useSyncExternalStore as Un,useEffect as Jn}from"react";function Ut(){return Jn(()=>{fe()},[]),{logs:Un(ge,K,K)}}import{night as W,ToolEmptyState as Yn,monoFont as qn}from"@buoy-gg/shared-ui/web";import{jsx as G,jsxs as me}from"react/jsx-runtime";var Jt={verbose:"#9b9b9b",info:W.color.text,warning:"#e2c08d",error:"#f48771"};function Qn(e){let t=new Date(e),r=(o,n=2)=>String(o).padStart(n,"0");return`${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}.${r(t.getMilliseconds(),3)}`}function Zn(){let{logs:e}=Ut(),t=({item:r})=>me(y,{style:B.row,children:[G(g,{style:B.time,children:Qn(r.timestamp)}),G(g,{style:[B.level,{color:Jt[r.level]}],children:r.level.toUpperCase()}),G(g,{style:[B.message,{color:Jt[r.level]}],numberOfLines:3,children:r.message})]});return me(y,{style:B.container,children:[me(y,{style:B.header,children:[me(g,{style:B.headerTitle,children:["Console (",e.length,")"]}),G($,{onPress:()=>oe(),style:B.clearButton,children:G(g,{style:B.clearText,children:"Clear"})})]}),G(He,{data:e,keyExtractor:r=>String(r.id),renderItem:t,ListEmptyComponent:G(Yn,{testID:"buoy-console-empty",otto:"printing",title:"No console logs captured yet",message:"console.log, .warn and .error from your app land here as they run."}),contentContainerStyle:e.length===0?B.emptyContainer:void 0})]})}var B=T.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:8,borderBottomWidth:T.hairlineWidth,borderBottomColor:W.color.border},headerTitle:{color:W.color.text,fontSize:13,fontWeight:"600"},clearButton:{paddingHorizontal:10,paddingVertical:4,borderRadius:4,backgroundColor:W.color.surfaceElevated},clearText:{color:W.color.text,fontSize:12},row:{flexDirection:"row",paddingHorizontal:12,paddingVertical:4,borderBottomWidth:T.hairlineWidth,borderBottomColor:W.color.separator,gap:8},time:{color:W.color.textTertiary,fontSize:11,fontVariant:["tabular-nums"],minWidth:86},level:{fontSize:11,fontWeight:"700",minWidth:44},message:{flex:1,fontSize:12,fontFamily:qn},empty:{color:W.color.textTertiary,fontSize:13,textAlign:"center"},emptyContainer:{flexGrow:1,alignItems:"center",justifyContent:"center"}});import{createSyncAdapter as Xn,memoByIdentity as ea,newestFitting as ta,sizeOrStub as ra}from"@buoy-gg/shared-ui/web";var oa=1.5*1024*1024,na=16*1024,aa=Object.freeze({__buoyTruncated:true,note:"Log payload omitted \u2014 inspect it on-device."}),ia=ea(e=>{let t={...e,args:Ze(e.args),message:te(e.message),stack:e.stack?te(e.stack,4096):e.stack};return ra(t,na,()=>({...t,args:[aa]}))});function la(e){return ta(e,{toWire:ia,budget:oa,baseBytes:16})}var sa=Xn({version:1,getSnapshot(){return{entries:la(K())}},subscribe(e){return ge(e)},actions:{clearEntries(){return oe(),{cleared:true}}}});export{Qe as CONSOLE_ICON_COLOR,qe as ConsoleIcon,Zn as ConsoleLogList,Pt as ConsoleMessageRow,Ft as ConsoleModal,Fn as ConsoleRoot,Ge as ConsoleValue,Kn as ConsoleView,oe as clearEntries,sa as consoleSyncAdapter,m as consoleTheme,Vt as consoleToolPreset,Rn as createConsoleTool,K as getEntries,Oe as getPreserveLog,pt as initConsolePersistence,fe as installConsoleCapture,Te as installFatalErrorCapture,It as levelStyles,Nr as onClear,Dr as replaceEntries,mt as setPreserveLog,ge as subscribe,ht as subscribePreserveLog,$e as uninstallConsoleCapture,Ut as useConsoleLogs,vt as useConsoleMessages};
17
+ `).filter(h=>h.trim()).map((h,C)=>b(g,{style:p.stackFrame,children:h.trim()},C))}):null]}),O=[p.wrapper,a.background?{backgroundColor:a.background}:p.dividerTop],V=Array.from({length:e.depth},(h,C)=>b(y,{style:p.nestingMarker},C)),L=e.lanes?b(y,{style:p.laneGutter,children:e.lanes.map((h,C)=>b(g,{style:[p.laneCell,h.color?{color:h.color}:null],children:h.glyph},C))}):e.bracketGlyph?b(g,{style:[p.originGutter,{color:e.originColor}],children:e.bracketGlyph}):null,F=X(y,{style:p.rowWrapper,children:[L,V,f]}),j=`buoy-console-row-${String(n.args[0])}`,le=[e.originLabel,c.find(h=>h.type==="string")?.value].filter(Boolean).join(" \u2014 ").slice(0,80);if(e.isGroupHeader&&e.groupId!==void 0){let h=e.groupId;return b($,{style:O,activeOpacity:.7,onPress:()=>r(h,!!e.groupCollapsed),testID:j,accessibilityLabel:le||"Console group",children:F})}return b($,{style:O,activeOpacity:.7,onPress:()=>u(h=>!h),testID:j,accessibilityLabel:le||"Console message",children:F})},(e,t)=>e.row.key===t.row.key&&e.row.lanes===t.row.lanes&&e.row.repeatCount===t.row.repeatCount&&e.row.groupCollapsed===t.row.groupCollapsed&&e.row.depth===t.row.depth&&e.row.bracketGlyph===t.row.bracketGlyph&&e.row.originLabel===t.row.originLabel&&e.row.clusterHeader?.count===t.row.clusterHeader?.count&&e.row.clusterHeader?.expanded===t.row.clusterHeader?.expanded&&e.showTimestamps===t.showTimestamps&&e.onToggleGroup===t.onToggleGroup&&e.onToggleCluster===t.onToggleCluster),p=T.create({wrapper:{paddingVertical:2,paddingRight:8,minHeight:18},dividerTop:{borderTopWidth:T.hairlineWidth,borderTopColor:m.divider},rowWrapper:{flexDirection:"row",alignItems:"flex-start"},originGutter:{width:11,fontFamily:z,fontSize:13,lineHeight:18,textAlign:"center"},laneGutter:{flexDirection:"row"},laneCell:{width:9,fontFamily:z,fontSize:13,lineHeight:18,textAlign:"center"},originLabel:{fontFamily:z,fontSize:10,lineHeight:16,marginBottom:1,opacity:.9},nestingMarker:{width:14,alignSelf:"stretch",borderRightWidth:T.hairlineWidth,borderRightColor:m.divider,marginLeft:2},messageColumn:{flex:1,flexDirection:"column",paddingLeft:6},messageLine:{flexDirection:"row",flexWrap:"wrap",alignItems:"flex-start"},contentWrap:{flexDirection:"row",flexWrap:"wrap",alignItems:"flex-start",flexShrink:1},contentWrapClamped:{flexWrap:"nowrap",overflow:"hidden",maxHeight:16},text:{fontFamily:z,fontSize:12,lineHeight:16},groupTitle:{fontWeight:"bold"},clusterTitle:{fontWeight:"600"},clusterCount:{color:m.tokenSubtle,fontFamily:z,fontSize:12,lineHeight:16},groupTriangle:{fontSize:9,lineHeight:16,marginRight:4},stackTriangle:{fontSize:8,lineHeight:16,marginRight:4},levelIcon:{fontSize:12,lineHeight:16,marginRight:5},timestamp:{color:m.tokenSubtle,fontFamily:z,fontSize:11,lineHeight:16,marginRight:6},repeatBadge:{borderWidth:1,borderRadius:9,paddingHorizontal:5,minWidth:16,alignItems:"center",justifyContent:"center",marginLeft:6,marginTop:1},repeatBadgeText:{fontSize:10,fontWeight:"700",lineHeight:14},stackTrace:{marginTop:2,marginLeft:12},stackFrame:{color:m.tokenSubtle,fontFamily:z,fontSize:11,lineHeight:15}});import{jsx as x,jsxs as Ve}from"react/jsx-runtime";function zt({c:e}){return e.view==="filters"?x(Nn,{c:e}):x(Dn,{c:e})}function Dn({c:e}){let t=At(null),r=At(true),o=dn(({item:n})=>x(Pt,{row:n,showTimestamps:e.showTimestamps,onToggleGroup:e.onToggleGroup,onToggleCluster:e.onToggleCluster}),[e.showTimestamps,e.onToggleGroup,e.onToggleCluster]);return x(He,{keyboardShouldPersistTaps:"handled",testID:"buoy-console-list",ref:t,data:e.rows,keyExtractor:n=>n.key,renderItem:o,style:S.list,...pn,onContentSizeChange:()=>{r.current&&t.current?.scrollToEnd({animated:false})},onScroll:n=>{let{contentOffset:a,contentSize:l,layoutMeasurement:s}=n.nativeEvent,i=l.height-(a.y+s.height);r.current=i<40},scrollEventThrottle:100})}function _e({testID:e,on:t,label:r,subtext:o,onPress:n}){return Ve($,{testID:e,style:S.row,onPress:n,activeOpacity:.7,children:[x(y,{style:[S.checkbox,t&&S.checkboxOn],children:t?x(gn,{size:12,color:H.color.onAccent,strokeWidth:3}):null}),Ve(y,{style:S.rowTextCol,children:[x(g,{style:S.rowLabel,children:r}),o?x(g,{style:S.rowSubtext,children:o}):null]})]})}function Wt({text:e}){return x(g,{style:S.sectionLabel,children:e})}function Nn({c:e}){let t=fn(ht,Oe,Oe),r=o=>e.setLevelsMask({...e.levelsMask,[o]:!e.levelsMask[o]});return Ve(Tt,{keyboardShouldPersistTaps:"handled",testID:"buoy-console-filters",style:S.subView,contentContainerStyle:S.subViewContent,children:[x(Wt,{text:"Log levels"}),x($,{testID:"buoy-console-levels-default",style:S.presetRow,onPress:()=>e.setLevelsMask({...Ne}),children:x(g,{style:S.presetText,children:"Default (hide verbose)"})}),x($,{testID:"buoy-console-levels-all",style:S.presetRow,onPress:()=>e.setLevelsMask({...De}),children:x(g,{style:S.presetText,children:"All levels"})}),Be.map(o=>x(_e,{testID:`buoy-console-level-${o}`,on:e.levelsMask[o],label:yt[o],onPress:()=>r(o)},o)),x(y,{style:S.divider}),x(Wt,{text:"Settings"}),x(_e,{testID:"buoy-console-timestamps",on:e.showTimestamps,label:"Show timestamps",onPress:()=>e.setShowTimestamps(o=>!o)}),x(_e,{testID:"buoy-console-preserve",on:t,label:"Preserve log",subtext:"Do not clear log on reload",onPress:()=>mt(!t)})]})}var S=T.create({list:{flex:1,backgroundColor:"transparent"},subView:{flex:1,backgroundColor:"transparent"},subViewContent:{padding:12},sectionLabel:{color:H.color.textTertiary,fontSize:11,textTransform:"uppercase",letterSpacing:.5,marginTop:4,marginBottom:4,paddingHorizontal:8},presetRow:{paddingVertical:10,paddingHorizontal:8},presetText:{color:H.color.accent,fontSize:14,fontWeight:"600"},divider:{height:T.hairlineWidth,backgroundColor:H.color.border,marginVertical:6},row:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:8,gap:12},rowTextCol:{flexDirection:"column",flex:1},rowLabel:{color:H.color.text,fontSize:14},rowSubtext:{color:H.color.textTertiary,fontSize:12,marginTop:1},checkbox:{width:18,height:18,borderRadius:4,borderWidth:1,borderColor:H.color.fillTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:H.color.accent,borderColor:H.color.accent}});import{jsx as Ke}from"react/jsx-runtime";function Ft({visible:e,onClose:t,onBack:r,onMinimize:o,persistenceKey:n="@react_buoy_console_modal"}){let a=wt();return Ke(tr,{visible:e,onClose:t,onMinimize:o,persistenceKey:n,header:{showToggleButton:true,customContent:Ke(Lt,{c:a,onBack:r})},enablePersistence:true,initialMode:"bottomSheet",disableScrollWrapper:true,children:Ke(zt,{c:a})})}import{createToolFactory as Bn,defineToolPreset as Mn}from"@buoy-gg/shared-ui/web";import{jsx as Hn}from"react/jsx-runtime";var Gt=globalThis,jn=typeof Gt.ErrorUtils?.setGlobalHandler=="function"||typeof Gt.RN$registerExceptionListener=="function";jn&&typeof ue<"u"&&ue?fe():typeof ue<"u"&&ue&&Te();var Vt=Mn({id:"console",name:"CONSOLE",description:"Captured console.* output",slot:"both",color:Qe,icon:({size:e})=>Hn(qe,{size:e}),component:Ft}),Rn=Bn(Vt);import{useEffect as Pn}from"react";import{getAccountAccess as zn,subscribeAccountAccess as Wn}from"@buoy-gg/shared-ui/web";var _t=0;function Fn(){return Pn(()=>{++_t;let e=true,t=()=>{if(!e)return;let o=zn();if(o.status==="locked"){$e(),oe();return}fe(),o.status==="admitted"&&pt()},r=Wn(t);return t(),()=>{e=false,r(),--_t===0&&$e()}},[]),null}import{macOSColors as Gn,windowDragProps as Vn}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as _n}from"react/jsx-runtime";function Kn(){let e=wt();return _n(y,{style:Kt.container,children:[Ue(y,{style:Kt.headerBar,...Vn,children:Ue(Lt,{c:e})}),Ue(zt,{c:e})]})}var Kt=T.create({container:{flex:1,backgroundColor:"transparent"},headerBar:{paddingHorizontal:12,paddingVertical:8,backgroundColor:"transparent",borderBottomWidth:T.hairlineWidth,borderBottomColor:Gn.border.default}});import{useSyncExternalStore as Un,useEffect as Jn}from"react";function Ut(){return Jn(()=>{fe()},[]),{logs:Un(ge,K,K)}}import{night as W,ToolEmptyState as Yn,monoFont as qn}from"@buoy-gg/shared-ui/web";import{jsx as G,jsxs as me}from"react/jsx-runtime";var Jt={verbose:"#9b9b9b",info:W.color.text,warning:"#e2c08d",error:"#f48771"};function Qn(e){let t=new Date(e),r=(o,n=2)=>String(o).padStart(n,"0");return`${r(t.getHours())}:${r(t.getMinutes())}:${r(t.getSeconds())}.${r(t.getMilliseconds(),3)}`}function Zn(){let{logs:e}=Ut(),t=({item:r})=>me(y,{style:B.row,children:[G(g,{style:B.time,children:Qn(r.timestamp)}),G(g,{style:[B.level,{color:Jt[r.level]}],children:r.level.toUpperCase()}),G(g,{style:[B.message,{color:Jt[r.level]}],numberOfLines:3,children:r.message})]});return me(y,{style:B.container,children:[me(y,{style:B.header,children:[me(g,{style:B.headerTitle,children:["Console (",e.length,")"]}),G($,{onPress:()=>oe(),style:B.clearButton,children:G(g,{style:B.clearText,children:"Clear"})})]}),G(He,{keyboardShouldPersistTaps:"handled",data:e,keyExtractor:r=>String(r.id),renderItem:t,ListEmptyComponent:G(Yn,{testID:"buoy-console-empty",otto:"printing",title:"No console logs captured yet",message:"console.log, .warn and .error from your app land here as they run."}),contentContainerStyle:e.length===0?B.emptyContainer:void 0})]})}var B=T.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:8,borderBottomWidth:T.hairlineWidth,borderBottomColor:W.color.border},headerTitle:{color:W.color.text,fontSize:13,fontWeight:"600"},clearButton:{paddingHorizontal:10,paddingVertical:4,borderRadius:4,backgroundColor:W.color.surfaceElevated},clearText:{color:W.color.text,fontSize:12},row:{flexDirection:"row",paddingHorizontal:12,paddingVertical:4,borderBottomWidth:T.hairlineWidth,borderBottomColor:W.color.separator,gap:8},time:{color:W.color.textTertiary,fontSize:11,fontVariant:["tabular-nums"],minWidth:86},level:{fontSize:11,fontWeight:"700",minWidth:44},message:{flex:1,fontSize:12,fontFamily:qn},empty:{color:W.color.textTertiary,fontSize:13,textAlign:"center"},emptyContainer:{flexGrow:1,alignItems:"center",justifyContent:"center"}});import{createSyncAdapter as Xn,memoByIdentity as ea,newestFitting as ta,sizeOrStub as ra}from"@buoy-gg/shared-ui/web";var oa=1.5*1024*1024,na=16*1024,aa=Object.freeze({__buoyTruncated:true,note:"Log payload omitted \u2014 inspect it on-device."}),ia=ea(e=>{let t={...e,args:Ze(e.args),message:te(e.message),stack:e.stack?te(e.stack,4096):e.stack};return ra(t,na,()=>({...t,args:[aa]}))});function la(e){return ta(e,{toWire:ia,budget:oa,baseBytes:16})}var sa=Xn({version:1,getSnapshot(){return{entries:la(K())}},subscribe(e){return ge(e)},actions:{clearEntries(){return oe(),{cleared:true}}}});export{Qe as CONSOLE_ICON_COLOR,qe as ConsoleIcon,Zn as ConsoleLogList,Pt as ConsoleMessageRow,Ft as ConsoleModal,Fn as ConsoleRoot,Ge as ConsoleValue,Kn as ConsoleView,oe as clearEntries,sa as consoleSyncAdapter,m as consoleTheme,Vt as consoleToolPreset,Rn as createConsoleTool,K as getEntries,Oe as getPreserveLog,pt as initConsolePersistence,fe as installConsoleCapture,Te as installFatalErrorCapture,It as levelStyles,Nr as onClear,Dr as replaceEntries,mt as setPreserveLog,ge as subscribe,ht as subscribePreserveLog,$e as uninstallConsoleCapture,Ut as useConsoleLogs,vt as useConsoleMessages};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/console",
3
- "version": "7.0.77",
3
+ "version": "7.0.79",
4
4
  "description": "Inspect captured JavaScript console messages in React Native. Capture and release-build support depend on setup and plan.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "sideEffects": false,
14
14
  "dependencies": {
15
- "@buoy-gg/shared-ui": "^7.0.77"
15
+ "@buoy-gg/shared-ui": "^7.0.79"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": "*"