@buoy-gg/react-query 7.0.56 → 7.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/web/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- "use client";var vr=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Jo=Object.getOwnPropertyNames;var Go=Object.prototype.hasOwnProperty;var Yo=(e,t)=>{for(var r in t)vr(e,r,{get:t[r],enumerable:true})},Sr=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jo(t))!Go.call(e,o)&&o!==r&&vr(e,o,{get:()=>t[o],enumerable:!(a=_o(t,o))||a.enumerable});return e},Xo=(e,t,r)=>(Sr(e,t,"default"),r&&Sr(r,t,"default"));typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import"@tanstack/react-query";import{QueryIcon as Cr}from"@buoy-gg/floating-tools-core/web";import{Wifi as xr}from"@buoy-gg/shared-ui/web";import{useCallback as Fe,useState as Ze,useEffect as Zo}from"react";import{useQueryClient as en}from"@tanstack/react-query";import{TickProvider as tn}from"@buoy-gg/shared-ui/web";import{useQueryClient as rn}from"@tanstack/react-query";import{JsModal as an,useSafeAreaInsets as on,ModalHeader as Lt,TabSelector as nn}from"@buoy-gg/shared-ui/web";import{useEffect as sn,useState as ln,useRef as un}from"react";import{useQueryClient as cn}from"@tanstack/react-query";function wr(e){let{query:t}=Bt(e);return t}function Bt(e){let t=cn(),[r,a]=ln({query:void 0,version:0}),o=un(void 0);return sn(()=>{if(!e){a({query:void 0,version:0}),o.current=void 0;return}let n=t.getQueryCache().find({queryKey:e,exact:true});a({query:n,version:0});let i=JSON.stringify(e);o.current=i;let l=t.getQueryCache().subscribe(s=>{(s.type==="updated"||s.type==="added"||s.type==="removed")&&"query"in s&&s.query&&JSON.stringify(s.query.queryKey)===o.current&&(s.type==="removed"?a({query:void 0,version:0}):a(u=>({query:s.query,version:u.version+1})))});return()=>l()},[t,e]),r}import{ModalHeader as Pe,TabSelector as qr,Search as dn,Filter as yn,Trash as hn,night as je}from"@buoy-gg/shared-ui/web";import{useState as fn,useRef as Mr,useEffect as mn}from"react";var Tr={};Yo(Tr,{AccessibilityInfo:()=>vn,ActivityIndicator:()=>li,Alert:()=>di,Animated:()=>Z,AppRegistry:()=>Cn,AppState:()=>xn,Appearance:()=>Sn,BackHandler:()=>wn,Button:()=>ui,CheckBox:()=>On,Clipboard:()=>qn,DeviceEventEmitter:()=>Xn,Dimensions:()=>Ar,Easing:()=>Mn,FlatList:()=>Wt,I18nManager:()=>Tn,Image:()=>Kn,ImageBackground:()=>Ln,InteractionManager:()=>Dn,Keyboard:()=>An,KeyboardAvoidingView:()=>Bn,LayoutAnimation:()=>Rn,Linking:()=>Qn,LogBox:()=>Yn,Modal:()=>Rr,NativeEventEmitter:()=>In,NativeModules:()=>bn,PanResponder:()=>Ht,Picker:()=>Hn,PixelRatio:()=>kn,Platform:()=>En,Pressable:()=>Dr,ProgressBar:()=>Wn,RefreshControl:()=>jn,SafeAreaView:()=>Vn,ScrollView:()=>be,SectionList:()=>$n,Share:()=>Fn,StatusBar:()=>Nn,StyleSheet:()=>T,Switch:()=>si,Text:()=>v,TextInput:()=>oi,Touchable:()=>Un,TouchableHighlight:()=>ni,TouchableNativeFeedback:()=>_n,TouchableOpacity:()=>N,TouchableWithoutFeedback:()=>ii,UIManager:()=>Pn,Vibration:()=>zn,View:()=>h,VirtualizedList:()=>Jn,YellowBox:()=>Gn,findNodeHandle:()=>ci,unstable_createElement:()=>pn,useColorScheme:()=>Zn,useLocaleContext:()=>ei,useWindowDimensions:()=>ti});Xo(Tr,gn);import*as gn from"react-native-web";import{unstable_createElement as pn,NativeModules as bn,AccessibilityInfo as vn,Animated as Z,Appearance as Sn,AppRegistry as Cn,AppState as xn,BackHandler as wn,Clipboard as qn,Dimensions as Ar,Easing as Mn,I18nManager as Tn,Keyboard as An,InteractionManager as Dn,LayoutAnimation as Rn,Linking as Qn,NativeEventEmitter as In,PanResponder as Ht,PixelRatio as kn,Platform as En,Share as Fn,StyleSheet as T,UIManager as Pn,Vibration as zn,CheckBox as On,FlatList as Wt,Image as Kn,ImageBackground as Ln,KeyboardAvoidingView as Bn,Picker as Hn,ProgressBar as Wn,RefreshControl as jn,SafeAreaView as Vn,SectionList as $n,StatusBar as Nn,Touchable as Un,TouchableNativeFeedback as _n,VirtualizedList as Jn,YellowBox as Gn,LogBox as Yn,DeviceEventEmitter as Xn,useColorScheme as Zn,useLocaleContext as ei,useWindowDimensions as ti}from"react-native-web";import*as V from"react-native-web";import{createElement as ri,forwardRef as ai}from"react";function $(e){let t=ai((a,o)=>{let{accessibilityState:n,accessibilityValue:i,...l}=a;for(let s of["busy","checked","disabled","expanded","selected"])n?.[s]!==void 0&&l[`aria-${s}`]===void 0&&(l[`aria-${s}`]=n[s]);for(let[s,u]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))i?.[s]!==void 0&&l[`aria-${u}`]===void 0&&(l[`aria-${u}`]=i[s]);return ri(e,{...l,ref:o})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var h=$(V.View),v=$(V.Text),oi=$(V.TextInput),N=$(V.TouchableOpacity),ni=$(V.TouchableHighlight),ii=$(V.TouchableWithoutFeedback),Dr=$(V.Pressable),be=$(V.ScrollView),Rr=$(V.Modal),si=$(V.Switch),li=$(V.ActivityIndicator),ui=$(V.Button),ci=V.findNodeHandle,di={alert(e,t,r,a){if(typeof document>"u")return;let o=document.createElement("dialog");o.dataset.buoyRoot="",o.setAttribute("aria-label",e),o.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",o.appendChild(n),t){let u=document.createElement("p");u.textContent=t,u.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",o.appendChild(u)}let i=document.createElement("div");i.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let l=r?.length?r:[{text:"OK"}],s=()=>{o.close?.(),o.remove()};for(let u of l){let c=document.createElement("button");c.type="button",c.textContent=u.text??"OK",c.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,c.onclick=()=>{s(),u.onPress?.()},i.appendChild(c)}o.addEventListener("cancel",u=>{u.preventDefault(),a?.cancelable!==false&&(s(),a?.onDismiss?.())}),o.appendChild(i),document.body.appendChild(o),o.showModal?o.showModal():o.setAttribute("open","")}};import{Wifi as Qr}from"@buoy-gg/shared-ui/web";import{useEffect as Ir,useState as yi,useRef as hi}from"react";import{onlineManager as mt}from"@tanstack/react-query";import{devToolsStorageKeys as kr,persistentStorage as Er}from"@buoy-gg/shared-ui/web";function Fr(){let[e,t]=yi(()=>mt.isOnline()),r=hi(false);Ir(()=>{if(r.current)return;(async()=>{try{let n=await Er.getItem(kr.settings.wifiEnabled());if(n!==null){let i=n==="true";t(i),mt.setOnline(i)}r.current=true}catch{}})()},[]);let a=async n=>{try{await Er.setItem(kr.settings.wifiEnabled(),n.toString())}catch{}},o=()=>{let n=!e;t(n),mt.setOnline(n),a(n)};return Ir(()=>mt.subscribe(n=>{t(n),r.current&&a(n)}),[]),{isOnline:e,handleWifiToggle:o}}import{jsx as jt}from"react/jsx-runtime";function Pr({size:e=16,testID:t}){let{isOnline:r,handleWifiToggle:a}=Fr();return jt(N,{"sentry-label":`ignore toggle WiFi ${r?"On":"Off"}`,testID:t,accessibilityRole:"button",accessibilityLabel:`WiFi ${r?"On":"Off"}`,accessibilityHint:`Tap to turn WiFi ${r?"off":"on"} for React Query`,onPress:a,hitSlop:{top:10,bottom:10,left:10,right:10},activeOpacity:.7,style:{alignItems:"center",justifyContent:"center",width:14,flexShrink:0},children:r?jt(Qr,{size:e,color:"#10B981"}):jt(Qr,{size:e,color:"#DC2626"})})}import{jsx as B,jsxs as gt}from"react/jsx-runtime";function et({selectedQuery:e,selectedMutation:t,activeTab:r,onTabChange:a,onBack:o,searchText:n="",onSearchChange:i,onFilterPress:l,hasActiveFilters:s=false,onClearCache:u,showWifiToggle:c=false}){let[d,f]=fn(false),b=Mr(false),y=Mr(null);mn(()=>{d&&y.current&&y.current.focus()},[d]);let m=()=>{f(!d),d&&i&&i("")},p=C=>{i&&i(C)},g=C=>C?.queryKey&&(Array.isArray(C.queryKey)?C.queryKey:[C.queryKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||"Unknown Query",S=C=>"queryKey"in C?g(C):C.options.mutationKey?(Array.isArray(C.options.mutationKey)?C.options.mutationKey:[C.options.mutationKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||`Mutation #${C.mutationId}`:`Mutation #${C.mutationId}`,w=[{key:"queries",label:"Queries"},{key:"mutations",label:"Mutations"}];return e||t?gt(Pe,{children:[B(Pe.Navigation,{onBack:o}),B(Pe.Content,{title:S(e??t),testID:"buoy-rq-detail-title"})]}):gt(Pe,{children:[B(Pe.Content,{title:"",noMargin:true,children:d?B(Pe.Search,{value:n,onChangeText:p,onCancel:()=>{p(""),f(false)},onDismiss:()=>f(false),dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search query keys...",accessibilityLabel:"Search queries and mutations",iconSize:14,testID:"buoy-rq-search",containerTestID:"buoy-rq-search-field",clearTestID:"buoy-rq-search-clear",inputProps:{"sentry-label":"ignore react query search header"}}):c?gt(h,{style:ze.tabRow,children:[B(h,{style:ze.tabSelectorWrap,children:B(qr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>a(C)})}),B(Pr,{size:16,testID:"buoy-rq-wifi"})]}):B(qr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>a(C)})}),gt(Pe.Actions,{children:[B(N,{"sentry-label":"ignore open search",testID:"buoy-rq-search-open",accessibilityRole:"button",accessibilityLabel:"Search queries and mutations",onPress:m,style:ze.headerActionButton,children:B(dn,{size:14,color:je.color.textSecondary})}),l&&B(N,{"sentry-label":"ignore open filter",testID:"buoy-rq-filters",accessibilityRole:"button",accessibilityLabel:s?"Filters, active":"Filters",onPress:l,style:[ze.headerActionButton,s&&ze.activeFilterButton],children:B(yn,{size:14,color:s?je.color.accent:je.color.textSecondary})}),u&&B(N,{"sentry-label":"ignore clear cache",testID:"buoy-rq-clear-cache",accessibilityRole:"button",onPress:u,style:[ze.headerActionButton,ze.clearCacheButton],accessibilityLabel:`Clear ${r} cache`,children:B(hn,{size:14,color:je.color.warning})})]})]})}var ze=T.create({tabRow:{flex:1,flexDirection:"row",alignItems:"center",gap:12},tabSelectorWrap:{flex:1},headerActionButton:{padding:6,borderRadius:4},activeFilterButton:{backgroundColor:je.color.accentSoft},clearCacheButton:{backgroundColor:je.color.warningSoft}});import{resolveListEmptyState as fi}from"@buoy-gg/shared-ui/web";import{useMemo as mi}from"react";import{useMemo as gi}from"react";import{useQueryClient as pi}from"@tanstack/react-query";var Ve=(e,t,r)=>{if(t.length===0)return r;if(e instanceof Map){let a=new Map(e);if(t.length===1)return a.set(t[0],r),a;let[o,...n]=t,i=a.get(o);return a.set(o,Ve(i??null,n,r)),a}if(e instanceof Set){let a=Ve(Array.from(e),t,r);return new Set(Array.isArray(a)?a:[])}if(Array.isArray(e)){let a=[...e];if(t.length===1)return a[t[0]]=r,a;let[o,...n]=t;return a[o]=Ve(a[o],n,r),a}if(e instanceof Object){let a={...e};if(t.length===1)return a[t[0]]=r,a;let[o,...n]=t;return a[o]=Ve(a[o],n,r),a}return e};var $e=(e,t)=>{if(e instanceof Map){let r=new Map(e);if(t.length===1)return r.delete(t[0]),r;let[a,...o]=t;return r.set(a,$e(r.get(a),o)),r}if(e instanceof Set){let r=$e(Array.from(e),t);return new Set(r)}if(Array.isArray(e)){let r=[...e];if(t.length===1)return r.filter((n,i)=>i.toString()!==t[0]);let[a,...o]=t;return r[a]=$e(r[a],o),r}if(e instanceof Object){let r={...e};if(t.length===1)return delete r[t[0]],r;let[a,...o]=t;return r[a]=$e(r[a],o),r}return e};function zr({activeQuery:e,dataPath:t,queryClient:r}){if(!t)return;let a=e.state.data,o=$e(a,t),n=JSON.parse(JSON.stringify(o));r.setQueryData(e.queryKey,n)}function Or(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Kr(e){return(Array.isArray(e)?e:[e]).filter(t=>t!=null).map(Or).filter(Boolean).join("-")||"unkeyed"}function bi(e){return`buoy-rq-query-row-${Kr(e)}`}function vi(e,t){return e==null?`buoy-rq-mutation-row-id-${t}`:`buoy-rq-mutation-row-${Kr(e)}`}function Si(e){return e.length===0?"buoy-rq-explorer-root":`buoy-rq-explorer-${e.map(Or).filter(Boolean).join("-")}`}import{LiveExplorer as Ci}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as xi}from"react/jsx-runtime";function me({editable:e,label:t,value:r,defaultExpanded:a,activeQuery:o,dataPath:n,itemsDeletable:i,dataVersion:l=0}){let s=pi(),u=gi(()=>{if(o)return{update:(c,d)=>{let f=o.state.data,b=Ve(f,c,d);s.setQueryData(o.queryKey,b)},remove:c=>{zr({queryClient:s,activeQuery:o,dataPath:c})}}},[s,o]);return xi(Ci,{editable:e,label:t,value:r,defaultExpanded:a,writer:u,dataPath:n,itemsDeletable:i,dataVersion:l,testIDForPath:Si,debounceMs:0})}import{useMemo as wi,useCallback as qi}from"react";import{memo as Mi}from"react";function se(e){return e.isDisabled()?"disabled":e.state.fetchStatus==="fetching"?"fetching":e.state.status==="error"?"error":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}import{CompactRow as Ti,buoyColors as ve,useRelativeTime as Ai}from"@buoy-gg/shared-ui/web";import{jsx as Di}from"react/jsx-runtime";var Ri=e=>e?.queryKey&&(Array.isArray(e.queryKey)?e.queryKey:[e.queryKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Query",Qi=Mi(function({query:e,isSelected:t,onSelect:r}){let a=b=>{switch(b){case"disabled":return ve.textMuted+"80";case"error":return ve.error;case"fresh":return ve.success;case"stale":return ve.warning;case"inactive":return ve.textMuted;case"fetching":return ve.primary;case"paused":return ve.textMuted;default:return ve.textSecondary}},o=se(e),n=e.getObserversCount(),i=e.isDisabled(),l=Ri(e),s=(()=>{if(i)return null;if(e.state.dataUpdatedAt&&e.state.dataUpdatedAt>0)return e.state.dataUpdatedAt;let b=e.state;return b.fetchedAt&&b.fetchedAt>0?b.fetchedAt:null})(),u=Ai(s),c=i?"Disabled":u||(e.state.dataUpdatedAt===0?"Not fetched":`N/A (${e.state.dataUpdatedAt||0})`),d=bi(e.queryKey),f=`${n} observer${n!==1?"s":""}`;return Di(Ti,{testID:d,statusTestID:`${d}-status`,statusSublabelTestID:`${d}-observers`,accessibilityLabel:`${l}, ${o}, ${f}`,statusDotColor:a(o),statusLabel:o.charAt(0).toUpperCase()+o.slice(1),statusSublabel:f,primaryText:l,bottomRightText:c,badgeText:n,badgeColor:a(o),isSelected:t,onPress:()=>r(e)})}),Lr=Qi;import{useEffect as Ii,useState as ki,useRef as Br,useMemo as Ei,useCallback as Hr}from"react";import{useQueryClient as Fi}from"@tanstack/react-query";import{buoyColors as pt}from"@buoy-gg/shared-ui/web";var le={base:()=>["#storage"],mmkv:{root:()=>[...le.base(),"mmkv"],key:e=>[...le.mmkv.root(),e],all:()=>[...le.mmkv.root(),"all"]},async:{root:()=>[...le.base(),"async"],key:e=>[...le.async.root(),e],all:()=>[...le.async.root(),"all"]},secure:{root:()=>[...le.base(),"secure"],key:e=>[...le.secure.root(),e],all:()=>[...le.secure.root(),"all"]}};function Se(e){return!Array.isArray(e)||e.length===0?false:e[0]==="#storage"}function Wr(e){if(!Se(e)||e.length<2)return null;let t=e[1];return t==="mmkv"||t==="async"||t==="secure"?t:null}function jr(e){switch(e){case"mmkv":return"MMKV";case"async":return"Async";case"secure":return"Secure";default:return e}}function Vr(e){switch(e){case"mmkv":return"purple";case"async":return"blue";case"secure":return"green";default:return"gray"}}function Pi(e){switch(e){case"mmkv":return pt.primary;case"async":return pt.warning;case"secure":return pt.success;default:return pt.textMuted}}function $r(e){return!Se(e)||e.length<3?"Unknown Storage Key":e.slice(2).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Storage Key"}var bt=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,zi=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,Nr=(e,t)=>bt(e)===bt(t)?zi(e,t):bt(e)>bt(t)?1:-1;function Oi(){let e=Fi(),[t,r]=ki(()=>e.getQueryCache().getAll().filter(l=>!Se(l.queryKey)).sort(Nr)),a=Br(new Map),o=Br(void 0),n=Hr(l=>{let s=a.current;if(l.length!==s.size)return true;for(let u of l){let c=s.get(u.queryHash);if(!c||c.dataUpdatedAt!==u.state.dataUpdatedAt||c.errorUpdatedAt!==u.state.errorUpdatedAt||c.fetchStatus!==u.state.fetchStatus||c.status!==u.state.status||c.isInvalidated!==u.state.isInvalidated)return true}return false},[]),i=Hr(()=>{let l=e.getQueryCache().getAll().filter(s=>!Se(s.queryKey));if(n(l)){let s=new Map;l.forEach(c=>{s.set(c.queryHash,c.state)}),a.current=s;let u=[...l].sort(Nr);r(u)}},[e,n]);return Ii(()=>{i();let l=e.getQueryCache().subscribe(s=>{if(s.type==="added"||s.type==="removed"||s.type==="updated"){if("query"in s&&s.query&&Se(s.query.queryKey))return;o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{i()},10)}});return()=>{l(),o.current&&clearTimeout(o.current)}},[e,i]),Ei(()=>t,[t])}var vt=Oi;import{night as Vt,ToolEmptyState as Ki,EVENT_LIST_PRESET as Li,monoFont as Bi}from"@buoy-gg/shared-ui/web";import{jsx as $t}from"react/jsx-runtime";function Ur({selectedQuery:e,onQuerySelect:t,activeFilter:r,emptyStateMessage:a,emptyState:o,contentContainerStyle:n,queries:i,searchText:l="",ignoredPatterns:s=new Set,includedPatterns:u=new Set}){let c=vt(),d=i??c,f=wi(()=>{let y=d;if(r&&(y=y.filter(m=>se(m)===r)),l){let m=l.toLowerCase();y=y.filter(p=>p?.queryKey?(Array.isArray(p.queryKey)?p.queryKey:[p.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase().includes(m):false)}return u.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return Array.from(u).some(g=>p.includes(g.toLowerCase()))})),s.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return!Array.from(s).some(g=>p.includes(g.toLowerCase()))})),y.sort((m,p)=>{let g=m.state.dataUpdatedAt||0;return(p.state.dataUpdatedAt||0)-g}),y},[d,r,l,u,s]),b=qi(y=>{if(e?.queryHash===y.queryHash){t(void 0);return}t(y)},[e?.queryHash,t]);return f.length===0?$t(Ki,{testID:"buoy-rq-empty",...o??{otto:"empty",title:"No queries found",message:a||(r?`No ${r} queries found`:"No queries found")}}):$t(Wt,{testID:"buoy-rq-query-list",style:_r.listWrapper,contentContainerStyle:n||_r.listContent,data:f,keyExtractor:Hi,renderItem:({item:y})=>$t(Lr,{query:y,stateSig:Wi(y),isSelected:e?.queryHash===y.queryHash,onSelect:b}),showsVerticalScrollIndicator:true,...Li})}var Hi=e=>e.queryHash;function Wi(e){let t=0,r=false;try{t=e.getObserversCount(),r=e.isStale()}catch{}return`${e.state.dataUpdatedAt}|${e.state.fetchStatus}|${e.state.status}|${t}|${r}`}var _r=T.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Vt.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Vt.color.border},emptyText:{color:Vt.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Bi,letterSpacing:.5}});import{buoyColors as D,monoFont as ji}from"@buoy-gg/shared-ui/web";import{jsx as Jr}from"react/jsx-runtime";var Vi={fresh:D.success+"15",stale:D.warning+"15",fetching:D.primary+"15",paused:D.textMuted+"1A",noObserver:D.textMuted+"1A",error:D.error+"15",inactive:D.textMuted+"1A"},$i={fresh:D.success+"33",stale:D.warning+"33",fetching:D.primary+"33",paused:D.textMuted+"33",noObserver:D.textMuted+"33",error:D.error+"33",inactive:D.textMuted+"33"},Ni={fresh:D.success,stale:D.warning,fetching:D.primary,paused:D.textMuted,noObserver:D.textMuted,error:D.error,inactive:D.textMuted};function Gr({query:e,testID:t}){let r=se(e),a=Vi[r],o=$i[r],n=Ni[r];return Jr(h,{style:[Yr.container,{backgroundColor:a,borderColor:o}],children:Jr(v,{testID:t,style:[Yr.text,{color:n}],children:r})})}var Yr=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:ji}});import{displayValue as Ui,night as U,monoFont as St}from"@buoy-gg/shared-ui/web";import{jsx as Ce,jsxs as Ct}from"react/jsx-runtime";function Nt({query:e}){if(e===void 0)return null;let t=new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});return Ct(h,{style:ee.minWidth,children:[Ce(v,{style:ee.headerText,children:"Query Details"}),Ct(h,{style:ee.row,children:[Ce(be,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:ee.flexOne,children:Ce(v,{testID:"buoy-rq-detail-key",style:ee.queryKeyText,children:Ui(e.queryKey,true)})}),Ce(Gr,{query:e,testID:"buoy-rq-detail-status"})]}),Ct(h,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Observers:"}),Ce(v,{testID:"buoy-rq-detail-observers",style:ee.valueText,children:`${e.getObserversCount()}`})]}),Ct(h,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Last Updated:"}),Ce(v,{testID:"buoy-rq-detail-updated",style:ee.valueText,children:`${t}`})]})]})}var ee=T.create({minWidth:{minWidth:200,backgroundColor:U.color.surface,borderRadius:6,borderWidth:1,borderColor:U.color.accent+"4D",overflow:"hidden",shadowColor:U.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:U.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:U.color.accent,borderBottomWidth:1,borderBottomColor:U.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:St},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:U.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:U.color.text,fontFamily:St,lineHeight:18,flexShrink:1,backgroundColor:U.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:U.color.accent+"4D"},labelText:{fontSize:10,color:U.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:St},valueText:{fontSize:12,color:U.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:St}});import{useQueryClient as _i}from"@tanstack/react-query";import{night as R}from"@buoy-gg/shared-ui/web";import{jsx as Xr,jsxs as Ji}from"react/jsx-runtime";var Gi={refetch:{dotColor:R.color.accent,textColor:R.color.text,borderColor:R.color.border},invalidate:{dotColor:R.color.warning,textColor:R.color.text,borderColor:R.color.border},reset:{dotColor:R.color.textSecondary,textColor:R.color.text,borderColor:R.color.border},remove:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"},triggerLoading:{dotColor:R.color.info,textColor:R.color.info,borderColor:R.color.info+"40"},triggerError:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"}};function ue({onClick:e,text:t,variant:r,disabled:a,testID:o}){let n=Gi[r];return Ji(N,{"sentry-label":"ignore devtools action button",testID:o,disabled:a,onPress:e,style:[Ut.button,{borderColor:a?R.color.border:n.borderColor,opacity:a?.4:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:a},children:[Xr(h,{style:[Ut.dot,{backgroundColor:a?R.color.textTertiary:n.dotColor}]}),Xr(v,{style:[Ut.text,{color:a?R.color.textTertiary:n.textColor}],children:t})]})}var Ut=T.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:4,borderWidth:1,paddingHorizontal:8,paddingVertical:4,backgroundColor:"transparent"},dot:{width:6,height:6,borderRadius:3,marginRight:6},text:{fontSize:12,fontWeight:"500"}});var Yi="@tanstack/query-devtools-event";function xe(e,t){try{let r=globalThis;if(typeof r.dispatchEvent!="function"||typeof r.CustomEvent!="function")return;r.dispatchEvent(new r.CustomEvent(Yi,{detail:{type:e,queryHash:t},bubbles:true,cancelable:true}))}catch{}}function _t({query:e}){if(e.state.data===void 0){xe("RESTORE_LOADING",e.queryHash);let t=e.state,r=e.state.fetchMeta?e.state.fetchMeta.__previousQueryOptions:null;e.cancel({silent:true}),e.setState({...t,fetchStatus:"idle",fetchMeta:null}),r&&e.fetch(r)}else{xe("TRIGGER_LOADING",e.queryHash);let t=e.options;e.fetch({...t,queryFn:()=>new Promise(()=>{}),gcTime:-1}),e.setState({data:void 0,status:"pending",fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:t}})}}function Jt({query:e}){xe("REFETCH",e.queryHash),e.fetch().catch(()=>{})}function Zr({query:e,queryClient:t}){xe("RESET",e.queryHash),t.resetQueries({queryKey:e.queryKey,exact:true})}function ea({query:e,queryClient:t}){xe("REMOVE",e.queryHash),t.removeQueries(e)}function ta({query:e,queryClient:t}){xe("INVALIDATE",e.queryHash),t.invalidateQueries(e)}function Gt({query:e,queryClient:t}){if(e.state.status!=="error"){xe("TRIGGER_ERROR",e.queryHash);let r=new Error("Unknown error from devtools"),a=e.options;e.setState({status:"error",error:r,fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:a}})}else xe("RESTORE_ERROR",e.queryHash),t.resetQueries(e)}import{night as Xi}from"@buoy-gg/shared-ui/web";import{jsx as we,jsxs as tt}from"react/jsx-runtime";function ra({query:e,setSelectedQuery:t}){let r=_i();if(e===void 0)return null;let a=e.state.status,o=se(e)==="fetching";return tt(h,{style:Oe.container,children:[tt(h,{style:Oe.section,children:[we(v,{style:Oe.sectionLabel,children:"Actions"}),tt(h,{style:Oe.buttonsRow,children:[we(ue,{disabled:o,onClick:()=>Jt({query:e}),variant:"refetch",text:"Refetch"}),we(ue,{disabled:a==="pending",onClick:()=>ta({query:e,queryClient:r}),variant:"invalidate",text:"Invalidate"}),we(ue,{disabled:a==="pending",onClick:()=>Zr({queryClient:r,query:e}),variant:"reset",text:"Reset"}),we(ue,{disabled:o,onClick:()=>{ea({queryClient:r,query:e}),t(void 0)},variant:"remove",text:"Remove"})]})]}),tt(h,{style:Oe.section,children:[we(v,{style:Oe.sectionLabel,children:"Triggers"}),tt(h,{style:Oe.buttonsRow,children:[we(ue,{disabled:false,onClick:()=>_t({query:e}),variant:"triggerLoading",text:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading"}),we(ue,{disabled:a==="pending",onClick:()=>Gt({query:e,queryClient:r}),variant:"triggerError",text:a==="error"?"Restore Error":"Trigger Error"})]})]})]})}var Oe=T.create({container:{gap:16},section:{gap:8},sectionLabel:{fontSize:11,fontWeight:"600",color:Xi.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},buttonsRow:{flexDirection:"row",flexWrap:"wrap",gap:8}});import{night as Yt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as Xt}from"react/jsx-runtime";function Zi({selectedQuery:e,setSelectedQuery:t}){return Xt(be,{"sentry-label":"ignore devtools query info scroll",style:de.flexOne,contentContainerStyle:de.scrollContent,children:[ce(h,{style:de.section,children:ce(Nt,{query:e})}),ce(h,{style:de.section,children:ce(ra,{query:e,setSelectedQuery:t})}),Xt(h,{style:de.section,children:[ce(v,{style:de.headerText,children:"Data Explorer"}),ce(h,{style:de.contentView,children:ce(me,{editable:true,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),Xt(h,{style:de.section,children:[ce(v,{style:de.headerText,children:"Query Explorer"}),ce(h,{style:de.contentView,children:ce(me,{label:"Query",value:e,defaultExpanded:["Query","queryKey"],activeQuery:e})})]})]})}var de=T.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:Yt.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:Yt.color.surface,borderRadius:12,borderWidth:1,borderColor:Yt.color.border,padding:16}});import{buoyColors as F,night as te}from"@buoy-gg/shared-ui/web";import{jsx as Zt,jsxs as es}from"react/jsx-runtime";var ts=({label:e,color:t,count:r,showLabel:a=true,isActive:o=false,onPress:n,onTouchStart:i,size:l="default",testID:s})=>{let u=l==="large",c=(d=>{let f={green:{bg:F.success+"15",border:F.success+"40",dot:F.success,text:F.success},yellow:{bg:F.warning+"15",border:F.warning+"40",dot:F.warning,text:F.warning},blue:{bg:F.primary+"15",border:F.primary+"40",dot:F.primary,text:F.primary},purple:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary},red:{bg:F.error+"15",border:F.error+"40",dot:F.error,text:F.error},gray:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary}};return f[d]||f.gray})(t);return es(N,{"sentry-label":"ignore devtools query status",testID:s,accessibilityRole:"button",accessibilityLabel:`${e}, ${r}${o?", selected":""}`,accessibilityState:{selected:o},style:[qe.queryStatusTag,u&&qe.queryStatusTagLarge,o&&{backgroundColor:c.bg,borderColor:c.border}],disabled:!n,onPress:n,onPressIn:i,activeOpacity:.7,children:[Zt(h,{style:[qe.dot,u&&qe.dotLarge,{backgroundColor:c.dot}]}),a&&Zt(v,{style:[qe.label,u&&qe.labelLarge,o&&{color:c.text}],numberOfLines:1,ellipsizeMode:"tail",children:e}),r>0&&Zt(v,{testID:s?`${s}-count`:void 0,style:[qe.count,u&&qe.countLarge,{color:c.dot}],numberOfLines:1,children:r})]})},qe=T.create({queryStatusTag:{flexDirection:"row",alignItems:"center",backgroundColor:te.color.buttonSurface,borderRadius:13,paddingHorizontal:10,paddingVertical:5,height:26,gap:6,borderWidth:1,borderColor:te.color.border},queryStatusTagLarge:{borderRadius:16,paddingHorizontal:13,paddingVertical:6,height:32,gap:7},dot:{width:6,height:6,borderRadius:3},dotLarge:{width:8,height:8,borderRadius:4},label:{fontSize:11,fontWeight:"500",color:te.color.textSecondary,fontFamily:"system"},labelLarge:{fontSize:13,fontWeight:"600",letterSpacing:.2,fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},count:{fontSize:11,fontVariant:["tabular-nums"],fontWeight:"600",marginLeft:"auto",fontFamily:"system"},countLarge:{fontSize:13,fontWeight:"700",fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),re=ts;import{ChipStrip as rs,useChipTap as as}from"@buoy-gg/shared-ui/web";import{useEffect as aa,useState as oa}from"react";import{useQueryClient as na}from"@tanstack/react-query";function os(){let e=na(),[t,r]=oa({fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});return aa(()=>{let a=()=>{let n=e.getQueryCache().getAll().reduce((i,l)=>{let s=se(l);return i[s]=(i[s]||0)+1,i},{fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});setTimeout(()=>r(n),0)};a();let o=e.getQueryCache().subscribe(a);return()=>o()},[e]),t}var ia=os;function ns(){let e=na(),[t,r]=oa({pending:0,success:0,error:0,paused:0,idle:0});return aa(()=>{let a=()=>{let n=e.getMutationCache().getAll().reduce((i,l)=>{let s=l.state.status;if(l.state.isPaused)i.paused++;else switch(s){case"idle":i.idle++;break;case"pending":i.pending++;break;case"success":i.success++;break;case"error":i.error++;break}return i},{pending:0,success:0,error:0,paused:0,idle:0});setTimeout(()=>r(n),0)};a();let o=e.getMutationCache().subscribe(a);return()=>o()},[e]),t}import{jsx as rt,jsxs as is}from"react/jsx-runtime";var ss=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{fresh:a,stale:o,fetching:n,paused:i,inactive:l}=ia(),{scrollProps:s,onTouchStart:u,isTap:c}=as(),d=(f,b)=>{c(b)&&t&&t(e===f?null:f)};return is(rs,{scrollProps:s,sentryLabel:"ignore devtools query status count scroll",children:[rt(re,{label:"Fresh",color:"green",count:a,isActive:e==="fresh",onPress:f=>d("fresh",f),onTouchStart:u,testID:"buoy-rq-status-fresh",showLabel:true,size:r}),rt(re,{label:"Loading",color:"blue",count:n,isActive:e==="fetching",onPress:f=>d("fetching",f),onTouchStart:u,testID:"buoy-rq-status-fetching",showLabel:true,size:r}),rt(re,{label:"Paused",color:"purple",count:i,isActive:e==="paused",onPress:f=>d("paused",f),onTouchStart:u,testID:"buoy-rq-status-paused",showLabel:true,size:r}),rt(re,{label:"Stale",color:"yellow",count:o,isActive:e==="stale",onPress:f=>d("stale",f),onTouchStart:u,testID:"buoy-rq-status-stale",showLabel:true,size:r}),rt(re,{label:"Idle",color:"gray",count:l,isActive:e==="inactive",onPress:f=>d("inactive",f),onTouchStart:u,testID:"buoy-rq-status-inactive",showLabel:true,size:r})]})},sa=ss;import{useState as ls,useRef as er,useMemo as us,useCallback as cs}from"react";import{QueryIcon as ds,CheckCircle as ys,Activity as hs,Pause as fs,XCircle as ms,buoyColors as xt}from"@buoy-gg/shared-ui/web";import{jsx as at}from"react/jsx-runtime";function gs({size:e=24}){return at(ds,{size:e})}function ps({size:e=14,color:t=xt.success,strokeWidth:r=2}){return at(ys,{size:e,color:t,strokeWidth:r})}function bs({size:e=14,color:t=xt.warning,strokeWidth:r=2}){return at(hs,{size:e,color:t,strokeWidth:r})}function vs({size:e=14,color:t=xt.textMuted,strokeWidth:r=2}){return at(fs,{size:e,color:t,strokeWidth:r})}function Ss({size:e=14,color:t=xt.error,strokeWidth:r=2}){return at(ms,{size:e,color:t,strokeWidth:r})}import{buoyColors as ot,night as Ke,useRelativeTime as Cs,monoFont as la}from"@buoy-gg/shared-ui/web";import{jsx as ae,jsxs as wt}from"react/jsx-runtime";var xs=e=>e.options.mutationKey&&(Array.isArray(e.options.mutationKey)?e.options.mutationKey:[e.options.mutationKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Anonymous Mutation";function ua({mutation:e,setSelectedMutation:t,selected:r}){let a=new Date(e.state.submittedAt).toLocaleTimeString(),o=(()=>{if(e.state.submittedAt&&e.state.submittedAt>0)return e.state.submittedAt;let u=e.state;return u.updatedAt&&u.updatedAt>0?u.updatedAt:null})(),n=Cs(o)||`N/A (${e.state.submittedAt||0})`,i=(()=>{if(e.state.isPaused)return{status:"Paused",color:ot.textMuted,icon:ae(vs,{})};switch(e.state.status){case"success":return{status:"Success",color:ot.success,icon:ae(ps,{})};case"error":return{status:"Error",color:ot.error,icon:ae(Ss,{})};case"pending":return{status:"Loading",color:ot.primary,icon:ae(bs,{})};default:return{status:"Idle",color:ot.textMuted,icon:null}}})(),l=xs(e),s=vi(e.options.mutationKey,e.mutationId);return wt(N,{"sentry-label":"ignore devtools mutation button",testID:s,accessibilityRole:"button",accessibilityLabel:`${l}, ${i.status}`,onPress:()=>t(e===r?void 0:e),style:[_.button,r?.mutationId===e.mutationId&&_.selected],children:[wt(h,{style:_.rowContent,children:[wt(h,{style:_.statusSection,children:[ae(h,{style:[_.statusDot,{backgroundColor:i.color}]}),wt(h,{style:_.statusInfo,children:[ae(v,{testID:`${s}-status`,style:[_.statusLabel,{color:i.color}],children:i.status}),ae(v,{style:_.submittedText,children:a})]})]}),ae(h,{style:_.mutationSection,children:ae(v,{testID:`${s}-key`,style:_.mutationKey,children:l})})]}),ae(h,{style:_.bottomRightContainer,children:ae(v,{style:_.bottomRightText,children:n})})]})}var _=T.create({button:{backgroundColor:Ke.color.surface,borderRadius:8,borderWidth:1,borderColor:Ke.color.border,marginHorizontal:8,marginVertical:3,padding:12},selected:{backgroundColor:Ke.color.accentSoft,borderColor:Ke.color.accentBorderStrong},rowContent:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},statusSection:{flexDirection:"row",alignItems:"center",gap:8,flex:1},statusDot:{width:8,height:8,borderRadius:4},statusInfo:{flex:1},statusLabel:{fontSize:11,fontWeight:"600",lineHeight:14},submittedText:{fontSize:10,color:Ke.color.textTertiary,marginTop:1},mutationSection:{flex:2,paddingHorizontal:12},mutationKey:{fontFamily:la,fontSize:12,color:Ke.color.text,lineHeight:16},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:Ke.color.textTertiary,fontFamily:la}});import{displayValue as ws,night as J,monoFont as qt}from"@buoy-gg/shared-ui/web";import{buoyColors as G,monoFont as qs}from"@buoy-gg/shared-ui/web";import{jsx as ca}from"react/jsx-runtime";var Ms={success:G.success+"15",error:G.error+"15",pending:G.primary+"15",idle:G.textMuted+"1A"},Ts={success:G.success+"33",error:G.error+"33",pending:G.primary+"33",idle:G.textMuted+"33"},As={success:G.success,error:G.error,pending:G.primary,idle:G.textMuted};function da({status:e,testID:t}){let r=e,a=Ms[r],o=Ts[r],n=As[r];return ca(h,{style:[ya.container,{backgroundColor:a,borderColor:o}],children:ca(v,{testID:t,style:[ya.text,{color:n}],children:e})})}var ya=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:qs}});import{jsx as Ne,jsxs as tr}from"react/jsx-runtime";function rr({selectedMutation:e}){if(e===void 0)return null;let t=new Date(e.state.submittedAt).toLocaleTimeString();return tr(h,{style:Me.minWidth,children:[Ne(v,{style:Me.headerText,children:"Mutation Details"}),tr(h,{style:Me.row,children:[Ne(be,{"sentry-label":"ignore devtools mutation details scroll",horizontal:true,style:Me.flex1,children:Ne(v,{testID:"buoy-rq-mutation-detail-key",style:Me.flexWrap,children:`${e.options.mutationKey?ws(e.options.mutationKey,true):"No mutationKey found"}`})}),Ne(da,{status:e.state.status,testID:"buoy-rq-mutation-detail-status"})]}),tr(h,{style:Me.row,children:[Ne(v,{style:Me.labelText,children:"Submitted At:"}),Ne(v,{style:Me.valueText,children:t})]})]})}var Me=T.create({minWidth:{minWidth:200,backgroundColor:J.color.surface,borderRadius:6,borderWidth:1,borderColor:J.color.accent+"4D",overflow:"hidden",shadowColor:J.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:J.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:J.color.accent,borderBottomWidth:1,borderBottomColor:J.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:qt},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:J.color.separator},flex1:{flex:1,marginRight:8},flexWrap:{fontSize:12,color:J.color.text,fontFamily:qt,lineHeight:18,flexShrink:1,backgroundColor:J.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:J.color.accent+"4D"},labelText:{fontSize:10,color:J.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:qt},valueText:{fontSize:12,color:J.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:qt}});import{night as nt,monoFont as Ds}from"@buoy-gg/shared-ui/web";import{jsx as H,jsxs as it}from"react/jsx-runtime";function ha({selectedMutation:e}){return it(be,{"sentry-label":"ignore devtools mutation information scroll",style:z.flex1,contentContainerStyle:z.scrollContent,children:[H(h,{style:z.section,children:H(rr,{selectedMutation:e})}),it(h,{style:z.section,children:[H(v,{style:z.textHeader,children:"Variables Details"}),H(h,{style:z.padding,children:H(me,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),it(h,{style:z.section,children:[H(v,{style:z.textHeader,children:"Context Details"}),H(h,{style:z.padding,children:H(me,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),it(h,{style:z.section,children:[H(v,{style:z.textHeader,children:"Data Explorer"}),H(h,{style:z.padding,children:H(me,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),it(h,{style:z.section,children:[H(v,{style:z.textHeader,children:"Mutations Explorer"}),H(h,{style:z.padding,children:H(me,{label:"Mutation",defaultExpanded:["Mutation"],value:e})})]})]})}var z=T.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:nt.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:nt.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:nt.color.accent+"33",fontFamily:Ds,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:nt.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:nt.color.border,borderTopWidth:0}});import{useCallback as fa,useEffect as Rs,useRef as ma,useState as Qs}from"react";import{useQueryClient as Is}from"@tanstack/react-query";function ks(){let e=Is(),[t,r]=Qs(()=>e.getMutationCache().getAll()),a=ma(new Map),o=ma(void 0),n=fa(l=>{let s=a.current;if(l.length!==s.size)return true;for(let u of l){let c=s.get(u.mutationId);if(!c||c.status!==u.state.status||c.submittedAt!==u.state.submittedAt||c.isPaused!==u.state.isPaused)return true}return false},[]),i=fa(()=>{let l=e.getMutationCache().getAll();if(n(l)){let s=new Map;l.forEach(u=>{s.set(u.mutationId,u.state)}),a.current=s,r(l)}},[e,n]);return Rs(()=>{i();let l=e.getMutationCache().subscribe(s=>{(s.type==="added"||s.type==="removed"||s.type==="updated")&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{i()},10))});return()=>{l(),o.current&&clearTimeout(o.current)}},[e,i]),{mutations:t}}var ga=ks;import{night as Le,ToolEmptyState as Es,monoFont as Fs}from"@buoy-gg/shared-ui/web";import{jsx as Te,jsxs as pa}from"react/jsx-runtime";function ba({selectedMutation:e,setSelectedMutation:t,activeFilter:r,hideInfoPanel:a=false,contentContainerStyle:o,searchText:n=""}){let{mutations:i}=ga(),l=S=>S.state.isPaused?"paused":S.state.status,s=us(()=>{let S=i;if(r&&(S=S.filter(w=>l(w)===r)),n){let w=n.toLowerCase();S=S.filter(C=>{let q=C.options.mutationKey;return q?(Array.isArray(q)?q:[q]).filter(A=>A!=null).map(A=>String(A)).join(" ").toLowerCase().includes(w):false})}return S},[i,r,n]),u=Ar.get("window").height,c=u*.4,d=150,f=u*.7,b=er(new Z.Value(c)).current,[,y]=ls(c),m=er(c),p=er(Ht.create({onMoveShouldSetPanResponder:(S,w)=>Math.abs(w.dy)>Math.abs(w.dx)&&Math.abs(w.dy)>10,onPanResponderGrant:()=>{b.stopAnimation(S=>{y(S),m.current=S,b.setValue(S)})},onPanResponderMove:(S,w)=>{let C=m.current-w.dy,q=Math.max(d,Math.min(f,C));b.setValue(q)},onPanResponderRelease:(S,w)=>{let C=Math.max(d,Math.min(f,m.current-w.dy));y(C),m.current=C,Z.timing(b,{toValue:C,duration:200,useNativeDriver:false}).start(()=>{b.setValue(C),y(C),m.current=C})}})).current,g=cs(({item:S})=>Te(ua,{selected:e,setSelectedMutation:t,mutation:S}),[e,t]);return pa(h,{style:Be.container,children:[s.length>0?Te(h,{style:Be.listWrapper,children:Te(Wt,{"sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:s,renderItem:g,keyExtractor:(S,w)=>`${S.mutationId}-${S.state.submittedAt}-${S.state.status}-${w}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process<"u"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:o||Be.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):Te(Es,{testID:"buoy-rq-mutations-empty",otto:r?"filtering":"scanning",title:"No mutations found",message:r?`No ${r} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),e&&!a&&pa(Z.View,{style:[Be.mutationInfo,{height:b}],children:[Te(h,{style:Be.dragHandle,...p.panHandlers,children:Te(h,{style:Be.dragIndicator})}),Te(h,{style:Be.mutationInfoContent,children:Te(ha,{selectedMutation:e})})]})]})}var Be=T.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:Le.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:Le.color.surface,borderBottomWidth:1,borderBottomColor:Le.color.border},dragIndicator:{width:40,height:4,backgroundColor:Le.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Le.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Le.color.border},emptyText:{color:Le.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Fs,letterSpacing:.5}});import{ChipStrip as Ps,useChipTap as zs}from"@buoy-gg/shared-ui/web";import{jsx as Mt,jsxs as Os}from"react/jsx-runtime";var Ks=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{pending:a,success:o,error:n,paused:i}=ns(),{scrollProps:l,onTouchStart:s,isTap:u}=zs(),c=(d,f)=>{u(f)&&t&&t(e===d?null:d)};return Os(Ps,{scrollProps:l,sentryLabel:"ignore devtools mutation status count scroll",children:[Mt(re,{label:"Pending",color:"blue",count:a,isActive:e==="pending",onPress:d=>c("pending",d),onTouchStart:s,testID:"buoy-rq-mstatus-pending",showLabel:true,size:r}),Mt(re,{label:"Success",color:"green",count:o,isActive:e==="success",onPress:d=>c("success",d),onTouchStart:s,testID:"buoy-rq-mstatus-success",showLabel:true,size:r}),Mt(re,{label:"Error",color:"red",count:n,isActive:e==="error",onPress:d=>c("error",d),onTouchStart:s,testID:"buoy-rq-mstatus-error",showLabel:true,size:r}),Mt(re,{label:"Paused",color:"purple",count:i,isActive:e==="paused",onPress:d=>c("paused",d),onTouchStart:s,testID:"buoy-rq-mstatus-paused",showLabel:true,size:r})]})},va=Ks;import{Trash as Ls,night as Ue}from"@buoy-gg/shared-ui/web";import{jsx as Sa}from"react/jsx-runtime";var Bs=({type:e,onClear:t,disabled:r=false})=>Sa(N,{"sentry-label":"ignore devtools clear cache button",style:[Ca.button,r&&Ca.disabledButton],onPress:t,disabled:r,activeOpacity:.7,accessibilityLabel:`Clear ${e} cache`,accessibilityRole:"button",accessibilityState:{disabled:r},children:Sa(Ls,{size:16,strokeWidth:2,color:r?Ue.color.textTertiary:Ue.color.warning})}),Ca=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:Ue.color.warningSoft,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:Ue.color.warning+"33"},disabledButton:{opacity:.5,backgroundColor:Ue.color.fill,borderColor:Ue.color.border}}),Hs=Bs;import{Wifi as xa,buoyColors as wa}from"@buoy-gg/shared-ui/web";import{jsx as ar}from"react/jsx-runtime";var Ws=({isOffline:e,onToggle:t})=>ar(N,{"sentry-label":"ignore devtools network toggle button",style:[qa.button,e&&qa.offlineButton],onPress:t,activeOpacity:.7,accessibilityLabel:e?"Unset offline mocking behavior":"Mock offline behavior",accessibilityRole:"button",accessibilityState:{selected:e},children:e?ar(xa,{size:16,color:wa.error,strokeWidth:2}):ar(xa,{size:16,color:wa.success,strokeWidth:2})}),qa=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:"rgba(16, 185, 129, 0.2)"},offlineButton:{backgroundColor:"rgba(239, 68, 68, 0.1)",borderColor:"rgba(239, 68, 68, 0.2)"}}),js=Ws;import{ChipStrip as Vs,useChipTap as $s}from"@buoy-gg/shared-ui/web";import{jsx as Ma}from"react/jsx-runtime";var Ta=["mmkv","async","secure"],Ns=({activeStorageTypes:e=new Set(Ta),onStorageTypesChange:t,counts:r})=>{let{scrollProps:a,onTouchStart:o,isTap:n}=$s(),i=(l,s)=>{if(n(s)&&t){let u=new Set(e);u.has(l)?u.delete(l):u.add(l),t(u)}};return Ma(Vs,{scrollProps:a,sentryLabel:"ignore devtools storage status count scroll",children:Ta.map(l=>{let s=r?.[l]??0;return Ma(re,{label:jr(l),color:Vr(l),count:s,isActive:e.has(l),onPress:u=>i(l,u),onTouchStart:o,showLabel:true},l)})})},Us=Ns;import{night as _s,monoFont as Js}from"@buoy-gg/shared-ui/web";import{jsx as Aa,jsxs as Gs}from"react/jsx-runtime";function Ys({totalCount:e,filteredCount:t,onPress:r}){if(t===e)return null;let a=Aa(h,{style:Da.container,children:Gs(v,{testID:"buoy-rq-filter-badge",style:Da.text,children:["Showing ",t," of ",e]})});return r?Aa(N,{testID:"buoy-rq-filter-badge-button",accessibilityRole:"button",accessibilityLabel:`Showing ${t} of ${e}, open filters`,onPress:r,activeOpacity:.7,children:a}):a}var Da=T.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:2},text:{fontSize:9,color:_s.color.textTertiary,fontFamily:Js}});import{jsx as Ra,jsxs as Xs}from"react/jsx-runtime";function Qa({selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:a="",ignoredPatterns:o=new Set,includedPatterns:n=new Set,onFilterPress:i}){let l=n.size>0,s=o.size>0,u=vt(),c=mi(()=>{let d=u;return n.size>0&&(d=d.filter(f=>{if(!f?.queryKey)return false;let b=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return Array.from(n).some(y=>b.includes(y.toLowerCase()))})),o.size>0&&(d=d.filter(f=>{if(!f?.queryKey)return true;let b=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return!Array.from(o).some(y=>b.includes(y.toLowerCase()))})),d.length},[u,n,o]);return Xs(h,{style:Ia.queryListContainer,children:[(l||s)&&Ra(Ys,{totalCount:u.length,filteredCount:c,onPress:i}),Ra(Ur,{selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:a,ignoredPatterns:o,includedPatterns:n,emptyState:fi({subject:"queries",verb:"active",search:a,total:u.length,blocked:r?`No ${r} queries. Pick another status to see the rest.`:l?`No queries match your "include only" filters. ${n.size} pattern(s) active.`:s?`No queries match the current filters. ${o.size} pattern(s) excluded.`:void 0,waiting:{otto:"scanning",title:"No queries found",message:`No React Query queries are currently active.
1
+ "use client";var vr=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Jo=Object.getOwnPropertyNames;var Go=Object.prototype.hasOwnProperty;var Yo=(e,t)=>{for(var r in t)vr(e,r,{get:t[r],enumerable:true})},Sr=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Jo(t))!Go.call(e,o)&&o!==r&&vr(e,o,{get:()=>t[o],enumerable:!(a=_o(t,o))||a.enumerable});return e},Xo=(e,t,r)=>(Sr(e,t,"default"),r&&Sr(r,t,"default"));var bc=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import"@tanstack/react-query";import{QueryIcon as Cr}from"@buoy-gg/floating-tools-core/web";import{Wifi as xr}from"@buoy-gg/shared-ui/web";import{useCallback as Fe,useState as Ze,useEffect as Zo}from"react";import{useQueryClient as en}from"@tanstack/react-query";import{TickProvider as tn}from"@buoy-gg/shared-ui/web";import{useQueryClient as rn}from"@tanstack/react-query";import{JsModal as an,useSafeAreaInsets as on,ModalHeader as Lt,TabSelector as nn}from"@buoy-gg/shared-ui/web";import{useEffect as sn,useState as ln,useRef as un}from"react";import{useQueryClient as cn}from"@tanstack/react-query";function wr(e){let{query:t}=Bt(e);return t}function Bt(e){let t=cn(),[r,a]=ln({query:void 0,version:0}),o=un(void 0);return sn(()=>{if(!e){a({query:void 0,version:0}),o.current=void 0;return}let n=t.getQueryCache().find({queryKey:e,exact:true});a({query:n,version:0});let i=JSON.stringify(e);o.current=i;let l=t.getQueryCache().subscribe(s=>{(s.type==="updated"||s.type==="added"||s.type==="removed")&&"query"in s&&s.query&&JSON.stringify(s.query.queryKey)===o.current&&(s.type==="removed"?a({query:void 0,version:0}):a(u=>({query:s.query,version:u.version+1})))});return()=>l()},[t,e]),r}import{ModalHeader as Pe,TabSelector as qr,Search as dn,Filter as yn,Trash as hn,night as je}from"@buoy-gg/shared-ui/web";import{useState as fn,useRef as Mr,useEffect as mn}from"react";var Tr={};Yo(Tr,{AccessibilityInfo:()=>vn,ActivityIndicator:()=>li,Alert:()=>di,Animated:()=>Z,AppRegistry:()=>Cn,AppState:()=>xn,Appearance:()=>Sn,BackHandler:()=>wn,Button:()=>ui,CheckBox:()=>zn,Clipboard:()=>qn,DeviceEventEmitter:()=>Xn,Dimensions:()=>Ar,Easing:()=>Mn,FlatList:()=>Wt,I18nManager:()=>Tn,Image:()=>Kn,ImageBackground:()=>Ln,InteractionManager:()=>Dn,Keyboard:()=>An,KeyboardAvoidingView:()=>Bn,LayoutAnimation:()=>Rn,Linking:()=>Qn,LogBox:()=>Yn,Modal:()=>Rr,NativeEventEmitter:()=>In,NativeModules:()=>bn,PanResponder:()=>Ht,Picker:()=>Hn,PixelRatio:()=>En,Platform:()=>kn,Pressable:()=>Dr,ProgressBar:()=>Wn,RefreshControl:()=>jn,SafeAreaView:()=>Vn,ScrollView:()=>be,SectionList:()=>$n,Share:()=>Fn,StatusBar:()=>Nn,StyleSheet:()=>T,Switch:()=>si,Text:()=>v,TextInput:()=>oi,Touchable:()=>Un,TouchableHighlight:()=>ni,TouchableNativeFeedback:()=>_n,TouchableOpacity:()=>N,TouchableWithoutFeedback:()=>ii,UIManager:()=>Pn,Vibration:()=>On,View:()=>h,VirtualizedList:()=>Jn,YellowBox:()=>Gn,findNodeHandle:()=>ci,unstable_createElement:()=>pn,useColorScheme:()=>Zn,useLocaleContext:()=>ei,useWindowDimensions:()=>ti});Xo(Tr,gn);import*as gn from"react-native-web";import{unstable_createElement as pn,NativeModules as bn,AccessibilityInfo as vn,Animated as Z,Appearance as Sn,AppRegistry as Cn,AppState as xn,BackHandler as wn,Clipboard as qn,Dimensions as Ar,Easing as Mn,I18nManager as Tn,Keyboard as An,InteractionManager as Dn,LayoutAnimation as Rn,Linking as Qn,NativeEventEmitter as In,PanResponder as Ht,PixelRatio as En,Platform as kn,Share as Fn,StyleSheet as T,UIManager as Pn,Vibration as On,CheckBox as zn,FlatList as Wt,Image as Kn,ImageBackground as Ln,KeyboardAvoidingView as Bn,Picker as Hn,ProgressBar as Wn,RefreshControl as jn,SafeAreaView as Vn,SectionList as $n,StatusBar as Nn,Touchable as Un,TouchableNativeFeedback as _n,VirtualizedList as Jn,YellowBox as Gn,LogBox as Yn,DeviceEventEmitter as Xn,useColorScheme as Zn,useLocaleContext as ei,useWindowDimensions as ti}from"react-native-web";import*as V from"react-native-web";import{createElement as ri,forwardRef as ai}from"react";function $(e){let t=ai((a,o)=>{let{accessibilityState:n,accessibilityValue:i,...l}=a;for(let s of["busy","checked","disabled","expanded","selected"])n?.[s]!==void 0&&l[`aria-${s}`]===void 0&&(l[`aria-${s}`]=n[s]);for(let[s,u]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))i?.[s]!==void 0&&l[`aria-${u}`]===void 0&&(l[`aria-${u}`]=i[s]);return ri(e,{...l,ref:o})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var h=$(V.View),v=$(V.Text),oi=$(V.TextInput),N=$(V.TouchableOpacity),ni=$(V.TouchableHighlight),ii=$(V.TouchableWithoutFeedback),Dr=$(V.Pressable),be=$(V.ScrollView),Rr=$(V.Modal),si=$(V.Switch),li=$(V.ActivityIndicator),ui=$(V.Button),ci=V.findNodeHandle,di={alert(e,t,r,a){if(typeof document>"u")return;let o=document.createElement("dialog");o.dataset.buoyRoot="",o.setAttribute("aria-label",e),o.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",o.appendChild(n),t){let u=document.createElement("p");u.textContent=t,u.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",o.appendChild(u)}let i=document.createElement("div");i.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let l=r?.length?r:[{text:"OK"}],s=()=>{o.close?.(),o.remove()};for(let u of l){let c=document.createElement("button");c.type="button",c.textContent=u.text??"OK",c.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,c.onclick=()=>{s(),u.onPress?.()},i.appendChild(c)}o.addEventListener("cancel",u=>{u.preventDefault(),a?.cancelable!==false&&(s(),a?.onDismiss?.())}),o.appendChild(i),document.body.appendChild(o),o.showModal?o.showModal():o.setAttribute("open","")}};import{Wifi as Qr}from"@buoy-gg/shared-ui/web";import{useEffect as Ir,useState as yi,useRef as hi}from"react";import{onlineManager as mt}from"@tanstack/react-query";import{devToolsStorageKeys as Er,persistentStorage as kr}from"@buoy-gg/shared-ui/web";function Fr(){let[e,t]=yi(()=>mt.isOnline()),r=hi(false);Ir(()=>{if(r.current)return;(async()=>{try{let n=await kr.getItem(Er.settings.wifiEnabled());if(n!==null){let i=n==="true";t(i),mt.setOnline(i)}r.current=true}catch{}})()},[]);let a=async n=>{try{await kr.setItem(Er.settings.wifiEnabled(),n.toString())}catch{}},o=()=>{let n=!e;t(n),mt.setOnline(n),a(n)};return Ir(()=>mt.subscribe(n=>{t(n),r.current&&a(n)}),[]),{isOnline:e,handleWifiToggle:o}}import{jsx as jt}from"react/jsx-runtime";function Pr({size:e=16,testID:t}){let{isOnline:r,handleWifiToggle:a}=Fr();return jt(N,{"sentry-label":`ignore toggle WiFi ${r?"On":"Off"}`,testID:t,accessibilityRole:"button",accessibilityLabel:`WiFi ${r?"On":"Off"}`,accessibilityHint:`Tap to turn WiFi ${r?"off":"on"} for React Query`,onPress:a,hitSlop:{top:10,bottom:10,left:10,right:10},activeOpacity:.7,style:{alignItems:"center",justifyContent:"center",width:14,flexShrink:0},children:r?jt(Qr,{size:e,color:"#10B981"}):jt(Qr,{size:e,color:"#DC2626"})})}import{jsx as B,jsxs as gt}from"react/jsx-runtime";function et({selectedQuery:e,selectedMutation:t,activeTab:r,onTabChange:a,onBack:o,searchText:n="",onSearchChange:i,onFilterPress:l,hasActiveFilters:s=false,onClearCache:u,showWifiToggle:c=false}){let[d,f]=fn(false),b=Mr(false),y=Mr(null);mn(()=>{d&&y.current&&y.current.focus()},[d]);let m=()=>{f(!d),d&&i&&i("")},p=C=>{i&&i(C)},g=C=>C?.queryKey&&(Array.isArray(C.queryKey)?C.queryKey:[C.queryKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||"Unknown Query",S=C=>"queryKey"in C?g(C):C.options.mutationKey?(Array.isArray(C.options.mutationKey)?C.options.mutationKey:[C.options.mutationKey]).filter(q=>q!=null).map(q=>String(q)).join(" \u203A ")||`Mutation #${C.mutationId}`:`Mutation #${C.mutationId}`,w=[{key:"queries",label:"Queries"},{key:"mutations",label:"Mutations"}];return e||t?gt(Pe,{children:[B(Pe.Navigation,{onBack:o}),B(Pe.Content,{title:S(e??t),testID:"buoy-rq-detail-title"})]}):gt(Pe,{children:[B(Pe.Content,{title:"",noMargin:true,children:d?B(Pe.Search,{value:n,onChangeText:p,onCancel:()=>{p(""),f(false)},onDismiss:()=>f(false),dismissOnBlur:true,clearOnlyWhenText:true,placeholder:"Search query keys...",accessibilityLabel:"Search queries and mutations",iconSize:14,testID:"buoy-rq-search",containerTestID:"buoy-rq-search-field",clearTestID:"buoy-rq-search-clear",inputProps:{"sentry-label":"ignore react query search header"}}):c?gt(h,{style:Oe.tabRow,children:[B(h,{style:Oe.tabSelectorWrap,children:B(qr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>a(C)})}),B(Pr,{size:16,testID:"buoy-rq-wifi"})]}):B(qr,{tabs:w,activeTab:r,testIDPrefix:"buoy-rq-tab",onTabChange:C=>a(C)})}),gt(Pe.Actions,{children:[B(N,{"sentry-label":"ignore open search",testID:"buoy-rq-search-open",accessibilityRole:"button",accessibilityLabel:"Search queries and mutations",onPress:m,style:Oe.headerActionButton,children:B(dn,{size:14,color:je.color.textSecondary})}),l&&B(N,{"sentry-label":"ignore open filter",testID:"buoy-rq-filters",accessibilityRole:"button",accessibilityLabel:s?"Filters, active":"Filters",onPress:l,style:[Oe.headerActionButton,s&&Oe.activeFilterButton],children:B(yn,{size:14,color:s?je.color.accent:je.color.textSecondary})}),u&&B(N,{"sentry-label":"ignore clear cache",testID:"buoy-rq-clear-cache",accessibilityRole:"button",onPress:u,style:[Oe.headerActionButton,Oe.clearCacheButton],accessibilityLabel:`Clear ${r} cache`,children:B(hn,{size:14,color:je.color.warning})})]})]})}var Oe=T.create({tabRow:{flex:1,flexDirection:"row",alignItems:"center",gap:12},tabSelectorWrap:{flex:1},headerActionButton:{padding:6,borderRadius:4},activeFilterButton:{backgroundColor:je.color.accentSoft},clearCacheButton:{backgroundColor:je.color.warningSoft}});import{resolveListEmptyState as fi}from"@buoy-gg/shared-ui/web";import{useMemo as mi}from"react";import{useMemo as gi}from"react";import{useQueryClient as pi}from"@tanstack/react-query";var Ve=(e,t,r)=>{if(t.length===0)return r;if(e instanceof Map){let a=new Map(e);if(t.length===1)return a.set(t[0],r),a;let[o,...n]=t,i=a.get(o);return a.set(o,Ve(i??null,n,r)),a}if(e instanceof Set){let a=Ve(Array.from(e),t,r);return new Set(Array.isArray(a)?a:[])}if(Array.isArray(e)){let a=[...e];if(t.length===1)return a[t[0]]=r,a;let[o,...n]=t;return a[o]=Ve(a[o],n,r),a}if(e instanceof Object){let a={...e};if(t.length===1)return a[t[0]]=r,a;let[o,...n]=t;return a[o]=Ve(a[o],n,r),a}return e};var $e=(e,t)=>{if(e instanceof Map){let r=new Map(e);if(t.length===1)return r.delete(t[0]),r;let[a,...o]=t;return r.set(a,$e(r.get(a),o)),r}if(e instanceof Set){let r=$e(Array.from(e),t);return new Set(r)}if(Array.isArray(e)){let r=[...e];if(t.length===1)return r.filter((n,i)=>i.toString()!==t[0]);let[a,...o]=t;return r[a]=$e(r[a],o),r}if(e instanceof Object){let r={...e};if(t.length===1)return delete r[t[0]],r;let[a,...o]=t;return r[a]=$e(r[a],o),r}return e};function Or({activeQuery:e,dataPath:t,queryClient:r}){if(!t)return;let a=e.state.data,o=$e(a,t),n=JSON.parse(JSON.stringify(o));r.setQueryData(e.queryKey,n)}function zr(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Kr(e){return(Array.isArray(e)?e:[e]).filter(t=>t!=null).map(zr).filter(Boolean).join("-")||"unkeyed"}function bi(e){return`buoy-rq-query-row-${Kr(e)}`}function vi(e,t){return e==null?`buoy-rq-mutation-row-id-${t}`:`buoy-rq-mutation-row-${Kr(e)}`}function Si(e){return e.length===0?"buoy-rq-explorer-root":`buoy-rq-explorer-${e.map(zr).filter(Boolean).join("-")}`}import{LiveExplorer as Ci}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as xi}from"react/jsx-runtime";function me({editable:e,label:t,value:r,defaultExpanded:a,activeQuery:o,dataPath:n,itemsDeletable:i,dataVersion:l=0}){let s=pi(),u=gi(()=>{if(o)return{update:(c,d)=>{let f=o.state.data,b=Ve(f,c,d);s.setQueryData(o.queryKey,b)},remove:c=>{Or({queryClient:s,activeQuery:o,dataPath:c})}}},[s,o]);return xi(Ci,{editable:e,label:t,value:r,defaultExpanded:a,writer:u,dataPath:n,itemsDeletable:i,dataVersion:l,testIDForPath:Si,debounceMs:0})}import{useMemo as wi,useCallback as qi}from"react";import{memo as Mi}from"react";function se(e){return e.isDisabled()?"disabled":e.state.fetchStatus==="fetching"?"fetching":e.state.status==="error"?"error":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}import{CompactRow as Ti,buoyColors as ve,useRelativeTime as Ai}from"@buoy-gg/shared-ui/web";import{jsx as Di}from"react/jsx-runtime";var Ri=e=>e?.queryKey&&(Array.isArray(e.queryKey)?e.queryKey:[e.queryKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Query",Qi=Mi(function({query:e,isSelected:t,onSelect:r}){let a=b=>{switch(b){case"disabled":return ve.textMuted+"80";case"error":return ve.error;case"fresh":return ve.success;case"stale":return ve.warning;case"inactive":return ve.textMuted;case"fetching":return ve.primary;case"paused":return ve.textMuted;default:return ve.textSecondary}},o=se(e),n=e.getObserversCount(),i=e.isDisabled(),l=Ri(e),s=(()=>{if(i)return null;if(e.state.dataUpdatedAt&&e.state.dataUpdatedAt>0)return e.state.dataUpdatedAt;let b=e.state;return b.fetchedAt&&b.fetchedAt>0?b.fetchedAt:null})(),u=Ai(s),c=i?"Disabled":u||(e.state.dataUpdatedAt===0?"Not fetched":`N/A (${e.state.dataUpdatedAt||0})`),d=bi(e.queryKey),f=`${n} observer${n!==1?"s":""}`;return Di(Ti,{testID:d,statusTestID:`${d}-status`,statusSublabelTestID:`${d}-observers`,accessibilityLabel:`${l}, ${o}, ${f}`,statusDotColor:a(o),statusLabel:o.charAt(0).toUpperCase()+o.slice(1),statusSublabel:f,primaryText:l,bottomRightText:c,badgeText:n,badgeColor:a(o),isSelected:t,onPress:()=>r(e)})}),Lr=Qi;import{useEffect as Ii,useState as Ei,useRef as Br,useMemo as ki,useCallback as Hr}from"react";import{useQueryClient as Fi}from"@tanstack/react-query";import{buoyColors as pt}from"@buoy-gg/shared-ui/web";var le={base:()=>["#storage"],mmkv:{root:()=>[...le.base(),"mmkv"],key:e=>[...le.mmkv.root(),e],all:()=>[...le.mmkv.root(),"all"]},async:{root:()=>[...le.base(),"async"],key:e=>[...le.async.root(),e],all:()=>[...le.async.root(),"all"]},secure:{root:()=>[...le.base(),"secure"],key:e=>[...le.secure.root(),e],all:()=>[...le.secure.root(),"all"]}};function Se(e){return!Array.isArray(e)||e.length===0?false:e[0]==="#storage"}function Wr(e){if(!Se(e)||e.length<2)return null;let t=e[1];return t==="mmkv"||t==="async"||t==="secure"?t:null}function jr(e){switch(e){case"mmkv":return"MMKV";case"async":return"Async";case"secure":return"Secure";default:return e}}function Vr(e){switch(e){case"mmkv":return"purple";case"async":return"blue";case"secure":return"green";default:return"gray"}}function Pi(e){switch(e){case"mmkv":return pt.primary;case"async":return pt.warning;case"secure":return pt.success;default:return pt.textMuted}}function $r(e){return!Se(e)||e.length<3?"Unknown Storage Key":e.slice(2).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Unknown Storage Key"}var bt=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,Oi=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,Nr=(e,t)=>bt(e)===bt(t)?Oi(e,t):bt(e)>bt(t)?1:-1;function zi(){let e=Fi(),[t,r]=Ei(()=>e.getQueryCache().getAll().filter(l=>!Se(l.queryKey)).sort(Nr)),a=Br(new Map),o=Br(void 0),n=Hr(l=>{let s=a.current;if(l.length!==s.size)return true;for(let u of l){let c=s.get(u.queryHash);if(!c||c.dataUpdatedAt!==u.state.dataUpdatedAt||c.errorUpdatedAt!==u.state.errorUpdatedAt||c.fetchStatus!==u.state.fetchStatus||c.status!==u.state.status||c.isInvalidated!==u.state.isInvalidated)return true}return false},[]),i=Hr(()=>{let l=e.getQueryCache().getAll().filter(s=>!Se(s.queryKey));if(n(l)){let s=new Map;l.forEach(c=>{s.set(c.queryHash,c.state)}),a.current=s;let u=[...l].sort(Nr);r(u)}},[e,n]);return Ii(()=>{i();let l=e.getQueryCache().subscribe(s=>{if(s.type==="added"||s.type==="removed"||s.type==="updated"){if("query"in s&&s.query&&Se(s.query.queryKey))return;o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{i()},10)}});return()=>{l(),o.current&&clearTimeout(o.current)}},[e,i]),ki(()=>t,[t])}var vt=zi;import{night as Vt,ToolEmptyState as Ki,EVENT_LIST_PRESET as Li,monoFont as Bi}from"@buoy-gg/shared-ui/web";import{jsx as $t}from"react/jsx-runtime";function Ur({selectedQuery:e,onQuerySelect:t,activeFilter:r,emptyStateMessage:a,emptyState:o,contentContainerStyle:n,queries:i,searchText:l="",ignoredPatterns:s=new Set,includedPatterns:u=new Set}){let c=vt(),d=i??c,f=wi(()=>{let y=d;if(r&&(y=y.filter(m=>se(m)===r)),l){let m=l.toLowerCase();y=y.filter(p=>p?.queryKey?(Array.isArray(p.queryKey)?p.queryKey:[p.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase().includes(m):false)}return u.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return Array.from(u).some(g=>p.includes(g.toLowerCase()))})),s.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return!Array.from(s).some(g=>p.includes(g.toLowerCase()))})),y.sort((m,p)=>{let g=m.state.dataUpdatedAt||0;return(p.state.dataUpdatedAt||0)-g}),y},[d,r,l,u,s]),b=qi(y=>{if(e?.queryHash===y.queryHash){t(void 0);return}t(y)},[e?.queryHash,t]);return f.length===0?$t(Ki,{testID:"buoy-rq-empty",...o??{otto:"empty",title:"No queries found",message:a||(r?`No ${r} queries found`:"No queries found")}}):$t(Wt,{testID:"buoy-rq-query-list",style:_r.listWrapper,contentContainerStyle:n||_r.listContent,data:f,keyExtractor:Hi,renderItem:({item:y})=>$t(Lr,{query:y,stateSig:Wi(y),isSelected:e?.queryHash===y.queryHash,onSelect:b}),showsVerticalScrollIndicator:true,...Li})}var Hi=e=>e.queryHash;function Wi(e){let t=0,r=false;try{t=e.getObserversCount(),r=e.isStale()}catch{}return`${e.state.dataUpdatedAt}|${e.state.fetchStatus}|${e.state.status}|${t}|${r}`}var _r=T.create({listWrapper:{flexGrow:1},listContent:{paddingBottom:16,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Vt.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Vt.color.border},emptyText:{color:Vt.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Bi,letterSpacing:.5}});import{buoyColors as D,monoFont as ji}from"@buoy-gg/shared-ui/web";import{jsx as Jr}from"react/jsx-runtime";var Vi={fresh:D.success+"15",stale:D.warning+"15",fetching:D.primary+"15",paused:D.textMuted+"1A",noObserver:D.textMuted+"1A",error:D.error+"15",inactive:D.textMuted+"1A"},$i={fresh:D.success+"33",stale:D.warning+"33",fetching:D.primary+"33",paused:D.textMuted+"33",noObserver:D.textMuted+"33",error:D.error+"33",inactive:D.textMuted+"33"},Ni={fresh:D.success,stale:D.warning,fetching:D.primary,paused:D.textMuted,noObserver:D.textMuted,error:D.error,inactive:D.textMuted};function Gr({query:e,testID:t}){let r=se(e),a=Vi[r],o=$i[r],n=Ni[r];return Jr(h,{style:[Yr.container,{backgroundColor:a,borderColor:o}],children:Jr(v,{testID:t,style:[Yr.text,{color:n}],children:r})})}var Yr=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:ji}});import{displayValue as Ui,night as U,monoFont as St}from"@buoy-gg/shared-ui/web";import{jsx as Ce,jsxs as Ct}from"react/jsx-runtime";function Nt({query:e}){if(e===void 0)return null;let t=new Date(e.state.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});return Ct(h,{style:ee.minWidth,children:[Ce(v,{style:ee.headerText,children:"Query Details"}),Ct(h,{style:ee.row,children:[Ce(be,{"sentry-label":"ignore devtools query details scroll",horizontal:true,style:ee.flexOne,children:Ce(v,{testID:"buoy-rq-detail-key",style:ee.queryKeyText,children:Ui(e.queryKey,true)})}),Ce(Gr,{query:e,testID:"buoy-rq-detail-status"})]}),Ct(h,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Observers:"}),Ce(v,{testID:"buoy-rq-detail-observers",style:ee.valueText,children:`${e.getObserversCount()}`})]}),Ct(h,{style:ee.row,children:[Ce(v,{style:ee.labelText,children:"Last Updated:"}),Ce(v,{testID:"buoy-rq-detail-updated",style:ee.valueText,children:`${t}`})]})]})}var ee=T.create({minWidth:{minWidth:200,backgroundColor:U.color.surface,borderRadius:6,borderWidth:1,borderColor:U.color.accent+"4D",overflow:"hidden",shadowColor:U.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:U.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:U.color.accent,borderBottomWidth:1,borderBottomColor:U.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:St},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:U.color.separator},flexOne:{flex:1,marginRight:8},queryKeyText:{fontSize:12,color:U.color.text,fontFamily:St,lineHeight:18,flexShrink:1,backgroundColor:U.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:U.color.accent+"4D"},labelText:{fontSize:10,color:U.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:St},valueText:{fontSize:12,color:U.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:St}});import{useQueryClient as _i}from"@tanstack/react-query";import{night as R}from"@buoy-gg/shared-ui/web";import{jsx as Xr,jsxs as Ji}from"react/jsx-runtime";var Gi={refetch:{dotColor:R.color.accent,textColor:R.color.text,borderColor:R.color.border},invalidate:{dotColor:R.color.warning,textColor:R.color.text,borderColor:R.color.border},reset:{dotColor:R.color.textSecondary,textColor:R.color.text,borderColor:R.color.border},remove:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"},triggerLoading:{dotColor:R.color.info,textColor:R.color.info,borderColor:R.color.info+"40"},triggerError:{dotColor:R.color.danger,textColor:R.color.danger,borderColor:R.color.danger+"40"}};function ue({onClick:e,text:t,variant:r,disabled:a,testID:o}){let n=Gi[r];return Ji(N,{"sentry-label":"ignore devtools action button",testID:o,disabled:a,onPress:e,style:[Ut.button,{borderColor:a?R.color.border:n.borderColor,opacity:a?.4:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:a},children:[Xr(h,{style:[Ut.dot,{backgroundColor:a?R.color.textTertiary:n.dotColor}]}),Xr(v,{style:[Ut.text,{color:a?R.color.textTertiary:n.textColor}],children:t})]})}var Ut=T.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:4,borderWidth:1,paddingHorizontal:8,paddingVertical:4,backgroundColor:"transparent"},dot:{width:6,height:6,borderRadius:3,marginRight:6},text:{fontSize:12,fontWeight:"500"}});var Yi="@tanstack/query-devtools-event";function xe(e,t){try{let r=globalThis;if(typeof r.dispatchEvent!="function"||typeof r.CustomEvent!="function")return;r.dispatchEvent(new r.CustomEvent(Yi,{detail:{type:e,queryHash:t},bubbles:true,cancelable:true}))}catch{}}function _t({query:e}){if(e.state.data===void 0){xe("RESTORE_LOADING",e.queryHash);let t=e.state,r=e.state.fetchMeta?e.state.fetchMeta.__previousQueryOptions:null;e.cancel({silent:true}),e.setState({...t,fetchStatus:"idle",fetchMeta:null}),r&&e.fetch(r)}else{xe("TRIGGER_LOADING",e.queryHash);let t=e.options;e.fetch({...t,queryFn:()=>new Promise(()=>{}),gcTime:-1}),e.setState({data:void 0,status:"pending",fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:t}})}}function Jt({query:e}){xe("REFETCH",e.queryHash),e.fetch().catch(()=>{})}function Zr({query:e,queryClient:t}){xe("RESET",e.queryHash),t.resetQueries({queryKey:e.queryKey,exact:true})}function ea({query:e,queryClient:t}){xe("REMOVE",e.queryHash),t.removeQueries(e)}function ta({query:e,queryClient:t}){xe("INVALIDATE",e.queryHash),t.invalidateQueries(e)}function Gt({query:e,queryClient:t}){if(e.state.status!=="error"){xe("TRIGGER_ERROR",e.queryHash);let r=new Error("Unknown error from devtools"),a=e.options;e.setState({status:"error",error:r,fetchMeta:{...e.state.fetchMeta,__previousQueryOptions:a}})}else xe("RESTORE_ERROR",e.queryHash),t.resetQueries(e)}import{night as Xi}from"@buoy-gg/shared-ui/web";import{jsx as we,jsxs as tt}from"react/jsx-runtime";function ra({query:e,setSelectedQuery:t}){let r=_i();if(e===void 0)return null;let a=e.state.status,o=se(e)==="fetching";return tt(h,{style:ze.container,children:[tt(h,{style:ze.section,children:[we(v,{style:ze.sectionLabel,children:"Actions"}),tt(h,{style:ze.buttonsRow,children:[we(ue,{disabled:o,onClick:()=>Jt({query:e}),variant:"refetch",text:"Refetch"}),we(ue,{disabled:a==="pending",onClick:()=>ta({query:e,queryClient:r}),variant:"invalidate",text:"Invalidate"}),we(ue,{disabled:a==="pending",onClick:()=>Zr({queryClient:r,query:e}),variant:"reset",text:"Reset"}),we(ue,{disabled:o,onClick:()=>{ea({queryClient:r,query:e}),t(void 0)},variant:"remove",text:"Remove"})]})]}),tt(h,{style:ze.section,children:[we(v,{style:ze.sectionLabel,children:"Triggers"}),tt(h,{style:ze.buttonsRow,children:[we(ue,{disabled:false,onClick:()=>_t({query:e}),variant:"triggerLoading",text:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading"}),we(ue,{disabled:a==="pending",onClick:()=>Gt({query:e,queryClient:r}),variant:"triggerError",text:a==="error"?"Restore Error":"Trigger Error"})]})]})]})}var ze=T.create({container:{gap:16},section:{gap:8},sectionLabel:{fontSize:11,fontWeight:"600",color:Xi.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},buttonsRow:{flexDirection:"row",flexWrap:"wrap",gap:8}});import{night as Yt}from"@buoy-gg/shared-ui/web";import{jsx as ce,jsxs as Xt}from"react/jsx-runtime";function Zi({selectedQuery:e,setSelectedQuery:t}){return Xt(be,{"sentry-label":"ignore devtools query info scroll",style:de.flexOne,contentContainerStyle:de.scrollContent,children:[ce(h,{style:de.section,children:ce(Nt,{query:e})}),ce(h,{style:de.section,children:ce(ra,{query:e,setSelectedQuery:t})}),Xt(h,{style:de.section,children:[ce(v,{style:de.headerText,children:"Data Explorer"}),ce(h,{style:de.contentView,children:ce(me,{editable:true,label:"Data",value:e?.state.data,defaultExpanded:["Data"],activeQuery:e})})]}),Xt(h,{style:de.section,children:[ce(v,{style:de.headerText,children:"Query Explorer"}),ce(h,{style:de.contentView,children:ce(me,{label:"Query",value:e,defaultExpanded:["Query","queryKey"],activeQuery:e})})]})]})}var de=T.create({flexOne:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},headerText:{fontSize:16,fontWeight:"600",color:Yt.color.text,marginBottom:8,textAlign:"left"},contentView:{backgroundColor:Yt.color.surface,borderRadius:12,borderWidth:1,borderColor:Yt.color.border,padding:16}});import{buoyColors as F,night as te}from"@buoy-gg/shared-ui/web";import{jsx as Zt,jsxs as es}from"react/jsx-runtime";var ts=({label:e,color:t,count:r,showLabel:a=true,isActive:o=false,onPress:n,onTouchStart:i,size:l="default",testID:s})=>{let u=l==="large",c=(d=>{let f={green:{bg:F.success+"15",border:F.success+"40",dot:F.success,text:F.success},yellow:{bg:F.warning+"15",border:F.warning+"40",dot:F.warning,text:F.warning},blue:{bg:F.primary+"15",border:F.primary+"40",dot:F.primary,text:F.primary},purple:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary},red:{bg:F.error+"15",border:F.error+"40",dot:F.error,text:F.error},gray:{bg:te.color.fillSecondary,border:te.color.fillTertiary,dot:te.color.textTertiary,text:te.color.textTertiary}};return f[d]||f.gray})(t);return es(N,{"sentry-label":"ignore devtools query status",testID:s,accessibilityRole:"button",accessibilityLabel:`${e}, ${r}${o?", selected":""}`,accessibilityState:{selected:o},style:[qe.queryStatusTag,u&&qe.queryStatusTagLarge,o&&{backgroundColor:c.bg,borderColor:c.border}],disabled:!n,onPress:n,onPressIn:i,activeOpacity:.7,children:[Zt(h,{style:[qe.dot,u&&qe.dotLarge,{backgroundColor:c.dot}]}),a&&Zt(v,{style:[qe.label,u&&qe.labelLarge,o&&{color:c.text}],numberOfLines:1,ellipsizeMode:"tail",children:e}),r>0&&Zt(v,{testID:s?`${s}-count`:void 0,style:[qe.count,u&&qe.countLarge,{color:c.dot}],numberOfLines:1,children:r})]})},qe=T.create({queryStatusTag:{flexDirection:"row",alignItems:"center",backgroundColor:te.color.buttonSurface,borderRadius:13,paddingHorizontal:10,paddingVertical:5,height:26,gap:6,borderWidth:1,borderColor:te.color.border},queryStatusTagLarge:{borderRadius:16,paddingHorizontal:13,paddingVertical:6,height:32,gap:7},dot:{width:6,height:6,borderRadius:3},dotLarge:{width:8,height:8,borderRadius:4},label:{fontSize:11,fontWeight:"500",color:te.color.textSecondary,fontFamily:"system"},labelLarge:{fontSize:13,fontWeight:"600",letterSpacing:.2,fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},count:{fontSize:11,fontVariant:["tabular-nums"],fontWeight:"600",marginLeft:"auto",fontFamily:"system"},countLarge:{fontSize:13,fontWeight:"700",fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),re=ts;import{ChipStrip as rs,useChipTap as as}from"@buoy-gg/shared-ui/web";import{useEffect as aa,useState as oa}from"react";import{useQueryClient as na}from"@tanstack/react-query";function os(){let e=na(),[t,r]=oa({fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});return aa(()=>{let a=()=>{let n=e.getQueryCache().getAll().reduce((i,l)=>{let s=se(l);return i[s]=(i[s]||0)+1,i},{fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0,disabled:0});setTimeout(()=>r(n),0)};a();let o=e.getQueryCache().subscribe(a);return()=>o()},[e]),t}var ia=os;function ns(){let e=na(),[t,r]=oa({pending:0,success:0,error:0,paused:0,idle:0});return aa(()=>{let a=()=>{let n=e.getMutationCache().getAll().reduce((i,l)=>{let s=l.state.status;if(l.state.isPaused)i.paused++;else switch(s){case"idle":i.idle++;break;case"pending":i.pending++;break;case"success":i.success++;break;case"error":i.error++;break}return i},{pending:0,success:0,error:0,paused:0,idle:0});setTimeout(()=>r(n),0)};a();let o=e.getMutationCache().subscribe(a);return()=>o()},[e]),t}import{jsx as rt,jsxs as is}from"react/jsx-runtime";var ss=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{fresh:a,stale:o,fetching:n,paused:i,inactive:l}=ia(),{scrollProps:s,onTouchStart:u,isTap:c}=as(),d=(f,b)=>{c(b)&&t&&t(e===f?null:f)};return is(rs,{scrollProps:s,sentryLabel:"ignore devtools query status count scroll",children:[rt(re,{label:"Fresh",color:"green",count:a,isActive:e==="fresh",onPress:f=>d("fresh",f),onTouchStart:u,testID:"buoy-rq-status-fresh",showLabel:true,size:r}),rt(re,{label:"Loading",color:"blue",count:n,isActive:e==="fetching",onPress:f=>d("fetching",f),onTouchStart:u,testID:"buoy-rq-status-fetching",showLabel:true,size:r}),rt(re,{label:"Paused",color:"purple",count:i,isActive:e==="paused",onPress:f=>d("paused",f),onTouchStart:u,testID:"buoy-rq-status-paused",showLabel:true,size:r}),rt(re,{label:"Stale",color:"yellow",count:o,isActive:e==="stale",onPress:f=>d("stale",f),onTouchStart:u,testID:"buoy-rq-status-stale",showLabel:true,size:r}),rt(re,{label:"Idle",color:"gray",count:l,isActive:e==="inactive",onPress:f=>d("inactive",f),onTouchStart:u,testID:"buoy-rq-status-inactive",showLabel:true,size:r})]})},sa=ss;import{useState as ls,useRef as er,useMemo as us,useCallback as cs}from"react";import{QueryIcon as ds,CheckCircle as ys,Activity as hs,Pause as fs,XCircle as ms,buoyColors as xt}from"@buoy-gg/shared-ui/web";import{jsx as at}from"react/jsx-runtime";function gs({size:e=24}){return at(ds,{size:e})}function ps({size:e=14,color:t=xt.success,strokeWidth:r=2}){return at(ys,{size:e,color:t,strokeWidth:r})}function bs({size:e=14,color:t=xt.warning,strokeWidth:r=2}){return at(hs,{size:e,color:t,strokeWidth:r})}function vs({size:e=14,color:t=xt.textMuted,strokeWidth:r=2}){return at(fs,{size:e,color:t,strokeWidth:r})}function Ss({size:e=14,color:t=xt.error,strokeWidth:r=2}){return at(ms,{size:e,color:t,strokeWidth:r})}import{buoyColors as ot,night as Ke,useRelativeTime as Cs,monoFont as la}from"@buoy-gg/shared-ui/web";import{jsx as ae,jsxs as wt}from"react/jsx-runtime";var xs=e=>e.options.mutationKey&&(Array.isArray(e.options.mutationKey)?e.options.mutationKey:[e.options.mutationKey]).filter(t=>t!=null).map(t=>String(t)).join(" \u203A ")||"Anonymous Mutation";function ua({mutation:e,setSelectedMutation:t,selected:r}){let a=new Date(e.state.submittedAt).toLocaleTimeString(),o=(()=>{if(e.state.submittedAt&&e.state.submittedAt>0)return e.state.submittedAt;let u=e.state;return u.updatedAt&&u.updatedAt>0?u.updatedAt:null})(),n=Cs(o)||`N/A (${e.state.submittedAt||0})`,i=(()=>{if(e.state.isPaused)return{status:"Paused",color:ot.textMuted,icon:ae(vs,{})};switch(e.state.status){case"success":return{status:"Success",color:ot.success,icon:ae(ps,{})};case"error":return{status:"Error",color:ot.error,icon:ae(Ss,{})};case"pending":return{status:"Loading",color:ot.primary,icon:ae(bs,{})};default:return{status:"Idle",color:ot.textMuted,icon:null}}})(),l=xs(e),s=vi(e.options.mutationKey,e.mutationId);return wt(N,{"sentry-label":"ignore devtools mutation button",testID:s,accessibilityRole:"button",accessibilityLabel:`${l}, ${i.status}`,onPress:()=>t(e===r?void 0:e),style:[_.button,r?.mutationId===e.mutationId&&_.selected],children:[wt(h,{style:_.rowContent,children:[wt(h,{style:_.statusSection,children:[ae(h,{style:[_.statusDot,{backgroundColor:i.color}]}),wt(h,{style:_.statusInfo,children:[ae(v,{testID:`${s}-status`,style:[_.statusLabel,{color:i.color}],children:i.status}),ae(v,{style:_.submittedText,children:a})]})]}),ae(h,{style:_.mutationSection,children:ae(v,{testID:`${s}-key`,style:_.mutationKey,children:l})})]}),ae(h,{style:_.bottomRightContainer,children:ae(v,{style:_.bottomRightText,children:n})})]})}var _=T.create({button:{backgroundColor:Ke.color.surface,borderRadius:8,borderWidth:1,borderColor:Ke.color.border,marginHorizontal:8,marginVertical:3,padding:12},selected:{backgroundColor:Ke.color.accentSoft,borderColor:Ke.color.accentBorderStrong},rowContent:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},statusSection:{flexDirection:"row",alignItems:"center",gap:8,flex:1},statusDot:{width:8,height:8,borderRadius:4},statusInfo:{flex:1},statusLabel:{fontSize:11,fontWeight:"600",lineHeight:14},submittedText:{fontSize:10,color:Ke.color.textTertiary,marginTop:1},mutationSection:{flex:2,paddingHorizontal:12},mutationKey:{fontFamily:la,fontSize:12,color:Ke.color.text,lineHeight:16},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:Ke.color.textTertiary,fontFamily:la}});import{displayValue as ws,night as J,monoFont as qt}from"@buoy-gg/shared-ui/web";import{buoyColors as G,monoFont as qs}from"@buoy-gg/shared-ui/web";import{jsx as ca}from"react/jsx-runtime";var Ms={success:G.success+"15",error:G.error+"15",pending:G.primary+"15",idle:G.textMuted+"1A"},Ts={success:G.success+"33",error:G.error+"33",pending:G.primary+"33",idle:G.textMuted+"33"},As={success:G.success,error:G.error,pending:G.primary,idle:G.textMuted};function da({status:e,testID:t}){let r=e,a=Ms[r],o=Ts[r],n=As[r];return ca(h,{style:[ya.container,{backgroundColor:a,borderColor:o}],children:ca(v,{testID:t,style:[ya.text,{color:n}],children:e})})}var ya=T.create({container:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},text:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:qs}});import{jsx as Ne,jsxs as tr}from"react/jsx-runtime";function rr({selectedMutation:e}){if(e===void 0)return null;let t=new Date(e.state.submittedAt).toLocaleTimeString();return tr(h,{style:Me.minWidth,children:[Ne(v,{style:Me.headerText,children:"Mutation Details"}),tr(h,{style:Me.row,children:[Ne(be,{"sentry-label":"ignore devtools mutation details scroll",horizontal:true,style:Me.flex1,children:Ne(v,{testID:"buoy-rq-mutation-detail-key",style:Me.flexWrap,children:`${e.options.mutationKey?ws(e.options.mutationKey,true):"No mutationKey found"}`})}),Ne(da,{status:e.state.status,testID:"buoy-rq-mutation-detail-status"})]}),tr(h,{style:Me.row,children:[Ne(v,{style:Me.labelText,children:"Submitted At:"}),Ne(v,{style:Me.valueText,children:t})]})]})}var Me=T.create({minWidth:{minWidth:200,backgroundColor:J.color.surface,borderRadius:6,borderWidth:1,borderColor:J.color.accent+"4D",overflow:"hidden",shadowColor:J.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},headerText:{backgroundColor:J.color.accent+"15",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:J.color.accent,borderBottomWidth:1,borderBottomColor:J.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:qt},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:J.color.separator},flex1:{flex:1,marginRight:8},flexWrap:{fontSize:12,color:J.color.text,fontFamily:qt,lineHeight:18,flexShrink:1,backgroundColor:J.color.accent+"15",paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:J.color.accent+"4D"},labelText:{fontSize:10,color:J.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:qt},valueText:{fontSize:12,color:J.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:qt}});import{night as nt,monoFont as Ds}from"@buoy-gg/shared-ui/web";import{jsx as H,jsxs as it}from"react/jsx-runtime";function ha({selectedMutation:e}){return it(be,{"sentry-label":"ignore devtools mutation information scroll",style:O.flex1,contentContainerStyle:O.scrollContent,children:[H(h,{style:O.section,children:H(rr,{selectedMutation:e})}),it(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Variables Details"}),H(h,{style:O.padding,children:H(me,{label:"Variables",value:e?.state.variables,defaultExpanded:["Variables"]})})]}),it(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Context Details"}),H(h,{style:O.padding,children:H(me,{label:"Context",value:e?.state.context,defaultExpanded:["Context"]})})]}),it(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Data Explorer"}),H(h,{style:O.padding,children:H(me,{label:"Data",defaultExpanded:["Data"],value:e?.state.data})})]}),it(h,{style:O.section,children:[H(v,{style:O.textHeader,children:"Mutations Explorer"}),H(h,{style:O.padding,children:H(me,{label:"Mutation",defaultExpanded:["Mutation"],value:e})})]})]})}var O=T.create({flex1:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingBottom:16,paddingHorizontal:8},section:{marginBottom:16},textHeader:{textAlign:"left",backgroundColor:nt.color.accent+"15",padding:12,fontSize:12,fontWeight:"700",color:nt.color.accent,borderTopLeftRadius:8,borderTopRightRadius:8,borderBottomWidth:1,borderBottomColor:nt.color.accent+"33",fontFamily:Ds,letterSpacing:1,textTransform:"uppercase"},padding:{padding:12,backgroundColor:nt.color.surface,borderBottomLeftRadius:8,borderBottomRightRadius:8,borderWidth:1,borderColor:nt.color.border,borderTopWidth:0}});import{useCallback as fa,useEffect as Rs,useRef as ma,useState as Qs}from"react";import{useQueryClient as Is}from"@tanstack/react-query";function Es(){let e=Is(),[t,r]=Qs(()=>e.getMutationCache().getAll()),a=ma(new Map),o=ma(void 0),n=fa(l=>{let s=a.current;if(l.length!==s.size)return true;for(let u of l){let c=s.get(u.mutationId);if(!c||c.status!==u.state.status||c.submittedAt!==u.state.submittedAt||c.isPaused!==u.state.isPaused)return true}return false},[]),i=fa(()=>{let l=e.getMutationCache().getAll();if(n(l)){let s=new Map;l.forEach(u=>{s.set(u.mutationId,u.state)}),a.current=s,r(l)}},[e,n]);return Rs(()=>{i();let l=e.getMutationCache().subscribe(s=>{(s.type==="added"||s.type==="removed"||s.type==="updated")&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{i()},10))});return()=>{l(),o.current&&clearTimeout(o.current)}},[e,i]),{mutations:t}}var ga=Es;import{night as Le,ToolEmptyState as ks,monoFont as Fs}from"@buoy-gg/shared-ui/web";import{jsx as Te,jsxs as pa}from"react/jsx-runtime";function ba({selectedMutation:e,setSelectedMutation:t,activeFilter:r,hideInfoPanel:a=false,contentContainerStyle:o,searchText:n=""}){let{mutations:i}=ga(),l=S=>S.state.isPaused?"paused":S.state.status,s=us(()=>{let S=i;if(r&&(S=S.filter(w=>l(w)===r)),n){let w=n.toLowerCase();S=S.filter(C=>{let q=C.options.mutationKey;return q?(Array.isArray(q)?q:[q]).filter(A=>A!=null).map(A=>String(A)).join(" ").toLowerCase().includes(w):false})}return S},[i,r,n]),u=Ar.get("window").height,c=u*.4,d=150,f=u*.7,b=er(new Z.Value(c)).current,[,y]=ls(c),m=er(c),p=er(Ht.create({onMoveShouldSetPanResponder:(S,w)=>Math.abs(w.dy)>Math.abs(w.dx)&&Math.abs(w.dy)>10,onPanResponderGrant:()=>{b.stopAnimation(S=>{y(S),m.current=S,b.setValue(S)})},onPanResponderMove:(S,w)=>{let C=m.current-w.dy,q=Math.max(d,Math.min(f,C));b.setValue(q)},onPanResponderRelease:(S,w)=>{let C=Math.max(d,Math.min(f,m.current-w.dy));y(C),m.current=C,Z.timing(b,{toValue:C,duration:200,useNativeDriver:false}).start(()=>{b.setValue(C),y(C),m.current=C})}})).current,g=cs(({item:S})=>Te(ua,{selected:e,setSelectedMutation:t,mutation:S}),[e,t]);return pa(h,{style:Be.container,children:[s.length>0?Te(h,{style:Be.listWrapper,children:Te(Wt,{"sentry-label":"ignore devtools mutations list",testID:"buoy-rq-mutation-list",data:s,renderItem:g,keyExtractor:(S,w)=>`${S.mutationId}-${S.state.submittedAt}-${S.state.status}-${w}`,inverted:true,showsVerticalScrollIndicator:true,removeClippedSubviews:!(typeof process<"u"&&process.env?.EXPO_PUBLIC_E2E),contentContainerStyle:o||Be.listContent,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})}):Te(ks,{testID:"buoy-rq-mutations-empty",otto:r?"filtering":"scanning",title:"No mutations found",message:r?`No ${r} mutations. Pick another status to see the rest.`:"Mutations run through useMutation will appear here."}),e&&!a&&pa(Z.View,{style:[Be.mutationInfo,{height:b}],children:[Te(h,{style:Be.dragHandle,...p.panHandlers,children:Te(h,{style:Be.dragIndicator})}),Te(h,{style:Be.mutationInfoContent,children:Te(ha,{selectedMutation:e})})]})]})}var Be=T.create({container:{flex:1,backgroundColor:"transparent"},listWrapper:{flex:1},listContent:{backgroundColor:"transparent",paddingHorizontal:8,paddingTop:8},mutationInfo:{borderTopWidth:1,borderTopColor:Le.color.border,backgroundColor:"transparent"},dragHandle:{height:20,justifyContent:"center",alignItems:"center",backgroundColor:Le.color.surface,borderBottomWidth:1,borderBottomColor:Le.color.border},dragIndicator:{width:40,height:4,backgroundColor:Le.color.placeholder,borderRadius:2},mutationInfoContent:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",padding:32,backgroundColor:Le.color.surface,margin:16,borderRadius:8,borderWidth:1,borderColor:Le.color.border},emptyText:{color:Le.color.textTertiary,fontSize:14,textAlign:"center",fontFamily:Fs,letterSpacing:.5}});import{ChipStrip as Ps,useChipTap as Os}from"@buoy-gg/shared-ui/web";import{jsx as Mt,jsxs as zs}from"react/jsx-runtime";var Ks=({activeFilter:e,onFilterChange:t,size:r="default"})=>{let{pending:a,success:o,error:n,paused:i}=ns(),{scrollProps:l,onTouchStart:s,isTap:u}=Os(),c=(d,f)=>{u(f)&&t&&t(e===d?null:d)};return zs(Ps,{scrollProps:l,sentryLabel:"ignore devtools mutation status count scroll",children:[Mt(re,{label:"Pending",color:"blue",count:a,isActive:e==="pending",onPress:d=>c("pending",d),onTouchStart:s,testID:"buoy-rq-mstatus-pending",showLabel:true,size:r}),Mt(re,{label:"Success",color:"green",count:o,isActive:e==="success",onPress:d=>c("success",d),onTouchStart:s,testID:"buoy-rq-mstatus-success",showLabel:true,size:r}),Mt(re,{label:"Error",color:"red",count:n,isActive:e==="error",onPress:d=>c("error",d),onTouchStart:s,testID:"buoy-rq-mstatus-error",showLabel:true,size:r}),Mt(re,{label:"Paused",color:"purple",count:i,isActive:e==="paused",onPress:d=>c("paused",d),onTouchStart:s,testID:"buoy-rq-mstatus-paused",showLabel:true,size:r})]})},va=Ks;import{Trash as Ls,night as Ue}from"@buoy-gg/shared-ui/web";import{jsx as Sa}from"react/jsx-runtime";var Bs=({type:e,onClear:t,disabled:r=false})=>Sa(N,{"sentry-label":"ignore devtools clear cache button",style:[Ca.button,r&&Ca.disabledButton],onPress:t,disabled:r,activeOpacity:.7,accessibilityLabel:`Clear ${e} cache`,accessibilityRole:"button",accessibilityState:{disabled:r},children:Sa(Ls,{size:16,strokeWidth:2,color:r?Ue.color.textTertiary:Ue.color.warning})}),Ca=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:Ue.color.warningSoft,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:Ue.color.warning+"33"},disabledButton:{opacity:.5,backgroundColor:Ue.color.fill,borderColor:Ue.color.border}}),Hs=Bs;import{Wifi as xa,buoyColors as wa}from"@buoy-gg/shared-ui/web";import{jsx as ar}from"react/jsx-runtime";var Ws=({isOffline:e,onToggle:t})=>ar(N,{"sentry-label":"ignore devtools network toggle button",style:[qa.button,e&&qa.offlineButton],onPress:t,activeOpacity:.7,accessibilityLabel:e?"Unset offline mocking behavior":"Mock offline behavior",accessibilityRole:"button",accessibilityState:{selected:e},children:e?ar(xa,{size:16,color:wa.error,strokeWidth:2}):ar(xa,{size:16,color:wa.success,strokeWidth:2})}),qa=T.create({button:{width:32,height:32,borderRadius:6,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:"rgba(16, 185, 129, 0.2)"},offlineButton:{backgroundColor:"rgba(239, 68, 68, 0.1)",borderColor:"rgba(239, 68, 68, 0.2)"}}),js=Ws;import{ChipStrip as Vs,useChipTap as $s}from"@buoy-gg/shared-ui/web";import{jsx as Ma}from"react/jsx-runtime";var Ta=["mmkv","async","secure"],Ns=({activeStorageTypes:e=new Set(Ta),onStorageTypesChange:t,counts:r})=>{let{scrollProps:a,onTouchStart:o,isTap:n}=$s(),i=(l,s)=>{if(n(s)&&t){let u=new Set(e);u.has(l)?u.delete(l):u.add(l),t(u)}};return Ma(Vs,{scrollProps:a,sentryLabel:"ignore devtools storage status count scroll",children:Ta.map(l=>{let s=r?.[l]??0;return Ma(re,{label:jr(l),color:Vr(l),count:s,isActive:e.has(l),onPress:u=>i(l,u),onTouchStart:o,showLabel:true},l)})})},Us=Ns;import{night as _s,monoFont as Js}from"@buoy-gg/shared-ui/web";import{jsx as Aa,jsxs as Gs}from"react/jsx-runtime";function Ys({totalCount:e,filteredCount:t,onPress:r}){if(t===e)return null;let a=Aa(h,{style:Da.container,children:Gs(v,{testID:"buoy-rq-filter-badge",style:Da.text,children:["Showing ",t," of ",e]})});return r?Aa(N,{testID:"buoy-rq-filter-badge-button",accessibilityRole:"button",accessibilityLabel:`Showing ${t} of ${e}, open filters`,onPress:r,activeOpacity:.7,children:a}):a}var Da=T.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:2},text:{fontSize:9,color:_s.color.textTertiary,fontFamily:Js}});import{jsx as Ra,jsxs as Xs}from"react/jsx-runtime";function Qa({selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:a="",ignoredPatterns:o=new Set,includedPatterns:n=new Set,onFilterPress:i}){let l=n.size>0,s=o.size>0,u=vt(),c=mi(()=>{let d=u;return n.size>0&&(d=d.filter(f=>{if(!f?.queryKey)return false;let b=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return Array.from(n).some(y=>b.includes(y.toLowerCase()))})),o.size>0&&(d=d.filter(f=>{if(!f?.queryKey)return true;let b=(Array.isArray(f.queryKey)?f.queryKey:[f.queryKey]).filter(y=>y!=null).map(y=>String(y)).join(" ").toLowerCase();return!Array.from(o).some(y=>b.includes(y.toLowerCase()))})),d.length},[u,n,o]);return Xs(h,{style:Ia.queryListContainer,children:[(l||s)&&Ra(Ys,{totalCount:u.length,filteredCount:c,onPress:i}),Ra(Ur,{selectedQuery:e,onQuerySelect:t,activeFilter:r,searchText:a,ignoredPatterns:o,includedPatterns:n,emptyState:fi({subject:"queries",verb:"active",search:a,total:u.length,blocked:r?`No ${r} queries. Pick another status to see the rest.`:l?`No queries match your "include only" filters. ${n.size} pattern(s) active.`:s?`No queries match the current filters. ${o.size} pattern(s) excluded.`:void 0,waiting:{otto:"scanning",title:"No queries found",message:`No React Query queries are currently active.
2
2
 
3
3
  To see queries here:
4
4
  \u2022 Make API calls using useQuery
5
5
  \u2022 Ensure queries are within QueryClientProvider
6
- \u2022 Check console for debugging info`}}),contentContainerStyle:Ia.queryListContent})]})}var Ia=T.create({queryListContainer:{flex:1,backgroundColor:"transparent"},queryListContent:{padding:8,backgroundColor:"transparent",flexGrow:1}});import{ToolFooter as Zs,useSafeAreaInsets as el}from"@buoy-gg/shared-ui/web";import{jsx as or}from"react/jsx-runtime";function ka({activeFilter:e,onFilterChange:t,isFloatingMode:r=true,size:a="default"}){let o=el({minBottom:16});return or(Zs,{floating:r,safeArea:false,paddingBottom:r?0:o.bottom,style:Ea.filterFooter,children:or(h,{style:Ea.filterContainer,children:or(sa,{activeFilter:e,onFilterChange:t,size:a})})})}var Ea=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{useCallback as tl,useMemo as st}from"react";import{DynamicFilterView as rl,buoyColors as Ae,monoFont as al,night as nr}from"@buoy-gg/shared-ui/web";import{XCircle as Fa,Clock as ir,RefreshCw as ol,Globe as nl,Zap as il,Filter as sl,Eye as ll}from"@buoy-gg/shared-ui/web";import{jsx as sr}from"react/jsx-runtime";var ul=()=>false;function cl({queries:e,activeFilter:t,onFilterChange:r,ignoredPatterns:a,onPatternToggle:o,includedPatterns:n,onIncludedPatternToggle:i,isTeamPattern:l=ul}){let s=tl(y=>l(y)?sr(h,{accessibilityLabel:"Set by your team on buoy.gg",style:[Pa.teamBadge,{borderColor:`${nr.color.accent}60`,backgroundColor:`${nr.color.accent}15`}],children:sr(v,{style:[Pa.teamBadgeText,{color:nr.color.accent}],children:"TEAM"})}):null,[l]),u=st(()=>{let y={all:e.length,disabled:0,fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0};return e.forEach(m=>{let p=se(m);p==="disabled"?y.disabled++:p==="error"?y.error++:p==="fresh"?y.fresh++:p==="stale"?y.stale++:p==="fetching"?y.fetching++:p==="paused"?y.paused++:p==="inactive"&&y.inactive++}),y},[e]),c=st(()=>{let y=new Set;return e.forEach(m=>{if(!m?.queryKey)return;(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).forEach(p=>{if(p!=null){let g=String(p);/^\d+$/.test(g)||y.add(g)}})}),Array.from(y).sort().slice(0,50)},[e]),d=st(()=>c,[c]),f=st(()=>{let y=e;return n.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return Array.from(n).some(g=>p.includes(g.toLowerCase()))})),a.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return!Array.from(a).some(g=>p.includes(g.toLowerCase()))})),y.length},[e,n,a]),b=st(()=>({filterSummarySection:{enabled:true,totalCount:e.length,filteredCount:f,includePatterns:n,excludePatterns:a},sections:[{id:"status",title:"Status",type:"status",data:[{id:"status::all",label:"All",count:u.all,icon:nl,color:Ae.primary,isActive:!t||t==="all"},{id:"status::disabled",label:"Disabled",count:u.disabled,icon:Fa,color:Ae.textMuted,isActive:t==="disabled"},{id:"status::fresh",label:"Fresh",count:u.fresh,icon:il,color:Ae.success,isActive:t==="fresh"},{id:"status::stale",label:"Stale",count:u.stale,icon:ir,color:Ae.warning,isActive:t==="stale"},{id:"status::fetching",label:"Fetching",count:u.fetching,icon:ol,color:Ae.primary,isActive:t==="fetching"},{id:"status::paused",label:"Paused",count:u.paused,icon:ir,color:Ae.textMuted,isActive:t==="paused"},{id:"status::inactive",label:"Inactive",count:u.inactive,icon:ir,color:Ae.textSecondary,isActive:t==="inactive"},{id:"status::error",label:"Error",count:u.error,icon:Fa,color:Ae.error,isActive:t==="error"}]}],addFilterSection:{enabled:true,placeholder:"Enter pattern to exclude...",title:"EXCLUDE FILTERS",icon:sl},includeOnlySection:{enabled:true,title:"INCLUDE ONLY FILTERS",description:"Show ONLY queries matching these patterns. All non-matching queries will be hidden.",placeholder:"Enter pattern to include...",icon:ll,patterns:n,onPatternToggle:i,onPatternAdd:i,renderPatternMeta:s},availableItemsSection:{enabled:true,title:"AVAILABLE QUERY KEYS",emptyMessage:"No queries found. Query keys will appear here once queries are active.",items:d},howItWorksSection:{enabled:true,title:"HOW QUERY FILTERS WORK",description:"There are two types of query key filters:",examples:["","INCLUDE ONLY (green):","\u2022 Shows ONLY queries matching the pattern","\u2022 Example: 'rewards' \u2192 shows only reward queries","\u2022 When active, non-matching queries are hidden","","EXCLUDE (blue):","\u2022 Hides queries matching the pattern","\u2022 Example: 'analytics' \u2192 hides analytics queries","","Filters are case-insensitive and match partial keys."]},activePatterns:a,renderPatternMeta:s}),[u,t,a,n,d,i,e.length,f,s]);return sr(rl,{...b,onFilterChange:y=>{let[m,p]=y.split("::");m==="status"?r(p==="all"||t===p?null:p):m==="suggestion"&&o(p)},onPatternToggle:o,onPatternAdd:o})}var Pa=T.create({teamBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:6,borderWidth:1},teamBadgeText:{fontSize:9,fontFamily:al,fontWeight:"700",letterSpacing:.5}});import{useState as lt,useCallback as ut,useEffect as Tt,useMemo as za,useRef as Oa}from"react";import{devToolsStorageKeys as De,persistentStorage as At,useTeamList as Ka}from"@buoy-gg/shared-ui/web";import{jsx as ge,jsxs as dl}from"react/jsx-runtime";function La({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:a,onMinimize:o,activeFilter:n,onFilterChange:i,enableSharedModalDimensions:l=false,onTabChange:s,searchText:u="",onSearchChange:c}){let d=rn(),f=wr(t),b=vt(),y=ut(()=>{d.getQueryCache().clear()},[d]),[m,p]=lt(null),g=n??m,S=i??p,[w,C]=lt(false),[q,A]=lt(new Set),[j,Ee]=lt(new Set),M=Oa(null),oe=Oa(null);Tt(()=>{(async()=>{try{let x=await At.getItem(De.reactQuery.ignoredPatterns());if(x){let Q=JSON.parse(x);Array.isArray(Q)&&(M.current=JSON.stringify(Array.from(new Set(Q))),A(new Set(Q)))}}catch(x){console.error("Failed to load ignored patterns:",x)}finally{M.current??(M.current="[]")}})()},[]),Tt(()=>{(async()=>{try{let x=await At.getItem(De.reactQuery.includedPatterns());if(x){let Q=JSON.parse(x);Array.isArray(Q)&&(oe.current=JSON.stringify(Array.from(new Set(Q))),Ee(new Set(Q)))}}catch(x){console.error("Failed to load included patterns:",x)}finally{oe.current??(oe.current="[]")}})()},[]),Tt(()=>{let x=JSON.stringify(Array.from(q));if(M.current===null||M.current===x)return;M.current=x,(async()=>{try{await At.setItem(De.reactQuery.ignoredPatterns(),x)}catch(Q){console.error("Failed to save ignored patterns:",Q)}})()},[q]),Tt(()=>{let x=JSON.stringify(Array.from(j));if(oe.current===null||oe.current===x)return;oe.current=x,(async()=>{try{await At.setItem(De.reactQuery.includedPatterns(),x)}catch(Q){console.error("Failed to save included patterns:",Q)}})()},[j]);let ye=Ka(De.reactQuery.ignoredPatterns()),he=Ka(De.reactQuery.includedPatterns()),ne=za(()=>ye.length?new Set([...q,...ye]):q,[q,ye]),ie=za(()=>he.length?new Set([...j,...he]):j,[j,he]),yt=ut(x=>ye.includes(x)&&!q.has(x)||he.includes(x)&&!j.has(x),[ye,he,q,j]),ht=ut(x=>{A(Q=>{if(!Q.has(x)&&ye.includes(x))return Q;let fe=new Set(Q);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[ye]),Kt=ut(x=>{Ee(Q=>{if(!Q.has(x)&&he.includes(x))return Q;let fe=new Set(Q);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[he]),[ft,Ho]=lt("bottomSheet"),Wo=l?De.reactQuery.modal():De.reactQuery.browserModal(),jo=ut(x=>{Ho(x)},[]),Vo=on({minBottom:16}),$o=ft==="floating"?56:48+Vo.bottom;if(!e)return null;let No=()=>{if(w){let x=[{key:"filters",label:"Filters"}];return dl(Lt,{children:[ge(Lt.Navigation,{onBack:()=>C(false)}),ge(Lt.Content,{title:"",noMargin:true,children:ge(nn,{tabs:x,activeTab:"filters",testIDPrefix:"buoy-rq-filterview-tab",onTabChange:()=>{}})})]})}return ge(et,{selectedQuery:f,activeTab:"queries",onTabChange:s,onBack:()=>r(void 0),searchText:u,onSearchChange:c,onFilterPress:()=>C(true),hasActiveFilters:g!==null||ne.size>0||ie.size>0,onClearCache:y})},Uo=ge(ka,{activeFilter:g,onFilterChange:S,isFloatingMode:ft==="floating"});return ge(an,{visible:e,onClose:a,onMinimize:o,persistenceKey:Wo,header:{customContent:No(),showToggleButton:true},onModeChange:jo,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:!w,styles:{},footer:w?void 0:Uo,footerHeight:w?void 0:$o,children:ge(h,{style:yl.container,children:w?ge(cl,{queries:b,activeFilter:g,onFilterChange:S,ignoredPatterns:ne,onPatternToggle:ht,includedPatterns:ie,onIncludedPatternToggle:Kt,isTeamPattern:yt}):ge(Qa,{selectedQuery:f,onQuerySelect:r,activeFilter:g,searchText:u,ignoredPatterns:ne,includedPatterns:ie,onFilterPress:()=>C(true)})})})}var yl=T.create({container:{flex:1,backgroundColor:"transparent"}});import{JsModal as hl,devToolsStorageKeys as Ba,useSafeAreaInsets as fl}from"@buoy-gg/shared-ui/web";import{useQueryClient as Ha}from"@tanstack/react-query";import{useSafeAreaInsets as Wa,night as O,monoFont as ja}from"@buoy-gg/shared-ui/web";import{useMemo as ml}from"react";function lr(e,t,r){return ml(()=>{let a=e.state.status;return[{label:"Refetch",variant:"refetch",disabled:se(e)==="fetching",onPress:()=>Jt({query:e})},{label:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading",variant:"triggerLoading",disabled:false,onPress:()=>_t({query:e})},{label:a==="error"?"Restore Error":"Trigger Error",variant:"triggerError",disabled:a==="pending",onPress:()=>Gt({query:e,queryClient:t})}]},[e,t,r])}import{DataViewer as gl}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as pl,jsx as I,jsxs as _e}from"react/jsx-runtime";function Va({selectedQuery:e,isFloatingMode:t,disableInternalFooter:r=false,queryVersion:a}){let o=Wa({minBottom:16}),n=Ha(),i=lr(e,n,a);return _e(pl,{children:[_e(be,{testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:k.explorerScrollContainer,contentContainerStyle:[k.explorerScrollContent,!r&&{paddingBottom:72}],children:[_e(h,{style:k.section,children:[I(vl,{visible:!!e.state.data,selectedQuery:e,queryVersion:a}),I(Sl,{visible:!e.state.data,selectedQuery:e})]}),I(h,{style:k.section,children:I(Nt,{query:e})}),I(h,{style:k.section,children:_e(h,{style:k.queryExplorerContainer,children:[I(v,{testID:"buoy-rq-query-explorer-header",style:k.queryExplorerHeader,children:"Query Explorer"}),I(h,{style:k.queryExplorerContent,children:I(gl,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&I(h,{style:[k.actionFooter,{paddingBottom:t?0:o.bottom+8}],children:I(h,{style:k.actionsRow,children:i.map((l,s)=>I(ue,{testID:`buoy-rq-action-${l.variant}`,onClick:l.onPress,text:l.label,variant:l.variant,disabled:l.disabled},s))})})]})}function bl({selectedQuery:e,isFloatingMode:t,queryVersion:r}){let a=Wa({minBottom:16}),o=Ha(),n=lr(e,o,r);return I(h,{style:[k.actionFooter,{paddingBottom:t?0:a.bottom+8}],children:I(h,{style:k.actionsRow,children:n.map((i,l)=>I(ue,{testID:`buoy-rq-action-${i.variant}`,onClick:i.onPress,text:i.label,variant:i.variant,disabled:i.disabled},l))})})}function vl({visible:e,selectedQuery:t,queryVersion:r=0}){return e?_e(h,{style:k.dataContainer,children:[I(v,{testID:"buoy-rq-data-header",style:k.dataHeader,children:"Data Editor"}),I(h,{style:k.dataContent,children:I(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"],activeQuery:t,dataVersion:r})})]}):null}function Sl({visible:e,selectedQuery:t}){if(!e)return null;let r=()=>t.isDisabled()?{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}:t.state.status==="pending"||se(t)==="fetching"?{title:t.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}:t.state.status==="error"?{title:"Query Error",description:t.state.error?.message||"An error occurred while fetching data."}:{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."},{title:a,description:o}=r();return _e(h,{style:k.emptyState,children:[I(v,{testID:"buoy-rq-detail-empty-title",style:k.emptyTitle,children:a}),I(v,{testID:"buoy-rq-detail-empty-description",style:k.emptyDescription,children:o})]})}var k=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:O.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:O.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:O.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:O.color.surface,borderRadius:6,borderWidth:1,borderColor:O.color.accent+"4D",overflow:"hidden",shadowColor:O.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:O.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:O.color.accent,borderBottomWidth:1,borderBottomColor:O.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ja},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:O.color.surface,borderRadius:6,borderWidth:1,borderColor:O.color.accent+"4D",overflow:"hidden",shadowColor:O.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:O.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:O.color.accent,borderBottomWidth:1,borderBottomColor:O.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ja},dataContent:{padding:8}});import{useState as Cl,useCallback as xl,useEffect as wl,useRef as ql}from"react";import{jsx as Dt}from"react/jsx-runtime";function $a({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:a,onMinimize:o,enableSharedModalDimensions:n=false,onTabChange:i}){let{query:l,version:s}=Bt(t),[u,c]=Cl("bottomSheet"),d=t?JSON.stringify(t):void 0,f=ql(void 0);wl(()=>{if(l){f.current=d;return}e&&f.current!==void 0&&f.current===d&&(f.current=void 0,r(void 0))},[e,l,d,r]);let b=xl(w=>{c(w)},[]),y=fl({minBottom:16}),m=u==="floating"?72:80+y.bottom,p=()=>Dt(et,{selectedQuery:l,activeTab:"queries",onTabChange:i,onBack:()=>r(void 0)}),g=n?Ba.reactQuery.modal():`${Ba.reactQuery.modal()}_data_editor`;if(!e||!l)return null;let S=Dt(bl,{selectedQuery:l,isFloatingMode:u==="floating",queryVersion:s},`footer-${s}`);return Dt(hl,{visible:e,onClose:a,onMinimize:o,persistenceKey:g,header:{customContent:p(),showToggleButton:true},onModeChange:b,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:S,footerHeight:m,children:Dt(Va,{selectedQuery:l,isFloatingMode:u==="floating",disableInternalFooter:true,queryVersion:s})})}import{useQueryClient as Ml}from"@tanstack/react-query";import{useCallback as ur,useState as Na,useRef as Ua}from"react";import{useEffect as Tl,useState as Al}from"react";import{useQueryClient as Dl}from"@tanstack/react-query";function cr(e){let t=Dl(),[r,a]=Al(void 0);return Tl(()=>{let o=()=>{if(e!==void 0){let i=t.getMutationCache().getAll().find(l=>l.mutationId===e);a(i)}else a(void 0)};setTimeout(o,0);let n=t.getMutationCache().subscribe(o);return()=>n()},[t,e]),r}import{jsx as _a}from"react/jsx-runtime";function Ja({selectedMutation:e,onMutationSelect:t,activeFilter:r,searchText:a=""}){let o=n=>{t(typeof n=="function"?n(e):n)};return _a(h,{style:Ga.mutationListContainer,children:_a(ba,{selectedMutation:e,setSelectedMutation:o,activeFilter:r,searchText:a,hideInfoPanel:true,contentContainerStyle:Ga.mutationListContent})})}var Ga=T.create({mutationListContainer:{flex:1,backgroundColor:"transparent"},mutationListContent:{padding:8,backgroundColor:"transparent"}});import{ToolFooter as Rl,useSafeAreaInsets as Ql}from"@buoy-gg/shared-ui/web";import{useMemo as Il}from"react";import{jsx as dr}from"react/jsx-runtime";function Ya({activeFilter:e,onFilterChange:t,modalMode:r,size:a="default"}){let o=r==="floating",n=Ql({minBottom:16}),i=Il(()=>o?0:n.bottom,[o,n.bottom]);return dr(Rl,{floating:o,safeArea:false,paddingBottom:i,style:Xa.filterFooter,children:dr(h,{style:Xa.filterContainer,children:dr(va,{activeFilter:e,onFilterChange:t,size:a})})},`footer-${o?"floating":"docked"}`)}var Xa=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{JsModal as kl,useSafeAreaInsets as El}from"@buoy-gg/shared-ui/web";import{absoluteFill as Fl}from"@buoy-gg/shared-ui/web";import{useMemo as W}from"react";import{ChevronLeft as Pl,ChevronRight as zl,night as Rt}from"@buoy-gg/shared-ui/web";import{jsx as Je,jsxs as Ol}from"react/jsx-runtime";var He=32,Za=6,eo=He,Kl=120,Qt=.95,to=1.15;function ro({translationX:e,maxTranslation:t=Kl,canSwipeLeft:r=true,canSwipeRight:a=true}){let o=W(()=>e.interpolate({inputRange:[0,t],outputRange:[0,1],extrapolate:"clamp"}),[e,t]),n=W(()=>o.interpolate({inputRange:[0,1],outputRange:[Za,eo]}),[o]),i=W(()=>o.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,to]}),[o]),l=W(()=>o.interpolate({inputRange:[0,.99,1],outputRange:[0,0,16]}),[o]),s=W(()=>o.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[o]),u=W(()=>o.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[o]),c=W(()=>o.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[o]),d=W(()=>e.interpolate({inputRange:[-t,0],outputRange:[1,0],extrapolate:"clamp"}),[e,t]),f=W(()=>d.interpolate({inputRange:[0,1],outputRange:[Za,eo]}),[d]),b=W(()=>d.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,to]}),[d]),y=W(()=>d.interpolate({inputRange:[0,.99,1],outputRange:[0,0,-16]}),[d]),m=W(()=>d.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[d]),p=W(()=>d.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[d]),g=W(()=>d.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[d]);return Ol(h,{style:yr.container,pointerEvents:"none",children:[a&&Je(Z.View,{style:[yr.leftWrapper,{width:n,height:He,borderRadius:He/2,backgroundColor:Rt.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:s,transform:[{scale:i},{translateX:l}]}],children:Je(Z.View,{style:{opacity:u,transform:[{scale:c}]},children:Je(Pl,{size:He*.6,color:Rt.color.accent,strokeWidth:3})})}),r&&Je(Z.View,{style:[yr.rightWrapper,{width:f,height:He,borderRadius:He/2,backgroundColor:Rt.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:m,transform:[{scale:b},{translateX:y}]}],children:Je(Z.View,{style:{opacity:p,transform:[{scale:g}]},children:Je(zl,{size:He*.6,color:Rt.color.accent,strokeWidth:3})})})]})}var yr=T.create({container:{...Fl,zIndex:1e3,justifyContent:"center",alignItems:"center"},leftWrapper:{position:"absolute",left:16},rightWrapper:{position:"absolute",right:16}});import{devToolsStorageKeys as ao}from"@buoy-gg/shared-ui/web";import{jsx as Ge,jsxs as Ll}from"react/jsx-runtime";function oo({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:a,onMinimize:o,activeFilter:n,onFilterChange:i,onTabChange:l,enableSharedModalDimensions:s=false,searchText:u="",onSearchChange:c}){let d=Ml(),f=cr(t),[b,y]=Na(null),m=n??b,p=i??y,g=ur(()=>{d.getMutationCache().clear(),r(void 0)},[d,r]),[S,w]=Na("bottomSheet"),C=s?ao.reactQuery.modal():ao.reactQuery.mutationModal(),q=Ua(new Z.Value(0)).current,A=ur(ne=>{ne==="right"&&l("queries")},[l]),j=ur(ne=>{w(ne)},[]),Ee=El({minBottom:16}),M=S==="floating"?56:48+Ee.bottom,oe=Ua(Ht.create({onStartShouldSetPanResponder:()=>false,onMoveShouldSetPanResponder:(ne,ie)=>Math.abs(ie.dx)>5&&Math.abs(ie.dy)<10,onPanResponderMove:(ne,ie)=>{q.setValue(ie.dx)},onPanResponderRelease:(ne,ie)=>{let{dx:yt,vx:ht}=ie,Kt=80,ft=.5;Z.spring(q,{toValue:0,useNativeDriver:true}).start(),(Math.abs(yt)>Kt||Math.abs(ht)>ft)&&(yt>0||ht>0?A("right"):A("left"))},onPanResponderTerminate:()=>{Z.spring(q,{toValue:0,useNativeDriver:true}).start()}})).current;if(!e)return null;let ye=()=>Ge(et,{selectedMutation:f,activeTab:"mutations",onTabChange:l,onBack:()=>r(void 0),searchText:u,onSearchChange:c,onClearCache:g}),he=Ge(Ya,{activeFilter:m,onFilterChange:p,modalMode:S});return Ge(kl,{visible:e,onClose:a,onMinimize:o,persistenceKey:C,header:{customContent:ye(),showToggleButton:true},onModeChange:j,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:he,footerHeight:M,children:Ge(h,{style:{flex:1},children:Ll(h,{...oe.panHandlers,style:{flex:1},children:[Ge(ro,{translationX:q,canSwipeLeft:false,canSwipeRight:true}),Ge(Ja,{selectedMutation:f,onMutationSelect:r,activeFilter:m,searchText:u})]})})})}import{JsModal as Bl,useSafeAreaInsets as Hl,devToolsStorageKeys as no}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Wl,night as K,monoFont as io}from"@buoy-gg/shared-ui/web";import{useMemo as jl}from"react";import{useQueryClient as Vl}from"@tanstack/react-query";function so(e){let t=Vl();return jl(()=>[{label:"Remove",variant:"remove",disabled:false,onPress:()=>t.getMutationCache().remove(e)}],[e,t])}import{DataViewer as $l}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Nl,jsx as E,jsxs as Ye}from"react/jsx-runtime";function lo({selectedMutation:e,isFloatingMode:t,disableInternalFooter:r=false}){return Ye(Nl,{children:[Ye(be,{testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:P.explorerScrollContainer,contentContainerStyle:P.explorerScrollContent,children:[Ye(h,{style:P.section,children:[E(Ul,{visible:!!e.state.data,selectedMutation:e}),E(_l,{visible:!e.state.data,selectedMutation:e})]}),E(h,{style:P.section,children:E(rr,{selectedMutation:e})}),E(h,{style:P.section,children:Ye(h,{style:P.mutationExplorerContainer,children:[E(v,{style:P.mutationExplorerHeader,children:"Mutation Explorer"}),E(h,{style:P.mutationExplorerContent,children:E($l,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&E(uo,{selectedMutation:e,isFloatingMode:t})]})}function uo({selectedMutation:e,isFloatingMode:t}){let r=Wl({minBottom:16}),a=so(e);return E(h,{style:[P.actionFooter,{paddingBottom:t?0:r.bottom+8}],children:E(h,{style:P.actionsGrid,children:a.map((o,n)=>E(ue,{testID:`buoy-rq-action-${o.variant}`,onClick:o.onPress,text:o.label,variant:o.variant,disabled:o.disabled},n))})})}function Ul({visible:e,selectedMutation:t}){return e?Ye(h,{style:P.dataContainer,children:[E(v,{style:P.dataHeader,children:"Data Editor"}),E(h,{style:P.dataContent,children:E(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"]},t.mutationId)})]}):null}function _l({visible:e,selectedMutation:t}){if(!e)return null;let r=()=>t.state.status==="pending"?{title:"Pending...",description:"The mutation is in progress."}:t.state.status==="error"?{title:"Mutation Error",description:t.state.error?.message||"An error occurred."}:{title:"No Data Available",description:"This mutation has no data."},{title:a,description:o}=r();return Ye(h,{style:P.emptyState,children:[E(v,{testID:"buoy-rq-mutation-detail-empty-title",style:P.emptyTitle,children:a}),E(v,{testID:"buoy-rq-mutation-detail-empty-description",style:P.emptyDescription,children:o})]})}var P=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:K.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:K.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:K.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:io},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:io},dataContent:{padding:8}});import{useState as Jl,useCallback as Gl,useEffect as Yl,useRef as Xl}from"react";import{jsx as It}from"react/jsx-runtime";function co({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:a,onMinimize:o,onTabChange:n,enableSharedModalDimensions:i=false}){let l=cr(t),[s,u]=Jl("bottomSheet"),c=Xl(void 0);Yl(()=>{if(l){c.current=l.mutationId;return}e&&c.current!==void 0&&c.current===t&&(c.current=void 0,r(void 0))},[e,l,t,r]);let d=Gl(g=>{u(g)},[]),f=Hl({minBottom:16}),b=s==="floating"?72:80+f.bottom,y=()=>It(et,{selectedMutation:l,activeTab:"mutations",onTabChange:n,onBack:()=>r(void 0)}),m=i?no.reactQuery.modal():no.reactQuery.mutationModal();if(!e||!l)return null;let p=It(uo,{selectedMutation:l,isFloatingMode:s==="floating"});return It(Bl,{visible:e,onClose:a,onMinimize:o,persistenceKey:m,header:{customContent:y(),showToggleButton:true},onModeChange:d,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:p,footerHeight:b,children:It(lo,{selectedMutation:l,isFloatingMode:s==="floating",disableInternalFooter:true})})}import{Fragment as Zl,jsx as kt,jsxs as eu}from"react/jsx-runtime";function yo({visible:e,selectedQueryKey:t,selectedMutationId:r,onQuerySelect:a,onMutationSelect:o,onClose:n,onMinimize:i,activeFilter:l,onFilterChange:s,activeTab:u,onTabChange:c,enableSharedModalDimensions:d=false,searchText:f="",onSearchChange:b}){let y=!!t||!!r,m=u==="queries",p=u==="mutations",g={onClose:n,onMinimize:i,activeFilter:l,onFilterChange:s,enableSharedModalDimensions:d},S=e&&!y&&m,w=e&&!y&&p,C=e&&y&&m&&!!t,q=e&&y&&p&&!!r;return eu(Zl,{children:[kt(La,{visible:S,selectedQueryKey:t,onQuerySelect:a,onTabChange:c,searchText:f,onSearchChange:b,...g}),kt(oo,{visible:w,selectedMutationId:r,onMutationSelect:o,onTabChange:c,searchText:f,onSearchChange:b,...g}),kt($a,{visible:C,selectedQueryKey:t,onQuerySelect:a,onTabChange:c,...g}),kt(co,{visible:q,selectedMutationId:r,onMutationSelect:o,onTabChange:c,...g})]})}import{ChangeLog as tu}from"@buoy-gg/shared-ui/web";var ru=0;function Re(){return`rq-${Date.now()}-${++ru}`}var au=class extends tu{constructor(){super({max:200});this.queryClient=null;this.queryUnsubscribe=null;this.mutationUnsubscribe=null;this.fetchStartTimes=new Map;this.mutationStartTimes=new Map;this.lastQueryStates=new Map;this.lastMutationStates=new Map}setQueryClient(e){this.disconnect(),this.queryClient=e,this.queryUnsubscribe=e.getQueryCache().subscribe(t=>{t.type==="updated"&&t.query&&this.handleQueryUpdate(t.query)}),this.mutationUnsubscribe=e.getMutationCache().subscribe(t=>{t.type==="updated"&&t.mutation&&this.handleMutationUpdate(t.mutation)})}disconnect(){this.queryUnsubscribe&&(this.queryUnsubscribe(),this.queryUnsubscribe=null),this.mutationUnsubscribe&&(this.mutationUnsubscribe(),this.mutationUnsubscribe=null),this.queryClient=null,this.lastQueryStates.clear(),this.lastMutationStates.clear(),this.fetchStartTimes.clear(),this.mutationStartTimes.clear()}handleQueryUpdate(e){if(Se(e.queryKey))return;let t=e.queryHash,r={fetchStatus:e.state.fetchStatus,status:e.state.status},a=this.lastQueryStates.get(t);if(!a)r.fetchStatus==="fetching"&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e}));else{let o=a.fetchStatus==="fetching",n=r.fetchStatus==="fetching";if(!o&&n&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})),o&&!n){let i=this.fetchStartTimes.get(t),l=i?Date.now()-i:void 0;this.fetchStartTimes.delete(t),r.status==="error"?this.addEvent({id:Re(),type:"query-fetch-error",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryError:e.state.error,duration:l,query:e}):this.addEvent({id:Re(),type:"query-fetch-success",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryData:e.state.data,duration:l,query:e})}!a.status&&e.state.isInvalidated&&this.addEvent({id:Re(),type:"query-invalidated",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})}this.lastQueryStates.set(t,r)}handleMutationUpdate(e){let t=e.mutationId,r=e.state.status,a=this.lastMutationStates.get(t);if(a!==r){if(r==="pending"&&a!=="pending")this.mutationStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"mutation-start",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutation:e});else if(r==="success"&&a==="pending"){let o=this.mutationStartTimes.get(t),n=o?Date.now()-o:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-success",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationData:e.state.data,duration:n,mutation:e})}else if(r==="error"&&a==="pending"){let o=this.mutationStartTimes.get(t),n=o?Date.now()-o:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-error",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationError:e.state.error,duration:n,mutation:e})}}this.lastMutationStates.set(t,r)}addEvent(e){this.record(e)}getEvents(){return this.items}subscribe(e){let t=super.subscribe(e);return e(this.items),t}clearEvents(){this.clear()}isConnected(){return this.queryClient!==null}},We=new au,ou=e=>We.setQueryClient(e),nu=()=>We.disconnect();import{jsx as ho}from"react/jsx-runtime";function hr({visible:e,onClose:t,onMinimize:r,enableSharedModalDimensions:a=true}){let o=en();Zo(()=>{We.isConnected()||We.setQueryClient(o)},[o]);let[n,i]=Ze(void 0),[l,s]=Ze(void 0),[u,c]=Ze(null),[d,f]=Ze("queries"),[b,y]=Ze(""),m=Fe(()=>{i(void 0),s(void 0),c(null),f("queries"),y("")},[]),p=Fe(()=>{m(),t()},[t,m]),g=Fe(A=>{i(A?.queryKey)},[]),S=Fe(A=>{s(A?.mutationId)},[]),w=Fe(A=>{c(A)},[]),C=Fe(A=>{f(A),c(null),i(void 0),s(void 0),y("")},[]),q=Fe(A=>{y(A)},[]);return e?ho(tn,{children:ho(yo,{visible:e,selectedQueryKey:n,selectedMutationId:l,onQuerySelect:g,onMutationSelect:S,onClose:p,onMinimize:r,activeFilter:u,onFilterChange:w,activeTab:d,onTabChange:C,searchText:b,onSearchChange:q,enableSharedModalDimensions:a})}):null}import{onlineManager as pe}from"@tanstack/react-query";import{devToolsStorageKeys as fo,persistentStorage as mo}from"@buoy-gg/shared-ui/web";import{useState as go,useEffect as po}from"react";import{jsx as Et}from"react/jsx-runtime";var bo=()=>null,vo=async e=>{try{await mo.setItem(fo.settings.wifiEnabled(),e.toString())}catch{}},iu=async()=>{try{let e=await mo.getItem(fo.settings.wifiEnabled());e!==null&&pe.setOnline(e==="true")}catch{}};iu();function su({size:e}){let[t,r]=go(()=>pe.isOnline());return po(()=>pe.subscribe(a=>{r(a)}),[]),Et(xr,{size:e,color:t?"#10B981":"#DC2626"})}var lu={id:"query",name:"QUERY",description:"React Query inspector",slot:"both",icon:({size:e})=>Et(Cr,{size:e}),component:hr,props:{enableSharedModalDimensions:false}};function uu(e){return{id:e?.id||"query",name:e?.name||"QUERY",description:e?.description||"React Query inspector",slot:"both",icon:({size:t})=>Et(Cr,{size:t}),component:hr,props:{enableSharedModalDimensions:e?.enableSharedModalDimensions!==void 0?e.enableSharedModalDimensions:false}}}var cu={id:"query-wifi-toggle",name:"WIFI",description:"Toggle React Query online/offline state",slot:"row",icon:su,component:bo,props:{},launchMode:"toggle-only",onPress:()=>{let e=!pe.isOnline();pe.setOnline(e),vo(e)}};function du(e){let t=e?.onColor||"#10B981",r=e?.offColor||"#DC2626",a=({size:o})=>{let[n,i]=go(()=>pe.isOnline());return po(()=>pe.subscribe(l=>{i(l)}),[]),Et(xr,{size:o,color:n?t:r})};return{id:e?.id||"query-wifi-toggle",name:e?.name||"WIFI",description:e?.description||"Toggle React Query online/offline state",slot:"row",icon:a,component:bo,props:{},launchMode:"toggle-only",onPress:()=>{let o=!pe.isOnline();pe.setOnline(o),vo(o)}}}import{expandKeyedArrays as yu,patchFromPath as hu,readPath as fu,refusalText as mu,shapeSummary as Ft,suggestedPatch as gu,typedEditViolations as pu,unshapedLists as bu}from"@buoy-gg/shared-ui/web";import{onlineManager as fr}from"@tanstack/react-query";import{isJsonSerializable as So,isOverWireBudget as Co}from"@buoy-gg/shared-ui/web";var vu=Object.freeze({__buoyDataOnDevice:true,note:"Query data stays on the device \u2014 fetched on demand via getQueryData."}),xo=Object.freeze({__buoyUnserializable:true,note:"Query data is not JSON-serializable (circular or bigint) and stayed on the device."}),Su=16*1024,wo=8*1024*1024;function Cu(e){return!!e&&typeof e=="object"&&e.__buoyDataOnDevice===true}function xu(e){return!!e&&typeof e=="object"&&e.__buoyUnserializable===true}function qo(e){return Cu(e)||xu(e)}function Qe(e){if(e!==void 0)return Co(e,Su)?So(e)?vu:xo:e}function Pt(e){if(e==null)return e;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,a=typeof t.message=="string"?t.message:void 0;if(r!==void 0||a!==void 0)return Qe({...r!==void 0?{name:r}:{},...a!==void 0?{message:a}:{}})}return Qe(e)}function wu(e){return Co(e,wo)?So(e)?{__buoyTruncated:true,note:`Exceeds the ${wo/(1024*1024)}MB detail limit \u2014 inspect it on-device.`}:xo:e}function qu(e){let t=e.getMutationCache().getAll().map(a=>Mu(a)),r=e.getQueryCache().getAll().map(a=>Au(a));return{mutations:t,queries:r}}function Mu(e){let t=e.state;return{mutationId:e.mutationId,mutationKey:e.options.mutationKey,state:{...t,data:Qe(t.data),variables:Qe(t.variables),error:Pt(t.error),failureReason:Pt(t.failureReason)},...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:Qe(e.meta)}}}function Tu(e){let{queryFn:t,select:r,persister:a,initialData:o,placeholderData:n,...i}=e;return{...i,queryFn:void 0,...e.meta?{meta:Qe(e.meta)}:{}}}function Au(e){let t=e.observers.map(r=>({queryHash:e.queryHash,options:Tu(r.options)}));return{state:{...e.state,...e.state.data!==void 0&&{data:Qe(e.state.data)},error:Pt(e.state.error),fetchFailureReason:Pt(e.state.fetchFailureReason)},queryKey:e.queryKey,queryHash:e.queryHash,...e.meta&&{meta:Qe(e.meta)},observers:t}}function Du(e,t){let r=e;for(let a of t.split(".")){if(!r||typeof r!="object"||Array.isArray(r)||!(a in r))return false;r=r[a]}return Array.isArray(r)?r.length>0:!!r&&typeof r=="object"}var ct=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Mo(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}function To(e,t,r="",a={shrunk:[],breaks:[]}){if(Array.isArray(e)&&Array.isArray(t))return t.length>0&&t.length<e.length&&a.shrunk.push({path:r||"(root)",have:e.length,sent:t.length}),t;if(!ct(e)||!ct(t))return t;let o={...e};for(let[n,i]of Object.entries(t)){let l=r?`${r}.${n}`:n;if(n in e){let s=Mo(e[n]),u=Mo(i);(s==="array"||s==="object")&&s!==u&&a.breaks.push({path:l,from:s,to:u}),o[n]=To(e[n],i,l,a)}else o[n]=i}return o}function Ru(e){let t=e.trim();try{let r=JSON.parse(t);if(Array.isArray(r))return r.map(a=>typeof a=="object"&&a!==null?JSON.stringify(a):String(a))}catch{}return t.includes(",")&&!t.startsWith("[")?t.split(",").map(r=>r.trim().replace(/^["']|["']$/g,"")):null}function Qu(e){let t;for(let r of e.observers??[]){let a=r.options?.refetchInterval,o=a;if(typeof a=="function")try{o=a(e)}catch{o=void 0}typeof o=="number"&&o>0&&(t=t===void 0?o:Math.min(t,o))}return t}function Ao(e){let t=r=>{let{queryHash:a}=r,o=e.getQueryCache(),n=a?o.get(a):void 0;if(!n&&typeof a=="string"){let i=Ru(a);i&&(n=o.getAll().find(l=>{let s=l.queryKey.map(u=>typeof u=="object"?JSON.stringify(u):String(u));return s.length===i.length&&s.every((u,c)=>u===i[c])}))}if(!n)throw new Error(`Query with hash "${a}" not found`);return n};return{version:2,getSnapshot:()=>({dehydratedState:qu(e),isOnlineManagerOnline:fr.isOnline()}),subscribe:r=>{let a=e.getQueryCache().subscribe(r),o=e.getMutationCache().subscribe(r),n=fr.subscribe(r);return()=>{a(),o(),n()}},actions:{getQueryData:r=>{let{queryHash:a,path:o}=r??{};if(!a)return{found:false,reason:"missing queryHash"};let n=e.getQueryCache().get(a);if(!n)return{found:false,reason:"unknown queryHash"};if(o){let l=fu(n.state.data,o);return l.ok?{found:true,queryHash:a,path:o,shape:Ft(l.value),data:l.value}:{found:false,reason:l.error}}if(n.state.data===void 0){let l=n.state.status,s=n.state.error;return{found:true,queryHash:a,hasData:false,status:l,fetchStatus:n.state.fetchStatus,...s?{error:s instanceof Error?s.message:String(s)}:{},reason:l==="error"?"This query has no data because it FAILED. Report the error, not an empty result.":n.state.fetchStatus==="fetching"?"No data yet \u2014 this query is still fetching.":"This query has never resolved (it may be disabled, or never enabled). It is not empty \u2014 it has nothing."}}let i=Ft(n.state.data);return{found:true,queryHash:a,hasData:true,...i?{shape:i}:{},data:wu(n.state.data)}},listQueries:r=>{let{includeData:a=false,staleOnly:o=false,limit:n}=r??{},i=e.getQueryCache().getAll(),l=[...o?i.filter(u=>u.isStale()):i].sort((u,c)=>{let d=+(c.getObserversCount()>0)-+(u.getObserversCount()>0);return d!==0?d:(c.state.dataUpdatedAt??0)-(u.state.dataUpdatedAt??0)}),s=(typeof n=="number"&&n>0?l.slice(0,n):l).map(u=>{let c=u.state.error,d=Qu(u);return{queryHash:u.queryHash,queryKey:u.queryKey,status:se(u),fetchStatus:u.state.fetchStatus,isStale:u.isStale(),observers:u.getObserversCount(),updatedAt:u.state.dataUpdatedAt,...d?{refetchEveryMs:d}:{},error:c?c.message??String(c):void 0,...a?{data:u.state.data}:{},...Ft(u.state.data)?{shape:Ft(u.state.data)}:{}}});return{queries:s,total:i.length,returned:s.length,includedData:a}},refetch:r=>t(r).fetch().catch(()=>{}),invalidate:r=>e.invalidateQueries(t(r)),reset:r=>e.resetQueries(t(r)),remove:r=>{let a=t(r),o=e.getQueryCache().findAll(a).some(n=>n.getObserversCount()>0);return e.removeQueries(a),{ok:true,...o?{note:"Removed \u2014 but a screen is still watching this query, and React Query leaves that screen rendering its LAST value (including anything written into the cache before this) until something refetches. Nothing on screen will change on its own. Use `reset` instead when you want the screen to go back to loading and fetch again."}:{}}},setQueryData:r=>{let{data:a,merge:o,force:n,path:i,value:l}=r,{queryKey:s,queryHash:u}=r,c=s;if(c===void 0&&typeof u=="string"){let y=e.getQueryCache().get(u);if(!y)return{ok:false,error:`Refused: no query with hash ${u} is in the cache. Read listQueries for the current hashes \u2014 a query that has been removed or whose key includes changing params (a search term, a cart payload) will not match an older hash.`};c=y.queryKey}if(c===void 0)return{ok:false,error:"Refused: no query was named. Send `queryKey` (the array from listQueries) or `queryHash` (its string form)."};let d=e.getQueryData(c),f=e.getQueryCache().find({queryKey:c,exact:true});if(d===void 0&&f&&(a!==void 0||i!==void 0)){let y=f,m=y?.state.status;return{ok:false,error:`Refused: this query has no data to edit \u2014 ${m==="error"?`it FAILED${y?.state.error?` (${y.state.error instanceof Error?y.state.error.message:String(y.state.error)})`:""}`:m==="pending"?"it has never resolved (it may be disabled, or still loading)":"it holds no data"}. There is nothing to merge into. Fix the cause first (restoreError, or let it fetch), or send force:true with the COMPLETE value if you mean to seed the cache from nothing.`,status:m}}if(a===void 0&&i===void 0)return{ok:false,error:"Refused: no change was described. Send `data` (with merge:true for a partial edit), or `path` and `value` to set one value."};let b=a;if(i!==void 0){if(l===void 0)return{ok:false,error:`Refused: sent \`path\` without \`value\`. Say what to set "${i}" to; if you mean to clear it, send value:null and the field must already be nullable.`};let y=hu(d,i,l);if(!y.ok)return{ok:false,error:`Refused: ${y.error}`};b=y.patch}if(o||i!==void 0){let y=n?{patch:b,notes:[],error:void 0}:yu(d,b);if(y.error)return{ok:false,error:`Refused: ${y.error}`};let m=y.patch;if(!n){let S=pu(d,m,{noun:"data"});if(S.length>0){let w=gu(m,S);return{ok:false,error:mu(S,"data",w),violations:S,...w?{suggestedData:w}:{}}}}let p=To(d,m),g=bu(d).filter(S=>Du(m,S));return e.setQueryData(c,p,{updatedAt:Date.now()}),{ok:true,mode:"merge",...i!==void 0?{path:i}:{},changedKeys:ct(m)?Object.keys(m):void 0,...y.notes.length?{keyed:y.notes}:{},...g.length?{unchecked:g.map(S=>`\`${S}\` was empty, so nothing in the app knows what its items look like and the shape of what you added was NOT checked. If the screen renders a field you left out, it will render undefined \u2014 read the query back and compare against how the screen uses it.`)}:{}}}if(!n&&ct(d)&&ct(a)){let y=Object.keys(d).filter(m=>!(m in a));if(y.length>0)return{ok:false,error:`Refused: the new value drops ${y.length} top-level field(s) the cached value has (${y.slice(0,8).join(", ")}${y.length>8?", \u2026":""}). A screen rendering those fields would crash. To change some fields, send merge:true with ONLY the fields that change. To really replace the whole value, send force:true.`,missingKeys:y}}return e.setQueryData(c,a,{updatedAt:Date.now()}),{ok:true,mode:"replace"}},triggerError:r=>{let a=t(r),o=a.options;a.setState({status:"error",error:new Error("Unknown error from devtools"),fetchMeta:{...a.state.fetchMeta,__previousQueryOptions:o}})},restoreError:r=>e.resetQueries(t(r)),triggerLoading:r=>{let a=t(r),o=a.options;a.fetch({...o,queryFn:()=>new Promise(()=>{}),gcTime:-1}).catch(()=>{}),a.setState({data:void 0,status:"pending",fetchMeta:{...a.state.fetchMeta,__previousQueryOptions:o}})},restoreLoading:r=>{let a=t(r),o=a.state,n=a.state.fetchMeta?a.state.fetchMeta.__previousQueryOptions:null;a.cancel({silent:true}),a.setState({...o,fetchStatus:"idle",fetchMeta:null}),n&&a.fetch(n).catch(()=>{})},clearQueryCache:()=>{let r=e.getQueryCache().getAll().filter(a=>a.getObserversCount()>0).length;return e.getQueryCache().clear(),{ok:true,cleared:true,...r?{note:`Cleared \u2014 but ${r} quer${r===1?"y is":"ies are"} still being watched by a screen, and React Query leaves those screens rendering their LAST value until something refetches. The cache is empty; the app on screen is not. Use \`reset\` on a query when you want its screen to reload.`}:{}}},clearMutationCache:()=>{e.getMutationCache().clear()},setOnline:r=>{let{online:a}=r;fr.setOnline(a)}}}}import{useEffect as Iu,useMemo as ku}from"react";import{useQueryClient as Eu}from"@tanstack/react-query";import{classifyPreviewItem as Fu,createRestoreScope as Pu,emptyRestoreResult as zu,failedRestore as Ou,registerStateSnapshotProvider as Ku,superJsonSerialize as Lu}from"@buoy-gg/shared-ui/web";function Do(e){return{...e,fetchStatus:"idle",fetchMeta:null}}function mr(e){return{status:e.state.status,error:e.state.error??null,data:e.state.data}}function gr(e,t){try{let r=JSON.stringify(e);return r.length>60?`${r.slice(0,57)}\u2026`:r}catch{return t}}function Ro(e){if(e==null)return e??null;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,a=typeof t.message=="string"?t.message:void 0;if(r!==void 0||a!==void 0)return{...r!==void 0?{name:r}:{},...a!==void 0?{message:a}:{}}}return e}function Qo(e){if(e===void 0)return true;try{return Lu(e),true}catch{return false}}function Io(e){let t=[],r=[];for(let a of e.getQueryCache().getAll()){let o=gr(a.queryKey,a.queryHash);if(!Qo(a.state.data)){t.push(`query ${o}: data can't be serialized (circular reference?) \u2014 not captured`);continue}r.push({queryKey:a.queryKey,queryHash:a.queryHash,...a.meta&&Qo(a.meta)?{meta:a.meta}:{},state:Do({...a.state,error:Ro(a.state.error),fetchFailureReason:Ro(a.state.fetchFailureReason)})})}return{queries:r,warnings:t}}function Bu(e){return{id:"query",label:"React Query",status:()=>({canCapture:true,canRestore:true}),async capture(){let{queries:t,warnings:r}=Io(e),a=e.getMutationCache().getAll().length;return a>0&&r.push(`${a} mutation(s) not captured (mutation functions cannot be restored)`),{data:{queries:t},warnings:r}},async restore(t,r){let a=t,o=Pu(r),n=zu();if(!a?.queries)return Ou("empty query snapshot");let i=e.getQueryCache(),l=new Set(a.queries.map(c=>c.queryHash));for(let c of a.queries)if(o.allows(c.queryHash)){if(qo(c.state.data)){n.skipped.push({id:c.queryHash,reason:"captured as an on-device placeholder by an older Buoy \u2014 re-capture this restore point"});continue}try{let d=Do(c.state),f=i.get(c.queryHash);f?f.setState(d):i.build(e,{queryKey:c.queryKey,queryHash:c.queryHash,...c.meta&&{meta:c.meta}},d),n.applied+=1}catch(d){n.skipped.push({id:c.queryHash,reason:String(d)}),n.ok=false}}for(let c of i.getAll().slice())if(o.allows(c.queryHash)&&!l.has(c.queryHash))try{i.remove(c),n.applied+=1}catch(d){n.skipped.push({id:c.queryHash,reason:String(d)})}let s=e.getMutationCache().getAll().length;s>0&&(e.getMutationCache().clear(),n.warnings.push(`mutation cache cleared (${s} mutation(s))`));let u=o.excludedWarning("quer(y/ies)");return u&&n.warnings.push(u),n},async previewItems(t,r){let a=t?.queries??[],o=r===void 0,n=o?Io(e).queries:r?.queries??[],i=new Map(n.map(c=>[c.queryHash,c])),l=new Map(a.map(c=>[c.queryHash,c])),s=[],u=[];for(let c of a){let d=gr(c.queryKey,c.queryHash);if(qo(c.state.data)){s.push({key:c.queryHash,label:d,verdict:"wont-apply",reason:"data stayed on the device when this was captured (older Buoy) \u2014 re-capture this restore point"});continue}let f=i.get(c.queryHash);s.push(Fu({key:c.queryHash,label:d,oldValue:f?mr(f):void 0,newValue:mr(c),inOld:f!==void 0,inNew:true},{tooLargeReason:"query data too large to render a diff \u2014 restore still applies it"}))}for(let c of n)l.has(c.queryHash)||s.push({key:c.queryHash,label:gr(c.queryKey,c.queryHash),verdict:"removed",oldValue:mr(c)});if(o){let c=e.getMutationCache().getAll().length;c>0&&u.push(`${c} in-memory mutation record(s) will be cleared`)}return{items:s,notes:u}}}}function Hu(e){return Ku(Bu(e))}function Wu(){let e;try{e=Eu()}catch{e=null}return Iu(()=>{if(e)return Hu(e)},[e]),ku(()=>e?Ao(e):null,[e])}function ko({queryState:e,observerCount:t,isStale:r}){return e.fetchStatus==="fetching"?"blue":e.status==="error"?"red":t?e.fetchStatus==="paused"?"purple":r?"yellow":"green":"gray"}import{useQueryClient as ju}from"@tanstack/react-query";import{jsx as zt,jsxs as Ie}from"react/jsx-runtime";function Eo(){try{let e=ju(),t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return Ie(h,{style:Y.container,children:[zt(v,{style:Y.title,children:"Debug Info"}),zt(v,{style:Y.info,children:"QueryClient: \u2705 Available"}),Ie(v,{style:Y.info,children:["Queries: ",t.length]}),Ie(v,{style:Y.info,children:["Mutations: ",r.length]}),t.length>0&&Ie(h,{style:Y.queriesList,children:[zt(v,{style:Y.subtitle,children:"Query Keys:"}),t.slice(0,3).map((a,o)=>Ie(v,{style:Y.queryKey,children:["\u2022"," ",Array.isArray(a.queryKey)?a.queryKey.join(" - "):String(a.queryKey)]},o)),t.length>3&&Ie(v,{style:Y.more,children:["... and ",t.length-3," more"]})]})]})}catch(e){return Ie(h,{style:Y.container,children:[zt(v,{style:Y.title,children:"Debug Info"}),Ie(v,{style:Y.error,children:["\u274C QueryClient Error: ",String(e)]})]})}}var Y=T.create({container:{padding:16,backgroundColor:"rgba(0, 0, 0, 0.3)",borderRadius:8,margin:16,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)"},title:{color:"#FFFFFF",fontSize:14,fontWeight:"600",marginBottom:8},subtitle:{color:"#E5E7EB",fontSize:12,fontWeight:"500",marginTop:8,marginBottom:4},info:{color:"#9CA3AF",fontSize:12,marginBottom:4},error:{color:"#EF4444",fontSize:12,marginBottom:4},queriesList:{marginTop:4},queryKey:{color:"#60A5FA",fontSize:11,marginLeft:8,marginBottom:2},more:{color:"#9CA3AF",fontSize:11,fontStyle:"italic",marginLeft:8}});import{jsx as ke,jsxs as Xe}from"react/jsx-runtime";function Vu({queries:e,selectedQuery:t,isOpen:r,onClose:a,onSelect:o}){let n=i=>Array.isArray(i.queryKey)?i.queryKey.join(" - "):String(i.queryKey);return ke(Rr,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:r,transparent:true,animationType:"fade",onRequestClose:a,children:ke(Dr,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:L.modalOverlay,onPress:a,children:Xe(h,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:L.modalContent,children:[Xe(h,{style:L.modalHeader,children:[ke(v,{style:L.modalTitle,children:"Select Query"}),Xe(v,{style:L.modalSubtitle,children:[e.length," ",e.length===1?"query":"queries"," ","available"]})]}),ke(be,{accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:L.scrollView,contentContainerStyle:L.scrollViewContent,showsVerticalScrollIndicator:true,children:e.length===0?Xe(h,{style:L.emptyState,children:[ke(v,{style:L.emptyTitle,children:"No Queries Found"}),Xe(v,{style:L.emptyDescription,children:["No React Query queries are currently active.",`
6
+ \u2022 Check console for debugging info`}}),contentContainerStyle:Ia.queryListContent})]})}var Ia=T.create({queryListContainer:{flex:1,backgroundColor:"transparent"},queryListContent:{padding:8,backgroundColor:"transparent",flexGrow:1}});import{ToolFooter as Zs,useSafeAreaInsets as el}from"@buoy-gg/shared-ui/web";import{jsx as or}from"react/jsx-runtime";function Ea({activeFilter:e,onFilterChange:t,isFloatingMode:r=true,size:a="default"}){let o=el({minBottom:16});return or(Zs,{floating:r,safeArea:false,paddingBottom:r?0:o.bottom,style:ka.filterFooter,children:or(h,{style:ka.filterContainer,children:or(sa,{activeFilter:e,onFilterChange:t,size:a})})})}var ka=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{useCallback as tl,useMemo as st}from"react";import{DynamicFilterView as rl,buoyColors as Ae,monoFont as al,night as nr}from"@buoy-gg/shared-ui/web";import{XCircle as Fa,Clock as ir,RefreshCw as ol,Globe as nl,Zap as il,Filter as sl,Eye as ll}from"@buoy-gg/shared-ui/web";import{jsx as sr}from"react/jsx-runtime";var ul=()=>false;function cl({queries:e,activeFilter:t,onFilterChange:r,ignoredPatterns:a,onPatternToggle:o,includedPatterns:n,onIncludedPatternToggle:i,isTeamPattern:l=ul}){let s=tl(y=>l(y)?sr(h,{accessibilityLabel:"Set by your team on buoy.gg",style:[Pa.teamBadge,{borderColor:`${nr.color.accent}60`,backgroundColor:`${nr.color.accent}15`}],children:sr(v,{style:[Pa.teamBadgeText,{color:nr.color.accent}],children:"TEAM"})}):null,[l]),u=st(()=>{let y={all:e.length,disabled:0,fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0};return e.forEach(m=>{let p=se(m);p==="disabled"?y.disabled++:p==="error"?y.error++:p==="fresh"?y.fresh++:p==="stale"?y.stale++:p==="fetching"?y.fetching++:p==="paused"?y.paused++:p==="inactive"&&y.inactive++}),y},[e]),c=st(()=>{let y=new Set;return e.forEach(m=>{if(!m?.queryKey)return;(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).forEach(p=>{if(p!=null){let g=String(p);/^\d+$/.test(g)||y.add(g)}})}),Array.from(y).sort().slice(0,50)},[e]),d=st(()=>c,[c]),f=st(()=>{let y=e;return n.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return false;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return Array.from(n).some(g=>p.includes(g.toLowerCase()))})),a.size>0&&(y=y.filter(m=>{if(!m?.queryKey)return true;let p=(Array.isArray(m.queryKey)?m.queryKey:[m.queryKey]).filter(g=>g!=null).map(g=>String(g)).join(" ").toLowerCase();return!Array.from(a).some(g=>p.includes(g.toLowerCase()))})),y.length},[e,n,a]),b=st(()=>({filterSummarySection:{enabled:true,totalCount:e.length,filteredCount:f,includePatterns:n,excludePatterns:a},sections:[{id:"status",title:"Status",type:"status",data:[{id:"status::all",label:"All",count:u.all,icon:nl,color:Ae.primary,isActive:!t||t==="all"},{id:"status::disabled",label:"Disabled",count:u.disabled,icon:Fa,color:Ae.textMuted,isActive:t==="disabled"},{id:"status::fresh",label:"Fresh",count:u.fresh,icon:il,color:Ae.success,isActive:t==="fresh"},{id:"status::stale",label:"Stale",count:u.stale,icon:ir,color:Ae.warning,isActive:t==="stale"},{id:"status::fetching",label:"Fetching",count:u.fetching,icon:ol,color:Ae.primary,isActive:t==="fetching"},{id:"status::paused",label:"Paused",count:u.paused,icon:ir,color:Ae.textMuted,isActive:t==="paused"},{id:"status::inactive",label:"Inactive",count:u.inactive,icon:ir,color:Ae.textSecondary,isActive:t==="inactive"},{id:"status::error",label:"Error",count:u.error,icon:Fa,color:Ae.error,isActive:t==="error"}]}],addFilterSection:{enabled:true,placeholder:"Enter pattern to exclude...",title:"EXCLUDE FILTERS",icon:sl},includeOnlySection:{enabled:true,title:"INCLUDE ONLY FILTERS",description:"Show ONLY queries matching these patterns. All non-matching queries will be hidden.",placeholder:"Enter pattern to include...",icon:ll,patterns:n,onPatternToggle:i,onPatternAdd:i,renderPatternMeta:s},availableItemsSection:{enabled:true,title:"AVAILABLE QUERY KEYS",emptyMessage:"No queries found. Query keys will appear here once queries are active.",items:d},howItWorksSection:{enabled:true,title:"HOW QUERY FILTERS WORK",description:"There are two types of query key filters:",examples:["","INCLUDE ONLY (green):","\u2022 Shows ONLY queries matching the pattern","\u2022 Example: 'rewards' \u2192 shows only reward queries","\u2022 When active, non-matching queries are hidden","","EXCLUDE (blue):","\u2022 Hides queries matching the pattern","\u2022 Example: 'analytics' \u2192 hides analytics queries","","Filters are case-insensitive and match partial keys."]},activePatterns:a,renderPatternMeta:s}),[u,t,a,n,d,i,e.length,f,s]);return sr(rl,{...b,onFilterChange:y=>{let[m,p]=y.split("::");m==="status"?r(p==="all"||t===p?null:p):m==="suggestion"&&o(p)},onPatternToggle:o,onPatternAdd:o})}var Pa=T.create({teamBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:6,borderWidth:1},teamBadgeText:{fontSize:9,fontFamily:al,fontWeight:"700",letterSpacing:.5}});import{useState as lt,useCallback as ut,useEffect as Tt,useMemo as Oa,useRef as za}from"react";import{devToolsStorageKeys as De,persistentStorage as At,useTeamList as Ka}from"@buoy-gg/shared-ui/web";import{jsx as ge,jsxs as dl}from"react/jsx-runtime";function La({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:a,onMinimize:o,activeFilter:n,onFilterChange:i,enableSharedModalDimensions:l=false,onTabChange:s,searchText:u="",onSearchChange:c}){let d=rn(),f=wr(t),b=vt(),y=ut(()=>{d.getQueryCache().clear()},[d]),[m,p]=lt(null),g=n??m,S=i??p,[w,C]=lt(false),[q,A]=lt(new Set),[j,ke]=lt(new Set),M=za(null),oe=za(null);Tt(()=>{(async()=>{try{let x=await At.getItem(De.reactQuery.ignoredPatterns());if(x){let Q=JSON.parse(x);Array.isArray(Q)&&(M.current=JSON.stringify(Array.from(new Set(Q))),A(new Set(Q)))}}catch(x){console.error("Failed to load ignored patterns:",x)}finally{M.current??(M.current="[]")}})()},[]),Tt(()=>{(async()=>{try{let x=await At.getItem(De.reactQuery.includedPatterns());if(x){let Q=JSON.parse(x);Array.isArray(Q)&&(oe.current=JSON.stringify(Array.from(new Set(Q))),ke(new Set(Q)))}}catch(x){console.error("Failed to load included patterns:",x)}finally{oe.current??(oe.current="[]")}})()},[]),Tt(()=>{let x=JSON.stringify(Array.from(q));if(M.current===null||M.current===x)return;M.current=x,(async()=>{try{await At.setItem(De.reactQuery.ignoredPatterns(),x)}catch(Q){console.error("Failed to save ignored patterns:",Q)}})()},[q]),Tt(()=>{let x=JSON.stringify(Array.from(j));if(oe.current===null||oe.current===x)return;oe.current=x,(async()=>{try{await At.setItem(De.reactQuery.includedPatterns(),x)}catch(Q){console.error("Failed to save included patterns:",Q)}})()},[j]);let ye=Ka(De.reactQuery.ignoredPatterns()),he=Ka(De.reactQuery.includedPatterns()),ne=Oa(()=>ye.length?new Set([...q,...ye]):q,[q,ye]),ie=Oa(()=>he.length?new Set([...j,...he]):j,[j,he]),yt=ut(x=>ye.includes(x)&&!q.has(x)||he.includes(x)&&!j.has(x),[ye,he,q,j]),ht=ut(x=>{A(Q=>{if(!Q.has(x)&&ye.includes(x))return Q;let fe=new Set(Q);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[ye]),Kt=ut(x=>{ke(Q=>{if(!Q.has(x)&&he.includes(x))return Q;let fe=new Set(Q);return fe.has(x)?fe.delete(x):fe.add(x),fe})},[he]),[ft,Ho]=lt("bottomSheet"),Wo=l?De.reactQuery.modal():De.reactQuery.browserModal(),jo=ut(x=>{Ho(x)},[]),Vo=on({minBottom:16}),$o=ft==="floating"?56:48+Vo.bottom;if(!e)return null;let No=()=>{if(w){let x=[{key:"filters",label:"Filters"}];return dl(Lt,{children:[ge(Lt.Navigation,{onBack:()=>C(false)}),ge(Lt.Content,{title:"",noMargin:true,children:ge(nn,{tabs:x,activeTab:"filters",testIDPrefix:"buoy-rq-filterview-tab",onTabChange:()=>{}})})]})}return ge(et,{selectedQuery:f,activeTab:"queries",onTabChange:s,onBack:()=>r(void 0),searchText:u,onSearchChange:c,onFilterPress:()=>C(true),hasActiveFilters:g!==null||ne.size>0||ie.size>0,onClearCache:y})},Uo=ge(Ea,{activeFilter:g,onFilterChange:S,isFloatingMode:ft==="floating"});return ge(an,{visible:e,onClose:a,onMinimize:o,persistenceKey:Wo,header:{customContent:No(),showToggleButton:true},onModeChange:jo,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:!w,styles:{},footer:w?void 0:Uo,footerHeight:w?void 0:$o,children:ge(h,{style:yl.container,children:w?ge(cl,{queries:b,activeFilter:g,onFilterChange:S,ignoredPatterns:ne,onPatternToggle:ht,includedPatterns:ie,onIncludedPatternToggle:Kt,isTeamPattern:yt}):ge(Qa,{selectedQuery:f,onQuerySelect:r,activeFilter:g,searchText:u,ignoredPatterns:ne,includedPatterns:ie,onFilterPress:()=>C(true)})})})}var yl=T.create({container:{flex:1,backgroundColor:"transparent"}});import{JsModal as hl,devToolsStorageKeys as Ba,useSafeAreaInsets as fl}from"@buoy-gg/shared-ui/web";import{useQueryClient as Ha}from"@tanstack/react-query";import{useSafeAreaInsets as Wa,night as z,monoFont as ja}from"@buoy-gg/shared-ui/web";import{useMemo as ml}from"react";function lr(e,t,r){return ml(()=>{let a=e.state.status;return[{label:"Refetch",variant:"refetch",disabled:se(e)==="fetching",onPress:()=>Jt({query:e})},{label:e.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading",variant:"triggerLoading",disabled:false,onPress:()=>_t({query:e})},{label:a==="error"?"Restore Error":"Trigger Error",variant:"triggerError",disabled:a==="pending",onPress:()=>Gt({query:e,queryClient:t})}]},[e,t,r])}import{DataViewer as gl}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as pl,jsx as I,jsxs as _e}from"react/jsx-runtime";function Va({selectedQuery:e,isFloatingMode:t,disableInternalFooter:r=false,queryVersion:a}){let o=Wa({minBottom:16}),n=Ha(),i=lr(e,n,a);return _e(pl,{children:[_e(be,{testID:"buoy-rq-detail-scroll",accessibilityLabel:"Data editor mode",accessibilityHint:"View data editor mode","sentry-label":"ignore data editor mode",style:E.explorerScrollContainer,contentContainerStyle:[E.explorerScrollContent,!r&&{paddingBottom:72}],children:[_e(h,{style:E.section,children:[I(vl,{visible:!!e.state.data,selectedQuery:e,queryVersion:a}),I(Sl,{visible:!e.state.data,selectedQuery:e})]}),I(h,{style:E.section,children:I(Nt,{query:e})}),I(h,{style:E.section,children:_e(h,{style:E.queryExplorerContainer,children:[I(v,{testID:"buoy-rq-query-explorer-header",style:E.queryExplorerHeader,children:"Query Explorer"}),I(h,{style:E.queryExplorerContent,children:I(gl,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&I(h,{style:[E.actionFooter,{paddingBottom:t?0:o.bottom+8}],children:I(h,{style:E.actionsRow,children:i.map((l,s)=>I(ue,{testID:`buoy-rq-action-${l.variant}`,onClick:l.onPress,text:l.label,variant:l.variant,disabled:l.disabled},s))})})]})}function bl({selectedQuery:e,isFloatingMode:t,queryVersion:r}){let a=Wa({minBottom:16}),o=Ha(),n=lr(e,o,r);return I(h,{style:[E.actionFooter,{paddingBottom:t?0:a.bottom+8}],children:I(h,{style:E.actionsRow,children:n.map((i,l)=>I(ue,{testID:`buoy-rq-action-${i.variant}`,onClick:i.onPress,text:i.label,variant:i.variant,disabled:i.disabled},l))})})}function vl({visible:e,selectedQuery:t,queryVersion:r=0}){return e?_e(h,{style:E.dataContainer,children:[I(v,{testID:"buoy-rq-data-header",style:E.dataHeader,children:"Data Editor"}),I(h,{style:E.dataContent,children:I(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"],activeQuery:t,dataVersion:r})})]}):null}function Sl({visible:e,selectedQuery:t}){if(!e)return null;let r=()=>t.isDisabled()?{title:"Query Disabled",description:"This query is disabled and won't automatically fetch. Enable the query or manually trigger a fetch to load data."}:t.state.status==="pending"||se(t)==="fetching"?{title:t.state.status==="pending"?"Loading...":"Refetching...",description:"Please wait while the query is being executed."}:t.state.status==="error"?{title:"Query Error",description:t.state.error?.message||"An error occurred while fetching data."}:{title:"No Data Available",description:"This query has no data to edit. Try refetching the query first."},{title:a,description:o}=r();return _e(h,{style:E.emptyState,children:[I(v,{testID:"buoy-rq-detail-empty-title",style:E.emptyTitle,children:a}),I(v,{testID:"buoy-rq-detail-empty-description",style:E.emptyDescription,children:o})]})}var E=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:z.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:z.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:z.color.border,paddingTop:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsRow:{flexDirection:"row",alignItems:"center",gap:8},queryExplorerContainer:{minWidth:200,backgroundColor:z.color.surface,borderRadius:6,borderWidth:1,borderColor:z.color.accent+"4D",overflow:"hidden",shadowColor:z.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},queryExplorerHeader:{backgroundColor:z.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:z.color.accent,borderBottomWidth:1,borderBottomColor:z.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ja},queryExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:z.color.surface,borderRadius:6,borderWidth:1,borderColor:z.color.accent+"4D",overflow:"hidden",shadowColor:z.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6,marginTop:8},dataHeader:{backgroundColor:z.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:z.color.accent,borderBottomWidth:1,borderBottomColor:z.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:ja},dataContent:{padding:8}});import{useState as Cl,useCallback as xl,useEffect as wl,useRef as ql}from"react";import{jsx as Dt}from"react/jsx-runtime";function $a({visible:e,selectedQueryKey:t,onQuerySelect:r,onClose:a,onMinimize:o,enableSharedModalDimensions:n=false,onTabChange:i}){let{query:l,version:s}=Bt(t),[u,c]=Cl("bottomSheet"),d=t?JSON.stringify(t):void 0,f=ql(void 0);wl(()=>{if(l){f.current=d;return}e&&f.current!==void 0&&f.current===d&&(f.current=void 0,r(void 0))},[e,l,d,r]);let b=xl(w=>{c(w)},[]),y=fl({minBottom:16}),m=u==="floating"?72:80+y.bottom,p=()=>Dt(et,{selectedQuery:l,activeTab:"queries",onTabChange:i,onBack:()=>r(void 0)}),g=n?Ba.reactQuery.modal():`${Ba.reactQuery.modal()}_data_editor`;if(!e||!l)return null;let S=Dt(bl,{selectedQuery:l,isFloatingMode:u==="floating",queryVersion:s},`footer-${s}`);return Dt(hl,{visible:e,onClose:a,onMinimize:o,persistenceKey:g,header:{customContent:p(),showToggleButton:true},onModeChange:b,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:S,footerHeight:m,children:Dt(Va,{selectedQuery:l,isFloatingMode:u==="floating",disableInternalFooter:true,queryVersion:s})})}import{useQueryClient as Ml}from"@tanstack/react-query";import{useCallback as ur,useState as Na,useRef as Ua}from"react";import{useEffect as Tl,useState as Al}from"react";import{useQueryClient as Dl}from"@tanstack/react-query";function cr(e){let t=Dl(),[r,a]=Al(void 0);return Tl(()=>{let o=()=>{if(e!==void 0){let i=t.getMutationCache().getAll().find(l=>l.mutationId===e);a(i)}else a(void 0)};setTimeout(o,0);let n=t.getMutationCache().subscribe(o);return()=>n()},[t,e]),r}import{jsx as _a}from"react/jsx-runtime";function Ja({selectedMutation:e,onMutationSelect:t,activeFilter:r,searchText:a=""}){let o=n=>{t(typeof n=="function"?n(e):n)};return _a(h,{style:Ga.mutationListContainer,children:_a(ba,{selectedMutation:e,setSelectedMutation:o,activeFilter:r,searchText:a,hideInfoPanel:true,contentContainerStyle:Ga.mutationListContent})})}var Ga=T.create({mutationListContainer:{flex:1,backgroundColor:"transparent"},mutationListContent:{padding:8,backgroundColor:"transparent"}});import{ToolFooter as Rl,useSafeAreaInsets as Ql}from"@buoy-gg/shared-ui/web";import{useMemo as Il}from"react";import{jsx as dr}from"react/jsx-runtime";function Ya({activeFilter:e,onFilterChange:t,modalMode:r,size:a="default"}){let o=r==="floating",n=Ql({minBottom:16}),i=Il(()=>o?0:n.bottom,[o,n.bottom]);return dr(Rl,{floating:o,safeArea:false,paddingBottom:i,style:Xa.filterFooter,children:dr(h,{style:Xa.filterContainer,children:dr(va,{activeFilter:e,onFilterChange:t,size:a})})},`footer-${o?"floating":"docked"}`)}var Xa=T.create({filterFooter:{paddingTop:8,paddingHorizontal:0},filterContainer:{minHeight:32,justifyContent:"center"}});import{JsModal as El,useSafeAreaInsets as kl}from"@buoy-gg/shared-ui/web";import{absoluteFill as Fl}from"@buoy-gg/shared-ui/web";import{useMemo as W}from"react";import{ChevronLeft as Pl,ChevronRight as Ol,night as Rt}from"@buoy-gg/shared-ui/web";import{jsx as Je,jsxs as zl}from"react/jsx-runtime";var He=32,Za=6,eo=He,Kl=120,Qt=.95,to=1.15;function ro({translationX:e,maxTranslation:t=Kl,canSwipeLeft:r=true,canSwipeRight:a=true}){let o=W(()=>e.interpolate({inputRange:[0,t],outputRange:[0,1],extrapolate:"clamp"}),[e,t]),n=W(()=>o.interpolate({inputRange:[0,1],outputRange:[Za,eo]}),[o]),i=W(()=>o.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,to]}),[o]),l=W(()=>o.interpolate({inputRange:[0,.99,1],outputRange:[0,0,16]}),[o]),s=W(()=>o.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[o]),u=W(()=>o.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[o]),c=W(()=>o.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[o]),d=W(()=>e.interpolate({inputRange:[-t,0],outputRange:[1,0],extrapolate:"clamp"}),[e,t]),f=W(()=>d.interpolate({inputRange:[0,1],outputRange:[Za,eo]}),[d]),b=W(()=>d.interpolate({inputRange:[0,Qt,1],outputRange:[1,1,to]}),[d]),y=W(()=>d.interpolate({inputRange:[0,.99,1],outputRange:[0,0,-16]}),[d]),m=W(()=>d.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"}),[d]),p=W(()=>d.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"}),[d]),g=W(()=>d.interpolate({inputRange:[0,.5,Qt,1],outputRange:[.8,.8,1,1.2]}),[d]);return zl(h,{style:yr.container,pointerEvents:"none",children:[a&&Je(Z.View,{style:[yr.leftWrapper,{width:n,height:He,borderRadius:He/2,backgroundColor:Rt.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:s,transform:[{scale:i},{translateX:l}]}],children:Je(Z.View,{style:{opacity:u,transform:[{scale:c}]},children:Je(Pl,{size:He*.6,color:Rt.color.accent,strokeWidth:3})})}),r&&Je(Z.View,{style:[yr.rightWrapper,{width:f,height:He,borderRadius:He/2,backgroundColor:Rt.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:m,transform:[{scale:b},{translateX:y}]}],children:Je(Z.View,{style:{opacity:p,transform:[{scale:g}]},children:Je(Ol,{size:He*.6,color:Rt.color.accent,strokeWidth:3})})})]})}var yr=T.create({container:{...Fl,zIndex:1e3,justifyContent:"center",alignItems:"center"},leftWrapper:{position:"absolute",left:16},rightWrapper:{position:"absolute",right:16}});import{devToolsStorageKeys as ao}from"@buoy-gg/shared-ui/web";import{jsx as Ge,jsxs as Ll}from"react/jsx-runtime";function oo({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:a,onMinimize:o,activeFilter:n,onFilterChange:i,onTabChange:l,enableSharedModalDimensions:s=false,searchText:u="",onSearchChange:c}){let d=Ml(),f=cr(t),[b,y]=Na(null),m=n??b,p=i??y,g=ur(()=>{d.getMutationCache().clear(),r(void 0)},[d,r]),[S,w]=Na("bottomSheet"),C=s?ao.reactQuery.modal():ao.reactQuery.mutationModal(),q=Ua(new Z.Value(0)).current,A=ur(ne=>{ne==="right"&&l("queries")},[l]),j=ur(ne=>{w(ne)},[]),ke=kl({minBottom:16}),M=S==="floating"?56:48+ke.bottom,oe=Ua(Ht.create({onStartShouldSetPanResponder:()=>false,onMoveShouldSetPanResponder:(ne,ie)=>Math.abs(ie.dx)>5&&Math.abs(ie.dy)<10,onPanResponderMove:(ne,ie)=>{q.setValue(ie.dx)},onPanResponderRelease:(ne,ie)=>{let{dx:yt,vx:ht}=ie,Kt=80,ft=.5;Z.spring(q,{toValue:0,useNativeDriver:true}).start(),(Math.abs(yt)>Kt||Math.abs(ht)>ft)&&(yt>0||ht>0?A("right"):A("left"))},onPanResponderTerminate:()=>{Z.spring(q,{toValue:0,useNativeDriver:true}).start()}})).current;if(!e)return null;let ye=()=>Ge(et,{selectedMutation:f,activeTab:"mutations",onTabChange:l,onBack:()=>r(void 0),searchText:u,onSearchChange:c,onClearCache:g}),he=Ge(Ya,{activeFilter:m,onFilterChange:p,modalMode:S});return Ge(El,{visible:e,onClose:a,onMinimize:o,persistenceKey:C,header:{customContent:ye(),showToggleButton:true},onModeChange:j,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:he,footerHeight:M,children:Ge(h,{style:{flex:1},children:Ll(h,{...oe.panHandlers,style:{flex:1},children:[Ge(ro,{translationX:q,canSwipeLeft:false,canSwipeRight:true}),Ge(Ja,{selectedMutation:f,onMutationSelect:r,activeFilter:m,searchText:u})]})})})}import{JsModal as Bl,useSafeAreaInsets as Hl,devToolsStorageKeys as no}from"@buoy-gg/shared-ui/web";import{useSafeAreaInsets as Wl,night as K,monoFont as io}from"@buoy-gg/shared-ui/web";import{useMemo as jl}from"react";import{useQueryClient as Vl}from"@tanstack/react-query";function so(e){let t=Vl();return jl(()=>[{label:"Remove",variant:"remove",disabled:false,onPress:()=>t.getMutationCache().remove(e)}],[e,t])}import{DataViewer as $l}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Nl,jsx as k,jsxs as Ye}from"react/jsx-runtime";function lo({selectedMutation:e,isFloatingMode:t,disableInternalFooter:r=false}){return Ye(Nl,{children:[Ye(be,{testID:"buoy-rq-mutation-detail-scroll",accessibilityLabel:"Mutation editor mode",accessibilityHint:"View mutation editor mode","sentry-label":"ignore mutation editor mode",style:P.explorerScrollContainer,contentContainerStyle:P.explorerScrollContent,children:[Ye(h,{style:P.section,children:[k(Ul,{visible:!!e.state.data,selectedMutation:e}),k(_l,{visible:!e.state.data,selectedMutation:e})]}),k(h,{style:P.section,children:k(rr,{selectedMutation:e})}),k(h,{style:P.section,children:Ye(h,{style:P.mutationExplorerContainer,children:[k(v,{style:P.mutationExplorerHeader,children:"Mutation Explorer"}),k(h,{style:P.mutationExplorerContent,children:k($l,{title:"",data:e,maxDepth:10,rawMode:true,showTypeFilter:true,initialExpanded:false})})]})})]}),!r&&k(uo,{selectedMutation:e,isFloatingMode:t})]})}function uo({selectedMutation:e,isFloatingMode:t}){let r=Wl({minBottom:16}),a=so(e);return k(h,{style:[P.actionFooter,{paddingBottom:t?0:r.bottom+8}],children:k(h,{style:P.actionsGrid,children:a.map((o,n)=>k(ue,{testID:`buoy-rq-action-${o.variant}`,onClick:o.onPress,text:o.label,variant:o.variant,disabled:o.disabled},n))})})}function Ul({visible:e,selectedMutation:t}){return e?Ye(h,{style:P.dataContainer,children:[k(v,{style:P.dataHeader,children:"Data Editor"}),k(h,{style:P.dataContent,children:k(me,{editable:true,label:"Data",value:t.state.data,defaultExpanded:["Data"]},t.mutationId)})]}):null}function _l({visible:e,selectedMutation:t}){if(!e)return null;let r=()=>t.state.status==="pending"?{title:"Pending...",description:"The mutation is in progress."}:t.state.status==="error"?{title:"Mutation Error",description:t.state.error?.message||"An error occurred."}:{title:"No Data Available",description:"This mutation has no data."},{title:a,description:o}=r();return Ye(h,{style:P.emptyState,children:[k(v,{testID:"buoy-rq-mutation-detail-empty-title",style:P.emptyTitle,children:a}),k(v,{testID:"buoy-rq-mutation-detail-empty-description",style:P.emptyDescription,children:o})]})}var P=T.create({explorerScrollContainer:{flex:1},explorerScrollContent:{paddingBottom:16,paddingHorizontal:8,flexGrow:1},section:{marginBottom:16},emptyState:{flex:1,justifyContent:"center",alignItems:"center",padding:32},emptyTitle:{color:K.color.text,fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},emptyDescription:{color:K.color.textSecondary,fontSize:14,textAlign:"center",lineHeight:20,maxWidth:280},actionFooter:{borderTopWidth:1,borderTopColor:K.color.border,paddingVertical:8,paddingHorizontal:12,backgroundColor:"transparent",borderBottomLeftRadius:14,borderBottomRightRadius:14},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:6,justifyContent:"space-between"},mutationExplorerContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},mutationExplorerHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:io},mutationExplorerContent:{padding:8},dataContainer:{minWidth:200,backgroundColor:K.color.surface,borderRadius:6,borderWidth:1,borderColor:K.color.accent+"4D",overflow:"hidden",shadowColor:K.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:K.color.accent+"1A",paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:K.color.accent,borderBottomWidth:1,borderBottomColor:K.color.accent+"33",letterSpacing:.5,textTransform:"uppercase",fontFamily:io},dataContent:{padding:8}});import{useState as Jl,useCallback as Gl,useEffect as Yl,useRef as Xl}from"react";import{jsx as It}from"react/jsx-runtime";function co({visible:e,selectedMutationId:t,onMutationSelect:r,onClose:a,onMinimize:o,onTabChange:n,enableSharedModalDimensions:i=false}){let l=cr(t),[s,u]=Jl("bottomSheet"),c=Xl(void 0);Yl(()=>{if(l){c.current=l.mutationId;return}e&&c.current!==void 0&&c.current===t&&(c.current=void 0,r(void 0))},[e,l,t,r]);let d=Gl(g=>{u(g)},[]),f=Hl({minBottom:16}),b=s==="floating"?72:80+f.bottom,y=()=>It(et,{selectedMutation:l,activeTab:"mutations",onTabChange:n,onBack:()=>r(void 0)}),m=i?no.reactQuery.modal():no.reactQuery.mutationModal();if(!e||!l)return null;let p=It(uo,{selectedMutation:l,isFloatingMode:s==="floating"});return It(Bl,{visible:e,onClose:a,onMinimize:o,persistenceKey:m,header:{customContent:y(),showToggleButton:true},onModeChange:d,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},footer:p,footerHeight:b,children:It(lo,{selectedMutation:l,isFloatingMode:s==="floating",disableInternalFooter:true})})}import{Fragment as Zl,jsx as Et,jsxs as eu}from"react/jsx-runtime";function yo({visible:e,selectedQueryKey:t,selectedMutationId:r,onQuerySelect:a,onMutationSelect:o,onClose:n,onMinimize:i,activeFilter:l,onFilterChange:s,activeTab:u,onTabChange:c,enableSharedModalDimensions:d=false,searchText:f="",onSearchChange:b}){let y=!!t||!!r,m=u==="queries",p=u==="mutations",g={onClose:n,onMinimize:i,activeFilter:l,onFilterChange:s,enableSharedModalDimensions:d},S=e&&!y&&m,w=e&&!y&&p,C=e&&y&&m&&!!t,q=e&&y&&p&&!!r;return eu(Zl,{children:[Et(La,{visible:S,selectedQueryKey:t,onQuerySelect:a,onTabChange:c,searchText:f,onSearchChange:b,...g}),Et(oo,{visible:w,selectedMutationId:r,onMutationSelect:o,onTabChange:c,searchText:f,onSearchChange:b,...g}),Et($a,{visible:C,selectedQueryKey:t,onQuerySelect:a,onTabChange:c,...g}),Et(co,{visible:q,selectedMutationId:r,onMutationSelect:o,onTabChange:c,...g})]})}import{ChangeLog as tu}from"@buoy-gg/shared-ui/web";var ru=0;function Re(){return`rq-${Date.now()}-${++ru}`}var au=class extends tu{constructor(){super({max:200});this.queryClient=null;this.queryUnsubscribe=null;this.mutationUnsubscribe=null;this.fetchStartTimes=new Map;this.mutationStartTimes=new Map;this.lastQueryStates=new Map;this.lastMutationStates=new Map}setQueryClient(e){this.disconnect(),this.queryClient=e,this.queryUnsubscribe=e.getQueryCache().subscribe(t=>{t.type==="updated"&&t.query&&this.handleQueryUpdate(t.query)}),this.mutationUnsubscribe=e.getMutationCache().subscribe(t=>{t.type==="updated"&&t.mutation&&this.handleMutationUpdate(t.mutation)})}disconnect(){this.queryUnsubscribe&&(this.queryUnsubscribe(),this.queryUnsubscribe=null),this.mutationUnsubscribe&&(this.mutationUnsubscribe(),this.mutationUnsubscribe=null),this.queryClient=null,this.lastQueryStates.clear(),this.lastMutationStates.clear(),this.fetchStartTimes.clear(),this.mutationStartTimes.clear()}handleQueryUpdate(e){if(Se(e.queryKey))return;let t=e.queryHash,r={fetchStatus:e.state.fetchStatus,status:e.state.status},a=this.lastQueryStates.get(t);if(!a)r.fetchStatus==="fetching"&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e}));else{let o=a.fetchStatus==="fetching",n=r.fetchStatus==="fetching";if(!o&&n&&(this.fetchStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"query-fetch-start",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})),o&&!n){let i=this.fetchStartTimes.get(t),l=i?Date.now()-i:void 0;this.fetchStartTimes.delete(t),r.status==="error"?this.addEvent({id:Re(),type:"query-fetch-error",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryError:e.state.error,duration:l,query:e}):this.addEvent({id:Re(),type:"query-fetch-success",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,queryData:e.state.data,duration:l,query:e})}!a.status&&e.state.isInvalidated&&this.addEvent({id:Re(),type:"query-invalidated",timestamp:Date.now(),queryKey:e.queryKey,queryHash:t,query:e})}this.lastQueryStates.set(t,r)}handleMutationUpdate(e){let t=e.mutationId,r=e.state.status,a=this.lastMutationStates.get(t);if(a!==r){if(r==="pending"&&a!=="pending")this.mutationStartTimes.set(t,Date.now()),this.addEvent({id:Re(),type:"mutation-start",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutation:e});else if(r==="success"&&a==="pending"){let o=this.mutationStartTimes.get(t),n=o?Date.now()-o:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-success",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationData:e.state.data,duration:n,mutation:e})}else if(r==="error"&&a==="pending"){let o=this.mutationStartTimes.get(t),n=o?Date.now()-o:void 0;this.mutationStartTimes.delete(t),this.addEvent({id:Re(),type:"mutation-error",timestamp:Date.now(),mutationId:t,mutationKey:e.options.mutationKey,mutationVariables:e.state.variables,mutationError:e.state.error,duration:n,mutation:e})}}this.lastMutationStates.set(t,r)}addEvent(e){this.record(e)}getEvents(){return this.items}subscribe(e){let t=super.subscribe(e);return e(this.items),t}clearEvents(){this.clear()}isConnected(){return this.queryClient!==null}},We=new au,ou=e=>We.setQueryClient(e),nu=()=>We.disconnect();import{jsx as ho}from"react/jsx-runtime";function hr({visible:e,onClose:t,onMinimize:r,enableSharedModalDimensions:a=true}){let o=en();Zo(()=>{We.isConnected()||We.setQueryClient(o)},[o]);let[n,i]=Ze(void 0),[l,s]=Ze(void 0),[u,c]=Ze(null),[d,f]=Ze("queries"),[b,y]=Ze(""),m=Fe(()=>{i(void 0),s(void 0),c(null),f("queries"),y("")},[]),p=Fe(()=>{m(),t()},[t,m]),g=Fe(A=>{i(A?.queryKey)},[]),S=Fe(A=>{s(A?.mutationId)},[]),w=Fe(A=>{c(A)},[]),C=Fe(A=>{f(A),c(null),i(void 0),s(void 0),y("")},[]),q=Fe(A=>{y(A)},[]);return e?ho(tn,{children:ho(yo,{visible:e,selectedQueryKey:n,selectedMutationId:l,onQuerySelect:g,onMutationSelect:S,onClose:p,onMinimize:r,activeFilter:u,onFilterChange:w,activeTab:d,onTabChange:C,searchText:b,onSearchChange:q,enableSharedModalDimensions:a})}):null}import{onlineManager as pe}from"@tanstack/react-query";import{devToolsStorageKeys as fo,persistentStorage as mo}from"@buoy-gg/shared-ui/web";import{useState as go,useEffect as po}from"react";import{jsx as kt}from"react/jsx-runtime";var bo=()=>null,vo=async e=>{try{await mo.setItem(fo.settings.wifiEnabled(),e.toString())}catch{}},iu=async()=>{try{let e=await mo.getItem(fo.settings.wifiEnabled());e!==null&&pe.setOnline(e==="true")}catch{}};iu();function su({size:e}){let[t,r]=go(()=>pe.isOnline());return po(()=>pe.subscribe(a=>{r(a)}),[]),kt(xr,{size:e,color:t?"#10B981":"#DC2626"})}var lu={id:"query",name:"QUERY",description:"React Query inspector",slot:"both",icon:({size:e})=>kt(Cr,{size:e}),component:hr,props:{enableSharedModalDimensions:false}};function uu(e){return{id:e?.id||"query",name:e?.name||"QUERY",description:e?.description||"React Query inspector",slot:"both",icon:({size:t})=>kt(Cr,{size:t}),component:hr,props:{enableSharedModalDimensions:e?.enableSharedModalDimensions!==void 0?e.enableSharedModalDimensions:false}}}var cu={id:"query-wifi-toggle",name:"WIFI",description:"Toggle React Query online/offline state",slot:"row",icon:su,component:bo,props:{},launchMode:"toggle-only",onPress:()=>{let e=!pe.isOnline();pe.setOnline(e),vo(e)}};function du(e){let t=e?.onColor||"#10B981",r=e?.offColor||"#DC2626",a=({size:o})=>{let[n,i]=go(()=>pe.isOnline());return po(()=>pe.subscribe(l=>{i(l)}),[]),kt(xr,{size:o,color:n?t:r})};return{id:e?.id||"query-wifi-toggle",name:e?.name||"WIFI",description:e?.description||"Toggle React Query online/offline state",slot:"row",icon:a,component:bo,props:{},launchMode:"toggle-only",onPress:()=>{let o=!pe.isOnline();pe.setOnline(o),vo(o)}}}import{expandKeyedArrays as yu,patchFromPath as hu,readPath as fu,refusalText as mu,shapeSummary as Ft,suggestedPatch as gu,typedEditViolations as pu,unshapedLists as bu}from"@buoy-gg/shared-ui/web";import{onlineManager as fr}from"@tanstack/react-query";import{isJsonSerializable as So,isOverWireBudget as Co}from"@buoy-gg/shared-ui/web";var vu=Object.freeze({__buoyDataOnDevice:true,note:"Query data stays on the device \u2014 fetched on demand via getQueryData."}),xo=Object.freeze({__buoyUnserializable:true,note:"Query data is not JSON-serializable (circular or bigint) and stayed on the device."}),Su=16*1024,wo=8*1024*1024;function Cu(e){return!!e&&typeof e=="object"&&e.__buoyDataOnDevice===true}function xu(e){return!!e&&typeof e=="object"&&e.__buoyUnserializable===true}function qo(e){return Cu(e)||xu(e)}function Qe(e){if(e!==void 0)return Co(e,Su)?So(e)?vu:xo:e}function Pt(e){if(e==null)return e;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,a=typeof t.message=="string"?t.message:void 0;if(r!==void 0||a!==void 0)return Qe({...r!==void 0?{name:r}:{},...a!==void 0?{message:a}:{}})}return Qe(e)}function wu(e){return Co(e,wo)?So(e)?{__buoyTruncated:true,note:`Exceeds the ${wo/(1024*1024)}MB detail limit \u2014 inspect it on-device.`}:xo:e}function qu(e){let t=e.getMutationCache().getAll().map(a=>Mu(a)),r=e.getQueryCache().getAll().map(a=>Au(a));return{mutations:t,queries:r}}function Mu(e){let t=e.state;return{mutationId:e.mutationId,mutationKey:e.options.mutationKey,state:{...t,data:Qe(t.data),variables:Qe(t.variables),error:Pt(t.error),failureReason:Pt(t.failureReason)},...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:Qe(e.meta)}}}function Tu(e){let{queryFn:t,select:r,persister:a,initialData:o,placeholderData:n,...i}=e;return{...i,queryFn:void 0,...e.meta?{meta:Qe(e.meta)}:{}}}function Au(e){let t=e.observers.map(r=>({queryHash:e.queryHash,options:Tu(r.options)}));return{state:{...e.state,...e.state.data!==void 0&&{data:Qe(e.state.data)},error:Pt(e.state.error),fetchFailureReason:Pt(e.state.fetchFailureReason)},queryKey:e.queryKey,queryHash:e.queryHash,...e.meta&&{meta:Qe(e.meta)},observers:t}}function Du(e,t){let r=e;for(let a of t.split(".")){if(!r||typeof r!="object"||Array.isArray(r)||!(a in r))return false;r=r[a]}return Array.isArray(r)?r.length>0:!!r&&typeof r=="object"}var ct=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Mo(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}function To(e,t,r="",a={shrunk:[],breaks:[]}){if(Array.isArray(e)&&Array.isArray(t))return t.length>0&&t.length<e.length&&a.shrunk.push({path:r||"(root)",have:e.length,sent:t.length}),t;if(!ct(e)||!ct(t))return t;let o={...e};for(let[n,i]of Object.entries(t)){let l=r?`${r}.${n}`:n;if(n in e){let s=Mo(e[n]),u=Mo(i);(s==="array"||s==="object")&&s!==u&&a.breaks.push({path:l,from:s,to:u}),o[n]=To(e[n],i,l,a)}else o[n]=i}return o}function Ru(e){let t=e.trim();try{let r=JSON.parse(t);if(Array.isArray(r))return r.map(a=>typeof a=="object"&&a!==null?JSON.stringify(a):String(a))}catch{}return t.includes(",")&&!t.startsWith("[")?t.split(",").map(r=>r.trim().replace(/^["']|["']$/g,"")):null}function Qu(e){let t;for(let r of e.observers??[]){let a=r.options?.refetchInterval,o=a;if(typeof a=="function")try{o=a(e)}catch{o=void 0}typeof o=="number"&&o>0&&(t=t===void 0?o:Math.min(t,o))}return t}function Ao(e){let t=r=>{let{queryHash:a}=r,o=e.getQueryCache(),n=a?o.get(a):void 0;if(!n&&typeof a=="string"){let i=Ru(a);i&&(n=o.getAll().find(l=>{let s=l.queryKey.map(u=>typeof u=="object"?JSON.stringify(u):String(u));return s.length===i.length&&s.every((u,c)=>u===i[c])}))}if(!n)throw new Error(`Query with hash "${a}" not found`);return n};return{version:2,getSnapshot:()=>({dehydratedState:qu(e),isOnlineManagerOnline:fr.isOnline()}),subscribe:r=>{let a=e.getQueryCache().subscribe(r),o=e.getMutationCache().subscribe(r),n=fr.subscribe(r);return()=>{a(),o(),n()}},actions:{getQueryData:r=>{let{queryHash:a,path:o}=r??{};if(!a)return{found:false,reason:"missing queryHash"};let n=e.getQueryCache().get(a);if(!n)return{found:false,reason:"unknown queryHash"};if(o){let l=fu(n.state.data,o);return l.ok?{found:true,queryHash:a,path:o,shape:Ft(l.value),data:l.value}:{found:false,reason:l.error}}if(n.state.data===void 0){let l=n.state.status,s=n.state.error;return{found:true,queryHash:a,hasData:false,status:l,fetchStatus:n.state.fetchStatus,...s?{error:s instanceof Error?s.message:String(s)}:{},reason:l==="error"?"This query has no data because it FAILED. Report the error, not an empty result.":n.state.fetchStatus==="fetching"?"No data yet \u2014 this query is still fetching.":"This query has never resolved (it may be disabled, or never enabled). It is not empty \u2014 it has nothing."}}let i=Ft(n.state.data);return{found:true,queryHash:a,hasData:true,...i?{shape:i}:{},data:wu(n.state.data)}},listQueries:r=>{let{includeData:a=false,staleOnly:o=false,limit:n}=r??{},i=e.getQueryCache().getAll(),l=[...o?i.filter(u=>u.isStale()):i].sort((u,c)=>{let d=+(c.getObserversCount()>0)-+(u.getObserversCount()>0);return d!==0?d:(c.state.dataUpdatedAt??0)-(u.state.dataUpdatedAt??0)}),s=(typeof n=="number"&&n>0?l.slice(0,n):l).map(u=>{let c=u.state.error,d=Qu(u);return{queryHash:u.queryHash,queryKey:u.queryKey,status:se(u),fetchStatus:u.state.fetchStatus,isStale:u.isStale(),observers:u.getObserversCount(),updatedAt:u.state.dataUpdatedAt,...d?{refetchEveryMs:d}:{},error:c?c.message??String(c):void 0,...a?{data:u.state.data}:{},...Ft(u.state.data)?{shape:Ft(u.state.data)}:{}}});return{queries:s,total:i.length,returned:s.length,includedData:a}},refetch:r=>t(r).fetch().catch(()=>{}),invalidate:r=>e.invalidateQueries(t(r)),reset:r=>e.resetQueries(t(r)),remove:r=>{let a=t(r),o=e.getQueryCache().findAll(a).some(n=>n.getObserversCount()>0);return e.removeQueries(a),{ok:true,...o?{note:"Removed \u2014 but a screen is still watching this query, and React Query leaves that screen rendering its LAST value (including anything written into the cache before this) until something refetches. Nothing on screen will change on its own. Use `reset` instead when you want the screen to go back to loading and fetch again."}:{}}},setQueryData:r=>{let{data:a,merge:o,force:n,path:i,value:l}=r,{queryKey:s,queryHash:u}=r,c=s;if(c===void 0&&typeof u=="string"){let y=e.getQueryCache().get(u);if(!y)return{ok:false,error:`Refused: no query with hash ${u} is in the cache. Read listQueries for the current hashes \u2014 a query that has been removed or whose key includes changing params (a search term, a cart payload) will not match an older hash.`};c=y.queryKey}if(c===void 0)return{ok:false,error:"Refused: no query was named. Send `queryKey` (the array from listQueries) or `queryHash` (its string form)."};let d=e.getQueryData(c),f=e.getQueryCache().find({queryKey:c,exact:true});if(d===void 0&&f&&(a!==void 0||i!==void 0)){let y=f,m=y?.state.status;return{ok:false,error:`Refused: this query has no data to edit \u2014 ${m==="error"?`it FAILED${y?.state.error?` (${y.state.error instanceof Error?y.state.error.message:String(y.state.error)})`:""}`:m==="pending"?"it has never resolved (it may be disabled, or still loading)":"it holds no data"}. There is nothing to merge into. Fix the cause first (restoreError, or let it fetch), or send force:true with the COMPLETE value if you mean to seed the cache from nothing.`,status:m}}if(a===void 0&&i===void 0)return{ok:false,error:"Refused: no change was described. Send `data` (with merge:true for a partial edit), or `path` and `value` to set one value."};let b=a;if(i!==void 0){if(l===void 0)return{ok:false,error:`Refused: sent \`path\` without \`value\`. Say what to set "${i}" to; if you mean to clear it, send value:null and the field must already be nullable.`};let y=hu(d,i,l);if(!y.ok)return{ok:false,error:`Refused: ${y.error}`};b=y.patch}if(o||i!==void 0){let y=n?{patch:b,notes:[],error:void 0}:yu(d,b);if(y.error)return{ok:false,error:`Refused: ${y.error}`};let m=y.patch;if(!n){let S=pu(d,m,{noun:"data"});if(S.length>0){let w=gu(m,S);return{ok:false,error:mu(S,"data",w),violations:S,...w?{suggestedData:w}:{}}}}let p=To(d,m),g=bu(d).filter(S=>Du(m,S));return e.setQueryData(c,p,{updatedAt:Date.now()}),{ok:true,mode:"merge",...i!==void 0?{path:i}:{},changedKeys:ct(m)?Object.keys(m):void 0,...y.notes.length?{keyed:y.notes}:{},...g.length?{unchecked:g.map(S=>`\`${S}\` was empty, so nothing in the app knows what its items look like and the shape of what you added was NOT checked. If the screen renders a field you left out, it will render undefined \u2014 read the query back and compare against how the screen uses it.`)}:{}}}if(!n&&ct(d)&&ct(a)){let y=Object.keys(d).filter(m=>!(m in a));if(y.length>0)return{ok:false,error:`Refused: the new value drops ${y.length} top-level field(s) the cached value has (${y.slice(0,8).join(", ")}${y.length>8?", \u2026":""}). A screen rendering those fields would crash. To change some fields, send merge:true with ONLY the fields that change. To really replace the whole value, send force:true.`,missingKeys:y}}return e.setQueryData(c,a,{updatedAt:Date.now()}),{ok:true,mode:"replace"}},triggerError:r=>{let a=t(r),o=a.options;a.setState({status:"error",error:new Error("Unknown error from devtools"),fetchMeta:{...a.state.fetchMeta,__previousQueryOptions:o}})},restoreError:r=>e.resetQueries(t(r)),triggerLoading:r=>{let a=t(r),o=a.options;a.fetch({...o,queryFn:()=>new Promise(()=>{}),gcTime:-1}).catch(()=>{}),a.setState({data:void 0,status:"pending",fetchMeta:{...a.state.fetchMeta,__previousQueryOptions:o}})},restoreLoading:r=>{let a=t(r),o=a.state,n=a.state.fetchMeta?a.state.fetchMeta.__previousQueryOptions:null;a.cancel({silent:true}),a.setState({...o,fetchStatus:"idle",fetchMeta:null}),n&&a.fetch(n).catch(()=>{})},clearQueryCache:()=>{let r=e.getQueryCache().getAll().filter(a=>a.getObserversCount()>0).length;return e.getQueryCache().clear(),{ok:true,cleared:true,...r?{note:`Cleared \u2014 but ${r} quer${r===1?"y is":"ies are"} still being watched by a screen, and React Query leaves those screens rendering their LAST value until something refetches. The cache is empty; the app on screen is not. Use \`reset\` on a query when you want its screen to reload.`}:{}}},clearMutationCache:()=>{e.getMutationCache().clear()},setOnline:r=>{let{online:a}=r;fr.setOnline(a)}}}}import{useEffect as Iu,useMemo as Eu}from"react";import{useQueryClient as ku}from"@tanstack/react-query";import{classifyPreviewItem as Fu,createRestoreScope as Pu,emptyRestoreResult as Ou,failedRestore as zu,registerStateSnapshotProvider as Ku,superJsonSerialize as Lu}from"@buoy-gg/shared-ui/web";function Do(e){return{...e,fetchStatus:"idle",fetchMeta:null}}function mr(e){return{status:e.state.status,error:e.state.error??null,data:e.state.data}}function gr(e,t){try{let r=JSON.stringify(e);return r.length>60?`${r.slice(0,57)}\u2026`:r}catch{return t}}function Ro(e){if(e==null)return e??null;if(typeof e=="object"){let t=e,r=typeof t.name=="string"?t.name:void 0,a=typeof t.message=="string"?t.message:void 0;if(r!==void 0||a!==void 0)return{...r!==void 0?{name:r}:{},...a!==void 0?{message:a}:{}}}return e}function Qo(e){if(e===void 0)return true;try{return Lu(e),true}catch{return false}}function Io(e){let t=[],r=[];for(let a of e.getQueryCache().getAll()){let o=gr(a.queryKey,a.queryHash);if(!Qo(a.state.data)){t.push(`query ${o}: data can't be serialized (circular reference?) \u2014 not captured`);continue}r.push({queryKey:a.queryKey,queryHash:a.queryHash,...a.meta&&Qo(a.meta)?{meta:a.meta}:{},state:Do({...a.state,error:Ro(a.state.error),fetchFailureReason:Ro(a.state.fetchFailureReason)})})}return{queries:r,warnings:t}}function Bu(e){return{id:"query",label:"React Query",status:()=>({canCapture:true,canRestore:true}),async capture(){let{queries:t,warnings:r}=Io(e),a=e.getMutationCache().getAll().length;return a>0&&r.push(`${a} mutation(s) not captured (mutation functions cannot be restored)`),{data:{queries:t},warnings:r}},async restore(t,r){let a=t,o=Pu(r),n=Ou();if(!a?.queries)return zu("empty query snapshot");let i=e.getQueryCache(),l=new Set(a.queries.map(c=>c.queryHash));for(let c of a.queries)if(o.allows(c.queryHash)){if(qo(c.state.data)){n.skipped.push({id:c.queryHash,reason:"captured as an on-device placeholder by an older Buoy \u2014 re-capture this restore point"});continue}try{let d=Do(c.state),f=i.get(c.queryHash);f?f.setState(d):i.build(e,{queryKey:c.queryKey,queryHash:c.queryHash,...c.meta&&{meta:c.meta}},d),n.applied+=1}catch(d){n.skipped.push({id:c.queryHash,reason:String(d)}),n.ok=false}}for(let c of i.getAll().slice())if(o.allows(c.queryHash)&&!l.has(c.queryHash))try{i.remove(c),n.applied+=1}catch(d){n.skipped.push({id:c.queryHash,reason:String(d)})}let s=e.getMutationCache().getAll().length;s>0&&(e.getMutationCache().clear(),n.warnings.push(`mutation cache cleared (${s} mutation(s))`));let u=o.excludedWarning("quer(y/ies)");return u&&n.warnings.push(u),n},async previewItems(t,r){let a=t?.queries??[],o=r===void 0,n=o?Io(e).queries:r?.queries??[],i=new Map(n.map(c=>[c.queryHash,c])),l=new Map(a.map(c=>[c.queryHash,c])),s=[],u=[];for(let c of a){let d=gr(c.queryKey,c.queryHash);if(qo(c.state.data)){s.push({key:c.queryHash,label:d,verdict:"wont-apply",reason:"data stayed on the device when this was captured (older Buoy) \u2014 re-capture this restore point"});continue}let f=i.get(c.queryHash);s.push(Fu({key:c.queryHash,label:d,oldValue:f?mr(f):void 0,newValue:mr(c),inOld:f!==void 0,inNew:true},{tooLargeReason:"query data too large to render a diff \u2014 restore still applies it"}))}for(let c of n)l.has(c.queryHash)||s.push({key:c.queryHash,label:gr(c.queryKey,c.queryHash),verdict:"removed",oldValue:mr(c)});if(o){let c=e.getMutationCache().getAll().length;c>0&&u.push(`${c} in-memory mutation record(s) will be cleared`)}return{items:s,notes:u}}}}function Hu(e){return Ku(Bu(e))}function Wu(){let e;try{e=ku()}catch{e=null}return Iu(()=>{if(e)return Hu(e)},[e]),Eu(()=>e?Ao(e):null,[e])}function Eo({queryState:e,observerCount:t,isStale:r}){return e.fetchStatus==="fetching"?"blue":e.status==="error"?"red":t?e.fetchStatus==="paused"?"purple":r?"yellow":"green":"gray"}import{useQueryClient as ju}from"@tanstack/react-query";import{jsx as Ot,jsxs as Ie}from"react/jsx-runtime";function ko(){try{let e=ju(),t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return Ie(h,{style:Y.container,children:[Ot(v,{style:Y.title,children:"Debug Info"}),Ot(v,{style:Y.info,children:"QueryClient: \u2705 Available"}),Ie(v,{style:Y.info,children:["Queries: ",t.length]}),Ie(v,{style:Y.info,children:["Mutations: ",r.length]}),t.length>0&&Ie(h,{style:Y.queriesList,children:[Ot(v,{style:Y.subtitle,children:"Query Keys:"}),t.slice(0,3).map((a,o)=>Ie(v,{style:Y.queryKey,children:["\u2022"," ",Array.isArray(a.queryKey)?a.queryKey.join(" - "):String(a.queryKey)]},o)),t.length>3&&Ie(v,{style:Y.more,children:["... and ",t.length-3," more"]})]})]})}catch(e){return Ie(h,{style:Y.container,children:[Ot(v,{style:Y.title,children:"Debug Info"}),Ie(v,{style:Y.error,children:["\u274C QueryClient Error: ",String(e)]})]})}}var Y=T.create({container:{padding:16,backgroundColor:"rgba(0, 0, 0, 0.3)",borderRadius:8,margin:16,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)"},title:{color:"#FFFFFF",fontSize:14,fontWeight:"600",marginBottom:8},subtitle:{color:"#E5E7EB",fontSize:12,fontWeight:"500",marginTop:8,marginBottom:4},info:{color:"#9CA3AF",fontSize:12,marginBottom:4},error:{color:"#EF4444",fontSize:12,marginBottom:4},queriesList:{marginTop:4},queryKey:{color:"#60A5FA",fontSize:11,marginLeft:8,marginBottom:2},more:{color:"#9CA3AF",fontSize:11,fontStyle:"italic",marginLeft:8}});import{jsx as Ee,jsxs as Xe}from"react/jsx-runtime";function Vu({queries:e,selectedQuery:t,isOpen:r,onClose:a,onSelect:o}){let n=i=>Array.isArray(i.queryKey)?i.queryKey.join(" - "):String(i.queryKey);return Ee(Rr,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:r,transparent:true,animationType:"fade",onRequestClose:a,children:Ee(Dr,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:L.modalOverlay,onPress:a,children:Xe(h,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:L.modalContent,children:[Xe(h,{style:L.modalHeader,children:[Ee(v,{style:L.modalTitle,children:"Select Query"}),Xe(v,{style:L.modalSubtitle,children:[e.length," ",e.length===1?"query":"queries"," ","available"]})]}),Ee(be,{accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:L.scrollView,contentContainerStyle:L.scrollViewContent,showsVerticalScrollIndicator:true,children:e.length===0?Xe(h,{style:L.emptyState,children:[Ee(v,{style:L.emptyTitle,children:"No Queries Found"}),Xe(v,{style:L.emptyDescription,children:["No React Query queries are currently active.",`
7
7
 
8
8
  `,"To see queries here:",`
9
9
  `,"\u2022 Make API calls using useQuery",`
10
10
  `,"\u2022 Ensure queries are within QueryClientProvider",`
11
- `,"\u2022 Check console for debugging info"]}),ke(Eo,{})]}):e.map((i,l)=>{let s=n(i),u=ko({queryState:i.state,observerCount:i.getObserversCount(),isStale:i.isStale()}),c={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"}[u]||"#6B7280",d=i===t;return Xe(N,{accessibilityLabel:`Query ${s}`,accessibilityHint:`View query ${s}`,"sentry-label":`ignore query ${s}`,style:[L.queryItem,d&&L.selectedQueryItem],onPress:()=>o(i),children:[ke(h,{style:[L.statusDot,{backgroundColor:c}]}),ke(v,{style:[L.queryText,d&&L.selectedQueryText],numberOfLines:1,children:s})]},`${i.queryHash}-${l}`)})})]})})})}var L=T.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},modalContent:{backgroundColor:"#1F1F1F",borderRadius:8,width:"80%",maxHeight:"80%",minHeight:"50%",borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",flex:0},modalHeader:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},modalTitle:{color:"#FFFFFF",fontSize:16,fontWeight:"600",marginBottom:4},modalSubtitle:{color:"#9CA3AF",fontSize:12},scrollView:{flex:1},scrollViewContent:{padding:8,flexGrow:1},emptyState:{padding:32,alignItems:"center",justifyContent:"center"},emptyTitle:{color:"#E5E7EB",fontSize:16,fontWeight:"500",marginBottom:8,textAlign:"center"},emptyDescription:{color:"#9CA3AF",fontSize:14,textAlign:"center",lineHeight:20},queryItem:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:4},selectedQueryItem:{backgroundColor:"rgba(255, 255, 255, 0.1)"},statusDot:{width:8,height:8,borderRadius:4,marginRight:8},queryText:{color:"#E5E7EB",fontSize:14,flex:1},selectedQueryText:{color:"#FFFFFF",fontWeight:"500"},trigger:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:4,paddingHorizontal:8,paddingVertical:6,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",minWidth:120,maxWidth:200},triggerText:{color:"#E5E7EB",fontSize:12,flex:1,marginHorizontal:6}});import{CyberpunkSectionButton as $u,buoyColors as Fo}from"@buoy-gg/shared-ui/web";import{jsx as pr}from"react/jsx-runtime";var Nu=()=>pr(h,{style:{width:24,height:24},children:pr(gs,{})});function Uu({onPress:e,getReactBuoySubtitle:t}){return pr($u,{id:"react-buoy-dev-tools",title:"QUERY",subtitle:(()=>{let r=t().match(/(\d+) queries • (\d+) mutations/);return r?`${r[1]}Q \u2022 ${r[2]}M`:"No data"})(),icon:Nu,iconColor:Fo.error,iconBackgroundColor:Fo.error+"1A",onPress:e,index:1})}import{useContext as _u,useEffect as Ju}from"react";import{QueryClientContext as Gu}from"@tanstack/react-query";function Yu(){let e=_u(Gu);return Ju(()=>{e&&(We.isConnected()||We.setQueryClient(e))},[e]),null}import{VirtualizedDataExplorer as Xu,DataViewer as Zu,TypeLegend as ec}from"@buoy-gg/shared-ui/web/dataViewer";import{useMemo as tc}from"react";import{useQueryClient as rc}from"@tanstack/react-query";import{isDevToolsStorageKey as ac}from"@buoy-gg/shared-ui/web";function Po(e){let t={mmkv:0,async:0,secure:0,total:0};return e.filter(r=>Se(r.queryKey)).forEach(r=>{let a=Wr(r.queryKey);if(a){let o=$r(r.queryKey);ac(o)||(t[a]++,t.total++)}}),t}function oc(){let e=rc();return tc(()=>{let t=e.getQueryCache().getAll();return Po(t)},[e])}function nc(e){return{getReactBuoySubtitle:()=>{try{let t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return`${t.length} queries \u2022 ${r.length} mutations`}catch{return"Data management & cache inspector"}}}}import{useState as X,useEffect as ic}from"react";import{useEffect as sc,useCallback as br}from"react";import{persistentStorage as zo}from"@buoy-gg/shared-ui/web";var dt=async(e,t)=>{await zo.setItem(e,t)},Ot=async e=>zo.getItem(e),lc=async(e,t)=>{try{await dt(`${e}_panel_dimensions`,JSON.stringify(t))}catch{}},uc=async(e,t)=>{try{await dt(`${e}_panel_height`,t.toString())}catch{}},cc=async(e,t)=>{try{await dt(`${e}_is_floating_mode`,t.toString())}catch{}},dc=async e=>{try{let[t,r,a]=await Promise.all([Ot(`${e}_panel_dimensions`),Ot(`${e}_panel_height`),Ot(`${e}_is_floating_mode`)]),o=t?JSON.parse(t):null,n=r?parseInt(r,10):null;return{dimensions:o,height:n,isFloating:a?a==="true":null}}catch{return{dimensions:null,height:null,isFloating:null}}},Oo=async(e,t)=>{try{let r=JSON.stringify(t);await dt(e,r)}catch{}},Ko=async e=>{try{let t=await Ot(e);return t&&t!==""?JSON.parse(t):null}catch{return null}},Lo=async e=>{try{await dt(e,"")}catch{}};function Bo({storagePrefix:e,isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:a=false,isSentryModalOpen:o=false,isStorageModalOpen:n=false,isNetworkModalOpen:i=false,selectedQueryKey:l,selectedSection:s,activeFilter:u,activeTab:c,selectedMutationId:d,isStateRestored:f}){let b=br(async()=>{let p={isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:a,isSentryModalOpen:o,isStorageModalOpen:n,isNetworkModalOpen:i,selectedQueryKey:l?JSON.stringify(l):void 0,selectedSection:s||void 0,activeFilter:u||void 0,activeTab:c||void 0,selectedMutationId:d?.toString()||void 0};await Oo(e,p)},[e,t,r,a,o,n,i,l,s,u,c,d]),y=br(async()=>await Ko(e),[e]),m=br(async()=>{await Lo(e)},[e]);return sc(()=>{f&&(t||r||a||o||n||i?b():m())},[t,r,a,o,n,i,l,s,u,c,d,f,b,m]),{saveCurrentState:b,loadSavedState:y,clearSavedState:m}}import{devToolsStorageKeys as yc}from"@buoy-gg/shared-ui/web";function hc(){let[e,t]=X(false),[r,a]=X(false),[o,n]=X(false),[i,l]=X(false),[s,u]=X(false),[c,d]=X(false),[f,b]=X(void 0),[y,m]=X(null),[p,g]=X(null),[S,w]=X(false),[C,q]=X("queries"),[A,j]=X(void 0),{loadSavedState:Ee}=Bo({storagePrefix:yc.modal.state(),isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:o,isSentryModalOpen:i,isStorageModalOpen:s,isNetworkModalOpen:c,selectedQueryKey:f,selectedSection:y,activeFilter:p,activeTab:C,selectedMutationId:A,isStateRestored:S});return ic(()=>{(async()=>{if(!S)try{let M=await Ee();if(M){if(t(M.isModalOpen),a(M.isDebugModalOpen),n(M.isEnvModalOpen||false),l(M.isSentryModalOpen||false),u(M.isStorageModalOpen||false),d(M.isNetworkModalOpen||false),M.selectedQueryKey)try{let oe=JSON.parse(M.selectedQueryKey);b(oe)}catch{}M.selectedSection&&m(M.selectedSection),M.activeFilter&&g(M.activeFilter),M.activeTab&&q(M.activeTab),M.selectedMutationId&&j(Number(M.selectedMutationId))}}catch{}finally{w(true)}})()},[S,Ee]),{isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:o,isSentryModalOpen:i,isStorageModalOpen:s,isNetworkModalOpen:c,selectedQueryKey:f,selectedSection:y,activeFilter:p,isStateRestored:S,activeTab:C,selectedMutationId:A,setSelectedSection:m,setActiveFilter:g,setActiveTab:q,handleModalDismiss:()=>{t(false),b(void 0)},handleDebugModalDismiss:()=>{a(false),m(null)},handleEnvModalDismiss:()=>{n(false)},handleSentryModalDismiss:()=>{l(false)},handleStorageModalDismiss:()=>{u(false)},handleNetworkModalDismiss:()=>{d(false)},handleQuerySelect:M=>{b(M?.queryKey)},handleQueryPress:()=>{t(true)},handleStatusPress:()=>{a(true)},handleEnvPress:()=>{n(true)},handleSentryPress:()=>{l(true)},handleStoragePress:()=>{u(true)},handleNetworkPress:()=>{d(true)},handleTabChange:M=>{M!==C&&(b(void 0),j(void 0),g(null)),q(M)},handleMutationSelect:M=>{j(M?.mutationId)}}}import{safeStringify as fc,displayValue as mc,parseDisplayValue as gc}from"@buoy-gg/shared-ui/web";function pc(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof Map)&&!(e instanceof Set)&&!(e instanceof RegExp)&&typeof e!="function"}export{ue as ActionButton,Hs as ClearCacheButton,$a as DataEditorModal,Va as DataEditorMode,Zu as DataViewer,me as Explorer,Ya as MutationBrowserFooter,oo as MutationBrowserModal,Ja as MutationBrowserMode,ua as MutationButton,rr as MutationDetails,da as MutationDetailsChips,co as MutationEditorModal,lo as MutationEditorMode,ha as MutationInformation,va as MutationStatusCount,ba as MutationsList,js as NetworkToggleButton,ra as QueryActions,Ur as QueryBrowser,ka as QueryBrowserFooter,La as QueryBrowserModal,Qa as QueryBrowserMode,Eo as QueryDebugInfo,Nt as QueryDetails,Gr as QueryDetailsChip,Zi as QueryInformation,Lr as QueryRow,Vu as QuerySelector,re as QueryStatus,sa as QueryStatusCount,hr as ReactQueryDevToolsModal,yo as ReactQueryModal,et as ReactQueryModalHeader,Uu as ReactQuerySection,Yu as ReactQueryTracker,Us as StorageStatusCount,ro as SwipeIndicator,ec as TypeLegend,Xu as VirtualizedDataExplorer,Pr as WifiToggle,Lo as clearModalVisibilityState,Ao as createReactQuerySyncAdapter,uu as createReactQueryTool,du as createWifiToggleTool,zr as deleteItem,$e as deleteNestedDataByPath,nu as disconnectQueryClient,mc as displayValue,$r as getCleanStorageKey,ko as getQueryStatusColor,se as getQueryStatusLabel,Po as getStorageQueryCounts,Wr as getStorageType,Vr as getStorageTypeColor,Pi as getStorageTypeHexColor,jr as getStorageTypeLabel,ta as invalidate,pc as isPlainObject,Se as isStorageQuery,Ko as loadModalVisibilityState,dc as loadPanelState,gc as parseDisplayValue,We as reactQueryEventStore,lu as reactQueryToolPreset,Jt as refetch,ea as remove,Zr as reset,fc as safeStringify,cc as saveFloatingMode,Oo as saveModalVisibilityState,lc as savePanelDimensions,uc as savePanelHeight,ou as setQueryClient,le as storageQueryKeys,Gt as triggerError,_t as triggerLoading,Ve as updateNestedDataByPath,lr as useActionButtons,ga as useAllMutations,vt as useAllQueries,cr as useGetMutationById,wr as useGetQueryByQueryKey,Bt as useGetQueryByQueryKeyWithVersion,hc as useModalManager,Bo as useModalPersistence,so as useMutationActionButtons,ia as useQueryStatusCounts,nc as useReactQueryState,Wu as useReactQuerySyncAdapter,oc as useStorageQueryCounts,Fr as useWifiState,cu as wifiTogglePreset};
11
+ `,"\u2022 Check console for debugging info"]}),Ee(ko,{})]}):e.map((i,l)=>{let s=n(i),u=Eo({queryState:i.state,observerCount:i.getObserversCount(),isStale:i.isStale()}),c={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"}[u]||"#6B7280",d=i===t;return Xe(N,{accessibilityLabel:`Query ${s}`,accessibilityHint:`View query ${s}`,"sentry-label":`ignore query ${s}`,style:[L.queryItem,d&&L.selectedQueryItem],onPress:()=>o(i),children:[Ee(h,{style:[L.statusDot,{backgroundColor:c}]}),Ee(v,{style:[L.queryText,d&&L.selectedQueryText],numberOfLines:1,children:s})]},`${i.queryHash}-${l}`)})})]})})})}var L=T.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},modalContent:{backgroundColor:"#1F1F1F",borderRadius:8,width:"80%",maxHeight:"80%",minHeight:"50%",borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",flex:0},modalHeader:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},modalTitle:{color:"#FFFFFF",fontSize:16,fontWeight:"600",marginBottom:4},modalSubtitle:{color:"#9CA3AF",fontSize:12},scrollView:{flex:1},scrollViewContent:{padding:8,flexGrow:1},emptyState:{padding:32,alignItems:"center",justifyContent:"center"},emptyTitle:{color:"#E5E7EB",fontSize:16,fontWeight:"500",marginBottom:8,textAlign:"center"},emptyDescription:{color:"#9CA3AF",fontSize:14,textAlign:"center",lineHeight:20},queryItem:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:4},selectedQueryItem:{backgroundColor:"rgba(255, 255, 255, 0.1)"},statusDot:{width:8,height:8,borderRadius:4,marginRight:8},queryText:{color:"#E5E7EB",fontSize:14,flex:1},selectedQueryText:{color:"#FFFFFF",fontWeight:"500"},trigger:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:4,paddingHorizontal:8,paddingVertical:6,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",minWidth:120,maxWidth:200},triggerText:{color:"#E5E7EB",fontSize:12,flex:1,marginHorizontal:6}});import{CyberpunkSectionButton as $u,buoyColors as Fo}from"@buoy-gg/shared-ui/web";import{jsx as pr}from"react/jsx-runtime";var Nu=()=>pr(h,{style:{width:24,height:24},children:pr(gs,{})});function Uu({onPress:e,getReactBuoySubtitle:t}){return pr($u,{id:"react-buoy-dev-tools",title:"QUERY",subtitle:(()=>{let r=t().match(/(\d+) queries • (\d+) mutations/);return r?`${r[1]}Q \u2022 ${r[2]}M`:"No data"})(),icon:Nu,iconColor:Fo.error,iconBackgroundColor:Fo.error+"1A",onPress:e,index:1})}import{useContext as _u,useEffect as Ju}from"react";import{QueryClientContext as Gu}from"@tanstack/react-query";function Yu(){let e=_u(Gu);return Ju(()=>{e&&(We.isConnected()||We.setQueryClient(e))},[e]),null}import{VirtualizedDataExplorer as Xu,DataViewer as Zu,TypeLegend as ec}from"@buoy-gg/shared-ui/web/dataViewer";import{useMemo as tc}from"react";import{useQueryClient as rc}from"@tanstack/react-query";import{isDevToolsStorageKey as ac}from"@buoy-gg/shared-ui/web";function Po(e){let t={mmkv:0,async:0,secure:0,total:0};return e.filter(r=>Se(r.queryKey)).forEach(r=>{let a=Wr(r.queryKey);if(a){let o=$r(r.queryKey);ac(o)||(t[a]++,t.total++)}}),t}function oc(){let e=rc();return tc(()=>{let t=e.getQueryCache().getAll();return Po(t)},[e])}function nc(e){return{getReactBuoySubtitle:()=>{try{let t=e.getQueryCache().getAll(),r=e.getMutationCache().getAll();return`${t.length} queries \u2022 ${r.length} mutations`}catch{return"Data management & cache inspector"}}}}import{useState as X,useEffect as ic}from"react";import{useEffect as sc,useCallback as br}from"react";import{persistentStorage as Oo}from"@buoy-gg/shared-ui/web";var dt=async(e,t)=>{await Oo.setItem(e,t)},zt=async e=>Oo.getItem(e),lc=async(e,t)=>{try{await dt(`${e}_panel_dimensions`,JSON.stringify(t))}catch{}},uc=async(e,t)=>{try{await dt(`${e}_panel_height`,t.toString())}catch{}},cc=async(e,t)=>{try{await dt(`${e}_is_floating_mode`,t.toString())}catch{}},dc=async e=>{try{let[t,r,a]=await Promise.all([zt(`${e}_panel_dimensions`),zt(`${e}_panel_height`),zt(`${e}_is_floating_mode`)]),o=t?JSON.parse(t):null,n=r?parseInt(r,10):null;return{dimensions:o,height:n,isFloating:a?a==="true":null}}catch{return{dimensions:null,height:null,isFloating:null}}},zo=async(e,t)=>{try{let r=JSON.stringify(t);await dt(e,r)}catch{}},Ko=async e=>{try{let t=await zt(e);return t&&t!==""?JSON.parse(t):null}catch{return null}},Lo=async e=>{try{await dt(e,"")}catch{}};function Bo({storagePrefix:e,isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:a=false,isSentryModalOpen:o=false,isStorageModalOpen:n=false,isNetworkModalOpen:i=false,selectedQueryKey:l,selectedSection:s,activeFilter:u,activeTab:c,selectedMutationId:d,isStateRestored:f}){let b=br(async()=>{let p={isModalOpen:t,isDebugModalOpen:r,isEnvModalOpen:a,isSentryModalOpen:o,isStorageModalOpen:n,isNetworkModalOpen:i,selectedQueryKey:l?JSON.stringify(l):void 0,selectedSection:s||void 0,activeFilter:u||void 0,activeTab:c||void 0,selectedMutationId:d?.toString()||void 0};await zo(e,p)},[e,t,r,a,o,n,i,l,s,u,c,d]),y=br(async()=>await Ko(e),[e]),m=br(async()=>{await Lo(e)},[e]);return sc(()=>{f&&(t||r||a||o||n||i?b():m())},[t,r,a,o,n,i,l,s,u,c,d,f,b,m]),{saveCurrentState:b,loadSavedState:y,clearSavedState:m}}import{devToolsStorageKeys as yc}from"@buoy-gg/shared-ui/web";function hc(){let[e,t]=X(false),[r,a]=X(false),[o,n]=X(false),[i,l]=X(false),[s,u]=X(false),[c,d]=X(false),[f,b]=X(void 0),[y,m]=X(null),[p,g]=X(null),[S,w]=X(false),[C,q]=X("queries"),[A,j]=X(void 0),{loadSavedState:ke}=Bo({storagePrefix:yc.modal.state(),isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:o,isSentryModalOpen:i,isStorageModalOpen:s,isNetworkModalOpen:c,selectedQueryKey:f,selectedSection:y,activeFilter:p,activeTab:C,selectedMutationId:A,isStateRestored:S});return ic(()=>{(async()=>{if(!S)try{let M=await ke();if(M){if(t(M.isModalOpen),a(M.isDebugModalOpen),n(M.isEnvModalOpen||false),l(M.isSentryModalOpen||false),u(M.isStorageModalOpen||false),d(M.isNetworkModalOpen||false),M.selectedQueryKey)try{let oe=JSON.parse(M.selectedQueryKey);b(oe)}catch{}M.selectedSection&&m(M.selectedSection),M.activeFilter&&g(M.activeFilter),M.activeTab&&q(M.activeTab),M.selectedMutationId&&j(Number(M.selectedMutationId))}}catch{}finally{w(true)}})()},[S,ke]),{isModalOpen:e,isDebugModalOpen:r,isEnvModalOpen:o,isSentryModalOpen:i,isStorageModalOpen:s,isNetworkModalOpen:c,selectedQueryKey:f,selectedSection:y,activeFilter:p,isStateRestored:S,activeTab:C,selectedMutationId:A,setSelectedSection:m,setActiveFilter:g,setActiveTab:q,handleModalDismiss:()=>{t(false),b(void 0)},handleDebugModalDismiss:()=>{a(false),m(null)},handleEnvModalDismiss:()=>{n(false)},handleSentryModalDismiss:()=>{l(false)},handleStorageModalDismiss:()=>{u(false)},handleNetworkModalDismiss:()=>{d(false)},handleQuerySelect:M=>{b(M?.queryKey)},handleQueryPress:()=>{t(true)},handleStatusPress:()=>{a(true)},handleEnvPress:()=>{n(true)},handleSentryPress:()=>{l(true)},handleStoragePress:()=>{u(true)},handleNetworkPress:()=>{d(true)},handleTabChange:M=>{M!==C&&(b(void 0),j(void 0),g(null)),q(M)},handleMutationSelect:M=>{j(M?.mutationId)}}}import{safeStringify as fc,displayValue as mc,parseDisplayValue as gc}from"@buoy-gg/shared-ui/web";function pc(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof Map)&&!(e instanceof Set)&&!(e instanceof RegExp)&&typeof e!="function"}export{ue as ActionButton,Hs as ClearCacheButton,$a as DataEditorModal,Va as DataEditorMode,Zu as DataViewer,me as Explorer,Ya as MutationBrowserFooter,oo as MutationBrowserModal,Ja as MutationBrowserMode,ua as MutationButton,rr as MutationDetails,da as MutationDetailsChips,co as MutationEditorModal,lo as MutationEditorMode,ha as MutationInformation,va as MutationStatusCount,ba as MutationsList,js as NetworkToggleButton,ra as QueryActions,Ur as QueryBrowser,Ea as QueryBrowserFooter,La as QueryBrowserModal,Qa as QueryBrowserMode,ko as QueryDebugInfo,Nt as QueryDetails,Gr as QueryDetailsChip,Zi as QueryInformation,Lr as QueryRow,Vu as QuerySelector,re as QueryStatus,sa as QueryStatusCount,hr as ReactQueryDevToolsModal,yo as ReactQueryModal,et as ReactQueryModalHeader,Uu as ReactQuerySection,Yu as ReactQueryTracker,Us as StorageStatusCount,ro as SwipeIndicator,ec as TypeLegend,Xu as VirtualizedDataExplorer,Pr as WifiToggle,Lo as clearModalVisibilityState,Ao as createReactQuerySyncAdapter,uu as createReactQueryTool,du as createWifiToggleTool,Or as deleteItem,$e as deleteNestedDataByPath,nu as disconnectQueryClient,mc as displayValue,$r as getCleanStorageKey,Eo as getQueryStatusColor,se as getQueryStatusLabel,Po as getStorageQueryCounts,Wr as getStorageType,Vr as getStorageTypeColor,Pi as getStorageTypeHexColor,jr as getStorageTypeLabel,ta as invalidate,pc as isPlainObject,Se as isStorageQuery,Ko as loadModalVisibilityState,dc as loadPanelState,gc as parseDisplayValue,We as reactQueryEventStore,lu as reactQueryToolPreset,Jt as refetch,ea as remove,Zr as reset,fc as safeStringify,cc as saveFloatingMode,zo as saveModalVisibilityState,lc as savePanelDimensions,uc as savePanelHeight,ou as setQueryClient,le as storageQueryKeys,Gt as triggerError,_t as triggerLoading,Ve as updateNestedDataByPath,lr as useActionButtons,ga as useAllMutations,vt as useAllQueries,cr as useGetMutationById,wr as useGetQueryByQueryKey,Bt as useGetQueryByQueryKeyWithVersion,hc as useModalManager,Bo as useModalPersistence,so as useMutationActionButtons,ia as useQueryStatusCounts,nc as useReactQueryState,Wu as useReactQuerySyncAdapter,oc as useStorageQueryCounts,Fr as useWifiState,cu as wifiTogglePreset};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/react-query",
3
- "version": "7.0.56",
3
+ "version": "7.0.57",
4
4
  "description": "TanStack Query devtools inside your React Native app — cache inspection, refetch & invalidate, offline toggle. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -39,8 +39,8 @@
39
39
  "**/checkPeer.*"
40
40
  ],
41
41
  "dependencies": {
42
- "@buoy-gg/floating-tools-core": "^7.0.56",
43
- "@buoy-gg/shared-ui": "^7.0.56"
42
+ "@buoy-gg/floating-tools-core": "^7.0.57",
43
+ "@buoy-gg/shared-ui": "^7.0.57"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@tanstack/react-query": ">=5.0.0",