@buoy-gg/debug-borders 7.0.74 → 7.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.collectDOMInstances=collectDOMInstances;function collectDOMInstances(t,o){const l=[];const c=t.ownerDocument.createTreeWalker(t,1,{acceptNode(n){const i=n;if(i.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, [hidden], .ion-page-hidden"))return 2;return 1}});let e=c.nextNode();while(e){if(!o.has(e)){const n=t.ownerDocument.defaultView?.getComputedStyle(e);const i=e.getBoundingClientRect();if(n?.visibility!=="hidden"&&n?.visibility!=="collapse"&&i.width>0&&i.height>0){let a=0;for(let s=e.parentElement;s&&s!==t;s=s.parentElement)a++;l.push({instance:e,fiber:null,depth:a})}}e=c.nextNode()}return l}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.collectDOMInstances=collectDOMInstances;function collectDOMInstances(t,o){const s=[];const a=t.ownerDocument.createTreeWalker(t,1,{acceptNode(i){const n=i;if(n.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, .ion-page-hidden"))return 2;if(t.ownerDocument.defaultView?.getComputedStyle(n).display==="none")return 2;return 1}});let e=a.nextNode();while(e){if(!o.has(e)){const i=t.ownerDocument.defaultView?.getComputedStyle(e);const n=e.getBoundingClientRect();if(i?.visibility!=="hidden"&&i?.visibility!=="collapse"&&n.width>0&&n.height>0){let c=0;for(let l=e.parentElement;l&&l!==t;l=l.parentElement)c++;s.push({instance:e,fiber:null,depth:c})}}e=a.nextNode()}return s}
@@ -1 +1 @@
1
- "use strict";var _vitest=require("vitest");var _domInstances=require("./domInstances");(0,_vitest.afterEach)(()=>{document.body.innerHTML=""});function setup(t){document.body.innerHTML=t;for(const e of Array.from(document.body.querySelectorAll("*"))){e.getBoundingClientRect=()=>({x:0,y:0,width:100,height:50})}}(0,_vitest.describe)("plain DOM borders",()=>{(0,_vitest.it)("finds app nodes without a React root",()=>{setup('<main><button data-testid="save">Save</button><canvas></canvas></main>');(0,_vitest.expect)((0,_domInstances.collectDOMInstances)(document.body,new Set).map(t=>[t.instance.tagName,t.depth])).toEqual([["MAIN",0],["BUTTON",1],["CANVAS",1]])});(0,_vitest.it)("does not add React nodes twice",()=>{setup("<button>Save</button>");(0,_vitest.expect)((0,_domInstances.collectDOMInstances)(document.body,new Set([document.querySelector("button")]))).toEqual([])});(0,_vitest.it)("skips Buoy, hidden pages, and SVG paths",()=>{setup('<div data-buoy-portal-host><div data-buoy-root><button>Buoy</button></div></div><div data-debug-overlay><div></div></div><main hidden><button>Hidden</button></main><div class="ion-page-hidden"><button>Old page</button></div><svg><path/></svg><button style="visibility:hidden">Hidden</button>');(0,_vitest.expect)((0,_domInstances.collectDOMInstances)(document.body,new Set)).toEqual([])})});
1
+ "use strict";var _vitest=require("vitest");var _domInstances=require("./domInstances");(0,_vitest.afterEach)(()=>{document.body.innerHTML=""});function setup(t){document.body.innerHTML=t;for(const e of Array.from(document.body.querySelectorAll("*"))){e.getBoundingClientRect=()=>({x:0,y:0,width:100,height:50})}}(0,_vitest.describe)("plain DOM borders",()=>{(0,_vitest.it)("finds app nodes without a React root",()=>{setup('<main><button data-testid="save">Save</button><canvas></canvas></main>');(0,_vitest.expect)((0,_domInstances.collectDOMInstances)(document.body,new Set).map(t=>[t.instance.tagName,t.depth])).toEqual([["MAIN",0],["BUTTON",1],["CANVAS",1]])});(0,_vitest.it)("does not add React nodes twice",()=>{setup("<button>Save</button>");(0,_vitest.expect)((0,_domInstances.collectDOMInstances)(document.body,new Set([document.querySelector("button")]))).toEqual([])});(0,_vitest.it)("skips Buoy, hidden pages, and SVG paths",()=>{setup('<div data-buoy-portal-host><div data-buoy-root><button>Buoy</button></div></div><div data-debug-overlay><div></div></div><main hidden><button>Hidden</button></main><div class="ion-page-hidden"><button>Old page</button></div><svg><path/></svg><button style="visibility:hidden">Hidden</button>');(0,_vitest.expect)((0,_domInstances.collectDOMInstances)(document.body,new Set)).toEqual([])});(0,_vitest.it)("borders a node whose hidden attribute the page's CSS overrides",()=>{setup('<div hidden style="display:block"><input placeholder="Search"></div>');(0,_vitest.expect)((0,_domInstances.collectDOMInstances)(document.body,new Set).map(t=>t.instance.tagName)).toEqual(["DIV","INPUT"])})});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.debugBordersSyncAdapter=void 0;const DebugBordersManager=require("../debug-borders/utils/DebugBordersManager");const debugBordersSyncAdapter=exports.debugBordersSyncAdapter={version:1,getSnapshot:()=>({mode:DebugBordersManager.getMode()}),subscribe:e=>DebugBordersManager.subscribe(e),actions:{cycleMode:()=>{DebugBordersManager.cycle()},setMode:e=>{DebugBordersManager.setMode(e.mode)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.debugBordersSyncAdapter=void 0;var _modes=require("./modes");const DebugBordersManager=require("../debug-borders/utils/DebugBordersManager");const debugBordersSyncAdapter=exports.debugBordersSyncAdapter={version:1,getSnapshot:()=>({mode:DebugBordersManager.getMode()}),subscribe:e=>DebugBordersManager.subscribe(e),actions:{cycleMode:()=>{DebugBordersManager.cycle()},setMode:e=>{DebugBordersManager.setMode((0,_modes.assertMode)(e?.mode))}}};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.assertMode=assertMode;const MODES=["off","borders","labels"];function assertMode(e){if(!MODES.includes(e)){throw new Error(`Unknown mode "${String(e)}". Use off, borders or labels.`)}return e}
@@ -0,0 +1 @@
1
+ "use strict";var _vitest=require("vitest");var _modes=require("./modes");(0,_vitest.describe)("debug borders setMode",()=>{(0,_vitest.it)("refuses a mode it doesn't know",()=>{(0,_vitest.expect)(()=>(0,_modes.assertMode)("all")).toThrow('Unknown mode "all". Use off, borders or labels.');(0,_vitest.expect)(()=>(0,_modes.assertMode)(void 0)).toThrow('Unknown mode "undefined"')});(0,_vitest.it)("takes the three real modes",()=>{(0,_vitest.expect)(["off","borders","labels"].map(_modes.assertMode)).toEqual(["off","borders","labels"])})});
@@ -1 +1 @@
1
- "use strict";export function collectDOMInstances(t,o){const l=[];const s=t.ownerDocument.createTreeWalker(t,1,{acceptNode(n){const i=n;if(i.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, [hidden], .ion-page-hidden"))return 2;return 1}});let e=s.nextNode();while(e){if(!o.has(e)){const n=t.ownerDocument.defaultView?.getComputedStyle(e);const i=e.getBoundingClientRect();if(n?.visibility!=="hidden"&&n?.visibility!=="collapse"&&i.width>0&&i.height>0){let c=0;for(let a=e.parentElement;a&&a!==t;a=a.parentElement)c++;l.push({instance:e,fiber:null,depth:c})}}e=s.nextNode()}return l}
1
+ "use strict";export function collectDOMInstances(t,o){const a=[];const s=t.ownerDocument.createTreeWalker(t,1,{acceptNode(i){const n=i;if(n.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, .ion-page-hidden"))return 2;if(t.ownerDocument.defaultView?.getComputedStyle(n).display==="none")return 2;return 1}});let e=s.nextNode();while(e){if(!o.has(e)){const i=t.ownerDocument.defaultView?.getComputedStyle(e);const n=e.getBoundingClientRect();if(i?.visibility!=="hidden"&&i?.visibility!=="collapse"&&n.width>0&&n.height>0){let c=0;for(let l=e.parentElement;l&&l!==t;l=l.parentElement)c++;a.push({instance:e,fiber:null,depth:c})}}e=s.nextNode()}return a}
@@ -1 +1 @@
1
- "use strict";import{afterEach as i,describe as u,expect as e,it as o}from"vitest";import{collectDOMInstances as n}from"./domInstances";i(()=>{document.body.innerHTML=""});function d(t){document.body.innerHTML=t;for(const a of Array.from(document.body.querySelectorAll("*"))){a.getBoundingClientRect=()=>({x:0,y:0,width:100,height:50})}}u("plain DOM borders",()=>{o("finds app nodes without a React root",()=>{d('<main><button data-testid="save">Save</button><canvas></canvas></main>');e(n(document.body,new Set).map(t=>[t.instance.tagName,t.depth])).toEqual([["MAIN",0],["BUTTON",1],["CANVAS",1]])});o("does not add React nodes twice",()=>{d("<button>Save</button>");e(n(document.body,new Set([document.querySelector("button")]))).toEqual([])});o("skips Buoy, hidden pages, and SVG paths",()=>{d('<div data-buoy-portal-host><div data-buoy-root><button>Buoy</button></div></div><div data-debug-overlay><div></div></div><main hidden><button>Hidden</button></main><div class="ion-page-hidden"><button>Old page</button></div><svg><path/></svg><button style="visibility:hidden">Hidden</button>');e(n(document.body,new Set)).toEqual([])})});
1
+ "use strict";import{afterEach as i,describe as u,expect as e,it as o}from"vitest";import{collectDOMInstances as d}from"./domInstances";i(()=>{document.body.innerHTML=""});function n(t){document.body.innerHTML=t;for(const a of Array.from(document.body.querySelectorAll("*"))){a.getBoundingClientRect=()=>({x:0,y:0,width:100,height:50})}}u("plain DOM borders",()=>{o("finds app nodes without a React root",()=>{n('<main><button data-testid="save">Save</button><canvas></canvas></main>');e(d(document.body,new Set).map(t=>[t.instance.tagName,t.depth])).toEqual([["MAIN",0],["BUTTON",1],["CANVAS",1]])});o("does not add React nodes twice",()=>{n("<button>Save</button>");e(d(document.body,new Set([document.querySelector("button")]))).toEqual([])});o("skips Buoy, hidden pages, and SVG paths",()=>{n('<div data-buoy-portal-host><div data-buoy-root><button>Buoy</button></div></div><div data-debug-overlay><div></div></div><main hidden><button>Hidden</button></main><div class="ion-page-hidden"><button>Old page</button></div><svg><path/></svg><button style="visibility:hidden">Hidden</button>');e(d(document.body,new Set)).toEqual([])});o("borders a node whose hidden attribute the page's CSS overrides",()=>{n('<div hidden style="display:block"><input placeholder="Search"></div>');e(d(document.body,new Set).map(t=>t.instance.tagName)).toEqual(["DIV","INPUT"])})});
@@ -1 +1 @@
1
- "use strict";const e=require("../debug-borders/utils/DebugBordersManager");export const debugBordersSyncAdapter={version:1,getSnapshot:()=>({mode:e.getMode()}),subscribe:r=>e.subscribe(r),actions:{cycleMode:()=>{e.cycle()},setMode:r=>{e.setMode(r.mode)}}};
1
+ "use strict";import{assertMode as s}from"./modes";const e=require("../debug-borders/utils/DebugBordersManager");export const debugBordersSyncAdapter={version:1,getSnapshot:()=>({mode:e.getMode()}),subscribe:r=>e.subscribe(r),actions:{cycleMode:()=>{e.cycle()},setMode:r=>{e.setMode(s(r?.mode))}}};
@@ -0,0 +1 @@
1
+ "use strict";const e=["off","borders","labels"];export function assertMode(r){if(!e.includes(r)){throw new Error(`Unknown mode "${String(r)}". Use off, borders or labels.`)}return r}
@@ -0,0 +1 @@
1
+ "use strict";import{describe as s,expect as e,it as r}from"vitest";import{assertMode as o}from"./modes";s("debug borders setMode",()=>{r("refuses a mode it doesn't know",()=>{e(()=>o("all")).toThrow('Unknown mode "all". Use off, borders or labels.');e(()=>o(void 0)).toThrow('Unknown mode "undefined"')});r("takes the three real modes",()=>{e(["off","borders","labels"].map(o)).toEqual(["off","borders","labels"])})});
@@ -0,0 +1,4 @@
1
+ export type DebugBordersMode = "off" | "borders" | "labels";
2
+ /** An unknown mode used to be stored as-is and drew nothing. */
3
+ export declare function assertMode(mode: unknown): DebugBordersMode;
4
+ //# sourceMappingURL=modes.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=modes.test.d.ts.map
package/lib/web/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";var re=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var We=Object.prototype.hasOwnProperty;var je=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ae=(e,t)=>()=>(e&&(t=e(e=0)),t);var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ce=(e,t)=>{for(var n in t)re(e,n,{get:t[n],enumerable:true})},ie=(e,t,n,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ze(t))!We.call(e,l)&&l!==n&&re(e,l,{get:()=>t[l],enumerable:!(p=_e(t,l))||p.enumerable});return e},Ke=(e,t,n)=>(ie(e,t,"default"),n&&ie(n,t,"default"));var Ue=e=>ie(re({},"__esModule",{value:true}),e);var $e,E=ae(()=>{"use strict";$e=(()=>{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)});import{loadToolModule as qe}from"@buoy-gg/shared-ui/web/utils";var K=z((e,t)=>{"use strict";E();var n="off",p=new Set,l=["off","borders","labels"],m=["off","borders"],h=null,u=false;function i(){if(!u){u=true;try{let c=qe("@buoy-gg/license");c&&typeof c.isPro=="function"&&(h=c.isPro)}catch{h=null}}}function a(){if(i(),h)try{return h()}catch{return false}return false}function o(){return a()?l:m}var d=l;function g(c){return p.add(c),c(n),()=>{p.delete(c)}}function s(){p.forEach(c=>{try{c(n)}catch(y){console.error("[DebugBorders] Error in listener:",y)}})}function f(c){return n===c?true:c==="labels"&&!a()?(console.warn("[DebugBorders] Labels mode requires React Buoy Pro. Upgrade at https://buoy.gg/pro"),false):(n=c,s(),true)}function w(){return n}function S(){let c=o(),y=c.indexOf(n);if(y===-1){f("off");return}let O=(y+1)%c.length;f(c[O])}function C(){f("borders")}function x(){f("off")}function T(){S()}function B(){return n!=="off"}function L(){return n==="labels"&&a()}function G(){return a()}function r(){return o()}function b(c){c?C():x()}t.exports={subscribe:g,enable:C,disable:x,toggle:T,cycle:S,isEnabled:B,showLabels:L,setEnabled:b,getMode:w,setMode:f,isProEnabled:G,getAvailableModes:r,MODE_CYCLE:d}});function Ye(e,t){let n=[],p=e.ownerDocument.createTreeWalker(e,1,{acceptNode(m){return m.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, [hidden], .ion-page-hidden")?2:1}}),l=p.nextNode();for(;l;){if(!t.has(l)){let m=e.ownerDocument.defaultView?.getComputedStyle(l),h=l.getBoundingClientRect();if(m?.visibility!=="hidden"&&m?.visibility!=="collapse"&&h.width>0&&h.height>0){let u=0;for(let i=l.parentElement;i&&i!==e;i=i.parentElement)u++;n.push({instance:l,fiber:null,depth:u})}}l=p.nextNode()}return n}var Je=ae(()=>{"use strict";E()});import{getDOMNodeHandle as Xe,isDOMElement as ue}from"@buoy-gg/shared-ui/web/utils";var X=z((e,t)=>{"use strict";E();Je();function n(){if(typeof globalThis>"u")return null;let r=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return r||null}function p(){let r=n();if(!r)return[];if(!r.getFiberRoots)return[];let b=new Set,c=r.renderers?.keys?Array.from(r.renderers.keys()):[1];for(let y of c)try{r.getFiberRoots(y)?.forEach(O=>b.add(O))}catch{}return[...b]}var l={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16,IncompleteClassComponent:17,DehydratedFragment:18,SuspenseListComponent:19,ScopeComponent:21,OffscreenComponent:22,LegacyHiddenComponent:23,CacheComponent:24,TracingMarkerComponent:25},m=new Set(["FloatingTools","FloatingDevTools","FloatingMenu","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","MinimizedToolsStack","GlitchToolButton","DefaultConfigProvider","JsModalComponent","JsModal","ModalHeader","DraggableHeader","DragIndicator","CornerHandle","WindowControls","HighlightUpdatesModal","HighlightUpdatesOverlay","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderCauseBadge","DebugBordersStandaloneOverlay","DebugBordersModal","ImageOverlayModal","ImageOverlayStandalone","StorageBrowser","StorageModal","GameUIStorageBrowser","StorageEventListener","StorageEventFilterView","NetworkMonitor","NetworkModal","NetworkRequestList","NetworkRequestDetail","RouteEventsModal","RouteEventsList","EnvSwitcher","EnvSwitcherModal","TabSelector","SectionHeader","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","ExpandablePopover","Divider","UserStatus","GripVerticalIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage"]),h=["JsModal","HighlightUpdates","RenderList","RenderDetail","DebugBorders","ImageOverlay","Storage","Network","RouteEvents","EnvSwitcher","Floating","Minimized","Expandable","DevTools","GameUI"],u=new Set(["debug-borders-overlay","floating-devtools-root","dial-devtools-root","jsmodal-root","highlight-updates-overlay","image-overlay-standalone","__rn_buoy__highlight-modal","logbox_inspector","logbox"]),i=new Map,a=500;function o(r){let b=Xe(r);return b!==null?b:r?typeof r._nativeTag=="number"?r._nativeTag:typeof r.canonical?._nativeTag=="number"?r.canonical._nativeTag:typeof r.__nativeTag=="number"?r.__nativeTag:null:null}function d(r){if(!r)return false;if(u.has(r))return true;let b=r.charCodeAt(0);return!!(b===95&&(r.startsWith("__highlight_")||r.startsWith("__rn_buoy__"))||b===108&&r.startsWith("logbox"))}function g(r){if(!r)return null;let b=r.type;if(b){if(typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;if(b.displayName)return b.displayName;if(b.name)return b.name}let c=r.elementType;if(c){if(typeof c=="function")return c.displayName||c.name||null;if(c.displayName)return c.displayName;if(c.name)return c.name}return null}function s(r,b){if(ue(b)&&b.closest("[data-buoy-root]"))return true;let c=o(b);if(c!=null){let M=i.get(c);if(M!==void 0)return M}let y=false,O=r.pendingProps?.nativeID||r.memoizedProps?.nativeID;if(d(O))y=true;else{let M=r,k=0;for(;M&&k<30;){let ne=g(M);if(ne){if(m.has(ne)){y=true;break}for(let Ge of h)if(ne.startsWith(Ge)){y=true;break}if(y)break}let Oe=M.pendingProps?.nativeID||M.memoizedProps?.nativeID;if(d(Oe)){y=true;break}M=M.return,k++}}if(y&&c!=null){if(i.size>=a){let M=Array.from(i.keys());for(let k=0;k<a/2;k++)i.delete(M[k])}i.set(c,y)}return y}function f(){i.clear()}function w(r){return r.tag!==l.OffscreenComponent?false:r.memoizedState!==null}function S(r){let b=r.memoizedProps;return b?b.activityState===0:false}function C(r){return ue(r)?r.tagName.toLowerCase():r?r.canonical?.viewConfig?.uiViewClassName?r.canonical.viewConfig.uiViewClassName:r.viewConfig?.uiViewClassName?r.viewConfig.uiViewClassName:null:null}function x(r){let b=C(r);return b?b.startsWith("RNSVG"):false}function T(r,b,c=0,y=new Set){if(r&&!y.has(r)&&(y.add(r),!(c>500))){if(w(r)){r.sibling&&T(r.sibling,b,c,y);return}if(S(r)){r.sibling&&T(r.sibling,b,c,y);return}b(r,c),r.child&&T(r.child,b,c+1,y),r.sibling&&T(r.sibling,b,c,y)}}function B(){let r=p(),b=[];if(r.forEach((c,y)=>{T(c.current,(O,M)=>{if(O.tag===l.HostComponent){let k=O.stateNode;if(s(O,k)||x(k))return;k&&b.push({instance:k,fiber:O,depth:M})}})}),typeof document<"u"&&document.body){let c=new Set(b.map(({instance:y})=>y));b.push(...Ye(document.body,c))}return b}function L(){let r=n();return!(!r||!r.getFiberRoots)}function G(){let r=n();return r?{available:true,hasAgent:!!r.reactDevtoolsAgent,hasFiberRoots:typeof r.getFiberRoots=="function",rendererCount:r.renderers?.size??0,rootCount:p().length,hookKeys:Object.keys(r)}:{available:false,reason:"Hook not found on global object"}}t.exports={getReactDevToolsHook:n,getFiberRoots:p,traverseFiberTree:T,getAllHostComponentInstances:B,isReactDevToolsAvailable:L,getReactDevToolsDiagnostics:G,isHiddenOffscreen:w,isInactiveScreen:S,isSVGComponent:x,getNativeViewClassName:C,isDevToolsComponent:s,isDevToolsNativeID:d,getComponentName:g,clearDevToolsCache:f,FiberTags:l,DEV_TOOLS_COMPONENT_NAMES:m,DEV_TOOLS_NATIVE_IDS:u}});var de={};ce(de,{VIEW_TYPE_MAP:()=>_,default:()=>ye,getAllComponentNames:()=>ge,getAllNativeViewTypes:()=>be,getComponentDisplayName:()=>pe,getNativeViewType:()=>fe,isKnownViewType:()=>me});function pe(e){return _[e]||e}function fe(e){for(let[t,n]of Object.entries(_))if(n===e)return t;return null}function me(e){return e in _}function be(){return Object.keys(_)}function ge(){return[...new Set(Object.values(_))]}var _,ye,Ze=ae(()=>{"use strict";E();_={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"};ye={VIEW_TYPE_MAP:_,getComponentDisplayName:pe,getNativeViewType:fe,isKnownViewType:me,getAllNativeViewTypes:be,getAllComponentNames:ge}});var he=z((e,t)=>{"use strict";E();var{getComponentDisplayName:n}=(Ze(),Ue(de)),{getNativeViewClassName:p,getComponentName:l}=X(),m={testID:{label:"test",color:"#10b981"},nativeID:{label:"native",color:"#f59e0b"},component:{label:"comp",color:"#a855f7"},accessibilityLabel:{label:"a11y",color:"#ec4899"},viewType:{label:"view",color:"#6b7280"}};function h(a,o){let d=a?.memoizedProps||a?.pendingProps||{testID:o?.getAttribute?.("data-testid"),nativeID:o?.id,accessibilityLabel:o?.getAttribute?.("aria-label"),accessibilityRole:o?.getAttribute?.("role")},g=p(o)||"Unknown",s=n(g),f=l(a),w=d.testID||d["data-testid"]||null,S=d.nativeID||null,C=d.accessibilityLabel||d.accessible?.label||d["aria-label"]||null,x=d.accessibilityRole||d.role||null,T=d.accessibilityHint||null,B=d.accessibilityState||null,L=null;if(d.style)try{L=Array.isArray(d.style)?Object.assign({},...d.style.filter(Boolean)):d.style}catch{L=null}let G=a?.tag,r=a?.key,b=null,c=a?.return;for(;c&&!(c.type&&typeof c.type=="function"&&(b=c.type.displayName||c.type.name||null,b));)c=c.return;let y={viewType:g,displayName:s,componentName:f,parentComponentName:b,testID:w,nativeID:S,accessibilityLabel:C,accessibilityRole:x,accessibilityHint:T,accessibilityState:B,fiberTag:G,fiberKey:r,styleInfo:L,primaryLabel:null,primaryType:null,primaryColor:null};return w?(y.primaryLabel=w,y.primaryType="testID",y.primaryColor=m.testID.color):C?(y.primaryLabel=C,y.primaryType="accessibilityLabel",y.primaryColor=m.accessibilityLabel.color):f?(y.primaryLabel=f,y.primaryType="component",y.primaryColor=m.component.color):S?(y.primaryLabel=S,y.primaryType="nativeID",y.primaryColor=m.nativeID.color):(y.primaryLabel=s,y.primaryType="viewType",y.primaryColor=m.viewType.color),y}function u(a,o=20){return a?a.length<=o?a:a.substring(0,o-1)+"\u2026":""}function i(a){let o=m[a];return o?o.label+":":""}t.exports={extractComponentInfo:h,getShortLabel:u,getLabelPrefix:i,IDENTIFIER_CONFIG:m}});var ve=z((e,t)=>{"use strict";E();var n=null;try{n=je("./DebugInfo").addLog}catch{}function p(i){return new Promise(a=>{try{let o=i;if(i.canonical&&(i.canonical.publicInstance?o=i.canonical.publicInstance:o=i.canonical),typeof o.getBoundingClientRect=="function"){let s=o.getBoundingClientRect();if(s&&typeof s.x=="number"&&typeof s.y=="number"&&typeof s.width=="number"&&typeof s.height=="number"&&s.width>=0&&s.height>=0){a({x:s.x,y:s.y,width:s.width,height:s.height});return}}let d=typeof globalThis<"u"?globalThis.nativeFabricUIManager:void 0,g=typeof o.measure=="function"?s=>o.measure(s):i.node&&typeof d?.measure=="function"?s=>d.measure(i.node,s):null;if(g){let s=setTimeout(()=>{a(null)},100);g((f,w,S,C,x,T)=>{clearTimeout(s),x!=null&&T!=null&&S!=null&&C!=null&&S>=0&&C>=0?a({x,y:T,width:S,height:C}):a(null)});return}a(null)}catch{a(null)}})}var{extractComponentInfo:l}=he();async function m(i){return(await Promise.all(i.map(async({instance:a,fiber:o,depth:d})=>{let g=await p(a);if(g){let s=l(o,a);return{...g,depth:d,componentInfo:s}}return null}))).filter(a=>a!=null)}function h(i){return{hasFabricBoundingRect:typeof i.getBoundingClientRect=="function",hasPaperMeasure:typeof i.measure=="function",hasNode:i.node!=null}}function u(i){let a={fabric:0,paper:0,none:0};return i.forEach(({instance:o})=>{let d=h(o);d.hasFabricBoundingRect?a.fabric++:d.hasPaperMeasure?a.paper++:a.none++}),a}t.exports={measureInstance:p,measureInstances:m,getMeasurementCapabilities:h,getMeasurementStats:u}});var Se=z((e,t)=>{"use strict";E();function n(o,d,g){let s=o/360,f=d/100,w=g/100,S,C,x;if(f===0)S=C=x=w;else{let B=(r,b,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<.16666666666666666?r+(b-r)*6*c:c<.5?b:c<.6666666666666666?r+(b-r)*(.6666666666666666-c)*6:r),L=w<.5?w*(1+f):w+f-w*f,G=2*w-L;S=B(G,L,s+1/3),C=B(G,L,s),x=B(G,L,s-1/3)}let T=B=>{let L=Math.round(B*255).toString(16);return L.length===1?"0"+L:L};return`#${T(S)}${T(C)}${T(x)}`}function p(o){let d=(0+o*137.508)%360;return n(d,70,50)}function l(){let o=Math.random()*360;return n(o,70,50)}function m(o){let d=[];for(let g=0;g<o;g++)d.push(p(g));return d}var h=["#FF5733","#33FF57","#3357FF","#FF33F5","#F5FF33","#33FFF5","#FF8333","#8333FF","#33FF83","#FF3383"];function u(o){return h[o%h.length]}function i(o,d=1){let g=parseInt(o.slice(1,3),16),s=parseInt(o.slice(3,5),16),f=parseInt(o.slice(5,7),16);return`rgba(${g}, ${s}, ${f}, ${d})`}function a(o){let d=parseInt(o.slice(1,3),16),g=parseInt(o.slice(3,5),16),s=parseInt(o.slice(5,7),16);return 255<<24|d<<16|g<<8|s}t.exports={getColorForDepth:p,getRandomColor:l,generateColorPalette:m,getColorFromPalette:u,hslToHex:n,hexToRgba:i,hexToProcessColor:a,PREDEFINED_PALETTE:h}});var Qe=z((e,t)=>{"use strict";E();var n={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function p(u,i){let a=n.PADDING,o=u.x-a,d=u.x+u.width+a,g=u.y-a,s=u.y+u.height+a,f=i.x-a,w=i.x+i.width+a,S=i.y-a,C=i.y+i.height+a;return!(d<f||o>w||s<S||g>C)}function l(u){return u?u.length*5+8:0}function m(u){if(!u||u.length===0)return u;let i=u.filter(g=>{let s=g.componentInfo;return s&&(s.testID||s.accessibilityLabel)}),a=u.map((g,s)=>{let f=g.componentInfo,w=f&&(f.testID||f.accessibilityLabel),S=w?f.primaryLabel:"",C=l(S);return{index:s,hasValidLabel:w,x:g.x,y:g.y-n.LABEL_HEIGHT,width:C,height:n.LABEL_HEIGHT,offsetY:0}}),o=a.map((g,s)=>s).filter(g=>a[g].hasValidLabel).sort((g,s)=>{let f=u[g],w=u[s];return Math.abs(f.y-w.y)>10?f.y-w.y:f.x-w.x}),d=[];for(let g of o){let s=a[g];if(s.width===0)continue;let f=0,w=true,S=0,C=Math.ceil(n.MAX_VERTICAL_OFFSET/n.LABEL_HEIGHT);for(;w&&S<C;){let x={x:s.x,y:s.y-f,width:s.width,height:s.height};w=d.some(T=>p(x,T)),w&&(f+=n.LABEL_HEIGHT,S++)}s.offsetY=f,d.push({x:s.x,y:s.y-f,width:s.width,height:s.height})}return u.map((g,s)=>({...g,labelOffsetY:a[s].offsetY}))}function h(u){if(!u||u.length<2)return false;for(let i=0;i<Math.min(u.length,20);i++)for(let a=i+1;a<Math.min(u.length,20);a++){let o=u[i],d=u[a];if(Math.abs(o.y-d.y)<n.LABEL_HEIGHT*2&&!(o.x+100<d.x||d.x+100<o.x))return true}return false}t.exports={resolveOverlappingLabels:m,rectsOverlap:p,estimateLabelWidth:l,mightHaveOverlaps:h,CONFIG:n}});E();E();import{useState as we,useEffect as Ce}from"react";import{Layers as xe}from"@buoy-gg/shared-ui/web";E();import Te,{useEffect as Ie,useState as Z,useCallback as Re}from"react";var Ve={};ce(Ve,{AccessibilityInfo:()=>nt,ActivityIndicator:()=>ao,Alert:()=>so,Animated:()=>rt,AppRegistry:()=>it,AppState:()=>lt,Appearance:()=>at,BackHandler:()=>st,Button:()=>io,CheckBox:()=>Tt,Clipboard:()=>ct,DeviceEventEmitter:()=>Gt,Dimensions:()=>ut,Easing:()=>dt,FlatList:()=>It,I18nManager:()=>pt,Image:()=>Rt,ImageBackground:()=>Vt,InteractionManager:()=>mt,Keyboard:()=>ft,KeyboardAvoidingView:()=>Et,LayoutAnimation:()=>bt,Linking:()=>gt,LogBox:()=>Ot,Modal:()=>no,NativeEventEmitter:()=>yt,NativeModules:()=>ot,PanResponder:()=>ht,Picker:()=>Nt,PixelRatio:()=>vt,Platform:()=>St,Pressable:()=>to,ProgressBar:()=>Lt,RefreshControl:()=>Dt,SafeAreaView:()=>Bt,ScrollView:()=>oo,SectionList:()=>Mt,Share:()=>wt,StatusBar:()=>At,StyleSheet:()=>U,Switch:()=>ro,Text:()=>I,TextInput:()=>Zt,Touchable:()=>Ft,TouchableHighlight:()=>Qt,TouchableNativeFeedback:()=>Pt,TouchableOpacity:()=>Q,TouchableWithoutFeedback:()=>eo,UIManager:()=>Ct,Vibration:()=>xt,View:()=>F,VirtualizedList:()=>kt,YellowBox:()=>Ht,findNodeHandle:()=>lo,unstable_createElement:()=>tt,useColorScheme:()=>_t,useLocaleContext:()=>zt,useWindowDimensions:()=>Wt});E();Ke(Ve,et);import*as et from"react-native-web";import{unstable_createElement as tt,NativeModules as ot,AccessibilityInfo as nt,Animated as rt,Appearance as at,AppRegistry as it,AppState as lt,BackHandler as st,Clipboard as ct,Dimensions as ut,Easing as dt,I18nManager as pt,Keyboard as ft,InteractionManager as mt,LayoutAnimation as bt,Linking as gt,NativeEventEmitter as yt,PanResponder as ht,PixelRatio as vt,Platform as St,Share as wt,StyleSheet as U,UIManager as Ct,Vibration as xt,CheckBox as Tt,FlatList as It,Image as Rt,ImageBackground as Vt,KeyboardAvoidingView as Et,Picker as Nt,ProgressBar as Lt,RefreshControl as Dt,SafeAreaView as Bt,SectionList as Mt,StatusBar as At,Touchable as Ft,TouchableNativeFeedback as Pt,VirtualizedList as kt,YellowBox as Ht,LogBox as Ot,DeviceEventEmitter as Gt,useColorScheme as _t,useLocaleContext as zt,useWindowDimensions as Wt}from"react-native-web";import*as A from"react-native-web";import{createElement as le,forwardRef as Ee,useCallback as jt,useRef as Kt}from"react";E();import{useEffect as Ut,useState as $t}from"react";import{createPortal as qt}from"react-dom";E();var Yt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Jt}from"react/jsx-runtime";var $=Symbol.for("@buoy-gg/portal-host"),Ne=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function Le(){let e=document;if(e[$])return e[$].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Yt});let n=()=>{let o=document.fullscreenElement,d=o&&o.tagName!=="CANVAS"?o:document.body;t.parentElement!==d&&d.appendChild(t)},p=new Map,l=o=>{(!t.contains(o.target)||!Ne(o.target))&&p.set(o.code||o.key,{key:o.key,code:o.code,location:o.location,keyCode:o.keyCode,which:o.which,altKey:o.altKey,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey})},m=o=>{p.delete(o.code||o.key)},h=()=>p.clear(),u=()=>{let o=[...p.values()];p.clear();for(let d of o)document.dispatchEvent(new KeyboardEvent("keyup",{...d,bubbles:true}))},i=o=>{Ne(o.target)&&o.stopPropagation()},a=o=>o.stopPropagation();return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",l,true),document.addEventListener("keyup",m,true),window.addEventListener("blur",h),t.addEventListener("focusin",u),t.addEventListener("keydown",i),t.addEventListener("keyup",i),t.addEventListener("keypress",i),t.addEventListener("wheel",a,{passive:true}),e[$]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",l,true),document.removeEventListener("keyup",m,true),window.removeEventListener("blur",h),t.remove(),delete e[$]}},t}function Xt({children:e}){let[t,n]=$t(null);return Ut(()=>{let p=Le(),l=document[$];return l.users++,n(p),()=>{--l.users===0&&l.dispose()}},[]),t?qt(Jt("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}function P(e){let t=Ee((p,l)=>{let{accessibilityState:m,accessibilityValue:h,...u}=p;for(let i of["busy","checked","disabled","expanded","selected"])m?.[i]!==void 0&&u[`aria-${i}`]===void 0&&(u[`aria-${i}`]=m[i]);for(let[i,a]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))h?.[i]!==void 0&&u[`aria-${a}`]===void 0&&(u[`aria-${a}`]=h[i]);return le(e,{...u,ref:l})}),n=e.State;return n&&Object.assign(t,{State:n}),t.displayName=e.displayName??e.name??"NativeWebView",t}var F=P(A.View),I=P(A.Text),Zt=P(A.TextInput),Q=P(A.TouchableOpacity),Qt=P(A.TouchableHighlight),eo=P(A.TouchableWithoutFeedback),to=P(A.Pressable),oo=P(A.ScrollView),De=Ee((e,t)=>{let n=Kt(null),p=jt(l=>{if(l){let m=l;for(;m.parentElement&&m.parentElement!==document.body;)m=m.parentElement;m.parentElement===document.body&&(n.current=m,Object.assign(m.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Le().appendChild(m))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof t=="function"?t(l):t&&(t.current=l)},[t]);return le(Xt,null,le(A.Modal,{...e,ref:p}))});De.displayName="Modal";var no=P(De),ro=P(A.Switch),ao=P(A.ActivityIndicator),io=P(A.Button),lo=A.findNodeHandle,so={alert(e,t,n,p){if(typeof document>"u")return;let l=document.createElement("dialog");l.dataset.buoyRoot="",l.setAttribute("aria-label",e),l.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 m=document.createElement("h2");if(m.textContent=e,m.style.cssText="font-size:18px;margin:0 0 12px",l.appendChild(m),t){let a=document.createElement("p");a.textContent=t,a.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",l.appendChild(a)}let h=document.createElement("div");h.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let u=n?.length?n:[{text:"OK"}],i=()=>{l.close?.(),l.remove()};for(let a of u){let o=document.createElement("button");o.type="button",o.textContent=a.text??"OK",o.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${a.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,o.onclick=()=>{i(),a.onPress?.()},h.appendChild(o)}l.addEventListener("cancel",a=>{a.preventDefault(),p?.cancelable!==false&&(i(),p?.onDismiss?.())}),l.appendChild(h),document.body.appendChild(l),l.showModal?l.showModal():l.setAttribute("open","")}};import{monoFont as q}from"@buoy-gg/shared-ui/web";import{JsModal as Be,devToolsStorageKeys as co}from"@buoy-gg/shared-ui/web";import{DataViewer as ee}from"@buoy-gg/shared-ui/web/dataViewer";import{loadToolModule as uo}from"@buoy-gg/shared-ui/web/utils";import{Fragment as Me,jsx as v,jsxs as W}from"react/jsx-runtime";var po=co.debugBorders.infoModal(),fo=K(),{getAllHostComponentInstances:mo}=X(),{measureInstances:bo}=ve(),{getColorForDepth:go}=Se(),{getShortLabel:Jo}=he(),{resolveOverlappingLabels:yo}=Qe(),Y;function ho(){if(Y!==void 0)return Y;try{Y=uo("@buoy-gg/core").useDevToolsVisibility??null}catch{Y=null}return Y??null}function N({label:e,value:t,color:n}){if(t==null)return null;let p;if(typeof t=="object")try{p=JSON.stringify(t,null,2)}catch{p=String(t)}else p=String(t);return W(F,{style:H.row,children:[v(I,{style:H.label,children:e}),v(I,{style:[H.value,n?{color:n}:null],children:p})]})}function vo({title:e}){return v(F,{style:Ae.container,children:v(I,{style:Ae.title,numberOfLines:1,children:e})})}function So({info:e,rect:t}){return W(F,{style:H.content,children:[v(I,{style:H.sectionTitle,children:"Identifiers"}),v(N,{label:"testID",value:e.testID,color:"#10b981"}),v(N,{label:"accessibilityLabel",value:e.accessibilityLabel,color:"#ec4899"}),v(N,{label:"nativeID",value:e.nativeID,color:"#f59e0b"}),v(N,{label:"key",value:e.fiberKey}),v(I,{style:H.sectionTitle,children:"Component"}),v(N,{label:"Component Name",value:e.componentName,color:"#a855f7"}),v(N,{label:"Parent Component",value:e.parentComponentName}),v(N,{label:"Display Name",value:e.displayName}),v(N,{label:"Native View Type",value:e.viewType}),v(N,{label:"Fiber Tag",value:e.fiberTag}),v(I,{style:H.sectionTitle,children:"Position & Size"}),v(N,{label:"X",value:Math.round(t.x)}),v(N,{label:"Y",value:Math.round(t.y)}),v(N,{label:"Width",value:Math.round(t.width)}),v(N,{label:"Height",value:Math.round(t.height)}),v(N,{label:"Depth",value:t.depth}),(e.accessibilityRole||e.accessibilityHint||e.accessibilityState)&&W(Me,{children:[v(I,{style:H.sectionTitle,children:"Accessibility"}),v(N,{label:"Role",value:e.accessibilityRole}),v(N,{label:"Hint",value:e.accessibilityHint}),e.accessibilityState&&ee?v(ee,{title:"",data:e.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(N,{label:"State",value:e.accessibilityState})]}),e.styleInfo&&W(Me,{children:[v(I,{style:H.sectionTitle,children:"Styles"}),ee?v(ee,{title:"",data:e.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(F,{style:H.codeBlock,children:v(I,{style:H.codeText,children:JSON.stringify(e.styleInfo,null,2)})})]})]})}function wo(){let[e,t]=Z("off"),[n,p]=Z([]),[l,m]=Z(null),[h,u]=Z(false),i=Te.useRef(false),a=ho()?.()?.isDevToolsActive??false,o=Re(f=>{m(f),u(true)},[]),d=Re(()=>{u(false),m(null)},[]),g=e!=="off"&&!a,s=e==="labels"&&!a;return Ie(()=>fo.subscribe(f=>{t(f)}),[]),Ie(()=>{if(!g){p([]);return}let f=true,w,S=async()=>{if(!(!f||i.current)){i.current=true;try{let x=mo();if(x.length===0){i.current=false;return}let T=await bo(x);if(f){let B=s?yo(T):T;p(B)}}catch(x){console.error("[Buoy]","[DebugBorders] Error updating measurements:",x)}finally{i.current=false}}},C=setTimeout(()=>{S()},500);return w=setInterval(S,2e3),()=>{f=false,clearTimeout(C),clearInterval(w),i.current=false}},[g,s,n.length]),g?W(F,{style:te.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[n.map((f,w)=>{let S=f.componentInfo,C=S&&(S.testID||S.accessibilityLabel);if(s&&!C)return null;let x=s&&S?S.primaryColor:go(f.depth);return W(Te.Fragment,{children:[v(F,{pointerEvents:"none",style:[te.border,{left:f.x,top:f.y,width:f.width,height:f.height,borderColor:x}]}),s&&C&&v(Q,{activeOpacity:.7,onPress:()=>o(f),style:[te.labelContainer,{left:f.x,top:f.y-10-(f.labelOffsetY||0),backgroundColor:S.primaryColor}],children:v(I,{style:te.labelText,numberOfLines:1,children:S.primaryLabel})})]},`border-${w}`)}),Be&&l?.componentInfo&&v(Be,{visible:h,onClose:d,initialMode:"bottomSheet",header:{customContent:v(vo,{title:l.componentInfo.primaryLabel})},persistenceKey:po,enablePersistence:false,children:v(So,{info:l.componentInfo,rect:l})})]}):null}var te=U.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:q,color:"#ffffff"}}),Ae=U.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:q}}),H=U.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:q},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:q},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:q}});import{jsx as Fe}from"react/jsx-runtime";var j=K(),Co={off:"#6b7280",borders:"#10b981",labels:"#06b6d4"};function xo({size:e}){let[t,n]=we(()=>j.getMode());return Ce(()=>j.subscribe(p=>{n(p)}),[]),Fe(xe,{size:e,color:Co[t]})}function Pe(){return null}var To={id:"debug-borders",name:"BORDERS",description:"Visual layout debugger - tap to cycle modes",slot:"row",icon:xo,component:Pe,props:{},launchMode:"toggle-only",onPress:()=>{j.cycle()}};function Io(e){let t={off:e?.offColor||"#6b7280",borders:e?.bordersColor||"#10b981",labels:e?.labelsColor||"#06b6d4"},n=({size:p})=>{let[l,m]=we(()=>j.getMode());return Ce(()=>j.subscribe(h=>{m(h)}),[]),Fe(xe,{size:p,color:t[l]})};return{id:e?.id||"debug-borders",name:e?.name||"BORDERS",description:e?.description||"Visual layout debugger - tap to cycle modes",slot:"row",icon:n,component:Pe,props:{},launchMode:"toggle-only",onPress:()=>{j.cycle()}}}E();var oe=K(),Ro={version:1,getSnapshot:()=>({mode:oe.getMode()}),subscribe:e=>oe.subscribe(e),actions:{cycleMode:()=>{oe.cycle()},setMode:e=>{oe.setMode(e.mode)}}};E();E();import{useEffect as ke,useState as He}from"react";import{night as R,Layers as Vo,StatusBadge as Eo,StatusIndicator as No}from"@buoy-gg/shared-ui/web";import{jsx as D,jsxs as J}from"react/jsx-runtime";var se=K();function Lo({visible:e,onClose:t}){let[n,p]=He(false),[l,m]=He(0);ke(()=>{let u=se.subscribe(p);return p(se.isEnabled()),u},[]),ke(()=>{if(!n){m(0);return}let u=()=>{try{let{getAllHostComponentInstances:a}=X(),o=a();m(o.length)}catch(a){console.error("[Buoy]","[DebugBorders] Error getting component count:",a)}};setTimeout(u,600);let i=setInterval(u,2e3);return()=>clearInterval(i)},[n]);let h=()=>{se.toggle()};return e?D(F,{style:V.container,children:J(F,{style:V.content,children:[D(I,{style:V.title,children:"Debug Borders"}),D(I,{style:V.description,children:"Visualize component layout structure with colored borders"}),J(F,{style:V.statusRow,children:[D(I,{style:V.statusLabel,children:"Status:"}),D(Eo,{status:n?"active":"inactive"})]}),n&&l>0&&J(F,{style:V.statsRow,children:[D(I,{style:V.statsLabel,children:"Components Tracked:"}),D(I,{style:V.statsValue,children:l})]}),D(F,{style:V.toggleContainer,children:J(Q,{style:[V.button,n&&V.buttonActive],onPress:h,accessibilityRole:"button",accessibilityLabel:`Debug borders ${n?"enabled":"disabled"}`,accessibilityHint:"Tap to toggle debug borders",children:[D(Vo,{size:40,color:n?R.color.accent:R.color.textSecondary}),D(I,{style:[V.buttonText,n&&V.buttonTextActive],children:n?"Disable Borders":"Enable Borders"})]})}),J(F,{style:V.infoBox,children:[D(No,{status:n?"success":"info",size:"small"}),D(I,{style:V.infoText,children:n?"Borders update every 2 seconds. Tap button to disable.":"Tap button to show colored borders around all components."})]}),D(Q,{style:V.closeButton,onPress:t,children:D(I,{style:V.closeButtonText,children:"Close"})})]})}):null}var V=U.create({container:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},content:{backgroundColor:R.color.surface,borderWidth:1,borderColor:R.color.border,borderRadius:16,padding:32,width:"85%",maxWidth:420,alignItems:"center"},title:{fontSize:24,fontWeight:"700",color:R.color.text,marginBottom:8},description:{fontSize:14,color:R.color.textSecondary,textAlign:"center",marginBottom:24},statusRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statusLabel:{fontSize:14,color:R.color.textSecondary,fontWeight:"600"},statsRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statsLabel:{fontSize:14,color:R.color.textSecondary,fontWeight:"600"},statsValue:{fontSize:16,color:R.color.text,fontWeight:"700"},toggleContainer:{alignItems:"center",justifyContent:"center",marginBottom:24},button:{alignItems:"center",justifyContent:"center",padding:24,borderRadius:16,backgroundColor:R.color.surfaceElevated,borderWidth:2,borderColor:R.color.border,minWidth:200},buttonActive:{borderColor:R.color.accentBorderStrong,backgroundColor:R.color.accentSoft},buttonText:{marginTop:12,fontSize:16,fontWeight:"600",color:R.color.textSecondary},buttonTextActive:{color:R.color.accent},infoBox:{flexDirection:"row",alignItems:"flex-start",backgroundColor:R.color.surfaceElevated,padding:12,borderRadius:8,marginBottom:24,gap:8},infoText:{flex:1,fontSize:12,color:R.color.textSecondary,lineHeight:16},closeButton:{paddingVertical:12,paddingHorizontal:32,backgroundColor:R.color.accent,borderRadius:8},closeButtonText:{color:R.color.onAccent,fontSize:16,fontWeight:"600"}});var Do=K(),Bo=X(),Mo=ve(),Ao=Se();export{Do as DebugBordersManager,Lo as DebugBordersModal,wo as DebugBordersStandaloneOverlay,Ao as colorGeneration,Mo as componentMeasurement,Io as createDebugBordersTool,Ro as debugBordersSyncAdapter,To as debugBordersToolPreset,Bo as fiberTreeTraversal};
1
+ "use client";var ie=Object.defineProperty;var $e=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var qe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,n)=>(typeof require<"u"?require:o)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var le=(e,o)=>()=>(e&&(o=e(e=0)),o);var z=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),fe=(e,o)=>{for(var n in o)ie(e,n,{get:o[n],enumerable:true})},se=(e,o,n,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of Ke(o))!Ue.call(e,s)&&s!==n&&ie(e,s,{get:()=>o[s],enumerable:!(d=$e(o,s))||d.enumerable});return e},Ye=(e,o,n)=>(se(e,o,"default"),n&&se(n,o,"default"));var Je=e=>se(ie({},"__esModule",{value:true}),e);var Xe,V=le(()=>{"use strict";Xe=(()=>{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)});import{loadToolModule as Qe}from"@buoy-gg/shared-ui/web/utils";var U=z((e,o)=>{"use strict";V();var n="off",d=new Set,s=["off","borders","labels"],m=["off","borders"],h=null,f=false;function i(){if(!f){f=true;try{let u=Qe("@buoy-gg/license");u&&typeof u.isPro=="function"&&(h=u.isPro)}catch{h=null}}}function r(){if(i(),h)try{return h()}catch{return false}return false}function t(){return r()?s:m}var c=s;function y(u){return d.add(u),u(n),()=>{d.delete(u)}}function l(){d.forEach(u=>{try{u(n)}catch(g){console.error("[DebugBorders] Error in listener:",g)}})}function p(u){return n===u?true:u==="labels"&&!r()?(console.warn("[DebugBorders] Labels mode requires React Buoy Pro. Upgrade at https://buoy.gg/pro"),false):(n=u,l(),true)}function S(){return n}function w(){let u=t(),g=u.indexOf(n);if(g===-1){p("off");return}let H=(g+1)%u.length;p(u[H])}function C(){p("borders")}function x(){p("off")}function T(){w()}function M(){return n!=="off"}function N(){return n==="labels"&&r()}function G(){return r()}function a(){return t()}function b(u){u?C():x()}o.exports={subscribe:y,enable:C,disable:x,toggle:T,cycle:w,isEnabled:M,showLabels:N,setEnabled:b,getMode:S,setMode:p,isProEnabled:G,getAvailableModes:a,MODE_CYCLE:c}});function Ze(e,o){let n=[],d=e.ownerDocument.createTreeWalker(e,1,{acceptNode(m){let h=m;return h.matches("[data-buoy-root], [data-buoy-portal-host], [data-debug-overlay], script, style, link, meta, svg, .ion-page-hidden")||e.ownerDocument.defaultView?.getComputedStyle(h).display==="none"?2:1}}),s=d.nextNode();for(;s;){if(!o.has(s)){let m=e.ownerDocument.defaultView?.getComputedStyle(s),h=s.getBoundingClientRect();if(m?.visibility!=="hidden"&&m?.visibility!=="collapse"&&h.width>0&&h.height>0){let f=0;for(let i=s.parentElement;i&&i!==e;i=i.parentElement)f++;n.push({instance:s,fiber:null,depth:f})}}s=d.nextNode()}return n}var et=le(()=>{"use strict";V()});import{getDOMNodeHandle as tt,isDOMElement as pe}from"@buoy-gg/shared-ui/web/utils";var Z=z((e,o)=>{"use strict";V();et();function n(){if(typeof globalThis>"u")return null;let a=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return a||null}function d(){let a=n();if(!a)return[];if(!a.getFiberRoots)return[];let b=new Set,u=a.renderers?.keys?Array.from(a.renderers.keys()):[1];for(let g of u)try{a.getFiberRoots(g)?.forEach(H=>b.add(H))}catch{}return[...b]}var s={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16,IncompleteClassComponent:17,DehydratedFragment:18,SuspenseListComponent:19,ScopeComponent:21,OffscreenComponent:22,LegacyHiddenComponent:23,CacheComponent:24,TracingMarkerComponent:25},m=new Set(["FloatingTools","FloatingDevTools","FloatingMenu","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","MinimizedToolsStack","GlitchToolButton","DefaultConfigProvider","JsModalComponent","JsModal","ModalHeader","DraggableHeader","DragIndicator","CornerHandle","WindowControls","HighlightUpdatesModal","HighlightUpdatesOverlay","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderCauseBadge","DebugBordersStandaloneOverlay","DebugBordersModal","ImageOverlayModal","ImageOverlayStandalone","StorageBrowser","StorageModal","GameUIStorageBrowser","StorageEventListener","StorageEventFilterView","NetworkMonitor","NetworkModal","NetworkRequestList","NetworkRequestDetail","RouteEventsModal","RouteEventsList","EnvSwitcher","EnvSwitcherModal","TabSelector","SectionHeader","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","ExpandablePopover","Divider","UserStatus","GripVerticalIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage"]),h=["JsModal","HighlightUpdates","RenderList","RenderDetail","DebugBorders","ImageOverlay","Storage","Network","RouteEvents","EnvSwitcher","Floating","Minimized","Expandable","DevTools","GameUI"],f=new Set(["debug-borders-overlay","floating-devtools-root","dial-devtools-root","jsmodal-root","highlight-updates-overlay","image-overlay-standalone","__rn_buoy__highlight-modal","logbox_inspector","logbox"]),i=new Map,r=500;function t(a){let b=tt(a);return b!==null?b:a?typeof a._nativeTag=="number"?a._nativeTag:typeof a.canonical?._nativeTag=="number"?a.canonical._nativeTag:typeof a.__nativeTag=="number"?a.__nativeTag:null:null}function c(a){if(!a)return false;if(f.has(a))return true;let b=a.charCodeAt(0);return!!(b===95&&(a.startsWith("__highlight_")||a.startsWith("__rn_buoy__"))||b===108&&a.startsWith("logbox"))}function y(a){if(!a)return null;let b=a.type;if(b){if(typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;if(b.displayName)return b.displayName;if(b.name)return b.name}let u=a.elementType;if(u){if(typeof u=="function")return u.displayName||u.name||null;if(u.displayName)return u.displayName;if(u.name)return u.name}return null}function l(a,b){if(pe(b)&&b.closest("[data-buoy-root]"))return true;let u=t(b);if(u!=null){let F=i.get(u);if(F!==void 0)return F}let g=false,H=a.pendingProps?.nativeID||a.memoizedProps?.nativeID;if(c(H))g=true;else{let F=a,k=0;for(;F&&k<30;){let ae=y(F);if(ae){if(m.has(ae)){g=true;break}for(let je of h)if(ae.startsWith(je)){g=true;break}if(g)break}let We=F.pendingProps?.nativeID||F.memoizedProps?.nativeID;if(c(We)){g=true;break}F=F.return,k++}}if(g&&u!=null){if(i.size>=r){let F=Array.from(i.keys());for(let k=0;k<r/2;k++)i.delete(F[k])}i.set(u,g)}return g}function p(){i.clear()}function S(a){return a.tag!==s.OffscreenComponent?false:a.memoizedState!==null}function w(a){let b=a.memoizedProps;return b?b.activityState===0:false}function C(a){return pe(a)?a.tagName.toLowerCase():a?a.canonical?.viewConfig?.uiViewClassName?a.canonical.viewConfig.uiViewClassName:a.viewConfig?.uiViewClassName?a.viewConfig.uiViewClassName:null:null}function x(a){let b=C(a);return b?b.startsWith("RNSVG"):false}function T(a,b,u=0,g=new Set){if(a&&!g.has(a)&&(g.add(a),!(u>500))){if(S(a)){a.sibling&&T(a.sibling,b,u,g);return}if(w(a)){a.sibling&&T(a.sibling,b,u,g);return}b(a,u),a.child&&T(a.child,b,u+1,g),a.sibling&&T(a.sibling,b,u,g)}}function M(){let a=d(),b=[];if(a.forEach((u,g)=>{T(u.current,(H,F)=>{if(H.tag===s.HostComponent){let k=H.stateNode;if(l(H,k)||x(k))return;k&&b.push({instance:k,fiber:H,depth:F})}})}),typeof document<"u"&&document.body){let u=new Set(b.map(({instance:g})=>g));b.push(...Ze(document.body,u))}return b}function N(){let a=n();return!(!a||!a.getFiberRoots)}function G(){let a=n();return a?{available:true,hasAgent:!!a.reactDevtoolsAgent,hasFiberRoots:typeof a.getFiberRoots=="function",rendererCount:a.renderers?.size??0,rootCount:d().length,hookKeys:Object.keys(a)}:{available:false,reason:"Hook not found on global object"}}o.exports={getReactDevToolsHook:n,getFiberRoots:d,traverseFiberTree:T,getAllHostComponentInstances:M,isReactDevToolsAvailable:N,getReactDevToolsDiagnostics:G,isHiddenOffscreen:S,isInactiveScreen:w,isSVGComponent:x,getNativeViewClassName:C,isDevToolsComponent:l,isDevToolsNativeID:c,getComponentName:y,clearDevToolsCache:p,FiberTags:s,DEV_TOOLS_COMPONENT_NAMES:m,DEV_TOOLS_NATIVE_IDS:f}});var me={};fe(me,{VIEW_TYPE_MAP:()=>_,default:()=>we,getAllComponentNames:()=>ve,getAllNativeViewTypes:()=>he,getComponentDisplayName:()=>be,getNativeViewType:()=>ye,isKnownViewType:()=>ge});function be(e){return _[e]||e}function ye(e){for(let[o,n]of Object.entries(_))if(n===e)return o;return null}function ge(e){return e in _}function he(){return Object.keys(_)}function ve(){return[...new Set(Object.values(_))]}var _,we,ot=le(()=>{"use strict";V();_={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"};we={VIEW_TYPE_MAP:_,getComponentDisplayName:be,getNativeViewType:ye,isKnownViewType:ge,getAllNativeViewTypes:he,getAllComponentNames:ve}});var Se=z((e,o)=>{"use strict";V();var{getComponentDisplayName:n}=(ot(),Je(me)),{getNativeViewClassName:d,getComponentName:s}=Z(),m={testID:{label:"test",color:"#10b981"},nativeID:{label:"native",color:"#f59e0b"},component:{label:"comp",color:"#a855f7"},accessibilityLabel:{label:"a11y",color:"#ec4899"},viewType:{label:"view",color:"#6b7280"}};function h(r,t){let c=r?.memoizedProps||r?.pendingProps||{testID:t?.getAttribute?.("data-testid"),nativeID:t?.id,accessibilityLabel:t?.getAttribute?.("aria-label"),accessibilityRole:t?.getAttribute?.("role")},y=d(t)||"Unknown",l=n(y),p=s(r),S=c.testID||c["data-testid"]||null,w=c.nativeID||null,C=c.accessibilityLabel||c.accessible?.label||c["aria-label"]||null,x=c.accessibilityRole||c.role||null,T=c.accessibilityHint||null,M=c.accessibilityState||null,N=null;if(c.style)try{N=Array.isArray(c.style)?Object.assign({},...c.style.filter(Boolean)):c.style}catch{N=null}let G=r?.tag,a=r?.key,b=null,u=r?.return;for(;u&&!(u.type&&typeof u.type=="function"&&(b=u.type.displayName||u.type.name||null,b));)u=u.return;let g={viewType:y,displayName:l,componentName:p,parentComponentName:b,testID:S,nativeID:w,accessibilityLabel:C,accessibilityRole:x,accessibilityHint:T,accessibilityState:M,fiberTag:G,fiberKey:a,styleInfo:N,primaryLabel:null,primaryType:null,primaryColor:null};return S?(g.primaryLabel=S,g.primaryType="testID",g.primaryColor=m.testID.color):C?(g.primaryLabel=C,g.primaryType="accessibilityLabel",g.primaryColor=m.accessibilityLabel.color):p?(g.primaryLabel=p,g.primaryType="component",g.primaryColor=m.component.color):w?(g.primaryLabel=w,g.primaryType="nativeID",g.primaryColor=m.nativeID.color):(g.primaryLabel=l,g.primaryType="viewType",g.primaryColor=m.viewType.color),g}function f(r,t=20){return r?r.length<=t?r:r.substring(0,t-1)+"\u2026":""}function i(r){let t=m[r];return t?t.label+":":""}o.exports={extractComponentInfo:h,getShortLabel:f,getLabelPrefix:i,IDENTIFIER_CONFIG:m}});var Ce=z((e,o)=>{"use strict";V();var n=null;try{n=qe("./DebugInfo").addLog}catch{}function d(i){return new Promise(r=>{try{let t=i;if(i.canonical&&(i.canonical.publicInstance?t=i.canonical.publicInstance:t=i.canonical),typeof t.getBoundingClientRect=="function"){let l=t.getBoundingClientRect();if(l&&typeof l.x=="number"&&typeof l.y=="number"&&typeof l.width=="number"&&typeof l.height=="number"&&l.width>=0&&l.height>=0){r({x:l.x,y:l.y,width:l.width,height:l.height});return}}let c=typeof globalThis<"u"?globalThis.nativeFabricUIManager:void 0,y=typeof t.measure=="function"?l=>t.measure(l):i.node&&typeof c?.measure=="function"?l=>c.measure(i.node,l):null;if(y){let l=setTimeout(()=>{r(null)},100);y((p,S,w,C,x,T)=>{clearTimeout(l),x!=null&&T!=null&&w!=null&&C!=null&&w>=0&&C>=0?r({x,y:T,width:w,height:C}):r(null)});return}r(null)}catch{r(null)}})}var{extractComponentInfo:s}=Se();async function m(i){return(await Promise.all(i.map(async({instance:r,fiber:t,depth:c})=>{let y=await d(r);if(y){let l=s(t,r);return{...y,depth:c,componentInfo:l}}return null}))).filter(r=>r!=null)}function h(i){return{hasFabricBoundingRect:typeof i.getBoundingClientRect=="function",hasPaperMeasure:typeof i.measure=="function",hasNode:i.node!=null}}function f(i){let r={fabric:0,paper:0,none:0};return i.forEach(({instance:t})=>{let c=h(t);c.hasFabricBoundingRect?r.fabric++:c.hasPaperMeasure?r.paper++:r.none++}),r}o.exports={measureInstance:d,measureInstances:m,getMeasurementCapabilities:h,getMeasurementStats:f}});var xe=z((e,o)=>{"use strict";V();function n(t,c,y){let l=t/360,p=c/100,S=y/100,w,C,x;if(p===0)w=C=x=S;else{let M=(a,b,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?a+(b-a)*6*u:u<.5?b:u<.6666666666666666?a+(b-a)*(.6666666666666666-u)*6:a),N=S<.5?S*(1+p):S+p-S*p,G=2*S-N;w=M(G,N,l+1/3),C=M(G,N,l),x=M(G,N,l-1/3)}let T=M=>{let N=Math.round(M*255).toString(16);return N.length===1?"0"+N:N};return`#${T(w)}${T(C)}${T(x)}`}function d(t){let c=(0+t*137.508)%360;return n(c,70,50)}function s(){let t=Math.random()*360;return n(t,70,50)}function m(t){let c=[];for(let y=0;y<t;y++)c.push(d(y));return c}var h=["#FF5733","#33FF57","#3357FF","#FF33F5","#F5FF33","#33FFF5","#FF8333","#8333FF","#33FF83","#FF3383"];function f(t){return h[t%h.length]}function i(t,c=1){let y=parseInt(t.slice(1,3),16),l=parseInt(t.slice(3,5),16),p=parseInt(t.slice(5,7),16);return`rgba(${y}, ${l}, ${p}, ${c})`}function r(t){let c=parseInt(t.slice(1,3),16),y=parseInt(t.slice(3,5),16),l=parseInt(t.slice(5,7),16);return 255<<24|c<<16|y<<8|l}o.exports={getColorForDepth:d,getRandomColor:s,generateColorPalette:m,getColorFromPalette:f,hslToHex:n,hexToRgba:i,hexToProcessColor:r,PREDEFINED_PALETTE:h}});var nt=z((e,o)=>{"use strict";V();var n={LABEL_SPACING:0,MAX_VERTICAL_OFFSET:100,LABEL_HEIGHT:10,PADDING:0};function d(f,i){let r=n.PADDING,t=f.x-r,c=f.x+f.width+r,y=f.y-r,l=f.y+f.height+r,p=i.x-r,S=i.x+i.width+r,w=i.y-r,C=i.y+i.height+r;return!(c<p||t>S||l<w||y>C)}function s(f){return f?f.length*5+8:0}function m(f){if(!f||f.length===0)return f;let i=f.filter(y=>{let l=y.componentInfo;return l&&(l.testID||l.accessibilityLabel)}),r=f.map((y,l)=>{let p=y.componentInfo,S=p&&(p.testID||p.accessibilityLabel),w=S?p.primaryLabel:"",C=s(w);return{index:l,hasValidLabel:S,x:y.x,y:y.y-n.LABEL_HEIGHT,width:C,height:n.LABEL_HEIGHT,offsetY:0}}),t=r.map((y,l)=>l).filter(y=>r[y].hasValidLabel).sort((y,l)=>{let p=f[y],S=f[l];return Math.abs(p.y-S.y)>10?p.y-S.y:p.x-S.x}),c=[];for(let y of t){let l=r[y];if(l.width===0)continue;let p=0,S=true,w=0,C=Math.ceil(n.MAX_VERTICAL_OFFSET/n.LABEL_HEIGHT);for(;S&&w<C;){let x={x:l.x,y:l.y-p,width:l.width,height:l.height};S=c.some(T=>d(x,T)),S&&(p+=n.LABEL_HEIGHT,w++)}l.offsetY=p,c.push({x:l.x,y:l.y-p,width:l.width,height:l.height})}return f.map((y,l)=>({...y,labelOffsetY:r[l].offsetY}))}function h(f){if(!f||f.length<2)return false;for(let i=0;i<Math.min(f.length,20);i++)for(let r=i+1;r<Math.min(f.length,20);r++){let t=f[i],c=f[r];if(Math.abs(t.y-c.y)<n.LABEL_HEIGHT*2&&!(t.x+100<c.x||c.x+100<t.x))return true}return false}o.exports={resolveOverlappingLabels:m,rectsOverlap:d,estimateLabelWidth:s,mightHaveOverlaps:h,CONFIG:n}});V();V();import{useState as Te,useEffect as Ie}from"react";import{Layers as Re}from"@buoy-gg/shared-ui/web";V();import Ve,{useEffect as Ee,useState as ee,useCallback as Le}from"react";var Ne={};fe(Ne,{AccessibilityInfo:()=>lt,ActivityIndicator:()=>fo,Alert:()=>bo,Animated:()=>no,AppRegistry:()=>ct,AppState:()=>ut,Appearance:()=>st,BackHandler:()=>dt,Button:()=>po,CheckBox:()=>Vt,Clipboard:()=>ft,DeviceEventEmitter:()=>Wt,Dimensions:()=>pt,Easing:()=>mt,FlatList:()=>Et,I18nManager:()=>bt,Image:()=>Lt,ImageBackground:()=>Nt,InteractionManager:()=>gt,Keyboard:()=>yt,KeyboardAvoidingView:()=>Bt,LayoutAnimation:()=>ht,Linking:()=>vt,LogBox:()=>zt,Modal:()=>co,NativeEventEmitter:()=>wt,NativeModules:()=>it,PanResponder:()=>St,Picker:()=>Dt,PixelRatio:()=>Ct,Platform:()=>xt,Pressable:()=>lo,ProgressBar:()=>At,RefreshControl:()=>Mt,SafeAreaView:()=>Ft,ScrollView:()=>so,SectionList:()=>Pt,Share:()=>Tt,StatusBar:()=>kt,StyleSheet:()=>Y,Switch:()=>uo,Text:()=>I,TextInput:()=>ro,Touchable:()=>Ot,TouchableHighlight:()=>ao,TouchableNativeFeedback:()=>Ht,TouchableOpacity:()=>te,TouchableWithoutFeedback:()=>io,UIManager:()=>It,Vibration:()=>Rt,View:()=>D,VirtualizedList:()=>Gt,YellowBox:()=>_t,findNodeHandle:()=>mo,unstable_createElement:()=>at,useColorScheme:()=>jt,useLocaleContext:()=>$t,useWindowDimensions:()=>Kt});V();Ye(Ne,rt);import*as rt from"react-native-web";import{unstable_createElement as at,NativeModules as it,AccessibilityInfo as lt,Appearance as st,AppRegistry as ct,AppState as ut,BackHandler as dt,Clipboard as ft,Dimensions as pt,Easing as mt,I18nManager as bt,Keyboard as yt,InteractionManager as gt,LayoutAnimation as ht,Linking as vt,NativeEventEmitter as wt,PanResponder as St,PixelRatio as Ct,Platform as xt,Share as Tt,UIManager as It,Vibration as Rt,CheckBox as Vt,FlatList as Et,Image as Lt,ImageBackground as Nt,KeyboardAvoidingView as Bt,Picker as Dt,ProgressBar as At,RefreshControl as Mt,SafeAreaView as Ft,SectionList as Pt,StatusBar as kt,Touchable as Ot,TouchableNativeFeedback as Ht,VirtualizedList as Gt,YellowBox as _t,LogBox as zt,DeviceEventEmitter as Wt,useColorScheme as jt,useLocaleContext as $t,useWindowDimensions as Kt}from"react-native-web";import*as B from"react-native-web";import{createElement as ce,forwardRef as Be,useCallback as Ut,useRef as qt}from"react";V();import{useEffect as Yt,useState as Jt}from"react";import{createPortal as Xt}from"react-dom";V();var Qt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Zt}from"react/jsx-runtime";var q=Symbol.for("@buoy-gg/portal-host"),De=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let o=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return o===""||o==="true"||o==="plaintext-only"};function Ae(){let e=document;if(e[q])return e[q].host;let o=document.createElement("div");o.dataset.buoyPortalHost="",Object.assign(o.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Qt});let n=()=>{let t=document.fullscreenElement,c=t&&t.tagName!=="CANVAS"?t:document.body;o.parentElement!==c&&c.appendChild(o)},d=new Map,s=t=>{(!o.contains(t.target)||!De(t.target))&&d.set(t.code||t.key,{key:t.key,code:t.code,location:t.location,keyCode:t.keyCode,which:t.which,altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})},m=t=>{d.delete(t.code||t.key)},h=()=>d.clear(),f=()=>{let t=[...d.values()];d.clear();for(let c of t)document.dispatchEvent(new KeyboardEvent("keyup",{...c,bubbles:true}))},i=t=>{De(t.target)&&t.stopPropagation()},r=t=>t.stopPropagation();return n(),document.addEventListener("fullscreenchange",n),document.addEventListener("keydown",s,true),document.addEventListener("keyup",m,true),window.addEventListener("blur",h),o.addEventListener("focusin",f),o.addEventListener("keydown",i),o.addEventListener("keyup",i),o.addEventListener("keypress",i),o.addEventListener("wheel",r,{passive:true}),e[q]={host:o,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",n),document.removeEventListener("keydown",s,true),document.removeEventListener("keyup",m,true),window.removeEventListener("blur",h),o.remove(),delete e[q]}},o}function eo({children:e}){let[o,n]=Jt(null);return Yt(()=>{let d=Ae(),s=document[q];return s.users++,n(d),()=>{--s.users===0&&s.dispose()}},[]),o?Xt(Zt("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),o):null}var W=B,to=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],j=e=>typeof e=="number"?`${e}px`:e;function ue(e){if(Array.isArray(e)){let c=e.map(ue);return c.some((y,l)=>y!==e[l])?c:e}if(!e||typeof e!="object"||!to.some(c=>e[c]!=null))return e;let{shadowColor:o,shadowOffset:n,shadowOpacity:d,shadowRadius:s,textShadowColor:m,textShadowOffset:h,textShadowRadius:f,...i}=e;if(o!=null||n!=null||d!=null||s!=null){let c=o??"black",y=d==null?c:`color-mix(in srgb, ${c} ${Math.min(d,1)*100}%, transparent)`,l=`${j(n?.width??0)} ${j(n?.height??0)} ${j(s??0)} ${y}`;i.boxShadow=typeof i.boxShadow=="string"?`${i.boxShadow}, ${l}`:i.boxShadow??l}let{width:r=0,height:t=0}=h??{};if(m&&(r||t||f)){let c=`${j(r)} ${j(t)} ${j(f??0)} ${m}`;i.textShadow=i.textShadow?`${i.textShadow}, ${c}`:c}return i}var oo=W.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Me(e,o){if(typeof e=="function")return d=>Me(e(d),o);let n=ue(e);return o?[n,oo[o]]:n}var Y={...W.StyleSheet,create:e=>W.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([o,n])=>[o,ue(n)])))};function P(e){let o=Be((d,s)=>{let{accessibilityState:m,accessibilityValue:h,pointerEvents:f,...i}=d;for(let t of["busy","checked","disabled","expanded","selected"])m?.[t]!==void 0&&i[`aria-${t}`]===void 0&&(i[`aria-${t}`]=m[t]);for(let[t,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))h?.[t]!==void 0&&i[`aria-${c}`]===void 0&&(i[`aria-${c}`]=h[t]);let r=Me(i.style,f);return r!==i.style&&(i.style=r),ce(e,{...i,ref:s})}),n=e.State;return n&&Object.assign(o,{State:n}),o.displayName=e.displayName??e.name??"NativeWebView",o}var D=P(B.View),I=P(B.Text),no={...W.Animated,View:W.Animated.createAnimatedComponent(D),Text:W.Animated.createAnimatedComponent(I)},ro=P(B.TextInput),te=P(B.TouchableOpacity),ao=P(B.TouchableHighlight),io=P(B.TouchableWithoutFeedback),lo=P(B.Pressable),so=P(B.ScrollView),Fe=Be((e,o)=>{let n=qt(null),d=Ut(s=>{if(s){let m=s;for(;m.parentElement&&m.parentElement!==document.body;)m=m.parentElement;m.parentElement===document.body&&(n.current=m,Object.assign(m.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Ae().appendChild(m))}else n.current&&(document.body.appendChild(n.current),n.current=null);typeof o=="function"?o(s):o&&(o.current=s)},[o]);return ce(eo,null,ce(B.Modal,{...e,ref:d}))});Fe.displayName="Modal";var co=P(Fe),uo=P(B.Switch),fo=P(B.ActivityIndicator),po=P(B.Button),mo=B.findNodeHandle,bo={alert(e,o,n,d){if(typeof document>"u")return;let s=document.createElement("dialog");s.dataset.buoyRoot="",s.setAttribute("aria-label",e),s.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 m=document.createElement("h2");if(m.textContent=e,m.style.cssText="font-size:18px;margin:0 0 12px",s.appendChild(m),o){let r=document.createElement("p");r.textContent=o,r.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",s.appendChild(r)}let h=document.createElement("div");h.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let f=n?.length?n:[{text:"OK"}],i=()=>{s.close?.(),s.remove()};for(let r of f){let t=document.createElement("button");t.type="button",t.textContent=r.text??"OK",t.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${r.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,t.onclick=()=>{i(),r.onPress?.()},h.appendChild(t)}s.addEventListener("cancel",r=>{r.preventDefault(),d?.cancelable!==false&&(i(),d?.onDismiss?.())}),s.appendChild(h),document.body.appendChild(s),s.showModal?s.showModal():s.setAttribute("open","")}};import{monoFont as J}from"@buoy-gg/shared-ui/web";import{JsModal as Pe,devToolsStorageKeys as yo}from"@buoy-gg/shared-ui/web";import{DataViewer as oe}from"@buoy-gg/shared-ui/web/dataViewer";import{loadToolModule as go}from"@buoy-gg/shared-ui/web/utils";import{Fragment as ke,jsx as v,jsxs as $}from"react/jsx-runtime";var ho=yo.debugBorders.infoModal(),vo=U(),{getAllHostComponentInstances:wo}=Z(),{measureInstances:So}=Ce(),{getColorForDepth:Co}=xe(),{getShortLabel:rn}=Se(),{resolveOverlappingLabels:xo}=nt(),X;function To(){if(X!==void 0)return X;try{X=go("@buoy-gg/core").useDevToolsVisibility??null}catch{X=null}return X??null}function L({label:e,value:o,color:n}){if(o==null)return null;let d;if(typeof o=="object")try{d=JSON.stringify(o,null,2)}catch{d=String(o)}else d=String(o);return $(D,{style:O.row,children:[v(I,{style:O.label,children:e}),v(I,{style:[O.value,n?{color:n}:null],children:d})]})}function Io({title:e}){return v(D,{style:Oe.container,children:v(I,{style:Oe.title,numberOfLines:1,children:e})})}function Ro({info:e,rect:o}){return $(D,{style:O.content,children:[v(I,{style:O.sectionTitle,children:"Identifiers"}),v(L,{label:"testID",value:e.testID,color:"#10b981"}),v(L,{label:"accessibilityLabel",value:e.accessibilityLabel,color:"#ec4899"}),v(L,{label:"nativeID",value:e.nativeID,color:"#f59e0b"}),v(L,{label:"key",value:e.fiberKey}),v(I,{style:O.sectionTitle,children:"Component"}),v(L,{label:"Component Name",value:e.componentName,color:"#a855f7"}),v(L,{label:"Parent Component",value:e.parentComponentName}),v(L,{label:"Display Name",value:e.displayName}),v(L,{label:"Native View Type",value:e.viewType}),v(L,{label:"Fiber Tag",value:e.fiberTag}),v(I,{style:O.sectionTitle,children:"Position & Size"}),v(L,{label:"X",value:Math.round(o.x)}),v(L,{label:"Y",value:Math.round(o.y)}),v(L,{label:"Width",value:Math.round(o.width)}),v(L,{label:"Height",value:Math.round(o.height)}),v(L,{label:"Depth",value:o.depth}),(e.accessibilityRole||e.accessibilityHint||e.accessibilityState)&&$(ke,{children:[v(I,{style:O.sectionTitle,children:"Accessibility"}),v(L,{label:"Role",value:e.accessibilityRole}),v(L,{label:"Hint",value:e.accessibilityHint}),e.accessibilityState&&oe?v(oe,{title:"",data:e.accessibilityState,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(L,{label:"State",value:e.accessibilityState})]}),e.styleInfo&&$(ke,{children:[v(I,{style:O.sectionTitle,children:"Styles"}),oe?v(oe,{title:"",data:e.styleInfo,showTypeFilter:true,rawMode:true,initialExpanded:true}):v(D,{style:O.codeBlock,children:v(I,{style:O.codeText,children:JSON.stringify(e.styleInfo,null,2)})})]})]})}function Vo(){let[e,o]=ee("off"),[n,d]=ee([]),[s,m]=ee(null),[h,f]=ee(false),i=Ve.useRef(false),r=To()?.()?.isDevToolsActive??false,t=Le(p=>{m(p),f(true)},[]),c=Le(()=>{f(false),m(null)},[]),y=e!=="off"&&!r,l=e==="labels"&&!r;return Ee(()=>vo.subscribe(p=>{o(p)}),[]),Ee(()=>{if(!y){d([]);return}let p=true,S,w=async()=>{if(!(!p||i.current)){i.current=true;try{let x=wo();if(x.length===0){i.current=false;return}let T=await So(x);if(p){let M=l?xo(T):T;d(M)}}catch(x){console.error("[Buoy]","[DebugBorders] Error updating measurements:",x)}finally{i.current=false}}},C=setTimeout(()=>{w()},500);return S=setInterval(w,2e3),()=>{p=false,clearTimeout(C),clearInterval(S),i.current=false}},[y,l,n.length]),y?$(D,{style:ne.overlay,pointerEvents:"box-none",dataSet:{debugOverlay:"true"},nativeID:"debug-borders-overlay",children:[n.map((p,S)=>{let w=p.componentInfo,C=w&&(w.testID||w.accessibilityLabel);if(l&&!C)return null;let x=l&&w?w.primaryColor:Co(p.depth);return $(Ve.Fragment,{children:[v(D,{pointerEvents:"none",style:[ne.border,{left:p.x,top:p.y,width:p.width,height:p.height,borderColor:x}]}),l&&C&&v(te,{activeOpacity:.7,onPress:()=>t(p),style:[ne.labelContainer,{left:p.x,top:p.y-10-(p.labelOffsetY||0),backgroundColor:w.primaryColor}],children:v(I,{style:ne.labelText,numberOfLines:1,children:w.primaryLabel})})]},`border-${S}`)}),Pe&&s?.componentInfo&&v(Pe,{visible:h,onClose:c,initialMode:"bottomSheet",header:{customContent:v(Io,{title:s.componentInfo.primaryLabel})},persistenceKey:ho,enablePersistence:false,children:v(Ro,{info:s.componentInfo,rect:s})})]}):null}var ne=Y.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:9e3,elevation:9e3},border:{position:"absolute",borderWidth:1,borderStyle:"solid"},labelContainer:{position:"absolute",paddingHorizontal:4,paddingVertical:1,borderRadius:2},labelText:{fontSize:8,fontWeight:"700",fontFamily:J,color:"#ffffff"}}),Oe=Y.create({container:{paddingHorizontal:16,paddingVertical:8,alignItems:"center"},title:{fontSize:16,fontWeight:"600",color:"#ffffff",fontFamily:J}}),O=Y.create({content:{padding:16},sectionTitle:{fontSize:12,fontWeight:"700",color:"#6b7280",marginTop:16,marginBottom:8,textTransform:"uppercase",letterSpacing:1},row:{flexDirection:"row",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},label:{fontSize:13,color:"#9ca3af",width:140,fontFamily:J},value:{fontSize:13,color:"#ffffff",flex:1,fontFamily:J},codeBlock:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:12,borderRadius:8,marginTop:4},codeText:{fontSize:11,color:"#e5e7eb",fontFamily:J}});import{jsx as He}from"react/jsx-runtime";var K=U(),Eo={off:"#6b7280",borders:"#10b981",labels:"#06b6d4"};function Lo({size:e}){let[o,n]=Te(()=>K.getMode());return Ie(()=>K.subscribe(d=>{n(d)}),[]),He(Re,{size:e,color:Eo[o]})}function Ge(){return null}var No={id:"debug-borders",name:"BORDERS",description:"Visual layout debugger - tap to cycle modes",slot:"row",icon:Lo,component:Ge,props:{},launchMode:"toggle-only",onPress:()=>{K.cycle()}};function Bo(e){let o={off:e?.offColor||"#6b7280",borders:e?.bordersColor||"#10b981",labels:e?.labelsColor||"#06b6d4"},n=({size:d})=>{let[s,m]=Te(()=>K.getMode());return Ie(()=>K.subscribe(h=>{m(h)}),[]),He(Re,{size:d,color:o[s]})};return{id:e?.id||"debug-borders",name:e?.name||"BORDERS",description:e?.description||"Visual layout debugger - tap to cycle modes",slot:"row",icon:n,component:Ge,props:{},launchMode:"toggle-only",onPress:()=>{K.cycle()}}}V();V();var Do=["off","borders","labels"];function Ao(e){if(!Do.includes(e))throw new Error(`Unknown mode "${String(e)}". Use off, borders or labels.`);return e}var re=U(),Mo={version:1,getSnapshot:()=>({mode:re.getMode()}),subscribe:e=>re.subscribe(e),actions:{cycleMode:()=>{re.cycle()},setMode:e=>{re.setMode(Ao(e?.mode))}}};V();V();import{useEffect as _e,useState as ze}from"react";import{night as R,Layers as Fo,StatusBadge as Po,StatusIndicator as ko}from"@buoy-gg/shared-ui/web";import{jsx as A,jsxs as Q}from"react/jsx-runtime";var de=U();function Oo({visible:e,onClose:o}){let[n,d]=ze(false),[s,m]=ze(0);_e(()=>{let f=de.subscribe(d);return d(de.isEnabled()),f},[]),_e(()=>{if(!n){m(0);return}let f=()=>{try{let{getAllHostComponentInstances:r}=Z(),t=r();m(t.length)}catch(r){console.error("[Buoy]","[DebugBorders] Error getting component count:",r)}};setTimeout(f,600);let i=setInterval(f,2e3);return()=>clearInterval(i)},[n]);let h=()=>{de.toggle()};return e?A(D,{style:E.container,children:Q(D,{style:E.content,children:[A(I,{style:E.title,children:"Debug Borders"}),A(I,{style:E.description,children:"Visualize component layout structure with colored borders"}),Q(D,{style:E.statusRow,children:[A(I,{style:E.statusLabel,children:"Status:"}),A(Po,{status:n?"active":"inactive"})]}),n&&s>0&&Q(D,{style:E.statsRow,children:[A(I,{style:E.statsLabel,children:"Components Tracked:"}),A(I,{style:E.statsValue,children:s})]}),A(D,{style:E.toggleContainer,children:Q(te,{style:[E.button,n&&E.buttonActive],onPress:h,accessibilityRole:"button",accessibilityLabel:`Debug borders ${n?"enabled":"disabled"}`,accessibilityHint:"Tap to toggle debug borders",children:[A(Fo,{size:40,color:n?R.color.accent:R.color.textSecondary}),A(I,{style:[E.buttonText,n&&E.buttonTextActive],children:n?"Disable Borders":"Enable Borders"})]})}),Q(D,{style:E.infoBox,children:[A(ko,{status:n?"success":"info",size:"small"}),A(I,{style:E.infoText,children:n?"Borders update every 2 seconds. Tap button to disable.":"Tap button to show colored borders around all components."})]}),A(te,{style:E.closeButton,onPress:o,children:A(I,{style:E.closeButtonText,children:"Close"})})]})}):null}var E=Y.create({container:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)"},content:{backgroundColor:R.color.surface,borderWidth:1,borderColor:R.color.border,borderRadius:16,padding:32,width:"85%",maxWidth:420,alignItems:"center"},title:{fontSize:24,fontWeight:"700",color:R.color.text,marginBottom:8},description:{fontSize:14,color:R.color.textSecondary,textAlign:"center",marginBottom:24},statusRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statusLabel:{fontSize:14,color:R.color.textSecondary,fontWeight:"600"},statsRow:{flexDirection:"row",alignItems:"center",marginBottom:16,gap:8},statsLabel:{fontSize:14,color:R.color.textSecondary,fontWeight:"600"},statsValue:{fontSize:16,color:R.color.text,fontWeight:"700"},toggleContainer:{alignItems:"center",justifyContent:"center",marginBottom:24},button:{alignItems:"center",justifyContent:"center",padding:24,borderRadius:16,backgroundColor:R.color.surfaceElevated,borderWidth:2,borderColor:R.color.border,minWidth:200},buttonActive:{borderColor:R.color.accentBorderStrong,backgroundColor:R.color.accentSoft},buttonText:{marginTop:12,fontSize:16,fontWeight:"600",color:R.color.textSecondary},buttonTextActive:{color:R.color.accent},infoBox:{flexDirection:"row",alignItems:"flex-start",backgroundColor:R.color.surfaceElevated,padding:12,borderRadius:8,marginBottom:24,gap:8},infoText:{flex:1,fontSize:12,color:R.color.textSecondary,lineHeight:16},closeButton:{paddingVertical:12,paddingHorizontal:32,backgroundColor:R.color.accent,borderRadius:8},closeButtonText:{color:R.color.onAccent,fontSize:16,fontWeight:"600"}});var Ho=U(),Go=Z(),_o=Ce(),zo=xe();export{Ho as DebugBordersManager,Oo as DebugBordersModal,Vo as DebugBordersStandaloneOverlay,zo as colorGeneration,_o as componentMeasurement,Bo as createDebugBordersTool,Mo as debugBordersSyncAdapter,No as debugBordersToolPreset,Go as fiberTreeTraversal};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/debug-borders",
3
- "version": "7.0.74",
3
+ "version": "7.0.76",
4
4
  "description": "Layout debugging borders for React Native — depth-colored, touch-through, tap any label to inspect testIDs & styles. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -34,18 +34,18 @@
34
34
  ],
35
35
  "sideEffects": false,
36
36
  "dependencies": {
37
- "@buoy-gg/shared-ui": "^7.0.74",
38
- "@buoy-gg/core": "^7.0.74"
37
+ "@buoy-gg/core": "^7.0.76",
38
+ "@buoy-gg/shared-ui": "^7.0.76"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": "*",
42
- "@buoy-gg/license": "7.0.74"
42
+ "@buoy-gg/license": "7.0.76"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/react": "^19.1.0",
46
46
  "@types/react-native": "^0.73.0",
47
47
  "typescript": "~5.8.3",
48
- "@buoy-gg/license": "^7.0.74"
48
+ "@buoy-gg/license": "^7.0.76"
49
49
  },
50
50
  "react-native-builder-bob": {
51
51
  "source": "src",