@buoy-gg/route-events 7.0.40 → 7.0.42

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 (104) hide show
  1. package/README.md +11 -60
  2. package/lib/commonjs/RouteObserver.js +1 -54
  3. package/lib/commonjs/RouteParser.js +1 -314
  4. package/lib/commonjs/RouteTracker.js +1 -112
  5. package/lib/commonjs/RouteTracker.web.js +1 -0
  6. package/lib/commonjs/browserRouteRegistry.js +1 -0
  7. package/lib/commonjs/browserRoutes.js +1 -0
  8. package/lib/commonjs/components/NavigationStack.js +2 -572
  9. package/lib/commonjs/components/ReactNavigationRoutes.js +1 -836
  10. package/lib/commonjs/components/ReactNavigationRoutes.web.js +1 -0
  11. package/lib/commonjs/components/RouteEventDetail.js +1 -97
  12. package/lib/commonjs/components/RouteEventExpandedContent.js +1 -204
  13. package/lib/commonjs/components/RouteEventItemCompact.js +1 -191
  14. package/lib/commonjs/components/RouteEventsModalWithTabs.js +1 -717
  15. package/lib/commonjs/components/RouteEventsTimeline.js +1 -107
  16. package/lib/commonjs/components/RouteFilterViewV2.js +1 -42
  17. package/lib/commonjs/components/RoutesSitemap.js +2 -1035
  18. package/lib/commonjs/expoRouterStore.js +1 -121
  19. package/lib/commonjs/expoRouterStore.web.js +1 -0
  20. package/lib/commonjs/hooks/useRouteEvents.js +1 -57
  21. package/lib/commonjs/index.js +1 -161
  22. package/lib/commonjs/preset.js +1 -69
  23. package/lib/commonjs/stores/navigationStackStore.js +1 -45
  24. package/lib/commonjs/stores/routeEventStore.js +1 -136
  25. package/lib/commonjs/sync/routeEventsSyncAdapter.js +1 -275
  26. package/lib/commonjs/useNavigationStack.js +1 -408
  27. package/lib/commonjs/useNavigationStack.web.js +1 -0
  28. package/lib/commonjs/useRouteObserver.js +1 -73
  29. package/lib/commonjs/useRouteObserverReactNavigation.js +1 -109
  30. package/lib/commonjs/useRouteSitemap.js +1 -255
  31. package/lib/commonjs/utils/routeTemplate.js +1 -28
  32. package/lib/commonjs/utils/safeReactNavigation.js +1 -194
  33. package/lib/commonjs/utils/safeReactNavigation.web.js +1 -0
  34. package/lib/commonjs/utils/testIDs.js +1 -63
  35. package/lib/module/RouteObserver.js +1 -49
  36. package/lib/module/RouteParser.js +1 -309
  37. package/lib/module/RouteTracker.js +1 -109
  38. package/lib/module/RouteTracker.web.js +1 -0
  39. package/lib/module/browserRouteRegistry.js +1 -0
  40. package/lib/module/browserRoutes.js +1 -0
  41. package/lib/module/components/NavigationStack.js +2 -568
  42. package/lib/module/components/ReactNavigationRoutes.js +1 -832
  43. package/lib/module/components/ReactNavigationRoutes.web.js +1 -0
  44. package/lib/module/components/RouteEventDetail.js +1 -93
  45. package/lib/module/components/RouteEventExpandedContent.js +1 -200
  46. package/lib/module/components/RouteEventItemCompact.js +1 -187
  47. package/lib/module/components/RouteEventsModalWithTabs.js +1 -714
  48. package/lib/module/components/RouteEventsTimeline.js +1 -103
  49. package/lib/module/components/RouteFilterViewV2.js +1 -38
  50. package/lib/module/components/RoutesSitemap.js +2 -1033
  51. package/lib/module/expoRouterStore.js +1 -114
  52. package/lib/module/expoRouterStore.web.js +1 -0
  53. package/lib/module/hooks/useRouteEvents.js +1 -54
  54. package/lib/module/index.js +1 -69
  55. package/lib/module/preset.js +1 -66
  56. package/lib/module/stores/navigationStackStore.js +1 -41
  57. package/lib/module/stores/routeEventStore.js +1 -128
  58. package/lib/module/sync/routeEventsSyncAdapter.js +1 -273
  59. package/lib/module/useNavigationStack.js +1 -404
  60. package/lib/module/useNavigationStack.web.js +1 -0
  61. package/lib/module/useRouteObserver.js +1 -70
  62. package/lib/module/useRouteObserverReactNavigation.js +1 -106
  63. package/lib/module/useRouteSitemap.js +1 -250
  64. package/lib/module/utils/routeTemplate.js +1 -24
  65. package/lib/module/utils/safeReactNavigation.js +1 -185
  66. package/lib/module/utils/safeReactNavigation.web.js +1 -0
  67. package/lib/module/utils/testIDs.js +1 -55
  68. package/lib/typescript/RouteTracker.web.d.ts +2 -0
  69. package/lib/typescript/browserRouteRegistry.d.ts +4 -0
  70. package/lib/typescript/browserRoutes.d.ts +2 -0
  71. package/lib/typescript/components/ReactNavigationRoutes.web.d.ts +2 -0
  72. package/lib/typescript/expoRouterStore.web.d.ts +13 -0
  73. package/lib/typescript/index.d.ts +1 -0
  74. package/lib/typescript/useNavigationStack.web.d.ts +4 -0
  75. package/lib/typescript/utils/routeTemplate.d.ts +13 -0
  76. package/lib/typescript/utils/safeReactNavigation.web.d.ts +22 -0
  77. package/lib/web/index.mjs +6 -0
  78. package/package.json +33 -13
  79. package/lib/typescript/RouteObserver.d.ts.map +0 -1
  80. package/lib/typescript/RouteParser.d.ts.map +0 -1
  81. package/lib/typescript/RouteTracker.d.ts.map +0 -1
  82. package/lib/typescript/components/NavigationStack.d.ts.map +0 -1
  83. package/lib/typescript/components/ReactNavigationRoutes.d.ts.map +0 -1
  84. package/lib/typescript/components/RouteEventDetail.d.ts.map +0 -1
  85. package/lib/typescript/components/RouteEventExpandedContent.d.ts.map +0 -1
  86. package/lib/typescript/components/RouteEventItemCompact.d.ts.map +0 -1
  87. package/lib/typescript/components/RouteEventsModalWithTabs.d.ts.map +0 -1
  88. package/lib/typescript/components/RouteEventsTimeline.d.ts.map +0 -1
  89. package/lib/typescript/components/RouteFilterViewV2.d.ts.map +0 -1
  90. package/lib/typescript/components/RoutesSitemap.d.ts.map +0 -1
  91. package/lib/typescript/expoRouterStore.d.ts.map +0 -1
  92. package/lib/typescript/hooks/useRouteEvents.d.ts.map +0 -1
  93. package/lib/typescript/index.d.ts.map +0 -1
  94. package/lib/typescript/preset.d.ts.map +0 -1
  95. package/lib/typescript/stores/navigationStackStore.d.ts.map +0 -1
  96. package/lib/typescript/stores/routeEventStore.d.ts.map +0 -1
  97. package/lib/typescript/sync/routeEventsSyncAdapter.d.ts.map +0 -1
  98. package/lib/typescript/useNavigationStack.d.ts.map +0 -1
  99. package/lib/typescript/useRouteObserver.d.ts.map +0 -1
  100. package/lib/typescript/useRouteObserverReactNavigation.d.ts.map +0 -1
  101. package/lib/typescript/useRouteSitemap.d.ts.map +0 -1
  102. package/lib/typescript/utils/routeTemplate.d.ts.map +0 -1
  103. package/lib/typescript/utils/safeReactNavigation.d.ts.map +0 -1
  104. package/lib/typescript/utils/testIDs.d.ts.map +0 -1
@@ -1,714 +1 @@
1
- "use strict";
2
-
3
- import { useState, useCallback, useEffect, useRef, useMemo } from "react";
4
- import { Text, View, TouchableOpacity, StyleSheet, Alert } from "react-native";
5
- import { getCommonActions, useSafeNavigationContainerRef } from "../utils/safeReactNavigation";
6
-
7
- // Resolved once at module load; null when React Navigation is absent
8
- // (useSafeNavigationContainerRef then yields undefined, so the dispatch
9
- // paths below never execute).
10
- const CommonActions = getCommonActions();
11
- import { useSafeRouter, isExpoRouterAvailable, windowDragProps, ToolEmptyState, resolveListEmptyState, usePersistedState, monoFont } from "@buoy-gg/shared-ui";
12
- import { JsModal, ModalHeader, TabSelector, formatRelativeTime, devToolsStorageKeys, Trash2, Filter, SearchBar, ToolbarCopyButton, Lock, ProUpgradeModal, PowerToggleButton, buoyColors, night, TickProvider, useLimit } from "@buoy-gg/shared-ui";
13
- import { useIsPro } from "@buoy-gg/license";
14
-
15
- // Free tier limit for route events
16
-
17
- import { useRouteEvents } from "../hooks/useRouteEvents";
18
- import { routeEventStore } from "../stores/routeEventStore";
19
- import { RouteEventDetail } from "./RouteEventDetail";
20
- import { RouteFilterViewV2 } from "./RouteFilterViewV2";
21
- import { RoutesSitemap } from "./RoutesSitemap";
22
- import { ReactNavigationRoutes } from "./ReactNavigationRoutes";
23
- import { NavigationStack } from "./NavigationStack";
24
- import { RouteEventsTimeline } from "./RouteEventsTimeline";
25
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
26
- /** Persistence recipes: the tab is stored as its bare name, the flag as "true"/"false". */
27
- const TAB_PERSISTENCE = {
28
- // Every tab the selector offers, including "stack": the save side has
29
- // always written it, so leaving it off this list meant the Stack tab
30
- // was persisted and then silently discarded on the next launch.
31
- parse: raw => raw === "routes" || raw === "events" || raw === "stack" ? raw : undefined,
32
- serialize: tab => tab
33
- };
34
- const BOOLEAN_PERSISTENCE = {
35
- parse: raw => raw === "true",
36
- serialize: value => value.toString()
37
- };
38
- const STRING_SET_PERSISTENCE = {
39
- parse: raw => new Set(JSON.parse(raw)),
40
- serialize: set => JSON.stringify(Array.from(set))
41
- };
42
-
43
- /**
44
- * Find the path from root navigation state to a screen by name.
45
- * Returns array of route names from root to the target, or null if not found.
46
- */
47
- function findScreenPath(state, screenName) {
48
- if (!state || !state.routes) return null;
49
- for (const route of state.routes) {
50
- if (route.name === screenName) {
51
- return [route.name];
52
- }
53
- if (route.state) {
54
- const nested = findScreenPath(route.state, screenName);
55
- if (nested) {
56
- return [route.name, ...nested];
57
- }
58
- }
59
- }
60
- return null;
61
- }
62
-
63
- /**
64
- * Build a nested CommonActions.navigate() from a path of screen names.
65
- * e.g. ["MainApp", "Settings", "SettingScreen"] becomes:
66
- * navigate("MainApp", { screen: "Settings", params: { screen: "SettingScreen" } })
67
- */
68
- function buildNestedNavigateAction(path) {
69
- if (path.length === 0) return null;
70
- if (path.length === 1) {
71
- return CommonActions.navigate({
72
- name: path[0]
73
- });
74
- }
75
-
76
- // Build nested params from the end
77
- let params = {
78
- screen: path[path.length - 1]
79
- };
80
- for (let i = path.length - 2; i >= 1; i--) {
81
- params = {
82
- screen: path[i],
83
- params
84
- };
85
- }
86
- return CommonActions.navigate({
87
- name: path[0],
88
- params
89
- });
90
- }
91
- export function RouteEventsModalWithTabs({
92
- visible,
93
- onClose,
94
- onBack,
95
- onMinimize,
96
- enableSharedModalDimensions = false,
97
- inline = false,
98
- remote
99
- }) {
100
- const router = useSafeRouter();
101
- const containerRef = useSafeNavigationContainerRef();
102
- const hasExpoRouter = isExpoRouterAvailable();
103
- const [activeTab, setActiveTab] = usePersistedState(devToolsStorageKeys.routeEvents.activeTab(), "events", TAB_PERSISTENCE);
104
- const [showUpgradeModal, setShowUpgradeModal] = useState(false);
105
- // Serialized stack reported up by NavigationStack so the copy button can live
106
- // in the shared navbar.
107
- const [stackCopyValue, setStackCopyValue] = useState("");
108
-
109
- // Check Pro status internally
110
- const isPro = useIsPro();
111
- const eventLimit = useLimit("routeEvents.entries");
112
-
113
- // Auto-close upgrade modal when user becomes Pro
114
- useEffect(() => {
115
- if (showUpgradeModal && isPro) {
116
- setShowUpgradeModal(false);
117
- }
118
- }, [showUpgradeModal, isPro]);
119
-
120
- // NOTE: Route tracking requires <RouteTracker /> to be placed inside the navigation tree.
121
- // The useRouteObserver hook uses expo-router hooks that only work inside Stack/Tabs/Slot.
122
- // See the RouteTracker component export for easy setup.
123
-
124
- // Local state to control subscription (true = subscribed, false = unsubscribed)
125
- const [isListeningEnabled, setIsListeningEnabled] = usePersistedState(devToolsStorageKeys.routeEvents.isMonitoring(), true, BOOLEAN_PERSISTENCE);
126
-
127
- // Event Listener state - using centralized store via hook
128
- // Pass enabled option to control subscription
129
- const {
130
- events,
131
- clearEvents: clearRouteEvents,
132
- isListening: isStoreListening
133
- } = useRouteEvents({
134
- enabled: isListeningEnabled
135
- });
136
-
137
- // isListening = enabled and store is listening
138
- const isListening = isListeningEnabled && isStoreListening;
139
-
140
- // The switch above only governs THIS component's subscription; the store
141
- // also holds one of its own from boot (routeEventStore.setBootCapture), so
142
- // pausing here has to release that too or capture would never stop.
143
- useEffect(() => {
144
- routeEventStore.setBootCapture(isListeningEnabled);
145
- }, [isListeningEnabled]);
146
- const [showFilters, setShowFilters] = useState(false);
147
- // Selected event drives the full-screen detail view (parity with the Events
148
- // tool). null = list view. visitNumber feeds the "Visited N times" section.
149
- const [selectedEvent, setSelectedEvent] = useState(null);
150
- const [selectedVisitNumber, setSelectedVisitNumber] = useState(1);
151
- const [searchQuery, setSearchQuery] = useState("");
152
- const [ignoredPatterns, setIgnoredPatterns] = usePersistedState(devToolsStorageKeys.routeEvents.eventFilters(), new Set(["/_sitemap", "/api", "/__dev"]), STRING_SET_PERSISTENCE);
153
- const lastEventRef = useRef(null);
154
- const handleModeChange = useCallback(_mode => {
155
- // Mode changes handled by JsModal
156
- }, []);
157
- const handleNavigate = useCallback(pathname => {
158
- try {
159
- // A remote host (Buoy Desktop) means the events belong to a synced
160
- // device — this process has no router, so delegate over the socket.
161
- // Same Pro gate as remote sitemap navigation: Home stays free so a
162
- // free user can always get the device back to a known screen.
163
- if (remote) {
164
- if (!remote.onNavigatePath) return;
165
- if (!isPro && pathname !== "/") {
166
- setShowUpgradeModal(true);
167
- return;
168
- }
169
- remote.onNavigatePath(pathname);
170
- return;
171
- }
172
- if (hasExpoRouter) {
173
- router.push(pathname);
174
- } else if (containerRef) {
175
- // On RN CLI, pathname is /<ScreenName> — extract the screen name
176
- const screenName = pathname.startsWith("/") ? pathname.slice(1) : pathname;
177
-
178
- // Walk the state tree to find the nesting path to this screen
179
- const rootState = containerRef.getRootState?.();
180
- if (rootState) {
181
- const path = findScreenPath(rootState, screenName);
182
- if (path) {
183
- const action = buildNestedNavigateAction(path);
184
- if (action) {
185
- containerRef.dispatch(action);
186
- return;
187
- }
188
- }
189
- }
190
-
191
- // Fallback: try direct navigation (works for top-level screens)
192
- containerRef.dispatch(CommonActions.navigate({
193
- name: screenName
194
- }));
195
- } else {
196
- // Neither Expo Router nor a navigation container — say so instead
197
- // of swallowing the tap.
198
- Alert.alert("Navigation Unavailable", "No Expo Router or React Navigation container was found in this app.");
199
- }
200
- } catch (error) {
201
- Alert.alert("Navigation Error", String(error));
202
- }
203
- }, [router, containerRef, hasExpoRouter, remote, isPro]);
204
-
205
- // Event listener is now managed by useRouteEvents hook
206
-
207
- const handleToggleListening = useCallback(() => {
208
- // Toggle subscription - this actually subscribes/unsubscribes from the store
209
- setIsListeningEnabled(prev => !prev);
210
- }, []);
211
- const handleClearEvents = useCallback(() => {
212
- if (events.length === 0) return;
213
-
214
- // Gate clear behind Pro
215
- if (!isPro) {
216
- setShowUpgradeModal(true);
217
- return;
218
- }
219
- clearRouteEvents();
220
- }, [events.length, isPro, clearRouteEvents]);
221
- const handleTogglePattern = useCallback(pattern => {
222
- setIgnoredPatterns(prev => {
223
- const next = new Set(prev);
224
- if (next.has(pattern)) {
225
- next.delete(pattern);
226
- } else {
227
- next.add(pattern);
228
- }
229
- return next;
230
- });
231
- }, []);
232
- const handleAddPattern = useCallback(pattern => {
233
- setIgnoredPatterns(prev => new Set([...prev, pattern]));
234
- }, []);
235
- const handleToggleFilters = useCallback(() => {
236
- setShowFilters(!showFilters);
237
- }, [showFilters]);
238
- const handleSelectEvent = useCallback((event, visitNumber) => {
239
- setSelectedEvent(event);
240
- setSelectedVisitNumber(visitNumber);
241
- }, []);
242
- const handleBackFromDetail = useCallback(() => {
243
- setSelectedEvent(null);
244
- }, []);
245
- const handleTabChange = useCallback(tab => {
246
- // Leaving the detail view whenever the tab changes.
247
- setSelectedEvent(null);
248
- setActiveTab(tab);
249
- }, []);
250
-
251
- // Get all unique pathnames from events
252
- const allEventPathnames = useMemo(() => {
253
- const pathnames = new Set();
254
- events.forEach(event => {
255
- if (event.pathname) {
256
- pathnames.add(event.pathname);
257
- }
258
- });
259
- return Array.from(pathnames).sort();
260
- }, [events]);
261
-
262
- // Filter events based on ignored patterns and search query
263
- const filteredEvents = useMemo(() => {
264
- return events.filter(event => {
265
- if (!event.pathname) return false;
266
-
267
- // Filter out pathnames that match ignored patterns
268
- const shouldIgnore = Array.from(ignoredPatterns).some(pattern => event.pathname.includes(pattern));
269
- if (shouldIgnore) return false;
270
-
271
- // Filter by search query (search in pathname and param values)
272
- if (searchQuery.trim()) {
273
- const query = searchQuery.toLowerCase();
274
- const pathnameMatch = event.pathname.toLowerCase().includes(query);
275
- const paramsMatch = Object.entries(event.params || {}).some(([key, value]) => {
276
- const valueStr = Array.isArray(value) ? value.join(" ") : value;
277
- return key.toLowerCase().includes(query) || valueStr.toLowerCase().includes(query);
278
- });
279
- return pathnameMatch || paramsMatch;
280
- }
281
- return true;
282
- });
283
- }, [events, ignoredPatterns, searchQuery]);
284
-
285
- // Pro is Infinity here, so slice() returns everything and the locked count
286
- // floors at 0 — no tier branching needed at the call site.
287
- const visibleEvents = useMemo(() => filteredEvents.slice(0, eventLimit), [filteredEvents, eventLimit]);
288
- const lockedEventCount = useMemo(() => Math.max(0, filteredEvents.length - eventLimit), [filteredEvents.length, eventLimit]);
289
-
290
- /**
291
- * "This was the Nth time you were here", per event.
292
- *
293
- * Keyed by the EVENT, not by its index. Indices belong to the unfiltered
294
- * list, and every consumer below reads them off the FILTERED one — so with
295
- * a search typed, or any ignore pattern active (there are three by
296
- * default), each row was handed the visit count of whatever event sat at
297
- * that position in the full history. Rows read plausibly and were simply
298
- * about a different navigation.
299
- */
300
- const visitCounts = useMemo(() => {
301
- const counts = new Map();
302
- const byEvent = new Map();
303
-
304
- // Oldest to newest, so the first time you visited a route is visit 1.
305
- for (let i = events.length - 1; i >= 0; i--) {
306
- const event = events[i];
307
- const visitNumber = (counts.get(event.pathname) || 0) + 1;
308
- counts.set(event.pathname, visitNumber);
309
- byEvent.set(event, visitNumber);
310
- }
311
- return byEvent;
312
- }, [events]);
313
-
314
- // Prepare copy data - memoized so it only rebuilds when dependencies change
315
- const copyAllEventsData = useMemo(() => {
316
- return {
317
- summary: {
318
- total: events.length,
319
- filtered: filteredEvents.length,
320
- listening: isListening,
321
- ignoredPatterns: Array.from(ignoredPatterns),
322
- timestamp: new Date().toISOString()
323
- },
324
- events: filteredEvents.map((event, index) => ({
325
- index,
326
- visitNumber: visitCounts.get(event) || 1,
327
- pathname: event.pathname,
328
- timestamp: event.timestamp,
329
- timestampRelative: formatRelativeTime(event.timestamp),
330
- params: event.params,
331
- segments: event.segments,
332
- previousPathname: event.previousPathname,
333
- timeSincePrevious: event.timeSincePrevious
334
- }))
335
- };
336
- }, [events.length, filteredEvents, isListening, ignoredPatterns, visitCounts]);
337
- if (!visible) return null;
338
- const persistenceKey = enableSharedModalDimensions ? devToolsStorageKeys.modal.root() : devToolsStorageKeys.routeEvents.modal();
339
-
340
- // No footer needed since we're showing a timeline
341
- const footerNode = null;
342
- const renderContent = () => {
343
- // Detail view takes priority — a selected event replaces the list.
344
- if (selectedEvent) {
345
- return /*#__PURE__*/_jsx(RouteEventDetail, {
346
- event: selectedEvent,
347
- visitNumber: selectedVisitNumber,
348
- onNavigate: handleNavigate
349
- });
350
- }
351
- if (activeTab === "routes") {
352
- // A remote host supplies the tree, so its presence — not this process's
353
- // router — decides which view can render it.
354
- return hasExpoRouter || remote?.sitemap ? /*#__PURE__*/_jsx(RoutesSitemap, {
355
- style: styles.contentWrapper,
356
- injectedRoutes: remote?.sitemap?.routes,
357
- injectedSource: remote?.sitemap?.source ?? null,
358
- injectedLastUpdatedAt: remote?.sitemap?.lastUpdatedAt ?? null,
359
- onNavigateRoute: remote ? handleRemoteNavigateRoute : undefined
360
- }) : /*#__PURE__*/_jsx(ReactNavigationRoutes, {
361
- style: styles.contentWrapper
362
- });
363
- }
364
- if (activeTab === "stack") {
365
- return /*#__PURE__*/_jsx(NavigationStack, {
366
- style: styles.contentWrapper,
367
- injectedStack: remote ? remote.stack ?? [] : undefined,
368
- onAction: remote?.onStackAction,
369
- onCopyValueChange: setStackCopyValue
370
- });
371
- }
372
-
373
- // Events tab content
374
- if (showFilters) {
375
- return /*#__PURE__*/_jsx(RouteFilterViewV2, {
376
- ignoredPatterns: ignoredPatterns,
377
- onTogglePattern: handleTogglePattern,
378
- onAddPattern: handleAddPattern,
379
- availablePathnames: allEventPathnames
380
- });
381
- }
382
-
383
- // Show search bar if there are events (even if filtered to 0)
384
- const showSearchBar = events.length > 0;
385
- if (filteredEvents.length === 0) {
386
- return /*#__PURE__*/_jsxs(View, {
387
- style: styles.contentWrapper,
388
- testID: "buoy-routes-events",
389
- children: [showSearchBar && /*#__PURE__*/_jsx(View, {
390
- style: styles.searchContainer,
391
- testID: "buoy-routes-search-field",
392
- children: /*#__PURE__*/_jsx(SearchBar, {
393
- value: searchQuery,
394
- onChange: setSearchQuery,
395
- placeholder: "Search pathname or params...",
396
- testID: "buoy-routes-search"
397
- })
398
- }), /*#__PURE__*/_jsx(ToolEmptyState, {
399
- testID: "buoy-routes-empty",
400
- ...resolveListEmptyState({
401
- subject: "route events",
402
- search: searchQuery,
403
- total: events.length,
404
- capturing: isListening,
405
- waiting: {
406
- otto: "walking",
407
- title: "No route events yet",
408
- message: "Navigation events will appear here"
409
- },
410
- paused: {
411
- title: "Event listener is paused",
412
- message: "Press play to start monitoring"
413
- }
414
- })
415
- })]
416
- });
417
- }
418
-
419
- // Show chronological timeline of events
420
- return /*#__PURE__*/_jsxs(View, {
421
- style: styles.contentWrapper,
422
- testID: "buoy-routes-events",
423
- children: [/*#__PURE__*/_jsx(View, {
424
- style: styles.searchContainer,
425
- testID: "buoy-routes-search-field",
426
- children: /*#__PURE__*/_jsx(SearchBar, {
427
- value: searchQuery,
428
- onChange: setSearchQuery,
429
- placeholder: "Search pathname or params...",
430
- testID: "buoy-routes-search"
431
- })
432
- }), lockedEventCount > 0 && /*#__PURE__*/_jsxs(View, {
433
- style: styles.lockedEventsBanner,
434
- testID: "buoy-routes-locked-banner",
435
- children: [/*#__PURE__*/_jsx(Lock, {
436
- size: 14,
437
- color: night.color.warning
438
- }), /*#__PURE__*/_jsxs(Text, {
439
- style: styles.lockedEventsBannerText,
440
- testID: "buoy-routes-locked-banner-text",
441
- children: [lockedEventCount, " older ", lockedEventCount === 1 ? 'event' : 'events', " locked"]
442
- }), /*#__PURE__*/_jsx(Text, {
443
- style: styles.lockedEventsBannerSubtext,
444
- children: "Upgrade to Pro for full history"
445
- })]
446
- }), /*#__PURE__*/_jsx(RouteEventsTimeline, {
447
- events: visibleEvents,
448
- visitCounts: visitCounts,
449
- onNavigate: handleNavigate,
450
- onSelectEvent: handleSelectEvent
451
- })]
452
- });
453
- };
454
- const headerContent = selectedEvent ? /*#__PURE__*/_jsxs(ModalHeader, {
455
- children: [/*#__PURE__*/_jsx(ModalHeader.Navigation, {
456
- onBack: handleBackFromDetail
457
- }), /*#__PURE__*/_jsx(ModalHeader.Content, {
458
- title: selectedEvent.pathname,
459
- testID: "buoy-routes-detail-title"
460
- }), /*#__PURE__*/_jsx(ModalHeader.Actions, {
461
- children: /*#__PURE__*/_jsx(ToolbarCopyButton, {
462
- testID: "buoy-routes-detail-copy",
463
- value: {
464
- pathname: selectedEvent.pathname,
465
- previousPathname: selectedEvent.previousPathname,
466
- params: selectedEvent.params,
467
- segments: selectedEvent.segments,
468
- timestamp: selectedEvent.timestamp,
469
- timestampISO: new Date(selectedEvent.timestamp).toISOString(),
470
- timeSincePrevious: selectedEvent.timeSincePrevious,
471
- visitNumber: selectedVisitNumber
472
- },
473
- buttonStyle: styles.iconButton
474
- })
475
- })]
476
- }) : showFilters ? /*#__PURE__*/_jsxs(ModalHeader, {
477
- children: [/*#__PURE__*/_jsx(ModalHeader.Navigation, {
478
- onBack: () => setShowFilters(false)
479
- }), /*#__PURE__*/_jsx(ModalHeader.Content, {
480
- title: "Filters",
481
- testID: "buoy-routes-filters-title"
482
- })]
483
- }) : /*#__PURE__*/_jsxs(ModalHeader, {
484
- children: [onBack && /*#__PURE__*/_jsx(ModalHeader.Navigation, {
485
- onBack: onBack
486
- }), /*#__PURE__*/_jsx(ModalHeader.Content, {
487
- title: "",
488
- noMargin: true,
489
- children: /*#__PURE__*/_jsx(TabSelector, {
490
- tabs: [{
491
- key: "routes",
492
- label: hasExpoRouter ? "Routes" : "Screens"
493
- }, {
494
- key: "events",
495
- label: `Events${events.length > 0 && activeTab !== "events" ? ` (${events.length})` : ""}`
496
- }, {
497
- key: "stack",
498
- label: "Stack"
499
- }],
500
- activeTab: activeTab,
501
- onTabChange: tab => handleTabChange(tab),
502
- testIDPrefix: "buoy-routes-tab"
503
- })
504
- }), /*#__PURE__*/_jsxs(ModalHeader.Actions, {
505
- children: [activeTab === "stack" && /*#__PURE__*/_jsx(ToolbarCopyButton, {
506
- value: stackCopyValue,
507
- buttonStyle: styles.iconButton,
508
- testID: "buoy-routes-stack-copy"
509
- }), activeTab === "events" && /*#__PURE__*/_jsxs(_Fragment, {
510
- children: [/*#__PURE__*/_jsx(ToolbarCopyButton, {
511
- value: copyAllEventsData,
512
- buttonStyle: styles.iconButton,
513
- testID: "buoy-routes-copy"
514
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
515
- onPress: handleToggleFilters,
516
- style: [styles.iconButton, ignoredPatterns.size > 0 && styles.activeFilterButton],
517
- testID: "buoy-routes-filters",
518
- accessibilityRole: "button",
519
- accessibilityLabel: ignoredPatterns.size > 0 ? `Route filters, ${ignoredPatterns.size} active` : "Route filters",
520
- children: /*#__PURE__*/_jsx(Filter, {
521
- size: 14,
522
- color: ignoredPatterns.size > 0 ? night.color.accent : night.color.textSecondary
523
- })
524
- }), /*#__PURE__*/_jsx(PowerToggleButton, {
525
- isEnabled: isListening,
526
- onToggle: handleToggleListening,
527
- accessibilityLabel: "Toggle route event monitoring",
528
- testID: "buoy-routes-power"
529
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
530
- onPress: handleClearEvents,
531
- style: styles.iconButton,
532
- testID: "buoy-routes-clear",
533
- accessibilityRole: "button",
534
- accessibilityLabel: "Clear route events",
535
- children: /*#__PURE__*/_jsx(Trash2, {
536
- size: 14,
537
- color: night.color.danger
538
- })
539
- })]
540
- })]
541
- })]
542
- });
543
-
544
- /**
545
- * Pro gate for remote sitemap navigation. The Home shortcut stays free so a
546
- * free user can always get the device back to a known screen; layouts and
547
- * groups are not navigable at all.
548
- */
549
- const handleRemoteNavigateRoute = route => {
550
- if (route.type === "layout" || route.type === "group") return;
551
- const isHomeRoute = route.type === "index" || route.path === "/";
552
- if (!isPro && !isHomeRoute) {
553
- setShowUpgradeModal(true);
554
- return;
555
- }
556
- remote?.onNavigateRoute?.(route);
557
- };
558
- const upgradeModal = /*#__PURE__*/_jsx(ProUpgradeModal, {
559
- visible: showUpgradeModal,
560
- onClose: () => setShowUpgradeModal(false),
561
- featureName: "Route Event Management"
562
- });
563
-
564
- // The ONLY difference between the phone and the desktop dashboard is which
565
- // shell the header, body and footer go in. Everything above this is shared.
566
- if (inline) {
567
- return /*#__PURE__*/_jsxs(TickProvider, {
568
- children: [/*#__PURE__*/_jsxs(View, {
569
- style: styles.inlineRoot,
570
- children: [/*#__PURE__*/_jsx(View, {
571
- style: styles.inlineHeader,
572
- ...windowDragProps,
573
- children: headerContent
574
- }), renderContent(), footerNode]
575
- }), upgradeModal]
576
- });
577
- }
578
- return /*#__PURE__*/_jsx(TickProvider, {
579
- children: /*#__PURE__*/_jsxs(JsModal, {
580
- visible: visible,
581
- onClose: onClose,
582
- onMinimize: onMinimize,
583
- persistenceKey: persistenceKey,
584
- header: {
585
- showToggleButton: true,
586
- customContent: headerContent
587
- },
588
- onModeChange: handleModeChange,
589
- enablePersistence: true,
590
- initialMode: "bottomSheet",
591
- enableGlitchEffects: true
592
- // Every screen owns its scrolling (timeline FlatList, sitemap/stack/
593
- // detail/filter ScrollViews) — the default wrapper would nest them.
594
- ,
595
- disableScrollWrapper: true,
596
- styles: {},
597
- footer: footerNode,
598
- footerHeight: footerNode ? 68 : 0,
599
- children: [renderContent(), upgradeModal]
600
- })
601
- });
602
- }
603
-
604
- /**
605
- * The same routes tool as `RouteEventsModalWithTabs`, rendered INLINE for hosts
606
- * that place tools in a panel rather than a modal. Exists so there is exactly
607
- * one implementation — the desktop dashboard used to ship its own copy of this
608
- * component's header and tab router.
609
- */
610
- export function RoutesToolView(props = {}) {
611
- return /*#__PURE__*/_jsx(RouteEventsModalWithTabs, {
612
- ...props,
613
- inline: true,
614
- visible: true,
615
- onClose: () => {}
616
- });
617
- }
618
- const styles = StyleSheet.create({
619
- inlineRoot: {
620
- flex: 1,
621
- minHeight: 0,
622
- // Transparent so the desktop workbench's hoisted sky (one field spanning
623
- // sidebar + panel) shows through — the shell paints its base beneath it.
624
- backgroundColor: "transparent"
625
- },
626
- inlineHeader: {
627
- paddingHorizontal: 12,
628
- paddingVertical: 8,
629
- borderBottomWidth: 1,
630
- borderBottomColor: buoyColors.border,
631
- // Clear, like Bench — the host's hoisted sky shows through the header.
632
- backgroundColor: "transparent"
633
- },
634
- iconButton: {
635
- padding: 6,
636
- borderRadius: 6,
637
- backgroundColor: night.color.buttonSurface
638
- },
639
- activeFilterButton: {
640
- backgroundColor: night.color.accentSoft
641
- },
642
- emptyState: {
643
- flex: 1,
644
- justifyContent: "center",
645
- alignItems: "center",
646
- padding: 32
647
- },
648
- emptyTitle: {
649
- color: night.color.text,
650
- fontSize: 16,
651
- fontWeight: "600",
652
- marginTop: 16,
653
- marginBottom: 8,
654
- fontFamily: monoFont,
655
- letterSpacing: 0.5,
656
- textTransform: "uppercase"
657
- },
658
- emptySubtitle: {
659
- color: night.color.textSecondary,
660
- fontSize: 14,
661
- textAlign: "center",
662
- fontFamily: monoFont
663
- },
664
- contentWrapper: {
665
- flex: 1
666
- },
667
- statsContainer: {
668
- paddingHorizontal: 16,
669
- paddingVertical: 8,
670
- backgroundColor: night.color.surface,
671
- borderBottomWidth: 1,
672
- borderBottomColor: night.color.border
673
- },
674
- statsText: {
675
- fontSize: 11,
676
- color: night.color.textSecondary,
677
- fontFamily: monoFont,
678
- textAlign: "center"
679
- },
680
- statsWarning: {
681
- color: night.color.warning,
682
- fontWeight: "600"
683
- },
684
- searchContainer: {
685
- paddingHorizontal: 16,
686
- paddingVertical: 8,
687
- // Transparent so the night sheet's star field shows through.
688
- backgroundColor: "transparent"
689
- },
690
- lockedEventsBanner: {
691
- flexDirection: "row",
692
- alignItems: "center",
693
- gap: 8,
694
- backgroundColor: night.color.warningSoft,
695
- borderWidth: 1,
696
- borderColor: night.color.warning + "30",
697
- borderRadius: 8,
698
- paddingVertical: 10,
699
- paddingHorizontal: 14,
700
- marginHorizontal: 16,
701
- marginBottom: 8
702
- },
703
- lockedEventsBannerText: {
704
- fontSize: 12,
705
- fontWeight: "600",
706
- color: night.color.warning,
707
- fontFamily: monoFont
708
- },
709
- lockedEventsBannerSubtext: {
710
- fontSize: 11,
711
- color: night.color.textSecondary,
712
- marginLeft: "auto"
713
- }
714
- });
1
+ "use strict";import{useState as T,useCallback as g,useEffect as oe,useRef as Ie,useMemo as N}from"react";import{Text as re,View as S,TouchableOpacity as ae,StyleSheet as Ae,Alert as se}from"react-native";import{getCommonActions as De,useSafeNavigationContainerRef as ze}from"../utils/safeReactNavigation";const U=De();import{useSafeRouter as Le,isExpoRouterAvailable as Me,windowDragProps as Fe,ToolEmptyState as We,resolveListEmptyState as je,usePersistedState as J,monoFont as W}from"@buoy-gg/shared-ui";import{JsModal as Ve,ModalHeader as m,TabSelector as He,formatRelativeTime as Oe,devToolsStorageKeys as B,Trash2 as _e,Filter as Ue,SearchBar as ie,ToolbarCopyButton as K,Lock as Je,ProUpgradeModal as Ke,PowerToggleButton as $e,buoyColors as Ge,night as s,TickProvider as le,useLimit as Qe}from"@buoy-gg/shared-ui";import{useIsPro as qe}from"@buoy-gg/license";import{useRouteEvents as Xe}from"../hooks/useRouteEvents";import{routeEventStore as Ye}from"../stores/routeEventStore";import{RouteEventDetail as Ze}from"./RouteEventDetail";import{RouteFilterViewV2 as et}from"./RouteFilterViewV2";import{RoutesSitemap as tt}from"./RoutesSitemap";import{ReactNavigationRoutes as nt}from"./ReactNavigationRoutes";import{NavigationStack as ot}from"./NavigationStack";import{RouteEventsTimeline as rt}from"./RouteEventsTimeline";import{splitRouteHref as at}from"../utils/routeTemplate";import{jsx as n,jsxs as u,Fragment as st}from"react/jsx-runtime";const it={parse:t=>t==="routes"||t==="events"||t==="stack"?t:void 0,serialize:t=>t};const lt={parse:t=>t==="true",serialize:t=>t.toString()};const ct={parse:t=>new Set(JSON.parse(t)),serialize:t=>JSON.stringify(Array.from(t))};function ce(t,f){if(!t||!t.routes)return null;for(const l of t.routes){if(l.name===f){return[l.name]}if(l.state){const v=ce(l.state,f);if(v){return[l.name,...v]}}}return null}function ut(t,f){if(t.length===0)return null;const l=f&&Object.keys(f).length>0?f:void 0;if(t.length===1){return U.navigate(l?{name:t[0],params:l}:{name:t[0]})}let v=l?{screen:t[t.length-1],params:l}:{screen:t[t.length-1]};for(let P=t.length-2;P>=1;P--){v={screen:t[P],params:v}}return U.navigate({name:t[0],params:v})}export function RouteEventsModalWithTabs({visible:t,onClose:f,onBack:l,onMinimize:v,enableSharedModalDimensions:P=false,inline:ue=false,remote:c}){const $=Le();const w=ze();const I=Me();const[E,de]=J(B.routeEvents.activeTab(),"events",it);const[j,x]=T(false);const[me,ge]=T("");const y=qe();const A=Qe("routeEvents.entries");oe(()=>{if(j&&y){x(false)}},[j,y]);const[D,pe]=J(B.routeEvents.isMonitoring(),true,lt);const{events:i,clearEvents:G,isListening:he}=Xe({enabled:D});const z=D&&he;oe(()=>{Ye.setBootCapture(D)},[D]);const[L,Q]=T(false);const[d,V]=T(null);const[q,fe]=T(1);const[C,X]=T("");const[p,Y]=J(B.routeEvents.eventFilters(),new Set(["/_sitemap","/api","/__dev"]),ct);const dt=Ie(null);const ve=g(e=>{},[]);const Z=g(e=>{try{if(c){if(!c.onNavigatePath)return;if(!y&&e!=="/"){x(true);return}c.onNavigatePath(e);return}if(I){$.push(e)}else if(w){const{pathname:o,params:r}=at(e);const h=o.startsWith("/")?o.slice(1):o;const R=Object.keys(r).length>0;const M=w.getRootState?.();if(M){const k=ce(M,h);if(k){const F=ut(k,r);if(F){w.dispatch(F);return}}}w.dispatch(U.navigate(R?{name:h,params:r}:{name:h}))}else{se.alert("Navigation Unavailable","No Expo Router or React Navigation container was found in this app.")}}catch(o){se.alert("Navigation Error",String(o))}},[$,w,I,c,y]);const be=g(()=>{pe(e=>!e)},[]);const ye=g(()=>{if(i.length===0)return;if(!y){x(true);return}G()},[i.length,y,G]);const Se=g(e=>{Y(o=>{const r=new Set(o);if(r.has(e)){r.delete(e)}else{r.add(e)}return r})},[]);const Ee=g(e=>{Y(o=>new Set([...o,e]))},[]);const Ce=g(()=>{Q(!L)},[L]);const Re=g((e,o)=>{V(e);fe(o)},[]);const ke=g(()=>{V(null)},[]);const Te=g(e=>{V(null);de(e)},[]);const Ne=N(()=>{const e=new Set;i.forEach(o=>{if(o.pathname){e.add(o.pathname)}});return Array.from(e).sort()},[i]);const b=N(()=>{return i.filter(e=>{if(!e.pathname)return false;const o=Array.from(p).some(r=>e.pathname.includes(r));if(o)return false;if(C.trim()){const r=C.toLowerCase();const h=e.pathname.toLowerCase().includes(r);const R=Object.entries(e.params||{}).some(([M,k])=>{const F=Array.isArray(k)?k.join(" "):k;return M.toLowerCase().includes(r)||F.toLowerCase().includes(r)});return h||R}return true})},[i,p,C]);const Pe=N(()=>b.slice(0,A),[b,A]);const H=N(()=>Math.max(0,b.length-A),[b.length,A]);const O=N(()=>{const e=new Map;const o=new Map;for(let r=i.length-1;r>=0;r--){const h=i[r];const R=(e.get(h.pathname)||0)+1;e.set(h.pathname,R);o.set(h,R)}return o},[i]);const we=N(()=>{return{summary:{total:i.length,filtered:b.length,listening:z,ignoredPatterns:Array.from(p),timestamp:new Date().toISOString()},events:b.map((e,o)=>({index:o,visitNumber:O.get(e)||1,pathname:e.pathname,timestamp:e.timestamp,timestampRelative:Oe(e.timestamp),params:e.params,segments:e.segments,previousPathname:e.previousPathname,timeSincePrevious:e.timeSincePrevious}))}},[i.length,b,z,p,O]);if(!t)return null;const xe=P?B.modal.root():B.routeEvents.modal();const _=null;const ee=()=>{if(d){return n(Ze,{event:d,visitNumber:q,onNavigate:Z})}if(E==="routes"){return I||c?.sitemap?n(tt,{style:a.contentWrapper,injectedRoutes:c?.sitemap?.routes,injectedSource:c?.sitemap?.source??null,injectedLastUpdatedAt:c?.sitemap?.lastUpdatedAt??null,onNavigateRoute:c?Be:void 0}):n(nt,{style:a.contentWrapper})}if(E==="stack"){return n(ot,{style:a.contentWrapper,injectedStack:c?c.stack??[]:void 0,onAction:c?.onStackAction,onCopyValueChange:ge})}if(L){return n(et,{ignoredPatterns:p,onTogglePattern:Se,onAddPattern:Ee,availablePathnames:Ne})}const e=i.length>0;if(b.length===0){return u(S,{style:a.contentWrapper,testID:"buoy-routes-events",children:[e&&n(S,{style:a.searchContainer,testID:"buoy-routes-search-field",children:n(ie,{value:C,onChange:X,placeholder:"Search pathname or params...",testID:"buoy-routes-search"})}),n(We,{testID:"buoy-routes-empty",...je({subject:"route events",search:C,total:i.length,capturing:z,waiting:{otto:"walking",title:"No route events yet",message:"Navigation events will appear here"},paused:{title:"Event listener is paused",message:"Press play to start monitoring"}})})]})}return u(S,{style:a.contentWrapper,testID:"buoy-routes-events",children:[n(S,{style:a.searchContainer,testID:"buoy-routes-search-field",children:n(ie,{value:C,onChange:X,placeholder:"Search pathname or params...",testID:"buoy-routes-search"})}),H>0&&u(S,{style:a.lockedEventsBanner,testID:"buoy-routes-locked-banner",children:[n(Je,{size:14,color:s.color.warning}),u(re,{style:a.lockedEventsBannerText,testID:"buoy-routes-locked-banner-text",children:[H," older ",H===1?"event":"events"," locked"]}),n(re,{style:a.lockedEventsBannerSubtext,children:"Upgrade to Pro for full history"})]}),n(rt,{events:Pe,visitCounts:O,onNavigate:Z,onSelectEvent:Re})]})};const te=d?u(m,{children:[n(m.Navigation,{onBack:ke}),n(m.Content,{title:d.pathname,testID:"buoy-routes-detail-title"}),n(m.Actions,{children:n(K,{testID:"buoy-routes-detail-copy",value:{pathname:d.pathname,previousPathname:d.previousPathname,params:d.params,segments:d.segments,timestamp:d.timestamp,timestampISO:new Date(d.timestamp).toISOString(),timeSincePrevious:d.timeSincePrevious,visitNumber:q},buttonStyle:a.iconButton})})]}):L?u(m,{children:[n(m.Navigation,{onBack:()=>Q(false)}),n(m.Content,{title:"Filters",testID:"buoy-routes-filters-title"})]}):u(m,{children:[l&&n(m.Navigation,{onBack:l}),n(m.Content,{title:"",noMargin:true,children:n(He,{tabs:[{key:"routes",label:I?"Routes":"Screens"},{key:"events",label:`Events${i.length>0&&E!=="events"?` (${i.length})`:""}`},{key:"stack",label:"Stack"}],activeTab:E,onTabChange:e=>Te(e),testIDPrefix:"buoy-routes-tab"})}),u(m.Actions,{children:[E==="stack"&&n(K,{value:me,buttonStyle:a.iconButton,testID:"buoy-routes-stack-copy"}),E==="events"&&u(st,{children:[n(K,{value:we,buttonStyle:a.iconButton,testID:"buoy-routes-copy"}),n(ae,{onPress:Ce,style:[a.iconButton,p.size>0&&a.activeFilterButton],testID:"buoy-routes-filters",accessibilityRole:"button",accessibilityLabel:p.size>0?`Route filters, ${p.size} active`:"Route filters",children:n(Ue,{size:14,color:p.size>0?s.color.accent:s.color.textSecondary})}),n($e,{isEnabled:z,onToggle:be,accessibilityLabel:"Toggle route event monitoring",testID:"buoy-routes-power"}),n(ae,{onPress:ye,style:a.iconButton,testID:"buoy-routes-clear",accessibilityRole:"button",accessibilityLabel:"Clear route events",children:n(_e,{size:14,color:s.color.danger})})]})]})]});const Be=e=>{if(e.type==="layout"||e.type==="group")return;const o=e.type==="index"||e.path==="/";if(!y&&!o){x(true);return}c?.onNavigateRoute?.(e)};const ne=n(Ke,{visible:j,onClose:()=>x(false),featureName:"Route Event Management"});if(ue){return u(le,{children:[u(S,{style:a.inlineRoot,children:[n(S,{style:a.inlineHeader,...Fe,children:te}),ee(),_]}),ne]})}return n(le,{children:u(Ve,{visible:t,onClose:f,onMinimize:v,persistenceKey:xe,header:{showToggleButton:true,customContent:te},onModeChange:ve,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:true,styles:{},footer:_,footerHeight:_?68:0,children:[ee(),ne]})})}export function RoutesToolView(t={}){return n(RouteEventsModalWithTabs,{...t,inline:true,visible:true,onClose:()=>{}})}const a=Ae.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Ge.border,backgroundColor:"transparent"},iconButton:{padding:6,borderRadius:6,backgroundColor:s.color.buttonSurface},activeFilterButton:{backgroundColor:s.color.accentSoft},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:s.color.text,fontSize:16,fontWeight:"600",marginTop:16,marginBottom:8,fontFamily:W,letterSpacing:.5,textTransform:"uppercase"},emptySubtitle:{color:s.color.textSecondary,fontSize:14,textAlign:"center",fontFamily:W},contentWrapper:{flex:1},statsContainer:{paddingHorizontal:16,paddingVertical:8,backgroundColor:s.color.surface,borderBottomWidth:1,borderBottomColor:s.color.border},statsText:{fontSize:11,color:s.color.textSecondary,fontFamily:W,textAlign:"center"},statsWarning:{color:s.color.warning,fontWeight:"600"},searchContainer:{paddingHorizontal:16,paddingVertical:8,backgroundColor:"transparent"},lockedEventsBanner:{flexDirection:"row",alignItems:"center",gap:8,backgroundColor:s.color.warningSoft,borderWidth:1,borderColor:s.color.warning+"30",borderRadius:8,paddingVertical:10,paddingHorizontal:14,marginHorizontal:16,marginBottom:8},lockedEventsBannerText:{fontSize:12,fontWeight:"600",color:s.color.warning,fontFamily:W},lockedEventsBannerSubtext:{fontSize:11,color:s.color.textSecondary,marginLeft:"auto"}});