@buoy-gg/highlight-updates 7.0.69 → 7.0.70

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.
package/lib/web/index.mjs CHANGED
@@ -1,38 +1,38 @@
1
- "use client";var bn=Object.defineProperty;var zu=Object.getOwnPropertyDescriptor;var Lu=Object.getOwnPropertyNames;var Bu=Object.prototype.hasOwnProperty;var l=(e,t)=>bn(e,"name",{value:t,configurable:true});var Kt=(e,t)=>()=>(e&&(t=e(e=0)),t);var sa=(e,t)=>{for(var n in t)bn(e,n,{get:t[n],enumerable:true})},zr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Lu(t))!Bu.call(e,o)&&o!==n&&bn(e,o,{get:()=>t[o],enumerable:!(r=zu(t,o))||r.enumerable});return e},Vu=(e,t,n)=>(zr(e,t,"default"),n&&zr(n,t,"default"));var Hu=e=>zr(bn({},"__esModule",{value:true}),e);var ee,U=Kt(()=>{"use strict";ee=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis)});function vn(e){return Xe[e]||e}function ca(e){for(let[t,n]of Object.entries(Xe))if(n===e)return t;return null}function ua(e){return e in Xe}function da(){return Object.keys(Xe)}function ga(){return[...new Set(Object.values(Xe))]}var Xe,ha=Kt(()=>{"use strict";U();Xe={RCTView:"View",RCTSafeAreaView:"SafeAreaView",RCTModalHostView:"Modal",RCTText:"Text",RCTRawText:"RawText",RCTVirtualText:"VirtualText",RCTTextInlineImage:"TextInlineImage",RCTImageView:"Image",RCTImage:"Image",RCTScrollView:"ScrollView",RCTScrollContentView:"ScrollContentView",AndroidHorizontalScrollView:"HorizontalScrollView",AndroidHorizontalScrollContentView:"HorizontalScrollContentView",RCTSinglelineTextInputView:"TextInput",RCTMultilineTextInputView:"TextInput (Multiline)",AndroidTextInput:"TextInput",RCTInputAccessoryView:"InputAccessoryView",RCTRefreshControl:"RefreshControl",AndroidSwipeRefreshLayout:"RefreshControl",PullToRefreshView:"RefreshControl",RCTSwitch:"Switch",AndroidSwitch:"Switch",RCTSlider:"Slider",RCTActivityIndicatorView:"ActivityIndicator",AndroidProgressBar:"ActivityIndicator",AndroidDrawerLayout:"DrawerLayout",VirtualView:"VirtualView",VirtualViewExperimental:"VirtualView",DebuggingOverlay:"DebuggingOverlay",LayoutConformance:"LayoutConformance",UnimplementedNativeView:"UnimplementedView",RKShimmeringView:"ShimmeringView",RCTTemplateView:"TemplateView",RCTAxialGradientView:"AxialGradientView",RCTMap:"Map",RCTWebView:"WebView",RCTKeyframes:"Keyframes",RCTImpressionTrackingView:"ImpressionTrackingView",RNSVGSvgView:"Svg",RNSVGGroup:"G",RNSVGPath:"Path",RNSVGText:"SvgText",RNSVGTSpan:"TSpan",RNSVGTextPath:"TextPath",RNSVGImage:"SvgImage",RNSVGCircle:"Circle",RNSVGEllipse:"Ellipse",RNSVGLine:"Line",RNSVGRect:"Rect",RNSVGClipPath:"ClipPath",RNSVGDefs:"Defs",RNSVGUse:"Use",RNSVGSymbol:"Symbol",RNSVGPattern:"Pattern",RNSVGMask:"Mask",RNSVGForeignObject:"ForeignObject",RNSVGMarker:"Marker",RNSVGLinearGradient:"LinearGradient",RNSVGRadialGradient:"RadialGradient",RNSVGFilter:"Filter",RNSVGFeBlend:"FeBlend",RNSVGFeColorMatrix:"FeColorMatrix",RNSVGFeComposite:"FeComposite",RNSVGFeFlood:"FeFlood",RNSVGFeGaussianBlur:"FeGaussianBlur",RNSVGFeMerge:"FeMerge",RNSVGFeOffset:"FeOffset",RNSVGPolygon:"Polygon",RNSVGPolyline:"Polyline",RNSVGStop:"Stop",RNGestureHandlerRootView:"GestureHandlerRootView",RNGestureHandlerButton:"GestureHandlerButton",RNCSafeAreaProvider:"SafeAreaProvider",RNCSafeAreaView:"SafeAreaView",RNSScreen:"Screen",RNSScreenContainer:"ScreenContainer",RNSScreenStack:"ScreenStack",RNSScreenStackHeaderConfig:"ScreenStackHeaderConfig",RNSScreenStackHeaderSubview:"ScreenStackHeaderSubview",RNSSearchBar:"SearchBar",RNSFullWindowOverlay:"FullWindowOverlay",RNSModalScreen:"ModalScreen",ReanimatedView:"Animated.View",ExpoView:"ExpoView",ExpoBlurView:"BlurView",ExpoLinearGradient:"LinearGradient",ExpoImage:"ExpoImage",ExpoVideoView:"VideoView",ExpoCamera:"Camera",ExpoBarCodeScannerView:"BarCodeScanner",RNCWebView:"WebView",AIRMap:"MapView",AIRMapMarker:"Marker",AIRMapPolyline:"Polyline",AIRMapPolygon:"Polygon",AIRMapCircle:"Circle",AIRMapCallout:"Callout",RCTVideo:"Video",LottieAnimationView:"LottieView",FastImageView:"FastImage"};l(vn,"getComponentDisplayName");l(ca,"getNativeViewType");l(ua,"isKnownViewType");l(da,"getAllNativeViewTypes");l(ga,"getAllComponentNames")});function pa(){return qt=performance.now(),qt}function ma(e,t){qt>0&&e>0&&(qt=0)}var qt,Lr,fa,Qe,Cn=Kt(()=>{"use strict";U();qt=0;l(pa,"markEventReceived");l(ma,"markOverlayRendered");Lr=class tp{constructor(){this.enabled=false;this.batchCounter=0;this.listeners=new Set;this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0};this.recentBatches=[];this.MAX_HISTORY=100;this.summaryInterval=null;this.SUMMARY_INTERVAL_MS=1e4}setEnabled(t){let n=this.enabled;this.enabled=t,t&&!n?this.resetStats():!t&&n&&this.stopSummaryInterval()}isEnabled(){return this.enabled}startBatch(t,n){let r=`batch_${++this.batchCounter}`,o=performance.now(),i=null,s=null,a=null,u=null,c=null,d=0,g=0,T=0,b=0,v;return{markFilteringComplete:l((f,S)=>{i=performance.now(),d=f,g=S},"markFilteringComplete"),markMeasurementStart:l(()=>{s=performance.now()},"markMeasurementStart"),markMeasurementComplete:l((f,S)=>{a=performance.now(),T=f,b=S},"markMeasurementComplete"),markTrackingComplete:l(()=>{u=performance.now()},"markTrackingComplete"),markCallbackComplete:l(()=>{c=performance.now()},"markCallbackComplete"),setOverlayRenderTime:l(f=>{v=f},"setOverlayRenderTime"),getBatchId:l(()=>r,"getBatchId"),finish:l(()=>{let f=performance.now(),S={batchId:r,timestamp:Date.now(),nodesReceived:t,nodesFiltered:d,nodesToProcess:g,batchSize:n,nodesInBatch:Math.min(g,n),filteringTime:i?i-o:0,measurementTime:s&&a?a-s:0,trackingTime:a&&u?u-a:0,callbackTime:u&&c?c-u:0,totalTime:f-o,measurementSuccessCount:T,measurementFailCount:b,overlayRenderTime:v};return this.enabled&&this.recordMetrics(S),S},"finish")}}recordMetrics(t){this.rollingStats.batchCount++,this.rollingStats.totalNodes+=t.nodesReceived,this.rollingStats.totalFiltered+=t.nodesFiltered,this.rollingStats.totalProcessed+=t.nodesInBatch,this.rollingStats.totalTime+=t.totalTime,this.rollingStats.maxTime=Math.max(this.rollingStats.maxTime,t.totalTime),this.rollingStats.minTime=Math.min(this.rollingStats.minTime,t.totalTime);let n=this.rollingStats.avgMeasurementTime,r=this.rollingStats.batchCount;this.rollingStats.avgMeasurementTime=n+(t.measurementTime-n)/r,this.recentBatches.push(t),this.recentBatches.length>this.MAX_HISTORY&&this.recentBatches.shift(),this.notifyListeners(t)}logBatch(t){let{batchId:n,nodesReceived:r,nodesFiltered:o,nodesInBatch:i,batchSize:s,filteringTime:a,measurementTime:u,trackingTime:c,callbackTime:d,totalTime:g,measurementSuccessCount:T,measurementFailCount:b,overlayRenderTime:v}=t;console.log("[Buoy]",`[HighlightPerf] ${n} | In:${r} Filt:${o} Proc:${i}/${s} | Filter:${a.toFixed(1)}ms Measure:${u.toFixed(1)}ms Track:${c.toFixed(1)}ms Callback:${d.toFixed(1)}ms | Total:${g.toFixed(1)}ms`+(v?` Render:${v.toFixed(1)}ms`:"")+` | Success:${T} Fail:${b}`),g>100&&console.warn("[Buoy]",`[HighlightPerf] \u26A0\uFE0F SLOW BATCH: ${g.toFixed(1)}ms - Measurement phase: ${u.toFixed(1)}ms (${(u/g*100).toFixed(0)}%)`)}logSummary(){if(this.rollingStats.batchCount===0)return;let t=this.rollingStats,n=t.totalTime/t.batchCount,r=t.totalNodes/t.batchCount;console.log("[Buoy]",`
1
+ "use client";var vn=Object.defineProperty;var Ku=Object.getOwnPropertyDescriptor;var qu=Object.getOwnPropertyNames;var Ju=Object.prototype.hasOwnProperty;var l=(e,t)=>vn(e,"name",{value:t,configurable:true});var Kt=(e,t)=>()=>(e&&(t=e(e=0)),t);var ga=(e,t)=>{for(var n in t)vn(e,n,{get:t[n],enumerable:true})},Vo=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qu(t))!Ju.call(e,r)&&r!==n&&vn(e,r,{get:()=>t[r],enumerable:!(o=Ku(t,r))||o.enumerable});return e},Yu=(e,t,n)=>(Vo(e,t,"default"),n&&Vo(n,t,"default"));var Xu=e=>Vo(vn({},"__esModule",{value:true}),e);var ee,U=Kt(()=>{"use strict";ee=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis)});function Cn(e){return Xe[e]||e}function ha(e){for(let[t,n]of Object.entries(Xe))if(n===e)return t;return null}function pa(e){return e in Xe}function ma(){return Object.keys(Xe)}function fa(){return[...new Set(Object.values(Xe))]}var Xe,ya=Kt(()=>{"use strict";U();Xe={RCTView:"View",RCTSafeAreaView:"SafeAreaView",RCTModalHostView:"Modal",RCTText:"Text",RCTRawText:"RawText",RCTVirtualText:"VirtualText",RCTTextInlineImage:"TextInlineImage",RCTImageView:"Image",RCTImage:"Image",RCTScrollView:"ScrollView",RCTScrollContentView:"ScrollContentView",AndroidHorizontalScrollView:"HorizontalScrollView",AndroidHorizontalScrollContentView:"HorizontalScrollContentView",RCTSinglelineTextInputView:"TextInput",RCTMultilineTextInputView:"TextInput (Multiline)",AndroidTextInput:"TextInput",RCTInputAccessoryView:"InputAccessoryView",RCTRefreshControl:"RefreshControl",AndroidSwipeRefreshLayout:"RefreshControl",PullToRefreshView:"RefreshControl",RCTSwitch:"Switch",AndroidSwitch:"Switch",RCTSlider:"Slider",RCTActivityIndicatorView:"ActivityIndicator",AndroidProgressBar:"ActivityIndicator",AndroidDrawerLayout:"DrawerLayout",VirtualView:"VirtualView",VirtualViewExperimental:"VirtualView",DebuggingOverlay:"DebuggingOverlay",LayoutConformance:"LayoutConformance",UnimplementedNativeView:"UnimplementedView",RKShimmeringView:"ShimmeringView",RCTTemplateView:"TemplateView",RCTAxialGradientView:"AxialGradientView",RCTMap:"Map",RCTWebView:"WebView",RCTKeyframes:"Keyframes",RCTImpressionTrackingView:"ImpressionTrackingView",RNSVGSvgView:"Svg",RNSVGGroup:"G",RNSVGPath:"Path",RNSVGText:"SvgText",RNSVGTSpan:"TSpan",RNSVGTextPath:"TextPath",RNSVGImage:"SvgImage",RNSVGCircle:"Circle",RNSVGEllipse:"Ellipse",RNSVGLine:"Line",RNSVGRect:"Rect",RNSVGClipPath:"ClipPath",RNSVGDefs:"Defs",RNSVGUse:"Use",RNSVGSymbol:"Symbol",RNSVGPattern:"Pattern",RNSVGMask:"Mask",RNSVGForeignObject:"ForeignObject",RNSVGMarker:"Marker",RNSVGLinearGradient:"LinearGradient",RNSVGRadialGradient:"RadialGradient",RNSVGFilter:"Filter",RNSVGFeBlend:"FeBlend",RNSVGFeColorMatrix:"FeColorMatrix",RNSVGFeComposite:"FeComposite",RNSVGFeFlood:"FeFlood",RNSVGFeGaussianBlur:"FeGaussianBlur",RNSVGFeMerge:"FeMerge",RNSVGFeOffset:"FeOffset",RNSVGPolygon:"Polygon",RNSVGPolyline:"Polyline",RNSVGStop:"Stop",RNGestureHandlerRootView:"GestureHandlerRootView",RNGestureHandlerButton:"GestureHandlerButton",RNCSafeAreaProvider:"SafeAreaProvider",RNCSafeAreaView:"SafeAreaView",RNSScreen:"Screen",RNSScreenContainer:"ScreenContainer",RNSScreenStack:"ScreenStack",RNSScreenStackHeaderConfig:"ScreenStackHeaderConfig",RNSScreenStackHeaderSubview:"ScreenStackHeaderSubview",RNSSearchBar:"SearchBar",RNSFullWindowOverlay:"FullWindowOverlay",RNSModalScreen:"ModalScreen",ReanimatedView:"Animated.View",ExpoView:"ExpoView",ExpoBlurView:"BlurView",ExpoLinearGradient:"LinearGradient",ExpoImage:"ExpoImage",ExpoVideoView:"VideoView",ExpoCamera:"Camera",ExpoBarCodeScannerView:"BarCodeScanner",RNCWebView:"WebView",AIRMap:"MapView",AIRMapMarker:"Marker",AIRMapPolyline:"Polyline",AIRMapPolygon:"Polygon",AIRMapCircle:"Circle",AIRMapCallout:"Callout",RCTVideo:"Video",LottieAnimationView:"LottieView",FastImageView:"FastImage"};l(Cn,"getComponentDisplayName");l(ha,"getNativeViewType");l(pa,"isKnownViewType");l(ma,"getAllNativeViewTypes");l(fa,"getAllComponentNames")});function ba(){return qt=performance.now(),qt}function va(e,t){qt>0&&e>0&&(qt=0)}var qt,Ao,Ca,Qe,Tn=Kt(()=>{"use strict";U();qt=0;l(ba,"markEventReceived");l(va,"markOverlayRendered");Ao=class yp{constructor(){this.enabled=false;this.batchCounter=0;this.listeners=new Set;this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0};this.recentBatches=[];this.MAX_HISTORY=100;this.summaryInterval=null;this.SUMMARY_INTERVAL_MS=1e4}setEnabled(t){let n=this.enabled;this.enabled=t,t&&!n?this.resetStats():!t&&n&&this.stopSummaryInterval()}isEnabled(){return this.enabled}startBatch(t,n){let o=`batch_${++this.batchCounter}`,r=performance.now(),i=null,s=null,a=null,c=null,u=null,d=0,g=0,T=0,f=0,b;return{markFilteringComplete:l((m,S)=>{i=performance.now(),d=m,g=S},"markFilteringComplete"),markMeasurementStart:l(()=>{s=performance.now()},"markMeasurementStart"),markMeasurementComplete:l((m,S)=>{a=performance.now(),T=m,f=S},"markMeasurementComplete"),markTrackingComplete:l(()=>{c=performance.now()},"markTrackingComplete"),markCallbackComplete:l(()=>{u=performance.now()},"markCallbackComplete"),setOverlayRenderTime:l(m=>{b=m},"setOverlayRenderTime"),getBatchId:l(()=>o,"getBatchId"),finish:l(()=>{let m=performance.now(),S={batchId:o,timestamp:Date.now(),nodesReceived:t,nodesFiltered:d,nodesToProcess:g,batchSize:n,nodesInBatch:Math.min(g,n),filteringTime:i?i-r:0,measurementTime:s&&a?a-s:0,trackingTime:a&&c?c-a:0,callbackTime:c&&u?u-c:0,totalTime:m-r,measurementSuccessCount:T,measurementFailCount:f,overlayRenderTime:b};return this.enabled&&this.recordMetrics(S),S},"finish")}}recordMetrics(t){this.rollingStats.batchCount++,this.rollingStats.totalNodes+=t.nodesReceived,this.rollingStats.totalFiltered+=t.nodesFiltered,this.rollingStats.totalProcessed+=t.nodesInBatch,this.rollingStats.totalTime+=t.totalTime,this.rollingStats.maxTime=Math.max(this.rollingStats.maxTime,t.totalTime),this.rollingStats.minTime=Math.min(this.rollingStats.minTime,t.totalTime);let n=this.rollingStats.avgMeasurementTime,o=this.rollingStats.batchCount;this.rollingStats.avgMeasurementTime=n+(t.measurementTime-n)/o,this.recentBatches.push(t),this.recentBatches.length>this.MAX_HISTORY&&this.recentBatches.shift(),this.notifyListeners(t)}logBatch(t){let{batchId:n,nodesReceived:o,nodesFiltered:r,nodesInBatch:i,batchSize:s,filteringTime:a,measurementTime:c,trackingTime:u,callbackTime:d,totalTime:g,measurementSuccessCount:T,measurementFailCount:f,overlayRenderTime:b}=t;console.log("[Buoy]",`[HighlightPerf] ${n} | In:${o} Filt:${r} Proc:${i}/${s} | Filter:${a.toFixed(1)}ms Measure:${c.toFixed(1)}ms Track:${u.toFixed(1)}ms Callback:${d.toFixed(1)}ms | Total:${g.toFixed(1)}ms`+(b?` Render:${b.toFixed(1)}ms`:"")+` | Success:${T} Fail:${f}`),g>100&&console.warn("[Buoy]",`[HighlightPerf] \u26A0\uFE0F SLOW BATCH: ${g.toFixed(1)}ms - Measurement phase: ${c.toFixed(1)}ms (${(c/g*100).toFixed(0)}%)`)}logSummary(){if(this.rollingStats.batchCount===0)return;let t=this.rollingStats,n=t.totalTime/t.batchCount,o=t.totalNodes/t.batchCount;console.log("[Buoy]",`
2
2
  [HighlightPerf] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 SUMMARY (last ${this.SUMMARY_INTERVAL_MS/1e3}s) \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
3
3
  Batches: ${t.batchCount}
4
- Avg nodes/batch: ${r.toFixed(1)} (filtered: ${(t.totalFiltered/t.batchCount).toFixed(1)})
4
+ Avg nodes/batch: ${o.toFixed(1)} (filtered: ${(t.totalFiltered/t.batchCount).toFixed(1)})
5
5
  Avg total time: ${n.toFixed(1)}ms
6
6
  Avg measurement time: ${t.avgMeasurementTime.toFixed(1)}ms
7
7
  Min/Max time: ${t.minTime.toFixed(1)}ms / ${t.maxTime.toFixed(1)}ms
8
8
  \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
9
- `),this.resetStats()}resetStats(){this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0}}startSummaryInterval(){this.stopSummaryInterval(),this.summaryInterval=setInterval(()=>{this.logSummary()},this.SUMMARY_INTERVAL_MS)}stopSummaryInterval(){this.summaryInterval&&(clearInterval(this.summaryInterval),this.summaryInterval=null)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(t){for(let n of this.listeners)try{n(t)}catch(r){console.error("[Buoy]","[HighlightPerf] Error in metrics listener:",r)}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[],this.resetStats(),this.batchCounter=0}generateReport(){let t=this.recentBatches;if(t.length===0)return"No performance data collected yet.";let n=t.reduce((s,a)=>s+a.totalTime,0)/t.length,r=t.reduce((s,a)=>s+a.measurementTime,0)/t.length,o=t.filter(s=>s.totalTime>100),i=t.filter(s=>s.totalTime<20);return`
9
+ `),this.resetStats()}resetStats(){this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0}}startSummaryInterval(){this.stopSummaryInterval(),this.summaryInterval=setInterval(()=>{this.logSummary()},this.SUMMARY_INTERVAL_MS)}stopSummaryInterval(){this.summaryInterval&&(clearInterval(this.summaryInterval),this.summaryInterval=null)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(t){for(let n of this.listeners)try{n(t)}catch(o){console.error("[Buoy]","[HighlightPerf] Error in metrics listener:",o)}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[],this.resetStats(),this.batchCounter=0}generateReport(){let t=this.recentBatches;if(t.length===0)return"No performance data collected yet.";let n=t.reduce((s,a)=>s+a.totalTime,0)/t.length,o=t.reduce((s,a)=>s+a.measurementTime,0)/t.length,r=t.filter(s=>s.totalTime>100),i=t.filter(s=>s.totalTime<20);return`
10
10
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
11
11
  \u2551 HIGHLIGHT UPDATES PERFORMANCE REPORT \u2551
12
12
  \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
13
13
  \u2551 Total batches analyzed: ${t.length.toString().padStart(5)} \u2551
14
14
  \u2551 Average total time: ${n.toFixed(1).padStart(5)}ms \u2551
15
- \u2551 Average measure time: ${r.toFixed(1).padStart(5)}ms (${(r/n*100).toFixed(0)}% of total) \u2551
15
+ \u2551 Average measure time: ${o.toFixed(1).padStart(5)}ms (${(o/n*100).toFixed(0)}% of total) \u2551
16
16
  \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
17
17
  \u2551 Fast batches (<20ms): ${i.length.toString().padStart(5)} (${(i.length/t.length*100).toFixed(0)}%) \u2551
18
- \u2551 Slow batches (>100ms): ${o.length.toString().padStart(5)} (${(o.length/t.length*100).toFixed(0)}%) \u2551
18
+ \u2551 Slow batches (>100ms): ${r.length.toString().padStart(5)} (${(r.length/t.length*100).toFixed(0)}%) \u2551
19
19
  \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
20
20
  \u2551 Time breakdown (avg): \u2551
21
21
  \u2551 Filtering: ${t.reduce((s,a)=>s+a.filteringTime,0/t.length).toFixed(1).padStart(6)}ms \u2551
22
- \u2551 Measurement: ${r.toFixed(1).padStart(6)}ms \u2190 Primary bottleneck \u2551
22
+ \u2551 Measurement: ${o.toFixed(1).padStart(6)}ms \u2190 Primary bottleneck \u2551
23
23
  \u2551 Tracking: ${(t.reduce((s,a)=>s+a.trackingTime,0)/t.length).toFixed(1).padStart(6)}ms \u2551
24
24
  \u2551 Callback: ${(t.reduce((s,a)=>s+a.callbackTime,0)/t.length).toFixed(1).padStart(6)}ms \u2551
25
25
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
26
- `}};l(Lr,"PerformanceLoggerSingleton");fa=Lr,Qe=new fa});function ya(e){if(e.isComponent===true||e.testID&&e.testID.trim())return true;let t=(e.componentName??"").trim();if(!t||Br.has(t)||ba.has(t))return false;let n=(e.viewType??"").trim();return!(n&&Br.has(n)&&t===n||/^comp(\s|$)/i.test(t)||t.startsWith("_"))}var Br,ba,Au=Kt(()=>{"use strict";U();Br=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]),ba=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"]);l(ya,"isNamedComposite")});var va={};sa(va,{RenderTracker:()=>B,default:()=>wa});var Vr,Ca,Hr,Ta,B,wa,Ve=Kt(()=>{"use strict";U();ha();Cn();Au();Vr=200,Ca=150,Hr=class np{constructor(){this.renders=new Map;this.listeners=new Set;this.stateListeners=new Set;this.settingsListeners=new Set;this.filterListeners=new Set;this.renderEventCallbacks=new Set;this.isTracking=false;this.isPaused=false;this.settings={batchSize:Ca,showRenderCount:true,performanceLogging:false,trackRenderCauses:false,enableRenderHistory:false,maxRenderHistoryPerComponent:20,capturePropsOnRender:false,captureStateOnRender:false,debugLogLevel:"off",excludeDevTools:true,showHostViews:false};this.isBatchMode=false;this.batchDirty=false;this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]}}trackRender(t){if(this.isPaused)return;let n=String(t.nativeTag),r=Date.now(),o=this.renders.get(n);if(o){if(o.renderCount=t.count,o.lastRenderTime=r,o.color=t.color,t.measurements&&(o.measurements=t.measurements),t.testID&&!o.testID&&(o.testID=t.testID),t.nativeID&&!o.nativeID&&(o.nativeID=t.nativeID),t.accessibilityLabel&&!o.accessibilityLabel&&(o.accessibilityLabel=t.accessibilityLabel),t.componentName&&!o.componentName&&(o.componentName=t.componentName),t.renderCause&&(o.lastRenderCause=t.renderCause),this.settings.enableRenderHistory){let i=t.renderCause||{type:"unknown",timestamp:r};this.addRenderEvent(o,i,t.capturedProps,t.capturedState)}}else{let i={id:n,nativeTag:t.nativeTag,viewType:t.viewType,displayName:vn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,...t.isComponent===void 0?{}:{isComponent:t.isComponent},renderCount:t.count,firstRenderTime:r,lastRenderTime:r,measurements:t.measurements,color:t.color,lastRenderCause:t.renderCause};if(this.settings.enableRenderHistory){i.renderHistory=[];let s=t.renderCause||{type:t.count===1?"mount":"unknown",timestamp:r};this.addRenderEvent(i,s,t.capturedProps,t.capturedState)}if(this.renders.set(n,i),this.renders.size>Vr){let s=Array.from(this.renders.values()).sort((a,u)=>a.lastRenderTime-u.lastRenderTime).slice(0,this.renders.size-Vr);for(let a of s)this.renders.delete(a.id)}}this.isBatchMode?this.batchDirty=true:this.notifyListeners()}addRenderEvent(t,n,r,o){t.renderHistory||(t.renderHistory=[]);let i={id:`${t.nativeTag}-${n.timestamp}`,timestamp:n.timestamp,cause:n,renderNumber:t.renderCount,capturedProps:this.settings.capturePropsOnRender?r:void 0,capturedState:this.settings.captureStateOnRender?o:void 0};t.renderHistory.push(i);let s=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));t.renderHistory.length>s&&(t.renderHistory=t.renderHistory.slice(-s)),this.notifyRenderEventCallbacks(i,t)}notifyRenderEventCallbacks(t,n){this.renderEventCallbacks.forEach(r=>{try{r(t,n)}catch{}})}emitRenderEvent(t){if(this.renderEventCallbacks.size===0)return;let n=Date.now(),r=t.renderCause||{type:"unknown",timestamp:n},o={id:String(t.nativeTag),nativeTag:t.nativeTag,viewType:t.viewType,displayName:vn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,renderCount:t.count,firstRenderTime:n,lastRenderTime:n,measurements:t.measurements,color:t.color,lastRenderCause:r,renderHistory:[]},i={id:`${t.nativeTag}-${n}-${t.count}`,timestamp:n,renderNumber:t.count,cause:r,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(i,o)}startBatch(){this.isBatchMode=true,this.batchDirty=false}endBatch(){this.isBatchMode=false,this.batchDirty&&(this.batchDirty=false,this.notifyListeners())}getRenders(){return Array.from(this.renders.values()).map(t=>({...t}))}passesFilters(t){if(this.filters.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,this.filters.includePatterns)||this.filters.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,this.filters.excludePatterns))return false;if(this.filters.includeViewType.size>0){let n=t.viewType||"",r=t.displayName||"";if(!this.matchesPattern(n,this.filters.includeViewType)&&!this.matchesPattern(r,this.filters.includeViewType))return false}if(this.filters.includeTestID.size>0&&(!t.testID||!this.matchesPattern(t.testID,this.filters.includeTestID))||this.filters.includeNativeID.size>0&&(!t.nativeID||!this.matchesPattern(t.nativeID,this.filters.includeNativeID))||this.filters.includeComponent.size>0&&(!t.componentName||!this.matchesPattern(t.componentName,this.filters.includeComponent)))return false;if(this.filters.excludeViewType.size>0){let n=t.viewType||"",r=t.displayName||"";if(this.matchesPattern(n,this.filters.excludeViewType)||this.matchesPattern(r,this.filters.excludeViewType))return false}return!(this.filters.excludeTestID.size>0&&t.testID&&this.matchesPattern(t.testID,this.filters.excludeTestID)||this.filters.excludeNativeID.size>0&&t.nativeID&&this.matchesPattern(t.nativeID,this.filters.excludeNativeID)||this.filters.excludeComponent.size>0&&t.componentName&&this.matchesPattern(t.componentName,this.filters.excludeComponent))}matchesAnyPatternForInfo(t,n){for(let r of n){let o=r.value.toLowerCase();switch(r.type){case"any":if(t.viewType.toLowerCase().includes(o)||t.displayName?.toLowerCase().includes(o)||t.testID?.toLowerCase().includes(o)||t.nativeID?.toLowerCase().includes(o)||t.componentName?.toLowerCase().includes(o)||t.accessibilityLabel?.toLowerCase().includes(o))return true;break;case"viewType":if(t.viewType.toLowerCase().includes(o)||t.displayName?.toLowerCase().includes(o))return true;break;case"testID":if(t.testID?.toLowerCase().includes(o))return true;break;case"nativeID":if(t.nativeID?.toLowerCase().includes(o))return true;break;case"component":if(t.componentName?.toLowerCase().includes(o))return true;break;case"accessibilityLabel":if(t.accessibilityLabel?.toLowerCase().includes(o))return true;break}}return false}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||this.filters.minRenderCount!==void 0||this.filters.maxRenderCount!==void 0}getFilteredRenders(t=""){let n=this.getRenders();if(this.settings.showHostViews||(n=n.filter(ya)),t.trim()){let r=t.toLowerCase();n=n.filter(o=>o.viewType.toLowerCase().includes(r)||o.displayName.toLowerCase().includes(r)||o.testID?.toLowerCase().includes(r)||o.nativeID?.toLowerCase().includes(r)||o.accessibilityLabel?.toLowerCase().includes(r)||o.componentName?.toLowerCase().includes(r)||String(o.nativeTag).includes(r))}return n=n.filter(r=>this.passesFilters(r)),this.filters.minRenderCount!==void 0&&(n=n.filter(r=>r.renderCount>=this.filters.minRenderCount)),this.filters.maxRenderCount!==void 0&&(n=n.filter(r=>r.renderCount<=this.filters.maxRenderCount)),n.sort((r,o)=>o.lastRenderTime-r.lastRenderTime)}matchesPattern(t,n){let r=t.toLowerCase();for(let o of n){let i=o.toLowerCase();if(r.includes(i))return true}return false}getRender(t){return this.renders.get(t)}clear(){this.renders.clear(),this.notifyListeners()}resetRenderCount(t){let n=this.renders.get(t);n&&(n.renderCount=0,this.notifyListeners())}start(){this.isTracking=true,this.isPaused=false,this.notifyStateListeners()}stop(){this.isTracking=false,this.isPaused=false,this.notifyStateListeners()}pause(){this.isPaused=true,this.notifyStateListeners()}resume(){this.isPaused=false,this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused,this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}replaceRenders(t,n){let r=new Map;for(let[o,i]of this.renders)i.renderHistory&&i.renderHistory.length>0&&r.set(o,i.renderHistory);this.renders=new Map(t.map(o=>{let i=r.get(o.id),s=i&&!(o.renderHistory&&o.renderHistory.length>0)?{...o,renderHistory:i}:o;return[s.id,s]})),n&&(this.isTracking!==n.isTracking||this.isPaused!==n.isPaused)&&(this.isTracking=n.isTracking,this.isPaused=n.isPaused,this.notifyStateListeners()),this.notifyListeners()}hydrateRender(t){let n=this.renders.get(t.id);this.renders.set(t.id,n?{...n,...t}:t),this.notifyListeners()}getFilters(){return this.filters}setFilters(t){this.filters={...this.filters,...t},this.notifyListeners(),this.notifyFilterListeners()}addIncludePattern(t,n){let r=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[r].add(n),this.notifyListeners()}removeIncludePattern(t,n){let r=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[r].delete(n),this.notifyListeners()}addExcludePattern(t,n){let r=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[r].add(n),this.notifyListeners()}removeExcludePattern(t,n){let r=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[r].delete(n),this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0},this.notifyListeners()}getAvailableProps(){let t=new Set,n=new Set,r=new Set,o=new Set,i=new Set;for(let s of this.renders.values())s.viewType&&t.add(s.viewType),s.testID&&n.add(s.testID),s.nativeID&&r.add(s.nativeID),s.componentName&&o.add(s.componentName),s.accessibilityLabel&&i.add(s.accessibilityLabel);return{viewTypes:Array.from(t).sort(),testIDs:Array.from(n).sort(),nativeIDs:Array.from(r).sort(),componentNames:Array.from(o).sort(),accessibilityLabels:Array.from(i).sort()}}getStats(){let t=0;for(let n of this.renders.values())t+=n.renderCount;return{totalComponents:this.renders.size,totalRenders:t}}subscribe(t){return this.listeners.add(t),t(this.getRenders()),()=>{this.listeners.delete(t)}}subscribeToState(t){return this.stateListeners.add(t),t(this.getState()),()=>{this.stateListeners.delete(t)}}subscribeToSettings(t){return this.settingsListeners.add(t),t(this.settings),()=>{this.settingsListeners.delete(t)}}subscribeToFilters(t){return this.filterListeners.add(t),t(this.filters),()=>{this.filterListeners.delete(t)}}onRenderEvent(t){return this.renderEventCallbacks.add(t),()=>{this.renderEventCallbacks.delete(t)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(t){let n=this.filters;return!(n.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,n.includePatterns)||n.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,n.excludePatterns)||(n.includeViewType.size>0||n.includeTestID.size>0||n.includeNativeID.size>0||n.includeComponent.size>0)&&!(n.includeViewType.size>0&&n.includeViewType.has(t.viewType)||n.includeTestID.size>0&&t.testID&&n.includeTestID.has(t.testID)||n.includeNativeID.size>0&&t.nativeID&&n.includeNativeID.has(t.nativeID)||n.includeComponent.size>0&&t.componentName&&n.includeComponent.has(t.componentName))||n.excludeViewType.has(t.viewType)||t.testID&&n.excludeTestID.has(t.testID)||t.nativeID&&n.excludeNativeID.has(t.nativeID)||t.componentName&&n.excludeComponent.has(t.componentName))}getSettings(){return{...this.settings}}setSettings(t){t.batchSize!==void 0&&(t.batchSize=Math.max(10,Math.min(500,t.batchSize))),t.maxRenderHistoryPerComponent!==void 0&&(t.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,t.maxRenderHistoryPerComponent))),t.enableRenderHistory&&!this.settings.trackRenderCauses&&(t.trackRenderCauses=true),t.trackRenderCauses===false&&this.settings.enableRenderHistory&&(t.enableRenderHistory=false),this.settings={...this.settings,...t},t.performanceLogging!==void 0&&Qe.setEnabled(t.performanceLogging),this.notifySettingsListeners()}clearAllRenderHistory(){for(let t of this.renders.values())t.renderHistory=[];this.notifyListeners()}clearRenderHistory(t){let n=this.renders.get(t);n&&(n.renderHistory=[],this.notifyListeners())}getRenderHistoryStats(){let t=0,n=0;for(let r of this.renders.values())r.renderHistory&&r.renderHistory.length>0&&(t+=r.renderHistory.length,n++);return{totalEvents:t,componentsWithHistory:n,averageEventsPerComponent:n>0?t/n:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(t){this.setSettings({batchSize:t})}notifyListeners(){let t=this.getRenders();for(let n of this.listeners)try{n(t)}catch(r){console.error("[Buoy]","[RenderTracker] Error in listener:",r)}}notifyStateListeners(){let t=this.getState();for(let n of this.stateListeners)try{n(t)}catch(r){console.error("[Buoy]","[RenderTracker] Error in state listener:",r)}}notifySettingsListeners(){let t=this.getSettings();for(let n of this.settingsListeners)try{n(t)}catch(r){console.error("[Buoy]","[RenderTracker] Error in settings listener:",r)}}notifyFilterListeners(){let t=this.getFilters();for(let n of this.filterListeners)try{n(t)}catch(r){console.error("[Buoy]","[RenderTracker] Error in filter listener:",r)}}};l(Hr,"RenderTrackerSingleton");Ta=Hr,B=new Ta,wa=B});U();U();import{useState as Ar,useEffect as Er,useCallback as Eu}from"react";import{HighlighterIcon as Sa,HighlightIcon as xa}from"@buoy-gg/floating-tools-core/web";U();import{getDOMFiber as Fr,getDOMNodeHandle as Ia,getDOMPublicInstance as Fu,isDOMElement as Ra}from"@buoy-gg/shared-ui/web/utils";U();var xt=null,It=null,Jt=false,Yt=false,Tn=null;function Mr(e){if(!e)return{type:"null"};let t=e,n={};if(t.canonical){n.type="Fabric";let r=t.canonical;if(r.publicInstance){let o=r.publicInstance;n.hasMeasure=typeof o.measure=="function",n.nativeTag=o.__nativeTag??o._nativeTag??"unknown"}}else typeof t.measure=="function"?(n.type="Legacy",n.hasMeasure=true,n.nativeTag=t.__nativeTag??t._nativeTag??t.nativeTag??"unknown"):(n.type="Unknown",n.keys=Object.keys(t).slice(0,10));return n}l(Mr,"describeNode");function Da(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;!e||typeof e.emit!="function"||xt||(xt=e.emit.bind(e),e.emit=function(t,...n){if(t==="traceUpdates"&&Yt){let r=n[0];r.size>0&&console.log("[Buoy]",`[PROFILER] traceUpdates: ${r.size} nodes`,Array.from(r).map((o,i)=>({index:i,...Mr(o)}))),Tn&&Tn(r)}return xt(t,...n)})}l(Da,"swizzleHookEmit");function ka(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.reactDevtoolsAgent;!e||typeof e.emit!="function"||It||(It=e.emit.bind(e),e.emit=function(t,...n){if(Yt&&t==="drawTraceUpdates"){let r=n[0];r.length>0&&console.log("[Buoy]",`[PROFILER] drawTraceUpdates: ${r.length} nodes`,r.map((o,i)=>({index:i,color:o.color,...Mr(o.node)})))}return It(t,...n)})}l(ka,"swizzleAgentEmit");function Pa(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;e?.rendererInterfaces&&e.rendererInterfaces.forEach(t=>{if(typeof t.setTraceUpdatesEnabled=="function")try{t.setTraceUpdatesEnabled(false)}catch{}})}l(Pa,"disableTracingOnAllRenderers");function $r(e){Tn=e}l($r,"setComparisonCallback");function Or(){typeof ee<"u"&&!ee||Jt||(Da(),ka(),Jt=true)}l(Or,"installProfilerInterceptor");function _r(){if(!Jt)return;let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;xt&&e&&(e.emit=xt,xt=null),It&&e?.reactDevtoolsAgent&&(e.reactDevtoolsAgent.emit=It,It=null),Pa(),Tn=null,Jt=false}l(_r,"uninstallProfilerInterceptor");function Na(){return Jt}l(Na,"isInterceptorInstalled");function za(){Yt=true}l(za,"enableProfilerLogging");function La(){Yt=false}l(La,"disableProfilerLogging");function Ba(){return Yt}l(Ba,"isLoggingEnabled");var Va={};sa(Va,{AccessibilityInfo:()=>_u,ActivityIndicator:()=>Bd,Alert:()=>Hd,Animated:()=>Wu,AppRegistry:()=>ju,AppState:()=>Gu,Appearance:()=>Uu,BackHandler:()=>Ku,Button:()=>Vd,CheckBox:()=>id,Clipboard:()=>qu,DeviceEventEmitter:()=>Cd,Dimensions:()=>Ze,Easing:()=>Ju,FlatList:()=>Aa,I18nManager:()=>Yu,Image:()=>ad,ImageBackground:()=>ld,InteractionManager:()=>Qu,Keyboard:()=>Xu,KeyboardAvoidingView:()=>sd,LayoutAnimation:()=>Zu,Linking:()=>ed,LogBox:()=>vd,Modal:()=>_a,NativeEventEmitter:()=>td,NativeModules:()=>Ou,PanResponder:()=>nd,Picker:()=>cd,PixelRatio:()=>Wr,Platform:()=>Ha,Pressable:()=>$a,ProgressBar:()=>ud,RefreshControl:()=>dd,SafeAreaView:()=>gd,ScrollView:()=>Me,SectionList:()=>hd,Share:()=>rd,StatusBar:()=>pd,StyleSheet:()=>ve,Switch:()=>Rt,Text:()=>p,TextInput:()=>wn,Touchable:()=>md,TouchableHighlight:()=>zd,TouchableNativeFeedback:()=>fd,TouchableOpacity:()=>Y,TouchableWithoutFeedback:()=>Ld,UIManager:()=>Xt,Vibration:()=>od,View:()=>h,VirtualizedList:()=>yd,YellowBox:()=>bd,findNodeHandle:()=>Dt,unstable_createElement:()=>$u,useColorScheme:()=>Td,useLocaleContext:()=>wd,useWindowDimensions:()=>Sd});U();Vu(Va,Mu);import*as Mu from"react-native-web";import{unstable_createElement as $u,NativeModules as Ou,AccessibilityInfo as _u,Animated as Wu,Appearance as Uu,AppRegistry as ju,AppState as Gu,BackHandler as Ku,Clipboard as qu,Dimensions as Ze,Easing as Ju,I18nManager as Yu,Keyboard as Xu,InteractionManager as Qu,LayoutAnimation as Zu,Linking as ed,NativeEventEmitter as td,PanResponder as nd,PixelRatio as Wr,Platform as Ha,Share as rd,StyleSheet as ve,UIManager as Xt,Vibration as od,CheckBox as id,FlatList as Aa,Image as ad,ImageBackground as ld,KeyboardAvoidingView as sd,Picker as cd,ProgressBar as ud,RefreshControl as dd,SafeAreaView as gd,SectionList as hd,StatusBar as pd,Touchable as md,TouchableNativeFeedback as fd,VirtualizedList as yd,YellowBox as bd,LogBox as vd,DeviceEventEmitter as Cd,useColorScheme as Td,useLocaleContext as wd,useWindowDimensions as Sd}from"react-native-web";import*as Ce from"react-native-web";import{createElement as Ur,forwardRef as Ea,useCallback as xd,useRef as Id}from"react";U();import{useEffect as Rd,useState as Dd}from"react";import{createPortal as kd}from"react-dom";U();var Pd='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Nd}from"react/jsx-runtime";var Qt=Symbol.for("@buoy-gg/portal-host"),Fa=l(e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"},"isTextField");function jr(){let e=document;if(e[Qt])return e[Qt].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Pd});let n=l(()=>{let d=document.fullscreenElement,g=d&&d.tagName!=="CANVAS"?d:document.body;t.parentElement!==g&&g.appendChild(t)},"move"),r=new Map,o=l(d=>{(!t.contains(d.target)||!Fa(d.target))&&r.set(d.code||d.key,{key:d.key,code:d.code,location:d.location,keyCode:d.keyCode,which:d.which,altKey:d.altKey,ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey})},"down"),i=l(d=>{r.delete(d.code||d.key)},"up"),s=l(()=>r.clear(),"clear"),a=l(()=>{let d=[...r.values()];r.clear();for(let g of d)document.dispatchEvent(new KeyboardEvent("keyup",{...g,bubbles:true}))},"focus"),u=l(d=>{Fa(d.target)&&d.stopPropagation()},"key"),c=l(d=>d.stopPropagation(),"wheel");return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",o,true),document.addEventListener("keyup",i,true),window.addEventListener("blur",s),t.addEventListener("focusin",a),t.addEventListener("keydown",u),t.addEventListener("keyup",u),t.addEventListener("keypress",u),t.addEventListener("wheel",c,{passive:true}),e[Qt]={host:t,users:0,dispose:l(()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",o,true),document.removeEventListener("keyup",i,true),window.removeEventListener("blur",s),t.remove(),delete e[Qt]},"dispose")},t}l(jr,"getBuoyPortalHost");function Ma({children:e}){let[t,n]=Dd(null);return Rd(()=>{let r=jr(),o=document[Qt];return o.users++,n(r),()=>{--o.users===0&&o.dispose()}},[]),t?kd(Nd("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}l(Ma,"BuoyPortal");function Te(e){let t=Ea((r,o)=>{let{accessibilityState:i,accessibilityValue:s,...a}=r;for(let u of["busy","checked","disabled","expanded","selected"])i?.[u]!==void 0&&a[`aria-${u}`]===void 0&&(a[`aria-${u}`]=i[u]);for(let[u,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[u]!==void 0&&a[`aria-${c}`]===void 0&&(a[`aria-${c}`]=s[u]);return Ur(e,{...a,ref:o})}),n=e.State;return n&&Object.assign(t,{State:n}),t.displayName=e.displayName??e.name??"NativeWebView",t}l(Te,"withAccessibility");var h=Te(Ce.View),p=Te(Ce.Text),wn=Te(Ce.TextInput),Y=Te(Ce.TouchableOpacity),zd=Te(Ce.TouchableHighlight),Ld=Te(Ce.TouchableWithoutFeedback),$a=Te(Ce.Pressable),Me=Te(Ce.ScrollView),Oa=Ea((e,t)=>{let n=Id(null),r=xd(o=>{if(o){let i=o;for(;i.parentElement&&i.parentElement!==document.body;)i=i.parentElement;i.parentElement===document.body&&(n.current=i,Object.assign(i.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),jr().appendChild(i))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof t=="function"?t(o):t&&(t.current=o)},[t]);return Ur(Ma,null,Ur(Ce.Modal,{...e,ref:r}))});Oa.displayName="Modal";var _a=Te(Oa),Rt=Te(Ce.Switch),Bd=Te(Ce.ActivityIndicator),Vd=Te(Ce.Button),Dt=Ce.findNodeHandle,Hd={alert(e,t,n,r){if(typeof document>"u")return;let o=document.createElement("dialog");o.dataset.buoyRoot="",o.setAttribute("aria-label",e),o.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",o.appendChild(i),t){let c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",o.appendChild(c)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let a=n?.length?n:[{text:"OK"}],u=l(()=>{o.close?.(),o.remove()},"close");for(let c of a){let d=document.createElement("button");d.type="button",d.textContent=c.text??"OK",d.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,d.onclick=()=>{u(),c.onPress?.()},s.appendChild(d)}o.addEventListener("cancel",c=>{c.preventDefault(),r?.cancelable!==false&&(u(),r?.onDismiss?.())}),o.appendChild(s),document.body.appendChild(o),o.showModal?o.showModal():o.setAttribute("open","")}};Ve();U();import{getDOMControlProps as Ad,getDOMNodeHandle as Ed,getDOMPublicInstance as Fd,isDOMElement as Md}from"@buoy-gg/shared-ui/web/utils";U();function Gr(e){return e?e.x>=-.1&&e.x<=1.1&&e.y>=-.1&&e.y<=1.1:false}l(Gr,"isOnScreenTap");function Sn(e,t,n){if(!e||t<=0||n<=0)return false;let r=e.x+e.width/2,o=e.y+e.height/2,i=t*.1,s=n*.1;return r>=-i&&r<=t+i&&o>=-s&&o<=n+s}l(Sn,"isRectCenterOnScreen");function Kr(e){return String(e??"").toLowerCase().replace(/\s+/g," ").replace(/(\d)[,\u00a0\u202f](?=\d{3}\b)/g,"$1").trim()}l(Kr,"looseText");function Zt(e,t){if(t.nativeTag!=null&&e.nativeTag===t.nativeTag)return 1e3;if(t.testID&&!t.query){if(!e.testID||e.testID.toLowerCase()!==t.testID.trim().toLowerCase())return 0;let s=200;return e.tap&&(s+=Gr(e.tap)?20:-40),s}let n=String(t.query??t.testID??"").trim().toLowerCase();if(!n)return 0;let r=[e.testID,e.label,e.text,e.name].filter(Boolean).map(s=>s.toLowerCase()),o=0;for(let s of r)s===n?o=Math.max(o,100):s.startsWith(n)?o=Math.max(o,50):s.includes(n)&&(o=Math.max(o,25));let i=Kr(n);if(i)for(let s of r){let a=Kr(s);a===i?o=Math.max(o,90):a.startsWith(i)?o=Math.max(o,45):a.includes(i)&&(o=Math.max(o,22))}return t.testID&&e.testID&&e.testID.toLowerCase()===t.testID.toLowerCase()&&(o=Math.max(o,200)),o===0?0:((e.testID??"").toLowerCase().startsWith("buoy-dial-")&&(o+=40),e.tap&&(Gr(e.tap)?o+=20:o-=40),o)}l(Zt,"scoreTapMatch");var xn=5,$d=22,qr=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function Jr(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}l(Jr,"getReactDevToolsHook");var Yr=0,Wa=false;function Ua(){if(Wa)return;let e=Jr();if(!e)return;let t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){return Yr++,typeof t=="function"?t.apply(e,n):void 0},Wa=true}l(Ua,"ensureCommitCounter");var Od=250;function Xr(){let e=new Map;return t=>{let n=[],r=t,o=0,i=false;for(;r&&o<400;){let s=e.get(r);if(s!==void 0){i=s;break}if(le(r)?.__buoyDevToolsRoot){i=true,e.set(r,true);break}n.push(r),r=r.return,o++}for(let s of n)e.set(s,i);return i}}l(Xr,"makeChromeCheck");function $e(){let e=Jr();if(!e)return[];let t=[];try{if(e.renderers&&typeof e.renderers.forEach=="function"&&e.renderers.forEach((n,r)=>{try{let o=e.getFiberRoots?.(r);o&&o.forEach(i=>t.push(i))}catch{}}),t.length===0&&e.getFiberRoots){let n=e.getFiberRoots(1);n&&n.forEach(r=>t.push(r))}}catch{}return t}l($e,"getAllFiberRoots");function Qr(e){return e.tag===$d&&e.memoizedState!==null}l(Qr,"isHiddenOffscreen");var et=false,Zr=0,In=false;function eo(e,t){let n=et;et=e;try{return t()}finally{et=n}}l(eo,"withHiddenScreens");function ja(e){let t=e.memoizedProps;return t?t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t)||t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t):false}l(ja,"isNotShowingScreen");function to(e){let t=e.memoizedProps?.activityState;return t===0||t===1||e.memoizedProps?.isPageFocused===false?true:!et&&ja(e)?(Zr++,true):false}l(to,"isInactiveScreen");function He(e,t,n=0,r=new Set){if(!(!e||r.has(e)||n>500)){if(r.add(e),Qr(e)||to(e)){e.sibling&&He(e.sibling,t,n,r);return}t(e),e.child&&He(e.child,t,n+1,r),e.sibling&&He(e.sibling,t,n,r)}}l(He,"traverseFiberTree");function Rn(e){let t=Fd(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"||typeof n.measureInWindow=="function"?n:null}l(Rn,"getPublicInstance");function tt(e){let t=Ed(e);if(t!==null)return t;if(e==null)return null;let n=e;if(typeof n.__nativeTag=="number")return n.__nativeTag;if(typeof n._nativeTag=="number")return n._nativeTag;if(typeof n.nativeTag=="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag=="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag=="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag=="number")return n.canonical.nativeTag}return null}l(tt,"getNativeTag");function Dn(e){let t=Rn(e.stateNode);if(t)return{instance:t,nativeTag:tt(e.stateNode),stateNode:e.stateNode};let n=[];e.child&&n.push(e.child);let r=0;for(;n.length>0&&r<4e3;){r++;let o=n.pop();if(!o)continue;let i=Rn(o.stateNode);if(i)return{instance:i,nativeTag:tt(o.stateNode),stateNode:o.stateNode};o.child&&n.push(o.child),o.sibling&&n.push(o.sibling)}return null}l(Dn,"findHostInstance");function Ga(e){let t=e,n=0;for(;t&&n++<200;){let r=t.stateNode;if(r&&typeof r.scrollTo=="function"){let o=typeof r.getNativeScrollRef=="function"&&r.getNativeScrollRef()||null,i=typeof r.getInnerViewNode=="function"&&r.getInnerViewNode()||typeof r.getScrollableNode=="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:o,innerNode:i}}t=t.return}return null}l(Ga,"findScrollAncestor");async function Ka(e,t,n,r){try{if(Md(n))return n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}),await new Promise(u=>setTimeout(u,16)),true;let o=Ga(e);if(!o)return false;let i=t,s=null,a=l(u=>new Promise(c=>{let d=false,g=l(b=>{d||(d=true,c(b))},"settle"),T=setTimeout(()=>g(null),600);try{u(b=>{clearTimeout(T),g(b)})}catch{clearTimeout(T),g(null)}}),"withTimeout");if(o.nativeRef&&typeof i.measureLayout=="function"&&(s=await a(u=>i.measureLayout(o.nativeRef,(c,d)=>u(d),()=>u(null)))),s==null){let u=Dt(t),c=typeof o.innerNode=="number"?o.innerNode:Dt(o.innerNode);u!=null&&c!=null&&(s=await a(d=>Xt.measureLayout(u,c,()=>d(null),(g,T)=>d(T))))}return s==null?false:(o.instance.scrollTo({y:Math.max(0,s-r),animated:false}),await new Promise(u=>setTimeout(u,120)),true)}catch{return false}}l(Ka,"scrollIntoView");function Oe(e){let t=e?.type;return t?typeof t=="string"?t:t.displayName||t.name||null:null}l(Oe,"getComponentName");function kn(e){let t=e?._debugOwner||e?.return,n=0;for(;t&&n<30;){n++;let r=Oe(t);if(r&&!qr.has(r)&&typeof t.type!="string")return r;t=t.return}return null}l(kn,"getOwningComponentName");function le(e){return Ad(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}l(le,"getProps");function no(e,t=0){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){let n=[];for(let r of e){let o=no(r,t+1);o&&n.push(o)}return n.length>0?n.join(""):void 0}}l(no,"flattenText");function qa(e){return e.replace(/\s+/g," ").trim()}l(qa,"normalizeVisibleText");function Pn(e){if(!e)return;let t=l(n=>{let r=no(n);if(r===void 0)return;let o=qa(r);return o?In?o:o.slice(0,80):void 0},"pick");return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}l(Pn,"getVisibleText");function Ja(e,t){let n=[],r=l((i,s)=>{if(!i||s>t||n.length>=4)return;if(i!==e){let u=le(i);if(u&&(typeof u.onPress=="function"||typeof u.onLongPress=="function"))return}let a=Pn(le(i));a&&!n.includes(a)&&n.push(a),i.child&&r(i.child,s+1),i!==e&&i.sibling&&r(i.sibling,s)},"visit");e.child&&r(e.child,1);let o=n.join(" ").trim();return o?o.slice(0,80):void 0}l(Ja,"collectDescendantText");function Ya(e){let t=e,n=0,r=null,o=null;for(;t&&n<25&&!(r&&o);){let i=le(t);i&&(!r&&typeof i.onPress=="function"&&(r=i.onPress),!o&&typeof i.onLongPress=="function"&&(o=i.onLongPress)),t=t.return,n++}return r?{handler:r,kind:"onPress",longPress:o??void 0}:o?{handler:o,kind:"onLongPress"}:null}l(Ya,"findPressHandler");function _e(e){return new Promise(t=>{let n=false,r=l(o=>{n||(n=true,t(o))},"done");setTimeout(()=>r(null),1e3);try{typeof e.measureInWindow=="function"?e.measureInWindow((o,i,s,a)=>{s>0&&a>0?r({x:o,y:i,width:s,height:a}):r(null)}):typeof e.measure=="function"?e.measure((o,i,s,a,u,c)=>{s>0&&a>0&&u!=null&&c!=null?r({x:u,y:c,width:s,height:a}):r(null)}):r(null)}catch{r(null)}})}l(_e,"measureInstance");var _d=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function Nn(){let e=$e();if(e.length===0)return[];let t=[],n=new Map,r=new Map,o=Xr();for(let i of e)He(i.current,s=>{let a=le(s);if(!a)return;let u=typeof a.onPress=="function"||typeof a.onLongPress=="function",c=typeof a.onValueChange=="function",d=typeof a.onChangeText=="function",g=a.testID||void 0,T=a.accessibilityLabel||void 0,b=a.accessibilityRole||a.role||void 0,v=Pn(a),f=b==="button"||b==="link"||b==="menuitem"||b==="tab"||b==="switch"||b==="checkbox",S=typeof s.type=="string"&&_d.has(s.type)&&a.animating!==false;if(!u&&!c&&!d&&!g&&!T&&!v&&!f&&!S)return;let C=null,N=null,m=null;if(c){let x=a.value,L=typeof x=="number"||typeof a.minimumValue=="number";N={handler:a.onValueChange,kind:L?"slider":"toggle",current:x,min:typeof a.minimumValue=="number"?a.minimumValue:void 0,max:typeof a.maximumValue=="number"?a.maximumValue:void 0}}else d?m={handler:a.onChangeText,current:typeof a.value=="string"?a.value:void 0}:C=Ya(s);let k=Oe(s),P=k??"Unknown";(!k||qr.has(k)||typeof s.type=="string")&&(P=kn(s)??k??"Unknown");let D=Dn(s);if(!D&&!g)return;!v&&!T&&u&&(v=Ja(s,6));let W=D?.instance??null,Z=D?.nativeTag??null,V=(W?n.get(W):void 0)??(Z!=null?r.get(Z):void 0);if(V){!V.press&&C?V.press=C:V.press&&C?.longPress&&!V.press.longPress&&(V.press.longPress=C.longPress),!V.valueControl&&N&&(V.valueControl=N),!V.textControl&&m&&(V.textControl=m),!V.testID&&g&&(V.testID=g),!V.label&&T&&(V.label=T),!V.text&&v&&(V.text=v),W&&!n.has(W)&&n.set(W,V),Z!=null&&!r.has(Z)&&r.set(Z,V);return}let j={nativeTag:Z,name:P,role:b??(S?"progressbar":void 0),testID:g,label:T,text:v,instance:W,stateNode:D?.stateNode??null,fiber:s,press:C,valueControl:N,textControl:m,rect:null,buoy:o(s)};t.push(j),W&&n.set(W,j),Z!=null&&r.set(Z,j)});return t}l(Nn,"collectCandidates");function Xa(e,t){return t.nativeTag!=null?e.nativeTag===t.nativeTag:t.testID&&e.testID?e.testID.toLowerCase()===t.testID.toLowerCase():false}l(Xa,"explicitlyTargets");function zn(e){let t=Nn();return e.includeBuoy?t:t.filter(n=>!n.buoy||Xa(n,e))}l(zn,"appCandidates");async function ro(e){await Promise.all(e.map(async t=>{t.instance&&(t.rect=await _e(t.instance))}))}l(ro,"measureCandidates");var Wd=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function Qa(e,t){let n=[],r=Xr();for(let i of $e())He(i.current,s=>{if(Oe(s)!=="VirtualizedList")return;let a=s.memoizedProps;if(!a||typeof a.getItemCount!="function"||!e&&r(s))return;let u;try{u=Number(a.getItemCount(a.data))}catch{return}if(!Number.isFinite(u)||u<=0)return;let c=[],d=l((b,v)=>{for(let f=b?.child;f;f=f.sibling){let S=Oe(f);if(S!=="VirtualizedList"){if(S==="CellRenderer"){c.push(f);continue}v<40&&d(f,v+1)}}},"walk");d(s,0);let g=s,T=kn(g);for(let b=0;b<6&&T&&Wd.test(T);b++)g=g._debugOwner||g.return,T=kn(g);n.push({owner:T,items:u,cells:c})});let o=[];for(let i of n){let s=(await Promise.all(i.cells.map(async a=>{let u=Dn(a);return u?_e(u.instance):null}))).filter(t).length;s>0&&i.items>s&&o.push({owner:i.owner,items:i.items,listed:s})}return o}l(Qa,"collectLists");async function Ln(e={}){let t=et,n=In;et=!!e.includeHidden,In=!!e.fullText;try{return await Za(e)}finally{et=t,In=n}}l(Ln,"describeScreen");async function Za(e){Zr=0;let t=Nn(),n=Zr,r=e.includeBuoy?t:t.filter(d=>!d.buoy),o=t.length-r.length;await ro(r);let i=Ze.get("window"),s=Math.round(i.width)||1,a=Math.round(i.height)||1,u=[];for(let d of r){let g=d.rect;if(!g&&!d.testID)continue;let T,b;if(g){let S=g.x+g.width/2,C=g.y+g.height/2;if(C<-a*.1||C>a*1.1||S<-s*.1||S>s*1.1)continue;T={x:ke(S/s),y:ke(C/a)},b={x:ke(g.x/s),y:ke(g.y/a),width:ke(g.width/s),height:ke(g.height/a)}}let v=d.valueControl?d.valueControl.kind:d.textControl?"text":void 0,f=d.valueControl?d.valueControl.current:d.textControl?.current;u.push({nativeTag:d.nativeTag,name:d.name,role:d.role,testID:d.testID,label:d.label,text:d.text,interactive:!!(d.press||d.valueControl||d.textControl),longPressable:d.press&&(d.press.kind==="onLongPress"||d.press.longPress)?true:void 0,control:v,value:f,tap:T,frame:b})}u.sort((d,g)=>{let T=d.tap?.y??2,b=g.tap?.y??2;return Math.abs(T-b)>.02?T-b:(d.tap?.x??2)-(g.tap?.x??2)});let c=await Qa(!!e.includeBuoy,d=>{if(!d)return false;let g=d.x+d.width/2;return d.y<=a*1.1&&d.y+d.height>=-a*.1&&g>=-s*.1&&g<=s*1.1});return{screen:{width:s,height:a},count:u.length,elements:u,...o>0?{hiddenBuoy:o}:{},...n>0?{hiddenScreens:n}:{},...c.length?{lists:c}:{}}}l(Za,"describeScreenInner");function ke(e){return Math.round(e*100)/100}l(ke,"round2");function oo(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}l(oo,"fieldsOf");function Bn(e,t){return Zt(oo(e),t)}l(Bn,"matchScore");function io(e,t,n){if(!(!e||!t||!n))return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}l(io,"tapPoint");function ao(e){let t=e?e.x+e.width/2:0,n=e?e.y+e.height/2:0;return{nativeEvent:{locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]},persist:l(()=>{},"persist"),preventDefault:l(()=>{},"preventDefault"),stopPropagation:l(()=>{},"stopPropagation"),isDefaultPrevented:l(()=>false,"isDefaultPrevented"),isPropagationStopped:l(()=>false,"isPropagationStopped"),target:null,currentTarget:null,type:"press",timeStamp:0}}l(ao,"makeSyntheticPressEvent");async function el(e){let t=eo(!!e.includeHidden,()=>zn(e));if(t.length===0)return{tapped:false,reason:"No React fiber roots / elements found on screen."};let n=t.map(m=>({c:m,score:Bn(m,e)})).filter(m=>m.score>0).sort((m,k)=>k.score-m.score),r=l(m=>!!(m.press||m.valueControl||m.textControl),"isInteractive");if(n.length===0&&!e.includeHidden&&eo(true,()=>zn(e)).map(m=>({c:m,score:Bn(m,e)})).filter(m=>m.score>0).length>0)return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."};if(n.length===0)return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(r).slice(0,12).map(m=>({nativeTag:m.nativeTag,name:m.name,testID:m.testID,text:m.text}))};let o=Ze.get("window"),i=o.width||1,s=o.height||1,a=n.slice(0,15);await Promise.all(a.map(async m=>{m.c.instance&&!m.c.rect&&(m.c.rect=await _e(m.c.instance))}));for(let m of a)m.score=Zt({...oo(m.c),tap:io(m.c.rect,i,s)},e);a.sort((m,k)=>k.score-m.score);let u=a.find(m=>r(m.c))??n.find(m=>r(m.c))??a[0],c=u.c,d=l((m,k)=>m.press&&m.press.handler===k.press?.handler||m.valueControl&&m.valueControl.handler===k.valueControl?.handler||m.textControl&&m.textControl.handler===k.textControl?.handler,"sameControl"),g=a.filter(m=>m!==u&&r(m.c)&&m.score===u.score).filter(m=>!d(m.c,c)).filter((m,k,P)=>P.findIndex(D=>d(D.c,m.c))===k).slice(0,3).map(m=>({nativeTag:m.c.nativeTag,name:m.c.name,testID:m.c.testID,text:m.c.text,tap:io(m.c.rect,i,s)})),T=e.nativeTag==null&&!(e.testID&&!e.query);if(T&&g.length>0){let m=[c,...g.map(k=>a.find(P=>P.c.nativeTag===k.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${m.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:m.map(k=>({nativeTag:k.nativeTag,name:k.name,testID:k.testID,text:k.text}))}}let b=a[0];if(T&&b&&b!==u&&!r(b.c)&&b.score>=90&&u.score<b.score-40)return{tapped:false,reason:`The best match for "${e.query}" is "${b.c.text??b.c.label??b.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${c.text??c.label??c.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:c.nativeTag,name:c.name,testID:c.testID,text:c.text}]};if(!r(c))return{tapped:false,reason:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text,via:"onPress"}};c.instance&&!c.rect&&(c.rect=await _e(c.instance));let v=false;(c.rect==null||!Sn(c.rect,i,s))&&e.scrollIntoView!==false&&c.instance&&(v=await Ka(c.fiber,c.instance,c.stateNode,80),v&&(c.rect=await _e(c.instance)));let f={nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text};Ua();let S=Yr,C=Date.now(),N=l(async m=>(await new Promise(k=>setTimeout(k,Od)),{tapped:true,scrolled:v,matched:m,effect:{commits:Yr-S,observedMs:Date.now()-C},...g.length?{alsoMatched:g}:{}}),"fired");try{if(c.press){if(e.longPress){let k=c.press.kind==="onLongPress"?c.press.handler:c.press.longPress;return k?(k(ao(c.rect)),await N({...f,via:"onLongPress"})):{tapped:false,scrolled:v,reason:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...f,via:"onPress"}}}return c.press.handler(ao(c.rect)),await N({...f,via:c.press.kind})}if(c.valueControl){let k=c.valueControl,P;if(k.kind==="toggle")P=typeof e.value=="boolean"?e.value:!k.current;else{let D=k.min??0,W=k.max??1;typeof e.value=="number"?P=Math.min(W,Math.max(D,e.value)):P=k.current===W?D:W}return k.handler(P),await N({...f,via:"onValueChange",value:P})}let m=e.text??(typeof e.value=="string"?e.value:"");return c.textControl.handler(m),await N({...f,via:"onChangeText",value:m})}catch(m){return{tapped:false,scrolled:v,reason:`handler threw: ${m instanceof Error?m.message:String(m)}`,matched:{...f,via:c.press?c.press.kind:c.valueControl?"onValueChange":"onChangeText"}}}}l(el,"tapElement");var Ud=5e3,jd=3e4,Gd=50,Kd=150;async function tl(e){if(!(e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim()))return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."};let t=Math.min(Math.max(e.timeoutMs??Ud,0),jd),n=Math.max(e.pollMs??Kd,Gd),r=e.gone===true,o=Date.now(),i=0;for(;;){i+=1;let{hit:s,closest:a}=await nl(e);if(r?!s:s)return{ok:true,waitedMs:Date.now()-o,polls:i,matched:s??void 0};if(Date.now()-o>=t){let u=a?.length?a:void 0,c=r?`Still on screen after ${t}ms.`:u?`Not on screen after ${t}ms \u2014 ${u.length===1?"one element":`${u.length} elements`} matched but ${u.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${t}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-o,polls:i,reason:c,matched:s??void 0,closest:u}}await new Promise(u=>setTimeout(u,n))}}l(tl,"waitFor");async function nl(e){let t=zn(e).map(a=>({c:a,score:Bn(a,e)})).filter(a=>a.score>0).sort((a,u)=>u.score-a.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await ro(t.map(a=>a.c));let n=Ze.get("window"),r=Math.round(n.width)||1,o=Math.round(n.height)||1,i=null;for(let{c:a}of t)if(Sn(a.rect,r,o)){i={nativeTag:a.nativeTag,name:a.name,testID:a.testID,label:a.label,text:a.text,interactive:!!(a.press||a.valueControl||a.textControl)};break}let s=t.slice(0,3).map(({c:a})=>({name:a.name,testID:a.testID,text:a.text,onScreen:Sn(a.rect,r,o)}));return{hit:i,closest:s}}l(nl,"findOnScreen");function Vn(e){let t=e,n=0;for(;t&&n<400;){if(le(t)?.__buoyDevToolsRoot)return true;t=t.return,n++}return false}l(Vn,"isBuoyChrome");function rl(e,t){let n=le(e.fiber);if(typeof n?.onPress=="function"||typeof n?.onValueChange=="function"||typeof n?.onChangeText=="function")return e;let r=null,o=e.fiber?.return,i=0;for(;o&&i<25;){if(typeof le(o)?.onPress=="function"){r=o;break}o=o.return,i++}if(!r)return e;let s=r;for(let a=0;a<6&&s;a++){let u=t.get(s);if(u)return u;s=s.return}return e}l(rl,"preferHandlerOwner");function Hn(e){let t=Nn();if(t.length===0)return null;let n=new Map;for(let a of t)n.set(a.fiber,a);let r=t.find(a=>a.nativeTag===e),o=null;if(!r){for(let a of $e())if(He(a.current,u=>{o||u.stateNode&&tt(u.stateNode)===e&&(o=u)}),o)break}let i=r??null;if(!i&&o){let a=o,u=0,c=null;for(;a&&u<25;){let d=n.get(a);if(d){if(d.press||d.valueControl||d.textControl){i=d;break}c||(c=d)}a=a.return,u++}i||(i=c)}if(!i||(i=rl(i,n),!i.press&&!i.valueControl&&!i.textControl)||Vn(i.fiber))return null;let s=i.valueControl?i.valueControl.kind:i.textControl?"text":"press";return{nativeTag:i.nativeTag,name:i.name,role:i.role,testID:i.testID,label:i.label,text:i.text,control:s,value:i.valueControl?i.valueControl.current:i.textControl?i.textControl.current:void 0}}l(Hn,"resolveTouchTarget");function ol(e){let t=null;for(let n of $e())if(He(n.current,r=>{!t&&r.stateNode&&tt(r.stateNode)===e&&(t=r)}),t)break;return t}l(ol,"fiberForTag");function lo(){let e=[];for(let t of $e()){let n=t.current?.child,r=0;for(;n&&r++<200;){if(n.tag===xn&&n.stateNode){e.push(n);break}n=n.child}}return e}l(lo,"rootHostFibers");function il(e,t){let n=globalThis.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!="function")return null;let r=lo().filter(o=>o.stateNode?.node);return r.length?new Promise(o=>{let i=setTimeout(()=>o(null),1e3),s=r.length,a=null;r.forEach((u,c)=>{try{n.findNodeAtPoint(u.stateNode.node,e,t,d=>{d&&(!a||c>=a.i)&&(a={i:c,fiber:d}),--s===0&&(clearTimeout(i),o(a?.fiber??null))})}catch{--s===0&&(clearTimeout(i),o(a?.fiber??null))}})}):null}l(il,"fabricFiberAt");function al(e,t){let n=Xt?.findSubviewIn;if(typeof n!="function")return null;let r=lo()[0],o=r?tt(r.stateNode)??Dt(r.stateNode):null;return o==null?null:new Promise(i=>{let s=setTimeout(()=>i(null),1e3);try{n.call(Xt,o,[e,t],a=>{clearTimeout(s),i(typeof a=="number"?ol(a):null)})}catch{clearTimeout(s),i(null)}})}l(al,"paperFiberAt");function ll(){let e=[],t=new Set,n=l(o=>{let i=[],s=l((a,u)=>{for(let c=a;c&&i.length<5e3;c=c.sibling)t.has(c)||u>500||Qr(c)||to(c)||(c.tag===xn&&c.stateNode?i.push(c):c.child&&s(c.child,u+1))},"dig");return o.child&&s(o.child,0),i},"hostChildren"),r=l((o,i)=>{t.has(o)||i>500||(t.add(o),e.push(o),so(n(o)).forEach(s=>r(s,i+1)))},"walk");for(let o of $e())so(n(o.current)).forEach(i=>r(i,0));return e}l(ll,"visibleHostFibers");function so(e){let t=e.map(n=>{let r=Number(An(le(n)?.style).zIndex);return Number.isFinite(r)?r:0});return e.map((n,r)=>({h:n,i:r})).sort((n,r)=>t[n.i]-t[r.i]||n.i-r.i).map(({h:n})=>n)}l(so,"sortByZ");function An(e,t=0){return!e||typeof e!="object"||t>10?{}:Array.isArray(e)?Object.assign({},...e.map(n=>An(n,t+1))):e}l(An,"flatStyle");var qd=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function sl(e){if(typeof e.type=="string"&&qd.has(e.type)&&e.type!=="RCTScrollContentView")return true;let t=An(le(e)?.style).overflow;return t==="hidden"||t==="scroll"}l(sl,"clipsChildren");function cl(e){let t=le(e)?.pointerEvents??le(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return,r=0;for(;n&&r++<200;){let o=le(n)?.pointerEvents??le(n)?.style?.pointerEvents;if(o==="none"||o==="box-only"&&n.tag===xn)return"all";n=n.return}return t==="box-none"?"self":null}l(cl,"passesTouchesThrough");async function ul(e,t,n){let r=await Promise.all(n.map(a=>{let u=Rn(a.stateNode);return u?_e(u):Promise.resolve(null)})),o=new Map;n.forEach((a,u)=>o.set(a,r[u]));let i=l(a=>!!a&&e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height,"inside"),s=l(a=>{for(let u=a.return,c=0;u&&c<300;u=u.return,c++)if(u.tag===xn&&o.has(u)&&sl(u)&&!i(o.get(u)))return true;return false},"clippedAway");for(let a=n.length-1;a>=0;a--)if(!(!i(r[a])||cl(n[a])||s(n[a])))return n[a];return null}l(ul,"measuredFiberAt");function dl(e,t){let n=globalThis.document,r=globalThis.window;if(!n?.elementFromPoint||!r)return null;let o=n.elementFromPoint(e*r.innerWidth,t*r.innerHeight);for(;o;){let i=Object.keys(o).find(s=>s.startsWith("__reactFiber$"));if(i)return o[i];o=o.parentElement}return null}l(dl,"domFiberAt");async function gl(e){let t=Math.min(1,Math.max(0,Number(e?.x))),n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};let r=Ze.get("window"),o=t*r.width,i=n*r.height,s="none",a=null,u=dl(t,n);if(u)s="dom",a=u;else{let v=il(o,i);if(v)s="fabric",a=await v;else{let S=al(o,i);S&&(s="paper",a=await S)}let f=ll();(!a||!new Set(f).has(a))&&(a=await ul(o,i,f),s="measured")}if(!a)return{found:false,method:s};let c=le(a)??{},d=tt(a.stateNode),g=[],T=a,b=0;for(;T&&b++<80&&g.length<6;){let v=Oe(T);v&&typeof T.type!="string"&&!qr.has(v)&&g[g.length-1]!==v&&g.push(v),T=T.return}return{found:true,method:s,buoy:Vn(a),view:{name:Oe(a)??"Unknown",nativeTag:d,testID:c.testID||void 0,label:c.accessibilityLabel||c["aria-label"]||void 0,text:Pn(c)},path:g,target:d!=null?Hn(d):null}}l(gl,"hitTest");async function hl(){let e=[];for(let r of $e())He(r.current,o=>{let i=o.stateNode;o.tag===1&&i&&typeof i.getCamera=="function"&&!Vn(o)&&e.push(o)});let t=Ze.get("window"),n=l(r=>Promise.race([r,new Promise(o=>setTimeout(()=>o(null),1e3))]),"timeout");return{maps:(await Promise.all(e.slice(0,5).map(async r=>{try{let o=await n(Promise.resolve(r.stateNode.getCamera()));if(!o)return null;let i=Dn(r),s=i?await _e(i.instance):null,a=le(r)??{};return{name:Oe(r)??"Map",testID:typeof a.testID=="string"?a.testID:void 0,frame:s&&t.width&&t.height?{x:ke(s.x/t.width),y:ke(s.y/t.height),width:ke(s.width/t.width),height:ke(s.height/t.height)}:void 0,camera:{heading:typeof o.heading=="number"?o.heading:void 0,pitch:typeof o.pitch=="number"?o.pitch:void 0,altitude:typeof o.altitude=="number"?o.altitude:void 0,zoom:typeof o.zoom=="number"?o.zoom:void 0,center:o.center}}}catch{return null}}))).filter(r=>!!r)}}l(hl,"readMaps");Cn();U();U();function pl(e){return!!e&&typeof e=="object"&&("next"in e||"queue"in e||"memoizedState"in e)}l(pl,"isHookList");function co(e,t,n){if(e===t)return false;if(n?.isClassComponent||!pl(t))return true;let r=e,o=t;for(let i=0;o!=null&&i<64;i++){if(o.queue!=null&&(r==null||!Object.is(r.memoizedState,o.memoizedState)))return true;o=o.next,r=r!=null?r.next:null}return false}l(co,"hookStateChanged");function ml(e,t){return co(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===1})}l(ml,"ownStateChanged");var fl={RCTText:{alwaysTrack:["children"],skip:[],description:"Text component - children is the displayed content"},RCTVirtualText:{alwaysTrack:["children"],skip:[],description:"Virtual Text (nested) - children is the displayed content"},RCTView:{alwaysTrack:[],skip:["children"],description:"View container - children are React elements"},RCTImageView:{alwaysTrack:["source"],skip:["children"],description:"Image - source contains the image URL/require"},RCTTextInput:{alwaysTrack:["value","defaultValue"],skip:["children"],description:"TextInput - value is the input content"},RCTSwitch:{alwaysTrack:["value"],skip:["children"],description:"Switch - value is the toggle state"},default:{alwaysTrack:[],skip:["children"],description:"Unknown component type"}};function yl(e){return e&&fl[e]||fl.default}l(yl,"getComponentPropConfig");var En=new WeakMap;function Fn(e){if(!e)return;let t=En.get(e);if(t||e.alternate&&(t=En.get(e.alternate),t))return t}l(Fn,"getComponentFiberPrevState");function bl(e,t){e&&(En.set(e,t),e.alternate&&En.set(e.alternate,t))}l(bl,"setComponentFiberState");var Ie=new Map,uo=500,Jd=10,go=50,vl=50,Yd=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","Fragment","Suspense","Provider","Consumer","Context","ForwardRef","Unknown","Component"]);function ho(e){return!!(!e||Yd.has(e)||e.startsWith("Animated"))}l(ho,"isInternalComponentName");function po(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,r=null;for(;t&&n<30;){let o=t.tag;if(o===0||o===1||o===11||o===15){let i=Ae(t);if(r||(r=t),!ho(i))return t}t=t.return,n++}return r}l(po,"getOwningComponentFiber");function Ae(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.displayName)return t.displayName;if(t.name)return t.name}return null}l(Ae,"getComponentNameFromFiber");function Cl(e){if(!e||typeof e!="object")return"unknown";if(e.queue!==null&&e.queue!==void 0)return"useState";let t=e.memoizedState;if(t!==null&&typeof t=="object"&&!Array.isArray(t)&&"current"in t&&Object.keys(t).length===1)return"useRef";if(Array.isArray(t)&&t.length===2){let[,n]=t;if(Array.isArray(n)||n===null)return typeof t[0]=="function"?"useCallback":"useMemo"}return t!==null&&typeof t=="object"&&!Array.isArray(t)&&("tag"in t||"create"in t||"destroy"in t)?"useEffect":"unknown"}l(Cl,"detectHookType");function Tl(e,t){let n=e?.memoizedState;switch(t){case"useState":case"useReducer":return n;case"useRef":return n?.current;case"useMemo":case"useCallback":return Array.isArray(n)?n[0]:n;case"useEffect":return"[effect]";default:return n}}l(Tl,"extractHookValue");function nt(e){if(!e?.memoizedState)return null;let t=e.memoizedState;if(typeof t!="object"||t===null||!("next"in t)&&!("queue"in t)&&!("memoizedState"in t))return null;let n=[],r=t,o=0;for(;r!==null&&o<go;){let i=Cl(r),s=Tl(r,i);n.push({index:o,type:i,value:s,rawState:r.memoizedState}),r=r.next,o++}return n.length>0?n:null}l(nt,"extractHookStates");function wl(e,t){if(!e||!t)return null;let n=[],r=Math.max(e.length,t.length);for(let o=0;o<r;o++){let i=e[o],s=t[o];if(!i&&s){n.push({index:o,type:s.type,currentValue:en(s.value,s.type),description:`Hook[${o}] added`});continue}if(i&&!s){n.push({index:o,type:i.type,previousValue:en(i.value,i.type),description:`Hook[${o}] removed`});continue}if(i&&s){if(i.rawState===s.rawState||s.type==="useEffect"||s.type==="useMemo"||s.type==="useCallback")continue;if(s.type==="useState"||s.type==="useReducer"||s.type==="useRef"){let a=en(i.value,i.type),u=en(s.value,s.type);n.push({index:o,type:s.type,previousValue:a,currentValue:u,description:`${a} \u2192 ${u}`})}}}return n.length>0?n:null}l(wl,"compareHookStates");function en(e,t){return rt(e)}l(en,"formatHookValue");function rt(e){if(e===null)return null;if(e!==void 0)return typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?e.length>30?e.slice(0,30)+"...":e:typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`{Object: ${Object.keys(e).length} keys}`:String(e)}l(rt,"formatDisplayValue");function Sl(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e,n=e.alternate,r=Fn(e);if(r&&n){let u=nt(e),c=nt(n),d=r.extractedHooks;if(u&&c&&d&&d.length>0){let g=d.find(T=>T.type==="useState");if(g){let T=u.find(v=>v.index===g.index),b=c.find(v=>v.index===g.index);if(T&&b){let v=T.value===g.value,f=b.value===g.value;v&&!f&&(t=n,n=e)}}}}let o=nt(t),i=null,s=null,a=null;return n?(i=n.memoizedProps,s=n.memoizedState,a=nt(n)):r&&(i=r.memoizedProps,s=r.memoizedState,a=r.extractedHooks),bl(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:o}),i===null?{cause:"mount",hookChanges:null}:Mn(i,t.memoizedProps)?co(s,t.memoizedState,{isClassComponent:t.tag===1})?{cause:"state",hookChanges:wl(a,o)}:{cause:"parent",hookChanges:null}:{cause:"props",hookChanges:null}}l(Sl,"detectComponentCause");function Mn(e,t){if(e===t)return true;if(!e||!t||typeof e!="object"||typeof t!="object")return false;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return false;for(let o of n)if(e[o]!==t[o])return false;return true}l(Mn,"shallowEqual");function ot(e,t=3){let n=new WeakSet;function r(o,i){if(i>t)return"[MAX_DEPTH]";if(o===null)return null;if(o===void 0)return;if(typeof o=="function")return`[Function: ${o.name||"anonymous"}]`;if(typeof o=="symbol")return`[Symbol: ${o.toString()}]`;if(typeof o!="object")return o;if(n.has(o))return"[Circular]";if(n.add(o),Array.isArray(o))return o.slice(0,10).map(u=>r(u,i+1));let s={},a=Object.keys(o).slice(0,20);for(let u of a)try{s[u]=r(o[u],i+1)}catch{s[u]="[Error accessing]"}return s}return l(r,"stringify"),r(e,0)}l(ot,"safeStringify");function kt(e){return e===void 0?"undefined":{0:"FunctionComponent",1:"ClassComponent",2:"IndeterminateComponent",3:"HostRoot",4:"HostPortal",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",12:"Profiler",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"}[e]||`Unknown(${e})`}l(kt,"getTagName");function xl(e,t){if(!(!t.hookChanges||t.hookChanges.length===0))for(let n of t.hookChanges)console.log("[Buoy]",`[${e||"Unknown"}] ${n.type}[${n.index}]: ${n.previousValue} \u2192 ${n.currentValue}`)}l(xl,"logMinimal");function Il(e,t,n,r,o){let i=Ae(n)||"Unknown",s=typeof t?.type=="string"?t.type:"Unknown",{cause:a,hookChanges:u}=r;if(console.log("[Buoy]",`[RENDER] ${i} (${s}:${e}) | Cause: ${a.toUpperCase()}`+(o&&o.length>0?` | Props: [${o.join(", ")}]`:"")),u&&u.length>0)for(let c of u)console.log("[Buoy]",` \u2514\u2500 ${c.type}[${c.index}]: ${c.previousValue} \u2192 ${c.currentValue}`)}l(Il,"logVerbose");function mo(e,t,n,r,o,i,s){let a=Ae(n)||"Unknown",u=typeof t?.type=="string"?t.type:"Unknown";console.log("[Buoy]",`
27
- [RN-BUOY RENDER DEBUG] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`),console.log("[Buoy]",`Render #${s} for ${u} (nativeTag: ${e})`),console.log("[Buoy]",`Timestamp: ${new Date().toISOString()}`),console.log("[Buoy]",`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
28
- `),console.log("[Buoy]",`NATIVE FIBER (${u}):`),console.log("[Buoy]",` type: "${t?.type}"`),console.log("[Buoy]",` tag: ${t?.tag} (${kt(t?.tag)})`);let c=t?.alternate;console.log("[Buoy]",` Previous values source: ${c?"alternate":r?"storage":"none"}`);let d=t?.memoizedProps?.children,g=c?.memoizedProps?.children,T=g!==void 0?g:r?.memoizedProps?.children,b=T!==void 0?d!==T:false;console.log("[Buoy]",` memoizedProps.children: ${rt(d)}${b?` (was: ${rt(T)})`:T!==void 0?" (unchanged)":" (first render)"}`);let v=t?.memoizedProps?.style,f=c?.memoizedProps?.style,S=f!==void 0?f:r?.memoizedProps?.style,C=S!==void 0?v!==S:false;if(v&&(console.log("[Buoy]",` memoizedProps.style: ${JSON.stringify(ot(v,2))}${C?" (REFERENCE CHANGED)":""}`),C&&S)){let V=tn(v,S);console.log("[Buoy]",` \u2514\u2500 Values actually changed: ${!V}`)}console.log("[Buoy]",` All memoizedProps keys: [${Object.keys(t?.memoizedProps||{}).join(", ")}]`);let N=t?.memoizedProps?.testID,m=t?.memoizedProps?.nativeID,k=t?.memoizedProps?.accessibilityLabel;if(N&&console.log("[Buoy]",` testID: "${N}"`),m&&console.log("[Buoy]",` nativeID: "${m}"`),k&&console.log("[Buoy]",` accessibilityLabel: "${k}"`),console.log("[Buoy]",` alternate: ${c?"YES":"NO"}`),c&&console.log("[Buoy]",` alternate.memoizedProps.children: ${rt(g)}`),console.log("[Buoy]"," Tree structure:"),console.log("[Buoy]",` return (parent): ${t?.return?kt(t.return.tag):"null"}`),console.log("[Buoy]",` child: ${t?.child?kt(t.child.tag):"null"}`),console.log("[Buoy]",` sibling: ${t?.sibling?kt(t.sibling.tag):"null"}`),console.log("[Buoy]",""),console.log("[Buoy]",`COMPONENT FIBER (${a}):`),n){if(console.log("[Buoy]",` name: "${a}"`),console.log("[Buoy]",` type: ${typeof n.type} (${n.type?.name||n.type?.displayName||"anonymous"})`),console.log("[Buoy]",` tag: ${n.tag} (${kt(n.tag)})`),console.log("[Buoy]",` memoizedProps: ${JSON.stringify(ot(n.memoizedProps,2))}`),console.log("[Buoy]",` alternate: ${n.alternate?"YES":"NO"}`),n.alternate){console.log("[Buoy]",` ALTERNATE memoizedProps: ${JSON.stringify(ot(n.alternate.memoizedProps,2))}`);let L=!Mn(n.alternate.memoizedProps,n.memoizedProps);console.log("[Buoy]",` Props changed (vs alternate): ${L?"YES":"NO"}`),console.log("[Buoy]",` ALTERNATE memoizedState: ${n.alternate.memoizedState===n.memoizedState?"SAME":"DIFFERENT"}`)}let V=Fn(n);if(V){console.log("[Buoy]",` WeakMap PREVIOUS memoizedProps: ${JSON.stringify(ot(V.memoizedProps,2))}`);let L=!Mn(V.memoizedProps,n.memoizedProps);console.log("[Buoy]",` Props changed (vs WeakMap): ${L?"YES":"NO"}`)}else console.log("[Buoy]"," WeakMap PREVIOUS state: (not found - first render or WeakMap cleared)");if(n._debugOwner){let L=Ae(n._debugOwner);console.log("[Buoy]",` _debugOwner: "${L}"`);let ue=n._debugOwner,pe=1;for(;ue&&pe<5;){let Fe=Ae(ue);console.log("[Buoy]",` \u2514\u2500[${pe}] ${Fe||"unknown"} (tag: ${ue.tag})`),ue=ue._debugOwner,pe++}}let j=0,x=t._debugOwner||t.return;for(;x&&x!==n&&j<30;)x=x.return,j++;console.log("[Buoy]",` Depth from native fiber: ${j}`)}else console.log("[Buoy]"," (No component fiber found - could not walk up tree)");if(console.log("[Buoy]",""),console.log("[Buoy]","HOOKS:"),n?.memoizedState){let V=nt(n),j=n.alternate?nt(n.alternate):null,x=Fn(n),L=j||x?.extractedHooks,ue=j?"alternate":x?"WeakMap":"none";V&&V.length>0?(console.log("[Buoy]",` Total hooks: ${V.length}`),console.log("[Buoy]",` Previous values source: ${ue}`),V.forEach((pe,Fe)=>{let ye=L?.[Fe],Rr=ye?ye.rawState!==pe.rawState:false,St=ye?rt(ye.value):"N/A",jt=Rr?" \u2190 CHANGED":"";console.log("[Buoy]",` [${Fe}] ${pe.type}: ${rt(pe.value)}${ye?` (was: ${St})`:" (first render)"}${jt}`)})):(console.log("[Buoy]"," (Could not extract hooks - memoizedState structure not recognized)"),console.log("[Buoy]",` Raw memoizedState type: ${typeof n.memoizedState}`),console.log("[Buoy]",` Has 'next' property: ${"next"in(n.memoizedState||{})}`),console.log("[Buoy]",` Has 'queue' property: ${"queue"in(n.memoizedState||{})}`))}else console.log("[Buoy]"," (No memoizedState - class component, no hooks, or not a function component)");if(console.log("[Buoy]",""),console.log("[Buoy]","RAW HOOKS DATA:"),n?.memoizedState&&typeof n.memoizedState=="object"){let V=n.memoizedState,j=0;for(;V&&j<10;)console.log("[Buoy]",` Hook[${j}]:`),console.log("[Buoy]",` memoizedState: ${ot(V.memoizedState,2)}`),console.log("[Buoy]",` baseState: ${ot(V.baseState,2)}`),console.log("[Buoy]",` queue: ${V.queue?"[Queue present]":"null"}`),console.log("[Buoy]",` next: ${V.next?"[Next hook]":"null"}`),V=V.next,j++;j===0&&console.log("[Buoy]"," (memoizedState is not a hooks linked list)")}console.log("[Buoy]",""),console.log("[Buoy]","DETECTION RESULTS:"),console.log("[Buoy]",` Component Cause: ${o.cause.toUpperCase()}`),o.hookChanges&&o.hookChanges.length>0&&(console.log("[Buoy]"," Hook Changes Detected:"),o.hookChanges.forEach(V=>{console.log("[Buoy]",` [${V.index}] ${V.type}: ${V.previousValue} \u2192 ${V.currentValue}`),V.description&&console.log("[Buoy]",` ${V.description}`)}));let P=typeof t?.type=="string"?t.type:void 0,D=fo(r?.memoizedProps,t?.memoizedProps,P);D&&D.length>0?console.log("[Buoy]",` Native Props Changed: [${D.join(", ")}]`):r&&console.log("[Buoy]"," Native Props Changed: (none detected)"),console.log("[Buoy]",""),console.log("[Buoy]","BATCH CONTEXT:"),console.log("[Buoy]",` Batch size: ${i.size}`),console.log("[Buoy]",` All tags in batch: [${Array.from(i).slice(0,20).join(", ")}${i.size>20?"...":""}]`);let W=vo(t),Z=W!==null&&i.has(W);if(console.log("[Buoy]",` Parent nativeTag: ${W??"not found"}`),console.log("[Buoy]",` Parent in batch: ${Z?"YES":"NO"}`),i.size>1){console.log("[Buoy]"," Components in same batch:");let V=t?.return,j=0;for(;V&&j<10;){let x=Co(V.stateNode);if(x!==null&&i.has(x)){let L=Ae(V)||V.type;console.log("[Buoy]",` [depth ${j}] ${L} (tag: ${x})`)}V=V.return,j++}}console.log("[Buoy]",`
26
+ `}};l(Ao,"PerformanceLoggerSingleton");Ca=Ao,Qe=new Ca});function Ta(e){if(e.isComponent===true||e.testID&&e.testID.trim())return true;let t=(e.componentName??"").trim();if(!t||Ho.has(t)||wa.has(t))return false;let n=(e.viewType??"").trim();return!(n&&Ho.has(n)&&t===n||/^comp(\s|$)/i.test(t)||t.startsWith("_"))}var Ho,wa,Qu=Kt(()=>{"use strict";U();Ho=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]),wa=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"]);l(Ta,"isNamedComposite")});var Sa={};ga(Sa,{RenderTracker:()=>B,default:()=>Da});var Eo,xa,Fo,Ia,B,Da,Ve=Kt(()=>{"use strict";U();ya();Tn();Qu();Eo=200,xa=150,Fo=class bp{constructor(){this.renders=new Map;this.listeners=new Set;this.stateListeners=new Set;this.settingsListeners=new Set;this.filterListeners=new Set;this.renderEventCallbacks=new Set;this.isTracking=false;this.isPaused=false;this.settings={batchSize:xa,showRenderCount:true,performanceLogging:false,trackRenderCauses:false,enableRenderHistory:false,maxRenderHistoryPerComponent:20,capturePropsOnRender:false,captureStateOnRender:false,debugLogLevel:"off",excludeDevTools:true,showHostViews:false};this.isBatchMode=false;this.batchDirty=false;this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]}}trackRender(t){if(this.isPaused)return;let n=String(t.nativeTag),o=Date.now(),r=this.renders.get(n);if(r){if(r.renderCount=t.count,r.lastRenderTime=o,r.color=t.color,t.measurements&&(r.measurements=t.measurements),t.testID&&!r.testID&&(r.testID=t.testID),t.nativeID&&!r.nativeID&&(r.nativeID=t.nativeID),t.accessibilityLabel&&!r.accessibilityLabel&&(r.accessibilityLabel=t.accessibilityLabel),t.componentName&&!r.componentName&&(r.componentName=t.componentName),t.renderCause&&(r.lastRenderCause=t.renderCause),this.settings.enableRenderHistory){let i=t.renderCause||{type:"unknown",timestamp:o};this.addRenderEvent(r,i,t.capturedProps,t.capturedState)}}else{let i={id:n,nativeTag:t.nativeTag,viewType:t.viewType,displayName:Cn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,...t.isComponent===void 0?{}:{isComponent:t.isComponent},renderCount:t.count,firstRenderTime:o,lastRenderTime:o,measurements:t.measurements,color:t.color,lastRenderCause:t.renderCause};if(this.settings.enableRenderHistory){i.renderHistory=[];let s=t.renderCause||{type:t.count===1?"mount":"unknown",timestamp:o};this.addRenderEvent(i,s,t.capturedProps,t.capturedState)}if(this.renders.set(n,i),this.renders.size>Eo){let s=Array.from(this.renders.values()).sort((a,c)=>a.lastRenderTime-c.lastRenderTime).slice(0,this.renders.size-Eo);for(let a of s)this.renders.delete(a.id)}}this.isBatchMode?this.batchDirty=true:this.notifyListeners()}addRenderEvent(t,n,o,r){t.renderHistory||(t.renderHistory=[]);let i={id:`${t.nativeTag}-${n.timestamp}`,timestamp:n.timestamp,cause:n,renderNumber:t.renderCount,capturedProps:this.settings.capturePropsOnRender?o:void 0,capturedState:this.settings.captureStateOnRender?r:void 0};t.renderHistory.push(i);let s=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));t.renderHistory.length>s&&(t.renderHistory=t.renderHistory.slice(-s)),this.notifyRenderEventCallbacks(i,t)}notifyRenderEventCallbacks(t,n){this.renderEventCallbacks.forEach(o=>{try{o(t,n)}catch{}})}emitRenderEvent(t){if(this.renderEventCallbacks.size===0)return;let n=Date.now(),o=t.renderCause||{type:"unknown",timestamp:n},r={id:String(t.nativeTag),nativeTag:t.nativeTag,viewType:t.viewType,displayName:Cn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,renderCount:t.count,firstRenderTime:n,lastRenderTime:n,measurements:t.measurements,color:t.color,lastRenderCause:o,renderHistory:[]},i={id:`${t.nativeTag}-${n}-${t.count}`,timestamp:n,renderNumber:t.count,cause:o,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(i,r)}startBatch(){this.isBatchMode=true,this.batchDirty=false}endBatch(){this.isBatchMode=false,this.batchDirty&&(this.batchDirty=false,this.notifyListeners())}getRenders(){return Array.from(this.renders.values()).map(t=>({...t}))}passesFilters(t){if(this.filters.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,this.filters.includePatterns)||this.filters.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,this.filters.excludePatterns))return false;if(this.filters.includeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(!this.matchesPattern(n,this.filters.includeViewType)&&!this.matchesPattern(o,this.filters.includeViewType))return false}if(this.filters.includeTestID.size>0&&(!t.testID||!this.matchesPattern(t.testID,this.filters.includeTestID))||this.filters.includeNativeID.size>0&&(!t.nativeID||!this.matchesPattern(t.nativeID,this.filters.includeNativeID))||this.filters.includeComponent.size>0&&(!t.componentName||!this.matchesPattern(t.componentName,this.filters.includeComponent)))return false;if(this.filters.excludeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(this.matchesPattern(n,this.filters.excludeViewType)||this.matchesPattern(o,this.filters.excludeViewType))return false}return!(this.filters.excludeTestID.size>0&&t.testID&&this.matchesPattern(t.testID,this.filters.excludeTestID)||this.filters.excludeNativeID.size>0&&t.nativeID&&this.matchesPattern(t.nativeID,this.filters.excludeNativeID)||this.filters.excludeComponent.size>0&&t.componentName&&this.matchesPattern(t.componentName,this.filters.excludeComponent))}matchesAnyPatternForInfo(t,n){for(let o of n){let r=o.value.toLowerCase();switch(o.type){case"any":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r)||t.testID?.toLowerCase().includes(r)||t.nativeID?.toLowerCase().includes(r)||t.componentName?.toLowerCase().includes(r)||t.accessibilityLabel?.toLowerCase().includes(r))return true;break;case"viewType":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r))return true;break;case"testID":if(t.testID?.toLowerCase().includes(r))return true;break;case"nativeID":if(t.nativeID?.toLowerCase().includes(r))return true;break;case"component":if(t.componentName?.toLowerCase().includes(r))return true;break;case"accessibilityLabel":if(t.accessibilityLabel?.toLowerCase().includes(r))return true;break}}return false}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||this.filters.minRenderCount!==void 0||this.filters.maxRenderCount!==void 0}getFilteredRenders(t=""){let n=this.getRenders();if(this.settings.showHostViews||(n=n.filter(Ta)),t.trim()){let o=t.toLowerCase();n=n.filter(r=>r.viewType.toLowerCase().includes(o)||r.displayName.toLowerCase().includes(o)||r.testID?.toLowerCase().includes(o)||r.nativeID?.toLowerCase().includes(o)||r.accessibilityLabel?.toLowerCase().includes(o)||r.componentName?.toLowerCase().includes(o)||String(r.nativeTag).includes(o))}return n=n.filter(o=>this.passesFilters(o)),this.filters.minRenderCount!==void 0&&(n=n.filter(o=>o.renderCount>=this.filters.minRenderCount)),this.filters.maxRenderCount!==void 0&&(n=n.filter(o=>o.renderCount<=this.filters.maxRenderCount)),n.sort((o,r)=>r.lastRenderTime-o.lastRenderTime)}matchesPattern(t,n){let o=t.toLowerCase();for(let r of n){let i=r.toLowerCase();if(o.includes(i))return true}return false}getRender(t){return this.renders.get(t)}clear(){this.renders.clear(),this.notifyListeners()}resetRenderCount(t){let n=this.renders.get(t);n&&(n.renderCount=0,this.notifyListeners())}start(){this.isTracking=true,this.isPaused=false,this.notifyStateListeners()}stop(){this.isTracking=false,this.isPaused=false,this.notifyStateListeners()}pause(){this.isPaused=true,this.notifyStateListeners()}resume(){this.isPaused=false,this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused,this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}replaceRenders(t,n){let o=new Map;for(let[r,i]of this.renders)i.renderHistory&&i.renderHistory.length>0&&o.set(r,i.renderHistory);this.renders=new Map(t.map(r=>{let i=o.get(r.id),s=i&&!(r.renderHistory&&r.renderHistory.length>0)?{...r,renderHistory:i}:r;return[s.id,s]})),n&&(this.isTracking!==n.isTracking||this.isPaused!==n.isPaused)&&(this.isTracking=n.isTracking,this.isPaused=n.isPaused,this.notifyStateListeners()),this.notifyListeners()}hydrateRender(t){let n=this.renders.get(t.id);this.renders.set(t.id,n?{...n,...t}:t),this.notifyListeners()}getFilters(){return this.filters}setFilters(t){this.filters={...this.filters,...t},this.notifyListeners(),this.notifyFilterListeners()}addIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}addExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0},this.notifyListeners()}getAvailableProps(){let t=new Set,n=new Set,o=new Set,r=new Set,i=new Set;for(let s of this.renders.values())s.viewType&&t.add(s.viewType),s.testID&&n.add(s.testID),s.nativeID&&o.add(s.nativeID),s.componentName&&r.add(s.componentName),s.accessibilityLabel&&i.add(s.accessibilityLabel);return{viewTypes:Array.from(t).sort(),testIDs:Array.from(n).sort(),nativeIDs:Array.from(o).sort(),componentNames:Array.from(r).sort(),accessibilityLabels:Array.from(i).sort()}}getStats(){let t=0;for(let n of this.renders.values())t+=n.renderCount;return{totalComponents:this.renders.size,totalRenders:t}}subscribe(t){return this.listeners.add(t),t(this.getRenders()),()=>{this.listeners.delete(t)}}subscribeToState(t){return this.stateListeners.add(t),t(this.getState()),()=>{this.stateListeners.delete(t)}}subscribeToSettings(t){return this.settingsListeners.add(t),t(this.settings),()=>{this.settingsListeners.delete(t)}}subscribeToFilters(t){return this.filterListeners.add(t),t(this.filters),()=>{this.filterListeners.delete(t)}}onRenderEvent(t){return this.renderEventCallbacks.add(t),()=>{this.renderEventCallbacks.delete(t)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(t){let n=this.filters;return!(n.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,n.includePatterns)||n.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,n.excludePatterns)||(n.includeViewType.size>0||n.includeTestID.size>0||n.includeNativeID.size>0||n.includeComponent.size>0)&&!(n.includeViewType.size>0&&n.includeViewType.has(t.viewType)||n.includeTestID.size>0&&t.testID&&n.includeTestID.has(t.testID)||n.includeNativeID.size>0&&t.nativeID&&n.includeNativeID.has(t.nativeID)||n.includeComponent.size>0&&t.componentName&&n.includeComponent.has(t.componentName))||n.excludeViewType.has(t.viewType)||t.testID&&n.excludeTestID.has(t.testID)||t.nativeID&&n.excludeNativeID.has(t.nativeID)||t.componentName&&n.excludeComponent.has(t.componentName))}getSettings(){return{...this.settings}}setSettings(t){t.batchSize!==void 0&&(t.batchSize=Math.max(10,Math.min(500,t.batchSize))),t.maxRenderHistoryPerComponent!==void 0&&(t.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,t.maxRenderHistoryPerComponent))),t.enableRenderHistory&&!this.settings.trackRenderCauses&&(t.trackRenderCauses=true),t.trackRenderCauses===false&&this.settings.enableRenderHistory&&(t.enableRenderHistory=false),this.settings={...this.settings,...t},t.performanceLogging!==void 0&&Qe.setEnabled(t.performanceLogging),this.notifySettingsListeners()}clearAllRenderHistory(){for(let t of this.renders.values())t.renderHistory=[];this.notifyListeners()}clearRenderHistory(t){let n=this.renders.get(t);n&&(n.renderHistory=[],this.notifyListeners())}getRenderHistoryStats(){let t=0,n=0;for(let o of this.renders.values())o.renderHistory&&o.renderHistory.length>0&&(t+=o.renderHistory.length,n++);return{totalEvents:t,componentsWithHistory:n,averageEventsPerComponent:n>0?t/n:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(t){this.setSettings({batchSize:t})}notifyListeners(){let t=this.getRenders();for(let n of this.listeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in listener:",o)}}notifyStateListeners(){let t=this.getState();for(let n of this.stateListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in state listener:",o)}}notifySettingsListeners(){let t=this.getSettings();for(let n of this.settingsListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in settings listener:",o)}}notifyFilterListeners(){let t=this.getFilters();for(let n of this.filterListeners)try{n(t)}catch(o){console.error("[Buoy]","[RenderTracker] Error in filter listener:",o)}}};l(Fo,"RenderTrackerSingleton");Ia=Fo,B=new Ia,Da=B});U();U();import{useState as Mo,useEffect as $o,useCallback as Zu}from"react";import{HighlighterIcon as Ra,HighlightIcon as ka}from"@buoy-gg/floating-tools-core/web";U();import{getDOMFiber as Oo,getDOMNodeHandle as Pa,getDOMPublicInstance as ed,isDOMElement as Na}from"@buoy-gg/shared-ui/web/utils";U();var xt=null,It=null,Jt=false,Yt=false,wn=null;function _o(e){if(!e)return{type:"null"};let t=e,n={};if(t.canonical){n.type="Fabric";let o=t.canonical;if(o.publicInstance){let r=o.publicInstance;n.hasMeasure=typeof r.measure=="function",n.nativeTag=r.__nativeTag??r._nativeTag??"unknown"}}else typeof t.measure=="function"?(n.type="Legacy",n.hasMeasure=true,n.nativeTag=t.__nativeTag??t._nativeTag??t.nativeTag??"unknown"):(n.type="Unknown",n.keys=Object.keys(t).slice(0,10));return n}l(_o,"describeNode");function La(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;!e||typeof e.emit!="function"||xt||(xt=e.emit.bind(e),e.emit=function(t,...n){if(t==="traceUpdates"&&Yt){let o=n[0];o.size>0&&console.log("[Buoy]",`[PROFILER] traceUpdates: ${o.size} nodes`,Array.from(o).map((r,i)=>({index:i,..._o(r)}))),wn&&wn(o)}return xt(t,...n)})}l(La,"swizzleHookEmit");function za(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.reactDevtoolsAgent;!e||typeof e.emit!="function"||It||(It=e.emit.bind(e),e.emit=function(t,...n){if(Yt&&t==="drawTraceUpdates"){let o=n[0];o.length>0&&console.log("[Buoy]",`[PROFILER] drawTraceUpdates: ${o.length} nodes`,o.map((r,i)=>({index:i,color:r.color,..._o(r.node)})))}return It(t,...n)})}l(za,"swizzleAgentEmit");function Ba(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;e?.rendererInterfaces&&e.rendererInterfaces.forEach(t=>{if(typeof t.setTraceUpdatesEnabled=="function")try{t.setTraceUpdatesEnabled(false)}catch{}})}l(Ba,"disableTracingOnAllRenderers");function Wo(e){wn=e}l(Wo,"setComparisonCallback");function Uo(){typeof ee<"u"&&!ee||Jt||(La(),za(),Jt=true)}l(Uo,"installProfilerInterceptor");function jo(){if(!Jt)return;let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;xt&&e&&(e.emit=xt,xt=null),It&&e?.reactDevtoolsAgent&&(e.reactDevtoolsAgent.emit=It,It=null),Ba(),wn=null,Jt=false}l(jo,"uninstallProfilerInterceptor");function Va(){return Jt}l(Va,"isInterceptorInstalled");function Aa(){Yt=true}l(Aa,"enableProfilerLogging");function Ha(){Yt=false}l(Ha,"disableProfilerLogging");function Ea(){return Yt}l(Ea,"isLoggingEnabled");var Fa={};ga(Fa,{AccessibilityInfo:()=>rd,ActivityIndicator:()=>Jd,Alert:()=>Xd,Animated:()=>id,AppRegistry:()=>ld,AppState:()=>sd,Appearance:()=>ad,BackHandler:()=>cd,Button:()=>Yd,CheckBox:()=>Td,Clipboard:()=>ud,DeviceEventEmitter:()=>Hd,Dimensions:()=>Ze,Easing:()=>dd,FlatList:()=>$a,I18nManager:()=>gd,Image:()=>wd,ImageBackground:()=>Sd,InteractionManager:()=>pd,Keyboard:()=>hd,KeyboardAvoidingView:()=>xd,LayoutAnimation:()=>md,Linking:()=>fd,LogBox:()=>Ad,Modal:()=>Ga,NativeEventEmitter:()=>yd,NativeModules:()=>od,PanResponder:()=>bd,Picker:()=>Id,PixelRatio:()=>Go,Platform:()=>Ma,Pressable:()=>Ua,ProgressBar:()=>Dd,RefreshControl:()=>Rd,SafeAreaView:()=>kd,ScrollView:()=>Me,SectionList:()=>Pd,Share:()=>vd,StatusBar:()=>Nd,StyleSheet:()=>ve,Switch:()=>Dt,Text:()=>p,TextInput:()=>Sn,Touchable:()=>Ld,TouchableHighlight:()=>Kd,TouchableNativeFeedback:()=>zd,TouchableOpacity:()=>Y,TouchableWithoutFeedback:()=>qd,UIManager:()=>Xt,Vibration:()=>Cd,View:()=>h,VirtualizedList:()=>Bd,YellowBox:()=>Vd,findNodeHandle:()=>Rt,unstable_createElement:()=>nd,useColorScheme:()=>Ed,useLocaleContext:()=>Fd,useWindowDimensions:()=>Md});U();Yu(Fa,td);import*as td from"react-native-web";import{unstable_createElement as nd,NativeModules as od,AccessibilityInfo as rd,Animated as id,Appearance as ad,AppRegistry as ld,AppState as sd,BackHandler as cd,Clipboard as ud,Dimensions as Ze,Easing as dd,I18nManager as gd,Keyboard as hd,InteractionManager as pd,LayoutAnimation as md,Linking as fd,NativeEventEmitter as yd,PanResponder as bd,PixelRatio as Go,Platform as Ma,Share as vd,StyleSheet as ve,UIManager as Xt,Vibration as Cd,CheckBox as Td,FlatList as $a,Image as wd,ImageBackground as Sd,KeyboardAvoidingView as xd,Picker as Id,ProgressBar as Dd,RefreshControl as Rd,SafeAreaView as kd,SectionList as Pd,StatusBar as Nd,Touchable as Ld,TouchableNativeFeedback as zd,VirtualizedList as Bd,YellowBox as Vd,LogBox as Ad,DeviceEventEmitter as Hd,useColorScheme as Ed,useLocaleContext as Fd,useWindowDimensions as Md}from"react-native-web";import*as Ce from"react-native-web";import{createElement as Ko,forwardRef as Oa,useCallback as $d,useRef as Od}from"react";U();import{useEffect as _d,useState as Wd}from"react";import{createPortal as Ud}from"react-dom";U();var jd='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Gd}from"react/jsx-runtime";var Qt=Symbol.for("@buoy-gg/portal-host"),_a=l(e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"},"isTextField");function qo(){let e=document;if(e[Qt])return e[Qt].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:jd});let n=l(()=>{let d=document.fullscreenElement,g=d&&d.tagName!=="CANVAS"?d:document.body;t.parentElement!==g&&g.appendChild(t)},"move"),o=new Map,r=l(d=>{(!t.contains(d.target)||!_a(d.target))&&o.set(d.code||d.key,{key:d.key,code:d.code,location:d.location,keyCode:d.keyCode,which:d.which,altKey:d.altKey,ctrlKey:d.ctrlKey,metaKey:d.metaKey,shiftKey:d.shiftKey})},"down"),i=l(d=>{o.delete(d.code||d.key)},"up"),s=l(()=>o.clear(),"clear"),a=l(()=>{let d=[...o.values()];o.clear();for(let g of d)document.dispatchEvent(new KeyboardEvent("keyup",{...g,bubbles:true}))},"focus"),c=l(d=>{_a(d.target)&&d.stopPropagation()},"key"),u=l(d=>d.stopPropagation(),"wheel");return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",r,true),document.addEventListener("keyup",i,true),window.addEventListener("blur",s),t.addEventListener("focusin",a),t.addEventListener("keydown",c),t.addEventListener("keyup",c),t.addEventListener("keypress",c),t.addEventListener("wheel",u,{passive:true}),e[Qt]={host:t,users:0,dispose:l(()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",r,true),document.removeEventListener("keyup",i,true),window.removeEventListener("blur",s),t.remove(),delete e[Qt]},"dispose")},t}l(qo,"getBuoyPortalHost");function Wa({children:e}){let[t,n]=Wd(null);return _d(()=>{let o=qo(),r=document[Qt];return r.users++,n(o),()=>{--r.users===0&&r.dispose()}},[]),t?Ud(Gd("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}l(Wa,"BuoyPortal");function Te(e){let t=Oa((o,r)=>{let{accessibilityState:i,accessibilityValue:s,...a}=o;for(let c of["busy","checked","disabled","expanded","selected"])i?.[c]!==void 0&&a[`aria-${c}`]===void 0&&(a[`aria-${c}`]=i[c]);for(let[c,u]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[c]!==void 0&&a[`aria-${u}`]===void 0&&(a[`aria-${u}`]=s[c]);return Ko(e,{...a,ref:r})}),n=e.State;return n&&Object.assign(t,{State:n}),t.displayName=e.displayName??e.name??"NativeWebView",t}l(Te,"withAccessibility");var h=Te(Ce.View),p=Te(Ce.Text),Sn=Te(Ce.TextInput),Y=Te(Ce.TouchableOpacity),Kd=Te(Ce.TouchableHighlight),qd=Te(Ce.TouchableWithoutFeedback),Ua=Te(Ce.Pressable),Me=Te(Ce.ScrollView),ja=Oa((e,t)=>{let n=Od(null),o=$d(r=>{if(r){let i=r;for(;i.parentElement&&i.parentElement!==document.body;)i=i.parentElement;i.parentElement===document.body&&(n.current=i,Object.assign(i.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),qo().appendChild(i))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof t=="function"?t(r):t&&(t.current=r)},[t]);return Ko(Wa,null,Ko(Ce.Modal,{...e,ref:o}))});ja.displayName="Modal";var Ga=Te(ja),Dt=Te(Ce.Switch),Jd=Te(Ce.ActivityIndicator),Yd=Te(Ce.Button),Rt=Ce.findNodeHandle,Xd={alert(e,t,n,o){if(typeof document>"u")return;let r=document.createElement("dialog");r.dataset.buoyRoot="",r.setAttribute("aria-label",e),r.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",r.appendChild(i),t){let u=document.createElement("p");u.textContent=t,u.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",r.appendChild(u)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let a=n?.length?n:[{text:"OK"}],c=l(()=>{r.close?.(),r.remove()},"close");for(let u of a){let d=document.createElement("button");d.type="button",d.textContent=u.text??"OK",d.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,d.onclick=()=>{c(),u.onPress?.()},s.appendChild(d)}r.addEventListener("cancel",u=>{u.preventDefault(),o?.cancelable!==false&&(c(),o?.onDismiss?.())}),r.appendChild(s),document.body.appendChild(r),r.showModal?r.showModal():r.setAttribute("open","")}};Ve();U();import{getDOMControlProps as Qd,getDOMNodeHandle as Jo,getDOMPublicInstance as Ka,isDOMElement as qa}from"@buoy-gg/shared-ui/web/utils";U();function Yo(e){return e?e.x>=-.1&&e.x<=1.1&&e.y>=-.1&&e.y<=1.1:false}l(Yo,"isOnScreenTap");function xn(e,t,n){if(!e||t<=0||n<=0)return false;let o=e.x+e.width/2,r=e.y+e.height/2,i=t*.1,s=n*.1;return o>=-i&&o<=t+i&&r>=-s&&r<=n+s}l(xn,"isRectCenterOnScreen");function Xo(e){return String(e??"").toLowerCase().replace(/\s+/g," ").replace(/(\d)[,\u00a0\u202f](?=\d{3}\b)/g,"$1").trim()}l(Xo,"looseText");function Zt(e,t){if(t.nativeTag!=null&&e.nativeTag===t.nativeTag)return 1e3;if(t.testID&&!t.query){if(!e.testID||e.testID.toLowerCase()!==t.testID.trim().toLowerCase())return 0;let s=200;return e.tap&&(s+=Yo(e.tap)?20:-40),s}let n=String(t.query??t.testID??"").trim().toLowerCase();if(!n)return 0;let o=[e.testID,e.label,e.text,e.name].filter(Boolean).map(s=>s.toLowerCase()),r=0;for(let s of o)s===n?r=Math.max(r,100):s.startsWith(n)?r=Math.max(r,50):s.includes(n)&&(r=Math.max(r,25));let i=Xo(n);if(i)for(let s of o){let a=Xo(s);a===i?r=Math.max(r,90):a.startsWith(i)?r=Math.max(r,45):a.includes(i)&&(r=Math.max(r,22))}return t.testID&&e.testID&&e.testID.toLowerCase()===t.testID.toLowerCase()&&(r=Math.max(r,200)),r===0?0:((e.testID??"").toLowerCase().startsWith("buoy-dial-")&&(r+=40),e.tap&&(Yo(e.tap)?r+=20:r-=40),r)}l(Zt,"scoreTapMatch");U();import{getDOMControlProps as Zd}from"@buoy-gg/shared-ui/web/utils";var eg=new Set(["button","link","menuitem","tab","switch","checkbox","radio","option","textbox","slider"]),tg=new Set(["SCRIPT","STYLE","NOSCRIPT","TEMPLATE","SVG","PATH","HEAD","META","LINK"]),Ja=80;function Ya(e){for(let t in e)if(t.startsWith("__reactContainer$")||t==="_reactRootContainer")return true;return false}l(Ya,"isReactContainer");function Xa(e){if(e.hidden||e.getAttribute("aria-hidden")==="true")return true;let t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}l(Xa,"isHidden");function Qa(e){let t=e;return typeof t.$$click=="function"||typeof t.onclick=="function"||e.tabIndex>=0&&e.hasAttribute("tabindex")}l(Qa,"hasClick");function Za(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===3&&(t+=n.textContent??"");return t=t.replace(/\s+/g," ").trim(),t||void 0}l(Za,"ownText");function el(e,t){let n=(e.innerText??e.textContent??"").replace(/\s+/g," ").trim();if(n)return t||n.length<=Ja?n:`${n.slice(0,Ja)}\u2026`}l(el,"allText");function tl(e={}){if(typeof document>"u"||!document.body)return[];let t=[],n=l((o,r,i)=>{if(tg.has(o.tagName.toUpperCase())||Ya(o)||Xa(o))return;let s=i||o.hasAttribute("data-buoy-root"),a=o.tagName.toLowerCase(),c=o.getAttribute("role")??void 0,u=a==="button"||a==="a"&&o.hasAttribute("href")||a==="input"||a==="textarea"||a==="select"||c!==void 0&&eg.has(c)||Qa(o),d=o.getAttribute("data-testid")??void 0,g=o.getAttribute("aria-label")??void 0,T=u?el(o,!!e.fullText):r?void 0:Za(o);if(u||d||g||T){let f={"data-testid":d,"aria-label":g,role:c,id:o.id||void 0};u&&a!=="input"&&a!=="textarea"&&a!=="select"&&(f.onClick=()=>o.click());let b=Zd(o,f);if(c==="switch"||c==="checkbox"){let m=o.getAttribute("aria-checked")==="true";b.value=m,b.onValueChange=S=>{!!S!=(o.getAttribute("aria-checked")==="true")&&o.click()},delete b.onPress}o.disabled&&delete b.onPress,t.push({element:o,props:b,text:T,buoy:s})}for(let f of Array.from(o.children))f instanceof HTMLElement&&n(f,r||u,s)},"walk");return n(document.body,false,false),t}l(tl,"collectDOMElements");function In(e){let t=globalThis[Symbol.for("buoy.dom.componentName")];try{let n=t?.(e);if(n)return n}catch{}return e.tagName.toLowerCase()}l(In,"domElementName");function nl(){if(typeof MutationObserver>"u"||typeof document>"u")return()=>0;let e=0,t=new MutationObserver(()=>{e+=1});return t.observe(document.body,{subtree:true,childList:true,characterData:true,attributes:true}),()=>(t.disconnect(),e)}l(nl,"watchDOMChanges");var Dn=5,ng=22,Qo=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function Zo(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}l(Zo,"getReactDevToolsHook");var er=0,ol=false;function rl(){if(ol)return;let e=Zo();if(!e)return;let t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){return er++,typeof t=="function"?t.apply(e,n):void 0},ol=true}l(rl,"ensureCommitCounter");var og=250;function tr(){let e=new Map;return t=>{let n=[],o=t,r=0,i=false;for(;o&&r<400;){let s=e.get(o);if(s!==void 0){i=s;break}if(le(o)?.__buoyDevToolsRoot){i=true,e.set(o,true);break}n.push(o),o=o.return,r++}for(let s of n)e.set(s,i);return i}}l(tr,"makeChromeCheck");function $e(){let e=Zo();if(!e)return[];let t=[];try{if(e.renderers&&typeof e.renderers.forEach=="function"&&e.renderers.forEach((n,o)=>{try{let r=e.getFiberRoots?.(o);r&&r.forEach(i=>t.push(i))}catch{}}),t.length===0&&e.getFiberRoots){let n=e.getFiberRoots(1);n&&n.forEach(o=>t.push(o))}}catch{}return t}l($e,"getAllFiberRoots");function nr(e){return e.tag===ng&&e.memoizedState!==null}l(nr,"isHiddenOffscreen");var et=false,or=0,en=false;function rr(e,t){let n=et;et=e;try{return t()}finally{et=n}}l(rr,"withHiddenScreens");function il(e){let t=e.memoizedProps;return t?t["aria-hidden"]===true&&(t.activityState!==void 0||"shouldFreeze"in t)||t.isFocused===false&&(t.routeKey!==void 0||"freezeContents"in t):false}l(il,"isNotShowingScreen");function ir(e){let t=e.memoizedProps?.activityState;return t===0||t===1||e.memoizedProps?.isPageFocused===false?true:!et&&il(e)?(or++,true):false}l(ir,"isInactiveScreen");function Ae(e,t,n=0,o=new Set){if(!(!e||o.has(e)||n>500)){if(o.add(e),nr(e)||ir(e)){e.sibling&&Ae(e.sibling,t,n,o);return}t(e),e.child&&Ae(e.child,t,n+1,o),e.sibling&&Ae(e.sibling,t,n,o)}}l(Ae,"traverseFiberTree");function Rn(e){let t=Ka(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"||typeof n.measureInWindow=="function"?n:null}l(Rn,"getPublicInstance");function tt(e){let t=Jo(e);if(t!==null)return t;if(e==null)return null;let n=e;if(typeof n.__nativeTag=="number")return n.__nativeTag;if(typeof n._nativeTag=="number")return n._nativeTag;if(typeof n.nativeTag=="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag=="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag=="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag=="number")return n.canonical.nativeTag}return null}l(tt,"getNativeTag");function kn(e){let t=Rn(e.stateNode);if(t)return{instance:t,nativeTag:tt(e.stateNode),stateNode:e.stateNode};let n=[];e.child&&n.push(e.child);let o=0;for(;n.length>0&&o<4e3;){o++;let r=n.pop();if(!r)continue;let i=Rn(r.stateNode);if(i)return{instance:i,nativeTag:tt(r.stateNode),stateNode:r.stateNode};r.child&&n.push(r.child),r.sibling&&n.push(r.sibling)}return null}l(kn,"findHostInstance");function al(e){let t=e,n=0;for(;t&&n++<200;){let o=t.stateNode;if(o&&typeof o.scrollTo=="function"){let r=typeof o.getNativeScrollRef=="function"&&o.getNativeScrollRef()||null,i=typeof o.getInnerViewNode=="function"&&o.getInnerViewNode()||typeof o.getScrollableNode=="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:i}}t=t.return}return null}l(al,"findScrollAncestor");async function ll(e,t,n,o){try{if(qa(n))return n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}),await new Promise(c=>setTimeout(c,16)),true;let r=al(e);if(!r)return false;let i=t,s=null,a=l(c=>new Promise(u=>{let d=false,g=l(f=>{d||(d=true,u(f))},"settle"),T=setTimeout(()=>g(null),600);try{c(f=>{clearTimeout(T),g(f)})}catch{clearTimeout(T),g(null)}}),"withTimeout");if(r.nativeRef&&typeof i.measureLayout=="function"&&(s=await a(c=>i.measureLayout(r.nativeRef,(u,d)=>c(d),()=>c(null)))),s==null){let c=Rt(t),u=typeof r.innerNode=="number"?r.innerNode:Rt(r.innerNode);c!=null&&u!=null&&(s=await a(d=>Xt.measureLayout(c,u,()=>d(null),(g,T)=>d(T))))}return s==null?false:(r.instance.scrollTo({y:Math.max(0,s-o),animated:false}),await new Promise(c=>setTimeout(c,120)),true)}catch{return false}}l(ll,"scrollIntoView");function Oe(e){let t=e?.type;return t?typeof t=="string"?t:t.displayName||t.name||null:null}l(Oe,"getComponentName");function Pn(e){let t=e?._debugOwner||e?.return,n=0;for(;t&&n<30;){n++;let o=Oe(t);if(o&&!Qo.has(o)&&typeof t.type!="string")return o;t=t.return}return null}l(Pn,"getOwningComponentName");function le(e){return Qd(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}l(le,"getProps");function ar(e,t=0){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){let n=[];for(let o of e){let r=ar(o,t+1);r&&n.push(r)}return n.length>0?n.join(""):void 0}}l(ar,"flattenText");function sl(e){return e.replace(/\s+/g," ").trim()}l(sl,"normalizeVisibleText");function Nn(e){if(!e)return;let t=l(n=>{let o=ar(n);if(o===void 0)return;let r=sl(o);return r?en?r:r.slice(0,80):void 0},"pick");return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}l(Nn,"getVisibleText");function cl(e,t){let n=[],o=l((i,s)=>{if(!i||s>t||n.length>=4)return;if(i!==e){let c=le(i);if(c&&(typeof c.onPress=="function"||typeof c.onLongPress=="function"))return}let a=Nn(le(i));a&&!n.includes(a)&&n.push(a),i.child&&o(i.child,s+1),i!==e&&i.sibling&&o(i.sibling,s)},"visit");e.child&&o(e.child,1);let r=n.join(" ").trim();return r?r.slice(0,80):void 0}l(cl,"collectDescendantText");function ul(e){let t=e,n=0,o=null,r=null;for(;t&&n<25&&!(o&&r);){let i=le(t);i&&(!o&&typeof i.onPress=="function"&&(o=i.onPress),!r&&typeof i.onLongPress=="function"&&(r=i.onLongPress)),t=t.return,n++}return o?{handler:o,kind:"onPress",longPress:r??void 0}:r?{handler:r,kind:"onLongPress"}:null}l(ul,"findPressHandler");function _e(e){return new Promise(t=>{let n=false,o=l(r=>{n||(n=true,t(r))},"done");setTimeout(()=>o(null),1e3);try{typeof e.measureInWindow=="function"?e.measureInWindow((r,i,s,a)=>{s>0&&a>0?o({x:r,y:i,width:s,height:a}):o(null)}):typeof e.measure=="function"?e.measure((r,i,s,a,c,u)=>{s>0&&a>0&&c!=null&&u!=null?o({x:c,y:u,width:s,height:a}):o(null)}):o(null)}catch{o(null)}})}l(_e,"measureInstance");var rg=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function Ln(){let e=$e(),t=[],n=new Map,o=new Map,r=tr();for(let i of e)Ae(i.current,s=>{let a=le(s);if(!a)return;let c=typeof a.onPress=="function"||typeof a.onLongPress=="function",u=typeof a.onValueChange=="function",d=typeof a.onChangeText=="function",g=a.testID||void 0,T=a.accessibilityLabel||void 0,f=a.accessibilityRole||a.role||void 0,b=Nn(a),m=f==="button"||f==="link"||f==="menuitem"||f==="tab"||f==="switch"||f==="checkbox",S=typeof s.type=="string"&&rg.has(s.type)&&a.animating!==false;if(!c&&!u&&!d&&!g&&!T&&!b&&!m&&!S)return;let v=null,L=null,P=null;if(u){let x=a.value,z=typeof x=="number"||typeof a.minimumValue=="number";L={handler:a.onValueChange,kind:z?"slider":"toggle",current:x,min:typeof a.minimumValue=="number"?a.minimumValue:void 0,max:typeof a.maximumValue=="number"?a.maximumValue:void 0}}else d?P={handler:a.onChangeText,current:typeof a.value=="string"?a.value:void 0}:v=ul(s);let C=Oe(s),I=C??"Unknown";(!C||Qo.has(C)||typeof s.type=="string")&&(I=Pn(s)??C??"Unknown");let R=kn(s);if(!R&&!g)return;!b&&!T&&c&&(b=cl(s,6));let W=R?.instance??null,X=R?.nativeTag??null,V=(W?n.get(W):void 0)??(X!=null?o.get(X):void 0);if(V){!V.press&&v?V.press=v:V.press&&v?.longPress&&!V.press.longPress&&(V.press.longPress=v.longPress),!V.valueControl&&L&&(V.valueControl=L),!V.textControl&&P&&(V.textControl=P),!V.testID&&g&&(V.testID=g),!V.label&&T&&(V.label=T),!V.text&&b&&(V.text=b),W&&!n.has(W)&&n.set(W,V),X!=null&&!o.has(X)&&o.set(X,V);return}let j={nativeTag:X,name:I,role:f??(S?"progressbar":void 0),testID:g,label:T,text:b,instance:W,stateNode:R?.stateNode??null,fiber:s,press:v,valueControl:L,textControl:P,rect:null,buoy:r(s)};t.push(j),W&&n.set(W,j),X!=null&&o.set(X,j)});return t.push(...lr()),t}l(Ln,"collectCandidates");function lr(){return tl({fullText:en}).map(({element:e,props:t,text:n,buoy:o})=>{let r=typeof t.onValueChange=="function"?{handler:t.onValueChange,kind:typeof t.value=="number"?"slider":"toggle",current:t.value,min:t.minimumValue,max:t.maximumValue}:null,i=!r&&typeof t.onChangeText=="function"?{handler:t.onChangeText,current:t.value}:null,s=!r&&!i&&typeof t.onPress=="function"?{handler:t.onPress,kind:"onPress"}:null;return{nativeTag:Jo(e),name:In(e),role:t.accessibilityRole,testID:t.testID,label:t.accessibilityLabel,text:n,instance:Ka(e),stateNode:e,fiber:null,buoy:o,press:s,valueControl:r,textControl:i,rect:null}})}l(lr,"collectDOMCandidates");function dl(e,t){return t.nativeTag!=null?e.nativeTag===t.nativeTag:t.testID&&e.testID?e.testID.toLowerCase()===t.testID.toLowerCase():false}l(dl,"explicitlyTargets");function zn(e){let t=Ln();return e.includeBuoy?t:t.filter(n=>!n.buoy||dl(n,e))}l(zn,"appCandidates");async function sr(e){await Promise.all(e.map(async t=>{t.instance&&(t.rect=await _e(t.instance))}))}l(sr,"measureCandidates");var ig=/^(FlatList|SectionList|VirtualizedSectionList|VirtualizedList|Animated\(.*\)|AnimatedComponent.*)$/;async function gl(e,t){let n=[],o=tr();for(let i of $e())Ae(i.current,s=>{if(Oe(s)!=="VirtualizedList")return;let a=s.memoizedProps;if(!a||typeof a.getItemCount!="function"||!e&&o(s))return;let c;try{c=Number(a.getItemCount(a.data))}catch{return}if(!Number.isFinite(c)||c<=0)return;let u=[],d=l((f,b)=>{for(let m=f?.child;m;m=m.sibling){let S=Oe(m);if(S!=="VirtualizedList"){if(S==="CellRenderer"){u.push(m);continue}b<40&&d(m,b+1)}}},"walk");d(s,0);let g=s,T=Pn(g);for(let f=0;f<6&&T&&ig.test(T);f++)g=g._debugOwner||g.return,T=Pn(g);n.push({owner:T,items:c,cells:u})});let r=[];for(let i of n){let s=(await Promise.all(i.cells.map(async a=>{let c=kn(a);return c?_e(c.instance):null}))).filter(t).length;s>0&&i.items>s&&r.push({owner:i.owner,items:i.items,listed:s})}return r}l(gl,"collectLists");async function Bn(e={}){let t=et,n=en;et=!!e.includeHidden,en=!!e.fullText;try{return await hl(e)}finally{et=t,en=n}}l(Bn,"describeScreen");async function hl(e){or=0;let t=Ln(),n=or,o=e.includeBuoy?t:t.filter(d=>!d.buoy),r=t.length-o.length;await sr(o);let i=Ze.get("window"),s=Math.round(i.width)||1,a=Math.round(i.height)||1,c=[];for(let d of o){let g=d.rect;if(!g&&!d.testID)continue;let T,f;if(g){let S=g.x+g.width/2,v=g.y+g.height/2;if(v<-a*.1||v>a*1.1||S<-s*.1||S>s*1.1)continue;T={x:ke(S/s),y:ke(v/a)},f={x:ke(g.x/s),y:ke(g.y/a),width:ke(g.width/s),height:ke(g.height/a)}}let b=d.valueControl?d.valueControl.kind:d.textControl?"text":void 0,m=d.valueControl?d.valueControl.current:d.textControl?.current;c.push({nativeTag:d.nativeTag,name:d.name,role:d.role,testID:d.testID,label:d.label,text:d.text,interactive:!!(d.press||d.valueControl||d.textControl),longPressable:d.press&&(d.press.kind==="onLongPress"||d.press.longPress)?true:void 0,control:b,value:m,tap:T,frame:f})}c.sort((d,g)=>{let T=d.tap?.y??2,f=g.tap?.y??2;return Math.abs(T-f)>.02?T-f:(d.tap?.x??2)-(g.tap?.x??2)});let u=await gl(!!e.includeBuoy,d=>{if(!d)return false;let g=d.x+d.width/2;return d.y<=a*1.1&&d.y+d.height>=-a*.1&&g>=-s*.1&&g<=s*1.1});return{screen:{width:s,height:a},count:c.length,elements:c,...r>0?{hiddenBuoy:r}:{},...n>0?{hiddenScreens:n}:{},...u.length?{lists:u}:{}}}l(hl,"describeScreenInner");function ke(e){return Math.round(e*100)/100}l(ke,"round2");function cr(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}l(cr,"fieldsOf");function Vn(e,t){return Zt(cr(e),t)}l(Vn,"matchScore");function ur(e,t,n){if(!(!e||!t||!n))return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}l(ur,"tapPoint");function dr(e){let t=e?e.x+e.width/2:0,n=e?e.y+e.height/2:0;return{nativeEvent:{locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]},persist:l(()=>{},"persist"),preventDefault:l(()=>{},"preventDefault"),stopPropagation:l(()=>{},"stopPropagation"),isDefaultPrevented:l(()=>false,"isDefaultPrevented"),isPropagationStopped:l(()=>false,"isPropagationStopped"),target:null,currentTarget:null,type:"press",timeStamp:0}}l(dr,"makeSyntheticPressEvent");async function pl(e){let t=rr(!!e.includeHidden,()=>zn(e));if(t.length===0)return{tapped:false,reason:"Nothing on screen to tap: no React elements and no page elements were found."};let n=t.map(C=>({c:C,score:Vn(C,e)})).filter(C=>C.score>0).sort((C,I)=>I.score-C.score),o=l(C=>!!(C.press||C.valueControl||C.textControl),"isInteractive");if(n.length===0&&!e.includeHidden&&rr(true,()=>zn(e)).map(C=>({c:C,score:Vn(C,e)})).filter(C=>C.score>0).length>0)return{tapped:false,reason:"That element is only on a screen that isn't showing (another tab, or a screen under the current one). Navigate to it first, or pass includeHidden:true if you really mean the hidden one."};if(n.length===0)return{tapped:false,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(o).slice(0,12).map(C=>({nativeTag:C.nativeTag,name:C.name,testID:C.testID,text:C.text}))};let r=Ze.get("window"),i=r.width||1,s=r.height||1,a=n.slice(0,15);await Promise.all(a.map(async C=>{C.c.instance&&!C.c.rect&&(C.c.rect=await _e(C.c.instance))}));for(let C of a)C.score=Zt({...cr(C.c),tap:ur(C.c.rect,i,s)},e);a.sort((C,I)=>I.score-C.score);let c=a.find(C=>o(C.c))??n.find(C=>o(C.c))??a[0],u=c.c,d=l((C,I)=>C.press&&C.press.handler===I.press?.handler||C.valueControl&&C.valueControl.handler===I.valueControl?.handler||C.textControl&&C.textControl.handler===I.textControl?.handler,"sameControl"),g=a.filter(C=>C!==c&&o(C.c)&&C.score===c.score).filter(C=>!d(C.c,u)).filter((C,I,R)=>R.findIndex(W=>d(W.c,C.c))===I).slice(0,3).map(C=>({nativeTag:C.c.nativeTag,name:C.c.name,testID:C.c.testID,text:C.c.text,tap:ur(C.c.rect,i,s)})),T=e.nativeTag==null&&!(e.testID&&!e.query);if(T&&g.length>0){let C=[u,...g.map(I=>a.find(R=>R.c.nativeTag===I.nativeTag)?.c).filter(Boolean)];return{tapped:false,reason:`"${e.query}" matches ${C.length} different controls equally well, so nothing was tapped. Tap one by its nativeTag.`,candidates:C.map(I=>({nativeTag:I.nativeTag,name:I.name,testID:I.testID,text:I.text}))}}let f=a[0];if(T&&f&&f!==c&&!o(f.c)&&f.score>=90&&c.score<f.score-40)return{tapped:false,reason:`The best match for "${e.query}" is "${f.c.text??f.c.label??f.c.name}", which has no JS press handler (it may be native, like a tab bar button). The closest pressable match, "${u.text??u.label??u.name}", is a much weaker match, so nothing was tapped. Use navigate, or tap a specific element by nativeTag.`,candidates:[{nativeTag:u.nativeTag,name:u.name,testID:u.testID,text:u.text}]};if(!o(u))return{tapped:false,reason:`Matched "${u.name}"${u.text?` ("${u.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:u.nativeTag,name:u.name,testID:u.testID,label:u.label,text:u.text,via:"onPress"}};u.instance&&!u.rect&&(u.rect=await _e(u.instance));let b=false;(u.rect==null||!xn(u.rect,i,s))&&e.scrollIntoView!==false&&u.instance&&(b=await ll(u.fiber,u.instance,u.stateNode,80),b&&(u.rect=await _e(u.instance)));let m={nativeTag:u.nativeTag,name:u.name,testID:u.testID,label:u.label,text:u.text};rl();let S=er,v=u.fiber===null&&qa(u.stateNode)?nl():null,L=Date.now(),P=l(async C=>(await new Promise(I=>setTimeout(I,og)),{tapped:true,scrolled:b,matched:C,effect:{commits:v?v():er-S,observedMs:Date.now()-L},...g.length?{alsoMatched:g}:{}}),"fired");try{if(u.press){if(e.longPress){let I=u.press.kind==="onLongPress"?u.press.handler:u.press.longPress;return I?(I(dr(u.rect)),await P({...m,via:"onLongPress"})):{tapped:false,scrolled:b,reason:`Matched "${u.name}"${u.text?` ("${u.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...m,via:"onPress"}}}return u.press.handler(dr(u.rect)),await P({...m,via:u.press.kind})}if(u.valueControl){let I=u.valueControl,R;if(I.kind==="toggle")R=typeof e.value=="boolean"?e.value:!I.current;else{let W=I.min??0,X=I.max??1;typeof e.value=="number"?R=Math.min(X,Math.max(W,e.value)):R=I.current===X?W:X}return I.handler(R),await P({...m,via:"onValueChange",value:R})}let C=e.text??(typeof e.value=="string"?e.value:"");return u.textControl.handler(C),await P({...m,via:"onChangeText",value:C})}catch(C){return v?.(),{tapped:false,scrolled:b,reason:`handler threw: ${C instanceof Error?C.message:String(C)}`,matched:{...m,via:u.press?u.press.kind:u.valueControl?"onValueChange":"onChangeText"}}}}l(pl,"tapElement");var ag=5e3,lg=3e4,sg=50,cg=150;async function ml(e){if(!(e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim()))return{ok:false,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."};let t=Math.min(Math.max(e.timeoutMs??ag,0),lg),n=Math.max(e.pollMs??cg,sg),o=e.gone===true,r=Date.now(),i=0;for(;;){i+=1;let{hit:s,closest:a}=await fl(e);if(o?!s:s)return{ok:true,waitedMs:Date.now()-r,polls:i,matched:s??void 0};if(Date.now()-r>=t){let c=a?.length?a:void 0,u=o?`Still on screen after ${t}ms.`:c?`Not on screen after ${t}ms \u2014 ${c.length===1?"one element":`${c.length} elements`} matched but ${c.some(d=>d.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${t}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:false,waitedMs:Date.now()-r,polls:i,reason:u,matched:s??void 0,closest:c}}await new Promise(c=>setTimeout(c,n))}}l(ml,"waitFor");async function fl(e){let t=zn(e).map(a=>({c:a,score:Vn(a,e)})).filter(a=>a.score>0).sort((a,c)=>c.score-a.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await sr(t.map(a=>a.c));let n=Ze.get("window"),o=Math.round(n.width)||1,r=Math.round(n.height)||1,i=null;for(let{c:a}of t)if(xn(a.rect,o,r)){i={nativeTag:a.nativeTag,name:a.name,testID:a.testID,label:a.label,text:a.text,interactive:!!(a.press||a.valueControl||a.textControl)};break}let s=t.slice(0,3).map(({c:a})=>({name:a.name,testID:a.testID,text:a.text,onScreen:xn(a.rect,o,r)}));return{hit:i,closest:s}}l(fl,"findOnScreen");function An(e){let t=e,n=0;for(;t&&n<400;){if(le(t)?.__buoyDevToolsRoot)return true;t=t.return,n++}return false}l(An,"isBuoyChrome");function yl(e,t){let n=le(e.fiber);if(typeof n?.onPress=="function"||typeof n?.onValueChange=="function"||typeof n?.onChangeText=="function")return e;let o=null,r=e.fiber?.return,i=0;for(;r&&i<25;){if(typeof le(r)?.onPress=="function"){o=r;break}r=r.return,i++}if(!o)return e;let s=o;for(let a=0;a<6&&s;a++){let c=t.get(s);if(c)return c;s=s.return}return e}l(yl,"preferHandlerOwner");function Hn(e){let t=Ln();if(t.length===0)return null;let n=new Map;for(let a of t)n.set(a.fiber,a);let o=t.find(a=>a.nativeTag===e),r=null;if(!o){for(let a of $e())if(Ae(a.current,c=>{r||c.stateNode&&tt(c.stateNode)===e&&(r=c)}),r)break}let i=o??null;if(!i&&r){let a=r,c=0,u=null;for(;a&&c<25;){let d=n.get(a);if(d){if(d.press||d.valueControl||d.textControl){i=d;break}u||(u=d)}a=a.return,c++}i||(i=u)}if(!i||(i=yl(i,n),!i.press&&!i.valueControl&&!i.textControl)||An(i.fiber))return null;let s=i.valueControl?i.valueControl.kind:i.textControl?"text":"press";return{nativeTag:i.nativeTag,name:i.name,role:i.role,testID:i.testID,label:i.label,text:i.text,control:s,value:i.valueControl?i.valueControl.current:i.textControl?i.textControl.current:void 0}}l(Hn,"resolveTouchTarget");function bl(e){let t=null;for(let n of $e())if(Ae(n.current,o=>{!t&&o.stateNode&&tt(o.stateNode)===e&&(t=o)}),t)break;return t}l(bl,"fiberForTag");function gr(){let e=[];for(let t of $e()){let n=t.current?.child,o=0;for(;n&&o++<200;){if(n.tag===Dn&&n.stateNode){e.push(n);break}n=n.child}}return e}l(gr,"rootHostFibers");function vl(e,t){let n=globalThis.nativeFabricUIManager;if(!n||typeof n.findNodeAtPoint!="function")return null;let o=gr().filter(r=>r.stateNode?.node);return o.length?new Promise(r=>{let i=setTimeout(()=>r(null),1e3),s=o.length,a=null;o.forEach((c,u)=>{try{n.findNodeAtPoint(c.stateNode.node,e,t,d=>{d&&(!a||u>=a.i)&&(a={i:u,fiber:d}),--s===0&&(clearTimeout(i),r(a?.fiber??null))})}catch{--s===0&&(clearTimeout(i),r(a?.fiber??null))}})}):null}l(vl,"fabricFiberAt");function Cl(e,t){let n=Xt?.findSubviewIn;if(typeof n!="function")return null;let o=gr()[0],r=o?tt(o.stateNode)??Rt(o.stateNode):null;return r==null?null:new Promise(i=>{let s=setTimeout(()=>i(null),1e3);try{n.call(Xt,r,[e,t],a=>{clearTimeout(s),i(typeof a=="number"?bl(a):null)})}catch{clearTimeout(s),i(null)}})}l(Cl,"paperFiberAt");function Tl(){let e=[],t=new Set,n=l(r=>{let i=[],s=l((a,c)=>{for(let u=a;u&&i.length<5e3;u=u.sibling)t.has(u)||c>500||nr(u)||ir(u)||(u.tag===Dn&&u.stateNode?i.push(u):u.child&&s(u.child,c+1))},"dig");return r.child&&s(r.child,0),i},"hostChildren"),o=l((r,i)=>{t.has(r)||i>500||(t.add(r),e.push(r),hr(n(r)).forEach(s=>o(s,i+1)))},"walk");for(let r of $e())hr(n(r.current)).forEach(i=>o(i,0));return e}l(Tl,"visibleHostFibers");function hr(e){let t=e.map(n=>{let o=Number(En(le(n)?.style).zIndex);return Number.isFinite(o)?o:0});return e.map((n,o)=>({h:n,i:o})).sort((n,o)=>t[n.i]-t[o.i]||n.i-o.i).map(({h:n})=>n)}l(hr,"sortByZ");function En(e,t=0){return!e||typeof e!="object"||t>10?{}:Array.isArray(e)?Object.assign({},...e.map(n=>En(n,t+1))):e}l(En,"flatStyle");var ug=new Set(["RCTScrollView","AndroidHorizontalScrollView","RCTScrollContentView"]);function wl(e){if(typeof e.type=="string"&&ug.has(e.type)&&e.type!=="RCTScrollContentView")return true;let t=En(le(e)?.style).overflow;return t==="hidden"||t==="scroll"}l(wl,"clipsChildren");function Sl(e){let t=le(e)?.pointerEvents??le(e)?.style?.pointerEvents;if(t==="none")return"all";let n=e.return,o=0;for(;n&&o++<200;){let r=le(n)?.pointerEvents??le(n)?.style?.pointerEvents;if(r==="none"||r==="box-only"&&n.tag===Dn)return"all";n=n.return}return t==="box-none"?"self":null}l(Sl,"passesTouchesThrough");async function xl(e,t,n){let o=await Promise.all(n.map(a=>{let c=Rn(a.stateNode);return c?_e(c):Promise.resolve(null)})),r=new Map;n.forEach((a,c)=>r.set(a,o[c]));let i=l(a=>!!a&&e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height,"inside"),s=l(a=>{for(let c=a.return,u=0;c&&u<300;c=c.return,u++)if(c.tag===Dn&&r.has(c)&&wl(c)&&!i(r.get(c)))return true;return false},"clippedAway");for(let a=n.length-1;a>=0;a--)if(!(!i(o[a])||Sl(n[a])||s(n[a])))return n[a];return null}l(xl,"measuredFiberAt");function Il(e,t){let n=globalThis.document,o=globalThis.window;if(!n?.elementFromPoint||!o)return null;let r=n.elementFromPoint(e*o.innerWidth,t*o.innerHeight);for(;r;){let i=Object.keys(r).find(s=>s.startsWith("__reactFiber$"));if(i)return r[i];r=r.parentElement}return null}l(Il,"domFiberAt");function Dl(e,t){let n=globalThis.document,o=globalThis.window;if(!n?.elementFromPoint||!o)return null;let r=n.elementFromPoint(e*o.innerWidth,t*o.innerHeight);if(!r)return null;for(let d=r;d;d=d.parentElement)if(Object.keys(d).some(g=>g.startsWith("__reactFiber$")||g.startsWith("__reactContainer$")))return null;let i=!!r.closest("[data-buoy-root]"),s=lr(),a=s.find(d=>d.stateNode===r),c;for(let d=r;d&&!c;d=d.parentElement)c=s.find(g=>g.stateNode===d&&(g.press||g.valueControl||g.textControl));let u=[];for(let d=r;d&&u.length<6;d=d.parentElement){let g=In(d);g!==d.tagName.toLowerCase()&&u[u.length-1]!==g&&u.push(g)}return{found:true,method:"dom",buoy:i,view:{name:In(r),nativeTag:Jo(r),testID:a?.testID,label:a?.label,text:a?.text},path:u,target:c&&!i?{nativeTag:c.nativeTag,name:c.name,role:c.role,testID:c.testID,label:c.label,text:c.text,control:c.valueControl?c.valueControl.kind:c.textControl?"text":"press",value:c.valueControl?c.valueControl.current:c.textControl?.current}:null}}l(Dl,"domPageHit");async function Rl(e){let t=Math.min(1,Math.max(0,Number(e?.x))),n=Math.min(1,Math.max(0,Number(e?.y)));if(!Number.isFinite(t)||!Number.isFinite(n))return{found:false,method:"none",reason:"x and y must be numbers from 0 to 1."};let o=Ze.get("window"),r=t*o.width,i=n*o.height,s="none",a=null,c=Il(t,n),u=c?null:Dl(t,n);if(u)return u;if(c)s="dom",a=c;else{let m=vl(r,i);if(m)s="fabric",a=await m;else{let v=Cl(r,i);v&&(s="paper",a=await v)}let S=Tl();(!a||!new Set(S).has(a))&&(a=await xl(r,i,S),s="measured")}if(!a)return{found:false,method:s};let d=le(a)??{},g=tt(a.stateNode),T=[],f=a,b=0;for(;f&&b++<80&&T.length<6;){let m=Oe(f);m&&typeof f.type!="string"&&!Qo.has(m)&&T[T.length-1]!==m&&T.push(m),f=f.return}return{found:true,method:s,buoy:An(a),view:{name:Oe(a)??"Unknown",nativeTag:g,testID:d.testID||void 0,label:d.accessibilityLabel||d["aria-label"]||void 0,text:Nn(d)},path:T,target:g!=null?Hn(g):null}}l(Rl,"hitTest");async function kl(){let e=[];for(let o of $e())Ae(o.current,r=>{let i=r.stateNode;r.tag===1&&i&&typeof i.getCamera=="function"&&!An(r)&&e.push(r)});let t=Ze.get("window"),n=l(o=>Promise.race([o,new Promise(r=>setTimeout(()=>r(null),1e3))]),"timeout");return{maps:(await Promise.all(e.slice(0,5).map(async o=>{try{let r=await n(Promise.resolve(o.stateNode.getCamera()));if(!r)return null;let i=kn(o),s=i?await _e(i.instance):null,a=le(o)??{};return{name:Oe(o)??"Map",testID:typeof a.testID=="string"?a.testID:void 0,frame:s&&t.width&&t.height?{x:ke(s.x/t.width),y:ke(s.y/t.height),width:ke(s.width/t.width),height:ke(s.height/t.height)}:void 0,camera:{heading:typeof r.heading=="number"?r.heading:void 0,pitch:typeof r.pitch=="number"?r.pitch:void 0,altitude:typeof r.altitude=="number"?r.altitude:void 0,zoom:typeof r.zoom=="number"?r.zoom:void 0,center:r.center}}}catch{return null}}))).filter(o=>!!o)}}l(kl,"readMaps");Tn();U();U();function Pl(e){return!!e&&typeof e=="object"&&("next"in e||"queue"in e||"memoizedState"in e)}l(Pl,"isHookList");function pr(e,t,n){if(e===t)return false;if(n?.isClassComponent||!Pl(t))return true;let o=e,r=t;for(let i=0;r!=null&&i<64;i++){if(r.queue!=null&&(o==null||!Object.is(o.memoizedState,r.memoizedState)))return true;r=r.next,o=o!=null?o.next:null}return false}l(pr,"hookStateChanged");function Nl(e,t){return pr(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===1})}l(Nl,"ownStateChanged");var Ll={RCTText:{alwaysTrack:["children"],skip:[],description:"Text component - children is the displayed content"},RCTVirtualText:{alwaysTrack:["children"],skip:[],description:"Virtual Text (nested) - children is the displayed content"},RCTView:{alwaysTrack:[],skip:["children"],description:"View container - children are React elements"},RCTImageView:{alwaysTrack:["source"],skip:["children"],description:"Image - source contains the image URL/require"},RCTTextInput:{alwaysTrack:["value","defaultValue"],skip:["children"],description:"TextInput - value is the input content"},RCTSwitch:{alwaysTrack:["value"],skip:["children"],description:"Switch - value is the toggle state"},default:{alwaysTrack:[],skip:["children"],description:"Unknown component type"}};function zl(e){return e&&Ll[e]||Ll.default}l(zl,"getComponentPropConfig");var Fn=new WeakMap;function Mn(e){if(!e)return;let t=Fn.get(e);if(t||e.alternate&&(t=Fn.get(e.alternate),t))return t}l(Mn,"getComponentFiberPrevState");function Bl(e,t){e&&(Fn.set(e,t),e.alternate&&Fn.set(e.alternate,t))}l(Bl,"setComponentFiberState");var Ie=new Map,mr=500,dg=10,fr=50,Vl=50,gg=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","Fragment","Suspense","Provider","Consumer","Context","ForwardRef","Unknown","Component"]);function yr(e){return!!(!e||gg.has(e)||e.startsWith("Animated"))}l(yr,"isInternalComponentName");function br(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=t.tag;if(r===0||r===1||r===11||r===15){let i=He(t);if(o||(o=t),!yr(i))return t}t=t.return,n++}return o}l(br,"getOwningComponentFiber");function He(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.displayName)return t.displayName;if(t.name)return t.name}return null}l(He,"getComponentNameFromFiber");function Al(e){if(!e||typeof e!="object")return"unknown";if(e.queue!==null&&e.queue!==void 0)return"useState";let t=e.memoizedState;if(t!==null&&typeof t=="object"&&!Array.isArray(t)&&"current"in t&&Object.keys(t).length===1)return"useRef";if(Array.isArray(t)&&t.length===2){let[,n]=t;if(Array.isArray(n)||n===null)return typeof t[0]=="function"?"useCallback":"useMemo"}return t!==null&&typeof t=="object"&&!Array.isArray(t)&&("tag"in t||"create"in t||"destroy"in t)?"useEffect":"unknown"}l(Al,"detectHookType");function Hl(e,t){let n=e?.memoizedState;switch(t){case"useState":case"useReducer":return n;case"useRef":return n?.current;case"useMemo":case"useCallback":return Array.isArray(n)?n[0]:n;case"useEffect":return"[effect]";default:return n}}l(Hl,"extractHookValue");function nt(e){if(!e?.memoizedState)return null;let t=e.memoizedState;if(typeof t!="object"||t===null||!("next"in t)&&!("queue"in t)&&!("memoizedState"in t))return null;let n=[],o=t,r=0;for(;o!==null&&r<fr;){let i=Al(o),s=Hl(o,i);n.push({index:r,type:i,value:s,rawState:o.memoizedState}),o=o.next,r++}return n.length>0?n:null}l(nt,"extractHookStates");function El(e,t){if(!e||!t)return null;let n=[],o=Math.max(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],s=t[r];if(!i&&s){n.push({index:r,type:s.type,currentValue:tn(s.value,s.type),description:`Hook[${r}] added`});continue}if(i&&!s){n.push({index:r,type:i.type,previousValue:tn(i.value,i.type),description:`Hook[${r}] removed`});continue}if(i&&s){if(i.rawState===s.rawState||s.type==="useEffect"||s.type==="useMemo"||s.type==="useCallback")continue;if(s.type==="useState"||s.type==="useReducer"||s.type==="useRef"){let a=tn(i.value,i.type),c=tn(s.value,s.type);n.push({index:r,type:s.type,previousValue:a,currentValue:c,description:`${a} \u2192 ${c}`})}}}return n.length>0?n:null}l(El,"compareHookStates");function tn(e,t){return ot(e)}l(tn,"formatHookValue");function ot(e){if(e===null)return null;if(e!==void 0)return typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?e.length>30?e.slice(0,30)+"...":e:typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`{Object: ${Object.keys(e).length} keys}`:String(e)}l(ot,"formatDisplayValue");function Fl(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e,n=e.alternate,o=Mn(e);if(o&&n){let c=nt(e),u=nt(n),d=o.extractedHooks;if(c&&u&&d&&d.length>0){let g=d.find(T=>T.type==="useState");if(g){let T=c.find(b=>b.index===g.index),f=u.find(b=>b.index===g.index);if(T&&f){let b=T.value===g.value,m=f.value===g.value;b&&!m&&(t=n,n=e)}}}}let r=nt(t),i=null,s=null,a=null;return n?(i=n.memoizedProps,s=n.memoizedState,a=nt(n)):o&&(i=o.memoizedProps,s=o.memoizedState,a=o.extractedHooks),Bl(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:r}),i===null?{cause:"mount",hookChanges:null}:$n(i,t.memoizedProps)?pr(s,t.memoizedState,{isClassComponent:t.tag===1})?{cause:"state",hookChanges:El(a,r)}:{cause:"parent",hookChanges:null}:{cause:"props",hookChanges:null}}l(Fl,"detectComponentCause");function $n(e,t){if(e===t)return true;if(!e||!t||typeof e!="object"||typeof t!="object")return false;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return false;for(let r of n)if(e[r]!==t[r])return false;return true}l($n,"shallowEqual");function rt(e,t=3){let n=new WeakSet;function o(r,i){if(i>t)return"[MAX_DEPTH]";if(r===null)return null;if(r===void 0)return;if(typeof r=="function")return`[Function: ${r.name||"anonymous"}]`;if(typeof r=="symbol")return`[Symbol: ${r.toString()}]`;if(typeof r!="object")return r;if(n.has(r))return"[Circular]";if(n.add(r),Array.isArray(r))return r.slice(0,10).map(c=>o(c,i+1));let s={},a=Object.keys(r).slice(0,20);for(let c of a)try{s[c]=o(r[c],i+1)}catch{s[c]="[Error accessing]"}return s}return l(o,"stringify"),o(e,0)}l(rt,"safeStringify");function kt(e){return e===void 0?"undefined":{0:"FunctionComponent",1:"ClassComponent",2:"IndeterminateComponent",3:"HostRoot",4:"HostPortal",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",12:"Profiler",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"}[e]||`Unknown(${e})`}l(kt,"getTagName");function Ml(e,t){if(!(!t.hookChanges||t.hookChanges.length===0))for(let n of t.hookChanges)console.log("[Buoy]",`[${e||"Unknown"}] ${n.type}[${n.index}]: ${n.previousValue} \u2192 ${n.currentValue}`)}l(Ml,"logMinimal");function $l(e,t,n,o,r){let i=He(n)||"Unknown",s=typeof t?.type=="string"?t.type:"Unknown",{cause:a,hookChanges:c}=o;if(console.log("[Buoy]",`[RENDER] ${i} (${s}:${e}) | Cause: ${a.toUpperCase()}`+(r&&r.length>0?` | Props: [${r.join(", ")}]`:"")),c&&c.length>0)for(let u of c)console.log("[Buoy]",` \u2514\u2500 ${u.type}[${u.index}]: ${u.previousValue} \u2192 ${u.currentValue}`)}l($l,"logVerbose");function vr(e,t,n,o,r,i,s){let a=He(n)||"Unknown",c=typeof t?.type=="string"?t.type:"Unknown";console.log("[Buoy]",`
27
+ [RN-BUOY RENDER DEBUG] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`),console.log("[Buoy]",`Render #${s} for ${c} (nativeTag: ${e})`),console.log("[Buoy]",`Timestamp: ${new Date().toISOString()}`),console.log("[Buoy]",`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
28
+ `),console.log("[Buoy]",`NATIVE FIBER (${c}):`),console.log("[Buoy]",` type: "${t?.type}"`),console.log("[Buoy]",` tag: ${t?.tag} (${kt(t?.tag)})`);let u=t?.alternate;console.log("[Buoy]",` Previous values source: ${u?"alternate":o?"storage":"none"}`);let d=t?.memoizedProps?.children,g=u?.memoizedProps?.children,T=g!==void 0?g:o?.memoizedProps?.children,f=T!==void 0?d!==T:false;console.log("[Buoy]",` memoizedProps.children: ${ot(d)}${f?` (was: ${ot(T)})`:T!==void 0?" (unchanged)":" (first render)"}`);let b=t?.memoizedProps?.style,m=u?.memoizedProps?.style,S=m!==void 0?m:o?.memoizedProps?.style,v=S!==void 0?b!==S:false;if(b&&(console.log("[Buoy]",` memoizedProps.style: ${JSON.stringify(rt(b,2))}${v?" (REFERENCE CHANGED)":""}`),v&&S)){let V=nn(b,S);console.log("[Buoy]",` \u2514\u2500 Values actually changed: ${!V}`)}console.log("[Buoy]",` All memoizedProps keys: [${Object.keys(t?.memoizedProps||{}).join(", ")}]`);let L=t?.memoizedProps?.testID,P=t?.memoizedProps?.nativeID,C=t?.memoizedProps?.accessibilityLabel;if(L&&console.log("[Buoy]",` testID: "${L}"`),P&&console.log("[Buoy]",` nativeID: "${P}"`),C&&console.log("[Buoy]",` accessibilityLabel: "${C}"`),console.log("[Buoy]",` alternate: ${u?"YES":"NO"}`),u&&console.log("[Buoy]",` alternate.memoizedProps.children: ${ot(g)}`),console.log("[Buoy]"," Tree structure:"),console.log("[Buoy]",` return (parent): ${t?.return?kt(t.return.tag):"null"}`),console.log("[Buoy]",` child: ${t?.child?kt(t.child.tag):"null"}`),console.log("[Buoy]",` sibling: ${t?.sibling?kt(t.sibling.tag):"null"}`),console.log("[Buoy]",""),console.log("[Buoy]",`COMPONENT FIBER (${a}):`),n){if(console.log("[Buoy]",` name: "${a}"`),console.log("[Buoy]",` type: ${typeof n.type} (${n.type?.name||n.type?.displayName||"anonymous"})`),console.log("[Buoy]",` tag: ${n.tag} (${kt(n.tag)})`),console.log("[Buoy]",` memoizedProps: ${JSON.stringify(rt(n.memoizedProps,2))}`),console.log("[Buoy]",` alternate: ${n.alternate?"YES":"NO"}`),n.alternate){console.log("[Buoy]",` ALTERNATE memoizedProps: ${JSON.stringify(rt(n.alternate.memoizedProps,2))}`);let z=!$n(n.alternate.memoizedProps,n.memoizedProps);console.log("[Buoy]",` Props changed (vs alternate): ${z?"YES":"NO"}`),console.log("[Buoy]",` ALTERNATE memoizedState: ${n.alternate.memoizedState===n.memoizedState?"SAME":"DIFFERENT"}`)}let V=Mn(n);if(V){console.log("[Buoy]",` WeakMap PREVIOUS memoizedProps: ${JSON.stringify(rt(V.memoizedProps,2))}`);let z=!$n(V.memoizedProps,n.memoizedProps);console.log("[Buoy]",` Props changed (vs WeakMap): ${z?"YES":"NO"}`)}else console.log("[Buoy]"," WeakMap PREVIOUS state: (not found - first render or WeakMap cleared)");if(n._debugOwner){let z=He(n._debugOwner);console.log("[Buoy]",` _debugOwner: "${z}"`);let ue=n._debugOwner,pe=1;for(;ue&&pe<5;){let Fe=He(ue);console.log("[Buoy]",` \u2514\u2500[${pe}] ${Fe||"unknown"} (tag: ${ue.tag})`),ue=ue._debugOwner,pe++}}let j=0,x=t._debugOwner||t.return;for(;x&&x!==n&&j<30;)x=x.return,j++;console.log("[Buoy]",` Depth from native fiber: ${j}`)}else console.log("[Buoy]"," (No component fiber found - could not walk up tree)");if(console.log("[Buoy]",""),console.log("[Buoy]","HOOKS:"),n?.memoizedState){let V=nt(n),j=n.alternate?nt(n.alternate):null,x=Mn(n),z=j||x?.extractedHooks,ue=j?"alternate":x?"WeakMap":"none";V&&V.length>0?(console.log("[Buoy]",` Total hooks: ${V.length}`),console.log("[Buoy]",` Previous values source: ${ue}`),V.forEach((pe,Fe)=>{let ye=z?.[Fe],Po=ye?ye.rawState!==pe.rawState:false,St=ye?ot(ye.value):"N/A",jt=Po?" \u2190 CHANGED":"";console.log("[Buoy]",` [${Fe}] ${pe.type}: ${ot(pe.value)}${ye?` (was: ${St})`:" (first render)"}${jt}`)})):(console.log("[Buoy]"," (Could not extract hooks - memoizedState structure not recognized)"),console.log("[Buoy]",` Raw memoizedState type: ${typeof n.memoizedState}`),console.log("[Buoy]",` Has 'next' property: ${"next"in(n.memoizedState||{})}`),console.log("[Buoy]",` Has 'queue' property: ${"queue"in(n.memoizedState||{})}`))}else console.log("[Buoy]"," (No memoizedState - class component, no hooks, or not a function component)");if(console.log("[Buoy]",""),console.log("[Buoy]","RAW HOOKS DATA:"),n?.memoizedState&&typeof n.memoizedState=="object"){let V=n.memoizedState,j=0;for(;V&&j<10;)console.log("[Buoy]",` Hook[${j}]:`),console.log("[Buoy]",` memoizedState: ${rt(V.memoizedState,2)}`),console.log("[Buoy]",` baseState: ${rt(V.baseState,2)}`),console.log("[Buoy]",` queue: ${V.queue?"[Queue present]":"null"}`),console.log("[Buoy]",` next: ${V.next?"[Next hook]":"null"}`),V=V.next,j++;j===0&&console.log("[Buoy]"," (memoizedState is not a hooks linked list)")}console.log("[Buoy]",""),console.log("[Buoy]","DETECTION RESULTS:"),console.log("[Buoy]",` Component Cause: ${r.cause.toUpperCase()}`),r.hookChanges&&r.hookChanges.length>0&&(console.log("[Buoy]"," Hook Changes Detected:"),r.hookChanges.forEach(V=>{console.log("[Buoy]",` [${V.index}] ${V.type}: ${V.previousValue} \u2192 ${V.currentValue}`),V.description&&console.log("[Buoy]",` ${V.description}`)}));let I=typeof t?.type=="string"?t.type:void 0,R=Cr(o?.memoizedProps,t?.memoizedProps,I);R&&R.length>0?console.log("[Buoy]",` Native Props Changed: [${R.join(", ")}]`):o&&console.log("[Buoy]"," Native Props Changed: (none detected)"),console.log("[Buoy]",""),console.log("[Buoy]","BATCH CONTEXT:"),console.log("[Buoy]",` Batch size: ${i.size}`),console.log("[Buoy]",` All tags in batch: [${Array.from(i).slice(0,20).join(", ")}${i.size>20?"...":""}]`);let W=Sr(t),X=W!==null&&i.has(W);if(console.log("[Buoy]",` Parent nativeTag: ${W??"not found"}`),console.log("[Buoy]",` Parent in batch: ${X?"YES":"NO"}`),i.size>1){console.log("[Buoy]"," Components in same batch:");let V=t?.return,j=0;for(;V&&j<10;){let x=xr(V.stateNode);if(x!==null&&i.has(x)){let z=He(V)||V.type;console.log("[Buoy]",` [depth ${j}] ${z} (tag: ${x})`)}V=V.return,j++}}console.log("[Buoy]",`
29
29
  \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
30
- `)}l(mo,"logComprehensiveRenderData");function $n(e,t,n,r="off"){let o=Date.now();if(!t)return{type:"unknown",timestamp:o};let i=t,s=t.alternate,a=Ie.get(e);if(a&&s){let D=a.memoizedProps?.children,W=t.memoizedProps?.children,Z=s.memoizedProps?.children,V=t.memoizedProps===a.memoizedProps||D!==void 0&&W===D,j=s.memoizedProps===a.memoizedProps||D!==void 0&&Z===D;V&&!j&&(i=s,s=t,r==="all"&&console.log("[Buoy]","[RenderCause] Detected fiber swap - using alternate as current"))}let u=null,c=null;s?(u=s.memoizedProps,c=s.memoizedState):a&&(u=a.memoizedProps,c=a.memoizedState);let d=u!==null?{memoizedProps:u,memoizedState:c,timestamp:o}:void 0,g={memoizedProps:i.memoizedProps,memoizedState:i.memoizedState,timestamp:o};Pl(e,g);let T=po(i),b=Ae(T)||void 0,v=kl(i,b)||void 0,f=Sl(T),S=f.cause,C=f.hookChanges;if(!d){if(r!=="off"){if(r==="minimal")console.log("[Buoy]",`[${b||"Unknown"}] MOUNT`);else if(r==="verbose"){let D=typeof i?.type=="string"?i.type:"Unknown";console.log("[Buoy]",`[RENDER] ${b||"Unknown"} (${D}:${e}) | Cause: MOUNT`)}else if(r==="all"){let D=Ie.has(e)?Ie.size:1;mo(e,i,T,d,f,n,D)}}return{type:"mount",timestamp:o,componentCause:"mount",componentName:b}}let N=typeof i.type=="string"?i.type:void 0,m=fo(d.memoizedProps,g.memoizedProps,N);if(r!=="off"){if(r==="minimal")xl(b,f);else if(r==="verbose")Il(e,i,T,f,m);else if(r==="all"){let D=Ie.has(e)?Ie.size:1;mo(e,i,T,d,f,n,D)}}if(m&&m.length>0)return{type:"props",changedKeys:m.slice(0,Jd),timestamp:o,componentCause:S,componentName:b,parentComponentName:v,hookChanges:C||void 0};let k=Rl(d.memoizedState,g.memoizedState);if(k&&k.length>0)return{type:"hooks",hookIndices:k,timestamp:o,componentCause:S,componentName:b,parentComponentName:v,hookChanges:C||void 0};let P=vo(i);return P&&n.has(P)?{type:"parent",timestamp:o,componentCause:S,componentName:b,parentComponentName:v,hookChanges:C||void 0}:S==="state"?{type:"state",timestamp:o,componentCause:S,componentName:b,parentComponentName:v,hookChanges:C||void 0}:S==="props"?{type:"props",timestamp:o,componentCause:S,componentName:b,parentComponentName:v}:S==="parent"?{type:"parent",timestamp:o,componentCause:S,componentName:b,parentComponentName:v}:{type:"unknown",timestamp:o,componentCause:S,componentName:b,parentComponentName:v}}l($n,"detectRenderCause");function fo(e,t,n){if(e===t||!e||!t||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return null;let r=yl(n),o=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(let s of o)if(!s.startsWith("__")&&!r.skip.includes(s)){if(s==="children"){if(!r.alwaysTrack.includes("children"))continue;let a=e[s],u=t[s];a!==u&&(yo(a)&&yo(u)?i.push(`children: ${bo(a)} \u2192 ${bo(u)}`):i.push("children (content)"));continue}if(e[s]!==t[s]){let a=e[s],u=t[s];s==="style"?tn(a,u)?i.push(`${s} (ref only)`):i.push(s):typeof a=="function"&&typeof u=="function"?i.push(`${s} (fn ref)`):i.push(s)}}return i.length>0?i:null}l(fo,"getChangedKeys");function tn(e,t,n=0){if(n>5)return false;if(e===t)return true;if(typeof e!=typeof t)return false;if(typeof e!="object"||e===null||t===null)return e===t;if(Array.isArray(e)!==Array.isArray(t))return false;if(Array.isArray(e)){if(e.length!==t.length)return false;for(let i=0;i<e.length;i++)if(!tn(e[i],t[i],n+1))return false;return true}let r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return false;for(let i of r)if(!o.includes(i)||!tn(e[i],t[i],n+1))return false;return true}l(tn,"deepEqual");function yo(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}l(yo,"isPrimitive");function bo(e){return e===null?"null":e===void 0?"undefined":typeof e=="string"?e.length>20?`"${e.slice(0,20)}..."`:`"${e}"`:typeof e=="number"||typeof e=="boolean"?String(e):"[object]"}l(bo,"formatValue");function Rl(e,t){if(e===t||e==null||t==null||typeof e!="object"||typeof t!="object")return null;let n=[],r=e,o=t,i=0;for(;o!==null&&i<go;)(r===null||Dl(r,o))&&n.push(i),o=o?.next??null,r=r?.next??null,i++;return n.length>0?n:null}l(Rl,"detectHookChanges");function Dl(e,t){return e===t?false:e.memoizedState!==t.memoizedState||e.baseState!==void 0&&e.baseState!==t.baseState}l(Dl,"didHookChange");function vo(e){let t=e?.return,n=0;for(;t&&n<vl;){if(t.stateNode){let r=Co(t.stateNode);if(r!=null)return r}t=t.return,n++}return null}l(vo,"getParentNativeTag");function kl(e,t){if(!e)return null;let n=po(e);if(!n)return null;let r=n.return,o=0;for(;r&&o<vl;){let i=r.tag;if(i===0||i===1||i===11||i===15){let s=Ae(r);if(s&&!ho(s)&&s!==t)return s}r=r.return,o++}return null}l(kl,"getParentComponentName");function Co(e){return e?typeof e.__nativeTag=="number"?e.__nativeTag:typeof e._nativeTag=="number"?e._nativeTag:typeof e.canonical?.__nativeTag=="number"?e.canonical.__nativeTag:typeof e.canonical?.publicInstance?.__nativeTag=="number"?e.canonical.publicInstance.__nativeTag:null:null}l(Co,"getNativeTagFromStateNode");function Pl(e,t){if(Ie.size>=uo){let n=Array.from(Ie.entries());n.sort((o,i)=>o[1].timestamp-i[1].timestamp);let r=Math.floor(uo/4);for(let o=0;o<r;o++)Ie.delete(n[o][0])}Ie.set(e,t)}l(Pl,"updateStoredState");function To(){Ie.clear()}l(To,"clearRenderCauseState");function Nl(e){Ie.delete(e)}l(Nl,"removeRenderCauseState");function zl(){return{storedStates:Ie.size,maxStates:uo}}l(zl,"getRenderCauseStats");var Xd=5,Ll=200,On=20,_n=30;function Ee(e,t=0,n=new WeakSet){if(e==null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e=="string")return e.length>Ll?e.slice(0,Ll)+"...":e;if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="symbol")return`[Symbol: ${e.description||""}]`;if(t>=Xd)return Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`[Object: ${Object.keys(e).length} keys]`:"[...]";if(typeof e=="object"){if(n.has(e))return"[Circular]";n.add(e)}if(Array.isArray(e)){let r=e.slice(0,On).map(o=>Ee(o,t+1,n));return e.length>On&&r.push(`[...${e.length-On} more]`),r}if(e instanceof Date)return e.toISOString();if(e instanceof Error)return`[Error: ${e.message}]`;if(e instanceof RegExp)return e.toString();if(e instanceof Map){let r={__type:"Map",__size:e.size},o=0;for(let[i,s]of e){if(o>=_n){r[`...${e.size-o} more`]=true;break}let a=typeof i=="string"?i:String(i);r[a]=Ee(s,t+1,n),o++}return r}if(e instanceof Set)return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,On).map(r=>Ee(r,t+1,n))};if(typeof e=="object"){let r={},o=Object.keys(e),i=o.slice(0,_n);for(let s of i)if(!(s.startsWith("__")||s==="children"))try{r[s]=Ee(e[s],t+1,n)}catch{r[s]="[Error accessing property]"}return o.length>_n&&(r[`...${o.length-_n} more keys`]=true),r}return"[Unknown type]"}l(Ee,"safeCloneForHistory");function Bl(e){if(e?.memoizedProps)return Ee(e.memoizedProps)}l(Bl,"capturePropsSnapshot");function Vl(e){if(!e?.memoizedState)return;let t=e.memoizedState;if(typeof t=="object"&&t!==null&&"next"in t){let n=[],r=t,o=0;for(;r&&o<go;)n.push({index:o,memoizedState:Ee(r.memoizedState)}),r=r.next,o++;return{__type:"Hooks",hooks:n}}return Ee(t)}l(Vl,"captureStateSnapshot");import{notifySubscriberCountChange as Hl}from"@buoy-gg/shared-ui/web";U();var wo=new Set(["HighlightUpdatesOverlay","HighlightUpdatesModal","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderHistoryFooter","RenderCauseBadge","TwoLevelCauseBadge","EnhancedCauseDisplay","IsolatedRenderList","IsolatedRenderListInner","StatsDisplay","StatsDisplayInner","CurrentStateView","EventStepperFooter","EventsModal","UnifiedEventList","UnifiedEventItem","UnifiedEventDetail","UnifiedEventFilters","UnifiedEventViewer","ReactQueryEventDetail","EventsCopySettingsView"]),nn=["HighlightUpdates","RenderList","RenderDetail","RenderHistory","RenderCause","EventStepper","UnifiedEvent","EventsModal","EventsCopy"],Al=new Set(["JsModalComponent","JsModal","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","FloatingTools","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","ModalHeader","TabSelector","SectionHeader","DraggableHeader","WindowControls","TreeDiffViewer","DataViewer","SplitDiffViewer","VirtualizedDataExplorer","DiffSummary","TypeLegend","IndentGuides","IndentGuidesOverlay","CyberpunkInput","DiffView","AnswerCard","DetailsSection","DetailRow","QuickActionsSection","FilterOptionCard","SearchSection","SearchSectionInner","HeaderActions","HeaderActionsInner","MainListHeader","FilterViewHeader","DetailViewHeader","FloatingMenu","FloatingDevTools","MinimizedToolsStack","MinimizedToolsContext","GlitchToolButton","ExpandablePopover","CollapsedPeek","ExpandedWrapper","DialIcon","DialMenu","DialIconItem","OnboardingTooltip","MenuLauncherIcon","DevToolsSettingsModal","SettingsModal","ImageOverlayModal","ImageOverlayStandalone","ToolCard","ToolIcon","GripVerticalIcon","UserStatus","Divider","ChevronDown","ChevronUp","ChevronLeft","ChevronRight","ChevronDownIcon","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage","PerfMonitorOverlay","PerfMonitorModal","PerfMonitorRoot","PerfHudInline","PerfDiagnostics","MetricSparkline","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","PerfHudInlineInner","PerfMonitorOverlayInner","MiniMetric","MetricRow","MetricNumber","MetricSparklineInner","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection","TaskTable","TaskRow","BusySparkline"]),So=["JsModal","ImageOverlay","PerfMonitor","PerfHud","JsTop"],El=new Set(["VirtualizedDataExplorer","TreeDiffView","TreeDiffRow","DataViewer","DiffView","DiffSummary","FloatingDevTools","FloatingMenu","FloatingBubble","MinimizedDock","DialMenu","DialItem","ExpandableSection","ChevronIcon","GlitchText","SettingsModal","SettingsRow","OnboardingFlow","DevToolsMenu"]),xo=false;function Fl(e){xo=e}l(Fl,"setCaptureBuoyToolRenders");function Io(){return xo}l(Io,"isCapturingBuoyToolRenders");var Qd=new Set(["PerfHudInline","PerfHudInlineInner","PerfDiagnostics","MetricSparkline","MetricSparklineInner","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","MiniMetric","MetricRow","MetricNumber","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection"]);function Ro(e){return e.startsWith("PerfMonitor")||e.startsWith("PerfHud")||Qd.has(e)}l(Ro,"isPerfMonitorComponentName");var Zd=new Set(["TaskTable","TaskRow","BusySparkline"]);function Ml(e){return e.startsWith("JsTop")||Zd.has(e)}l(Ml,"isJsTopComponentName");function $l(e){if(wo.has(e))return true;for(let t=0;t<nn.length;t++)if(e.startsWith(nn[t]))return true;if(xo)return Ro(e)||Ml(e);if(Al.has(e)||El.has(e))return true;for(let t=0;t<So.length;t++)if(e.startsWith(So[t]))return true;return false}l($l,"isDevToolsComponentName");function Ol(e){if(wo.has(e))return true;for(let t=0;t<nn.length;t++)if(e.startsWith(nn[t]))return true;return false}l(Ol,"isRenderLoopUnsafeName");var se=false,it=false,We=false,we=false,ae=null,Pe=null,Wn=null,rn=null,_l=false,Se=false,Un=new Set,Do=new Set,ko=new Map,Po=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],eg=false;function J(e,t){eg&&(t!==void 0?console.log("[Buoy]",`[HighlightUpdates] ${e}`,t):console.log("[Buoy]",`[HighlightUpdates] ${e}`))}l(J,"debugLog");function jn(e){let t=Fu(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"?n:null}l(jn,"getPublicInstance");function at(e){let t=Ia(e);if(t!==null)return t;if(e==null)return null;let n=e;if(n.__nativeTag!=null)return n.__nativeTag;if(n._nativeTag!=null)return n._nativeTag;if(n.nativeTag!=null)return n.nativeTag;if(n.canonical){if(n.canonical.__nativeTag!=null)return n.canonical.__nativeTag;if(n.canonical._nativeTag!=null)return n.canonical._nativeTag;if(n.canonical.nativeTag!=null)return n.canonical.nativeTag}return null}l(at,"getNativeTag");function Gn(e){let t=e,n={viewType:"Unknown"};t?.canonical?.viewConfig?.uiViewClassName?n.viewType=t.canonical.viewConfig.uiViewClassName:t?.viewConfig?.uiViewClassName?n.viewType=t.viewConfig.uiViewClassName:Ra(t)&&(n.viewType=t.tagName.toLowerCase());let r=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Fr(t),o=t?.canonical?.currentProps,i=t?.canonical?.pendingProps,s=r?.pendingProps,a=r?.memoizedProps;return n.testID=o?.testID||i?.testID||s?.testID||a?.testID||s?.["data-testid"]||a?.["data-testid"]||void 0,n.nativeID=o?.nativeID||i?.nativeID||s?.nativeID||a?.nativeID||s?.id||a?.id||void 0,n.accessibilityLabel=o?.accessibilityLabel||i?.accessibilityLabel||s?.accessibilityLabel||a?.accessibilityLabel||s?.["aria-label"]||a?.["aria-label"]||void 0,n.componentName=Kl(r)||void 0,n}l(Gn,"extractComponentInfo");var Wl=false,tg=false,No=null;var ng=new Set;var rg=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]),og=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]),lt=new Map,Ul=500;function jl(){lt.clear()}l(jl,"clearDevToolsCache");function zo(e){return e?!!(rg.has(e)||e.startsWith("__highlight_")):false}l(zo,"isHighlightOverlayNativeID");function Lo(e){if(!e)return false;if(og.has(e))return true;let t=e.charCodeAt(0);return!!(t===95&&e.startsWith("__rn_buoy__")||t===108&&e.startsWith("logbox"))}l(Lo,"isOtherDevToolsNativeID");function Bo(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.displayName)return t.displayName;if(t.name)return t.name}let n=e.elementType;if(n){if(n.displayName)return n.displayName;if(n.name)return n.name}return null}l(Bo,"getComponentName");var ig=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","ScreenContainer","ScreenStack","Screen","ScreenContentWrapper","Svg","G","Path","Rect","Circle","Line","Polygon","Polyline","Ellipse","Text as SVGText","TSpan","TextPath","Use","Symbol","Defs","ClipPath","LinearGradient","RadialGradient","Stop","Mask","Pattern","Image as SVGImage","SafeAreaProvider","SafeAreaView","SafeAreaListener","GestureHandlerRootView","GestureDetector","ReanimatedView","ReanimatedText","ReanimatedImage","ReanimatedScrollView","Fragment","Suspense","Provider","Consumer","Context","ForwardRef"]);function Gl(e){return!!(!e||ig.has(e)||e==="Unknown"||e==="Component"||e.startsWith("Animated"))}l(Gl,"isInternalComponent");function Kl(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,r=null;for(;t&&n<30;){let o=Bo(t);if(o&&typeof t.type!="string"&&(r||(r=o),!Gl(o)))return o;t=t.return,n++}return r}l(Kl,"getOwningComponentName");function ql(e){let t=e,n=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Fr(t),r=at(e)||at(t?.canonical?.publicInstance),o=Io(),i=!o&&B.getSettings().excludeDevTools;if(i&&Ra(e)&&e.closest("[data-buoy-root]"))return true;if(r!=null&&i){let u=lt.get(r);if(u!==void 0)return u}let s=false,a=n?.pendingProps?.nativeID||n?.memoizedProps?.nativeID||t?.canonical?.currentProps?.nativeID||null;if((zo(a)||i&&Lo(a))&&(s=true),!s&&n){let u=n,c=0;for(;u&&c<30;){let d=Bo(u);if(d){if(wo.has(d)){s=true;break}for(let T of nn)if(d.startsWith(T)){s=true;break}if(s)break;if(o&&Ro(d)){s=true;break}if(i){if(Al.has(d)||El.has(d)){s=true;break}for(let T of So)if(d.startsWith(T)){s=true;break}if(s)break}}let g=u.pendingProps?.nativeID||u.memoizedProps?.nativeID;if(zo(g)){s=true;break}if(i&&Lo(g)){s=true;break}u=u.return,c++}}if(s&&r!=null&&i){if(lt.size>=Ul){let u=Array.from(lt.keys());for(let c=0;c<Ul/2;c++)lt.delete(u[c])}lt.set(r,s)}return s}l(ql,"isOurOverlayNode");function Vo(e){let t=Math.min(e-1,Po.length-1);return Po[Math.max(0,t)]}l(Vo,"getColorForRenderCount");function Jl(e){if(e.size===0||!se&&!We||B.getState().isPaused)return;Qe.isEnabled()&&pa();let t=B.getBatchSize(),n=Qe.startBatch(e.size,t),r=[],o=0,i=0,s=B.hasActiveFilters();for(let c of e)if(c&&typeof c=="object")try{if(ql(c)){o++;continue}let d=jn(c),g=at(c)||at(d);if(g==null)continue;let T=Gn(c);if(s&&!B.passesFilters(T)){i++;continue}let b=B.getSettings().showRenderCount,v,f;b?(v=(ko.get(g)||0)+1,ko.set(g,v),f=Vo(v)):(v=0,f=Po[0]),r.push({node:c,color:f,count:v})}catch{}if(n.markFilteringComplete(o+i,r.length),r.length===0){n.finish();return}Wl&&console.log("[Buoy]",`[HighlightUpdates] ${r.length} component(s) re-rendered`);let a=B.getRenderEventCallbackCount()>0;if(!Pe&&!a){Wl&&console.log("[Buoy]","[HighlightUpdates] No highlightCallback and no event callbacks - skipping render"),_l=false;return}n.markMeasurementStart();let u=r.slice(0,t*4).map(({node:c,color:d,count:g})=>new Promise(T=>{let b=false,v=l(m=>{b||(b=true,clearTimeout(f),T(m))},"settle"),f=setTimeout(()=>v({rect:null,stateNode:c,color:d,count:g}),500),S=jn(c),C=at(c)||at(S);if(C==null){v({rect:null,stateNode:c,color:d,count:g});return}let N=l((m,k,P,D,W,Z)=>{if(W==null||Z==null||P==null||D==null){v({rect:null,stateNode:c,color:d,count:g});return}v({rect:{id:C,x:W,y:Z,width:P,height:D,color:d,count:g},stateNode:c,color:d,count:g})},"onMeasured");if(!S){let m=c.node,k=globalThis.nativeFabricUIManager;if(m&&k?.measure){try{k.measure(m,N)}catch{v({rect:null,stateNode:c,color:d,count:g})}return}v({rect:null,stateNode:c,color:d,count:g});return}try{S.measure(N)}catch{v({rect:null,stateNode:c,color:d,count:g})}}));Promise.all(u).then(c=>{let d=c.filter(T=>T.rect!==null),g=d.map(T=>T.rect);n.markMeasurementComplete(d.length,c.length-d.length),g.length>0&&Pe&&se&&!it&&Pe(g),setTimeout(()=>{try{for(let f of d)f.rect&&Ho(f.rect.id,f.stateNode)}catch(f){J("registerTrackedNode batch failed",f)}let T=B.getSettings(),b=T.trackRenderCauses&&T.showRenderCount,v=null;if(b){v=new Set;for(let{rect:f}of d)f&&v.add(f.id)}if(se){B.startBatch();for(let{rect:f,stateNode:S,color:C,count:N}of d)if(f){let m=Gn(S),k;if(b&&v){let P=Kn(S);k=$n(f.id,P,v,T.debugLogLevel)}B.trackRender({nativeTag:f.id,viewType:m.viewType,testID:m.testID,nativeID:m.nativeID,accessibilityLabel:m.accessibilityLabel,componentName:m.componentName,measurements:{x:f.x,y:f.y,width:f.width,height:f.height},color:C,count:N,renderCause:k})}B.endBatch()}else for(let{rect:f,stateNode:S,color:C,count:N}of d)if(f){let m=Gn(S),k;if(b&&v){let P=Kn(S);k=$n(f.id,P,v,T.debugLogLevel)}B.emitRenderEvent({nativeTag:f.id,viewType:m.viewType,testID:m.testID,nativeID:m.nativeID,accessibilityLabel:m.accessibilityLabel,componentName:m.componentName,measurements:{x:f.x,y:f.y,width:f.width,height:f.height},color:C,count:N,renderCause:k})}n.markTrackingComplete(),n.markCallbackComplete(),n.finish()},0)}).catch(c=>{console.error("[Buoy]","[HighlightUpdates] Error in measurement pipeline:",c),n.finish()})}l(Jl,"handleTraceUpdates");var Yl=globalThis.WeakRef,Pt=new Map;function Ho(e,t){if(!(e==null||t==null||typeof t!="object"))try{Pt.set(e,Yl?new Yl(t):{deref:l(()=>t,"deref")})}catch{Pt.set(e,{deref:l(()=>t,"deref")})}}l(Ho,"registerTrackedNode");function Xl(e){let t=Pt.get(e)?.deref();return t||Pt.delete(e),t??null}l(Xl,"derefNode");function Ql(e){return new Promise(t=>{try{e.measure((n,r,o,i,s,a)=>{s==null||a==null||o==null||i==null?t(null):t({x:s,y:a,width:o,height:i})})}catch{t(null)}})}l(Ql,"measureNode");function Kn(e){let t=e;return t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Fr(t)||null}l(Kn,"getFiberFromNode");function Zl(e){let t=Kn(e),n=0;for(;t&&n++<200;){let r=t.stateNode;if(r&&typeof r.scrollTo=="function"){let o=typeof r.getNativeScrollRef=="function"&&r.getNativeScrollRef()||null,i=typeof r.getInnerViewNode=="function"&&r.getInnerViewNode()||typeof r.getScrollableNode=="function"&&r.getScrollableNode()||r;return{instance:r,nativeRef:o,innerNode:i}}t=t.return}return null}l(Zl,"findScrollAncestor");async function es(e,t,n){try{let r=Zl(e);if(!r)return false;let o=t,i=null,s=l(a=>new Promise(u=>{let c=false,d=l(T=>{c||(c=true,u(T))},"settle"),g=setTimeout(()=>d(null),600);try{a(T=>{clearTimeout(g),d(T)})}catch{clearTimeout(g),d(null)}}),"withTimeout");if(r.nativeRef&&typeof o.measureLayout=="function"&&(i=await s(a=>o.measureLayout(r.nativeRef,(u,c)=>a(c),()=>a(null)))),i==null){let a=Dt(t),u=typeof r.innerNode=="number"?r.innerNode:Dt(r.innerNode);a!=null&&u!=null&&(i=await s(c=>Xt.measureLayout(a,u,()=>c(null),(d,g)=>c(g))))}return i==null?false:(r.instance.scrollTo({y:Math.max(0,i-n),animated:false}),await new Promise(a=>setTimeout(a,80)),true)}catch{return false}}l(es,"scrollDescendantIntoView");function ts(e,t){let n=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)],r=0;for(let o of n){if(!o)continue;let i=o.toLowerCase();if(i===t)return 3;i.startsWith(t)?r=Math.max(r,2):i.includes(t)&&(r=Math.max(r,1))}return r}l(ts,"matchScore");async function ns(e){let t=e.scrollIntoView!==false,n=typeof e.margin=="number"?e.margin:12,r=B.getRenders(),o=l(async()=>{let C=await Ln(),N=(e.query??"").trim().toLowerCase(),m;for(let D of C.elements){if(e.nativeTag!=null&&D.nativeTag===e.nativeTag){m={el:D,score:1e3};break}let W=Zt({nativeTag:D.nativeTag,testID:D.testID,label:D.label,text:D.text,name:D.name,tap:D.tap},{query:N||void 0,nativeTag:e.nativeTag});W<=0||(!m||W>m.score)&&(m={el:D,score:W})}if(!m?.el.frame)return{matched:false,reason:"no-match",candidates:[]};let k=C.screen,P=m.el.frame;return{matched:true,live:true,rect:{x:P.x*k.width,y:P.y*k.height,width:P.width*k.width,height:P.height*k.height},scale:Wr.get(),screen:{width:k.width,height:k.height},nativeTag:m.el.nativeTag??void 0,componentName:m.el.name,testID:m.el.testID}},"locateFromScreen");if(r.length===0)return o();let i=(e.query??"").trim().toLowerCase(),s=i?r.map(C=>({r:C,score:ts(C,i)})).filter(C=>C.score>0).sort((C,N)=>N.score-C.score||N.r.lastRenderTime-C.r.lastRenderTime):[],a=s.slice(0,8).map(({r:C})=>({nativeTag:C.nativeTag,componentName:C.componentName,testID:C.testID,nativeID:C.nativeID,viewType:C.viewType,renderCount:C.renderCount})),u=e.nativeTag??(s.length>0?s[0].r.nativeTag:void 0);if(u==null){let C=await o();return C.matched?C:{matched:false,reason:"no-match",candidates:a}}let c=r.find(C=>C.nativeTag===u),d=null,g=false,T=false,b=Xl(u);if(b){let C=jn(b);C&&(t&&(T=await es(b,C,n)),d=await Ql(C),g=!!d)}if(!d&&c?.measurements&&(d={...c.measurements}),!d)return{matched:false,reason:"no-measurement",nativeTag:u,candidates:a};let v=Wr.get(),f=Ze.get("window"),S=d.x>=-1&&d.y>=-1&&d.x+d.width<=f.width+1&&d.y+d.height<=f.height+1;return{matched:true,live:g,scrolled:T,inView:S,rect:d,scale:v,screen:{width:f.width,height:f.height},nativeTag:u,componentName:c?.componentName,testID:c?.testID,candidates:a}}l(ns,"locateComponent");function Ao(e){if(!ae?.rendererInterfaces){J("No rendererInterfaces available");return}let t=0;if(ae.rendererInterfaces.forEach((n,r)=>{if(typeof n.setTraceUpdatesEnabled=="function")try{n.setTraceUpdatesEnabled(e),t++,J(`Renderer ${r}: setTraceUpdatesEnabled(${e})`)}catch(o){J(`Renderer ${r}: error setting trace updates`,o)}else J(`Renderer ${r}: no setTraceUpdatesEnabled method`)}),J(`Set trace updates ${e?"enabled":"disabled"} on ${t} renderer(s)`),ae.reactDevtoolsAgent?.setTraceUpdatesEnabled)try{ae.reactDevtoolsAgent.setTraceUpdatesEnabled(e),J("Also set trace updates on agent")}catch(n){J("Error setting trace updates on agent",n)}}l(Ao,"setTraceUpdatesOnRenderers");function Eo(){ae&&(rn||(J("Subscribing to traceUpdates event"),typeof ae.sub=="function"?(rn=ae.sub("traceUpdates",Jl),J("Subscribed using hook.sub()")):J("hook.sub not available, traceUpdates may not work"),Ao(true)))}l(Eo,"subscribeToTraceUpdates");function qn(){Ao(false),rn&&(rn(),rn=null,J("Unsubscribed from traceUpdates event"))}l(qn,"unsubscribeFromTraceUpdates");function Fo(e){Pe=e,J(`Highlight callback ${e?"set":"cleared"}`)}l(Fo,"setHighlightCallback");function rs(e){Wn=e,J(`Badge press callback ${e?"set":"cleared"}`)}l(rs,"setBadgePressCallback");function os(){return Wn}l(os,"getBadgePressCallback");function is(e){Wn&&Wn(e)}l(is,"handleBadgePress");var Mo=null,Jn=null;function as(e){Mo=e,e&&Jn!==null&&e(Jn)}l(as,"setSpotlightCallback");function ls(e){if(me){me("setSpotlight",{nativeTag:e});return}Jn=e,Mo&&Mo(e)}l(ls,"setSpotlight");var me=null;function ss(e){me=e}l(ss,"setRemoteHandler");function cs(e){se!==e.enabled&&(se=e.enabled,Yn()),Se!==e.frozen&&(Se=e.frozen,on())}l(cs,"replaceRemoteState");function us(){return Jn}l(us,"getSpotlight");function Yn(){Do.forEach(e=>{try{e(se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in state listener:",t)}})}l(Yn,"notifyStateListeners");function $o(e){return Do.add(e),e(se),()=>{Do.delete(e)}}l($o,"subscribe");function ds(e){if(typeof ee<"u"&&!ee)return{recordRenders:l(()=>{},"recordRenders"),disconnect:l(()=>{},"disconnect")};if(Ue!==void 0||we)throw new Error("Connect the render source before Highlight starts.");Ue=e;let t=true,n=new Set;return Nt(),{recordRenders(r){if(!t||!e||!se||B.getState().isPaused)return;let o=[];B.startBatch();try{for(let{host:i,name:s,count:a}of r){if(!i.isConnected)continue;let u=Ia(i);if(u===null)continue;let c=(B.getRender(String(u))?.renderCount??0)+a,d=Vo(c),{x:g,y:T,width:b,height:v}=i.getBoundingClientRect(),f={x:g,y:T,width:b,height:v};B.trackRender({nativeTag:u,viewType:s,componentName:s,isComponent:true,testID:i.getAttribute("data-testid")??void 0,measurements:f,color:d,count:c}),Ho(u,i),n.add(u),b>0&&v>0&&o.push({id:u,...f,color:d,count:B.getSettings().showRenderCount?c:0})}}finally{B.endBatch()}for(let i of n)B.getRender(String(i))||(n.delete(i),Pt.delete(i));!it&&o.length&&Pe?.(o)},disconnect(){if(t){t=false,st(),Pe?.([]),_o();for(let r of n)Pt.delete(r);n.clear(),Ue=void 0,we=false}}}}l(ds,"connectRenderSource");var Ue;function gs(){return Ue===void 0?void 0:Ue?"ready":"unavailable"}l(gs,"getRenderSourceStatus");function Nt(){if(typeof ee<"u"&&!ee)return J("Only available in development builds"),false;if(me||we)return true;if(Ue!==void 0)return we=Ue,Xn(),we;if(ae=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null,!ae)return J("React DevTools hook not found"),false;if(J("Hook found"),J(`Hook has sub: ${typeof ae.sub=="function"}`),J(`Hook has on: ${typeof ae.on=="function"}`),J(`Hook has emit: ${typeof ae.emit=="function"}`),Or(),ae.rendererInterfaces&&ae.rendererInterfaces.size>0)return we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s)`),Xn(),true;let e=setInterval(()=>{ae?.rendererInterfaces&&ae.rendererInterfaces.size>0&&(clearInterval(e),we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s) (delayed)`),Xn())},100);return setTimeout(()=>clearInterval(e),1e4),false}l(Nt,"initialize");function Xn(){typeof window<"u"&&(window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:zt,disable:st,toggle:Oo,isEnabled:Wo,setEnabled:Uo,subscribe:$o,initialize:Nt,destroy:Ko,isInitialized:l(()=>we,"isInitialized"),setHighlightCallback:Fo})}l(Xn,"exposeGlobally");function zt(){typeof ee<"u"&&!ee||Ue!==false&&(we||Nt(),it&&(it=false),!se&&(J("Enabling highlights"),We||Eo(),B.start(),se=true,Yn(),Hl("render")))}l(zt,"enable");function st(){typeof ee<"u"&&!ee||se&&(J("Disabling highlights"),tg=false,_l=false,No&&(clearTimeout(No),No=null),ng.clear(),lt.clear(),To(),Se&&(Se=false,on()),We||qn(),B.stop(),se=false,Yn(),Hl("render"))}l(st,"disable");function hs(){typeof ee<"u"&&!ee||We||(we||Nt(),J("Enabling background tracking"),se||Eo(),We=true)}l(hs,"enableBackgroundTracking");function ps(){typeof ee<"u"&&!ee||We&&(J("Disabling background tracking"),We=false,se||qn())}l(ps,"disableBackgroundTracking");function ms(){return We}l(ms,"isBackgroundTrackingEnabled");function Oo(){if(!(typeof ee<"u"&&!ee)){if(me){me("toggle");return}se?st():zt()}}l(Oo,"toggle");function _o(){if(me){me("clearRenderCounts");return}ko.clear(),B.clear(),J("Cleared render counts")}l(_o,"clearRenderCounts");function Wo(){return se}l(Wo,"isEnabled");function Uo(e){if(me){me("setEnabled",{enabled:e});return}e?zt():st()}l(Uo,"setEnabled");function Qn(e){it!==e&&(it=e,e&&Pe&&Pe([]))}l(Qn,"setHighlightsSuppressed");function fs(){return it}l(fs,"getHighlightsSuppressed");function ys(e){if(me){me("setSilentTracking",{enabled:e});return}e?(zt(),Qn(true)):(Qn(false),st())}l(ys,"setSilentTracking");function bs(){return we}l(bs,"isInitialized");function on(){Un.forEach(e=>{try{e(Se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in freeze listener:",t)}})}l(on,"notifyFreezeListeners");function vs(e){return Un.add(e),e(Se),()=>{Un.delete(e)}}l(vs,"subscribeToFreeze");function jo(){typeof ee<"u"&&!ee||Se||(Se=true,J("Freeze mode enabled"),on())}l(jo,"freeze");function Go(){typeof ee<"u"&&!ee||Se&&(Se=false,J("Freeze mode disabled"),Pe&&Pe([]),on())}l(Go,"unfreeze");function Cs(){if(me){me("toggleFreeze");return}Se?Go():jo()}l(Cs,"toggleFreeze");function Ts(){return Se}l(Ts,"getFrozen");function Ko(){we&&(qn(),_r(),$r(null),Se=false,Un.clear(),se=false,ae=null,Pe=null,we=false,typeof window<"u"&&delete window.__HIGHLIGHT_UPDATES_CONTROLLER__,J("Destroyed"))}l(Ko,"destroy");var ag={connectRenderSource:ds,getRenderSourceStatus:gs,subscribe:$o,enable:zt,disable:st,toggle:Oo,isEnabled:Wo,setEnabled:Uo,initialize:Nt,destroy:Ko,isInitialized:bs,setHighlightCallback:Fo,clearRenderCounts:_o,freeze:jo,unfreeze:Go,toggleFreeze:Cs,getFrozen:Ts,subscribeToFreeze:vs,setBadgePressCallback:rs,getBadgePressCallback:os,handleBadgePress:is,setSpotlightCallback:as,setSpotlight:ls,getSpotlight:us,clearDevToolsCache:jl,enableBackgroundTracking:hs,disableBackgroundTracking:ps,isBackgroundTrackingEnabled:ms,setRemoteHandler:ss,replaceRemoteState:cs,locateComponent:ns,setHighlightsSuppressed:Qn,getHighlightsSuppressed:fs,setSilentTracking:ys},E=ag;U();import lg,{useState as de,useEffect as Re,useRef as ct,useCallback as re}from"react";import{Power as sg,JsModal as cg,devToolsStorageKeys as Lt,persistentStorage as Zn,night as Bt,TickProvider as ws,windowDragProps as ug}from"@buoy-gg/shared-ui/web";import{useIsPro as dg}from"@buoy-gg/license/web";Ve();U();import{useMemo as er,useState as Ss,useCallback as an}from"react";import{CopyButton as gg,formatRelativeTime as hg,PlusIcon as pg,MinusIcon as mg,EventStepperFooter as fg,Lock as yg,night as $,useLimit as bg,monoFont as Vt}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as vg}from"@buoy-gg/shared-ui/web/dataViewer";U();import{buoyColors as je,night as oe,monoFont as ut}from"@buoy-gg/shared-ui/web";import{Fragment as Cg,jsx as K,jsxs as ce}from"react/jsx-runtime";var Ge={mount:{label:"MOUNT",color:je.success,tip:"First render of this component."},props:{label:"PROPS",color:je.warning,tip:"Native props changed. Consider React.memo() or useCallback for handlers."},state:{label:"STATE",color:"#a855f7",tip:"Component state changed via setState."},hooks:{label:"HOOKS",color:"#ec4899",tip:"Hook values changed (useState, useReducer, useMemo, etc.)."},context:{label:"CONTEXT",color:"#06b6d4",tip:"React context value changed."},parent:{label:"PARENT",color:je.textSecondary,tip:"Parent component re-rendered. Consider wrapping with React.memo()."},unknown:{label:"?",color:je.textMuted,tip:"Could not determine render cause."}},ln={mount:{label:"mount",color:je.success,tip:"First render of this component."},props:{label:"props",color:je.warning,tip:"Component received different props from parent."},state:{label:"state",color:"#a855f7",tip:"Component's own state changed (useState/useReducer)."},parent:{label:"parent",color:je.textSecondary,tip:"Parent re-rendered but this component's props/state didn't change. Consider React.memo()."},unknown:{label:"?",color:je.textMuted,tip:"Could not determine component render cause."}};function qo({cause:e,compact:t=false,showKeys:n=false,showTwoLevel:r=false,testID:o}){let i=Ge[e.type],s=e.componentCause?ln[e.componentCause]:null,a=r&&s&&e.componentCause!==e.type;return ce(h,{nativeID:"__rn_buoy__cause-badge",testID:o,style:[H.container,t&&H.containerCompact],children:[a&&ce(Cg,{children:[K(h,{style:[H.badge,t&&H.badgeCompact,H.componentBadge,{backgroundColor:s.color+"15"}],children:K(p,{testID:o?`${o}-component`:void 0,style:[H.badgeText,t&&H.badgeTextCompact,H.componentBadgeText,{color:s.color}],children:s.label})}),K(p,{style:[H.arrowText,t&&H.arrowTextCompact],children:"\u2192"})]}),K(h,{style:[H.badge,t&&H.badgeCompact,{backgroundColor:i.color+"20"}],children:K(p,{testID:o?`${o}-native`:void 0,style:[H.badgeText,t&&H.badgeTextCompact,{color:i.color}],children:i.label})}),n&&e.changedKeys&&e.changedKeys.length>0&&K(p,{testID:o?`${o}-keys`:void 0,style:[H.keysText,t&&H.keysTextCompact],numberOfLines:1,children:e.changedKeys.join(", ")}),n&&e.hookIndices&&e.hookIndices.length>0&&ce(p,{testID:o?`${o}-hooks`:void 0,style:[H.keysText,t&&H.keysTextCompact],numberOfLines:1,children:["Hook ",e.hookIndices.join(", ")]})]})}l(qo,"RenderCauseBadge");function xs({cause:e}){let t=Ge[e.type],n=e.componentCause?ln[e.componentCause]:null,r=e.componentName||"Component";return ce(h,{nativeID:"__rn_buoy__two-level-cause",style:H.twoLevelContainer,children:[n&&ce(h,{style:H.twoLevelRow,children:[K(p,{style:H.twoLevelLabel,children:"Component:"}),K(p,{style:H.twoLevelName,children:r}),K(p,{style:H.twoLevelText,children:"re-rendered due to"}),K(h,{style:[H.badge,{backgroundColor:n.color+"20"}],children:K(p,{style:[H.badgeText,{color:n.color}],children:n.label.toUpperCase()})})]}),ce(h,{style:H.twoLevelRow,children:[K(p,{style:H.twoLevelLabel,children:"Native:"}),K(h,{style:[H.badge,{backgroundColor:t.color+"20"}],children:K(p,{style:[H.badgeText,{color:t.color}],children:t.label})}),e.changedKeys&&e.changedKeys.length>0&&ce(p,{style:H.twoLevelKeys,children:["[",e.changedKeys.join(", "),"]"]})]})]})}l(xs,"TwoLevelCauseBadge");function Jo({cause:e,nativeType:t}){let n=Ge[e.type],r=e.componentCause?ln[e.componentCause]:null,o=e.componentName||"Unknown",i=e.hookChanges&&e.hookChanges.length>0,s=e.changedKeys&&e.changedKeys.length>0,a=e.changedKeys?.filter(c=>c.includes("(ref only)")||c.includes("(fn ref)"))||[],u=e.changedKeys?.filter(c=>!c.includes("(ref only)")&&!c.includes("(fn ref)"))||[];return ce(h,{nativeID:"__rn_buoy__enhanced-cause",style:H.enhancedContainer,children:[ce(h,{style:H.enhancedHeader,children:[K(p,{style:H.enhancedComponentName,children:o}),t&&K(h,{style:H.enhancedNativeTag,children:K(p,{style:H.enhancedNativeTagText,children:t})})]}),ce(h,{style:H.enhancedFlowContainer,children:[K(p,{style:H.enhancedFlowLabel,children:"Cause:"}),r&&K(h,{style:[H.enhancedFlowBadge,{backgroundColor:r.color+"20"}],children:K(p,{style:[H.enhancedFlowBadgeText,{color:r.color}],children:r.label.toUpperCase()})}),K(p,{style:H.enhancedFlowArrow,children:"\u2192"}),K(h,{style:[H.enhancedFlowBadge,{backgroundColor:n.color+"20"}],children:K(p,{style:[H.enhancedFlowBadgeText,{color:n.color}],children:n.label})})]}),i&&ce(h,{style:H.enhancedSection,children:[K(p,{style:H.enhancedSectionTitle,children:"Component State Changed:"}),e.hookChanges.map(c=>ce(h,{style:H.enhancedChangeRow,children:[K(p,{style:H.enhancedChangeIcon,children:"\u26A1"}),ce(p,{style:H.enhancedChangeText,children:["Hook[",c.index,"] (",c.type,"): ",c.description]})]},c.index))]}),u.length>0&&ce(h,{style:H.enhancedSection,children:[K(p,{style:H.enhancedSectionTitle,children:"Native Props Changed:"}),u.map((c,d)=>ce(h,{style:H.enhancedChangeRow,children:[K(p,{style:H.enhancedChangeIcon,children:"~"}),K(p,{style:H.enhancedChangeText,children:c})]},d))]}),a.length>0&&ce(h,{style:H.enhancedSection,children:[K(p,{style:[H.enhancedSectionTitle,{color:oe.color.textTertiary}],children:"Reference Changes (optimization opportunity):"}),a.map((c,d)=>ce(h,{style:H.enhancedChangeRow,children:[K(p,{style:[H.enhancedChangeIcon,{color:oe.color.textTertiary}],children:"\u25CB"}),K(p,{style:[H.enhancedChangeText,{color:oe.color.textTertiary}],children:c})]},d))]}),!i&&!s&&e.type!=="mount"&&K(h,{style:H.enhancedSection,children:K(p,{style:H.enhancedNoChanges,children:e.type==="parent"?"Parent re-rendered (consider React.memo)":"No specific changes detected"})})]})}l(Jo,"EnhancedCauseDisplay");var H=ve.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{paddingVertical:3,paddingHorizontal:6,borderRadius:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5},componentBadge:{borderStyle:"dashed",borderWidth:1,borderColor:oe.color.border},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},componentBadgeText:{fontWeight:"500",textTransform:"lowercase"},arrowText:{fontSize:10,color:oe.color.textTertiary},arrowTextCompact:{fontSize:9},keysText:{fontSize:11,color:oe.color.textSecondary,fontFamily:ut,flex:1},keysTextCompact:{fontSize:10},twoLevelContainer:{gap:8},twoLevelRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:6},twoLevelLabel:{fontSize:11,fontWeight:"600",color:oe.color.textSecondary,minWidth:70},twoLevelName:{fontSize:11,fontWeight:"600",color:oe.color.text,fontFamily:ut},twoLevelText:{fontSize:11,color:oe.color.textSecondary},twoLevelKeys:{fontSize:10,color:oe.color.textSecondary,fontFamily:ut},enhancedContainer:{gap:12},enhancedHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},enhancedComponentName:{fontSize:14,fontWeight:"700",color:oe.color.text,fontFamily:ut},enhancedNativeTag:{backgroundColor:oe.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},enhancedNativeTagText:{fontSize:10,fontWeight:"600",color:oe.color.textTertiary,fontFamily:ut},enhancedFlowContainer:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12,backgroundColor:oe.color.bg,borderRadius:6},enhancedFlowLabel:{fontSize:11,fontWeight:"600",color:oe.color.textSecondary},enhancedFlowBadge:{paddingVertical:3,paddingHorizontal:8,borderRadius:4},enhancedFlowBadgeText:{fontSize:10,fontWeight:"700"},enhancedFlowArrow:{fontSize:14,color:oe.color.textTertiary,fontWeight:"300"},enhancedSection:{gap:6},enhancedSectionTitle:{fontSize:11,fontWeight:"600",color:oe.color.textSecondary,letterSpacing:.3},enhancedChangeRow:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingLeft:4},enhancedChangeIcon:{fontSize:12,color:oe.color.warning,fontFamily:ut,width:16},enhancedChangeText:{fontSize:12,color:oe.color.text,fontFamily:ut,flex:1},enhancedNoChanges:{fontSize:12,color:oe.color.textTertiary,fontStyle:"italic",paddingLeft:4}});U();function Is(e,t){let n=e.filter(b=>b.renderCount>=t.minRenders);if(t.filterCauses.length>0){let b=new Set(t.filterCauses);n=n.filter(v=>b.has(v.lastRenderCause?.type??"unknown"))}let r=e.flatMap(b=>[b.firstRenderTime,b.lastRenderTime]).filter(b=>Number.isFinite(b)),o=r.length>0?Math.max(...r)-Math.min(...r):0,i=Math.max(.001,o/1e3),s=(t.groupByName?Rs(n):n.map(b=>[b])).map(b=>Ds(b,t,i));Ps(s,t.sortBy);let a=t.topN===-1?0:Math.max(0,s.length-t.topN),u=t.topN===-1?s:s.slice(0,t.topN),c=e.reduce((b,v)=>b+v.renderCount,0),d=ks(e),g=0,T=false;for(let b of e)b.lastRenderCause||(g+=b.renderCount),b.renderHistory&&b.renderHistory.length>0&&(T=true);return{totalUniqueComponents:n.length,totalRenders:c,windowMs:o,causeBreakdown:d,rows:u,truncated:a,dataGaps:{historyOff:!T,propsCaptureOff:!e.some(b=>b.renderHistory?.some(v=>v.capturedProps!==void 0)),stateCaptureOff:!e.some(b=>b.renderHistory?.some(v=>v.capturedState!==void 0)),rendersWithoutCause:g}}}l(Is,"buildReport");function Rs(e){let t=new Map;for(let n of e){let r=n.componentName||n.displayName||n.viewType,o=t.get(r);o?o.push(n):t.set(r,[n])}return Array.from(t.values())}l(Rs,"groupByComponentName");function Ds(e,t,n){let r=e[0],o=r.componentName||r.displayName||r.viewType,i=0,s={},a=new Map,u=new Map,c=new Map,d=0,g=0,T=0;for(let P of e){i+=P.renderCount;let D=P.lastRenderCause;if(!D)continue;let W=D.type;s[W]=(s[W]??0)+P.renderCount;let Z=(D.hookChanges?.length??0)>0,V=(D.changedKeys?.length??0)>0;if(W==="parent"&&(D.componentCause==="state"||D.componentCause==="props"||Z||V?g+=P.renderCount:T+=P.renderCount),W==="props"&&!V&&(d+=P.renderCount),D.parentComponentName&&c.set(D.parentComponentName,(c.get(D.parentComponentName)??0)+1),t.aggregateCauses&&D.hookChanges)for(let j of D.hookChanges){let x=`${j.type}[${j.index}]`,L=a.get(x);L?L.count+=1:a.set(x,{count:1,sample:zs(j)})}if(D.changedKeys)for(let j of D.changedKeys)j.includes("(ref only)")||u.set(j,(u.get(j)??0)+1)}let b=Array.from(a.entries()).sort((P,D)=>D[1].count-P[1].count).slice(0,3).map(([P,D])=>({hook:P,count:D.count,sample:D.sample})),v=Array.from(u.entries()).sort((P,D)=>D[1]-P[1]).slice(0,5).map(([P])=>P),f="unknown",S=-1;for(let[P,D]of Object.entries(s))(D??0)>S&&(S=D??0,f=P);let C,N=0;for(let[P,D]of c)D>N&&(N=D,C=P);let m=e.map(P=>P.renderCount).sort((P,D)=>D-P),k=i/n;return{name:o,viewType:r.viewType,instances:e.length,renders:i,causeMix:s,dominantCause:f,hookCauses:b,changedKeys:v,unknownPropsCount:d,parentWithOwnChange:g,parentNoChange:T,parentName:C,instanceCounts:m,rate:k,source:e}}l(Ds,"processGroup");function ks(e){let t={};for(let n of e){let r=n.lastRenderCause?.type??"unknown";t[r]=(t[r]??0)+n.renderCount}return t}l(ks,"aggregateCauseBreakdown");function Ps(e,t){switch(t){case"renderCount":e.sort((n,r)=>r.renders-n.renders);break;case"rate":e.sort((n,r)=>r.rate-n.rate);break;case"name":e.sort((n,r)=>n.name.localeCompare(r.name));break}}l(Ps,"sortRows");var Ns=32;function Yo(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="function")return"[Fn]";if(typeof e=="object")return Array.isArray(e)?`[Array(${e.length})]`:"[Obj]";let t=String(e);return t.length>Ns?t.slice(0,Ns-1)+"\u2026":t}l(Yo,"truncateValue");function zs(e){return e.previousValue===void 0&&e.currentValue===void 0?e.description:`${Yo(e.previousValue)} \u2192 ${Yo(e.currentValue)}`}l(zs,"formatHookSample");function Xo(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}l(Xo,"formatWindow");function tr(e){return e>=100?`${e.toFixed(0)}/s`:e>=10?`${e.toFixed(1)}/s`:`${e.toFixed(2)}/s`}l(tr,"formatRate");function Qo(e){let t=Object.entries(e).sort((n,r)=>(r[1]??0)-(n[1]??0));return t.length===0?"(no causes recorded)":t.map(([n,r])=>`${n} ${r}`).join(" \xB7 ")}l(Qo,"causeBreakdownLine");function Zo(e){let t=[],n=Object.entries(e.causeMix).filter(([,o])=>(o??0)>0).sort((o,i)=>(i[1]??0)-(o[1]??0)),r=n.length>=2&&(n[1]?.[1]??0)>=e.renders*.1;if(e.dominantCause==="hooks"&&e.hookCauses.length>0){let o=e.hookCauses[0];o.sample?t.push(`hooks \xD7${o.count} ${o.hook}: ${o.sample}`):t.push(`hooks \xD7${o.count} ${o.hook}`)}else if(e.dominantCause==="props"){if(e.changedKeys.length>0){let o=e.changedKeys.slice(0,3).join(", ");t.push(`props (${o})`)}else t.push("props (keys not captured)");e.unknownPropsCount>0&&e.changedKeys.length>0&&t.push(`[${e.unknownPropsCount} unidentified]`)}else if(e.dominantCause==="parent"){let o="parent cascade";e.parentNoChange>0&&e.parentWithOwnChange===0&&(o="parent cascade, no own change"),e.parentName&&(o+=` \u2190 ${e.parentName}`),t.push(o)}else e.dominantCause==="mount"?t.push("mount"):e.dominantCause==="state"?t.push("state"):e.dominantCause==="context"?t.push("context"):t.push("unknown");if(r){let o=n.map(([i,s])=>`${i}:${s}`).join(" + ");t.push(`(${o})`)}return t.join(" ")}l(Zo,"describeCause");function ei(e){if(e.instances<=1)return e.name;let t=e.instanceCounts,n=t[0]??0,r=t[t.length-1]??0;if(n-r<=1)return`${e.name} \xD7${e.instances} (${n} each)`;let o=t.slice(1),i=o.reduce((a,u)=>a+u,0),s=o.length>0?i/o.length:0;return`${e.name} \xD7${e.instances} (top ${n}, others ~${Math.round(s)})`}l(ei,"describeInstances");var Tg="React Native render report \u2014 review the data and identify why components are re-rendering.";function ti(e,t){let n=[];n.push(Tg),n.push(""),n.push(`Window: ${Xo(e.windowMs)} \xB7 ${e.totalUniqueComponents} components \xB7 ${e.totalRenders} renders`),n.push(`Cause mix: ${Qo(e.causeBreakdown)}`),n.push(""),n.push("Top offenders (count \xB7 rate \xB7 component \xB7 cause):"),n.push("");let r=e.rows.map(ei),o=Math.min(36,Math.max(8,...r.map(u=>u.length))),i=Math.max(3,...e.rows.map(u=>`\xD7${u.renders}`.length)),s=Math.max(5,...e.rows.map(u=>tr(u.rate).length));for(let u=0;u<e.rows.length;u++){let c=e.rows[u],d=(r[u]??c.name).padEnd(o),g=`\xD7${c.renders}`.padStart(i),T=tr(c.rate).padStart(s),b=Zo(c);n.push(` ${g} ${T} ${d} ${b}`)}e.truncated>0&&(n.push(""),n.push(`... ${e.truncated} more (set topN=-1 to expand)`));let a=ni(e);if(a.length>0){n.push(""),n.push("Data availability:");for(let u of a)n.push(` \xB7 ${u}`)}return n.join(`
31
- `)}l(ti,"generateSummary");function ni(e){let t=[];return e.dataGaps.rendersWithoutCause>0&&t.push(`${e.dataGaps.rendersWithoutCause} renders had no cause info (enable trackRenderCauses for more detail)`),e.dataGaps.propsCaptureOff&&t.push("prop snapshots not captured (enable capturePropsOnRender to see prop diffs for 'props (keys not captured)' rows)"),e.dataGaps.stateCaptureOff&&t.push("state snapshots not captured (enable captureStateOnRender)"),e.dataGaps.historyOff&&t.push("render history off (enable enableRenderHistory for per-render timeline)"),t}l(ni,"buildDataFooter");function Ls(e,t){let n=[];n.push("# React Render Report"),n.push(""),n.push(`**Window:** ${Xo(e.windowMs)} \xB7 **Components:** ${e.totalUniqueComponents} \xB7 **Renders:** ${e.totalRenders}`),n.push(`**Cause mix:** ${Qo(e.causeBreakdown)}`),n.push(""),n.push("| Component | Renders | Rate | Cause |"),n.push("|---|---:|---:|---|");for(let o of e.rows){let i=ei(o),s=Zo(o).replace(/\|/g,"\\|");n.push(`| ${i} | ${o.renders} | ${tr(o.rate)} | ${s} |`)}e.truncated>0&&(n.push(""),n.push(`_... ${e.truncated} more rows_`));let r=ni(e);if(r.length>0){n.push(""),n.push("**Data availability:**");for(let o of r)n.push(`- ${o}`)}return n.join(`
32
- `)}l(Ls,"generateMarkdownTable");function Bs(e,t,n){let r={exportedAt:new Date().toISOString(),summary:{windowMs:t.windowMs,totalComponents:t.totalUniqueComponents,totalRenders:t.totalRenders,causeBreakdown:t.causeBreakdown,truncated:t.truncated,dataGaps:t.dataGaps},components:t.rows.map(o=>({name:o.name,viewType:o.viewType,instances:o.instances,instanceCounts:o.instances>1?o.instanceCounts:void 0,renders:o.renders,ratePerSec:Number(o.rate.toFixed(3)),dominantCause:o.dominantCause,causeMix:o.causeMix,hookCauses:o.hookCauses,changedKeys:o.changedKeys,unknownPropsCount:o.unknownPropsCount||void 0,parentName:o.parentName,parentWithOwnChange:o.parentWithOwnChange||void 0,parentNoChange:o.parentNoChange||void 0,...n.includeHistory?{history:Vs(o.source)}:{}}))};return n.includeHistory?JSON.stringify(r,null,2):JSON.stringify(r)}l(Bs,"generateJson");function Vs(e){return e.map(t=>({name:t.componentName||t.displayName,nativeTag:t.nativeTag,renderCount:t.renderCount,history:t.renderHistory?.map(n=>({n:n.renderNumber,t:n.timestamp,cause:{type:n.cause.type,componentCause:n.cause.componentCause,changedKeys:n.cause.changedKeys,parentComponentName:n.cause.parentComponentName,hookChanges:n.cause.hookChanges?.map(r=>({type:r.type,index:r.index,desc:r.description}))}}))}))}l(Vs,"extractHistory");function nr(e,t){let n=Is(e,t);switch(t.format){case"summary":return ti(n,t);case"markdown-table":return Ls(n,t);case"json":return Bs(e,n,t);default:return ti(n,t)}}l(nr,"generateExport");function Hs(e,t){return nr(e,t).length}l(Hs,"estimateExportSize");function ri(e){return{totalComponents:e.length,totalRenders:e.reduce((t,n)=>t+n.renderCount,0)}}l(ri,"getExportSummary");function As(e){return nr([e],{format:"summary",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false})}l(As,"generateSingleComponentExport");import{jsx as O,jsxs as Q}from"react/jsx-runtime";function oi({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:r,onAddFilter:o,isPro:i=false}){let[s,a]=Ss(0),u=n??s,c=r??a,d=er(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((V,j)=>V.timestamp-j.timestamp),[e.renderHistory]),g=d.length,T=d[u],b=bg("highlightUpdates.detailEvents"),v=i?1/0:b,f=er(()=>Math.max(0,g-v),[v,g]),S=T?.cause||e.lastRenderCause,C=an(()=>{u>0&&c(u-1)},[u,c]),N=an(()=>{let V=Math.min(v-1,g-1);u<V&&c(u+1)},[u,g,c,v]),m=er(()=>As(e),[e]),k=e.componentName||e.displayName,P=e.viewType,D=e.lastRenderTime-e.firstRenderTime,W=D>0?(e.renderCount/(D/1e3)).toFixed(1):e.renderCount.toString(),Z=!t&&g>1;return Q(h,{style:z.container,children:[Q(h,{style:z.header,children:[Q(h,{style:z.headerLeft,children:[O(p,{testID:"buoy-highlight-detail-name",style:z.componentName,numberOfLines:1,children:k}),O(h,{style:z.nativeTypeBadge,children:O(p,{testID:"buoy-highlight-detail-type",style:z.nativeTypeText,children:P})})]}),O(gg,{value:m,size:14,testID:"buoy-highlight-detail-copy"})]}),Q(Me,{testID:"buoy-highlight-detail-scroll",style:z.scrollView,contentContainerStyle:[z.scrollContent,Z&&{paddingBottom:100}],showsVerticalScrollIndicator:false,children:[S&&O(Es,{cause:S,renderNumber:T?.renderNumber}),O(Fs,{render:e,rendersPerSec:W}),f>0&&Q(h,{testID:"buoy-highlight-detail-locked",style:z.lockedBanner,children:[O(yg,{size:14,color:$.color.warning}),Q(p,{testID:"buoy-highlight-detail-locked-text",style:z.lockedBannerText,children:[f," ",f===1?"event":"events"," hidden"]}),O(p,{style:z.lockedBannerSubtext,children:"Upgrade to Pro"})]}),o&&O(Ms,{render:e,onAddFilter:o})]}),Z&&O(fg,{currentIndex:u,totalItems:g,onPrevious:C,onNext:N,itemLabel:"Render",subtitle:T?.timestamp?hg(new Date(T.timestamp)):void 0,applySafeAreaInset:false,absolute:true})]})}l(oi,"RenderDetailView");function Es({cause:e,renderNumber:t}){let n=e.componentCause||e.type,r=e.componentCause?ln[e.componentCause]:Ge[e.type],o=e.hookChanges&&e.hookChanges.length>0,i=e.changedKeys&&e.changedKeys.length>0,s=l(()=>e.type==="mount"?"First render":n==="parent"?"Triggered by":"Changed:","getLabel");return Q(h,{testID:"buoy-highlight-detail-cause",style:z.answerCard,children:[Q(h,{style:z.causeBadgeRow,children:[O(p,{testID:"buoy-highlight-detail-cause-label",style:z.causeLabel,children:s()}),O(h,{style:[z.causeBadgeLarge,{backgroundColor:r.color+"20"}],children:O(p,{testID:"buoy-highlight-detail-cause-badge",style:[z.causeBadgeLargeText,{color:r.color}],children:r.label.toUpperCase()})})]}),o&&O(h,{style:z.hookChangesContainer,children:e.hookChanges.map((a,u)=>{let c=`${a.type}[${a.index}]`,d={[c]:a.previousValue},g={[c]:a.currentValue};return O(h,{style:z.hookDiffContainer,children:O(vg,{oldValue:d,newValue:g,theme:"dark",showUnchanged:false})},u)})}),!o&&i&&O(h,{style:z.propsChangesContainer,children:e.changedKeys.filter(a=>!a.includes("(ref only)")).slice(0,5).map((a,u)=>O(h,{style:z.propChangeChip,children:O(p,{testID:`buoy-highlight-detail-changed-${u}`,style:z.propChangeText,children:a})},u))})]})}l(Es,"AnswerCard");function Fs({render:e,rendersPerSec:t}){let n=e.testID||e.nativeID||e.accessibilityLabel,r=e.measurements;return Q(h,{style:z.detailsSection,children:[n&&Q(h,{testID:"buoy-highlight-detail-identifiers",style:z.detailsCard,children:[O(p,{style:z.detailsCardTitle,children:"Identifiers"}),e.testID&&O(rr,{label:"testID",value:e.testID}),e.nativeID&&O(rr,{label:"nativeID",value:e.nativeID}),e.accessibilityLabel&&O(rr,{label:"a11y",value:e.accessibilityLabel})]}),Q(h,{testID:"buoy-highlight-detail-stats",style:z.statsRow,children:[Q(h,{testID:"buoy-highlight-detail-stat-renders",style:z.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-renders-value",style:[z.statValue,{color:e.color}],children:e.renderCount}),O(p,{style:z.statLabel,children:"renders"})]}),O(h,{style:z.statDivider}),Q(h,{testID:"buoy-highlight-detail-stat-rate",style:z.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-rate-value",style:z.statValue,children:t}),O(p,{style:z.statLabel,children:"/sec"})]}),O(h,{style:z.statDivider}),Q(h,{testID:"buoy-highlight-detail-stat-tag",style:z.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-tag-value",style:z.statValue,children:e.nativeTag}),O(p,{style:z.statLabel,children:"tag"})]})]}),r&&Q(h,{testID:"buoy-highlight-detail-measure",style:z.measurementsRow,children:[Q(h,{style:z.measurementItem,children:[O(p,{style:z.measurementLabel,children:"x"}),O(p,{testID:"buoy-highlight-detail-measure-x",style:z.measurementValue,children:Math.round(e.measurements.x)})]}),Q(h,{style:z.measurementItem,children:[O(p,{style:z.measurementLabel,children:"y"}),O(p,{testID:"buoy-highlight-detail-measure-y",style:z.measurementValue,children:Math.round(e.measurements.y)})]}),Q(h,{style:z.measurementItem,children:[O(p,{style:z.measurementLabel,children:"w"}),O(p,{testID:"buoy-highlight-detail-measure-w",style:z.measurementValue,children:Math.round(e.measurements.width)})]}),Q(h,{style:z.measurementItem,children:[O(p,{style:z.measurementLabel,children:"h"}),O(p,{testID:"buoy-highlight-detail-measure-h",style:z.measurementValue,children:Math.round(e.measurements.height)})]})]})]})}l(Fs,"DetailsSection");function rr({label:e,value:t}){let n=`buoy-highlight-detail-id-${e.toLowerCase()}`;return Q(h,{testID:n,style:z.detailRow,children:[O(p,{style:z.detailLabel,children:e}),O(p,{testID:`${n}-value`,style:z.detailValue,numberOfLines:1,children:t})]})}l(rr,"DetailRow");function Ms({render:e,onAddFilter:t}){let[n,r]=Ss(null),o=er(()=>{let c=[];return e.nativeID&&c.push({type:"nativeID",value:e.nativeID,label:"nativeID"}),e.testID&&c.push({type:"testID",value:e.testID,label:"testID"}),e.accessibilityLabel&&c.push({type:"accessibilityLabel",value:e.accessibilityLabel,label:"a11y"}),e.componentName&&c.push({type:"component",value:e.componentName,label:"component"}),c.push({type:"viewType",value:e.viewType,label:"viewType"}),c},[e]),i=n!==null?o[n]:null,s=an(c=>{r(d=>d===c?null:c)},[]),a=an(()=>{i&&(t({type:i.type,value:i.value},"include"),r(null))},[i,t]),u=an(()=>{i&&(t({type:i.type,value:i.value},"exclude"),r(null))},[i,t]);return Q(h,{testID:"buoy-highlight-quick",style:z.quickActionsSection,children:[O(p,{style:z.quickActionsTitle,children:"Quick Filters"}),O(h,{style:z.filterOptionsList,children:o.map((c,d)=>O($s,{testID:`buoy-highlight-quick-${c.type.toLowerCase()}`,label:c.label,value:c.value,isSelected:n===d,onSelect:()=>s(d)},c.type))}),Q(h,{style:z.filterActionButtons,children:[Q(Y,{testID:"buoy-highlight-quick-include",accessibilityRole:"button",accessibilityLabel:"Only show this",style:[z.filterActionButton,z.filterActionButtonInclude,!i&&z.filterActionButtonDisabled],onPress:a,disabled:!i,activeOpacity:.7,children:[O(pg,{size:14,color:i?$.color.accent:$.color.textTertiary}),O(p,{style:[z.filterActionButtonText,{color:i?$.color.accent:$.color.textTertiary}],children:"Only Show This"})]}),Q(Y,{testID:"buoy-highlight-quick-exclude",accessibilityRole:"button",accessibilityLabel:"Hide this",style:[z.filterActionButton,z.filterActionButtonExclude,!i&&z.filterActionButtonDisabled],onPress:u,disabled:!i,activeOpacity:.7,children:[O(mg,{size:14,color:i?$.color.danger:$.color.textTertiary}),O(p,{style:[z.filterActionButtonText,{color:i?$.color.danger:$.color.textTertiary}],children:"Hide This"})]})]})]})}l(Ms,"QuickActionsSection");function $s({testID:e,label:t,value:n,isSelected:r,onSelect:o}){return Q(Y,{testID:e,accessibilityRole:"button",accessibilityLabel:`${t}, ${n}`,style:[z.filterOptionCard,r&&z.filterOptionCardSelected],onPress:o,activeOpacity:.7,children:[O(p,{style:[z.filterOptionLabel,r&&z.filterOptionLabelSelected],children:t}),O(p,{testID:e?`${e}-value`:void 0,style:[z.filterOptionValue,r&&z.filterOptionValueSelected],numberOfLines:1,children:n})]})}l($s,"FilterOptionCard");var z=ve.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:12,padding:16,paddingBottom:0},scrollView:{flex:1},scrollContent:{padding:16,paddingTop:12,paddingBottom:80,gap:12},headerLeft:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:10},componentName:{fontSize:18,fontWeight:"700",color:$.color.text,flexShrink:1},nativeTypeBadge:{backgroundColor:$.color.bg,paddingVertical:3,paddingHorizontal:8,borderRadius:4},nativeTypeText:{fontSize:11,fontWeight:"600",color:$.color.textTertiary,fontFamily:Vt},answerCard:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:6},causeBadgeRow:{flexDirection:"row",alignItems:"center",gap:8},causeBadgeLarge:{paddingVertical:4,paddingHorizontal:10,borderRadius:4},causeBadgeLargeText:{fontSize:11,fontWeight:"700",letterSpacing:.5},causeLabel:{fontSize:12,color:$.color.textSecondary,fontWeight:"500"},hookChangesContainer:{gap:6},hookDiffContainer:{backgroundColor:$.color.bg,borderRadius:6,overflow:"hidden"},propsChangesContainer:{flexDirection:"row",flexWrap:"wrap",gap:4},propChangeChip:{backgroundColor:$.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},propChangeText:{fontSize:11,color:$.color.text,fontFamily:Vt},detailsSection:{gap:10},detailsCard:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:6},detailsCardTitle:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:4},detailRow:{flexDirection:"row",alignItems:"center",gap:8},detailLabel:{fontSize:11,fontWeight:"600",color:$.color.textSecondary,minWidth:55},detailValue:{fontSize:12,color:$.color.text,fontFamily:Vt,flex:1},statsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,paddingVertical:10,paddingHorizontal:16},statItem:{flex:1,alignItems:"center"},statValue:{fontSize:16,fontWeight:"700",color:$.color.text,fontFamily:Vt},statLabel:{fontSize:10,color:$.color.textTertiary,marginTop:2},statDivider:{width:1,height:24,backgroundColor:$.color.border,marginHorizontal:12},measurementsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,paddingVertical:8,paddingHorizontal:12},measurementItem:{flexDirection:"row",alignItems:"baseline",gap:4},measurementLabel:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,textTransform:"uppercase"},measurementValue:{fontSize:12,fontWeight:"600",color:$.color.text,fontFamily:Vt},quickActionsSection:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:10},quickActionsTitle:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:2},filterOptionsList:{gap:6},filterOptionCard:{flexDirection:"row",alignItems:"center",backgroundColor:$.color.surfaceElevated,borderRadius:6,paddingVertical:10,paddingHorizontal:12,borderWidth:1,borderColor:"transparent",gap:10},filterOptionCardSelected:{borderColor:$.color.accentBorderStrong,backgroundColor:$.color.accentSoft},filterOptionLabel:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,minWidth:70},filterOptionLabelSelected:{color:$.color.accent},filterOptionValue:{fontSize:12,color:$.color.text,fontFamily:Vt,flex:1},filterOptionValueSelected:{color:$.color.text},filterActionButtons:{flexDirection:"row",gap:8,marginTop:12},filterActionButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:4,paddingVertical:8,paddingHorizontal:10,borderRadius:6,borderWidth:1},filterActionButtonInclude:{backgroundColor:$.color.accentSoft,borderColor:$.color.accentBorderStrong},filterActionButtonExclude:{backgroundColor:$.color.dangerSoft,borderColor:$.color.danger+"40"},filterActionButtonDisabled:{backgroundColor:$.color.surfaceElevated,borderColor:$.color.border,opacity:.5},filterActionButtonText:{fontSize:11,fontWeight:"600"},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.warning+"40",paddingVertical:12,paddingHorizontal:16,gap:8},lockedBannerText:{color:$.color.warning,fontSize:13,fontWeight:"600"},lockedBannerSubtext:{color:$.color.textTertiary,fontSize:12}});import{EventStepperFooter as wg}from"@buoy-gg/shared-ui/web";U();import{useState as dt,useCallback as gt}from"react";import{Eye as Os,Filter as ii,Plus as _s,X as or,Box as Ws,Settings as Sg,Hash as xg,SectionHeader as te,night as I,monoFont as Ht}from"@buoy-gg/shared-ui/web";U();import{Box as Ig,Hash as Us,Layers as Rg,Eye as Dg,Search as kg,FileCode as Pg,buoyColors as ai,night as js,monoFont as Gs}from"@buoy-gg/shared-ui/web";import{jsx as At,jsxs as li}from"react/jsx-runtime";var Ks={viewType:{label:"ViewType",shortLabel:"View",color:js.color.accent,icon:Ig},testID:{label:"testID",shortLabel:"test",color:ai.success,icon:Us},nativeID:{label:"nativeID",shortLabel:"native",color:"#f59e0b",icon:Us},component:{label:"Component",shortLabel:"Comp",color:"#a855f7",icon:Pg},accessibilityLabel:{label:"a11y",shortLabel:"a11y",color:"#ec4899",icon:Dg},nativeTag:{label:"tag",shortLabel:"tag",color:ai.textMuted,icon:Rg},any:{label:"Any",shortLabel:"Any",color:ai.warning,icon:kg}};function Et({type:e,value:t,compact:n=false,badgeOnly:r=false,valueOnly:o=false,shortLabel:i=false,showIcon:s=false,testID:a}){let u=Ks[e],c=u.icon,d=i?u.shortLabel:u.label;return o?At(p,{testID:a?`${a}-value`:void 0,style:[fe.valueOnly,n&&fe.valueOnlyCompact,{color:u.color}],numberOfLines:1,children:t}):r?li(h,{testID:a,style:[fe.badgeOnly,n&&fe.badgeOnlyCompact,{backgroundColor:u.color+"20",borderColor:u.color+"40"}],children:[s&&At(c,{size:n?10:12,color:u.color}),At(p,{style:[fe.badgeOnlyText,n&&fe.badgeOnlyTextCompact,{color:u.color}],children:d})]}):li(h,{testID:a,accessibilityLabel:`${u.label} ${t}`,style:[fe.container,n&&fe.containerCompact],children:[li(h,{style:[fe.badge,n&&fe.badgeCompact,{backgroundColor:u.color+"20"}],children:[s&&At(c,{size:n?8:10,color:u.color}),At(p,{style:[fe.badgeText,n&&fe.badgeTextCompact,{color:u.color}],children:d})]}),At(p,{testID:a?`${a}-value`:void 0,style:[fe.value,n&&fe.valueCompact],numberOfLines:1,children:t})]})}l(Et,"IdentifierBadge");var fe=ve.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{flexDirection:"row",alignItems:"center",paddingVertical:3,paddingHorizontal:6,borderRadius:4,gap:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5,gap:3},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},value:{fontSize:12,color:js.color.text,fontFamily:Gs,flex:1},valueCompact:{fontSize:11},badgeOnly:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,borderRadius:6,borderWidth:1,gap:5},badgeOnlyCompact:{paddingVertical:2,paddingHorizontal:6,borderRadius:4,gap:4},badgeOnlyText:{fontSize:11,fontWeight:"600"},badgeOnlyTextCompact:{fontSize:9,fontWeight:"700"},valueOnly:{fontSize:12,fontFamily:Gs},valueOnlyCompact:{fontSize:11},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCount:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCountText:{fontSize:10,fontWeight:"600"}});U();function ht(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}l(ht,"identifierSlug");function si(e){return`buoy-highlight-row-${ht(e)}`}l(si,"renderRowTestID");function ci(e,t){return`buoy-highlight-detected-${ht(e)}-${ht(t)}`}l(ci,"detectedItemTestID");function ui(e,t,n){return`buoy-highlight-${e}-chip-${ht(t)}-${ht(n)}`}l(ui,"patternChipTestID");function pt(e){return`buoy-highlight-setting-${e}`}l(pt,"settingTestID");import{Fragment as di,jsx as w,jsxs as M}from"react/jsx-runtime";var sn=l(e=>Ks[e],"getFilterConfig"),Ng=["any","viewType","testID","nativeID","component","accessibilityLabel"];function gi({mode:e,onSelect:t,onCancel:n}){return M(h,{nativeID:"__rn_buoy__type-picker",testID:`buoy-highlight-${e}-types`,style:y.typePicker,children:[w(h,{style:y.typePickerRow,children:Ng.map(r=>{let o=sn(r),i=o.icon;return M(Y,{testID:`buoy-highlight-${e}-type-${r.toLowerCase()}`,accessibilityRole:"button",accessibilityLabel:o.label,style:[y.typeOption,{backgroundColor:o.color+"15",borderColor:o.color+"40"}],onPress:()=>t(r),children:[w(i,{size:14,color:o.color}),w(p,{style:[y.typeOptionText,{color:o.color}],children:o.label})]},r)})}),w(Y,{testID:`buoy-highlight-${e}-types-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:n,style:y.typePickerCancel,children:w(or,{size:16,color:I.color.textTertiary})})]})}l(gi,"TypePicker");function hi({mode:e,type:t,onSubmit:n,onCancel:r}){let[o,i]=dt(""),s=sn(t),a=l(()=>{o.trim()&&n(o.trim())},"handleSubmit");return M(h,{nativeID:"__rn_buoy__pattern-input",testID:`buoy-highlight-${e}-input-row`,style:y.patternInputContainer,children:[w(Et,{type:t,value:"",badgeOnly:true,compact:true}),w(wn,{testID:`buoy-highlight-${e}-input`,value:o,onChangeText:i,onSubmitEditing:a,placeholder:"Enter pattern...",placeholderTextColor:I.color.placeholder,style:y.patternInput,autoFocus:true,returnKeyType:"done",autoCorrect:false,autoCapitalize:"none"}),o.trim()&&w(Y,{testID:`buoy-highlight-${e}-submit`,accessibilityRole:"button",accessibilityLabel:"Add pattern",onPress:a,style:[y.addPatternButton,{backgroundColor:s.color+"20"}],children:w(p,{style:[y.addPatternButtonText,{color:s.color}],children:"Add"})}),w(Y,{testID:`buoy-highlight-${e}-input-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:r,style:y.cancelButton,children:w(or,{size:16,color:I.color.textTertiary})})]})}l(hi,"PatternInput");function pi({mode:e,pattern:t,onRemove:n}){let r=sn(t.type);return M(Y,{testID:ui(e,t.type,t.value),accessibilityRole:"button",accessibilityLabel:`${r.label} ${t.value}, tap to remove`,style:[y.patternChip,{borderColor:r.color+"40"}],onPress:n,activeOpacity:.7,children:[w(h,{style:[y.patternChipBadge,{backgroundColor:r.color+"20"}],children:w(p,{style:[y.patternChipBadgeText,{color:r.color}],children:r.shortLabel})}),w(p,{style:y.patternChipValue,numberOfLines:1,children:t.value}),w(or,{size:12,color:I.color.textTertiary,style:y.patternChipX})]})}l(pi,"PatternChip");var zg={label:"All",shortLabel:"All",color:I.color.textSecondary,icon:Ws};function mt({filterType:e,count:t,isSelected:n,onPress:r}){let o=e==="all"?zg:sn(e),i=`buoy-highlight-detected-cat-${String(e).toLowerCase()}`;return M(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${o.label}, ${t}`,style:[y.categoryBadge,{backgroundColor:o.color+"15",borderColor:n?o.color:o.color+"40",borderWidth:n?2:1}],onPress:r,children:[w(o.icon,{size:12,color:o.color}),w(p,{style:[y.categoryBadgeText,{color:o.color}],children:o.label}),w(h,{style:[y.categoryBadgeCountBubble,{backgroundColor:o.color+"25"}],children:w(p,{testID:`${i}-count`,style:[y.categoryBadgeCount,{color:o.color}],children:t})})]})}l(mt,"DetectedCategoryBadge");var Lg=[{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:150,label:"150"},{value:250,label:"250"},{value:500,label:"500"}],mi=[{value:"off",label:"Off",description:"No debug logging"},{value:"minimal",label:"Minimal",description:"Only hook value changes"},{value:"verbose",label:"Verbose",description:"Component + cause + changes"},{value:"all",label:"All",description:"Full fiber dump"}];function fi({filters:e,onFilterChange:t,settings:n,onSettingsChange:r,availableProps:o,activeTab:i}){let[s,a]=dt(false),[u,c]=dt(false),[d,g]=dt(null),[T,b]=dt(null),[v,f]=dt("all"),[S,C]=dt(null),N=l(x=>{switch(x){case"viewType":return o.viewTypes.map(L=>({value:L,type:"viewType"}));case"testID":return o.testIDs.map(L=>({value:L,type:"testID"}));case"nativeID":return o.nativeIDs.map(L=>({value:L,type:"nativeID"}));case"component":return o.componentNames.map(L=>({value:L,type:"component"}));case"accessibilityLabel":return o.accessibilityLabels.map(L=>({value:L,type:"accessibilityLabel"}));case"all":default:return[...o.viewTypes.map(L=>({value:L,type:"viewType"})),...o.testIDs.map(L=>({value:L,type:"testID"})),...o.nativeIDs.map(L=>({value:L,type:"nativeID"})),...o.componentNames.map(L=>({value:L,type:"component"})),...o.accessibilityLabels.map(L=>({value:L,type:"accessibilityLabel"}))]}},"getItemsForCategory")(v),m=o.viewTypes.length+o.testIDs.length+o.nativeIDs.length+o.componentNames.length+o.accessibilityLabels.length,k=gt((x,L)=>{let ue=[...e.includePatterns,{type:x,value:L}];t({includePatterns:ue}),g(null)},[e.includePatterns,t]),P=gt((x,L)=>{let ue=[...e.excludePatterns,{type:x,value:L}];t({excludePatterns:ue}),b(null)},[e.excludePatterns,t]),D=gt(x=>{let L=e.includePatterns.filter((ue,pe)=>pe!==x);t({includePatterns:L})},[e.includePatterns,t]),W=gt(x=>{let L=e.excludePatterns.filter((ue,pe)=>pe!==x);t({excludePatterns:L})},[e.excludePatterns,t]),Z=gt((x,L)=>{C({type:x,value:L})},[]),V=gt(()=>{S&&(k(S.type,S.value),C(null))},[S,k]),j=gt(()=>{S&&(P(S.type,S.value),C(null))},[S,P]);return w(h,{style:y.container,children:w(Me,{nativeID:"__rn_buoy__filter-view",testID:"buoy-highlight-filter-scroll",style:y.scrollView,contentContainerStyle:y.scrollContent,showsVerticalScrollIndicator:false,children:i==="filters"?M(di,{children:[M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:Os,color:I.color.accent,size:12}),w(te.Title,{children:"INCLUDE ONLY"}),e.includePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-include-count",count:e.includePatterns.length,color:I.color.accent})]}),w(p,{style:y.sectionDescription,children:"Show only components matching these patterns. If any are set, components must match at least one."}),e.includePatterns.length>0&&w(h,{style:y.patternChips,children:e.includePatterns.map((x,L)=>w(pi,{mode:"include",pattern:x,onRemove:()=>D(L)},`${x.type}-${x.value}-${L}`))}),w(h,{style:y.addPatternRow,children:s?w(gi,{mode:"include",onSelect:x=>{a(false),g(x)},onCancel:()=>a(false)}):d?w(hi,{mode:"include",type:d,onSubmit:x=>k(d,x),onCancel:()=>g(null)}):M(Y,{testID:"buoy-highlight-include-add",accessibilityRole:"button",accessibilityLabel:"Add include pattern",style:[y.addButton,{borderColor:I.color.accentBorderStrong}],onPress:()=>a(true),children:[w(_s,{size:14,color:I.color.accent}),w(p,{style:[y.addButtonText,{color:I.color.accent}],children:"Add include pattern"})]})})]}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:ii,color:I.color.accent,size:12}),w(te.Title,{children:"EXCLUDE"}),e.excludePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-exclude-count",count:e.excludePatterns.length,color:I.color.accent})]}),w(p,{style:y.sectionDescription,children:"Hide components matching these patterns from the list."}),e.excludePatterns.length>0&&w(h,{style:y.patternChips,children:e.excludePatterns.map((x,L)=>w(pi,{mode:"exclude",pattern:x,onRemove:()=>W(L)},`${x.type}-${x.value}-${L}`))}),w(h,{style:y.addPatternRow,children:u?w(gi,{mode:"exclude",onSelect:x=>{c(false),b(x)},onCancel:()=>c(false)}):T?w(hi,{mode:"exclude",type:T,onSubmit:x=>P(T,x),onCancel:()=>b(null)}):M(Y,{testID:"buoy-highlight-exclude-add",accessibilityRole:"button",accessibilityLabel:"Add exclude pattern",style:[y.addButton,{borderColor:I.color.accentBorderStrong}],onPress:()=>c(true),children:[w(_s,{size:14,color:I.color.accent}),w(p,{style:[y.addButtonText,{color:I.color.accent}],children:"Add exclude pattern"})]})})]}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:xg,color:I.color.warning,size:12}),w(te.Title,{children:"RENDER COUNT RANGE"}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&w(te.Badge,{count:1,color:I.color.warning})]}),w(p,{style:y.sectionDescription,children:"Show only components with render count in a specific range."}),M(h,{nativeID:"__rn_buoy__render-count-range",testID:"buoy-highlight-range",style:y.renderCountRangeContainer,children:[M(h,{style:y.renderCountInputRow,children:[M(h,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Min"}),w(wn,{value:e.minRenderCount!==void 0?String(e.minRenderCount):"",onChangeText:x=>{let L=parseInt(x,10);x===""||x===void 0?t({minRenderCount:void 0}):!isNaN(L)&&L>=0&&t({minRenderCount:L})},testID:"buoy-highlight-range-min",placeholder:"0",placeholderTextColor:I.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]}),w(p,{style:y.renderCountSeparator,children:"to"}),M(h,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Max"}),w(wn,{value:e.maxRenderCount!==void 0?String(e.maxRenderCount):"",onChangeText:x=>{let L=parseInt(x,10);x===""||x===void 0?t({maxRenderCount:void 0}):!isNaN(L)&&L>=0&&t({maxRenderCount:L})},testID:"buoy-highlight-range-max",placeholder:"\u221E",placeholderTextColor:I.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]})]}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&M(Y,{testID:"buoy-highlight-range-clear",accessibilityRole:"button",accessibilityLabel:"Clear range",style:y.clearRangeButton,onPress:()=>t({minRenderCount:void 0,maxRenderCount:void 0}),children:[w(or,{size:12,color:I.color.warning}),w(p,{style:y.clearRangeButtonText,children:"Clear Range"})]})]})]}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:Ws,color:I.color.textSecondary,size:12}),w(te.Title,{children:"DETECTED ITEMS"})]}),w(p,{style:y.sectionDescription,children:"Tap an item to quickly add it as an exclude pattern."}),M(Me,{horizontal:true,showsHorizontalScrollIndicator:false,style:y.categoryBadgeScroll,contentContainerStyle:y.categoryBadgeScrollContent,children:[m>0&&w(mt,{filterType:"all",count:m,isSelected:v==="all",onPress:()=>f("all")}),o.viewTypes.length>0&&w(mt,{filterType:"viewType",count:o.viewTypes.length,isSelected:v==="viewType",onPress:()=>f("viewType")}),o.testIDs.length>0&&w(mt,{filterType:"testID",count:o.testIDs.length,isSelected:v==="testID",onPress:()=>f("testID")}),o.nativeIDs.length>0&&w(mt,{filterType:"nativeID",count:o.nativeIDs.length,isSelected:v==="nativeID",onPress:()=>f("nativeID")}),o.componentNames.length>0&&w(mt,{filterType:"component",count:o.componentNames.length,isSelected:v==="component",onPress:()=>f("component")}),o.accessibilityLabels.length>0&&w(mt,{filterType:"accessibilityLabel",count:o.accessibilityLabels.length,isSelected:v==="accessibilityLabel",onPress:()=>f("accessibilityLabel")})]}),w(h,{nativeID:"__rn_buoy__detected-items",testID:"buoy-highlight-detected",style:y.detectedItemsContainer,children:N.length>0?w(Me,{testID:"buoy-highlight-detected-scroll",style:y.detectedItemsScroll,contentContainerStyle:y.detectedItems,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:N.map(x=>{let L=sn(x.type);return w(Y,{testID:ci(x.type,x.value),accessibilityRole:"button",accessibilityLabel:`${L.label} ${x.value}`,style:[y.detectedItem,{borderColor:L.color+"40"}],onPress:()=>Z(x.type,x.value),children:v==="all"?w(Et,{type:x.type,value:x.value,compact:true,shortLabel:true}):w(p,{style:y.detectedItemText,numberOfLines:1,children:x.value})},`${x.type}-${x.value}`)})}):w(p,{testID:"buoy-highlight-detected-empty",style:y.emptyText,children:"No items detected yet. Start tracking to see components here."})})]}),w(_a,{visible:S!==null,transparent:true,animationType:"fade",onRequestClose:()=>C(null),children:w($a,{accessible:false,testID:"buoy-highlight-detected-popup-backdrop",style:y.modalOverlay,onPress:()=>C(null),children:w(h,{accessible:false,testID:"buoy-highlight-detected-popup",style:y.actionPopup,children:S&&M(di,{children:[w(h,{style:y.actionPopupHeader,children:w(Et,{type:S.type,value:S.value,compact:true,shortLabel:true})}),M(h,{style:y.actionPopupButtons,children:[M(Y,{testID:"buoy-highlight-detected-popup-include",accessibilityRole:"button",accessibilityLabel:"Include only",style:[y.actionPopupButton,y.actionPopupInclude],onPress:V,children:[w(Os,{size:16,color:I.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:I.color.accent}],children:"Include Only"})]}),M(Y,{testID:"buoy-highlight-detected-popup-exclude",accessibilityRole:"button",accessibilityLabel:"Exclude",style:[y.actionPopupButton,y.actionPopupExclude],onPress:j,children:[w(ii,{size:16,color:I.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:I.color.accent}],children:"Exclude"})]})]}),w(Y,{testID:"buoy-highlight-detected-popup-cancel",accessibilityRole:"button",accessibilityLabel:"Cancel",style:y.actionPopupCancel,onPress:()=>C(null),children:w(p,{style:y.actionPopupCancelText,children:"Cancel"})})]})})})}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:ii,color:I.color.textTertiary,size:12}),w(te.Title,{children:"HOW FILTERS WORK"})]}),w(h,{style:y.howItWorks,children:M(p,{style:y.howItWorksText,children:[w(p,{style:y.howItWorksBold,children:"Any:"})," Matches against all fields",`
30
+ `)}l(vr,"logComprehensiveRenderData");function On(e,t,n,o="off"){let r=Date.now();if(!t)return{type:"unknown",timestamp:r};let i=t,s=t.alternate,a=Ie.get(e);if(a&&s){let R=a.memoizedProps?.children,W=t.memoizedProps?.children,X=s.memoizedProps?.children,V=t.memoizedProps===a.memoizedProps||R!==void 0&&W===R,j=s.memoizedProps===a.memoizedProps||R!==void 0&&X===R;V&&!j&&(i=s,s=t,o==="all"&&console.log("[Buoy]","[RenderCause] Detected fiber swap - using alternate as current"))}let c=null,u=null;s?(c=s.memoizedProps,u=s.memoizedState):a&&(c=a.memoizedProps,u=a.memoizedState);let d=c!==null?{memoizedProps:c,memoizedState:u,timestamp:r}:void 0,g={memoizedProps:i.memoizedProps,memoizedState:i.memoizedState,timestamp:r};Ul(e,g);let T=br(i),f=He(T)||void 0,b=Wl(i,f)||void 0,m=Fl(T),S=m.cause,v=m.hookChanges;if(!d){if(o!=="off"){if(o==="minimal")console.log("[Buoy]",`[${f||"Unknown"}] MOUNT`);else if(o==="verbose"){let R=typeof i?.type=="string"?i.type:"Unknown";console.log("[Buoy]",`[RENDER] ${f||"Unknown"} (${R}:${e}) | Cause: MOUNT`)}else if(o==="all"){let R=Ie.has(e)?Ie.size:1;vr(e,i,T,d,m,n,R)}}return{type:"mount",timestamp:r,componentCause:"mount",componentName:f}}let L=typeof i.type=="string"?i.type:void 0,P=Cr(d.memoizedProps,g.memoizedProps,L);if(o!=="off"){if(o==="minimal")Ml(f,m);else if(o==="verbose")$l(e,i,T,m,P);else if(o==="all"){let R=Ie.has(e)?Ie.size:1;vr(e,i,T,d,m,n,R)}}if(P&&P.length>0)return{type:"props",changedKeys:P.slice(0,dg),timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0};let C=Ol(d.memoizedState,g.memoizedState);if(C&&C.length>0)return{type:"hooks",hookIndices:C,timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0};let I=Sr(i);return I&&n.has(I)?{type:"parent",timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0}:S==="state"?{type:"state",timestamp:r,componentCause:S,componentName:f,parentComponentName:b,hookChanges:v||void 0}:S==="props"?{type:"props",timestamp:r,componentCause:S,componentName:f,parentComponentName:b}:S==="parent"?{type:"parent",timestamp:r,componentCause:S,componentName:f,parentComponentName:b}:{type:"unknown",timestamp:r,componentCause:S,componentName:f,parentComponentName:b}}l(On,"detectRenderCause");function Cr(e,t,n){if(e===t||!e||!t||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return null;let o=zl(n),r=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(let s of r)if(!s.startsWith("__")&&!o.skip.includes(s)){if(s==="children"){if(!o.alwaysTrack.includes("children"))continue;let a=e[s],c=t[s];a!==c&&(Tr(a)&&Tr(c)?i.push(`children: ${wr(a)} \u2192 ${wr(c)}`):i.push("children (content)"));continue}if(e[s]!==t[s]){let a=e[s],c=t[s];s==="style"?nn(a,c)?i.push(`${s} (ref only)`):i.push(s):typeof a=="function"&&typeof c=="function"?i.push(`${s} (fn ref)`):i.push(s)}}return i.length>0?i:null}l(Cr,"getChangedKeys");function nn(e,t,n=0){if(n>5)return false;if(e===t)return true;if(typeof e!=typeof t)return false;if(typeof e!="object"||e===null||t===null)return e===t;if(Array.isArray(e)!==Array.isArray(t))return false;if(Array.isArray(e)){if(e.length!==t.length)return false;for(let i=0;i<e.length;i++)if(!nn(e[i],t[i],n+1))return false;return true}let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return false;for(let i of o)if(!r.includes(i)||!nn(e[i],t[i],n+1))return false;return true}l(nn,"deepEqual");function Tr(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}l(Tr,"isPrimitive");function wr(e){return e===null?"null":e===void 0?"undefined":typeof e=="string"?e.length>20?`"${e.slice(0,20)}..."`:`"${e}"`:typeof e=="number"||typeof e=="boolean"?String(e):"[object]"}l(wr,"formatValue");function Ol(e,t){if(e===t||e==null||t==null||typeof e!="object"||typeof t!="object")return null;let n=[],o=e,r=t,i=0;for(;r!==null&&i<fr;)(o===null||_l(o,r))&&n.push(i),r=r?.next??null,o=o?.next??null,i++;return n.length>0?n:null}l(Ol,"detectHookChanges");function _l(e,t){return e===t?false:e.memoizedState!==t.memoizedState||e.baseState!==void 0&&e.baseState!==t.baseState}l(_l,"didHookChange");function Sr(e){let t=e?.return,n=0;for(;t&&n<Vl;){if(t.stateNode){let o=xr(t.stateNode);if(o!=null)return o}t=t.return,n++}return null}l(Sr,"getParentNativeTag");function Wl(e,t){if(!e)return null;let n=br(e);if(!n)return null;let o=n.return,r=0;for(;o&&r<Vl;){let i=o.tag;if(i===0||i===1||i===11||i===15){let s=He(o);if(s&&!yr(s)&&s!==t)return s}o=o.return,r++}return null}l(Wl,"getParentComponentName");function xr(e){return e?typeof e.__nativeTag=="number"?e.__nativeTag:typeof e._nativeTag=="number"?e._nativeTag:typeof e.canonical?.__nativeTag=="number"?e.canonical.__nativeTag:typeof e.canonical?.publicInstance?.__nativeTag=="number"?e.canonical.publicInstance.__nativeTag:null:null}l(xr,"getNativeTagFromStateNode");function Ul(e,t){if(Ie.size>=mr){let n=Array.from(Ie.entries());n.sort((r,i)=>r[1].timestamp-i[1].timestamp);let o=Math.floor(mr/4);for(let r=0;r<o;r++)Ie.delete(n[r][0])}Ie.set(e,t)}l(Ul,"updateStoredState");function Ir(){Ie.clear()}l(Ir,"clearRenderCauseState");function jl(e){Ie.delete(e)}l(jl,"removeRenderCauseState");function Gl(){return{storedStates:Ie.size,maxStates:mr}}l(Gl,"getRenderCauseStats");var hg=5,Kl=200,_n=20,Wn=30;function Ee(e,t=0,n=new WeakSet){if(e==null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e=="string")return e.length>Kl?e.slice(0,Kl)+"...":e;if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="symbol")return`[Symbol: ${e.description||""}]`;if(t>=hg)return Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`[Object: ${Object.keys(e).length} keys]`:"[...]";if(typeof e=="object"){if(n.has(e))return"[Circular]";n.add(e)}if(Array.isArray(e)){let o=e.slice(0,_n).map(r=>Ee(r,t+1,n));return e.length>_n&&o.push(`[...${e.length-_n} more]`),o}if(e instanceof Date)return e.toISOString();if(e instanceof Error)return`[Error: ${e.message}]`;if(e instanceof RegExp)return e.toString();if(e instanceof Map){let o={__type:"Map",__size:e.size},r=0;for(let[i,s]of e){if(r>=Wn){o[`...${e.size-r} more`]=true;break}let a=typeof i=="string"?i:String(i);o[a]=Ee(s,t+1,n),r++}return o}if(e instanceof Set)return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,_n).map(o=>Ee(o,t+1,n))};if(typeof e=="object"){let o={},r=Object.keys(e),i=r.slice(0,Wn);for(let s of i)if(!(s.startsWith("__")||s==="children"))try{o[s]=Ee(e[s],t+1,n)}catch{o[s]="[Error accessing property]"}return r.length>Wn&&(o[`...${r.length-Wn} more keys`]=true),o}return"[Unknown type]"}l(Ee,"safeCloneForHistory");function ql(e){if(e?.memoizedProps)return Ee(e.memoizedProps)}l(ql,"capturePropsSnapshot");function Jl(e){if(!e?.memoizedState)return;let t=e.memoizedState;if(typeof t=="object"&&t!==null&&"next"in t){let n=[],o=t,r=0;for(;o&&r<fr;)n.push({index:r,memoizedState:Ee(o.memoizedState)}),o=o.next,r++;return{__type:"Hooks",hooks:n}}return Ee(t)}l(Jl,"captureStateSnapshot");import{notifySubscriberCountChange as Yl}from"@buoy-gg/shared-ui/web";U();var Dr=new Set(["HighlightUpdatesOverlay","HighlightUpdatesModal","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderHistoryFooter","RenderCauseBadge","TwoLevelCauseBadge","EnhancedCauseDisplay","IsolatedRenderList","IsolatedRenderListInner","StatsDisplay","StatsDisplayInner","CurrentStateView","EventStepperFooter","EventsModal","UnifiedEventList","UnifiedEventItem","UnifiedEventDetail","UnifiedEventFilters","UnifiedEventViewer","ReactQueryEventDetail","EventsCopySettingsView"]),on=["HighlightUpdates","RenderList","RenderDetail","RenderHistory","RenderCause","EventStepper","UnifiedEvent","EventsModal","EventsCopy"],Xl=new Set(["JsModalComponent","JsModal","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","FloatingTools","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","ModalHeader","TabSelector","SectionHeader","DraggableHeader","WindowControls","TreeDiffViewer","DataViewer","SplitDiffViewer","VirtualizedDataExplorer","DiffSummary","TypeLegend","IndentGuides","IndentGuidesOverlay","CyberpunkInput","DiffView","AnswerCard","DetailsSection","DetailRow","QuickActionsSection","FilterOptionCard","SearchSection","SearchSectionInner","HeaderActions","HeaderActionsInner","MainListHeader","FilterViewHeader","DetailViewHeader","FloatingMenu","FloatingDevTools","MinimizedToolsStack","MinimizedToolsContext","GlitchToolButton","ExpandablePopover","CollapsedPeek","ExpandedWrapper","DialIcon","DialMenu","DialIconItem","OnboardingTooltip","MenuLauncherIcon","DevToolsSettingsModal","SettingsModal","ImageOverlayModal","ImageOverlayStandalone","ToolCard","ToolIcon","GripVerticalIcon","UserStatus","Divider","ChevronDown","ChevronUp","ChevronLeft","ChevronRight","ChevronDownIcon","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage","PerfMonitorOverlay","PerfMonitorModal","PerfMonitorRoot","PerfHudInline","PerfDiagnostics","MetricSparkline","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","PerfHudInlineInner","PerfMonitorOverlayInner","MiniMetric","MetricRow","MetricNumber","MetricSparklineInner","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection","TaskTable","TaskRow","BusySparkline"]),Rr=["JsModal","ImageOverlay","PerfMonitor","PerfHud","JsTop"],Ql=new Set(["VirtualizedDataExplorer","TreeDiffView","TreeDiffRow","DataViewer","DiffView","DiffSummary","FloatingDevTools","FloatingMenu","FloatingBubble","MinimizedDock","DialMenu","DialItem","ExpandableSection","ChevronIcon","GlitchText","SettingsModal","SettingsRow","OnboardingFlow","DevToolsMenu"]),kr=false;function Zl(e){kr=e}l(Zl,"setCaptureBuoyToolRenders");function Pr(){return kr}l(Pr,"isCapturingBuoyToolRenders");var pg=new Set(["PerfHudInline","PerfHudInlineInner","PerfDiagnostics","MetricSparkline","MetricSparklineInner","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","MiniMetric","MetricRow","MetricNumber","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection"]);function Nr(e){return e.startsWith("PerfMonitor")||e.startsWith("PerfHud")||pg.has(e)}l(Nr,"isPerfMonitorComponentName");var mg=new Set(["TaskTable","TaskRow","BusySparkline"]);function es(e){return e.startsWith("JsTop")||mg.has(e)}l(es,"isJsTopComponentName");function ts(e){if(Dr.has(e))return true;for(let t=0;t<on.length;t++)if(e.startsWith(on[t]))return true;if(kr)return Nr(e)||es(e);if(Xl.has(e)||Ql.has(e))return true;for(let t=0;t<Rr.length;t++)if(e.startsWith(Rr[t]))return true;return false}l(ts,"isDevToolsComponentName");function ns(e){if(Dr.has(e))return true;for(let t=0;t<on.length;t++)if(e.startsWith(on[t]))return true;return false}l(ns,"isRenderLoopUnsafeName");var se=false,it=false,We=false,we=false,ae=null,Pe=null,Un=null,rn=null,os=false,Se=false,jn=new Set,Lr=new Set,zr=new Map,Br=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],fg=false;function J(e,t){fg&&(t!==void 0?console.log("[Buoy]",`[HighlightUpdates] ${e}`,t):console.log("[Buoy]",`[HighlightUpdates] ${e}`))}l(J,"debugLog");function Gn(e){let t=ed(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"?n:null}l(Gn,"getPublicInstance");function at(e){let t=Pa(e);if(t!==null)return t;if(e==null)return null;let n=e;if(n.__nativeTag!=null)return n.__nativeTag;if(n._nativeTag!=null)return n._nativeTag;if(n.nativeTag!=null)return n.nativeTag;if(n.canonical){if(n.canonical.__nativeTag!=null)return n.canonical.__nativeTag;if(n.canonical._nativeTag!=null)return n.canonical._nativeTag;if(n.canonical.nativeTag!=null)return n.canonical.nativeTag}return null}l(at,"getNativeTag");function Kn(e){let t=e,n={viewType:"Unknown"};t?.canonical?.viewConfig?.uiViewClassName?n.viewType=t.canonical.viewConfig.uiViewClassName:t?.viewConfig?.uiViewClassName?n.viewType=t.viewConfig.uiViewClassName:Na(t)&&(n.viewType=t.tagName.toLowerCase());let o=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Oo(t),r=t?.canonical?.currentProps,i=t?.canonical?.pendingProps,s=o?.pendingProps,a=o?.memoizedProps;return n.testID=r?.testID||i?.testID||s?.testID||a?.testID||s?.["data-testid"]||a?.["data-testid"]||void 0,n.nativeID=r?.nativeID||i?.nativeID||s?.nativeID||a?.nativeID||s?.id||a?.id||void 0,n.accessibilityLabel=r?.accessibilityLabel||i?.accessibilityLabel||s?.accessibilityLabel||a?.accessibilityLabel||s?.["aria-label"]||a?.["aria-label"]||void 0,n.componentName=ss(o)||void 0,n}l(Kn,"extractComponentInfo");var rs=false,yg=false,Vr=null;var bg=new Set;var vg=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]),Cg=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]),lt=new Map,is=500;function as(){lt.clear()}l(as,"clearDevToolsCache");function Ar(e){return e?!!(vg.has(e)||e.startsWith("__highlight_")):false}l(Ar,"isHighlightOverlayNativeID");function Hr(e){if(!e)return false;if(Cg.has(e))return true;let t=e.charCodeAt(0);return!!(t===95&&e.startsWith("__rn_buoy__")||t===108&&e.startsWith("logbox"))}l(Hr,"isOtherDevToolsNativeID");function Er(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.displayName)return t.displayName;if(t.name)return t.name}let n=e.elementType;if(n){if(n.displayName)return n.displayName;if(n.name)return n.name}return null}l(Er,"getComponentName");var Tg=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","ScreenContainer","ScreenStack","Screen","ScreenContentWrapper","Svg","G","Path","Rect","Circle","Line","Polygon","Polyline","Ellipse","Text as SVGText","TSpan","TextPath","Use","Symbol","Defs","ClipPath","LinearGradient","RadialGradient","Stop","Mask","Pattern","Image as SVGImage","SafeAreaProvider","SafeAreaView","SafeAreaListener","GestureHandlerRootView","GestureDetector","ReanimatedView","ReanimatedText","ReanimatedImage","ReanimatedScrollView","Fragment","Suspense","Provider","Consumer","Context","ForwardRef"]);function ls(e){return!!(!e||Tg.has(e)||e==="Unknown"||e==="Component"||e.startsWith("Animated"))}l(ls,"isInternalComponent");function ss(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=Er(t);if(r&&typeof t.type!="string"&&(o||(o=r),!ls(r)))return r;t=t.return,n++}return o}l(ss,"getOwningComponentName");function cs(e){let t=e,n=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Oo(t),o=at(e)||at(t?.canonical?.publicInstance),r=Pr(),i=!r&&B.getSettings().excludeDevTools;if(i&&Na(e)&&e.closest("[data-buoy-root]"))return true;if(o!=null&&i){let c=lt.get(o);if(c!==void 0)return c}let s=false,a=n?.pendingProps?.nativeID||n?.memoizedProps?.nativeID||t?.canonical?.currentProps?.nativeID||null;if((Ar(a)||i&&Hr(a))&&(s=true),!s&&n){let c=n,u=0;for(;c&&u<30;){let d=Er(c);if(d){if(Dr.has(d)){s=true;break}for(let T of on)if(d.startsWith(T)){s=true;break}if(s)break;if(r&&Nr(d)){s=true;break}if(i){if(Xl.has(d)||Ql.has(d)){s=true;break}for(let T of Rr)if(d.startsWith(T)){s=true;break}if(s)break}}let g=c.pendingProps?.nativeID||c.memoizedProps?.nativeID;if(Ar(g)){s=true;break}if(i&&Hr(g)){s=true;break}c=c.return,u++}}if(s&&o!=null&&i){if(lt.size>=is){let c=Array.from(lt.keys());for(let u=0;u<is/2;u++)lt.delete(c[u])}lt.set(o,s)}return s}l(cs,"isOurOverlayNode");function Fr(e){let t=Math.min(e-1,Br.length-1);return Br[Math.max(0,t)]}l(Fr,"getColorForRenderCount");function us(e){if(e.size===0||!se&&!We||B.getState().isPaused)return;Qe.isEnabled()&&ba();let t=B.getBatchSize(),n=Qe.startBatch(e.size,t),o=[],r=0,i=0,s=B.hasActiveFilters();for(let u of e)if(u&&typeof u=="object")try{if(cs(u)){r++;continue}let d=Gn(u),g=at(u)||at(d);if(g==null)continue;let T=Kn(u);if(s&&!B.passesFilters(T)){i++;continue}let f=B.getSettings().showRenderCount,b,m;f?(b=(zr.get(g)||0)+1,zr.set(g,b),m=Fr(b)):(b=0,m=Br[0]),o.push({node:u,color:m,count:b})}catch{}if(n.markFilteringComplete(r+i,o.length),o.length===0){n.finish();return}rs&&console.log("[Buoy]",`[HighlightUpdates] ${o.length} component(s) re-rendered`);let a=B.getRenderEventCallbackCount()>0;if(!Pe&&!a){rs&&console.log("[Buoy]","[HighlightUpdates] No highlightCallback and no event callbacks - skipping render"),os=false;return}n.markMeasurementStart();let c=o.slice(0,t*4).map(({node:u,color:d,count:g})=>new Promise(T=>{let f=false,b=l(P=>{f||(f=true,clearTimeout(m),T(P))},"settle"),m=setTimeout(()=>b({rect:null,stateNode:u,color:d,count:g}),500),S=Gn(u),v=at(u)||at(S);if(v==null){b({rect:null,stateNode:u,color:d,count:g});return}let L=l((P,C,I,R,W,X)=>{if(W==null||X==null||I==null||R==null){b({rect:null,stateNode:u,color:d,count:g});return}b({rect:{id:v,x:W,y:X,width:I,height:R,color:d,count:g},stateNode:u,color:d,count:g})},"onMeasured");if(!S){let P=u.node,C=globalThis.nativeFabricUIManager;if(P&&C?.measure){try{C.measure(P,L)}catch{b({rect:null,stateNode:u,color:d,count:g})}return}b({rect:null,stateNode:u,color:d,count:g});return}try{S.measure(L)}catch{b({rect:null,stateNode:u,color:d,count:g})}}));Promise.all(c).then(u=>{let d=u.filter(T=>T.rect!==null),g=d.map(T=>T.rect);n.markMeasurementComplete(d.length,u.length-d.length),g.length>0&&Pe&&se&&!it&&Pe(g),setTimeout(()=>{try{for(let m of d)m.rect&&Mr(m.rect.id,m.stateNode)}catch(m){J("registerTrackedNode batch failed",m)}let T=B.getSettings(),f=T.trackRenderCauses&&T.showRenderCount,b=null;if(f){b=new Set;for(let{rect:m}of d)m&&b.add(m.id)}if(se){B.startBatch();for(let{rect:m,stateNode:S,color:v,count:L}of d)if(m){let P=Kn(S),C;if(f&&b){let I=qn(S);C=On(m.id,I,b,T.debugLogLevel)}B.trackRender({nativeTag:m.id,viewType:P.viewType,testID:P.testID,nativeID:P.nativeID,accessibilityLabel:P.accessibilityLabel,componentName:P.componentName,measurements:{x:m.x,y:m.y,width:m.width,height:m.height},color:v,count:L,renderCause:C})}B.endBatch()}else for(let{rect:m,stateNode:S,color:v,count:L}of d)if(m){let P=Kn(S),C;if(f&&b){let I=qn(S);C=On(m.id,I,b,T.debugLogLevel)}B.emitRenderEvent({nativeTag:m.id,viewType:P.viewType,testID:P.testID,nativeID:P.nativeID,accessibilityLabel:P.accessibilityLabel,componentName:P.componentName,measurements:{x:m.x,y:m.y,width:m.width,height:m.height},color:v,count:L,renderCause:C})}n.markTrackingComplete(),n.markCallbackComplete(),n.finish()},0)}).catch(u=>{console.error("[Buoy]","[HighlightUpdates] Error in measurement pipeline:",u),n.finish()})}l(us,"handleTraceUpdates");var ds=globalThis.WeakRef,Pt=new Map;function Mr(e,t){if(!(e==null||t==null||typeof t!="object"))try{Pt.set(e,ds?new ds(t):{deref:l(()=>t,"deref")})}catch{Pt.set(e,{deref:l(()=>t,"deref")})}}l(Mr,"registerTrackedNode");function gs(e){let t=Pt.get(e)?.deref();return t||Pt.delete(e),t??null}l(gs,"derefNode");function hs(e){return new Promise(t=>{try{e.measure((n,o,r,i,s,a)=>{s==null||a==null||r==null||i==null?t(null):t({x:s,y:a,width:r,height:i})})}catch{t(null)}})}l(hs,"measureNode");function qn(e){let t=e;return t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Oo(t)||null}l(qn,"getFiberFromNode");function ps(e){let t=qn(e),n=0;for(;t&&n++<200;){let o=t.stateNode;if(o&&typeof o.scrollTo=="function"){let r=typeof o.getNativeScrollRef=="function"&&o.getNativeScrollRef()||null,i=typeof o.getInnerViewNode=="function"&&o.getInnerViewNode()||typeof o.getScrollableNode=="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:i}}t=t.return}return null}l(ps,"findScrollAncestor");async function ms(e,t,n){try{let o=ps(e);if(!o)return false;let r=t,i=null,s=l(a=>new Promise(c=>{let u=false,d=l(T=>{u||(u=true,c(T))},"settle"),g=setTimeout(()=>d(null),600);try{a(T=>{clearTimeout(g),d(T)})}catch{clearTimeout(g),d(null)}}),"withTimeout");if(o.nativeRef&&typeof r.measureLayout=="function"&&(i=await s(a=>r.measureLayout(o.nativeRef,(c,u)=>a(u),()=>a(null)))),i==null){let a=Rt(t),c=typeof o.innerNode=="number"?o.innerNode:Rt(o.innerNode);a!=null&&c!=null&&(i=await s(u=>Xt.measureLayout(a,c,()=>u(null),(d,g)=>u(g))))}return i==null?false:(o.instance.scrollTo({y:Math.max(0,i-n),animated:false}),await new Promise(a=>setTimeout(a,80)),true)}catch{return false}}l(ms,"scrollDescendantIntoView");function fs(e,t){let n=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)],o=0;for(let r of n){if(!r)continue;let i=r.toLowerCase();if(i===t)return 3;i.startsWith(t)?o=Math.max(o,2):i.includes(t)&&(o=Math.max(o,1))}return o}l(fs,"matchScore");async function ys(e){let t=e.scrollIntoView!==false,n=typeof e.margin=="number"?e.margin:12,o=B.getRenders(),r=l(async()=>{let v=await Bn(),L=(e.query??"").trim().toLowerCase(),P;for(let R of v.elements){if(e.nativeTag!=null&&R.nativeTag===e.nativeTag){P={el:R,score:1e3};break}let W=Zt({nativeTag:R.nativeTag,testID:R.testID,label:R.label,text:R.text,name:R.name,tap:R.tap},{query:L||void 0,nativeTag:e.nativeTag});W<=0||(!P||W>P.score)&&(P={el:R,score:W})}if(!P?.el.frame)return{matched:false,reason:"no-match",candidates:[]};let C=v.screen,I=P.el.frame;return{matched:true,live:true,rect:{x:I.x*C.width,y:I.y*C.height,width:I.width*C.width,height:I.height*C.height},scale:Go.get(),screen:{width:C.width,height:C.height},nativeTag:P.el.nativeTag??void 0,componentName:P.el.name,testID:P.el.testID}},"locateFromScreen");if(o.length===0)return r();let i=(e.query??"").trim().toLowerCase(),s=i?o.map(v=>({r:v,score:fs(v,i)})).filter(v=>v.score>0).sort((v,L)=>L.score-v.score||L.r.lastRenderTime-v.r.lastRenderTime):[],a=s.slice(0,8).map(({r:v})=>({nativeTag:v.nativeTag,componentName:v.componentName,testID:v.testID,nativeID:v.nativeID,viewType:v.viewType,renderCount:v.renderCount})),c=e.nativeTag??(s.length>0?s[0].r.nativeTag:void 0);if(c==null){let v=await r();return v.matched?v:{matched:false,reason:"no-match",candidates:a}}let u=o.find(v=>v.nativeTag===c),d=null,g=false,T=false,f=gs(c);if(f){let v=Gn(f);v&&(t&&(T=await ms(f,v,n)),d=await hs(v),g=!!d)}if(!d&&u?.measurements&&(d={...u.measurements}),!d)return{matched:false,reason:"no-measurement",nativeTag:c,candidates:a};let b=Go.get(),m=Ze.get("window"),S=d.x>=-1&&d.y>=-1&&d.x+d.width<=m.width+1&&d.y+d.height<=m.height+1;return{matched:true,live:g,scrolled:T,inView:S,rect:d,scale:b,screen:{width:m.width,height:m.height},nativeTag:c,componentName:u?.componentName,testID:u?.testID,candidates:a}}l(ys,"locateComponent");function $r(e){if(!ae?.rendererInterfaces){J("No rendererInterfaces available");return}let t=0;if(ae.rendererInterfaces.forEach((n,o)=>{if(typeof n.setTraceUpdatesEnabled=="function")try{n.setTraceUpdatesEnabled(e),t++,J(`Renderer ${o}: setTraceUpdatesEnabled(${e})`)}catch(r){J(`Renderer ${o}: error setting trace updates`,r)}else J(`Renderer ${o}: no setTraceUpdatesEnabled method`)}),J(`Set trace updates ${e?"enabled":"disabled"} on ${t} renderer(s)`),ae.reactDevtoolsAgent?.setTraceUpdatesEnabled)try{ae.reactDevtoolsAgent.setTraceUpdatesEnabled(e),J("Also set trace updates on agent")}catch(n){J("Error setting trace updates on agent",n)}}l($r,"setTraceUpdatesOnRenderers");function Or(){ae&&(rn||(J("Subscribing to traceUpdates event"),typeof ae.sub=="function"?(rn=ae.sub("traceUpdates",us),J("Subscribed using hook.sub()")):J("hook.sub not available, traceUpdates may not work"),$r(true)))}l(Or,"subscribeToTraceUpdates");function Jn(){$r(false),rn&&(rn(),rn=null,J("Unsubscribed from traceUpdates event"))}l(Jn,"unsubscribeFromTraceUpdates");function _r(e){Pe=e,J(`Highlight callback ${e?"set":"cleared"}`)}l(_r,"setHighlightCallback");function bs(e){Un=e,J(`Badge press callback ${e?"set":"cleared"}`)}l(bs,"setBadgePressCallback");function vs(){return Un}l(vs,"getBadgePressCallback");function Cs(e){Un&&Un(e)}l(Cs,"handleBadgePress");var Wr=null,Yn=null;function Ts(e){Wr=e,e&&Yn!==null&&e(Yn)}l(Ts,"setSpotlightCallback");function ws(e){if(me){me("setSpotlight",{nativeTag:e});return}Yn=e,Wr&&Wr(e)}l(ws,"setSpotlight");var me=null;function Ss(e){me=e}l(Ss,"setRemoteHandler");function xs(e){se!==e.enabled&&(se=e.enabled,Xn()),Se!==e.frozen&&(Se=e.frozen,an())}l(xs,"replaceRemoteState");function Is(){return Yn}l(Is,"getSpotlight");function Xn(){Lr.forEach(e=>{try{e(se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in state listener:",t)}})}l(Xn,"notifyStateListeners");function Ur(e){return Lr.add(e),e(se),()=>{Lr.delete(e)}}l(Ur,"subscribe");function Ds(e){if(typeof ee<"u"&&!ee)return{recordRenders:l(()=>{},"recordRenders"),disconnect:l(()=>{},"disconnect")};if(Ue!==void 0||we)throw new Error("Connect the render source before Highlight starts.");Ue=e;let t=true,n=new Set;return Nt(),{recordRenders(o){if(!t||!e||!se||B.getState().isPaused)return;let r=[];B.startBatch();try{for(let{host:i,name:s,count:a}of o){if(!i.isConnected)continue;let c=Pa(i);if(c===null)continue;let u=(B.getRender(String(c))?.renderCount??0)+a,d=Fr(u),{x:g,y:T,width:f,height:b}=i.getBoundingClientRect(),m={x:g,y:T,width:f,height:b};B.trackRender({nativeTag:c,viewType:s,componentName:s,isComponent:true,testID:i.getAttribute("data-testid")??void 0,measurements:m,color:d,count:u}),Mr(c,i),n.add(c),f>0&&b>0&&r.push({id:c,...m,color:d,count:B.getSettings().showRenderCount?u:0})}}finally{B.endBatch()}for(let i of n)B.getRender(String(i))||(n.delete(i),Pt.delete(i));!it&&r.length&&Pe?.(r)},disconnect(){if(t){t=false,st(),Pe?.([]),Gr();for(let o of n)Pt.delete(o);n.clear(),Ue=void 0,we=false}}}}l(Ds,"connectRenderSource");var Ue;function Rs(){return Ue===void 0?void 0:Ue?"ready":"unavailable"}l(Rs,"getRenderSourceStatus");function Nt(){if(typeof ee<"u"&&!ee)return J("Only available in development builds"),false;if(me||we)return true;if(Ue!==void 0)return we=Ue,Qn(),we;if(ae=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null,!ae)return J("React DevTools hook not found"),false;if(J("Hook found"),J(`Hook has sub: ${typeof ae.sub=="function"}`),J(`Hook has on: ${typeof ae.on=="function"}`),J(`Hook has emit: ${typeof ae.emit=="function"}`),Uo(),ae.rendererInterfaces&&ae.rendererInterfaces.size>0)return we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s)`),Qn(),true;let e=setInterval(()=>{ae?.rendererInterfaces&&ae.rendererInterfaces.size>0&&(clearInterval(e),we=true,J(`Initialized with ${ae.rendererInterfaces.size} renderer(s) (delayed)`),Qn())},100);return setTimeout(()=>clearInterval(e),1e4),false}l(Nt,"initialize");function Qn(){typeof window<"u"&&(window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:Lt,disable:st,toggle:jr,isEnabled:Kr,setEnabled:qr,subscribe:Ur,initialize:Nt,destroy:Xr,isInitialized:l(()=>we,"isInitialized"),setHighlightCallback:_r})}l(Qn,"exposeGlobally");function Lt(){typeof ee<"u"&&!ee||Ue!==false&&(we||Nt(),it&&(it=false),!se&&(J("Enabling highlights"),We||Or(),B.start(),se=true,Xn(),Yl("render")))}l(Lt,"enable");function st(){typeof ee<"u"&&!ee||se&&(J("Disabling highlights"),yg=false,os=false,Vr&&(clearTimeout(Vr),Vr=null),bg.clear(),lt.clear(),Ir(),Se&&(Se=false,an()),We||Jn(),B.stop(),se=false,Xn(),Yl("render"))}l(st,"disable");function ks(){typeof ee<"u"&&!ee||We||(we||Nt(),J("Enabling background tracking"),se||Or(),We=true)}l(ks,"enableBackgroundTracking");function Ps(){typeof ee<"u"&&!ee||We&&(J("Disabling background tracking"),We=false,se||Jn())}l(Ps,"disableBackgroundTracking");function Ns(){return We}l(Ns,"isBackgroundTrackingEnabled");function jr(){if(!(typeof ee<"u"&&!ee)){if(me){me("toggle");return}se?st():Lt()}}l(jr,"toggle");function Gr(){if(me){me("clearRenderCounts");return}zr.clear(),B.clear(),J("Cleared render counts")}l(Gr,"clearRenderCounts");function Kr(){return se}l(Kr,"isEnabled");function qr(e){if(me){me("setEnabled",{enabled:e});return}e?Lt():st()}l(qr,"setEnabled");function Zn(e){it!==e&&(it=e,e&&Pe&&Pe([]))}l(Zn,"setHighlightsSuppressed");function Ls(){return it}l(Ls,"getHighlightsSuppressed");function zs(e){if(me){me("setSilentTracking",{enabled:e});return}e?(Lt(),Zn(true)):(Zn(false),st())}l(zs,"setSilentTracking");function Bs(){return we}l(Bs,"isInitialized");function an(){jn.forEach(e=>{try{e(Se)}catch(t){console.error("[Buoy]","[HighlightUpdates] Error in freeze listener:",t)}})}l(an,"notifyFreezeListeners");function Vs(e){return jn.add(e),e(Se),()=>{jn.delete(e)}}l(Vs,"subscribeToFreeze");function Jr(){typeof ee<"u"&&!ee||Se||(Se=true,J("Freeze mode enabled"),an())}l(Jr,"freeze");function Yr(){typeof ee<"u"&&!ee||Se&&(Se=false,J("Freeze mode disabled"),Pe&&Pe([]),an())}l(Yr,"unfreeze");function As(){if(me){me("toggleFreeze");return}Se?Yr():Jr()}l(As,"toggleFreeze");function Hs(){return Se}l(Hs,"getFrozen");function Xr(){we&&(Jn(),jo(),Wo(null),Se=false,jn.clear(),se=false,ae=null,Pe=null,we=false,typeof window<"u"&&delete window.__HIGHLIGHT_UPDATES_CONTROLLER__,J("Destroyed"))}l(Xr,"destroy");var wg={connectRenderSource:Ds,getRenderSourceStatus:Rs,subscribe:Ur,enable:Lt,disable:st,toggle:jr,isEnabled:Kr,setEnabled:qr,initialize:Nt,destroy:Xr,isInitialized:Bs,setHighlightCallback:_r,clearRenderCounts:Gr,freeze:Jr,unfreeze:Yr,toggleFreeze:As,getFrozen:Hs,subscribeToFreeze:Vs,setBadgePressCallback:bs,getBadgePressCallback:vs,handleBadgePress:Cs,setSpotlightCallback:Ts,setSpotlight:ws,getSpotlight:Is,clearDevToolsCache:as,enableBackgroundTracking:ks,disableBackgroundTracking:Ps,isBackgroundTrackingEnabled:Ns,setRemoteHandler:Ss,replaceRemoteState:xs,locateComponent:ys,setHighlightsSuppressed:Zn,getHighlightsSuppressed:Ls,setSilentTracking:zs},E=wg;U();import Sg,{useState as de,useEffect as De,useRef as ct,useCallback as oe}from"react";import{Power as xg,JsModal as Ig,devToolsStorageKeys as zt,persistentStorage as eo,night as Bt,TickProvider as Es,windowDragProps as Dg}from"@buoy-gg/shared-ui/web";import{useIsPro as Rg}from"@buoy-gg/license/web";Ve();U();import{useMemo as to,useState as Fs,useCallback as ln}from"react";import{CopyButton as kg,formatRelativeTime as Pg,PlusIcon as Ng,MinusIcon as Lg,EventStepperFooter as zg,Lock as Bg,night as $,useLimit as Vg,monoFont as Vt}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as Ag}from"@buoy-gg/shared-ui/web/dataViewer";U();import{buoyColors as je,night as re,monoFont as ut}from"@buoy-gg/shared-ui/web";import{Fragment as Hg,jsx as K,jsxs as ce}from"react/jsx-runtime";var Ge={mount:{label:"MOUNT",color:je.success,tip:"First render of this component."},props:{label:"PROPS",color:je.warning,tip:"Native props changed. Consider React.memo() or useCallback for handlers."},state:{label:"STATE",color:"#a855f7",tip:"Component state changed via setState."},hooks:{label:"HOOKS",color:"#ec4899",tip:"Hook values changed (useState, useReducer, useMemo, etc.)."},context:{label:"CONTEXT",color:"#06b6d4",tip:"React context value changed."},parent:{label:"PARENT",color:je.textSecondary,tip:"Parent component re-rendered. Consider wrapping with React.memo()."},unknown:{label:"?",color:je.textMuted,tip:"Could not determine render cause."}},sn={mount:{label:"mount",color:je.success,tip:"First render of this component."},props:{label:"props",color:je.warning,tip:"Component received different props from parent."},state:{label:"state",color:"#a855f7",tip:"Component's own state changed (useState/useReducer)."},parent:{label:"parent",color:je.textSecondary,tip:"Parent re-rendered but this component's props/state didn't change. Consider React.memo()."},unknown:{label:"?",color:je.textMuted,tip:"Could not determine component render cause."}};function Qr({cause:e,compact:t=false,showKeys:n=false,showTwoLevel:o=false,testID:r}){let i=Ge[e.type],s=e.componentCause?sn[e.componentCause]:null,a=o&&s&&e.componentCause!==e.type;return ce(h,{nativeID:"__rn_buoy__cause-badge",testID:r,style:[A.container,t&&A.containerCompact],children:[a&&ce(Hg,{children:[K(h,{style:[A.badge,t&&A.badgeCompact,A.componentBadge,{backgroundColor:s.color+"15"}],children:K(p,{testID:r?`${r}-component`:void 0,style:[A.badgeText,t&&A.badgeTextCompact,A.componentBadgeText,{color:s.color}],children:s.label})}),K(p,{style:[A.arrowText,t&&A.arrowTextCompact],children:"\u2192"})]}),K(h,{style:[A.badge,t&&A.badgeCompact,{backgroundColor:i.color+"20"}],children:K(p,{testID:r?`${r}-native`:void 0,style:[A.badgeText,t&&A.badgeTextCompact,{color:i.color}],children:i.label})}),n&&e.changedKeys&&e.changedKeys.length>0&&K(p,{testID:r?`${r}-keys`:void 0,style:[A.keysText,t&&A.keysTextCompact],numberOfLines:1,children:e.changedKeys.join(", ")}),n&&e.hookIndices&&e.hookIndices.length>0&&ce(p,{testID:r?`${r}-hooks`:void 0,style:[A.keysText,t&&A.keysTextCompact],numberOfLines:1,children:["Hook ",e.hookIndices.join(", ")]})]})}l(Qr,"RenderCauseBadge");function Ms({cause:e}){let t=Ge[e.type],n=e.componentCause?sn[e.componentCause]:null,o=e.componentName||"Component";return ce(h,{nativeID:"__rn_buoy__two-level-cause",style:A.twoLevelContainer,children:[n&&ce(h,{style:A.twoLevelRow,children:[K(p,{style:A.twoLevelLabel,children:"Component:"}),K(p,{style:A.twoLevelName,children:o}),K(p,{style:A.twoLevelText,children:"re-rendered due to"}),K(h,{style:[A.badge,{backgroundColor:n.color+"20"}],children:K(p,{style:[A.badgeText,{color:n.color}],children:n.label.toUpperCase()})})]}),ce(h,{style:A.twoLevelRow,children:[K(p,{style:A.twoLevelLabel,children:"Native:"}),K(h,{style:[A.badge,{backgroundColor:t.color+"20"}],children:K(p,{style:[A.badgeText,{color:t.color}],children:t.label})}),e.changedKeys&&e.changedKeys.length>0&&ce(p,{style:A.twoLevelKeys,children:["[",e.changedKeys.join(", "),"]"]})]})]})}l(Ms,"TwoLevelCauseBadge");function Zr({cause:e,nativeType:t}){let n=Ge[e.type],o=e.componentCause?sn[e.componentCause]:null,r=e.componentName||"Unknown",i=e.hookChanges&&e.hookChanges.length>0,s=e.changedKeys&&e.changedKeys.length>0,a=e.changedKeys?.filter(u=>u.includes("(ref only)")||u.includes("(fn ref)"))||[],c=e.changedKeys?.filter(u=>!u.includes("(ref only)")&&!u.includes("(fn ref)"))||[];return ce(h,{nativeID:"__rn_buoy__enhanced-cause",style:A.enhancedContainer,children:[ce(h,{style:A.enhancedHeader,children:[K(p,{style:A.enhancedComponentName,children:r}),t&&K(h,{style:A.enhancedNativeTag,children:K(p,{style:A.enhancedNativeTagText,children:t})})]}),ce(h,{style:A.enhancedFlowContainer,children:[K(p,{style:A.enhancedFlowLabel,children:"Cause:"}),o&&K(h,{style:[A.enhancedFlowBadge,{backgroundColor:o.color+"20"}],children:K(p,{style:[A.enhancedFlowBadgeText,{color:o.color}],children:o.label.toUpperCase()})}),K(p,{style:A.enhancedFlowArrow,children:"\u2192"}),K(h,{style:[A.enhancedFlowBadge,{backgroundColor:n.color+"20"}],children:K(p,{style:[A.enhancedFlowBadgeText,{color:n.color}],children:n.label})})]}),i&&ce(h,{style:A.enhancedSection,children:[K(p,{style:A.enhancedSectionTitle,children:"Component State Changed:"}),e.hookChanges.map(u=>ce(h,{style:A.enhancedChangeRow,children:[K(p,{style:A.enhancedChangeIcon,children:"\u26A1"}),ce(p,{style:A.enhancedChangeText,children:["Hook[",u.index,"] (",u.type,"): ",u.description]})]},u.index))]}),c.length>0&&ce(h,{style:A.enhancedSection,children:[K(p,{style:A.enhancedSectionTitle,children:"Native Props Changed:"}),c.map((u,d)=>ce(h,{style:A.enhancedChangeRow,children:[K(p,{style:A.enhancedChangeIcon,children:"~"}),K(p,{style:A.enhancedChangeText,children:u})]},d))]}),a.length>0&&ce(h,{style:A.enhancedSection,children:[K(p,{style:[A.enhancedSectionTitle,{color:re.color.textTertiary}],children:"Reference Changes (optimization opportunity):"}),a.map((u,d)=>ce(h,{style:A.enhancedChangeRow,children:[K(p,{style:[A.enhancedChangeIcon,{color:re.color.textTertiary}],children:"\u25CB"}),K(p,{style:[A.enhancedChangeText,{color:re.color.textTertiary}],children:u})]},d))]}),!i&&!s&&e.type!=="mount"&&K(h,{style:A.enhancedSection,children:K(p,{style:A.enhancedNoChanges,children:e.type==="parent"?"Parent re-rendered (consider React.memo)":"No specific changes detected"})})]})}l(Zr,"EnhancedCauseDisplay");var A=ve.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{paddingVertical:3,paddingHorizontal:6,borderRadius:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5},componentBadge:{borderStyle:"dashed",borderWidth:1,borderColor:re.color.border},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},componentBadgeText:{fontWeight:"500",textTransform:"lowercase"},arrowText:{fontSize:10,color:re.color.textTertiary},arrowTextCompact:{fontSize:9},keysText:{fontSize:11,color:re.color.textSecondary,fontFamily:ut,flex:1},keysTextCompact:{fontSize:10},twoLevelContainer:{gap:8},twoLevelRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:6},twoLevelLabel:{fontSize:11,fontWeight:"600",color:re.color.textSecondary,minWidth:70},twoLevelName:{fontSize:11,fontWeight:"600",color:re.color.text,fontFamily:ut},twoLevelText:{fontSize:11,color:re.color.textSecondary},twoLevelKeys:{fontSize:10,color:re.color.textSecondary,fontFamily:ut},enhancedContainer:{gap:12},enhancedHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},enhancedComponentName:{fontSize:14,fontWeight:"700",color:re.color.text,fontFamily:ut},enhancedNativeTag:{backgroundColor:re.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},enhancedNativeTagText:{fontSize:10,fontWeight:"600",color:re.color.textTertiary,fontFamily:ut},enhancedFlowContainer:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12,backgroundColor:re.color.bg,borderRadius:6},enhancedFlowLabel:{fontSize:11,fontWeight:"600",color:re.color.textSecondary},enhancedFlowBadge:{paddingVertical:3,paddingHorizontal:8,borderRadius:4},enhancedFlowBadgeText:{fontSize:10,fontWeight:"700"},enhancedFlowArrow:{fontSize:14,color:re.color.textTertiary,fontWeight:"300"},enhancedSection:{gap:6},enhancedSectionTitle:{fontSize:11,fontWeight:"600",color:re.color.textSecondary,letterSpacing:.3},enhancedChangeRow:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingLeft:4},enhancedChangeIcon:{fontSize:12,color:re.color.warning,fontFamily:ut,width:16},enhancedChangeText:{fontSize:12,color:re.color.text,fontFamily:ut,flex:1},enhancedNoChanges:{fontSize:12,color:re.color.textTertiary,fontStyle:"italic",paddingLeft:4}});U();function $s(e,t){let n=e.filter(f=>f.renderCount>=t.minRenders);if(t.filterCauses.length>0){let f=new Set(t.filterCauses);n=n.filter(b=>f.has(b.lastRenderCause?.type??"unknown"))}let o=e.flatMap(f=>[f.firstRenderTime,f.lastRenderTime]).filter(f=>Number.isFinite(f)),r=o.length>0?Math.max(...o)-Math.min(...o):0,i=Math.max(.001,r/1e3),s=(t.groupByName?Os(n):n.map(f=>[f])).map(f=>_s(f,t,i));Us(s,t.sortBy);let a=t.topN===-1?0:Math.max(0,s.length-t.topN),c=t.topN===-1?s:s.slice(0,t.topN),u=e.reduce((f,b)=>f+b.renderCount,0),d=Ws(e),g=0,T=false;for(let f of e)f.lastRenderCause||(g+=f.renderCount),f.renderHistory&&f.renderHistory.length>0&&(T=true);return{totalUniqueComponents:n.length,totalRenders:u,windowMs:r,causeBreakdown:d,rows:c,truncated:a,dataGaps:{historyOff:!T,propsCaptureOff:!e.some(f=>f.renderHistory?.some(b=>b.capturedProps!==void 0)),stateCaptureOff:!e.some(f=>f.renderHistory?.some(b=>b.capturedState!==void 0)),rendersWithoutCause:g}}}l($s,"buildReport");function Os(e){let t=new Map;for(let n of e){let o=n.componentName||n.displayName||n.viewType,r=t.get(o);r?r.push(n):t.set(o,[n])}return Array.from(t.values())}l(Os,"groupByComponentName");function _s(e,t,n){let o=e[0],r=o.componentName||o.displayName||o.viewType,i=0,s={},a=new Map,c=new Map,u=new Map,d=0,g=0,T=0;for(let I of e){i+=I.renderCount;let R=I.lastRenderCause;if(!R)continue;let W=R.type;s[W]=(s[W]??0)+I.renderCount;let X=(R.hookChanges?.length??0)>0,V=(R.changedKeys?.length??0)>0;if(W==="parent"&&(R.componentCause==="state"||R.componentCause==="props"||X||V?g+=I.renderCount:T+=I.renderCount),W==="props"&&!V&&(d+=I.renderCount),R.parentComponentName&&u.set(R.parentComponentName,(u.get(R.parentComponentName)??0)+1),t.aggregateCauses&&R.hookChanges)for(let j of R.hookChanges){let x=`${j.type}[${j.index}]`,z=a.get(x);z?z.count+=1:a.set(x,{count:1,sample:Gs(j)})}if(R.changedKeys)for(let j of R.changedKeys)j.includes("(ref only)")||c.set(j,(c.get(j)??0)+1)}let f=Array.from(a.entries()).sort((I,R)=>R[1].count-I[1].count).slice(0,3).map(([I,R])=>({hook:I,count:R.count,sample:R.sample})),b=Array.from(c.entries()).sort((I,R)=>R[1]-I[1]).slice(0,5).map(([I])=>I),m="unknown",S=-1;for(let[I,R]of Object.entries(s))(R??0)>S&&(S=R??0,m=I);let v,L=0;for(let[I,R]of u)R>L&&(L=R,v=I);let P=e.map(I=>I.renderCount).sort((I,R)=>R-I),C=i/n;return{name:r,viewType:o.viewType,instances:e.length,renders:i,causeMix:s,dominantCause:m,hookCauses:f,changedKeys:b,unknownPropsCount:d,parentWithOwnChange:g,parentNoChange:T,parentName:v,instanceCounts:P,rate:C,source:e}}l(_s,"processGroup");function Ws(e){let t={};for(let n of e){let o=n.lastRenderCause?.type??"unknown";t[o]=(t[o]??0)+n.renderCount}return t}l(Ws,"aggregateCauseBreakdown");function Us(e,t){switch(t){case"renderCount":e.sort((n,o)=>o.renders-n.renders);break;case"rate":e.sort((n,o)=>o.rate-n.rate);break;case"name":e.sort((n,o)=>n.name.localeCompare(o.name));break}}l(Us,"sortRows");var js=32;function ei(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="function")return"[Fn]";if(typeof e=="object")return Array.isArray(e)?`[Array(${e.length})]`:"[Obj]";let t=String(e);return t.length>js?t.slice(0,js-1)+"\u2026":t}l(ei,"truncateValue");function Gs(e){return e.previousValue===void 0&&e.currentValue===void 0?e.description:`${ei(e.previousValue)} \u2192 ${ei(e.currentValue)}`}l(Gs,"formatHookSample");function ti(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}l(ti,"formatWindow");function no(e){return e>=100?`${e.toFixed(0)}/s`:e>=10?`${e.toFixed(1)}/s`:`${e.toFixed(2)}/s`}l(no,"formatRate");function ni(e){let t=Object.entries(e).sort((n,o)=>(o[1]??0)-(n[1]??0));return t.length===0?"(no causes recorded)":t.map(([n,o])=>`${n} ${o}`).join(" \xB7 ")}l(ni,"causeBreakdownLine");function oi(e){let t=[],n=Object.entries(e.causeMix).filter(([,r])=>(r??0)>0).sort((r,i)=>(i[1]??0)-(r[1]??0)),o=n.length>=2&&(n[1]?.[1]??0)>=e.renders*.1;if(e.dominantCause==="hooks"&&e.hookCauses.length>0){let r=e.hookCauses[0];r.sample?t.push(`hooks \xD7${r.count} ${r.hook}: ${r.sample}`):t.push(`hooks \xD7${r.count} ${r.hook}`)}else if(e.dominantCause==="props"){if(e.changedKeys.length>0){let r=e.changedKeys.slice(0,3).join(", ");t.push(`props (${r})`)}else t.push("props (keys not captured)");e.unknownPropsCount>0&&e.changedKeys.length>0&&t.push(`[${e.unknownPropsCount} unidentified]`)}else if(e.dominantCause==="parent"){let r="parent cascade";e.parentNoChange>0&&e.parentWithOwnChange===0&&(r="parent cascade, no own change"),e.parentName&&(r+=` \u2190 ${e.parentName}`),t.push(r)}else e.dominantCause==="mount"?t.push("mount"):e.dominantCause==="state"?t.push("state"):e.dominantCause==="context"?t.push("context"):t.push("unknown");if(o){let r=n.map(([i,s])=>`${i}:${s}`).join(" + ");t.push(`(${r})`)}return t.join(" ")}l(oi,"describeCause");function ri(e){if(e.instances<=1)return e.name;let t=e.instanceCounts,n=t[0]??0,o=t[t.length-1]??0;if(n-o<=1)return`${e.name} \xD7${e.instances} (${n} each)`;let r=t.slice(1),i=r.reduce((a,c)=>a+c,0),s=r.length>0?i/r.length:0;return`${e.name} \xD7${e.instances} (top ${n}, others ~${Math.round(s)})`}l(ri,"describeInstances");var Eg="React Native render report \u2014 review the data and identify why components are re-rendering.";function ii(e,t){let n=[];n.push(Eg),n.push(""),n.push(`Window: ${ti(e.windowMs)} \xB7 ${e.totalUniqueComponents} components \xB7 ${e.totalRenders} renders`),n.push(`Cause mix: ${ni(e.causeBreakdown)}`),n.push(""),n.push("Top offenders (count \xB7 rate \xB7 component \xB7 cause):"),n.push("");let o=e.rows.map(ri),r=Math.min(36,Math.max(8,...o.map(c=>c.length))),i=Math.max(3,...e.rows.map(c=>`\xD7${c.renders}`.length)),s=Math.max(5,...e.rows.map(c=>no(c.rate).length));for(let c=0;c<e.rows.length;c++){let u=e.rows[c],d=(o[c]??u.name).padEnd(r),g=`\xD7${u.renders}`.padStart(i),T=no(u.rate).padStart(s),f=oi(u);n.push(` ${g} ${T} ${d} ${f}`)}e.truncated>0&&(n.push(""),n.push(`... ${e.truncated} more (set topN=-1 to expand)`));let a=ai(e);if(a.length>0){n.push(""),n.push("Data availability:");for(let c of a)n.push(` \xB7 ${c}`)}return n.join(`
31
+ `)}l(ii,"generateSummary");function ai(e){let t=[];return e.dataGaps.rendersWithoutCause>0&&t.push(`${e.dataGaps.rendersWithoutCause} renders had no cause info (enable trackRenderCauses for more detail)`),e.dataGaps.propsCaptureOff&&t.push("prop snapshots not captured (enable capturePropsOnRender to see prop diffs for 'props (keys not captured)' rows)"),e.dataGaps.stateCaptureOff&&t.push("state snapshots not captured (enable captureStateOnRender)"),e.dataGaps.historyOff&&t.push("render history off (enable enableRenderHistory for per-render timeline)"),t}l(ai,"buildDataFooter");function Ks(e,t){let n=[];n.push("# React Render Report"),n.push(""),n.push(`**Window:** ${ti(e.windowMs)} \xB7 **Components:** ${e.totalUniqueComponents} \xB7 **Renders:** ${e.totalRenders}`),n.push(`**Cause mix:** ${ni(e.causeBreakdown)}`),n.push(""),n.push("| Component | Renders | Rate | Cause |"),n.push("|---|---:|---:|---|");for(let r of e.rows){let i=ri(r),s=oi(r).replace(/\|/g,"\\|");n.push(`| ${i} | ${r.renders} | ${no(r.rate)} | ${s} |`)}e.truncated>0&&(n.push(""),n.push(`_... ${e.truncated} more rows_`));let o=ai(e);if(o.length>0){n.push(""),n.push("**Data availability:**");for(let r of o)n.push(`- ${r}`)}return n.join(`
32
+ `)}l(Ks,"generateMarkdownTable");function qs(e,t,n){let o={exportedAt:new Date().toISOString(),summary:{windowMs:t.windowMs,totalComponents:t.totalUniqueComponents,totalRenders:t.totalRenders,causeBreakdown:t.causeBreakdown,truncated:t.truncated,dataGaps:t.dataGaps},components:t.rows.map(r=>({name:r.name,viewType:r.viewType,instances:r.instances,instanceCounts:r.instances>1?r.instanceCounts:void 0,renders:r.renders,ratePerSec:Number(r.rate.toFixed(3)),dominantCause:r.dominantCause,causeMix:r.causeMix,hookCauses:r.hookCauses,changedKeys:r.changedKeys,unknownPropsCount:r.unknownPropsCount||void 0,parentName:r.parentName,parentWithOwnChange:r.parentWithOwnChange||void 0,parentNoChange:r.parentNoChange||void 0,...n.includeHistory?{history:Js(r.source)}:{}}))};return n.includeHistory?JSON.stringify(o,null,2):JSON.stringify(o)}l(qs,"generateJson");function Js(e){return e.map(t=>({name:t.componentName||t.displayName,nativeTag:t.nativeTag,renderCount:t.renderCount,history:t.renderHistory?.map(n=>({n:n.renderNumber,t:n.timestamp,cause:{type:n.cause.type,componentCause:n.cause.componentCause,changedKeys:n.cause.changedKeys,parentComponentName:n.cause.parentComponentName,hookChanges:n.cause.hookChanges?.map(o=>({type:o.type,index:o.index,desc:o.description}))}}))}))}l(Js,"extractHistory");function oo(e,t){let n=$s(e,t);switch(t.format){case"summary":return ii(n,t);case"markdown-table":return Ks(n,t);case"json":return qs(e,n,t);default:return ii(n,t)}}l(oo,"generateExport");function Ys(e,t){return oo(e,t).length}l(Ys,"estimateExportSize");function li(e){return{totalComponents:e.length,totalRenders:e.reduce((t,n)=>t+n.renderCount,0)}}l(li,"getExportSummary");function Xs(e){return oo([e],{format:"summary",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false})}l(Xs,"generateSingleComponentExport");import{jsx as O,jsxs as Z}from"react/jsx-runtime";function si({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:o,onAddFilter:r,isPro:i=false}){let[s,a]=Fs(0),c=n??s,u=o??a,d=to(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((V,j)=>V.timestamp-j.timestamp),[e.renderHistory]),g=d.length,T=d[c],f=Vg("highlightUpdates.detailEvents"),b=i?1/0:f,m=to(()=>Math.max(0,g-b),[b,g]),S=T?.cause||e.lastRenderCause,v=ln(()=>{c>0&&u(c-1)},[c,u]),L=ln(()=>{let V=Math.min(b-1,g-1);c<V&&u(c+1)},[c,g,u,b]),P=to(()=>Xs(e),[e]),C=e.componentName||e.displayName,I=e.viewType,R=e.lastRenderTime-e.firstRenderTime,W=R>0?(e.renderCount/(R/1e3)).toFixed(1):e.renderCount.toString(),X=!t&&g>1;return Z(h,{style:N.container,children:[Z(h,{style:N.header,children:[Z(h,{style:N.headerLeft,children:[O(p,{testID:"buoy-highlight-detail-name",style:N.componentName,numberOfLines:1,children:C}),O(h,{style:N.nativeTypeBadge,children:O(p,{testID:"buoy-highlight-detail-type",style:N.nativeTypeText,children:I})})]}),O(kg,{value:P,size:14,testID:"buoy-highlight-detail-copy"})]}),Z(Me,{testID:"buoy-highlight-detail-scroll",style:N.scrollView,contentContainerStyle:[N.scrollContent,X&&{paddingBottom:100}],showsVerticalScrollIndicator:false,children:[S&&O(Qs,{cause:S,renderNumber:T?.renderNumber}),O(Zs,{render:e,rendersPerSec:W}),m>0&&Z(h,{testID:"buoy-highlight-detail-locked",style:N.lockedBanner,children:[O(Bg,{size:14,color:$.color.warning}),Z(p,{testID:"buoy-highlight-detail-locked-text",style:N.lockedBannerText,children:[m," ",m===1?"event":"events"," hidden"]}),O(p,{style:N.lockedBannerSubtext,children:"Upgrade to Pro"})]}),r&&O(ec,{render:e,onAddFilter:r})]}),X&&O(zg,{currentIndex:c,totalItems:g,onPrevious:v,onNext:L,itemLabel:"Render",subtitle:T?.timestamp?Pg(new Date(T.timestamp)):void 0,applySafeAreaInset:false,absolute:true})]})}l(si,"RenderDetailView");function Qs({cause:e,renderNumber:t}){let n=e.componentCause||e.type,o=e.componentCause?sn[e.componentCause]:Ge[e.type],r=e.hookChanges&&e.hookChanges.length>0,i=e.changedKeys&&e.changedKeys.length>0,s=l(()=>e.type==="mount"?"First render":n==="parent"?"Triggered by":"Changed:","getLabel");return Z(h,{testID:"buoy-highlight-detail-cause",style:N.answerCard,children:[Z(h,{style:N.causeBadgeRow,children:[O(p,{testID:"buoy-highlight-detail-cause-label",style:N.causeLabel,children:s()}),O(h,{style:[N.causeBadgeLarge,{backgroundColor:o.color+"20"}],children:O(p,{testID:"buoy-highlight-detail-cause-badge",style:[N.causeBadgeLargeText,{color:o.color}],children:o.label.toUpperCase()})})]}),r&&O(h,{style:N.hookChangesContainer,children:e.hookChanges.map((a,c)=>{let u=`${a.type}[${a.index}]`,d={[u]:a.previousValue},g={[u]:a.currentValue};return O(h,{style:N.hookDiffContainer,children:O(Ag,{oldValue:d,newValue:g,theme:"dark",showUnchanged:false})},c)})}),!r&&i&&O(h,{style:N.propsChangesContainer,children:e.changedKeys.filter(a=>!a.includes("(ref only)")).slice(0,5).map((a,c)=>O(h,{style:N.propChangeChip,children:O(p,{testID:`buoy-highlight-detail-changed-${c}`,style:N.propChangeText,children:a})},c))})]})}l(Qs,"AnswerCard");function Zs({render:e,rendersPerSec:t}){let n=e.testID||e.nativeID||e.accessibilityLabel,o=e.measurements;return Z(h,{style:N.detailsSection,children:[n&&Z(h,{testID:"buoy-highlight-detail-identifiers",style:N.detailsCard,children:[O(p,{style:N.detailsCardTitle,children:"Identifiers"}),e.testID&&O(ro,{label:"testID",value:e.testID}),e.nativeID&&O(ro,{label:"nativeID",value:e.nativeID}),e.accessibilityLabel&&O(ro,{label:"a11y",value:e.accessibilityLabel})]}),Z(h,{testID:"buoy-highlight-detail-stats",style:N.statsRow,children:[Z(h,{testID:"buoy-highlight-detail-stat-renders",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-renders-value",style:[N.statValue,{color:e.color}],children:e.renderCount}),O(p,{style:N.statLabel,children:"renders"})]}),O(h,{style:N.statDivider}),Z(h,{testID:"buoy-highlight-detail-stat-rate",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-rate-value",style:N.statValue,children:t}),O(p,{style:N.statLabel,children:"/sec"})]}),O(h,{style:N.statDivider}),Z(h,{testID:"buoy-highlight-detail-stat-tag",style:N.statItem,children:[O(p,{testID:"buoy-highlight-detail-stat-tag-value",style:N.statValue,children:e.nativeTag}),O(p,{style:N.statLabel,children:"tag"})]})]}),o&&Z(h,{testID:"buoy-highlight-detail-measure",style:N.measurementsRow,children:[Z(h,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"x"}),O(p,{testID:"buoy-highlight-detail-measure-x",style:N.measurementValue,children:Math.round(e.measurements.x)})]}),Z(h,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"y"}),O(p,{testID:"buoy-highlight-detail-measure-y",style:N.measurementValue,children:Math.round(e.measurements.y)})]}),Z(h,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"w"}),O(p,{testID:"buoy-highlight-detail-measure-w",style:N.measurementValue,children:Math.round(e.measurements.width)})]}),Z(h,{style:N.measurementItem,children:[O(p,{style:N.measurementLabel,children:"h"}),O(p,{testID:"buoy-highlight-detail-measure-h",style:N.measurementValue,children:Math.round(e.measurements.height)})]})]})]})}l(Zs,"DetailsSection");function ro({label:e,value:t}){let n=`buoy-highlight-detail-id-${e.toLowerCase()}`;return Z(h,{testID:n,style:N.detailRow,children:[O(p,{style:N.detailLabel,children:e}),O(p,{testID:`${n}-value`,style:N.detailValue,numberOfLines:1,children:t})]})}l(ro,"DetailRow");function ec({render:e,onAddFilter:t}){let[n,o]=Fs(null),r=to(()=>{let u=[];return e.nativeID&&u.push({type:"nativeID",value:e.nativeID,label:"nativeID"}),e.testID&&u.push({type:"testID",value:e.testID,label:"testID"}),e.accessibilityLabel&&u.push({type:"accessibilityLabel",value:e.accessibilityLabel,label:"a11y"}),e.componentName&&u.push({type:"component",value:e.componentName,label:"component"}),u.push({type:"viewType",value:e.viewType,label:"viewType"}),u},[e]),i=n!==null?r[n]:null,s=ln(u=>{o(d=>d===u?null:u)},[]),a=ln(()=>{i&&(t({type:i.type,value:i.value},"include"),o(null))},[i,t]),c=ln(()=>{i&&(t({type:i.type,value:i.value},"exclude"),o(null))},[i,t]);return Z(h,{testID:"buoy-highlight-quick",style:N.quickActionsSection,children:[O(p,{style:N.quickActionsTitle,children:"Quick Filters"}),O(h,{style:N.filterOptionsList,children:r.map((u,d)=>O(tc,{testID:`buoy-highlight-quick-${u.type.toLowerCase()}`,label:u.label,value:u.value,isSelected:n===d,onSelect:()=>s(d)},u.type))}),Z(h,{style:N.filterActionButtons,children:[Z(Y,{testID:"buoy-highlight-quick-include",accessibilityRole:"button",accessibilityLabel:"Only show this",style:[N.filterActionButton,N.filterActionButtonInclude,!i&&N.filterActionButtonDisabled],onPress:a,disabled:!i,activeOpacity:.7,children:[O(Ng,{size:14,color:i?$.color.accent:$.color.textTertiary}),O(p,{style:[N.filterActionButtonText,{color:i?$.color.accent:$.color.textTertiary}],children:"Only Show This"})]}),Z(Y,{testID:"buoy-highlight-quick-exclude",accessibilityRole:"button",accessibilityLabel:"Hide this",style:[N.filterActionButton,N.filterActionButtonExclude,!i&&N.filterActionButtonDisabled],onPress:c,disabled:!i,activeOpacity:.7,children:[O(Lg,{size:14,color:i?$.color.danger:$.color.textTertiary}),O(p,{style:[N.filterActionButtonText,{color:i?$.color.danger:$.color.textTertiary}],children:"Hide This"})]})]})]})}l(ec,"QuickActionsSection");function tc({testID:e,label:t,value:n,isSelected:o,onSelect:r}){return Z(Y,{testID:e,accessibilityRole:"button",accessibilityLabel:`${t}, ${n}`,style:[N.filterOptionCard,o&&N.filterOptionCardSelected],onPress:r,activeOpacity:.7,children:[O(p,{style:[N.filterOptionLabel,o&&N.filterOptionLabelSelected],children:t}),O(p,{testID:e?`${e}-value`:void 0,style:[N.filterOptionValue,o&&N.filterOptionValueSelected],numberOfLines:1,children:n})]})}l(tc,"FilterOptionCard");var N=ve.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:12,padding:16,paddingBottom:0},scrollView:{flex:1},scrollContent:{padding:16,paddingTop:12,paddingBottom:80,gap:12},headerLeft:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:10},componentName:{fontSize:18,fontWeight:"700",color:$.color.text,flexShrink:1},nativeTypeBadge:{backgroundColor:$.color.bg,paddingVertical:3,paddingHorizontal:8,borderRadius:4},nativeTypeText:{fontSize:11,fontWeight:"600",color:$.color.textTertiary,fontFamily:Vt},answerCard:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:6},causeBadgeRow:{flexDirection:"row",alignItems:"center",gap:8},causeBadgeLarge:{paddingVertical:4,paddingHorizontal:10,borderRadius:4},causeBadgeLargeText:{fontSize:11,fontWeight:"700",letterSpacing:.5},causeLabel:{fontSize:12,color:$.color.textSecondary,fontWeight:"500"},hookChangesContainer:{gap:6},hookDiffContainer:{backgroundColor:$.color.bg,borderRadius:6,overflow:"hidden"},propsChangesContainer:{flexDirection:"row",flexWrap:"wrap",gap:4},propChangeChip:{backgroundColor:$.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},propChangeText:{fontSize:11,color:$.color.text,fontFamily:Vt},detailsSection:{gap:10},detailsCard:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:6},detailsCardTitle:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:4},detailRow:{flexDirection:"row",alignItems:"center",gap:8},detailLabel:{fontSize:11,fontWeight:"600",color:$.color.textSecondary,minWidth:55},detailValue:{fontSize:12,color:$.color.text,fontFamily:Vt,flex:1},statsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,paddingVertical:10,paddingHorizontal:16},statItem:{flex:1,alignItems:"center"},statValue:{fontSize:16,fontWeight:"700",color:$.color.text,fontFamily:Vt},statLabel:{fontSize:10,color:$.color.textTertiary,marginTop:2},statDivider:{width:1,height:24,backgroundColor:$.color.border,marginHorizontal:12},measurementsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,paddingVertical:8,paddingHorizontal:12},measurementItem:{flexDirection:"row",alignItems:"baseline",gap:4},measurementLabel:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,textTransform:"uppercase"},measurementValue:{fontSize:12,fontWeight:"600",color:$.color.text,fontFamily:Vt},quickActionsSection:{backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.border,padding:12,gap:10},quickActionsTitle:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:2},filterOptionsList:{gap:6},filterOptionCard:{flexDirection:"row",alignItems:"center",backgroundColor:$.color.surfaceElevated,borderRadius:6,paddingVertical:10,paddingHorizontal:12,borderWidth:1,borderColor:"transparent",gap:10},filterOptionCardSelected:{borderColor:$.color.accentBorderStrong,backgroundColor:$.color.accentSoft},filterOptionLabel:{fontSize:10,fontWeight:"600",color:$.color.textTertiary,minWidth:70},filterOptionLabelSelected:{color:$.color.accent},filterOptionValue:{fontSize:12,color:$.color.text,fontFamily:Vt,flex:1},filterOptionValueSelected:{color:$.color.text},filterActionButtons:{flexDirection:"row",gap:8,marginTop:12},filterActionButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:4,paddingVertical:8,paddingHorizontal:10,borderRadius:6,borderWidth:1},filterActionButtonInclude:{backgroundColor:$.color.accentSoft,borderColor:$.color.accentBorderStrong},filterActionButtonExclude:{backgroundColor:$.color.dangerSoft,borderColor:$.color.danger+"40"},filterActionButtonDisabled:{backgroundColor:$.color.surfaceElevated,borderColor:$.color.border,opacity:.5},filterActionButtonText:{fontSize:11,fontWeight:"600"},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:$.color.surface,borderRadius:8,borderWidth:1,borderColor:$.color.warning+"40",paddingVertical:12,paddingHorizontal:16,gap:8},lockedBannerText:{color:$.color.warning,fontSize:13,fontWeight:"600"},lockedBannerSubtext:{color:$.color.textTertiary,fontSize:12}});import{EventStepperFooter as Fg}from"@buoy-gg/shared-ui/web";U();import{useState as dt,useCallback as gt}from"react";import{Eye as nc,Filter as ci,Plus as oc,X as io,Box as rc,Settings as Mg,Hash as $g,SectionHeader as te,night as D,monoFont as At}from"@buoy-gg/shared-ui/web";U();import{Box as Og,Hash as ic,Layers as _g,Eye as Wg,Search as Ug,FileCode as jg,buoyColors as ui,night as ac,monoFont as lc}from"@buoy-gg/shared-ui/web";import{jsx as Ht,jsxs as di}from"react/jsx-runtime";var sc={viewType:{label:"ViewType",shortLabel:"View",color:ac.color.accent,icon:Og},testID:{label:"testID",shortLabel:"test",color:ui.success,icon:ic},nativeID:{label:"nativeID",shortLabel:"native",color:"#f59e0b",icon:ic},component:{label:"Component",shortLabel:"Comp",color:"#a855f7",icon:jg},accessibilityLabel:{label:"a11y",shortLabel:"a11y",color:"#ec4899",icon:Wg},nativeTag:{label:"tag",shortLabel:"tag",color:ui.textMuted,icon:_g},any:{label:"Any",shortLabel:"Any",color:ui.warning,icon:Ug}};function Et({type:e,value:t,compact:n=false,badgeOnly:o=false,valueOnly:r=false,shortLabel:i=false,showIcon:s=false,testID:a}){let c=sc[e],u=c.icon,d=i?c.shortLabel:c.label;return r?Ht(p,{testID:a?`${a}-value`:void 0,style:[fe.valueOnly,n&&fe.valueOnlyCompact,{color:c.color}],numberOfLines:1,children:t}):o?di(h,{testID:a,style:[fe.badgeOnly,n&&fe.badgeOnlyCompact,{backgroundColor:c.color+"20",borderColor:c.color+"40"}],children:[s&&Ht(u,{size:n?10:12,color:c.color}),Ht(p,{style:[fe.badgeOnlyText,n&&fe.badgeOnlyTextCompact,{color:c.color}],children:d})]}):di(h,{testID:a,accessibilityLabel:`${c.label} ${t}`,style:[fe.container,n&&fe.containerCompact],children:[di(h,{style:[fe.badge,n&&fe.badgeCompact,{backgroundColor:c.color+"20"}],children:[s&&Ht(u,{size:n?8:10,color:c.color}),Ht(p,{style:[fe.badgeText,n&&fe.badgeTextCompact,{color:c.color}],children:d})]}),Ht(p,{testID:a?`${a}-value`:void 0,style:[fe.value,n&&fe.valueCompact],numberOfLines:1,children:t})]})}l(Et,"IdentifierBadge");var fe=ve.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{flexDirection:"row",alignItems:"center",paddingVertical:3,paddingHorizontal:6,borderRadius:4,gap:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5,gap:3},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},value:{fontSize:12,color:ac.color.text,fontFamily:lc,flex:1},valueCompact:{fontSize:11},badgeOnly:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,borderRadius:6,borderWidth:1,gap:5},badgeOnlyCompact:{paddingVertical:2,paddingHorizontal:6,borderRadius:4,gap:4},badgeOnlyText:{fontSize:11,fontWeight:"600"},badgeOnlyTextCompact:{fontSize:9,fontWeight:"700"},valueOnly:{fontSize:12,fontFamily:lc},valueOnlyCompact:{fontSize:11},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCount:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCountText:{fontSize:10,fontWeight:"600"}});U();function ht(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}l(ht,"identifierSlug");function gi(e){return`buoy-highlight-row-${ht(e)}`}l(gi,"renderRowTestID");function hi(e,t){return`buoy-highlight-detected-${ht(e)}-${ht(t)}`}l(hi,"detectedItemTestID");function pi(e,t,n){return`buoy-highlight-${e}-chip-${ht(t)}-${ht(n)}`}l(pi,"patternChipTestID");function pt(e){return`buoy-highlight-setting-${e}`}l(pt,"settingTestID");import{Fragment as mi,jsx as w,jsxs as M}from"react/jsx-runtime";var cn=l(e=>sc[e],"getFilterConfig"),Gg=["any","viewType","testID","nativeID","component","accessibilityLabel"];function fi({mode:e,onSelect:t,onCancel:n}){return M(h,{nativeID:"__rn_buoy__type-picker",testID:`buoy-highlight-${e}-types`,style:y.typePicker,children:[w(h,{style:y.typePickerRow,children:Gg.map(o=>{let r=cn(o),i=r.icon;return M(Y,{testID:`buoy-highlight-${e}-type-${o.toLowerCase()}`,accessibilityRole:"button",accessibilityLabel:r.label,style:[y.typeOption,{backgroundColor:r.color+"15",borderColor:r.color+"40"}],onPress:()=>t(o),children:[w(i,{size:14,color:r.color}),w(p,{style:[y.typeOptionText,{color:r.color}],children:r.label})]},o)})}),w(Y,{testID:`buoy-highlight-${e}-types-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:n,style:y.typePickerCancel,children:w(io,{size:16,color:D.color.textTertiary})})]})}l(fi,"TypePicker");function yi({mode:e,type:t,onSubmit:n,onCancel:o}){let[r,i]=dt(""),s=cn(t),a=l(()=>{r.trim()&&n(r.trim())},"handleSubmit");return M(h,{nativeID:"__rn_buoy__pattern-input",testID:`buoy-highlight-${e}-input-row`,style:y.patternInputContainer,children:[w(Et,{type:t,value:"",badgeOnly:true,compact:true}),w(Sn,{testID:`buoy-highlight-${e}-input`,value:r,onChangeText:i,onSubmitEditing:a,placeholder:"Enter pattern...",placeholderTextColor:D.color.placeholder,style:y.patternInput,autoFocus:true,returnKeyType:"done",autoCorrect:false,autoCapitalize:"none"}),r.trim()&&w(Y,{testID:`buoy-highlight-${e}-submit`,accessibilityRole:"button",accessibilityLabel:"Add pattern",onPress:a,style:[y.addPatternButton,{backgroundColor:s.color+"20"}],children:w(p,{style:[y.addPatternButtonText,{color:s.color}],children:"Add"})}),w(Y,{testID:`buoy-highlight-${e}-input-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:o,style:y.cancelButton,children:w(io,{size:16,color:D.color.textTertiary})})]})}l(yi,"PatternInput");function bi({mode:e,pattern:t,onRemove:n}){let o=cn(t.type);return M(Y,{testID:pi(e,t.type,t.value),accessibilityRole:"button",accessibilityLabel:`${o.label} ${t.value}, tap to remove`,style:[y.patternChip,{borderColor:o.color+"40"}],onPress:n,activeOpacity:.7,children:[w(h,{style:[y.patternChipBadge,{backgroundColor:o.color+"20"}],children:w(p,{style:[y.patternChipBadgeText,{color:o.color}],children:o.shortLabel})}),w(p,{style:y.patternChipValue,numberOfLines:1,children:t.value}),w(io,{size:12,color:D.color.textTertiary,style:y.patternChipX})]})}l(bi,"PatternChip");var Kg={label:"All",shortLabel:"All",color:D.color.textSecondary,icon:rc};function mt({filterType:e,count:t,isSelected:n,onPress:o}){let r=e==="all"?Kg:cn(e),i=`buoy-highlight-detected-cat-${String(e).toLowerCase()}`;return M(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${r.label}, ${t}`,style:[y.categoryBadge,{backgroundColor:r.color+"15",borderColor:n?r.color:r.color+"40",borderWidth:n?2:1}],onPress:o,children:[w(r.icon,{size:12,color:r.color}),w(p,{style:[y.categoryBadgeText,{color:r.color}],children:r.label}),w(h,{style:[y.categoryBadgeCountBubble,{backgroundColor:r.color+"25"}],children:w(p,{testID:`${i}-count`,style:[y.categoryBadgeCount,{color:r.color}],children:t})})]})}l(mt,"DetectedCategoryBadge");var qg=[{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:150,label:"150"},{value:250,label:"250"},{value:500,label:"500"}],vi=[{value:"off",label:"Off",description:"No debug logging"},{value:"minimal",label:"Minimal",description:"Only hook value changes"},{value:"verbose",label:"Verbose",description:"Component + cause + changes"},{value:"all",label:"All",description:"Full fiber dump"}];function Ci({filters:e,onFilterChange:t,settings:n,onSettingsChange:o,availableProps:r,activeTab:i}){let[s,a]=dt(false),[c,u]=dt(false),[d,g]=dt(null),[T,f]=dt(null),[b,m]=dt("all"),[S,v]=dt(null),L=l(x=>{switch(x){case"viewType":return r.viewTypes.map(z=>({value:z,type:"viewType"}));case"testID":return r.testIDs.map(z=>({value:z,type:"testID"}));case"nativeID":return r.nativeIDs.map(z=>({value:z,type:"nativeID"}));case"component":return r.componentNames.map(z=>({value:z,type:"component"}));case"accessibilityLabel":return r.accessibilityLabels.map(z=>({value:z,type:"accessibilityLabel"}));case"all":default:return[...r.viewTypes.map(z=>({value:z,type:"viewType"})),...r.testIDs.map(z=>({value:z,type:"testID"})),...r.nativeIDs.map(z=>({value:z,type:"nativeID"})),...r.componentNames.map(z=>({value:z,type:"component"})),...r.accessibilityLabels.map(z=>({value:z,type:"accessibilityLabel"}))]}},"getItemsForCategory")(b),P=r.viewTypes.length+r.testIDs.length+r.nativeIDs.length+r.componentNames.length+r.accessibilityLabels.length,C=gt((x,z)=>{let ue=[...e.includePatterns,{type:x,value:z}];t({includePatterns:ue}),g(null)},[e.includePatterns,t]),I=gt((x,z)=>{let ue=[...e.excludePatterns,{type:x,value:z}];t({excludePatterns:ue}),f(null)},[e.excludePatterns,t]),R=gt(x=>{let z=e.includePatterns.filter((ue,pe)=>pe!==x);t({includePatterns:z})},[e.includePatterns,t]),W=gt(x=>{let z=e.excludePatterns.filter((ue,pe)=>pe!==x);t({excludePatterns:z})},[e.excludePatterns,t]),X=gt((x,z)=>{v({type:x,value:z})},[]),V=gt(()=>{S&&(C(S.type,S.value),v(null))},[S,C]),j=gt(()=>{S&&(I(S.type,S.value),v(null))},[S,I]);return w(h,{style:y.container,children:w(Me,{nativeID:"__rn_buoy__filter-view",testID:"buoy-highlight-filter-scroll",style:y.scrollView,contentContainerStyle:y.scrollContent,showsVerticalScrollIndicator:false,children:i==="filters"?M(mi,{children:[M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:nc,color:D.color.accent,size:12}),w(te.Title,{children:"INCLUDE ONLY"}),e.includePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-include-count",count:e.includePatterns.length,color:D.color.accent})]}),w(p,{style:y.sectionDescription,children:"Show only components matching these patterns. If any are set, components must match at least one."}),e.includePatterns.length>0&&w(h,{style:y.patternChips,children:e.includePatterns.map((x,z)=>w(bi,{mode:"include",pattern:x,onRemove:()=>R(z)},`${x.type}-${x.value}-${z}`))}),w(h,{style:y.addPatternRow,children:s?w(fi,{mode:"include",onSelect:x=>{a(false),g(x)},onCancel:()=>a(false)}):d?w(yi,{mode:"include",type:d,onSubmit:x=>C(d,x),onCancel:()=>g(null)}):M(Y,{testID:"buoy-highlight-include-add",accessibilityRole:"button",accessibilityLabel:"Add include pattern",style:[y.addButton,{borderColor:D.color.accentBorderStrong}],onPress:()=>a(true),children:[w(oc,{size:14,color:D.color.accent}),w(p,{style:[y.addButtonText,{color:D.color.accent}],children:"Add include pattern"})]})})]}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:ci,color:D.color.accent,size:12}),w(te.Title,{children:"EXCLUDE"}),e.excludePatterns.length>0&&w(te.Badge,{testID:"buoy-highlight-exclude-count",count:e.excludePatterns.length,color:D.color.accent})]}),w(p,{style:y.sectionDescription,children:"Hide components matching these patterns from the list."}),e.excludePatterns.length>0&&w(h,{style:y.patternChips,children:e.excludePatterns.map((x,z)=>w(bi,{mode:"exclude",pattern:x,onRemove:()=>W(z)},`${x.type}-${x.value}-${z}`))}),w(h,{style:y.addPatternRow,children:c?w(fi,{mode:"exclude",onSelect:x=>{u(false),f(x)},onCancel:()=>u(false)}):T?w(yi,{mode:"exclude",type:T,onSubmit:x=>I(T,x),onCancel:()=>f(null)}):M(Y,{testID:"buoy-highlight-exclude-add",accessibilityRole:"button",accessibilityLabel:"Add exclude pattern",style:[y.addButton,{borderColor:D.color.accentBorderStrong}],onPress:()=>u(true),children:[w(oc,{size:14,color:D.color.accent}),w(p,{style:[y.addButtonText,{color:D.color.accent}],children:"Add exclude pattern"})]})})]}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:$g,color:D.color.warning,size:12}),w(te.Title,{children:"RENDER COUNT RANGE"}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&w(te.Badge,{count:1,color:D.color.warning})]}),w(p,{style:y.sectionDescription,children:"Show only components with render count in a specific range."}),M(h,{nativeID:"__rn_buoy__render-count-range",testID:"buoy-highlight-range",style:y.renderCountRangeContainer,children:[M(h,{style:y.renderCountInputRow,children:[M(h,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Min"}),w(Sn,{value:e.minRenderCount!==void 0?String(e.minRenderCount):"",onChangeText:x=>{let z=parseInt(x,10);x===""||x===void 0?t({minRenderCount:void 0}):!isNaN(z)&&z>=0&&t({minRenderCount:z})},testID:"buoy-highlight-range-min",placeholder:"0",placeholderTextColor:D.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]}),w(p,{style:y.renderCountSeparator,children:"to"}),M(h,{style:y.renderCountInputGroup,children:[w(p,{style:y.renderCountLabel,children:"Max"}),w(Sn,{value:e.maxRenderCount!==void 0?String(e.maxRenderCount):"",onChangeText:x=>{let z=parseInt(x,10);x===""||x===void 0?t({maxRenderCount:void 0}):!isNaN(z)&&z>=0&&t({maxRenderCount:z})},testID:"buoy-highlight-range-max",placeholder:"\u221E",placeholderTextColor:D.color.placeholder,style:y.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]})]}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&M(Y,{testID:"buoy-highlight-range-clear",accessibilityRole:"button",accessibilityLabel:"Clear range",style:y.clearRangeButton,onPress:()=>t({minRenderCount:void 0,maxRenderCount:void 0}),children:[w(io,{size:12,color:D.color.warning}),w(p,{style:y.clearRangeButtonText,children:"Clear Range"})]})]})]}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:rc,color:D.color.textSecondary,size:12}),w(te.Title,{children:"DETECTED ITEMS"})]}),w(p,{style:y.sectionDescription,children:"Tap an item to quickly add it as an exclude pattern."}),M(Me,{horizontal:true,showsHorizontalScrollIndicator:false,style:y.categoryBadgeScroll,contentContainerStyle:y.categoryBadgeScrollContent,children:[P>0&&w(mt,{filterType:"all",count:P,isSelected:b==="all",onPress:()=>m("all")}),r.viewTypes.length>0&&w(mt,{filterType:"viewType",count:r.viewTypes.length,isSelected:b==="viewType",onPress:()=>m("viewType")}),r.testIDs.length>0&&w(mt,{filterType:"testID",count:r.testIDs.length,isSelected:b==="testID",onPress:()=>m("testID")}),r.nativeIDs.length>0&&w(mt,{filterType:"nativeID",count:r.nativeIDs.length,isSelected:b==="nativeID",onPress:()=>m("nativeID")}),r.componentNames.length>0&&w(mt,{filterType:"component",count:r.componentNames.length,isSelected:b==="component",onPress:()=>m("component")}),r.accessibilityLabels.length>0&&w(mt,{filterType:"accessibilityLabel",count:r.accessibilityLabels.length,isSelected:b==="accessibilityLabel",onPress:()=>m("accessibilityLabel")})]}),w(h,{nativeID:"__rn_buoy__detected-items",testID:"buoy-highlight-detected",style:y.detectedItemsContainer,children:L.length>0?w(Me,{testID:"buoy-highlight-detected-scroll",style:y.detectedItemsScroll,contentContainerStyle:y.detectedItems,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:L.map(x=>{let z=cn(x.type);return w(Y,{testID:hi(x.type,x.value),accessibilityRole:"button",accessibilityLabel:`${z.label} ${x.value}`,style:[y.detectedItem,{borderColor:z.color+"40"}],onPress:()=>X(x.type,x.value),children:b==="all"?w(Et,{type:x.type,value:x.value,compact:true,shortLabel:true}):w(p,{style:y.detectedItemText,numberOfLines:1,children:x.value})},`${x.type}-${x.value}`)})}):w(p,{testID:"buoy-highlight-detected-empty",style:y.emptyText,children:"No items detected yet. Start tracking to see components here."})})]}),w(Ga,{visible:S!==null,transparent:true,animationType:"fade",onRequestClose:()=>v(null),children:w(Ua,{accessible:false,testID:"buoy-highlight-detected-popup-backdrop",style:y.modalOverlay,onPress:()=>v(null),children:w(h,{accessible:false,testID:"buoy-highlight-detected-popup",style:y.actionPopup,children:S&&M(mi,{children:[w(h,{style:y.actionPopupHeader,children:w(Et,{type:S.type,value:S.value,compact:true,shortLabel:true})}),M(h,{style:y.actionPopupButtons,children:[M(Y,{testID:"buoy-highlight-detected-popup-include",accessibilityRole:"button",accessibilityLabel:"Include only",style:[y.actionPopupButton,y.actionPopupInclude],onPress:V,children:[w(nc,{size:16,color:D.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:D.color.accent}],children:"Include Only"})]}),M(Y,{testID:"buoy-highlight-detected-popup-exclude",accessibilityRole:"button",accessibilityLabel:"Exclude",style:[y.actionPopupButton,y.actionPopupExclude],onPress:j,children:[w(ci,{size:16,color:D.color.accent}),w(p,{style:[y.actionPopupButtonText,{color:D.color.accent}],children:"Exclude"})]})]}),w(Y,{testID:"buoy-highlight-detected-popup-cancel",accessibilityRole:"button",accessibilityLabel:"Cancel",style:y.actionPopupCancel,onPress:()=>v(null),children:w(p,{style:y.actionPopupCancelText,children:"Cancel"})})]})})})}),M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:ci,color:D.color.textTertiary,size:12}),w(te.Title,{children:"HOW FILTERS WORK"})]}),w(h,{style:y.howItWorks,children:M(p,{style:y.howItWorksText,children:[w(p,{style:y.howItWorksBold,children:"Any:"})," Matches against all fields",`
33
33
  `,w(p,{style:y.howItWorksBold,children:"ViewType:"})," Native component class (RCTView, RCTText)",`
34
34
  `,w(p,{style:y.howItWorksBold,children:"testID:"})," Component testID prop",`
35
- `,w(p,{style:y.howItWorksBold,children:"Component:"})," React component name from fiber"]})})]})]}):w(di,{children:M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:Sg,color:I.color.textTertiary,size:12}),w(te.Title,{children:"SETTINGS"})]}),M(h,{style:y.settingsSection,children:[M(h,{style:y.settingItem,children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Show Render Count"}),w(Rt,{testID:pt("showRenderCount"),value:n.showRenderCount,onValueChange:x=>{r({showRenderCount:x}),!x&&n.trackRenderCauses&&r({trackRenderCauses:false})},trackColor:{false:I.color.surfaceElevated,true:I.color.accent+"80"},thumbColor:n.showRenderCount?I.color.accent:I.color.knob})]}),w(p,{style:y.settingDescription,children:"Display render count badge on highlights. Disabling improves performance by skipping count tracking."})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:[y.settingLabel,!n.showRenderCount&&y.settingLabelDisabled],children:"Track Render Causes"}),w(Rt,{testID:pt("trackRenderCauses"),value:n.trackRenderCauses,onValueChange:x=>r({trackRenderCauses:x}),trackColor:{false:I.color.surfaceElevated,true:I.color.warning+"80"},thumbColor:n.trackRenderCauses?I.color.warning:I.color.knob,disabled:!n.showRenderCount})]}),M(p,{style:y.settingDescription,children:["Detect WHY components render (props, hooks, parent re-render).",!n.showRenderCount&&M(p,{style:y.settingWarning,children:[`
36
- `,'Requires "Show Render Count" to be enabled.']})]})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:[y.settingLabel,!n.trackRenderCauses&&y.settingLabelDisabled],children:"Enable Render History"}),w(Rt,{testID:pt("enableRenderHistory"),value:n.enableRenderHistory,onValueChange:x=>r({enableRenderHistory:x}),trackColor:{false:I.color.surfaceElevated,true:I.color.accent+"80"},thumbColor:n.enableRenderHistory?I.color.accent:I.color.knob,disabled:!n.trackRenderCauses})]}),M(p,{style:y.settingDescription,children:["Store render events for each component to view in the History tab.",!n.trackRenderCauses&&M(p,{style:y.settingWarning,children:[`
37
- `,'Requires "Track Render Causes" to be enabled.']})]})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Debug Log Level"}),w(h,{style:y.settingValue,children:w(p,{testID:"buoy-highlight-setting-debugLogLevel-value",style:[y.settingValueText,n.debugLogLevel!=="off"&&{color:I.color.warning}],children:mi.find(x=>x.value===n.debugLogLevel)?.label||"Off"})})]}),w(p,{style:y.settingDescription,children:"Control console logging verbosity for render cause detection."}),w(h,{style:y.batchSizePresets,children:mi.map(x=>w(Y,{style:[y.batchSizePreset,n.debugLogLevel===x.value&&y.batchSizePresetActive,x.value!=="off"&&n.debugLogLevel===x.value&&{backgroundColor:I.color.warningSoft,borderColor:I.color.warning}],onPress:()=>r({debugLogLevel:x.value}),testID:`buoy-highlight-preset-log-${x.value}`,accessibilityRole:"button",accessibilityLabel:`Debug log level ${x.label}`,children:w(p,{style:[y.batchSizePresetText,n.debugLogLevel===x.value&&y.batchSizePresetTextActive,x.value!=="off"&&n.debugLogLevel===x.value&&{color:I.color.warning}],children:x.label})},x.value))}),M(p,{style:y.settingDescriptionMuted,children:[mi.find(x=>x.value===n.debugLogLevel)?.description,n.debugLogLevel!=="off"&&" \u2022 Check Metro console for logs"]})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Batch Size"}),w(h,{style:y.settingValue,children:w(p,{testID:"buoy-highlight-setting-batchSize-value",style:y.settingValueText,children:n.batchSize})})]}),w(p,{style:y.settingDescription,children:"Maximum components to highlight per render update. Higher values capture more re-renders but may impact performance on complex screens."}),w(h,{style:y.batchSizePresets,children:Lg.map(x=>w(Y,{style:[y.batchSizePreset,n.batchSize===x.value&&y.batchSizePresetActive],onPress:()=>r({batchSize:x.value}),testID:`buoy-highlight-preset-batch-${x.value}`,accessibilityRole:"button",accessibilityLabel:`Batch size ${x.label}`,children:w(p,{style:[y.batchSizePresetText,n.batchSize===x.value&&y.batchSizePresetTextActive],children:x.label})},x.value))})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Show host views"}),w(Rt,{testID:pt("showHostViews"),value:!!n.showHostViews,onValueChange:x=>r({showHostViews:x}),trackColor:{false:I.color.surfaceElevated,true:I.color.accent+"80"},thumbColor:n.showHostViews?I.color.accent:I.color.knob})]}),w(p,{style:y.settingDescription,children:"Include anonymous View / RCTView / Text hosts. Off by default so the list is named composites (what actually re-rendered)."})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Highlight Dev Tools"}),w(Rt,{testID:pt("excludeDevTools"),value:!n.excludeDevTools,onValueChange:x=>r({excludeDevTools:!x}),trackColor:{false:I.color.surfaceElevated,true:I.color.accent+"80"},thumbColor:n.excludeDevTools?I.color.knob:I.color.accent})]}),M(p,{style:y.settingDescription,children:["Show re-render highlights on Buoy dev tools (floating menu, modals, etc.). Useful for optimizing the dev tools themselves.",!n.excludeDevTools&&M(p,{style:y.settingWarning,children:[`
38
- `,"The highlight overlay is always excluded to prevent infinite loops."]})]})]})]})]})})})})}l(fi,"HighlightFilterView");var y=ve.create({container:{flex:1,backgroundColor:"transparent"},scrollView:{flex:1},scrollContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:32},section:{backgroundColor:I.color.surface,borderRadius:8,borderWidth:1,borderColor:I.color.border,marginBottom:12,overflow:"hidden"},sectionDescription:{fontSize:11,color:I.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:16},patternChips:{flexDirection:"row",flexWrap:"wrap",gap:8,paddingHorizontal:16,paddingTop:12},patternChip:{flexDirection:"row",alignItems:"center",backgroundColor:I.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:4,paddingLeft:4,paddingRight:6,maxWidth:"100%",gap:4},patternChipBadge:{paddingVertical:2,paddingHorizontal:5,borderRadius:4},patternChipBadgeText:{fontSize:9,fontWeight:"700"},patternChipValue:{fontSize:11,color:I.color.text,fontFamily:Ht,flexShrink:1},patternChipX:{marginLeft:2},addPatternRow:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},addButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderStyle:"dashed",gap:6},addButtonText:{fontSize:12,fontWeight:"500"},typePicker:{flexDirection:"row",alignItems:"center",gap:8},typePickerRow:{flex:1,flexDirection:"row",flexWrap:"wrap",gap:8},typeOption:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,borderWidth:1,backgroundColor:I.color.surfaceElevated,gap:6},typeOptionText:{fontSize:11,fontWeight:"600"},typePickerCancel:{padding:8},patternInputContainer:{flexDirection:"row",alignItems:"center",backgroundColor:I.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:I.color.border,paddingLeft:4,paddingRight:8,paddingVertical:4,gap:4},patternInput:{flex:1,fontSize:12,color:I.color.text,paddingVertical:6,paddingHorizontal:4},addPatternButton:{paddingVertical:6,paddingHorizontal:10,borderRadius:4},addPatternButtonText:{fontSize:11,fontWeight:"600"},cancelButton:{padding:4},categoryBadgeScroll:{marginTop:12},categoryBadgeScrollContent:{paddingHorizontal:16,gap:8},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,borderWidth:1,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCountBubble:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCount:{fontSize:10,fontWeight:"600"},detectedItemsContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},detectedItemsScroll:{maxHeight:200},detectedItems:{flexDirection:"row",flexWrap:"wrap",gap:8},detectedItem:{flexDirection:"row",alignItems:"center",backgroundColor:I.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:6,paddingHorizontal:10,gap:6},detectedItemText:{fontSize:11,color:I.color.text,fontFamily:Ht},emptyText:{fontSize:11,color:I.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:16,paddingHorizontal:16},howItWorks:{paddingHorizontal:16,paddingVertical:12},howItWorksText:{fontSize:11,color:I.color.textTertiary,lineHeight:18,fontFamily:Ht},howItWorksBold:{fontWeight:"700",color:I.color.textSecondary},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:32},actionPopup:{backgroundColor:I.color.surface,borderRadius:12,borderWidth:1,borderColor:I.color.border,width:"100%",maxWidth:300,overflow:"hidden"},actionPopupHeader:{padding:16,borderBottomWidth:1,borderBottomColor:I.color.separator,alignItems:"center"},actionPopupButtons:{flexDirection:"row",padding:12,gap:8},actionPopupButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:12,borderRadius:8,gap:8},actionPopupInclude:{backgroundColor:I.color.accentSoft},actionPopupExclude:{backgroundColor:I.color.accentSoft},actionPopupButtonText:{fontSize:13,fontWeight:"600"},actionPopupCancel:{padding:12,borderTopWidth:1,borderTopColor:I.color.separator,alignItems:"center"},actionPopupCancelText:{fontSize:13,color:I.color.textTertiary,fontWeight:"500"},settingsSection:{paddingHorizontal:16,paddingTop:8,paddingBottom:16},settingItem:{gap:8},settingItemSpaced:{marginTop:16,paddingTop:16,borderTopWidth:1,borderTopColor:I.color.separator},settingHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},settingLabel:{fontSize:13,fontWeight:"600",color:I.color.text},settingValue:{backgroundColor:I.color.fillSecondary,paddingHorizontal:10,paddingVertical:4,borderRadius:6},settingValueText:{fontSize:12,fontWeight:"700",color:I.color.textTertiary,fontFamily:Ht},settingDescription:{fontSize:11,color:I.color.textSecondary,lineHeight:16},settingDescriptionMuted:{fontSize:10,color:I.color.textTertiary,lineHeight:14,marginTop:4,fontStyle:"italic"},settingLabelDisabled:{color:I.color.textTertiary},settingWarning:{color:I.color.warning,fontWeight:"500"},batchSizePresets:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:4},batchSizePreset:{paddingVertical:8,paddingHorizontal:14,borderRadius:6,backgroundColor:I.color.surfaceElevated,borderWidth:1,borderColor:I.color.border},batchSizePresetActive:{backgroundColor:I.color.fillSecondary,borderColor:I.color.fillTertiary},batchSizePresetText:{fontSize:12,fontWeight:"500",color:I.color.textSecondary,fontFamily:Ht},batchSizePresetTextActive:{color:I.color.textTertiary,fontWeight:"700"},renderCountRangeContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,gap:12},renderCountInputRow:{flexDirection:"row",alignItems:"center",gap:12},renderCountInputGroup:{flex:1,gap:4},renderCountLabel:{fontSize:10,fontWeight:"600",color:I.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},renderCountInput:{backgroundColor:I.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:I.color.border,paddingVertical:10,paddingHorizontal:12,fontSize:14,fontWeight:"600",color:I.color.text,fontFamily:Ht,textAlign:"center"},renderCountSeparator:{fontSize:12,color:I.color.textTertiary,marginTop:18},clearRangeButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,backgroundColor:I.color.warningSoft,borderWidth:1,borderColor:I.color.warning+"40",gap:6,alignSelf:"center"},clearRangeButtonText:{fontSize:11,fontWeight:"600",color:I.color.warning}});U();import{useState as Bg,useEffect as qs,useRef as Vg,useCallback as yi,memo as Hg,useMemo as Js}from"react";Ve();U();import Ag,{useMemo as Ys}from"react";import{ChevronRight as Eg,night as ft,useRelativeTime as Fg,monoFont as Xs}from"@buoy-gg/shared-ui/web";import{jsx as Ne,jsxs as Ft}from"react/jsx-runtime";function Qs({render:e,onPress:t}){let n=Ys(()=>e.testID?{type:"testID",value:e.testID}:e.nativeID?{type:"nativeID",value:e.nativeID}:e.componentName?{type:"component",value:e.componentName}:e.accessibilityLabel?{type:"accessibilityLabel",value:e.accessibilityLabel}:{type:"nativeTag",value:String(e.nativeTag)},[e.testID,e.nativeID,e.componentName,e.accessibilityLabel,e.nativeTag]),r=Ys(()=>e.accessibilityLabel&&n.type!=="accessibilityLabel"?{type:"accessibilityLabel",value:e.accessibilityLabel}:null,[e.accessibilityLabel,n.type]),o=Fg(e.lastRenderTime),i=si(n.value);return Ft(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${e.displayName}, ${n.type} ${n.value}, ${e.renderCount} renders`,style:xe.container,onPress:()=>t(e),activeOpacity:.7,children:[Ne(h,{style:[xe.colorIndicator,{backgroundColor:e.color}]}),Ft(h,{style:xe.content,children:[Ft(h,{style:xe.topRow,children:[Ft(h,{style:xe.viewTypeContainer,children:[Ne(p,{testID:`${i}-name`,style:xe.viewType,numberOfLines:1,children:e.displayName}),r?Ne(Et,{type:r.type,value:r.value,compact:true,shortLabel:true}):e.displayName!==e.viewType?Ne(p,{testID:`${i}-type`,style:xe.nativeType,numberOfLines:1,children:e.viewType}):null]}),Ne(h,{style:[xe.renderCountBadge,{backgroundColor:e.color+"30"}],children:Ft(p,{testID:`${i}-count`,style:[xe.renderCount,{color:e.color}],children:[e.renderCount,"x"]})})]}),e.lastRenderCause&&Ne(h,{style:xe.causeRow,children:Ne(qo,{testID:`${i}-cause`,cause:e.lastRenderCause,compact:true,showKeys:true,showTwoLevel:true})}),Ft(h,{style:xe.bottomRow,children:[Ne(h,{style:xe.identifierContainer,children:Ne(Et,{testID:`${i}-identifier`,type:n.type,value:n.value,compact:true,shortLabel:true})}),Ne(p,{testID:`${i}-time`,style:xe.timing,children:o})]})]}),Ne(Eg,{size:16,color:ft.color.textTertiary})]})}l(Qs,"RenderListItemInner");var Zs=Ag.memo(Qs,(e,t)=>{let n=e.render,r=t.render;return n.id===r.id&&n.renderCount===r.renderCount&&n.color===r.color&&n.lastRenderTime===r.lastRenderTime&&n.lastRenderCause?.type===r.lastRenderCause?.type&&n.lastRenderCause?.componentCause===r.lastRenderCause?.componentCause&&e.onPress===t.onPress}),xe=ve.create({container:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,marginHorizontal:12,marginBottom:6,backgroundColor:ft.color.surface,borderRadius:8,borderWidth:1,borderColor:ft.color.border},colorIndicator:{width:4,height:36,borderRadius:2,marginRight:10},content:{flex:1,marginRight:8},topRow:{flexDirection:"row",alignItems:"center",marginBottom:4},causeRow:{marginBottom:4},viewTypeContainer:{flex:1,marginRight:8},viewType:{fontSize:13,fontWeight:"600",color:ft.color.text},nativeType:{fontSize:10,color:ft.color.textTertiary,fontFamily:Xs,marginTop:1},accessibilityLabel:{fontSize:10,color:ft.color.accent,fontStyle:"italic",marginTop:1},renderCountBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:10},renderCount:{fontSize:11,fontWeight:"700",fontFamily:Xs},bottomRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},identifierContainer:{flex:1,flexShrink:1,overflow:"hidden"},timing:{fontSize:10,color:ft.color.textTertiary,fontWeight:"500",flexShrink:0}});import{Lock as Mg,night as bi,useLimit as $g,ToolEmptyState as Og,resolveListEmptyState as _g}from"@buoy-gg/shared-ui/web";import{jsx as cn,jsxs as ec}from"react/jsx-runtime";function tc({searchText:e,filters:t,onSelectRender:n,onStatsChange:r,onRendersChange:o,isTracking:i,isPro:s=false}){let[a,u]=Bg(()=>B.getFilteredRenders(e)),c=Vg(null);qs(()=>B.subscribe(()=>{let C=B.getFilteredRenders(e);u(C),r(B.getStats()),o?.(C)}),[e,r,o]),qs(()=>{let C=B.getFilteredRenders(e);u(C),o?.(C)},[e,t,o]);let d=$g("highlightUpdates.components"),g=s?1/0:d,T=Js(()=>a.slice(0,g),[a,g]),b=Js(()=>Math.max(0,a.length-g),[a.length,g]),v=yi(C=>C.id,[]),f=yi(({item:C,index:N})=>cn(Zs,{render:C,onPress:()=>n(C,N,T)}),[n,T]),S=yi(()=>b<=0?null:ec(h,{testID:"buoy-highlight-locked",style:ir.lockedBanner,children:[cn(Mg,{size:14,color:bi.color.warning}),ec(p,{testID:"buoy-highlight-locked-text",style:ir.lockedBannerText,children:[b," more ",b===1?"component":"components"," locked"]}),cn(p,{style:ir.lockedBannerSubtext,children:"Upgrade to Pro"})]}),[b]);if(a.length===0){let C=e.trim(),N=B.getStats().totalComponents,m=C?B.getFilteredRenders("").length:0,k=_g({subject:"components",verb:"tracked",search:e,total:C?m:N,capturing:i,blocked:C&&m===0&&N>0?"The active filters hide everything tracked, so there is nothing to search.":void 0,waiting:{otto:"stare",title:"No renders tracked",message:"Component renders will appear here"},paused:{title:"No renders tracked",message:"Enable tracking to start capturing"}});return cn(Og,{...k,testID:"buoy-highlight-empty"})}return cn(Aa,{testID:"buoy-highlight-list",ref:c,data:T,renderItem:f,keyExtractor:v,contentContainerStyle:ir.listContent,showsVerticalScrollIndicator:true,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,ListFooterComponent:S})}l(tc,"IsolatedRenderListInner");var Wg=Hg(tc),ir=ve.create({listContent:{paddingTop:8},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:16,marginTop:8,gap:8},lockedBannerText:{color:bi.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:bi.color.textTertiary,fontSize:12}});U();import{memo as Mt}from"react";import{Trash2 as Ug,Search as jg,Filter as Gg,Pause as Kg,Copy as qg,ModalHeader as ge,TabSelector as nc,night as he,PowerToggleButton as Jg}from"@buoy-gg/shared-ui/web";U();import{useState as Yg,useEffect as Xg,memo as Qg}from"react";Ve();import{Activity as Zg,night as ar,monoFont as eh}from"@buoy-gg/shared-ui/web";import{jsx as rc,jsxs as th}from"react/jsx-runtime";function oc(){let[e,t]=Yg({totalComponents:0,totalRenders:0});return Xg(()=>B.subscribe(()=>{t(B.getStats())}),[]),th(h,{nativeID:"__rn_buoy__stats-row",testID:"buoy-highlight-stats",accessibilityLabel:`${e.totalComponents} components tracked`,style:ic.headerChip,children:[rc(Zg,{size:12,color:ar.color.accent}),rc(p,{testID:"buoy-highlight-stats-value",style:[ic.headerChipValue,{color:ar.color.accent}],children:e.totalComponents})]})}l(oc,"StatsDisplayInner");var nh=Qg(oc),ic=ve.create({headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:ar.color.buttonSurface,paddingHorizontal:8,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:ar.color.border},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:eh}});import{jsx as X,jsxs as un}from"react/jsx-runtime";var rh=Mt(l(function({isActive:e,searchText:t,onSearchChange:n,onSearchClose:r}){return e?X(ge.Search,{value:t,onChangeText:n,onCancel:()=>{n(""),r()},onDismiss:r,dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search testID, nativeID, component...",accessibilityLabel:"Search renders",iconSize:14,testID:"buoy-highlight-search-field",containerTestID:"buoy-highlight-search-container",containerNativeID:"__rn_buoy__search-container",clearTestID:"buoy-highlight-search-clear"}):null},"SearchSection")),oh=rh,ih=Mt(l(function({onSearchToggle:e,onFilterToggle:t,onToggleTracking:n,onToggleFreeze:r,onClear:o,onOpenCopySettings:i,isTracking:s,isFrozen:a,activeFilterCount:u,hasRenders:c}){return un(ge.Actions,{children:[X(Y,{testID:"buoy-highlight-search",accessibilityRole:"button",accessibilityLabel:"Search renders",onPress:e,style:Be.headerActionButton,children:X(jg,{size:14,color:he.color.textSecondary})}),X(Y,{testID:"buoy-highlight-filters",accessibilityRole:"button",accessibilityLabel:u>0?`Filters, ${u} active`:"Filters",onPress:t,style:[Be.headerActionButton,u>0&&Be.activeFilterButton],children:X(Gg,{size:14,color:u>0?he.color.accent:he.color.textTertiary})}),X(Y,{testID:"buoy-highlight-copy",accessibilityRole:"button",onPress:i,style:[Be.headerActionButton,!c&&Be.headerActionButtonDisabled],disabled:!c,accessibilityLabel:"Open copy settings",children:X(qg,{size:14,color:c?he.color.textSecondary:he.color.textTertiary})}),X(Y,{testID:"buoy-highlight-freeze",accessibilityRole:"button",accessibilityLabel:a?"Unfreeze frame":"Freeze frame",onPress:r,style:[Be.headerActionButton,a&&Be.freezeButton,!s&&Be.headerActionButtonDisabled],disabled:!s,children:X(Kg,{size:14,color:s?a?he.color.accent:he.color.textTertiary:he.color.textTertiary})}),X(Jg,{testID:"buoy-highlight-power",isEnabled:s,onToggle:n,accessibilityLabel:"Toggle render tracking"}),X(Y,{testID:"buoy-highlight-clear",accessibilityRole:"button",accessibilityLabel:"Clear tracked renders",onPress:o,style:[Be.headerActionButton,!c&&Be.headerActionButtonDisabled],disabled:!c,children:X(Ug,{size:14,color:c?he.color.textTertiary:he.color.textTertiary})})]})},"HeaderActions")),ah=ih,lh=Mt(l(function({onBack:e,isSearchActive:t,searchText:n,onSearchChange:r,onSearchToggle:o,onSearchClose:i,onFilterToggle:s,onToggleTracking:a,onToggleFreeze:u,onClear:c,onOpenCopySettings:d,isTracking:g,isFrozen:T,activeFilterCount:b,hasRenders:v,searchInputRef:f}){return un(ge,{children:[e&&X(ge.Navigation,{onBack:e}),X(ge.Content,{title:"",children:t?X(oh,{isActive:t,searchText:n,onSearchChange:r,onSearchClose:i,searchInputRef:f}):X(nh,{})}),X(ah,{onSearchToggle:o,onFilterToggle:s,onToggleTracking:a,onToggleFreeze:u,onClear:c,onOpenCopySettings:d,isTracking:g,isFrozen:T,activeFilterCount:b,hasRenders:v})]})},"MainListHeader")),sh=Mt(l(function({onBack:e,activeTab:t,onTabChange:n,activeFilterCount:r=0}){let o=[{key:"filters",label:`Filters${r>0?` (${r})`:""}`},{key:"settings",label:"Settings"}];return un(ge,{children:[X(ge.Navigation,{onBack:e}),X(ge.Content,{title:"",noMargin:true,children:X(nc,{tabs:o,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-filter-tab"})}),X(ge.Actions,{})]})},"FilterViewHeader")),ch=Mt(l(function({onBack:e,activeTab:t,onTabChange:n,hasHistory:r=true}){let o=[{key:"details",label:"Details"},{key:"history",label:"History",disabled:!r}];return un(ge,{children:[X(ge.Navigation,{onBack:e}),X(ge.Content,{title:"",noMargin:true,children:X(nc,{tabs:o,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-detail-tab"})}),X(ge.Actions,{})]})},"DetailViewHeader")),uh=Mt(l(function({onBack:e}){return un(ge,{children:[X(ge.Navigation,{onBack:e}),X(ge.Content,{title:"Copy Settings",testID:"buoy-highlight-copy-title"})]})},"CopySettingsViewHeader")),Be=ve.create({headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:he.color.buttonSurface,borderWidth:1,borderColor:he.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},activeFilterButton:{backgroundColor:he.color.accentSoft,borderColor:he.color.accentBorderStrong},freezeButton:{backgroundColor:he.color.accentSoft,borderColor:he.color.accentBorderStrong}});U();import{useState as vi,useCallback as lr,useMemo as dn}from"react";Ve();import{Clock as dh,GitBranch as gh,Database as ac,Lock as hh,formatRelativeTime as lc,SectionHeader as $t,EventStepperFooter as sc,buoyColors as cc,night as A,useLimit as uc,ToolEmptyState as ph,monoFont as Ke}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as dc}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as mh,jsx as F,jsxs as q}from"react/jsx-runtime";function sr(e){let t=new Date(e),n=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0"),i=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${r}:${o}.${i}`}l(sr,"formatTimeWithMs");function Ci({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:r,isPro:o=false}){let[i,s]=vi(0),a=n??i,u=r??s,[c,d]=vi("current"),g=dn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((P,D)=>P.timestamp-D.timestamp),[e.renderHistory]),T=uc("highlightUpdates.historyEvents"),b=o?1/0:T,v=dn(()=>g.slice(-b),[g,b]),f=dn(()=>Math.max(0,g.length-b),[g.length,b]),S=v.length,C=v[a],N=a>0?v[a-1]:null,m=lr(()=>{a>0&&u(a-1)},[a,u]),k=lr(()=>{a<S-1&&u(a+1)},[a,S,u]);if(S===0){let P=B.getSettings().enableRenderHistory;return F(ph,{testID:"buoy-highlight-history-empty",otto:P?"stare":"paused",title:"No Render History",message:P?"History is on and armed \u2014 this component has not re-rendered since. Interact with the app to record one.":"Enable render history tracking in settings to see render events here."})}return q(mh,{children:[q(h,{style:[R.container,{paddingBottom:!t&&S>1?80:0}],children:[f>0&&q(h,{testID:"buoy-highlight-history-locked",style:R.lockedBanner,children:[F(hh,{size:14,color:A.color.warning}),q(p,{testID:"buoy-highlight-history-locked-text",style:R.lockedBannerText,children:[f," older ",f===1?"render":"renders"," locked"]}),F(p,{style:R.lockedBannerSubtext,children:"Upgrade to Pro"})]}),q(h,{style:R.viewToggleContainer,children:[q(Y,{testID:"buoy-highlight-history-mode-current",accessibilityRole:"button",accessibilityLabel:"Current state",style:[R.viewToggleCard,c==="current"&&R.viewToggleCardActive],onPress:()=>d("current"),activeOpacity:.8,children:[q(h,{style:R.viewToggleContent,children:[F(ac,{size:16,color:c==="current"?A.color.accent:A.color.textSecondary}),F(p,{style:[R.viewToggleLabel,c==="current"&&R.viewToggleLabelActive],children:"CURRENT STATE"})]}),q(p,{style:[R.viewToggleDescription,c==="current"&&{color:A.color.text}],children:["View render #",C?.renderNumber??0," details"]})]}),q(h,{testID:"buoy-highlight-history-mode-diff",accessibilityLabel:"Diff view, coming soon",style:[R.viewToggleCard,R.viewToggleCardDisabled],children:[q(h,{style:R.viewToggleContent,children:[F(gh,{size:16,color:A.color.textTertiary}),F(p,{style:[R.viewToggleLabel,R.viewToggleLabelDisabled],children:"DIFF VIEW"}),F(h,{style:R.todoBadge,children:F(p,{style:R.todoBadgeText,children:"TODO"})})]}),F(p,{style:[R.viewToggleDescription,{color:A.color.textTertiary}],children:"Compare renders side by side (coming soon)"})]})]}),F(Me,{testID:"buoy-highlight-history-scroll",style:R.contentScroll,contentContainerStyle:R.contentContainer,showsVerticalScrollIndicator:false,children:c==="current"?F(gc,{event:C,render:e}):F(hc,{previousEvent:N,currentEvent:C,render:e})})]}),!t&&F(sc,{currentIndex:a,totalItems:S,onPrevious:m,onNext:k,itemLabel:"Render",subtitle:lc(new Date(C?.timestamp??Date.now()))})]})}l(Ci,"RenderHistoryViewer");function gc({event:e,render:t}){if(!e)return F(h,{testID:"buoy-highlight-history-no-event",style:R.noEventContainer,children:F(p,{style:R.noEventText,children:"No event selected"})});let n=Ge[e.cause.type];return q(h,{style:R.currentStateContainer,children:[q(h,{style:R.eventHeader,children:[q(h,{style:R.eventHeaderLeft,children:[q(p,{testID:"buoy-highlight-history-event-title",style:R.eventTitle,children:["Render #",e.renderNumber]}),F(p,{testID:"buoy-highlight-history-event-time",style:R.eventTime,children:sr(e.timestamp)})]}),q(h,{style:[R.eventBadge,{backgroundColor:t.color+"30"}],children:[F(h,{style:[R.eventBadgeDot,{backgroundColor:t.color}]}),F(p,{testID:"buoy-highlight-history-event-cause",style:[R.eventBadgeText,{color:t.color}],children:e.cause.type.toUpperCase()})]})]}),q(h,{style:R.section,children:[q($t,{children:[F($t.Icon,{icon:dh,color:n.color,size:12}),F($t.Title,{children:"WHY DID THIS RENDER?"})]}),F(h,{style:R.sectionContent,children:F(Jo,{cause:e.cause,nativeType:t.viewType})})]}),e.capturedProps&&Object.keys(e.capturedProps).length>0&&q(h,{style:R.section,children:[q($t,{children:[F($t.Icon,{icon:ac,color:A.color.accent,size:12}),F($t.Title,{children:"CAPTURED PROPS"})]}),F(h,{style:R.sectionContent,children:F(Me,{horizontal:true,showsHorizontalScrollIndicator:false,style:R.propsScrollView,children:F(p,{testID:"buoy-highlight-history-props",style:R.propsJson,children:JSON.stringify(e.capturedProps,null,2)})})})]})]})}l(gc,"CurrentStateView");function hc({previousEvent:e,currentEvent:t,render:n}){let[r,o]=vi("props");if(!e||!t)return F(h,{style:R.noEventContainer,children:F(p,{style:R.noEventText,children:"Select an event with a previous event to compare"})});let i=Ge[e.cause.type],s=Ge[t.cause.type],a=e.capturedProps&&t.capturedProps,u=e.capturedState&&t.capturedState;return q(h,{style:R.diffContainer,children:[q(h,{style:R.compareBar,children:[q(h,{style:R.compareSide,children:[q(h,{style:R.compareLabelRow,children:[F(p,{style:[R.compareLabel,{color:cc.warning}],children:"PREV"}),F(h,{style:[R.compareActionBadge,{backgroundColor:`${i.color}20`}],children:F(p,{style:[R.compareActionText,{color:i.color}],children:e.cause.type.toUpperCase()})})]}),q(h,{style:R.compareMeta,children:[q(p,{style:R.compareIndex,children:["#",e.renderNumber]}),F(p,{style:R.compareTime,children:sr(e.timestamp)})]})]}),F(h,{style:R.compareDivider,children:F(p,{style:R.compareArrow,children:"\u2192"})}),q(h,{style:R.compareSide,children:[q(h,{style:R.compareLabelRow,children:[F(p,{style:[R.compareLabel,{color:cc.success}],children:"CUR"}),F(h,{style:[R.compareActionBadge,{backgroundColor:`${s.color}20`}],children:F(p,{style:[R.compareActionText,{color:s.color}],children:t.cause.type.toUpperCase()})})]}),q(h,{style:R.compareMeta,children:[q(p,{style:R.compareIndex,children:["#",t.renderNumber]}),F(p,{style:R.compareTime,children:sr(t.timestamp)})]})]})]}),q(h,{style:R.diffModeTabs,children:[F(Y,{style:[R.diffModeTab,r==="cause"&&R.diffModeTabActive],onPress:()=>o("cause"),activeOpacity:.7,children:F(p,{style:[R.diffModeTabText,r==="cause"&&R.diffModeTabTextActive],children:"CAUSE"})}),F(Y,{style:[R.diffModeTab,r==="props"&&R.diffModeTabActive,!a&&R.diffModeTabDisabled],onPress:()=>a&&o("props"),activeOpacity:a?.7:1,children:F(p,{style:[R.diffModeTabText,r==="props"&&R.diffModeTabTextActive,!a&&R.diffModeTabTextDisabled],children:"PROPS"})}),F(Y,{style:[R.diffModeTab,r==="state"&&R.diffModeTabActive,!u&&R.diffModeTabDisabled],onPress:()=>u&&o("state"),activeOpacity:u?.7:1,children:F(p,{style:[R.diffModeTabText,r==="state"&&R.diffModeTabTextActive,!u&&R.diffModeTabTextDisabled],children:"STATE"})})]}),r==="cause"&&F(h,{style:R.diffSummary,children:F(Jo,{cause:t.cause,nativeType:n.viewType})}),r==="props"&&F(h,{style:R.treeDiffContainer,children:a?F(dc,{oldValue:e.capturedProps,newValue:t.capturedProps,theme:"dark",showUnchanged:true}):q(h,{style:R.noDiffData,children:[F(p,{style:R.noDiffDataTitle,children:"Props Not Captured"}),F(p,{style:R.noDiffDataText,children:'Enable "Capture Props on Render" in settings to see props diff.'})]})}),r==="state"&&F(h,{style:R.treeDiffContainer,children:u?F(dc,{oldValue:e.capturedState,newValue:t.capturedState,theme:"dark",showUnchanged:true}):q(h,{style:R.noDiffData,children:[F(p,{style:R.noDiffDataTitle,children:"State Not Captured"}),F(p,{style:R.noDiffDataText,children:'Enable "Capture State on Render" in settings to see state diff.'})]})})]})}l(hc,"DiffView");function Ti({render:e,selectedEventIndex:t=0,onEventIndexChange:n=l(()=>{},"onEventIndexChange"),isPro:r=false}){let o=dn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((T,b)=>T.timestamp-b.timestamp),[e.renderHistory]),i=uc("highlightUpdates.historyEvents"),s=r?1/0:i,a=dn(()=>o.slice(-s),[o,s]),u=a.length,c=a[t],d=lr(()=>{n(Math.max(0,t-1))},[t,n]),g=lr(()=>{n(Math.min(u-1,t+1))},[t,u,n]);return u<=1?null:F(sc,{currentIndex:t,totalItems:u,onPrevious:d,onNext:g,itemLabel:"Render",subtitle:c?lc(new Date(c.timestamp)):void 0})}l(Ti,"RenderHistoryFooter");var R=ve.create({container:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:32,gap:12},emptyTitle:{fontSize:16,fontWeight:"600",color:A.color.text},emptyText:{fontSize:13,color:A.color.textSecondary,textAlign:"center",lineHeight:18},viewToggleContainer:{flexDirection:"row",padding:12,gap:8},viewToggleCard:{flex:1,backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:10,gap:4},viewToggleCardActive:{borderColor:A.color.accentBorderStrong,backgroundColor:A.color.accentSoft},viewToggleCardDisabled:{opacity:.5},todoBadge:{backgroundColor:A.color.fillSecondary,paddingHorizontal:6,paddingVertical:2,borderRadius:4,marginLeft:4},todoBadgeText:{fontSize:9,fontWeight:"700",color:A.color.textTertiary,letterSpacing:.3},viewToggleContent:{flexDirection:"row",alignItems:"center",gap:6},viewToggleLabel:{fontSize:10,fontWeight:"700",color:A.color.textSecondary,letterSpacing:.5},viewToggleLabelActive:{color:A.color.accent},viewToggleLabelDisabled:{color:A.color.textTertiary},viewToggleDescription:{fontSize:11,color:A.color.textTertiary,marginTop:2},contentScroll:{flex:1},contentContainer:{padding:12,paddingTop:0},noEventContainer:{padding:24,alignItems:"center"},noEventText:{fontSize:13,color:A.color.textTertiary},currentStateContainer:{gap:12},eventHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:12},eventHeaderLeft:{gap:2},eventTitle:{fontSize:15,fontWeight:"700",color:A.color.text},eventTime:{fontSize:11,color:A.color.textTertiary,fontFamily:Ke},eventBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4,borderRadius:12,gap:6},eventBadgeDot:{width:6,height:6,borderRadius:3},eventBadgeText:{fontSize:10,fontWeight:"700",fontFamily:Ke},section:{backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,overflow:"hidden"},sectionContent:{padding:12,paddingTop:8},causeContainer:{marginBottom:12},changedList:{marginBottom:12,paddingLeft:4},changedListTitle:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,marginBottom:6},changedItem:{fontSize:12,color:A.color.text,fontFamily:Ke,marginBottom:3,paddingLeft:8},propsScrollView:{maxHeight:150},propsJson:{fontSize:11,fontFamily:Ke,color:A.color.text,backgroundColor:A.color.bg,padding:10,borderRadius:6},diffContainer:{gap:12},compareBar:{flexDirection:"row",backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:10},compareSide:{flex:1,gap:4},compareLabelRow:{flexDirection:"row",alignItems:"center",gap:8},compareLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5},compareActionBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},compareActionText:{fontSize:9,fontWeight:"600"},compareMeta:{flexDirection:"row",alignItems:"center",gap:6},compareIndex:{fontSize:12,fontWeight:"600",color:A.color.text},compareTime:{fontSize:10,color:A.color.textTertiary,fontFamily:Ke},compareDivider:{width:30,alignItems:"center",justifyContent:"center"},compareArrow:{fontSize:16,color:A.color.textTertiary},diffSummary:{backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:12},diffSummaryTitle:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,marginBottom:8},diffChanges:{gap:4},diffChangeItem:{flexDirection:"row",alignItems:"center",gap:6},diffChangeIcon:{fontSize:12,fontWeight:"700",color:A.color.warning,fontFamily:Ke},diffChangeKey:{fontSize:12,color:A.color.text,fontFamily:Ke},diffNoChanges:{fontSize:12,color:A.color.textTertiary,fontStyle:"italic"},diffPlaceholder:{fontSize:12,color:A.color.textTertiary,fontStyle:"italic",textAlign:"center",padding:16},diffModeTabs:{flexDirection:"row",backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:4,gap:4},diffModeTab:{flex:1,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center"},diffModeTabActive:{backgroundColor:A.color.accentSoft},diffModeTabDisabled:{opacity:.4},diffModeTabText:{fontSize:10,fontWeight:"600",color:A.color.textSecondary,letterSpacing:.5},diffModeTabTextActive:{color:A.color.accent},diffModeTabTextDisabled:{color:A.color.textTertiary},causeDiffContainer:{gap:8,marginBottom:12},causeDiffRow:{flexDirection:"row",alignItems:"center",gap:8},causeDiffLabel:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,minWidth:80},causeDiffValue:{fontSize:12,color:A.color.text,fontFamily:Ke,fontWeight:"500"},diffChangesTitle:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,marginBottom:6},treeDiffContainer:{backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,overflow:"hidden",minHeight:150},noDiffData:{padding:24,alignItems:"center",gap:8},noDiffDataTitle:{fontSize:13,fontWeight:"600",color:A.color.text},noDiffDataText:{fontSize:12,color:A.color.textTertiary,textAlign:"center",lineHeight:18},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,marginHorizontal:12,marginTop:8,backgroundColor:A.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:A.color.warning+"30",gap:8},lockedBannerText:{color:A.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:A.color.textTertiary,fontSize:12}});U();import{useCallback as Ot,useEffect as fh,useMemo as cr,useState as pc}from"react";import{DynamicFilterView as yh,macOSColors as wi,night as Si,FileText as mc,FileCode as fc,Zap as yc,Settings as bh,Eye as vh,Layers as Ch,ToolbarCopyButton as Th,ExportPreview as wh,monoFont as Sh}from"@buoy-gg/shared-ui/web";U();var xi={format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},bc={llm:{format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},table:{format:"markdown-table",topN:50,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},json:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},full:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:false,sortBy:"renderCount",includeHistory:true}};function vc(e){for(let[t,n]of Object.entries(bc))if(Object.keys(n).every(r=>{let o=e[r],i=n[r];return Array.isArray(o)&&Array.isArray(i)?o.length===i.length&&o.every((s,a)=>s===i[a]):o===i}))return t;return null}l(vc,"detectActivePreset");var De={llm:{label:"LLM",description:"Compact summary for AI",color:"#10B981"},table:{label:"Table",description:"Markdown table",color:"#3B82F6"},json:{label:"JSON",description:"Structured data",color:"#F59E0B"},full:{label:"Full",description:"Everything incl. history",color:"#6B7280"}};U();import{definePersistedSetting as xh,devToolsStorageKeys as Ih}from"@buoy-gg/shared-ui/web";var Cc=xh(Ih.highlightUpdates.copySettings(),xi,{sanitize:l((e,t)=>({...e,filterCauses:t?.filterCauses??xi.filterCauses}),"sanitize")});async function Tc(e){await Cc.save(e)}l(Tc,"saveCopySettings");async function wc(){return Cc.loadOrNull()}l(wc,"loadCopySettings");import{Fragment as Rh,jsx as _t,jsxs as Dh}from"react/jsx-runtime";var kh=50*1024,Ph=200*1024,Nh=[{value:"mount",label:"Mount"},{value:"props",label:"Props"},{value:"hooks",label:"Hooks"},{value:"state",label:"State"},{value:"parent",label:"Parent"},{value:"context",label:"Context"},{value:"unknown",label:"Unknown"}];function Sc(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}l(Sc,"formatBytes");function xc(){let e=Date.now();return[{id:"1",nativeTag:1,viewType:"RCTView",displayName:"View",componentName:"PokemonListItem",renderCount:30,firstRenderTime:e-5e3,lastRenderTime:e,color:"#10B981",lastRenderCause:{type:"parent",timestamp:e,componentCause:"parent"}},{id:"2",nativeTag:2,viewType:"RCTView",displayName:"View",componentName:"CartHeader",renderCount:12,firstRenderTime:e-4e3,lastRenderTime:e,color:"#3B82F6",lastRenderCause:{type:"hooks",timestamp:e,componentCause:"state",hookChanges:[{type:"useState",index:2,previousValue:4,currentValue:5}]}},{id:"3",nativeTag:3,viewType:"RCTView",displayName:"View",componentName:"SearchBar",renderCount:8,firstRenderTime:e-3e3,lastRenderTime:e,color:"#F59E0B",lastRenderCause:{type:"props",timestamp:e,componentCause:"props",changedKeys:["query","onChange"]}}]}l(xc,"createMockRenders");function Ic({renders:e}){let[t,n]=pc(xi),[r,o]=pc(false);fh(()=>{let C=true;return wc().then(N=>{C&&N&&n(N)}),()=>{C=false}},[]);let i=Ot(C=>{n(C),Tc(C)},[]),s=e.length>0,a=s?e:xc(),u=cr(()=>vc(t),[t]),c=cr(()=>Hs(a,t),[a,t]),d=cr(()=>c>=Ph?"danger":c>=kh?"warning":"none",[c]),g=Ot(()=>nr(a,t),[a,t]),T=Ot(C=>{let N=bc[C];N&&i({...N,filterCauses:[...N.filterCauses]})},[i]),b=Ot((C,N)=>{let[m,k]=C.split("::");if(m==="preset"){T(k);return}if(m==="format"){i({...t,format:N});return}if(m==="sort"){i({...t,sortBy:N});return}if(m==="topN"){i({...t,topN:N});return}if(m==="minRenders"){i({...t,minRenders:N});return}if(m==="cause"){let P=N,D=t.filterCauses.includes(P);i({...t,filterCauses:D?t.filterCauses.filter(W=>W!==P):[...t.filterCauses,P]});return}if(m==="signal"){let P=k;i({...t,[P]:!t[P]});return}},[t,i,T]),v=Ot(()=>{let{totalComponents:C,totalRenders:N}=ri(a);return _t(wh,{expanded:r,onExpandedChange:o,summary:`${C} component${C!==1?"s":""} \xB7 ${N} renders \xB7 ~${Sc(c)}${s?"":" (mock data)"}`,warningLevel:d,warningText:{warning:"Large payload \u2014 preview may be slow",danger:"Very large payload \u2014 try a smaller topN or turn off history"},testIDs:{expand:"buoy-highlight-copy-preview-show",collapse:"buoy-highlight-copy-preview-hide",summary:"buoy-highlight-copy-preview-summary",warning:"buoy-highlight-copy-size-warning"},renderBody:()=>{let m=g();return _t(Me,{testID:"buoy-highlight-copy-preview-scroll",style:Ii.previewScroll,nestedScrollEnabled:true,children:_t(p,{testID:"buoy-highlight-copy-preview-text",style:Ii.previewText,selectable:true,children:m})})}})},[r,a,c,d,s,g]),f=Ot(()=>{let{totalComponents:C}=ri(a),N=s?`${C} components`:"Mock data (no renders captured)";return Dh(Rh,{children:[_t(p,{testID:"buoy-highlight-copy-status",style:Ii.statusLabel,children:N}),_t(Th,{value:g})]})},[s,a,g]),S=cr(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:De.llm.label,icon:yc,color:De.llm.color,value:"llm",isActive:u==="llm",description:De.llm.description},{id:"preset::table",label:De.table.label,icon:mc,color:De.table.color,value:"table",isActive:u==="table",description:De.table.description},{id:"preset::json",label:De.json.label,icon:fc,color:De.json.color,value:"json",isActive:u==="json",description:De.json.description},{id:"preset::full",label:De.full.label,icon:Ch,color:De.full.color,value:"full",isActive:u==="full",description:De.full.description},{id:"preset::custom",label:"Custom",icon:bh,color:Si.color.textSecondary,value:"custom",isActive:u===null,description:"User-configured"}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::summary",label:"Summary",icon:yc,color:wi.semantic.success,value:"summary",isActive:t.format==="summary",description:"Compact, LLM-ready"},{id:"format::markdown-table",label:"Table",icon:mc,color:wi.semantic.info,value:"markdown-table",isActive:t.format==="markdown-table",description:"Markdown table"},{id:"format::json",label:"JSON",icon:fc,color:wi.semantic.warning,value:"json",isActive:t.format==="json",description:"Structured data"}]},{id:"sort",title:"Sort By",type:"custom",data:[{id:"sort::renderCount",label:"Count",value:"renderCount",isActive:t.sortBy==="renderCount",description:"Total renders"},{id:"sort::rate",label:"Rate",value:"rate",isActive:t.sortBy==="rate",description:"Renders / sec"},{id:"sort::name",label:"Name",value:"name",isActive:t.sortBy==="name",description:"Alphabetical"}]},{id:"topN",title:"Top N",type:"custom",data:[{id:"topN::10",label:"10",value:10,isActive:t.topN===10},{id:"topN::25",label:"25",value:25,isActive:t.topN===25},{id:"topN::50",label:"50",value:50,isActive:t.topN===50},{id:"topN::100",label:"100",value:100,isActive:t.topN===100},{id:"topN::-1",label:"All",value:-1,isActive:t.topN===-1}]},{id:"minRenders",title:"Min Renders",type:"custom",data:[{id:"minRenders::1",label:"1",value:1,isActive:t.minRenders===1},{id:"minRenders::2",label:"2",value:2,isActive:t.minRenders===2},{id:"minRenders::3",label:"3",value:3,isActive:t.minRenders===3},{id:"minRenders::5",label:"5",value:5,isActive:t.minRenders===5},{id:"minRenders::10",label:"10",value:10,isActive:t.minRenders===10}]},{id:"causes",title:"Filter Causes",type:"custom",description:t.filterCauses.length===0?"All causes shown":"Only the selected causes shown",data:Nh.map(C=>({id:`cause::${C.value}`,label:C.label,value:C.value,isActive:t.filterCauses.includes(C.value)}))},{id:"signal",title:"Signal Extraction",type:"custom",data:[{id:"signal::groupByName",label:"Group by name",value:"groupByName",isActive:t.groupByName,description:"Collapse list items"},{id:"signal::aggregateCauses",label:"Aggregate causes",value:"aggregateCauses",isActive:t.aggregateCauses,description:"Hook x N"},{id:"signal::includeHistory",label:"Include history",value:"includeHistory",isActive:t.includeHistory,description:"JSON only \u2014 large"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:vh,content:v,headerActions:f},onFilterChange:b}),[t,u,b,v,f]);return _t(yh,{...S})}l(Ic,"RendersCopySettingsView");var Ii=ve.create({previewScroll:{maxHeight:360},previewText:{fontFamily:Sh,fontSize:11,color:Si.color.text,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:Si.color.textTertiary,marginRight:8}});import{Fragment as zh,jsx as ne,jsxs as Ri}from"react/jsx-runtime";var Lh=lg.memo(l(function(){return Ri(h,{testID:"buoy-highlight-disabled-banner",style:gn.disabledBanner,children:[ne(sg,{size:14,color:Bt.color.warning}),ne(p,{testID:"buoy-highlight-disabled-text",style:gn.disabledText,children:"Render tracking is disabled"})]})},"DisabledBanner"));function ur({visible:e,onClose:t,onBack:n,onMinimize:r,enableSharedModalDimensions:o=false,initialNativeTag:i,onInitialNativeTagHandled:s,onRenderSelect:a,inline:u=false}){let c=dg(),[d,g]=de(false),[T,b]=de(()=>E.getFrozen()),[v,f]=de(()=>B.getStats().totalComponents>0),[S,C]=de(null),[N,m]=de(0),[k,P]=de(false),[D,W]=de(false),[Z,V]=de([]),[j,x]=de("filters"),[L,ue]=de("details"),[pe,Fe]=de(0),[ye,Rr]=de(""),[St,jt]=de(false),Oi=ct(null),Gt=ct([]),_i=ct(B.getFilters()),[Dr,Wi]=de(()=>{let _=B.getFilters();return _.includePatterns.length+_.excludePatterns.length}),[be,Ui]=de(()=>B.getFilters()),[kr,ji]=de(()=>B.getSettings()),Gi=ct(false),Pr=ct(false),yn=ct(false);Re(()=>{!e||Gi.current||(Gi.current=true)},[e]),Re(()=>{if(!e||Pr.current)return;l(async()=>{try{let _=await Zn.getItem(Lt.highlightUpdates.filters());if(_){let G=JSON.parse(_),ie={includeTestID:new Set(G.includeTestID||[]),includeNativeID:new Set(G.includeNativeID||[]),includeViewType:new Set(G.includeViewType||[]),includeComponent:new Set(G.includeComponent||[]),excludeTestID:new Set(G.excludeTestID||[]),excludeNativeID:new Set(G.excludeNativeID||[]),excludeViewType:new Set(G.excludeViewType||[]),excludeComponent:new Set(G.excludeComponent||[]),includePatterns:G.includePatterns||[],excludePatterns:G.excludePatterns||[]};B.setFilters(ie);let Le=B.getFilters();_i.current=Le,Ui(Le),Wi(Le.includePatterns.length+Le.excludePatterns.length)}Pr.current=true}catch{}},"loadFilters")()},[e]),Re(()=>{if(!Pr.current)return;l(async()=>{try{let _={includeTestID:Array.from(be.includeTestID),includeNativeID:Array.from(be.includeNativeID),includeViewType:Array.from(be.includeViewType),includeComponent:Array.from(be.includeComponent),excludeTestID:Array.from(be.excludeTestID),excludeNativeID:Array.from(be.excludeNativeID),excludeViewType:Array.from(be.excludeViewType),excludeComponent:Array.from(be.excludeComponent),includePatterns:be.includePatterns,excludePatterns:be.excludePatterns};await Zn.setItem(Lt.highlightUpdates.filters(),JSON.stringify(_))}catch{}},"saveFilters")()},[be]),Re(()=>{if(!e||yn.current)return;l(async()=>{try{let _=await Zn.getItem(Lt.highlightUpdates.settings());if(_){let G=JSON.parse(_),{performanceLogging:ie,excludeDevTools:Le,...Ye}=G;B.setSettings(Ye),ji(B.getSettings())}yn.current=true}catch{yn.current=true}},"loadSettings")()},[e]),Re(()=>{if(!yn.current)return;l(async()=>{try{let{performanceLogging:_,excludeDevTools:G,...ie}=kr;await Zn.setItem(Lt.highlightUpdates.settings(),JSON.stringify(ie))}catch{}},"saveSettings")()},[kr]),Re(()=>{let _=B.subscribeToState(G=>{g(G.isTracking)});return()=>{_()}},[]),Re(()=>{let _=E.subscribeToFreeze(G=>{b(G)});return()=>{_()}},[]),Re(()=>{St&&requestAnimationFrame(()=>{Oi.current?.focus()})},[St]),Re(()=>{e||E.setSpotlight(null)},[e]),Re(()=>{if(e&&i!=null){let _=B.getRender(String(i));_&&(C(_),m(0),P(false),E.setSpotlight(_.nativeTag)),s?.()}},[e,i,s]);let Ki=re(()=>{E.isInitialized()||E.initialize(),E.toggle()},[]),qi=re(()=>{E.toggleFreeze()},[]),Ji=re(()=>{E.clearRenderCounts(),f(false)},[]),Yi=re(()=>{V(B.getFilteredRenders(ye)),W(true)},[ye]),Xi=re(()=>{W(false)},[]),Qi=re(_=>{Rr(_)},[]),wu=re((_,G,ie)=>{C(_),m(G),ue("details"),Fe(0),Gt.current=ie,E.setSpotlight(_.nativeTag)},[]);Re(()=>{if(!S)return;let _=String(S.nativeTag);return B.subscribe(()=>{let G=B.getRender(_);G&&C({...G})})},[S?.nativeTag]);let Zi=ct(null);Re(()=>{!a||!S||Zi.current!==S.nativeTag&&(Zi.current=S.nativeTag,a(S))},[S,a]);let Su=re(_=>{Gt.current=_},[]),ea=re(()=>{C(null),m(0),ye&&jt(true),E.setSpotlight(null)},[ye]),xu=re(()=>{let _=Gt.current;if(N>0){let G=N-1,ie=_[G];ie&&(C(ie),m(G),E.setSpotlight(ie.nativeTag))}},[N]),Iu=re(()=>{let _=Gt.current;if(N<_.length-1){let G=N+1,ie=_[G];ie&&(C(ie),m(G),E.setSpotlight(ie.nativeTag))}},[N]),ta=re(()=>{P(false)},[]),na=re(()=>{P(true)},[]),ra=re(()=>{jt(true)},[]),oa=re(()=>{jt(false)},[]),Nr=re(_=>{B.setFilters(_);let G=B.getFilters();_i.current=G,Ui(G),Wi(G.includePatterns.length+G.excludePatterns.length)},[]),Ru=re((_,G)=>{let ie=B.getFilters(),Le={};G==="include"?ie.includePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(Le.includePatterns=[...ie.includePatterns,_]):ie.excludePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(Le.excludePatterns=[...ie.excludePatterns,_]),Object.keys(Le).length>0&&(Nr(Le),C(null),m(0),E.setSpotlight(null))},[Nr]),Du=re(_=>{B.setSettings(_),ji(B.getSettings())},[]),ku=re(_=>{f(_.totalComponents>0)},[]),ia=re(()=>D?ne(uh,{onBack:Xi}):k?ne(sh,{onBack:ta,activeTab:j,onTabChange:x,activeFilterCount:Dr}):S?ne(ch,{onBack:ea,activeTab:L,onTabChange:ue,hasHistory:(S.renderHistory?.length??0)>0}):ne(lh,{onBack:n,isSearchActive:St,searchText:ye,onSearchChange:Qi,onSearchToggle:ra,onSearchClose:oa,onFilterToggle:na,onToggleTracking:Ki,onToggleFreeze:qi,onClear:Ji,onOpenCopySettings:Yi,isTracking:d,isFrozen:T,activeFilterCount:Dr,hasRenders:v,searchInputRef:Oi}),[D,k,S,n,St,ye,d,T,Dr,v,j,L,ta,ea,Xi,Qi,ra,oa,na,Ki,qi,Ji,Yi]),Pu=o?Lt.modal.root():Lt.highlightUpdates.modal();if(!e)return null;let Nu=Gt.current.length,aa=S?L==="details"?ne(wg,{currentIndex:N,totalItems:Nu,onPrevious:xu,onNext:Iu,itemLabel:"Component",subtitle:S.componentName||S.displayName||S.viewType}):ne(Ti,{render:S,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:c}):null,la=ne(h,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:gn.container,children:D?ne(Ic,{renders:Z}):S?L==="details"?ne(oi,{render:S,disableInternalFooter:true,onAddFilter:Ru,isPro:c}):ne(Ci,{render:S,disableInternalFooter:true,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:c}):k?ne(fi,{filters:be,onFilterChange:Nr,settings:kr,onSettingsChange:Du,availableProps:B.getAvailableProps(),activeTab:j}):Ri(zh,{children:[E.getRenderSourceStatus()==="unavailable"?ne(p,{style:{color:Bt.color.warning,padding:16},children:"Not in this app"}):!d&&ne(Lh,{}),ne(Wg,{searchText:ye,filters:be,onSelectRender:wu,onStatsChange:ku,onRendersChange:Su,isTracking:d,isPro:c})]})});return u?ne(ws,{children:Ri(h,{style:gn.inlineRoot,children:[ne(h,{style:gn.inlineHeader,...ug,children:ia()}),la,aa]})}):ne(ws,{children:ne(cg,{visible:e,onClose:t,onMinimize:r,persistenceKey:Pu,header:{showToggleButton:true,customContent:ia()},enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Ha.OS==="web",styles:{},footer:aa,footerHeight:S&&(L==="details"||(S.renderHistory?.length??0)>1)?68:0,children:la})})}l(ur,"HighlightUpdatesModal");function Rc(e={}){return ne(ur,{...e,inline:true,visible:true,onClose:()=>{}})}l(Rc,"HighlightToolView");var gn=ve.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Bt.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:Bt.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:Bt.color.warning+"20"},disabledText:{color:Bt.color.warning,fontSize:11,flex:1}});import{jsx as hn}from"react/jsx-runtime";function Dc({size:e}){let[t,n]=Ar(()=>E.isEnabled());return Er(()=>E.subscribe(r=>{n(r)}),[]),hn(xa,{size:e,color:t?"#10b981":"#6b7280"})}l(Dc,"HighlightIcon");function Di(){return null}l(Di,"EmptyComponent");function ki(e){let[t,n]=Ar(null);Er(()=>(e.visible&&E.setBadgePressCallback(o=>{n(o)}),()=>{e.visible||E.setBadgePressCallback(null)}),[e.visible]);let r=Eu(()=>{n(null)},[]);return hn(ur,{...e,initialNativeTag:t,onInitialNativeTagHandled:r})}l(ki,"HighlightUpdatesModalWithBadgeNavigation");var Bh={id:"highlight-updates",name:"TOGGLE HIGHLIGHT",description:"Toggle component render highlights",slot:"row",icon:Dc,component:Di,props:{},launchMode:"toggle-only",onPress:l(()=>{E.isInitialized()||E.initialize(),E.toggle()},"onPress")};function kc(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";e?.autoInitialize&&setTimeout(()=>{E.initialize()},1e3);let r=l(({size:o})=>{let[i,s]=Ar(()=>E.isEnabled());return Er(()=>E.subscribe(a=>{s(a)}),[]),hn(xa,{size:o,color:i?t:n})},"CustomHighlightIcon");return{id:e?.id||"highlight-updates",name:e?.name||"TOGGLE HIGHLIGHT",description:e?.description||"Toggle component render highlights",slot:"row",icon:r,component:Di,props:{},launchMode:"toggle-only",onPress:l(()=>{E.isInitialized()||E.initialize(),E.toggle()},"onPress")}}l(kc,"createHighlightUpdatesTool");var Vh={id:"highlight-updates-modal",name:"HIGHLIGHT",description:"View component render tracking modal",slot:"both",icon:l(({size:e})=>hn(Sa,{size:e}),"icon"),component:ki,props:{enableSharedModalDimensions:false}};function Pc(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";return e?.autoInitialize&&setTimeout(()=>{E.initialize()},1e3),{id:e?.id||"highlight-updates-modal",name:e?.name||"HIGHLIGHT",description:e?.description||"View component render tracking modal",slot:"both",icon:l(({size:r})=>hn(Sa,{size:r,color:t}),"icon"),component:ki,props:{enableSharedModalDimensions:false}}}l(Pc,"createHighlightUpdatesModalTool");U();U();import{getDOMFiber as Hh,getDOMNodeHandle as Ah}from"@buoy-gg/shared-ui/web/utils";var Eh=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","Pressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","TextInput","Switch","ActivityIndicator","Modal","SafeAreaView","SafeAreaProvider","KeyboardAvoidingView","VirtualizedList","Screen","ScreenContainer","ScreenStack","ScreenContentWrapper","GestureHandlerRootView","GestureDetector","Wrapper"]);function dr(e){let t=e.return,n=t?.elementType??t?.type;return t&&n?.$$typeof===Symbol.for("react.memo")&&(n.type===e.type||n.type===e.elementType)?t:null}l(dr,"memoParent");function gr(e){let t="",n=e.tag===14||e.tag===15,r=e.tag===11,o=new Set,i=l(a=>{!a||o.has(a)||o.size>20||(o.add(a),t||(t=a.displayName||(typeof a=="function"?a.name:"")),a.$$typeof===Symbol.for("react.memo")&&(n=true,i(a.type)),a.$$typeof===Symbol.for("react.forward_ref")&&(r=true,i(a.render)))},"visit");i(e.elementType),i(e.type);let s=dr(e);return s&&i(s.elementType??s.type),{name:t||"Anonymous",memo:n,forwardRef:r}}l(gr,"typeInfo");function Pi(e){if(!e||typeof e.type=="string"||![0,1,2,11,14,15].includes(e.tag))return false;let{name:t}=gr(e),n=e._debugSource?.fileName??"";return!Eh.has(t)&&!/^(Animated|RCT|Reanimated|Buoy|DevTools|FloatingDevTools|HighlightUpdates)/.test(t)&&!/[@/]buoy-gg\/|\/react-native\//.test(n)&&!e.memoizedProps?.__buoyDevToolsRoot}l(Pi,"isUserComponent");function Nc(e){let t=gr(e),n=dr(e),r=e._debugSource??n?._debugSource;if(typeof r?.fileName=="string"&&r.fileName)t.source={fileName:r.fileName},Number.isFinite(r.lineNumber)&&(t.source.lineNumber=r.lineNumber),Number.isFinite(r.columnNumber)&&(t.source.columnNumber=r.columnNumber);else{let o=e._debugStack??n?._debugStack;typeof o?.stack=="string"&&(t.rawStack=o.stack)}return t}l(Nc,"entry");function zc(e){let t=e.child?[e.child]:[],n=0;for(;t.length&&n++<300;){let r=t.shift();if(r._debugOwner===e){let o=r._debugSource;if(typeof o?.fileName=="string"&&o.fileName)return{source:{fileName:o.fileName,...Number.isFinite(o.lineNumber)?{lineNumber:o.lineNumber}:{},...Number.isFinite(o.columnNumber)?{columnNumber:o.columnNumber}:{}}};if(typeof r._debugStack?.stack=="string")return{rawStack:r._debugStack.stack}}r.child&&t.push(r.child),r.sibling&&t.push(r.sibling)}}l(zc,"definitionOf");function Lc(e){let t=[],n=null,r=new Set,o=e;for(;o&&!r.has(o)&&r.size<400&&t.length<7;){r.add(o),Pi(o)&&(t.length||(n=o),t.push(Nc(o)));let s=dr(o);o=o._debugOwner||s?._debugOwner||s?.return||o.return,s&&o===s&&(o=s._debugOwner||s.return)}if(!t.length)return{found:false,reason:"No app component was found for this view."};let i=n?zc(n):void 0;return{found:true,component:i?{...t[0],definedIn:i}:t[0],owners:t.slice(1)}}l(Lc,"sourceFromFiber");function Bc(e){return e?.canonical?.internalInstanceHandle||e?._internalInstanceHandle||e?._internalFiberInstanceHandleDEV||Hh(e)||null}l(Bc,"fiberFromStateNode");function Vc(e){return Ah(e)??e?.__nativeTag??e?._nativeTag??e?.nativeTag??e?.canonical?.__nativeTag??e?.canonical?._nativeTag??e?.canonical?.nativeTag??null}l(Vc,"nativeTag");var Fh=1e5;function Hc(e){let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__,n=[],r=l(s=>{try{t?.getFiberRoots?.(s)?.forEach(a=>n.push(a.current))}catch{}},"addRoots");t?.renderers?.forEach((s,a)=>r(a)),n.length||r(1);let o=[...n],i=new Set;for(;o.length;){if(i.size>=Fh)return{fiber:null,capped:true,any:true};let s=o.pop();if(!s||i.has(s))continue;i.add(s),s.sibling&&o.push(s.sibling);let a=s.memoizedProps??{};if(!(s.tag===22&&s.memoizedState!=null||a.__buoyDevToolsRoot||a.activityState===0||a.activityState===1||a.isPageFocused===false||a["aria-hidden"]===true&&(a.activityState!==void 0||"shouldFreeze"in a)||a.isFocused===false&&(a.routeKey!==void 0||"freezeContents"in a))){if(e(s))return{fiber:s,capped:false,any:true};s.child&&o.push(s.child)}}return{fiber:null,capped:false,any:n.length>0}}l(Hc,"findLiveFiber");async function Ac(e={}){try{let{nativeTag:t,query:n}=e??{};if(t!==void 0&&(!Number.isInteger(t)||t<0)||n!==void 0&&typeof n!="string")return{found:false,reason:"Pass a valid nativeTag or a text query."};let r=n?.trim();if(t==null&&!r)return{found:false,reason:"Pass a query or nativeTag."};let o=false,i=false,s=l(c=>{let d=Hc(c);return o||(o=d.capped),i||(i=d.any),d.fiber??void 0},"find"),a=l(c=>s(d=>d.stateNode&&Vc(d.stateNode)===c),"byTag"),u=t!=null?a(t):void 0;if(t==null&&r&&(u=s(c=>Pi(c)&&gr(c).name.toLowerCase()===r.toLowerCase()),!u)){let c=(await Ln({})).elements.map(d=>({el:d,score:Zt(d,{query:r})})).filter(({score:d})=>d>0).sort((d,g)=>g.score-d.score)[0]?.el;c?.nativeTag!=null&&(u=a(c.nativeTag))}return!u&&!i?{found:false,reason:"No React tree was found. Use a dev build."}:u?Lc(Bc(u.stateNode)??u):{found:false,reason:o?"The React tree is too big to search fully, and no view matched in the part searched. Pass the nativeTag from describe_screen.":"No view matched. Check describe_screen for its name or tag."}}catch{return{found:false,reason:"Could not read the React tree. Try again in a dev build."}}}l(Ac,"getComponentSource");Ve();U();U();import{resolveDOMEventEmitter as Mh}from"@buoy-gg/shared-ui/web/utils";var $h=14,Oh=550,_h=4e3,Wh=8e3,Ec=600,Ni=null,Fc=false,zi=null,hr=[],qe="idle",Je=[],Li=0,ze=null;function Mc(){if(Fc)return Ni;Fc=true;let e=Mh();return Ni=e.emitter,zi=e.reason,Ni}l(Mc,"getEmitter");function yt(e){return typeof e=="number"&&Number.isFinite(e)?e:null}l(yt,"num");function Bi(e){let t=e?.nativeEvent;return t?yt(t.target)??yt(t.tag):null}l(Bi,"tagOf");function pr(e){let t=e?.nativeEvent;if(!t)return null;let n={x:yt(t.pageX),y:yt(t.pageY)};if(n.x!==null&&n.y!==null)return{x:n.x,y:n.y};for(let r of["changedTouches","touches"]){let o=t[r];if(Array.isArray(o)&&o.length){let i=o[0],s=yt(i?.pageX),a=yt(i?.pageY);if(s!==null&&a!==null)return{x:s,y:a}}}return null}l(pr,"pointOf");function Vi(e){Je.push({...e,seq:++Li}),Je.length>Ec&&(Je=Je.slice(-Ec))}l(Vi,"push");function $c(e){let t=Bi(e);if(t===null)return;let n=pr(e),r=null;try{r=Hn(t)}catch{}ze={tag:t,x:n?.x??0,y:n?.y??0,t:Date.now(),drift:0,target:r}}l($c,"onTouchStart");function Oc(e){if(!ze)return;let t=pr(e);if(!t)return;let n=t.x-ze.x,r=t.y-ze.y;ze.drift=Math.max(ze.drift,Math.sqrt(n*n+r*r))}l(Oc,"onTouchMove");function _c(e){let t=ze;if(ze=null,!t||!t.target)return;let n=pr(e);if(n){let o=n.x-t.x,i=n.y-t.y;t.drift=Math.max(t.drift,Math.sqrt(o*o+i*i))}if(t.drift>$h)return;let r=Date.now()-t.t;r>_h||t.target.control!=="text"&&(t.target.control==="toggle"||t.target.control==="slider"||Vi({t:Date.now(),kind:r>=Oh?"longPress":"press",target:t.target}))}l(_c,"onTouchEnd");function Wc(){ze=null}l(Wc,"onTouchCancel");function mr(e){let t=Bi(e);if(t===null)return;let n=e.nativeEvent,r,o;if(typeof n.text=="string")r="text",o=n.text;else if(typeof n.value=="boolean")r="toggle",o=n.value;else if(typeof n.value=="number")r="slider",o=n.value;else return;let i=Je[Je.length-1];if(i&&i.kind===r&&i.target.nativeTag===t&&Date.now()-i.t<Wh){i.value=o,i.t=Date.now();return}let s=null;try{s=Hn(t)}catch{}s&&Vi({t:Date.now(),kind:r,target:s,value:o})}l(mr,"onChange");function Uc(){if(qe==="capturing")return Wt();let e=Mc();if(!e)return qe="unavailable",Wt();try{hr=[e.addListener("topTouchStart",$c),e.addListener("topTouchMove",Oc),e.addListener("topTouchEnd",_c),e.addListener("topTouchCancel",Wc),e.addListener("topChange",mr),e.addListener("topValueChange",mr),e.addListener("topSlidingComplete",mr)],ze=null,qe="capturing"}catch(t){hr=[],qe="unavailable",zi=t?.message??"addListener failed"}return Wt()}l(Uc,"startTouchCapture");function jc(){hr.forEach(e=>{try{e.remove()}catch{}}),hr=[],ze=null,qe==="capturing"&&(qe="idle")}l(jc,"stopTouchCapture");function Gc(){Je=[],Li=0}l(Gc,"clearTouchCapture");function Wt(){return{status:qe,reason:qe==="unavailable"?zi:null}}l(Wt,"getTouchCaptureStatus");function Kc(e=0){return{...Wt(),records:Je.filter(t=>t.seq>e),seq:Li}}l(Kc,"readTouchCapture");U();var qc=0,Jc=1,Yc=11,Xc=14,Qc=15,fr=1,Uh=1e4,jh=300,Gh=20,Zc=false,pn=false,Hi=false,yr=false,br=0,bt=0,vr=0,vt={},Ct=new Map;function Ai(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}l(Ai,"getHook");function Cr(e){let t=e.flags??e.effectTag;return typeof t=="number"?t:0}l(Cr,"getFlags");function Ei(e){return e===qc||e===Jc||e===Yc||e===Xc||e===Qc}l(Ei,"isCompositeTag");function Tr(e){let t=e.type;try{switch(e.tag){case qc:case Jc:return t?.displayName||t?.name||"Anonymous";case Yc:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case Xc:case Qc:{let n=t?.type??e.elementType?.type;return t?.displayName||n?.displayName||n?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}l(Tr,"getComponentName");function eu(e){let t=e.actualDuration;if(typeof t!="number")return null;let n=t;for(let r=e.child;r!=null;r=r.sibling)typeof r.actualDuration=="number"&&(n-=r.actualDuration);return n>0?n:0}l(eu,"computeSelfMs");var Kh=new Set(["View","Text","Image","ImageBackground","ScrollView","FlatList","SectionList","SafeAreaView","KeyboardAvoidingView","StatusBar","ActivityIndicator","RefreshControl","Modal","Switch","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","PressabilityDebugView","AnimatedComponent","Wrapper"]),tu=["Animated(","Pressability","Virtualized","CellRenderer"];function Fi(e){if(Kh.has(e))return true;for(let t=0;t<tu.length;t++)if(e.startsWith(tu[t]))return true;return false}l(Fi,"isFrameworkWrapperName");var nu=40,ru=5;function ou(e,t){if(Object.is(e,t))return true;let n=typeof e;if(n!==typeof t)return false;if(n==="function")return true;if(e===null||t===null||n!=="object")return false;let r=Array.isArray(e);if(r!==Array.isArray(t))return false;if(r){if(e.length!==t.length)return false;for(let s=0;s<e.length;s++)if(!Object.is(e[s],t[s]))return false;return true}let o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return false;for(let s=0;s<o.length;s++){let a=o[s];if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return false}return true}l(ou,"isEquivalentValue");function iu(e,t){let n=e.alternate;if(!n)return{cause:"mount"};let r=e.memoizedProps,o=n.memoizedProps;if(r!==o&&r&&o){let i=false,s=false,a,u=Object.keys(r),c=u.length<nu?u.length:nu;for(let d=0;d<c;d++){let g=u[d],T=o[g],b=r[g];if(!Object.is(T,b)&&(i=true,t&&(a||(a=[]),a.length<ru&&a.push(g)),!ou(T,b)&&(s=true,!t)))break}if(!s&&Object.keys(o).length!==u.length&&(i=true,s=true),i)return{cause:s?"props":"propsUnstable",changedKeys:a}}return ml(n,e)?{cause:"hooks"}:{cause:"parent"}}l(iu,"detectCause");function au(e){for(let t=e.return;t!=null;t=t.return){if(!Ei(t.tag)||(Cr(t)&fr)===0)continue;let n=Tr(t);if(!Fi(n))return n}}l(au,"nearestRenderedAncestorName");function lu(e,t){let n=Tr(e),r=eu(e);r!==null&&(Hi=true);let o=r??0;bt+=1,vr+=o;let{cause:i,changedKeys:s}=iu(e,yr);if(vt[i]=(vt[i]??0)+1,Fi(n))return;let a=Ct.get(n);if(!a){if(Ct.size>=jh)return;a={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}},Ct.set(n,a)}if(a.renders+=1,a.totalSelfMs+=o,o>a.maxSelfMs&&(a.maxSelfMs=o),a.causes[i]=(a.causes[i]??0)+1,yr){if(s){a.changedProps||(a.changedProps=new Set);for(let u=0;u<s.length&&!(a.changedProps.size>=ru);u++)a.changedProps.add(s[u])}t&&!a.parentName&&(a.parentName=t)}}l(lu,"recordRender");function su(e){let t=e?.current;if(!t)return;let n=bt,r=0,o=t;for(;o!=null&&(r+=1,!(r>Uh));){let i=false,s=Ei(o.tag);if(o.memoizedProps?.__buoyDevToolsRoot||o.memoizedProps?.["data-buoy-root"]!==void 0)i=true;else if(s){let a=Tr(o);Ol(a)?i=true:$l(a)||(Cr(o)&fr)!==0&&lu(o,yr?au(o):void 0)}if(!i){let a=o.subtreeFlags;if(!(typeof a=="number"&&(a&fr)===0&&(Cr(o)&fr)===0)&&o.child!=null){o=o.child;continue}}for(;o!=null;){if(o===t)return Mi(n);if(o.sibling!=null){o=o.sibling;break}o=o.return}}Mi(n)}l(su,"handleCommit");function Mi(e){bt>e&&(br+=1)}l(Mi,"finalizeCommit");function cu(){if(Zc)return true;let e=Ai();if(!e)return false;let t=e.onCommitFiberRoot;return e.onCommitFiberRoot=function(n,r,...o){if(pn)try{su(r)}catch{}return typeof t=="function"?t.call(e,n,r,...o):void 0},Zc=true,true}l(cu,"ensureHookInstalled");function uu(){if(typeof ee<"u"&&!ee)return false;let e=Ai();return!!(e&&e.renderers&&e.renderers.size>0)}l(uu,"isSupported");function du(){return pn}l(du,"isCapturing");function gu(e){cu()&&(Ct=new Map,Hi=false,yr=e?.detail===true,br=0,bt=0,vr=0,vt={},pn=true)}l(gu,"startCapture");function hu(){if(!pn&&bt===0&&Ct.size===0)return null;pn=false;let e=Array.from(Ct.entries()).sort((n,r)=>{let o=r[1].totalSelfMs-n[1].totalSelfMs;return o!==0?o:r[1].renders-n[1].renders}).slice(0,Gh).map(([n,r])=>({name:n,renders:r.renders,totalMs:mn(r.totalSelfMs),maxMs:mn(r.maxSelfMs),avgMs:r.renders>0?mn(r.totalSelfMs/r.renders):0,causes:r.causes,...r.changedProps&&r.changedProps.size>0?{changedProps:Array.from(r.changedProps)}:null,...r.parentName?{parentName:r.parentName}:null})),t={totalCommits:br,totalRenders:bt,capturedDurations:Hi,totalRenderMs:mn(vr),wastedRenders:(vt.parent??0)+(vt.propsUnstable??0),causes:vt,topComponents:e};return Ct=new Map,br=0,bt=0,vr=0,vt={},t}l(hu,"stopCapture");function mn(e){return Math.round(e*100)/100}l(mn,"round2");var Tt={isSupported:uu,isCapturing:du,startCapture:gu,stopCapture:hu};function fn(){E.isInitialized()||E.initialize()}l(fn,"ensureInitialized");function wr(e){if(!e)return;let{hookChanges:t,...n}=e;return n}l(wr,"toWireCause");function pu(e){let{renderHistory:t,lastRenderCause:n,...r}=e;return{...r,lastRenderCause:wr(n),historyCount:t?.length??0}}l(pu,"toWireRender");function mu(e){try{return JSON.stringify(e),e}catch{return{...e,lastRenderCause:wr(e.lastRenderCause),renderHistory:e.renderHistory?.map(t=>({...t,capturedProps:void 0,capturedState:void 0,cause:wr(t.cause)??t.cause}))}}}l(mu,"jsonSafeRender");function fu(){return Tt.isSupported()?(Tt.startCapture({detail:true}),{ok:true}):{ok:false,reason:"render capture needs a dev build with the React DevTools hook available"}}l(fu,"beginMeasurement");function yu(){return{summary:Tt.stopCapture()}}l(yu,"endMeasurement");var qh={version:3,getSnapshot:l(()=>({enabled:E.isEnabled(),frozen:E.getFrozen(),highlightsSuppressed:E.getHighlightsSuppressed(),renders:B.getRenders().map(pu),trackerState:B.getState()}),"getSnapshot"),subscribe:l(e=>{let t=E.subscribe(e),n=E.subscribeToFreeze(e),r=B.subscribe(e),o=B.subscribeToState(e);return()=>{t(),n(),r(),o()}},"subscribe"),actions:{getComponentSource:l(async e=>{try{return await Ac(e)}catch(t){return{found:false,reason:`Could not read the component's source: ${t instanceof Error?t.message:String(t)}`}}},"getComponentSource"),beginMeasurement:l(()=>fu(),"beginMeasurement"),endMeasurement:l(()=>yu(),"endMeasurement"),getRenderDetail:l(e=>{let{nativeTag:t}=e??{};if(t==null)return{found:false,reason:"missing nativeTag"};let n=B.getRender(String(t));return n?{found:true,nativeTag:t,render:mu(n)}:{found:false,reason:"unknown nativeTag"}},"getRenderDetail"),toggle:l(()=>{fn(),E.toggle()},"toggle"),setEnabled:l(e=>{fn(),E.setEnabled(e.enabled)},"setEnabled"),toggleFreeze:l(()=>{E.toggleFreeze()},"toggleFreeze"),clearRenderCounts:l(()=>{E.clearRenderCounts()},"clearRenderCounts"),setSpotlight:l(e=>{E.setSpotlight(e.nativeTag)},"setSpotlight"),locateComponent:l(e=>(fn(),E.locateComponent(e??{})),"locateComponent"),setSilentTracking:l(e=>{fn(),E.setSilentTracking(e.enabled??false)},"setSilentTracking"),describeScreen:l(e=>Ln(e??{}),"describeScreen"),tapElement:l(e=>el(e??{}),"tapElement"),waitFor:l(e=>tl(e??{}),"waitFor"),hitTest:l(e=>gl(e??{x:.5,y:.5}),"hitTest"),readMaps:l(()=>hl(),"readMaps"),startTouchCapture:l(()=>Uc(),"startTouchCapture"),stopTouchCapture:l(()=>(jc(),Wt()),"stopTouchCapture"),clearTouchCapture:l(()=>(Gc(),{ok:true}),"clearTouchCapture"),readTouchCapture:l(e=>Kc(e?.sinceSeq??0),"readTouchCapture")}};U();import{useEffect as Sr,useState as $i,useRef as xr,useCallback as bu,useLayoutEffect as Jh}from"react";import{night as Ir,monoFont as Yh}from"@buoy-gg/shared-ui/web";Cn();Ve();import{Fragment as Xh,jsx as Ut,jsxs as vu}from"react/jsx-runtime";var Qh=1e3;function Cu({onBadgePress:e}={}){let[t,n]=$i([]),[r,o]=$i(()=>E.getFrozen()),[i,s]=$i(null),a=xr(null),u=xr(0),c=xr(0),d=xr(r);d.current=r,Qe.isEnabled()&&(u.current=performance.now(),c.current=t.length),Jh(()=>{if(Qe.isEnabled()&&u.current>0&&c.current>0){let f=performance.now()-u.current;ma(c.current,f)}}),Sr(()=>E.subscribeToFreeze(f=>{o(f)}),[]),Sr(()=>B.subscribeToFilters(()=>{n(f=>f.filter(S=>{let C=B.getRender(String(S.id));return C?B.shouldShowRender(C):true}))}),[]),Sr(()=>(E.setSpotlightCallback(f=>{s(f)}),()=>{E.setSpotlightCallback(null)}),[]);let g=bu(f=>{let S=Date.now(),C=f.map(N=>({...N,timestamp:S}));n(N=>{let m=[...N];for(let k of C){let P=m.findIndex(D=>D.id===k.id);P>=0?m[P]=k:m.push(k)}return m})},[]);Sr(()=>(E.setHighlightCallback(g),a.current=setInterval(()=>{if(d.current)return;let f=Date.now();n(S=>S.filter(C=>f-C.timestamp<Qh))},50),()=>{E.setHighlightCallback(null),a.current&&clearInterval(a.current)}),[g]);let T=e||E.getBadgePressCallback(),b=bu(f=>{e?e(f):E.handleBadgePress(f)},[e]),v=i?B.getRender(String(i)):null;return t.length===0&&!v?.measurements?null:vu(h,{style:wt.overlay,pointerEvents:"box-none",nativeID:"highlight-updates-overlay",children:[v?.measurements&&vu(Xh,{children:[Ut(h,{pointerEvents:"none",nativeID:"__spotlight_highlight__",style:[wt.spotlightHighlight,{left:v.measurements.x-3,top:v.measurements.y-3,width:v.measurements.width+6,height:v.measurements.height+6}]}),Ut(h,{pointerEvents:"none",style:[wt.spotlightLabel,{left:v.measurements.x,top:v.measurements.y+v.measurements.height+4}],children:Ut(p,{style:wt.spotlightLabelText,children:v.componentName||v.displayName||v.viewType})})]}),t.map(f=>Ut(h,{pointerEvents:"box-none",nativeID:`__highlight_rect_${f.id}__`,style:[wt.highlight,{left:f.x,top:f.y,width:f.width,height:f.height,borderColor:f.color}],children:f.count>0&&Ut(h,{style:[wt.badge,{backgroundColor:f.color}],nativeID:`__highlight_badge_${f.id}__`,pointerEvents:T?"auto":"none",hitSlop:{top:8,bottom:8,left:8,right:8},onStartShouldSetResponder:()=>!!T,onResponderGrant:()=>b(f.id),children:Ut(p,{style:wt.badgeText,nativeID:`__highlight_text_${f.id}__`,children:f.count})})},`highlight-${f.id}`))]})}l(Cu,"HighlightUpdatesOverlay");var wt=ve.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999999,elevation:999999,borderWidth:0},highlight:{position:"absolute",borderWidth:2,borderStyle:"solid",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,height:14,borderRadius:0,justifyContent:"center",alignItems:"center",paddingHorizontal:2},badgeText:{color:"#000",fontSize:9,fontWeight:"bold"},spotlightHighlight:{position:"absolute",borderWidth:2,borderStyle:"dashed",borderColor:Ir.color.accent,backgroundColor:"transparent"},spotlightLabel:{position:"absolute",backgroundColor:Ir.color.surface,borderWidth:1,borderColor:Ir.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},spotlightLabelText:{color:Ir.color.accent,fontSize:11,fontWeight:"600",fontFamily:Yh}});import{setRenderCaptureProvider as Zh}from"@buoy-gg/shared-ui/web";Ve();Cn();ha();U();function Tu(e){let t={exportedAt:new Date().toISOString(),totalComponents:e.length,totalRenders:e.reduce((n,r)=>n+r.renderCount,0),components:e.map(n=>({componentName:n.componentName||n.displayName,viewType:n.viewType,nativeTag:n.nativeTag,testID:n.testID,nativeID:n.nativeID,accessibilityLabel:n.accessibilityLabel,renderCount:n.renderCount,firstRenderTime:n.firstRenderTime,lastRenderTime:n.lastRenderTime,lastRenderCause:n.lastRenderCause?{type:n.lastRenderCause.type,componentCause:n.lastRenderCause.componentCause,changedKeys:n.lastRenderCause.changedKeys,hookChanges:n.lastRenderCause.hookChanges?.map(r=>({type:r.type,index:r.index,description:r.description}))}:null,renderHistory:n.renderHistory?.map(r=>({renderNumber:r.renderNumber,timestamp:r.timestamp,cause:{type:r.cause.type,componentCause:r.cause.componentCause,changedKeys:r.cause.changedKeys}}))}))};return JSON.stringify(t,null,2)}l(Tu,"generateRendersJson");try{Zh({isSupported:Tt.isSupported,start:Tt.startCapture,stop:Tt.stopCapture,startLiveHighlights:l(()=>{try{let e=E.isEnabled(),t=E.getHighlightsSuppressed();return E.enable(),()=>{try{e?t&&E.setHighlightsSuppressed(true):E.disable()}catch{}}}catch{return null}},"startLiveHighlights")})}catch{}var ep=l(e=>{let{RenderTracker:t}=(Ve(),Hu(va));return t.onRenderEvent(e)},"onRenderEvent");export{Ge as CAUSE_CONFIG,ln as COMPONENT_CAUSE_CONFIG,Tt as CommitProfiler,fi as HighlightFilterView,Rc as HighlightToolView,E as HighlightUpdatesController,ur as HighlightUpdatesModal,Cu as HighlightUpdatesOverlay,Qe as PerformanceLogger,qo as RenderCauseBadge,oi as RenderDetailView,Ti as RenderHistoryFooter,Ci as RenderHistoryViewer,Zs as RenderListItem,B as RenderTracker,xs as TwoLevelCauseBadge,Xe as VIEW_TYPE_MAP,Bl as capturePropsSnapshot,Vl as captureStateSnapshot,To as clearRenderCauseState,Pc as createHighlightUpdatesModalTool,kc as createHighlightUpdatesTool,$n as detectRenderCause,ci as detectedItemTestID,La as disableProfilerLogging,za as enableProfilerLogging,Tu as generateRendersJson,ga as getAllComponentNames,da as getAllNativeViewTypes,vn as getComponentDisplayName,ca as getNativeViewType,zl as getRenderCauseStats,Vh as highlightUpdatesModalPreset,Bh as highlightUpdatesPreset,qh as highlightUpdatesSyncAdapter,ht as identifierSlug,Or as installProfilerInterceptor,Io as isCapturingBuoyToolRenders,Na as isInterceptorInstalled,ua as isKnownViewType,Ba as isLoggingEnabled,ep as onRenderEvent,ui as patternChipTestID,Nl as removeRenderCauseState,si as renderRowTestID,Ee as safeCloneForHistory,Fl as setCaptureBuoyToolRenders,$r as setComparisonCallback,pt as settingTestID,_r as uninstallProfilerInterceptor};
35
+ `,w(p,{style:y.howItWorksBold,children:"Component:"})," React component name from fiber"]})})]})]}):w(mi,{children:M(h,{style:y.section,children:[M(te,{children:[w(te.Icon,{icon:Mg,color:D.color.textTertiary,size:12}),w(te.Title,{children:"SETTINGS"})]}),M(h,{style:y.settingsSection,children:[M(h,{style:y.settingItem,children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Show Render Count"}),w(Dt,{testID:pt("showRenderCount"),value:n.showRenderCount,onValueChange:x=>{o({showRenderCount:x}),!x&&n.trackRenderCauses&&o({trackRenderCauses:false})},trackColor:{false:D.color.surfaceElevated,true:D.color.accent+"80"},thumbColor:n.showRenderCount?D.color.accent:D.color.knob})]}),w(p,{style:y.settingDescription,children:"Display render count badge on highlights. Disabling improves performance by skipping count tracking."})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:[y.settingLabel,!n.showRenderCount&&y.settingLabelDisabled],children:"Track Render Causes"}),w(Dt,{testID:pt("trackRenderCauses"),value:n.trackRenderCauses,onValueChange:x=>o({trackRenderCauses:x}),trackColor:{false:D.color.surfaceElevated,true:D.color.warning+"80"},thumbColor:n.trackRenderCauses?D.color.warning:D.color.knob,disabled:!n.showRenderCount})]}),M(p,{style:y.settingDescription,children:["Detect WHY components render (props, hooks, parent re-render).",!n.showRenderCount&&M(p,{style:y.settingWarning,children:[`
36
+ `,'Requires "Show Render Count" to be enabled.']})]})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:[y.settingLabel,!n.trackRenderCauses&&y.settingLabelDisabled],children:"Enable Render History"}),w(Dt,{testID:pt("enableRenderHistory"),value:n.enableRenderHistory,onValueChange:x=>o({enableRenderHistory:x}),trackColor:{false:D.color.surfaceElevated,true:D.color.accent+"80"},thumbColor:n.enableRenderHistory?D.color.accent:D.color.knob,disabled:!n.trackRenderCauses})]}),M(p,{style:y.settingDescription,children:["Store render events for each component to view in the History tab.",!n.trackRenderCauses&&M(p,{style:y.settingWarning,children:[`
37
+ `,'Requires "Track Render Causes" to be enabled.']})]})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Debug Log Level"}),w(h,{style:y.settingValue,children:w(p,{testID:"buoy-highlight-setting-debugLogLevel-value",style:[y.settingValueText,n.debugLogLevel!=="off"&&{color:D.color.warning}],children:vi.find(x=>x.value===n.debugLogLevel)?.label||"Off"})})]}),w(p,{style:y.settingDescription,children:"Control console logging verbosity for render cause detection."}),w(h,{style:y.batchSizePresets,children:vi.map(x=>w(Y,{style:[y.batchSizePreset,n.debugLogLevel===x.value&&y.batchSizePresetActive,x.value!=="off"&&n.debugLogLevel===x.value&&{backgroundColor:D.color.warningSoft,borderColor:D.color.warning}],onPress:()=>o({debugLogLevel:x.value}),testID:`buoy-highlight-preset-log-${x.value}`,accessibilityRole:"button",accessibilityLabel:`Debug log level ${x.label}`,children:w(p,{style:[y.batchSizePresetText,n.debugLogLevel===x.value&&y.batchSizePresetTextActive,x.value!=="off"&&n.debugLogLevel===x.value&&{color:D.color.warning}],children:x.label})},x.value))}),M(p,{style:y.settingDescriptionMuted,children:[vi.find(x=>x.value===n.debugLogLevel)?.description,n.debugLogLevel!=="off"&&" \u2022 Check Metro console for logs"]})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Batch Size"}),w(h,{style:y.settingValue,children:w(p,{testID:"buoy-highlight-setting-batchSize-value",style:y.settingValueText,children:n.batchSize})})]}),w(p,{style:y.settingDescription,children:"Maximum components to highlight per render update. Higher values capture more re-renders but may impact performance on complex screens."}),w(h,{style:y.batchSizePresets,children:qg.map(x=>w(Y,{style:[y.batchSizePreset,n.batchSize===x.value&&y.batchSizePresetActive],onPress:()=>o({batchSize:x.value}),testID:`buoy-highlight-preset-batch-${x.value}`,accessibilityRole:"button",accessibilityLabel:`Batch size ${x.label}`,children:w(p,{style:[y.batchSizePresetText,n.batchSize===x.value&&y.batchSizePresetTextActive],children:x.label})},x.value))})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Show host views"}),w(Dt,{testID:pt("showHostViews"),value:!!n.showHostViews,onValueChange:x=>o({showHostViews:x}),trackColor:{false:D.color.surfaceElevated,true:D.color.accent+"80"},thumbColor:n.showHostViews?D.color.accent:D.color.knob})]}),w(p,{style:y.settingDescription,children:"Include anonymous View / RCTView / Text hosts. Off by default so the list is named composites (what actually re-rendered)."})]}),M(h,{style:[y.settingItem,y.settingItemSpaced],children:[M(h,{style:y.settingHeader,children:[w(p,{style:y.settingLabel,children:"Highlight Dev Tools"}),w(Dt,{testID:pt("excludeDevTools"),value:!n.excludeDevTools,onValueChange:x=>o({excludeDevTools:!x}),trackColor:{false:D.color.surfaceElevated,true:D.color.accent+"80"},thumbColor:n.excludeDevTools?D.color.knob:D.color.accent})]}),M(p,{style:y.settingDescription,children:["Show re-render highlights on Buoy dev tools (floating menu, modals, etc.). Useful for optimizing the dev tools themselves.",!n.excludeDevTools&&M(p,{style:y.settingWarning,children:[`
38
+ `,"The highlight overlay is always excluded to prevent infinite loops."]})]})]})]})]})})})})}l(Ci,"HighlightFilterView");var y=ve.create({container:{flex:1,backgroundColor:"transparent"},scrollView:{flex:1},scrollContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:32},section:{backgroundColor:D.color.surface,borderRadius:8,borderWidth:1,borderColor:D.color.border,marginBottom:12,overflow:"hidden"},sectionDescription:{fontSize:11,color:D.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:16},patternChips:{flexDirection:"row",flexWrap:"wrap",gap:8,paddingHorizontal:16,paddingTop:12},patternChip:{flexDirection:"row",alignItems:"center",backgroundColor:D.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:4,paddingLeft:4,paddingRight:6,maxWidth:"100%",gap:4},patternChipBadge:{paddingVertical:2,paddingHorizontal:5,borderRadius:4},patternChipBadgeText:{fontSize:9,fontWeight:"700"},patternChipValue:{fontSize:11,color:D.color.text,fontFamily:At,flexShrink:1},patternChipX:{marginLeft:2},addPatternRow:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},addButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderStyle:"dashed",gap:6},addButtonText:{fontSize:12,fontWeight:"500"},typePicker:{flexDirection:"row",alignItems:"center",gap:8},typePickerRow:{flex:1,flexDirection:"row",flexWrap:"wrap",gap:8},typeOption:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,borderWidth:1,backgroundColor:D.color.surfaceElevated,gap:6},typeOptionText:{fontSize:11,fontWeight:"600"},typePickerCancel:{padding:8},patternInputContainer:{flexDirection:"row",alignItems:"center",backgroundColor:D.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:D.color.border,paddingLeft:4,paddingRight:8,paddingVertical:4,gap:4},patternInput:{flex:1,fontSize:12,color:D.color.text,paddingVertical:6,paddingHorizontal:4},addPatternButton:{paddingVertical:6,paddingHorizontal:10,borderRadius:4},addPatternButtonText:{fontSize:11,fontWeight:"600"},cancelButton:{padding:4},categoryBadgeScroll:{marginTop:12},categoryBadgeScrollContent:{paddingHorizontal:16,gap:8},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,borderWidth:1,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCountBubble:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCount:{fontSize:10,fontWeight:"600"},detectedItemsContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},detectedItemsScroll:{maxHeight:200},detectedItems:{flexDirection:"row",flexWrap:"wrap",gap:8},detectedItem:{flexDirection:"row",alignItems:"center",backgroundColor:D.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:6,paddingHorizontal:10,gap:6},detectedItemText:{fontSize:11,color:D.color.text,fontFamily:At},emptyText:{fontSize:11,color:D.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:16,paddingHorizontal:16},howItWorks:{paddingHorizontal:16,paddingVertical:12},howItWorksText:{fontSize:11,color:D.color.textTertiary,lineHeight:18,fontFamily:At},howItWorksBold:{fontWeight:"700",color:D.color.textSecondary},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:32},actionPopup:{backgroundColor:D.color.surface,borderRadius:12,borderWidth:1,borderColor:D.color.border,width:"100%",maxWidth:300,overflow:"hidden"},actionPopupHeader:{padding:16,borderBottomWidth:1,borderBottomColor:D.color.separator,alignItems:"center"},actionPopupButtons:{flexDirection:"row",padding:12,gap:8},actionPopupButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:12,borderRadius:8,gap:8},actionPopupInclude:{backgroundColor:D.color.accentSoft},actionPopupExclude:{backgroundColor:D.color.accentSoft},actionPopupButtonText:{fontSize:13,fontWeight:"600"},actionPopupCancel:{padding:12,borderTopWidth:1,borderTopColor:D.color.separator,alignItems:"center"},actionPopupCancelText:{fontSize:13,color:D.color.textTertiary,fontWeight:"500"},settingsSection:{paddingHorizontal:16,paddingTop:8,paddingBottom:16},settingItem:{gap:8},settingItemSpaced:{marginTop:16,paddingTop:16,borderTopWidth:1,borderTopColor:D.color.separator},settingHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},settingLabel:{fontSize:13,fontWeight:"600",color:D.color.text},settingValue:{backgroundColor:D.color.fillSecondary,paddingHorizontal:10,paddingVertical:4,borderRadius:6},settingValueText:{fontSize:12,fontWeight:"700",color:D.color.textTertiary,fontFamily:At},settingDescription:{fontSize:11,color:D.color.textSecondary,lineHeight:16},settingDescriptionMuted:{fontSize:10,color:D.color.textTertiary,lineHeight:14,marginTop:4,fontStyle:"italic"},settingLabelDisabled:{color:D.color.textTertiary},settingWarning:{color:D.color.warning,fontWeight:"500"},batchSizePresets:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:4},batchSizePreset:{paddingVertical:8,paddingHorizontal:14,borderRadius:6,backgroundColor:D.color.surfaceElevated,borderWidth:1,borderColor:D.color.border},batchSizePresetActive:{backgroundColor:D.color.fillSecondary,borderColor:D.color.fillTertiary},batchSizePresetText:{fontSize:12,fontWeight:"500",color:D.color.textSecondary,fontFamily:At},batchSizePresetTextActive:{color:D.color.textTertiary,fontWeight:"700"},renderCountRangeContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,gap:12},renderCountInputRow:{flexDirection:"row",alignItems:"center",gap:12},renderCountInputGroup:{flex:1,gap:4},renderCountLabel:{fontSize:10,fontWeight:"600",color:D.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},renderCountInput:{backgroundColor:D.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:D.color.border,paddingVertical:10,paddingHorizontal:12,fontSize:14,fontWeight:"600",color:D.color.text,fontFamily:At,textAlign:"center"},renderCountSeparator:{fontSize:12,color:D.color.textTertiary,marginTop:18},clearRangeButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,backgroundColor:D.color.warningSoft,borderWidth:1,borderColor:D.color.warning+"40",gap:6,alignSelf:"center"},clearRangeButtonText:{fontSize:11,fontWeight:"600",color:D.color.warning}});U();import{useState as Jg,useEffect as cc,useRef as Yg,useCallback as Ti,memo as Xg,useMemo as uc}from"react";Ve();U();import Qg,{useMemo as dc}from"react";import{ChevronRight as Zg,night as ft,useRelativeTime as eh,monoFont as gc}from"@buoy-gg/shared-ui/web";import{jsx as Ne,jsxs as Ft}from"react/jsx-runtime";function hc({render:e,onPress:t}){let n=dc(()=>e.testID?{type:"testID",value:e.testID}:e.nativeID?{type:"nativeID",value:e.nativeID}:e.componentName?{type:"component",value:e.componentName}:e.accessibilityLabel?{type:"accessibilityLabel",value:e.accessibilityLabel}:{type:"nativeTag",value:String(e.nativeTag)},[e.testID,e.nativeID,e.componentName,e.accessibilityLabel,e.nativeTag]),o=dc(()=>e.accessibilityLabel&&n.type!=="accessibilityLabel"?{type:"accessibilityLabel",value:e.accessibilityLabel}:null,[e.accessibilityLabel,n.type]),r=eh(e.lastRenderTime),i=gi(n.value);return Ft(Y,{testID:i,accessibilityRole:"button",accessibilityLabel:`${e.displayName}, ${n.type} ${n.value}, ${e.renderCount} renders`,style:xe.container,onPress:()=>t(e),activeOpacity:.7,children:[Ne(h,{style:[xe.colorIndicator,{backgroundColor:e.color}]}),Ft(h,{style:xe.content,children:[Ft(h,{style:xe.topRow,children:[Ft(h,{style:xe.viewTypeContainer,children:[Ne(p,{testID:`${i}-name`,style:xe.viewType,numberOfLines:1,children:e.displayName}),o?Ne(Et,{type:o.type,value:o.value,compact:true,shortLabel:true}):e.displayName!==e.viewType?Ne(p,{testID:`${i}-type`,style:xe.nativeType,numberOfLines:1,children:e.viewType}):null]}),Ne(h,{style:[xe.renderCountBadge,{backgroundColor:e.color+"30"}],children:Ft(p,{testID:`${i}-count`,style:[xe.renderCount,{color:e.color}],children:[e.renderCount,"x"]})})]}),e.lastRenderCause&&Ne(h,{style:xe.causeRow,children:Ne(Qr,{testID:`${i}-cause`,cause:e.lastRenderCause,compact:true,showKeys:true,showTwoLevel:true})}),Ft(h,{style:xe.bottomRow,children:[Ne(h,{style:xe.identifierContainer,children:Ne(Et,{testID:`${i}-identifier`,type:n.type,value:n.value,compact:true,shortLabel:true})}),Ne(p,{testID:`${i}-time`,style:xe.timing,children:r})]})]}),Ne(Zg,{size:16,color:ft.color.textTertiary})]})}l(hc,"RenderListItemInner");var pc=Qg.memo(hc,(e,t)=>{let n=e.render,o=t.render;return n.id===o.id&&n.renderCount===o.renderCount&&n.color===o.color&&n.lastRenderTime===o.lastRenderTime&&n.lastRenderCause?.type===o.lastRenderCause?.type&&n.lastRenderCause?.componentCause===o.lastRenderCause?.componentCause&&e.onPress===t.onPress}),xe=ve.create({container:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,marginHorizontal:12,marginBottom:6,backgroundColor:ft.color.surface,borderRadius:8,borderWidth:1,borderColor:ft.color.border},colorIndicator:{width:4,height:36,borderRadius:2,marginRight:10},content:{flex:1,marginRight:8},topRow:{flexDirection:"row",alignItems:"center",marginBottom:4},causeRow:{marginBottom:4},viewTypeContainer:{flex:1,marginRight:8},viewType:{fontSize:13,fontWeight:"600",color:ft.color.text},nativeType:{fontSize:10,color:ft.color.textTertiary,fontFamily:gc,marginTop:1},accessibilityLabel:{fontSize:10,color:ft.color.accent,fontStyle:"italic",marginTop:1},renderCountBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:10},renderCount:{fontSize:11,fontWeight:"700",fontFamily:gc},bottomRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},identifierContainer:{flex:1,flexShrink:1,overflow:"hidden"},timing:{fontSize:10,color:ft.color.textTertiary,fontWeight:"500",flexShrink:0}});import{Lock as th,night as wi,useLimit as nh,ToolEmptyState as oh,resolveListEmptyState as rh}from"@buoy-gg/shared-ui/web";import{jsx as un,jsxs as mc}from"react/jsx-runtime";function fc({searchText:e,filters:t,onSelectRender:n,onStatsChange:o,onRendersChange:r,isTracking:i,isPro:s=false}){let[a,c]=Jg(()=>B.getFilteredRenders(e)),u=Yg(null);cc(()=>B.subscribe(()=>{let v=B.getFilteredRenders(e);c(v),o(B.getStats()),r?.(v)}),[e,o,r]),cc(()=>{let v=B.getFilteredRenders(e);c(v),r?.(v)},[e,t,r]);let d=nh("highlightUpdates.components"),g=s?1/0:d,T=uc(()=>a.slice(0,g),[a,g]),f=uc(()=>Math.max(0,a.length-g),[a.length,g]),b=Ti(v=>v.id,[]),m=Ti(({item:v,index:L})=>un(pc,{render:v,onPress:()=>n(v,L,T)}),[n,T]),S=Ti(()=>f<=0?null:mc(h,{testID:"buoy-highlight-locked",style:ao.lockedBanner,children:[un(th,{size:14,color:wi.color.warning}),mc(p,{testID:"buoy-highlight-locked-text",style:ao.lockedBannerText,children:[f," more ",f===1?"component":"components"," locked"]}),un(p,{style:ao.lockedBannerSubtext,children:"Upgrade to Pro"})]}),[f]);if(a.length===0){let v=e.trim(),L=B.getStats().totalComponents,P=v?B.getFilteredRenders("").length:0,C=rh({subject:"components",verb:"tracked",search:e,total:v?P:L,capturing:i,blocked:v&&P===0&&L>0?"The active filters hide everything tracked, so there is nothing to search.":void 0,waiting:{otto:"stare",title:"No renders tracked",message:"Component renders will appear here"},paused:{title:"No renders tracked",message:"Enable tracking to start capturing"}});return un(oh,{...C,testID:"buoy-highlight-empty"})}return un($a,{testID:"buoy-highlight-list",ref:u,data:T,renderItem:m,keyExtractor:b,contentContainerStyle:ao.listContent,showsVerticalScrollIndicator:true,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,ListFooterComponent:S})}l(fc,"IsolatedRenderListInner");var ih=Xg(fc),ao=ve.create({listContent:{paddingTop:8},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:16,marginTop:8,gap:8},lockedBannerText:{color:wi.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:wi.color.textTertiary,fontSize:12}});U();import{memo as Mt}from"react";import{Trash2 as ah,Search as lh,Filter as sh,Pause as ch,Copy as uh,ModalHeader as ge,TabSelector as yc,night as he,PowerToggleButton as dh}from"@buoy-gg/shared-ui/web";U();import{useState as gh,useEffect as hh,memo as ph}from"react";Ve();import{Activity as mh,night as lo,monoFont as fh}from"@buoy-gg/shared-ui/web";import{jsx as bc,jsxs as yh}from"react/jsx-runtime";function vc(){let[e,t]=gh({totalComponents:0,totalRenders:0});return hh(()=>B.subscribe(()=>{t(B.getStats())}),[]),yh(h,{nativeID:"__rn_buoy__stats-row",testID:"buoy-highlight-stats",accessibilityLabel:`${e.totalComponents} components tracked`,style:Cc.headerChip,children:[bc(mh,{size:12,color:lo.color.accent}),bc(p,{testID:"buoy-highlight-stats-value",style:[Cc.headerChipValue,{color:lo.color.accent}],children:e.totalComponents})]})}l(vc,"StatsDisplayInner");var bh=ph(vc),Cc=ve.create({headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:lo.color.buttonSurface,paddingHorizontal:8,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:lo.color.border},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:fh}});import{jsx as Q,jsxs as dn}from"react/jsx-runtime";var vh=Mt(l(function({isActive:e,searchText:t,onSearchChange:n,onSearchClose:o}){return e?Q(ge.Search,{value:t,onChangeText:n,onCancel:()=>{n(""),o()},onDismiss:o,dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search testID, nativeID, component...",accessibilityLabel:"Search renders",iconSize:14,testID:"buoy-highlight-search-field",containerTestID:"buoy-highlight-search-container",containerNativeID:"__rn_buoy__search-container",clearTestID:"buoy-highlight-search-clear"}):null},"SearchSection")),Ch=vh,Th=Mt(l(function({onSearchToggle:e,onFilterToggle:t,onToggleTracking:n,onToggleFreeze:o,onClear:r,onOpenCopySettings:i,isTracking:s,isFrozen:a,activeFilterCount:c,hasRenders:u}){return dn(ge.Actions,{children:[Q(Y,{testID:"buoy-highlight-search",accessibilityRole:"button",accessibilityLabel:"Search renders",onPress:e,style:Be.headerActionButton,children:Q(lh,{size:14,color:he.color.textSecondary})}),Q(Y,{testID:"buoy-highlight-filters",accessibilityRole:"button",accessibilityLabel:c>0?`Filters, ${c} active`:"Filters",onPress:t,style:[Be.headerActionButton,c>0&&Be.activeFilterButton],children:Q(sh,{size:14,color:c>0?he.color.accent:he.color.textTertiary})}),Q(Y,{testID:"buoy-highlight-copy",accessibilityRole:"button",onPress:i,style:[Be.headerActionButton,!u&&Be.headerActionButtonDisabled],disabled:!u,accessibilityLabel:"Open copy settings",children:Q(uh,{size:14,color:u?he.color.textSecondary:he.color.textTertiary})}),Q(Y,{testID:"buoy-highlight-freeze",accessibilityRole:"button",accessibilityLabel:a?"Unfreeze frame":"Freeze frame",onPress:o,style:[Be.headerActionButton,a&&Be.freezeButton,!s&&Be.headerActionButtonDisabled],disabled:!s,children:Q(ch,{size:14,color:s?a?he.color.accent:he.color.textTertiary:he.color.textTertiary})}),Q(dh,{testID:"buoy-highlight-power",isEnabled:s,onToggle:n,accessibilityLabel:"Toggle render tracking"}),Q(Y,{testID:"buoy-highlight-clear",accessibilityRole:"button",accessibilityLabel:"Clear tracked renders",onPress:r,style:[Be.headerActionButton,!u&&Be.headerActionButtonDisabled],disabled:!u,children:Q(ah,{size:14,color:u?he.color.textTertiary:he.color.textTertiary})})]})},"HeaderActions")),wh=Th,Sh=Mt(l(function({onBack:e,isSearchActive:t,searchText:n,onSearchChange:o,onSearchToggle:r,onSearchClose:i,onFilterToggle:s,onToggleTracking:a,onToggleFreeze:c,onClear:u,onOpenCopySettings:d,isTracking:g,isFrozen:T,activeFilterCount:f,hasRenders:b,searchInputRef:m}){return dn(ge,{children:[e&&Q(ge.Navigation,{onBack:e}),Q(ge.Content,{title:"",children:t?Q(Ch,{isActive:t,searchText:n,onSearchChange:o,onSearchClose:i,searchInputRef:m}):Q(bh,{})}),Q(wh,{onSearchToggle:r,onFilterToggle:s,onToggleTracking:a,onToggleFreeze:c,onClear:u,onOpenCopySettings:d,isTracking:g,isFrozen:T,activeFilterCount:f,hasRenders:b})]})},"MainListHeader")),xh=Mt(l(function({onBack:e,activeTab:t,onTabChange:n,activeFilterCount:o=0}){let r=[{key:"filters",label:`Filters${o>0?` (${o})`:""}`},{key:"settings",label:"Settings"}];return dn(ge,{children:[Q(ge.Navigation,{onBack:e}),Q(ge.Content,{title:"",noMargin:true,children:Q(yc,{tabs:r,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-filter-tab"})}),Q(ge.Actions,{})]})},"FilterViewHeader")),Ih=Mt(l(function({onBack:e,activeTab:t,onTabChange:n,hasHistory:o=true}){let r=[{key:"details",label:"Details"},{key:"history",label:"History",disabled:!o}];return dn(ge,{children:[Q(ge.Navigation,{onBack:e}),Q(ge.Content,{title:"",noMargin:true,children:Q(yc,{tabs:r,activeTab:t,onTabChange:i=>n(i),testIDPrefix:"buoy-highlight-detail-tab"})}),Q(ge.Actions,{})]})},"DetailViewHeader")),Dh=Mt(l(function({onBack:e}){return dn(ge,{children:[Q(ge.Navigation,{onBack:e}),Q(ge.Content,{title:"Copy Settings",testID:"buoy-highlight-copy-title"})]})},"CopySettingsViewHeader")),Be=ve.create({headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:he.color.buttonSurface,borderWidth:1,borderColor:he.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},activeFilterButton:{backgroundColor:he.color.accentSoft,borderColor:he.color.accentBorderStrong},freezeButton:{backgroundColor:he.color.accentSoft,borderColor:he.color.accentBorderStrong}});U();import{useState as Si,useCallback as so,useMemo as gn}from"react";Ve();import{Clock as Rh,GitBranch as kh,Database as Tc,Lock as Ph,formatRelativeTime as wc,SectionHeader as $t,EventStepperFooter as Sc,buoyColors as xc,night as H,useLimit as Ic,ToolEmptyState as Nh,monoFont as Ke}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as Dc}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Lh,jsx as F,jsxs as q}from"react/jsx-runtime";function co(e){let t=new Date(e),n=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),r=t.getSeconds().toString().padStart(2,"0"),i=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${o}:${r}.${i}`}l(co,"formatTimeWithMs");function xi({render:e,disableInternalFooter:t=false,selectedEventIndex:n,onEventIndexChange:o,isPro:r=false}){let[i,s]=Si(0),a=n??i,c=o??s,[u,d]=Si("current"),g=gn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((I,R)=>I.timestamp-R.timestamp),[e.renderHistory]),T=Ic("highlightUpdates.historyEvents"),f=r?1/0:T,b=gn(()=>g.slice(-f),[g,f]),m=gn(()=>Math.max(0,g.length-f),[g.length,f]),S=b.length,v=b[a],L=a>0?b[a-1]:null,P=so(()=>{a>0&&c(a-1)},[a,c]),C=so(()=>{a<S-1&&c(a+1)},[a,S,c]);if(S===0){let I=B.getSettings().enableRenderHistory;return F(Nh,{testID:"buoy-highlight-history-empty",otto:I?"stare":"paused",title:"No Render History",message:I?"History is on and armed \u2014 this component has not re-rendered since. Interact with the app to record one.":"Enable render history tracking in settings to see render events here."})}return q(Lh,{children:[q(h,{style:[k.container,{paddingBottom:!t&&S>1?80:0}],children:[m>0&&q(h,{testID:"buoy-highlight-history-locked",style:k.lockedBanner,children:[F(Ph,{size:14,color:H.color.warning}),q(p,{testID:"buoy-highlight-history-locked-text",style:k.lockedBannerText,children:[m," older ",m===1?"render":"renders"," locked"]}),F(p,{style:k.lockedBannerSubtext,children:"Upgrade to Pro"})]}),q(h,{style:k.viewToggleContainer,children:[q(Y,{testID:"buoy-highlight-history-mode-current",accessibilityRole:"button",accessibilityLabel:"Current state",style:[k.viewToggleCard,u==="current"&&k.viewToggleCardActive],onPress:()=>d("current"),activeOpacity:.8,children:[q(h,{style:k.viewToggleContent,children:[F(Tc,{size:16,color:u==="current"?H.color.accent:H.color.textSecondary}),F(p,{style:[k.viewToggleLabel,u==="current"&&k.viewToggleLabelActive],children:"CURRENT STATE"})]}),q(p,{style:[k.viewToggleDescription,u==="current"&&{color:H.color.text}],children:["View render #",v?.renderNumber??0," details"]})]}),q(h,{testID:"buoy-highlight-history-mode-diff",accessibilityLabel:"Diff view, coming soon",style:[k.viewToggleCard,k.viewToggleCardDisabled],children:[q(h,{style:k.viewToggleContent,children:[F(kh,{size:16,color:H.color.textTertiary}),F(p,{style:[k.viewToggleLabel,k.viewToggleLabelDisabled],children:"DIFF VIEW"}),F(h,{style:k.todoBadge,children:F(p,{style:k.todoBadgeText,children:"TODO"})})]}),F(p,{style:[k.viewToggleDescription,{color:H.color.textTertiary}],children:"Compare renders side by side (coming soon)"})]})]}),F(Me,{testID:"buoy-highlight-history-scroll",style:k.contentScroll,contentContainerStyle:k.contentContainer,showsVerticalScrollIndicator:false,children:u==="current"?F(Rc,{event:v,render:e}):F(kc,{previousEvent:L,currentEvent:v,render:e})})]}),!t&&F(Sc,{currentIndex:a,totalItems:S,onPrevious:P,onNext:C,itemLabel:"Render",subtitle:wc(new Date(v?.timestamp??Date.now()))})]})}l(xi,"RenderHistoryViewer");function Rc({event:e,render:t}){if(!e)return F(h,{testID:"buoy-highlight-history-no-event",style:k.noEventContainer,children:F(p,{style:k.noEventText,children:"No event selected"})});let n=Ge[e.cause.type];return q(h,{style:k.currentStateContainer,children:[q(h,{style:k.eventHeader,children:[q(h,{style:k.eventHeaderLeft,children:[q(p,{testID:"buoy-highlight-history-event-title",style:k.eventTitle,children:["Render #",e.renderNumber]}),F(p,{testID:"buoy-highlight-history-event-time",style:k.eventTime,children:co(e.timestamp)})]}),q(h,{style:[k.eventBadge,{backgroundColor:t.color+"30"}],children:[F(h,{style:[k.eventBadgeDot,{backgroundColor:t.color}]}),F(p,{testID:"buoy-highlight-history-event-cause",style:[k.eventBadgeText,{color:t.color}],children:e.cause.type.toUpperCase()})]})]}),q(h,{style:k.section,children:[q($t,{children:[F($t.Icon,{icon:Rh,color:n.color,size:12}),F($t.Title,{children:"WHY DID THIS RENDER?"})]}),F(h,{style:k.sectionContent,children:F(Zr,{cause:e.cause,nativeType:t.viewType})})]}),e.capturedProps&&Object.keys(e.capturedProps).length>0&&q(h,{style:k.section,children:[q($t,{children:[F($t.Icon,{icon:Tc,color:H.color.accent,size:12}),F($t.Title,{children:"CAPTURED PROPS"})]}),F(h,{style:k.sectionContent,children:F(Me,{horizontal:true,showsHorizontalScrollIndicator:false,style:k.propsScrollView,children:F(p,{testID:"buoy-highlight-history-props",style:k.propsJson,children:JSON.stringify(e.capturedProps,null,2)})})})]})]})}l(Rc,"CurrentStateView");function kc({previousEvent:e,currentEvent:t,render:n}){let[o,r]=Si("props");if(!e||!t)return F(h,{style:k.noEventContainer,children:F(p,{style:k.noEventText,children:"Select an event with a previous event to compare"})});let i=Ge[e.cause.type],s=Ge[t.cause.type],a=e.capturedProps&&t.capturedProps,c=e.capturedState&&t.capturedState;return q(h,{style:k.diffContainer,children:[q(h,{style:k.compareBar,children:[q(h,{style:k.compareSide,children:[q(h,{style:k.compareLabelRow,children:[F(p,{style:[k.compareLabel,{color:xc.warning}],children:"PREV"}),F(h,{style:[k.compareActionBadge,{backgroundColor:`${i.color}20`}],children:F(p,{style:[k.compareActionText,{color:i.color}],children:e.cause.type.toUpperCase()})})]}),q(h,{style:k.compareMeta,children:[q(p,{style:k.compareIndex,children:["#",e.renderNumber]}),F(p,{style:k.compareTime,children:co(e.timestamp)})]})]}),F(h,{style:k.compareDivider,children:F(p,{style:k.compareArrow,children:"\u2192"})}),q(h,{style:k.compareSide,children:[q(h,{style:k.compareLabelRow,children:[F(p,{style:[k.compareLabel,{color:xc.success}],children:"CUR"}),F(h,{style:[k.compareActionBadge,{backgroundColor:`${s.color}20`}],children:F(p,{style:[k.compareActionText,{color:s.color}],children:t.cause.type.toUpperCase()})})]}),q(h,{style:k.compareMeta,children:[q(p,{style:k.compareIndex,children:["#",t.renderNumber]}),F(p,{style:k.compareTime,children:co(t.timestamp)})]})]})]}),q(h,{style:k.diffModeTabs,children:[F(Y,{style:[k.diffModeTab,o==="cause"&&k.diffModeTabActive],onPress:()=>r("cause"),activeOpacity:.7,children:F(p,{style:[k.diffModeTabText,o==="cause"&&k.diffModeTabTextActive],children:"CAUSE"})}),F(Y,{style:[k.diffModeTab,o==="props"&&k.diffModeTabActive,!a&&k.diffModeTabDisabled],onPress:()=>a&&r("props"),activeOpacity:a?.7:1,children:F(p,{style:[k.diffModeTabText,o==="props"&&k.diffModeTabTextActive,!a&&k.diffModeTabTextDisabled],children:"PROPS"})}),F(Y,{style:[k.diffModeTab,o==="state"&&k.diffModeTabActive,!c&&k.diffModeTabDisabled],onPress:()=>c&&r("state"),activeOpacity:c?.7:1,children:F(p,{style:[k.diffModeTabText,o==="state"&&k.diffModeTabTextActive,!c&&k.diffModeTabTextDisabled],children:"STATE"})})]}),o==="cause"&&F(h,{style:k.diffSummary,children:F(Zr,{cause:t.cause,nativeType:n.viewType})}),o==="props"&&F(h,{style:k.treeDiffContainer,children:a?F(Dc,{oldValue:e.capturedProps,newValue:t.capturedProps,theme:"dark",showUnchanged:true}):q(h,{style:k.noDiffData,children:[F(p,{style:k.noDiffDataTitle,children:"Props Not Captured"}),F(p,{style:k.noDiffDataText,children:'Enable "Capture Props on Render" in settings to see props diff.'})]})}),o==="state"&&F(h,{style:k.treeDiffContainer,children:c?F(Dc,{oldValue:e.capturedState,newValue:t.capturedState,theme:"dark",showUnchanged:true}):q(h,{style:k.noDiffData,children:[F(p,{style:k.noDiffDataTitle,children:"State Not Captured"}),F(p,{style:k.noDiffDataText,children:'Enable "Capture State on Render" in settings to see state diff.'})]})})]})}l(kc,"DiffView");function Ii({render:e,selectedEventIndex:t=0,onEventIndexChange:n=l(()=>{},"onEventIndexChange"),isPro:o=false}){let r=gn(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((T,f)=>T.timestamp-f.timestamp),[e.renderHistory]),i=Ic("highlightUpdates.historyEvents"),s=o?1/0:i,a=gn(()=>r.slice(-s),[r,s]),c=a.length,u=a[t],d=so(()=>{n(Math.max(0,t-1))},[t,n]),g=so(()=>{n(Math.min(c-1,t+1))},[t,c,n]);return c<=1?null:F(Sc,{currentIndex:t,totalItems:c,onPrevious:d,onNext:g,itemLabel:"Render",subtitle:u?wc(new Date(u.timestamp)):void 0})}l(Ii,"RenderHistoryFooter");var k=ve.create({container:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:32,gap:12},emptyTitle:{fontSize:16,fontWeight:"600",color:H.color.text},emptyText:{fontSize:13,color:H.color.textSecondary,textAlign:"center",lineHeight:18},viewToggleContainer:{flexDirection:"row",padding:12,gap:8},viewToggleCard:{flex:1,backgroundColor:H.color.surface,borderRadius:8,borderWidth:1,borderColor:H.color.border,padding:10,gap:4},viewToggleCardActive:{borderColor:H.color.accentBorderStrong,backgroundColor:H.color.accentSoft},viewToggleCardDisabled:{opacity:.5},todoBadge:{backgroundColor:H.color.fillSecondary,paddingHorizontal:6,paddingVertical:2,borderRadius:4,marginLeft:4},todoBadgeText:{fontSize:9,fontWeight:"700",color:H.color.textTertiary,letterSpacing:.3},viewToggleContent:{flexDirection:"row",alignItems:"center",gap:6},viewToggleLabel:{fontSize:10,fontWeight:"700",color:H.color.textSecondary,letterSpacing:.5},viewToggleLabelActive:{color:H.color.accent},viewToggleLabelDisabled:{color:H.color.textTertiary},viewToggleDescription:{fontSize:11,color:H.color.textTertiary,marginTop:2},contentScroll:{flex:1},contentContainer:{padding:12,paddingTop:0},noEventContainer:{padding:24,alignItems:"center"},noEventText:{fontSize:13,color:H.color.textTertiary},currentStateContainer:{gap:12},eventHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:H.color.surface,borderRadius:8,borderWidth:1,borderColor:H.color.border,padding:12},eventHeaderLeft:{gap:2},eventTitle:{fontSize:15,fontWeight:"700",color:H.color.text},eventTime:{fontSize:11,color:H.color.textTertiary,fontFamily:Ke},eventBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4,borderRadius:12,gap:6},eventBadgeDot:{width:6,height:6,borderRadius:3},eventBadgeText:{fontSize:10,fontWeight:"700",fontFamily:Ke},section:{backgroundColor:H.color.surface,borderRadius:8,borderWidth:1,borderColor:H.color.border,overflow:"hidden"},sectionContent:{padding:12,paddingTop:8},causeContainer:{marginBottom:12},changedList:{marginBottom:12,paddingLeft:4},changedListTitle:{fontSize:11,fontWeight:"600",color:H.color.textSecondary,marginBottom:6},changedItem:{fontSize:12,color:H.color.text,fontFamily:Ke,marginBottom:3,paddingLeft:8},propsScrollView:{maxHeight:150},propsJson:{fontSize:11,fontFamily:Ke,color:H.color.text,backgroundColor:H.color.bg,padding:10,borderRadius:6},diffContainer:{gap:12},compareBar:{flexDirection:"row",backgroundColor:H.color.surface,borderRadius:8,borderWidth:1,borderColor:H.color.border,padding:10},compareSide:{flex:1,gap:4},compareLabelRow:{flexDirection:"row",alignItems:"center",gap:8},compareLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5},compareActionBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},compareActionText:{fontSize:9,fontWeight:"600"},compareMeta:{flexDirection:"row",alignItems:"center",gap:6},compareIndex:{fontSize:12,fontWeight:"600",color:H.color.text},compareTime:{fontSize:10,color:H.color.textTertiary,fontFamily:Ke},compareDivider:{width:30,alignItems:"center",justifyContent:"center"},compareArrow:{fontSize:16,color:H.color.textTertiary},diffSummary:{backgroundColor:H.color.surface,borderRadius:8,borderWidth:1,borderColor:H.color.border,padding:12},diffSummaryTitle:{fontSize:11,fontWeight:"600",color:H.color.textSecondary,marginBottom:8},diffChanges:{gap:4},diffChangeItem:{flexDirection:"row",alignItems:"center",gap:6},diffChangeIcon:{fontSize:12,fontWeight:"700",color:H.color.warning,fontFamily:Ke},diffChangeKey:{fontSize:12,color:H.color.text,fontFamily:Ke},diffNoChanges:{fontSize:12,color:H.color.textTertiary,fontStyle:"italic"},diffPlaceholder:{fontSize:12,color:H.color.textTertiary,fontStyle:"italic",textAlign:"center",padding:16},diffModeTabs:{flexDirection:"row",backgroundColor:H.color.surface,borderRadius:8,borderWidth:1,borderColor:H.color.border,padding:4,gap:4},diffModeTab:{flex:1,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center"},diffModeTabActive:{backgroundColor:H.color.accentSoft},diffModeTabDisabled:{opacity:.4},diffModeTabText:{fontSize:10,fontWeight:"600",color:H.color.textSecondary,letterSpacing:.5},diffModeTabTextActive:{color:H.color.accent},diffModeTabTextDisabled:{color:H.color.textTertiary},causeDiffContainer:{gap:8,marginBottom:12},causeDiffRow:{flexDirection:"row",alignItems:"center",gap:8},causeDiffLabel:{fontSize:11,fontWeight:"600",color:H.color.textSecondary,minWidth:80},causeDiffValue:{fontSize:12,color:H.color.text,fontFamily:Ke,fontWeight:"500"},diffChangesTitle:{fontSize:11,fontWeight:"600",color:H.color.textSecondary,marginBottom:6},treeDiffContainer:{backgroundColor:H.color.surface,borderRadius:8,borderWidth:1,borderColor:H.color.border,overflow:"hidden",minHeight:150},noDiffData:{padding:24,alignItems:"center",gap:8},noDiffDataTitle:{fontSize:13,fontWeight:"600",color:H.color.text},noDiffDataText:{fontSize:12,color:H.color.textTertiary,textAlign:"center",lineHeight:18},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,marginHorizontal:12,marginTop:8,backgroundColor:H.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:H.color.warning+"30",gap:8},lockedBannerText:{color:H.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:H.color.textTertiary,fontSize:12}});U();import{useCallback as Ot,useEffect as zh,useMemo as uo,useState as Pc}from"react";import{DynamicFilterView as Bh,macOSColors as Di,night as Ri,FileText as Nc,FileCode as Lc,Zap as zc,Settings as Vh,Eye as Ah,Layers as Hh,ToolbarCopyButton as Eh,ExportPreview as Fh,monoFont as Mh}from"@buoy-gg/shared-ui/web";U();var ki={format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},Bc={llm:{format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},table:{format:"markdown-table",topN:50,minRenders:2,filterCauses:[],groupByName:true,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},json:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:true,sortBy:"renderCount",includeHistory:false},full:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:false,aggregateCauses:false,sortBy:"renderCount",includeHistory:true}};function Vc(e){for(let[t,n]of Object.entries(Bc))if(Object.keys(n).every(o=>{let r=e[o],i=n[o];return Array.isArray(r)&&Array.isArray(i)?r.length===i.length&&r.every((s,a)=>s===i[a]):r===i}))return t;return null}l(Vc,"detectActivePreset");var Re={llm:{label:"LLM",description:"Compact summary for AI",color:"#10B981"},table:{label:"Table",description:"Markdown table",color:"#3B82F6"},json:{label:"JSON",description:"Structured data",color:"#F59E0B"},full:{label:"Full",description:"Everything incl. history",color:"#6B7280"}};U();import{definePersistedSetting as $h,devToolsStorageKeys as Oh}from"@buoy-gg/shared-ui/web";var Ac=$h(Oh.highlightUpdates.copySettings(),ki,{sanitize:l((e,t)=>({...e,filterCauses:t?.filterCauses??ki.filterCauses}),"sanitize")});async function Hc(e){await Ac.save(e)}l(Hc,"saveCopySettings");async function Ec(){return Ac.loadOrNull()}l(Ec,"loadCopySettings");import{Fragment as _h,jsx as _t,jsxs as Wh}from"react/jsx-runtime";var Uh=50*1024,jh=200*1024,Gh=[{value:"mount",label:"Mount"},{value:"props",label:"Props"},{value:"hooks",label:"Hooks"},{value:"state",label:"State"},{value:"parent",label:"Parent"},{value:"context",label:"Context"},{value:"unknown",label:"Unknown"}];function Fc(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}l(Fc,"formatBytes");function Mc(){let e=Date.now();return[{id:"1",nativeTag:1,viewType:"RCTView",displayName:"View",componentName:"PokemonListItem",renderCount:30,firstRenderTime:e-5e3,lastRenderTime:e,color:"#10B981",lastRenderCause:{type:"parent",timestamp:e,componentCause:"parent"}},{id:"2",nativeTag:2,viewType:"RCTView",displayName:"View",componentName:"CartHeader",renderCount:12,firstRenderTime:e-4e3,lastRenderTime:e,color:"#3B82F6",lastRenderCause:{type:"hooks",timestamp:e,componentCause:"state",hookChanges:[{type:"useState",index:2,previousValue:4,currentValue:5}]}},{id:"3",nativeTag:3,viewType:"RCTView",displayName:"View",componentName:"SearchBar",renderCount:8,firstRenderTime:e-3e3,lastRenderTime:e,color:"#F59E0B",lastRenderCause:{type:"props",timestamp:e,componentCause:"props",changedKeys:["query","onChange"]}}]}l(Mc,"createMockRenders");function $c({renders:e}){let[t,n]=Pc(ki),[o,r]=Pc(false);zh(()=>{let v=true;return Ec().then(L=>{v&&L&&n(L)}),()=>{v=false}},[]);let i=Ot(v=>{n(v),Hc(v)},[]),s=e.length>0,a=s?e:Mc(),c=uo(()=>Vc(t),[t]),u=uo(()=>Ys(a,t),[a,t]),d=uo(()=>u>=jh?"danger":u>=Uh?"warning":"none",[u]),g=Ot(()=>oo(a,t),[a,t]),T=Ot(v=>{let L=Bc[v];L&&i({...L,filterCauses:[...L.filterCauses]})},[i]),f=Ot((v,L)=>{let[P,C]=v.split("::");if(P==="preset"){T(C);return}if(P==="format"){i({...t,format:L});return}if(P==="sort"){i({...t,sortBy:L});return}if(P==="topN"){i({...t,topN:L});return}if(P==="minRenders"){i({...t,minRenders:L});return}if(P==="cause"){let I=L,R=t.filterCauses.includes(I);i({...t,filterCauses:R?t.filterCauses.filter(W=>W!==I):[...t.filterCauses,I]});return}if(P==="signal"){let I=C;i({...t,[I]:!t[I]});return}},[t,i,T]),b=Ot(()=>{let{totalComponents:v,totalRenders:L}=li(a);return _t(Fh,{expanded:o,onExpandedChange:r,summary:`${v} component${v!==1?"s":""} \xB7 ${L} renders \xB7 ~${Fc(u)}${s?"":" (mock data)"}`,warningLevel:d,warningText:{warning:"Large payload \u2014 preview may be slow",danger:"Very large payload \u2014 try a smaller topN or turn off history"},testIDs:{expand:"buoy-highlight-copy-preview-show",collapse:"buoy-highlight-copy-preview-hide",summary:"buoy-highlight-copy-preview-summary",warning:"buoy-highlight-copy-size-warning"},renderBody:()=>{let P=g();return _t(Me,{testID:"buoy-highlight-copy-preview-scroll",style:Pi.previewScroll,nestedScrollEnabled:true,children:_t(p,{testID:"buoy-highlight-copy-preview-text",style:Pi.previewText,selectable:true,children:P})})}})},[o,a,u,d,s,g]),m=Ot(()=>{let{totalComponents:v}=li(a),L=s?`${v} components`:"Mock data (no renders captured)";return Wh(_h,{children:[_t(p,{testID:"buoy-highlight-copy-status",style:Pi.statusLabel,children:L}),_t(Eh,{value:g})]})},[s,a,g]),S=uo(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:Re.llm.label,icon:zc,color:Re.llm.color,value:"llm",isActive:c==="llm",description:Re.llm.description},{id:"preset::table",label:Re.table.label,icon:Nc,color:Re.table.color,value:"table",isActive:c==="table",description:Re.table.description},{id:"preset::json",label:Re.json.label,icon:Lc,color:Re.json.color,value:"json",isActive:c==="json",description:Re.json.description},{id:"preset::full",label:Re.full.label,icon:Hh,color:Re.full.color,value:"full",isActive:c==="full",description:Re.full.description},{id:"preset::custom",label:"Custom",icon:Vh,color:Ri.color.textSecondary,value:"custom",isActive:c===null,description:"User-configured"}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::summary",label:"Summary",icon:zc,color:Di.semantic.success,value:"summary",isActive:t.format==="summary",description:"Compact, LLM-ready"},{id:"format::markdown-table",label:"Table",icon:Nc,color:Di.semantic.info,value:"markdown-table",isActive:t.format==="markdown-table",description:"Markdown table"},{id:"format::json",label:"JSON",icon:Lc,color:Di.semantic.warning,value:"json",isActive:t.format==="json",description:"Structured data"}]},{id:"sort",title:"Sort By",type:"custom",data:[{id:"sort::renderCount",label:"Count",value:"renderCount",isActive:t.sortBy==="renderCount",description:"Total renders"},{id:"sort::rate",label:"Rate",value:"rate",isActive:t.sortBy==="rate",description:"Renders / sec"},{id:"sort::name",label:"Name",value:"name",isActive:t.sortBy==="name",description:"Alphabetical"}]},{id:"topN",title:"Top N",type:"custom",data:[{id:"topN::10",label:"10",value:10,isActive:t.topN===10},{id:"topN::25",label:"25",value:25,isActive:t.topN===25},{id:"topN::50",label:"50",value:50,isActive:t.topN===50},{id:"topN::100",label:"100",value:100,isActive:t.topN===100},{id:"topN::-1",label:"All",value:-1,isActive:t.topN===-1}]},{id:"minRenders",title:"Min Renders",type:"custom",data:[{id:"minRenders::1",label:"1",value:1,isActive:t.minRenders===1},{id:"minRenders::2",label:"2",value:2,isActive:t.minRenders===2},{id:"minRenders::3",label:"3",value:3,isActive:t.minRenders===3},{id:"minRenders::5",label:"5",value:5,isActive:t.minRenders===5},{id:"minRenders::10",label:"10",value:10,isActive:t.minRenders===10}]},{id:"causes",title:"Filter Causes",type:"custom",description:t.filterCauses.length===0?"All causes shown":"Only the selected causes shown",data:Gh.map(v=>({id:`cause::${v.value}`,label:v.label,value:v.value,isActive:t.filterCauses.includes(v.value)}))},{id:"signal",title:"Signal Extraction",type:"custom",data:[{id:"signal::groupByName",label:"Group by name",value:"groupByName",isActive:t.groupByName,description:"Collapse list items"},{id:"signal::aggregateCauses",label:"Aggregate causes",value:"aggregateCauses",isActive:t.aggregateCauses,description:"Hook x N"},{id:"signal::includeHistory",label:"Include history",value:"includeHistory",isActive:t.includeHistory,description:"JSON only \u2014 large"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:Ah,content:b,headerActions:m},onFilterChange:f}),[t,c,f,b,m]);return _t(Bh,{...S})}l($c,"RendersCopySettingsView");var Pi=ve.create({previewScroll:{maxHeight:360},previewText:{fontFamily:Mh,fontSize:11,color:Ri.color.text,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:Ri.color.textTertiary,marginRight:8}});import{Fragment as Kh,jsx as ne,jsxs as Ni}from"react/jsx-runtime";var qh=Sg.memo(l(function(){return Ni(h,{testID:"buoy-highlight-disabled-banner",style:hn.disabledBanner,children:[ne(xg,{size:14,color:Bt.color.warning}),ne(p,{testID:"buoy-highlight-disabled-text",style:hn.disabledText,children:"Render tracking is disabled"})]})},"DisabledBanner"));function go({visible:e,onClose:t,onBack:n,onMinimize:o,enableSharedModalDimensions:r=false,initialNativeTag:i,onInitialNativeTagHandled:s,onRenderSelect:a,inline:c=false}){let u=Rg(),[d,g]=de(false),[T,f]=de(()=>E.getFrozen()),[b,m]=de(()=>B.getStats().totalComponents>0),[S,v]=de(null),[L,P]=de(0),[C,I]=de(false),[R,W]=de(false),[X,V]=de([]),[j,x]=de("filters"),[z,ue]=de("details"),[pe,Fe]=de(0),[ye,Po]=de(""),[St,jt]=de(false),ji=ct(null),Gt=ct([]),Gi=ct(B.getFilters()),[No,Ki]=de(()=>{let _=B.getFilters();return _.includePatterns.length+_.excludePatterns.length}),[be,qi]=de(()=>B.getFilters()),[Lo,Ji]=de(()=>B.getSettings()),Yi=ct(false),zo=ct(false),bn=ct(false);De(()=>{!e||Yi.current||(Yi.current=true)},[e]),De(()=>{if(!e||zo.current)return;l(async()=>{try{let _=await eo.getItem(zt.highlightUpdates.filters());if(_){let G=JSON.parse(_),ie={includeTestID:new Set(G.includeTestID||[]),includeNativeID:new Set(G.includeNativeID||[]),includeViewType:new Set(G.includeViewType||[]),includeComponent:new Set(G.includeComponent||[]),excludeTestID:new Set(G.excludeTestID||[]),excludeNativeID:new Set(G.excludeNativeID||[]),excludeViewType:new Set(G.excludeViewType||[]),excludeComponent:new Set(G.excludeComponent||[]),includePatterns:G.includePatterns||[],excludePatterns:G.excludePatterns||[]};B.setFilters(ie);let ze=B.getFilters();Gi.current=ze,qi(ze),Ki(ze.includePatterns.length+ze.excludePatterns.length)}zo.current=true}catch{}},"loadFilters")()},[e]),De(()=>{if(!zo.current)return;l(async()=>{try{let _={includeTestID:Array.from(be.includeTestID),includeNativeID:Array.from(be.includeNativeID),includeViewType:Array.from(be.includeViewType),includeComponent:Array.from(be.includeComponent),excludeTestID:Array.from(be.excludeTestID),excludeNativeID:Array.from(be.excludeNativeID),excludeViewType:Array.from(be.excludeViewType),excludeComponent:Array.from(be.excludeComponent),includePatterns:be.includePatterns,excludePatterns:be.excludePatterns};await eo.setItem(zt.highlightUpdates.filters(),JSON.stringify(_))}catch{}},"saveFilters")()},[be]),De(()=>{if(!e||bn.current)return;l(async()=>{try{let _=await eo.getItem(zt.highlightUpdates.settings());if(_){let G=JSON.parse(_),{performanceLogging:ie,excludeDevTools:ze,...Ye}=G;B.setSettings(Ye),Ji(B.getSettings())}bn.current=true}catch{bn.current=true}},"loadSettings")()},[e]),De(()=>{if(!bn.current)return;l(async()=>{try{let{performanceLogging:_,excludeDevTools:G,...ie}=Lo;await eo.setItem(zt.highlightUpdates.settings(),JSON.stringify(ie))}catch{}},"saveSettings")()},[Lo]),De(()=>{let _=B.subscribeToState(G=>{g(G.isTracking)});return()=>{_()}},[]),De(()=>{let _=E.subscribeToFreeze(G=>{f(G)});return()=>{_()}},[]),De(()=>{St&&requestAnimationFrame(()=>{ji.current?.focus()})},[St]),De(()=>{e||E.setSpotlight(null)},[e]),De(()=>{if(e&&i!=null){let _=B.getRender(String(i));_&&(v(_),P(0),I(false),E.setSpotlight(_.nativeTag)),s?.()}},[e,i,s]);let Xi=oe(()=>{E.isInitialized()||E.initialize(),E.toggle()},[]),Qi=oe(()=>{E.toggleFreeze()},[]),Zi=oe(()=>{E.clearRenderCounts(),m(false)},[]),ea=oe(()=>{V(B.getFilteredRenders(ye)),W(true)},[ye]),ta=oe(()=>{W(false)},[]),na=oe(_=>{Po(_)},[]),Fu=oe((_,G,ie)=>{v(_),P(G),ue("details"),Fe(0),Gt.current=ie,E.setSpotlight(_.nativeTag)},[]);De(()=>{if(!S)return;let _=String(S.nativeTag);return B.subscribe(()=>{let G=B.getRender(_);G&&v({...G})})},[S?.nativeTag]);let oa=ct(null);De(()=>{!a||!S||oa.current!==S.nativeTag&&(oa.current=S.nativeTag,a(S))},[S,a]);let Mu=oe(_=>{Gt.current=_},[]),ra=oe(()=>{v(null),P(0),ye&&jt(true),E.setSpotlight(null)},[ye]),$u=oe(()=>{let _=Gt.current;if(L>0){let G=L-1,ie=_[G];ie&&(v(ie),P(G),E.setSpotlight(ie.nativeTag))}},[L]),Ou=oe(()=>{let _=Gt.current;if(L<_.length-1){let G=L+1,ie=_[G];ie&&(v(ie),P(G),E.setSpotlight(ie.nativeTag))}},[L]),ia=oe(()=>{I(false)},[]),aa=oe(()=>{I(true)},[]),la=oe(()=>{jt(true)},[]),sa=oe(()=>{jt(false)},[]),Bo=oe(_=>{B.setFilters(_);let G=B.getFilters();Gi.current=G,qi(G),Ki(G.includePatterns.length+G.excludePatterns.length)},[]),_u=oe((_,G)=>{let ie=B.getFilters(),ze={};G==="include"?ie.includePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(ze.includePatterns=[...ie.includePatterns,_]):ie.excludePatterns.some(Ye=>Ye.type===_.type&&Ye.value===_.value)||(ze.excludePatterns=[...ie.excludePatterns,_]),Object.keys(ze).length>0&&(Bo(ze),v(null),P(0),E.setSpotlight(null))},[Bo]),Wu=oe(_=>{B.setSettings(_),Ji(B.getSettings())},[]),Uu=oe(_=>{m(_.totalComponents>0)},[]),ca=oe(()=>R?ne(Dh,{onBack:ta}):C?ne(xh,{onBack:ia,activeTab:j,onTabChange:x,activeFilterCount:No}):S?ne(Ih,{onBack:ra,activeTab:z,onTabChange:ue,hasHistory:(S.renderHistory?.length??0)>0}):ne(Sh,{onBack:n,isSearchActive:St,searchText:ye,onSearchChange:na,onSearchToggle:la,onSearchClose:sa,onFilterToggle:aa,onToggleTracking:Xi,onToggleFreeze:Qi,onClear:Zi,onOpenCopySettings:ea,isTracking:d,isFrozen:T,activeFilterCount:No,hasRenders:b,searchInputRef:ji}),[R,C,S,n,St,ye,d,T,No,b,j,z,ia,ra,ta,na,la,sa,aa,Xi,Qi,Zi,ea]),ju=r?zt.modal.root():zt.highlightUpdates.modal();if(!e)return null;let Gu=Gt.current.length,ua=S?z==="details"?ne(Fg,{currentIndex:L,totalItems:Gu,onPrevious:$u,onNext:Ou,itemLabel:"Component",subtitle:S.componentName||S.displayName||S.viewType}):ne(Ii,{render:S,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:u}):null,da=ne(h,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:hn.container,children:R?ne($c,{renders:X}):S?z==="details"?ne(si,{render:S,disableInternalFooter:true,onAddFilter:_u,isPro:u}):ne(xi,{render:S,disableInternalFooter:true,selectedEventIndex:pe,onEventIndexChange:Fe,isPro:u}):C?ne(Ci,{filters:be,onFilterChange:Bo,settings:Lo,onSettingsChange:Wu,availableProps:B.getAvailableProps(),activeTab:j}):Ni(Kh,{children:[E.getRenderSourceStatus()==="unavailable"?ne(p,{style:{color:Bt.color.warning,padding:16},children:"Not in this app"}):!d&&ne(qh,{}),ne(ih,{searchText:ye,filters:be,onSelectRender:Fu,onStatsChange:Uu,onRendersChange:Mu,isTracking:d,isPro:u})]})});return c?ne(Es,{children:Ni(h,{style:hn.inlineRoot,children:[ne(h,{style:hn.inlineHeader,...Dg,children:ca()}),da,ua]})}):ne(Es,{children:ne(Ig,{visible:e,onClose:t,onMinimize:o,persistenceKey:ju,header:{showToggleButton:true,customContent:ca()},enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Ma.OS==="web",styles:{},footer:ua,footerHeight:S&&(z==="details"||(S.renderHistory?.length??0)>1)?68:0,children:da})})}l(go,"HighlightUpdatesModal");function Oc(e={}){return ne(go,{...e,inline:true,visible:true,onClose:()=>{}})}l(Oc,"HighlightToolView");var hn=ve.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Bt.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:Bt.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:Bt.color.warning+"20"},disabledText:{color:Bt.color.warning,fontSize:11,flex:1}});import{jsx as pn}from"react/jsx-runtime";function _c({size:e}){let[t,n]=Mo(()=>E.isEnabled());return $o(()=>E.subscribe(o=>{n(o)}),[]),pn(ka,{size:e,color:t?"#10b981":"#6b7280"})}l(_c,"HighlightIcon");function Li(){return null}l(Li,"EmptyComponent");function zi(e){let[t,n]=Mo(null);$o(()=>(e.visible&&E.setBadgePressCallback(r=>{n(r)}),()=>{e.visible||E.setBadgePressCallback(null)}),[e.visible]);let o=Zu(()=>{n(null)},[]);return pn(go,{...e,initialNativeTag:t,onInitialNativeTagHandled:o})}l(zi,"HighlightUpdatesModalWithBadgeNavigation");var Jh={id:"highlight-updates",name:"TOGGLE HIGHLIGHT",description:"Toggle component render highlights",slot:"row",icon:_c,component:Li,props:{},launchMode:"toggle-only",onPress:l(()=>{E.isInitialized()||E.initialize(),E.toggle()},"onPress")};function Wc(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";e?.autoInitialize&&setTimeout(()=>{E.initialize()},1e3);let o=l(({size:r})=>{let[i,s]=Mo(()=>E.isEnabled());return $o(()=>E.subscribe(a=>{s(a)}),[]),pn(ka,{size:r,color:i?t:n})},"CustomHighlightIcon");return{id:e?.id||"highlight-updates",name:e?.name||"TOGGLE HIGHLIGHT",description:e?.description||"Toggle component render highlights",slot:"row",icon:o,component:Li,props:{},launchMode:"toggle-only",onPress:l(()=>{E.isInitialized()||E.initialize(),E.toggle()},"onPress")}}l(Wc,"createHighlightUpdatesTool");var Yh={id:"highlight-updates-modal",name:"HIGHLIGHT",description:"View component render tracking modal",slot:"both",icon:l(({size:e})=>pn(Ra,{size:e}),"icon"),component:zi,props:{enableSharedModalDimensions:false}};function Uc(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";return e?.autoInitialize&&setTimeout(()=>{E.initialize()},1e3),{id:e?.id||"highlight-updates-modal",name:e?.name||"HIGHLIGHT",description:e?.description||"View component render tracking modal",slot:"both",icon:l(({size:o})=>pn(Ra,{size:o,color:t}),"icon"),component:zi,props:{enableSharedModalDimensions:false}}}l(Uc,"createHighlightUpdatesModalTool");U();U();import{getDOMFiber as Xh,getDOMNodeHandle as Qh}from"@buoy-gg/shared-ui/web/utils";var Zh=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","Pressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","TextInput","Switch","ActivityIndicator","Modal","SafeAreaView","SafeAreaProvider","KeyboardAvoidingView","VirtualizedList","Screen","ScreenContainer","ScreenStack","ScreenContentWrapper","GestureHandlerRootView","GestureDetector","Wrapper"]);function ho(e){let t=e.return,n=t?.elementType??t?.type;return t&&n?.$$typeof===Symbol.for("react.memo")&&(n.type===e.type||n.type===e.elementType)?t:null}l(ho,"memoParent");function po(e){let t="",n=e.tag===14||e.tag===15,o=e.tag===11,r=new Set,i=l(a=>{!a||r.has(a)||r.size>20||(r.add(a),t||(t=a.displayName||(typeof a=="function"?a.name:"")),a.$$typeof===Symbol.for("react.memo")&&(n=true,i(a.type)),a.$$typeof===Symbol.for("react.forward_ref")&&(o=true,i(a.render)))},"visit");i(e.elementType),i(e.type);let s=ho(e);return s&&i(s.elementType??s.type),{name:t||"Anonymous",memo:n,forwardRef:o}}l(po,"typeInfo");function Bi(e){if(!e||typeof e.type=="string"||![0,1,2,11,14,15].includes(e.tag))return false;let{name:t}=po(e),n=e._debugSource?.fileName??"";return!Zh.has(t)&&!/^(Animated|RCT|Reanimated|Buoy|DevTools|FloatingDevTools|HighlightUpdates)/.test(t)&&!/[@/]buoy-gg\/|\/react-native\//.test(n)&&!e.memoizedProps?.__buoyDevToolsRoot}l(Bi,"isUserComponent");function jc(e){let t=po(e),n=ho(e),o=e._debugSource??n?._debugSource;if(typeof o?.fileName=="string"&&o.fileName)t.source={fileName:o.fileName},Number.isFinite(o.lineNumber)&&(t.source.lineNumber=o.lineNumber),Number.isFinite(o.columnNumber)&&(t.source.columnNumber=o.columnNumber);else{let r=e._debugStack??n?._debugStack;typeof r?.stack=="string"&&(t.rawStack=r.stack)}return t}l(jc,"entry");function Gc(e){let t=e.child?[e.child]:[],n=0;for(;t.length&&n++<300;){let o=t.shift();if(o._debugOwner===e){let r=o._debugSource;if(typeof r?.fileName=="string"&&r.fileName)return{source:{fileName:r.fileName,...Number.isFinite(r.lineNumber)?{lineNumber:r.lineNumber}:{},...Number.isFinite(r.columnNumber)?{columnNumber:r.columnNumber}:{}}};if(typeof o._debugStack?.stack=="string")return{rawStack:o._debugStack.stack}}o.child&&t.push(o.child),o.sibling&&t.push(o.sibling)}}l(Gc,"definitionOf");function Kc(e){let t=[],n=null,o=new Set,r=e;for(;r&&!o.has(r)&&o.size<400&&t.length<7;){o.add(r),Bi(r)&&(t.length||(n=r),t.push(jc(r)));let s=ho(r);r=r._debugOwner||s?._debugOwner||s?.return||r.return,s&&r===s&&(r=s._debugOwner||s.return)}if(!t.length)return{found:false,reason:"No app component was found for this view."};let i=n?Gc(n):void 0;return{found:true,component:i?{...t[0],definedIn:i}:t[0],owners:t.slice(1)}}l(Kc,"sourceFromFiber");function qc(e){return e?.canonical?.internalInstanceHandle||e?._internalInstanceHandle||e?._internalFiberInstanceHandleDEV||Xh(e)||null}l(qc,"fiberFromStateNode");function Jc(e){return Qh(e)??e?.__nativeTag??e?._nativeTag??e?.nativeTag??e?.canonical?.__nativeTag??e?.canonical?._nativeTag??e?.canonical?.nativeTag??null}l(Jc,"nativeTag");var ep=1e5;function Yc(e){let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__,n=[],o=l(s=>{try{t?.getFiberRoots?.(s)?.forEach(a=>n.push(a.current))}catch{}},"addRoots");t?.renderers?.forEach((s,a)=>o(a)),n.length||o(1);let r=[...n],i=new Set;for(;r.length;){if(i.size>=ep)return{fiber:null,capped:true,any:true};let s=r.pop();if(!s||i.has(s))continue;i.add(s),s.sibling&&r.push(s.sibling);let a=s.memoizedProps??{};if(!(s.tag===22&&s.memoizedState!=null||a.__buoyDevToolsRoot||a.activityState===0||a.activityState===1||a.isPageFocused===false||a["aria-hidden"]===true&&(a.activityState!==void 0||"shouldFreeze"in a)||a.isFocused===false&&(a.routeKey!==void 0||"freezeContents"in a))){if(e(s))return{fiber:s,capped:false,any:true};s.child&&r.push(s.child)}}return{fiber:null,capped:false,any:n.length>0}}l(Yc,"findLiveFiber");async function Xc(e={}){try{let{nativeTag:t,query:n}=e??{};if(t!==void 0&&(!Number.isInteger(t)||t<0)||n!==void 0&&typeof n!="string")return{found:false,reason:"Pass a valid nativeTag or a text query."};let o=n?.trim();if(t==null&&!o)return{found:false,reason:"Pass a query or nativeTag."};let r=false,i=false,s=l(u=>{let d=Yc(u);return r||(r=d.capped),i||(i=d.any),d.fiber??void 0},"find"),a=l(u=>s(d=>d.stateNode&&Jc(d.stateNode)===u),"byTag"),c=t!=null?a(t):void 0;if(t==null&&o&&(c=s(u=>Bi(u)&&po(u).name.toLowerCase()===o.toLowerCase()),!c)){let u=(await Bn({})).elements.map(d=>({el:d,score:Zt(d,{query:o})})).filter(({score:d})=>d>0).sort((d,g)=>g.score-d.score)[0]?.el;u?.nativeTag!=null&&(c=a(u.nativeTag))}return!c&&!i?{found:false,reason:"No React tree was found. Use a dev build."}:c?Kc(qc(c.stateNode)??c):{found:false,reason:r?"The React tree is too big to search fully, and no view matched in the part searched. Pass the nativeTag from describe_screen.":"No view matched. Check describe_screen for its name or tag."}}catch{return{found:false,reason:"Could not read the React tree. Try again in a dev build."}}}l(Xc,"getComponentSource");Ve();U();U();import{resolveDOMEventEmitter as tp}from"@buoy-gg/shared-ui/web/utils";var np=14,op=550,rp=4e3,ip=8e3,Qc=600,Vi=null,Zc=false,Ai=null,mo=[],qe="idle",Je=[],Hi=0,Le=null;function eu(){if(Zc)return Vi;Zc=true;let e=tp();return Vi=e.emitter,Ai=e.reason,Vi}l(eu,"getEmitter");function yt(e){return typeof e=="number"&&Number.isFinite(e)?e:null}l(yt,"num");function Ei(e){let t=e?.nativeEvent;return t?yt(t.target)??yt(t.tag):null}l(Ei,"tagOf");function fo(e){let t=e?.nativeEvent;if(!t)return null;let n={x:yt(t.pageX),y:yt(t.pageY)};if(n.x!==null&&n.y!==null)return{x:n.x,y:n.y};for(let o of["changedTouches","touches"]){let r=t[o];if(Array.isArray(r)&&r.length){let i=r[0],s=yt(i?.pageX),a=yt(i?.pageY);if(s!==null&&a!==null)return{x:s,y:a}}}return null}l(fo,"pointOf");function Fi(e){Je.push({...e,seq:++Hi}),Je.length>Qc&&(Je=Je.slice(-Qc))}l(Fi,"push");function tu(e){let t=Ei(e);if(t===null)return;let n=fo(e),o=null;try{o=Hn(t)}catch{}Le={tag:t,x:n?.x??0,y:n?.y??0,t:Date.now(),drift:0,target:o}}l(tu,"onTouchStart");function nu(e){if(!Le)return;let t=fo(e);if(!t)return;let n=t.x-Le.x,o=t.y-Le.y;Le.drift=Math.max(Le.drift,Math.sqrt(n*n+o*o))}l(nu,"onTouchMove");function ou(e){let t=Le;if(Le=null,!t||!t.target)return;let n=fo(e);if(n){let r=n.x-t.x,i=n.y-t.y;t.drift=Math.max(t.drift,Math.sqrt(r*r+i*i))}if(t.drift>np)return;let o=Date.now()-t.t;o>rp||t.target.control!=="text"&&(t.target.control==="toggle"||t.target.control==="slider"||Fi({t:Date.now(),kind:o>=op?"longPress":"press",target:t.target}))}l(ou,"onTouchEnd");function ru(){Le=null}l(ru,"onTouchCancel");function yo(e){let t=Ei(e);if(t===null)return;let n=e.nativeEvent,o,r;if(typeof n.text=="string")o="text",r=n.text;else if(typeof n.value=="boolean")o="toggle",r=n.value;else if(typeof n.value=="number")o="slider",r=n.value;else return;let i=Je[Je.length-1];if(i&&i.kind===o&&i.target.nativeTag===t&&Date.now()-i.t<ip){i.value=r,i.t=Date.now();return}let s=null;try{s=Hn(t)}catch{}s&&Fi({t:Date.now(),kind:o,target:s,value:r})}l(yo,"onChange");function iu(){if(qe==="capturing")return Wt();let e=eu();if(!e)return qe="unavailable",Wt();try{mo=[e.addListener("topTouchStart",tu),e.addListener("topTouchMove",nu),e.addListener("topTouchEnd",ou),e.addListener("topTouchCancel",ru),e.addListener("topChange",yo),e.addListener("topValueChange",yo),e.addListener("topSlidingComplete",yo)],Le=null,qe="capturing"}catch(t){mo=[],qe="unavailable",Ai=t?.message??"addListener failed"}return Wt()}l(iu,"startTouchCapture");function au(){mo.forEach(e=>{try{e.remove()}catch{}}),mo=[],Le=null,qe==="capturing"&&(qe="idle")}l(au,"stopTouchCapture");function lu(){Je=[],Hi=0}l(lu,"clearTouchCapture");function Wt(){return{status:qe,reason:qe==="unavailable"?Ai:null}}l(Wt,"getTouchCaptureStatus");function su(e=0){return{...Wt(),records:Je.filter(t=>t.seq>e),seq:Hi}}l(su,"readTouchCapture");U();var cu=0,uu=1,du=11,gu=14,hu=15,bo=1,ap=1e4,lp=300,sp=20,pu=false,mn=false,Mi=false,vo=false,Co=0,bt=0,To=0,vt={},Ct=new Map;function $i(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}l($i,"getHook");function wo(e){let t=e.flags??e.effectTag;return typeof t=="number"?t:0}l(wo,"getFlags");function Oi(e){return e===cu||e===uu||e===du||e===gu||e===hu}l(Oi,"isCompositeTag");function So(e){let t=e.type;try{switch(e.tag){case cu:case uu:return t?.displayName||t?.name||"Anonymous";case du:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case gu:case hu:{let n=t?.type??e.elementType?.type;return t?.displayName||n?.displayName||n?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}l(So,"getComponentName");function mu(e){let t=e.actualDuration;if(typeof t!="number")return null;let n=t;for(let o=e.child;o!=null;o=o.sibling)typeof o.actualDuration=="number"&&(n-=o.actualDuration);return n>0?n:0}l(mu,"computeSelfMs");var cp=new Set(["View","Text","Image","ImageBackground","ScrollView","FlatList","SectionList","SafeAreaView","KeyboardAvoidingView","StatusBar","ActivityIndicator","RefreshControl","Modal","Switch","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","PressabilityDebugView","AnimatedComponent","Wrapper"]),fu=["Animated(","Pressability","Virtualized","CellRenderer"];function _i(e){if(cp.has(e))return true;for(let t=0;t<fu.length;t++)if(e.startsWith(fu[t]))return true;return false}l(_i,"isFrameworkWrapperName");var yu=40,bu=5;function vu(e,t){if(Object.is(e,t))return true;let n=typeof e;if(n!==typeof t)return false;if(n==="function")return true;if(e===null||t===null||n!=="object")return false;let o=Array.isArray(e);if(o!==Array.isArray(t))return false;if(o){if(e.length!==t.length)return false;for(let s=0;s<e.length;s++)if(!Object.is(e[s],t[s]))return false;return true}let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return false;for(let s=0;s<r.length;s++){let a=r[s];if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return false}return true}l(vu,"isEquivalentValue");function Cu(e,t){let n=e.alternate;if(!n)return{cause:"mount"};let o=e.memoizedProps,r=n.memoizedProps;if(o!==r&&o&&r){let i=false,s=false,a,c=Object.keys(o),u=c.length<yu?c.length:yu;for(let d=0;d<u;d++){let g=c[d],T=r[g],f=o[g];if(!Object.is(T,f)&&(i=true,t&&(a||(a=[]),a.length<bu&&a.push(g)),!vu(T,f)&&(s=true,!t)))break}if(!s&&Object.keys(r).length!==c.length&&(i=true,s=true),i)return{cause:s?"props":"propsUnstable",changedKeys:a}}return Nl(n,e)?{cause:"hooks"}:{cause:"parent"}}l(Cu,"detectCause");function Tu(e){for(let t=e.return;t!=null;t=t.return){if(!Oi(t.tag)||(wo(t)&bo)===0)continue;let n=So(t);if(!_i(n))return n}}l(Tu,"nearestRenderedAncestorName");function wu(e,t){let n=So(e),o=mu(e);o!==null&&(Mi=true);let r=o??0;bt+=1,To+=r;let{cause:i,changedKeys:s}=Cu(e,vo);if(vt[i]=(vt[i]??0)+1,_i(n))return;let a=Ct.get(n);if(!a){if(Ct.size>=lp)return;a={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}},Ct.set(n,a)}if(a.renders+=1,a.totalSelfMs+=r,r>a.maxSelfMs&&(a.maxSelfMs=r),a.causes[i]=(a.causes[i]??0)+1,vo){if(s){a.changedProps||(a.changedProps=new Set);for(let c=0;c<s.length&&!(a.changedProps.size>=bu);c++)a.changedProps.add(s[c])}t&&!a.parentName&&(a.parentName=t)}}l(wu,"recordRender");function Su(e){let t=e?.current;if(!t)return;let n=bt,o=0,r=t;for(;r!=null&&(o+=1,!(o>ap));){let i=false,s=Oi(r.tag);if(r.memoizedProps?.__buoyDevToolsRoot||r.memoizedProps?.["data-buoy-root"]!==void 0)i=true;else if(s){let a=So(r);ns(a)?i=true:ts(a)||(wo(r)&bo)!==0&&wu(r,vo?Tu(r):void 0)}if(!i){let a=r.subtreeFlags;if(!(typeof a=="number"&&(a&bo)===0&&(wo(r)&bo)===0)&&r.child!=null){r=r.child;continue}}for(;r!=null;){if(r===t)return Wi(n);if(r.sibling!=null){r=r.sibling;break}r=r.return}}Wi(n)}l(Su,"handleCommit");function Wi(e){bt>e&&(Co+=1)}l(Wi,"finalizeCommit");function xu(){if(pu)return true;let e=$i();if(!e)return false;let t=e.onCommitFiberRoot;return e.onCommitFiberRoot=function(n,o,...r){if(mn)try{Su(o)}catch{}return typeof t=="function"?t.call(e,n,o,...r):void 0},pu=true,true}l(xu,"ensureHookInstalled");function Iu(){if(typeof ee<"u"&&!ee)return false;let e=$i();return!!(e&&e.renderers&&e.renderers.size>0)}l(Iu,"isSupported");function Du(){return mn}l(Du,"isCapturing");function Ru(e){xu()&&(Ct=new Map,Mi=false,vo=e?.detail===true,Co=0,bt=0,To=0,vt={},mn=true)}l(Ru,"startCapture");function ku(){if(!mn&&bt===0&&Ct.size===0)return null;mn=false;let e=Array.from(Ct.entries()).sort((n,o)=>{let r=o[1].totalSelfMs-n[1].totalSelfMs;return r!==0?r:o[1].renders-n[1].renders}).slice(0,sp).map(([n,o])=>({name:n,renders:o.renders,totalMs:fn(o.totalSelfMs),maxMs:fn(o.maxSelfMs),avgMs:o.renders>0?fn(o.totalSelfMs/o.renders):0,causes:o.causes,...o.changedProps&&o.changedProps.size>0?{changedProps:Array.from(o.changedProps)}:null,...o.parentName?{parentName:o.parentName}:null})),t={totalCommits:Co,totalRenders:bt,capturedDurations:Mi,totalRenderMs:fn(To),wastedRenders:(vt.parent??0)+(vt.propsUnstable??0),causes:vt,topComponents:e};return Ct=new Map,Co=0,bt=0,To=0,vt={},t}l(ku,"stopCapture");function fn(e){return Math.round(e*100)/100}l(fn,"round2");var Tt={isSupported:Iu,isCapturing:Du,startCapture:Ru,stopCapture:ku};function yn(){E.isInitialized()||E.initialize()}l(yn,"ensureInitialized");function xo(e){if(!e)return;let{hookChanges:t,...n}=e;return n}l(xo,"toWireCause");function Pu(e){let{renderHistory:t,lastRenderCause:n,...o}=e;return{...o,lastRenderCause:xo(n),historyCount:t?.length??0}}l(Pu,"toWireRender");function Nu(e){try{return JSON.stringify(e),e}catch{return{...e,lastRenderCause:xo(e.lastRenderCause),renderHistory:e.renderHistory?.map(t=>({...t,capturedProps:void 0,capturedState:void 0,cause:xo(t.cause)??t.cause}))}}}l(Nu,"jsonSafeRender");function Lu(){let e=globalThis[Symbol.for("buoy.framework.renderCapture")];return e&&typeof e.start=="function"&&e.isSupported()?e:null}l(Lu,"frameworkCapture");var Io=null;function zu(){if(Tt.isSupported())return Tt.startCapture({detail:true}),Io="react",{ok:true};let e=Lu();return e?(e.start(),Io=e,{ok:true}):{ok:false,reason:"render capture needs a dev build with the React DevTools hook available"}}l(zu,"beginMeasurement");function Bu(){let e=Io;return Io=null,e&&e!=="react"?{summary:e.stop()}:{summary:Tt.stopCapture()}}l(Bu,"endMeasurement");var up={version:3,getSnapshot:l(()=>({enabled:E.isEnabled(),frozen:E.getFrozen(),highlightsSuppressed:E.getHighlightsSuppressed(),renders:B.getRenders().map(Pu),trackerState:B.getState()}),"getSnapshot"),subscribe:l(e=>{let t=E.subscribe(e),n=E.subscribeToFreeze(e),o=B.subscribe(e),r=B.subscribeToState(e);return()=>{t(),n(),o(),r()}},"subscribe"),actions:{getComponentSource:l(async e=>{try{return await Xc(e)}catch(t){return{found:false,reason:`Could not read the component's source: ${t instanceof Error?t.message:String(t)}`}}},"getComponentSource"),beginMeasurement:l(()=>zu(),"beginMeasurement"),endMeasurement:l(()=>Bu(),"endMeasurement"),getRenderDetail:l(e=>{let{nativeTag:t}=e??{};if(t==null)return{found:false,reason:"missing nativeTag"};let n=B.getRender(String(t));return n?{found:true,nativeTag:t,render:Nu(n)}:{found:false,reason:"unknown nativeTag"}},"getRenderDetail"),toggle:l(()=>{yn(),E.toggle()},"toggle"),setEnabled:l(e=>{yn(),E.setEnabled(e.enabled)},"setEnabled"),toggleFreeze:l(()=>{E.toggleFreeze()},"toggleFreeze"),clearRenderCounts:l(()=>{E.clearRenderCounts()},"clearRenderCounts"),setSpotlight:l(e=>{E.setSpotlight(e.nativeTag)},"setSpotlight"),locateComponent:l(e=>(yn(),E.locateComponent(e??{})),"locateComponent"),setSilentTracking:l(e=>{yn(),E.setSilentTracking(e.enabled??false)},"setSilentTracking"),describeScreen:l(e=>Bn(e??{}),"describeScreen"),tapElement:l(e=>pl(e??{}),"tapElement"),waitFor:l(e=>ml(e??{}),"waitFor"),hitTest:l(e=>Rl(e??{x:.5,y:.5}),"hitTest"),readMaps:l(()=>kl(),"readMaps"),startTouchCapture:l(()=>iu(),"startTouchCapture"),stopTouchCapture:l(()=>(au(),Wt()),"stopTouchCapture"),clearTouchCapture:l(()=>(lu(),{ok:true}),"clearTouchCapture"),readTouchCapture:l(e=>su(e?.sinceSeq??0),"readTouchCapture")}};U();import{useEffect as Do,useState as Ui,useRef as Ro,useCallback as Vu,useLayoutEffect as dp}from"react";import{night as ko,monoFont as gp}from"@buoy-gg/shared-ui/web";Tn();Ve();import{Fragment as hp,jsx as Ut,jsxs as Au}from"react/jsx-runtime";var pp=1e3;function Hu({onBadgePress:e}={}){let[t,n]=Ui([]),[o,r]=Ui(()=>E.getFrozen()),[i,s]=Ui(null),a=Ro(null),c=Ro(0),u=Ro(0),d=Ro(o);d.current=o,Qe.isEnabled()&&(c.current=performance.now(),u.current=t.length),dp(()=>{if(Qe.isEnabled()&&c.current>0&&u.current>0){let m=performance.now()-c.current;va(u.current,m)}}),Do(()=>E.subscribeToFreeze(m=>{r(m)}),[]),Do(()=>B.subscribeToFilters(()=>{n(m=>m.filter(S=>{let v=B.getRender(String(S.id));return v?B.shouldShowRender(v):true}))}),[]),Do(()=>(E.setSpotlightCallback(m=>{s(m)}),()=>{E.setSpotlightCallback(null)}),[]);let g=Vu(m=>{let S=Date.now(),v=m.map(L=>({...L,timestamp:S}));n(L=>{let P=[...L];for(let C of v){let I=P.findIndex(R=>R.id===C.id);I>=0?P[I]=C:P.push(C)}return P})},[]);Do(()=>(E.setHighlightCallback(g),a.current=setInterval(()=>{if(d.current)return;let m=Date.now();n(S=>S.filter(v=>m-v.timestamp<pp))},50),()=>{E.setHighlightCallback(null),a.current&&clearInterval(a.current)}),[g]);let T=e||E.getBadgePressCallback(),f=Vu(m=>{e?e(m):E.handleBadgePress(m)},[e]),b=i?B.getRender(String(i)):null;return t.length===0&&!b?.measurements?null:Au(h,{style:wt.overlay,pointerEvents:"box-none",nativeID:"highlight-updates-overlay",children:[b?.measurements&&Au(hp,{children:[Ut(h,{pointerEvents:"none",nativeID:"__spotlight_highlight__",style:[wt.spotlightHighlight,{left:b.measurements.x-3,top:b.measurements.y-3,width:b.measurements.width+6,height:b.measurements.height+6}]}),Ut(h,{pointerEvents:"none",style:[wt.spotlightLabel,{left:b.measurements.x,top:b.measurements.y+b.measurements.height+4}],children:Ut(p,{style:wt.spotlightLabelText,children:b.componentName||b.displayName||b.viewType})})]}),t.map(m=>Ut(h,{pointerEvents:"box-none",nativeID:`__highlight_rect_${m.id}__`,style:[wt.highlight,{left:m.x,top:m.y,width:m.width,height:m.height,borderColor:m.color}],children:m.count>0&&Ut(h,{style:[wt.badge,{backgroundColor:m.color}],nativeID:`__highlight_badge_${m.id}__`,pointerEvents:T?"auto":"none",hitSlop:{top:8,bottom:8,left:8,right:8},onStartShouldSetResponder:()=>!!T,onResponderGrant:()=>f(m.id),children:Ut(p,{style:wt.badgeText,nativeID:`__highlight_text_${m.id}__`,children:m.count})})},`highlight-${m.id}`))]})}l(Hu,"HighlightUpdatesOverlay");var wt=ve.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999999,elevation:999999,borderWidth:0},highlight:{position:"absolute",borderWidth:2,borderStyle:"solid",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,height:14,borderRadius:0,justifyContent:"center",alignItems:"center",paddingHorizontal:2},badgeText:{color:"#000",fontSize:9,fontWeight:"bold"},spotlightHighlight:{position:"absolute",borderWidth:2,borderStyle:"dashed",borderColor:ko.color.accent,backgroundColor:"transparent"},spotlightLabel:{position:"absolute",backgroundColor:ko.color.surface,borderWidth:1,borderColor:ko.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},spotlightLabelText:{color:ko.color.accent,fontSize:11,fontWeight:"600",fontFamily:gp}});import{setRenderCaptureProvider as mp}from"@buoy-gg/shared-ui/web";Ve();Tn();ya();U();function Eu(e){let t={exportedAt:new Date().toISOString(),totalComponents:e.length,totalRenders:e.reduce((n,o)=>n+o.renderCount,0),components:e.map(n=>({componentName:n.componentName||n.displayName,viewType:n.viewType,nativeTag:n.nativeTag,testID:n.testID,nativeID:n.nativeID,accessibilityLabel:n.accessibilityLabel,renderCount:n.renderCount,firstRenderTime:n.firstRenderTime,lastRenderTime:n.lastRenderTime,lastRenderCause:n.lastRenderCause?{type:n.lastRenderCause.type,componentCause:n.lastRenderCause.componentCause,changedKeys:n.lastRenderCause.changedKeys,hookChanges:n.lastRenderCause.hookChanges?.map(o=>({type:o.type,index:o.index,description:o.description}))}:null,renderHistory:n.renderHistory?.map(o=>({renderNumber:o.renderNumber,timestamp:o.timestamp,cause:{type:o.cause.type,componentCause:o.cause.componentCause,changedKeys:o.cause.changedKeys}}))}))};return JSON.stringify(t,null,2)}l(Eu,"generateRendersJson");try{mp({isSupported:Tt.isSupported,start:Tt.startCapture,stop:Tt.stopCapture,startLiveHighlights:l(()=>{try{let e=E.isEnabled(),t=E.getHighlightsSuppressed();return E.enable(),()=>{try{e?t&&E.setHighlightsSuppressed(true):E.disable()}catch{}}}catch{return null}},"startLiveHighlights")})}catch{}var fp=l(e=>{let{RenderTracker:t}=(Ve(),Xu(Sa));return t.onRenderEvent(e)},"onRenderEvent");export{Ge as CAUSE_CONFIG,sn as COMPONENT_CAUSE_CONFIG,Tt as CommitProfiler,Ci as HighlightFilterView,Oc as HighlightToolView,E as HighlightUpdatesController,go as HighlightUpdatesModal,Hu as HighlightUpdatesOverlay,Qe as PerformanceLogger,Qr as RenderCauseBadge,si as RenderDetailView,Ii as RenderHistoryFooter,xi as RenderHistoryViewer,pc as RenderListItem,B as RenderTracker,Ms as TwoLevelCauseBadge,Xe as VIEW_TYPE_MAP,ql as capturePropsSnapshot,Jl as captureStateSnapshot,Ir as clearRenderCauseState,Uc as createHighlightUpdatesModalTool,Wc as createHighlightUpdatesTool,On as detectRenderCause,hi as detectedItemTestID,Ha as disableProfilerLogging,Aa as enableProfilerLogging,Eu as generateRendersJson,fa as getAllComponentNames,ma as getAllNativeViewTypes,Cn as getComponentDisplayName,ha as getNativeViewType,Gl as getRenderCauseStats,Yh as highlightUpdatesModalPreset,Jh as highlightUpdatesPreset,up as highlightUpdatesSyncAdapter,ht as identifierSlug,Uo as installProfilerInterceptor,Pr as isCapturingBuoyToolRenders,Va as isInterceptorInstalled,pa as isKnownViewType,Ea as isLoggingEnabled,fp as onRenderEvent,pi as patternChipTestID,jl as removeRenderCauseState,gi as renderRowTestID,Ee as safeCloneForHistory,Zl as setCaptureBuoyToolRenders,Wo as setComparisonCallback,pt as settingTestID,jo as uninstallProfilerInterceptor};