@buoy-gg/core 7.0.62 → 7.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/version.js +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/version.d.ts +1 -1
- package/package.json +5 -5
- package/lib/web/chunks/FloatingDevTools.web-OQERI2YM.mjs +0 -1
- package/lib/web/chunks/chunk-JGFWBADO.mjs +0 -10
- package/lib/web/chunks/chunk-T6BXEQLL.mjs +0 -1
package/lib/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SDK_VERSION=void 0;const SDK_VERSION=exports.SDK_VERSION="7.0.63";
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const SDK_VERSION="7.0.
|
|
1
|
+
"use strict";export const SDK_VERSION="7.0.63";
|
|
@@ -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.
|
|
12
|
+
export declare const SDK_VERSION = "7.0.63";
|
|
13
13
|
//# sourceMappingURL=version.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.
|
|
12
|
+
export declare const SDK_VERSION = "7.0.63";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.63",
|
|
4
4
|
"description": "Floating developer menu and account setup for React Native. Add tool packages and configure Desktop or MCP connections separately.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
],
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"react-devtools-core": "6.1.5",
|
|
77
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
78
|
-
"@buoy-gg/
|
|
79
|
-
"@buoy-gg/
|
|
80
|
-
"@buoy-gg/
|
|
77
|
+
"@buoy-gg/floating-tools-core": "^7.0.63",
|
|
78
|
+
"@buoy-gg/shared-ui": "^7.0.63",
|
|
79
|
+
"@buoy-gg/floating-tools-react": "^7.0.63",
|
|
80
|
+
"@buoy-gg/license": "^7.0.63"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"react": "*"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{v as o}from"./chunk-JGFWBADO.mjs";import"./chunk-7G3P7Z7K.mjs";import"./chunk-5SGL6QL4.mjs";import"./chunk-CLXYMJTS.mjs";export{o as FloatingDevTools};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";import{a as N,b as H,c as lt,d as Xo,e as Jt,f as Qo,g as bl,h as Ae,i as Yt,j as Ne,k as ct}from"./chunk-7G3P7Z7K.mjs";import{b as Zo,c as er}from"./chunk-5SGL6QL4.mjs";import{a as Xt,d as _e}from"./chunk-CLXYMJTS.mjs";import{FloatingToolHost as tr}from"@buoy-gg/shared-ui/web/floating";import*as nr from"@buoy-gg/license/web";import{LicenseManager as or,useLicense as rr,sameLicenseKey as ir,resolveDevBuild as ar,capacitorDebug as sr,isCapacitorNative as lr,loadCapacitorAppHost as cr}from"@buoy-gg/license/web";import{AccountSetup as dr,HintsProvider as ur,normalizeEnvironment as pr,registerToolOpener as fr,startSettingsSync as mr}from"@buoy-gg/shared-ui/web";import{useState as Mt,useMemo as me,useCallback as We,useEffect as ee,useRef as gr}from"react";import{useSettings as hr,getToolLabel as dt,getToolDescription as yr,getToolColor as Qt}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as Ee,devToolsStorageKeys as ut,EnvironmentIndicator as br,EnvironmentSelectorInline as vr}from"@buoy-gg/shared-ui/web";var Sr=[];function wr(){return[]}function Zt(e=[]){return[...new Map(e.map(t=>[t.id,t])).values()]}function Bt(e,t){return e.filter(n=>{let r=n.slot||"both";return r==="both"||r===t})}function xr(e,t){let n=t instanceof Set?t:new Set(t);return e.filter(r=>n.has(r.id))}import{FloatingTool as en,FloatingToolDivider as Tr,FloatingToolUserStatus as tn,getBubbleAnchorPosition as Cr}from"@buoy-gg/shared-ui/web/floating";import{useState as Q,useEffect as Oe,useMemo as pt,useRef as ft,useCallback as mt}from"react";var nn={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 Ir(e,t){return e&&nn[e]?nn[e]:t}import{getDialLayout as kr,getAllIconPositions as zr,getGridLineRotations as Rr,getIconStaggerInputRange as Mr,MAX_DIAL_SLOTS as Ge,DIAL_ICON_SIZE as Br,dialAnimationConfig as on,getDialCSSKeyframesString as Ar,getDialCSSAnimationStyles as Er,dialColors as L,dialStyles as S,withAlpha as rn,floatingToolsColors as Or}from"@buoy-gg/floating-tools-react/web";import{persistentStorage as an,monoFont as sn,ToolBackground as Dr,useToolBackground as Pr}from"@buoy-gg/shared-ui/web";import{memo as Lr}from"react";import{RasterLayer as Fr,scatter as $r,useLoop as jr,withBgAlpha as Nr}from"@buoy-gg/shared-ui/web";import{Fragment as _r,jsx as Je}from"react/jsx-runtime";var Wr=.94,Hr=6,Ur=2400,gt=3,ln=16,Kr=Array.from({length:gt},(e,t)=>$r(22343^t*40503,ln*4)),cn=["#FFFFFF","#B3D9FF","#8CB3FF"],dn=Math.PI/3,un=14*Math.PI/180;function Vr(e){let t=Math.min(5,Math.floor(e*6)),n=e*6-t;return t*dn+un/2+n*(dn-un)}function qr(e){return Math.min(Hr,1/(1-e*Wr))}function Gr(e){let t=.15+.85*e*e;return e<.06?t*=e/.06:e>.94&&(t*=(1-e)/.06),Math.min(.7,t)}function Jr(e){let t=e/gt,n=[],r=12;for(let s=0;s<=r;s++)n.push(s/r);let o=(1-t)%1;o>.001&&o<1-.001&&n.push(o-1e-4,o+1e-4),n.sort((s,u)=>s-u);let i=[],a=[],l=[];for(let s of n){let u=t===0&&s===1?1:(s+t)%1;i.push(s),a.push(qr(u)),l.push(Gr(u))}return{input:i,scale:a,opacity:l}}var Yr=Array.from({length:gt},(e,t)=>Jr(t)),Xr=Lr(function({size:e}){let t=jr(Ur),n=e/2,r=[];for(let o=0;o<gt;o++){let i=Kr[o],a=Yr[o],l=[];for(let s=0;s<ln;s++){let u=Vr(i[s*4]),f=(.15+.85*Math.sqrt(i[s*4+1]))*.5*n,I=cn[Math.floor(i[s*4+3]*cn.length)%3],m=n+Math.cos(u)*f,M=n+Math.sin(u)*f,w=.6,B=w*2.4;l.push(Je(N,{style:{position:"absolute",left:m-B/2,top:M-B/2,width:B,height:B,borderRadius:B/2,backgroundColor:Nr(I,.3)}},`${s}-h`),Je(N,{style:{position:"absolute",left:m-w/2,top:M-w/2,width:w,height:w,borderRadius:w/2,backgroundColor:I}},s))}r.push(Je(Ae.View,{style:{position:"absolute",left:0,top:0,width:e,height:e,opacity:t.interpolate({inputRange:a.input,outputRange:a.opacity}),transform:[{scale:t.interpolate({inputRange:a.input,outputRange:a.scale})}]},pointerEvents:"none",children:Je(Fr,{style:{width:e,height:e},raster:false,children:l})},o))}return Je(_r,{children:r})});import{useEffect as Qr,useState as pn}from"react";import{dialColors as He,withAlpha as fn}from"@buoy-gg/floating-tools-react/web";import{ARROW_BOTTOM_OFFSET as Zr,ARROW_HEIGHT as ei,SPACING_GAP as Fl,getScreenCenterY as $l,calculateTooltipPosition as ti,calculateTargetPosition as jl}from"@buoy-gg/shared-ui/web/floating";import{monoFont as mn}from"@buoy-gg/shared-ui/web";import{jsx as Ue,jsxs as gn}from"react/jsx-runtime";var hn=false;function ni(){if(hn||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),hn=true}var At=He.accent;function yn({title:e,message:t,onDismiss:n,showArrow:r=true}){let[o,i]=pn(false),[a,l]=pn(false);Qr(()=>{ni();let u=requestAnimationFrame(()=>i(true));return()=>cancelAnimationFrame(u)},[]);let s={fontFamily:mn,textTransform:"uppercase"};return Ue("div",{style:{position:"fixed",left:"50%",bottom:ti(),transform:`translateX(-50%) scale(${o?1:.8})`,opacity:o?1:0,transition:"transform 300ms cubic-bezier(0.34, 1.3, 0.64, 1), opacity 300ms ease",zIndex:10002,pointerEvents:"auto"},children:gn("div",{style:{position:"relative",animation:o?"buoyOnboardPulse 3s ease-in-out infinite":"none"},children:[Ue("div",{style:{position:"absolute",inset:-4,borderRadius:18,backgroundColor:"#FFFFFF",opacity:.06}}),gn("div",{style:{position:"relative",maxWidth:280,backgroundColor:He.dialBackground,borderRadius:16,border:`1px solid ${He.dialBorder}`,padding:20,boxShadow:`0 0 20px ${fn(He.dialShadow,.6)}`,display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[Ue("span",{style:{...s,fontSize:16,fontWeight:900,letterSpacing:1,color:At,textAlign:"center"},children:e}),Ue("span",{style:{fontFamily:mn,fontSize:13,lineHeight:"20px",color:He.centerText,textAlign:"center"},children:t}),Ue("button",{onClick:n,onPointerDown:()=>l(true),onPointerUp:()=>l(false),onPointerLeave:()=>l(false),onPointerCancel:()=>l(false),style:{...s,marginTop:8,borderRadius:8,border:"none",backgroundColor:At,padding:"10px 24px",fontSize:14,fontWeight:900,letterSpacing:1.5,color:"#000000",cursor:"pointer",opacity:a?.7:1,transform:a?"scale(0.96)":"scale(1)",transition:"transform 100ms ease, opacity 100ms ease"},children:"Got it!"})]}),r&&Ue("div",{style:{position:"absolute",left:"50%",bottom:Zr,marginLeft:-12,width:0,height:0,borderLeft:"12px solid transparent",borderRight:"12px solid transparent",borderTop:`${ei}px solid ${At}`,filter:`drop-shadow(0 0 10px ${fn(He.dialShadow,.5)})`,animation:o?"buoyOnboardArrowBounce 1.6s ease-in-out infinite":"none"}})]})})}import{Fragment as oi,jsx as D,jsxs as be}from"react/jsx-runtime";var ri={x:.5,y:.5},bn="@react_buoy_settings_tooltip_shown",vn=false;function ii(){if(vn||typeof document>"u")return;let e=document.createElement("style");e.textContent=Ar(),document.head.appendChild(e),vn=true}var Ke=e=>1-Math.pow(1-e,3),Et=e=>e*e*e;function ai({icon:e,index:t,totalIcons:n,position:r,progress:o,onPress:i}){let[a,l]=Q(false),[s,u]=Q(false),f=!e.icon&&e.id.startsWith("empty-"),I=!f&&e.unavailable===true,m=!f&&!I,{icons:M}=on,w=Mr(t,n),B=0;o<=w[1]?B=0:o<=w[2]?B=(o-w[1])/(w[2]-w[1]):B=1,B=Math.max(0,Math.min(1,B));let z=Br,E=M.pressIn.scale,R=B*(s?E:a?1.1:1),k=0;B<=0?k=0:B<=.3?k=B:k=.3+(B-.3)*(.7/.7);let v=r.x*B,C=r.y*B;return D("button",{role:"menuitem","aria-label":f?"Empty slot":Ir(e.id,e.name),"data-testid":e.id?`buoy-dial-${e.id}`:void 0,"aria-disabled":!m,tabIndex:m?0:-1,onClick:m?i:void 0,onPointerEnter:P=>m&&P.pointerType==="mouse"&&l(true),onPointerLeave:()=>{l(false),u(false)},onPointerDown:()=>m&&u(true),onPointerUp:()=>u(false),onPointerCancel:()=>u(false),style:{position:"absolute",left:"50%",top:"50%",width:z,height:z,marginLeft:-z/2,marginTop:-z/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:m?"pointer":"default",transform:`translate(${v}px, ${C}px) scale(${R})`,opacity:k,transition:a||s?"transform 100ms ease":"none",background:"none",border:"none",padding:0},children:f?D("div",{style:{width:S.emptySlot.dotSize,height:S.emptySlot.dotSize,borderRadius:S.emptySlot.dotSize/2,backgroundColor:L.emptyDotBackground,border:`${S.emptySlot.borderWidth}px solid ${L.emptyDotBorder}`}}):be(oi,{children:[D("div",{style:{position:"absolute",width:`${S.icon.gradientBgSizePercent}%`,height:`${S.icon.gradientBgSizePercent}%`,borderRadius:S.icon.gradientBgBorderRadius,backgroundColor:"rgba(0, 0, 0, 0.2)",opacity:S.icon.gradientBgOpacity}}),D("div",{style:{position:"absolute",width:`${S.icon.innerGlowSizePercent}%`,height:`${S.icon.innerGlowSizePercent}%`,borderRadius:S.icon.innerGlowBorderRadius,backgroundColor:"rgba(255, 255, 255, 0.02)",opacity:S.icon.innerGlowOpacity}}),D("div",{style:{marginBottom:S.icon.wrapperMarginBottom,display:"flex",alignItems:"center",justifyContent:"center",fontSize:32,filter:a?"brightness(1.2)":"none"},children:e.icon}),D("span",{style:{fontSize:e.name.length>8?Math.max(S.icon.label.fontSize*.7,S.icon.label.fontSize*8/e.name.length):S.icon.label.fontSize,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,color:L.iconLabel,letterSpacing:S.icon.label.letterSpacing,marginTop:S.icon.label.marginTop,textTransform:"uppercase",whiteSpace:"nowrap"},children:e.name}),I&&D("span",{style:{fontSize:S.icon.label.fontSize-1,fontWeight:S.icon.label.fontWeight,fontFamily:S.icon.label.fontFamily,letterSpacing:S.icon.label.letterSpacing,color:Or.muted,textTransform:"uppercase",whiteSpace:"nowrap"},children:"Unavailable"})]})})}function Sn({side:e,color:t}){return D("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(([n,r,o,i],a)=>D("line",{x1:n,y1:r,x2:o,y2:i,stroke:t,strokeWidth:2},a))})}function wn({side:e,disabled:t,onClick:n}){let[r,o]=Q(false),i=t?L.emptyDotBorder:L.accent;return be("button",{type:"button","aria-label":`${e==="prev"?"Previous":"Next"} dial page`,"data-testid":`buoy-dial-${e}`,disabled:t,onClick:n,onPointerDown:()=>!t&&o(true),onPointerUp:()=>o(false),onPointerLeave:()=>o(false),onPointerCancel:()=>o(false),style:{display:"flex",alignItems:"center",gap:4,padding:"10px 16px",borderRadius:10,border:`1px solid ${L.dialBorder}`,backgroundColor:L.dialBackground,color:t?L.iconLabelMuted:L.centerText,fontSize:12,fontWeight:900,fontFamily:sn,letterSpacing:1.5,textTransform:"uppercase",cursor:t?"default":"pointer",opacity:t?.4:1,boxShadow:t?"none":`0 0 8px ${rn(L.dialShadow,.4)}`,transform:r?"scale(0.92)":"scale(1)",transition:"transform 100ms ease"},children:[e==="prev"&&D(Sn,{side:"prev",color:i}),e==="prev"?"PREV":"NEXT",e==="next"&&D(Sn,{side:"next",color:i})]})}function xn({icons:e,onClose:t,centerLabel:n="MENU",onCenterPress:r,settingsOpen:o=false,hintsDisabled:i=false}){let{id:a}=Pr(),[l,s]=Q(0),[u,f]=Q(0),[I,m]=Q(0),[M,w]=Q(0),[B,z]=Q(0),[E,R]=Q(1),[k,v]=Q(false),[C,P]=Q(false),[T,A]=Q(false),Z=ft(null),W=ft(null),q=ft(null),te=ft(false),{entrance:K,exit:ie,interaction:ne}=on,ve=Er(),[ae,Ie]=Q(()=>({width:window.innerWidth,height:window.innerHeight}));Oe(()=>{let b=()=>Ie({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);let $=pt(()=>kr({screenWidth:ae.width,maxCircleSize:Math.max(120,Math.min(320,ae.height-96))}),[ae]),qe=pt(()=>Rr(),[]),ke=pt(()=>zr(Ge,$.iconRadius),[$.iconRadius]),[Fe,ze]=Q(0),se=Math.max(1,Math.ceil(e.length/Ge)),J=Math.min(Fe,se-1),Se=pt(()=>{let b=J*Ge,x=[...e.slice(b,b+Ge)];for(;x.length<Ge;)x.push({id:`empty-${x.length}`,name:"",icon:null,onPress:()=>{}});return x},[e,J]);Oe(()=>{ii()},[]),Oe(()=>{let b=K.backdrop.duration,x=K.dial.rotation.duration,Y=K.centerButton.delay,U=K.icons.delay,G=K.icons.duration,V=performance.now(),oe=fe=>{let c=fe-V;s(Math.min(1,c/b));let g=Math.min(1,c/400),O=Ke(g)*1.1;g>.7&&(O-=(g-.7)*.33),g>=1&&(O=1),f(Math.max(0,Math.min(1.05,O)));let X=Math.min(1,c/x);if(m(Ke(X)*360),c>=Y){let xe=Math.min(1,(c-Y)/300),je=Ke(xe)*1.15;xe>.6&&(je-=(xe-.6)*.375),xe>=1&&(je=1),w(Math.max(0,Math.min(1.05,je)))}if(c>=U){let xe=Math.min(1,(c-U)/G);z(Ke(xe))}let we=U+G;c<we?q.current=requestAnimationFrame(oe):(s(1),f(1),m(360),w(1),z(1),A(true))};return q.current=requestAnimationFrame(oe),()=>{q.current&&cancelAnimationFrame(q.current)}},[]);let pe=mt(()=>{if(te.current)return;te.current=true,P(true),q.current&&cancelAnimationFrame(q.current);let b=performance.now(),x=ie.icons.duration,Y=ie.centerButton.duration,U=ie.dialScale.duration,G=Math.max(Y,U),V=ie.backdrop.duration,oe=fe=>{let c=fe-b;if(c<x){let X=Et(c/x);z(1-X),q.current=requestAnimationFrame(oe);return}let g=x;if(c<g+G){z(0);let X=Math.min(1,(c-g)/Y),we=Math.min(1,(c-g)/U);w(1-Et(X)),f(1-Et(we)),q.current=requestAnimationFrame(oe);return}let O=g+G;if(c<O+V){f(0),w(0);let X=(c-O)/V;s(1-X),q.current=requestAnimationFrame(oe);return}s(0),t()};q.current=requestAnimationFrame(oe)},[ie,t]);Oe(()=>{let b=document.activeElement,x=Z.current;return()=>{b?.isConnected&&(document.activeElement===document.body||x?.contains(document.activeElement))&&b.focus()}},[]),Oe(()=>{if(o)return;W.current?.focus();let b=x=>{let Y=Z.current;if(Y){if(x.key==="Escape")x.preventDefault(),pe();else if(x.key==="Tab"){let U=Array.from(Y.querySelectorAll('button:not(:disabled):not([aria-disabled="true"]), [tabindex="0"]')).filter(oe=>oe.getClientRects().length>0),G=U[0],V=U[U.length-1];(!Y.contains(document.activeElement)||(x.shiftKey?document.activeElement===G:document.activeElement===V))&&(x.preventDefault(),(x.shiftKey?V:G)?.focus())}else if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(x.key)){let U=Array.from(Y.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')),G=U.indexOf(document.activeElement);if(G<0||!U.length)return;x.preventDefault();let V=x.key==="Home"?0:x.key==="End"?U.length-1:(G+(x.key==="ArrowRight"||x.key==="ArrowDown"?1:-1)+U.length)%U.length;U[V].focus()}}};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[pe,o]);let[Re,$e]=Q(false);Oe(()=>{if(i)return;let b=false,x=setTimeout(async()=>{let Y=await an.getItem(bn);!b&&!Y&&$e(true)},1200);return()=>{b=true,clearTimeout(x)}},[i]);let he=mt(()=>{$e(false),an.setItem(bn,"true")},[]);Oe(()=>{o&&Re&&he()},[o,Re,he]);let Me=mt(b=>{if(b.id.startsWith("empty-")||te.current)return;let[x,Y]=ne.iconSelect.pulse,U=performance.now(),G=150,V=oe=>{let fe=oe-U;if(fe<G){let c=Ke(fe/G);R(1-(1-x.scale)*c),requestAnimationFrame(V)}else if(fe<G*2){let c=Ke((fe-G)/G);R(x.scale+(Y.scale-x.scale)*c),requestAnimationFrame(V)}else R(1)};requestAnimationFrame(V),setTimeout(()=>{b.onPress(),pe()},ne.iconSelect.actionDelay)},[ne.iconSelect,pe]),ue=mt(b=>{if(te.current)return;let x=Math.max(0,Math.min(b,se-1));x!==J&&ze(x)},[se,J]),ye=$.buttonSize*S.centerButton.containerRatio,Be=$.buttonSize*S.centerButton.borderRatio,d=$.buttonSize*S.centerButton.containerRatio/2+6,_=T&&!C;return be("div",{ref:Z,role:"dialog","aria-label":"Dial Menu","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e4},children:[D("button",{type:"button","aria-label":"Close dial menu",tabIndex:0,onClick:pe,style:{position:"absolute",inset:0,border:0,padding:0,backgroundColor:L.dialBackdrop,opacity:l}}),be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,bottom:80,width:$.circleSize,height:$.circleSize,borderRadius:"50%",backgroundColor:L.dialBackground,border:`${S.circle.borderWidth}px solid ${L.dialBorder}`,boxShadow:`0 0 ${S.circle.shadowRadius}px ${rn(L.dialShadow,S.circle.shadowOpacity)}`,transform:`scale(${u}) rotate(${I}deg)`,opacity:u>.01?1:0,overflow:"hidden"},children:[D("div",{style:{position:"absolute",inset:0,borderRadius:"50%",backgroundColor:L.dialGradient1,opacity:S.gradientLayers[0].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"30%",left:"30%",borderRadius:"50%",backgroundColor:L.dialGradient2,opacity:S.gradientLayers[1].opacity}}),D("div",{style:{position:"absolute",inset:0,top:"50%",left:"50%",borderRadius:"50%",backgroundColor:L.dialGradient3,opacity:S.gradientLayers[2].opacity}}),qe.map(b=>D("div",{style:{position:"absolute",top:"50%",left:0,right:0,height:S.grid.lineHeight,transform:`rotate(${b}deg)`,transformOrigin:"center"},children:["left","right"].map(x=>D("div",{style:{position:"absolute",top:0,[x]:0,width:`calc(50% - ${d}px)`,height:S.grid.lineHeight,backgroundColor:L.dialGridLine}},x))},b)),D("div",{"data-testid":"dial-background","data-background":a,style:{position:"absolute",inset:0,pointerEvents:"none"},children:a==="hyperspace"?D(Xr,{size:$.circleSize}):D(Dr,{focus:ri})}),Se.map((b,x)=>D(ai,{icon:b,index:x,totalIcons:Se.length,position:ke[x],progress:B,onPress:()=>Me(b)},x)),be("div",{style:{position:"absolute",left:"50%",top:"50%",width:ye,height:ye,marginLeft:-ye/2,marginTop:-ye/2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:L.hubHalo,borderRadius:$.buttonSize,overflow:"hidden",transform:`scale(${M*E})`,opacity:M>.01?1:0},children:[D("div",{style:{position:"absolute",inset:0,backgroundColor:L.dialGradient1,opacity:.5,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"20%",left:"20%",backgroundColor:L.dialGradient2,opacity:.3,borderRadius:$.buttonSize}}),D("div",{style:{position:"absolute",inset:0,top:"40%",left:"40%",backgroundColor:L.dialGradient3,opacity:.2,borderRadius:$.buttonSize}}),D("div",{style:{width:Be,height:Be,borderRadius:$.buttonSize*S.centerButton.borderRadiusRatio,backgroundColor:L.hubFill,display:"flex",alignItems:"center",justifyContent:"center"},children:D("button",{ref:W,type:"button","aria-label":o?"Close Settings":"Open Dev Tools Settings",disabled:!r,onClick:r,onPointerEnter:b=>b.pointerType==="mouse"&&v(true),onPointerLeave:()=>v(false),style:{border:0,padding:0,background:"transparent",width:$.buttonSize,height:$.buttonSize,borderRadius:$.buttonSize/2,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:r?"pointer":"default",transform:k?`scale(${ne.centerHover.scale})`:"scale(1)",transition:`transform ${ne.centerHover.duration}ms ease`,animation:_&&!k?ve.pulse:"none"},children:o?be("span",{style:{display:"flex",flexDirection:"column",alignItems:"center",fontSize:S.centerButton.text.fontSize-2,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase",lineHeight:1.2},children:[D("span",{style:{marginBottom:-2},children:"CLOSE"}),D("span",{style:{marginTop:-2},children:"SETTINGS"})]}):D("span",{style:{fontSize:S.centerButton.text.fontSize,fontWeight:S.centerButton.text.fontWeight,fontFamily:S.centerButton.text.fontFamily,color:L.centerText,letterSpacing:S.centerButton.text.letterSpacing,textAlign:"center",textShadow:`0 0 4px ${L.centerTextGlow}`,textTransform:"uppercase"},children:n})})})]})]}),se>1&&be("div",{style:{position:"absolute",left:"50%",marginLeft:-$.circleSize/2,top:"calc(100% - 64px)",width:$.circleSize,display:"flex",alignItems:"center",justifyContent:"space-between",opacity:Math.min(1,u),transform:`scale(${Math.min(1,u)})`},children:[D(wn,{side:"prev",disabled:J<=0,onClick:()=>ue(J-1)}),be("span",{"data-testid":"buoy-dial-page",style:{padding:"6px 12px",fontSize:13,fontWeight:900,fontFamily:sn,letterSpacing:2,color:L.centerText,textShadow:`0 0 6px ${L.centerTextGlow}`},children:[String(J+1).padStart(2,"0"),be("span",{style:{color:L.iconLabelMuted,textShadow:"none"},children:[" / ",String(se).padStart(2,"0")]})]}),D(wn,{side:"next",disabled:J>=se-1,onClick:()=>ue(J+1)})]}),Re&&!o&&D(yn,{title:"Welcome to Buoy!",message:"Tap the center button to configure and add tools to your dial menu.",onDismiss:he,showArrow:false})]})}import{persistentStorage as Tn,devToolsStorageKeys as si}from"@buoy-gg/shared-ui/web";import{recordUsage as li,pruneUsage as ci}from"@buoy-gg/floating-tools-core/web";var Cn=si.dial.usage(),Ve={},In=false,Ot=null;function kn(){return Ot||(Ot=(async()=>{try{let e=await Tn.getItem(Cn);if(e){let t=JSON.parse(e);t&&typeof t=="object"&&(Ve=t)}}catch{}finally{In=true}})(),Ot)}kn();function di(e){return e.map((t,n)=>({id:t,index:n,lastUsed:Ve[t]?.lastUsed??0})).sort((t,n)=>n.lastUsed-t.lastUsed||t.index-n.index).map(({id:t})=>t)}async function ui(e){if(!e)return;In||await kn();let t=Math.max(Date.now(),...Object.values(Ve).map(n=>n.lastUsed+1));Ve=ci(li(Ve,e,t),t);try{await Tn.setItem(Cn,JSON.stringify(Ve))}catch{}}import{useCallback as pi,useMemo as zn}from"react";import{persistentStorage as fi}from"@buoy-gg/shared-ui/web";import{useState as re,useEffect as Te,useCallback as ht,useMemo as yt}from"react";import{settingsEventBus as bt}from"@buoy-gg/floating-tools-core/web";import{useSyncExternalStore as mi}from"react";import{getRegisteredToolModule as gi}from"@buoy-gg/shared-ui/web";var hi=()=>()=>{},yi=()=>null;function bi(){let e=gi("@buoy-gg/external-sync");return mi(e?.subscribeSyncStatus??hi,()=>e?.getSyncStatus?.()??null,yi)}import{SentryIcon as vi,WifiCircuitIcon as Si,ImageOverlayIcon as wi,RenderCountIcon as xi,Info as Dt,Layers as Ti,ChevronRightIcon as Rn,ChevronDown as Mn,getStorageBackendType as Ci,getUseLicense as Ii,signOutOfBuoy as ki,persistentStorage as De,Trash2 as zi,CheckCircle2 as Bn,BuoyUpgradeSheet as Ri,BackgroundSwitcher as Mi,night as h,NightCard as Pe,NightRows as Pt,NightSectionLabel as Bi,NightFootnote as An,NightSwitch as En,NightButton as Lt,NightSegmented as Ai,NightBadge as ge,NightSeparator as Ei,monoFont as On}from"@buoy-gg/shared-ui/web";import{EnvIcon as Dn,StorageIcon as Oi,RoutesIcon as Di,NetworkIcon as Pi,QueryIcon as Li,HighlighterIcon as Fi,ReduxIcon as $i,EventsIcon as ji}from"@buoy-gg/floating-tools-core/web";import Ni,{createContext as _i,useContext as Wi}from"react";import{jsx as Hi}from"react/jsx-runtime";var Pn=_i({});function Ln({children:e,defaultFloatingTools:t,defaultDialTools:n}){let r=Ni.useMemo(()=>({defaultFloatingTools:t,defaultDialTools:n}),[t,n]);return Hi(Pn.Provider,{value:r,children:e})}function Fn(){return Wi(Pn)}import Ui from"react";import{toolTheme as Ki}from"@buoy-gg/shared-ui/web";import{jsx as $n}from"react/jsx-runtime";function Vi({label:e,size:t,color:n=Ki.colors.text}){let r=Math.max(Array.from(e.replace(/[\uFE00-\uFE0F\u200D]/g,"")).length,1),o=r<=2?t:t*1.6,i=Math.max(7,Math.min(t*(r===1?.7:.62),o/(.62*r)));return $n("span",{style:{display:"inline-flex",minWidth:t,maxWidth:o,height:t,alignItems:"center",justifyContent:"center",color:n,fontSize:i,fontWeight:800,letterSpacing:.5,whiteSpace:"nowrap",overflow:"hidden"},children:e})}function jn(e,t){return e==null?e:typeof e=="function"?Ui.createElement(e,{slot:t.slot,size:t.size,state:t.state,actions:t.actions}):typeof e=="string"||typeof e=="number"?$n(Vi,{label:String(e),size:t.size,color:t.color}):e}import{JsModal as qi,devToolsStorageKeys as Ft,onSettingsApplied as Gi,expandableWindowControlsSupported as Ji}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Yi}from"@buoy-gg/shared-ui/web";import{Fragment as Ye,jsx as p,jsxs as j}from"react/jsx-runtime";var Xe="@react_buoy_dev_tools_settings",Xi=6,vt=e=>{let t=Xi,n={};for(let[r,o]of Object.entries(e))o&&t>0?(n[r]=true,t-=1):n[r]=false;return n},Qi=(e,t)=>{let{userStatus:n,environment:r,...o}=e,i=t?Object.entries(o).filter(([a])=>t.includes(a)):Object.entries(o);return{...Object.fromEntries(i),environment:r??false}},Nn=(e,t,n)=>{if(!t)return e;let r={...e.dialTools,...t.dialTools??{}},o=n?.allowedDialKeys?Object.entries(r).filter(([i])=>n.allowedDialKeys?.includes(i)):Object.entries(r);return{dialTools:vt(Object.fromEntries(o)),floatingTools:Qi({...e.floatingTools,...t.floatingTools??{}},n?.allowedFloatingKeys),globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true,...t.globalSettings??{}}}},Zi=(e=[],t,n)=>{let r={},o={},i=new Set(t??[]),a=new Set(n??[]),l=!n||n.length===0;for(let s of e){let{id:u,slot:f="both"}=s;(f==="dial"||f==="both")&&(r[u]=l?true:a.has(u)),(f==="row"||f==="both")&&(o[u]=i.has(u))}return{dialTools:vt(r),floatingTools:{...o,environment:i.has("environment")},globalSettings:{enableSharedModalDimensions:false,expandableWindowControls:true}}},ea=({visible:e,onClose:t,onSettingsChange:n,initialSettings:r,availableApps:o=[],storage:i=De,zIndex:a})=>{let{defaultFloatingTools:l,defaultDialTools:s}=Fn(),u=yt(()=>Zi(o,l,s),[o,l,s]),f=yt(()=>Object.keys(u.dialTools),[u]),I=yt(()=>Object.keys(u.floatingTools).filter(c=>c!=="environment"),[u]),[m,M]=re(r||Qe||u),[w,B]=re($t??"floating"),[z,E]=re($t!==null),[R,k]=re(new Set),[v,C]=re(false),[P,T]=re(false);Te(()=>{let c=requestAnimationFrame(()=>T(true));return()=>cancelAnimationFrame(c)},[]);let A=bi();Te(()=>{(async()=>{try{let c=await De.getItem(Ft.settings.activeTab());if(c&&["floating","settings","pro"].includes(c)){let g=c;$t=g,B(O=>O===g?O:g)}}catch{}finally{E(true)}})()},[]),Te(()=>{z&&De.setItem(Ft.settings.activeTab(),w).catch(c=>{console.warn("Failed to save settings active tab:",c)})},[w,z]);let Z=Ii()?.(),W=Z?.isPro??false,q=!W&&Z?.licenseKey?Z.error:null,te=Z?.errorKind==="transport",[K,ie]=re(_n),[ne,ve]=re(false),[ae,Ie]=re(false),[$,qe]=re(false),[ke,Fe]=re([]),[ze,se]=re(false),J=Yi(),Se=Yt.get("window").height,pe=Yt.get("window").width,Re=Math.floor(Se*.33),$e=Math.min(pe-32,400),he=ht(async()=>{try{let c=await i.getItem(Xe);if(c){let g=JSON.parse(c),O=Nn(u,g,{allowedDialKeys:f,allowedFloatingKeys:I});Qe=O,M(X=>Wn(X,O)?X:O);return}Qe=u,M(g=>Wn(g,u)?g:u)}catch(c){console.error("Failed to load dev tools settings:",c),M(u)}},[u,f,I,i]);Te(()=>{he()},[he]),Te(()=>{Ci().then(c=>{_n=c,ie(g=>g===c?g:c)})},[]),Te(()=>{$&&(se(true),De.getAllKeys().then(c=>{Fe(c.sort())}).catch(()=>{Fe([])}).finally(()=>{se(false)}))},[$]);let Me=async c=>{try{let g={...c,dialTools:vt(c.dialTools)};await i.setItem(Xe,JSON.stringify(g)),Qe=g,M(g),n?.(g),bt.emit(g)}catch(g){console.error("Failed to save dev tools settings:",g)}},ue=c=>{let g={...m,floatingTools:{...m.floatingTools,[c]:!m.floatingTools[c]}};Me(g)},ye=c=>{let g={...m,globalSettings:{...m.globalSettings,[c]:!m.globalSettings?.[c]}};Me(g)},Be=async()=>{ve(true),Ie(false);try{await De.clear(),Ie(true),M(u),i!==De&&await i.setItem(Xe,JSON.stringify(u)),n?.(u),bt.emit(u),setTimeout(()=>Ie(false),2e3)}catch(c){console.error("Failed to clear storage:",c)}finally{ve(false)}},d=ht(c=>{},[]),_=c=>{let g=o.find(O=>O.id===c);return g?.description?g.description:c==="environment"?"Environment badge.":""},b=c=>c==="environment"?"Env Badge":o.find(g=>g.id===c)?.name??c.toUpperCase().replace(/_/g," "),x=c=>{if(!P)return null;switch(c){case"query":return p(Li,{size:18});case"env":return p(Dn,{size:18});case"sentry":return p(vi,{size:18,color:"#9945FF"});case"storage":return p(Oi,{size:18,bgColor:h.color.surface});case"wifi":case"query-wifi-toggle":return p(Si,{size:18,colorPreset:"green",strength:4,noBackground:true});case"route-events":return p(Di,{size:18,bgColor:h.color.surface});case"network":return p(Pi,{size:18});case"environment":return p(Dn,{size:18});case"debug-borders":return p(Ti,{size:18,color:h.color.accent});case"highlight-updates":return p(xi,{size:18,color:h.color.accent});case"highlight-updates-modal":return p(Fi,{size:18});case"redux":return p($i,{size:18});case"image-overlay":return p(wi,{size:18});case"events":return p(ji,{size:18});case"zustand":try{let{ZustandIcon:g}=Xt("@buoy-gg/zustand/web");return p(g,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}case"jotai":try{let{JotaiIcon:g}=Xt("@buoy-gg/jotai/web");return p(g,{size:18})}catch{return p(Dt,{size:18,color:h.color.textSecondary})}default:{let g=o.find(O=>O.id===c);return g?.icon!=null?jn(g.icon,{slot:"row",size:18,color:g.color}):p(Dt,{size:18,color:h.color.textSecondary})}}},Y=(c,g,O,X)=>{let we=_(c);return j(lt,{activeOpacity:O?1:.7,onPress:()=>!O&&X(),accessibilityLabel:b(c),accessibilityRole:"button",style:[y.toolRow,O&&y.rowDisabled],children:[p(N,{style:y.toolIconSlot,children:x(c)}),j(N,{style:y.rowInfo,children:[j(H,{style:y.rowLabel,children:[b(c),O?" \xB7 max 6":""]}),we?p(H,{style:y.rowCaption,numberOfLines:1,children:we}):null]}),p(En,{value:g,disabled:O,onValueChange:()=>X()})]},c)},U=c=>{k(g=>{let O=new Set(g);return O.has(c)?O.delete(c):O.add(c),O})},G=(c,g,O,X,we)=>{let xe=m.globalSettings?.[c]??false,je=R.has(c);return j(N,{children:[j(lt,{activeOpacity:.7,onPress:()=>U(c),accessibilityLabel:g,style:y.settingRow,children:[j(N,{style:y.rowInfo,children:[p(H,{style:y.rowLabel,children:g}),p(H,{style:y.rowCaption,numberOfLines:je?0:1,children:O})]}),p(En,{value:xe,onValueChange:()=>ye(c)})]}),je&&j(N,{style:y.settingRowBody,children:[p(H,{style:y.settingRowBodyText,children:X}),p(H,{style:y.settingRowBodyHint,children:we})]})]},c)},V=(c,g,O)=>j(N,{children:[p(Bi,{children:c}),g,O]}),oe=K==="filesystem"?p(ge,{label:"File System",tone:"accent"}):K==="asyncstorage"?p(ge,{label:"Async Storage",tone:"warning"}):K==="localstorage"?p(ge,{label:"Local Storage",tone:"accent"}):K==="memory"?p(ge,{label:"Memory",tone:"danger"}):p(ge,{label:"Loading\u2026",tone:"neutral"}),fe=()=>j(N,{style:y.container,children:[j(Jt,{style:y.scrollContent,showsVerticalScrollIndicator:false,contentContainerStyle:y.scrollContainer,children:[w==="floating"&&p(Ye,{children:V("Floating Tools",p(Pe,{glass:true,children:p(Pt,{children:Object.entries(m.floatingTools).map(([c,g])=>Y(c,g,false,()=>ue(c)))})}),p(An,{children:"Tools switched on here appear in the floating bubble row."}))}),w==="settings"&&j(Ye,{children:[V("Background",p(Pe,{glass:true,padded:true,children:p(Mi,{embedded:true})})),V("Storage",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>qe(!$),accessibilityLabel:"Storage Type",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Storage Type"})}),oe,$?p(Mn,{size:16,color:h.color.textTertiary}):p(Rn,{size:16,color:h.color.textTertiary})]}),$&&j(Ye,{children:[j(N,{style:y.settingRowBody,children:[p(H,{style:y.settingRowBodyText,children:K==="filesystem"?"Settings persist independently and survive AsyncStorage.clear() calls during logout.":K==="asyncstorage"?"Settings may be lost if AsyncStorage is cleared during logout.":K==="localstorage"?"Settings are saved in this browser. Clearing site data removes them.":K==="memory"?"Settings are stored in memory only and will be lost on app restart.":"Checking storage backend\u2026"}),K==="asyncstorage"&&p(H,{style:[y.settingRowBodyText,y.bodyWarning],children:"Install expo-file-system to persist settings through logout flows."}),K==="memory"&&p(H,{style:[y.settingRowBodyText,y.bodyDanger],children:"No persistent storage available \u2014 install expo-file-system (best) or @react-native-async-storage/async-storage."})]}),p(Ei,{}),j(N,{style:y.storageExpanded,children:[j(N,{style:y.storageExpandedHeader,children:[p(H,{style:y.storageExpandedTitle,children:"SAVED SETTINGS"}),p(H,{style:y.storageExpandedCount,children:ze?"\u2026":`${ke.length} keys`})]}),ze?p(H,{style:y.storageKeyEmpty,children:"Loading\u2026"}):ke.length===0?p(H,{style:y.storageKeyEmpty,children:"No settings saved yet"}):p(Jt,{style:y.storageKeysList,nestedScrollEnabled:true,showsVerticalScrollIndicator:true,children:ke.map(c=>p(N,{style:y.storageKeyItem,children:p(H,{style:y.storageKeyText,numberOfLines:1,children:c.replace("@react_buoy_","")})},c))})]}),p(N,{style:y.cardButtonWrap,children:p(Lt,{label:ae?"Cleared":ne?"Clearing\u2026":"Clear All Settings",variant:ae?"secondary":"destructive",size:"md",disabled:ne,onPress:Be,icon:ae?p(Bn,{size:15,color:h.color.accent}):p(zi,{size:15,color:ne?h.color.textTertiary:h.color.danger})})})]})]})),A&&A.state!=="idle"&&V("Desktop Sync",j(Pe,{glass:true,children:[j(lt,{activeOpacity:.7,onPress:()=>U("desktopSync"),accessibilityLabel:"Buoy Desktop",style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Buoy Desktop"})}),A.state==="connected"?p(ge,{label:"Connected",tone:"accent"}):A.state==="connecting"?p(ge,{label:"Connecting\u2026",tone:"neutral"}):p(ge,{label:"Retrying",tone:"warning"}),R.has("desktopSync")?p(Mn,{size:16,color:h.color.textTertiary}):p(Rn,{size:16,color:h.color.textTertiary})]}),R.has("desktopSync")&&j(N,{style:y.settingRowBody,children:[j(H,{style:y.settingRowBodyText,children:[A.state==="connected"?"Streaming tool data to Buoy Desktop at ":"Trying to reach Buoy Desktop at ",p(H,{style:y.footnoteMono,children:A.targetURL??"(unknown URL)"}),A.state!=="connected"&&" \u2014 is the desktop app running? Override with the externalSync socketURL option if it runs elsewhere."]}),A.state==="retrying"&&A.lastError&&j(H,{style:[y.settingRowBodyText,y.bodyWarning],children:["Last error: ",A.lastError]})]})]})),V("Modal Behavior",p(Pe,{glass:true,children:j(Pt,{children:[G("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."),Ji(Ne.OS==="web")?G("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]})}))]}),w==="pro"&&j(Ye,{children:[V("License",j(Pe,{glass:true,children:[j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"License Status"})}),p(N,{testID:"buoy-settings-license-status",accessibilityLabel:W?"License: Active":"License: Free",children:W?p(ge,{label:"Active",tone:"accent"}):p(ge,{label:"Free",tone:"neutral"})})]}),Z?.tierSource==="session"?j(N,{style:y.settingRow,children:[p(N,{style:y.rowInfo,children:p(H,{style:y.rowLabel,children:"Signed in with Buoy"})}),p(Lt,{label:"Sign out",variant:"secondary",size:"md",onPress:()=>void ki(),testID:"buoy-settings-signout"})]}):null]}),p(An,{children:W?"You have full access to all Buoy DevTools features.":q?te?`Couldn't reach the license server (${q}). A VPN or corporate proxy can block buoy.gg \u2014 turn it off and reload. Your key hasn't been rejected.`:`License check failed: ${q}.`:"Upgrade to Pro to unlock all features and support development."})),!W&&j(Ye,{children:[V("Pro Features",p(Pe,{glass:true,children:p(Pt,{children:["Advanced Settings","Priority Support"].map(c=>j(N,{style:y.featureRow,children:[p(Bn,{size:16,color:h.color.accent}),p(H,{style:y.rowLabel,children:c})]},c))})})),p(Lt,{label:"Upgrade to Pro",variant:"primary",size:"lg",onPress:()=>C(true)})]})]})]}),p(Ri,{visible:v,onClose:()=>C(false)})]});return p(qi,{visible:e,onClose:t,zIndex:a,variant:"night",header:{showToggleButton:false,customContent:p(N,{style:y.headerRow,children:p(Ai,{glass:true,tabs:[{key:"floating",label:"Floating"},{key:"settings",label:"Settings"},{key:"pro",label:"Pro"}],activeKey:w,onChange:c=>B(c)})})},initialMode:"bottomSheet",onModeChange:d,persistenceKey:Ft.settings.root(),enablePersistence:true,maxHeight:Se-J.top,initialHeight:Re,initialFloatingPosition:{x:(pe-$e)/2,y:J.top+20},enableGlitchEffects:true,children:fe()})},ta={dialTools:{},floatingTools:{environment:false},globalSettings:{enableSharedModalDimensions:false}},na=(e,t)=>{let n=new Set(e??[]),r=new Set(t??[]),o={};for(let a of r)o[a]=true;let i={environment:n.has("environment")};for(let a of n)a!=="environment"&&(i[a]=true);return{dialTools:vt(o),floatingTools:i,globalSettings:{enableSharedModalDimensions:false}}},Qe=null,$t=null,_n=null,Wn=(e,t)=>JSON.stringify(e)===JSON.stringify(t);bt.addListener(e=>{e&&(Qe=e)});var Hn=()=>{let{defaultFloatingTools:e,defaultDialTools:t}=Fn(),n=yt(()=>!e&&!t?ta:na(e,t),[e,t]),[r,o]=re(n),i=ht(async()=>{try{let l=await De.getItem(Xe);if(l){let s=JSON.parse(l),u=Nn(n,s);o(u);return}o(n)}catch(l){console.error("Failed to load dev tools settings:",l),o(n)}},[n]);Te(()=>Gi(l=>{l.includes(Xe)&&i()}),[i]),Te(()=>{i();let l=bt.addListener(s=>{try{s&&o(s)}catch{}});return()=>{l()}},[i]);let a=ht(()=>{i()},[i]);return{settings:r,refreshSettings:a}},y=ct.create({container:{flex:1,backgroundColor:"transparent"},headerRow:{flexDirection:"row",alignItems:"center",paddingLeft:h.gutter,paddingRight:h.gutter,paddingBottom:8},scrollContent:{flex:1},scrollContainer:{paddingHorizontal:h.gutter,paddingTop:8,paddingBottom:24,gap:h.groupGap},toolRow:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:h.rowPadH,paddingVertical:12},settingRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:h.rowPadV,minHeight:52},featureRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:h.rowPadH,paddingVertical:12},rowDisabled:{opacity:.4},toolIconSlot:{width:24,alignItems:"center"},rowInfo:{flex:1,gap:2},rowLabel:{color:h.color.text,fontSize:h.font.row,fontWeight:"500"},rowCaption:{color:h.color.textTertiary,fontSize:h.font.label},settingRowBody:{paddingHorizontal:h.rowPadH,paddingBottom:h.rowPadV,gap:6},settingRowBodyText:{color:h.color.textSecondary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},settingRowBodyHint:{color:h.color.textTertiary,fontSize:h.font.caption,lineHeight:h.font.caption*1.45},bodyWarning:{color:h.color.warning},bodyDanger:{color:h.color.danger},cardButtonWrap:{paddingHorizontal:h.cardPad,paddingTop:10,paddingBottom:h.cardPad},storageExpanded:{paddingHorizontal:h.rowPadH,paddingVertical:12,gap:8},storageExpandedHeader:{flexDirection:"row",alignItems:"center"},storageExpandedTitle:{flex:1,color:h.color.textSecondary,fontSize:h.font.micro,fontWeight:"600",letterSpacing:.5},storageExpandedCount:{color:h.color.textTertiary,fontSize:h.font.micro},storageKeysList:{maxHeight:150},storageKeyItem:{backgroundColor:h.color.glassElevated,borderRadius:h.radius.segment,paddingHorizontal:10,paddingVertical:7,marginBottom:4},storageKeyText:{color:h.color.textSecondary,fontSize:h.font.micro,fontFamily:On},storageKeyEmpty:{color:h.color.textTertiary,fontSize:h.font.caption,fontStyle:"italic"},footnoteMono:{fontFamily:On,fontSize:h.font.label,color:h.color.textSecondary}});import{jsx as Un}from"react/jsx-runtime";var oa=[];function Kn({visible:e,onClose:t,availableTools:n=oa,defaultFloatingTools:r,defaultDialTools:o,storage:i=fi,onSettingsChange:a}){let l=zn(()=>({getItem:async f=>i.getItem(f),setItem:async(f,I)=>i.setItem(f,I)}),[i]),s=zn(()=>n.map(f=>({...f,name:f.name??f.id,icon:typeof f.icon=="function"?I=>f.icon(I.size):f.icon})),[n]),u=pi(f=>{a?.(f)},[a]);return Un(Ln,{defaultFloatingTools:r,defaultDialTools:o,children:Un(ea,{visible:e,onClose:t,zIndex:11e3,availableApps:s,storage:l,onSettingsChange:u})})}import{persistentStorage as Vn,setExpandableWindowControls as ra}from"@buoy-gg/shared-ui/web";import{createContext as ia,useCallback as Ce,useContext as aa,useEffect as St,useMemo as sa,useRef as Ze,useState as qn}from"react";var la=(e,t,n)=>{if(t.singleton){let o=e.find(i=>i.id===t.id);if(o){let i=o.minimized??false;return{instanceId:o.instanceId,wasMinimized:i,apps:[...e.filter(a=>a.instanceId!==o.instanceId),{...o,minimized:false}]}}}let r=n();return{instanceId:r,wasMinimized:false,apps:[...e,{...t,instanceId:r}]}};import{createContext as ca,useCallback as Gn,useContext as da,useEffect as wt,useMemo as ua,useRef as Jn,useState as xt}from"react";import{JsModal as pa,ModalHeader as et,HeaderSearchButton as fa,TickProvider as ma,ToolScreenHeaderContext as ga,devToolsStorageKeys as Yn,buoyColors as Xn,gameUIColors as jt}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as Tt}from"react/jsx-runtime";var tt=()=>{},ha={search:"",isSearchActive:false,clearSearch:tt,close:tt,minimize:tt,showToast:tt,setHeaderOverride:tt},Qn=ca(null);function Zn(){return da(Qn)??ha}function ya(e,t){let{setHeaderOverride:n}=Zn();wt(()=>(n(e),()=>n(null)),t)}var eo=2200,ba={success:jt.success,error:jt.error,info:jt.info};function va({message:e,type:t,nonce:n}){let r=Jn(new Ae.Value(0)).current;wt(()=>{r.setValue(0),Ae.sequence([Ae.timing(r,{toValue:1,duration:150,useNativeDriver:true}),Ae.delay(eo-450),Ae.timing(r,{toValue:0,duration:300,useNativeDriver:true})]).start()},[n,r]);let o=ba[t];return Tt(Ae.View,{pointerEvents:"none",style:[Ct.toast,{opacity:r,borderColor:o+"60"}],children:[le(N,{style:[Ct.toastDot,{backgroundColor:o}]}),le(H,{style:Ct.toastText,numberOfLines:2,children:e})]})}function Sa({app:e,config:t,visible:n,zIndex:r,onClose:o,onMinimize:i,initialModalState:a,enableSharedModalDimensions:l,bodyProps:s}){let u=e.component,[f,I]=xt(false),[m,M]=xt(""),[w,B]=xt(null),[z,E]=xt(null),R=Jn(null),k=Gn(()=>{I(false),M("")},[]),v=Gn((K,ie="info")=>{R.current&&clearTimeout(R.current),E(ne=>({message:K,type:ie,nonce:(ne?.nonce??0)+1})),R.current=setTimeout(()=>E(null),eo)},[]);wt(()=>()=>{R.current&&clearTimeout(R.current)},[]);let C=ua(()=>({search:f?m:"",isSearchActive:f,clearSearch:k,close:o,minimize:()=>i(),showToast:v,setHeaderOverride:B,instanceId:e.instanceId}),[m,f,k,o,i,v,e.instanceId]),P=w?.title??t.title??e.title??e.id,T=w?.subtitle??t.subtitle,A=w?.onBack,Z=w?.actions??t.headerActions,W=w?.searchable??t.searchable;wt(()=>{!W&&f&&k()},[W,f,k]);let q=l?Yn.modal.root():Yn.custom(e.id).modal(),te=Tt(et,{children:[A&&!f&&le(et.Navigation,{onBack:A}),f?le(et.Search,{value:m,onChangeText:M,onCancel:k,placeholder:t.searchPlaceholder,testID:`tool-search-field-${e.id}`}):le(et.Content,{title:P,subtitle:T}),Tt(et.Actions,{children:[!f&&Z,W&&!f&&le(fa,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>I(true)})]})]});return le(Qn.Provider,{value:C,children:le(pa,{visible:n,onClose:o,onBack:A,onMinimize:i,initialModalState:a,zIndex:r,persistenceKey:q,enablePersistence:true,initialMode:t.initialMode??"bottomSheet",header:{customContent:te,showToggleButton:true},disableScrollWrapper:true,styles:{},children:Tt(N,{style:Ct.bodyRoot,children:[le(ma,{children:le(ga.Provider,{value:B,children:le(u,{...s})})}),z&&le(va,{message:z.message,type:z.type,nonce:z.nonce})]})})})}var Ct=ct.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:Xn.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:Xn.text}});import{useEffect as wa,useRef as xa}from"react";import{capacitorPlatform as Ta,capacitorPlugin as Ca}from"@buoy-gg/license/web";function Ia(){return globalThis.__BUOY_HOLDS_BACK__===true}var ka=99.5;function za(){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}}function Ra(e,t){let n=xa(t);n.current=t,wa(()=>{if(!e||Ta()!=="android")return;let r=globalThis;r.__BUOY_HOLDS_BACK__=true;let o;if(za()){let i=a=>{a.detail?.register?.(ka,()=>{n.current()})};document.addEventListener("ionBackButton",i),o=()=>document.removeEventListener("ionBackButton",i)}else{let i=Ca("App");if(!i?.addListener){r.__BUOY_HOLDS_BACK__=false;return}let a=false,l=null;Promise.resolve(i.addListener("backButton",()=>n.current())).then(s=>{a?s.remove():l=s}).catch(()=>{}),o=()=>{a=true,l&&l.remove()}}return()=>{o(),r.__BUOY_HOLDS_BACK__=false}},[e])}import{Fragment as Ma,jsx as ce}from"react/jsx-runtime";var to=ia(null),no="@react_buoy_open_apps",Nt=44,Ba=12,Aa=100,Ea=16,Oa=e=>({x:window.innerWidth-Nt-Ea,y:window.innerHeight-Aa-Nt-e*(Nt+Ba)}),oo=({children:e})=>{let[t,n]=qn([]),[r,o]=qn(false),i=Ze([]),a=Ze(null),l=Ze(false),s=Ze(false),u=Ze(false),f=Ce(v=>{let C="";return n(P=>{let{apps:T,instanceId:A}=la(P,v,()=>`${v.id}-${Date.now()}-${Math.random().toString(36).slice(2)}`);return C=A,T}),C},[]),I=Ce(()=>{if(l.current||!s.current||!u.current)return;l.current=true;let v=a.current;if(!v||v.length===0){o(true);return}a.current=null,v.forEach(({id:C,minimized:P})=>{let T=i.current.find(A=>A.id===C);if(T&&T.component){let A=jn(T.icon,{slot:"dial",size:20,color:T.color});f({id:T.id,title:T.name,component:T.component,props:T.props,modal:T.modal,launchMode:T.launchMode||"self-modal",singleton:T.singleton??true,icon:A,color:T.color,minimized:P})}}),o(true)},[f]);St(()=>{let v=false;return(async()=>{try{let C=await Vn.getItem(no);if(v)return;if(C){let P=JSON.parse(C),T;Array.isArray(P)&&P.length>0&&(typeof P[0]=="string"?T=P.map(A=>({id:A,minimized:false})):T=P.filter(A=>typeof A=="object"&&A!==null&&typeof A.id=="string"),T.length&&(a.current=T))}}catch{}v||(s.current=true,I())})(),()=>{v=true}},[I]),St(()=>{if(!r)return;let v=t.map(C=>({id:C.id,minimized:C.minimized??false}));Vn.setItem(no,JSON.stringify(v))},[t,r]);let m=Ce(v=>{i.current=v,u.current=true,I()},[I]),M=Ce(v=>{n(C=>C.length?v?C.filter(P=>P.instanceId!==v):C.slice(0,-1):C)},[]),w=Ce(()=>n([]),[]),B=Ce((v,C)=>{n(P=>P.map(T=>T.instanceId===v?{...T,minimized:true,restoreState:C}:T))},[]),z=Ce((v,C)=>{n(P=>P.map(T=>T.instanceId===v?{...T,minimized:false,restoreState:C??T.restoreState}:T))},[]),E=Ce(v=>t.find(C=>C.instanceId===v)?.minimized??false,[t]),R=t.some(v=>v.launchMode!=="toggle-only"&&!v.minimized);St(()=>{if(!R)return;let v=C=>{if(C.key!=="Escape"||C.defaultPrevented)return;let P=[...t].reverse().find(T=>T.launchMode!=="toggle-only"&&!T.minimized);P&&M(P.instanceId)};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[R,M,t]),Ra(t.length>0,()=>M());let k=sa(()=>({openApps:t,isAnyOpen:R,open:f,close:M,closeAll:w,registerApps:m,minimize:B,restore:z,isMinimized:E}),[t,R,f,M,w,m,B,z,E]);return ce(to.Provider,{value:k,children:e})},nt=()=>{let e=aa(to);return e||{openApps:[],isAnyOpen:false,open:()=>"",close:()=>{},closeAll:()=>{},registerApps:()=>{},minimize:()=>{},restore:()=>{},isMinimized:()=>false}},Da=9e3,Pa={position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.28)",display:"flex",alignItems:"center",justifyContent:"center"},La={maxHeight:"90%",width:"94%",borderRadius:12,backgroundColor:"white",overflow:"hidden"},Fa=({app:e,zIndex:t,onClose:n,onMinimize:r,minimizeTargetPosition:o,enableSharedModalDimensions:i})=>{let a=e.component,l=!e.minimized,s={...e.props??{},...i?{enableSharedModalDimensions:true}:{}};return e.modal&&(!e.launchMode||e.launchMode==="self-modal")?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(Sa,{app:e,config:e.modal,visible:l,zIndex:t,onClose:n,onMinimize:r,initialModalState:e.restoreState,enableSharedModalDimensions:i,bodyProps:s})}):e.launchMode==="self-modal"?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,visible:l,onClose:n,onRequestClose:n,onMinimize:r,minimizeTargetPosition:o,instanceId:e.instanceId,zIndex:t,initialModalState:e.restoreState})}):e.launchMode==="inline"?l?ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{position:"fixed",inset:0,zIndex:t,pointerEvents:"none"},children:ce(a,{...s,onClose:n,onMinimize:r,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})}):null:ce("div",{"data-testid":`buoy-tool-instance-${e.id}`,style:{...Pa,zIndex:t,display:l?"flex":"none"},children:ce("div",{style:La,children:ce(a,{...s,onClose:n,onMinimize:r,minimizeTargetPosition:o,initialModalState:e.restoreState,instanceId:e.instanceId})})})},ro=()=>{let{openApps:e,close:t,minimize:n}=nt(),{settings:r}=Hn();St(()=>{ra(r.globalSettings?.expandableWindowControls!==false)},[r.globalSettings?.expandableWindowControls]);let o=e.filter(l=>l.launchMode!=="toggle-only");if(o.length===0)return null;let i=o.filter(l=>l.minimized).length,a=Cr()??Oa(i);return ce(Ma,{children:o.map((l,s)=>ce(Fa,{app:l,zIndex:Da+s,onClose:()=>t(l.instanceId),onMinimize:u=>n(l.instanceId,u),enableSharedModalDimensions:r.globalSettings?.enableSharedModalDimensions===true,minimizeTargetPosition:a},l.instanceId))})};import{useCallback as $a,useEffect as _t,useRef as ja,useState as io,useSyncExternalStore as ao}from"react";import{persistentStorage as so,getToolAttention as Wt,subscribeToolAttention as lo}from"@buoy-gg/shared-ui/web";import{jsx as de,jsxs as It}from"react/jsx-runtime";function Na(e){return ao(lo,()=>Wt(e),()=>Wt(e))}var co={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"},uo={needsInput:3,failed:2,done:1},po=new Map;function fo(e){let t=null;for(let r of e?e.split("|"):[]){let o=Wt(r);o&&(!t||uo[o.kind]>uo[t.kind])&&(t=o)}let n=po.get(e);return n&&t&&n.kind===t.kind&&n.label===t.label?n:!n&&!t?null:(po.set(e,t),t)}function _a(e){let t=e.join("|");return ao(lo,()=>fo(t),()=>fo(t))}var mo=28,Ht=32,Ut=6,go=8,ho=24,yo="@react_buoy_minimized_stack_expanded",Wa=80,bo=2e3,Ha=6e3,Ua="#1A1A1A",ot="#888888";function vo({down:e=false}){return de("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:de("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:ot,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ka({id:e,title:t,icon:n,index:r,onPress:o}){let i=Na(e),a=ja(null);return _t(()=>{let l=true,s,u=()=>{a.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:Wa,easing:"linear"})},f=I=>{let m=I?500+Math.random()*1500+r*200:bo+Math.random()*(Ha-bo)+r*300;s=setTimeout(()=>{l&&(u(),f(false))},m)};return f(true),()=>{l=false,clearTimeout(s)}},[r]),It("button",{type:"button","aria-label":i?`${t} \u2014 ${i.label}. Restore`:`Restore ${t}`,"data-testid":`buoy-dock-restore-${e}`,onClick:o,style:{width:Ht,height:Ht,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[de("div",{ref:a,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n}),i?de("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${i.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:co[i.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:i.kind==="needsInput"?"!":""}):null]})}function Va({containerWidth:e=32}){let{openApps:t,restore:n}=nt(),r=t.filter(m=>m.minimized&&m.launchMode!=="toggle-only"),[o,i]=io(false),[a,l]=io(false),s=_a(r.map(m=>m.id));_t(()=>{let m=false;return(async()=>{let M=await so.getItem(yo);!m&&M==="true"&&i(true),m||l(true)})(),()=>{m=true}},[]),_t(()=>{a&&so.setItem(yo,o?"true":"false")},[o,a]);let u=$a(m=>{n(m)},[n]);if(r.length===0)return null;let f=go+r.length*Ht+(r.length-1)*Ut+Ut+ho+4,I={backgroundColor:Ua,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${ot}66`,borderLeft:`1px solid ${ot}66`,borderRight:`1px solid ${ot}66`,borderBottom:"none",boxSizing:"border-box"};return It("div",{style:{height:mo,overflow:"visible",position:"relative"},children:[de("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:o?"visible":"hidden",height:o?f:0,opacity:o?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:o?"auto":"none",...I},children:It("div",{style:{height:f,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:go,gap:Ut,boxSizing:"border-box"},children:[o&&[...r].reverse().map((m,M)=>de(Ka,{id:m.id,title:m.title||m.id,icon:m.icon??de("span",{style:{color:"#fff",fontSize:13},children:(m.title||m.id).slice(0,1).toUpperCase()}),index:M,onPress:()=>u(m.instanceId)},m.instanceId)),de("button",{type:"button","aria-label":"Collapse","data-testid":"buoy-dock-collapse",onClick:()=>i(false),style:{width:"100%",height:ho,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:de(vo,{down:true})})]})}),It("button",{type:"button","aria-label":`Show ${r.length} minimized tools`,"data-testid":"buoy-dock-peek",tabIndex:o?-1:0,"aria-hidden":o,onClick:()=>i(true),style:{position:"absolute",bottom:0,left:0,width:e,height:mo,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:o?0:1,transform:o?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:o?"none":"auto",...I},children:[de(vo,{}),s?de("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:co[s.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:s.kind==="needsInput"?"!":""}):null,r.length>1&&de("span",{style:{fontSize:9,fontWeight:600,color:ot,marginLeft:1},children:r.length})]})]})}import{registerToolModules as qa}from"@buoy-gg/shared-ui/web";import{createElement as Ga}from"react";function rt(e){let t=e.icon;return{...e,icon:typeof t=="function"?n=>Ga(t,{size:n,slot:e.slot??"both",color:e.color}):()=>t}}import{createContext as Ja,useContext as Ya,useState as So,useMemo as wo}from"react";import{jsx as Xa}from"react/jsx-runtime";var xo=Ja(null);function To({children:e}){let[t,n]=So(false),[r,o]=So(false),i=wo(()=>t||r,[t,r]),a=wo(()=>({isDialOpen:t,isToolOpen:r,isDevToolsActive:i,setDialOpen:n,setToolOpen:o}),[t,r,i]);return Xa(xo.Provider,{value:a,children:e})}function Kt(){let e=Ya(xo);return e||{isDialOpen:false,isToolOpen:false,isDevToolsActive:false,setDialOpen:()=>{},setToolOpen:()=>{}}}import*as Qa from"@buoy-gg/license/web";import*as Za from"@buoy-gg/shared-ui/web";import*as es from"@buoy-gg/shared-ui/web/dataViewer";function Co(e){qa({core:{useDevToolsVisibility:Kt},license:Qa,"shared-ui":Za,"shared-ui/dataViewer":es,...e});let t=new Set;return Object.values(e).flatMap(n=>Object.entries(n).flatMap(([r,o])=>!r.endsWith("Preset")||!o||typeof o.id!="string"||!o.component||t.has(o.id)?[]:(t.add(o.id),[rt(o)])))}import{useEffect as kt,useMemo as zt,useRef as ts}from"react";import{LicenseManager as ns,installCapacitorBridge as os,resolveDevBuild as Io,useLicense as rs}from"@buoy-gg/license/web";import{registerToolAdapters as is}from"@buoy-gg/shared-ui/web";function ko(e){return typeof e=="object"&&e!==null?e:void 0}function as({isDevelopment:e,isLicensed:t,externalSync:n,isAvailable:r}){if(n===false||!r)return false;if(e)return true;let o=ko(n);return t&&o?.enableInRelease===true&&Ro(o.socketURL,o)===null}var zo="http://localhost:42831";function ss(e){return e==="localhost"||e.endsWith(".localhost")||/^127\.\d+\.\d+\.\d+$/.test(e)||e==="[::1]"||e==="::1"||e==="10.0.2.2"}function Ro(e,t){let n=e??zo;if(t?.allowInsecureNetwork===true)return null;let r;try{r=new URL(n)}catch{return`[Buoy] externalSync.socketURL "${n}" isn't a valid URL, so this release build won't connect to Buoy Desktop.`}return r.protocol==="https:"||r.protocol==="wss:"||ss(r.hostname)?null:`[Buoy] This release build won't connect to ${n}: 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.`}var ls={impersonate:["searchUsers","startImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"]};function cs(e,t,n){if(t)return e;let r=null;for(let[o,i]of Object.entries(ls)){if(n?.includes(o))continue;let a=e[o];if(!a?.actions)continue;let l={...a.actions};for(let s of i)s in l&&(l[s]=()=>{throw new Error(`${o}.${s} is off in release builds. To allow it from Buoy Desktop and the MCP, pass externalSync={{ enableInRelease: true, releaseActions: ["${o}"] }}.`)});r??(r={...e}),r[o]={...a,actions:l}}return r??e}import{useEffect as ds,useMemo as us,useState as ps}from"react";import{devToolsStorageKeys as fs,persistentStorage as ms}from"@buoy-gg/shared-ui/web";import{isCapacitorNative as gs}from"@buoy-gg/license/web";var hs=8;function ys(){let e="";for(;e.length<hs;)e+=(Math.random()*16|0).toString(16);return e}function bs(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function vs({appName:e,hardwareName:t,platform:n,installId:r,deviceId:o}){let i=bs(e??"buoy")||"buoy",a=e??"Buoy Device",l=t?.trim()||n;return o?{deviceId:o,deviceName:`${a} (${l})`}:{deviceId:`${i}-${n}-${r}`,deviceName:`${a} (${l} \xB7 ${r.slice(-4)})`}}function Ss(){let e=globalThis;try{return e.sessionStorage??null}catch{return null}}function ws(){let e=globalThis;try{return e.localStorage??null}catch{return null}}async function xs({platform:e=Ne.OS,store:t,mint:n=ys}={}){let r=fs.sync.deviceId(),o=t===void 0?gs()?ws():e==="web"?Ss():ms:t;if(!o)return n();try{let i=await o.getItem(r);if(i&&i.length>0)return i;let a=n();return await o.setItem(r,a),a}catch{return n()}}var Vt=null;function Ts(){return Vt||(Vt=xs()),Vt}function Cs(e,t){let n=e?.deviceId,r=e?.deviceName,o=t.loadId??Ts,i=t.platform??Ne.OS,[a,l]=ps(null);return ds(()=>{if(n)return;let s=false;return o().then(u=>{s||l(u)}),()=>{s=true}},[n,o]),us(()=>{if(!n&&!a)return null;let s=vs({appName:t.appName,hardwareName:t.hardwareName,platform:i,installId:a??"",deviceId:n});return r?{...s,deviceName:r}:s},[n,r,a,t.appName,t.hardwareName,i])}import{useEffect as Is,useState as ks}from"react";import{capacitorPlatform as zs,capacitorPlugin as Rt,isCapacitorNative as Rs}from"@buoy-gg/license/web";function Ms(e,t){if(t==="ios")return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":null;let n=/Android [\d.]+;\s*([^;)]+?)(?:\s+Build\/|\))/.exec(e)?.[1]?.trim();return!n||n==="K"?null:n}function Bs(e){return/sdk_gphone|Android SDK built for|google_sdk|Emulator|generic_/i.test(e)}function Mo(){return typeof navigator>"u"?"":navigator.userAgent??""}function qt(){return typeof document>"u"?null:document.title||(typeof location>"u"?null:location.hostname)||null}var Bo="@react_buoy_capacitor_app_name";function As(e){try{let t=globalThis.localStorage;if(!t)return e;let n=t.getItem(Bo);if(n)return n;e&&t.setItem(Bo,e)}catch{}return e}function Es(){let e=zs();if(!e)return{platform:"web",appName:qt(),hardwareName:"Browser",ready:true};let t=!!Rt("App");return{platform:e,appName:t?qt():As(qt()),hardwareName:Ms(Mo(),e)??e,extraDeviceInfo:{runtime:"capacitor"},ready:!t&&!Rt("Device")}}function Os(){let[e,t]=ks(Es);return Is(()=>{if(!Rs())return;let n=false,r=Rt("App"),o=Rt("Device");return Promise.all([r?.getInfo?.().catch(()=>null)??null,o?.getInfo?.().catch(()=>null)??null]).then(([i,a])=>{if(n)return;let l=i?.name?.trim(),s=a?.name?.trim()||a?.model?.trim();t(u=>({...u,appName:l||u.appName,hardwareName:s||u.hardwareName,ready:true}))}),()=>{n=true}},[]),e}function Ao(){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}}function Eo(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return null}}function Ds(e,t){if(e==="ios"){let n=Eo(t.serverUrl);return n?n===Eo(t.origin):t.protocol==="capacitor:"}return Oo.has(t.hostname)}var Oo=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Ps(e,t,n,r=Ao()){if(n==="web"||!r)return e;let o;try{o=new URL(e)}catch{return e}let i=Ds(n,r);return!t&&i&&o.hostname===r.hostname&&(o.hostname="localhost"),n==="android"&&Oo.has(o.hostname)&&Bs(r.userAgent)&&(o.hostname="10.0.2.2"),o.toString().replace(/\/$/,"")}function Ls(e,t,n=Ao()){return t!=="android"||!n||n.protocol!=="https:"||!/^(http|ws):/i.test(e)?null:`[Buoy] Can't reach Buoy Desktop at ${e}. This Android WebView serves the app from https://${n.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.`}import{getDevServerOrigin as Fs,resolveReloadStrategy as $s,scheduleReloadApp as js}from"@buoy-gg/shared-ui/web";var Do=Date.now(),Po=Fs(),Ns={platform:Ne.OS,isTV:Ne.isTV===true,isTVOS:Ne.isTVOS===true},Lo={version:3,getSnapshot:()=>{let e=$s("auto");return{startedAt:Do,devServerOrigin:Po,device:Ns,reload:{available:e!==null,strategy:e}}},subscribe:e=>()=>{},actions:{ping:()=>({ok:true,startedAt:Do,devServerOrigin:Po}),reloadApp:e=>{let t=e??{},{strategy:n,delayMs:r}=js({strategy:t.strategy,delayMs:t.delayMs});return{scheduled:true,strategy:n,delayMs:r}}}};import{Fragment as _s,jsx as Le,jsxs as Ws}from"react/jsx-runtime";var Hs=["ConsoleRoot","RouteTracker","ReactQueryTracker","ReduxAutoInstrument","PerfMonitorRoot","AutomationResumer","ImagesRoot"],Us=["DebugBordersStandaloneOverlay","HighlightUpdatesOverlay","ImageOverlayStandalone","PerfMonitorOverlay","JsTopHudOverlay","ImpersonateOverlay","ScenariosOverlay"];function Ks(e){let t=zt(()=>Object.fromEntries(Object.entries(e.modules).map(([r,o])=>[r.replace(/^@buoy-gg\//,"").replace(/\/web$/,""),o])),[e.modules]),n=t["react-query"];return n?.useReactQuerySyncAdapter?Le(Vs,{...e,modules:t,query:n}):Le(Fo,{...e,modules:t})}function Vs(e){let t=e.query.useReactQuerySyncAdapter();return Le(Fo,{...e,queryAdapter:t})}function Fo({modules:e,apps:t,requiredEnvVars:n,externalSync:r,headless:o,sentryGetClient:i,queryAdapter:a}){let{isPro:l,tier:s}=rs(),u=zt(()=>{let z={app:Lo};for(let[E,R]of Object.entries(e))for(let[k,v]of Object.entries(R))k.endsWith("SyncAdapter")&&v&&typeof v=="object"&&(z[E]=v);a&&(z.query=a),e.env?.createEnvSyncAdapter&&(z.env=e.env.createEnvSyncAdapter(n??[]));for(let E of t??[])E.sync&&(z[`custom:${E.id}`]=E.sync);return z},[e,t,n,a]),f=ts(u);f.current=u,kt(()=>is(()=>f.current),[]),kt(()=>{let z=[],E=R=>{let k=R?.();typeof k=="function"&&z.push(k)};return E(e.network?.startNetworkCapture),E(e.storage?.startBrowserStorageCapture),E(e.assets?.startBrowserAssetCapture),Io(typeof _e<"u"?_e: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 R of z.reverse())R()}},[e]);let I=e["external-sync"],m=Io(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),M=as({isDevelopment:m,isLicensed:l,externalSync:r,isAvailable:!!I}),w=ko(r);os({release:!m&&!!w?.enableInRelease}),!m&&w?.enableInRelease&&jo(Ro(w.socketURL,w));let B=e.sentry?.SentryRoot;return Ws(_s,{children:[Object.entries(e).flatMap(([z,E])=>Hs.map(R=>{let k=E[R];return k?Le(k,{},`${z}:${R}`):null})),B&&Le(B,{getClient:i}),Object.entries(e).flatMap(([z,E])=>Us.map(R=>{let k=E[R];return k&&(!o||R==="ScenariosOverlay"||R==="ImpersonateOverlay")?Le(k,{},`${z}:${R}`):null})),M&&Le(qs,{module:I,tools:u,options:w,isPro:l,tier:s,dev:m})]})}var $o=null;function jo(e){!e||e===$o||($o=e,console.warn(e))}function qs({module:e,tools:t,options:n,isPro:r,tier:o,dev:i}){let a=Os(),l=Cs(n,{appName:a.appName,hardwareName:a.hardwareName,platform:a.platform}),s=zt(()=>Ps(n?.socketURL??(i?e.getDefaultSocketURL():zo),!!n?.socketURL,a.platform),[n?.socketURL,i,e,a.platform]),{socket:u}=e.useExternalSyncSocket({deviceName:l?.deviceName??"Buoy Browser",socketURL:s,persistentDeviceId:a.ready?l?.deviceId??null:null,platform:a.platform,extraDeviceInfo:a.extraDeviceInfo,enableLogs:n?.enableLogs});kt(()=>{let m=Ls(s,a.platform);if(!u||!m)return;let M=()=>jo(m);return u.on("connect_error",M),()=>{u.off("connect_error",M)}},[u,s,a.platform]),kt(()=>{if(!u)return;let m=()=>{u.connected&&ns.hasAccountAccess()&&u.emit("device-license",{isPro:r?"1":"0",tier:o})};return m(),u.on("connect",m),()=>{u.off("connect",m)}},[u,r,o]);let f=n?.releaseActions?.join(",")??"",I=zt(()=>cs(t,i,f?f.split(","):void 0),[t,i,f]);return e.useExternalSync({tools:I,socket:u,deviceId:a.ready?l?.deviceId??null:null,enableLogs:n?.enableLogs}),null}import{useState as No}from"react";import{createPortal as Gs}from"react-dom";import{useBuoySession as Js}from"@buoy-gg/license/web";import{Fragment as _o,jsx as it,jsxs as Wo}from"react/jsx-runtime";var Ho="#20C997";function Ys(){let{status:e,signIn:t,signOut:n}=Js(),[r,o]=No(false),[i,a]=No(null);if(typeof document>"u")return null;let l=()=>{a(null),o(true),t().catch(u=>a(u instanceof Error?u.message:"Sign-in did not work. Try again.")).finally(()=>o(false))},s=e.state==="active";return Gs(it("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:s||i?"12px 14px":0,borderRadius:16,background:s||i?"#0f1419":"transparent",color:"#e6edf3",boxShadow:s||i?"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:s?Wo(_o,{children:[it("div",{"data-testid":"buoy-signin-needs-plan",children:"Buoy on a live site needs a Pro or Business plan."}),it("button",{type:"button",onClick:()=>void n(),style:Xs,"data-testid":"buoy-signout",children:"Sign out"})]}):Wo(_o,{children:[i?it("div",{role:"alert",style:{marginBottom:10},"data-testid":"buoy-signin-error",children:i}):null,it("button",{type:"button",onClick:l,disabled:r,"data-testid":"buoy-signin",style:{display:"inline-flex",alignItems:"center",gap:8,padding:"10px 16px",border:"none",borderRadius:999,background:Ho,color:"#04130d",fontWeight:600,fontSize:14,cursor:r?"wait":"pointer",boxShadow:"0 8px 24px rgba(0,0,0,.3)"},children:r?"Signing in\u2026":"Sign in to Buoy"})]})}),document.body)}var Xs={marginTop:8,padding:0,border:"none",background:"none",color:Ho,fontSize:14,cursor:"pointer",textDecoration:"underline"};import{useState as Qs}from"react";import{AccountSetupButton as Zs,BuoyNeedsPlanCard as el,BuoySignInCard as tl,useSignInState as nl}from"@buoy-gg/shared-ui/web";import{jsx as at,jsxs as Uo}from"react/jsx-runtime";function Ko({needsPlan:e=false}){let[t,n]=Qs(false),r=nl();return Uo(N,{pointerEvents:"box-none",style:Vo.root,children:[at(Zs,{expanded:t,onPress:()=>n(true)}),t?at(Qo,{visible:true,transparent:true,animationType:"fade",onRequestClose:()=>n(false),children:Uo(N,{style:Vo.overlay,accessibilityViewIsModal:true,children:[at(Xo,{style:ct.absoluteFill,onPress:()=>n(false),accessible:false}),e&&r==="active"?at(el,{onClose:()=>n(false)}):at(tl,{onClose:()=>n(false)})]})}):null]})}var Vo=ct.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 qo(e){if(e.length>6){let t=e.map(n=>`"${n}"`).join(", ");return e.slice(0,6)}return e}import{installedTools as ol,installedToolsFound as rl}from"@buoy-gg/core/web/installed-tools";import{Fragment as Gt,jsx as F,jsxs as st}from"react/jsx-runtime";var Go={},Jo="@react_buoy_floating_menu_tooltip_shown",il=Ee;function al({size:e=14,color:t="#20C997"}){let n=Math.max(2,e/4),r=Math.max(1,e/16);return F("div",{style:{display:"grid",gridTemplateColumns:`repeat(3, ${n}px)`,gap:r,width:e,height:e,alignContent:"center",justifyContent:"center"},children:Array.from({length:9}).map((o,i)=>F("div",{style:{width:n,height:n,borderRadius:n/2,backgroundColor:t}},i))})}function sl(e){let{defaultFloatingTools:t,defaultDialTools:n,disableHints:r=false,children:o}=e,i=me(()=>n&&qo(n),[n]);return F(Ln,{defaultFloatingTools:t,defaultDialTools:i,children:F(ur,{disableHints:r,children:st(To,{children:[F(oo,{children:F(fl,{...e})}),o]})})})}var ll=["ReduxAutoInstrument","ConsoleRoot","RouteTracker","ReactQueryTracker"];function cl({modules:e=Go}){return F(Gt,{children:Object.entries(e).flatMap(([t,n])=>ll.map(r=>{let o=n[r];return o?F(o,{},`${t}:${r}`):null}))})}function dl(){let{openApps:e,restore:t}=nt();return ee(()=>fr(n=>{let r=e.find(o=>o.id===n);return r?(t(r.instanceId),true):false}),[e,t]),null}function ul(){let e=sr();return pr((e===null?process.env.NODE_ENV:e?"development":"production")??"dev")}function pl(e,t,n,r){let o=u=>Object.entries(e).find(([f])=>f.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")===u)?.[1],i=[],a=o("env");t?.length&&a?.createEnvTool&&a.createEnvVarConfig&&i.push(rt(a.createEnvTool({requiredEnvVars:a.createEnvVarConfig(t)})));let l=o("storage");n?.length&&l?.createStorageTool&&i.push(rt(l.createStorageTool({requiredStorageKeys:n})));let s=o("ask-buoy");return r&&s?.createAskBuoyTool&&i.push(rt(s.createAskBuoyTool(r))),i}function fl({environment:e,userRole:t="admin",availableEnvironments:n,onEnvironmentSwitch:r,apps:o,modules:i=Go,externalSync:a,requiredEnvVars:l,sentryGetClient:s,disableHints:u=false,headless:f=false,hidden:I=false,defaultFloatingTools:m,defaultDialTools:M,zustandStores:w,requiredStorageKeys:B,askBuoy:z}){let E=e??ul(),R=me(()=>M?qo(M):void 0,[M]),[k,v]=Mt(false),[C,P]=Mt(false),T=gr(false),A=nt(),Z=me(()=>pl(i,l,B,z),[i,l,B,z]),W=me(()=>Zt([...Co(i),...o??[],...Z]),[o,i,Z]),q=me(()=>Object.entries(i).find(([d])=>d.replace(/^@buoy-gg\//,"").replace(/\/web$/,"")==="zustand")?.[1],[i]);ee(()=>{if(!w||typeof q?.watchStores!="function")return;let d=q.watchStores(w);return typeof d=="function"?d:void 0},[w,q]);let te=Kt(),K=A.openApps.some(d=>!d.minimized);ee(()=>{te.setDialOpen(k)},[k,te.setDialOpen]),ee(()=>{te.setToolOpen(K||C)},[K,C,te.setToolOpen]);let{registerApps:ie}=A;ee(()=>{ie(W.map(d=>{let _=d.icon;return{...d,icon:typeof _=="function"?({size:b})=>_(b):_}}))},[ie,W]);let ne=me(()=>W.map(d=>({id:d.id,name:d.name,description:d.description,slot:d.slot})),[W]);hr({availableTools:ne,storage:il}),ee(()=>{let d=false;return(async()=>{let[_,b]=await Promise.all([Ee.getItem(ut.dial.isOpen()),Ee.getItem(ut.settings.modalOpen())]);d||(_==="true"&&v(true),b==="true"&&(v(true),P(true)),T.current=true)})(),()=>{d=true}},[]),ee(()=>{T.current&&Ee.setItem(ut.dial.isOpen(),k?"true":"false")},[k]),ee(()=>{T.current&&Ee.setItem(ut.settings.modalOpen(),C?"true":"false")},[C]);let ve=We(d=>{if(ui(d.id),d.launchMode==="toggle-only"){d.onPress?.();return}if(d.component){let _=typeof d.icon=="function"?d.icon(20):d.icon;A.open({id:d.id,title:d.name||dt(d.id),component:d.component,props:d.props,modal:d.modal,launchMode:d.launchMode||"self-modal",singleton:d.singleton??true,icon:_,color:d.color||Qt(d.id)})}else d.onPress?.()},[A]),ae=me(()=>Bt(W,"dial").map(d=>{let _=d.color||Qt(d.id),b;return typeof d.icon=="string"?b=d.icon:typeof d.icon=="function"?b=d.icon(32):b=null,{id:d.id,name:d.name||dt(d.id),icon:b,unavailable:!d.component&&!d.onPress,color:_,onPress:()=>{ve(d),v(false)}}}),[W,ve]),Ie=me(()=>{if(!k)return ae;let d=new Map(ae.map(_=>[_.id,_]));return di(ae.map(_=>_.id)).map(_=>d.get(_)).filter(_=>!!_)},[k,ae]),{settings:$}=Hn(),qe=me(()=>Bt(W,"row").filter(d=>($.floatingTools[d.id]??false)===true&&(d.component||d.onPress)),[W,$.floatingTools]),ke=me(()=>W.map(d=>({id:d.id,name:d.name||dt(d.id),description:d.description||yr(d.id),slot:d.slot,icon:d.icon,color:d.color})),[W]),[Fe,ze]=Mt(false),se=A.openApps.some(d=>!d.minimized);ee(()=>{if(u)return;let d=false,_=setTimeout(async()=>{let b=await Ee.getItem(Jo);!d&&!b&&ze(true)},1e3);return()=>{d=true,clearTimeout(_)}},[u]);let J=We(()=>{ze(false),Ee.setItem(Jo,"true")},[]),Se=We(()=>{J(),v(true)},[J]),pe=We(()=>{v(false),P(false)},[]),Re=We(()=>{P(d=>!d)},[]),$e=We(()=>P(false),[]),he=!!(n?.length&&r),Me=$.floatingTools.environment!==false,ue=Fe&&!k&&!se&&!I;ee(()=>{if(!ue)return;let d=b=>{(!(b.target instanceof Element)||!b.target.closest("[data-buoy-root]"))&&J()},_=b=>{b.key==="Escape"&&J()};return document.addEventListener("pointerdown",d,true),document.addEventListener("keydown",_),()=>{document.removeEventListener("pointerdown",d,true),document.removeEventListener("keydown",_)}},[ue,J]);let ye=A.openApps.some(d=>d.minimized&&d.launchMode!=="toggle-only"),Be=F(Ks,{modules:i,apps:o,requiredEnvVars:l,externalSync:a,headless:f,sentryGetClient:s});return f?Be:st("div",{"data-buoy-root":"",style:{display:"contents"},children:[Be,F(dl,{}),ue&&F("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.85)",zIndex:1e4,pointerEvents:"none"}}),F("div",{style:I?{visibility:"hidden"}:{display:"contents"},"aria-hidden":I||void 0,children:st(en,{enablePositionPersistence:!ue,pushToSide:k||se,suspendPointerEvents:k,centerOnboarding:ue,minimizedStack:ye?F(Va,{}):void 0,hasMinimizedStack:ye,children:[E&&Me&&!he&&F(br,{environment:E}),he&&Me&&F(vr,{currentEnvironment:E??"local",availableEnvironments:n,onSelect:r}),t?F(tn,{userRole:t,onPress:Se}):F("button",{"aria-label":"Open dev tools",onClick:Se,style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 8px",background:"none",border:"none",cursor:"pointer"},children:F(al,{})}),qe.map(d=>F("button",{"aria-label":d.name||dt(d.id),title:d.description,onClick:()=>ve(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))]})}),ue&&F(yn,{title:"Welcome to Buoy!",message:"Grab and position this menu wherever you want, then tap the icon to open your tools.",onDismiss:J}),k&&!I&&F(xn,{icons:Ie,onClose:pe,centerLabel:"BUOY",onCenterPress:Re,settingsOpen:C,hintsDisabled:u}),C&&!I&&F(Kn,{visible:true,onClose:$e,availableTools:ke,defaultFloatingTools:m,defaultDialTools:R,onSettingsChange:d=>{}}),!I&&st(Gt,{children:[F(ro,{}),F(tr,{})]})]})}function ml(e){let t=e&&typeof e=="object"?e.appId:void 0,n=!!e;ee(()=>{if(!n)return;let r=false,o=nr.SessionManager;if(!o)return;let i=a=>{r||!a||(o.configure({audience:`app:${a}`}),o.load().catch(()=>{}))};return t?i(t):cr().then(a=>i(a?.bundleId)).catch(()=>{}),()=>{r=true}},[n,t])}var Yo=false;function gl(e){return e.modules?e:(!rl&&!Yo&&typeof console<"u"&&(Yo=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:ol})}function hl(e){let t=gl(e),{access:n,isPro:r,licenseKey:o}=rr();ee(()=>{or.configure(t.licenseKey)},[t.licenseKey]);let i=t.licenseKey===void 0||ir(t.licenseKey,o),a=ar(typeof _e<"u"?_e:process.env.NODE_ENV!=="production"),l=i&&n.status==="admitted";ee(()=>{l&&mr()},[l]),ee(()=>{a||n.status==="initializing"||(r&&l?Zo():er())},[a,r,l,n.status]);let s=lr();return ml(s?t.signIn:void 0),!a&&!r?!t.signIn||t.headless?null:s?F(Ko,{needsPlan:true}):F(Ys,{}):l?F(sl,{...t}):st(Gt,{children:[n.status==="initializing"&&F(cl,{modules:t.modules}),t.headless?null:t.signIn&&s?F(Ko,{}):F(dr,{})]})}export{Sr as a,wr as b,Zt as c,Bt as d,xr as e,en as f,Tr as g,tn as h,xn as i,Kn as j,Zn as k,ya as l,Ia as m,oo as n,nt as o,ro as p,rt as q,To as r,Kt as s,Co as t,Lo as u,hl as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{b as V,c as L}from"./chunk-CLXYMJTS.mjs";import{toolTheme as P}from"@buoy-gg/shared-ui/web";var v={};V(v,{AccessibilityInfo:()=>H,ActivityIndicator:()=>ka,Alert:()=>Ma,Animated:()=>w,AppRegistry:()=>z,AppState:()=>N,Appearance:()=>F,BackHandler:()=>O,Button:()=>Aa,CheckBox:()=>aa,Clipboard:()=>U,DeviceEventEmitter:()=>ga,Dimensions:()=>S,Easing:()=>W,FlatList:()=>ea,I18nManager:()=>K,Image:()=>sa,ImageBackground:()=>ta,InteractionManager:()=>$,Keyboard:()=>j,KeyboardAvoidingView:()=>oa,LayoutAnimation:()=>G,Linking:()=>q,LogBox:()=>ha,Modal:()=>A,NativeEventEmitter:()=>J,NativeModules:()=>R,PanResponder:()=>X,Picker:()=>ra,PixelRatio:()=>Y,Platform:()=>C,Pressable:()=>E,ProgressBar:()=>ia,RefreshControl:()=>na,SafeAreaView:()=>la,ScrollView:()=>k,SectionList:()=>ca,Share:()=>_,StatusBar:()=>da,StyleSheet:()=>x,Switch:()=>Ea,Text:()=>b,TextInput:()=>Sa,Touchable:()=>ua,TouchableHighlight:()=>Ca,TouchableNativeFeedback:()=>ma,TouchableOpacity:()=>T,TouchableWithoutFeedback:()=>Ta,UIManager:()=>Z,Vibration:()=>Q,View:()=>f,VirtualizedList:()=>pa,YellowBox:()=>fa,findNodeHandle:()=>Ba,unstable_createElement:()=>D,useColorScheme:()=>ba,useLocaleContext:()=>xa,useWindowDimensions:()=>ya});L(v,I);import*as I from"react-native-web";import{unstable_createElement as D,NativeModules as R,AccessibilityInfo as H,Animated as w,Appearance as F,AppRegistry as z,AppState as N,BackHandler as O,Clipboard as U,Dimensions as S,Easing as W,I18nManager as K,Keyboard as j,InteractionManager as $,LayoutAnimation as G,Linking as q,NativeEventEmitter as J,PanResponder as X,PixelRatio as Y,Platform as C,Share as _,StyleSheet as x,UIManager as Z,Vibration as Q,CheckBox as aa,FlatList as ea,Image as sa,ImageBackground as ta,KeyboardAvoidingView as oa,Picker as ra,ProgressBar as ia,RefreshControl as na,SafeAreaView as la,SectionList as ca,StatusBar as da,Touchable as ua,TouchableNativeFeedback as ma,VirtualizedList as pa,YellowBox as fa,LogBox as ha,DeviceEventEmitter as ga,useColorScheme as ba,useLocaleContext as xa,useWindowDimensions as ya}from"react-native-web";import*as i from"react-native-web";import{createElement as va,forwardRef as wa}from"react";function l(e){let t=wa((r,s)=>{let{accessibilityState:c,accessibilityValue:m,...u}=r;for(let d of["busy","checked","disabled","expanded","selected"])c?.[d]!==void 0&&u[`aria-${d}`]===void 0&&(u[`aria-${d}`]=c[d]);for(let[d,n]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))m?.[d]!==void 0&&u[`aria-${n}`]===void 0&&(u[`aria-${n}`]=m[d]);return va(e,{...u,ref:s})}),o=e.State;return o&&Object.assign(t,{State:o}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=l(i.View),b=l(i.Text),Sa=l(i.TextInput),T=l(i.TouchableOpacity),Ca=l(i.TouchableHighlight),Ta=l(i.TouchableWithoutFeedback),E=l(i.Pressable),k=l(i.ScrollView),A=l(i.Modal),Ea=l(i.Switch),ka=l(i.ActivityIndicator),Aa=l(i.Button),Ba=i.findNodeHandle,Ma={alert(e,t,o,r){if(typeof document>"u")return;let s=document.createElement("dialog");s.dataset.buoyRoot="",s.setAttribute("aria-label",e),s.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let c=document.createElement("h2");if(c.textContent=e,c.style.cssText="font-size:18px;margin:0 0 12px",s.appendChild(c),t){let n=document.createElement("p");n.textContent=t,n.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",s.appendChild(n)}let m=document.createElement("div");m.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let u=o?.length?o:[{text:"OK"}],d=()=>{s.close?.(),s.remove()};for(let n of u){let g=document.createElement("button");g.type="button",g.textContent=n.text??"OK",g.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${n.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,g.onclick=()=>{d(),n.onPress?.()},m.appendChild(g)}s.addEventListener("cancel",n=>{n.preventDefault(),r?.cancelable!==false&&(d(),r?.onDismiss?.())}),s.appendChild(m),document.body.appendChild(s),s.showModal?s.showModal():s.setAttribute("open","")}};import{CopyButton as Va,toolTheme as a}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as La,SplitDiffViewer as Pa}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as p,jsxs as B}from"react/jsx-runtime";var Ia={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 M(e){return Ia[e.toLowerCase()]??a.colors.textMuted}var Da={GET:a.colors.info,POST:a.colors.success,PUT:a.colors.warning,PATCH:a.colors.warning,DELETE:a.colors.error};function Ra(e){return Da[e.toUpperCase()]??a.colors.textSecondary}var Ha={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 Fa(e){return Ha[e.toLowerCase()]??a.colors.textSecondary}function za({children:e,color:t=a.colors.textSecondary,icon:o,size:r="small",pill:s=false,mono:c=false,style:m}){let u=typeof e=="string"||typeof e=="number";return B(f,{style:[h.base,r==="medium"&&h.medium,s&&h.pill,{backgroundColor:t+"1A",borderColor:t+"40"},m],children:[o,u?p(b,{style:[h.text,r==="medium"&&h.textMedium,c&&h.textMono,{color:t}],numberOfLines:1,children:e}):e]})}var h=x.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 Na({status:e,color:t,size:o=8,style:r}){let s=t??(e?M(e):a.colors.textMuted);return p(f,{style:[{width:o,height:o,borderRadius:o/2,backgroundColor:s},r]})}function Oa({label:e,value:t,copyable:o=false,style:r}){let s=typeof t=="string"||typeof t=="number";return B(f,{style:[y.row,r],children:[p(b,{style:y.label,numberOfLines:1,children:e}),p(f,{style:y.value,children:s?p(b,{style:y.valueText,numberOfLines:2,children:String(t)}):t}),o&&t!=null&&p(Va,{value:t,size:12})]})}var y=x.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 Ua({oldValue:e,newValue:t,mode:o="tree",showUnchanged:r=true,scrollEnabled:s=false,height:c=220}){return o==="text"?p(Pa,{oldValue:e,newValue:t,height:c}):p(La,{oldValue:e,newValue:t,showUnchanged:r,scrollEnabled:s})}import{ToolButton as Wa,CopyButton as Ka,PowerToggleButton as ja}from"@buoy-gg/shared-ui/web";import{CompactRow as $a,DevToolsCard as Ga}from"@buoy-gg/shared-ui/web";import{SectionHeader as qa,CollapsibleSection as Ja,TabSelector as Xa,EmptyState as Ya,SearchBar as _a,EventStepperFooter as Za}from"@buoy-gg/shared-ui/web";import{DataViewer as Qa}from"@buoy-gg/shared-ui/web/dataViewer";import{BaseEventStore as ae}from"@buoy-gg/shared-ui/web";import{RelativeTime as ee}from"@buoy-gg/shared-ui/web";import{formatBytes as se,formatDuration as te,formatNumber as oe,truncateMiddle as re,safeStringify as ie}from"@buoy-gg/shared-ui/web";import{usePersistedState as ne,persistentStorage as le,devToolsStorageKeys as ce}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as de,copyToClipboard as ue}from"@buoy-gg/shared-ui/web";import{JsModal as me}from"@buoy-gg/shared-ui/web";import{Activity as pe,AlertTriangle as fe,Bug as he,Check as ge,CheckCircle as be,ChevronDown as xe,ChevronLeft as ye,ChevronRight as ve,ChevronUp as we,Clock as Se,Copy as Ce,Database as Te,Eye as Ee,EyeOff as ke,FileJson as Ae,FileText as Be,Filter as Me,FlaskConical as Ve,Globe as Le,Hash as Pe,Info as Ie,Key as De,Layers as Re,Lock as He,Pause as Fe,Play as ze,Plus as Ne,Power as Oe,RefreshCw as Ue,Search as We,Settings as Ke,Shield as je,Trash2 as $e,User as Ge,Wifi as qe,X as Je,Zap as Xe,AlertCircle as Ye,BarChart3 as _e,Bookmark as Ze,Cloud as Qe,Download as as,Edit3 as es,GitBranch as ss,HardDrive as ts,HelpCircle as os,Home as rs,Image as is,Link as ns,Maximize2 as ls,Minus as cs,Palette as ds,Pin as us,Route as ms,Server as ps,Smartphone as fs,Square as hs,CheckSquare as gs,Timer as bs,Unlock as xs,Upload as ys,Users as vs,XCircle as ws}from"@buoy-gg/shared-ui/web";export{f as a,b,T as c,E as d,k as e,A as f,v as g,w as h,S as i,C as j,x as k,M as l,Ra as m,Fa as n,za as o,Na as p,Oa as q,Ua as r,P as s,Wa as t,Ka as u,ja as v,$a as w,Ga as x,qa as y,Ja as z,Xa as A,Ya as B,_a as C,Za as D,Qa as E,ae as F,ee as G,se as H,te as I,oe as J,re as K,ie as L,ne as M,le as N,ce as O,de as P,ue as Q,me as R,pe as S,fe as T,he as U,ge as V,be as W,xe as X,ye as Y,ve as Z,we as _,Se as $,Ce as aa,Te as ba,Ee as ca,ke as da,Ae as ea,Be as fa,Me as ga,Ve as ha,Le as ia,Pe as ja,Ie as ka,De as la,Re as ma,He as na,Fe as oa,ze as pa,Ne as qa,Oe as ra,Ue as sa,We as ta,Ke as ua,je as va,$e as wa,Ge as xa,qe as ya,Je as za,Xe as Aa,Ye as Ba,_e as Ca,Ze as Da,Qe as Ea,as as Fa,es as Ga,ss as Ha,ts as Ia,os as Ja,rs as Ka,is as La,ns as Ma,ls as Na,cs as Oa,ds as Pa,us as Qa,ms as Ra,ps as Sa,fs as Ta,hs as Ua,gs as Va,bs as Wa,xs as Xa,ys as Ya,vs as Za,ws as _a};
|