@buoy-gg/redux 7.0.76 → 7.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/redux/components/ReduxActionDetailContent.js +1 -1
- package/lib/commonjs/redux/components/ReduxActionDetailView.js +1 -1
- package/lib/commonjs/redux/components/ReduxActionInfoView.js +1 -1
- package/lib/commonjs/redux/components/ReduxModal.js +1 -1
- package/lib/module/redux/components/ReduxActionDetailContent.js +1 -1
- package/lib/module/redux/components/ReduxActionDetailView.js +1 -1
- package/lib/module/redux/components/ReduxActionInfoView.js +1 -1
- package/lib/module/redux/components/ReduxModal.js +1 -1
- package/lib/web/index.mjs +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionDetailContent=ReduxActionDetailContent;exports.ReduxActionDetailFooter=ReduxActionDetailFooter;var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _ReduxDetailViewToggle=require("./ReduxDetailViewToggle");var _ReduxActionInfoView=require("./ReduxActionInfoView");var _testIDs=require("../utils/testIDs");var _reduxActionStore=require("../utils/reduxActionStore");var _jsxRuntime=require("react/jsx-runtime");function getActionColor(e){if(e.includes("/pending"))return _sharedUi.macOSColors.semantic.warning;if(e.includes("/fulfilled"))return _sharedUi.macOSColors.semantic.success;if(e.includes("/rejected"))return _sharedUi.macOSColors.semantic.error;if(e.startsWith("@@"))return _sharedUi.macOSColors.text.muted;return _sharedUi.macOSColors.semantic.info}function getActionLabel(e){if(e.includes("/pending"))return"PENDING";if(e.includes("/fulfilled"))return"FULFILLED";if(e.includes("/rejected"))return"REJECTED";if(e.startsWith("@@"))return"INTERNAL";const r=e.split("/");return r[r.length-1]?.toUpperCase()||"ACTION"}function getValueType(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";return typeof e}function formatTimestamp(e){const r=new Date(e);return r.toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}const DIFF_MODE_TABS=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function ReduxActionDetailContent({action:e,actions:r,selectedIndex:t,onIndexChange:o,disableInternalFooter:n=false,initialView:m="action"}){const[s,b]=(0,_react.useState)(m);const[x,v]=(0,_react.useState)("tree");const a=r.length;const g=(0,_reduxActionStore.isEvictedState)(e.nextState);const l=getActionColor(e.type);const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionDetailContent=ReduxActionDetailContent;exports.ReduxActionDetailFooter=ReduxActionDetailFooter;var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _ReduxDetailViewToggle=require("./ReduxDetailViewToggle");var _ReduxActionInfoView=require("./ReduxActionInfoView");var _testIDs=require("../utils/testIDs");var _reduxActionStore=require("../utils/reduxActionStore");var _jsxRuntime=require("react/jsx-runtime");function getActionColor(e){if(e.includes("/pending"))return _sharedUi.macOSColors.semantic.warning;if(e.includes("/fulfilled"))return _sharedUi.macOSColors.semantic.success;if(e.includes("/rejected"))return _sharedUi.macOSColors.semantic.error;if(e.startsWith("@@"))return _sharedUi.macOSColors.text.muted;return _sharedUi.macOSColors.semantic.info}function getActionLabel(e){if(e.includes("/pending"))return"PENDING";if(e.includes("/fulfilled"))return"FULFILLED";if(e.includes("/rejected"))return"REJECTED";if(e.startsWith("@@"))return"INTERNAL";const r=e.split("/");return r[r.length-1]?.toUpperCase()||"ACTION"}function getValueType(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";return typeof e}function formatTimestamp(e){const r=new Date(e);return r.toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}const DIFF_MODE_TABS=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function ReduxActionDetailContent({action:e,actions:r,selectedIndex:t,onIndexChange:o,disableInternalFooter:n=false,initialView:m="action"}){const[s,b]=(0,_react.useState)(m);const[x,v]=(0,_react.useState)("tree");const a=r.length;const g=(0,_reduxActionStore.isEvictedState)(e.nextState);const l=getActionColor(e.type);const d=getActionLabel(e.type);const p=getValueType((0,_sharedUi.parseValue)(e.nextState));const c=a-t;const h=c-1;const u=t<a-1?t+1:null;const i=u!==null?r[u]:null;const w=(0,_react.useMemo)(()=>({index:u??0,label:h>0?`#${h}`:"Initial",timestamp:i?formatTimestamp(i.timestamp):"",relativeTime:i?(0,_sharedUi.formatRelativeTime)(new Date(i.timestamp)):"state",badge:i?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionBadgeSmall,{backgroundColor:`${getActionColor(i.type)}20`}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.actionTextSmall,{color:getActionColor(i.type)}],children:getActionLabel(i.type)})}):void 0}),[u,i,h]);const y=(0,_react.useMemo)(()=>({index:t,label:`#${c}`,timestamp:formatTimestamp(e.timestamp),relativeTime:(0,_sharedUi.formatRelativeTime)(new Date(e.timestamp)),badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionBadgeSmall,{backgroundColor:`${l}20`}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.actionTextSmall,{color:l}],children:d})})}),[t,e.timestamp,l,d,c]);const D=(0,_react.useCallback)(()=>{if(g){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.contentCard,testID:`${_testIDs.REDUX_TEST_ID}-state-evicted`,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.valueHeader,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.valueLabel,children:"STATE AFTER ACTION"})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.evictedText,children:`Not retained. Raw state is kept for the ${_reduxActionStore.STATE_RETENTION_LIMIT} most recent actions, so this action's before/after trees have been released.`})]})}const f=(0,_sharedUi.parseValue)(e.nextState);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.contentCard,testID:`${_testIDs.REDUX_TEST_ID}-state-card`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.valueHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.valueLabel,children:"STATE AFTER ACTION"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.valueHeaderBadges,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.actionBadge,{backgroundColor:`${l}20`}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.actionText,{color:l}],children:d})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.typeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.typeText,testID:`${_testIDs.REDUX_TEST_ID}-state-type`,children:p.toUpperCase()})})]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:f,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,l,d,p,g]);const V=(0,_react.useCallback)(()=>{const f=(0,_sharedUi.parseValue)(e.prevState);const S=(0,_sharedUi.parseValue)(e.nextState);if(x==="split"){return(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:{flex:1},showsVerticalScrollIndicator:true,children:(0,_jsxRuntime.jsx)(_dataViewer.SplitDiffViewer,{oldValue:f,newValue:S,theme:_dataViewer.diffThemes.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})})}return(0,_jsxRuntime.jsx)(_dataViewer.TreeDiffViewer,{oldValue:f,newValue:S})},[e.prevState,e.nextState,x]);const C=(0,_react.useCallback)(()=>{o(Math.min(a-1,t+1))},[t,a,o]);const E=(0,_react.useCallback)(()=>{o(Math.max(0,t-1))},[t,o]);const j=g||(0,_reduxActionStore.isEvictedState)(e.prevState)||e.prevState===void 0;const T=!n&&a>1;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsx)(_ReduxDetailViewToggle.ReduxDetailViewToggle,{activeView:s,onViewChange:b,diffDisabled:j}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.contentArea,T&&styles.contentAreaFooterPad],children:[s==="action"&&(0,_jsxRuntime.jsx)(_ReduxActionInfoView.ReduxActionInfoView,{action:e}),s==="state"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.stateContainer,children:D()}),s==="diff"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffContainer,testID:`${_testIDs.REDUX_TEST_ID}-diff`,children:[(0,_jsxRuntime.jsx)(_sharedUi.DiffModeTabs,{tabs:DIFF_MODE_TABS,activeTab:x,onTabChange:v,testIDPrefix:`${_testIDs.REDUX_TEST_ID}-diff-tab`}),(0,_jsxRuntime.jsx)(_sharedUi.CompareBar,{leftEvent:w,rightEvent:y}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.diffContent,testID:`${_testIDs.REDUX_TEST_ID}-diff-content`,children:V()})]})]}),T&&(0,_jsxRuntime.jsx)(_sharedUi.EventStepperFooter,{currentIndex:c-1,totalItems:a,onPrevious:C,onNext:E,itemLabel:"Action",subtitle:(0,_sharedUi.formatRelativeTime)(new Date(e.timestamp)),absolute:true})]})}function ReduxActionDetailFooter({action:e,actions:r,selectedIndex:t,onIndexChange:o}){const n=r.length;if(n<=1)return null;const m=n-t;return(0,_jsxRuntime.jsx)(_sharedUi.EventStepperFooter,{currentIndex:m-1,totalItems:n,onPrevious:()=>o(Math.min(n-1,t+1)),onNext:()=>o(Math.max(0,t-1)),itemLabel:"Action",subtitle:(0,_sharedUi.formatRelativeTime)(new Date(e.timestamp))})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},contentArea:{flex:1},contentAreaFooterPad:{paddingBottom:96},stateContainer:{flex:1,padding:14},contentCard:{backgroundColor:_sharedUi.night.color.surface,borderRadius:14,padding:14,borderWidth:1,borderColor:_sharedUi.night.color.border},valueHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:8},valueLabel:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:_sharedUi.monoFont,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},valueBox:{backgroundColor:_sharedUi.night.color.bg,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.border,padding:8},evictedText:{fontSize:12,color:_sharedUi.night.color.textSecondary,lineHeight:18},valueText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:_sharedUi.monoFont},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionDetailView=ReduxActionDetailView;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function ReduxActionDetailView({action:e}){const[o,i]=(0,_react.useState)("action");const t=[{key:"action",label:"Action"},{key:"state",label:"State"},{key:"diff",label:"Diff"}];const n=new Date(e.timestamp).toLocaleTimeString();const d=()=>{return JSON.stringify({type:e.type,payload:e.payload,timestamp:e.timestamp,duration:e.duration,hasStateChange:e.hasStateChange},null,2)};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionType,numberOfLines:2,children:e.type}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerMeta,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.metaText,children:n}),e.duration!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.changeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.changeBadgeText,children:"State Changed"})})]})]}),(0,_jsxRuntime.jsx)(_sharedUi.CopyButton,{value:d(),size:16})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.tabContainer,children:(0,_jsxRuntime.jsx)(_sharedUi.TabSelector,{tabs:t,activeTab:o,onTabChange:c=>i(c)})}),(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.content,showsVerticalScrollIndicator:true,children:[o==="action"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.payload}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No payload"})}),(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Full Action",defaultOpen:false,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.action})})]}),o==="state"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Previous State",defaultOpen:false,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.prevState})}),(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Next State",defaultOpen:true,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.nextState})})]}),o==="diff"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:e.hasStateChange?(0,_jsxRuntime.jsx)(StateDiff,{prevState:e.prevState,nextState:e.nextState}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangeContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangeText,children:"No state changes from this action"})})})]})]})}function StateDiff({prevState:e,nextState:o}){const i=findChanges(e,o);if(i.length===0){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangeContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangeText,children:"No differences detected"})})}return(0,_jsxRuntime.jsx)(_reactNative.View,{children:i.map((t,n)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffItem,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.diffTypeBadge,{backgroundColor:t.type==="added"?_sharedUi.macOSColors.semantic.successBackground:t.type==="removed"?_sharedUi.macOSColors.semantic.errorBackground:_sharedUi.macOSColors.semantic.warningBackground}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.diffTypeText,{color:t.type==="added"?_sharedUi.macOSColors.semantic.success:t.type==="removed"?_sharedUi.macOSColors.semantic.error:_sharedUi.macOSColors.semantic.warning}],children:t.type.toUpperCase()})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffPath,children:t.path})]}),t.type==="modified"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffValues,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffValue,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffLabel,children:"Before:"}),(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.oldValue})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffValue,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffLabel,children:"After:"}),(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.newValue})]})]}),t.type==="added"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.diffValue,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.newValue})}),t.type==="removed"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.diffValue,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.oldValue})})]},n))})}function findChanges(e,o,i=""){const t=[];if(typeof e!=="object"||typeof o!=="object"){if(e!==o){t.push({type:"modified",path:i||"root",oldValue:e,newValue:o})}return t}if(e===null||o===null){if(e!==o){t.push({type:"modified",path:i||"root",oldValue:e,newValue:o})}return t}const n=e;const d=o;const c=new Set([...Object.keys(n),...Object.keys(d)]);for(const l of c){const s=i?`${i}.${l}`:l;const a=n[l];const r=d[l];if(!(l in n)){t.push({type:"added",path:s,newValue:r})}else if(!(l in d)){t.push({type:"removed",path:s,oldValue:a})}else if(a!==r){if(typeof a==="object"&&typeof r==="object"&&a!==null&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)){if(s.split(".").length<3){t.push(...findChanges(a,r,s))}else{t.push({type:"modified",path:s,oldValue:a,newValue:r})}}else{t.push({type:"modified",path:s,oldValue:a,newValue:r})}}}return t}const styles=_reactNative.StyleSheet.create({container:{flex:1},header:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:12,backgroundColor:_sharedUi.night.color.surface,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},headerContent:{flex:1,marginRight:12},actionType:{fontSize:14,fontWeight:"600",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:_sharedUi.night.color.textTertiary},durationText:{fontSize:11,color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},changeBadge:{backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,paddingHorizontal:6,paddingVertical:2,borderRadius:4},changeBadgeText:{fontSize:10,color:_sharedUi.macOSColors.semantic.warning,fontWeight:"600"},tabContainer:{paddingHorizontal:12,paddingVertical:8},content:{flex:1},section:{paddingHorizontal:12,paddingBottom:20},emptyText:{fontSize:12,color:_sharedUi.night.color.textTertiary,fontStyle:"italic",padding:8},noChangeContainer:{padding:20,alignItems:"center"},noChangeText:{fontSize:13,color:_sharedUi.night.color.textTertiary},diffItem:{marginBottom:12,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},diffHeader:{flexDirection:"row",alignItems:"center",gap:8,padding:8,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},diffTypeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},diffTypeText:{fontSize:10,fontWeight:"700"},diffPath:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:_sharedUi.night.color.textTertiary,marginBottom:4,fontWeight:"600"}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionDetailView=ReduxActionDetailView;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function ReduxActionDetailView({action:e}){const[o,i]=(0,_react.useState)("action");const t=[{key:"action",label:"Action"},{key:"state",label:"State"},{key:"diff",label:"Diff"}];const n=new Date(e.timestamp).toLocaleTimeString();const d=()=>{return JSON.stringify({type:e.type,payload:e.payload,timestamp:e.timestamp,duration:e.duration,hasStateChange:e.hasStateChange},null,2)};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionType,numberOfLines:2,children:e.type}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerMeta,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.metaText,children:n}),e.duration!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.changeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.changeBadgeText,children:"State Changed"})})]})]}),(0,_jsxRuntime.jsx)(_sharedUi.CopyButton,{value:d(),size:16})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.tabContainer,children:(0,_jsxRuntime.jsx)(_sharedUi.TabSelector,{tabs:t,activeTab:o,onTabChange:c=>i(c)})}),(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.content,showsVerticalScrollIndicator:true,children:[o==="action"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.payload}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.emptyText,children:"No payload"})}),(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Full Action",defaultOpen:false,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.action})})]}),o==="state"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Previous State",defaultOpen:false,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.prevState})}),(0,_jsxRuntime.jsx)(_sharedUi.CollapsibleSection,{title:"Next State",defaultOpen:true,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:e.nextState})})]}),o==="diff"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:e.hasStateChange?(0,_jsxRuntime.jsx)(StateDiff,{prevState:e.prevState,nextState:e.nextState}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangeContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangeText,children:"No state changes from this action"})})})]})]})}function StateDiff({prevState:e,nextState:o}){const i=findChanges(e,o);if(i.length===0){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangeContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangeText,children:"No differences detected"})})}return(0,_jsxRuntime.jsx)(_reactNative.View,{children:i.map((t,n)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffItem,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.diffTypeBadge,{backgroundColor:t.type==="added"?_sharedUi.macOSColors.semantic.successBackground:t.type==="removed"?_sharedUi.macOSColors.semantic.errorBackground:_sharedUi.macOSColors.semantic.warningBackground}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.diffTypeText,{color:t.type==="added"?_sharedUi.macOSColors.semantic.success:t.type==="removed"?_sharedUi.macOSColors.semantic.error:_sharedUi.macOSColors.semantic.warning}],children:t.type.toUpperCase()})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffPath,children:t.path})]}),t.type==="modified"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffValues,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffValue,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffLabel,children:"Before:"}),(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.oldValue})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.diffValue,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.diffLabel,children:"After:"}),(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.newValue})]})]}),t.type==="added"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.diffValue,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.newValue})}),t.type==="removed"&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.diffValue,children:(0,_jsxRuntime.jsx)(_sharedUi.DataInspector,{data:t.oldValue})})]},n))})}function findChanges(e,o,i=""){const t=[];if(typeof e!=="object"||typeof o!=="object"){if(e!==o){t.push({type:"modified",path:i||"root",oldValue:e,newValue:o})}return t}if(e===null||o===null){if(e!==o){t.push({type:"modified",path:i||"root",oldValue:e,newValue:o})}return t}const n=e;const d=o;const c=new Set([...Object.keys(n),...Object.keys(d)]);for(const l of c){const s=i?`${i}.${l}`:l;const a=n[l];const r=d[l];if(!(l in n)){t.push({type:"added",path:s,newValue:r})}else if(!(l in d)){t.push({type:"removed",path:s,oldValue:a})}else if(a!==r){if(typeof a==="object"&&typeof r==="object"&&a!==null&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)){if(s.split(".").length<3){t.push(...findChanges(a,r,s))}else{t.push({type:"modified",path:s,oldValue:a,newValue:r})}}else{t.push({type:"modified",path:s,oldValue:a,newValue:r})}}}return t}const styles=_reactNative.StyleSheet.create({container:{flex:1},header:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:12,backgroundColor:_sharedUi.night.color.surface,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},headerContent:{flex:1,marginRight:12},actionType:{fontSize:14,fontWeight:"600",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:_sharedUi.night.color.textTertiary},durationText:{fontSize:11,color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},changeBadge:{backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,paddingHorizontal:6,paddingVertical:2,borderRadius:4},changeBadgeText:{fontSize:10,color:_sharedUi.macOSColors.semantic.warning,fontWeight:"600"},tabContainer:{paddingHorizontal:12,paddingVertical:8},content:{flex:1},section:{paddingHorizontal:12,paddingBottom:20},emptyText:{fontSize:12,color:_sharedUi.night.color.textTertiary,fontStyle:"italic",padding:8},noChangeContainer:{padding:20,alignItems:"center"},noChangeText:{fontSize:13,color:_sharedUi.night.color.textTertiary},diffItem:{marginBottom:12,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},diffHeader:{flexDirection:"row",alignItems:"center",gap:8,padding:8,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},diffTypeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},diffTypeText:{fontSize:10,fontWeight:"700"},diffPath:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:_sharedUi.night.color.textTertiary,marginBottom:4,fontWeight:"600"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionInfoView=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _reduxActionStore=require("../utils/reduxActionStore");var _buoyReduxMiddleware=require("../utils/buoyReduxMiddleware");var _ReduxActionButton=require("./ReduxActionButton");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(n,e){if("function"==typeof WeakMap)var a=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(t,i){if(!i&&t&&t.__esModule)return t;var r,c,l={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return l;if(r=i?o:a){if(r.has(t))return r.get(t);r.set(t,l)}for(const s in t)"default"!==s&&{}.hasOwnProperty.call(t,s)&&((c=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,s))&&(c.get||c.set)?r(l,s,c):l[s]=t[s]);return l})(n,e)}function getCategoryInfo(n){switch(n){case"pending":return{label:"PENDING",color:_sharedUi.buoyColors.warning,bgColor:_sharedUi.buoyColors.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:_sharedUi.buoyColors.success,bgColor:_sharedUi.buoyColors.success+"26"};case"rejected":return{label:"REJECTED",color:_sharedUi.buoyColors.error,bgColor:_sharedUi.buoyColors.error+"26"};case"internal":return{label:"INTERNAL",color:_sharedUi.buoyColors.textMuted,bgColor:_sharedUi.buoyColors.textMuted+"26"};case"query":return{label:"QUERY",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};case"mutation":return{label:"MUTATION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};default:return{label:"ACTION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"}}}function formatDuration(n){if(n===void 0)return"N/A";if(n<1)return"<1ms";return`${n.toFixed(1)}ms`}function SectionHeader({icon:n,title:e,badge:a,testID:o}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,testID:o,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeaderLeft,children:[(0,_jsxRuntime.jsx)(n,{size:14,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:e})]}),a]})}function formatTime(n){const e=new Date(n);const a=e.getHours().toString().padStart(2,"0");const o=e.getMinutes().toString().padStart(2,"0");const t=e.getSeconds().toString().padStart(2,"0");const i=e.getMilliseconds().toString().padStart(3,"0");return`${a}:${o}:${t}.${i}`}const ReduxActionInfoView=exports.ReduxActionInfoView=(0,_react.memo)(function n({action:e,onNavigateToAction:a}){const o=(0,_license.useIsPro)();const[t,i]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{if(t&&o){i(false)}},[t,o]);const r=getCategoryInfo(e.category);const c=(0,_reduxActionStore.isEvictedState)(e.nextState);const l=(0,_buoyReduxMiddleware.isTimeTravelAvailable)();const s=c||!l;const h=e.payload!==void 0;const b=e.meta&&Object.keys(e.meta).length>0;const T=e.error!==void 0;const u=(0,_react.useMemo)(()=>{return _reduxActionStore.reduxActionStore.getLinkedActions(e)},[e]);const p=u.length>1;const C=p?_reduxActionStore.reduxActionStore.getBaseActionType(e.type):null;const f=e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationDuration(e.meta.requestId):null;const D=(0,_react.useCallback)(async()=>{if(!o){i(true);return}await(0,_sharedUi.copyToClipboard)(e.action)},[e,o]);const w=(0,_react.useCallback)(async()=>{if(!o){i(true);return}await(0,_sharedUi.copyToClipboard)(e.payload)},[e.payload,o]);const m=(0,_react.useCallback)(()=>{if(e.action&&typeof e.action==="object"&&"type"in e.action){(0,_buoyReduxMiddleware.replayAction)(e.action)}},[e]);const j=(0,_react.useCallback)(()=>{if(e.nextState!==void 0){(0,_buoyReduxMiddleware.jumpToState)(e.nextState)}},[e]);return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{testID:`${_testIDs.REDUX_TEST_ID}-detail-scroll`,style:styles.container,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:false,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-info-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Info,title:"ACTION INFO"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Type",value:e.type,mono:true,testID:`${_testIDs.REDUX_TEST_ID}-info-type`}),e.sliceName&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Slice",value:e.sliceName,mono:true,testID:`${_testIDs.REDUX_TEST_ID}-info-slice`}),(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Action",value:e.actionName,mono:true,testID:`${_testIDs.REDUX_TEST_ID}-info-action`}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:r.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:r.color}],testID:`${_testIDs.REDUX_TEST_ID}-info-category`,children:r.label})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.durationBadge,e.isSlowAction&&styles.durationBadgeSlow],children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:e.isSlowAction?_sharedUi.buoyColors.error:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.durationText,e.isSlowAction&&styles.durationTextSlow],testID:`${_testIDs.REDUX_TEST_ID}-info-duration`,children:formatDuration(e.duration)}),e.isSlowAction&&(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:10,color:_sharedUi.buoyColors.error})]}),e.hasStateChange?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.changesBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:10,color:_sharedUi.buoyColors.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.changesText,testID:`${_testIDs.REDUX_TEST_ID}-info-changes`,children:e.diffSummary||"changed"})]}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangesBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangesText,testID:`${_testIDs.REDUX_TEST_ID}-info-no-changes`,children:"no change"})})]})]})]}),p&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-async-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC FLOW",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.asyncBadge,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.asyncBadgeText,testID:`${_testIDs.REDUX_TEST_ID}-async-count`,children:[u.length," ACTIONS"]})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.baseActionType,testID:`${_testIDs.REDUX_TEST_ID}-async-base`,children:C}),f!==null&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.totalDurationRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.totalDurationLabel,children:"Total Duration"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.totalDurationValue,testID:`${_testIDs.REDUX_TEST_ID}-async-total`,children:[f,"ms"]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timeline,children:u.map((d,g)=>{const y=getCategoryInfo(d.category);const x=d.id===e.id;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.timelineItem,x&&styles.timelineItemCurrent],onPress:()=>a?.(d),disabled:x||!a,activeOpacity:.7,testID:`${_testIDs.REDUX_TEST_ID}-async-step-${g}`,children:[g<u.length-1&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineConnector}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineDot,{backgroundColor:y.color}]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineStatusBadge,{backgroundColor:y.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.timelineStatusText,{color:y.color}],testID:`${_testIDs.REDUX_TEST_ID}-async-step-${g}-status`,children:y.label})}),x&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.currentBadge,testID:`${_testIDs.REDUX_TEST_ID}-async-step-${g}-current`,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.currentBadgeText,children:"CURRENT"})})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineTime,children:formatTime(d.timestamp)})]})]},d.id)})})]})]}),h&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-payload-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Box,title:"PAYLOAD",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.typeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload==="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),b&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-meta-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC METADATA",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:r.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:r.color}],children:"RTK THUNK"})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[e.meta?.requestId&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:r.color,testID:`${_testIDs.REDUX_TEST_ID}-meta-status`}),e.meta?.arg!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.argSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argLabel,children:"Original Argument"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.argValueContainer,children:typeof e.meta.arg==="object"?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Rejected With Value",value:"true",valueColor:_sharedUi.buoyColors.error}),e.meta?.aborted&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Aborted",value:"true",valueColor:_sharedUi.buoyColors.warning}),e.meta?.condition&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Condition",value:"true",valueColor:_sharedUi.night.color.textTertiary})]})]}),T&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.card,styles.errorCard],testID:`${_testIDs.REDUX_TEST_ID}-error-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.AlertCircle,title:"ERROR",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorBadgeText,testID:`${_testIDs.REDUX_TEST_ID}-error-badge`,children:"REJECTED"})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:typeof e.error==="object"?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:String(e.error)})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-full-action-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.FileText,title:"FULL ACTION OBJECT"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionFooter,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionsGrid,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"replay",text:"REPLAY",onPress:m,testID:`${_testIDs.REDUX_TEST_ID}-replay`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:"Dispatch again"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"jump",text:"JUMP",onPress:j,disabled:s,testID:`${_testIDs.REDUX_TEST_ID}-jump`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,testID:`${_testIDs.REDUX_TEST_ID}-jump-description`,children:c?"State not retained":l?"Restore this state":"Time travel not wired"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY ACTION",onPress:D,testID:`${_testIDs.REDUX_TEST_ID}-copy-action`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy to clipboard":"Pro feature"})]}),h&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY PAYLOAD",onPress:w,testID:`${_testIDs.REDUX_TEST_ID}-copy-payload`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy payload only":"Pro feature"})]})]})}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:t,onClose:()=>i(false),featureName:"Copy"})]})});const styles=_reactNative.StyleSheet.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:_sharedUi.buoyColors.error+"4D",shadowColor:_sharedUi.buoyColors.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",backgroundColor:_sharedUi.night.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:_sharedUi.night.color.accent,fontFamily:_sharedUi.monoFont},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},durationBadgeSlow:{backgroundColor:_sharedUi.buoyColors.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont},durationTextSlow:{color:_sharedUi.buoyColors.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:_sharedUi.night.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:_sharedUi.night.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},dataViewerContainer:{backgroundColor:_sharedUi.night.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:_sharedUi.night.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:_sharedUi.night.color.bg,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},argValue:{fontSize:11,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.buoyColors.error,letterSpacing:.3},errorText:{fontSize:12,color:_sharedUi.buoyColors.error,fontFamily:_sharedUi.monoFont,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.night.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},totalDurationLabel:{fontSize:11,color:_sharedUi.night.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:_sharedUi.buoyColors.success,fontFamily:_sharedUi.monoFont},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:_sharedUi.night.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:_sharedUi.night.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:_sharedUi.night.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:_sharedUi.night.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},actionFooter:{backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:_sharedUi.night.color.textTertiary,textAlign:"center"}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReduxActionInfoView=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _reduxActionStore=require("../utils/reduxActionStore");var _buoyReduxMiddleware=require("../utils/buoyReduxMiddleware");var _ReduxActionButton=require("./ReduxActionButton");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireWildcard(n,e){if("function"==typeof WeakMap)var a=new WeakMap,o=new WeakMap;return(_interopRequireWildcard=function(t,i){if(!i&&t&&t.__esModule)return t;var r,c,l={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return l;if(r=i?o:a){if(r.has(t))return r.get(t);r.set(t,l)}for(const s in t)"default"!==s&&{}.hasOwnProperty.call(t,s)&&((c=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,s))&&(c.get||c.set)?r(l,s,c):l[s]=t[s]);return l})(n,e)}function getCategoryInfo(n){switch(n){case"pending":return{label:"PENDING",color:_sharedUi.buoyColors.warning,bgColor:_sharedUi.buoyColors.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:_sharedUi.buoyColors.success,bgColor:_sharedUi.buoyColors.success+"26"};case"rejected":return{label:"REJECTED",color:_sharedUi.buoyColors.error,bgColor:_sharedUi.buoyColors.error+"26"};case"internal":return{label:"INTERNAL",color:_sharedUi.buoyColors.textMuted,bgColor:_sharedUi.buoyColors.textMuted+"26"};case"query":return{label:"QUERY",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};case"mutation":return{label:"MUTATION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"};default:return{label:"ACTION",color:_sharedUi.buoyColors.info,bgColor:_sharedUi.buoyColors.info+"26"}}}function formatDuration(n){if(n===void 0)return"N/A";if(n<1)return"<1ms";return`${n.toFixed(1)}ms`}function SectionHeader({icon:n,title:e,badge:a,testID:o}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeader,testID:o,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sectionHeaderLeft,children:[(0,_jsxRuntime.jsx)(n,{size:14,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:e})]}),a]})}function formatTime(n){const e=new Date(n);const a=e.getHours().toString().padStart(2,"0");const o=e.getMinutes().toString().padStart(2,"0");const t=e.getSeconds().toString().padStart(2,"0");const i=e.getMilliseconds().toString().padStart(3,"0");return`${a}:${o}:${t}.${i}`}const ReduxActionInfoView=exports.ReduxActionInfoView=(0,_react.memo)(function n({action:e,onNavigateToAction:a}){const o=(0,_license.useIsPro)();const[t,i]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{if(t&&o){i(false)}},[t,o]);const r=getCategoryInfo(e.category);const c=(0,_reduxActionStore.isEvictedState)(e.nextState);const l=(0,_buoyReduxMiddleware.isTimeTravelAvailable)();const s=c||!l;const h=e.payload!==void 0;const b=e.meta&&Object.keys(e.meta).length>0;const T=e.error!==void 0;const u=(0,_react.useMemo)(()=>{return _reduxActionStore.reduxActionStore.getLinkedActions(e)},[e]);const p=u.length>1;const C=p?_reduxActionStore.reduxActionStore.getBaseActionType(e.type):null;const f=e.meta?.requestId?_reduxActionStore.reduxActionStore.getAsyncOperationDuration(e.meta.requestId):null;const D=(0,_react.useCallback)(async()=>{if(!o){i(true);return}await(0,_sharedUi.copyToClipboard)(e.action)},[e,o]);const w=(0,_react.useCallback)(async()=>{if(!o){i(true);return}await(0,_sharedUi.copyToClipboard)(e.payload)},[e.payload,o]);const m=(0,_react.useCallback)(()=>{if(e.action&&typeof e.action==="object"&&"type"in e.action){(0,_buoyReduxMiddleware.replayAction)(e.action)}},[e]);const j=(0,_react.useCallback)(()=>{if(e.nextState!==void 0){(0,_buoyReduxMiddleware.jumpToState)(e.nextState)}},[e]);return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",testID:`${_testIDs.REDUX_TEST_ID}-detail-scroll`,style:styles.container,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:false,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-info-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Info,title:"ACTION INFO"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Type",value:e.type,mono:true,testID:`${_testIDs.REDUX_TEST_ID}-info-type`}),e.sliceName&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Slice",value:e.sliceName,mono:true,testID:`${_testIDs.REDUX_TEST_ID}-info-slice`}),(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Action",value:e.actionName,mono:true,testID:`${_testIDs.REDUX_TEST_ID}-info-action`}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.badgeRow,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:r.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:r.color}],testID:`${_testIDs.REDUX_TEST_ID}-info-category`,children:r.label})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.durationBadge,e.isSlowAction&&styles.durationBadgeSlow],children:[(0,_jsxRuntime.jsx)(_sharedUi.Clock,{size:10,color:e.isSlowAction?_sharedUi.buoyColors.error:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.durationText,e.isSlowAction&&styles.durationTextSlow],testID:`${_testIDs.REDUX_TEST_ID}-info-duration`,children:formatDuration(e.duration)}),e.isSlowAction&&(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:10,color:_sharedUi.buoyColors.error})]}),e.hasStateChange?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.changesBadge,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:10,color:_sharedUi.buoyColors.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.changesText,testID:`${_testIDs.REDUX_TEST_ID}-info-changes`,children:e.diffSummary||"changed"})]}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.noChangesBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.noChangesText,testID:`${_testIDs.REDUX_TEST_ID}-info-no-changes`,children:"no change"})})]})]})]}),p&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-async-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC FLOW",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.asyncBadge,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.asyncBadgeText,testID:`${_testIDs.REDUX_TEST_ID}-async-count`,children:[u.length," ACTIONS"]})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.baseActionType,testID:`${_testIDs.REDUX_TEST_ID}-async-base`,children:C}),f!==null&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.totalDurationRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.totalDurationLabel,children:"Total Duration"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.totalDurationValue,testID:`${_testIDs.REDUX_TEST_ID}-async-total`,children:[f,"ms"]})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timeline,children:u.map((d,g)=>{const y=getCategoryInfo(d.category);const x=d.id===e.id;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.timelineItem,x&&styles.timelineItemCurrent],onPress:()=>a?.(d),disabled:x||!a,activeOpacity:.7,testID:`${_testIDs.REDUX_TEST_ID}-async-step-${g}`,children:[g<u.length-1&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.timelineConnector}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineDot,{backgroundColor:y.color}]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timelineHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.timelineStatusBadge,{backgroundColor:y.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.timelineStatusText,{color:y.color}],testID:`${_testIDs.REDUX_TEST_ID}-async-step-${g}-status`,children:y.label})}),x&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.currentBadge,testID:`${_testIDs.REDUX_TEST_ID}-async-step-${g}-current`,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.currentBadgeText,children:"CURRENT"})})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timelineTime,children:formatTime(d.timestamp)})]})]},d.id)})})]})]}),h&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-payload-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Box,title:"PAYLOAD",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.typeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload==="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),b&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-meta-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.Hash,title:"ASYNC METADATA",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.categoryBadge,{backgroundColor:r.bgColor}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.categoryText,{color:r.color}],children:"RTK THUNK"})})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardContent,children:[e.meta?.requestId&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:r.color,testID:`${_testIDs.REDUX_TEST_ID}-meta-status`}),e.meta?.arg!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.argSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argLabel,children:"Original Argument"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.argValueContainer,children:typeof e.meta.arg==="object"?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Rejected With Value",value:"true",valueColor:_sharedUi.buoyColors.error}),e.meta?.aborted&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Aborted",value:"true",valueColor:_sharedUi.buoyColors.warning}),e.meta?.condition&&(0,_jsxRuntime.jsx)(_sharedUi.InfoRow,{label:"Condition",value:"true",valueColor:_sharedUi.night.color.textTertiary})]})]}),T&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.card,styles.errorCard],testID:`${_testIDs.REDUX_TEST_ID}-error-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.AlertCircle,title:"ERROR",badge:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.errorBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorBadgeText,testID:`${_testIDs.REDUX_TEST_ID}-error-badge`,children:"REJECTED"})})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:typeof e.error==="object"?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:String(e.error)})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,testID:`${_testIDs.REDUX_TEST_ID}-full-action-card`,children:[(0,_jsxRuntime.jsx)(SectionHeader,{icon:_sharedUi.FileText,title:"FULL ACTION OBJECT"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataViewerContainer,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:(0,_sharedUi.parseValue)(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionFooter,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionsGrid,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"replay",text:"REPLAY",onPress:m,testID:`${_testIDs.REDUX_TEST_ID}-replay`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:"Dispatch again"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"jump",text:"JUMP",onPress:j,disabled:s,testID:`${_testIDs.REDUX_TEST_ID}-jump`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,testID:`${_testIDs.REDUX_TEST_ID}-jump-description`,children:c?"State not retained":l?"Restore this state":"Time travel not wired"})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY ACTION",onPress:D,testID:`${_testIDs.REDUX_TEST_ID}-copy-action`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy to clipboard":"Pro feature"})]}),h&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionButtonWrapper,children:[(0,_jsxRuntime.jsx)(_ReduxActionButton.ReduxActionButton,{type:"copy",text:"COPY PAYLOAD",onPress:w,testID:`${_testIDs.REDUX_TEST_ID}-copy-payload`}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.actionDescription,children:o?"Copy payload only":"Pro feature"})]})]})}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:t,onClose:()=>i(false),featureName:"Copy"})]})});const styles=_reactNative.StyleSheet.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:_sharedUi.buoyColors.error+"4D",shadowColor:_sharedUi.buoyColors.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accent+"33",backgroundColor:_sharedUi.night.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:_sharedUi.night.color.accent,fontFamily:_sharedUi.monoFont},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},durationBadgeSlow:{backgroundColor:_sharedUi.buoyColors.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:_sharedUi.night.color.textSecondary,fontFamily:_sharedUi.monoFont},durationTextSlow:{color:_sharedUi.buoyColors.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:_sharedUi.buoyColors.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:_sharedUi.night.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:_sharedUi.night.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},dataViewerContainer:{backgroundColor:_sharedUi.night.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:_sharedUi.night.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:_sharedUi.night.color.bg,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"},argValue:{fontSize:11,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.buoyColors.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.buoyColors.error,letterSpacing:.3},errorText:{fontSize:12,color:_sharedUi.buoyColors.error,fontFamily:_sharedUi.monoFont,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:_sharedUi.night.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:_sharedUi.night.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},totalDurationLabel:{fontSize:11,color:_sharedUi.night.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:_sharedUi.buoyColors.success,fontFamily:_sharedUi.monoFont},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:_sharedUi.night.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:_sharedUi.night.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:_sharedUi.night.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:_sharedUi.night.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:_sharedUi.night.color.textTertiary,fontFamily:_sharedUi.monoFont},actionFooter:{backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:_sharedUi.night.color.textTertiary,textAlign:"center"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FREE_TIER_ACTION_LIMIT=void 0;exports.ReduxModal=ReduxModal;exports.ReduxToolView=ReduxToolView;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _useReduxActions=require("../hooks/useReduxActions");var _reduxActionStore=require("../utils/reduxActionStore");var _useAutoInstrumentRedux=require("../hooks/useAutoInstrumentRedux");var _ReduxActionItem=require("./ReduxActionItem");var _ReduxActionDetailContent=require("./ReduxActionDetailContent");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const FREE_TIER_ACTION_LIMIT=exports.FREE_TIER_ACTION_LIMIT=_sharedUi.TIER_LIMITS["redux.actions"].free;function EmptyState({isEnabled:s,query:b,totalActions:h}){const T=(0,_sharedUi.resolveListEmptyState)({subject:"actions",search:b,total:h,capturing:s,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{...T,testID:`${_testIDs.REDUX_TEST_ID}-empty`})}function ReduxModal({visible:s,onClose:b,onBack:h,onMinimize:T,enableSharedModalDimensions:U=false,inline:$=false,onActionSelect:y,initialSelectedActionId:a,initialDetailView:z}){const H=(0,_license.useIsPro)();const g=(0,_sharedUi.useLimit)("redux.actions");const[O,C]=(0,_react.useState)(false);const{isInstrumented:R,isLoading:se,error:V,isReactReduxAvailable:X,captureMechanism:W}=(0,_useAutoInstrumentRedux.useAutoInstrumentRedux)();const{filteredActions:o,filter:x,setFilter:c,stats:i,clearActions:q,isEnabled:I,toggleCapture:N}=(0,_useReduxActions.useReduxActions)();const r=(0,_react.useMemo)(()=>o.slice(0,g),[o,g]);const d=(0,_react.useMemo)(()=>Math.max(0,o.length-g),[o.length,g]);const F=d>0;const[S,p]=(0,_react.useState)(null);const l=(0,_react.useMemo)(()=>{if(S===null)return null;const e=r.findIndex(t=>t.id===S);return e>=0?e:null},[S,r]);const n=l!==null?r[l]:null;const m=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{if(!y)return;const e=n?.id??null;if(e===null||e===m.current)return;m.current=e;y(n)},[n,y]);const E=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{if(!a)return;if(E.current===a)return;const e=r.findIndex(t=>t.id===a);if(e<0)return;E.current=a;p(a)},[a,r]);const[u,_]=(0,_react.useState)("");const[j,f]=(0,_react.useState)(false);const ae=(0,_react.useRef)(null);const K=(0,_react.useRef)(null);const G=(0,_react.useCallback)(e=>{},[]);const J=e=>{_(e);c(t=>({...t,searchText:e}))};const Q=(0,_react.useCallback)(()=>{_("");c(e=>({...e,searchText:""}));f(false)},[c]);const A=(0,_react.useCallback)(e=>{p(e.id)},[]);const Z=(0,_react.useCallback)(()=>{C(true)},[]);const Y=(0,_react.useCallback)(()=>{p(null)},[]);const w=(0,_react.useCallback)(e=>{const t=r[e];if(t)p(t.id)},[r]);const ee=async()=>{if(!H){C(true);return}const e=o.map(t=>({id:t.id,type:t.type,...t.payload!==void 0&&{payload:t.payload},timestamp:t.timestamp,prevState:t.prevState,nextState:t.nextState,hasStateChange:t.hasStateChange}));await(0,_sharedUi.copyToClipboard)(e)};const te=(0,_react.useCallback)(e=>e.id,[]);const k=(0,_react.useMemo)(()=>(0,_testIDs.buildActionRowTestIDs)(r),[r]);const v=(0,_react.useMemo)(()=>{const e=new Map;for(const t of _reduxActionStore.reduxActionStore.getActions()){const D=t.meta?.requestId;if(!D)continue;e.set(D,(e.get(D)??0)+1)}return e},[o]);const oe=(0,_react.useCallback)(({item:e})=>{const t=e.meta?.requestId;return(0,_jsxRuntime.jsx)(_ReduxActionItem.ReduxActionItem,{action:e,onPress:A,linkedCount:t?v.get(t)??0:0,testID:k.get(e.id)})},[A,k,v]);const B=()=>{if(n){return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:Y}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:n.type,centered:true,testID:`${_testIDs.REDUX_TEST_ID}-detail-title`})]})}return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[h&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:h}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"",children:j?(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Search,{value:u,onChangeText:J,onCancel:Q,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${_testIDs.REDUX_TEST_ID}-search-field`,containerTestID:`${_testIDs.REDUX_TEST_ID}-search`,clearTestID:`${_testIDs.REDUX_TEST_ID}-search-clear`,onBlur:()=>{if(u.length===0)f(false)}}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChipRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,!x.onlyWithChanges&&styles.headerChipActive],onPress:()=>c(e=>({...e,onlyWithChanges:false})),testID:`${_testIDs.REDUX_TEST_ID}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${i.totalActions} captured`,accessibilityState:{selected:!x.onlyWithChanges},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerChipLabel,children:"ALL"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.night.color.text}],testID:`${_testIDs.REDUX_TEST_ID}-chip-all-value`,children:i.totalActions})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,x.onlyWithChanges&&styles.headerChipActive],onPress:()=>c(e=>({...e,onlyWithChanges:true})),testID:`${_testIDs.REDUX_TEST_ID}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${i.actionsWithChanges} of them`,accessibilityState:{selected:!!x.onlyWithChanges},children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.warning}],testID:`${_testIDs.REDUX_TEST_ID}-chip-changed-value`,children:i.actionsWithChanges})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChip,testID:`${_testIDs.REDUX_TEST_ID}-chip-types`,accessibilityLabel:`${i.uniqueActionTypes} distinct action types`,children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle,{size:12,color:_sharedUi.macOSColors.semantic.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.success}],testID:`${_testIDs.REDUX_TEST_ID}-chip-types-value`,children:i.uniqueActionTypes})]})]})}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[!j&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>f(true),style:[styles.headerActionButton,u.length>0&&styles.headerActionButtonActive],testID:`${_testIDs.REDUX_TEST_ID}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:14,color:u.length>0?_sharedUi.night.color.accent:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:ee,style:[styles.headerActionButton,o.length===0&&styles.headerActionButtonDisabled],disabled:o.length===0,testID:`${_testIDs.REDUX_TEST_ID}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:o.length===0},children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:o.length>0?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})}),(0,_jsxRuntime.jsx)(_sharedUi.PowerToggleButton,{isEnabled:I,onToggle:N,accessibilityLabel:"Toggle Redux action capture",testID:`${_testIDs.REDUX_TEST_ID}-power`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:q,style:[styles.headerActionButton,o.length===0&&styles.headerActionButtonDisabled],disabled:o.length===0,testID:`${_testIDs.REDUX_TEST_ID}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:o.length===0},children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:14,color:o.length>0?_sharedUi.night.color.textTertiary:_sharedUi.night.color.textTertiary})})]})]})};const re=U?_sharedUi.devToolsStorageKeys.modal.root():"buoy-redux-modal";if(!s)return null;const M=n&&l!==null?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailFooter,{action:n,actions:r,selectedIndex:l,onIndexChange:w}):null;const ne=n&&r.length>1?68:0;const ie=n==null;const L=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:n&&l!==null?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailContent,{action:n,actions:r,selectedIndex:l,onIndexChange:w,disableInternalFooter:true,initialView:z}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[V&&!R&&!_reduxActionStore.reduxActionStore.isCaptureSuppressed()&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBanner,testID:`${_testIDs.REDUX_TEST_ID}-banner-error`,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:14,color:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:X?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!I&&R&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,testID:`${_testIDs.REDUX_TEST_ID}-banner-disabled`,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Action capture is disabled"})]}),W==="patch"&&!_reduxActionStore.reduxActionStore.isCaptureSuppressed()&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,testID:`${_testIDs.REDUX_TEST_ID}-banner-patch`,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:14,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),F&&(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.lockedBanner,onPress:Z,activeOpacity:.8,testID:`${_testIDs.REDUX_TEST_ID}-locked`,accessibilityRole:"button",accessibilityLabel:`${d} older ${d===1?"action":"actions"} locked. Upgrade to see them.`,children:[(0,_jsxRuntime.jsx)(_sharedUi.Lock,{size:14,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.lockedText,testID:`${_testIDs.REDUX_TEST_ID}-locked-text`,children:[d," older ",d===1?"action":"actions"," locked"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.upgradeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.upgradeBadgeText,children:"UPGRADE"})})]}),r.length>0?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{ref:K,testID:`${_testIDs.REDUX_TEST_ID}-list`,data:r,renderItem:oe,keyExtractor:te,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:true,..._sharedUi.EVENT_LIST_PRESET}):(0,_jsxRuntime.jsx)(EmptyState,{isEnabled:I,query:u,totalActions:i.totalActions})]})});const P=(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:O,onClose:()=>C(false),featureName:"Full Action History"});if($){return(0,_jsxRuntime.jsxs)(_sharedUi.TickProvider,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.inlineRoot,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.inlineHeader,..._sharedUi.windowDragProps,children:B()}),L,M]}),P]})}return(0,_jsxRuntime.jsxs)(_sharedUi.TickProvider,{children:[(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:s,onClose:b,onMinimize:T,persistenceKey:re,header:{showToggleButton:true,customContent:B()},onModeChange:G,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:ie,styles:{},footer:M,footerHeight:ne,children:L}),P]})}function ReduxToolView(s={}){return(0,_jsxRuntime.jsx)(ReduxModal,{...s,inline:true,visible:true,onClose:()=>{}})}const styles=_reactNative.StyleSheet.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:_sharedUi.night.color.border},headerChipActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:_sharedUi.night.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:_sharedUi.monoFont},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:_sharedUi.night.color.surfaceElevated,borderWidth:1,borderColor:_sharedUi.night.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},startButton:{backgroundColor:_sharedUi.macOSColors.semantic.successBackground,borderColor:_sharedUi.macOSColors.semantic.success+"40"},stopButton:{backgroundColor:_sharedUi.macOSColors.semantic.errorBackground,borderColor:_sharedUi.macOSColors.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.danger+"20"},errorText:{color:_sharedUi.night.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.warning+"20"},disabledText:{color:_sharedUi.night.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.accentBorder},lockedText:{color:_sharedUi.night.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:_sharedUi.night.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:_sharedUi.night.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FREE_TIER_ACTION_LIMIT=void 0;exports.ReduxModal=ReduxModal;exports.ReduxToolView=ReduxToolView;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _useReduxActions=require("../hooks/useReduxActions");var _reduxActionStore=require("../utils/reduxActionStore");var _useAutoInstrumentRedux=require("../hooks/useAutoInstrumentRedux");var _ReduxActionItem=require("./ReduxActionItem");var _ReduxActionDetailContent=require("./ReduxActionDetailContent");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const FREE_TIER_ACTION_LIMIT=exports.FREE_TIER_ACTION_LIMIT=_sharedUi.TIER_LIMITS["redux.actions"].free;function EmptyState({isEnabled:i,query:b,totalActions:h}){const T=(0,_sharedUi.resolveListEmptyState)({subject:"actions",search:b,total:h,capturing:i,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{...T,testID:`${_testIDs.REDUX_TEST_ID}-empty`})}function ReduxModal({visible:i,onClose:b,onBack:h,onMinimize:T,enableSharedModalDimensions:U=false,inline:$=false,onActionSelect:y,initialSelectedActionId:a,initialDetailView:z}){const H=(0,_license.useIsPro)();const g=(0,_sharedUi.useLimit)("redux.actions");const[O,C]=(0,_react.useState)(false);const{isInstrumented:R,isLoading:ie,error:V,isReactReduxAvailable:X,captureMechanism:W}=(0,_useAutoInstrumentRedux.useAutoInstrumentRedux)();const{filteredActions:o,filter:x,setFilter:c,stats:s,clearActions:q,isEnabled:I,toggleCapture:N}=(0,_useReduxActions.useReduxActions)();const r=(0,_react.useMemo)(()=>o.slice(0,g),[o,g]);const d=(0,_react.useMemo)(()=>Math.max(0,o.length-g),[o.length,g]);const F=d>0;const[S,p]=(0,_react.useState)(null);const l=(0,_react.useMemo)(()=>{if(S===null)return null;const e=r.findIndex(t=>t.id===S);return e>=0?e:null},[S,r]);const n=l!==null?r[l]:null;const m=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{if(!y)return;const e=n?.id??null;if(e===null||e===m.current)return;m.current=e;y(n)},[n,y]);const E=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{if(!a)return;if(E.current===a)return;const e=r.findIndex(t=>t.id===a);if(e<0)return;E.current=a;p(a)},[a,r]);const[u,_]=(0,_react.useState)("");const[j,f]=(0,_react.useState)(false);const ae=(0,_react.useRef)(null);const K=(0,_react.useRef)(null);const G=(0,_react.useCallback)(e=>{},[]);const J=e=>{_(e);c(t=>({...t,searchText:e}))};const Q=(0,_react.useCallback)(()=>{_("");c(e=>({...e,searchText:""}));f(false)},[c]);const A=(0,_react.useCallback)(e=>{p(e.id)},[]);const Z=(0,_react.useCallback)(()=>{C(true)},[]);const Y=(0,_react.useCallback)(()=>{p(null)},[]);const w=(0,_react.useCallback)(e=>{const t=r[e];if(t)p(t.id)},[r]);const ee=async()=>{if(!H){C(true);return}const e=o.map(t=>({id:t.id,type:t.type,...t.payload!==void 0&&{payload:t.payload},timestamp:t.timestamp,prevState:t.prevState,nextState:t.nextState,hasStateChange:t.hasStateChange}));await(0,_sharedUi.copyToClipboard)(e)};const te=(0,_react.useCallback)(e=>e.id,[]);const k=(0,_react.useMemo)(()=>(0,_testIDs.buildActionRowTestIDs)(r),[r]);const v=(0,_react.useMemo)(()=>{const e=new Map;for(const t of _reduxActionStore.reduxActionStore.getActions()){const D=t.meta?.requestId;if(!D)continue;e.set(D,(e.get(D)??0)+1)}return e},[o]);const oe=(0,_react.useCallback)(({item:e})=>{const t=e.meta?.requestId;return(0,_jsxRuntime.jsx)(_ReduxActionItem.ReduxActionItem,{action:e,onPress:A,linkedCount:t?v.get(t)??0:0,testID:k.get(e.id)})},[A,k,v]);const B=()=>{if(n){return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:Y}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:n.type,centered:true,testID:`${_testIDs.REDUX_TEST_ID}-detail-title`})]})}return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[h&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:h}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"",children:j?(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Search,{value:u,onChangeText:J,onCancel:Q,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${_testIDs.REDUX_TEST_ID}-search-field`,containerTestID:`${_testIDs.REDUX_TEST_ID}-search`,clearTestID:`${_testIDs.REDUX_TEST_ID}-search-clear`,onBlur:()=>{if(u.length===0)f(false)}}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChipRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,!x.onlyWithChanges&&styles.headerChipActive],onPress:()=>c(e=>({...e,onlyWithChanges:false})),testID:`${_testIDs.REDUX_TEST_ID}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${s.totalActions} captured`,accessibilityState:{selected:!x.onlyWithChanges},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerChipLabel,children:"ALL"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.night.color.text}],testID:`${_testIDs.REDUX_TEST_ID}-chip-all-value`,children:s.totalActions})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:[styles.headerChip,x.onlyWithChanges&&styles.headerChipActive],onPress:()=>c(e=>({...e,onlyWithChanges:true})),testID:`${_testIDs.REDUX_TEST_ID}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${s.actionsWithChanges} of them`,accessibilityState:{selected:!!x.onlyWithChanges},children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:12,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.warning}],testID:`${_testIDs.REDUX_TEST_ID}-chip-changed-value`,children:s.actionsWithChanges})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerChip,testID:`${_testIDs.REDUX_TEST_ID}-chip-types`,accessibilityLabel:`${s.uniqueActionTypes} distinct action types`,children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckCircle,{size:12,color:_sharedUi.macOSColors.semantic.success}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.headerChipValue,{color:_sharedUi.macOSColors.semantic.success}],testID:`${_testIDs.REDUX_TEST_ID}-chip-types-value`,children:s.uniqueActionTypes})]})]})}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[!j&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>f(true),style:[styles.headerActionButton,u.length>0&&styles.headerActionButtonActive],testID:`${_testIDs.REDUX_TEST_ID}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:14,color:u.length>0?_sharedUi.night.color.accent:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:ee,style:[styles.headerActionButton,o.length===0&&styles.headerActionButtonDisabled],disabled:o.length===0,testID:`${_testIDs.REDUX_TEST_ID}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:o.length===0},children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:o.length>0?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})}),(0,_jsxRuntime.jsx)(_sharedUi.PowerToggleButton,{isEnabled:I,onToggle:N,accessibilityLabel:"Toggle Redux action capture",testID:`${_testIDs.REDUX_TEST_ID}-power`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:q,style:[styles.headerActionButton,o.length===0&&styles.headerActionButtonDisabled],disabled:o.length===0,testID:`${_testIDs.REDUX_TEST_ID}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:o.length===0},children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:14,color:o.length>0?_sharedUi.night.color.textTertiary:_sharedUi.night.color.textTertiary})})]})]})};const re=U?_sharedUi.devToolsStorageKeys.modal.root():"buoy-redux-modal";if(!i)return null;const M=n&&l!==null?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailFooter,{action:n,actions:r,selectedIndex:l,onIndexChange:w}):null;const ne=n&&r.length>1?68:0;const se=n==null;const L=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:n&&l!==null?(0,_jsxRuntime.jsx)(_ReduxActionDetailContent.ReduxActionDetailContent,{action:n,actions:r,selectedIndex:l,onIndexChange:w,disableInternalFooter:true,initialView:z}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[V&&!R&&!_reduxActionStore.reduxActionStore.isCaptureSuppressed()&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.errorBanner,testID:`${_testIDs.REDUX_TEST_ID}-banner-error`,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:14,color:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:X?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!I&&R&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,testID:`${_testIDs.REDUX_TEST_ID}-banner-disabled`,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Action capture is disabled"})]}),W==="patch"&&!_reduxActionStore.reduxActionStore.isCaptureSuppressed()&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,testID:`${_testIDs.REDUX_TEST_ID}-banner-patch`,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:14,color:_sharedUi.night.color.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),F&&(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.lockedBanner,onPress:Z,activeOpacity:.8,testID:`${_testIDs.REDUX_TEST_ID}-locked`,accessibilityRole:"button",accessibilityLabel:`${d} older ${d===1?"action":"actions"} locked. Upgrade to see them.`,children:[(0,_jsxRuntime.jsx)(_sharedUi.Lock,{size:14,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.lockedText,testID:`${_testIDs.REDUX_TEST_ID}-locked-text`,children:[d," older ",d===1?"action":"actions"," locked"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.upgradeBadge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.upgradeBadgeText,children:"UPGRADE"})})]}),r.length>0?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",ref:K,testID:`${_testIDs.REDUX_TEST_ID}-list`,data:r,renderItem:oe,keyExtractor:te,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:true,..._sharedUi.EVENT_LIST_PRESET}):(0,_jsxRuntime.jsx)(EmptyState,{isEnabled:I,query:u,totalActions:s.totalActions})]})});const P=(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:O,onClose:()=>C(false),featureName:"Full Action History"});if($){return(0,_jsxRuntime.jsxs)(_sharedUi.TickProvider,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.inlineRoot,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.inlineHeader,..._sharedUi.windowDragProps,children:B()}),L,M]}),P]})}return(0,_jsxRuntime.jsxs)(_sharedUi.TickProvider,{children:[(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:i,onClose:b,onMinimize:T,persistenceKey:re,header:{showToggleButton:true,customContent:B()},onModeChange:G,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:se,styles:{},footer:M,footerHeight:ne,children:L}),P]})}function ReduxToolView(i={}){return(0,_jsxRuntime.jsx)(ReduxModal,{...i,inline:true,visible:true,onClose:()=>{}})}const styles=_reactNative.StyleSheet.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:_sharedUi.night.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:_sharedUi.night.color.border},headerChipActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:_sharedUi.night.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:_sharedUi.monoFont},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:_sharedUi.night.color.surfaceElevated,borderWidth:1,borderColor:_sharedUi.night.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},startButton:{backgroundColor:_sharedUi.macOSColors.semantic.successBackground,borderColor:_sharedUi.macOSColors.semantic.success+"40"},stopButton:{backgroundColor:_sharedUi.macOSColors.semantic.errorBackground,borderColor:_sharedUi.macOSColors.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.danger+"20"},errorText:{color:_sharedUi.night.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.warning+"20"},disabledText:{color:_sharedUi.night.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.night.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.accentBorder},lockedText:{color:_sharedUi.night.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:_sharedUi.night.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:_sharedUi.night.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{View as o,Text as d,StyleSheet as X,ScrollView as q}from"react-native";import{useState as L,useCallback as v,useMemo as B}from"react";import{macOSColors as g,night as l,EventStepperFooter as
|
|
1
|
+
"use strict";import{View as o,Text as d,StyleSheet as X,ScrollView as q}from"react-native";import{useState as L,useCallback as v,useMemo as B}from"react";import{macOSColors as g,night as l,EventStepperFooter as k,formatRelativeTime as D,parseValue as w,monoFont as h}from"@buoy-gg/shared-ui";import{DataViewer as K,SplitDiffViewer as Q,TreeDiffViewer as Y,diffThemes as Z}from"@buoy-gg/shared-ui/dataViewer";import{ReduxDetailViewToggle as ee}from"./ReduxDetailViewToggle";import{ReduxActionInfoView as te}from"./ReduxActionInfoView";import{DiffModeTabs as re,CompareBar as oe}from"@buoy-gg/shared-ui";import{REDUX_TEST_ID as p}from"../utils/testIDs";import{isEvictedState as H,STATE_RETENTION_LIMIT as ne}from"../utils/reduxActionStore";import{jsx as t,jsxs as c}from"react/jsx-runtime";function F(e){if(e.includes("/pending"))return g.semantic.warning;if(e.includes("/fulfilled"))return g.semantic.success;if(e.includes("/rejected"))return g.semantic.error;if(e.startsWith("@@"))return g.text.muted;return g.semantic.info}function M(e){if(e.includes("/pending"))return"PENDING";if(e.includes("/fulfilled"))return"FULFILLED";if(e.includes("/rejected"))return"REJECTED";if(e.startsWith("@@"))return"INTERNAL";const i=e.split("/");return i[i.length-1]?.toUpperCase()||"ACTION"}function ie(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";return typeof e}function $(e){const i=new Date(e);return i.toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}const ae=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];export function ReduxActionDetailContent({action:e,actions:i,selectedIndex:n,onIndexChange:s,disableInternalFooter:f=false,initialView:C="action"}){const[b,z]=L(C);const[E,W]=L("tree");const u=i.length;const A=H(e.nextState);const m=F(e.type);const T=M(e.type);const N=ie(w(e.nextState));const y=u-n;const V=y-1;const S=n<u-1?n+1:null;const a=S!==null?i[S]:null;const P=B(()=>({index:S??0,label:V>0?`#${V}`:"Initial",timestamp:a?$(a.timestamp):"",relativeTime:a?D(new Date(a.timestamp)):"state",badge:a?t(o,{style:[r.actionBadgeSmall,{backgroundColor:`${F(a.type)}20`}],children:t(d,{style:[r.actionTextSmall,{color:F(a.type)}],children:M(a.type)})}):void 0}),[S,a,V]);const _=B(()=>({index:n,label:`#${y}`,timestamp:$(e.timestamp),relativeTime:D(new Date(e.timestamp)),badge:t(o,{style:[r.actionBadgeSmall,{backgroundColor:`${m}20`}],children:t(d,{style:[r.actionTextSmall,{color:m}],children:T})})}),[n,e.timestamp,m,T,y]);const j=v(()=>{if(A){return c(o,{style:r.contentCard,testID:`${p}-state-evicted`,children:[t(o,{style:r.valueHeader,children:t(d,{style:r.valueLabel,children:"STATE AFTER ACTION"})}),t(d,{style:r.evictedText,children:`Not retained. Raw state is kept for the ${ne} most recent actions, so this action's before/after trees have been released.`})]})}const x=w(e.nextState);return c(o,{style:r.contentCard,testID:`${p}-state-card`,children:[c(o,{style:r.valueHeader,children:[t(d,{style:r.valueLabel,children:"STATE AFTER ACTION"}),c(o,{style:r.valueHeaderBadges,children:[t(o,{style:[r.actionBadge,{backgroundColor:`${m}20`}],children:t(d,{style:[r.actionText,{color:m}],children:T})}),t(o,{style:r.typeBadge,children:t(d,{style:r.typeText,testID:`${p}-state-type`,children:N.toUpperCase()})})]})]}),t(o,{style:r.dataViewerContainer,children:t(K,{title:"",data:x,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,m,T,N,A]);const O=v(()=>{const x=w(e.prevState);const I=w(e.nextState);if(E==="split"){return t(q,{keyboardShouldPersistTaps:"handled",style:{flex:1},showsVerticalScrollIndicator:true,children:t(Q,{oldValue:x,newValue:I,theme:Z.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})})}return t(Y,{oldValue:x,newValue:I})},[e.prevState,e.nextState,E]);const U=v(()=>{s(Math.min(u-1,n+1))},[n,u,s]);const G=v(()=>{s(Math.max(0,n-1))},[n,s]);const J=A||H(e.prevState)||e.prevState===void 0;const R=!f&&u>1;return c(o,{style:r.container,children:[t(ee,{activeView:b,onViewChange:z,diffDisabled:J}),c(o,{style:[r.contentArea,R&&r.contentAreaFooterPad],children:[b==="action"&&t(te,{action:e}),b==="state"&&t(o,{style:r.stateContainer,children:j()}),b==="diff"&&c(o,{style:r.diffContainer,testID:`${p}-diff`,children:[t(re,{tabs:ae,activeTab:E,onTabChange:W,testIDPrefix:`${p}-diff-tab`}),t(oe,{leftEvent:P,rightEvent:_}),t(o,{style:r.diffContent,testID:`${p}-diff-content`,children:O()})]})]}),R&&t(k,{currentIndex:y-1,totalItems:u,onPrevious:U,onNext:G,itemLabel:"Action",subtitle:D(new Date(e.timestamp)),absolute:true})]})}export function ReduxActionDetailFooter({action:e,actions:i,selectedIndex:n,onIndexChange:s}){const f=i.length;if(f<=1)return null;const C=f-n;return t(k,{currentIndex:C-1,totalItems:f,onPrevious:()=>s(Math.min(f-1,n+1)),onNext:()=>s(Math.max(0,n-1)),itemLabel:"Action",subtitle:D(new Date(e.timestamp))})}const r=X.create({container:{flex:1,backgroundColor:"transparent"},contentArea:{flex:1},contentAreaFooterPad:{paddingBottom:96},stateContainer:{flex:1,padding:14},contentCard:{backgroundColor:l.color.surface,borderRadius:14,padding:14,borderWidth:1,borderColor:l.color.border},valueHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:8},valueLabel:{fontSize:10,color:l.color.textSecondary,fontFamily:h,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:h,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:l.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:l.color.textTertiary,fontFamily:h},valueBox:{backgroundColor:l.color.bg,borderRadius:6,borderWidth:1,borderColor:l.color.border,padding:8},evictedText:{fontSize:12,color:l.color.textSecondary,lineHeight:18},valueText:{fontSize:12,color:l.color.text,fontFamily:h,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:h},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as V}from"react";import{View as
|
|
1
|
+
"use strict";import{useState as V}from"react";import{View as a,Text as d,StyleSheet as S,ScrollView as w}from"react-native";import{macOSColors as y,night as l,TabSelector as B,DataInspector as h,CollapsibleSection as b,CopyButton as k,monoFont as T}from"@buoy-gg/shared-ui";import{jsx as e,jsxs as i}from"react/jsx-runtime";export function ReduxActionDetailView({action:o}){const[n,s]=V("action");const r=[{key:"action",label:"Action"},{key:"state",label:"State"},{key:"diff",label:"Diff"}];const u=new Date(o.timestamp).toLocaleTimeString();const g=()=>{return JSON.stringify({type:o.type,payload:o.payload,timestamp:o.timestamp,duration:o.duration,hasStateChange:o.hasStateChange},null,2)};return i(a,{style:t.container,children:[i(a,{style:t.header,children:[i(a,{style:t.headerContent,children:[e(d,{style:t.actionType,numberOfLines:2,children:o.type}),i(a,{style:t.headerMeta,children:[e(d,{style:t.metaText,children:u}),o.duration!==void 0&&i(d,{style:t.durationText,children:[o.duration.toFixed(2),"ms"]}),o.hasStateChange&&e(a,{style:t.changeBadge,children:e(d,{style:t.changeBadgeText,children:"State Changed"})})]})]}),e(k,{value:g(),size:16})]}),e(a,{style:t.tabContainer,children:e(B,{tabs:r,activeTab:n,onTabChange:x=>s(x)})}),i(w,{keyboardShouldPersistTaps:"handled",style:t.content,showsVerticalScrollIndicator:true,children:[n==="action"&&i(a,{style:t.section,children:[e(b,{title:"Payload",defaultOpen:true,children:o.payload!==void 0?e(h,{data:o.payload}):e(d,{style:t.emptyText,children:"No payload"})}),e(b,{title:"Full Action",defaultOpen:false,children:e(h,{data:o.action})})]}),n==="state"&&i(a,{style:t.section,children:[e(b,{title:"Previous State",defaultOpen:false,children:e(h,{data:o.prevState})}),e(b,{title:"Next State",defaultOpen:true,children:e(h,{data:o.nextState})})]}),n==="diff"&&e(a,{style:t.section,children:o.hasStateChange?e(z,{prevState:o.prevState,nextState:o.nextState}):e(a,{style:t.noChangeContainer,children:e(d,{style:t.noChangeText,children:"No state changes from this action"})})})]})]})}function z({prevState:o,nextState:n}){const s=C(o,n);if(s.length===0){return e(a,{style:t.noChangeContainer,children:e(d,{style:t.noChangeText,children:"No differences detected"})})}return e(a,{children:s.map((r,u)=>i(a,{style:t.diffItem,children:[i(a,{style:t.diffHeader,children:[e(a,{style:[t.diffTypeBadge,{backgroundColor:r.type==="added"?y.semantic.successBackground:r.type==="removed"?y.semantic.errorBackground:y.semantic.warningBackground}],children:e(d,{style:[t.diffTypeText,{color:r.type==="added"?y.semantic.success:r.type==="removed"?y.semantic.error:y.semantic.warning}],children:r.type.toUpperCase()})}),e(d,{style:t.diffPath,children:r.path})]}),r.type==="modified"&&i(a,{style:t.diffValues,children:[i(a,{style:t.diffValue,children:[e(d,{style:t.diffLabel,children:"Before:"}),e(h,{data:r.oldValue})]}),i(a,{style:t.diffValue,children:[e(d,{style:t.diffLabel,children:"After:"}),e(h,{data:r.newValue})]})]}),r.type==="added"&&e(a,{style:t.diffValue,children:e(h,{data:r.newValue})}),r.type==="removed"&&e(a,{style:t.diffValue,children:e(h,{data:r.oldValue})})]},u))})}function C(o,n,s=""){const r=[];if(typeof o!=="object"||typeof n!=="object"){if(o!==n){r.push({type:"modified",path:s||"root",oldValue:o,newValue:n})}return r}if(o===null||n===null){if(o!==n){r.push({type:"modified",path:s||"root",oldValue:o,newValue:n})}return r}const u=o;const g=n;const x=new Set([...Object.keys(u),...Object.keys(g)]);for(const p of x){const m=s?`${s}.${p}`:p;const c=u[p];const f=g[p];if(!(p in u)){r.push({type:"added",path:m,newValue:f})}else if(!(p in g)){r.push({type:"removed",path:m,oldValue:c})}else if(c!==f){if(typeof c==="object"&&typeof f==="object"&&c!==null&&f!==null&&!Array.isArray(c)&&!Array.isArray(f)){if(m.split(".").length<3){r.push(...C(c,f,m))}else{r.push({type:"modified",path:m,oldValue:c,newValue:f})}}else{r.push({type:"modified",path:m,oldValue:c,newValue:f})}}}return r}const t=S.create({container:{flex:1},header:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:12,backgroundColor:l.color.surface,borderBottomWidth:1,borderBottomColor:l.color.border},headerContent:{flex:1,marginRight:12},actionType:{fontSize:14,fontWeight:"600",color:l.color.text,fontFamily:T,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:l.color.textTertiary},durationText:{fontSize:11,color:l.color.textTertiary,fontFamily:T},changeBadge:{backgroundColor:y.semantic.warningBackground,paddingHorizontal:6,paddingVertical:2,borderRadius:4},changeBadgeText:{fontSize:10,color:y.semantic.warning,fontWeight:"600"},tabContainer:{paddingHorizontal:12,paddingVertical:8},content:{flex:1},section:{paddingHorizontal:12,paddingBottom:20},emptyText:{fontSize:12,color:l.color.textTertiary,fontStyle:"italic",padding:8},noChangeContainer:{padding:20,alignItems:"center"},noChangeText:{fontSize:13,color:l.color.textTertiary},diffItem:{marginBottom:12,backgroundColor:l.color.surface,borderRadius:8,borderWidth:1,borderColor:l.color.border,overflow:"hidden"},diffHeader:{flexDirection:"row",alignItems:"center",gap:8,padding:8,borderBottomWidth:1,borderBottomColor:l.color.border},diffTypeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},diffTypeText:{fontSize:10,fontWeight:"700"},diffPath:{fontSize:12,color:l.color.text,fontFamily:T},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:l.color.textTertiary,marginBottom:4,fontWeight:"600"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import ye,{memo as U,useMemo as Y,useCallback as x,useState as q,useEffect as J}from"react";import{View as r,Text as c,StyleSheet as _,ScrollView as G,TouchableOpacity as K}from"react-native";import{buoyColors as n,night as a,Clock as Q,AlertTriangle as X,Zap as Z,Hash as W,Info as ee,Box as te,AlertCircle as oe,FileText as re,parseValue as D,ProUpgradeModal as ae,copyToClipboard as v,InfoRow as g,monoFont as u}from"@buoy-gg/shared-ui";import{useIsPro as ne}from"@buoy-gg/license";import{DataViewer as w}from"@buoy-gg/shared-ui/dataViewer";import{reduxActionStore as R,isEvictedState as le}from"../utils/reduxActionStore";import{jumpToState as ie,replayAction as ce,isTimeTravelAvailable as de}from"../utils/buoyReduxMiddleware";import{ReduxActionButton as I}from"./ReduxActionButton";import{REDUX_TEST_ID as l}from"../utils/testIDs";import{jsx as t,jsxs as i}from"react/jsx-runtime";function O(s){switch(s){case"pending":return{label:"PENDING",color:n.warning,bgColor:n.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:n.success,bgColor:n.success+"26"};case"rejected":return{label:"REJECTED",color:n.error,bgColor:n.error+"26"};case"internal":return{label:"INTERNAL",color:n.textMuted,bgColor:n.textMuted+"26"};case"query":return{label:"QUERY",color:n.info,bgColor:n.info+"26"};case"mutation":return{label:"MUTATION",color:n.info,bgColor:n.info+"26"};default:return{label:"ACTION",color:n.info,bgColor:n.info+"26"}}}function se(s){if(s===void 0)return"N/A";if(s<1)return"<1ms";return`${s.toFixed(1)}ms`}function f({icon:s,title:o,badge:y,testID:d}){return i(r,{style:e.sectionHeader,testID:d,children:[i(r,{style:e.sectionHeaderLeft,children:[t(s,{size:14,color:a.color.accent}),t(c,{style:e.sectionTitle,children:o})]}),y]})}function ge(s){const o=new Date(s);const y=o.getHours().toString().padStart(2,"0");const d=o.getMinutes().toString().padStart(2,"0");const m=o.getSeconds().toString().padStart(2,"0");const p=o.getMilliseconds().toString().padStart(3,"0");return`${y}:${d}:${m}.${p}`}export const ReduxActionInfoView=U(function s({action:o,onNavigateToAction:y}){const d=ne();const[m,p]=q(false);J(()=>{if(m&&d){p(false)}},[m,d]);const h=O(o.category);const A=le(o.nextState);const $=de();const k=A||!$;const z=o.payload!==void 0;const H=o.meta&&Object.keys(o.meta).length>0;const F=o.error!==void 0;const C=Y(()=>{return R.getLinkedActions(o)},[o]);const V=C.length>1;const P=V?R.getBaseActionType(o.type):null;const E=o.meta?.requestId?R.getAsyncOperationDuration(o.meta.requestId):null;const j=x(async()=>{if(!d){p(true);return}await v(o.action)},[o,d]);const N=x(async()=>{if(!d){p(true);return}await v(o.payload)},[o.payload,d]);const L=x(()=>{if(o.action&&typeof o.action==="object"&&"type"in o.action){ce(o.action)}},[o]);const M=x(()=>{if(o.nextState!==void 0){ie(o.nextState)}},[o]);return i(G,{testID:`${l}-detail-scroll`,style:e.container,contentContainerStyle:e.contentContainer,showsVerticalScrollIndicator:false,children:[i(r,{style:e.card,testID:`${l}-info-card`,children:[t(f,{icon:ee,title:"ACTION INFO"}),i(r,{style:e.cardContent,children:[t(g,{label:"Type",value:o.type,mono:true,testID:`${l}-info-type`}),o.sliceName&&t(g,{label:"Slice",value:o.sliceName,mono:true,testID:`${l}-info-slice`}),t(g,{label:"Action",value:o.actionName,mono:true,testID:`${l}-info-action`}),i(r,{style:e.badgeRow,children:[t(r,{style:[e.categoryBadge,{backgroundColor:h.bgColor}],children:t(c,{style:[e.categoryText,{color:h.color}],testID:`${l}-info-category`,children:h.label})}),i(r,{style:[e.durationBadge,o.isSlowAction&&e.durationBadgeSlow],children:[t(Q,{size:10,color:o.isSlowAction?n.error:a.color.textSecondary}),t(c,{style:[e.durationText,o.isSlowAction&&e.durationTextSlow],testID:`${l}-info-duration`,children:se(o.duration)}),o.isSlowAction&&t(X,{size:10,color:n.error})]}),o.hasStateChange?i(r,{style:e.changesBadge,children:[t(Z,{size:10,color:n.success}),t(c,{style:e.changesText,testID:`${l}-info-changes`,children:o.diffSummary||"changed"})]}):t(r,{style:e.noChangesBadge,children:t(c,{style:e.noChangesText,testID:`${l}-info-no-changes`,children:"no change"})})]})]})]}),V&&i(r,{style:e.card,testID:`${l}-async-card`,children:[t(f,{icon:W,title:"ASYNC FLOW",badge:t(r,{style:e.asyncBadge,children:i(c,{style:e.asyncBadgeText,testID:`${l}-async-count`,children:[C.length," ACTIONS"]})})}),i(r,{style:e.cardContent,children:[t(c,{style:e.baseActionType,testID:`${l}-async-base`,children:P}),E!==null&&i(r,{style:e.totalDurationRow,children:[t(c,{style:e.totalDurationLabel,children:"Total Duration"}),i(c,{style:e.totalDurationValue,testID:`${l}-async-total`,children:[E,"ms"]})]}),t(r,{style:e.timeline,children:C.map((b,S)=>{const T=O(b.category);const B=b.id===o.id;return i(K,{style:[e.timelineItem,B&&e.timelineItemCurrent],onPress:()=>y?.(b),disabled:B||!y,activeOpacity:.7,testID:`${l}-async-step-${S}`,children:[S<C.length-1&&t(r,{style:e.timelineConnector}),t(r,{style:[e.timelineDot,{backgroundColor:T.color}]}),i(r,{style:e.timelineContent,children:[i(r,{style:e.timelineHeader,children:[t(r,{style:[e.timelineStatusBadge,{backgroundColor:T.bgColor}],children:t(c,{style:[e.timelineStatusText,{color:T.color}],testID:`${l}-async-step-${S}-status`,children:T.label})}),B&&t(r,{style:e.currentBadge,testID:`${l}-async-step-${S}-current`,children:t(c,{style:e.currentBadgeText,children:"CURRENT"})})]}),t(c,{style:e.timelineTime,children:ge(b.timestamp)})]})]},b.id)})})]})]}),z&&i(r,{style:e.card,testID:`${l}-payload-card`,children:[t(f,{icon:te,title:"PAYLOAD",badge:t(r,{style:e.typeBadge,children:t(c,{style:e.typeText,children:Array.isArray(o.payload)?"ARRAY":typeof o.payload==="object"?"OBJECT":typeof o.payload?.toString().toUpperCase()})})}),t(r,{style:e.dataViewerContainer,children:t(w,{title:"",data:D(o.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),H&&i(r,{style:e.card,testID:`${l}-meta-card`,children:[t(f,{icon:W,title:"ASYNC METADATA",badge:t(r,{style:[e.categoryBadge,{backgroundColor:h.bgColor}],children:t(c,{style:[e.categoryText,{color:h.color}],children:"RTK THUNK"})})}),i(r,{style:e.cardContent,children:[o.meta?.requestId&&t(g,{label:"Request ID",value:o.meta.requestId,mono:true}),o.meta?.requestStatus&&t(g,{label:"Status",value:o.meta.requestStatus.toUpperCase(),valueColor:h.color,testID:`${l}-meta-status`}),o.meta?.arg!==void 0&&i(r,{style:e.argSection,children:[t(c,{style:e.argLabel,children:"Original Argument"}),t(r,{style:e.argValueContainer,children:typeof o.meta.arg==="object"?t(w,{title:"",data:D(o.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):t(c,{style:e.argValue,children:JSON.stringify(o.meta.arg)})})]}),o.meta?.rejectedWithValue&&t(g,{label:"Rejected With Value",value:"true",valueColor:n.error}),o.meta?.aborted&&t(g,{label:"Aborted",value:"true",valueColor:n.warning}),o.meta?.condition&&t(g,{label:"Condition",value:"true",valueColor:a.color.textTertiary})]})]}),F&&i(r,{style:[e.card,e.errorCard],testID:`${l}-error-card`,children:[t(f,{icon:oe,title:"ERROR",badge:t(r,{style:e.errorBadge,children:t(c,{style:e.errorBadgeText,testID:`${l}-error-badge`,children:"REJECTED"})})}),t(r,{style:e.dataViewerContainer,children:typeof o.error==="object"?t(w,{title:"",data:D(o.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):t(c,{style:e.errorText,children:String(o.error)})})]}),i(r,{style:e.card,testID:`${l}-full-action-card`,children:[t(f,{icon:re,title:"FULL ACTION OBJECT"}),t(r,{style:e.dataViewerContainer,children:t(w,{title:"",data:D(o.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),t(r,{style:e.actionFooter,children:i(r,{style:e.actionsGrid,children:[i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"replay",text:"REPLAY",onPress:L,testID:`${l}-replay`}),t(c,{style:e.actionDescription,children:"Dispatch again"})]}),i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"jump",text:"JUMP",onPress:M,disabled:k,testID:`${l}-jump`}),t(c,{style:e.actionDescription,testID:`${l}-jump-description`,children:A?"State not retained":$?"Restore this state":"Time travel not wired"})]}),i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"copy",text:"COPY ACTION",onPress:j,testID:`${l}-copy-action`}),t(c,{style:e.actionDescription,children:d?"Copy to clipboard":"Pro feature"})]}),z&&i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"copy",text:"COPY PAYLOAD",onPress:N,testID:`${l}-copy-payload`}),t(c,{style:e.actionDescription,children:d?"Copy payload only":"Pro feature"})]})]})}),t(ae,{visible:m,onClose:()=>p(false),featureName:"Copy"})]})});const e=_.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:a.color.surface,borderRadius:6,borderWidth:1,borderColor:a.color.accent+"4D",overflow:"hidden",shadowColor:a.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:n.error+"4D",shadowColor:n.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:a.color.accent+"33",backgroundColor:a.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:a.color.accent,fontFamily:u},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:a.color.surfaceElevated},durationBadgeSlow:{backgroundColor:n.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:a.color.textSecondary,fontFamily:u},durationTextSlow:{color:n.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:n.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:n.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:a.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:a.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:a.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:a.color.textTertiary,fontFamily:u},dataViewerContainer:{backgroundColor:a.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:a.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:a.color.bg,borderRadius:6,borderWidth:1,borderColor:a.color.border,overflow:"hidden"},argValue:{fontSize:11,color:a.color.text,fontFamily:u,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:n.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:n.error,letterSpacing:.3},errorText:{fontSize:12,color:n.error,fontFamily:u,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:a.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:a.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:a.color.text,fontFamily:u,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:a.color.border},totalDurationLabel:{fontSize:11,color:a.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:n.success,fontFamily:u},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:a.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:a.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:a.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:a.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:a.color.textTertiary,fontFamily:u},actionFooter:{backgroundColor:a.color.surface,borderRadius:6,borderWidth:1,borderColor:a.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:a.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:a.color.textTertiary,textAlign:"center"}});
|
|
1
|
+
"use strict";import ye,{memo as U,useMemo as Y,useCallback as x,useState as q,useEffect as J}from"react";import{View as r,Text as c,StyleSheet as _,ScrollView as G,TouchableOpacity as K}from"react-native";import{buoyColors as n,night as a,Clock as Q,AlertTriangle as X,Zap as Z,Hash as W,Info as ee,Box as te,AlertCircle as oe,FileText as re,parseValue as D,ProUpgradeModal as ae,copyToClipboard as v,InfoRow as g,monoFont as u}from"@buoy-gg/shared-ui";import{useIsPro as ne}from"@buoy-gg/license";import{DataViewer as w}from"@buoy-gg/shared-ui/dataViewer";import{reduxActionStore as R,isEvictedState as le}from"../utils/reduxActionStore";import{jumpToState as ie,replayAction as ce,isTimeTravelAvailable as de}from"../utils/buoyReduxMiddleware";import{ReduxActionButton as I}from"./ReduxActionButton";import{REDUX_TEST_ID as l}from"../utils/testIDs";import{jsx as t,jsxs as i}from"react/jsx-runtime";function O(s){switch(s){case"pending":return{label:"PENDING",color:n.warning,bgColor:n.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:n.success,bgColor:n.success+"26"};case"rejected":return{label:"REJECTED",color:n.error,bgColor:n.error+"26"};case"internal":return{label:"INTERNAL",color:n.textMuted,bgColor:n.textMuted+"26"};case"query":return{label:"QUERY",color:n.info,bgColor:n.info+"26"};case"mutation":return{label:"MUTATION",color:n.info,bgColor:n.info+"26"};default:return{label:"ACTION",color:n.info,bgColor:n.info+"26"}}}function se(s){if(s===void 0)return"N/A";if(s<1)return"<1ms";return`${s.toFixed(1)}ms`}function f({icon:s,title:o,badge:y,testID:d}){return i(r,{style:e.sectionHeader,testID:d,children:[i(r,{style:e.sectionHeaderLeft,children:[t(s,{size:14,color:a.color.accent}),t(c,{style:e.sectionTitle,children:o})]}),y]})}function ge(s){const o=new Date(s);const y=o.getHours().toString().padStart(2,"0");const d=o.getMinutes().toString().padStart(2,"0");const m=o.getSeconds().toString().padStart(2,"0");const p=o.getMilliseconds().toString().padStart(3,"0");return`${y}:${d}:${m}.${p}`}export const ReduxActionInfoView=U(function s({action:o,onNavigateToAction:y}){const d=ne();const[m,p]=q(false);J(()=>{if(m&&d){p(false)}},[m,d]);const h=O(o.category);const A=le(o.nextState);const $=de();const k=A||!$;const z=o.payload!==void 0;const H=o.meta&&Object.keys(o.meta).length>0;const F=o.error!==void 0;const C=Y(()=>{return R.getLinkedActions(o)},[o]);const V=C.length>1;const P=V?R.getBaseActionType(o.type):null;const E=o.meta?.requestId?R.getAsyncOperationDuration(o.meta.requestId):null;const j=x(async()=>{if(!d){p(true);return}await v(o.action)},[o,d]);const N=x(async()=>{if(!d){p(true);return}await v(o.payload)},[o.payload,d]);const L=x(()=>{if(o.action&&typeof o.action==="object"&&"type"in o.action){ce(o.action)}},[o]);const M=x(()=>{if(o.nextState!==void 0){ie(o.nextState)}},[o]);return i(G,{keyboardShouldPersistTaps:"handled",testID:`${l}-detail-scroll`,style:e.container,contentContainerStyle:e.contentContainer,showsVerticalScrollIndicator:false,children:[i(r,{style:e.card,testID:`${l}-info-card`,children:[t(f,{icon:ee,title:"ACTION INFO"}),i(r,{style:e.cardContent,children:[t(g,{label:"Type",value:o.type,mono:true,testID:`${l}-info-type`}),o.sliceName&&t(g,{label:"Slice",value:o.sliceName,mono:true,testID:`${l}-info-slice`}),t(g,{label:"Action",value:o.actionName,mono:true,testID:`${l}-info-action`}),i(r,{style:e.badgeRow,children:[t(r,{style:[e.categoryBadge,{backgroundColor:h.bgColor}],children:t(c,{style:[e.categoryText,{color:h.color}],testID:`${l}-info-category`,children:h.label})}),i(r,{style:[e.durationBadge,o.isSlowAction&&e.durationBadgeSlow],children:[t(Q,{size:10,color:o.isSlowAction?n.error:a.color.textSecondary}),t(c,{style:[e.durationText,o.isSlowAction&&e.durationTextSlow],testID:`${l}-info-duration`,children:se(o.duration)}),o.isSlowAction&&t(X,{size:10,color:n.error})]}),o.hasStateChange?i(r,{style:e.changesBadge,children:[t(Z,{size:10,color:n.success}),t(c,{style:e.changesText,testID:`${l}-info-changes`,children:o.diffSummary||"changed"})]}):t(r,{style:e.noChangesBadge,children:t(c,{style:e.noChangesText,testID:`${l}-info-no-changes`,children:"no change"})})]})]})]}),V&&i(r,{style:e.card,testID:`${l}-async-card`,children:[t(f,{icon:W,title:"ASYNC FLOW",badge:t(r,{style:e.asyncBadge,children:i(c,{style:e.asyncBadgeText,testID:`${l}-async-count`,children:[C.length," ACTIONS"]})})}),i(r,{style:e.cardContent,children:[t(c,{style:e.baseActionType,testID:`${l}-async-base`,children:P}),E!==null&&i(r,{style:e.totalDurationRow,children:[t(c,{style:e.totalDurationLabel,children:"Total Duration"}),i(c,{style:e.totalDurationValue,testID:`${l}-async-total`,children:[E,"ms"]})]}),t(r,{style:e.timeline,children:C.map((b,S)=>{const T=O(b.category);const B=b.id===o.id;return i(K,{style:[e.timelineItem,B&&e.timelineItemCurrent],onPress:()=>y?.(b),disabled:B||!y,activeOpacity:.7,testID:`${l}-async-step-${S}`,children:[S<C.length-1&&t(r,{style:e.timelineConnector}),t(r,{style:[e.timelineDot,{backgroundColor:T.color}]}),i(r,{style:e.timelineContent,children:[i(r,{style:e.timelineHeader,children:[t(r,{style:[e.timelineStatusBadge,{backgroundColor:T.bgColor}],children:t(c,{style:[e.timelineStatusText,{color:T.color}],testID:`${l}-async-step-${S}-status`,children:T.label})}),B&&t(r,{style:e.currentBadge,testID:`${l}-async-step-${S}-current`,children:t(c,{style:e.currentBadgeText,children:"CURRENT"})})]}),t(c,{style:e.timelineTime,children:ge(b.timestamp)})]})]},b.id)})})]})]}),z&&i(r,{style:e.card,testID:`${l}-payload-card`,children:[t(f,{icon:te,title:"PAYLOAD",badge:t(r,{style:e.typeBadge,children:t(c,{style:e.typeText,children:Array.isArray(o.payload)?"ARRAY":typeof o.payload==="object"?"OBJECT":typeof o.payload?.toString().toUpperCase()})})}),t(r,{style:e.dataViewerContainer,children:t(w,{title:"",data:D(o.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),H&&i(r,{style:e.card,testID:`${l}-meta-card`,children:[t(f,{icon:W,title:"ASYNC METADATA",badge:t(r,{style:[e.categoryBadge,{backgroundColor:h.bgColor}],children:t(c,{style:[e.categoryText,{color:h.color}],children:"RTK THUNK"})})}),i(r,{style:e.cardContent,children:[o.meta?.requestId&&t(g,{label:"Request ID",value:o.meta.requestId,mono:true}),o.meta?.requestStatus&&t(g,{label:"Status",value:o.meta.requestStatus.toUpperCase(),valueColor:h.color,testID:`${l}-meta-status`}),o.meta?.arg!==void 0&&i(r,{style:e.argSection,children:[t(c,{style:e.argLabel,children:"Original Argument"}),t(r,{style:e.argValueContainer,children:typeof o.meta.arg==="object"?t(w,{title:"",data:D(o.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):t(c,{style:e.argValue,children:JSON.stringify(o.meta.arg)})})]}),o.meta?.rejectedWithValue&&t(g,{label:"Rejected With Value",value:"true",valueColor:n.error}),o.meta?.aborted&&t(g,{label:"Aborted",value:"true",valueColor:n.warning}),o.meta?.condition&&t(g,{label:"Condition",value:"true",valueColor:a.color.textTertiary})]})]}),F&&i(r,{style:[e.card,e.errorCard],testID:`${l}-error-card`,children:[t(f,{icon:oe,title:"ERROR",badge:t(r,{style:e.errorBadge,children:t(c,{style:e.errorBadgeText,testID:`${l}-error-badge`,children:"REJECTED"})})}),t(r,{style:e.dataViewerContainer,children:typeof o.error==="object"?t(w,{title:"",data:D(o.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):t(c,{style:e.errorText,children:String(o.error)})})]}),i(r,{style:e.card,testID:`${l}-full-action-card`,children:[t(f,{icon:re,title:"FULL ACTION OBJECT"}),t(r,{style:e.dataViewerContainer,children:t(w,{title:"",data:D(o.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),t(r,{style:e.actionFooter,children:i(r,{style:e.actionsGrid,children:[i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"replay",text:"REPLAY",onPress:L,testID:`${l}-replay`}),t(c,{style:e.actionDescription,children:"Dispatch again"})]}),i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"jump",text:"JUMP",onPress:M,disabled:k,testID:`${l}-jump`}),t(c,{style:e.actionDescription,testID:`${l}-jump-description`,children:A?"State not retained":$?"Restore this state":"Time travel not wired"})]}),i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"copy",text:"COPY ACTION",onPress:j,testID:`${l}-copy-action`}),t(c,{style:e.actionDescription,children:d?"Copy to clipboard":"Pro feature"})]}),z&&i(r,{style:e.actionButtonWrapper,children:[t(I,{type:"copy",text:"COPY PAYLOAD",onPress:N,testID:`${l}-copy-payload`}),t(c,{style:e.actionDescription,children:d?"Copy payload only":"Pro feature"})]})]})}),t(ae,{visible:m,onClose:()=>p(false),featureName:"Copy"})]})});const e=_.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:a.color.surface,borderRadius:6,borderWidth:1,borderColor:a.color.accent+"4D",overflow:"hidden",shadowColor:a.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:n.error+"4D",shadowColor:n.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:a.color.accent+"33",backgroundColor:a.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:a.color.accent,fontFamily:u},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:a.color.surfaceElevated},durationBadgeSlow:{backgroundColor:n.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:a.color.textSecondary,fontFamily:u},durationTextSlow:{color:n.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:n.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:n.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:a.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:a.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:a.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:a.color.textTertiary,fontFamily:u},dataViewerContainer:{backgroundColor:a.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:a.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:a.color.bg,borderRadius:6,borderWidth:1,borderColor:a.color.border,overflow:"hidden"},argValue:{fontSize:11,color:a.color.text,fontFamily:u,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:n.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:n.error,letterSpacing:.3},errorText:{fontSize:12,color:n.error,fontFamily:u,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:a.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:a.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:a.color.text,fontFamily:u,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:a.color.border},totalDurationLabel:{fontSize:11,color:a.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:n.success,fontFamily:u},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:a.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:a.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:a.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:a.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:a.color.textTertiary,fontFamily:u},actionFooter:{backgroundColor:a.color.surface,borderRadius:6,borderWidth:1,borderColor:a.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:a.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:a.color.textTertiary,textAlign:"center"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as k,useMemo as T,useRef as B,useCallback as g,useEffect as Z}from"react";import{View as d,Text as u,StyleSheet as Ae,FlatList as Re,TouchableOpacity as C}from"react-native";import{JsModal as we,ModalHeader as p,macOSColors as h,night as o,Search as De,Trash2 as ke,Power as Be,Zap as ve,CheckCircle as $e,Copy as Ee,Lock as Le,AlertTriangle as Y,devToolsStorageKeys as Pe,copyToClipboard as ze,ProUpgradeModal as We,PowerToggleButton as Me,TickProvider as ee,useLimit as He,TIER_LIMITS as Ve,windowDragProps as _e,ToolEmptyState as Fe,resolveListEmptyState as Ne,EVENT_LIST_PRESET as qe,monoFont as je}from"@buoy-gg/shared-ui";import{useIsPro as Oe}from"@buoy-gg/license";import{useReduxActions as Ue}from"../hooks/useReduxActions";import{reduxActionStore as H}from"../utils/reduxActionStore";import{useAutoInstrumentRedux as Ke}from"../hooks/useAutoInstrumentRedux";import{ReduxActionItem as Ge}from"./ReduxActionItem";import{ReduxActionDetailContent as Je,ReduxActionDetailFooter as Qe}from"./ReduxActionDetailContent";import{REDUX_TEST_ID as i,buildActionRowTestIDs as Xe}from"../utils/testIDs";import{jsx as e,jsxs as a,Fragment as Ze}from"react/jsx-runtime";export const FREE_TIER_ACTION_LIMIT=Ve["redux.actions"].free;function Ye({isEnabled:y,query:v,totalActions:A}){const $=Ne({subject:"actions",search:v,total:A,capturing:y,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return e(Fe,{...$,testID:`${i}-empty`})}export function ReduxModal({visible:y,onClose:v,onBack:A,onMinimize:$,enableSharedModalDimensions:te=false,inline:oe=false,onActionSelect:E,initialSelectedActionId:f,initialDetailView:re}){const ne=Oe();const R=He("redux.actions");const[ie,L]=k(false);const{isInstrumented:V,isLoading:et,error:ae,isReactReduxAvailable:le,captureMechanism:se}=Ke();const{filteredActions:l,filter:w,setFilter:x,stats:b,clearActions:ce,isEnabled:P,toggleCapture:de}=Ue();const s=T(()=>l.slice(0,R),[l,R]);const I=T(()=>Math.max(0,l.length-R),[l.length,R]);const ue=I>0;const[z,D]=k(null);const m=T(()=>{if(z===null)return null;const t=s.findIndex(n=>n.id===z);return t>=0?t:null},[z,s]);const c=m!==null?s[m]:null;const _=B(null);Z(()=>{if(!E)return;const t=c?.id??null;if(t===null||t===_.current)return;_.current=t;E(c)},[c,E]);const F=B(null);Z(()=>{if(!f)return;if(F.current===f)return;const t=s.findIndex(n=>n.id===f);if(t<0)return;F.current=f;D(f)},[f,s]);const[S,N]=k("");const[q,W]=k(false);const tt=B(null);const he=B(null);const ge=g(t=>{},[]);const pe=t=>{N(t);x(n=>({...n,searchText:t}))};const be=g(()=>{N("");x(t=>({...t,searchText:""}));W(false)},[x]);const j=g(t=>{D(t.id)},[]);const ye=g(()=>{L(true)},[]);const fe=g(()=>{D(null)},[]);const O=g(t=>{const n=s[t];if(n)D(n.id)},[s]);const me=async()=>{if(!ne){L(true);return}const t=l.map(n=>({id:n.id,type:n.type,...n.payload!==void 0&&{payload:n.payload},timestamp:n.timestamp,prevState:n.prevState,nextState:n.nextState,hasStateChange:n.hasStateChange}));await ze(t)};const Ce=g(t=>t.id,[]);const U=T(()=>Xe(s),[s]);const K=T(()=>{const t=new Map;for(const n of H.getActions()){const M=n.meta?.requestId;if(!M)continue;t.set(M,(t.get(M)??0)+1)}return t},[l]);const xe=g(({item:t})=>{const n=t.meta?.requestId;return e(Ge,{action:t,onPress:j,linkedCount:n?K.get(n)??0:0,testID:U.get(t.id)})},[j,U,K]);const G=()=>{if(c){return a(p,{children:[e(p.Navigation,{onBack:fe}),e(p.Content,{title:c.type,centered:true,testID:`${i}-detail-title`})]})}return a(p,{children:[A&&e(p.Navigation,{onBack:A}),e(p.Content,{title:"",children:q?e(p.Search,{value:S,onChangeText:pe,onCancel:be,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${i}-search-field`,containerTestID:`${i}-search`,clearTestID:`${i}-search-clear`,onBlur:()=>{if(S.length===0)W(false)}}):a(d,{style:r.headerChipRow,children:[a(C,{style:[r.headerChip,!w.onlyWithChanges&&r.headerChipActive],onPress:()=>x(t=>({...t,onlyWithChanges:false})),testID:`${i}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${b.totalActions} captured`,accessibilityState:{selected:!w.onlyWithChanges},children:[e(u,{style:r.headerChipLabel,children:"ALL"}),e(u,{style:[r.headerChipValue,{color:o.color.text}],testID:`${i}-chip-all-value`,children:b.totalActions})]}),a(C,{style:[r.headerChip,w.onlyWithChanges&&r.headerChipActive],onPress:()=>x(t=>({...t,onlyWithChanges:true})),testID:`${i}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${b.actionsWithChanges} of them`,accessibilityState:{selected:!!w.onlyWithChanges},children:[e(ve,{size:12,color:h.semantic.warning}),e(u,{style:[r.headerChipValue,{color:h.semantic.warning}],testID:`${i}-chip-changed-value`,children:b.actionsWithChanges})]}),a(d,{style:r.headerChip,testID:`${i}-chip-types`,accessibilityLabel:`${b.uniqueActionTypes} distinct action types`,children:[e($e,{size:12,color:h.semantic.success}),e(u,{style:[r.headerChipValue,{color:h.semantic.success}],testID:`${i}-chip-types-value`,children:b.uniqueActionTypes})]})]})}),a(p.Actions,{children:[!q&&e(C,{onPress:()=>W(true),style:[r.headerActionButton,S.length>0&&r.headerActionButtonActive],testID:`${i}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:e(De,{size:14,color:S.length>0?o.color.accent:o.color.textSecondary})}),e(C,{onPress:me,style:[r.headerActionButton,l.length===0&&r.headerActionButtonDisabled],disabled:l.length===0,testID:`${i}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:l.length===0},children:e(Ee,{size:14,color:l.length>0?o.color.textSecondary:o.color.textTertiary})}),e(Me,{isEnabled:P,onToggle:de,accessibilityLabel:"Toggle Redux action capture",testID:`${i}-power`}),e(C,{onPress:ce,style:[r.headerActionButton,l.length===0&&r.headerActionButtonDisabled],disabled:l.length===0,testID:`${i}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:l.length===0},children:e(ke,{size:14,color:l.length>0?o.color.textTertiary:o.color.textTertiary})})]})]})};const Ie=te?Pe.modal.root():"buoy-redux-modal";if(!y)return null;const J=c&&m!==null?e(Qe,{action:c,actions:s,selectedIndex:m,onIndexChange:O}):null;const Se=c&&s.length>1?68:0;const Te=c==null;const Q=e(d,{style:r.container,children:c&&m!==null?e(Je,{action:c,actions:s,selectedIndex:m,onIndexChange:O,disableInternalFooter:true,initialView:re}):a(Ze,{children:[ae&&!V&&!H.isCaptureSuppressed()&&a(d,{style:r.errorBanner,testID:`${i}-banner-error`,children:[e(Y,{size:14,color:o.color.danger}),e(u,{style:r.errorText,children:le?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!P&&V&&a(d,{style:r.disabledBanner,testID:`${i}-banner-disabled`,children:[e(Be,{size:14,color:o.color.warning}),e(u,{style:r.disabledText,children:"Action capture is disabled"})]}),se==="patch"&&!H.isCaptureSuppressed()&&a(d,{style:r.disabledBanner,testID:`${i}-banner-patch`,children:[e(Y,{size:14,color:o.color.warning}),e(u,{style:r.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),ue&&a(C,{style:r.lockedBanner,onPress:ye,activeOpacity:.8,testID:`${i}-locked`,accessibilityRole:"button",accessibilityLabel:`${I} older ${I===1?"action":"actions"} locked. Upgrade to see them.`,children:[e(Le,{size:14,color:o.color.accent}),a(u,{style:r.lockedText,testID:`${i}-locked-text`,children:[I," older ",I===1?"action":"actions"," locked"]}),e(d,{style:r.upgradeBadge,children:e(u,{style:r.upgradeBadgeText,children:"UPGRADE"})})]}),s.length>0?e(Re,{ref:he,testID:`${i}-list`,data:s,renderItem:xe,keyExtractor:Ce,contentContainerStyle:r.listContent,showsVerticalScrollIndicator:true,...qe}):e(Ye,{isEnabled:P,query:S,totalActions:b.totalActions})]})});const X=e(We,{visible:ie,onClose:()=>L(false),featureName:"Full Action History"});if(oe){return a(ee,{children:[a(d,{style:r.inlineRoot,children:[e(d,{style:r.inlineHeader,..._e,children:G()}),Q,J]}),X]})}return a(ee,{children:[e(we,{visible:y,onClose:v,onMinimize:$,persistenceKey:Ie,header:{showToggleButton:true,customContent:G()},onModeChange:ge,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Te,styles:{},footer:J,footerHeight:Se,children:Q}),X]})}export function ReduxToolView(y={}){return e(ReduxModal,{...y,inline:true,visible:true,onClose:()=>{}})}const r=Ae.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:h.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:o.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:o.color.border},headerChipActive:{backgroundColor:o.color.accentSoft,borderColor:o.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:o.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:je},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:o.color.surfaceElevated,borderWidth:1,borderColor:o.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:o.color.accentSoft,borderColor:o.color.accentBorderStrong},startButton:{backgroundColor:h.semantic.successBackground,borderColor:h.semantic.success+"40"},stopButton:{backgroundColor:h.semantic.errorBackground,borderColor:h.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:o.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:o.color.danger+"20"},errorText:{color:o.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:o.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:o.color.warning+"20"},disabledText:{color:o.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:o.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:o.color.accentBorder},lockedText:{color:o.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:o.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:o.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});
|
|
1
|
+
"use strict";import{useState as k,useMemo as T,useRef as B,useCallback as g,useEffect as Z}from"react";import{View as d,Text as u,StyleSheet as Ae,FlatList as Re,TouchableOpacity as C}from"react-native";import{JsModal as we,ModalHeader as p,macOSColors as h,night as o,Search as De,Trash2 as ke,Power as Be,Zap as ve,CheckCircle as $e,Copy as Ee,Lock as Le,AlertTriangle as Y,devToolsStorageKeys as Pe,copyToClipboard as ze,ProUpgradeModal as We,PowerToggleButton as Me,TickProvider as ee,useLimit as He,TIER_LIMITS as Ve,windowDragProps as _e,ToolEmptyState as Fe,resolveListEmptyState as Ne,EVENT_LIST_PRESET as qe,monoFont as je}from"@buoy-gg/shared-ui";import{useIsPro as Oe}from"@buoy-gg/license";import{useReduxActions as Ue}from"../hooks/useReduxActions";import{reduxActionStore as H}from"../utils/reduxActionStore";import{useAutoInstrumentRedux as Ke}from"../hooks/useAutoInstrumentRedux";import{ReduxActionItem as Ge}from"./ReduxActionItem";import{ReduxActionDetailContent as Je,ReduxActionDetailFooter as Qe}from"./ReduxActionDetailContent";import{REDUX_TEST_ID as i,buildActionRowTestIDs as Xe}from"../utils/testIDs";import{jsx as e,jsxs as a,Fragment as Ze}from"react/jsx-runtime";export const FREE_TIER_ACTION_LIMIT=Ve["redux.actions"].free;function Ye({isEnabled:y,query:v,totalActions:A}){const $=Ne({subject:"actions",search:v,total:A,capturing:y,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return e(Fe,{...$,testID:`${i}-empty`})}export function ReduxModal({visible:y,onClose:v,onBack:A,onMinimize:$,enableSharedModalDimensions:te=false,inline:oe=false,onActionSelect:E,initialSelectedActionId:f,initialDetailView:re}){const ne=Oe();const R=He("redux.actions");const[ie,L]=k(false);const{isInstrumented:V,isLoading:et,error:ae,isReactReduxAvailable:le,captureMechanism:se}=Ke();const{filteredActions:l,filter:w,setFilter:x,stats:b,clearActions:ce,isEnabled:P,toggleCapture:de}=Ue();const s=T(()=>l.slice(0,R),[l,R]);const I=T(()=>Math.max(0,l.length-R),[l.length,R]);const ue=I>0;const[z,D]=k(null);const m=T(()=>{if(z===null)return null;const t=s.findIndex(n=>n.id===z);return t>=0?t:null},[z,s]);const c=m!==null?s[m]:null;const _=B(null);Z(()=>{if(!E)return;const t=c?.id??null;if(t===null||t===_.current)return;_.current=t;E(c)},[c,E]);const F=B(null);Z(()=>{if(!f)return;if(F.current===f)return;const t=s.findIndex(n=>n.id===f);if(t<0)return;F.current=f;D(f)},[f,s]);const[S,N]=k("");const[q,W]=k(false);const tt=B(null);const he=B(null);const ge=g(t=>{},[]);const pe=t=>{N(t);x(n=>({...n,searchText:t}))};const be=g(()=>{N("");x(t=>({...t,searchText:""}));W(false)},[x]);const j=g(t=>{D(t.id)},[]);const ye=g(()=>{L(true)},[]);const fe=g(()=>{D(null)},[]);const O=g(t=>{const n=s[t];if(n)D(n.id)},[s]);const me=async()=>{if(!ne){L(true);return}const t=l.map(n=>({id:n.id,type:n.type,...n.payload!==void 0&&{payload:n.payload},timestamp:n.timestamp,prevState:n.prevState,nextState:n.nextState,hasStateChange:n.hasStateChange}));await ze(t)};const Ce=g(t=>t.id,[]);const U=T(()=>Xe(s),[s]);const K=T(()=>{const t=new Map;for(const n of H.getActions()){const M=n.meta?.requestId;if(!M)continue;t.set(M,(t.get(M)??0)+1)}return t},[l]);const xe=g(({item:t})=>{const n=t.meta?.requestId;return e(Ge,{action:t,onPress:j,linkedCount:n?K.get(n)??0:0,testID:U.get(t.id)})},[j,U,K]);const G=()=>{if(c){return a(p,{children:[e(p.Navigation,{onBack:fe}),e(p.Content,{title:c.type,centered:true,testID:`${i}-detail-title`})]})}return a(p,{children:[A&&e(p.Navigation,{onBack:A}),e(p.Content,{title:"",children:q?e(p.Search,{value:S,onChangeText:pe,onCancel:be,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${i}-search-field`,containerTestID:`${i}-search`,clearTestID:`${i}-search-clear`,onBlur:()=>{if(S.length===0)W(false)}}):a(d,{style:r.headerChipRow,children:[a(C,{style:[r.headerChip,!w.onlyWithChanges&&r.headerChipActive],onPress:()=>x(t=>({...t,onlyWithChanges:false})),testID:`${i}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${b.totalActions} captured`,accessibilityState:{selected:!w.onlyWithChanges},children:[e(u,{style:r.headerChipLabel,children:"ALL"}),e(u,{style:[r.headerChipValue,{color:o.color.text}],testID:`${i}-chip-all-value`,children:b.totalActions})]}),a(C,{style:[r.headerChip,w.onlyWithChanges&&r.headerChipActive],onPress:()=>x(t=>({...t,onlyWithChanges:true})),testID:`${i}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${b.actionsWithChanges} of them`,accessibilityState:{selected:!!w.onlyWithChanges},children:[e(ve,{size:12,color:h.semantic.warning}),e(u,{style:[r.headerChipValue,{color:h.semantic.warning}],testID:`${i}-chip-changed-value`,children:b.actionsWithChanges})]}),a(d,{style:r.headerChip,testID:`${i}-chip-types`,accessibilityLabel:`${b.uniqueActionTypes} distinct action types`,children:[e($e,{size:12,color:h.semantic.success}),e(u,{style:[r.headerChipValue,{color:h.semantic.success}],testID:`${i}-chip-types-value`,children:b.uniqueActionTypes})]})]})}),a(p.Actions,{children:[!q&&e(C,{onPress:()=>W(true),style:[r.headerActionButton,S.length>0&&r.headerActionButtonActive],testID:`${i}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:e(De,{size:14,color:S.length>0?o.color.accent:o.color.textSecondary})}),e(C,{onPress:me,style:[r.headerActionButton,l.length===0&&r.headerActionButtonDisabled],disabled:l.length===0,testID:`${i}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:l.length===0},children:e(Ee,{size:14,color:l.length>0?o.color.textSecondary:o.color.textTertiary})}),e(Me,{isEnabled:P,onToggle:de,accessibilityLabel:"Toggle Redux action capture",testID:`${i}-power`}),e(C,{onPress:ce,style:[r.headerActionButton,l.length===0&&r.headerActionButtonDisabled],disabled:l.length===0,testID:`${i}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:l.length===0},children:e(ke,{size:14,color:l.length>0?o.color.textTertiary:o.color.textTertiary})})]})]})};const Ie=te?Pe.modal.root():"buoy-redux-modal";if(!y)return null;const J=c&&m!==null?e(Qe,{action:c,actions:s,selectedIndex:m,onIndexChange:O}):null;const Se=c&&s.length>1?68:0;const Te=c==null;const Q=e(d,{style:r.container,children:c&&m!==null?e(Je,{action:c,actions:s,selectedIndex:m,onIndexChange:O,disableInternalFooter:true,initialView:re}):a(Ze,{children:[ae&&!V&&!H.isCaptureSuppressed()&&a(d,{style:r.errorBanner,testID:`${i}-banner-error`,children:[e(Y,{size:14,color:o.color.danger}),e(u,{style:r.errorText,children:le?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!P&&V&&a(d,{style:r.disabledBanner,testID:`${i}-banner-disabled`,children:[e(Be,{size:14,color:o.color.warning}),e(u,{style:r.disabledText,children:"Action capture is disabled"})]}),se==="patch"&&!H.isCaptureSuppressed()&&a(d,{style:r.disabledBanner,testID:`${i}-banner-patch`,children:[e(Y,{size:14,color:o.color.warning}),e(u,{style:r.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),ue&&a(C,{style:r.lockedBanner,onPress:ye,activeOpacity:.8,testID:`${i}-locked`,accessibilityRole:"button",accessibilityLabel:`${I} older ${I===1?"action":"actions"} locked. Upgrade to see them.`,children:[e(Le,{size:14,color:o.color.accent}),a(u,{style:r.lockedText,testID:`${i}-locked-text`,children:[I," older ",I===1?"action":"actions"," locked"]}),e(d,{style:r.upgradeBadge,children:e(u,{style:r.upgradeBadgeText,children:"UPGRADE"})})]}),s.length>0?e(Re,{keyboardShouldPersistTaps:"handled",ref:he,testID:`${i}-list`,data:s,renderItem:xe,keyExtractor:Ce,contentContainerStyle:r.listContent,showsVerticalScrollIndicator:true,...qe}):e(Ye,{isEnabled:P,query:S,totalActions:b.totalActions})]})});const X=e(We,{visible:ie,onClose:()=>L(false),featureName:"Full Action History"});if(oe){return a(ee,{children:[a(d,{style:r.inlineRoot,children:[e(d,{style:r.inlineHeader,..._e,children:G()}),Q,J]}),X]})}return a(ee,{children:[e(we,{visible:y,onClose:v,onMinimize:$,persistenceKey:Ie,header:{showToggleButton:true,customContent:G()},onModeChange:ge,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Te,styles:{},footer:J,footerHeight:Se,children:Q}),X]})}export function ReduxToolView(y={}){return e(ReduxModal,{...y,inline:true,visible:true,onClose:()=>{}})}const r=Ae.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:h.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:o.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:o.color.border},headerChipActive:{backgroundColor:o.color.accentSoft,borderColor:o.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:o.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:je},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:o.color.surfaceElevated,borderWidth:1,borderColor:o.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:o.color.accentSoft,borderColor:o.color.accentBorderStrong},startButton:{backgroundColor:h.semantic.successBackground,borderColor:h.semantic.success+"40"},stopButton:{backgroundColor:h.semantic.errorBackground,borderColor:h.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:o.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:o.color.danger+"20"},errorText:{color:o.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:o.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:o.color.warning+"20"},disabledText:{color:o.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:o.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:o.color.accentBorder},lockedText:{color:o.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:o.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:o.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});
|
package/lib/web/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var Vt=Object.defineProperty;var Fr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Hr=Object.prototype.hasOwnProperty;var _r=(e,t)=>{for(var r in t)Vt(e,r,{get:t[r],enumerable:true})},zt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Mr(t))!Hr.call(e,a)&&a!==r&&Vt(e,a,{get:()=>t[a],enumerable:!(o=Fr(t,a))||o.enumerable});return e},qr=(e,t,r)=>(zt(e,t,"default"),r&&zt(r,t,"default"));var jt=(()=>{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{classifyPreviewItem as Ur,createRestoreScope as Kr,registerStateSnapshotProvider as Yr,skippedRestore as tt,unionKeys as Jr,wontApply as Gr}from"@buoy-gg/shared-ui/web";var rt=Symbol.for("@@buoy/enhancerInstrumented"),be=null,pe=null,ot=null,Lt=false;function ee(e,t){be=e,pe=t,ot=null}function Pt(e){be===e&&(be=null,pe=null)}function te(){return be}function at(){Lt=true}function $e(){return Lt&&be!==null}function Xr(e){ot=e}function re(){return{mechanism:pe,capture:pe==="enhancer"||pe==="middleware"||pe==="extension"?"full":pe==="patch"?"top-level-only":"none",hasStore:be!==null,timeTravel:$e(),diagnostic:ot}}import{ChangeLog as Qr,approxJsonSize as Zr}from"@buoy-gg/shared-ui/web";var nt=25,it=Object.freeze({__buoyStateEvicted:true,note:`Raw state retained for the ${nt} most recent actions only.`}),Wt=Object.freeze({__buoyStateOnDevice:true,note:"State trees stay on the device \u2014 fetched on demand via getActionDetail."}),eo=Object.freeze({__buoyPayloadOnDevice:true,note:"Payload stays on the device \u2014 fetched on demand via getActionDetail."});function Oe(e){return typeof e=="object"&&e!==null&&e.__buoyPayloadOnDevice===true}function oe(e){if(typeof e!="object"||e===null)return false;let t=e;return t.__buoyStateEvicted===true||t.__buoyStateOnDevice===true}function to(e){return e.startsWith("@@")?"internal":e.includes("/pending")?"pending":e.includes("/fulfilled")?"fulfilled":e.includes("/rejected")?"rejected":e.includes("/executeQuery")?"query":e.includes("/executeMutation")?"mutation":"action"}function ro(e){if(e.startsWith("@@")){let r=e.split("/");return{sliceName:null,actionName:r[r.length-1]||e}}let t=e.split("/");if(t.length>=2){let r=t[0],o=t[1];return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])&&(o=t.slice(1,-1).join("/")),{sliceName:r,actionName:o.toUpperCase()}}return{sliceName:null,actionName:e.toUpperCase()}}function Nt(e,t){return Zr(e,t).bytes>t}function oo(e,t=40){if(e===void 0)return"";if(e===null)return"null";try{if(typeof e=="string")return e.length>t?`"${e.slice(0,t-3)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";if(Nt(e,t))return`[${e.length} items]`;let r=JSON.stringify(e);return r.length>t?`[${e.length} items]`:r}if(typeof e=="object"){let r=Object.keys(e);if(r.length===0)return"{}";if(Nt(e,t))return`{ ${r.length} keys }`;let o=JSON.stringify(e);return o.length<=t?o:`{ ${r.length} keys }`}return String(e).slice(0,t)}catch{return"[complex]"}}function ao(e,t){if(e===t)return{summary:"no change",changedCount:0};if(typeof e!="object"||typeof t!="object"||e===null||t===null)return{summary:"changed",changedCount:1};let r=Object.keys(e),o=Object.keys(t),a=o.filter(u=>!r.includes(u)).length,n=r.filter(u=>!o.includes(u)).length,c=0;for(let u of r)o.includes(u)&&e[u]!==t[u]&&c++;let d=[];a>0&&d.push(`+${a}`),n>0&&d.push(`-${n}`),c>0&&d.push(`~${c}`);let s=a+n+c;return d.length===0?{summary:"nested change",changedCount:1}:{summary:`${d.join(" ")} ${s===1?"key":"keys"}`,changedCount:s}}function no(e){let t=e.meta;if(t)return{requestId:t.requestId,requestStatus:t.requestStatus,arg:t.arg,rejectedWithValue:t.rejectedWithValue,aborted:t.aborted,condition:t.condition}}var io=class extends Qr{addAction(e,t,r,o){if(!this.canRecord())return;let a=e.type||"";if(!a)return;let n=t!==r,c=to(a),{sliceName:d,actionName:s}=ro(a),u=no(e),i=oo(e.payload),{summary:h,changedCount:m}=ao(t,r),R=(o??0)>16,V={id:this.nextId(),type:a,payload:e.payload,action:e,timestamp:Date.now(),prevState:t,nextState:r,duration:o,hasStateChange:n,category:c,sliceName:d,actionName:s,meta:u,error:e.error,payloadPreview:i,diffSummary:h,changedKeysCount:m,isSlowAction:R};this.push(V);for(let z=nt;z<this.items.length;z++){let L=this.items[z];if(L.prevState!==it)L.prevState=it,L.nextState=it;else break}this.notifyListeners()}getActions(){return this.getAll()}getActionById(e){return this.getById(e)}clearActions(){this.clear()}replaceActions(e){if(!this.getEnabled())return;let t=new Map;for(let o of this.items)o.prevState!==void 0&&!oe(o.prevState)&&t.set(o.id,o);let r=e.slice(0,this.max).map(o=>{let a=t.get(o.id);return!a||!oe(o.prevState)?o:{...o,prevState:a.prevState,nextState:a.nextState,payload:Oe(o.payload)?a.payload:o.payload,action:Oe(o.action)?a.action:o.action,meta:Oe(o.meta?.arg)?a.meta:o.meta,error:Oe(o.error)?a.error:o.error}});this.setItems(r)}hydrateAction(e,t){this.hydrateById(e,t)}setMaxActions(e){this.setMax(e)}getStats(){let e=this.items.length,t=this.items.filter(n=>n.hasStateChange).length,r=new Set(this.items.map(n=>n.type)),o=this.items.filter(n=>n.duration!==void 0).map(n=>n.duration),a=o.length>0?o.reduce((n,c)=>n+c,0)/o.length:0;return{totalActions:e,actionsWithChanges:t,actionsWithoutChanges:e-t,uniqueActionTypes:r.size,averageDuration:Math.round(a*100)/100}}filterActions(e){let t=[...this.items];if(e.searchText){let r=e.searchText.toLowerCase();t=t.filter(o=>o.type.toLowerCase().includes(r))}return e.actionTypes&&e.actionTypes.length>0&&(t=t.filter(r=>e.actionTypes.includes(r.type))),e.onlyWithChanges&&(t=t.filter(r=>r.hasStateChange)),t}getUniqueActionTypes(){return Array.from(new Set(this.items.map(e=>e.type))).sort()}getRelatedActions(e){return this.items.filter(t=>t.meta?.requestId===e).sort((t,r)=>t.timestamp-r.timestamp)}getLinkedActions(e){return e.meta?.requestId?this.getRelatedActions(e.meta.requestId):[]}getLinkedActionsCount(e){return e.meta?.requestId?this.items.filter(t=>t.meta?.requestId===e.meta?.requestId).length:0}getAsyncOperationDuration(e){let t=this.getRelatedActions(e);if(t.length<2)return null;let r=t.find(a=>a.category==="pending"),o=t.find(a=>a.category==="fulfilled"||a.category==="rejected");return r&&o?o.timestamp-r.timestamp:null}getBaseActionType(e){let t=e.split("/");if(t.length>=2){let r=t[t.length-1];if(["pending","fulfilled","rejected"].includes(r))return t.slice(0,-1).join("/")}return e}getAsyncOperationIndex(e){let t=new Map;for(let o of this.items)o.meta?.requestId&&!t.has(o.meta.requestId)&&t.set(o.meta.requestId,o.timestamp);let r=Array.from(t.entries()).sort((o,a)=>o[1]-a[1]).map(([o])=>o).indexOf(e);return r>=0?r+1:0}},x=new io;var lt=false;function Ft(){return lt}var xe="@@buoy/JUMP_TO_STATE",lo="@@buoy/REPLAY_ACTION";function Mt(e){if(oe(e)){console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");return}let t=te();if(!t){console.warn("[BuoyRedux] Cannot jump to state - no store instrumented");return}if(!$e()){console.warn("[BuoyRedux] Cannot jump to state - the root reducer cannot serve a state jump. Capture and time travel are wired separately: either put `import '@buoy-gg/redux';` first in your app entry (so Buoy is the store enhancer), or wrap your root reducer with withBuoyDevTools().");return}t.dispatch({type:xe,payload:e})}function Ht(e){let t=te();t?t.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}function so(e){return at(),(t,r)=>r.type===xe?r.payload:e(t,r)}var co=e=>(lt=true,ee(e,"middleware"),t=>r=>{let o=r;if(o.type?.startsWith("@@buoy/"))return t(r);let a=performance.now(),n=e.getState(),c=t(r),d=e.getState(),s=performance.now()-a;return x.addAction(o,n,d,s),c});function uo(e={}){let{maxActions:t=200,ignoreActions:r=[]}=e;return x.setMaxActions(t),o=>(lt=true,ee(o,"middleware"),a=>n=>{let c=n,d=c.type||"";if(d?.startsWith("@@buoy/")||r.includes(d))return a(n);let s=performance.now(),u=o.getState(),i=a(n),h=o.getState(),m=performance.now()-s;return x.addAction(c,u,h,m),i})}var Ve="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function po(){let{mechanism:e,hasStore:t,diagnostic:r}=re();return t?e==="patch"?{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${Ve}`}:{canCapture:true,canRestore:true,detail:e==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}:{canCapture:false,canRestore:false,detail:r==="no-react-redux"?"react-redux not installed":r==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}async function go(){let e=te();return e?{data:{state:e.getState()},warnings:[]}:{data:null,warnings:["no Redux store instrumented"]}}async function ho(e,t){let r=e,o=te();if(!o||r===void 0||r===null)return tt("redux",o?"empty redux snapshot":"no Redux store instrumented");let{mechanism:a}=re();if(a==="patch")return tt("redux",`restore unavailable on auto-instrumented stores \u2014 ${Ve}`);let n=Kr(t),c=Object.keys(r.state??{}).filter(s=>!n.touch(s)),d=r.state;if(c.length>0){let s=o.getState(),u={...r.state};for(let i of c)u[i]=s?.[i];d=u}if(o.dispatch({type:xe,payload:d}),o.getState()===d){let s=c.length>0?[`${c.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:s}}return tt("redux",`store ignored the state jump \u2014 ${Ve}`)}async function fo(e,t){let r=e?.state,o=t===void 0,a=te(),n=o?a?.getState():t?.state,c=[],d=[],s;if(o){let{mechanism:h,hasStore:m}=re();m?h==="patch"&&(s=`auto-instrumented store cannot be restored \u2014 ${Ve}`):s="no Redux store instrumented"}let u=n??{},i=r??{};for(let h of Jr(u,i)){let m=Ur({key:h,label:h,oldValue:u[h],newValue:i[h],inOld:Object.prototype.hasOwnProperty.call(u,h),inNew:Object.prototype.hasOwnProperty.call(i,h)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});s&&(m=Gr(m,s)),c.push(m)}return s&&d.push(`Redux restore unavailable: ${s}`),{items:c,notes:d}}Yr({id:"redux",label:"Redux",status:po,capture:go,restore:ho,previewItems:fo});function st(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...o)=>t(r(...o)))}function _t(e){return at(),(t,r)=>r&&r.type===xe?r.payload:e(t,r)}function yo(e){if(typeof e!="object"||e===null)return false;let t=e.type;return typeof t!="string"?false:!t.startsWith("@@buoy/")&&!t.startsWith("@@redux/")}var ze=e=>(t,r)=>{let o=e(_t(t),r),a={...o,dispatch:n=>{if(!yo(n)||Ft())return o.dispatch(n);let c=performance.now(),d=o.getState(),s=o.dispatch(n);return x.addAction(n,d,o.getState(),performance.now()-c),s},replaceReducer:n=>o.replaceReducer(_t(n)),[rt]:true};return ee(a,"enhancer"),a};function mo(...e){return e.length===0?st(ze):e.length===1&&typeof e[0]=="object"&&e[0]!==null?(...t)=>st(...t,ze):st(...e,ze)}var ct=false;function qt(){if(!(typeof jt<"u"&&jt))return false;let e=globalThis;return e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||(e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__=mo,ct=true),ct}function bo(){return ct}qt();import{useState as je,useMemo as Te,useRef as Le,useCallback as ae,useEffect as Ut}from"react";var Kt={};_r(Kt,{AccessibilityInfo:()=>vo,ActivityIndicator:()=>Ta,Alert:()=>Da,Animated:()=>ma,AppRegistry:()=>To,AppState:()=>Ao,Appearance:()=>wo,BackHandler:()=>Io,Button:()=>Aa,CheckBox:()=>Mo,Clipboard:()=>Do,DeviceEventEmitter:()=>oa,Dimensions:()=>Bo,Easing:()=>Ro,FlatList:()=>Yt,I18nManager:()=>ko,Image:()=>Ho,ImageBackground:()=>_o,InteractionManager:()=>$o,Keyboard:()=>Eo,KeyboardAvoidingView:()=>qo,LayoutAnimation:()=>Oo,Linking:()=>Vo,LogBox:()=>ra,Modal:()=>va,NativeEventEmitter:()=>zo,NativeModules:()=>So,PanResponder:()=>jo,Picker:()=>Uo,PixelRatio:()=>Lo,Platform:()=>Po,Pressable:()=>Sa,ProgressBar:()=>Ko,RefreshControl:()=>Yo,SafeAreaView:()=>Jo,ScrollView:()=>Pe,SectionList:()=>Go,Share:()=>Wo,StatusBar:()=>Xo,StyleSheet:()=>ge,Switch:()=>wa,Text:()=>y,TextInput:()=>ba,Touchable:()=>Qo,TouchableHighlight:()=>xa,TouchableNativeFeedback:()=>Zo,TouchableOpacity:()=>J,TouchableWithoutFeedback:()=>Ca,UIManager:()=>No,Vibration:()=>Fo,View:()=>l,VirtualizedList:()=>ea,YellowBox:()=>ta,findNodeHandle:()=>Ia,unstable_createElement:()=>Co,useColorScheme:()=>aa,useLocaleContext:()=>na,useWindowDimensions:()=>ia});qr(Kt,xo);import*as xo from"react-native-web";import{unstable_createElement as Co,NativeModules as So,AccessibilityInfo as vo,Appearance as wo,AppRegistry as To,AppState as Ao,BackHandler as Io,Clipboard as Do,Dimensions as Bo,Easing as Ro,I18nManager as ko,Keyboard as Eo,InteractionManager as $o,LayoutAnimation as Oo,Linking as Vo,NativeEventEmitter as zo,PanResponder as jo,PixelRatio as Lo,Platform as Po,Share as Wo,UIManager as No,Vibration as Fo,CheckBox as Mo,FlatList as Yt,Image as Ho,ImageBackground as _o,KeyboardAvoidingView as qo,Picker as Uo,ProgressBar as Ko,RefreshControl as Yo,SafeAreaView as Jo,SectionList as Go,StatusBar as Xo,Touchable as Qo,TouchableNativeFeedback as Zo,VirtualizedList as ea,YellowBox as ta,LogBox as ra,DeviceEventEmitter as oa,useColorScheme as aa,useLocaleContext as na,useWindowDimensions as ia}from"react-native-web";import*as M from"react-native-web";import{createElement as dt,forwardRef as Jt,useCallback as la,useRef as sa}from"react";import{useEffect as ca,useState as da}from"react";import{createPortal as ua}from"react-dom";var pa='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as ga}from"react/jsx-runtime";var Ae=Symbol.for("@buoy-gg/portal-host"),Gt=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function Xt(){let e=document;if(e[Ae])return e[Ae].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:pa});let r=()=>{let i=document.fullscreenElement,h=i&&i.tagName!=="CANVAS"?i:document.body;t.parentElement!==h&&h.appendChild(t)},o=new Map,a=i=>{(!t.contains(i.target)||!Gt(i.target))&&o.set(i.code||i.key,{key:i.key,code:i.code,location:i.location,keyCode:i.keyCode,which:i.which,altKey:i.altKey,ctrlKey:i.ctrlKey,metaKey:i.metaKey,shiftKey:i.shiftKey})},n=i=>{o.delete(i.code||i.key)},c=()=>o.clear(),d=()=>{let i=[...o.values()];o.clear();for(let h of i)document.dispatchEvent(new KeyboardEvent("keyup",{...h,bubbles:true}))},s=i=>{Gt(i.target)&&i.stopPropagation()},u=i=>i.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",c),t.addEventListener("focusin",d),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",u,{passive:true}),e[Ae]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",c),t.remove(),delete e[Ae]}},t}function ha({children:e}){let[t,r]=da(null);return ca(()=>{let o=Xt(),a=document[Ae];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?ua(ga("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var Ce=M,fa=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Se=e=>typeof e=="number"?`${e}px`:e;function ut(e){if(Array.isArray(e)){let h=e.map(ut);return h.some((m,R)=>m!==e[R])?h:e}if(!e||typeof e!="object"||!fa.some(h=>e[h]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:c,textShadowRadius:d,...s}=e;if(t!=null||r!=null||o!=null||a!=null){let h=t??"black",m=o==null?h:`color-mix(in srgb, ${h} ${Math.min(o,1)*100}%, transparent)`,R=`${Se(r?.width??0)} ${Se(r?.height??0)} ${Se(a??0)} ${m}`;s.boxShadow=typeof s.boxShadow=="string"?`${s.boxShadow}, ${R}`:s.boxShadow??R}let{width:u=0,height:i=0}=c??{};if(n&&(u||i||d)){let h=`${Se(u)} ${Se(i)} ${Se(d??0)} ${n}`;s.textShadow=s.textShadow?`${s.textShadow}, ${h}`:h}return s}var ya=Ce.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Qt(e,t){if(typeof e=="function")return o=>Qt(e(o),t);let r=ut(e);return t?[r,ya[t]]:r}var ge={...Ce.StyleSheet,create:e=>Ce.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ut(r)])))};function _(e){let t=Jt((o,a)=>{let{accessibilityState:n,accessibilityValue:c,pointerEvents:d,...s}=o;for(let i of["busy","checked","disabled","expanded","selected"])n?.[i]!==void 0&&s[`aria-${i}`]===void 0&&(s[`aria-${i}`]=n[i]);for(let[i,h]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[i]!==void 0&&s[`aria-${h}`]===void 0&&(s[`aria-${h}`]=c[i]);let u=Qt(s.style,d);return u!==s.style&&(s.style=u),dt(e,{...s,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var l=_(M.View),y=_(M.Text),ma={...Ce.Animated,View:Ce.Animated.createAnimatedComponent(l),Text:Ce.Animated.createAnimatedComponent(y)},ba=_(M.TextInput),J=_(M.TouchableOpacity),xa=_(M.TouchableHighlight),Ca=_(M.TouchableWithoutFeedback),Sa=_(M.Pressable),Pe=_(M.ScrollView),Zt=Jt((e,t)=>{let r=sa(null),o=la(a=>{if(a){let n=a;for(;n.parentElement&&n.parentElement!==document.body;)n=n.parentElement;n.parentElement===document.body&&(r.current=n,Object.assign(n.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Xt().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return dt(ha,null,dt(M.Modal,{...e,ref:o}))});Zt.displayName="Modal";var va=_(Zt),wa=_(M.Switch),Ta=_(M.ActivityIndicator),Aa=_(M.Button),Ia=M.findNodeHandle,Da={alert(e,t,r,o){if(typeof document>"u")return;let a=document.createElement("dialog");a.dataset.buoyRoot="",a.setAttribute("aria-label",e),a.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",a.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",a.appendChild(u)}let c=document.createElement("div");c.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let d=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let u of d){let i=document.createElement("button");i.type="button",i.textContent=u.text??"OK",i.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,i.onclick=()=>{s(),u.onPress?.()},c.appendChild(i)}a.addEventListener("cancel",u=>{u.preventDefault(),o?.cancelable!==false&&(s(),o?.onDismiss?.())}),a.appendChild(c),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{JsModal as Ba,ModalHeader as ne,macOSColors as G,night as T,Search as Ra,Trash2 as ka,Power as Ea,Zap as $a,CheckCircle as Oa,Copy as Va,Lock as za,AlertTriangle as er,devToolsStorageKeys as ja,copyToClipboard as La,ProUpgradeModal as Pa,PowerToggleButton as Wa,TickProvider as tr,useLimit as Na,TIER_LIMITS as Fa,windowDragProps as Ma,ToolEmptyState as Ha,resolveListEmptyState as _a,EVENT_LIST_PRESET as qa,monoFont as Ua}from"@buoy-gg/shared-ui/web";import{useIsPro as Ka}from"@buoy-gg/license/web";import{useState as Ya,useMemo as rr,useCallback as or}from"react";import{useChangeLog as Ja}from"@buoy-gg/shared-ui/web";var Ga=(e,t)=>x.filterActions(t);function ar(){let e=Ja(x,{filterItems:Ga}),[t,r]=Ya(null),o=rr(()=>x.getStats(),[e.items]),a=rr(()=>x.getUniqueActionTypes(),[e.items]),n=or(()=>{x.clearActions(),r(null)},[]),c=or(d=>x.getActionById(d),[]);return{actions:e.items,filteredActions:e.filteredItems,filter:e.filter,setFilter:e.setFilter,stats:o,clearActions:n,isEnabled:e.isEnabled,toggleCapture:e.toggleCapture,actionTypes:a,getActionById:c,selectedAction:t,setSelectedAction:r}}import{useStore as Xa}from"react-redux";function nr(){return Xa}import{useEffect as Qa,useState as We,useRef as ir,useCallback as lr}from"react";var Ie=Symbol.for("@@buoy/instrumented"),pt=Symbol.for("@@buoy/originalDispatch");function Za(e){let t=e;return t[Ie]===true||t[rt]===true}function gt(e,t={}){let r=e;if(r[rt])return ee(e,"enhancer"),()=>{};if(Ft())return ee(e,"middleware"),()=>{};if(r[Ie])return ee(e,"patch"),()=>{};let{maxActions:o=200,ignoreActions:a=[]}=t;x.setMaxActions(o);let n=e.dispatch.bind(e);r[pt]=n;let c=(d=>{if(typeof d!="object"||d===null||typeof d.type!="string")return n(d);let s=d.type;if(s.startsWith("@@buoy/")||s.startsWith("@@redux/")||a.includes(s))return n(d);let u=performance.now(),i=e.getState(),h=n(d),m=e.getState(),R=performance.now()-u;return x.addAction(d,i,m,R),h});return e.dispatch=c,r[Ie]=true,ee(e,"patch"),()=>{ht(e)}}function ht(e){let t=e;if(t[Ie]){let r=t[pt];r&&(e.dispatch=r),delete t[Ie],delete t[pt]}Pt(e)}function en(e,t={}){return gt(e,t)}function Ne(){return te()}function tn(){return te()!==null}function ft(e={}){let{autoStart:t=true}=e,r=ir(e);r.current=e;let[o,a]=We(false),[n,c]=We(true),[d,s]=We(null),[u,i]=We(null),h=ir(null),m=nr(),R=m!==null,V=null,z=null,L=null;if(m)try{V=m()}catch(O){L="no-provider",z=O instanceof Error?O.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else L="no-react-redux",z="react-redux is not installed or not available";let P=re().mechanism==="extension"?te():null,w=lr(()=>{if(!V&&P){a(true),i(P),s(null),c(false);return}if(!V){Xr(L),s(z||"No Redux store available"),c(false);return}try{let O=gt(V,r.current);h.current=O,a(true),i(V),s(null)}catch(O){s(O instanceof Error?O.message:"Failed to instrument Redux store"),a(false)}finally{c(false)}},[V,P]),K=lr(()=>{h.current&&(h.current(),h.current=null),u&&ht(u),a(false),i(null)},[u]);return Qa(()=>(t?w():c(false),()=>{}),[t,w]),{isInstrumented:o,isLoading:n,error:d,isReactReduxAvailable:R,captureMechanism:re().mechanism,startInstrumentation:w,stopInstrumentation:K,store:u}}function rn(){let e=nr();if(!e)return{isAvailable:false,error:"react-redux is not installed"};try{let t=e();return{isAvailable:t!=null,error:null}}catch(t){return{isAvailable:false,error:t instanceof Error?t.message:"Not inside a Redux Provider"}}}import{memo as on}from"react";import{ChangeRow as De,buoyColors as ie,AlertCircle as an,monoFont as nn}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as sr}from"react/jsx-runtime";var cr=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function ln(e){return e<=0?{bg:"rgba(142, 142, 147, 0.2)",text:ie.textSecondary}:cr[(e-1)%cr.length]}var yt={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function sn(e){if(!e)return"#6B7280";let t=e.toLowerCase();if(yt[t])return yt[t];for(let[r,o]of Object.entries(yt))if(t.includes(r))return o;return`hsl(${e.split("").reduce((r,o)=>r+o.charCodeAt(0),0)*137%360}, 70%, 60%)`}function cn(e,t){switch(e){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return t?t.charAt(0).toUpperCase()+t.slice(1):"Action"}}function dn(e,t,r){switch(e){case"pending":return ie.warning;case"fulfilled":return ie.success;case"rejected":return ie.error;case"internal":return ie.textMuted;case"query":return ie.info;case"mutation":return ie.info;default:return sn(r)}}function un(e){let t=[];return e.duration!==void 0&&e.duration>=.1&&t.push(`${e.duration.toFixed(1)}ms`),e.hasStateChange?e.changedKeysCount&&e.changedKeysCount>0?t.push(`${e.changedKeysCount} key${e.changedKeysCount>1?"s":""} changed`):t.push(e.diffSummary||"state changed"):t.push("no state change"),t.join(" \xB7 ")}function pn(e){return e.actionName?.toUpperCase()||e.type.split("/").pop()?.toUpperCase()||""}function gn(e){if(e.category==="internal")return e.type;let t=e.type.split("/");return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])?t.slice(0,-1).join("/"):e.type}var dr=on(function({action:e,onPress:t,linkedCount:r,testID:o}){let a=e.sliceName??void 0,n=dn(e.category,e.hasStateChange,a),c=cn(e.category,a),d=un(e),s=gn(e),u=pn(e),i=u&&u!==s.toUpperCase()?u:void 0,h=(r??0)>1,m=h?x.getLinkedActions(e):[],R=h?m.findIndex(w=>w.id===e.id)+1:0,V=h&&e.meta?.requestId?x.getAsyncOperationIndex(e.meta.requestId):0,z=ln(V),L=h?le(l,{style:[Fe.asyncSequenceBadge,{backgroundColor:z.bg}],children:sr(y,{style:[Fe.asyncSequenceText,{color:z.text}],testID:o?`${o}-seq`:void 0,children:[R,"/",r," #",V]})}):void 0,P={statusColor:n,statusLabel:c,sublabel:d,primaryText:s,timestamp:e.timestamp,onPress:()=>t(e),testID:o,accessibilityLabel:`${s}, ${c}, ${d}`};return e.isSlowAction?le(De,{...P,badgePrefix:L,slow:true}):e.category==="rejected"?le(De,{...P,customBadge:sr(l,{style:Fe.badgeContainer,children:[L,le(l,{style:Fe.errorBadge,testID:o?`${o}-error`:void 0,children:le(an,{size:12,color:ie.error})})]})}):h?le(De,{...P,badgePrefix:L,changed:e.hasStateChange}):e.hasStateChange?le(De,{...P,badgeText:i,changed:true}):le(De,{...P,plainBadgeText:i})}),Fe=ge.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:nn}});import{useState as ur,useCallback as Me,useMemo as pr}from"react";import{macOSColors as Be,night as X,EventStepperFooter as gr,formatRelativeTime as He,parseValue as _e,monoFont as Re}from"@buoy-gg/shared-ui/web";import{DataViewer as hn,SplitDiffViewer as fn,TreeDiffViewer as yn,diffThemes as mn}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as bn}from"react";import{DetailViewToggle as xn,FileText as Cn,Database as Sn,GitBranch as vn}from"@buoy-gg/shared-ui/web";import{jsx as wn}from"react/jsx-runtime";var Tn=[{key:"action",label:"ACTION",description:"View action details",icon:Cn},{key:"state",label:"STATE",description:"View current state",icon:Sn},{key:"diff",label:"DIFF",description:"Compare changes",icon:vn}],An=["diff"],In=bn(function({activeView:e,onViewChange:t,diffDisabled:r=false}){return wn(xn,{views:Tn,activeView:e,onViewChange:t,disabledKeys:r?An:void 0,testIDPrefix:"buoy-redux"})});import{memo as Dn,useMemo as Bn,useCallback as qe,useState as Rn,useEffect as kn}from"react";import{buoyColors as D,night as S,Clock as En,AlertTriangle as $n,Zap as On,Hash as hr,Info as Vn,Box as zn,AlertCircle as jn,FileText as Ln,parseValue as Ue,ProUpgradeModal as Pn,copyToClipboard as fr,InfoRow as se,monoFont as ce}from"@buoy-gg/shared-ui/web";import{useIsPro as Wn}from"@buoy-gg/license/web";import{DataViewer as Ke}from"@buoy-gg/shared-ui/web/dataViewer";import{night as B,monoFont as Nn}from"@buoy-gg/shared-ui/web";import{jsx as yr,jsxs as Fn}from"react/jsx-runtime";var Mn={replay:{color:B.color.accent,backgroundColor:B.color.accent+"15",borderColor:B.color.accent+"40",textColor:B.color.accent},copy:{color:B.color.accent,backgroundColor:B.color.accent+"15",borderColor:B.color.accent+"40",textColor:B.color.accent},jump:{color:B.color.warning,backgroundColor:B.color.warning+"15",borderColor:B.color.warning+"40",textColor:B.color.warning},skip:{color:B.color.textSecondary,backgroundColor:B.color.textSecondary+"26",borderColor:B.color.textSecondary+"59",textColor:B.color.textSecondary},clear:{color:B.color.danger,backgroundColor:B.color.danger+"15",borderColor:B.color.danger+"40",textColor:B.color.danger},diff:{color:B.color.info,backgroundColor:B.color.info+"15",borderColor:B.color.info+"40",textColor:B.color.info}};function Ye({onPress:e,text:t,type:r,disabled:o=false,testID:a}){let n=Mn[r];return Fn(J,{testID:a,disabled:o,onPress:e,style:[mt.button,{backgroundColor:o?B.color.textTertiary+"1A":n.backgroundColor,borderColor:o?B.color.textTertiary+"33":n.borderColor,opacity:o?.5:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},children:[yr(l,{style:[mt.dot,{backgroundColor:o?B.color.textTertiary:n.color}]}),yr(y,{style:[mt.text,{color:o?B.color.textTertiary:n.textColor}],children:t})]})}var mt=ge.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:6,borderWidth:1,paddingHorizontal:12,paddingVertical:6,height:25,minWidth:80,shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:2},dot:{width:5,height:5,borderRadius:3,marginRight:6,shadowColor:B.color.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:Nn,height:12}});var f="buoy-redux";function mr(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function br(e,t){return`${f}-row-${mr(e)}-${t}`}function xr(e){let t=new Map,r=new Map;for(let o of e){let a=(t.get(o.type)??0)+1;t.set(o.type,a),r.set(o.id,br(o.type,a))}return r}import{jsx as g,jsxs as k}from"react/jsx-runtime";function Cr(e){switch(e){case"pending":return{label:"PENDING",color:D.warning,bgColor:D.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:D.success,bgColor:D.success+"26"};case"rejected":return{label:"REJECTED",color:D.error,bgColor:D.error+"26"};case"internal":return{label:"INTERNAL",color:D.textMuted,bgColor:D.textMuted+"26"};case"query":return{label:"QUERY",color:D.info,bgColor:D.info+"26"};case"mutation":return{label:"MUTATION",color:D.info,bgColor:D.info+"26"};default:return{label:"ACTION",color:D.info,bgColor:D.info+"26"}}}function Hn(e){return e===void 0?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function ve({icon:e,title:t,badge:r,testID:o}){return k(l,{style:p.sectionHeader,testID:o,children:[k(l,{style:p.sectionHeaderLeft,children:[g(e,{size:14,color:S.color.accent}),g(y,{style:p.sectionTitle,children:t})]}),r]})}function _n(e){let t=new Date(e),r=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0"),n=t.getMilliseconds().toString().padStart(3,"0");return`${r}:${o}:${a}.${n}`}var qn=Dn(function({action:e,onNavigateToAction:t}){let r=Wn(),[o,a]=Rn(false);kn(()=>{o&&r&&a(false)},[o,r]);let n=Cr(e.category),c=oe(e.nextState),d=$e(),s=c||!d,u=e.payload!==void 0,i=e.meta&&Object.keys(e.meta).length>0,h=e.error!==void 0,m=Bn(()=>x.getLinkedActions(e),[e]),R=m.length>1,V=R?x.getBaseActionType(e.type):null,z=e.meta?.requestId?x.getAsyncOperationDuration(e.meta.requestId):null,L=qe(async()=>{if(!r){a(true);return}await fr(e.action)},[e,r]),P=qe(async()=>{if(!r){a(true);return}await fr(e.payload)},[e.payload,r]),w=qe(()=>{e.action&&typeof e.action=="object"&&"type"in e.action&&Ht(e.action)},[e]),K=qe(()=>{e.nextState!==void 0&&Mt(e.nextState)},[e]);return k(Pe,{testID:`${f}-detail-scroll`,style:p.container,contentContainerStyle:p.contentContainer,showsVerticalScrollIndicator:false,children:[k(l,{style:p.card,testID:`${f}-info-card`,children:[g(ve,{icon:Vn,title:"ACTION INFO"}),k(l,{style:p.cardContent,children:[g(se,{label:"Type",value:e.type,mono:true,testID:`${f}-info-type`}),e.sliceName&&g(se,{label:"Slice",value:e.sliceName,mono:true,testID:`${f}-info-slice`}),g(se,{label:"Action",value:e.actionName,mono:true,testID:`${f}-info-action`}),k(l,{style:p.badgeRow,children:[g(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:g(y,{style:[p.categoryText,{color:n.color}],testID:`${f}-info-category`,children:n.label})}),k(l,{style:[p.durationBadge,e.isSlowAction&&p.durationBadgeSlow],children:[g(En,{size:10,color:e.isSlowAction?D.error:S.color.textSecondary}),g(y,{style:[p.durationText,e.isSlowAction&&p.durationTextSlow],testID:`${f}-info-duration`,children:Hn(e.duration)}),e.isSlowAction&&g($n,{size:10,color:D.error})]}),e.hasStateChange?k(l,{style:p.changesBadge,children:[g(On,{size:10,color:D.success}),g(y,{style:p.changesText,testID:`${f}-info-changes`,children:e.diffSummary||"changed"})]}):g(l,{style:p.noChangesBadge,children:g(y,{style:p.noChangesText,testID:`${f}-info-no-changes`,children:"no change"})})]})]})]}),R&&k(l,{style:p.card,testID:`${f}-async-card`,children:[g(ve,{icon:hr,title:"ASYNC FLOW",badge:g(l,{style:p.asyncBadge,children:k(y,{style:p.asyncBadgeText,testID:`${f}-async-count`,children:[m.length," ACTIONS"]})})}),k(l,{style:p.cardContent,children:[g(y,{style:p.baseActionType,testID:`${f}-async-base`,children:V}),z!==null&&k(l,{style:p.totalDurationRow,children:[g(y,{style:p.totalDurationLabel,children:"Total Duration"}),k(y,{style:p.totalDurationValue,testID:`${f}-async-total`,children:[z,"ms"]})]}),g(l,{style:p.timeline,children:m.map((O,F)=>{let Q=Cr(O.category),Y=O.id===e.id;return k(J,{style:[p.timelineItem,Y&&p.timelineItemCurrent],onPress:()=>t?.(O),disabled:Y||!t,activeOpacity:.7,testID:`${f}-async-step-${F}`,children:[F<m.length-1&&g(l,{style:p.timelineConnector}),g(l,{style:[p.timelineDot,{backgroundColor:Q.color}]}),k(l,{style:p.timelineContent,children:[k(l,{style:p.timelineHeader,children:[g(l,{style:[p.timelineStatusBadge,{backgroundColor:Q.bgColor}],children:g(y,{style:[p.timelineStatusText,{color:Q.color}],testID:`${f}-async-step-${F}-status`,children:Q.label})}),Y&&g(l,{style:p.currentBadge,testID:`${f}-async-step-${F}-current`,children:g(y,{style:p.currentBadgeText,children:"CURRENT"})})]}),g(y,{style:p.timelineTime,children:_n(O.timestamp)})]})]},O.id)})})]})]}),u&&k(l,{style:p.card,testID:`${f}-payload-card`,children:[g(ve,{icon:zn,title:"PAYLOAD",badge:g(l,{style:p.typeBadge,children:g(y,{style:p.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload=="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),g(l,{style:p.dataViewerContainer,children:g(Ke,{title:"",data:Ue(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),i&&k(l,{style:p.card,testID:`${f}-meta-card`,children:[g(ve,{icon:hr,title:"ASYNC METADATA",badge:g(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:g(y,{style:[p.categoryText,{color:n.color}],children:"RTK THUNK"})})}),k(l,{style:p.cardContent,children:[e.meta?.requestId&&g(se,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&g(se,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:n.color,testID:`${f}-meta-status`}),e.meta?.arg!==void 0&&k(l,{style:p.argSection,children:[g(y,{style:p.argLabel,children:"Original Argument"}),g(l,{style:p.argValueContainer,children:typeof e.meta.arg=="object"?g(Ke,{title:"",data:Ue(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):g(y,{style:p.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&g(se,{label:"Rejected With Value",value:"true",valueColor:D.error}),e.meta?.aborted&&g(se,{label:"Aborted",value:"true",valueColor:D.warning}),e.meta?.condition&&g(se,{label:"Condition",value:"true",valueColor:S.color.textTertiary})]})]}),h&&k(l,{style:[p.card,p.errorCard],testID:`${f}-error-card`,children:[g(ve,{icon:jn,title:"ERROR",badge:g(l,{style:p.errorBadge,children:g(y,{style:p.errorBadgeText,testID:`${f}-error-badge`,children:"REJECTED"})})}),g(l,{style:p.dataViewerContainer,children:typeof e.error=="object"?g(Ke,{title:"",data:Ue(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):g(y,{style:p.errorText,children:String(e.error)})})]}),k(l,{style:p.card,testID:`${f}-full-action-card`,children:[g(ve,{icon:Ln,title:"FULL ACTION OBJECT"}),g(l,{style:p.dataViewerContainer,children:g(Ke,{title:"",data:Ue(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),g(l,{style:p.actionFooter,children:k(l,{style:p.actionsGrid,children:[k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"replay",text:"REPLAY",onPress:w,testID:`${f}-replay`}),g(y,{style:p.actionDescription,children:"Dispatch again"})]}),k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"jump",text:"JUMP",onPress:K,disabled:s,testID:`${f}-jump`}),g(y,{style:p.actionDescription,testID:`${f}-jump-description`,children:c?"State not retained":d?"Restore this state":"Time travel not wired"})]}),k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"copy",text:"COPY ACTION",onPress:L,testID:`${f}-copy-action`}),g(y,{style:p.actionDescription,children:r?"Copy to clipboard":"Pro feature"})]}),u&&k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"copy",text:"COPY PAYLOAD",onPress:P,testID:`${f}-copy-payload`}),g(y,{style:p.actionDescription,children:r?"Copy payload only":"Pro feature"})]})]})}),g(Pn,{visible:o,onClose:()=>a(false),featureName:"Copy"})]})}),p=ge.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:S.color.surface,borderRadius:6,borderWidth:1,borderColor:S.color.accent+"4D",overflow:"hidden",shadowColor:S.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:D.error+"4D",shadowColor:D.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:S.color.accent+"33",backgroundColor:S.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:S.color.accent,fontFamily:ce},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.surfaceElevated},durationBadgeSlow:{backgroundColor:D.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:S.color.textSecondary,fontFamily:ce},durationTextSlow:{color:D.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:D.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:D.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:S.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:S.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:S.color.textTertiary,fontFamily:ce},dataViewerContainer:{backgroundColor:S.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:S.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:S.color.bg,borderRadius:6,borderWidth:1,borderColor:S.color.border,overflow:"hidden"},argValue:{fontSize:11,color:S.color.text,fontFamily:ce,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:D.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:D.error,letterSpacing:.3},errorText:{fontSize:12,color:D.error,fontFamily:ce,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:S.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:S.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:S.color.text,fontFamily:ce,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:S.color.border},totalDurationLabel:{fontSize:11,color:S.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:D.success,fontFamily:ce},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:S.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:S.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:S.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:S.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:S.color.textTertiary,fontFamily:ce},actionFooter:{backgroundColor:S.color.surface,borderRadius:6,borderWidth:1,borderColor:S.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:S.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:S.color.textTertiary,textAlign:"center"}});import{DiffModeTabs as Un,CompareBar as Kn}from"@buoy-gg/shared-ui/web";import{jsx as E,jsxs as he}from"react/jsx-runtime";function bt(e){return e.includes("/pending")?Be.semantic.warning:e.includes("/fulfilled")?Be.semantic.success:e.includes("/rejected")?Be.semantic.error:e.startsWith("@@")?Be.text.muted:Be.semantic.info}function Sr(e){if(e.includes("/pending"))return"PENDING";if(e.includes("/fulfilled"))return"FULFILLED";if(e.includes("/rejected"))return"REJECTED";if(e.startsWith("@@"))return"INTERNAL";let t=e.split("/");return t[t.length-1]?.toUpperCase()||"ACTION"}function Yn(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}function vr(e){return new Date(e).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var Jn=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function wr({action:e,actions:t,selectedIndex:r,onIndexChange:o,disableInternalFooter:a=false,initialView:n="action"}){let[c,d]=ur(n),[s,u]=ur("tree"),i=t.length,h=oe(e.nextState),m=bt(e.type),R=Sr(e.type),V=Yn(_e(e.nextState)),z=i-r,L=z-1,P=r<i-1?r+1:null,w=P!==null?t[P]:null,K=pr(()=>({index:P??0,label:L>0?`#${L}`:"Initial",timestamp:w?vr(w.timestamp):"",relativeTime:w?He(new Date(w.timestamp)):"state",badge:w?E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${bt(w.type)}20`}],children:E(y,{style:[$.actionTextSmall,{color:bt(w.type)}],children:Sr(w.type)})}):void 0}),[P,w,L]),O=pr(()=>({index:r,label:`#${z}`,timestamp:vr(e.timestamp),relativeTime:He(new Date(e.timestamp)),badge:E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionTextSmall,{color:m}],children:R})})}),[r,e.timestamp,m,R,z]),F=Me(()=>{if(h)return he(l,{style:$.contentCard,testID:`${f}-state-evicted`,children:[E(l,{style:$.valueHeader,children:E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"})}),E(y,{style:$.evictedText,children:`Not retained. Raw state is kept for the ${nt} most recent actions, so this action's before/after trees have been released.`})]});let fe=_e(e.nextState);return he(l,{style:$.contentCard,testID:`${f}-state-card`,children:[he(l,{style:$.valueHeader,children:[E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"}),he(l,{style:$.valueHeaderBadges,children:[E(l,{style:[$.actionBadge,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionText,{color:m}],children:R})}),E(l,{style:$.typeBadge,children:E(y,{style:$.typeText,testID:`${f}-state-type`,children:V.toUpperCase()})})]})]}),E(l,{style:$.dataViewerContainer,children:E(hn,{title:"",data:fe,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,m,R,V,h]),Q=Me(()=>{let fe=_e(e.prevState),ye=_e(e.nextState);return s==="split"?E(Pe,{style:{flex:1},showsVerticalScrollIndicator:true,children:E(fn,{oldValue:fe,newValue:ye,theme:mn.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})}):E(yn,{oldValue:fe,newValue:ye})},[e.prevState,e.nextState,s]),Y=Me(()=>{o(Math.min(i-1,r+1))},[r,i,o]),Qe=Me(()=>{o(Math.max(0,r-1))},[r,o]),W=h||oe(e.prevState)||e.prevState===void 0,Z=!a&&i>1;return he(l,{style:$.container,children:[E(In,{activeView:c,onViewChange:d,diffDisabled:W}),he(l,{style:[$.contentArea,Z&&$.contentAreaFooterPad],children:[c==="action"&&E(qn,{action:e}),c==="state"&&E(l,{style:$.stateContainer,children:F()}),c==="diff"&&he(l,{style:$.diffContainer,testID:`${f}-diff`,children:[E(Un,{tabs:Jn,activeTab:s,onTabChange:u,testIDPrefix:`${f}-diff-tab`}),E(Kn,{leftEvent:K,rightEvent:O}),E(l,{style:$.diffContent,testID:`${f}-diff-content`,children:Q()})]})]}),Z&&E(gr,{currentIndex:z-1,totalItems:i,onPrevious:Y,onNext:Qe,itemLabel:"Action",subtitle:He(new Date(e.timestamp)),absolute:true})]})}function Tr({action:e,actions:t,selectedIndex:r,onIndexChange:o}){let a=t.length;if(a<=1)return null;let n=a-r;return E(gr,{currentIndex:n-1,totalItems:a,onPrevious:()=>o(Math.min(a-1,r+1)),onNext:()=>o(Math.max(0,r-1)),itemLabel:"Action",subtitle:He(new Date(e.timestamp))})}var $=ge.create({container:{flex:1,backgroundColor:"transparent"},contentArea:{flex:1},contentAreaFooterPad:{paddingBottom:96},stateContainer:{flex:1,padding:14},contentCard:{backgroundColor:X.color.surface,borderRadius:14,padding:14,borderWidth:1,borderColor:X.color.border},valueHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:8},valueLabel:{fontSize:10,color:X.color.textSecondary,fontFamily:Re,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:Re,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:X.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:X.color.textTertiary,fontFamily:Re},valueBox:{backgroundColor:X.color.bg,borderRadius:6,borderWidth:1,borderColor:X.color.border,padding:8},evictedText:{fontSize:12,color:X.color.textSecondary,lineHeight:18},valueText:{fontSize:12,color:X.color.text,fontFamily:Re,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:Re},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});import{Fragment as Gn,jsx as b,jsxs as N}from"react/jsx-runtime";var Xn=Fa["redux.actions"].free;function Qn({isEnabled:e,query:t,totalActions:r}){let o=_a({subject:"actions",search:t,total:r,capturing:e,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return b(Ha,{...o,testID:`${f}-empty`})}function xt({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,onActionSelect:c,initialSelectedActionId:d,initialDetailView:s}){let u=Ka(),i=Na("redux.actions"),[h,m]=je(false),{isInstrumented:R,isLoading:V,error:z,isReactReduxAvailable:L,captureMechanism:P}=ft(),{filteredActions:w,filter:K,setFilter:O,stats:F,clearActions:Q,isEnabled:Y,toggleCapture:Qe}=ar(),W=Te(()=>w.slice(0,i),[w,i]),Z=Te(()=>Math.max(0,w.length-i),[w.length,i]),fe=Z>0,[ye,Ee]=je(null),me=Te(()=>{if(ye===null)return null;let C=W.findIndex(j=>j.id===ye);return C>=0?C:null},[ye,W]),U=me!==null?W[me]:null,vt=Le(null);Ut(()=>{if(!c)return;let C=U?.id??null;C===null||C===vt.current||(vt.current=C,c(U))},[U,c]);let wt=Le(null);Ut(()=>{!d||wt.current===d||W.findIndex(C=>C.id===d)<0||(wt.current=d,Ee(d))},[d,W]);let[we,Tt]=je(""),[At,Ze]=je(false),wi=Le(null),Rr=Le(null),kr=ae(C=>{},[]),Er=C=>{Tt(C),O(j=>({...j,searchText:C}))},$r=ae(()=>{Tt(""),O(C=>({...C,searchText:""})),Ze(false)},[O]),It=ae(C=>{Ee(C.id)},[]),Or=ae(()=>{m(true)},[]),Vr=ae(()=>{Ee(null)},[]),Dt=ae(C=>{let j=W[C];j&&Ee(j.id)},[W]),zr=async()=>{if(!u){m(true);return}let C=w.map(j=>({id:j.id,type:j.type,...j.payload!==void 0&&{payload:j.payload},timestamp:j.timestamp,prevState:j.prevState,nextState:j.nextState,hasStateChange:j.hasStateChange}));await La(C)},jr=ae(C=>C.id,[]),Bt=Te(()=>xr(W),[W]),Rt=Te(()=>{let C=new Map;for(let j of x.getActions()){let et=j.meta?.requestId;et&&C.set(et,(C.get(et)??0)+1)}return C},[w]),Lr=ae(({item:C})=>{let j=C.meta?.requestId;return b(dr,{action:C,onPress:It,linkedCount:j?Rt.get(j)??0:0,testID:Bt.get(C.id)})},[It,Bt,Rt]),kt=()=>U?N(ne,{children:[b(ne.Navigation,{onBack:Vr}),b(ne.Content,{title:U.type,centered:true,testID:`${f}-detail-title`})]}):N(ne,{children:[r&&b(ne.Navigation,{onBack:r}),b(ne.Content,{title:"",children:At?b(ne.Search,{value:we,onChangeText:Er,onCancel:$r,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${f}-search-field`,containerTestID:`${f}-search`,clearTestID:`${f}-search-clear`,onBlur:()=>{we.length===0&&Ze(false)}}):N(l,{style:I.headerChipRow,children:[N(J,{style:[I.headerChip,!K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(C=>({...C,onlyWithChanges:false})),testID:`${f}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${F.totalActions} captured`,accessibilityState:{selected:!K.onlyWithChanges},children:[b(y,{style:I.headerChipLabel,children:"ALL"}),b(y,{style:[I.headerChipValue,{color:T.color.text}],testID:`${f}-chip-all-value`,children:F.totalActions})]}),N(J,{style:[I.headerChip,K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(C=>({...C,onlyWithChanges:true})),testID:`${f}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${F.actionsWithChanges} of them`,accessibilityState:{selected:!!K.onlyWithChanges},children:[b($a,{size:12,color:G.semantic.warning}),b(y,{style:[I.headerChipValue,{color:G.semantic.warning}],testID:`${f}-chip-changed-value`,children:F.actionsWithChanges})]}),N(l,{style:I.headerChip,testID:`${f}-chip-types`,accessibilityLabel:`${F.uniqueActionTypes} distinct action types`,children:[b(Oa,{size:12,color:G.semantic.success}),b(y,{style:[I.headerChipValue,{color:G.semantic.success}],testID:`${f}-chip-types-value`,children:F.uniqueActionTypes})]})]})}),N(ne.Actions,{children:[!At&&b(J,{onPress:()=>Ze(true),style:[I.headerActionButton,we.length>0&&I.headerActionButtonActive],testID:`${f}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:b(Ra,{size:14,color:we.length>0?T.color.accent:T.color.textSecondary})}),b(J,{onPress:zr,style:[I.headerActionButton,w.length===0&&I.headerActionButtonDisabled],disabled:w.length===0,testID:`${f}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:w.length===0},children:b(Va,{size:14,color:w.length>0?T.color.textSecondary:T.color.textTertiary})}),b(Wa,{isEnabled:Y,onToggle:Qe,accessibilityLabel:"Toggle Redux action capture",testID:`${f}-power`}),b(J,{onPress:Q,style:[I.headerActionButton,w.length===0&&I.headerActionButtonDisabled],disabled:w.length===0,testID:`${f}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:w.length===0},children:b(ka,{size:14,color:w.length>0?T.color.textTertiary:T.color.textTertiary})})]})]}),Pr=a?ja.modal.root():"buoy-redux-modal";if(!e)return null;let Et=U&&me!==null?b(Tr,{action:U,actions:W,selectedIndex:me,onIndexChange:Dt}):null,Wr=U&&W.length>1?68:0,Nr=U==null,$t=b(l,{style:I.container,children:U&&me!==null?b(wr,{action:U,actions:W,selectedIndex:me,onIndexChange:Dt,disableInternalFooter:true,initialView:s}):N(Gn,{children:[z&&!R&&!x.isCaptureSuppressed()&&N(l,{style:I.errorBanner,testID:`${f}-banner-error`,children:[b(er,{size:14,color:T.color.danger}),b(y,{style:I.errorText,children:L?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!Y&&R&&N(l,{style:I.disabledBanner,testID:`${f}-banner-disabled`,children:[b(Ea,{size:14,color:T.color.warning}),b(y,{style:I.disabledText,children:"Action capture is disabled"})]}),P==="patch"&&!x.isCaptureSuppressed()&&N(l,{style:I.disabledBanner,testID:`${f}-banner-patch`,children:[b(er,{size:14,color:T.color.warning}),b(y,{style:I.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),fe&&N(J,{style:I.lockedBanner,onPress:Or,activeOpacity:.8,testID:`${f}-locked`,accessibilityRole:"button",accessibilityLabel:`${Z} older ${Z===1?"action":"actions"} locked. Upgrade to see them.`,children:[b(za,{size:14,color:T.color.accent}),N(y,{style:I.lockedText,testID:`${f}-locked-text`,children:[Z," older ",Z===1?"action":"actions"," locked"]}),b(l,{style:I.upgradeBadge,children:b(y,{style:I.upgradeBadgeText,children:"UPGRADE"})})]}),W.length>0?b(Yt,{ref:Rr,testID:`${f}-list`,data:W,renderItem:Lr,keyExtractor:jr,contentContainerStyle:I.listContent,showsVerticalScrollIndicator:true,...qa}):b(Qn,{isEnabled:Y,query:we,totalActions:F.totalActions})]})}),Ot=b(Pa,{visible:h,onClose:()=>m(false),featureName:"Full Action History"});return n?N(tr,{children:[N(l,{style:I.inlineRoot,children:[b(l,{style:I.inlineHeader,...Ma,children:kt()}),$t,Et]}),Ot]}):N(tr,{children:[b(Ba,{visible:e,onClose:t,onMinimize:o,persistenceKey:Pr,header:{showToggleButton:true,customContent:kt()},onModeChange:kr,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Nr,styles:{},footer:Et,footerHeight:Wr,children:$t}),Ot]})}function Zn(e={}){return b(xt,{...e,inline:true,visible:true,onClose:()=>{}})}var I=ge.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:G.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:T.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:T.color.border},headerChipActive:{backgroundColor:T.color.accentSoft,borderColor:T.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:T.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:Ua},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:T.color.surfaceElevated,borderWidth:1,borderColor:T.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:T.color.accentSoft,borderColor:T.color.accentBorderStrong},startButton:{backgroundColor:G.semantic.successBackground,borderColor:G.semantic.success+"40"},stopButton:{backgroundColor:G.semantic.errorBackground,borderColor:G.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:T.color.danger+"20"},errorText:{color:T.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:T.color.warning+"20"},disabledText:{color:T.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:T.color.accentBorder},lockedText:{color:T.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:T.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:T.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});import{ReduxIcon as Je,REDUX_ICON_COLOR as al}from"@buoy-gg/floating-tools-core/web";import{createToolFactory as ei,defineToolPreset as ti}from"@buoy-gg/shared-ui/web";import{jsx as Ar}from"react/jsx-runtime";var Ir=ti({id:"redux",name:"REDUX",description:"Redux action & state inspector",slot:"both",icon:({size:e})=>Ar(Je,{size:e}),component:xt,props:{enableSharedModalDimensions:false}}),ri=ei(Ir,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}),e=>({icon:({size:t})=>Ar(Je,{size:t,color:e.iconColor})}));var oi={timeTravel:false,toggle:false,edit:false,diff:true,export:true,import:false,reset:true,recording:true};function ai(e,t,r){return{id:e.id,label:e.type,timestamp:e.timestamp,data:e.payload??e.action,prevState:e.prevState,nextState:e.nextState,hasStateChange:e.hasStateChange,duration:e.duration,source:"redux",isCurrent:t===0,isInFuture:false,isSkipped:false,meta:{fullAction:e.action}}}function Dr(e){let{icon:t=Je,color:r="#764ABC",name:o="Redux"}=e??{},a=0;return{id:"redux",name:o,icon:t,color:r,capabilities:oi,subscribe:n=>x.subscribe(()=>{n()}),getEntries:()=>{let n=x.getActions();return n.map((c,d)=>ai(c,d,n.length))},getEntryCount:()=>x.getActions().length,getCurrentState:()=>{let n=x.getActions();if(n.length!==0)return n[0].nextState},getStateAtEntry:n=>x.getActionById(String(n))?.nextState,get currentIndex(){return a},jumpTo:n=>{let c=x.getActions().findIndex(d=>d.id===String(n));c!==-1&&(a=c)},get isRecording(){return x.getEnabled()},setRecording:n=>{x.setEnabled(n)},reset:()=>{x.clearActions(),a=0},exportHistory:()=>{let n=x.getActions();return JSON.stringify(n,null,2)}}}var ni=Dr();import{WIRE_DETAIL_LIMIT_BYTES as ii,capDetail as li,createSyncAdapter as si,memoByIdentity as ci,readParams as ke,toWire as di}from"@buoy-gg/shared-ui/web";var Ge=e=>di(e,eo),ui=ci(e=>{let t=oe(e.prevState)?{...e}:{...e,prevState:Wt,nextState:Wt};if(t.payload=Ge(t.payload),t.action=Ge(t.action),t.error=Ge(t.error),t.meta){let r=Ge(t.meta.arg);r!==t.meta.arg&&(t.meta={...t.meta,arg:r})}return t});function pi(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e):[]}function gi(e,t){let{path:r,value:o,remove:a}=t;if(!r)return{ok:false,error:'setState needs a `path`, like "offers.added.<id>".'};if(!a&&o===void 0)return{ok:false,error:"Sent `path` without `value`. Send value (null is fine) or remove:true."};let n=r.split(".").filter(Boolean),c=h=>Array.isArray(h)?[...h]:{...h},d=c(e),s=d;for(let h=0;h<n.length-1;h++){let m=n[h],R=s[m];if(!R||typeof R!="object")return{ok:false,error:`No object at "${n.slice(0,h+1).join(".")}" \u2014 read getState for the real shape.`};let V=c(R);s[m]=V,s=V}let u=n[n.length-1],i=s[u];if(a){if(!(u in s))return{ok:false,error:`Nothing at "${r}" to remove.`};Array.isArray(s)?s.splice(Number(u),1):delete s[u]}else s[u]=o;return{ok:true,next:d,prev:i}}function hi(e){let t={};if(!e||typeof e!="object"||Array.isArray(e))return t;for(let[r,o]of Object.entries(e).slice(0,40))o&&typeof o=="object"&&!Array.isArray(o)&&(t[r]=Object.keys(o).slice(0,12));return t}function Ct(){let e=re().diagnostic??"not-instrumented";return{available:false,slices:[],reason:e}}var fi=si({version:2,getSnapshot:()=>x.getActions().map(ui),subscribe:e=>x.subscribe(e),actions:{clearEvents:()=>{x.clearActions()},getActionDetail:e=>{let{id:t}=ke(e);if(!t)return{found:false,reason:"missing id"};let r=x.getActionById(t);if(!r)return{found:false,reason:"unknown id"};if(oe(r.prevState))return{found:true,id:t,evicted:true,reason:"Raw state was evicted (retained for recent actions only)."};let o=n=>li(n,ii),a=n=>{if(!n)return n;let c=o(n.arg);return c===n.arg?n:{...n,arg:c}};return{found:true,id:t,prevState:o(r.prevState),nextState:o(r.nextState),payload:o(r.payload),action:o(r.action),meta:a(r.meta),error:o(r.error)}},getState:e=>{let{includeValues:t=false}=ke(e),r=Ne();if(!r)return Ct();let o=r.getState(),a=re();return{available:true,slices:pi(o),sliceFields:hi(o),capture:a.capture,mechanism:a.mechanism,...t?{state:o}:{}}},dispatch:e=>{let{action:t}=ke(e),r=Ne();if(!r)return{dispatched:false,...Ct()};if(!t)throw new Error("dispatch requires an `action`");return r.dispatch(t),{dispatched:true,type:t.type}},setState:e=>{let t=Ne();if(!t)return{ok:false,...Ct()};if(!$e())return{ok:false,error:"This store has no Buoy time-travel reducer, so its state can't be edited directly. Dispatch one of the app's own actions instead."};let r=gi(t.getState(),ke(e));return r.ok?(t.dispatch({type:xe,payload:r.next}),{ok:true,path:ke(e).path,previous:r.prev}):r}}});import{useState as yi}from"react";import{macOSColors as de,night as q,TabSelector as mi,DataInspector as ue,CollapsibleSection as Xe,CopyButton as bi,monoFont as St}from"@buoy-gg/shared-ui/web";import{jsx as v,jsxs as H}from"react/jsx-runtime";function xi({action:e}){let[t,r]=yi("action"),o=[{key:"action",label:"Action"},{key:"state",label:"State"},{key:"diff",label:"Diff"}],a=new Date(e.timestamp).toLocaleTimeString(),n=()=>JSON.stringify({type:e.type,payload:e.payload,timestamp:e.timestamp,duration:e.duration,hasStateChange:e.hasStateChange},null,2);return H(l,{style:A.container,children:[H(l,{style:A.header,children:[H(l,{style:A.headerContent,children:[v(y,{style:A.actionType,numberOfLines:2,children:e.type}),H(l,{style:A.headerMeta,children:[v(y,{style:A.metaText,children:a}),e.duration!==void 0&&H(y,{style:A.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&v(l,{style:A.changeBadge,children:v(y,{style:A.changeBadgeText,children:"State Changed"})})]})]}),v(bi,{value:n(),size:16})]}),v(l,{style:A.tabContainer,children:v(mi,{tabs:o,activeTab:t,onTabChange:c=>r(c)})}),H(Pe,{style:A.content,showsVerticalScrollIndicator:true,children:[t==="action"&&H(l,{style:A.section,children:[v(Xe,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?v(ue,{data:e.payload}):v(y,{style:A.emptyText,children:"No payload"})}),v(Xe,{title:"Full Action",defaultOpen:false,children:v(ue,{data:e.action})})]}),t==="state"&&H(l,{style:A.section,children:[v(Xe,{title:"Previous State",defaultOpen:false,children:v(ue,{data:e.prevState})}),v(Xe,{title:"Next State",defaultOpen:true,children:v(ue,{data:e.nextState})})]}),t==="diff"&&v(l,{style:A.section,children:e.hasStateChange?v(Ci,{prevState:e.prevState,nextState:e.nextState}):v(l,{style:A.noChangeContainer,children:v(y,{style:A.noChangeText,children:"No state changes from this action"})})})]})]})}function Ci({prevState:e,nextState:t}){let r=Br(e,t);return r.length===0?v(l,{style:A.noChangeContainer,children:v(y,{style:A.noChangeText,children:"No differences detected"})}):v(l,{children:r.map((o,a)=>H(l,{style:A.diffItem,children:[H(l,{style:A.diffHeader,children:[v(l,{style:[A.diffTypeBadge,{backgroundColor:o.type==="added"?de.semantic.successBackground:o.type==="removed"?de.semantic.errorBackground:de.semantic.warningBackground}],children:v(y,{style:[A.diffTypeText,{color:o.type==="added"?de.semantic.success:o.type==="removed"?de.semantic.error:de.semantic.warning}],children:o.type.toUpperCase()})}),v(y,{style:A.diffPath,children:o.path})]}),o.type==="modified"&&H(l,{style:A.diffValues,children:[H(l,{style:A.diffValue,children:[v(y,{style:A.diffLabel,children:"Before:"}),v(ue,{data:o.oldValue})]}),H(l,{style:A.diffValue,children:[v(y,{style:A.diffLabel,children:"After:"}),v(ue,{data:o.newValue})]})]}),o.type==="added"&&v(l,{style:A.diffValue,children:v(ue,{data:o.newValue})}),o.type==="removed"&&v(l,{style:A.diffValue,children:v(ue,{data:o.oldValue})})]},a))})}function Br(e,t,r=""){let o=[];if(typeof e!="object"||typeof t!="object")return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;if(e===null||t===null)return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;let a=e,n=t,c=new Set([...Object.keys(a),...Object.keys(n)]);for(let d of c){let s=r?`${r}.${d}`:d,u=a[d],i=n[d];d in a?d in n?u!==i&&(typeof u=="object"&&typeof i=="object"&&u!==null&&i!==null&&!Array.isArray(u)&&!Array.isArray(i)?s.split(".").length<3?o.push(...Br(u,i,s)):o.push({type:"modified",path:s,oldValue:u,newValue:i}):o.push({type:"modified",path:s,oldValue:u,newValue:i})):o.push({type:"removed",path:s,oldValue:u}):o.push({type:"added",path:s,newValue:i})}return o}var A=ge.create({container:{flex:1},header:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:12,backgroundColor:q.color.surface,borderBottomWidth:1,borderBottomColor:q.color.border},headerContent:{flex:1,marginRight:12},actionType:{fontSize:14,fontWeight:"600",color:q.color.text,fontFamily:St,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:q.color.textTertiary},durationText:{fontSize:11,color:q.color.textTertiary,fontFamily:St},changeBadge:{backgroundColor:de.semantic.warningBackground,paddingHorizontal:6,paddingVertical:2,borderRadius:4},changeBadgeText:{fontSize:10,color:de.semantic.warning,fontWeight:"600"},tabContainer:{paddingHorizontal:12,paddingVertical:8},content:{flex:1},section:{paddingHorizontal:12,paddingBottom:20},emptyText:{fontSize:12,color:q.color.textTertiary,fontStyle:"italic",padding:8},noChangeContainer:{padding:20,alignItems:"center"},noChangeText:{fontSize:13,color:q.color.textTertiary},diffItem:{marginBottom:12,backgroundColor:q.color.surface,borderRadius:8,borderWidth:1,borderColor:q.color.border,overflow:"hidden"},diffHeader:{flexDirection:"row",alignItems:"center",gap:8,padding:8,borderBottomWidth:1,borderBottomColor:q.color.border},diffTypeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},diffTypeText:{fontSize:10,fontWeight:"700"},diffPath:{fontSize:12,color:q.color.text,fontFamily:St},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:q.color.textTertiary,marginBottom:4,fontWeight:"600"}});function Si(){return ft(),null}function vi(e){return ee(e,"extension"),at(),()=>Pt(e)}export{xe as BUOY_JUMP_TO_STATE,lo as BUOY_REPLAY_ACTION,Xn as FREE_TIER_ACTION_LIMIT,f as REDUX_TEST_ID,wr as ReduxActionDetailContent,Tr as ReduxActionDetailFooter,xi as ReduxActionDetailView,dr as ReduxActionItem,Si as ReduxAutoInstrument,Je as ReduxIcon,xt as ReduxModal,Zn as ReduxToolView,br as actionRowTestID,xr as buildActionRowTestIDs,ze as buoyDevtoolsEnhancer,co as buoyReduxMiddleware,qt as claimDevtoolsHook,vi as connectReduxAdapter,uo as createBuoyReduxMiddleware,Dr as createReduxHistoryAdapter,ri as createReduxTool,Ne as getActiveStore,re as getInstrumentationStatus,gt as instrumentStore,tn as isAutoInstrumentActive,bo as isDevtoolsHookClaimed,Za as isStoreInstrumented,Mt as jumpToState,x as reduxActionStore,ni as reduxHistoryAdapter,fi as reduxSyncAdapter,Ir as reduxToolPreset,en as registerReduxStore,Ht as replayAction,mr as slugForTestID,ht as uninstrumentStore,ft as useAutoInstrumentRedux,ar as useReduxActions,rn as useReduxAvailability,so as withBuoyDevTools};
|
|
1
|
+
"use client";var Vt=Object.defineProperty;var Fr=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Hr=Object.prototype.hasOwnProperty;var _r=(e,t)=>{for(var r in t)Vt(e,r,{get:t[r],enumerable:true})},zt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Mr(t))!Hr.call(e,a)&&a!==r&&Vt(e,a,{get:()=>t[a],enumerable:!(o=Fr(t,a))||o.enumerable});return e},qr=(e,t,r)=>(zt(e,t,"default"),r&&zt(r,t,"default"));var jt=(()=>{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{classifyPreviewItem as Ur,createRestoreScope as Kr,registerStateSnapshotProvider as Yr,skippedRestore as tt,unionKeys as Jr,wontApply as Gr}from"@buoy-gg/shared-ui/web";var rt=Symbol.for("@@buoy/enhancerInstrumented"),be=null,pe=null,ot=null,Lt=false;function ee(e,t){be=e,pe=t,ot=null}function Pt(e){be===e&&(be=null,pe=null)}function te(){return be}function at(){Lt=true}function $e(){return Lt&&be!==null}function Xr(e){ot=e}function re(){return{mechanism:pe,capture:pe==="enhancer"||pe==="middleware"||pe==="extension"?"full":pe==="patch"?"top-level-only":"none",hasStore:be!==null,timeTravel:$e(),diagnostic:ot}}import{ChangeLog as Qr,approxJsonSize as Zr}from"@buoy-gg/shared-ui/web";var nt=25,it=Object.freeze({__buoyStateEvicted:true,note:`Raw state retained for the ${nt} most recent actions only.`}),Wt=Object.freeze({__buoyStateOnDevice:true,note:"State trees stay on the device \u2014 fetched on demand via getActionDetail."}),eo=Object.freeze({__buoyPayloadOnDevice:true,note:"Payload stays on the device \u2014 fetched on demand via getActionDetail."});function Oe(e){return typeof e=="object"&&e!==null&&e.__buoyPayloadOnDevice===true}function oe(e){if(typeof e!="object"||e===null)return false;let t=e;return t.__buoyStateEvicted===true||t.__buoyStateOnDevice===true}function to(e){return e.startsWith("@@")?"internal":e.includes("/pending")?"pending":e.includes("/fulfilled")?"fulfilled":e.includes("/rejected")?"rejected":e.includes("/executeQuery")?"query":e.includes("/executeMutation")?"mutation":"action"}function ro(e){if(e.startsWith("@@")){let r=e.split("/");return{sliceName:null,actionName:r[r.length-1]||e}}let t=e.split("/");if(t.length>=2){let r=t[0],o=t[1];return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])&&(o=t.slice(1,-1).join("/")),{sliceName:r,actionName:o.toUpperCase()}}return{sliceName:null,actionName:e.toUpperCase()}}function Nt(e,t){return Zr(e,t).bytes>t}function oo(e,t=40){if(e===void 0)return"";if(e===null)return"null";try{if(typeof e=="string")return e.length>t?`"${e.slice(0,t-3)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";if(Nt(e,t))return`[${e.length} items]`;let r=JSON.stringify(e);return r.length>t?`[${e.length} items]`:r}if(typeof e=="object"){let r=Object.keys(e);if(r.length===0)return"{}";if(Nt(e,t))return`{ ${r.length} keys }`;let o=JSON.stringify(e);return o.length<=t?o:`{ ${r.length} keys }`}return String(e).slice(0,t)}catch{return"[complex]"}}function ao(e,t){if(e===t)return{summary:"no change",changedCount:0};if(typeof e!="object"||typeof t!="object"||e===null||t===null)return{summary:"changed",changedCount:1};let r=Object.keys(e),o=Object.keys(t),a=o.filter(u=>!r.includes(u)).length,n=r.filter(u=>!o.includes(u)).length,c=0;for(let u of r)o.includes(u)&&e[u]!==t[u]&&c++;let d=[];a>0&&d.push(`+${a}`),n>0&&d.push(`-${n}`),c>0&&d.push(`~${c}`);let s=a+n+c;return d.length===0?{summary:"nested change",changedCount:1}:{summary:`${d.join(" ")} ${s===1?"key":"keys"}`,changedCount:s}}function no(e){let t=e.meta;if(t)return{requestId:t.requestId,requestStatus:t.requestStatus,arg:t.arg,rejectedWithValue:t.rejectedWithValue,aborted:t.aborted,condition:t.condition}}var io=class extends Qr{addAction(e,t,r,o){if(!this.canRecord())return;let a=e.type||"";if(!a)return;let n=t!==r,c=to(a),{sliceName:d,actionName:s}=ro(a),u=no(e),i=oo(e.payload),{summary:h,changedCount:m}=ao(t,r),R=(o??0)>16,V={id:this.nextId(),type:a,payload:e.payload,action:e,timestamp:Date.now(),prevState:t,nextState:r,duration:o,hasStateChange:n,category:c,sliceName:d,actionName:s,meta:u,error:e.error,payloadPreview:i,diffSummary:h,changedKeysCount:m,isSlowAction:R};this.push(V);for(let z=nt;z<this.items.length;z++){let L=this.items[z];if(L.prevState!==it)L.prevState=it,L.nextState=it;else break}this.notifyListeners()}getActions(){return this.getAll()}getActionById(e){return this.getById(e)}clearActions(){this.clear()}replaceActions(e){if(!this.getEnabled())return;let t=new Map;for(let o of this.items)o.prevState!==void 0&&!oe(o.prevState)&&t.set(o.id,o);let r=e.slice(0,this.max).map(o=>{let a=t.get(o.id);return!a||!oe(o.prevState)?o:{...o,prevState:a.prevState,nextState:a.nextState,payload:Oe(o.payload)?a.payload:o.payload,action:Oe(o.action)?a.action:o.action,meta:Oe(o.meta?.arg)?a.meta:o.meta,error:Oe(o.error)?a.error:o.error}});this.setItems(r)}hydrateAction(e,t){this.hydrateById(e,t)}setMaxActions(e){this.setMax(e)}getStats(){let e=this.items.length,t=this.items.filter(n=>n.hasStateChange).length,r=new Set(this.items.map(n=>n.type)),o=this.items.filter(n=>n.duration!==void 0).map(n=>n.duration),a=o.length>0?o.reduce((n,c)=>n+c,0)/o.length:0;return{totalActions:e,actionsWithChanges:t,actionsWithoutChanges:e-t,uniqueActionTypes:r.size,averageDuration:Math.round(a*100)/100}}filterActions(e){let t=[...this.items];if(e.searchText){let r=e.searchText.toLowerCase();t=t.filter(o=>o.type.toLowerCase().includes(r))}return e.actionTypes&&e.actionTypes.length>0&&(t=t.filter(r=>e.actionTypes.includes(r.type))),e.onlyWithChanges&&(t=t.filter(r=>r.hasStateChange)),t}getUniqueActionTypes(){return Array.from(new Set(this.items.map(e=>e.type))).sort()}getRelatedActions(e){return this.items.filter(t=>t.meta?.requestId===e).sort((t,r)=>t.timestamp-r.timestamp)}getLinkedActions(e){return e.meta?.requestId?this.getRelatedActions(e.meta.requestId):[]}getLinkedActionsCount(e){return e.meta?.requestId?this.items.filter(t=>t.meta?.requestId===e.meta?.requestId).length:0}getAsyncOperationDuration(e){let t=this.getRelatedActions(e);if(t.length<2)return null;let r=t.find(a=>a.category==="pending"),o=t.find(a=>a.category==="fulfilled"||a.category==="rejected");return r&&o?o.timestamp-r.timestamp:null}getBaseActionType(e){let t=e.split("/");if(t.length>=2){let r=t[t.length-1];if(["pending","fulfilled","rejected"].includes(r))return t.slice(0,-1).join("/")}return e}getAsyncOperationIndex(e){let t=new Map;for(let o of this.items)o.meta?.requestId&&!t.has(o.meta.requestId)&&t.set(o.meta.requestId,o.timestamp);let r=Array.from(t.entries()).sort((o,a)=>o[1]-a[1]).map(([o])=>o).indexOf(e);return r>=0?r+1:0}},x=new io;var lt=false;function Ft(){return lt}var xe="@@buoy/JUMP_TO_STATE",lo="@@buoy/REPLAY_ACTION";function Mt(e){if(oe(e)){console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");return}let t=te();if(!t){console.warn("[BuoyRedux] Cannot jump to state - no store instrumented");return}if(!$e()){console.warn("[BuoyRedux] Cannot jump to state - the root reducer cannot serve a state jump. Capture and time travel are wired separately: either put `import '@buoy-gg/redux';` first in your app entry (so Buoy is the store enhancer), or wrap your root reducer with withBuoyDevTools().");return}t.dispatch({type:xe,payload:e})}function Ht(e){let t=te();t?t.dispatch(e):console.warn("[BuoyRedux] Cannot replay action - no store instrumented")}function so(e){return at(),(t,r)=>r.type===xe?r.payload:e(t,r)}var co=e=>(lt=true,ee(e,"middleware"),t=>r=>{let o=r;if(o.type?.startsWith("@@buoy/"))return t(r);let a=performance.now(),n=e.getState(),c=t(r),d=e.getState(),s=performance.now()-a;return x.addAction(o,n,d,s),c});function uo(e={}){let{maxActions:t=200,ignoreActions:r=[]}=e;return x.setMaxActions(t),o=>(lt=true,ee(o,"middleware"),a=>n=>{let c=n,d=c.type||"";if(d?.startsWith("@@buoy/")||r.includes(d))return a(n);let s=performance.now(),u=o.getState(),i=a(n),h=o.getState(),m=performance.now()-s;return x.addAction(c,u,h,m),i})}var Ve="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function po(){let{mechanism:e,hasStore:t,diagnostic:r}=re();return t?e==="patch"?{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${Ve}`}:{canCapture:true,canRestore:true,detail:e==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}:{canCapture:false,canRestore:false,detail:r==="no-react-redux"?"react-redux not installed":r==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}async function go(){let e=te();return e?{data:{state:e.getState()},warnings:[]}:{data:null,warnings:["no Redux store instrumented"]}}async function ho(e,t){let r=e,o=te();if(!o||r===void 0||r===null)return tt("redux",o?"empty redux snapshot":"no Redux store instrumented");let{mechanism:a}=re();if(a==="patch")return tt("redux",`restore unavailable on auto-instrumented stores \u2014 ${Ve}`);let n=Kr(t),c=Object.keys(r.state??{}).filter(s=>!n.touch(s)),d=r.state;if(c.length>0){let s=o.getState(),u={...r.state};for(let i of c)u[i]=s?.[i];d=u}if(o.dispatch({type:xe,payload:d}),o.getState()===d){let s=c.length>0?[`${c.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:s}}return tt("redux",`store ignored the state jump \u2014 ${Ve}`)}async function fo(e,t){let r=e?.state,o=t===void 0,a=te(),n=o?a?.getState():t?.state,c=[],d=[],s;if(o){let{mechanism:h,hasStore:m}=re();m?h==="patch"&&(s=`auto-instrumented store cannot be restored \u2014 ${Ve}`):s="no Redux store instrumented"}let u=n??{},i=r??{};for(let h of Jr(u,i)){let m=Ur({key:h,label:h,oldValue:u[h],newValue:i[h],inOld:Object.prototype.hasOwnProperty.call(u,h),inNew:Object.prototype.hasOwnProperty.call(i,h)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});s&&(m=Gr(m,s)),c.push(m)}return s&&d.push(`Redux restore unavailable: ${s}`),{items:c,notes:d}}Yr({id:"redux",label:"Redux",status:po,capture:go,restore:ho,previewItems:fo});function st(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...o)=>t(r(...o)))}function _t(e){return at(),(t,r)=>r&&r.type===xe?r.payload:e(t,r)}function yo(e){if(typeof e!="object"||e===null)return false;let t=e.type;return typeof t!="string"?false:!t.startsWith("@@buoy/")&&!t.startsWith("@@redux/")}var ze=e=>(t,r)=>{let o=e(_t(t),r),a={...o,dispatch:n=>{if(!yo(n)||Ft())return o.dispatch(n);let c=performance.now(),d=o.getState(),s=o.dispatch(n);return x.addAction(n,d,o.getState(),performance.now()-c),s},replaceReducer:n=>o.replaceReducer(_t(n)),[rt]:true};return ee(a,"enhancer"),a};function mo(...e){return e.length===0?st(ze):e.length===1&&typeof e[0]=="object"&&e[0]!==null?(...t)=>st(...t,ze):st(...e,ze)}var ct=false;function qt(){if(!(typeof jt<"u"&&jt))return false;let e=globalThis;return e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||(e.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__=mo,ct=true),ct}function bo(){return ct}qt();import{useState as je,useMemo as Te,useRef as Le,useCallback as ae,useEffect as Ut}from"react";var Kt={};_r(Kt,{AccessibilityInfo:()=>vo,ActivityIndicator:()=>Ta,Alert:()=>Da,Animated:()=>ma,AppRegistry:()=>To,AppState:()=>Ao,Appearance:()=>wo,BackHandler:()=>Io,Button:()=>Aa,CheckBox:()=>Mo,Clipboard:()=>Do,DeviceEventEmitter:()=>oa,Dimensions:()=>Bo,Easing:()=>Ro,FlatList:()=>Yt,I18nManager:()=>ko,Image:()=>Ho,ImageBackground:()=>_o,InteractionManager:()=>$o,Keyboard:()=>Eo,KeyboardAvoidingView:()=>qo,LayoutAnimation:()=>Oo,Linking:()=>Vo,LogBox:()=>ra,Modal:()=>va,NativeEventEmitter:()=>zo,NativeModules:()=>Co,PanResponder:()=>jo,Picker:()=>Uo,PixelRatio:()=>Lo,Platform:()=>Po,Pressable:()=>Ca,ProgressBar:()=>Ko,RefreshControl:()=>Yo,SafeAreaView:()=>Jo,ScrollView:()=>Pe,SectionList:()=>Go,Share:()=>Wo,StatusBar:()=>Xo,StyleSheet:()=>ge,Switch:()=>wa,Text:()=>y,TextInput:()=>ba,Touchable:()=>Qo,TouchableHighlight:()=>xa,TouchableNativeFeedback:()=>Zo,TouchableOpacity:()=>J,TouchableWithoutFeedback:()=>Sa,UIManager:()=>No,Vibration:()=>Fo,View:()=>l,VirtualizedList:()=>ea,YellowBox:()=>ta,findNodeHandle:()=>Ia,unstable_createElement:()=>So,useColorScheme:()=>aa,useLocaleContext:()=>na,useWindowDimensions:()=>ia});qr(Kt,xo);import*as xo from"react-native-web";import{unstable_createElement as So,NativeModules as Co,AccessibilityInfo as vo,Appearance as wo,AppRegistry as To,AppState as Ao,BackHandler as Io,Clipboard as Do,Dimensions as Bo,Easing as Ro,I18nManager as ko,Keyboard as Eo,InteractionManager as $o,LayoutAnimation as Oo,Linking as Vo,NativeEventEmitter as zo,PanResponder as jo,PixelRatio as Lo,Platform as Po,Share as Wo,UIManager as No,Vibration as Fo,CheckBox as Mo,FlatList as Yt,Image as Ho,ImageBackground as _o,KeyboardAvoidingView as qo,Picker as Uo,ProgressBar as Ko,RefreshControl as Yo,SafeAreaView as Jo,SectionList as Go,StatusBar as Xo,Touchable as Qo,TouchableNativeFeedback as Zo,VirtualizedList as ea,YellowBox as ta,LogBox as ra,DeviceEventEmitter as oa,useColorScheme as aa,useLocaleContext as na,useWindowDimensions as ia}from"react-native-web";import*as M from"react-native-web";import{createElement as dt,forwardRef as Jt,useCallback as la,useRef as sa}from"react";import{useEffect as ca,useState as da}from"react";import{createPortal as ua}from"react-dom";var pa='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as ga}from"react/jsx-runtime";var Ae=Symbol.for("@buoy-gg/portal-host"),Gt=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function Xt(){let e=document;if(e[Ae])return e[Ae].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:pa});let r=()=>{let i=document.fullscreenElement,h=i&&i.tagName!=="CANVAS"?i:document.body;t.parentElement!==h&&h.appendChild(t)},o=new Map,a=i=>{(!t.contains(i.target)||!Gt(i.target))&&o.set(i.code||i.key,{key:i.key,code:i.code,location:i.location,keyCode:i.keyCode,which:i.which,altKey:i.altKey,ctrlKey:i.ctrlKey,metaKey:i.metaKey,shiftKey:i.shiftKey})},n=i=>{o.delete(i.code||i.key)},c=()=>o.clear(),d=()=>{let i=[...o.values()];o.clear();for(let h of i)document.dispatchEvent(new KeyboardEvent("keyup",{...h,bubbles:true}))},s=i=>{Gt(i.target)&&i.stopPropagation()},u=i=>i.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",c),t.addEventListener("focusin",d),t.addEventListener("keydown",s),t.addEventListener("keyup",s),t.addEventListener("keypress",s),t.addEventListener("wheel",u,{passive:true}),e[Ae]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",c),t.remove(),delete e[Ae]}},t}function ha({children:e}){let[t,r]=da(null);return ca(()=>{let o=Xt(),a=document[Ae];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?ua(ga("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var Se=M,fa=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],Ce=e=>typeof e=="number"?`${e}px`:e;function ut(e){if(Array.isArray(e)){let h=e.map(ut);return h.some((m,R)=>m!==e[R])?h:e}if(!e||typeof e!="object"||!fa.some(h=>e[h]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:c,textShadowRadius:d,...s}=e;if(t!=null||r!=null||o!=null||a!=null){let h=t??"black",m=o==null?h:`color-mix(in srgb, ${h} ${Math.min(o,1)*100}%, transparent)`,R=`${Ce(r?.width??0)} ${Ce(r?.height??0)} ${Ce(a??0)} ${m}`;s.boxShadow=typeof s.boxShadow=="string"?`${s.boxShadow}, ${R}`:s.boxShadow??R}let{width:u=0,height:i=0}=c??{};if(n&&(u||i||d)){let h=`${Ce(u)} ${Ce(i)} ${Ce(d??0)} ${n}`;s.textShadow=s.textShadow?`${s.textShadow}, ${h}`:h}return s}var ya=Se.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function Qt(e,t){if(typeof e=="function")return o=>Qt(e(o),t);let r=ut(e);return t?[r,ya[t]]:r}var ge={...Se.StyleSheet,create:e=>Se.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ut(r)])))};function _(e){let t=Jt((o,a)=>{let{accessibilityState:n,accessibilityValue:c,pointerEvents:d,...s}=o;for(let i of["busy","checked","disabled","expanded","selected"])n?.[i]!==void 0&&s[`aria-${i}`]===void 0&&(s[`aria-${i}`]=n[i]);for(let[i,h]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[i]!==void 0&&s[`aria-${h}`]===void 0&&(s[`aria-${h}`]=c[i]);let u=Qt(s.style,d);return u!==s.style&&(s.style=u),dt(e,{...s,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var l=_(M.View),y=_(M.Text),ma={...Se.Animated,View:Se.Animated.createAnimatedComponent(l),Text:Se.Animated.createAnimatedComponent(y)},ba=_(M.TextInput),J=_(M.TouchableOpacity),xa=_(M.TouchableHighlight),Sa=_(M.TouchableWithoutFeedback),Ca=_(M.Pressable),Pe=_(M.ScrollView),Zt=Jt((e,t)=>{let r=sa(null),o=la(a=>{if(a){let n=a;for(;n.parentElement&&n.parentElement!==document.body;)n=n.parentElement;n.parentElement===document.body&&(r.current=n,Object.assign(n.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),Xt().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return dt(ha,null,dt(M.Modal,{...e,ref:o}))});Zt.displayName="Modal";var va=_(Zt),wa=_(M.Switch),Ta=_(M.ActivityIndicator),Aa=_(M.Button),Ia=M.findNodeHandle,Da={alert(e,t,r,o){if(typeof document>"u")return;let a=document.createElement("dialog");a.dataset.buoyRoot="",a.setAttribute("aria-label",e),a.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",a.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",a.appendChild(u)}let c=document.createElement("div");c.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let d=r?.length?r:[{text:"OK"}],s=()=>{a.close?.(),a.remove()};for(let u of d){let i=document.createElement("button");i.type="button",i.textContent=u.text??"OK",i.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${u.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,i.onclick=()=>{s(),u.onPress?.()},c.appendChild(i)}a.addEventListener("cancel",u=>{u.preventDefault(),o?.cancelable!==false&&(s(),o?.onDismiss?.())}),a.appendChild(c),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{JsModal as Ba,ModalHeader as ne,macOSColors as G,night as T,Search as Ra,Trash2 as ka,Power as Ea,Zap as $a,CheckCircle as Oa,Copy as Va,Lock as za,AlertTriangle as er,devToolsStorageKeys as ja,copyToClipboard as La,ProUpgradeModal as Pa,PowerToggleButton as Wa,TickProvider as tr,useLimit as Na,TIER_LIMITS as Fa,windowDragProps as Ma,ToolEmptyState as Ha,resolveListEmptyState as _a,EVENT_LIST_PRESET as qa,monoFont as Ua}from"@buoy-gg/shared-ui/web";import{useIsPro as Ka}from"@buoy-gg/license/web";import{useState as Ya,useMemo as rr,useCallback as or}from"react";import{useChangeLog as Ja}from"@buoy-gg/shared-ui/web";var Ga=(e,t)=>x.filterActions(t);function ar(){let e=Ja(x,{filterItems:Ga}),[t,r]=Ya(null),o=rr(()=>x.getStats(),[e.items]),a=rr(()=>x.getUniqueActionTypes(),[e.items]),n=or(()=>{x.clearActions(),r(null)},[]),c=or(d=>x.getActionById(d),[]);return{actions:e.items,filteredActions:e.filteredItems,filter:e.filter,setFilter:e.setFilter,stats:o,clearActions:n,isEnabled:e.isEnabled,toggleCapture:e.toggleCapture,actionTypes:a,getActionById:c,selectedAction:t,setSelectedAction:r}}import{useStore as Xa}from"react-redux";function nr(){return Xa}import{useEffect as Qa,useState as We,useRef as ir,useCallback as lr}from"react";var Ie=Symbol.for("@@buoy/instrumented"),pt=Symbol.for("@@buoy/originalDispatch");function Za(e){let t=e;return t[Ie]===true||t[rt]===true}function gt(e,t={}){let r=e;if(r[rt])return ee(e,"enhancer"),()=>{};if(Ft())return ee(e,"middleware"),()=>{};if(r[Ie])return ee(e,"patch"),()=>{};let{maxActions:o=200,ignoreActions:a=[]}=t;x.setMaxActions(o);let n=e.dispatch.bind(e);r[pt]=n;let c=(d=>{if(typeof d!="object"||d===null||typeof d.type!="string")return n(d);let s=d.type;if(s.startsWith("@@buoy/")||s.startsWith("@@redux/")||a.includes(s))return n(d);let u=performance.now(),i=e.getState(),h=n(d),m=e.getState(),R=performance.now()-u;return x.addAction(d,i,m,R),h});return e.dispatch=c,r[Ie]=true,ee(e,"patch"),()=>{ht(e)}}function ht(e){let t=e;if(t[Ie]){let r=t[pt];r&&(e.dispatch=r),delete t[Ie],delete t[pt]}Pt(e)}function en(e,t={}){return gt(e,t)}function Ne(){return te()}function tn(){return te()!==null}function ft(e={}){let{autoStart:t=true}=e,r=ir(e);r.current=e;let[o,a]=We(false),[n,c]=We(true),[d,s]=We(null),[u,i]=We(null),h=ir(null),m=nr(),R=m!==null,V=null,z=null,L=null;if(m)try{V=m()}catch(O){L="no-provider",z=O instanceof Error?O.message:"Failed to access Redux store. Make sure your app is wrapped in a Redux Provider."}else L="no-react-redux",z="react-redux is not installed or not available";let P=re().mechanism==="extension"?te():null,w=lr(()=>{if(!V&&P){a(true),i(P),s(null),c(false);return}if(!V){Xr(L),s(z||"No Redux store available"),c(false);return}try{let O=gt(V,r.current);h.current=O,a(true),i(V),s(null)}catch(O){s(O instanceof Error?O.message:"Failed to instrument Redux store"),a(false)}finally{c(false)}},[V,P]),K=lr(()=>{h.current&&(h.current(),h.current=null),u&&ht(u),a(false),i(null)},[u]);return Qa(()=>(t?w():c(false),()=>{}),[t,w]),{isInstrumented:o,isLoading:n,error:d,isReactReduxAvailable:R,captureMechanism:re().mechanism,startInstrumentation:w,stopInstrumentation:K,store:u}}function rn(){let e=nr();if(!e)return{isAvailable:false,error:"react-redux is not installed"};try{let t=e();return{isAvailable:t!=null,error:null}}catch(t){return{isAvailable:false,error:t instanceof Error?t.message:"Not inside a Redux Provider"}}}import{memo as on}from"react";import{ChangeRow as De,buoyColors as ie,AlertCircle as an,monoFont as nn}from"@buoy-gg/shared-ui/web";import{jsx as le,jsxs as sr}from"react/jsx-runtime";var cr=[{bg:"rgba(99, 102, 241, 0.25)",text:"#818CF8"},{bg:"rgba(236, 72, 153, 0.25)",text:"#F472B6"},{bg:"rgba(14, 165, 233, 0.25)",text:"#38BDF8"},{bg:"rgba(245, 158, 11, 0.25)",text:"#FBBF24"},{bg:"rgba(16, 185, 129, 0.25)",text:"#34D399"},{bg:"rgba(168, 85, 247, 0.25)",text:"#C084FC"},{bg:"rgba(239, 68, 68, 0.25)",text:"#F87171"},{bg:"rgba(20, 184, 166, 0.25)",text:"#2DD4BF"}];function ln(e){return e<=0?{bg:"rgba(142, 142, 147, 0.2)",text:ie.textSecondary}:cr[(e-1)%cr.length]}var yt={cart:"#10B981",user:"#3B82F6",auth:"#8B5CF6",app:"#6366F1",ui:"#EC4899",settings:"#F59E0B",api:"#14B8A6",data:"#06B6D4"};function sn(e){if(!e)return"#6B7280";let t=e.toLowerCase();if(yt[t])return yt[t];for(let[r,o]of Object.entries(yt))if(t.includes(r))return o;return`hsl(${e.split("").reduce((r,o)=>r+o.charCodeAt(0),0)*137%360}, 70%, 60%)`}function cn(e,t){switch(e){case"pending":return"Pending";case"fulfilled":return"Success";case"rejected":return"Error";case"internal":return"Internal";case"query":return"Query";case"mutation":return"Mutation";default:return t?t.charAt(0).toUpperCase()+t.slice(1):"Action"}}function dn(e,t,r){switch(e){case"pending":return ie.warning;case"fulfilled":return ie.success;case"rejected":return ie.error;case"internal":return ie.textMuted;case"query":return ie.info;case"mutation":return ie.info;default:return sn(r)}}function un(e){let t=[];return e.duration!==void 0&&e.duration>=.1&&t.push(`${e.duration.toFixed(1)}ms`),e.hasStateChange?e.changedKeysCount&&e.changedKeysCount>0?t.push(`${e.changedKeysCount} key${e.changedKeysCount>1?"s":""} changed`):t.push(e.diffSummary||"state changed"):t.push("no state change"),t.join(" \xB7 ")}function pn(e){return e.actionName?.toUpperCase()||e.type.split("/").pop()?.toUpperCase()||""}function gn(e){if(e.category==="internal")return e.type;let t=e.type.split("/");return t.length>=3&&["pending","fulfilled","rejected"].includes(t[t.length-1])?t.slice(0,-1).join("/"):e.type}var dr=on(function({action:e,onPress:t,linkedCount:r,testID:o}){let a=e.sliceName??void 0,n=dn(e.category,e.hasStateChange,a),c=cn(e.category,a),d=un(e),s=gn(e),u=pn(e),i=u&&u!==s.toUpperCase()?u:void 0,h=(r??0)>1,m=h?x.getLinkedActions(e):[],R=h?m.findIndex(w=>w.id===e.id)+1:0,V=h&&e.meta?.requestId?x.getAsyncOperationIndex(e.meta.requestId):0,z=ln(V),L=h?le(l,{style:[Fe.asyncSequenceBadge,{backgroundColor:z.bg}],children:sr(y,{style:[Fe.asyncSequenceText,{color:z.text}],testID:o?`${o}-seq`:void 0,children:[R,"/",r," #",V]})}):void 0,P={statusColor:n,statusLabel:c,sublabel:d,primaryText:s,timestamp:e.timestamp,onPress:()=>t(e),testID:o,accessibilityLabel:`${s}, ${c}, ${d}`};return e.isSlowAction?le(De,{...P,badgePrefix:L,slow:true}):e.category==="rejected"?le(De,{...P,customBadge:sr(l,{style:Fe.badgeContainer,children:[L,le(l,{style:Fe.errorBadge,testID:o?`${o}-error`:void 0,children:le(an,{size:12,color:ie.error})})]})}):h?le(De,{...P,badgePrefix:L,changed:e.hasStateChange}):e.hasStateChange?le(De,{...P,badgeText:i,changed:true}):le(De,{...P,plainBadgeText:i})}),Fe=ge.create({badgeContainer:{flexDirection:"row",alignItems:"center",gap:4},errorBadge:{paddingHorizontal:4},asyncSequenceBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},asyncSequenceText:{fontSize:10,fontWeight:"600",fontFamily:nn}});import{useState as ur,useCallback as Me,useMemo as pr}from"react";import{macOSColors as Be,night as X,EventStepperFooter as gr,formatRelativeTime as He,parseValue as _e,monoFont as Re}from"@buoy-gg/shared-ui/web";import{DataViewer as hn,SplitDiffViewer as fn,TreeDiffViewer as yn,diffThemes as mn}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as bn}from"react";import{DetailViewToggle as xn,FileText as Sn,Database as Cn,GitBranch as vn}from"@buoy-gg/shared-ui/web";import{jsx as wn}from"react/jsx-runtime";var Tn=[{key:"action",label:"ACTION",description:"View action details",icon:Sn},{key:"state",label:"STATE",description:"View current state",icon:Cn},{key:"diff",label:"DIFF",description:"Compare changes",icon:vn}],An=["diff"],In=bn(function({activeView:e,onViewChange:t,diffDisabled:r=false}){return wn(xn,{views:Tn,activeView:e,onViewChange:t,disabledKeys:r?An:void 0,testIDPrefix:"buoy-redux"})});import{memo as Dn,useMemo as Bn,useCallback as qe,useState as Rn,useEffect as kn}from"react";import{buoyColors as D,night as C,Clock as En,AlertTriangle as $n,Zap as On,Hash as hr,Info as Vn,Box as zn,AlertCircle as jn,FileText as Ln,parseValue as Ue,ProUpgradeModal as Pn,copyToClipboard as fr,InfoRow as se,monoFont as ce}from"@buoy-gg/shared-ui/web";import{useIsPro as Wn}from"@buoy-gg/license/web";import{DataViewer as Ke}from"@buoy-gg/shared-ui/web/dataViewer";import{night as B,monoFont as Nn}from"@buoy-gg/shared-ui/web";import{jsx as yr,jsxs as Fn}from"react/jsx-runtime";var Mn={replay:{color:B.color.accent,backgroundColor:B.color.accent+"15",borderColor:B.color.accent+"40",textColor:B.color.accent},copy:{color:B.color.accent,backgroundColor:B.color.accent+"15",borderColor:B.color.accent+"40",textColor:B.color.accent},jump:{color:B.color.warning,backgroundColor:B.color.warning+"15",borderColor:B.color.warning+"40",textColor:B.color.warning},skip:{color:B.color.textSecondary,backgroundColor:B.color.textSecondary+"26",borderColor:B.color.textSecondary+"59",textColor:B.color.textSecondary},clear:{color:B.color.danger,backgroundColor:B.color.danger+"15",borderColor:B.color.danger+"40",textColor:B.color.danger},diff:{color:B.color.info,backgroundColor:B.color.info+"15",borderColor:B.color.info+"40",textColor:B.color.info}};function Ye({onPress:e,text:t,type:r,disabled:o=false,testID:a}){let n=Mn[r];return Fn(J,{testID:a,disabled:o,onPress:e,style:[mt.button,{backgroundColor:o?B.color.textTertiary+"1A":n.backgroundColor,borderColor:o?B.color.textTertiary+"33":n.borderColor,opacity:o?.5:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},children:[yr(l,{style:[mt.dot,{backgroundColor:o?B.color.textTertiary:n.color}]}),yr(y,{style:[mt.text,{color:o?B.color.textTertiary:n.textColor}],children:t})]})}var mt=ge.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:6,borderWidth:1,paddingHorizontal:12,paddingVertical:6,height:25,minWidth:80,shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:2},dot:{width:5,height:5,borderRadius:3,marginRight:6,shadowColor:B.color.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:Nn,height:12}});var f="buoy-redux";function mr(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function br(e,t){return`${f}-row-${mr(e)}-${t}`}function xr(e){let t=new Map,r=new Map;for(let o of e){let a=(t.get(o.type)??0)+1;t.set(o.type,a),r.set(o.id,br(o.type,a))}return r}import{jsx as g,jsxs as k}from"react/jsx-runtime";function Sr(e){switch(e){case"pending":return{label:"PENDING",color:D.warning,bgColor:D.warning+"26"};case"fulfilled":return{label:"FULFILLED",color:D.success,bgColor:D.success+"26"};case"rejected":return{label:"REJECTED",color:D.error,bgColor:D.error+"26"};case"internal":return{label:"INTERNAL",color:D.textMuted,bgColor:D.textMuted+"26"};case"query":return{label:"QUERY",color:D.info,bgColor:D.info+"26"};case"mutation":return{label:"MUTATION",color:D.info,bgColor:D.info+"26"};default:return{label:"ACTION",color:D.info,bgColor:D.info+"26"}}}function Hn(e){return e===void 0?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function ve({icon:e,title:t,badge:r,testID:o}){return k(l,{style:p.sectionHeader,testID:o,children:[k(l,{style:p.sectionHeaderLeft,children:[g(e,{size:14,color:C.color.accent}),g(y,{style:p.sectionTitle,children:t})]}),r]})}function _n(e){let t=new Date(e),r=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0"),n=t.getMilliseconds().toString().padStart(3,"0");return`${r}:${o}:${a}.${n}`}var qn=Dn(function({action:e,onNavigateToAction:t}){let r=Wn(),[o,a]=Rn(false);kn(()=>{o&&r&&a(false)},[o,r]);let n=Sr(e.category),c=oe(e.nextState),d=$e(),s=c||!d,u=e.payload!==void 0,i=e.meta&&Object.keys(e.meta).length>0,h=e.error!==void 0,m=Bn(()=>x.getLinkedActions(e),[e]),R=m.length>1,V=R?x.getBaseActionType(e.type):null,z=e.meta?.requestId?x.getAsyncOperationDuration(e.meta.requestId):null,L=qe(async()=>{if(!r){a(true);return}await fr(e.action)},[e,r]),P=qe(async()=>{if(!r){a(true);return}await fr(e.payload)},[e.payload,r]),w=qe(()=>{e.action&&typeof e.action=="object"&&"type"in e.action&&Ht(e.action)},[e]),K=qe(()=>{e.nextState!==void 0&&Mt(e.nextState)},[e]);return k(Pe,{keyboardShouldPersistTaps:"handled",testID:`${f}-detail-scroll`,style:p.container,contentContainerStyle:p.contentContainer,showsVerticalScrollIndicator:false,children:[k(l,{style:p.card,testID:`${f}-info-card`,children:[g(ve,{icon:Vn,title:"ACTION INFO"}),k(l,{style:p.cardContent,children:[g(se,{label:"Type",value:e.type,mono:true,testID:`${f}-info-type`}),e.sliceName&&g(se,{label:"Slice",value:e.sliceName,mono:true,testID:`${f}-info-slice`}),g(se,{label:"Action",value:e.actionName,mono:true,testID:`${f}-info-action`}),k(l,{style:p.badgeRow,children:[g(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:g(y,{style:[p.categoryText,{color:n.color}],testID:`${f}-info-category`,children:n.label})}),k(l,{style:[p.durationBadge,e.isSlowAction&&p.durationBadgeSlow],children:[g(En,{size:10,color:e.isSlowAction?D.error:C.color.textSecondary}),g(y,{style:[p.durationText,e.isSlowAction&&p.durationTextSlow],testID:`${f}-info-duration`,children:Hn(e.duration)}),e.isSlowAction&&g($n,{size:10,color:D.error})]}),e.hasStateChange?k(l,{style:p.changesBadge,children:[g(On,{size:10,color:D.success}),g(y,{style:p.changesText,testID:`${f}-info-changes`,children:e.diffSummary||"changed"})]}):g(l,{style:p.noChangesBadge,children:g(y,{style:p.noChangesText,testID:`${f}-info-no-changes`,children:"no change"})})]})]})]}),R&&k(l,{style:p.card,testID:`${f}-async-card`,children:[g(ve,{icon:hr,title:"ASYNC FLOW",badge:g(l,{style:p.asyncBadge,children:k(y,{style:p.asyncBadgeText,testID:`${f}-async-count`,children:[m.length," ACTIONS"]})})}),k(l,{style:p.cardContent,children:[g(y,{style:p.baseActionType,testID:`${f}-async-base`,children:V}),z!==null&&k(l,{style:p.totalDurationRow,children:[g(y,{style:p.totalDurationLabel,children:"Total Duration"}),k(y,{style:p.totalDurationValue,testID:`${f}-async-total`,children:[z,"ms"]})]}),g(l,{style:p.timeline,children:m.map((O,F)=>{let Q=Sr(O.category),Y=O.id===e.id;return k(J,{style:[p.timelineItem,Y&&p.timelineItemCurrent],onPress:()=>t?.(O),disabled:Y||!t,activeOpacity:.7,testID:`${f}-async-step-${F}`,children:[F<m.length-1&&g(l,{style:p.timelineConnector}),g(l,{style:[p.timelineDot,{backgroundColor:Q.color}]}),k(l,{style:p.timelineContent,children:[k(l,{style:p.timelineHeader,children:[g(l,{style:[p.timelineStatusBadge,{backgroundColor:Q.bgColor}],children:g(y,{style:[p.timelineStatusText,{color:Q.color}],testID:`${f}-async-step-${F}-status`,children:Q.label})}),Y&&g(l,{style:p.currentBadge,testID:`${f}-async-step-${F}-current`,children:g(y,{style:p.currentBadgeText,children:"CURRENT"})})]}),g(y,{style:p.timelineTime,children:_n(O.timestamp)})]})]},O.id)})})]})]}),u&&k(l,{style:p.card,testID:`${f}-payload-card`,children:[g(ve,{icon:zn,title:"PAYLOAD",badge:g(l,{style:p.typeBadge,children:g(y,{style:p.typeText,children:Array.isArray(e.payload)?"ARRAY":typeof e.payload=="object"?"OBJECT":typeof e.payload?.toString().toUpperCase()})})}),g(l,{style:p.dataViewerContainer,children:g(Ke,{title:"",data:Ue(e.payload),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),i&&k(l,{style:p.card,testID:`${f}-meta-card`,children:[g(ve,{icon:hr,title:"ASYNC METADATA",badge:g(l,{style:[p.categoryBadge,{backgroundColor:n.bgColor}],children:g(y,{style:[p.categoryText,{color:n.color}],children:"RTK THUNK"})})}),k(l,{style:p.cardContent,children:[e.meta?.requestId&&g(se,{label:"Request ID",value:e.meta.requestId,mono:true}),e.meta?.requestStatus&&g(se,{label:"Status",value:e.meta.requestStatus.toUpperCase(),valueColor:n.color,testID:`${f}-meta-status`}),e.meta?.arg!==void 0&&k(l,{style:p.argSection,children:[g(y,{style:p.argLabel,children:"Original Argument"}),g(l,{style:p.argValueContainer,children:typeof e.meta.arg=="object"?g(Ke,{title:"",data:Ue(e.meta.arg),showTypeFilter:true,rawMode:true,initialExpanded:true}):g(y,{style:p.argValue,children:JSON.stringify(e.meta.arg)})})]}),e.meta?.rejectedWithValue&&g(se,{label:"Rejected With Value",value:"true",valueColor:D.error}),e.meta?.aborted&&g(se,{label:"Aborted",value:"true",valueColor:D.warning}),e.meta?.condition&&g(se,{label:"Condition",value:"true",valueColor:C.color.textTertiary})]})]}),h&&k(l,{style:[p.card,p.errorCard],testID:`${f}-error-card`,children:[g(ve,{icon:jn,title:"ERROR",badge:g(l,{style:p.errorBadge,children:g(y,{style:p.errorBadgeText,testID:`${f}-error-badge`,children:"REJECTED"})})}),g(l,{style:p.dataViewerContainer,children:typeof e.error=="object"?g(Ke,{title:"",data:Ue(e.error),showTypeFilter:true,rawMode:true,initialExpanded:true}):g(y,{style:p.errorText,children:String(e.error)})})]}),k(l,{style:p.card,testID:`${f}-full-action-card`,children:[g(ve,{icon:Ln,title:"FULL ACTION OBJECT"}),g(l,{style:p.dataViewerContainer,children:g(Ke,{title:"",data:Ue(e.action),showTypeFilter:true,rawMode:true,initialExpanded:true})})]}),g(l,{style:p.actionFooter,children:k(l,{style:p.actionsGrid,children:[k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"replay",text:"REPLAY",onPress:w,testID:`${f}-replay`}),g(y,{style:p.actionDescription,children:"Dispatch again"})]}),k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"jump",text:"JUMP",onPress:K,disabled:s,testID:`${f}-jump`}),g(y,{style:p.actionDescription,testID:`${f}-jump-description`,children:c?"State not retained":d?"Restore this state":"Time travel not wired"})]}),k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"copy",text:"COPY ACTION",onPress:L,testID:`${f}-copy-action`}),g(y,{style:p.actionDescription,children:r?"Copy to clipboard":"Pro feature"})]}),u&&k(l,{style:p.actionButtonWrapper,children:[g(Ye,{type:"copy",text:"COPY PAYLOAD",onPress:P,testID:`${f}-copy-payload`}),g(y,{style:p.actionDescription,children:r?"Copy payload only":"Pro feature"})]})]})}),g(Pn,{visible:o,onClose:()=>a(false),featureName:"Copy"})]})}),p=ge.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:C.color.surface,borderRadius:6,borderWidth:1,borderColor:C.color.accent+"4D",overflow:"hidden",shadowColor:C.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},errorCard:{borderColor:D.error+"4D",shadowColor:D.error},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:C.color.accent+"33",backgroundColor:C.color.accent+"15"},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:C.color.accent,fontFamily:ce},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:C.color.surfaceElevated},durationBadgeSlow:{backgroundColor:D.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:C.color.textSecondary,fontFamily:ce},durationTextSlow:{color:D.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:D.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:D.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:C.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:C.color.textTertiary},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:C.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:C.color.textTertiary,fontFamily:ce},dataViewerContainer:{backgroundColor:C.color.bg,minHeight:60},argSection:{marginTop:4},argLabel:{fontSize:11,color:C.color.textTertiary,fontWeight:"500",marginBottom:6},argValueContainer:{backgroundColor:C.color.bg,borderRadius:6,borderWidth:1,borderColor:C.color.border,overflow:"hidden"},argValue:{fontSize:11,color:C.color.text,fontFamily:ce,padding:10},errorBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:D.error+"26"},errorBadgeText:{fontSize:9,fontWeight:"700",color:D.error,letterSpacing:.3},errorText:{fontSize:12,color:D.error,fontFamily:ce,padding:14},asyncBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:C.color.accent+"26"},asyncBadgeText:{fontSize:9,fontWeight:"700",color:C.color.accent,letterSpacing:.3},baseActionType:{fontSize:12,fontWeight:"600",color:C.color.text,fontFamily:ce,marginBottom:8},totalDurationRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:12,borderBottomWidth:1,borderBottomColor:C.color.border},totalDurationLabel:{fontSize:11,color:C.color.textTertiary,fontWeight:"500"},totalDurationValue:{fontSize:14,fontWeight:"700",color:D.success,fontFamily:ce},timeline:{gap:0},timelineItem:{flexDirection:"row",alignItems:"flex-start",paddingVertical:8,paddingHorizontal:8,borderRadius:8,position:"relative"},timelineItemCurrent:{backgroundColor:C.color.accentSoft},timelineConnector:{position:"absolute",left:13,top:24,bottom:-8,width:2,backgroundColor:C.color.border},timelineDot:{width:12,height:12,borderRadius:6,marginRight:10,marginTop:2},timelineContent:{flex:1},timelineHeader:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},timelineStatusBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},timelineStatusText:{fontSize:9,fontWeight:"700",letterSpacing:.3},currentBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:C.color.accent},currentBadgeText:{fontSize:8,fontWeight:"700",color:C.color.onAccent,letterSpacing:.3},timelineTime:{fontSize:10,color:C.color.textTertiary,fontFamily:ce},actionFooter:{backgroundColor:C.color.surface,borderRadius:6,borderWidth:1,borderColor:C.color.accent+"4D",paddingVertical:12,paddingHorizontal:12,shadowColor:C.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"},actionButtonWrapper:{alignItems:"center",gap:4},actionDescription:{fontSize:9,color:C.color.textTertiary,textAlign:"center"}});import{DiffModeTabs as Un,CompareBar as Kn}from"@buoy-gg/shared-ui/web";import{jsx as E,jsxs as he}from"react/jsx-runtime";function bt(e){return e.includes("/pending")?Be.semantic.warning:e.includes("/fulfilled")?Be.semantic.success:e.includes("/rejected")?Be.semantic.error:e.startsWith("@@")?Be.text.muted:Be.semantic.info}function Cr(e){if(e.includes("/pending"))return"PENDING";if(e.includes("/fulfilled"))return"FULFILLED";if(e.includes("/rejected"))return"REJECTED";if(e.startsWith("@@"))return"INTERNAL";let t=e.split("/");return t[t.length-1]?.toUpperCase()||"ACTION"}function Yn(e){return e===null?"null":e===void 0?"undefined":Array.isArray(e)?"array":typeof e}function vr(e){return new Date(e).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var Jn=[{key:"tree",label:"TREE VIEW"},{key:"split",label:"SPLIT VIEW"}];function wr({action:e,actions:t,selectedIndex:r,onIndexChange:o,disableInternalFooter:a=false,initialView:n="action"}){let[c,d]=ur(n),[s,u]=ur("tree"),i=t.length,h=oe(e.nextState),m=bt(e.type),R=Cr(e.type),V=Yn(_e(e.nextState)),z=i-r,L=z-1,P=r<i-1?r+1:null,w=P!==null?t[P]:null,K=pr(()=>({index:P??0,label:L>0?`#${L}`:"Initial",timestamp:w?vr(w.timestamp):"",relativeTime:w?He(new Date(w.timestamp)):"state",badge:w?E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${bt(w.type)}20`}],children:E(y,{style:[$.actionTextSmall,{color:bt(w.type)}],children:Cr(w.type)})}):void 0}),[P,w,L]),O=pr(()=>({index:r,label:`#${z}`,timestamp:vr(e.timestamp),relativeTime:He(new Date(e.timestamp)),badge:E(l,{style:[$.actionBadgeSmall,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionTextSmall,{color:m}],children:R})})}),[r,e.timestamp,m,R,z]),F=Me(()=>{if(h)return he(l,{style:$.contentCard,testID:`${f}-state-evicted`,children:[E(l,{style:$.valueHeader,children:E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"})}),E(y,{style:$.evictedText,children:`Not retained. Raw state is kept for the ${nt} most recent actions, so this action's before/after trees have been released.`})]});let fe=_e(e.nextState);return he(l,{style:$.contentCard,testID:`${f}-state-card`,children:[he(l,{style:$.valueHeader,children:[E(y,{style:$.valueLabel,children:"STATE AFTER ACTION"}),he(l,{style:$.valueHeaderBadges,children:[E(l,{style:[$.actionBadge,{backgroundColor:`${m}20`}],children:E(y,{style:[$.actionText,{color:m}],children:R})}),E(l,{style:$.typeBadge,children:E(y,{style:$.typeText,testID:`${f}-state-type`,children:V.toUpperCase()})})]})]}),E(l,{style:$.dataViewerContainer,children:E(hn,{title:"",data:fe,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})},[e.nextState,m,R,V,h]),Q=Me(()=>{let fe=_e(e.prevState),ye=_e(e.nextState);return s==="split"?E(Pe,{keyboardShouldPersistTaps:"handled",style:{flex:1},showsVerticalScrollIndicator:true,children:E(fn,{oldValue:fe,newValue:ye,theme:mn.devToolsDefault,options:{hideLineNumbers:false,disableWordDiff:false,showDiffOnly:false,compareMethod:"words",contextLines:3},showThemeName:false})}):E(yn,{oldValue:fe,newValue:ye})},[e.prevState,e.nextState,s]),Y=Me(()=>{o(Math.min(i-1,r+1))},[r,i,o]),Qe=Me(()=>{o(Math.max(0,r-1))},[r,o]),W=h||oe(e.prevState)||e.prevState===void 0,Z=!a&&i>1;return he(l,{style:$.container,children:[E(In,{activeView:c,onViewChange:d,diffDisabled:W}),he(l,{style:[$.contentArea,Z&&$.contentAreaFooterPad],children:[c==="action"&&E(qn,{action:e}),c==="state"&&E(l,{style:$.stateContainer,children:F()}),c==="diff"&&he(l,{style:$.diffContainer,testID:`${f}-diff`,children:[E(Un,{tabs:Jn,activeTab:s,onTabChange:u,testIDPrefix:`${f}-diff-tab`}),E(Kn,{leftEvent:K,rightEvent:O}),E(l,{style:$.diffContent,testID:`${f}-diff-content`,children:Q()})]})]}),Z&&E(gr,{currentIndex:z-1,totalItems:i,onPrevious:Y,onNext:Qe,itemLabel:"Action",subtitle:He(new Date(e.timestamp)),absolute:true})]})}function Tr({action:e,actions:t,selectedIndex:r,onIndexChange:o}){let a=t.length;if(a<=1)return null;let n=a-r;return E(gr,{currentIndex:n-1,totalItems:a,onPrevious:()=>o(Math.min(a-1,r+1)),onNext:()=>o(Math.max(0,r-1)),itemLabel:"Action",subtitle:He(new Date(e.timestamp))})}var $=ge.create({container:{flex:1,backgroundColor:"transparent"},contentArea:{flex:1},contentAreaFooterPad:{paddingBottom:96},stateContainer:{flex:1,padding:14},contentCard:{backgroundColor:X.color.surface,borderRadius:14,padding:14,borderWidth:1,borderColor:X.color.border},valueHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:8},valueLabel:{fontSize:10,color:X.color.textSecondary,fontFamily:Re,letterSpacing:.5,fontWeight:"600"},valueHeaderBadges:{flexDirection:"row",alignItems:"center",gap:6},actionBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4},actionText:{fontSize:9,fontWeight:"700",fontFamily:Re,letterSpacing:.3},typeBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:4,backgroundColor:X.color.surfaceElevated},typeText:{fontSize:9,fontWeight:"600",color:X.color.textTertiary,fontFamily:Re},valueBox:{backgroundColor:X.color.bg,borderRadius:6,borderWidth:1,borderColor:X.color.border,padding:8},evictedText:{fontSize:12,color:X.color.textSecondary,lineHeight:18},valueText:{fontSize:12,color:X.color.text,fontFamily:Re,lineHeight:18},diffContainer:{flex:1},diffContent:{flex:1,paddingHorizontal:14},actionBadgeSmall:{paddingHorizontal:6,paddingVertical:1,borderRadius:3},actionTextSmall:{fontSize:8,fontWeight:"700",fontFamily:Re},dataViewerContainer:{marginTop:-12,marginHorizontal:-12,marginBottom:-12}});import{Fragment as Gn,jsx as b,jsxs as N}from"react/jsx-runtime";var Xn=Fa["redux.actions"].free;function Qn({isEnabled:e,query:t,totalActions:r}){let o=_a({subject:"actions",search:t,total:r,capturing:e,waiting:{otto:"waiting",title:"No Redux actions",message:"Actions will appear here as they are dispatched"},paused:{title:"No Redux actions",message:"Enable capture to start recording actions"}});return b(Ha,{...o,testID:`${f}-empty`})}function xt({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,onActionSelect:c,initialSelectedActionId:d,initialDetailView:s}){let u=Ka(),i=Na("redux.actions"),[h,m]=je(false),{isInstrumented:R,isLoading:V,error:z,isReactReduxAvailable:L,captureMechanism:P}=ft(),{filteredActions:w,filter:K,setFilter:O,stats:F,clearActions:Q,isEnabled:Y,toggleCapture:Qe}=ar(),W=Te(()=>w.slice(0,i),[w,i]),Z=Te(()=>Math.max(0,w.length-i),[w.length,i]),fe=Z>0,[ye,Ee]=je(null),me=Te(()=>{if(ye===null)return null;let S=W.findIndex(j=>j.id===ye);return S>=0?S:null},[ye,W]),U=me!==null?W[me]:null,vt=Le(null);Ut(()=>{if(!c)return;let S=U?.id??null;S===null||S===vt.current||(vt.current=S,c(U))},[U,c]);let wt=Le(null);Ut(()=>{!d||wt.current===d||W.findIndex(S=>S.id===d)<0||(wt.current=d,Ee(d))},[d,W]);let[we,Tt]=je(""),[At,Ze]=je(false),wi=Le(null),Rr=Le(null),kr=ae(S=>{},[]),Er=S=>{Tt(S),O(j=>({...j,searchText:S}))},$r=ae(()=>{Tt(""),O(S=>({...S,searchText:""})),Ze(false)},[O]),It=ae(S=>{Ee(S.id)},[]),Or=ae(()=>{m(true)},[]),Vr=ae(()=>{Ee(null)},[]),Dt=ae(S=>{let j=W[S];j&&Ee(j.id)},[W]),zr=async()=>{if(!u){m(true);return}let S=w.map(j=>({id:j.id,type:j.type,...j.payload!==void 0&&{payload:j.payload},timestamp:j.timestamp,prevState:j.prevState,nextState:j.nextState,hasStateChange:j.hasStateChange}));await La(S)},jr=ae(S=>S.id,[]),Bt=Te(()=>xr(W),[W]),Rt=Te(()=>{let S=new Map;for(let j of x.getActions()){let et=j.meta?.requestId;et&&S.set(et,(S.get(et)??0)+1)}return S},[w]),Lr=ae(({item:S})=>{let j=S.meta?.requestId;return b(dr,{action:S,onPress:It,linkedCount:j?Rt.get(j)??0:0,testID:Bt.get(S.id)})},[It,Bt,Rt]),kt=()=>U?N(ne,{children:[b(ne.Navigation,{onBack:Vr}),b(ne.Content,{title:U.type,centered:true,testID:`${f}-detail-title`})]}):N(ne,{children:[r&&b(ne.Navigation,{onBack:r}),b(ne.Content,{title:"",children:At?b(ne.Search,{value:we,onChangeText:Er,onCancel:$r,placeholder:"Search action types...",accessibilityLabel:"Search action types",iconSize:14,testID:`${f}-search-field`,containerTestID:`${f}-search`,clearTestID:`${f}-search-clear`,onBlur:()=>{we.length===0&&Ze(false)}}):N(l,{style:I.headerChipRow,children:[N(J,{style:[I.headerChip,!K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(S=>({...S,onlyWithChanges:false})),testID:`${f}-chip-all`,accessibilityRole:"button",accessibilityLabel:`Show all actions, ${F.totalActions} captured`,accessibilityState:{selected:!K.onlyWithChanges},children:[b(y,{style:I.headerChipLabel,children:"ALL"}),b(y,{style:[I.headerChipValue,{color:T.color.text}],testID:`${f}-chip-all-value`,children:F.totalActions})]}),N(J,{style:[I.headerChip,K.onlyWithChanges&&I.headerChipActive],onPress:()=>O(S=>({...S,onlyWithChanges:true})),testID:`${f}-chip-changed`,accessibilityRole:"button",accessibilityLabel:`Show only actions that changed state, ${F.actionsWithChanges} of them`,accessibilityState:{selected:!!K.onlyWithChanges},children:[b($a,{size:12,color:G.semantic.warning}),b(y,{style:[I.headerChipValue,{color:G.semantic.warning}],testID:`${f}-chip-changed-value`,children:F.actionsWithChanges})]}),N(l,{style:I.headerChip,testID:`${f}-chip-types`,accessibilityLabel:`${F.uniqueActionTypes} distinct action types`,children:[b(Oa,{size:12,color:G.semantic.success}),b(y,{style:[I.headerChipValue,{color:G.semantic.success}],testID:`${f}-chip-types-value`,children:F.uniqueActionTypes})]})]})}),N(ne.Actions,{children:[!At&&b(J,{onPress:()=>Ze(true),style:[I.headerActionButton,we.length>0&&I.headerActionButtonActive],testID:`${f}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search action types",children:b(Ra,{size:14,color:we.length>0?T.color.accent:T.color.textSecondary})}),b(J,{onPress:zr,style:[I.headerActionButton,w.length===0&&I.headerActionButtonDisabled],disabled:w.length===0,testID:`${f}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy all actions",accessibilityState:{disabled:w.length===0},children:b(Va,{size:14,color:w.length>0?T.color.textSecondary:T.color.textTertiary})}),b(Wa,{isEnabled:Y,onToggle:Qe,accessibilityLabel:"Toggle Redux action capture",testID:`${f}-power`}),b(J,{onPress:Q,style:[I.headerActionButton,w.length===0&&I.headerActionButtonDisabled],disabled:w.length===0,testID:`${f}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear actions",accessibilityState:{disabled:w.length===0},children:b(ka,{size:14,color:w.length>0?T.color.textTertiary:T.color.textTertiary})})]})]}),Pr=a?ja.modal.root():"buoy-redux-modal";if(!e)return null;let Et=U&&me!==null?b(Tr,{action:U,actions:W,selectedIndex:me,onIndexChange:Dt}):null,Wr=U&&W.length>1?68:0,Nr=U==null,$t=b(l,{style:I.container,children:U&&me!==null?b(wr,{action:U,actions:W,selectedIndex:me,onIndexChange:Dt,disableInternalFooter:true,initialView:s}):N(Gn,{children:[z&&!R&&!x.isCaptureSuppressed()&&N(l,{style:I.errorBanner,testID:`${f}-banner-error`,children:[b(er,{size:14,color:T.color.danger}),b(y,{style:I.errorText,children:L?"Not inside a Redux Provider. Wrap your app with <Provider store={store}>.":"react-redux not installed. Run: npm install react-redux"})]}),!Y&&R&&N(l,{style:I.disabledBanner,testID:`${f}-banner-disabled`,children:[b(Ea,{size:14,color:T.color.warning}),b(y,{style:I.disabledText,children:"Action capture is disabled"})]}),P==="patch"&&!x.isCaptureSuppressed()&&N(l,{style:I.disabledBanner,testID:`${f}-banner-patch`,children:[b(er,{size:14,color:T.color.warning}),b(y,{style:I.disabledText,children:"Top-level capture only \u2014 thunk/RTK Query internals aren't visible. Put import '@buoy-gg/redux' first in your app entry (or add buoyReduxMiddleware) for full capture."})]}),fe&&N(J,{style:I.lockedBanner,onPress:Or,activeOpacity:.8,testID:`${f}-locked`,accessibilityRole:"button",accessibilityLabel:`${Z} older ${Z===1?"action":"actions"} locked. Upgrade to see them.`,children:[b(za,{size:14,color:T.color.accent}),N(y,{style:I.lockedText,testID:`${f}-locked-text`,children:[Z," older ",Z===1?"action":"actions"," locked"]}),b(l,{style:I.upgradeBadge,children:b(y,{style:I.upgradeBadgeText,children:"UPGRADE"})})]}),W.length>0?b(Yt,{keyboardShouldPersistTaps:"handled",ref:Rr,testID:`${f}-list`,data:W,renderItem:Lr,keyExtractor:jr,contentContainerStyle:I.listContent,showsVerticalScrollIndicator:true,...qa}):b(Qn,{isEnabled:Y,query:we,totalActions:F.totalActions})]})}),Ot=b(Pa,{visible:h,onClose:()=>m(false),featureName:"Full Action History"});return n?N(tr,{children:[N(l,{style:I.inlineRoot,children:[b(l,{style:I.inlineHeader,...Ma,children:kt()}),$t,Et]}),Ot]}):N(tr,{children:[b(Ba,{visible:e,onClose:t,onMinimize:o,persistenceKey:Pr,header:{showToggleButton:true,customContent:kt()},onModeChange:kr,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,disableScrollWrapper:Nr,styles:{},footer:Et,footerHeight:Wr,children:$t}),Ot]})}function Zn(e={}){return b(xt,{...e,inline:true,visible:true,onClose:()=>{}})}var I=ge.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:G.border.default,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:T.color.surfaceElevated,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:T.color.border},headerChipActive:{backgroundColor:T.color.accentSoft,borderColor:T.color.accentBorderStrong},headerChipLabel:{fontSize:10,fontWeight:"700",color:T.color.textTertiary},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:Ua},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:T.color.surfaceElevated,borderWidth:1,borderColor:T.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:T.color.accentSoft,borderColor:T.color.accentBorderStrong},startButton:{backgroundColor:G.semantic.successBackground,borderColor:G.semantic.success+"40"},stopButton:{backgroundColor:G.semantic.errorBackground,borderColor:G.semantic.error+"40"},errorBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.dangerSoft,borderRadius:8,borderWidth:1,borderColor:T.color.danger+"20"},errorText:{color:T.color.danger,fontSize:11,flex:1},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:T.color.warning+"20"},disabledText:{color:T.color.warning,fontSize:11,flex:1},listContent:{paddingTop:8,paddingBottom:20},lockedBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:T.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:T.color.accentBorder},lockedText:{color:T.color.accent,fontSize:11,fontWeight:"500",flex:1},upgradeBadge:{backgroundColor:T.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},upgradeBadgeText:{color:T.color.onAccent,fontSize:9,fontWeight:"700",letterSpacing:.5}});import{ReduxIcon as Je,REDUX_ICON_COLOR as al}from"@buoy-gg/floating-tools-core/web";import{createToolFactory as ei,defineToolPreset as ti}from"@buoy-gg/shared-ui/web";import{jsx as Ar}from"react/jsx-runtime";var Ir=ti({id:"redux",name:"REDUX",description:"Redux action & state inspector",slot:"both",icon:({size:e})=>Ar(Je,{size:e}),component:xt,props:{enableSharedModalDimensions:false}}),ri=ei(Ir,e=>({enableSharedModalDimensions:e.enableSharedModalDimensions??false}),e=>({icon:({size:t})=>Ar(Je,{size:t,color:e.iconColor})}));var oi={timeTravel:false,toggle:false,edit:false,diff:true,export:true,import:false,reset:true,recording:true};function ai(e,t,r){return{id:e.id,label:e.type,timestamp:e.timestamp,data:e.payload??e.action,prevState:e.prevState,nextState:e.nextState,hasStateChange:e.hasStateChange,duration:e.duration,source:"redux",isCurrent:t===0,isInFuture:false,isSkipped:false,meta:{fullAction:e.action}}}function Dr(e){let{icon:t=Je,color:r="#764ABC",name:o="Redux"}=e??{},a=0;return{id:"redux",name:o,icon:t,color:r,capabilities:oi,subscribe:n=>x.subscribe(()=>{n()}),getEntries:()=>{let n=x.getActions();return n.map((c,d)=>ai(c,d,n.length))},getEntryCount:()=>x.getActions().length,getCurrentState:()=>{let n=x.getActions();if(n.length!==0)return n[0].nextState},getStateAtEntry:n=>x.getActionById(String(n))?.nextState,get currentIndex(){return a},jumpTo:n=>{let c=x.getActions().findIndex(d=>d.id===String(n));c!==-1&&(a=c)},get isRecording(){return x.getEnabled()},setRecording:n=>{x.setEnabled(n)},reset:()=>{x.clearActions(),a=0},exportHistory:()=>{let n=x.getActions();return JSON.stringify(n,null,2)}}}var ni=Dr();import{WIRE_DETAIL_LIMIT_BYTES as ii,capDetail as li,createSyncAdapter as si,memoByIdentity as ci,readParams as ke,toWire as di}from"@buoy-gg/shared-ui/web";var Ge=e=>di(e,eo),ui=ci(e=>{let t=oe(e.prevState)?{...e}:{...e,prevState:Wt,nextState:Wt};if(t.payload=Ge(t.payload),t.action=Ge(t.action),t.error=Ge(t.error),t.meta){let r=Ge(t.meta.arg);r!==t.meta.arg&&(t.meta={...t.meta,arg:r})}return t});function pi(e){return e&&typeof e=="object"&&!Array.isArray(e)?Object.keys(e):[]}function gi(e,t){let{path:r,value:o,remove:a}=t;if(!r)return{ok:false,error:'setState needs a `path`, like "offers.added.<id>".'};if(!a&&o===void 0)return{ok:false,error:"Sent `path` without `value`. Send value (null is fine) or remove:true."};let n=r.split(".").filter(Boolean),c=h=>Array.isArray(h)?[...h]:{...h},d=c(e),s=d;for(let h=0;h<n.length-1;h++){let m=n[h],R=s[m];if(!R||typeof R!="object")return{ok:false,error:`No object at "${n.slice(0,h+1).join(".")}" \u2014 read getState for the real shape.`};let V=c(R);s[m]=V,s=V}let u=n[n.length-1],i=s[u];if(a){if(!(u in s))return{ok:false,error:`Nothing at "${r}" to remove.`};Array.isArray(s)?s.splice(Number(u),1):delete s[u]}else s[u]=o;return{ok:true,next:d,prev:i}}function hi(e){let t={};if(!e||typeof e!="object"||Array.isArray(e))return t;for(let[r,o]of Object.entries(e).slice(0,40))o&&typeof o=="object"&&!Array.isArray(o)&&(t[r]=Object.keys(o).slice(0,12));return t}function St(){let e=re().diagnostic??"not-instrumented";return{available:false,slices:[],reason:e}}var fi=si({version:2,getSnapshot:()=>x.getActions().map(ui),subscribe:e=>x.subscribe(e),actions:{clearEvents:()=>{x.clearActions()},getActionDetail:e=>{let{id:t}=ke(e);if(!t)return{found:false,reason:"missing id"};let r=x.getActionById(t);if(!r)return{found:false,reason:"unknown id"};if(oe(r.prevState))return{found:true,id:t,evicted:true,reason:"Raw state was evicted (retained for recent actions only)."};let o=n=>li(n,ii),a=n=>{if(!n)return n;let c=o(n.arg);return c===n.arg?n:{...n,arg:c}};return{found:true,id:t,prevState:o(r.prevState),nextState:o(r.nextState),payload:o(r.payload),action:o(r.action),meta:a(r.meta),error:o(r.error)}},getState:e=>{let{includeValues:t=false}=ke(e),r=Ne();if(!r)return St();let o=r.getState(),a=re();return{available:true,slices:pi(o),sliceFields:hi(o),capture:a.capture,mechanism:a.mechanism,...t?{state:o}:{}}},dispatch:e=>{let{action:t}=ke(e),r=Ne();if(!r)return{dispatched:false,...St()};if(!t)throw new Error("dispatch requires an `action`");return r.dispatch(t),{dispatched:true,type:t.type}},setState:e=>{let t=Ne();if(!t)return{ok:false,...St()};if(!$e())return{ok:false,error:"This store has no Buoy time-travel reducer, so its state can't be edited directly. Dispatch one of the app's own actions instead."};let r=gi(t.getState(),ke(e));return r.ok?(t.dispatch({type:xe,payload:r.next}),{ok:true,path:ke(e).path,previous:r.prev}):r}}});import{useState as yi}from"react";import{macOSColors as de,night as q,TabSelector as mi,DataInspector as ue,CollapsibleSection as Xe,CopyButton as bi,monoFont as Ct}from"@buoy-gg/shared-ui/web";import{jsx as v,jsxs as H}from"react/jsx-runtime";function xi({action:e}){let[t,r]=yi("action"),o=[{key:"action",label:"Action"},{key:"state",label:"State"},{key:"diff",label:"Diff"}],a=new Date(e.timestamp).toLocaleTimeString(),n=()=>JSON.stringify({type:e.type,payload:e.payload,timestamp:e.timestamp,duration:e.duration,hasStateChange:e.hasStateChange},null,2);return H(l,{style:A.container,children:[H(l,{style:A.header,children:[H(l,{style:A.headerContent,children:[v(y,{style:A.actionType,numberOfLines:2,children:e.type}),H(l,{style:A.headerMeta,children:[v(y,{style:A.metaText,children:a}),e.duration!==void 0&&H(y,{style:A.durationText,children:[e.duration.toFixed(2),"ms"]}),e.hasStateChange&&v(l,{style:A.changeBadge,children:v(y,{style:A.changeBadgeText,children:"State Changed"})})]})]}),v(bi,{value:n(),size:16})]}),v(l,{style:A.tabContainer,children:v(mi,{tabs:o,activeTab:t,onTabChange:c=>r(c)})}),H(Pe,{keyboardShouldPersistTaps:"handled",style:A.content,showsVerticalScrollIndicator:true,children:[t==="action"&&H(l,{style:A.section,children:[v(Xe,{title:"Payload",defaultOpen:true,children:e.payload!==void 0?v(ue,{data:e.payload}):v(y,{style:A.emptyText,children:"No payload"})}),v(Xe,{title:"Full Action",defaultOpen:false,children:v(ue,{data:e.action})})]}),t==="state"&&H(l,{style:A.section,children:[v(Xe,{title:"Previous State",defaultOpen:false,children:v(ue,{data:e.prevState})}),v(Xe,{title:"Next State",defaultOpen:true,children:v(ue,{data:e.nextState})})]}),t==="diff"&&v(l,{style:A.section,children:e.hasStateChange?v(Si,{prevState:e.prevState,nextState:e.nextState}):v(l,{style:A.noChangeContainer,children:v(y,{style:A.noChangeText,children:"No state changes from this action"})})})]})]})}function Si({prevState:e,nextState:t}){let r=Br(e,t);return r.length===0?v(l,{style:A.noChangeContainer,children:v(y,{style:A.noChangeText,children:"No differences detected"})}):v(l,{children:r.map((o,a)=>H(l,{style:A.diffItem,children:[H(l,{style:A.diffHeader,children:[v(l,{style:[A.diffTypeBadge,{backgroundColor:o.type==="added"?de.semantic.successBackground:o.type==="removed"?de.semantic.errorBackground:de.semantic.warningBackground}],children:v(y,{style:[A.diffTypeText,{color:o.type==="added"?de.semantic.success:o.type==="removed"?de.semantic.error:de.semantic.warning}],children:o.type.toUpperCase()})}),v(y,{style:A.diffPath,children:o.path})]}),o.type==="modified"&&H(l,{style:A.diffValues,children:[H(l,{style:A.diffValue,children:[v(y,{style:A.diffLabel,children:"Before:"}),v(ue,{data:o.oldValue})]}),H(l,{style:A.diffValue,children:[v(y,{style:A.diffLabel,children:"After:"}),v(ue,{data:o.newValue})]})]}),o.type==="added"&&v(l,{style:A.diffValue,children:v(ue,{data:o.newValue})}),o.type==="removed"&&v(l,{style:A.diffValue,children:v(ue,{data:o.oldValue})})]},a))})}function Br(e,t,r=""){let o=[];if(typeof e!="object"||typeof t!="object")return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;if(e===null||t===null)return e!==t&&o.push({type:"modified",path:r||"root",oldValue:e,newValue:t}),o;let a=e,n=t,c=new Set([...Object.keys(a),...Object.keys(n)]);for(let d of c){let s=r?`${r}.${d}`:d,u=a[d],i=n[d];d in a?d in n?u!==i&&(typeof u=="object"&&typeof i=="object"&&u!==null&&i!==null&&!Array.isArray(u)&&!Array.isArray(i)?s.split(".").length<3?o.push(...Br(u,i,s)):o.push({type:"modified",path:s,oldValue:u,newValue:i}):o.push({type:"modified",path:s,oldValue:u,newValue:i})):o.push({type:"removed",path:s,oldValue:u}):o.push({type:"added",path:s,newValue:i})}return o}var A=ge.create({container:{flex:1},header:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:12,backgroundColor:q.color.surface,borderBottomWidth:1,borderBottomColor:q.color.border},headerContent:{flex:1,marginRight:12},actionType:{fontSize:14,fontWeight:"600",color:q.color.text,fontFamily:Ct,marginBottom:6},headerMeta:{flexDirection:"row",alignItems:"center",gap:12},metaText:{fontSize:11,color:q.color.textTertiary},durationText:{fontSize:11,color:q.color.textTertiary,fontFamily:Ct},changeBadge:{backgroundColor:de.semantic.warningBackground,paddingHorizontal:6,paddingVertical:2,borderRadius:4},changeBadgeText:{fontSize:10,color:de.semantic.warning,fontWeight:"600"},tabContainer:{paddingHorizontal:12,paddingVertical:8},content:{flex:1},section:{paddingHorizontal:12,paddingBottom:20},emptyText:{fontSize:12,color:q.color.textTertiary,fontStyle:"italic",padding:8},noChangeContainer:{padding:20,alignItems:"center"},noChangeText:{fontSize:13,color:q.color.textTertiary},diffItem:{marginBottom:12,backgroundColor:q.color.surface,borderRadius:8,borderWidth:1,borderColor:q.color.border,overflow:"hidden"},diffHeader:{flexDirection:"row",alignItems:"center",gap:8,padding:8,borderBottomWidth:1,borderBottomColor:q.color.border},diffTypeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},diffTypeText:{fontSize:10,fontWeight:"700"},diffPath:{fontSize:12,color:q.color.text,fontFamily:Ct},diffValues:{padding:8,gap:8},diffValue:{padding:8},diffLabel:{fontSize:11,color:q.color.textTertiary,marginBottom:4,fontWeight:"600"}});function Ci(){return ft(),null}function vi(e){return ee(e,"extension"),at(),()=>Pt(e)}export{xe as BUOY_JUMP_TO_STATE,lo as BUOY_REPLAY_ACTION,Xn as FREE_TIER_ACTION_LIMIT,f as REDUX_TEST_ID,wr as ReduxActionDetailContent,Tr as ReduxActionDetailFooter,xi as ReduxActionDetailView,dr as ReduxActionItem,Ci as ReduxAutoInstrument,Je as ReduxIcon,xt as ReduxModal,Zn as ReduxToolView,br as actionRowTestID,xr as buildActionRowTestIDs,ze as buoyDevtoolsEnhancer,co as buoyReduxMiddleware,qt as claimDevtoolsHook,vi as connectReduxAdapter,uo as createBuoyReduxMiddleware,Dr as createReduxHistoryAdapter,ri as createReduxTool,Ne as getActiveStore,re as getInstrumentationStatus,gt as instrumentStore,tn as isAutoInstrumentActive,bo as isDevtoolsHookClaimed,Za as isStoreInstrumented,Mt as jumpToState,x as reduxActionStore,ni as reduxHistoryAdapter,fi as reduxSyncAdapter,Ir as reduxToolPreset,en as registerReduxStore,Ht as replayAction,mr as slugForTestID,ht as uninstrumentStore,ft as useAutoInstrumentRedux,ar as useReduxActions,rn as useReduxAvailability,so as withBuoyDevTools};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/redux",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.78",
|
|
4
4
|
"description": "Inspect a connected Redux store, captured actions and state changes, and dispatch supported actions from Buoy tools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"./lib/web/**/*.mjs"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
44
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
45
|
-
"@buoy-gg/license": "^7.0.
|
|
43
|
+
"@buoy-gg/shared-ui": "^7.0.78",
|
|
44
|
+
"@buoy-gg/floating-tools-core": "^7.0.78",
|
|
45
|
+
"@buoy-gg/license": "^7.0.78"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@reduxjs/toolkit": ">=1.9.0",
|