@buoy-gg/core 7.0.63 → 7.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +5 -1
  2. package/bin/buoy.js +11 -8
  3. package/lib/commonjs/browserRegister.js +1 -1
  4. package/lib/commonjs/browserRegister.server.js +1 -1
  5. package/lib/commonjs/browserRegisterNetwork.js +1 -0
  6. package/lib/commonjs/browserRegisterNetwork.server.js +1 -0
  7. package/lib/commonjs/browserRegisterNetwork.test.js +1 -0
  8. package/lib/commonjs/earlyNetwork.js +1 -1
  9. package/lib/commonjs/floatingMenu/AppHost.web.js +1 -1
  10. package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +1 -1
  11. package/lib/commonjs/floatingMenu/BuoySignIn.web.js +1 -1
  12. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  13. package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -1
  14. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -1
  15. package/lib/commonjs/floatingMenu/FloatingMenu.js +1 -1
  16. package/lib/commonjs/floatingMenu/dial/DialDevTools.js +1 -1
  17. package/lib/commonjs/index.web.js +1 -1
  18. package/lib/commonjs/mountBuoy.js +1 -0
  19. package/lib/commonjs/mountBuoy.test.js +1 -0
  20. package/lib/commonjs/threeBootHook.js +1 -0
  21. package/lib/commonjs/threeBootHook.test.js +1 -0
  22. package/lib/commonjs/version.js +1 -1
  23. package/lib/module/browserRegister.js +1 -1
  24. package/lib/module/browserRegister.server.js +1 -1
  25. package/lib/module/browserRegisterNetwork.js +1 -0
  26. package/lib/module/browserRegisterNetwork.server.js +1 -0
  27. package/lib/module/browserRegisterNetwork.test.js +1 -0
  28. package/lib/module/earlyNetwork.js +1 -1
  29. package/lib/module/floatingMenu/AppHost.web.js +1 -1
  30. package/lib/module/floatingMenu/BrowserToolRuntime.js +1 -1
  31. package/lib/module/floatingMenu/BuoySignIn.web.js +1 -1
  32. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1
  33. package/lib/module/floatingMenu/FloatingDevTools.js +1 -1
  34. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -1
  35. package/lib/module/floatingMenu/FloatingMenu.js +1 -1
  36. package/lib/module/floatingMenu/dial/DialDevTools.js +1 -1
  37. package/lib/module/index.web.js +1 -1
  38. package/lib/module/mountBuoy.js +1 -0
  39. package/lib/module/mountBuoy.test.js +1 -0
  40. package/lib/module/threeBootHook.js +1 -0
  41. package/lib/module/threeBootHook.test.js +1 -0
  42. package/lib/module/version.js +1 -1
  43. package/lib/typescript/commonjs/browserRegister.d.ts +1 -0
  44. package/lib/typescript/commonjs/browserRegister.server.d.ts +2 -0
  45. package/lib/typescript/commonjs/browserRegisterNetwork.d.ts +5 -0
  46. package/lib/typescript/commonjs/browserRegisterNetwork.server.d.ts +5 -0
  47. package/lib/typescript/commonjs/floatingMenu/BuoySignIn.web.d.ts +1 -1
  48. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +1 -1
  49. package/lib/typescript/commonjs/index.web.d.ts +1 -0
  50. package/lib/typescript/commonjs/mountBuoy.d.ts +16 -0
  51. package/lib/typescript/commonjs/threeBootHook.d.ts +9 -0
  52. package/lib/typescript/commonjs/version.d.ts +1 -1
  53. package/lib/typescript/module/browserRegister.d.ts +1 -0
  54. package/lib/typescript/module/browserRegister.server.d.ts +2 -0
  55. package/lib/typescript/module/browserRegisterNetwork.d.ts +5 -0
  56. package/lib/typescript/module/browserRegisterNetwork.server.d.ts +5 -0
  57. package/lib/typescript/module/floatingMenu/BuoySignIn.web.d.ts +1 -1
  58. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +1 -1
  59. package/lib/typescript/module/index.web.d.ts +1 -0
  60. package/lib/typescript/module/mountBuoy.d.ts +16 -0
  61. package/lib/typescript/module/threeBootHook.d.ts +9 -0
  62. package/lib/typescript/module/version.d.ts +1 -1
  63. package/lib/web/auto.mjs +1 -1
  64. package/lib/web/chunks/FloatingDevTools.web-P3PAM3FD.mjs +1 -0
  65. package/lib/web/chunks/chunk-5EUMNDI5.mjs +1 -0
  66. package/lib/web/chunks/chunk-D2FYORGY.mjs +1 -0
  67. package/lib/web/chunks/chunk-LOPXJLVB.mjs +1 -0
  68. package/lib/web/chunks/chunk-NEDMFPZ4.mjs +1 -0
  69. package/lib/web/chunks/chunk-NKUQECQ2.mjs +10 -0
  70. package/lib/web/chunks/chunk-RBPDZUHO.mjs +1 -0
  71. package/lib/web/chunks/chunk-Z6I7ZD34.mjs +1 -0
  72. package/lib/web/index.mjs +1 -1
  73. package/lib/web/installed-tools.mjs +1 -1
  74. package/lib/web/register-network-server.mjs +1 -0
  75. package/lib/web/register-network.mjs +1 -0
  76. package/lib/web/register-server.mjs +1 -1
  77. package/lib/web/register.mjs +1 -1
  78. package/lib/web/three.mjs +1 -0
  79. package/lib/web/toolkit.mjs +1 -1
  80. package/package.json +21 -6
  81. package/lib/web/chunks/FloatingDevTools.web-M3ASH5EV.mjs +0 -1
  82. package/lib/web/chunks/chunk-3YORPV22.mjs +0 -10
  83. package/lib/web/chunks/chunk-5SGL6QL4.mjs +0 -1
  84. package/lib/web/chunks/chunk-7G3P7Z7K.mjs +0 -1
  85. package/lib/web/chunks/chunk-CLXYMJTS.mjs +0 -1
  86. package/lib/web/chunks/chunk-ZD6O2YPD.mjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";import{act as o}from"react";import{afterEach as c,expect as t,it as u,vi as i}from"vitest";import{mountBuoy as a}from"./mountBuoy.js";import{QueryClient as s,QueryClientProvider as m,useQueryClient as d}from"@tanstack/react-query";import{jsxs as y,jsx as l}from"react/jsx-runtime";i.mock("./floatingMenu/FloatingDevTools.web",()=>({FloatingDevTools:e=>y("span",{children:[e.environment,e.children]})}));i.stubGlobal("IS_REACT_ACT_ENVIRONMENT",true);c(()=>{document.body.innerHTML=""});u("mounts with the given props and removes its root on unmount",async()=>{let e;await o(async()=>{e=a({environment:"qa"})});t(document.querySelector("[data-buoy-mount]")?.textContent).toBe("qa");await o(async()=>e());t(document.querySelector("[data-buoy-mount]")).toBeNull();t(()=>e()).not.toThrow()});u("keeps other roots and app DOM when one mount is removed",async()=>{const e=document.createElement("main");document.body.append(e);let r;let n;await o(async()=>{r=a({environment:"qa"});n=a({environment:"dev"})});await o(async()=>r());t(e.isConnected).toBe(true);t(document.querySelectorAll("[data-buoy-mount]")).toHaveLength(1);t(document.querySelector("[data-buoy-mount]")?.textContent).toBe("dev");await o(async()=>n())});u("shares the app QueryClient with tool panels",async()=>{const e=new s;e.setQueryData(["host"],"from Angular");function r(){return l("b",{children:d().getQueryData(["host"])})}let n;await o(async()=>{n=a({queryClient:e,modules:{query:{QueryClientProvider:m}},children:l(r,{})})});t(document.querySelector("[data-buoy-mount]")?.textContent).toBe("from Angular");await o(async()=>n())});u("fails before adding a root when the Query provider is absent",()=>{t(()=>a({queryClient:new s})).toThrow("Add the react-query tool");t(document.querySelector("[data-buoy-mount]")).toBeNull()});
@@ -0,0 +1 @@
1
+ "use strict";const f=new WeakMap;const c=128;export function installThreeBootHook(){const r=window;const e=r.__THREE_DEVTOOLS__??(r.__THREE_DEVTOOLS__=new EventTarget);if(!f.has(e)){const n=[];f.set(e,n);const t=o=>{const s=o.detail;const i={type:o.type};if(typeof s==="object"&&s!==null||typeof s==="function"){if(typeof WeakRef==="undefined")return;i.ref=new WeakRef(s)}else i.value=s;n.push(i);if(n.length>c)n.shift()};e.addEventListener("register",t);e.addEventListener("observe",t)}return e}export function subscribeThreeBootEvents(r){const e=installThreeBootHook();const n=t=>r({type:t.type,detail:t.detail});e.addEventListener("register",n);e.addEventListener("observe",n);for(const t of[...f.get(e)]){const o=t.ref?t.ref.deref():t.value;if(t.ref&&o===void 0)continue;r({type:t.type,detail:o})}return()=>{e.removeEventListener("register",n);e.removeEventListener("observe",n)}}
@@ -0,0 +1 @@
1
+ "use strict";import{afterEach as c,expect as t,it as i,vi as o}from"vitest";import{installThreeBootHook as l,subscribeThreeBootEvents as v}from"./threeBootHook.js";c(()=>o.unstubAllGlobals());i("keeps an existing hook and its listeners",()=>{const e=new EventTarget;const s=o.fn();e.addEventListener("observe",s);o.stubGlobal("window",{__THREE_DEVTOOLS__:e});t(l()).toBe(e);e.dispatchEvent(new CustomEvent("observe",{detail:{}}));t(s).toHaveBeenCalledOnce()});i("replays buffered events once and unsubscribes from live events",()=>{o.stubGlobal("window",{});const e=l();const s={};e.dispatchEvent(new CustomEvent("register",{detail:{revision:"186"}}));e.dispatchEvent(new CustomEvent("observe",{detail:s}));l();const n=o.fn();const a=v(n);t(n).toHaveBeenCalledTimes(2);t(n).toHaveBeenLastCalledWith({type:"observe",detail:s});e.dispatchEvent(new CustomEvent("observe",{detail:{}}));t(n).toHaveBeenCalledTimes(3);a();e.dispatchEvent(new CustomEvent("observe",{detail:{}}));t(n).toHaveBeenCalledTimes(3)});i("bounds the buffer and uses weak references for objects",()=>{o.stubGlobal("window",{});const e=[];o.stubGlobal("WeakRef",class{constructor(r){e.push(r)}deref(){return void 0}});const s=l();const n={};s.dispatchEvent(new CustomEvent("observe",{detail:n}));t(e).toEqual([n]);const a=o.fn();v(a)();t(a).not.toHaveBeenCalled();for(let r=0;r<150;r++)s.dispatchEvent(new CustomEvent("register",{detail:r}));v(a)();t(a).toHaveBeenCalledTimes(128);t(a).toHaveBeenNthCalledWith(1,{type:"register",detail:22})});i("offers a safe subscription from the server entry",async()=>{const e=await import("./browserRegister.server");t(e).toHaveProperty("subscribeThreeBootEvents");const s=o.fn();const n=e.subscribeThreeBootEvents(s);t(n).toBeTypeOf("function");n();t(s).not.toHaveBeenCalled()});
@@ -1 +1 @@
1
- "use strict";export const SDK_VERSION="7.0.63";
1
+ "use strict";export const SDK_VERSION="7.0.65";
@@ -1,3 +1,4 @@
1
+ export { subscribeThreeBootEvents } from './threeBootHook';
1
2
  export { earlyHookScript } from './earlyHookScript';
2
3
  /**
3
4
  * Call before importing React DOM so render and element inspectors can see app
@@ -3,4 +3,6 @@ export { earlyHookScript } from './earlyHookScript';
3
3
  export declare function registerBrowserDevTools(_options?: {
4
4
  enableInRelease?: boolean;
5
5
  }): boolean;
6
+ /** Match the browser entry without starting a hook on the server. */
7
+ export declare function subscribeThreeBootEvents(_listener: (event: import('./threeBootHook').ThreeBootEvent) => void): () => void;
6
8
  //# sourceMappingURL=browserRegister.server.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Record early web calls without loading the React inspector. */
2
+ export declare function registerBrowserNetwork(options?: {
3
+ enableInRelease?: boolean;
4
+ }): boolean;
5
+ //# sourceMappingURL=browserRegisterNetwork.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Match the browser entry without starting capture on the server. */
2
+ export declare function registerBrowserNetwork(_options?: {
3
+ enableInRelease?: boolean;
4
+ }): boolean;
5
+ //# sourceMappingURL=browserRegisterNetwork.server.d.ts.map
@@ -8,5 +8,5 @@
8
8
  * The click handler calls signIn() directly: the popup has to open before
9
9
  * anything awaits, or the browser blocks it.
10
10
  */
11
- export declare function BuoySignIn(): import("react").ReactPortal | null;
11
+ export declare function BuoySignIn(): import("react").JSX.Element | null;
12
12
  //# sourceMappingURL=BuoySignIn.web.d.ts.map
@@ -67,5 +67,5 @@ export interface FloatingDevToolsProps {
67
67
  requireLicense?: boolean;
68
68
  }
69
69
  export type { WebToolConfig, Environment, UserRole };
70
- export declare function FloatingDevTools(input: FloatingDevToolsProps): import("react").JSX.Element | null;
70
+ export declare function FloatingDevTools(input: FloatingDevToolsProps): import("react").JSX.Element;
71
71
  //# sourceMappingURL=FloatingDevTools.web.d.ts.map
@@ -27,4 +27,5 @@ export { useToolHost, useToolHeader, type ToolHostContextValue, type ToolHeaderO
27
27
  export { DevToolsVisibilityProvider, useDevToolsVisibility } from "./floatingMenu/DevToolsVisibilityContext";
28
28
  export { appSyncAdapter } from "./floatingMenu/sync/appSyncAdapter";
29
29
  export { LicenseManager } from "@buoy-gg/license";
30
+ export { mountBuoy, type MountBuoyOptions } from './mountBuoy';
30
31
  //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { type FloatingDevToolsProps } from './floatingMenu/FloatingDevTools.web';
2
+ /** Core passes the client to the Query tool without importing its package. */
3
+ interface BuoyQueryClient {
4
+ mount(): void;
5
+ unmount(): void;
6
+ getQueryCache(): unknown;
7
+ getMutationCache(): unknown;
8
+ }
9
+ /** Mount Buoy in its own React root. Call the result to remove it. */
10
+ export interface MountBuoyOptions extends FloatingDevToolsProps {
11
+ /** The app's QueryClient. Add the react-query tool to modules as well. */
12
+ queryClient?: BuoyQueryClient;
13
+ }
14
+ export declare function mountBuoy({ queryClient, ...options }?: MountBuoyOptions): () => void;
15
+ export {};
16
+ //# sourceMappingURL=mountBuoy.d.ts.map
@@ -0,0 +1,9 @@
1
+ export type ThreeBootEvent = {
2
+ type: 'register' | 'observe';
3
+ detail: unknown;
4
+ };
5
+ /** Keep the browser's hook, including hooks owned by other devtools. */
6
+ export declare function installThreeBootHook(): EventTarget;
7
+ /** Replay live buffered objects, then watch new events. Call the result to stop. */
8
+ export declare function subscribeThreeBootEvents(listener: (event: ThreeBootEvent) => void): () => void;
9
+ //# sourceMappingURL=threeBootHook.d.ts.map
@@ -9,5 +9,5 @@
9
9
  * Drift is prevented by a test that fails when this disagrees with
10
10
  * package.json, so a version bump that forgets this file cannot ship.
11
11
  */
12
- export declare const SDK_VERSION = "7.0.63";
12
+ export declare const SDK_VERSION = "7.0.65";
13
13
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,4 @@
1
+ export { subscribeThreeBootEvents } from './threeBootHook';
1
2
  export { earlyHookScript } from './earlyHookScript';
2
3
  /**
3
4
  * Call before importing React DOM so render and element inspectors can see app
@@ -3,4 +3,6 @@ export { earlyHookScript } from './earlyHookScript';
3
3
  export declare function registerBrowserDevTools(_options?: {
4
4
  enableInRelease?: boolean;
5
5
  }): boolean;
6
+ /** Match the browser entry without starting a hook on the server. */
7
+ export declare function subscribeThreeBootEvents(_listener: (event: import('./threeBootHook').ThreeBootEvent) => void): () => void;
6
8
  //# sourceMappingURL=browserRegister.server.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Record early web calls without loading the React inspector. */
2
+ export declare function registerBrowserNetwork(options?: {
3
+ enableInRelease?: boolean;
4
+ }): boolean;
5
+ //# sourceMappingURL=browserRegisterNetwork.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Match the browser entry without starting capture on the server. */
2
+ export declare function registerBrowserNetwork(_options?: {
3
+ enableInRelease?: boolean;
4
+ }): boolean;
5
+ //# sourceMappingURL=browserRegisterNetwork.server.d.ts.map
@@ -8,5 +8,5 @@
8
8
  * The click handler calls signIn() directly: the popup has to open before
9
9
  * anything awaits, or the browser blocks it.
10
10
  */
11
- export declare function BuoySignIn(): import("react").ReactPortal | null;
11
+ export declare function BuoySignIn(): import("react").JSX.Element | null;
12
12
  //# sourceMappingURL=BuoySignIn.web.d.ts.map
@@ -67,5 +67,5 @@ export interface FloatingDevToolsProps {
67
67
  requireLicense?: boolean;
68
68
  }
69
69
  export type { WebToolConfig, Environment, UserRole };
70
- export declare function FloatingDevTools(input: FloatingDevToolsProps): import("react").JSX.Element | null;
70
+ export declare function FloatingDevTools(input: FloatingDevToolsProps): import("react").JSX.Element;
71
71
  //# sourceMappingURL=FloatingDevTools.web.d.ts.map
@@ -27,4 +27,5 @@ export { useToolHost, useToolHeader, type ToolHostContextValue, type ToolHeaderO
27
27
  export { DevToolsVisibilityProvider, useDevToolsVisibility } from "./floatingMenu/DevToolsVisibilityContext";
28
28
  export { appSyncAdapter } from "./floatingMenu/sync/appSyncAdapter";
29
29
  export { LicenseManager } from "@buoy-gg/license";
30
+ export { mountBuoy, type MountBuoyOptions } from './mountBuoy';
30
31
  //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { type FloatingDevToolsProps } from './floatingMenu/FloatingDevTools.web';
2
+ /** Core passes the client to the Query tool without importing its package. */
3
+ interface BuoyQueryClient {
4
+ mount(): void;
5
+ unmount(): void;
6
+ getQueryCache(): unknown;
7
+ getMutationCache(): unknown;
8
+ }
9
+ /** Mount Buoy in its own React root. Call the result to remove it. */
10
+ export interface MountBuoyOptions extends FloatingDevToolsProps {
11
+ /** The app's QueryClient. Add the react-query tool to modules as well. */
12
+ queryClient?: BuoyQueryClient;
13
+ }
14
+ export declare function mountBuoy({ queryClient, ...options }?: MountBuoyOptions): () => void;
15
+ export {};
16
+ //# sourceMappingURL=mountBuoy.d.ts.map
@@ -0,0 +1,9 @@
1
+ export type ThreeBootEvent = {
2
+ type: 'register' | 'observe';
3
+ detail: unknown;
4
+ };
5
+ /** Keep the browser's hook, including hooks owned by other devtools. */
6
+ export declare function installThreeBootHook(): EventTarget;
7
+ /** Replay live buffered objects, then watch new events. Call the result to stop. */
8
+ export declare function subscribeThreeBootEvents(listener: (event: ThreeBootEvent) => void): () => void;
9
+ //# sourceMappingURL=threeBootHook.d.ts.map
@@ -9,5 +9,5 @@
9
9
  * Drift is prevented by a test that fails when this disagrees with
10
10
  * package.json, so a version bump that forgets this file cannot ship.
11
11
  */
12
- export declare const SDK_VERSION = "7.0.63";
12
+ export declare const SDK_VERSION = "7.0.65";
13
13
  //# sourceMappingURL=version.d.ts.map
package/lib/web/auto.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{d as a}from"./chunks/chunk-CLXYMJTS.mjs";import{createElement as n,lazy as l,Suspense as i,useEffect as f,useState as c}from"react";function r(){if(typeof window>"u")return false;let e=window.Capacitor,t=false;try{t=e?.isNativePlatform?.()===true}catch{t=false}return t?e?.DEBUG===true:typeof a<"u"?!!a:process.env.NODE_ENV!=="production"}var o;function p(){return o??(o=l(()=>import("./chunks/FloatingDevTools.web-M3ASH5EV.mjs").then(e=>({default:e.FloatingDevTools})))),o}function d({enabled:e,...t}){let[u,s]=c(false);return f(()=>{s(e??r())},[e]),u?n(i,{fallback:null},n(p(),t)):null}export{d as BuoyDevTools,r as shouldShowBuoy};
1
+ "use client";import{a as t,e as u}from"./chunks/chunk-LOPXJLVB.mjs";import{createElement as n,lazy as c,Suspense as p,useEffect as d,useState as y}from"react";function a(){if(typeof window>"u")return false;let o=window.Capacitor,e=false;try{e=o?.isNativePlatform?.()===true}catch{e=false}return e?o?.DEBUG===true:typeof u<"u"?!!u:process.env.NODE_ENV!=="production"}t(a,"shouldShowBuoy");var s;function l(){return s??(s=c(()=>import("./chunks/FloatingDevTools.web-P3PAM3FD.mjs").then(o=>({default:o.FloatingDevTools})))),s}t(l,"loadHost");function r({enabled:o,...e}){let[i,f]=y(false);return d(()=>{f(o??a())},[o]),i?n(p,{fallback:null},n(l(),e)):null}t(r,"BuoyDevTools");export{r as BuoyDevTools,a as shouldShowBuoy};
@@ -0,0 +1 @@
1
+ "use client";import{v as o}from"./chunk-NKUQECQ2.mjs";import"./chunk-Z6I7ZD34.mjs";import"./chunk-D2FYORGY.mjs";import"./chunk-LOPXJLVB.mjs";export{o as FloatingDevTools};
@@ -0,0 +1 @@
1
+ "use client";import{a as f}from"./chunk-LOPXJLVB.mjs";function _(){if(typeof window>"u")return;let y=window;if(y.__BUOY_EARLY_NETWORK__)return;let i=Date.now,c=true,l=[],p=f(t=>{if(l.push(t),l.length>100){let n=l.shift();n?.kind==="fetch"&&n.settled.then(a=>a.clone?.body?.cancel()).catch(()=>{})}},"push"),h=typeof window.fetch=="function"?window.fetch:void 0;if(h&&(window.fetch=f(function(t,n){if(n?.__buoyInternal||!c)return h.call(window,t,n);let a;try{t instanceof Request&&t.body&&!t.bodyUsed&&n?.body===void 0&&(a=t.clone())}catch{}let u=i(),d=h.call(window,t,n),r=d.then(e=>{let o=i(),s=/event-stream|ndjson/.test(e.headers.get("content-type")??""),w;try{s||(w=e.clone())}catch{}return{response:e,clone:w,headersAt:o}},e=>({error:e,headersAt:i()}));return p({kind:"fetch",input:t,init:n,requestCopy:a,start:u,settled:r}),d},"buoyEarlyFetch")),typeof XMLHttpRequest<"u"){let t=XMLHttpRequest.prototype,{open:n,send:a,setRequestHeader:u}=t,d=new WeakMap;t.open=function(r,e,...o){return c&&d.set(this,{method:r,url:String(e),headers:{}}),n.call(this,r,e,...o)},t.setRequestHeader=function(r,e){let o=d.get(this);return o&&(o.headers[r]=e),u.call(this,r,e)},t.send=function(r){let e=d.get(this);if(c&&e){d.delete(this);let o=i(),s=this;s.addEventListener("readystatechange",()=>{s.readyState===2&&s._buoyTtfb===void 0&&(s._buoyTtfb=i()-o),s.readyState===4&&(s._buoyEarlyEnd=i())}),p({kind:"xhr",xhr:s,method:e.method,url:e.url,headers:e.headers,body:r,start:o})}return a.call(this,r)}}y.__BUOY_EARLY_NETWORK__={version:1,records:l,adopt(){return c=false,l.splice(0)}}}f(_,"installEarlyNetworkRecorder");export{_ as a};
@@ -0,0 +1 @@
1
+ "use client";import{a as e}from"./chunk-LOPXJLVB.mjs";var t="@react_buoy_web_register_until";function r(){try{let a=Number(globalThis.localStorage?.getItem(t));return Number.isFinite(a)&&a>Date.now()}catch{return false}}e(r,"hasReleaseOptIn");function l(){try{globalThis.localStorage?.setItem(t,String(Date.now()+6048e5))}catch{}}e(l,"markReleaseOptIn");function o(){try{globalThis.localStorage?.removeItem(t)}catch{}}e(o,"clearReleaseOptIn");export{r as a,l as b,o as c};
@@ -0,0 +1 @@
1
+ "use client";var a=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var p=(e,r)=>a(e,"name",{value:r,configurable:true}),s=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var c=(e,r)=>{for(var t in r)a(e,t,{get:r[t],enumerable:true})},i=(e,r,t,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of f(r))!l.call(e,o)&&o!==t&&a(e,o,{get:()=>r[o],enumerable:!(u=n(r,o))||u.enumerable});return e},y=(e,r,t)=>(i(e,r,"default"),t&&i(t,r,"default"));var b=(()=>{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);export{p as a,s as b,c,y as d,b as e};
@@ -0,0 +1 @@
1
+ "use client";import{a as s}from"./chunk-LOPXJLVB.mjs";var f=new WeakMap,d=128;function l(){let n=window,e=n.__THREE_DEVTOOLS__??(n.__THREE_DEVTOOLS__=new EventTarget);if(!f.has(e)){let r=[];f.set(e,r);let t=s(i=>{let o=i.detail,a={type:i.type};if(typeof o=="object"&&o!==null||typeof o=="function"){if(typeof WeakRef>"u")return;a.ref=new WeakRef(o)}else a.value=o;r.push(a),r.length>d&&r.shift()},"record");e.addEventListener("register",t),e.addEventListener("observe",t)}return e}s(l,"installThreeBootHook");function v(n){let e=l(),r=s(t=>n({type:t.type,detail:t.detail}),"receive");e.addEventListener("register",r),e.addEventListener("observe",r);for(let t of[...f.get(e)]){let i=t.ref?t.ref.deref():t.value;t.ref&&i===void 0||n({type:t.type,detail:i})}return()=>{e.removeEventListener("register",r),e.removeEventListener("observe",r)}}s(v,"subscribeThreeBootEvents");export{l as a,v as b};
@@ -0,0 +1,10 @@
1
+ "use client";import{a as H,b as U,c as ct,d as or,e as wo,f as nr,g as xl,h as Re,i as xo,j as He,k as dt}from"./chunk-Z6I7ZD34.mjs";import{b as ir,c as rr}from"./chunk-D2FYORGY.mjs";import{a as r,b as To,e as We}from"./chunk-LOPXJLVB.mjs";import{BuoyPortal as ar,FloatingToolHost as sr}from"@buoy-gg/shared-ui/web/floating";import*as lr from"@buoy-gg/license/web";import{LicenseManager as cr,useLicense as dr,sameLicenseKey as ur,resolveDevBuild as pr,capacitorDebug as mr,isCapacitorNative as gr,loadCapacitorAppHost as fr}from"@buoy-gg/license/web";import{AccountSetup as hr,HintsProvider as yr,normalizeEnvironment as br,registerToolOpener as vr,startSettingsSync as Sr}from"@buoy-gg/shared-ui/web";import{useState as Et,useMemo as fe,useCallback as _e,useEffect as te,useRef as wr}from"react";import{useSettings as xr,getToolLabel as ut,getToolDescription as Tr,getToolColor as Co}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Ee,devToolsStorageKeys as pt,EnvironmentIndicator as Cr,EnvironmentSelectorInline as Ir}from"@buoy-gg/shared-ui/web";var kr=[];function Io(){return[]}r(Io,"autoDiscoverWebPresets");function Ot(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}r(Ot,"autoDiscoverWithCustom");function mt(e,t){return e.filter(o=>{let i=o.slot||"both";return i==="both"||i===t})}r(mt,"getToolsBySlot");function ko(e,t){let o=t instanceof Set?t:new Set(t);return e.filter(i=>o.has(i.id))}r(ko,"getEnabledTools");import{FloatingTool as zo,FloatingToolDivider as zr,FloatingToolUserStatus as Bo,getBubbleAnchorPosition as Br}from"@buoy-gg/shared-ui/web/floating";import{useState as Z,useEffect as Oe,useMemo as gt,useRef as ft,useCallback as ht}from"react";var Ao={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock",permissions:"Permissions","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};function Do(e,t){return e&&Ao[e]?Ao[e]:t}r(Do,"dialAccessibilityLabel");import{getDialLayout as Ar,getAllIconPositions as Dr,getGridLineRotations as Mr,getIconStaggerInputRange as Rr,MAX_DIAL_SLOTS as Xe,DIAL_ICON_SIZE as Er,dialAnimationConfig as Mo,getDialCSSKeyframesString as Or,getDialCSSAnimationStyles as Pr,dialColors as $,dialStyles as w,withAlpha as Ro,floatingToolsColors as Lr}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Eo,monoFont as Oo,ToolBackground as Fr,useToolBackground as $r}from"@buoy-gg/shared-ui/web";import{memo as jr}from"react";import{RasterLayer as Nr,scatter as Hr,useLoop as Wr,withBgAlpha as _r}from"@buoy-gg/shared-ui/web";import{Fragment as Ur,jsx as Qe}from"react/jsx-runtime";var Kr=.94,Vr=6,qr=2400,yt=3,Po=16,Gr=Array.from({length:yt},(e,t)=>Hr(22343^t*40503,Po*4)),Lo=["#FFFFFF","#B3D9FF","#8CB3FF"],Fo=Math.PI/3,$o=14*Math.PI/180;function jo(e){let t=Math.min(5,Math.floor(e*6)),o=e*6-t;return t*Fo+$o/2+o*(Fo-$o)}r(jo,"spokeClearAngle");function No(e){return Math.min(Vr,1/(1-e*Kr))}r(No,"scaleAt");function Ho(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}r(Ho,"opacityAt");function Wo(e){let t=e/yt,o=[],i=12;for(let c=0;c<=i;c++)o.push(c/i);let n=(1-t)%1;n>.001&&n<1-.001&&o.push(n-1e-4,n+1e-4),o.sort((c,p)=>c-p);let a=[],s=[],u=[];for(let c of o){let p=t===0&&c===1?1:(c+t)%1;a.push(c),s.push(No(p)),u.push(Ho(p))}return{input:a,scale:s,opacity:u}}r(Wo,"shellStops");var Jr=Array.from({length:yt},(e,t)=>Wo(t)),Yr=jr(r(function({size:e}){let t=Wr(qr),o=e/2,i=[];for(let n=0;n<yt;n++){let a=Gr[n],s=Jr[n],u=[];for(let c=0;c<Po;c++){let p=jo(a[c*4]),g=(.15+.85*Math.sqrt(a[c*4+1]))*.5*o,C=Lo[Math.floor(a[c*4+3]*Lo.length)%3],f=o+Math.cos(p)*g,D=o+Math.sin(p)*g,x=.6,M=x*2.4;u.push(Qe(H,{style:{position:"absolute",left:f-M/2,top:D-M/2,width:M,height:M,borderRadius:M/2,backgroundColor:_r(C,.3)}},`${c}-h`),Qe(H,{style:{position:"absolute",left:f-x/2,top:D-x/2,width:x,height:x,borderRadius:x/2,backgroundColor:C}},c))}i.push(Qe(Re.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:s.input,outputRange:s.opacity}),transform:[{scale:t.interpolate({inputRange:s.input,outputRange:s.scale})}]},pointerEvents:"none",children:Qe(Nr,{style:{width:e,height:e},raster:false,children:u})},n))}return Qe(Ur,{children:i})},"DialHyperspace"));import{useEffect as Xr,useState as _o}from"react";import{dialColors as Ue,withAlpha as Uo}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Qr,ARROW_HEIGHT as Zr,SPACING_GAP as Hl,getScreenCenterY as Wl,calculateTooltipPosition as ea,calculateTargetPosition as _l}from"@buoy-gg/shared-ui/web/floating";import{monoFont as Ko}from"@buoy-gg/shared-ui/web";import{jsx as Ke,jsxs as Vo}from"react/jsx-runtime";var qo=false;function Go(){if(qo||typeof document>"u")return;let e=document.createElement("style");e.textContent=`
2
+ @keyframes buoyOnboardPulse {
3
+ 0%, 100% { transform: scale(1); }
4
+ 50% { transform: scale(1.02); }
5
+ }
6
+ @keyframes buoyOnboardArrowBounce {
7
+ 0%, 100% { transform: translateY(0); }
8
+ 50% { transform: translateY(-8px); }
9
+ }
10
+ `,document.head.appendChild(e),qo=true}r(Go,"injectOnboardingKeyframes");var Pt=Ue.accent;function Lt({title:e,message:t,onDismiss:o,showArrow:i=true}){let[n,a]=_o(false),[s,u]=_o(false);Xr(()=>{Go();let p=requestAnimationFrame(()=>a(true));return()=>cancelAnimationFrame(p)},[]);let c={fontFamily:Ko,textTransform:"uppercase"};return Ke("div",{style:{position:"fixed",left:"50%",bottom:ea(),transform:`translateX(-50%) scale(${n?1:.8})`,opacity:n?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:Vo("div",{style:{position:"relative",animation:n?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ke("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),Vo("div",{style:{position:"relative",maxWidth:280,backgroundColor:Ue.dialBackground,borderRadius:16,border:`1px solid ${Ue.dialBorder}`,padding:20,boxShadow:`0 0 20px ${Uo(Ue.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ke("span",{style:{...c,fontSize:16,fontWeight:900,letterSpacing:1,color:Pt,textAlign:"center"},children:e}),Ke("span",{style:{fontFamily:Ko,fontSize:13,lineHeight:"20px",color:Ue.centerText,textAlign:"center"},children:t}),Ke("button",{onClick:o,onPointerDown:()=>u(true),onPointerUp:()=>u(false),onPointerLeave:()=>u(false),onPointerCancel:()=>u(false),style:{...c,marginTop:8,borderRadius:8,border:"none",backgroundColor:Pt,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:s?.7:1,transform:s?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),i&&Ke("div",{style:{position:"absolute",left:"50%",bottom:Qr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${Zr}px solid ${Pt}`,filter:`drop-shadow(0 0 10px ${Uo(Ue.dialShadow,.5)})`,animation:n?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}r(Lt,"OnboardingTooltip");import{Fragment as ta,jsx as P,jsxs as ve}from"react/jsx-runtime";var oa={x:.5,y:.5},Jo="@react_buoy_settings_tooltip_shown",Yo=false;function Xo(){if(Yo||typeof document>"u")return;let e=document.createElement("style");e.textContent=Or(),document.head.appendChild(e),Yo=true}r(Xo,"injectKeyframes");var Ve=r(e=>1-Math.pow(1-e,3),"easeOutCubic"),Ft=r(e=>e*e*e,"easeInCubic");function Qo({icon:e,index:t,totalIcons:o,position:i,progress:n,onPress:a}){let[s,u]=Z(false),[c,p]=Z(false),g=!e.icon&&e.id.startsWith("empty-"),C=!g&&e.unavailable===true,f=!g&&!C,{icons:D}=Mo,x=Rr(t,o),M=0;n<=x[1]?M=0:n<=x[2]?M=(n-x[1])/(x[2]-x[1]):M=1,M=Math.max(0,Math.min(1,M));let B=Er,E=D.pressIn.scale,A=M*(c?E:s?1.1:1),k=0;M<=0?k=0:M<=.3?k=M:k=.3+(M-.3)*(.7/.7);let S=i.x*M,I=i.y*M;return P("button",{role:"menuitem","aria-label":g?"Empty slot":Do(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!f,tabIndex:f?0:-1,onClick:f?a:void 0,onPointerEnter:F=>f&&F.pointerType==="mouse"&&u(true),onPointerLeave:()=>{u(false),p(false)},onPointerDown:()=>f&&p(true),onPointerUp:()=>p(false),onPointerCancel:()=>p(false),style:{position:"absolute",left:"50%",top:"50%",width:B,height:B,marginLeft:-B/2,marginTop:-B/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:f?"pointer":"default",transform:`translate(${S}px, ${I}px) scale(${A})`,opacity:k,transition:s||c?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:g?P("div",{style:{width:w.emptySlot.dotSize,height:w.emptySlot.dotSize,borderRadius:w.emptySlot.dotSize/2,backgroundColor:$.emptyDotBackground,border:`${w.emptySlot.borderWidth}px solid ${$.emptyDotBorder}`}}):ve(ta,{children:[P("div",{style:{position:"absolute",width:`${w.icon.gradientBgSizePercent}%`,height:`${w.icon.gradientBgSizePercent}%`,borderRadius:w.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:w.icon.gradientBgOpacity}}),P("div",{style:{position:"absolute",width:`${w.icon.innerGlowSizePercent}%`,height:`${w.icon.innerGlowSizePercent}%`,borderRadius:w.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:w.icon.innerGlowOpacity}}),P("div",{style:{marginBottom:w.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:s?"brightness(1.2)":"none"},children:e.icon}),P("span",{style:{fontSize:e.name.length>8?Math.max(w.icon.label.fontSize*.7,w.icon.label.fontSize*8/e.name.length):w.icon.label.fontSize,fontWeight:w.icon.label.fontWeight,fontFamily:w.icon.label.fontFamily,color:$.iconLabel,letterSpacing:w.icon.label.letterSpacing,marginTop:w.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),C&&P("span",{style:{fontSize:w.icon.label.fontSize-1,fontWeight:w.icon.label.fontWeight,fontFamily:w.icon.label.fontFamily,letterSpacing:w.icon.label.letterSpacing,color:Lr.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}r(Qo,"DialIconItem");function $t({side:e,color:t}){return P("svg",{width:18,height:18,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(e==="prev"?[[15,18,9,12],[9,12,15,6]]:[[9,18,15,12],[15,12,9,6]]).map(([o,i,n,a],s)=>P("line",{x1:o,y1:i,x2:n,y2:a,stroke:t,strokeWidth:2},s))})}r($t,"PagerChevron");function jt({side:e,disabled:t,onClick:o}){let[i,n]=Z(false),a=t?$.emptyDotBorder:$.accent;return ve("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:o,onPointerDown:()=>!t&&n(true),onPointerUp:()=>n(false),onPointerLeave:()=>n(false),onPointerCancel:()=>n(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${$.dialBorder}`,backgroundColor:$.dialBackground,color:t?$.iconLabelMuted:$.centerText,fontSize:12,fontWeight:900,fontFamily:Oo,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${Ro($.dialShadow,.4)}`,transform:i?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&P($t,{side:"prev",color:a}),e==="prev"?"PREV":"NEXT",e==="next"&&P($t,{side:"next",color:a})]})}r(jt,"PagerButton");function Nt({icons:e,onClose:t,centerLabel:o="MENU",onCenterPress:i,settingsOpen:n=false,hintsDisabled:a=false}){let{id:s}=$r(),[u,c]=Z(0),[p,g]=Z(0),[C,f]=Z(0),[D,x]=Z(0),[M,B]=Z(0),[E,A]=Z(1),[k,S]=Z(false),[I,F]=Z(false),[z,R]=Z(false),ee=ft(null),_=ft(null),G=ft(null),oe=ft(false),{entrance:V,exit:ae,interaction:ne}=Mo,Se=Pr(),[se,ke]=Z(()=>({width:window.innerWidth,height:window.innerHeight}));Oe(()=>{let v=r(()=>ke({width:window.innerWidth,height:window.innerHeight}),"resize");return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);let j=gt(()=>Ar({screenWidth:se.width,maxCircleSize:Math.max(120,Math.min(320,se.height-96))}),[se]),Ye=gt(()=>Mr(),[]),ze=gt(()=>Dr(Xe,j.iconRadius),[j.iconRadius]),[$e,Be]=Z(0),le=Math.max(1,Math.ceil(e.length/Xe)),Y=Math.min($e,le-1),we=gt(()=>{let v=Y*Xe,T=[...e.slice(v,v+Xe)];for(;T.length<Xe;)T.push({id:`empty-${T.length}`,name:"",icon:null,onPress:r(()=>{},"onPress")});return T},[e,Y]);Oe(()=>{Xo()},[]),Oe(()=>{let v=V.backdrop.duration,T=V.dial.rotation.duration,X=V.centerButton.delay,K=V.icons.delay,J=V.icons.duration,q=performance.now(),ie=r(ge=>{let l=ge-q;c(Math.min(1,l/v));let h=Math.min(1,l/400),O=Ve(h)*1.1;h>.7&&(O-=(h-.7)*.33),h>=1&&(O=1),g(Math.max(0,Math.min(1.05,O)));let Q=Math.min(1,l/T);if(f(Ve(Q)*360),l>=X){let Te=Math.min(1,(l-X)/300),Ne=Ve(Te)*1.15;Te>.6&&(Ne-=(Te-.6)*.375),Te>=1&&(Ne=1),x(Math.max(0,Math.min(1.05,Ne)))}if(l>=K){let Te=Math.min(1,(l-K)/J);B(Ve(Te))}let xe=K+J;l<xe?G.current=requestAnimationFrame(ie):(c(1),g(1),f(360),x(1),B(1),R(true))},"animate");return G.current=requestAnimationFrame(ie),()=>{G.current&&cancelAnimationFrame(G.current)}},[]);let me=ht(()=>{if(oe.current)return;oe.current=true,F(true),G.current&&cancelAnimationFrame(G.current);let v=performance.now(),T=ae.icons.duration,X=ae.centerButton.duration,K=ae.dialScale.duration,J=Math.max(X,K),q=ae.backdrop.duration,ie=r(ge=>{let l=ge-v;if(l<T){let Q=Ft(l/T);B(1-Q),G.current=requestAnimationFrame(ie);return}let h=T;if(l<h+J){B(0);let Q=Math.min(1,(l-h)/X),xe=Math.min(1,(l-h)/K);x(1-Ft(Q)),g(1-Ft(xe)),G.current=requestAnimationFrame(ie);return}let O=h+J;if(l<O+q){g(0),x(0);let Q=(l-O)/q;c(1-Q),G.current=requestAnimationFrame(ie);return}c(0),t()},"animate");G.current=requestAnimationFrame(ie)},[ae,t]);Oe(()=>{let v=document.activeElement,T=ee.current;return()=>{v?.isConnected&&(document.activeElement===document.body||T?.contains(document.activeElement))&&v.focus()}},[]),Oe(()=>{if(n)return;_.current?.focus();let v=r(T=>{let X=ee.current;if(X){if(T.key==="Escape")T.preventDefault(),me();else if(T.key==="Tab"){let K=Array.from(X.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(ie=>ie.getClientRects().length>0),J=K[0],q=K[K.length-1];(!X.contains(document.activeElement)||(T.shiftKey?document.activeElement===J:document.activeElement===q))&&(T.preventDefault(),(T.shiftKey?q:J)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(T.key)){let K=Array.from(X.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),J=K.indexOf(document.activeElement);if(J<0||!K.length)return;T.preventDefault();let q=T.key==="Home"?0:T.key==="End"?K.length-1:(J+(T.key==="ArrowRight"||T.key==="ArrowDown"?1:-1)+K.length)%K.length;K[q].focus()}}},"handleKeyDown");return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[me,n]);let[Ae,je]=Z(false);Oe(()=>{if(a)return;let v=false,T=setTimeout(async()=>{let X=await Eo.getItem(Jo);!v&&!X&&je(true)},1200);return()=>{v=true,clearTimeout(T)}},[a]);let ye=ht(()=>{je(false),Eo.setItem(Jo,"true")},[]);Oe(()=>{n&&Ae&&ye()},[n,Ae,ye]);let De=ht(v=>{if(v.id.startsWith("empty-")||oe.current)return;let[T,X]=ne.iconSelect.pulse,K=performance.now(),J=150,q=r(ie=>{let ge=ie-K;if(ge<J){let l=Ve(ge/J);A(1-(1-T.scale)*l),requestAnimationFrame(q)}else if(ge<J*2){let l=Ve((ge-J)/J);A(T.scale+(X.scale-T.scale)*l),requestAnimationFrame(q)}else A(1)},"animatePulse");requestAnimationFrame(q),setTimeout(()=>{v.onPress(),me()},ne.iconSelect.actionDelay)},[ne.iconSelect,me]),pe=ht(v=>{if(oe.current)return;let T=Math.max(0,Math.min(v,le-1));T!==Y&&Be(T)},[le,Y]),be=j.buttonSize*w.centerButton.containerRatio,Me=j.buttonSize*w.centerButton.borderRatio,d=j.buttonSize*w.centerButton.containerRatio/2+6,W=z&&!I;return ve("div",{ref:ee,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[P("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:me,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:$.dialBackdrop,opacity:u}}),ve("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,bottom:80,width:j.circleSize,height:j.circleSize,borderRadius:"50%",backgroundColor:$.dialBackground,border:`${w.circle.borderWidth}px solid ${$.dialBorder}`,boxShadow:`0 0 ${w.circle.shadowRadius}px ${Ro($.dialShadow,w.circle.shadowOpacity)}`,transform:`scale(${p}) rotate(${C}deg)`,opacity:p>.01?1:0,overflow:"hidden"},children:[P("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:$.dialGradient1,opacity:w.gradientLayers[0].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:$.dialGradient2,opacity:w.gradientLayers[1].opacity}}),P("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:$.dialGradient3,opacity:w.gradientLayers[2].opacity}}),Ye.map(v=>P("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:w.grid.lineHeight,transform:`rotate(${v}deg)`,transformOrigin:"center"},children:["left","right"].map(T=>P("div",{style:{position:"absolute",top:0,[T]:0,width:`calc(50% - ${d}px)`,height:w.grid.lineHeight,backgroundColor:$.dialGridLine}},T))},v)),P("div",{"data-testid":"dial-background","data-background":s,style:{position:"absolute",inset:0,pointerEvents:"none"},children:s==="hyperspace"?P(Yr,{size:j.circleSize}):P(Fr,{focus:oa})}),we.map((v,T)=>P(Qo,{icon:v,index:T,totalIcons:we.length,position:ze[T],progress:M,onPress:()=>De(v)},T)),ve("div",{style:{position:"absolute",left:"50%",top:"50%",width:be,height:be,marginLeft:-be/2,marginTop:-be/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:$.hubHalo,borderRadius:j.buttonSize,overflow:"hidden",transform:`scale(${D*E})`,opacity:D>.01?1:0},children:[P("div",{style:{position:"absolute",inset:0,backgroundColor:$.dialGradient1,opacity:.5,borderRadius:j.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:$.dialGradient2,opacity:.3,borderRadius:j.buttonSize}}),P("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:$.dialGradient3,opacity:.2,borderRadius:j.buttonSize}}),P("div",{style:{width:Me,height:Me,borderRadius:j.buttonSize*w.centerButton.borderRadiusRatio,backgroundColor:$.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:P("button",{ref:_,type:"button","aria-label":n?"Close Settings":"Open Dev Tools Settings",disabled:!i,onClick:i,onPointerEnter:v=>v.pointerType==="mouse"&&S(true),onPointerLeave:()=>S(false),style:{border:0,padding:0,background:"transparent",width:j.buttonSize,height:j.buttonSize,borderRadius:j.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default",transform:k?`scale(${ne.centerHover.scale})`:"scale(1)",transition:`transform ${ne.centerHover.duration}ms ease`,animation:W&&!k?Se.pulse:"none"},children:n?ve("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:w.centerButton.text.fontSize-2,fontWeight:w.centerButton.text.fontWeight,fontFamily:w.centerButton.text.fontFamily,color:$.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[P("span",{style:{marginBottom:-2},children:"CLOSE"}),P("span",{style:{marginTop:-2},children:"SETTINGS"})]}):P("span",{style:{fontSize:w.centerButton.text.fontSize,fontWeight:w.centerButton.text.fontWeight,fontFamily:w.centerButton.text.fontFamily,color:$.centerText,letterSpacing:w.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${$.centerTextGlow}`,textTransform:"uppercase"},children:o})})})]})]}),le>1&&ve("div",{style:{position:"absolute",left:"50%",marginLeft:-j.circleSize/2,top:"calc(100% - 64px)",width:j.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,p),transform:`scale(${Math.min(1,p)})`},children:[P(jt,{side:"prev",disabled:Y<=0,onClick:()=>pe(Y-1)}),ve("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:Oo,letterSpacing:2,color:$.centerText,textShadow:`0 0 6px ${$.centerTextGlow}`},children:[String(Y+1).padStart(2,"0"),ve("span",{style:{color:$.iconLabelMuted,textShadow:"none"},children:[" / ",String(le).padStart(2,"0")]})]}),P(jt,{side:"next",disabled:Y>=le-1,onClick:()=>pe(Y+1)})]}),Ae&&!n&&P(Lt,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:ye,showArrow:false})]})}r(Nt,"DialMenu");import{persistentStorage as Zo,devToolsStorageKeys as na}from"@buoy-gg/shared-ui/web";import{recordUsage as ia,pruneUsage as ra}from"@buoy-gg/floating-tools-core/web";var en=na.dial.usage(),qe={},tn=false,Ht=null;function Wt(){return Ht||(Ht=(async()=>{try{let e=await Zo.getItem(en);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(qe=t)}}catch{}finally{tn=true}})(),Ht)}r(Wt,"loadDialUsage");Wt();function on(e){return e.map((t,o)=>({id:t,index:o,lastUsed:qe[t]?.lastUsed??0})).sort((t,o)=>o.lastUsed-t.lastUsed||t.index-o.index).map(({id:t})=>t)}r(on,"getRankedToolIds");async function nn(e){if(!e)return;tn||await Wt();let t=Math.max(Date.now(),...Object.values(qe).map(o=>o.lastUsed+1));qe=ra(ia(qe,e,t),t);try{await Zo.setItem(en,JSON.stringify(qe))}catch{}}r(nn,"recordToolUsage");import{useCallback as aa,useMemo as rn}from"react";import{persistentStorage as sa}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Ce,useCallback as bt,useMemo as vt}from"react";import{settingsEventBus as St}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as la}from"react";import{getRegisteredToolModule as ca}from"@buoy-gg/shared-ui/web";var da=r(()=>()=>{},"noopSubscribe"),ua=r(()=>null,"serverSnapshot");function an(){let e=ca("@buoy-gg/external-sync");return la(e?.subscribeSyncStatus??da,()=>e?.getSyncStatus?.()??null,ua)}r(an,"useDesktopSyncStatus");import{SentryIcon as pa,WifiCircuitIcon as ma,ImageOverlayIcon as ga,RenderCountIcon as fa,Info as _t,Layers as ha,ChevronRightIcon as sn,ChevronDown as ln,getStorageBackendType as ya,getUseLicense as ba,signOutOfBuoy as va,persistentStorage as Pe,Trash2 as Sa,CheckCircle2 as cn,BuoyUpgradeSheet as wa,BackgroundSwitcher as xa,night as y,NightCard as Le,NightRows as Ut,NightSectionLabel as Ta,NightFootnote as dn,NightSwitch as un,NightButton as Kt,NightSegmented as Ca,NightBadge as he,NightSeparator as Ia,monoFont as pn}from"@buoy-gg/shared-ui/web";import{EnvIcon as mn,StorageIcon as ka,RoutesIcon as za,NetworkIcon as Ba,QueryIcon as Aa,HighlighterIcon as Da,ReduxIcon as Ma,EventsIcon as Ra}from"@buoy-gg/floating-tools-core/web";import Ea,{createContext as Oa,useContext as Pa}from"react";import{jsx as La}from"react/jsx-runtime";var gn=Oa({});function Vt({children:e,defaultFloatingTools:t,defaultDialTools:o}){let i=Ea.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:o}),[t,o]);return La(gn.Provider,{value:i,children:e})}r(Vt,"DefaultConfigProvider");function qt(){return Pa(gn)}r(qt,"useDefaultConfig");import Fa from"react";import{toolTheme as $a}from"@buoy-gg/shared-ui/web";import{jsx as fn}from"react/jsx-runtime";function hn({label:e,size:t,color:o=$a.colors.text}){let i=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),n=i<=2?t:t*1.6,a=Math.max(7,Math.min(t*(i===1?.7:.62),n/(.62*i)));return fn("span",{style:{display:"inline-flex",minWidth:t,maxWidth:n,height:t,alignItems:"center",justifyContent:"center",color:o,fontSize:a,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}r(hn,"AppTextIcon");function Gt(e,t){return e==null?e:typeof e=="function"?Fa.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?fn(hn,{label:String(e),size:t.size,color:t.color}):e}r(Gt,"renderAppIcon");import{JsModal as ja,devToolsStorageKeys as Jt,onSettingsApplied as Na,expandableWindowControlsSupported as Ha}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Wa}from"@buoy-gg/shared-ui/web";import{Fragment as Ze,jsx as m,jsxs as N}from"react/jsx-runtime";var et="@react_buoy_dev_tools_settings",_a=6,wt=r(e=>{let t=_a,o={};for(let[i,n]of Object.entries(e))n&&t>0?(o[i]=true,t-=1):o[i]=false;return o},"enforceDialLimit"),Ua=r((e,t)=>{let{userStatus:o,environment:i,...n}=e,a=t?Object.entries(n).filter(([s])=>t.includes(s)):Object.entries(n);return{...Object.fromEntries(a),environment:i??false}},"sanitizeFloating"),yn=r((e,t,o)=>{if(!t)return e;let i={...e.dialTools,...t.dialTools??{}},n=o?.allowedDialKeys?Object.entries(i).filter(([a])=>o.allowedDialKeys?.includes(a)):Object.entries(i);return{dialTools:wt(Object.fromEntries(n)),floatingTools:Ua({...e.floatingTools,...t.floatingTools??{}},o?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},"mergeWithDefaults"),Ka=r((e=[],t,o)=>{let i={},n={},a=new Set(t??[]),s=new Set(o??[]),u=!o||o.length===0;for(let c of e){let{id:p,slot:g="both"}=c;(g==="dial"||g==="both")&&(i[p]=u?true:s.has(p)),(g==="row"||g==="both")&&(n[p]=a.has(p))}return{dialTools:wt(i),floatingTools:{...n,environment:a.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},"generateDefaultSettings"),Va=r(({visible:e,onClose:t,onSettingsChange:o,initialSettings:i,availableApps:n=[],storage:a=Pe,zIndex:s})=>{let{defaultFloatingTools:u,defaultDialTools:c}=qt(),p=vt(()=>Ka(n,u,c),[n,u,c]),g=vt(()=>Object.keys(p.dialTools),[p]),C=vt(()=>Object.keys(p.floatingTools).filter(l=>l!=="environment"),[p]),[f,D]=re(i||tt||p),[x,M]=re(Yt??"floating"),[B,E]=re(Yt!==null),[A,k]=re(new Set),[S,I]=re(false),[F,z]=re(false);Ce(()=>{let l=requestAnimationFrame(()=>z(true));return()=>cancelAnimationFrame(l)},[]);let R=an();Ce(()=>{r(async()=>{try{let l=await Pe.getItem(Jt.settings.activeTab());if(l&&["floating","settings","pro"].includes(l)){let h=l;Yt=h,M(O=>O===h?O:h)}}catch{}finally{E(true)}},"loadActiveTab")()},[]),Ce(()=>{B&&Pe.setItem(Jt.settings.activeTab(),x).catch(l=>{console.warn("[Buoy]","Failed to save settings active tab:",l)})},[x,B]);let ee=ba()?.(),_=ee?.isPro??false,G=!_&&ee?.licenseKey?ee.error:null,oe=ee?.errorKind==="transport",[V,ae]=re(bn),[ne,Se]=re(false),[se,ke]=re(false),[j,Ye]=re(false),[ze,$e]=re([]),[Be,le]=re(false),Y=Wa(),we=xo.get("window").height,me=xo.get("window").width,Ae=Math.floor(we*.33),je=Math.min(me-32,400),ye=bt(async()=>{try{let l=await a.getItem(et);if(l){let h=JSON.parse(l),O=yn(p,h,{allowedDialKeys:g,allowedFloatingKeys:C});tt=O,D(Q=>vn(Q,O)?Q:O);return}tt=p,D(h=>vn(h,p)?h:p)}catch(l){console.error("[Buoy]","Failed to load dev tools settings:",l),D(p)}},[p,g,C,a]);Ce(()=>{ye()},[ye]),Ce(()=>{ya().then(l=>{bn=l,ae(h=>h===l?h:l)})},[]),Ce(()=>{j&&(le(true),Pe.getAllKeys().then(l=>{$e(l.sort())}).catch(()=>{$e([])}).finally(()=>{le(false)}))},[j]);let De=r(async l=>{try{let h={...l,dialTools:wt(l.dialTools)};await a.setItem(et,JSON.stringify(h)),tt=h,D(h),o?.(h),St.emit(h)}catch(h){console.error("[Buoy]","Failed to save dev tools settings:",h)}},"saveSettings"),pe=r(l=>{let h={...f,floatingTools:{...f.floatingTools,[l]:!f.floatingTools[l]}};De(h)},"toggleFloatingTool"),be=r(l=>{let h={...f,globalSettings:{...f.globalSettings,[l]:!f.globalSettings?.[l]}};De(h)},"toggleGlobalSetting"),Me=r(async()=>{Se(true),ke(false);try{await Pe.clear(),ke(true),D(p),a!==Pe&&await a.setItem(et,JSON.stringify(p)),o?.(p),St.emit(p),setTimeout(()=>ke(false),2e3)}catch(l){console.error("[Buoy]","Failed to clear storage:",l)}finally{Se(false)}},"handleClearStorage"),d=bt(l=>{},[]),W=r(l=>{let h=n.find(O=>O.id===l);return h?.description?h.description:l==="environment"?"Environment badge.":""},"getToolDescription"),v=r(l=>l==="environment"?"Env Badge":n.find(h=>h.id===l)?.name??l.toUpperCase().replace(/_/g," "),"getToolLabel"),T=r(l=>{if(!F)return null;switch(l){case"query":return m(Aa,{size:18});case"env":return m(mn,{size:18});case"sentry":return m(pa,{size:18,color:"#9945FF"});case"storage":return m(ka,{size:18,bgColor:y.color.surface});case"wifi":case"query-wifi-toggle":return m(ma,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return m(za,{size:18,bgColor:y.color.surface});case"network":return m(Ba,{size:18});case"environment":return m(mn,{size:18});case"debug-borders":return m(ha,{size:18,color:y.color.accent});case"highlight-updates":return m(fa,{size:18,color:y.color.accent});case"highlight-updates-modal":return m(Da,{size:18});case"redux":return m(Ma,{size:18});case"image-overlay":return m(ga,{size:18});case"events":return m(Ra,{size:18});case"zustand":try{let{ZustandIcon:h}=To("@buoy-gg/zustand/web");return m(h,{size:18})}catch{return m(_t,{size:18,color:y.color.textSecondary})}case"jotai":try{let{JotaiIcon:h}=To("@buoy-gg/jotai/web");return m(h,{size:18})}catch{return m(_t,{size:18,color:y.color.textSecondary})}default:{let h=n.find(O=>O.id===l);return h?.icon!=null?Gt(h.icon,{slot:"row",size:18,color:h.color}):m(_t,{size:18,color:y.color.textSecondary})}}},"getToolIcon"),X=r((l,h,O,Q)=>{let xe=W(l);return N(ct,{activeOpacity:O?1:.7,onPress:()=>!O&&Q(),accessibilityLabel:v(l),accessibilityRole:"button",style:[b.toolRow,O&&b.rowDisabled],children:[m(H,{style:b.toolIconSlot,children:T(l)}),N(H,{style:b.rowInfo,children:[N(U,{style:b.rowLabel,children:[v(l),O?" \xB7 max 6":""]}),xe?m(U,{style:b.rowCaption,numberOfLines:1,children:xe}):null]}),m(un,{value:h,disabled:O,onValueChange:()=>Q()})]},l)},"renderToolRow"),K=r(l=>{k(h=>{let O=new Set(h);return O.has(l)?O.delete(l):O.add(l),O})},"toggleSettingExpanded"),J=r((l,h,O,Q,xe)=>{let Te=f.globalSettings?.[l]??false,Ne=A.has(l);return N(H,{children:[N(ct,{activeOpacity:.7,onPress:()=>K(l),accessibilityLabel:h,style:b.settingRow,children:[N(H,{style:b.rowInfo,children:[m(U,{style:b.rowLabel,children:h}),m(U,{style:b.rowCaption,numberOfLines:Ne?0:1,children:O})]}),m(un,{value:Te,onValueChange:()=>be(l)})]}),Ne&&N(H,{style:b.settingRowBody,children:[m(U,{style:b.settingRowBodyText,children:Q}),m(U,{style:b.settingRowBodyHint,children:xe})]})]},l)},"renderGlobalSettingRow"),q=r((l,h,O)=>N(H,{children:[m(Ta,{children:l}),h,O]}),"renderSection"),ie=V==="filesystem"?m(he,{label:"File System",tone:"accent"}):V==="asyncstorage"?m(he,{label:"Async Storage",tone:"warning"}):V==="localstorage"?m(he,{label:"Local Storage",tone:"accent"}):V==="memory"?m(he,{label:"Memory",tone:"danger"}):m(he,{label:"Loading\u2026",tone:"neutral"}),ge=r(()=>N(H,{style:b.container,children:[N(wo,{style:b.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:b.scrollContainer,children:[x==="floating"&&m(Ze,{children:q("Floating Tools",m(Le,{glass:true,children:m(Ut,{children:Object.entries(f.floatingTools).map(([l,h])=>X(l,h,false,()=>pe(l)))})}),m(dn,{children:"Tools switched on here appear in the floating bubble row."}))}),x==="settings"&&N(Ze,{children:[q("Background",m(Le,{glass:true,padded:true,children:m(xa,{embedded:true})})),q("Storage",N(Le,{glass:true,children:[N(ct,{activeOpacity:.7,onPress:()=>Ye(!j),accessibilityLabel:"Storage Type",style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Storage Type"})}),ie,j?m(ln,{size:16,color:y.color.textTertiary}):m(sn,{size:16,color:y.color.textTertiary})]}),j&&N(Ze,{children:[N(H,{style:b.settingRowBody,children:[m(U,{style:b.settingRowBodyText,children:V==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":V==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":V==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":V==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),V==="asyncstorage"&&m(U,{style:[b.settingRowBodyText,b.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),V==="memory"&&m(U,{style:[b.settingRowBodyText,b.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),m(Ia,{}),N(H,{style:b.storageExpanded,children:[N(H,{style:b.storageExpandedHeader,children:[m(U,{style:b.storageExpandedTitle,children:"SAVED SETTINGS"}),m(U,{style:b.storageExpandedCount,children:Be?"\u2026":`${ze.length} keys`})]}),Be?m(U,{style:b.storageKeyEmpty,children:"Loading\u2026"}):ze.length===0?m(U,{style:b.storageKeyEmpty,children:"No settings saved yet"}):m(wo,{style:b.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ze.map(l=>m(H,{style:b.storageKeyItem,children:m(U,{style:b.storageKeyText,numberOfLines:1,children:l.replace("@react_buoy_","")})},l))})]}),m(H,{style:b.cardButtonWrap,children:m(Kt,{label:se?"Cleared":ne?"Clearing\u2026":"Clear All Settings",variant:se?"secondary":"destructive",size:"md",disabled:ne,onPress:Me,icon:se?m(cn,{size:15,color:y.color.accent}):m(Sa,{size:15,color:ne?y.color.textTertiary:y.color.danger})})})]})]})),R&&R.state!=="idle"&&q("Desktop Sync",N(Le,{glass:true,children:[N(ct,{activeOpacity:.7,onPress:()=>K("desktopSync"),accessibilityLabel:"Buoy Desktop",style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Buoy Desktop"})}),R.state==="connected"?m(he,{label:"Connected",tone:"accent"}):R.state==="connecting"?m(he,{label:"Connecting\u2026",tone:"neutral"}):m(he,{label:"Retrying",tone:"warning"}),A.has("desktopSync")?m(ln,{size:16,color:y.color.textTertiary}):m(sn,{size:16,color:y.color.textTertiary})]}),A.has("desktopSync")&&N(H,{style:b.settingRowBody,children:[N(U,{style:b.settingRowBodyText,children:[R.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",m(U,{style:b.footnoteMono,children:R.targetURL??"(unknown URL)"}),R.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),R.state==="retrying"&&R.lastError&&N(U,{style:[b.settingRowBodyText,b.bodyWarning],children:["Last error: ",R.lastError]})]})]})),q("Modal Behavior",m(Le,{glass:true,children:N(Ut,{children:[J("enableSharedModalDimensions","Shared Modal Size","Sync dimensions across all tools","When enabled, all tool modals will share the same size and position. Resizing one modal will affect all others. When disabled, each tool remembers its own size and position independently.","Keep OFF for the best experience. This allows you to customize each tool's modal size separately."),Ha(He.OS==="web")?J("expandableWindowControls","Expand Controls","iPad-style expandable window buttons","When enabled, the window control buttons (minimize, toggle mode, close) start as small dots and expand into larger, easy-to-tap buttons when pressed. When disabled, buttons are directly tappable at their small size.","Keep ON for touch devices where the small buttons are hard to press. Turn OFF if you prefer direct single-tap access."):null]})}))]}),x==="pro"&&N(Ze,{children:[q("License",N(Le,{glass:true,children:[N(H,{style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"License Status"})}),m(H,{testID:"buoy-settings-license-status",accessibilityLabel:_?"License: Active":"License: Free",children:_?m(he,{label:"Active",tone:"accent"}):m(he,{label:"Free",tone:"neutral"})})]}),ee?.tierSource==="session"?N(H,{style:b.settingRow,children:[m(H,{style:b.rowInfo,children:m(U,{style:b.rowLabel,children:"Signed in with Buoy"})}),m(Kt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void va(),testID:"buoy-settings-signout"})]}):null]}),m(dn,{children:_?"You have full access to all Buoy DevTools features.":G?oe?`Couldn't reach the license server (${G}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${G}.`:"Upgrade to Pro to unlock all features and support development."})),!_&&N(Ze,{children:[q("Pro Features",m(Le,{glass:true,children:m(Ut,{children:["Advanced Settings","Priority Support"].map(l=>N(H,{style:b.featureRow,children:[m(cn,{size:16,color:y.color.accent}),m(U,{style:b.rowLabel,children:l})]},l))})})),m(Kt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>I(true)})]})]})]}),m(wa,{visible:S,onClose:()=>I(false)})]}),"renderContent");return m(ja,{visible:e,onClose:t,zIndex:s,variant:"night",header:{showToggleButton:false,customContent:m(H,{style:b.headerRow,children:m(Ca,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:x,onChange:l=>M(l)})})},initialMode:"bottomSheet",onModeChange:d,persistenceKey:Jt.settings.root(),enablePersistence:true,maxHeight:we-Y.top,initialHeight:Ae,initialFloatingPosition:{x:(me-je)/2,y:Y.top+20},enableGlitchEffects:true,children:ge()})},"DevToolsSettingsModal"),qa={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},Ga=r((e,t)=>{let o=new Set(e??[]),i=new Set(t??[]),n={};for(let s of i)n[s]=true;let a={environment:o.has("environment")};for(let s of o)s!=="environment"&&(a[s]=true);return{dialTools:wt(n),floatingTools:a,globalSettings:{enableSharedModalDimensions:false}}},"createDefaultsFromConfig"),tt=null,Yt=null,bn=null,vn=r((e,t)=>JSON.stringify(e)===JSON.stringify(t),"sameSettings");St.addListener(e=>{e&&(tt=e)});var Sn=r(()=>{let{defaultFloatingTools:e,defaultDialTools:t}=qt(),o=vt(()=>!e&&!t?qa:Ga(e,t),[e,t]),[i,n]=re(o),a=bt(async()=>{try{let u=await Pe.getItem(et);if(u){let c=JSON.parse(u),p=yn(o,c);n(p);return}n(o)}catch(u){console.error("[Buoy]","Failed to load dev tools settings:",u),n(o)}},[o]);Ce(()=>Na(u=>{u.includes(et)&&a()}),[a]),Ce(()=>{a();let u=St.addListener(c=>{try{c&&n(c)}catch{}});return()=>{u()}},[a]);let s=bt(()=>{a()},[a]);return{settings:i,refreshSettings:s}},"useDevToolsSettings"),b=dt.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:y.gutter,paddingRight:y.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:y.gutter,paddingTop:8,paddingBottom:24,gap:y.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:y.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:y.rowPadH,paddingVertical:y.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:y.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:y.color.text,fontSize:y.font.row,fontWeight:"500"},rowCaption:{color:y.color.textTertiary,fontSize:y.font.label},settingRowBody:{paddingHorizontal:y.rowPadH,paddingBottom:y.rowPadV,gap:6},settingRowBodyText:{color:y.color.textSecondary,fontSize:y.font.caption,lineHeight:y.font.caption*1.45},settingRowBodyHint:{color:y.color.textTertiary,fontSize:y.font.caption,lineHeight:y.font.caption*1.45},bodyWarning:{color:y.color.warning},bodyDanger:{color:y.color.danger},cardButtonWrap:{paddingHorizontal:y.cardPad,paddingTop:10,paddingBottom:y.cardPad},storageExpanded:{paddingHorizontal:y.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:y.color.textSecondary,fontSize:y.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:y.color.textTertiary,fontSize:y.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:y.color.glassElevated,borderRadius:y.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:y.color.textSecondary,fontSize:y.font.micro,fontFamily:pn},storageKeyEmpty:{color:y.color.textTertiary,fontSize:y.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:pn,fontSize:y.font.label,color:y.color.textSecondary}});import{jsx as wn}from"react/jsx-runtime";var Ja=[];function Xt({visible:e,onClose:t,availableTools:o=Ja,defaultFloatingTools:i,defaultDialTools:n,storage:a=sa,onSettingsChange:s}){let u=rn(()=>({getItem:r(async g=>a.getItem(g),"getItem"),setItem:r(async(g,C)=>a.setItem(g,C),"setItem")}),[a]),c=rn(()=>o.map(g=>({...g,name:g.name??g.id,icon:typeof g.icon=="function"?C=>g.icon(C.size):g.icon})),[o]),p=aa(g=>{s?.(g)},[s]);return wn(Vt,{defaultFloatingTools:i,defaultDialTools:n,children:wn(Va,{visible:e,onClose:t,zIndex:11e3,availableApps:c,storage:u,onSettingsChange:p})})}r(Xt,"SettingsModal");import{listenBuoyKeydown as Ya}from"@buoy-gg/shared-ui/web/floating";import{persistentStorage as xn,setExpandableWindowControls as Xa}from"@buoy-gg/shared-ui/web";import{createContext as Qa,useCallback as Ie,useContext as Za,useEffect as xt,useMemo as es,useRef as ot,useState as Tn}from"react";var ts=r((e,t,o)=>{if(t.singleton){let n=e.find(a=>a.id===t.id);if(n){let a=n.minimized??false;return{instanceId:n.instanceId,wasMinimized:a,apps:[...e.filter(s=>s.instanceId!==n.instanceId),{...n,minimized:false}]}}}let i=o();return{instanceId:i,wasMinimized:false,apps:[...e,{...t,instanceId:i}]}},"resolveOpenAppsState");import{createContext as os,useCallback as Cn,useContext as ns,useEffect as Tt,useMemo as is,useRef as In,useState as Ct}from"react";import{JsModal as rs,ModalHeader as nt,HeaderSearchButton as as,TickProvider as ss,ToolScreenHeaderContext as ls,devToolsStorageKeys as kn,buoyColors as zn,gameUIColors as Qt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as It}from"react/jsx-runtime";var it=r(()=>{},"noop"),cs={search:"",isSearchActive:false,clearSearch:it,close:it,minimize:it,showToast:it,setHeaderOverride:it},Bn=os(null);function Zt(){return ns(Bn)??cs}r(Zt,"useToolHost");function An(e,t){let{setHeaderOverride:o}=Zt();Tt(()=>(o(e),()=>o(null)),t)}r(An,"useToolHeader");var Dn=2200,ds={success:Qt.success,error:Qt.error,info:Qt.info};function Mn({message:e,type:t,nonce:o}){let i=In(new Re.Value(0)).current;Tt(()=>{i.setValue(0),Re.sequence([Re.timing(i,{toValue:1,duration:150,useNativeDriver:true}),Re.delay(Dn-450),Re.timing(i,{toValue:0,duration:300,useNativeDriver:true})]).start()},[o,i]);let n=ds[t];return It(Re.View,{pointerEvents:"none",style:[kt.toast,{opacity:i,borderColor:n+"60"}],children:[ce(H,{style:[kt.toastDot,{backgroundColor:n}]}),ce(U,{style:kt.toastText,numberOfLines:2,children:e})]})}r(Mn,"ToastView");function Rn({app:e,config:t,visible:o,zIndex:i,onClose:n,onMinimize:a,initialModalState:s,enableSharedModalDimensions:u,bodyProps:c}){let p=e.component,[g,C]=Ct(false),[f,D]=Ct(""),[x,M]=Ct(null),[B,E]=Ct(null),A=In(null),k=Cn(()=>{C(false),D("")},[]),S=Cn((V,ae="info")=>{A.current&&clearTimeout(A.current),E(ne=>({message:V,type:ae,nonce:(ne?.nonce??0)+1})),A.current=setTimeout(()=>E(null),Dn)},[]);Tt(()=>()=>{A.current&&clearTimeout(A.current)},[]);let I=is(()=>({search:g?f:"",isSearchActive:g,clearSearch:k,close:n,minimize:r(()=>a(),"minimize"),showToast:S,setHeaderOverride:M,instanceId:e.instanceId}),[f,g,k,n,a,S,e.instanceId]),F=x?.title??t.title??e.title??e.id,z=x?.subtitle??t.subtitle,R=x?.onBack,ee=x?.actions??t.headerActions,_=x?.searchable??t.searchable;Tt(()=>{!_&&g&&k()},[_,g,k]);let G=u?kn.modal.root():kn.custom(e.id).modal(),oe=It(nt,{children:[R&&!g&&ce(nt.Navigation,{onBack:R}),g?ce(nt.Search,{value:f,onChangeText:D,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):ce(nt.Content,{title:F,subtitle:z}),It(nt.Actions,{children:[!g&&ee,_&&!g&&ce(as,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>C(true)})]})]});return ce(Bn.Provider,{value:I,children:ce(rs,{visible:o,onClose:n,onBack:R,onMinimize:a,initialModalState:s,zIndex:i,persistenceKey:G,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:oe,showToggleButton:true},disableScrollWrapper:true,styles:{},children:It(H,{style:kt.bodyRoot,children:[ce(ss,{children:ce(ls.Provider,{value:M,children:ce(p,{...c})})}),B&&ce(Mn,{message:B.message,type:B.type,nonce:B.nonce})]})})})}r(Rn,"ToolModalShell");var kt=dt.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:zn.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:zn.text}});import{useEffect as us,useRef as ps}from"react";import{capacitorPlatform as ms,capacitorPlugin as gs}from"@buoy-gg/license/web";function En(){return globalThis.__BUOY_HOLDS_BACK__===true}r(En,"isBuoyHoldingBackButton");var fs=99.5;function On(){if(typeof document>"u")return false;let e=globalThis.Ionic;if(!e&&!document.querySelector("ion-app"))return false;try{return e?.config?.get?.("hardwareBackButton",true)!==false}catch{return true}}r(On,"ionicHandlesBack");function Pn(e,t){let o=ps(t);o.current=t,us(()=>{if(!e||ms()!=="android")return;let i=globalThis;i.__BUOY_HOLDS_BACK__=true;let n;if(On()){let a=r(s=>{s.detail?.register?.(fs,()=>{o.current()})},"listener");document.addEventListener("ionBackButton",a),n=r(()=>document.removeEventListener("ionBackButton",a),"cleanup")}else{let a=gs("App");if(!a?.addListener){i.__BUOY_HOLDS_BACK__=false;return}let s=false,u=null;Promise.resolve(a.addListener("backButton",()=>o.current())).then(c=>{s?c.remove():u=c}).catch(()=>{}),n=r(()=>{s=true,u&&u.remove()},"cleanup")}return()=>{n(),i.__BUOY_HOLDS_BACK__=false}},[e])}r(Pn,"useCapacitorBackButton");import{Fragment as hs,jsx as de}from"react/jsx-runtime";var Ln=Qa(null),Fn="@react_buoy_open_apps",eo=44,ys=12,bs=100,vs=16,Ss=r(e=>({x:window.innerWidth-eo-vs,y:window.innerHeight-bs-eo-e*(eo+ys)}),"dockIconPosition"),$n=r(({children:e})=>{let[t,o]=Tn([]),[i,n]=Tn(false),a=ot([]),s=ot(null),u=ot(false),c=ot(false),p=ot(false),g=Ie(S=>{let I="";return o(F=>{let{apps:z,instanceId:R}=ts(F,S,()=>`${S.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return I=R,z}),I},[]),C=Ie(()=>{if(u.current||!c.current||!p.current)return;u.current=true;let S=s.current;if(!S||S.length===0){n(true);return}s.current=null,S.forEach(({id:I,minimized:F})=>{let z=a.current.find(R=>R.id===I);if(z&&z.component){let R=Gt(z.icon,{slot:"dial",size:20,color:z.color});g({id:z.id,title:z.name,component:z.component,props:z.props,modal:z.modal,launchMode:z.launchMode||"self-modal",singleton:z.singleton??true,icon:R,color:z.color,minimized:F})}}),n(true)},[g]);xt(()=>{let S=false;return r(async()=>{try{let I=await xn.getItem(Fn);if(S)return;if(I){let F=JSON.parse(I),z;Array.isArray(F)&&F.length>0&&(typeof F[0]=="string"?z=F.map(R=>({id:R,minimized:false})):z=F.filter(R=>typeof R=="object"&&R!==null&&typeof R.id=="string"),z.length&&(s.current=z))}}catch{}S||(c.current=true,C())},"restoreOpenApps")(),()=>{S=true}},[C]),xt(()=>{if(!i)return;let S=t.map(I=>({id:I.id,minimized:I.minimized??false}));xn.setItem(Fn,JSON.stringify(S))},[t,i]);let f=Ie(S=>{a.current=S,p.current=true,C()},[C]),D=Ie(S=>{o(I=>I.length?S?I.filter(F=>F.instanceId!==S):I.slice(0,-1):I)},[]),x=Ie(()=>o([]),[]),M=Ie((S,I)=>{o(F=>F.map(z=>z.instanceId===S?{...z,minimized:true,restoreState:I}:z))},[]),B=Ie((S,I)=>{o(F=>F.map(z=>z.instanceId===S?{...z,minimized:false,restoreState:I??z.restoreState}:z))},[]),E=Ie(S=>t.find(I=>I.instanceId===S)?.minimized??false,[t]),A=t.some(S=>S.launchMode!=="toggle-only"&&!S.minimized);xt(()=>A?Ya(r(S=>{if(S.key!=="Escape"||S.defaultPrevented)return;let I=[...t].reverse().find(F=>F.launchMode!=="toggle-only"&&!F.minimized);I&&D(I.instanceId)},"handler")):void 0,[A,D,t]),Pn(t.length>0,()=>D());let k=es(()=>({openApps:t,isAnyOpen:A,open:g,close:D,closeAll:x,registerApps:f,minimize:M,restore:B,isMinimized:E}),[t,A,g,D,x,f,M,B,E]);return de(Ln.Provider,{value:k,children:e})},"AppHostProvider"),rt=r(()=>{let e=Za(Ln);return e||{openApps:[],isAnyOpen:false,open:r(()=>"","open"),close:r(()=>{},"close"),closeAll:r(()=>{},"closeAll"),registerApps:r(()=>{},"registerApps"),minimize:r(()=>{},"minimize"),restore:r(()=>{},"restore"),isMinimized:r(()=>false,"isMinimized")}},"useAppHost"),ws=9e3,xs={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},Ts={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Cs=r(({app:e,zIndex:t,onClose:o,onMinimize:i,minimizeTargetPosition:n,enableSharedModalDimensions:a})=>{let s=e.component,u=!e.minimized,c={...e.props??{},...a?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(Rn,{app:e,config:e.modal,visible:u,zIndex:t,onClose:o,onMinimize:i,initialModalState:e.restoreState,enableSharedModalDimensions:a,bodyProps:c})}):e.launchMode==="self-modal"?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...c,visible:u,onClose:o,onRequestClose:o,onMinimize:i,minimizeTargetPosition:n,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?u?de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:de(s,{...c,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:de("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...xs,zIndex:t,display:u?"flex":"none"},children:de("div",{style:Ts,children:de(s,{...c,onClose:o,onMinimize:i,minimizeTargetPosition:n,initialModalState:e.restoreState,instanceId:e.instanceId})})})},"AppRenderer"),jn=r(()=>{let{openApps:e,close:t,minimize:o}=rt(),{settings:i}=Sn();xt(()=>{Xa(i.globalSettings?.expandableWindowControls!==false)},[i.globalSettings?.expandableWindowControls]);let n=e.filter(u=>u.launchMode!=="toggle-only");if(n.length===0)return null;let a=n.filter(u=>u.minimized).length,s=Br()??Ss(a);return de(hs,{children:n.map((u,c)=>de(Cs,{app:u,zIndex:ws+c,onClose:()=>t(u.instanceId),onMinimize:p=>o(u.instanceId,p),enableSharedModalDimensions:i.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:s},u.instanceId))})},"AppOverlay");import{useCallback as Is,useEffect as to,useRef as ks,useState as Nn,useSyncExternalStore as Hn}from"react";import{persistentStorage as Wn,getToolAttention as oo,subscribeToolAttention as _n}from"@buoy-gg/shared-ui/web";import{jsx as ue,jsxs as zt}from"react/jsx-runtime";function Un(e){return Hn(_n,()=>oo(e),()=>oo(e))}r(Un,"useToolAttention");var Kn={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},Vn={needsInput:3,failed:2,done:1},qn=new Map;function no(e){let t=null;for(let i of e?e.split("|"):[]){let n=oo(i);n&&(!t||Vn[n.kind]>Vn[t.kind])&&(t=n)}let o=qn.get(e);return o&&t&&o.kind===t.kind&&o.label===t.label?o:!o&&!t?null:(qn.set(e,t),t)}r(no,"strongest");function Gn(e){let t=e.join("|");return Hn(_n,()=>no(t),()=>no(t))}r(Gn,"useStrongestAttention");var Jn=28,io=32,ro=6,Yn=8,Xn=24,Qn="@react_buoy_minimized_stack_expanded",zs=80,Zn=2e3,Bs=6e3,As="#1A1A1A",at="#888888";function ao({down:e=false}){return ue("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:ue("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:at,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}r(ao,"ChevronGlyph");function ei({id:e,title:t,icon:o,index:i,onPress:n}){let a=Un(e),s=ks(null);return to(()=>{let u=true,c,p=r(()=>{s.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:zs,easing:"linear"})},"runGlitch"),g=r(C=>{let f=C?500+Math.random()*1500+i*200:Zn+Math.random()*(Bs-Zn)+i*300;c=setTimeout(()=>{u&&(p(),g(false))},f)},"schedule");return g(true),()=>{u=false,clearTimeout(c)}},[i]),zt("button",{type:"button","aria-label":a?`${t} \u2014 ${a.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:n,style:{width:io,height:io,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[ue("div",{ref:s,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:o}),a?ue("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:Kn[a.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:a.kind==="needsInput"?"!":""}):null]})}r(ei,"GlitchToolButton");function ti({containerWidth:e=32}){let{openApps:t,restore:o}=rt(),i=t.filter(f=>f.minimized&&f.launchMode!=="toggle-only"),[n,a]=Nn(false),[s,u]=Nn(false),c=Gn(i.map(f=>f.id));to(()=>{let f=false;return r(async()=>{let D=await Wn.getItem(Qn);!f&&D==="true"&&a(true),f||u(true)},"load")(),()=>{f=true}},[]),to(()=>{s&&Wn.setItem(Qn,n?"true":"false")},[n,s]);let p=Is(f=>{o(f)},[o]);if(i.length===0)return null;let g=Yn+i.length*io+(i.length-1)*ro+ro+Xn+4,C={backgroundColor:As,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${at}66`,borderLeft:`1px solid ${at}66`,borderRight:`1px solid ${at}66`,borderBottom:"none",boxSizing:"border-box"};return zt("div",{style:{height:Jn,overflow:"visible",position:"relative"},children:[ue("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:n?"visible":"hidden",height:n?g:0,opacity:n?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:n?"auto":"none",...C},children:zt("div",{style:{height:g,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:Yn,gap:ro,boxSizing:"border-box"},children:[n&&[...i].reverse().map((f,D)=>ue(ei,{id:f.id,title:f.title||f.id,icon:f.icon??ue("span",{style:{color:"#fff",fontSize:13},children:(f.title||f.id).slice(0,1).toUpperCase()}),index:D,onPress:()=>p(f.instanceId)},f.instanceId)),ue("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>a(false),style:{width:"100%",height:Xn,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:ue(ao,{down:true})})]})}),zt("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:n?-1:0,"aria-hidden":n,onClick:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:Jn,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:n?0:1,transform:n?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:n?"none":"auto",...C},children:[ue(ao,{}),c?ue("span",{"aria-hidden":true,"data-testid":"buoy-dock-peek-attention",style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:Kn[c.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:c.kind==="needsInput"?"!":""}):null,i.length>1&&ue("span",{style:{fontSize:9,fontWeight:600,color:at,marginLeft:1},children:i.length})]})]})}r(ti,"MinimizedToolsStack");import{registerToolModules as Ds}from"@buoy-gg/shared-ui/web";import{createElement as Ms}from"react";function Ge(e){let t=e.icon;return{...e,icon:typeof t=="function"?o=>Ms(t,{size:o,slot:e.slot??"both",color:e.color}):()=>t}}r(Ge,"createWebTool");import{createContext as Rs,useContext as Es,useState as oi,useMemo as ni}from"react";import{jsx as Os}from"react/jsx-runtime";var ii=Rs(null);function so({children:e}){let[t,o]=oi(false),[i,n]=oi(false),a=ni(()=>t||i,[t,i]),s=ni(()=>({isDialOpen:t,isToolOpen:i,isDevToolsActive:a,setDialOpen:o,setToolOpen:n}),[t,i,a]);return Os(ii.Provider,{value:s,children:e})}r(so,"DevToolsVisibilityProvider");function Bt(){let e=Es(ii);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:r(()=>{},"setDialOpen"),setToolOpen:r(()=>{},"setToolOpen")}}r(Bt,"useDevToolsVisibility");import*as Ps from"@buoy-gg/license/web";import*as Ls from"@buoy-gg/shared-ui/web";import*as Fs from"@buoy-gg/shared-ui/web/dataViewer";function lo(e){Ds({core:{useDevToolsVisibility:Bt},license:Ps,"shared-ui":Ls,"shared-ui/dataViewer":Fs,...e});let t=new Set;return Object.values(e).flatMap(o=>Object.entries(o).flatMap(([i,n])=>!i.endsWith("Preset")||!n||typeof n.id!="string"||!n.component||t.has(n.id)?[]:(t.add(n.id),[Ge(n)])))}r(lo,"createWebTools");import{useEffect as At,useMemo as Dt,useRef as $s}from"react";import{LicenseManager as js,installCapacitorBridge as Ns,resolveDevBuild as ri,useLicense as Hs}from"@buoy-gg/license/web";import{registerToolAdapters as Ws}from"@buoy-gg/shared-ui/web";function co(e){return typeof e=="object"&&e!==null?e:void 0}r(co,"externalSyncOptions");function ai({isDevelopment:e,isLicensed:t,externalSync:o,isAvailable:i}){if(o===false||!i)return false;if(e)return true;let n=co(o);return t&&n?.enableInRelease===true&&uo(n.socketURL,n)===null}r(ai,"shouldMountExternalSync");var si="http://localhost:42831";function li(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}r(li,"isLoopbackHost");function uo(e,t){let o=e??si;if(t?.allowInsecureNetwork===true)return null;let i;try{i=new URL(o)}catch{return`[Buoy] externalSync.socketURL "${o}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return i.protocol==="https:"||i.protocol==="wss:"||li(i.hostname)?null:`[Buoy] This release build won't connect to ${o}: release sync carries real user data, and plain http to another machine is readable by anyone on the same network. Use a simulator, an emulator or adb reverse (localhost), an https:// broker, or set externalSync.allowInsecureNetwork: true for a network you trust.`}r(uo,"releaseTransportProblem");var _s={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function ci(e,t,o){if(t)return e;let i=null;for(let[n,a]of Object.entries(_s)){if(o?.includes(n))continue;let s=e[n];if(!s?.actions)continue;let u={...s.actions};for(let c of a)c in u&&(u[c]=()=>{throw new Error(`${n}.${c} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${n}"] }}.`)});i??(i={...e}),i[n]={...s,actions:u}}return i??e}r(ci,"applyReleaseActionPolicy");import{useEffect as Us,useMemo as Ks,useState as Vs}from"react";import{devToolsStorageKeys as qs,persistentStorage as Gs}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as Js}from"@buoy-gg/license/web";var Ys=8;function di(){let e="";for(;e.length<Ys;)e+=(Math.random()*16|0).toString(16);return e}r(di,"generateInstallId");function ui(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}r(ui,"slugify");function pi({appName:e,hardwareName:t,platform:o,installId:i,deviceId:n}){let a=ui(e??"buoy")||"buoy",s=e??"Buoy Device",u=t?.trim()||o;return n?{deviceId:n,deviceName:`${s} (${u})`}:{deviceId:`${a}-${o}-${i}`,deviceName:`${s} (${u} \xB7 ${i.slice(-4)})`}}r(pi,"buildDeviceIdentity");function mi(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}r(mi,"sessionStore");function gi(){let e=globalThis;try{return e.localStorage??null}catch{return null}}r(gi,"localStore");async function fi({platform:e=He.OS,store:t,mint:o=di}={}){let i=qs.sync.deviceId(),n=t===void 0?Js()?gi():e==="web"?mi():Gs:t;if(!n)return o();try{let a=await n.getItem(i);if(a&&a.length>0)return a;let s=o();return await n.setItem(i,s),s}catch{return o()}}r(fi,"loadInstallId");var po=null;function hi(){return po||(po=fi()),po}r(hi,"getInstallId");function yi(e,t){let o=e?.deviceId,i=e?.deviceName,n=t.loadId??hi,a=t.platform??He.OS,[s,u]=Vs(null);return Us(()=>{if(o)return;let c=false;return n().then(p=>{c||u(p)}),()=>{c=true}},[o,n]),Ks(()=>{if(!o&&!s)return null;let c=pi({appName:t.appName,hardwareName:t.hardwareName,platform:a,installId:s??"",deviceId:o});return i?{...c,deviceName:i}:c},[o,i,s,t.appName,t.hardwareName,a])}r(yi,"useDeviceIdentity");import{useEffect as Xs,useState as Qs}from"react";import{capacitorPlatform as Zs,capacitorPlugin as Mt,isCapacitorNative as el}from"@buoy-gg/license/web";function bi(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let o=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!o||o==="K"?null:o}r(bi,"hardwareFromUserAgent");function vi(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}r(vi,"isAndroidEmulatorUserAgent");function mo(){return typeof navigator>"u"?"":navigator.userAgent??""}r(mo,"userAgent");function Rt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}r(Rt,"firstPageTitle");var Si="@react_buoy_capacitor_app_name";function wi(e){try{let t=globalThis.localStorage;if(!t)return e;let o=t.getItem(Si);if(o)return o;e&&t.setItem(Si,e)}catch{}return e}r(wi,"persistedAppName");function xi(){let e=Zs();if(!e)return{platform:"web",appName:Rt(),hardwareName:"Browser",ready:true};let t=!!Mt("App");return{platform:e,appName:t?Rt():wi(Rt()),hardwareName:bi(mo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Mt("Device")}}r(xi,"initialHostInfo");function Ti(){let[e,t]=Qs(xi);return Xs(()=>{if(!el())return;let o=false,i=Mt("App"),n=Mt("Device");return Promise.all([i?.getInfo?.().catch(()=>null)??null,n?.getInfo?.().catch(()=>null)??null]).then(([a,s])=>{if(o)return;let u=a?.name?.trim(),c=s?.name?.trim()||s?.model?.trim();t(p=>({...p,appName:u||p.appName,hardwareName:c||p.hardwareName,ready:true}))}),()=>{o=true}},[]),e}r(Ti,"useHostInfo");function go(){if(typeof location>"u")return null;let e=globalThis.WEBVIEW_SERVER_URL;return{protocol:location.protocol,hostname:location.hostname,origin:`${location.protocol}//${location.host}`,userAgent:mo(),serverUrl:typeof e=="string"?e:null}}r(go,"pageInfo");function fo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}r(fo,"schemeHost");function Ci(e,t){if(e==="ios"){let o=fo(t.serverUrl);return o?o===fo(t.origin):t.protocol==="capacitor:"}return Ii.has(t.hostname)}r(Ci,"isBundledPage");var Ii=new Set(["localhost","127.0.0.1","[::1]","::1"]);function ki(e,t,o,i=go()){if(o==="web"||!i)return e;let n;try{n=new URL(e)}catch{return e}let a=Ci(o,i);return!t&&a&&n.hostname===i.hostname&&(n.hostname="localhost"),o==="android"&&Ii.has(n.hostname)&&vi(i.userAgent)&&(n.hostname="10.0.2.2"),n.toString().replace(/\/$/,"")}r(ki,"capacitorBrokerURL");function zi(e,t,o=go()){return t!=="android"||!o||o.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${o.hostname} and blocks plain http/ws by default. For debug builds, set android.allowMixedContent: true and server.cleartext: true in capacitor.config, then run cap sync.`}r(zi,"capacitorTransportProblem");import{getDevServerOrigin as tl,resolveReloadStrategy as ol,scheduleReloadApp as nl}from"@buoy-gg/shared-ui/web";var Bi=Date.now(),Ai=tl(),il={platform:He.OS,isTV:He.isTV===true,isTVOS:He.isTVOS===true},Di={version:3,getSnapshot:r(()=>{let e=ol("auto");return{startedAt:Bi,devServerOrigin:Ai,device:il,reload:{available:e!==null,strategy:e}}},"getSnapshot"),subscribe:r(e=>()=>{},"subscribe"),actions:{ping:r(()=>({ok:true,startedAt:Bi,devServerOrigin:Ai}),"ping"),reloadApp:r(e=>{let t=e??{},{strategy:o,delayMs:i}=nl({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:o,delayMs:i}},"reloadApp")}};import{Fragment as rl,jsx as Fe,jsxs as al}from"react/jsx-runtime";var sl=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],ll=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Mi(e){let t=Dt(()=>Object.fromEntries(Object.entries(e.modules).map(([i,n])=>[i.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),n])),[e.modules]),o=t["react-query"];return o?.useReactQuerySyncAdapter?Fe(Ri,{...e,modules:t,query:o}):Fe(ho,{...e,modules:t})}r(Mi,"BrowserToolRuntime");function Ri(e){let t=e.query.useReactQuerySyncAdapter();return Fe(ho,{...e,queryAdapter:t})}r(Ri,"QueryRuntime");function ho({modules:e,apps:t,requiredEnvVars:o,externalSync:i,headless:n,sentryGetClient:a,queryAdapter:s}){let{isPro:u,tier:c}=Hs(),p=Dt(()=>{let B={app:Di};for(let[E,A]of Object.entries(e))for(let[k,S]of Object.entries(A))k.endsWith("SyncAdapter")&&S&&typeof S=="object"&&(B[E]=S);s&&(B.query=s),e.env?.createEnvSyncAdapter&&(B.env=e.env.createEnvSyncAdapter(o??[]));for(let E of t??[])E.sync&&(B[`custom:${E.id}`]=E.sync);return B},[e,t,o,s]),g=$s(p);g.current=p,At(()=>Ws(()=>g.current),[]),At(()=>{let B=[],E=r(A=>{let k=A?.();typeof k=="function"&&B.push(k)},"start");return E(e.network?.startNetworkCapture),E(e.storage?.startBrowserStorageCapture),E(e.assets?.startBrowserAssetCapture),E(e.three?.startThreeCapture),ri(typeof We<"u"?We:process.env.NODE_ENV!=="production")&&E(e["time-machine"]?.startTimeMachineFloatingToolPersistence),e.storage?.storageSyncAdapter?.subscribe&&E(()=>e.storage.storageSyncAdapter.subscribe(()=>{})),e["focus-inspector"]?.focusInspectorSyncAdapter?.subscribe&&E(()=>e["focus-inspector"].focusInspectorSyncAdapter.subscribe(()=>{})),()=>{for(let A of B.reverse())A()}},[e]);let C=e["external-sync"],f=ri(typeof We<"u"?We:process.env.NODE_ENV!=="production"),D=ai({isDevelopment:f,isLicensed:u,externalSync:i,isAvailable:!!C}),x=co(i);Ns({release:!f&&!!x?.enableInRelease}),!f&&x?.enableInRelease&&yo(uo(x.socketURL,x));let M=e.sentry?.SentryRoot;return al(rl,{children:[Object.entries(e).flatMap(([B,E])=>sl.map(A=>{let k=E[A];return k?Fe(k,{},`${B}:${A}`):null})),M&&Fe(M,{getClient:a}),Object.entries(e).flatMap(([B,E])=>ll.map(A=>{let k=E[A];return k&&(!n||A==="ScenariosOverlay"||A==="ImpersonateOverlay")?Fe(k,{},`${B}:${A}`):null})),D&&Fe(Oi,{module:C,tools:p,options:x,isPro:u,tier:c,dev:f})]})}r(ho,"ToolRuntime");var Ei=null;function yo(e){!e||e===Ei||(Ei=e,console.warn("[Buoy]",e))}r(yo,"warnOnce");function Oi({module:e,tools:t,options:o,isPro:i,tier:n,dev:a}){let s=Ti(),u=yi(o,{appName:s.appName,hardwareName:s.hardwareName,platform:s.platform}),c=Dt(()=>ki(o?.socketURL??(a?e.getDefaultSocketURL():si),!!o?.socketURL,s.platform),[o?.socketURL,a,e,s.platform]),{socket:p}=e.useExternalSyncSocket({deviceName:u?.deviceName??"Buoy Browser",socketURL:c,persistentDeviceId:s.ready?u?.deviceId??null:null,platform:s.platform,extraDeviceInfo:s.extraDeviceInfo,enableLogs:o?.enableLogs});At(()=>{let f=zi(c,s.platform);if(!p||!f)return;let D=r(()=>yo(f),"onError");return p.on("connect_error",D),()=>{p.off("connect_error",D)}},[p,c,s.platform]),At(()=>{if(!p)return;let f=r(()=>{p.connected&&js.hasAccountAccess()&&p.emit("device-license",{isPro:i?"1":"0",tier:n})},"emit");return f(),p.on("connect",f),()=>{p.off("connect",f)}},[p,i,n]);let g=o?.releaseActions?.join(",")??"",C=Dt(()=>ci(t,a,g?g.split(","):void 0),[t,a,g]);return e.useExternalSync({tools:C,socket:p,deviceId:s.ready?u?.deviceId??null:null,enableLogs:o?.enableLogs}),null}r(Oi,"BrowserExternalSync");import{useState as Pi}from"react";import{BuoyPortal as cl}from"@buoy-gg/shared-ui/web/floating";import{useBuoySession as dl}from"@buoy-gg/license/web";import{Fragment as Li,jsx as Je,jsxs as Fi}from"react/jsx-runtime";var $i="#20C997";function ji(){let{status:e,signIn:t,signOut:o}=dl(),[i,n]=Pi(false),[a,s]=Pi(null);if(typeof document>"u")return null;let u=r(()=>{s(null),n(true),t().catch(p=>s(p instanceof Error?p.message:"Sign-in did not work. Try again.")).finally(()=>n(false))},"start"),c=e.state==="active";return Je(cl,{children:Je("div",{"data-buoy-signin":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,maxWidth:"min(320px, calc(100vw - 32px))",padding:c||a?"12px 14px":0,borderRadius:16,background:c||a?"#0f1419":"transparent",color:"#e6edf3",boxShadow:c||a?"0 10px 30px rgba(0,0,0,.35)":"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:14,lineHeight:1.45},children:c?Fi(Li,{children:[Je("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),Je("button",{type:"button",onClick:()=>void o(),style:ul,"data-testid":"buoy-signout",children:"Sign out"})]}):Fi(Li,{children:[a?Je("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:a}):null,Je("button",{type:"button",onClick:u,disabled:i,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:$i,color:"#04130d",fontWeight:600,fontSize:14,cursor:i?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:i?"Signing in\u2026":"Sign in to Buoy"})]})})})}r(ji,"BuoySignIn");var ul={marginTop:8,padding:0,border:"none",background:"none",color:$i,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as pl}from"react";import{AccountSetupButton as ml,BuoyNeedsPlanCard as gl,BuoySignInCard as fl,useSignInState as hl}from"@buoy-gg/shared-ui/web";import{jsx as st,jsxs as Ni}from"react/jsx-runtime";function bo({needsPlan:e=false}){let[t,o]=pl(false),i=hl();return Ni(H,{pointerEvents:"box-none",style:Hi.root,children:[st(ml,{expanded:t,onPress:()=>o(true)}),t?st(nr,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>o(false),children:Ni(H,{style:Hi.overlay,accessibilityViewIsModal:true,children:[st(or,{style:dt.absoluteFill,onPress:()=>o(false),accessible:false}),e&&i==="active"?st(gl,{onClose:()=>o(false)}):st(fl,{onClose:()=>o(false)})]})}):null]})}r(bo,"BuoySignIn");var Hi=dt.create({root:{position:"absolute",bottom:30,right:16,zIndex:99999},overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20}});function vo(e){if(e.length>6){let t=e.map(o=>`"${o}"`).join(", ");return e.slice(0,6)}return e}r(vo,"validateDialConfig");import{installedTools as yl,installedToolsFound as bl}from"@buoy-gg/core/web/installed-tools";import{Fragment as So,jsx as L,jsxs as lt}from"react/jsx-runtime";var Wi={},_i="@react_buoy_floating_menu_tooltip_shown",vl=Ee;function Ui({size:e=14,color:t="#20C997"}){let o=Math.max(2,e/4),i=Math.max(1,e/16);return L("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${o}px)`,gap:i,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((n,a)=>L("div",{style:{width:o,height:o,borderRadius:o/2,backgroundColor:t}},a))})}r(Ui,"MenuLauncherIcon");function Ki(e){let{defaultFloatingTools:t,defaultDialTools:o,disableHints:i=false,children:n}=e,a=fe(()=>o&&vo(o),[o]);return L(Vt,{defaultFloatingTools:t,defaultDialTools:a,children:L(yr,{disableHints:i,children:lt(so,{children:[L($n,{children:L(Yi,{...e})}),n]})})})}r(Ki,"AdmittedFloatingDevTools");var Sl=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function Vi({modules:e=Wi}){return L(So,{children:Object.entries(e).flatMap(([t,o])=>Sl.map(i=>{let n=o[i];return n?L(n,{},`${t}:${i}`):null}))})}r(Vi,"StartupCapture");function qi(){let{openApps:e,restore:t}=rt();return te(()=>vr(o=>{let i=e.find(n=>n.id===o);return i?(t(i.instanceId),true):false}),[e,t]),null}r(qi,"WebToolOpenerBridge");function Gi(){let e=mr();return br((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}r(Gi,"defaultEnvironment");function Ji(e,t,o,i){let n=r(g=>Object.entries(e).find(([C])=>C.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===g)?.[1],"find"),a=[],s=n("env");t?.length&&s?.createEnvTool&&s.createEnvVarConfig&&a.push(Ge(s.createEnvTool({requiredEnvVars:s.createEnvVarConfig(t)})));let u=n("storage");o?.length&&u?.createStorageTool&&a.push(Ge(u.createStorageTool({requiredStorageKeys:o})));let c=n("ask-buoy"),p=i==="hosted"?c?.hostedAskBuoy?.():i;return p&&c?.createAskBuoyTool&&a.push(Ge(c.createAskBuoyTool(p))),a}r(Ji,"configOverrides");function Yi({environment:e,userRole:t="admin",availableEnvironments:o,onEnvironmentSwitch:i,apps:n,modules:a=Wi,externalSync:s,requiredEnvVars:u,sentryGetClient:c,disableHints:p=false,headless:g=false,hidden:C=false,defaultFloatingTools:f,defaultDialTools:D,zustandStores:x,requiredStorageKeys:M,askBuoy:B}){let E=e??Gi(),A=fe(()=>D?vo(D):void 0,[D]),[k,S]=Et(false),[I,F]=Et(false),z=wr(false),R=rt(),ee=fe(()=>Ji(a,u,M,B),[a,u,M,B]),_=fe(()=>Ot([...lo(a),...n??[],...ee]),[n,a,ee]),G=fe(()=>Object.entries(a).find(([d])=>d.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[a]);te(()=>{if(!x||typeof G?.watchStores!="function")return;let d=G.watchStores(x);return typeof d=="function"?d:void 0},[x,G]);let oe=Bt(),V=R.openApps.some(d=>!d.minimized);te(()=>{oe.setDialOpen(k)},[k,oe.setDialOpen]),te(()=>{oe.setToolOpen(V||I)},[V,I,oe.setToolOpen]);let{registerApps:ae}=R;te(()=>{ae(_.map(d=>{let W=d.icon;return{...d,icon:typeof W=="function"?({size:v})=>W(v):W}}))},[ae,_]);let ne=fe(()=>_.map(d=>({id:d.id,name:d.name,description:d.description,slot:d.slot})),[_]);xr({availableTools:ne,storage:vl}),te(()=>{let d=false;return r(async()=>{let[W,v]=await Promise.all([Ee.getItem(pt.dial.isOpen()),Ee.getItem(pt.settings.modalOpen())]);d||(W==="true"&&S(true),v==="true"&&(S(true),F(true)),z.current=true)},"restore")(),()=>{d=true}},[]),te(()=>{z.current&&Ee.setItem(pt.dial.isOpen(),k?"true":"false")},[k]),te(()=>{z.current&&Ee.setItem(pt.settings.modalOpen(),I?"true":"false")},[I]);let Se=_e(d=>{if(nn(d.id),d.launchMode==="toggle-only"){d.onPress?.();return}if(d.component){let W=typeof d.icon=="function"?d.icon(20):d.icon;R.open({id:d.id,title:d.name||ut(d.id),component:d.component,props:d.props,modal:d.modal,launchMode:d.launchMode||"self-modal",singleton:d.singleton??true,icon:W,color:d.color||Co(d.id)})}else d.onPress?.()},[R]),se=fe(()=>mt(_,"dial").map(d=>{let W=d.color||Co(d.id),v;return typeof d.icon=="string"?v=d.icon:typeof d.icon=="function"?v=d.icon(32):v=null,{id:d.id,name:d.name||ut(d.id),icon:v,unavailable:!d.component&&!d.onPress,color:W,onPress:r(()=>{Se(d),S(false)},"onPress")}}),[_,Se]),ke=fe(()=>{if(!k)return se;let d=new Map(se.map(W=>[W.id,W]));return on(se.map(W=>W.id)).map(W=>d.get(W)).filter(W=>!!W)},[k,se]),{settings:j}=Sn(),Ye=fe(()=>mt(_,"row").filter(d=>(j.floatingTools[d.id]??false)===true&&(d.component||d.onPress)),[_,j.floatingTools]),ze=fe(()=>_.map(d=>({id:d.id,name:d.name||ut(d.id),description:d.description||Tr(d.id),slot:d.slot,icon:d.icon,color:d.color})),[_]),[$e,Be]=Et(false),le=R.openApps.some(d=>!d.minimized);te(()=>{if(p)return;let d=false,W=setTimeout(async()=>{let v=await Ee.getItem(_i);!d&&!v&&Be(true)},1e3);return()=>{d=true,clearTimeout(W)}},[p]);let Y=_e(()=>{Be(false),Ee.setItem(_i,"true")},[]),we=_e(()=>{Y(),S(true)},[Y]),me=_e(()=>{S(false),F(false)},[]),Ae=_e(()=>{F(d=>!d)},[]),je=_e(()=>F(false),[]),ye=!!(o?.length&&i),De=j.floatingTools.environment!==false,pe=$e&&!k&&!le&&!C;te(()=>{if(!pe)return;let d=r(v=>{(!(v.target instanceof Element)||!v.target.closest("[data-buoy-root]"))&&Y()},"onPointerDown"),W=r(v=>{v.key==="Escape"&&Y()},"onKeyDown");return document.addEventListener("pointerdown",d,true),document.addEventListener("keydown",W),()=>{document.removeEventListener("pointerdown",d,true),document.removeEventListener("keydown",W)}},[pe,Y]);let be=R.openApps.some(d=>d.minimized&&d.launchMode!=="toggle-only"),Me=L(Mi,{modules:a,apps:n,requiredEnvVars:u,externalSync:s,headless:g,sentryGetClient:c});return g?Me:lt("div",{"data-buoy-root":"",style:{display:"contents"},children:[Me,L(qi,{}),pe&&L("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),L("div",{style:C?{visibility:"hidden"}:{display:"contents"},"aria-hidden":C||void 0,children:lt(zo,{enablePositionPersistence:!pe,pushToSide:k||le,suspendPointerEvents:k,centerOnboarding:pe,minimizedStack:be?L(ti,{}):void 0,hasMinimizedStack:be,children:[E&&De&&!ye&&L(Cr,{environment:E}),ye&&De&&L(Ir,{currentEnvironment:E??"local",availableEnvironments:o,onSelect:i}),t?L(Bo,{userRole:t,onPress:we}):L("button",{"aria-label":"Open dev tools",onClick:we,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:L(Ui,{})}),Ye.map(d=>L("button",{"aria-label":d.name||ut(d.id),title:d.description,onClick:()=>Se(d),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px 6px",borderRadius:6,background:"none",border:"none",cursor:"pointer"},children:typeof d.icon=="function"?d.icon(16):d.icon},d.id))]})}),pe&&L(Lt,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:Y}),k&&!C&&L(Nt,{icons:ke,onClose:me,centerLabel:"BUOY",onCenterPress:Ae,settingsOpen:I,hintsDisabled:p}),I&&!C&&L(Xt,{visible:true,onClose:je,availableTools:ze,defaultFloatingTools:f,defaultDialTools:A,onSettingsChange:d=>{}}),!C&&lt(So,{children:[L(jn,{}),L(sr,{})]})]})}r(Yi,"FloatingDevToolsInner");function Xi(e){let t=e&&typeof e=="object"?e.appId:void 0,o=!!e;te(()=>{if(!o)return;let i=false,n=lr.SessionManager;if(!n)return;let a=r(s=>{i||!s||(n.configure({audience:`app:${s}`}),n.load().catch(()=>{}))},"apply");return t?a(t):fr().then(s=>a(s?.bundleId)).catch(()=>{}),()=>{i=true}},[o,t])}r(Xi,"useCapacitorSignInAudience");var Qi=false;function Zi(e){return e.modules?e:(!bl&&!Qi&&typeof console<"u"&&(Qi=true,console.info("[Buoy] No tools loaded. Add buoy() from '@buoy-gg/core/vite' to your Vite plugins, or pass modules to FloatingDevTools.")),{...e,modules:yl})}r(Zi,"withInstalledTools");function er(e){return L(ar,{children:L(tr,{...Zi(e)})})}r(er,"FloatingDevTools");function tr(e){let{access:t,isPro:o,licenseKey:i}=dr();te(()=>{cr.configure(e.licenseKey)},[e.licenseKey]);let n=e.licenseKey===void 0||ur(e.licenseKey,i),a=pr(typeof We<"u"?We:process.env.NODE_ENV!=="production"),s=n&&t.status==="admitted";te(()=>{s&&Sr()},[s]),te(()=>{a||t.status==="initializing"||(o&&s?ir():rr())},[a,o,s,t.status]);let u=gr();return Xi(u?e.signIn:void 0),!a&&!o?!e.signIn||e.headless?null:u?L(bo,{needsPlan:true}):L(ji,{}):s?L(Ki,{...e}):lt(So,{children:[t.status==="initializing"&&L(Vi,{modules:e.modules}),e.headless?null:e.signIn&&u?L(bo,{}):L(hr,{})]})}r(tr,"FloatingDevToolsContent");export{kr as a,Io as b,Ot as c,mt as d,ko as e,zo as f,zr as g,Bo as h,Nt as i,Xt as j,Zt as k,An as l,En as m,$n as n,rt as o,jn as p,Ge as q,so as r,Bt as s,lo as t,Di as u,er as v};
@@ -0,0 +1 @@
1
+ "use client";import{a as c,b as d,g as de,k as p}from"./chunk-Z6I7ZD34.mjs";import{a as i}from"./chunk-LOPXJLVB.mjs";import{toolTheme as T}from"@buoy-gg/shared-ui/web";import{CopyButton as D,toolTheme as a}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as M,SplitDiffViewer as k}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as t,jsxs as g}from"react/jsx-runtime";var B={success:a.colors.success,active:a.colors.success,connected:a.colors.success,error:a.colors.error,failed:a.colors.error,warning:a.colors.warning,stale:a.colors.warning,pending:a.colors.info,loading:a.colors.info,fetching:a.colors.info,info:a.colors.info,inactive:a.colors.textMuted,idle:a.colors.textMuted};function f(e){return B[e.toLowerCase()]??a.colors.textMuted}i(f,"statusColor");var E={GET:a.colors.info,POST:a.colors.success,PUT:a.colors.warning,PATCH:a.colors.warning,DELETE:a.colors.error};function h(e){return E[e.toUpperCase()]??a.colors.textSecondary}i(h,"methodColor");var V={string:a.colors.success,number:a.colors.info,boolean:a.colors.warning,object:a.colors.accent,array:a.colors.accent,function:a.colors.error,null:a.colors.textMuted,undefined:a.colors.textMuted};function y(e){return V[e.toLowerCase()]??a.colors.textSecondary}i(y,"typeColor");function C({children:e,color:s=a.colors.textSecondary,icon:o,size:r="small",pill:l=false,mono:m=false,style:S}){let v=typeof e=="string"||typeof e=="number";return g(c,{style:[n.base,r==="medium"&&n.medium,l&&n.pill,{backgroundColor:s+"1A",borderColor:s+"40"},S],children:[o,v?t(d,{style:[n.text,r==="medium"&&n.textMedium,m&&n.textMono,{color:s}],numberOfLines:1,children:e}):e]})}i(C,"Badge");var n=p.create({base:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",gap:4,borderWidth:1,borderRadius:a.radius.sm,paddingHorizontal:6,paddingVertical:2},medium:{paddingHorizontal:8,paddingVertical:3},pill:{borderRadius:a.radius.pill,minWidth:20,justifyContent:"center"},text:{fontSize:10,fontWeight:"600",letterSpacing:.3},textMedium:{fontSize:12},textMono:{fontFamily:a.text.mono.fontFamily}});function x({status:e,color:s,size:o=8,style:r}){let l=s??(e?f(e):a.colors.textMuted);return t(c,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:l},r]})}i(x,"StatusDot");function b({label:e,value:s,copyable:o=false,style:r}){let l=typeof s=="string"||typeof s=="number";return g(c,{style:[u.row,r],children:[t(d,{style:u.label,numberOfLines:1,children:e}),t(c,{style:u.value,children:l?t(d,{style:u.valueText,numberOfLines:2,children:String(s)}):s}),o&&s!=null&&t(D,{value:s,size:12})]})}i(b,"InfoRow");var u=p.create({row:{flexDirection:"row",alignItems:"center",gap:a.spacing.sm,paddingVertical:3},label:{...a.text.label,color:a.colors.textMuted,minWidth:72},value:{flex:1,flexDirection:"row",alignItems:"center"},valueText:{...a.text.mono,color:a.colors.text}});function w({oldValue:e,newValue:s,mode:o="tree",showUnchanged:r=true,scrollEnabled:l=false,height:m=220}){return o==="text"?t(k,{oldValue:e,newValue:s,height:m}):t(M,{oldValue:e,newValue:s,showUnchanged:r,scrollEnabled:l})}i(w,"DiffViewer");import{ToolButton as P,CopyButton as L,PowerToggleButton as H}from"@buoy-gg/shared-ui/web";import{CompactRow as R,DevToolsCard as U}from"@buoy-gg/shared-ui/web";import{SectionHeader as z,CollapsibleSection as I,TabSelector as F,EmptyState as A,SearchBar as O,EventStepperFooter as j}from"@buoy-gg/shared-ui/web";import{DataViewer as W}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as q}from"@buoy-gg/shared-ui/web";import{RelativeTime as G}from"@buoy-gg/shared-ui/web";import{formatBytes as K,formatDuration as J,formatNumber as N,truncateMiddle as X,safeStringify as Y}from"@buoy-gg/shared-ui/web";import{usePersistedState as Z,persistentStorage as _,devToolsStorageKeys as $}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Q,copyToClipboard as aa}from"@buoy-gg/shared-ui/web";import{JsModal as ea}from"@buoy-gg/shared-ui/web";import{Activity as sa,AlertTriangle as oa,Bug as ra,Check as ta,CheckCircle as la,ChevronDown as ia,ChevronLeft as na,ChevronRight as ca,ChevronUp as ua,Clock as ma,Copy as da,Database as fa,Eye as pa,EyeOff as ga,FileJson as ha,FileText as ya,Filter as Ca,FlaskConical as xa,Globe as ba,Hash as wa,Info as Sa,Key as va,Layers as Ta,Lock as Da,Pause as Ma,Play as ka,Plus as Ba,Power as Ea,RefreshCw as Va,Search as Pa,Settings as La,Shield as Ha,Trash2 as Ra,User as Ua,Wifi as za,X as Ia,Zap as Fa,AlertCircle as Aa,BarChart3 as Oa,Bookmark as ja,Cloud as Wa,Download as qa,Edit3 as Ga,GitBranch as Ka,HardDrive as Ja,HelpCircle as Na,Home as Xa,Image as Ya,Link as Za,Maximize2 as _a,Minus as $a,Palette as Qa,Pin as ae,Route as ee,Server as se,Smartphone as oe,Square as re,CheckSquare as te,Timer as le,Unlock as ie,Upload as ne,Users as ce,XCircle as ue}from"@buoy-gg/shared-ui/web";export{f as a,h as b,y as c,C as d,x as e,b as f,w as g,T as h,P as i,L as j,H as k,R as l,U as m,z as n,I as o,F as p,A as q,O as r,j as s,W as t,q as u,G as v,K as w,J as x,N as y,X as z,Y as A,Z as B,_ as C,$ as D,Q as E,aa as F,ea as G,sa as H,oa as I,ra as J,ta as K,la as L,ia as M,na as N,ca as O,ua as P,ma as Q,da as R,fa as S,pa as T,ga as U,ha as V,ya as W,Ca as X,xa as Y,ba as Z,wa as _,Sa as $,va as aa,Ta as ba,Da as ca,Ma as da,ka as ea,Ba as fa,Ea as ga,Va as ha,Pa as ia,La as ja,Ha as ka,Ra as la,Ua as ma,za as na,Ia as oa,Fa as pa,Aa as qa,Oa as ra,ja as sa,Wa as ta,qa as ua,Ga as va,Ka as wa,Ja as xa,Na as ya,Xa as za,Ya as Aa,Za as Ba,_a as Ca,$a as Da,Qa as Ea,ae as Fa,ee as Ga,se as Ha,oe as Ia,re as Ja,te as Ka,le as La,ie as Ma,ne as Na,ce as Oa,ue as Pa};
@@ -0,0 +1 @@
1
+ "use client";import{a as d,c as M,d as N}from"./chunk-LOPXJLVB.mjs";var f={};M(f,{AccessibilityInfo:()=>F,ActivityIndicator:()=>Me,Alert:()=>Re,Animated:()=>x,AppRegistry:()=>O,AppState:()=>j,Appearance:()=>D,BackHandler:()=>z,Button:()=>Ne,CheckBox:()=>ae,Clipboard:()=>W,DeviceEventEmitter:()=>he,Dimensions:()=>g,Easing:()=>$,FlatList:()=>ne,I18nManager:()=>U,Image:()=>oe,ImageBackground:()=>se,InteractionManager:()=>_,Keyboard:()=>Y,KeyboardAvoidingView:()=>ie,LayoutAnimation:()=>G,Linking:()=>q,LogBox:()=>ve,Modal:()=>K,NativeEventEmitter:()=>J,NativeModules:()=>H,PanResponder:()=>Q,Picker:()=>re,PixelRatio:()=>X,Platform:()=>E,Pressable:()=>B,ProgressBar:()=>le,RefreshControl:()=>de,SafeAreaView:()=>ce,ScrollView:()=>I,SectionList:()=>ue,Share:()=>Z,StatusBar:()=>pe,StyleSheet:()=>w,Switch:()=>Ke,Text:()=>C,TextInput:()=>Be,Touchable:()=>me,TouchableHighlight:()=>Ie,TouchableNativeFeedback:()=>ye,TouchableOpacity:()=>T,TouchableWithoutFeedback:()=>Pe,UIManager:()=>ee,Vibration:()=>te,View:()=>A,VirtualizedList:()=>be,YellowBox:()=>fe,findNodeHandle:()=>Ve,unstable_createElement:()=>R,useColorScheme:()=>xe,useLocaleContext:()=>ge,useWindowDimensions:()=>Ee});N(f,V);import*as V from"react-native-web";import{unstable_createElement as R,NativeModules as H,AccessibilityInfo as F,Animated as x,Appearance as D,AppRegistry as O,AppState as j,BackHandler as z,Clipboard as W,Dimensions as g,Easing as $,I18nManager as U,Keyboard as Y,InteractionManager as _,LayoutAnimation as G,Linking as q,NativeEventEmitter as J,PanResponder as Q,PixelRatio as X,Platform as E,Share as Z,StyleSheet as w,UIManager as ee,Vibration as te,CheckBox as ae,FlatList as ne,Image as oe,ImageBackground as se,KeyboardAvoidingView as ie,Picker as re,ProgressBar as le,RefreshControl as de,SafeAreaView as ce,SectionList as ue,StatusBar as pe,Touchable as me,TouchableNativeFeedback as ye,VirtualizedList as be,YellowBox as fe,LogBox as ve,DeviceEventEmitter as he,useColorScheme as xe,useLocaleContext as ge,useWindowDimensions as Ee}from"react-native-web";import*as c from"react-native-web";import{createElement as v,forwardRef as k,useCallback as we,useRef as ke}from"react";import{useEffect as Le,useState as Se}from"react";import{createPortal as Ae}from"react-dom";var Ce='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as Te}from"react/jsx-runtime";var y=Symbol.for("@buoy-gg/portal-host"),L=d(n=>{if(!(n instanceof Element))return false;if(n.closest("input, textarea, select"))return true;let e=n.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return e===""||e==="true"||e==="plaintext-only"},"isTextField");function h(){let n=document;if(n[y])return n[y].host;let e=document.createElement("div");e.dataset.buoyPortalHost="",Object.assign(e.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:Ce});let s=d(()=>{let t=document.fullscreenElement,b=t&&t.tagName!=="CANVAS"?t:document.body;e.parentElement!==b&&b.appendChild(e)},"move"),i=new Map,a=d(t=>{(!e.contains(t.target)||!L(t.target))&&i.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})},"down"),o=d(t=>{i.delete(t.code||t.key)},"up"),p=d(()=>i.clear(),"clear"),m=d(()=>{let t=[...i.values()];i.clear();for(let b of t)document.dispatchEvent(new KeyboardEvent("keyup",{...b,bubbles:true}))},"focus"),r=d(t=>{L(t.target)&&t.stopPropagation()},"key"),l=d(t=>t.stopPropagation(),"wheel");return s(),document.addEventListener("fullscreenchange",s),document.addEventListener("keydown",a,true),document.addEventListener("keyup",o,true),window.addEventListener("blur",p),e.addEventListener("focusin",m),e.addEventListener("keydown",r),e.addEventListener("keyup",r),e.addEventListener("keypress",r),e.addEventListener("wheel",l,{passive:true}),n[y]={host:e,users:0,dispose:d(()=>{document.removeEventListener("fullscreenchange",s),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",o,true),window.removeEventListener("blur",p),e.remove(),delete n[y]},"dispose")},e}d(h,"getBuoyPortalHost");function S({children:n}){let[e,s]=Se(null);return Le(()=>{let i=h(),a=document[y];return a.users++,s(i),()=>{--a.users===0&&a.dispose()}},[]),e?Ae(Te("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:n}),e):null}d(S,"BuoyPortal");function u(n){let e=k((i,a)=>{let{accessibilityState:o,accessibilityValue:p,...m}=i;for(let r of["busy","checked","disabled","expanded","selected"])o?.[r]!==void 0&&m[`aria-${r}`]===void 0&&(m[`aria-${r}`]=o[r]);for(let[r,l]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))p?.[r]!==void 0&&m[`aria-${l}`]===void 0&&(m[`aria-${l}`]=p[r]);return v(n,{...m,ref:a})}),s=n.State;return s&&Object.assign(e,{State:s}),e.displayName=n.displayName??n.name??"NativeWebView",e}d(u,"withAccessibility");var A=u(c.View),C=u(c.Text),Be=u(c.TextInput),T=u(c.TouchableOpacity),Ie=u(c.TouchableHighlight),Pe=u(c.TouchableWithoutFeedback),B=u(c.Pressable),I=u(c.ScrollView),P=k((n,e)=>{let s=ke(null),i=we(a=>{if(a){let o=a;for(;o.parentElement&&o.parentElement!==document.body;)o=o.parentElement;o.parentElement===document.body&&(s.current=o,Object.assign(o.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),h().appendChild(o))}else s.current&&(document.body.appendChild(s.current),s.current=null);typeof e=="function"?e(a):e&&(e.current=a)},[e]);return v(S,null,v(c.Modal,{...n,ref:i}))});P.displayName="Modal";var K=u(P),Ke=u(c.Switch),Me=u(c.ActivityIndicator),Ne=u(c.Button),Ve=c.findNodeHandle,Re={alert(n,e,s,i){if(typeof document>"u")return;let a=document.createElement("dialog");a.dataset.buoyRoot="",a.setAttribute("aria-label",n),a.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 o=document.createElement("h2");if(o.textContent=n,o.style.cssText="font-size:18px;margin:0 0 12px",a.appendChild(o),e){let l=document.createElement("p");l.textContent=e,l.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",a.appendChild(l)}let p=document.createElement("div");p.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let m=s?.length?s:[{text:"OK"}],r=d(()=>{a.close?.(),a.remove()},"close");for(let l of m){let t=document.createElement("button");t.type="button",t.textContent=l.text??"OK",t.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${l.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,t.onclick=()=>{r(),l.onPress?.()},p.appendChild(t)}a.addEventListener("cancel",l=>{l.preventDefault(),i?.cancelable!==false&&(r(),i?.onDismiss?.())}),a.appendChild(p),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};export{A as a,C as b,T as c,B as d,I as e,K as f,f as g,x as h,g as i,E as j,w as k};
package/lib/web/index.mjs CHANGED
@@ -1 +1 @@
1
- "use client";import{$ as a,A as s,Aa as o,B as e,Ba as t,C as r,Ca as l,D as i,Da as n,E as p,Ea as g,F as u,Fa as c,G as C,Ga as d,H as S,Ha as m,I as T,Ia as y,J as f,Ja as h,K as v,Ka as D,L as b,La as B,M as k,Ma as P,N as H,Na as w,O as F,Oa as A,P as L,Pa as M,Q as E,R,S as I,T as U,U as W,V as O,W as V,X as q,Y as x,Z as G,_ as J,a as K,aa as j,b as z,ba as N,c as X,ca as Z,d as Q,da as Y,e as _,ea as $,f as aa,fa as sa,g as oa,ga as ea,h as ta,ha as ra,i as la,ia,j as na,ja as pa,k as ga,ka as ua,l as ca,la as Ca,m as da,ma as Sa,n as ma,na as Ta,o as ya,oa as fa,p as ha,pa as va,q as Da,qa as ba,r as Ba,ra as ka,s as Pa,sa as Ha,t as wa,ta as Fa,u as Aa,ua as La,v as Ma,va as Ea,w as Ra,wa as Ia,x as Ua,xa as Wa,y as Oa,ya as Va,z as qa,za as xa}from"./chunks/chunk-ZD6O2YPD.mjs";import{a as Ga,b as Ja,c as Ka,d as ja,e as za,f as Na,g as Xa,h as Za,i as Qa,j as Ya,k as _a,l as $a,m as as,n as ss,o as os,p as es,q as ts,r as rs,s as ls,t as is,u as ns,v as ps}from"./chunks/chunk-3YORPV22.mjs";import"./chunks/chunk-7G3P7Z7K.mjs";import{c as gs}from"./chunks/chunk-5SGL6QL4.mjs";import"./chunks/chunk-CLXYMJTS.mjs";import{useSettings as us,useFloatingTools as cs,getToolLabel as Cs,getToolDescription as ds,getToolColor as Ss,settingsColors as ms,settingsStyles as Ts,dialColors as ys,dialStyles as fs}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as hs}from"@buoy-gg/license/web";export{S as Activity,ba as AlertCircle,T as AlertTriangle,ss as AppHostProvider,es as AppOverlay,Q as Badge,ka as BarChart3,Aa as BaseEventStore,Ha as Bookmark,f as Bug,la as Button,da as Card,v as Check,b as CheckCircle,D as CheckSquare,k as ChevronDown,H as ChevronLeft,F as ChevronRight,L as ChevronUp,E as Clock,Fa as Cloud,ya as CollapsibleSection,R as Copy,na as CopyButton,wa as DataViewer,I as Database,rs as DevToolsVisibilityProvider,Qa as DialMenu,oa as DiffViewer,Xa as Divider,La as Download,Ea as Edit3,Da as EmptyState,Pa as EventStepperFooter,U as Eye,W as EyeOff,O as FileJson,V as FileText,q as Filter,x as FlaskConical,ps as FloatingDevTools,Na as FloatingTools,Ia as GitBranch,G as Globe,Wa as HardDrive,J as Hash,Va as HelpCircle,xa as Home,o as Image,a as Info,aa as InfoRow,C as JsModal,j as Key,N as Layers,hs as LicenseManager,t as Link,Z as Lock,l as Maximize2,n as Minus,g as Palette,Y as Pause,c as Pin,$ as Play,sa as Plus,ea as Power,ga as PowerToggle,ra as RefreshCw,Ma as RelativeTime,d as Route,ca as Row,ia as Search,Ba as SearchBar,ma as SectionHeader,m as Server,pa as Settings,Ya as SettingsModal,ua as Shield,y as Smartphone,h as Square,_ as StatusDot,ha as TabSelector,B as Timer,Ca as Trash2,P as Unlock,w as Upload,Sa as User,Za as UserStatus,A as Users,Ta as Wifi,fa as X,M as XCircle,va as Zap,ns as appSyncAdapter,Ja as autoDiscoverWebPresets,Ka as autoDiscoverWithCustom,gs as clearReleaseOptIn,u as copyToClipboard,ts as createWebTool,is as createWebTools,Ga as defaultToolPresets,i as devToolsStorageKeys,ys as dialColors,fs as dialStyles,Ra as formatBytes,Ua as formatDuration,Oa as formatNumber,za as getEnabledTools,Ss as getToolColor,ds as getToolDescription,Cs as getToolLabel,ja as getToolsBySlot,as as isBuoyHoldingBackButton,z as methodColor,r as persistentStorage,s as safeStringify,ms as settingsColors,Ts as settingsStyles,K as statusColor,ta as toolTheme,qa as truncateMiddle,X as typeColor,os as useAppHost,ls as useDevToolsVisibility,cs as useFloatingTools,e as usePersistedState,p as useSafeAreaInsets,us as useSettings,$a as useToolHeader,_a as useToolHost};
1
+ "use client";import{a as m,b as d,c,d as p,e as C,f as g,g as y,h as f,i as S,j as T,k as v,l as h,m as b,n as D,o as B,p as P,q as k,r as w,s as E,t as H,u as M,v as i}from"./chunks/chunk-NKUQECQ2.mjs";import{$ as A,A as F,Aa as L,B as R,Ba as q,C as x,Ca as I,D as U,Da as W,E as j,Ea as G,F as J,Fa as K,G as O,Ga as V,H as z,Ha as X,I as N,Ia as Q,J as Z,Ja as Y,K as _,Ka as $,L as aa,La as sa,M as ea,Ma as oa,N as ta,Na as ra,O as la,Oa as ia,P as na,Pa as ua,Q as ma,R as da,S as ca,T as pa,U as Ca,V as ga,W as ya,X as fa,Y as Sa,Z as Ta,_ as va,a as ha,aa as ba,b as Da,ba as Ba,c as Pa,ca as ka,d as wa,da as Ea,e as Ha,ea as Ma,f as Aa,fa as Fa,g as La,ga as Ra,h as qa,ha as xa,i as Ia,ia as Ua,j as Wa,ja,k as Ga,ka as Ja,l as Ka,la as Oa,m as Va,ma as za,n as Xa,na as Na,o as Qa,oa as Za,p as Ya,pa as _a,q as $a,qa as as,r as ss,ra as es,s as os,sa as ts,t as rs,ta as ls,u as is,ua as ns,v as us,va as ms,w as ds,wa as cs,x as ps,xa as Cs,y as gs,ya as ys,z as fs,za as Ss}from"./chunks/chunk-RBPDZUHO.mjs";import"./chunks/chunk-Z6I7ZD34.mjs";import{c as Ts}from"./chunks/chunk-D2FYORGY.mjs";import{a as vs}from"./chunks/chunk-LOPXJLVB.mjs";import{useSettings as hs,useFloatingTools as bs,getToolLabel as Ds,getToolDescription as Bs,getToolColor as Ps,settingsColors as ks,settingsStyles as ws,dialColors as Es,dialStyles as Hs}from"@buoy-gg/floating-tools-react/web";import{LicenseManager as Ms}from"@buoy-gg/license/web";import{createRoot as As}from"react-dom/client";import{createElement as Fs}from"react";import{jsx as Ls}from"react/jsx-runtime";function n({queryClient:s,...e}={}){let o=Object.values(e.modules??{}).find(u=>u.QueryClientProvider)?.QueryClientProvider;if(s&&!o)throw new Error("Add the react-query tool to modules to use queryClient.");let a=document.createElement("div");a.dataset.buoyMount="",document.body.appendChild(a);let t=As(a),r=Ls(i,{...e});t.render(s?Fs(o,{client:s},r):r);let l=true;return()=>{l&&(l=false,t.unmount(),a.remove())}}vs(n,"mountBuoy");export{z as Activity,as as AlertCircle,N as AlertTriangle,D as AppHostProvider,P as AppOverlay,wa as Badge,es as BarChart3,is as BaseEventStore,ts as Bookmark,Z as Bug,Ia as Button,Va as Card,_ as Check,aa as CheckCircle,$ as CheckSquare,ea as ChevronDown,ta as ChevronLeft,la as ChevronRight,na as ChevronUp,ma as Clock,ls as Cloud,Qa as CollapsibleSection,da as Copy,Wa as CopyButton,rs as DataViewer,ca as Database,w as DevToolsVisibilityProvider,S as DialMenu,La as DiffViewer,y as Divider,ns as Download,ms as Edit3,$a as EmptyState,os as EventStepperFooter,pa as Eye,Ca as EyeOff,ga as FileJson,ya as FileText,fa as Filter,Sa as FlaskConical,i as FloatingDevTools,g as FloatingTools,cs as GitBranch,Ta as Globe,Cs as HardDrive,va as Hash,ys as HelpCircle,Ss as Home,L as Image,A as Info,Aa as InfoRow,O as JsModal,ba as Key,Ba as Layers,Ms as LicenseManager,q as Link,ka as Lock,I as Maximize2,W as Minus,G as Palette,Ea as Pause,K as Pin,Ma as Play,Fa as Plus,Ra as Power,Ga as PowerToggle,xa as RefreshCw,us as RelativeTime,V as Route,Ka as Row,Ua as Search,ss as SearchBar,Xa as SectionHeader,X as Server,ja as Settings,T as SettingsModal,Ja as Shield,Q as Smartphone,Y as Square,Ha as StatusDot,Ya as TabSelector,sa as Timer,Oa as Trash2,oa as Unlock,ra as Upload,za as User,f as UserStatus,ia as Users,Na as Wifi,Za as X,ua as XCircle,_a as Zap,M as appSyncAdapter,d as autoDiscoverWebPresets,c as autoDiscoverWithCustom,Ts as clearReleaseOptIn,J as copyToClipboard,k as createWebTool,H as createWebTools,m as defaultToolPresets,U as devToolsStorageKeys,Es as dialColors,Hs as dialStyles,ds as formatBytes,ps as formatDuration,gs as formatNumber,C as getEnabledTools,Ps as getToolColor,Bs as getToolDescription,Ds as getToolLabel,p as getToolsBySlot,b as isBuoyHoldingBackButton,Da as methodColor,n as mountBuoy,x as persistentStorage,F as safeStringify,ks as settingsColors,ws as settingsStyles,ha as statusColor,qa as toolTheme,fs as truncateMiddle,Pa as typeColor,B as useAppHost,E as useDevToolsVisibility,bs as useFloatingTools,R as usePersistedState,j as useSafeAreaInsets,hs as useSettings,h as useToolHeader,v as useToolHost};
@@ -1 +1 @@
1
- "use client";import"./chunks/chunk-CLXYMJTS.mjs";var l={},o=false;export{l as installedTools,o as installedToolsFound};
1
+ "use client";import"./chunks/chunk-LOPXJLVB.mjs";var l={},o=false;export{l as installedTools,o as installedToolsFound};
@@ -0,0 +1 @@
1
+ "use client";import{a as e}from"./chunks/chunk-LOPXJLVB.mjs";function r(o={}){return false}e(r,"registerBrowserNetwork");export{r as registerBrowserNetwork};
@@ -0,0 +1 @@
1
+ "use client";import{a as n}from"./chunks/chunk-5EUMNDI5.mjs";import{a as s}from"./chunks/chunk-D2FYORGY.mjs";import{a as p,e as i}from"./chunks/chunk-LOPXJLVB.mjs";import{installCapacitorBridge as f}from"@buoy-gg/license/web/capacitor";function r(a={}){if(typeof window>"u"||typeof document>"u")return false;let e=window.Capacitor,t=(()=>{try{return e?.isNativePlatform?.()===true}catch{return false}})(),o=t?e?.DEBUG===true:typeof i<"u"?i:process.env.NODE_ENV!=="production";return!o&&!a.enableInRelease&&!s()?false:(n(),t&&f({release:!o}),true)}p(r,"registerBrowserNetwork");r();export{r as registerBrowserNetwork};
@@ -1 +1 @@
1
- "use client";import{a as r}from"./chunks/chunk-FROELTJH.mjs";import"./chunks/chunk-CLXYMJTS.mjs";function o(e={}){return false}export{r as earlyHookScript,o as registerBrowserDevTools};
1
+ "use client";import{a as t}from"./chunks/chunk-FROELTJH.mjs";import{a as r}from"./chunks/chunk-LOPXJLVB.mjs";function e(s={}){return false}r(e,"registerBrowserDevTools");function o(s){return()=>{}}r(o,"subscribeThreeBootEvents");export{t as earlyHookScript,e as registerBrowserDevTools,o as subscribeThreeBootEvents};
@@ -1 +1 @@
1
- "use client";import{a as L}from"./chunks/chunk-FROELTJH.mjs";import{a as b}from"./chunks/chunk-5SGL6QL4.mjs";import{d as w}from"./chunks/chunk-CLXYMJTS.mjs";import*as y from"react-devtools-core";function R(){if(typeof window>"u")return;let h=window;if(h.__BUOY_EARLY_NETWORK__)return;let l=Date.now,u=true,c=[],d=o=>{if(c.push(o),c.length>100){let n=c.shift();n?.kind==="fetch"&&n.settled.then(_=>_.clone?.body?.cancel()).catch(()=>{})}},s=typeof window.fetch=="function"?window.fetch:void 0;if(s&&(window.fetch=function(o,n){if(!u)return s.call(window,o,n);let _;try{o instanceof Request&&o.body&&!o.bodyUsed&&n?.body===void 0&&(_=o.clone())}catch{}let f=l(),a=s.call(window,o,n),t=a.then(e=>{let r=l(),i=/event-stream|ndjson/.test(e.headers.get("content-type")??""),p;try{i||(p=e.clone())}catch{}return{response:e,clone:p,headersAt:r}},e=>({error:e,headersAt:l()}));return d({kind:"fetch",input:o,init:n,requestCopy:_,start:f,settled:t}),a}),typeof XMLHttpRequest<"u"){let o=XMLHttpRequest.prototype,{open:n,send:_,setRequestHeader:f}=o,a=new WeakMap;o.open=function(t,e,...r){return u&&a.set(this,{method:t,url:String(e),headers:{}}),n.call(this,t,e,...r)},o.setRequestHeader=function(t,e){let r=a.get(this);return r&&(r.headers[t]=e),f.call(this,t,e)},o.send=function(t){let e=a.get(this);if(u&&e){a.delete(this);let r=l(),i=this;i.addEventListener("readystatechange",()=>{i.readyState===2&&i._buoyTtfb===void 0&&(i._buoyTtfb=l()-r),i.readyState===4&&(i._buoyEarlyEnd=l())}),d({kind:"xhr",xhr:i,method:e.method,url:e.url,headers:e.headers,body:t,start:r})}return _.call(this,t)}}h.__BUOY_EARLY_NETWORK__={version:1,records:c,adopt(){return u=false,c.splice(0)}}}import{installCapacitorBridge as A}from"@buoy-gg/license/web/capacitor";var E=["onScheduleFiberRoot","onCommitFiberRoot","onPostCommitFiberRoot","onCommitFiberUnmount","setStrictMode"];function m(h={}){if(typeof window>"u"||typeof document>"u")return false;let l=window.Capacitor,u=(()=>{try{return l?.isNativePlatform?.()===true}catch{return false}})(),c=u?l?.DEBUG===true:typeof w<"u"?w:process.env.NODE_ENV!=="production";if(!c&&!h.enableInRelease&&!b())return false;R(),u&&A({release:!c});let d=window,s=d.__REACT_DEVTOOLS_GLOBAL_HOOK__,o=s&&s.supportsFiber&&!s.getFiberRoots&&!s.sub&&Object.getOwnPropertyDescriptor(d,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?.configurable;if(o&&delete d.__REACT_DEVTOOLS_GLOBAL_HOOK__,!d.__REACT_DEVTOOLS_GLOBAL_HOOK__&&((y.initialize??y.default?.initialize)({appendComponentStack:false,breakOnConsoleErrors:false,showInlineWarningsAndErrors:false,hideConsoleLogsInStrictMode:false}),o)){let n=d.__REACT_DEVTOOLS_GLOBAL_HOOK__,_=n.inject,f=new Map;n.inject=t=>{let e=_(t);return f.set(e,s.inject(t)),e};for(let t of E){let e=n[t];typeof e=="function"&&(n[t]=(r,...i)=>(f.has(r)&&s[t]?.(f.get(r),...i),e(r,...i)))}let a=new Map;if(s.renderers?.forEach?.((t,e)=>a.set(e,_(t))),a.size)for(let t of E){let e=s[t];s[t]=function(r,...i){let p=e?.call(this,r,...i),O=a.get(r);return O!==void 0&&n[t]?.(O,...i),p}}}return!!d.__REACT_DEVTOOLS_GLOBAL_HOOK__}m();export{L as earlyHookScript,m as registerBrowserDevTools};
1
+ "use client";import{a as C,b as A}from"./chunks/chunk-NEDMFPZ4.mjs";import{a as w}from"./chunks/chunk-FROELTJH.mjs";import{a as B}from"./chunks/chunk-5EUMNDI5.mjs";import{a as D}from"./chunks/chunk-D2FYORGY.mjs";import{a as R,e as E}from"./chunks/chunk-LOPXJLVB.mjs";import*as L from"react-devtools-core";import{installCapacitorBridge as S}from"@buoy-gg/license/web/capacitor";var d=["onScheduleFiberRoot","onCommitFiberRoot","onPostCommitFiberRoot","onCommitFiberUnmount","setStrictMode"];function O(T={}){if(typeof window>"u"||typeof document>"u")return false;let l=window.Capacitor,f=(()=>{try{return l?.isNativePlatform?.()===true}catch{return false}})(),p=f?l?.DEBUG===true:typeof E<"u"?E:process.env.NODE_ENV!=="production";if(!p&&!T.enableInRelease&&!D())return false;C(),B(),f&&S({release:!p});let r=window,o=r.__REACT_DEVTOOLS_GLOBAL_HOOK__,c=o&&o.supportsFiber&&!o.getFiberRoots&&!o.sub&&Object.getOwnPropertyDescriptor(r,"__REACT_DEVTOOLS_GLOBAL_HOOK__")?.configurable;if(c&&delete r.__REACT_DEVTOOLS_GLOBAL_HOOK__,!r.__REACT_DEVTOOLS_GLOBAL_HOOK__&&((L.initialize??L.default?.initialize)({appendComponentStack:false,breakOnConsoleErrors:false,showInlineWarningsAndErrors:false,hideConsoleLogsInStrictMode:false}),c)){let n=r.__REACT_DEVTOOLS_GLOBAL_HOOK__,m=n.inject,a=new Map;n.inject=e=>{let t=m(e);return a.set(t,o.inject(e)),t};for(let e of d){let t=n[e];typeof t=="function"&&(n[e]=(i,...s)=>(a.has(i)&&o[e]?.(a.get(i),...s),t(i,...s)))}let _=new Map;if(o.renderers?.forEach?.((e,t)=>_.set(t,m(e))),_.size)for(let e of d){let t=o[e];o[e]=function(i,...s){let b=t?.call(this,i,...s),u=_.get(i);return u!==void 0&&n[e]?.(u,...s),b}}}return!!r.__REACT_DEVTOOLS_GLOBAL_HOOK__}R(O,"registerBrowserDevTools");O();export{w as earlyHookScript,O as registerBrowserDevTools,A as subscribeThreeBootEvents};
@@ -0,0 +1 @@
1
+ "use client";import{a as o,b as e}from"./chunks/chunk-NEDMFPZ4.mjs";import"./chunks/chunk-LOPXJLVB.mjs";export{o as installThreeBootHook,e as subscribeThreeBootEvents};