@buoy-gg/route-events 7.0.42 → 7.0.44
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.routeEventsSyncAdapter=exports.SNAPSHOT_PARAM_INLINE_LIMIT=void 0;var _sharedUi=require("@buoy-gg/shared-ui");var _routeEventStore=require("../stores/routeEventStore");var _navigationStackStore=require("../stores/navigationStackStore");var _RouteParser=require("../RouteParser");var _expoRouterStore=require("../expoRouterStore");const SNAPSHOT_PARAM_INLINE_LIMIT=exports.SNAPSHOT_PARAM_INLINE_LIMIT=16*1024;const PARAMS_ON_DEVICE=Object.freeze({__buoyOmitted:"route-params",note:"Navigation params stay on the device."});function shouldOmitParams(t){if(t==null)return false;return(0,_sharedUi.isOverWireBudget)(t,SNAPSHOT_PARAM_INLINE_LIMIT)}function toWireParams(t){if(!shouldOmitParams(t))return t;return PARAMS_ON_DEVICE}function toWireEvent(t){if(!shouldOmitParams(t.params))return t;return{...t,params:toWireParams(t.params)}}function toWireStackItem(t){if(!shouldOmitParams(t.params))return t;return{...t,params:toWireParams(t.params)}}function getSitemapSnapshot(){const t=(0,_expoRouterStore.getRouteNodeMetadata)();return{routes:_RouteParser.RouteParser.parseRouteTree((0,_expoRouterStore.loadRouteNode)()),source:t.source,lastUpdatedAt:t.lastLoadedAt}}const routeEventsSyncAdapter=exports.routeEventsSyncAdapter={version:3,getSnapshot:()=>({events:_routeEventStore.routeEventStore.getEvents().map(toWireEvent),sitemap:getSitemapSnapshot(),stack:_navigationStackStore.navigationStackStore.getStack().map(toWireStackItem)}),subscribe:t=>{const e=_routeEventStore.routeEventStore.subscribeToEvents(t);const a=_navigationStackStore.navigationStackStore.subscribe(t);let r=null;if(!(0,_expoRouterStore.loadRouteNode)()){let n=0;const i=100;const o=()=>{n+=1;if((0,_expoRouterStore.loadRouteNode)()){r=null;t();return}r=n<i?setTimeout(o,100):null};r=setTimeout(o,100)}return()=>{e();a();if(r)clearTimeout(r)}},actions:{clearEvents:()=>{_routeEventStore.routeEventStore.clearEvents()},getCurrentRoute:()=>{const t=_routeEventStore.routeEventStore.getEvents()[0];if(t&&_routeEventStore.routeEventStore.isCapturing()){return{path:t.pathname,params:toWireParams(t.params),at:t.timestamp,source:"event"}}const e=_navigationStackStore.navigationStackStore.getStack();const a=e.find(r=>r.isFocused)??e[e.length-1];if(a?.pathname){return{path:a.pathname,params:toWireParams(a.params??{}),at:null,source:"stack"}}if(t){return{path:t.pathname,params:toWireParams(t.params),at:t.timestamp,source:"event",stale:true}}return{path:null,params:{},at:null,source:null}},navigate:t=>{const e=t;const a=e?.path;if(!a){throw new Error("navigate requires a 'path' param")}const r=(0,_sharedUi.getSafeRouter)();if(!r){const i=_navigationStackStore.navigationStackStore.getActions();const o=a.replace(/^\//,"");if(!i?.navigateToRoute||!o){throw new Error("expo-router is not available here and no navigation container was captured \u2014 is <RouteTracker /> mounted inside your NavigationContainer?")}const s=i.navigateToRoute(o,e?.params);if(!s){throw new Error(`Could not navigate to "${o}" \u2014 no navigation container is live.`)}return{navigated:a,replaced:false,via:"react-navigation"}}const n=e?.replace===true&&typeof r.replace==="function"?r.replace:r.navigate;n(a);return{navigated:a,replaced:e?.replace===true}},stackNavigateToIndex:t=>{const e=t?.index;if(typeof e!=="number"){throw new Error("stackNavigateToIndex requires a numeric 'index'")}const a=_navigationStackStore.navigationStackStore.getActions();if(!a)throw new Error("navigation stack is not available");a.navigateToIndex(e);return{navigatedToIndex:e}},stackPopToIndex:t=>{const e=t?.index;if(typeof e!=="number"){throw new Error("stackPopToIndex requires a numeric 'index'")}const a=_navigationStackStore.navigationStackStore.getActions();if(!a)throw new Error("navigation stack is not available");a.popToIndex(e);return{poppedToIndex:e}},stackGoBack:()=>{const t=_navigationStackStore.navigationStackStore.getActions();if(!t)throw new Error("navigation stack is not available");t.goBack();return{wentBack:true}},stackPopToTop:()=>{const t=_navigationStackStore.navigationStackStore.getActions();if(!t)throw new Error("navigation stack is not available");t.popToTop();return{poppedToTop:true}}}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.routeEventsSyncAdapter=exports.SNAPSHOT_PARAM_INLINE_LIMIT=void 0;var _sharedUi=require("@buoy-gg/shared-ui");var _routeEventStore=require("../stores/routeEventStore");var _navigationStackStore=require("../stores/navigationStackStore");var _RouteParser=require("../RouteParser");var _expoRouterStore=require("../expoRouterStore");const SNAPSHOT_PARAM_INLINE_LIMIT=exports.SNAPSHOT_PARAM_INLINE_LIMIT=16*1024;const PARAMS_ON_DEVICE=Object.freeze({__buoyOmitted:"route-params",note:"Navigation params stay on the device."});function shouldOmitParams(t){if(t==null)return false;return(0,_sharedUi.isOverWireBudget)(t,SNAPSHOT_PARAM_INLINE_LIMIT)}function toWireParams(t){if(!shouldOmitParams(t))return t;return PARAMS_ON_DEVICE}function toWireEvent(t){if(!shouldOmitParams(t.params))return t;return{...t,params:toWireParams(t.params)}}function toWireStackItem(t){if(!shouldOmitParams(t.params))return t;return{...t,params:toWireParams(t.params)}}function getSitemapSnapshot(){const t=(0,_expoRouterStore.getRouteNodeMetadata)();return{routes:_RouteParser.RouteParser.parseRouteTree((0,_expoRouterStore.loadRouteNode)()),source:t.source,lastUpdatedAt:t.lastLoadedAt}}const routeEventsSyncAdapter=exports.routeEventsSyncAdapter={version:3,getSnapshot:()=>({events:_routeEventStore.routeEventStore.getEvents().map(toWireEvent),sitemap:getSitemapSnapshot(),stack:_navigationStackStore.navigationStackStore.getStack().map(toWireStackItem)}),subscribe:t=>{const e=_routeEventStore.routeEventStore.subscribeToEvents(t);const a=_navigationStackStore.navigationStackStore.subscribe(t);let r=null;if(!(0,_expoRouterStore.loadRouteNode)()){let n=0;const i=100;const o=()=>{n+=1;if((0,_expoRouterStore.loadRouteNode)()){r=null;t();return}r=n<i?setTimeout(o,100):null};r=setTimeout(o,100)}return()=>{e();a();if(r)clearTimeout(r)}},actions:{clearEvents:()=>{_routeEventStore.routeEventStore.clearEvents()},getCurrentRoute:()=>{const t=_routeEventStore.routeEventStore.getEvents()[0];if(t&&_routeEventStore.routeEventStore.isCapturing()){return{path:t.pathname,params:toWireParams(t.params),at:t.timestamp,source:"event"}}const e=_navigationStackStore.navigationStackStore.getStack();const a=e.find(r=>r.isFocused)??e[e.length-1];if(a?.pathname){return{path:a.pathname,params:toWireParams(a.params??{}),at:null,source:"stack"}}if(t){return{path:t.pathname,params:toWireParams(t.params),at:t.timestamp,source:"event",stale:true}}return{path:null,params:{},at:null,source:null}},navigate:t=>{const e=t;const a=e?.path;if(!a){throw new Error("navigate requires a 'path' param")}const r=(0,_sharedUi.getSafeRouter)();if(!r){const i=_navigationStackStore.navigationStackStore.getActions();const o=a.replace(/^\//,"");if(!i?.navigateToRoute||!o){throw new Error("expo-router is not available here and no navigation container was captured \u2014 is <RouteTracker /> mounted inside your NavigationContainer?")}const s=i.navigateToRoute(o,e?.params);if(!s){throw new Error(`Could not navigate to "${o}" \u2014 no navigation container is live.`)}return{navigated:a,replaced:false,via:"react-navigation"}}if(e?.reset===true){try{if(r.canDismiss?.())r.dismissAll?.()}catch{}r.navigate(a);return{navigated:a,replaced:false,reset:true}}const n=e?.replace===true&&typeof r.replace==="function"?r.replace:r.navigate;n(a);return{navigated:a,replaced:e?.replace===true}},stackNavigateToIndex:t=>{const e=t?.index;if(typeof e!=="number"){throw new Error("stackNavigateToIndex requires a numeric 'index'")}const a=_navigationStackStore.navigationStackStore.getActions();if(!a)throw new Error("navigation stack is not available");a.navigateToIndex(e);return{navigatedToIndex:e}},stackPopToIndex:t=>{const e=t?.index;if(typeof e!=="number"){throw new Error("stackPopToIndex requires a numeric 'index'")}const a=_navigationStackStore.navigationStackStore.getActions();if(!a)throw new Error("navigation stack is not available");a.popToIndex(e);return{poppedToIndex:e}},stackGoBack:()=>{const t=_navigationStackStore.navigationStackStore.getActions();if(!t)throw new Error("navigation stack is not available");t.goBack();return{wentBack:true}},stackPopToTop:()=>{const t=_navigationStackStore.navigationStackStore.getActions();if(!t)throw new Error("navigation stack is not available");t.popToTop();return{poppedToTop:true}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{getSafeRouter as d}from"@buoy-gg/shared-ui";import{routeEventStore as i}from"../stores/routeEventStore";import{navigationStackStore as
|
|
1
|
+
"use strict";import{getSafeRouter as d}from"@buoy-gg/shared-ui";import{routeEventStore as i}from"../stores/routeEventStore";import{navigationStackStore as n}from"../stores/navigationStackStore";import{RouteParser as f}from"../RouteParser";import{loadRouteNode as p,getRouteNodeMetadata as v}from"../expoRouterStore";import{isOverWireBudget as g}from"@buoy-gg/shared-ui";export const SNAPSHOT_PARAM_INLINE_LIMIT=16*1024;const h=Object.freeze({__buoyOmitted:"route-params",note:"Navigation params stay on the device."});function l(t){if(t==null)return false;return g(t,SNAPSHOT_PARAM_INLINE_LIMIT)}function s(t){if(!l(t))return t;return h}function T(t){if(!l(t.params))return t;return{...t,params:s(t.params)}}function k(t){if(!l(t.params))return t;return{...t,params:s(t.params)}}function E(){const t=v();return{routes:f.parseRouteTree(p()),source:t.source,lastUpdatedAt:t.lastLoadedAt}}export const routeEventsSyncAdapter={version:3,getSnapshot:()=>({events:i.getEvents().map(T),sitemap:E(),stack:n.getStack().map(k)}),subscribe:t=>{const e=i.subscribeToEvents(t);const a=n.subscribe(t);let r=null;if(!p()){let c=0;const u=100;const o=()=>{c+=1;if(p()){r=null;t();return}r=c<u?setTimeout(o,100):null};r=setTimeout(o,100)}return()=>{e();a();if(r)clearTimeout(r)}},actions:{clearEvents:()=>{i.clearEvents()},getCurrentRoute:()=>{const t=i.getEvents()[0];if(t&&i.isCapturing()){return{path:t.pathname,params:s(t.params),at:t.timestamp,source:"event"}}const e=n.getStack();const a=e.find(r=>r.isFocused)??e[e.length-1];if(a?.pathname){return{path:a.pathname,params:s(a.params??{}),at:null,source:"stack"}}if(t){return{path:t.pathname,params:s(t.params),at:t.timestamp,source:"event",stale:true}}return{path:null,params:{},at:null,source:null}},navigate:t=>{const e=t;const a=e?.path;if(!a){throw new Error("navigate requires a 'path' param")}const r=d();if(!r){const u=n.getActions();const o=a.replace(/^\//,"");if(!u?.navigateToRoute||!o){throw new Error("expo-router is not available here and no navigation container was captured \u2014 is <RouteTracker /> mounted inside your NavigationContainer?")}const m=u.navigateToRoute(o,e?.params);if(!m){throw new Error(`Could not navigate to "${o}" \u2014 no navigation container is live.`)}return{navigated:a,replaced:false,via:"react-navigation"}}if(e?.reset===true){try{if(r.canDismiss?.())r.dismissAll?.()}catch{}r.navigate(a);return{navigated:a,replaced:false,reset:true}}const c=e?.replace===true&&typeof r.replace==="function"?r.replace:r.navigate;c(a);return{navigated:a,replaced:e?.replace===true}},stackNavigateToIndex:t=>{const e=t?.index;if(typeof e!=="number"){throw new Error("stackNavigateToIndex requires a numeric 'index'")}const a=n.getActions();if(!a)throw new Error("navigation stack is not available");a.navigateToIndex(e);return{navigatedToIndex:e}},stackPopToIndex:t=>{const e=t?.index;if(typeof e!=="number"){throw new Error("stackPopToIndex requires a numeric 'index'")}const a=n.getActions();if(!a)throw new Error("navigation stack is not available");a.popToIndex(e);return{poppedToIndex:e}},stackGoBack:()=>{const t=n.getActions();if(!t)throw new Error("navigation stack is not available");t.goBack();return{wentBack:true}},stackPopToTop:()=>{const t=n.getActions();if(!t)throw new Error("navigation stack is not available");t.popToTop();return{poppedToTop:true}}}};
|
|
@@ -94,10 +94,17 @@ export declare const routeEventsSyncAdapter: {
|
|
|
94
94
|
navigated: string;
|
|
95
95
|
replaced: boolean;
|
|
96
96
|
via: string;
|
|
97
|
+
reset?: undefined;
|
|
97
98
|
} | {
|
|
98
99
|
navigated: string;
|
|
99
100
|
replaced: boolean;
|
|
101
|
+
reset: boolean;
|
|
100
102
|
via?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
navigated: string;
|
|
105
|
+
replaced: boolean;
|
|
106
|
+
via?: undefined;
|
|
107
|
+
reset?: undefined;
|
|
101
108
|
};
|
|
102
109
|
stackNavigateToIndex: (params?: unknown) => {
|
|
103
110
|
navigatedToIndex: number;
|
package/lib/web/index.mjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
|
|
4
4
|
Route: ${b.path}`,[{text:"Cancel",style:"cancel"},{text:w<Pe.length-1?"Next":"Navigate",onPress:ne=>{if(ne&&ne.trim()){let fe={...X,[Le]:ne.trim()};ye(b,w+1,fe)}else _.alert("Invalid Value","Please enter a value for the parameter")}}],"plain-text")},[N]),xe=Ne((b,w)=>{if(a){a(b);return}if(!O&&!w?.bypassPro){ae(true);return}if(b.type==="layout"||b.type==="group"){_.alert("Cannot Navigate",`${b.type==="layout"?"Layouts":"Route groups"} are not navigable routes`);return}if(b.type==="dynamic"||b.type==="catch-all"){if(b.params.length===0){try{N.push(b.path)}catch(X){_.alert("Navigation Error",String(X))}return}ye(b);return}try{N.push(b.path)}catch(X){_.alert("Navigation Error",String(X))}},[N,ye,O,a]),le=Ne(()=>{xe(xa,{bypassPro:true})},[xe]),f=Ne(()=>{v||(T(true),R(),setTimeout(()=>T(false),400))},[v,R]),E=_e(()=>V?`Updated ${ia(V)}`:"Awaiting route data",[V]),H=_e(()=>K?`Source: ${K}`:"Source: unknown",[K]),ce=_e(()=>n&&G.length>0?[{title:"Search Results",icon:"",routes:G}]:P,[n,G,P]);return ee?L(l,{style:[s.container,e],children:[u&&L(l,{style:s.searchContainer,testID:"buoy-routes-sitemap-search-field",children:[d(Vt,{size:16,color:y.color.textTertiary}),d(Lt,{style:s.searchInput,placeholder:"Search routes...",placeholderTextColor:y.color.placeholder,value:n,onChangeText:i,autoCapitalize:"none",autoCorrect:false,autoFocus:true,testID:"buoy-routes-sitemap-search",accessibilityLabel:"Search routes"}),n.length>0&&d(W,{onPress:()=>i(""),style:s.clearButton,testID:"buoy-routes-sitemap-search-clear",accessibilityRole:"button",accessibilityLabel:"Clear route search",children:d(p,{style:s.clearButtonText,children:"\u2715"})}),d(W,{style:s.closeSearchButton,onPress:()=>{c(false),i("")},testID:"buoy-routes-sitemap-search-done",accessibilityRole:"button",accessibilityLabel:"Done searching routes",children:d(p,{style:s.closeSearchText,children:"Done"})})]}),L(Ue,{testID:"buoy-routes-sitemap-scroll",style:s.scrollView,contentContainerStyle:s.scrollContent,children:[!u&&L(l,{style:s.header,children:[L(l,{style:s.actionsRow,children:[L(l,{style:[s.actionWrapper,Z&&s.actionWrapperDesktop],children:[d(W,{style:[s.iconButton,Z&&s.iconButtonDesktop],onPress:le,accessibilityLabel:"Go to home route",accessibilityRole:"button",testID:"buoy-routes-sitemap-home",children:d(oa,{size:Qe,color:y.color.textSecondary})}),d(p,{style:[s.actionLabel,Z&&s.actionLabelDesktop],children:"Home"})]}),L(l,{style:[s.actionWrapper,Z&&s.actionWrapperDesktop],children:[d(aa,{value:z,testID:"buoy-routes-sitemap-copy",size:Z?Qe:14,buttonStyle:Z?s.actionButtonHeaderDesktop:s.actionButtonHeader}),d(p,{style:[s.actionLabel,Z&&s.actionLabelDesktop],children:"Copy"})]}),L(l,{style:[s.actionWrapper,Z&&s.actionWrapperDesktop],children:[d(W,{style:[s.iconButton,Z&&s.iconButtonDesktop,v&&s.refreshButtonDisabled],onPress:f,disabled:v,testID:"buoy-routes-sitemap-refresh",accessibilityRole:"button",accessibilityLabel:"Refresh route tree",children:d(na,{size:Qe,color:v?y.color.textTertiary:y.color.textSecondary})}),d(p,{style:[s.actionLabel,Z&&s.actionLabelDesktop],children:"Refresh"})]}),L(l,{style:[s.actionWrapper,Z&&s.actionWrapperDesktop],children:[d(W,{style:[s.iconButton,Z&&s.iconButtonDesktop],onPress:()=>c(true),testID:"buoy-routes-sitemap-search-open",accessibilityRole:"button",accessibilityLabel:"Search routes",children:d(Vt,{size:Qe,color:y.color.textSecondary})}),d(p,{style:[s.actionLabel,Z&&s.actionLabelDesktop],children:"Search"})]})]}),L(l,{style:s.statsGrid,children:[d(Ee,{value:D.total,label:"Total",id:"total"}),d(Ee,{value:D.static,label:"Static",id:"static"}),d(Ee,{value:D.dynamic,label:"Dynamic",id:"dynamic"}),d(Ee,{value:D.catchAll,label:"Catch-All",id:"catch-all"}),d(Ee,{value:D.layouts,label:"Layouts",id:"layouts"}),d(Ee,{value:D.groups,label:"Groups",id:"groups"})]})]}),ce.length===0?d(ea,{testID:"buoy-routes-sitemap-empty",otto:"map",title:"No routes found",message:"Nothing in the router matches. Clear the search to see the whole tree."}):ce.map(b=>d(Sa,{group:b,isExpanded:n.length>0||h.has(b.title),onToggleExpand:()=>Ce(b.title),onNavigate:xe},b.title)),L(l,{style:s.metaFooter,children:[d(p,{style:s.metaText,testID:"buoy-routes-sitemap-updated",children:E}),d(l,{style:s.sourceBadge,children:d(p,{style:s.sourceText,testID:"buoy-routes-sitemap-source",children:H})})]})]}),d(sa,{visible:$,onClose:()=>ae(false),featureName:"Route Navigation"})]}):d(l,{style:[s.container,e],children:d(l,{style:s.loadingContainer,children:d(p,{style:s.loadingText,testID:"buoy-routes-sitemap-loading",children:k?"Loading routes...":"Route sitemap isn't available on the dashboard \u2014 the route tree lives on the device. Use the Events tab to see navigation here."})})})}function Ee({value:e,label:t,id:o}){return L(l,{style:s.statItem,testID:`buoy-routes-stat-${o}`,accessibilityLabel:`${t}, ${e}`,children:[d(p,{style:s.statValue,testID:`buoy-routes-stat-${o}-value`,children:e}),d(p,{style:s.statLabel,children:t})]})}function Sa({group:e,isExpanded:t,onToggleExpand:o,onNavigate:r}){return L(l,{style:s.groupContainer,children:[L(W,{style:s.groupHeader,onPress:o,activeOpacity:.7,testID:Gt(e.title),accessibilityRole:"button",accessibilityLabel:`${e.title}, ${e.routes.length} routes`,children:[L(l,{style:s.groupHeaderLeft,children:[t?d(Ht,{size:14,color:y.color.textSecondary}):d(Mt,{size:14,color:y.color.textSecondary}),d(p,{style:s.groupTitle,children:e.title})]}),d(l,{style:s.groupBadge,children:d(p,{style:s.groupCount,testID:`${Gt(e.title)}-count`,children:e.routes.length})})]}),e.description&&d(l,{style:s.groupDescription,children:d(p,{style:s.groupDescriptionText,children:e.description})}),t&&d(l,{style:s.routesList,children:e.routes.map((a,n)=>d(Kt,{route:a,onNavigate:r},`${a.path}-${n}`))})]})}function Kt({route:e,depth:t=0,onNavigate:o}){let[r,a]=Be(false),n=e.children.length>0,i=Ca(e.type),u=e.type!=="layout"&&e.type!=="group",c=ba(e.path),h=n,I=h?r:true;return d(l,{style:[s.routeItem,{marginLeft:t*12}],testID:c,children:L(l,{style:s.routeCard,children:[L(l,{style:s.routeHeader,children:[h?L(W,{style:s.routeHeaderLeft,onPress:()=>a(!r),activeOpacity:.7,testID:`${c}-toggle`,accessibilityRole:"button",accessibilityLabel:`${e.path}, ${e.type}, ${e.children.length} nested`,children:[d(l,{style:s.expandIndicator,children:r?d(Ht,{size:14,color:y.color.textSecondary}):d(Mt,{size:14,color:y.color.textSecondary})}),d(p,{style:s.routePath,numberOfLines:3,testID:`${c}-path`,children:e.path})]}):L(l,{style:s.routeHeaderLeft,accessible:true,accessibilityLabel:`${e.path}, ${e.type}`,children:[d(l,{style:s.expandIndicator}),d(p,{style:s.routePath,numberOfLines:3,testID:`${c}-path`,children:e.path})]}),L(l,{style:s.routeHeaderActions,children:[n&&d(l,{style:s.childCountBadge,children:d(p,{style:s.childCountText,testID:`${c}-children-count`,children:e.children.length})}),d(l,{style:[s.typeTag,{backgroundColor:`${i}15`,borderColor:`${i}40`}],children:d(p,{style:[s.typeText,{color:i}],testID:`${c}-type`,children:e.type.toUpperCase()})}),d(ra,{value:e.path,buttonStyle:s.iconAction,testID:`${c}-copy`}),u&&d(W,{style:s.goButton,onPress:()=>o(e),activeOpacity:.7,testID:`${c}-go`,accessibilityRole:"button",accessibilityLabel:`Go to ${e.path}`,children:d(p,{style:s.goButtonText,children:"Go"})})]})]}),I&&n&&d(l,{style:s.childrenContainer,children:e.children.map((v,T)=>d(Kt,{route:v,depth:t+1,onNavigate:o},`${v.path}-${T}`))})]})})}function Ca(e){switch(e){case"static":return"#3B82F6";case"dynamic":return"#F59E0B";case"catch-all":return"#EC4899";case"index":return"#10B981";case"layout":return"#8B5CF6";case"group":return"#6366F1";case"not-found":return"#EF4444";default:return"#6B7280"}}var s=ve.create({container:{flex:1,backgroundColor:"transparent"},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center"},loadingText:{color:y.color.textSecondary,fontSize:14,fontFamily:U,textAlign:"center",lineHeight:20,paddingHorizontal:32,maxWidth:420},header:{flexDirection:"column",padding:8,borderBottomWidth:1,borderBottomColor:y.color.border,gap:12,marginBottom:8},actionsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:12,paddingBottom:4},statsGrid:{flexDirection:"row",flexWrap:"wrap",gap:8},statItem:{flexGrow:1,flexShrink:1,flexBasis:"30%",minWidth:90,backgroundColor:y.color.surface,borderRadius:8,paddingVertical:10,paddingHorizontal:12,alignItems:"center"},statValue:{fontSize:18,fontWeight:"800",color:y.color.text,fontFamily:U},statLabel:{fontSize:10,color:y.color.textTertiary,marginTop:4,fontFamily:U,textTransform:"uppercase",letterSpacing:.5},actionWrapper:{flex:1,alignItems:"center",justifyContent:"center",gap:4,minWidth:48},actionWrapperDesktop:{gap:8,minWidth:72},actionButtonHeader:{padding:6,borderRadius:4,backgroundColor:y.color.surfaceElevated},actionButtonHeaderDesktop:{padding:12,borderRadius:8,backgroundColor:y.color.surfaceElevated},iconButton:{padding:6,borderRadius:4,alignItems:"center",justifyContent:"center"},iconButtonDesktop:{padding:12,borderRadius:8,backgroundColor:y.color.surfaceElevated},actionLabel:{fontSize:8,color:y.color.textTertiary,fontFamily:U,textTransform:"uppercase",letterSpacing:.5},actionLabelDesktop:{fontSize:12},refreshButtonDisabled:{opacity:.5},metaFooter:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:16,paddingVertical:16,marginTop:16,borderTopWidth:1,borderTopColor:y.color.border},metaText:{fontSize:12,color:y.color.textSecondary,fontFamily:U},sourceBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:999,borderWidth:1,borderColor:y.color.border,backgroundColor:y.color.surface},sourceText:{fontSize:11,color:y.color.textSecondary,textTransform:"capitalize",fontFamily:U},searchContainer:{flexDirection:"row",alignItems:"center",padding:8,gap:8,borderBottomWidth:1,borderBottomColor:y.color.border},searchInput:{flex:1,color:y.color.text,fontSize:14,fontFamily:U},clearButton:{padding:4},clearButtonText:{color:y.color.textTertiary,fontSize:18},closeSearchButton:{paddingHorizontal:8,paddingVertical:4},closeSearchText:{color:y.color.accent,fontSize:14,fontWeight:"600",fontFamily:U},scrollView:{flex:1},scrollContent:{paddingBottom:8},emptyState:{padding:32,alignItems:"center"},emptyText:{color:y.color.textSecondary,fontSize:14,fontFamily:U},groupContainer:{marginVertical:4},groupHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,paddingHorizontal:16,backgroundColor:y.color.surface,borderLeftWidth:3,borderLeftColor:y.color.fillTertiary},groupHeaderLeft:{flexDirection:"row",alignItems:"center",gap:8,flex:1},groupTitle:{fontSize:12,fontWeight:"700",color:y.color.text,fontFamily:U,textTransform:"uppercase",letterSpacing:.8},groupBadge:{backgroundColor:"#3B82F615",borderColor:"#3B82F640",borderWidth:1,borderRadius:12,paddingHorizontal:8,paddingVertical:3,minWidth:24,alignItems:"center",justifyContent:"center"},groupCount:{fontSize:11,fontWeight:"600",color:"#3B82F6",fontFamily:U},routesList:{backgroundColor:"transparent"},groupDescription:{paddingHorizontal:16,paddingVertical:8,marginBottom:8,backgroundColor:y.color.surfaceElevated,borderLeftWidth:3,borderLeftColor:y.color.fillTertiary},groupDescriptionText:{fontSize:11,color:y.color.textSecondary,fontFamily:U,lineHeight:16},routeItem:{marginBottom:6},routeCard:{backgroundColor:y.color.surface,borderRadius:6,borderWidth:1,borderColor:y.color.border,overflow:"hidden",shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:2,elevation:1},routeHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:7,paddingHorizontal:10,gap:8},expandIndicator:{width:18,alignItems:"center"},routeHeaderLeft:{flexDirection:"row",alignItems:"center",gap:8,flex:1},routePath:{fontSize:13,fontWeight:"600",color:y.color.text,fontFamily:U,flex:1},routeHeaderActions:{flexDirection:"row",alignItems:"center",gap:6},childCountBadge:{backgroundColor:"#6B728015",borderColor:"#6B728040",borderWidth:1,borderRadius:12,paddingHorizontal:7,paddingVertical:2,minWidth:22,alignItems:"center",justifyContent:"center"},childCountText:{fontSize:11,fontWeight:"600",color:y.color.textSecondary,fontFamily:U},typeTag:{borderRadius:4,paddingHorizontal:6,paddingVertical:2,borderWidth:1},typeText:{fontSize:10,fontWeight:"600",fontFamily:U},iconAction:{width:28,height:24,borderRadius:4,backgroundColor:y.color.surfaceElevated,borderWidth:1,borderColor:y.color.border,alignItems:"center",justifyContent:"center"},goButton:{height:24,paddingHorizontal:10,borderRadius:4,alignItems:"center",justifyContent:"center",backgroundColor:y.color.accentSoft,borderWidth:1,borderColor:y.color.accentBorder},goButtonText:{fontSize:12,color:y.color.accent,fontFamily:U,fontWeight:"600"},childrenContainer:{borderLeftWidth:2,borderLeftColor:y.color.border,marginLeft:16,marginRight:8,marginTop:2,marginBottom:8}});import{useState as _t,useMemo as qe,useEffect as Jt}from"react";import{ChevronDown as Ta,ChevronRight as Ra,InlineCopyButton as wa,ProUpgradeModal as Ia,buoyColors as Ze,night as j,useSafeAreaInsets as ka,ToolEmptyState as Ba,monoFont as se}from"@buoy-gg/shared-ui/web";import{useIsPro as Da}from"@buoy-gg/license/web";import{DataViewer as Ea}from"@buoy-gg/shared-ui/web/dataViewer";import{useSyncExternalStore as Pa}from"react";var La=class{constructor(){this.stack=[];this.actions=null;this.listeners=new Set}getStack(){return this.stack}setStack(e){this.stack=e,this.listeners.forEach(t=>t())}getActions(){return this.actions}setActions(e){this.actions=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Q=new La;var $a=[];function Qt(){let e=Pa(r=>Q.subscribe(r),()=>Q.getStack(),()=>$a),t=e.find(r=>r.isFocused)??null,o=()=>{let r=Q.getActions();if(!r)throw new Error("Mount RouteTracker to capture browser navigation.");return r};return{stack:e,focusedRoute:t,stackDepth:e.length,isAtRoot:!t||t.index===0,isLoaded:e.length>0,error:null,refresh:()=>{},navigateToIndex:r=>o().navigateToIndex(r),navigateToRoute:(r,a)=>o().navigateToRoute?.(r,a)??false,popToIndex:r=>o().popToIndex(r),goBack:()=>o().goBack(),popToTop:()=>o().popToTop()}}import{jsx as C,jsxs as oe}from"react/jsx-runtime";function qt({style:e,injectedStack:t,onAction:o,onCopyValueChange:r}){let a=Qt(),n=t!=null,i=ka({minBottom:8}),u=n?t:a.stack,c=n?true:a.isLoaded,h=n?null:a.error,I=qe(()=>u.find(f=>f.isFocused)??null,[u]),v=u.length,T=v<=1,$=f=>o?o("navigateToIndex",{index:f}):a.navigateToIndex(f),ae=f=>o?o("popToIndex",{index:f}):a.popToIndex(f),O=()=>o?o("goBack"):a.goBack(),N=()=>o?o("popToTop"):a.popToTop(),[P,D]=_t(null),[ee,k]=_t(false),G=Da();Jt(()=>{ee&&G&&k(false)},[ee,G]);let pe=qe(()=>{let f=u.map(E=>({pathname:E.pathname,name:E.name,params:E.params,isFocused:E.isFocused}));return JSON.stringify(f,null,2)},[u]);Jt(()=>{r?.(pe)},[pe,r]);let R=qe(()=>P!==null&&u[P]?u[P]:I,[P,u,I]),V=qe(()=>P!==null&&u[P]&&!u[P].isFocused,[P,u]);if(!c)return C(l,{style:[m.container,e],children:C(l,{style:m.loadingContainer,children:C(p,{style:m.loadingText,testID:"buoy-routes-stack-loading",children:"Loading navigation stack..."})})});if(h)return C(l,{style:[m.container,e],children:oe(l,{style:m.errorContainer,testID:"buoy-routes-stack-error",children:[C(p,{style:m.errorText,children:"Error loading stack"}),C(p,{style:m.errorDetail,testID:"buoy-routes-stack-error-detail",children:h.message})]})});if(u.length===0)return C(l,{style:[m.container,e],children:C(Ba,{testID:"buoy-routes-stack-empty",otto:"walking",title:"No navigation stack",message:"Navigate to a route to see the stack"})});let K=(f,E,H,ce)=>{if(o){let b=globalThis.window?.confirm;(!b||b(`${f}
|
|
5
5
|
|
|
6
|
-
${E}`))&&ce();return}_.alert(f,E,[{text:"Cancel",style:"cancel"},{text:H,style:"destructive",onPress:ce}])},z=()=>{if(!G){k(true);return}if(T){_.alert("Cannot Go Back","Already at the root of the stack");return}O()},Ce=()=>{if(!G){k(true);return}if(T){_.alert("Already at Top","Stack only has one screen");return}K("Pop to Top","This will remove all screens except the root screen.","Pop to Top",N)},ye=f=>{D(P===f?null:f)},xe=()=>{if(!G){k(true);return}if(R){if(R.isFocused){_.alert("Already There","This route is already visible");return}$(R.index)}},le=()=>{if(!G){k(true);return}if(!R)return;if(R.isFocused){_.alert("Cannot Pop","Selected route is already visible");return}if(R.index===v-1){_.alert("Cannot Pop","No screens above selected route");return}let f=v-1-R.index,E=R.index;K("Pop to Route",`Remove ${f} screen${f!==1?"s":""} above ${R.pathname}?`,"Pop",()=>ae(E))};return oe(l,{style:[m.container,e],children:[C(Ue,{testID:"buoy-routes-stack-scroll",style:m.stackScroll,contentContainerStyle:[m.stackContent,{paddingBottom:m.stackContent.padding+i.bottom}],children:[...u].reverse().map((f,E)=>{let H=u.length-1-E,ce=P===H,b=Object.keys(f.params).length>0,w=va(H);return C(l,{style:m.stackItemWrapper,testID:w,children:oe(l,{style:[m.stackItem,ce&&m.stackItemSelected],children:[oe(W,{style:m.stackItemHeader,onPress:()=>ye(H),activeOpacity:.7,testID:`${w}-toggle`,accessibilityRole:"button",accessibilityLabel:`${f.pathname}, ${f.isFocused?"focused":"mounted"}, position ${H} of ${v-1}`,children:[C(l,{style:m.expandIndicator,children:ce?C(Ta,{size:14,color:j.color.textSecondary}):C(Ra,{size:14,color:j.color.textSecondary})}),C(p,{style:m.stackItemPath,numberOfLines:1,testID:`${w}-path`,children:f.pathname}),C(wa,{value:f.pathname,buttonStyle:m.copyRouteButton,testID:`${w}-copy`}),C(l,{style:[m.statusBadge,{backgroundColor:f.isFocused?`${Ze.success}15`:"#3B82F615",borderColor:f.isFocused?`${Ze.success}40`:"#3B82F640"}],children:C(p,{style:[m.statusBadgeText,{color:f.isFocused?Ze.success:"#3B82F6"}],testID:`${w}-status`,children:f.isFocused?"FOCUSED":"MOUNTED"})})]}),ce&&oe(l,{style:m.expandedContent,children:[oe(l,{style:m.detailRow,children:[C(p,{style:m.detailLabel,children:"Route Name:"}),C(p,{style:m.detailValue,testID:`${w}-name`,children:f.name})]}),oe(l,{style:m.detailRow,children:[C(p,{style:m.detailLabel,children:"Position:"}),oe(p,{style:m.detailValue,testID:`${w}-position`,children:[H," / ",v-1]})]}),b&&C(l,{style:m.dataViewerContainer,children:C(Ea,{title:"Parameters",data:f.params,showTypeFilter:false})}),oe(l,{style:m.actionsRow,children:[oe(l,{style:m.actionWrapper,children:[C(W,{style:[m.actionButton,T&&m.actionButtonDisabled],onPress:z,disabled:T,testID:`${w}-back`,accessibilityRole:"button",accessibilityLabel:"Go back one screen",children:C(p,{style:[m.actionButtonText,T&&m.actionButtonTextDisabled],children:"Back"})}),C(p,{style:m.helpText,children:"Go back one screen"})]}),oe(l,{style:m.actionWrapper,children:[C(W,{style:[m.actionButton,f.isFocused&&m.actionButtonDisabled],onPress:xe,disabled:f.isFocused,testID:`${w}-go`,accessibilityRole:"button",accessibilityLabel:`Navigate to ${f.pathname}`,children:C(p,{style:[m.actionButtonText,f.isFocused&&m.actionButtonTextDisabled],children:"Go"})}),C(p,{style:m.helpText,children:"Navigate to this route"})]}),oe(l,{style:m.actionWrapper,children:[C(W,{style:[m.actionButton,(f.isFocused||H===v-1)&&m.actionButtonDisabled],onPress:le,disabled:f.isFocused||H===v-1,testID:`${w}-pop-to`,accessibilityRole:"button",accessibilityLabel:`Remove screens above ${f.pathname}`,children:C(p,{style:[m.actionButtonText,(f.isFocused||H===v-1)&&m.actionButtonTextDisabled],children:"Pop To"})}),C(p,{style:m.helpText,children:"Remove screens above this"})]})]})]})]})},`stack-${H}-${f.key}`)})}),C(Ia,{visible:ee,onClose:()=>k(false),featureName:"Stack Navigation"})]})}var m=ve.create({container:{flex:1,backgroundColor:"transparent"},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32},loadingText:{color:j.color.textSecondary,fontSize:14,fontFamily:se},errorContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32},errorText:{color:Ze.error,fontSize:16,fontWeight:"600",fontFamily:se,marginBottom:8},errorDetail:{color:j.color.textSecondary,fontSize:12,fontFamily:se,textAlign:"center"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyText:{color:j.color.text,fontSize:16,fontWeight:"600",fontFamily:se,marginBottom:8},emptySubtext:{color:j.color.textSecondary,fontSize:14,fontFamily:se,textAlign:"center"},stackScroll:{flex:1},stackContent:{padding:8},stackItemWrapper:{marginBottom:6},stackItem:{backgroundColor:j.color.surface,borderRadius:6,borderWidth:1,borderColor:j.color.border,overflow:"hidden"},stackItemSelected:{borderColor:j.color.accent,borderWidth:2},stackItemHeader:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,gap:8},expandIndicator:{width:20,alignItems:"center"},stackItemPath:{fontSize:13,fontWeight:"600",color:j.color.text,fontFamily:se,flex:1},copyRouteButton:{padding:4,marginLeft:4},statusBadge:{borderRadius:4,paddingHorizontal:6,paddingVertical:2,borderWidth:1},statusBadgeText:{fontSize:10,fontWeight:"600",fontFamily:se},expandedContent:{paddingHorizontal:12,paddingTop:8,paddingBottom:12,borderTopWidth:1,borderTopColor:j.color.border},detailRow:{marginBottom:8},detailLabel:{fontSize:10,color:j.color.textSecondary,fontFamily:se,marginBottom:2},detailValue:{fontSize:12,color:j.color.text,fontFamily:se},dataViewerContainer:{marginTop:4,marginHorizontal:-12,marginBottom:8},actionsRow:{flexDirection:"row",gap:6,marginTop:12},actionWrapper:{flex:1},actionButton:{backgroundColor:j.color.surfaceElevated,paddingVertical:8,paddingHorizontal:8,borderRadius:6,alignItems:"center"},actionButtonDisabled:{opacity:.5},actionButtonText:{fontSize:12,fontWeight:"600",color:j.color.text,fontFamily:se},actionButtonTextDisabled:{color:j.color.textTertiary},helpText:{fontSize:9,color:j.color.textSecondary,fontFamily:se,textAlign:"center",marginTop:4,lineHeight:12}});import{useCallback as Fa}from"react";import{Navigation as za,night as gt,EVENT_LIST_PRESET as Aa,monoFont as Zt}from"@buoy-gg/shared-ui/web";import{memo as Na,useMemo as de}from"react";import{CompactRow as Wa,RelativeTime as ja,buoyColors as Xt,night as Xe,monoFont as Yt}from"@buoy-gg/shared-ui/web";import{jsx as je}from"react/jsx-runtime";function Oa(e){return e.pathname==="/"?"home":ct(e.pathname,e.segments)?"dynamic":e.params&&Object.keys(e.params).length>0?"with-params":"default"}function Va(e){switch(e){case"home":return Xt.success;case"dynamic":return Xe.color.accent;case"with-params":return Xt.warning;default:return Xe.color.textSecondary}}function Ha(e){switch(e){case"home":return"Home";case"dynamic":return"Dynamic";case"with-params":return"Params";default:return"Static"}}function Ma(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.floor(e/6e4),o=Math.floor(e%6e4/1e3);return o>0?`${t}m ${o}s`:`${t}m`}function Ua(e){let t=[];e.timeSincePrevious!==void 0&&e.timeSincePrevious>0&&t.push(Ma(e.timeSincePrevious));let o=e.segments?.length||0;return o>0&&t.push(`depth ${o}`),t.join(" \xB7 ")||"root"}function Ga(e){if(e.params&&Object.keys(e.params).length>0){let t=Object.keys(e.params).length;return`${t} PARAM${t!==1?"S":""}`}}var eo=Na(function({event:e,visitNumber:t,isExpanded:o,onPress:r,onNavigate:a,index:n}){let i=de(()=>Oa(e),[e]),u=de(()=>ct(e.pathname,e.segments),[e.pathname,e.segments]),c=de(()=>Va(i),[i]),h=de(()=>Ha(i),[i]),I=de(()=>Ua(e),[e]),v=de(()=>Ga(e),[e]),T=de(()=>fa(e.pathname,t),[e.pathname,t]),$=de(()=>`${e.pathname}, ${h}, ${I}`,[e.pathname,h,I]),ae=de(()=>{if(o)return je(lt,{event:e,visitNumber:t,routeTemplate:u})},[o,e,t,u]),O=de(()=>{if(a)return je(W,{style:to.goButton,onPress:()=>a(Nt(e.pathname,e.params)),testID:`${T}-go`,accessibilityRole:"button",accessibilityLabel:`Go to ${e.pathname}`,children:je(p,{style:to.goButtonText,children:"Go"})})},[a,e.pathname,T]);return je(Wa,{statusDotColor:c,statusLabel:h,statusSublabel:I,primaryText:e.pathname,badgeText:v,badgeColor:c,trailingAction:O,bottomRightText:je(ja,{timestamp:e.timestamp}),showChevron:true,expandedContent:ae,isExpanded:o,expandedGlowColor:c,onPress:()=>r(n),testID:T,statusTestID:`${T}-status`,statusSublabelTestID:`${T}-sublabel`,accessibilityLabel:$})}),to=ve.create({badgeText:{fontSize:11,fontWeight:"600",fontFamily:Yt},goButton:{backgroundColor:Xe.color.accent,paddingHorizontal:8,paddingVertical:4,borderRadius:4},goButtonText:{fontSize:10,fontWeight:"600",color:Xe.color.onAccent,fontFamily:Yt}});import{jsx as Oe,jsxs as Ka}from"react/jsx-runtime";function _a({events:e,visitCounts:t,onNavigate:o,onSelectEvent:r}){let a=Fa(n=>{let i=e[n];i&&r(i,t.get(i)||1)},[e,t,r]);return e.length===0?Ka(l,{style:Ye.emptyState,testID:"buoy-routes-empty",children:[Oe(za,{size:48,color:gt.color.textTertiary}),Oe(p,{style:Ye.emptyTitle,testID:"buoy-routes-empty-title",children:"No events yet"}),Oe(p,{style:Ye.emptySubtitle,testID:"buoy-routes-empty-subtitle",children:"Navigation events will appear here"})]}):Oe(Pt,{testID:"buoy-routes-timeline",contentContainerStyle:Ye.listContent,data:e,keyExtractor:n=>`${n.timestamp}-${n.pathname}`,renderItem:({item:n,index:i})=>Oe(eo,{event:n,visitNumber:t.get(n)||1,isExpanded:false,index:i,onPress:a,onNavigate:o}),showsVerticalScrollIndicator:true,...Aa})}var Ye=ve.create({listContent:{paddingVertical:8},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:gt.color.text,fontSize:16,fontWeight:"600",marginTop:16,marginBottom:8,fontFamily:Zt,letterSpacing:.5,textTransform:"uppercase"},emptySubtitle:{color:gt.color.textSecondary,fontSize:14,textAlign:"center",fontFamily:Zt}});import{Fragment as Ja,jsx as S,jsxs as re}from"react/jsx-runtime";var yt=Tr(),Qa={parse:e=>e==="routes"||e==="events"||e==="stack"?e:void 0,serialize:e=>e},qa={parse:e=>e==="true",serialize:e=>e.toString()},Za={parse:e=>new Set(JSON.parse(e)),serialize:e=>JSON.stringify(Array.from(e))};function oo(e,t){if(!e||!e.routes)return null;for(let o of e.routes){if(o.name===t)return[o.name];if(o.state){let r=oo(o.state,t);if(r)return[o.name,...r]}}return null}function Xa(e,t){if(e.length===0)return null;let o=t&&Object.keys(t).length>0?t:void 0;if(e.length===1)return yt.navigate(o?{name:e[0],params:o}:{name:e[0]});let r=o?{screen:e[e.length-1],params:o}:{screen:e[e.length-1]};for(let a=e.length-2;a>=1;a--)r={screen:e[a],params:r};return yt.navigate({name:e[0],params:r})}function ft({visible:e,onClose:t,onBack:o,onMinimize:r,enableSharedModalDimensions:a=false,inline:n=false,remote:i}){let u=Rr(),c=void 0,h=wr(),[I,v]=at($e.routeEvents.activeTab(),"events",Qa),[T,$]=we(false),[ae,O]=we(""),N=jr(),P=Wr("routeEvents.entries");Bt(()=>{T&&N&&$(false)},[T,N]);let[D,ee]=at($e.routeEvents.isMonitoring(),true,qa),{events:k,clearEvents:G,isListening:pe}=At({enabled:D}),R=D&&pe;Bt(()=>{he.setBootCapture(D)},[D]);let[V,K]=we(false),[z,Ce]=we(null),[ye,xe]=we(1),[le,f]=we(""),[E,H]=at($e.routeEvents.eventFilters(),new Set(["/_sitemap","/api","/__dev"]),Za),ce=Ro(null),b=ue(g=>{},[]),w=ue(g=>{try{if(i){if(!i.onNavigatePath)return;if(!N&&g!=="/"){$(true);return}i.onNavigatePath(g);return}if(h)u.push(g);else if(c){let{pathname:B,params:q}=Qr(g),me=B.startsWith("/")?B.slice(1):B,Te=Object.keys(q).length>0,Re=c.getRootState?.();if(Re){let Me=oo(Re,me);if(Me){let wt=Xa(Me,q);if(wt){c.dispatch(wt);return}}}c.dispatch(yt.navigate(Te?{name:me,params:q}:{name:me}))}else _.alert("Navigation Unavailable","No Expo Router or React Navigation container was found in this app.")}catch(B){_.alert("Navigation Error",String(B))}},[u,c,h,i,N]),X=ue(()=>{ee(g=>!g)},[]),Pe=ue(()=>{if(k.length!==0){if(!N){$(true);return}G()}},[k.length,N,G]),Le=ue(g=>{H(B=>{let q=new Set(B);return q.has(g)?q.delete(g):q.add(g),q})},[]),et=ue(g=>{H(B=>new Set([...B,g]))},[]),ne=ue(()=>{K(!V)},[V]),fe=ue((g,B)=>{Ce(g),xe(B)},[]),He=ue(()=>{Ce(null)},[]),po=ue(g=>{Ce(null),v(g)},[]),mo=Ie(()=>{let g=new Set;return k.forEach(B=>{B.pathname&&g.add(B.pathname)}),Array.from(g).sort()},[k]),be=Ie(()=>k.filter(g=>{if(!g.pathname||Array.from(E).some(B=>g.pathname.includes(B)))return false;if(le.trim()){let B=le.toLowerCase(),q=g.pathname.toLowerCase().includes(B),me=Object.entries(g.params||{}).some(([Te,Re])=>{let Me=Array.isArray(Re)?Re.join(" "):Re;return Te.toLowerCase().includes(B)||Me.toLowerCase().includes(B)});return q||me}return true}),[k,E,le]),ho=Ie(()=>be.slice(0,P),[be,P]),tt=Ie(()=>Math.max(0,be.length-P),[be.length,P]),ot=Ie(()=>{let g=new Map,B=new Map;for(let q=k.length-1;q>=0;q--){let me=k[q],Te=(g.get(me.pathname)||0)+1;g.set(me.pathname,Te),B.set(me,Te)}return B},[k]),go=Ie(()=>({summary:{total:k.length,filtered:be.length,listening:R,ignoredPatterns:Array.from(E),timestamp:new Date().toISOString()},events:be.map((g,B)=>({index:B,visitNumber:ot.get(g)||1,pathname:g.pathname,timestamp:g.timestamp,timestampRelative:Pr(g.timestamp),params:g.params,segments:g.segments,previousPathname:g.previousPathname,timeSincePrevious:g.timeSincePrevious}))}),[k.length,be,R,E,ot]);if(!e)return null;let yo=a?$e.modal.root():$e.routeEvents.modal(),rt=null,Ct=()=>{if(z)return S(jt,{event:z,visitNumber:ye,onNavigate:w});if(I==="routes")return h||i?.sitemap?S(ht,{style:A.contentWrapper,injectedRoutes:i?.sitemap?.routes,injectedSource:i?.sitemap?.source??null,injectedLastUpdatedAt:i?.sitemap?.lastUpdatedAt??null,onNavigateRoute:i?fo:void 0}):S(ht,{style:A.contentWrapper});if(I==="stack")return S(qt,{style:A.contentWrapper,injectedStack:i?i.stack??[]:void 0,onAction:i?.onStackAction,onCopyValueChange:O});if(V)return S(Xr,{ignoredPatterns:E,onTogglePattern:Le,onAddPattern:et,availablePathnames:mo});let g=k.length>0;return be.length===0?re(l,{style:A.contentWrapper,testID:"buoy-routes-events",children:[g&&S(l,{style:A.searchContainer,testID:"buoy-routes-search-field",children:S($t,{value:le,onChange:f,placeholder:"Search pathname or params...",testID:"buoy-routes-search"})}),S(kr,{testID:"buoy-routes-empty",...Br({subject:"route events",search:le,total:k.length,capturing:R,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"}})})]}):re(l,{style:A.contentWrapper,testID:"buoy-routes-events",children:[S(l,{style:A.searchContainer,testID:"buoy-routes-search-field",children:S($t,{value:le,onChange:f,placeholder:"Search pathname or params...",testID:"buoy-routes-search"})}),tt>0&&re(l,{style:A.lockedEventsBanner,testID:"buoy-routes-locked-banner",children:[S(Fr,{size:14,color:M.color.warning}),re(p,{style:A.lockedEventsBannerText,testID:"buoy-routes-locked-banner-text",children:[tt," older ",tt===1?"event":"events"," locked"]}),S(p,{style:A.lockedEventsBannerSubtext,children:"Upgrade to Pro for full history"})]}),S(_a,{events:ho,visitCounts:ot,onNavigate:w,onSelectEvent:fe})]})},Tt=z?re(ie,{children:[S(ie.Navigation,{onBack:He}),S(ie.Content,{title:z.pathname,testID:"buoy-routes-detail-title"}),S(ie.Actions,{children:S(nt,{testID:"buoy-routes-detail-copy",value:{pathname:z.pathname,previousPathname:z.previousPathname,params:z.params,segments:z.segments,timestamp:z.timestamp,timestampISO:new Date(z.timestamp).toISOString(),timeSincePrevious:z.timeSincePrevious,visitNumber:ye},buttonStyle:A.iconButton})})]}):V?re(ie,{children:[S(ie.Navigation,{onBack:()=>K(false)}),S(ie.Content,{title:"Filters",testID:"buoy-routes-filters-title"})]}):re(ie,{children:[o&&S(ie.Navigation,{onBack:o}),S(ie.Content,{title:"",noMargin:true,children:S(Er,{tabs:[{key:"routes",label:h?"Routes":"Screens"},{key:"events",label:`Events${k.length>0&&I!=="events"?` (${k.length})`:""}`},{key:"stack",label:"Stack"}],activeTab:I,onTabChange:g=>po(g),testIDPrefix:"buoy-routes-tab"})}),re(ie.Actions,{children:[I==="stack"&&S(nt,{value:ae,buttonStyle:A.iconButton,testID:"buoy-routes-stack-copy"}),I==="events"&&re(Ja,{children:[S(nt,{value:go,buttonStyle:A.iconButton,testID:"buoy-routes-copy"}),S(W,{onPress:ne,style:[A.iconButton,E.size>0&&A.activeFilterButton],testID:"buoy-routes-filters",accessibilityRole:"button",accessibilityLabel:E.size>0?`Route filters, ${E.size} active`:"Route filters",children:S($r,{size:14,color:E.size>0?M.color.accent:M.color.textSecondary})}),S(Ar,{isEnabled:R,onToggle:X,accessibilityLabel:"Toggle route event monitoring",testID:"buoy-routes-power"}),S(W,{onPress:Pe,style:A.iconButton,testID:"buoy-routes-clear",accessibilityRole:"button",accessibilityLabel:"Clear route events",children:S(Lr,{size:14,color:M.color.danger})})]})]})]}),fo=g=>{if(g.type==="layout"||g.type==="group")return;let B=g.type==="index"||g.path==="/";if(!N&&!B){$(true);return}i?.onNavigateRoute?.(g)},Rt=S(zr,{visible:T,onClose:()=>$(false),featureName:"Route Event Management"});return n?re(Ft,{children:[re(l,{style:A.inlineRoot,children:[S(l,{style:A.inlineHeader,...Ir,children:Tt}),Ct(),rt]}),Rt]}):S(Ft,{children:re(Dr,{visible:e,onClose:t,onMinimize:r,persistenceKey:yo,header:{showToggleButton:true,customContent:Tt},onModeChange:b,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:true,styles:{},footer:rt,footerHeight:rt?68:0,children:[Ct(),Rt]})})}function Ya(e={}){return S(ft,{...e,inline:true,visible:true,onClose:()=>{}})}var A=ve.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Nr.border,backgroundColor:"transparent"},iconButton:{padding:6,borderRadius:6,backgroundColor:M.color.buttonSurface},activeFilterButton:{backgroundColor:M.color.accentSoft},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:M.color.text,fontSize:16,fontWeight:"600",marginTop:16,marginBottom:8,fontFamily:Ge,letterSpacing:.5,textTransform:"uppercase"},emptySubtitle:{color:M.color.textSecondary,fontSize:14,textAlign:"center",fontFamily:Ge},contentWrapper:{flex:1},statsContainer:{paddingHorizontal:16,paddingVertical:8,backgroundColor:M.color.surface,borderBottomWidth:1,borderBottomColor:M.color.border},statsText:{fontSize:11,color:M.color.textSecondary,fontFamily:Ge,textAlign:"center"},statsWarning:{color:M.color.warning,fontWeight:"600"},searchContainer:{paddingHorizontal:16,paddingVertical:8,backgroundColor:"transparent"},lockedEventsBanner:{flexDirection:"row",alignItems:"center",gap:8,backgroundColor:M.color.warningSoft,borderWidth:1,borderColor:M.color.warning+"30",borderRadius:8,paddingVertical:10,paddingHorizontal:14,marginHorizontal:16,marginBottom:8},lockedEventsBannerText:{fontSize:12,fontWeight:"600",color:M.color.warning,fontFamily:Ge},lockedEventsBannerSubtext:{fontSize:11,color:M.color.textSecondary,marginLeft:"auto"}});import{createToolFactory as en,defineToolPreset as tn}from"@buoy-gg/shared-ui/web";import{jsx as on}from"react/jsx-runtime";var ro=tn({id:"route-events",name:"ROUTES",description:"Route tracking & navigation inspector",slot:"both",icon:({size:e})=>on(To,{size:e}),component:ft,props:{enableSharedModalDimensions:false}}),rn=en(ro,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}));import{useEffect as an}from"react";import{browserRouter as ao,getBrowserHref as nn,getBrowserRouteURL as no,subscribeBrowserNavigation as sn}from"@buoy-gg/shared-ui/web/utils";var io=0,bt;function ln(){if(typeof window>"u")return()=>{};if(io++===0){he.hydrateBootCapture();let t,o,r="",a=[],n=-1,i=c=>{if(c.href===r&&c.kind==="pop")return;if(c.kind==="replace"&&n>=0)a[n]=c.href;else if(c.kind==="pop"){let v=a.lastIndexOf(c.href,n-1),T=a.indexOf(c.href,n+1);v>=0?n=v:T>=0?n=T:(a.splice(n+1),a.push(c.href),n++)}else a.splice(n+1),a.push(c.href),n++;r=c.href;let h=no(c.href),I=Date.now();Fe.emit({pathname:h.pathname,params:Object.fromEntries(h.searchParams),segments:h.pathname.split("/").filter(Boolean),previousPathname:t,timestamp:I,timeSincePrevious:o===void 0?void 0:I-o}),t=h.pathname,o=I,Q.setStack(a.map((v,T)=>{let $=no(v);return{key:`browser:${T}`,name:$.pathname,pathname:$.pathname,params:Object.fromEntries($.searchParams),index:T,isFocused:T===n,canPop:T>0}}))},u=c=>{if(!Number.isInteger(c)||c<0||c>=a.length)throw new Error("That browser history entry is unavailable.");window.history.go(c-n)};Q.setActions({navigateToIndex:u,popToIndex:u,goBack:ao.back,popToTop:()=>u(0),navigateToRoute:(c,h)=>(ao.push({pathname:c,params:h}),true)}),bt=sn(i),i({href:nn(),kind:"initial"})}let e=false;return()=>{e||(e=true,--io===0&&(bt?.(),bt=void 0,Q.setActions(null)))}}function cn(){return an(ln,[]),null}import{useEffect as so,useRef as vt}from"react";import{useSafePathname as un,useSafeSegments as dn,useSafeGlobalSearchParams as pn}from"@buoy-gg/shared-ui/web";function mn(e){let t=un(),o=dn(),r=pn(),a=vt(e),n=vt(void 0),i=vt(void 0);so(()=>{a.current=e},[e]),so(()=>{let u=Date.now(),c=i.current?u-i.current:void 0,h={pathname:t,params:r,segments:o,timestamp:u,previousPathname:n.current,timeSincePrevious:c};n.current=t,i.current=u,Fe.emit(h),a.current&&a.current(h)},[t,o,r])}import{useEffect as lo,useRef as xt}from"react";function co(e){if(!e||!e.routes||e.routes.length===0)return{route:null,segments:[]};let t=e.routes[e.index??0],o=[t.name];if(t.state){let r=co(t.state);if(r.route)return{route:r.route,segments:[...o,...r.segments]}}return{route:t,segments:o}}function uo(e,t,o,r){if(!e)return;let{route:a,segments:n}=co(e);if(!a)return;let i=`/${a.name}`;if(i===t.current)return;let u=Date.now(),c=o.current?u-o.current:void 0,h={pathname:i,params:a.params||{},segments:n,timestamp:u,previousPathname:t.current,timeSincePrevious:c};t.current=i,o.current=u,Fe.emit(h),r.current&&r.current(h)}function hn(e){let t=void 0,o=xt(e),r=xt(void 0),a=xt(void 0);lo(()=>{o.current=e},[e]),lo(()=>{if(!t)return;let n=t.getRootState?.();n&&uo(n,r,a,o);let i=t.addListener?.("state",()=>{let u=t.getRootState?.();uo(u,r,a,o)});return()=>{i?.()}},[t])}import{getSafeRouter as gn}from"@buoy-gg/shared-ui/web";import{isOverWireBudget as yn}from"@buoy-gg/shared-ui/web";var fn=16*1024,bn=Object.freeze({__buoyOmitted:"route-params",note:"Navigation params stay on the device."});function St(e){return e==null?false:yn(e,fn)}function Ve(e){return St(e)?bn:e}function vn(e){return St(e.params)?{...e,params:Ve(e.params)}:e}function xn(e){return St(e.params)?{...e,params:Ve(e.params)}:e}function Sn(){let e=pt();return{routes:ge.parseRouteTree(We()),source:e.source,lastUpdatedAt:e.lastLoadedAt}}var Cn={version:3,getSnapshot:()=>({events:he.getEvents().map(vn),sitemap:Sn(),stack:Q.getStack().map(xn)}),subscribe:e=>{let t=he.subscribeToEvents(e),o=Q.subscribe(e),r=null;if(!We()){let a=0,n=100,i=()=>{if(a+=1,We()){r=null,e();return}r=a<n?setTimeout(i,100):null};r=setTimeout(i,100)}return()=>{t(),o(),r&&clearTimeout(r)}},actions:{clearEvents:()=>{he.clearEvents()},getCurrentRoute:()=>{let e=he.getEvents()[0];if(e&&he.isCapturing())return{path:e.pathname,params:Ve(e.params),at:e.timestamp,source:"event"};let t=Q.getStack(),o=t.find(r=>r.isFocused)??t[t.length-1];return o?.pathname?{path:o.pathname,params:Ve(o.params??{}),at:null,source:"stack"}:e?{path:e.pathname,params:Ve(e.params),at:e.timestamp,source:"event",stale:true}:{path:null,params:{},at:null,source:null}},navigate:e=>{let t=e,o=t?.path;if(!o)throw new Error("navigate requires a 'path' param");let r=gn();if(!r){let a=Q.getActions(),n=o.replace(/^\//,"");if(!a?.navigateToRoute||!n)throw new Error("expo-router is not available here and no navigation container was captured \u2014 is <RouteTracker /> mounted inside your NavigationContainer?");if(!a.navigateToRoute(n,t?.params))throw new Error(`Could not navigate to "${n}" \u2014 no navigation container is live.`);return{navigated:o,replaced:false,via:"react-navigation"}}return(t?.replace===true&&typeof r.replace=="function"?r.replace:r.navigate)(o),{navigated:o,replaced:t?.replace===true}},stackNavigateToIndex:e=>{let t=e?.index;if(typeof t!="number")throw new Error("stackNavigateToIndex requires a numeric 'index'");let o=Q.getActions();if(!o)throw new Error("navigation stack is not available");return o.navigateToIndex(t),{navigatedToIndex:t}},stackPopToIndex:e=>{let t=e?.index;if(typeof t!="number")throw new Error("stackPopToIndex requires a numeric 'index'");let o=Q.getActions();if(!o)throw new Error("navigation stack is not available");return o.popToIndex(t),{poppedToIndex:t}},stackGoBack:()=>{let e=Q.getActions();if(!e)throw new Error("navigation stack is not available");return e.goBack(),{wentBack:true}},stackPopToTop:()=>{let e=Q.getActions();if(!e)throw new Error("navigation stack is not available");return e.popToTop(),{poppedToTop:true}}}};export{qt as NavigationStack,jt as RouteEventDetail,lt as RouteEventExpandedContent,eo as RouteEventItemCompact,ft as RouteEventsModalWithTabs,zt as RouteObserver,ge as RouteParser,cn as RouteTracker,ht as RoutesSitemap,Ya as RoutesToolView,rn as createRouteEventsTool,Q as navigationStackStore,pa as registerBrowserRoutes,he as routeEventStore,Cn as routeEventsSyncAdapter,ro as routeEventsToolPreset,Fe as routeObserver,Qt as useNavigationStack,ya as useParentRoutes,ga as useRoute,At as useRouteEvents,mn as useRouteObserver,hn as useRouteObserverReactNavigation,Je as useRouteSitemap};
|
|
6
|
+
${E}`))&&ce();return}_.alert(f,E,[{text:"Cancel",style:"cancel"},{text:H,style:"destructive",onPress:ce}])},z=()=>{if(!G){k(true);return}if(T){_.alert("Cannot Go Back","Already at the root of the stack");return}O()},Ce=()=>{if(!G){k(true);return}if(T){_.alert("Already at Top","Stack only has one screen");return}K("Pop to Top","This will remove all screens except the root screen.","Pop to Top",N)},ye=f=>{D(P===f?null:f)},xe=()=>{if(!G){k(true);return}if(R){if(R.isFocused){_.alert("Already There","This route is already visible");return}$(R.index)}},le=()=>{if(!G){k(true);return}if(!R)return;if(R.isFocused){_.alert("Cannot Pop","Selected route is already visible");return}if(R.index===v-1){_.alert("Cannot Pop","No screens above selected route");return}let f=v-1-R.index,E=R.index;K("Pop to Route",`Remove ${f} screen${f!==1?"s":""} above ${R.pathname}?`,"Pop",()=>ae(E))};return oe(l,{style:[m.container,e],children:[C(Ue,{testID:"buoy-routes-stack-scroll",style:m.stackScroll,contentContainerStyle:[m.stackContent,{paddingBottom:m.stackContent.padding+i.bottom}],children:[...u].reverse().map((f,E)=>{let H=u.length-1-E,ce=P===H,b=Object.keys(f.params).length>0,w=va(H);return C(l,{style:m.stackItemWrapper,testID:w,children:oe(l,{style:[m.stackItem,ce&&m.stackItemSelected],children:[oe(W,{style:m.stackItemHeader,onPress:()=>ye(H),activeOpacity:.7,testID:`${w}-toggle`,accessibilityRole:"button",accessibilityLabel:`${f.pathname}, ${f.isFocused?"focused":"mounted"}, position ${H} of ${v-1}`,children:[C(l,{style:m.expandIndicator,children:ce?C(Ta,{size:14,color:j.color.textSecondary}):C(Ra,{size:14,color:j.color.textSecondary})}),C(p,{style:m.stackItemPath,numberOfLines:1,testID:`${w}-path`,children:f.pathname}),C(wa,{value:f.pathname,buttonStyle:m.copyRouteButton,testID:`${w}-copy`}),C(l,{style:[m.statusBadge,{backgroundColor:f.isFocused?`${Ze.success}15`:"#3B82F615",borderColor:f.isFocused?`${Ze.success}40`:"#3B82F640"}],children:C(p,{style:[m.statusBadgeText,{color:f.isFocused?Ze.success:"#3B82F6"}],testID:`${w}-status`,children:f.isFocused?"FOCUSED":"MOUNTED"})})]}),ce&&oe(l,{style:m.expandedContent,children:[oe(l,{style:m.detailRow,children:[C(p,{style:m.detailLabel,children:"Route Name:"}),C(p,{style:m.detailValue,testID:`${w}-name`,children:f.name})]}),oe(l,{style:m.detailRow,children:[C(p,{style:m.detailLabel,children:"Position:"}),oe(p,{style:m.detailValue,testID:`${w}-position`,children:[H," / ",v-1]})]}),b&&C(l,{style:m.dataViewerContainer,children:C(Ea,{title:"Parameters",data:f.params,showTypeFilter:false})}),oe(l,{style:m.actionsRow,children:[oe(l,{style:m.actionWrapper,children:[C(W,{style:[m.actionButton,T&&m.actionButtonDisabled],onPress:z,disabled:T,testID:`${w}-back`,accessibilityRole:"button",accessibilityLabel:"Go back one screen",children:C(p,{style:[m.actionButtonText,T&&m.actionButtonTextDisabled],children:"Back"})}),C(p,{style:m.helpText,children:"Go back one screen"})]}),oe(l,{style:m.actionWrapper,children:[C(W,{style:[m.actionButton,f.isFocused&&m.actionButtonDisabled],onPress:xe,disabled:f.isFocused,testID:`${w}-go`,accessibilityRole:"button",accessibilityLabel:`Navigate to ${f.pathname}`,children:C(p,{style:[m.actionButtonText,f.isFocused&&m.actionButtonTextDisabled],children:"Go"})}),C(p,{style:m.helpText,children:"Navigate to this route"})]}),oe(l,{style:m.actionWrapper,children:[C(W,{style:[m.actionButton,(f.isFocused||H===v-1)&&m.actionButtonDisabled],onPress:le,disabled:f.isFocused||H===v-1,testID:`${w}-pop-to`,accessibilityRole:"button",accessibilityLabel:`Remove screens above ${f.pathname}`,children:C(p,{style:[m.actionButtonText,(f.isFocused||H===v-1)&&m.actionButtonTextDisabled],children:"Pop To"})}),C(p,{style:m.helpText,children:"Remove screens above this"})]})]})]})]})},`stack-${H}-${f.key}`)})}),C(Ia,{visible:ee,onClose:()=>k(false),featureName:"Stack Navigation"})]})}var m=ve.create({container:{flex:1,backgroundColor:"transparent"},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32},loadingText:{color:j.color.textSecondary,fontSize:14,fontFamily:se},errorContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32},errorText:{color:Ze.error,fontSize:16,fontWeight:"600",fontFamily:se,marginBottom:8},errorDetail:{color:j.color.textSecondary,fontSize:12,fontFamily:se,textAlign:"center"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyText:{color:j.color.text,fontSize:16,fontWeight:"600",fontFamily:se,marginBottom:8},emptySubtext:{color:j.color.textSecondary,fontSize:14,fontFamily:se,textAlign:"center"},stackScroll:{flex:1},stackContent:{padding:8},stackItemWrapper:{marginBottom:6},stackItem:{backgroundColor:j.color.surface,borderRadius:6,borderWidth:1,borderColor:j.color.border,overflow:"hidden"},stackItemSelected:{borderColor:j.color.accent,borderWidth:2},stackItemHeader:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,gap:8},expandIndicator:{width:20,alignItems:"center"},stackItemPath:{fontSize:13,fontWeight:"600",color:j.color.text,fontFamily:se,flex:1},copyRouteButton:{padding:4,marginLeft:4},statusBadge:{borderRadius:4,paddingHorizontal:6,paddingVertical:2,borderWidth:1},statusBadgeText:{fontSize:10,fontWeight:"600",fontFamily:se},expandedContent:{paddingHorizontal:12,paddingTop:8,paddingBottom:12,borderTopWidth:1,borderTopColor:j.color.border},detailRow:{marginBottom:8},detailLabel:{fontSize:10,color:j.color.textSecondary,fontFamily:se,marginBottom:2},detailValue:{fontSize:12,color:j.color.text,fontFamily:se},dataViewerContainer:{marginTop:4,marginHorizontal:-12,marginBottom:8},actionsRow:{flexDirection:"row",gap:6,marginTop:12},actionWrapper:{flex:1},actionButton:{backgroundColor:j.color.surfaceElevated,paddingVertical:8,paddingHorizontal:8,borderRadius:6,alignItems:"center"},actionButtonDisabled:{opacity:.5},actionButtonText:{fontSize:12,fontWeight:"600",color:j.color.text,fontFamily:se},actionButtonTextDisabled:{color:j.color.textTertiary},helpText:{fontSize:9,color:j.color.textSecondary,fontFamily:se,textAlign:"center",marginTop:4,lineHeight:12}});import{useCallback as Fa}from"react";import{Navigation as za,night as gt,EVENT_LIST_PRESET as Aa,monoFont as Zt}from"@buoy-gg/shared-ui/web";import{memo as Na,useMemo as de}from"react";import{CompactRow as Wa,RelativeTime as ja,buoyColors as Xt,night as Xe,monoFont as Yt}from"@buoy-gg/shared-ui/web";import{jsx as je}from"react/jsx-runtime";function Oa(e){return e.pathname==="/"?"home":ct(e.pathname,e.segments)?"dynamic":e.params&&Object.keys(e.params).length>0?"with-params":"default"}function Va(e){switch(e){case"home":return Xt.success;case"dynamic":return Xe.color.accent;case"with-params":return Xt.warning;default:return Xe.color.textSecondary}}function Ha(e){switch(e){case"home":return"Home";case"dynamic":return"Dynamic";case"with-params":return"Params";default:return"Static"}}function Ma(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.floor(e/6e4),o=Math.floor(e%6e4/1e3);return o>0?`${t}m ${o}s`:`${t}m`}function Ua(e){let t=[];e.timeSincePrevious!==void 0&&e.timeSincePrevious>0&&t.push(Ma(e.timeSincePrevious));let o=e.segments?.length||0;return o>0&&t.push(`depth ${o}`),t.join(" \xB7 ")||"root"}function Ga(e){if(e.params&&Object.keys(e.params).length>0){let t=Object.keys(e.params).length;return`${t} PARAM${t!==1?"S":""}`}}var eo=Na(function({event:e,visitNumber:t,isExpanded:o,onPress:r,onNavigate:a,index:n}){let i=de(()=>Oa(e),[e]),u=de(()=>ct(e.pathname,e.segments),[e.pathname,e.segments]),c=de(()=>Va(i),[i]),h=de(()=>Ha(i),[i]),I=de(()=>Ua(e),[e]),v=de(()=>Ga(e),[e]),T=de(()=>fa(e.pathname,t),[e.pathname,t]),$=de(()=>`${e.pathname}, ${h}, ${I}`,[e.pathname,h,I]),ae=de(()=>{if(o)return je(lt,{event:e,visitNumber:t,routeTemplate:u})},[o,e,t,u]),O=de(()=>{if(a)return je(W,{style:to.goButton,onPress:()=>a(Nt(e.pathname,e.params)),testID:`${T}-go`,accessibilityRole:"button",accessibilityLabel:`Go to ${e.pathname}`,children:je(p,{style:to.goButtonText,children:"Go"})})},[a,e.pathname,T]);return je(Wa,{statusDotColor:c,statusLabel:h,statusSublabel:I,primaryText:e.pathname,badgeText:v,badgeColor:c,trailingAction:O,bottomRightText:je(ja,{timestamp:e.timestamp}),showChevron:true,expandedContent:ae,isExpanded:o,expandedGlowColor:c,onPress:()=>r(n),testID:T,statusTestID:`${T}-status`,statusSublabelTestID:`${T}-sublabel`,accessibilityLabel:$})}),to=ve.create({badgeText:{fontSize:11,fontWeight:"600",fontFamily:Yt},goButton:{backgroundColor:Xe.color.accent,paddingHorizontal:8,paddingVertical:4,borderRadius:4},goButtonText:{fontSize:10,fontWeight:"600",color:Xe.color.onAccent,fontFamily:Yt}});import{jsx as Oe,jsxs as Ka}from"react/jsx-runtime";function _a({events:e,visitCounts:t,onNavigate:o,onSelectEvent:r}){let a=Fa(n=>{let i=e[n];i&&r(i,t.get(i)||1)},[e,t,r]);return e.length===0?Ka(l,{style:Ye.emptyState,testID:"buoy-routes-empty",children:[Oe(za,{size:48,color:gt.color.textTertiary}),Oe(p,{style:Ye.emptyTitle,testID:"buoy-routes-empty-title",children:"No events yet"}),Oe(p,{style:Ye.emptySubtitle,testID:"buoy-routes-empty-subtitle",children:"Navigation events will appear here"})]}):Oe(Pt,{testID:"buoy-routes-timeline",contentContainerStyle:Ye.listContent,data:e,keyExtractor:n=>`${n.timestamp}-${n.pathname}`,renderItem:({item:n,index:i})=>Oe(eo,{event:n,visitNumber:t.get(n)||1,isExpanded:false,index:i,onPress:a,onNavigate:o}),showsVerticalScrollIndicator:true,...Aa})}var Ye=ve.create({listContent:{paddingVertical:8},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:gt.color.text,fontSize:16,fontWeight:"600",marginTop:16,marginBottom:8,fontFamily:Zt,letterSpacing:.5,textTransform:"uppercase"},emptySubtitle:{color:gt.color.textSecondary,fontSize:14,textAlign:"center",fontFamily:Zt}});import{Fragment as Ja,jsx as S,jsxs as re}from"react/jsx-runtime";var yt=Tr(),Qa={parse:e=>e==="routes"||e==="events"||e==="stack"?e:void 0,serialize:e=>e},qa={parse:e=>e==="true",serialize:e=>e.toString()},Za={parse:e=>new Set(JSON.parse(e)),serialize:e=>JSON.stringify(Array.from(e))};function oo(e,t){if(!e||!e.routes)return null;for(let o of e.routes){if(o.name===t)return[o.name];if(o.state){let r=oo(o.state,t);if(r)return[o.name,...r]}}return null}function Xa(e,t){if(e.length===0)return null;let o=t&&Object.keys(t).length>0?t:void 0;if(e.length===1)return yt.navigate(o?{name:e[0],params:o}:{name:e[0]});let r=o?{screen:e[e.length-1],params:o}:{screen:e[e.length-1]};for(let a=e.length-2;a>=1;a--)r={screen:e[a],params:r};return yt.navigate({name:e[0],params:r})}function ft({visible:e,onClose:t,onBack:o,onMinimize:r,enableSharedModalDimensions:a=false,inline:n=false,remote:i}){let u=Rr(),c=void 0,h=wr(),[I,v]=at($e.routeEvents.activeTab(),"events",Qa),[T,$]=we(false),[ae,O]=we(""),N=jr(),P=Wr("routeEvents.entries");Bt(()=>{T&&N&&$(false)},[T,N]);let[D,ee]=at($e.routeEvents.isMonitoring(),true,qa),{events:k,clearEvents:G,isListening:pe}=At({enabled:D}),R=D&&pe;Bt(()=>{he.setBootCapture(D)},[D]);let[V,K]=we(false),[z,Ce]=we(null),[ye,xe]=we(1),[le,f]=we(""),[E,H]=at($e.routeEvents.eventFilters(),new Set(["/_sitemap","/api","/__dev"]),Za),ce=Ro(null),b=ue(g=>{},[]),w=ue(g=>{try{if(i){if(!i.onNavigatePath)return;if(!N&&g!=="/"){$(true);return}i.onNavigatePath(g);return}if(h)u.push(g);else if(c){let{pathname:B,params:q}=Qr(g),me=B.startsWith("/")?B.slice(1):B,Te=Object.keys(q).length>0,Re=c.getRootState?.();if(Re){let Me=oo(Re,me);if(Me){let wt=Xa(Me,q);if(wt){c.dispatch(wt);return}}}c.dispatch(yt.navigate(Te?{name:me,params:q}:{name:me}))}else _.alert("Navigation Unavailable","No Expo Router or React Navigation container was found in this app.")}catch(B){_.alert("Navigation Error",String(B))}},[u,c,h,i,N]),X=ue(()=>{ee(g=>!g)},[]),Pe=ue(()=>{if(k.length!==0){if(!N){$(true);return}G()}},[k.length,N,G]),Le=ue(g=>{H(B=>{let q=new Set(B);return q.has(g)?q.delete(g):q.add(g),q})},[]),et=ue(g=>{H(B=>new Set([...B,g]))},[]),ne=ue(()=>{K(!V)},[V]),fe=ue((g,B)=>{Ce(g),xe(B)},[]),He=ue(()=>{Ce(null)},[]),po=ue(g=>{Ce(null),v(g)},[]),mo=Ie(()=>{let g=new Set;return k.forEach(B=>{B.pathname&&g.add(B.pathname)}),Array.from(g).sort()},[k]),be=Ie(()=>k.filter(g=>{if(!g.pathname||Array.from(E).some(B=>g.pathname.includes(B)))return false;if(le.trim()){let B=le.toLowerCase(),q=g.pathname.toLowerCase().includes(B),me=Object.entries(g.params||{}).some(([Te,Re])=>{let Me=Array.isArray(Re)?Re.join(" "):Re;return Te.toLowerCase().includes(B)||Me.toLowerCase().includes(B)});return q||me}return true}),[k,E,le]),ho=Ie(()=>be.slice(0,P),[be,P]),tt=Ie(()=>Math.max(0,be.length-P),[be.length,P]),ot=Ie(()=>{let g=new Map,B=new Map;for(let q=k.length-1;q>=0;q--){let me=k[q],Te=(g.get(me.pathname)||0)+1;g.set(me.pathname,Te),B.set(me,Te)}return B},[k]),go=Ie(()=>({summary:{total:k.length,filtered:be.length,listening:R,ignoredPatterns:Array.from(E),timestamp:new Date().toISOString()},events:be.map((g,B)=>({index:B,visitNumber:ot.get(g)||1,pathname:g.pathname,timestamp:g.timestamp,timestampRelative:Pr(g.timestamp),params:g.params,segments:g.segments,previousPathname:g.previousPathname,timeSincePrevious:g.timeSincePrevious}))}),[k.length,be,R,E,ot]);if(!e)return null;let yo=a?$e.modal.root():$e.routeEvents.modal(),rt=null,Ct=()=>{if(z)return S(jt,{event:z,visitNumber:ye,onNavigate:w});if(I==="routes")return h||i?.sitemap?S(ht,{style:A.contentWrapper,injectedRoutes:i?.sitemap?.routes,injectedSource:i?.sitemap?.source??null,injectedLastUpdatedAt:i?.sitemap?.lastUpdatedAt??null,onNavigateRoute:i?fo:void 0}):S(ht,{style:A.contentWrapper});if(I==="stack")return S(qt,{style:A.contentWrapper,injectedStack:i?i.stack??[]:void 0,onAction:i?.onStackAction,onCopyValueChange:O});if(V)return S(Xr,{ignoredPatterns:E,onTogglePattern:Le,onAddPattern:et,availablePathnames:mo});let g=k.length>0;return be.length===0?re(l,{style:A.contentWrapper,testID:"buoy-routes-events",children:[g&&S(l,{style:A.searchContainer,testID:"buoy-routes-search-field",children:S($t,{value:le,onChange:f,placeholder:"Search pathname or params...",testID:"buoy-routes-search"})}),S(kr,{testID:"buoy-routes-empty",...Br({subject:"route events",search:le,total:k.length,capturing:R,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"}})})]}):re(l,{style:A.contentWrapper,testID:"buoy-routes-events",children:[S(l,{style:A.searchContainer,testID:"buoy-routes-search-field",children:S($t,{value:le,onChange:f,placeholder:"Search pathname or params...",testID:"buoy-routes-search"})}),tt>0&&re(l,{style:A.lockedEventsBanner,testID:"buoy-routes-locked-banner",children:[S(Fr,{size:14,color:M.color.warning}),re(p,{style:A.lockedEventsBannerText,testID:"buoy-routes-locked-banner-text",children:[tt," older ",tt===1?"event":"events"," locked"]}),S(p,{style:A.lockedEventsBannerSubtext,children:"Upgrade to Pro for full history"})]}),S(_a,{events:ho,visitCounts:ot,onNavigate:w,onSelectEvent:fe})]})},Tt=z?re(ie,{children:[S(ie.Navigation,{onBack:He}),S(ie.Content,{title:z.pathname,testID:"buoy-routes-detail-title"}),S(ie.Actions,{children:S(nt,{testID:"buoy-routes-detail-copy",value:{pathname:z.pathname,previousPathname:z.previousPathname,params:z.params,segments:z.segments,timestamp:z.timestamp,timestampISO:new Date(z.timestamp).toISOString(),timeSincePrevious:z.timeSincePrevious,visitNumber:ye},buttonStyle:A.iconButton})})]}):V?re(ie,{children:[S(ie.Navigation,{onBack:()=>K(false)}),S(ie.Content,{title:"Filters",testID:"buoy-routes-filters-title"})]}):re(ie,{children:[o&&S(ie.Navigation,{onBack:o}),S(ie.Content,{title:"",noMargin:true,children:S(Er,{tabs:[{key:"routes",label:h?"Routes":"Screens"},{key:"events",label:`Events${k.length>0&&I!=="events"?` (${k.length})`:""}`},{key:"stack",label:"Stack"}],activeTab:I,onTabChange:g=>po(g),testIDPrefix:"buoy-routes-tab"})}),re(ie.Actions,{children:[I==="stack"&&S(nt,{value:ae,buttonStyle:A.iconButton,testID:"buoy-routes-stack-copy"}),I==="events"&&re(Ja,{children:[S(nt,{value:go,buttonStyle:A.iconButton,testID:"buoy-routes-copy"}),S(W,{onPress:ne,style:[A.iconButton,E.size>0&&A.activeFilterButton],testID:"buoy-routes-filters",accessibilityRole:"button",accessibilityLabel:E.size>0?`Route filters, ${E.size} active`:"Route filters",children:S($r,{size:14,color:E.size>0?M.color.accent:M.color.textSecondary})}),S(Ar,{isEnabled:R,onToggle:X,accessibilityLabel:"Toggle route event monitoring",testID:"buoy-routes-power"}),S(W,{onPress:Pe,style:A.iconButton,testID:"buoy-routes-clear",accessibilityRole:"button",accessibilityLabel:"Clear route events",children:S(Lr,{size:14,color:M.color.danger})})]})]})]}),fo=g=>{if(g.type==="layout"||g.type==="group")return;let B=g.type==="index"||g.path==="/";if(!N&&!B){$(true);return}i?.onNavigateRoute?.(g)},Rt=S(zr,{visible:T,onClose:()=>$(false),featureName:"Route Event Management"});return n?re(Ft,{children:[re(l,{style:A.inlineRoot,children:[S(l,{style:A.inlineHeader,...Ir,children:Tt}),Ct(),rt]}),Rt]}):S(Ft,{children:re(Dr,{visible:e,onClose:t,onMinimize:r,persistenceKey:yo,header:{showToggleButton:true,customContent:Tt},onModeChange:b,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:true,styles:{},footer:rt,footerHeight:rt?68:0,children:[Ct(),Rt]})})}function Ya(e={}){return S(ft,{...e,inline:true,visible:true,onClose:()=>{}})}var A=ve.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Nr.border,backgroundColor:"transparent"},iconButton:{padding:6,borderRadius:6,backgroundColor:M.color.buttonSurface},activeFilterButton:{backgroundColor:M.color.accentSoft},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:M.color.text,fontSize:16,fontWeight:"600",marginTop:16,marginBottom:8,fontFamily:Ge,letterSpacing:.5,textTransform:"uppercase"},emptySubtitle:{color:M.color.textSecondary,fontSize:14,textAlign:"center",fontFamily:Ge},contentWrapper:{flex:1},statsContainer:{paddingHorizontal:16,paddingVertical:8,backgroundColor:M.color.surface,borderBottomWidth:1,borderBottomColor:M.color.border},statsText:{fontSize:11,color:M.color.textSecondary,fontFamily:Ge,textAlign:"center"},statsWarning:{color:M.color.warning,fontWeight:"600"},searchContainer:{paddingHorizontal:16,paddingVertical:8,backgroundColor:"transparent"},lockedEventsBanner:{flexDirection:"row",alignItems:"center",gap:8,backgroundColor:M.color.warningSoft,borderWidth:1,borderColor:M.color.warning+"30",borderRadius:8,paddingVertical:10,paddingHorizontal:14,marginHorizontal:16,marginBottom:8},lockedEventsBannerText:{fontSize:12,fontWeight:"600",color:M.color.warning,fontFamily:Ge},lockedEventsBannerSubtext:{fontSize:11,color:M.color.textSecondary,marginLeft:"auto"}});import{createToolFactory as en,defineToolPreset as tn}from"@buoy-gg/shared-ui/web";import{jsx as on}from"react/jsx-runtime";var ro=tn({id:"route-events",name:"ROUTES",description:"Route tracking & navigation inspector",slot:"both",icon:({size:e})=>on(To,{size:e}),component:ft,props:{enableSharedModalDimensions:false}}),rn=en(ro,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}));import{useEffect as an}from"react";import{browserRouter as ao,getBrowserHref as nn,getBrowserRouteURL as no,subscribeBrowserNavigation as sn}from"@buoy-gg/shared-ui/web/utils";var io=0,bt;function ln(){if(typeof window>"u")return()=>{};if(io++===0){he.hydrateBootCapture();let t,o,r="",a=[],n=-1,i=c=>{if(c.href===r&&c.kind==="pop")return;if(c.kind==="replace"&&n>=0)a[n]=c.href;else if(c.kind==="pop"){let v=a.lastIndexOf(c.href,n-1),T=a.indexOf(c.href,n+1);v>=0?n=v:T>=0?n=T:(a.splice(n+1),a.push(c.href),n++)}else a.splice(n+1),a.push(c.href),n++;r=c.href;let h=no(c.href),I=Date.now();Fe.emit({pathname:h.pathname,params:Object.fromEntries(h.searchParams),segments:h.pathname.split("/").filter(Boolean),previousPathname:t,timestamp:I,timeSincePrevious:o===void 0?void 0:I-o}),t=h.pathname,o=I,Q.setStack(a.map((v,T)=>{let $=no(v);return{key:`browser:${T}`,name:$.pathname,pathname:$.pathname,params:Object.fromEntries($.searchParams),index:T,isFocused:T===n,canPop:T>0}}))},u=c=>{if(!Number.isInteger(c)||c<0||c>=a.length)throw new Error("That browser history entry is unavailable.");window.history.go(c-n)};Q.setActions({navigateToIndex:u,popToIndex:u,goBack:ao.back,popToTop:()=>u(0),navigateToRoute:(c,h)=>(ao.push({pathname:c,params:h}),true)}),bt=sn(i),i({href:nn(),kind:"initial"})}let e=false;return()=>{e||(e=true,--io===0&&(bt?.(),bt=void 0,Q.setActions(null)))}}function cn(){return an(ln,[]),null}import{useEffect as so,useRef as vt}from"react";import{useSafePathname as un,useSafeSegments as dn,useSafeGlobalSearchParams as pn}from"@buoy-gg/shared-ui/web";function mn(e){let t=un(),o=dn(),r=pn(),a=vt(e),n=vt(void 0),i=vt(void 0);so(()=>{a.current=e},[e]),so(()=>{let u=Date.now(),c=i.current?u-i.current:void 0,h={pathname:t,params:r,segments:o,timestamp:u,previousPathname:n.current,timeSincePrevious:c};n.current=t,i.current=u,Fe.emit(h),a.current&&a.current(h)},[t,o,r])}import{useEffect as lo,useRef as xt}from"react";function co(e){if(!e||!e.routes||e.routes.length===0)return{route:null,segments:[]};let t=e.routes[e.index??0],o=[t.name];if(t.state){let r=co(t.state);if(r.route)return{route:r.route,segments:[...o,...r.segments]}}return{route:t,segments:o}}function uo(e,t,o,r){if(!e)return;let{route:a,segments:n}=co(e);if(!a)return;let i=`/${a.name}`;if(i===t.current)return;let u=Date.now(),c=o.current?u-o.current:void 0,h={pathname:i,params:a.params||{},segments:n,timestamp:u,previousPathname:t.current,timeSincePrevious:c};t.current=i,o.current=u,Fe.emit(h),r.current&&r.current(h)}function hn(e){let t=void 0,o=xt(e),r=xt(void 0),a=xt(void 0);lo(()=>{o.current=e},[e]),lo(()=>{if(!t)return;let n=t.getRootState?.();n&&uo(n,r,a,o);let i=t.addListener?.("state",()=>{let u=t.getRootState?.();uo(u,r,a,o)});return()=>{i?.()}},[t])}import{getSafeRouter as gn}from"@buoy-gg/shared-ui/web";import{isOverWireBudget as yn}from"@buoy-gg/shared-ui/web";var fn=16*1024,bn=Object.freeze({__buoyOmitted:"route-params",note:"Navigation params stay on the device."});function St(e){return e==null?false:yn(e,fn)}function Ve(e){return St(e)?bn:e}function vn(e){return St(e.params)?{...e,params:Ve(e.params)}:e}function xn(e){return St(e.params)?{...e,params:Ve(e.params)}:e}function Sn(){let e=pt();return{routes:ge.parseRouteTree(We()),source:e.source,lastUpdatedAt:e.lastLoadedAt}}var Cn={version:3,getSnapshot:()=>({events:he.getEvents().map(vn),sitemap:Sn(),stack:Q.getStack().map(xn)}),subscribe:e=>{let t=he.subscribeToEvents(e),o=Q.subscribe(e),r=null;if(!We()){let a=0,n=100,i=()=>{if(a+=1,We()){r=null,e();return}r=a<n?setTimeout(i,100):null};r=setTimeout(i,100)}return()=>{t(),o(),r&&clearTimeout(r)}},actions:{clearEvents:()=>{he.clearEvents()},getCurrentRoute:()=>{let e=he.getEvents()[0];if(e&&he.isCapturing())return{path:e.pathname,params:Ve(e.params),at:e.timestamp,source:"event"};let t=Q.getStack(),o=t.find(r=>r.isFocused)??t[t.length-1];return o?.pathname?{path:o.pathname,params:Ve(o.params??{}),at:null,source:"stack"}:e?{path:e.pathname,params:Ve(e.params),at:e.timestamp,source:"event",stale:true}:{path:null,params:{},at:null,source:null}},navigate:e=>{let t=e,o=t?.path;if(!o)throw new Error("navigate requires a 'path' param");let r=gn();if(!r){let a=Q.getActions(),n=o.replace(/^\//,"");if(!a?.navigateToRoute||!n)throw new Error("expo-router is not available here and no navigation container was captured \u2014 is <RouteTracker /> mounted inside your NavigationContainer?");if(!a.navigateToRoute(n,t?.params))throw new Error(`Could not navigate to "${n}" \u2014 no navigation container is live.`);return{navigated:o,replaced:false,via:"react-navigation"}}if(t?.reset===true){try{r.canDismiss?.()&&r.dismissAll?.()}catch{}return r.navigate(o),{navigated:o,replaced:false,reset:true}}return(t?.replace===true&&typeof r.replace=="function"?r.replace:r.navigate)(o),{navigated:o,replaced:t?.replace===true}},stackNavigateToIndex:e=>{let t=e?.index;if(typeof t!="number")throw new Error("stackNavigateToIndex requires a numeric 'index'");let o=Q.getActions();if(!o)throw new Error("navigation stack is not available");return o.navigateToIndex(t),{navigatedToIndex:t}},stackPopToIndex:e=>{let t=e?.index;if(typeof t!="number")throw new Error("stackPopToIndex requires a numeric 'index'");let o=Q.getActions();if(!o)throw new Error("navigation stack is not available");return o.popToIndex(t),{poppedToIndex:t}},stackGoBack:()=>{let e=Q.getActions();if(!e)throw new Error("navigation stack is not available");return e.goBack(),{wentBack:true}},stackPopToTop:()=>{let e=Q.getActions();if(!e)throw new Error("navigation stack is not available");return e.popToTop(),{poppedToTop:true}}}};export{qt as NavigationStack,jt as RouteEventDetail,lt as RouteEventExpandedContent,eo as RouteEventItemCompact,ft as RouteEventsModalWithTabs,zt as RouteObserver,ge as RouteParser,cn as RouteTracker,ht as RoutesSitemap,Ya as RoutesToolView,rn as createRouteEventsTool,Q as navigationStackStore,pa as registerBrowserRoutes,he as routeEventStore,Cn as routeEventsSyncAdapter,ro as routeEventsToolPreset,Fe as routeObserver,Qt as useNavigationStack,ya as useParentRoutes,ga as useRoute,At as useRouteEvents,mn as useRouteObserver,hn as useRouteObserverReactNavigation,Je as useRouteSitemap};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/route-events",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.44",
|
|
4
4
|
"description": "Inspect reported navigation state and supported route actions in React Native apps using Expo Router or React Navigation.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -34,17 +34,12 @@
|
|
|
34
34
|
],
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
38
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
37
|
+
"@buoy-gg/floating-tools-core": "^7.0.44",
|
|
38
|
+
"@buoy-gg/shared-ui": "^7.0.44"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@buoy-gg/license": "7.0.
|
|
42
|
-
"
|
|
43
|
-
"expo-router": "*",
|
|
44
|
-
"react": "*",
|
|
45
|
-
"react-native": "*",
|
|
46
|
-
"react-native-web": "^0.21.0",
|
|
47
|
-
"react-dom": ">=18"
|
|
41
|
+
"@buoy-gg/license": "7.0.44",
|
|
42
|
+
"react": "*"
|
|
48
43
|
},
|
|
49
44
|
"peerDependenciesMeta": {
|
|
50
45
|
"expo-router": {
|
|
@@ -70,7 +65,7 @@
|
|
|
70
65
|
"@types/react-native": "^0.73.0",
|
|
71
66
|
"expo-router": "~5.0.7",
|
|
72
67
|
"typescript": "~5.8.3",
|
|
73
|
-
"@buoy-gg/license": "^7.0.
|
|
68
|
+
"@buoy-gg/license": "^7.0.44"
|
|
74
69
|
},
|
|
75
70
|
"react-native-builder-bob": {
|
|
76
71
|
"source": "src",
|