@localstack/appinspector-ui 1.0.77 → 1.0.79

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/dist/index.js CHANGED
@@ -484,7 +484,7 @@ var init_event_streams = __esm({
484
484
 
485
485
  // src/pages/spans-list-page.tsx
486
486
  import { Box as Box18 } from "@mui/material";
487
- import { useCallback as useCallback10, useState as useState15 } from "react";
487
+ import { useCallback as useCallback10, useState as useState16 } from "react";
488
488
 
489
489
  // src/components/spans-list/spans-list.tsx
490
490
  import { Alert, Box as Box4, Button as Button2 } from "@mui/material";
@@ -12914,9 +12914,9 @@ var SpansDataGrid = ({
12914
12914
  )) }, headerGroup.id);
12915
12915
  }) }),
12916
12916
  /* @__PURE__ */ jsxs120(TableBody, { children: [
12917
- spans === void 0 && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsx124(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx124(CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
12918
- spans?.length === 0 && /* @__PURE__ */ jsx124(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_NO_SPANS }),
12919
- order2 === "newest_first" && /* @__PURE__ */ jsxs120(Fragment3, { children: [
12917
+ (spans === void 0 || clearingSpans) && /* @__PURE__ */ jsx124(TableRow, { children: /* @__PURE__ */ jsx124(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx124(CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
12918
+ !clearingSpans && spans?.length === 0 && /* @__PURE__ */ jsx124(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_NO_SPANS }),
12919
+ !clearingSpans && order2 === "newest_first" && /* @__PURE__ */ jsxs120(Fragment3, { children: [
12920
12920
  hasRows && hasMoreForward && /* @__PURE__ */ jsx124(LoadSpansRow, { colSpan: columnCount, fetching: fetchingForward, label: LABEL_LOAD_NEWER, onFetch: onFetchForward }),
12921
12921
  hasRows && !hasMoreForward && /* @__PURE__ */ jsx124(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM }),
12922
12922
  hasRows && /* @__PURE__ */ jsx124(AnimatePresence, { initial: false, children: (() => {
@@ -12932,7 +12932,7 @@ var SpansDataGrid = ({
12932
12932
  hasRows && hasMoreBackward && /* @__PURE__ */ jsx124(LoadSpansRow, { colSpan: columnCount, fetching: fetchingBackward, label: LABEL_LOAD_OLDER, onFetch: onFetchBackward }),
12933
12933
  hasRows && !hasMoreBackward && /* @__PURE__ */ jsx124(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM })
12934
12934
  ] }),
12935
- order2 === "oldest_first" && /* @__PURE__ */ jsxs120(Fragment3, { children: [
12935
+ !clearingSpans && order2 === "oldest_first" && /* @__PURE__ */ jsxs120(Fragment3, { children: [
12936
12936
  hasRows && !hasMoreBackward && /* @__PURE__ */ jsx124(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM }),
12937
12937
  hasRows && hasMoreBackward && /* @__PURE__ */ jsx124(LoadSpansRow, { colSpan: columnCount, fetching: fetchingBackward, label: LABEL_LOAD_OLDER, onFetch: onFetchBackward }),
12938
12938
  hasRows && /* @__PURE__ */ jsx124(AnimatePresence, { initial: false, children: rows.map((row) => /* @__PURE__ */ jsx124(SpansDataGridRow, { row }, row.original.span_id)) }),
@@ -13329,7 +13329,7 @@ function useLocalStorage(key, initialValue) {
13329
13329
  }
13330
13330
 
13331
13331
  // src/hooks/use-spans.ts
13332
- import { useCallback as useCallback7, useEffect as useEffect14, useRef as useRef10, useState as useState7 } from "react";
13332
+ import { useCallback as useCallback7, useEffect as useEffect15, useRef as useRef11, useState as useState8 } from "react";
13333
13333
 
13334
13334
  // src/api/use-api.tsx
13335
13335
  import { createContext as createContext7, useContext as useContext14 } from "react";
@@ -13544,26 +13544,24 @@ var createPaginationBuffer = (options) => {
13544
13544
  void checkIfThereAreMoreItemsForward();
13545
13545
  },
13546
13546
  clear: () => {
13547
- if (items !== void 0) {
13548
- items = [];
13549
- }
13547
+ items = [];
13550
13548
  hasMoreBackward = void 0;
13551
13549
  nextBackwardToken = void 0;
13552
13550
  hasMoreForward = void 0;
13553
13551
  nextForwardToken = void 0;
13554
13552
  reportDataChange();
13555
13553
  },
13556
- fetchBackward: () => {
13554
+ fetchBackward: async () => {
13557
13555
  if (fetchingForward || fetchingBackward) {
13558
13556
  return;
13559
13557
  }
13560
- void fetchBackward();
13558
+ await fetchBackward();
13561
13559
  },
13562
- fetchForward: () => {
13560
+ fetchForward: async () => {
13563
13561
  if (fetchingForward || fetchingBackward) {
13564
13562
  return;
13565
13563
  }
13566
- void fetchForward();
13564
+ await fetchForward();
13567
13565
  }
13568
13566
  };
13569
13567
  };
@@ -13855,15 +13853,109 @@ function useSpansWebSocket(options) {
13855
13853
  return { connected };
13856
13854
  }
13857
13855
 
13856
+ // src/hooks/use-throttled-items.ts
13857
+ import { useEffect as useEffect14, useRef as useRef10, useState as useState7 } from "react";
13858
+ function useThrottledItems(items, getId, catchUpIncrement = 10) {
13859
+ const [displayedItems, setDisplayedItems] = useState7([]);
13860
+ const [isCatchingUpForward, setIsCatchingUpForward] = useState7(false);
13861
+ const [isCatchingUpBackward, setIsCatchingUpBackward] = useState7(false);
13862
+ const targetRef = useRef10([]);
13863
+ const rafRef = useRef10(void 0);
13864
+ const leftHiddenRef = useRef10(0);
13865
+ const rightHiddenRef = useRef10(0);
13866
+ const shrinkRafPendingRef = useRef10(false);
13867
+ useEffect14(() => {
13868
+ const previousTarget = targetRef.current;
13869
+ const target = items ?? [];
13870
+ targetRef.current = target;
13871
+ if (rafRef.current !== void 0) {
13872
+ cancelAnimationFrame(rafRef.current);
13873
+ rafRef.current = void 0;
13874
+ }
13875
+ if (target.length < previousTarget.length) {
13876
+ leftHiddenRef.current = 0;
13877
+ rightHiddenRef.current = 0;
13878
+ shrinkRafPendingRef.current = true;
13879
+ rafRef.current = requestAnimationFrame(() => {
13880
+ rafRef.current = void 0;
13881
+ shrinkRafPendingRef.current = false;
13882
+ setDisplayedItems(targetRef.current);
13883
+ setIsCatchingUpForward(false);
13884
+ setIsCatchingUpBackward(false);
13885
+ });
13886
+ return;
13887
+ }
13888
+ if (shrinkRafPendingRef.current) {
13889
+ if (target.length === previousTarget.length) {
13890
+ rafRef.current = requestAnimationFrame(() => {
13891
+ rafRef.current = void 0;
13892
+ shrinkRafPendingRef.current = false;
13893
+ setDisplayedItems(targetRef.current);
13894
+ setIsCatchingUpForward(false);
13895
+ setIsCatchingUpBackward(false);
13896
+ });
13897
+ return;
13898
+ }
13899
+ shrinkRafPendingRef.current = false;
13900
+ }
13901
+ let targetGrew = false;
13902
+ if (target.length > previousTarget.length) {
13903
+ targetGrew = true;
13904
+ const previousIds = new Set(previousTarget.map((item) => getId(item)));
13905
+ const firstOldIndex = target.findIndex((item) => previousIds.has(getId(item)));
13906
+ const leftGrowth = Math.max(0, firstOldIndex);
13907
+ const lastOldIndex = target.findLastIndex((item) => previousIds.has(getId(item)));
13908
+ const rightGrowth = lastOldIndex === -1 ? Math.max(0, target.length - previousTarget.length) : target.length - 1 - lastOldIndex;
13909
+ leftHiddenRef.current += leftGrowth;
13910
+ rightHiddenRef.current += rightGrowth;
13911
+ }
13912
+ if (leftHiddenRef.current > 0 || rightHiddenRef.current > 0) {
13913
+ const step = () => {
13914
+ const t2 = targetRef.current;
13915
+ if (leftHiddenRef.current > 0) {
13916
+ const inc = leftHiddenRef.current < catchUpIncrement ? 1 : catchUpIncrement;
13917
+ leftHiddenRef.current = Math.max(0, leftHiddenRef.current - inc);
13918
+ }
13919
+ if (rightHiddenRef.current > 0) {
13920
+ const inc = rightHiddenRef.current < catchUpIncrement ? 1 : catchUpIncrement;
13921
+ rightHiddenRef.current = Math.max(0, rightHiddenRef.current - inc);
13922
+ }
13923
+ const left = leftHiddenRef.current;
13924
+ const right = rightHiddenRef.current;
13925
+ setDisplayedItems(t2.slice(left, right > 0 ? t2.length - right : void 0));
13926
+ setIsCatchingUpForward(right > 0);
13927
+ setIsCatchingUpBackward(left > 0);
13928
+ rafRef.current = left > 0 || right > 0 ? requestAnimationFrame(step) : void 0;
13929
+ };
13930
+ rafRef.current = requestAnimationFrame(step);
13931
+ } else if (targetGrew) {
13932
+ rafRef.current = requestAnimationFrame(() => {
13933
+ rafRef.current = void 0;
13934
+ setDisplayedItems(targetRef.current);
13935
+ });
13936
+ }
13937
+ }, [items, getId, catchUpIncrement]);
13938
+ useEffect14(() => {
13939
+ return () => {
13940
+ if (rafRef.current !== void 0) {
13941
+ cancelAnimationFrame(rafRef.current);
13942
+ rafRef.current = void 0;
13943
+ }
13944
+ };
13945
+ }, []);
13946
+ return { isCatchingUpBackward, isCatchingUpForward, items: displayedItems };
13947
+ }
13948
+
13858
13949
  // src/hooks/use-spans.ts
13859
13950
  var PAGE_SIZE = 30;
13860
13951
  var useSpans = () => {
13861
13952
  const api = useAppInspectorApi();
13862
- const [spans, setSpans] = useState7();
13863
- const [fetchError, setFetchError] = useState7();
13864
- const [fetchingForward, setFetchingForward] = useState7(false);
13865
- const [fetchingBackward, setFetchingBackward] = useState7(false);
13866
- const paginationBuffer = useRef10(createPaginationBuffer({
13953
+ const [spans, setSpans] = useState8();
13954
+ const throttledSpans = useThrottledItems(spans, (span) => span.span_id);
13955
+ const [fetchError, setFetchError] = useState8();
13956
+ const [fetchingForward, setFetchingForward] = useState8(false);
13957
+ const [fetchingBackward, setFetchingBackward] = useState8(false);
13958
+ const paginationBufferRef = useRef11(createPaginationBuffer({
13867
13959
  async fetchPage(token) {
13868
13960
  const response = await api.getSpans({
13869
13961
  limit: PAGE_SIZE,
@@ -13897,19 +13989,19 @@ var useSpans = () => {
13897
13989
  return a3.start_time_unix_nano < b3.start_time_unix_nano ? -1 : 1;
13898
13990
  }
13899
13991
  }));
13900
- const [hasMoreBackward, setHasMoreBackward] = useState7();
13901
- const [hasMoreForward, setHasMoreForward] = useState7();
13992
+ const [hasMoreBackward, setHasMoreBackward] = useState8();
13993
+ const [hasMoreForward, setHasMoreForward] = useState8();
13902
13994
  const fetchForward = useCallback7(() => {
13903
- paginationBuffer.current.fetchForward();
13995
+ void paginationBufferRef.current.fetchForward();
13904
13996
  }, []);
13905
13997
  const fetchBackward = useCallback7(() => {
13906
- paginationBuffer.current.fetchBackward();
13998
+ void paginationBufferRef.current.fetchBackward();
13907
13999
  }, []);
13908
- useEffect14(() => {
14000
+ useEffect15(() => {
13909
14001
  fetchForward();
13910
14002
  }, [fetchForward]);
13911
14003
  const { checkStatus, error: statusError, status } = useStatus();
13912
- const [clearingSpans, setClearingSpans] = useState7(false);
14004
+ const [clearingSpans, setClearingSpans] = useState8(false);
13913
14005
  const clearSpans = useCallback7(async () => {
13914
14006
  if (clearingSpans) {
13915
14007
  return;
@@ -13917,7 +14009,8 @@ var useSpans = () => {
13917
14009
  setClearingSpans(true);
13918
14010
  try {
13919
14011
  await api.deleteSpans();
13920
- paginationBuffer.current.clear();
14012
+ paginationBufferRef.current.clear();
14013
+ await paginationBufferRef.current.fetchForward();
13921
14014
  } catch (error) {
13922
14015
  console.error("Failed to delete spans:", error);
13923
14016
  setFetchError(error instanceof Error ? error : new Error("Failed to delete spans", { cause: error }));
@@ -13925,17 +14018,25 @@ var useSpans = () => {
13925
14018
  setClearingSpans(false);
13926
14019
  }
13927
14020
  }, [clearingSpans, api]);
13928
- const [streamPaused, setStreamPaused] = useState7(false);
14021
+ const [streamPaused, setStreamPaused] = useState8(false);
13929
14022
  const toggleStream = useCallback7(() => {
13930
14023
  setStreamPaused((previous) => !previous);
13931
14024
  }, []);
14025
+ useEffect15(() => {
14026
+ if (hasMoreForward === true && !fetchingForward && !streamPaused) {
14027
+ void paginationBufferRef.current.fetchForward();
14028
+ }
14029
+ }, [hasMoreForward, fetchingForward, streamPaused]);
13932
14030
  useSpansWebSocket({
13933
14031
  onMessage: () => {
14032
+ if (clearingSpans) {
14033
+ return;
14034
+ }
13934
14035
  if (!hasMoreForward) {
13935
14036
  if (streamPaused) {
13936
- paginationBuffer.current.checkIfThereAreMoreItemsForward();
14037
+ paginationBufferRef.current.checkIfThereAreMoreItemsForward();
13937
14038
  } else {
13938
- paginationBuffer.current.fetchForward();
14039
+ void paginationBufferRef.current.fetchForward();
13939
14040
  }
13940
14041
  }
13941
14042
  }
@@ -13951,7 +14052,7 @@ var useSpans = () => {
13951
14052
  fetchingForward,
13952
14053
  hasMoreBackward,
13953
14054
  hasMoreForward,
13954
- spans,
14055
+ spans: throttledSpans.items,
13955
14056
  status,
13956
14057
  statusError,
13957
14058
  streamPaused,
@@ -13964,7 +14065,7 @@ import { ArrowBack } from "@mui/icons-material";
13964
14065
  import { Box as Box17, Button as Button5, Drawer, Paper as Paper3 } from "@mui/material";
13965
14066
  import { styled } from "@mui/material/styles";
13966
14067
  import { ReactFlowProvider } from "@xyflow/react";
13967
- import { useCallback as useCallback9, useEffect as useEffect19, useRef as useRef14, useState as useState14 } from "react";
14068
+ import { useCallback as useCallback9, useEffect as useEffect20, useRef as useRef15, useState as useState15 } from "react";
13968
14069
 
13969
14070
  // src/components/event-details/event-details.tsx
13970
14071
  import { Close as Close2 } from "@mui/icons-material";
@@ -13974,7 +14075,7 @@ import { Box as Box13, Chip as Chip3, Divider as Divider2, FormControlLabel as F
13974
14075
  var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
13975
14076
  import { jsx as jsx129, jsxs as jsxs123, Fragment as Fragment5 } from "react/jsx-runtime";
13976
14077
  import { Box as Box6, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper as Paper2 } from "@mui/material";
13977
- import { createContext as createContext9, useContext as useContext16, useState as useState8, useRef as useRef11, useCallback as useCallback8, useMemo as useMemo7, useEffect as useEffect15, memo as memo9 } from "react";
14078
+ import { createContext as createContext9, useContext as useContext16, useState as useState9, useRef as useRef12, useCallback as useCallback8, useMemo as useMemo7, useEffect as useEffect16, memo as memo9 } from "react";
13978
14079
  import { create, useStore, createStore } from "zustand";
13979
14080
  function r(e2) {
13980
14081
  var t2, f2, n2 = "";
@@ -14218,8 +14319,8 @@ async function copyString(value) {
14218
14319
  }
14219
14320
  function useClipboard() {
14220
14321
  let { timeout = 2e3 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
14221
- const [copied, setCopied] = useState8(false);
14222
- const copyTimeout = useRef11(null);
14322
+ const [copied, setCopied] = useState9(false);
14323
+ const copyTimeout = useRef12(null);
14223
14324
  const handleCopyResult = useCallback8((value) => {
14224
14325
  const current = copyTimeout.current;
14225
14326
  if (current) {
@@ -14279,7 +14380,7 @@ function useInspect(path, value, nestedIndex) {
14279
14380
  const setInspectCache = useJsonViewerStore((store) => store.setInspectCache);
14280
14381
  const defaultInspectDepth = useJsonViewerStore((store) => store.defaultInspectDepth);
14281
14382
  const defaultInspectControl = useJsonViewerStore((store) => store.defaultInspectControl);
14282
- useEffect15(() => {
14383
+ useEffect16(() => {
14283
14384
  const inspect2 = getInspectCache(path, nestedIndex);
14284
14385
  if (inspect2 !== void 0) {
14285
14386
  return;
@@ -14301,7 +14402,7 @@ function useInspect(path, value, nestedIndex) {
14301
14402
  value,
14302
14403
  setInspectCache
14303
14404
  ]);
14304
- const [inspect, set] = useState8(() => {
14405
+ const [inspect, set] = useState9(() => {
14305
14406
  const shouldInspect = getInspectCache(path, nestedIndex);
14306
14407
  if (shouldInspect !== void 0) {
14307
14408
  return shouldInspect;
@@ -14832,7 +14933,7 @@ var ObjectType = (props) => {
14832
14933
  const borderColor = useJsonViewerStore((store) => store.colorspace.base02);
14833
14934
  const groupArraysAfterLength = useJsonViewerStore((store) => store.groupArraysAfterLength);
14834
14935
  const isTrap = useIsCycleReference(props.path, props.value);
14835
- const [displayLength, setDisplayLength] = useState8(useJsonViewerStore((store) => store.maxDisplayLength));
14936
+ const [displayLength, setDisplayLength] = useState9(useJsonViewerStore((store) => store.maxDisplayLength));
14836
14937
  const objectSortKeys = useJsonViewerStore((store) => store.objectSortKeys);
14837
14938
  const elements = useMemo7(() => {
14838
14939
  if (!props.inspect) {
@@ -15038,7 +15139,7 @@ var stringType = defineEasyType({
15038
15139
  serialize: (value) => value,
15039
15140
  deserialize: (value) => value,
15040
15141
  Renderer: (props) => {
15041
- const [showRest, setShowRest] = useState8(false);
15142
+ const [showRest, setShowRest] = useState9(false);
15042
15143
  const collapseStringsAfterLength = useJsonViewerStore((store) => store.collapseStringsAfterLength);
15043
15144
  const value = showRest ? props.value : props.value.slice(0, collapseStringsAfterLength);
15044
15145
  const hasRest = props.value.length > collapseStringsAfterLength;
@@ -15192,7 +15293,7 @@ var DataKeyPair = (props) => {
15192
15293
  storeEditable,
15193
15294
  value
15194
15295
  ]);
15195
- const [tempValue, setTempValue] = useState8("");
15296
+ const [tempValue, setTempValue] = useState9("");
15196
15297
  const depth = path.length;
15197
15298
  const key = path[depth - 1];
15198
15299
  const hoverPath = useJsonViewerStore((store) => store.hoverPath);
@@ -15206,7 +15307,7 @@ var DataKeyPair = (props) => {
15206
15307
  const setHover = useJsonViewerStore((store) => store.setHover);
15207
15308
  const root = useJsonViewerStore((store) => store.value);
15208
15309
  const [inspect, setInspect] = useInspect(path, value, nestedIndex);
15209
- const [editing, setEditing] = useState8(false);
15310
+ const [editing, setEditing] = useState9(false);
15210
15311
  const onChange = useJsonViewerStore((store) => store.onChange);
15211
15312
  const keyColor = useTextColor();
15212
15313
  const numberKeyColor = useJsonViewerStore((store) => store.colorspace.base0C);
@@ -15294,8 +15395,8 @@ var DataKeyPair = (props) => {
15294
15395
  prevValue,
15295
15396
  value
15296
15397
  ]);
15297
- const highlightContainer = useRef11();
15298
- useEffect15(() => {
15398
+ const highlightContainer = useRef12();
15399
+ useEffect16(() => {
15299
15400
  if (highlightContainer.current && isHighlight && "animate" in highlightContainer.current) {
15300
15401
  highlightContainer.current.animate([
15301
15402
  {
@@ -15591,8 +15692,8 @@ var DataKeyPair = (props) => {
15591
15692
  };
15592
15693
  var query = "(prefers-color-scheme: dark)";
15593
15694
  function useThemeDetector() {
15594
- const [isDark, setIsDark] = useState8(false);
15595
- useEffect15(() => {
15695
+ const [isDark, setIsDark] = useState9(false);
15696
+ useEffect16(() => {
15596
15697
  const listener = (e2) => setIsDark(e2.matches);
15597
15698
  setIsDark(window.matchMedia(query).matches);
15598
15699
  const queryMedia = window.matchMedia(query);
@@ -15603,7 +15704,7 @@ function useThemeDetector() {
15603
15704
  }
15604
15705
  function useSetIfNotUndefinedEffect(key, value) {
15605
15706
  const { setState } = useContext16(JsonViewerStoreContext);
15606
- useEffect15(() => {
15707
+ useEffect16(() => {
15607
15708
  if (value !== void 0) {
15608
15709
  setState({
15609
15710
  [key]: value
@@ -15617,7 +15718,7 @@ function useSetIfNotUndefinedEffect(key, value) {
15617
15718
  }
15618
15719
  var JsonViewerInner = (props) => {
15619
15720
  const { setState } = useContext16(JsonViewerStoreContext);
15620
- useEffect15(() => {
15721
+ useEffect16(() => {
15621
15722
  setState((state) => ({
15622
15723
  prevValue: state.value,
15623
15724
  value: props.value
@@ -15645,7 +15746,7 @@ var JsonViewerInner = (props) => {
15645
15746
  useSetIfNotUndefinedEffect("displaySize", props.displaySize);
15646
15747
  useSetIfNotUndefinedEffect("displayComma", props.displayComma);
15647
15748
  useSetIfNotUndefinedEffect("highlightUpdates", props.highlightUpdates);
15648
- useEffect15(() => {
15749
+ useEffect16(() => {
15649
15750
  if (props.theme === "light") {
15650
15751
  setState({
15651
15752
  colorspace: lightColorspace
@@ -15669,7 +15770,7 @@ var JsonViewerInner = (props) => {
15669
15770
  }, [
15670
15771
  props.theme
15671
15772
  ]);
15672
- const onceRef = useRef11(true);
15773
+ const onceRef = useRef12(true);
15673
15774
  const registerTypes = useTypeRegistryStore((store) => store.registerTypes);
15674
15775
  if (onceRef.current) {
15675
15776
  const allTypes = props.valueTypes ? [
@@ -15681,7 +15782,7 @@ var JsonViewerInner = (props) => {
15681
15782
  registerTypes(allTypes);
15682
15783
  onceRef.current = false;
15683
15784
  }
15684
- useEffect15(() => {
15785
+ useEffect16(() => {
15685
15786
  const allTypes = props.valueTypes ? [
15686
15787
  ...predefinedTypes,
15687
15788
  ...props.valueTypes
@@ -15778,7 +15879,7 @@ var JsonViewer = function JsonViewer2(props) {
15778
15879
  };
15779
15880
 
15780
15881
  // src/components/event-details/event-details.tsx
15781
- import { memo as memo10, useMemo as useMemo11, useState as useState13 } from "react";
15882
+ import { memo as memo10, useMemo as useMemo11, useState as useState14 } from "react";
15782
15883
 
15783
15884
  // src/utils/iam-utils.ts
15784
15885
  function determinePermissionStatus(payload) {
@@ -15977,7 +16078,7 @@ var getEventGroupsByType = (events) => {
15977
16078
  // src/components/event-details/event-detail.tsx
15978
16079
  import { KeyboardArrowDown as KeyboardArrowDown2, KeyboardArrowRight as KeyboardArrowRight2 } from "@mui/icons-material";
15979
16080
  import { Box as Box10, Grid as Grid3, IconButton as IconButton2, Typography as Typography6 } from "@mui/material";
15980
- import { useEffect as useEffect16, useMemo as useMemo9, useRef as useRef12, useState as useState10 } from "react";
16081
+ import { useEffect as useEffect17, useMemo as useMemo9, useRef as useRef13, useState as useState11 } from "react";
15981
16082
 
15982
16083
  // src/components/status-icon.tsx
15983
16084
  import { Cancel, CheckCircle, Error as Error2, Info, RemoveCircle } from "@mui/icons-material";
@@ -16128,7 +16229,7 @@ var IAMEventDetail = ({ event }) => {
16128
16229
  // src/components/event-details/iam-permission-detail.tsx
16129
16230
  import { KeyboardArrowDown, KeyboardArrowRight } from "@mui/icons-material";
16130
16231
  import { Box as Box9, Chip as Chip2, IconButton, Typography as Typography5 } from "@mui/material";
16131
- import { useMemo as useMemo8, useState as useState9 } from "react";
16232
+ import { useMemo as useMemo8, useState as useState10 } from "react";
16132
16233
  import { jsx as jsx132, jsxs as jsxs125 } from "react/jsx-runtime";
16133
16234
  var getChipColors = (status) => {
16134
16235
  const isAllowed = status === "explicitly_allowed" || status === "implicitly_allowed";
@@ -16138,7 +16239,7 @@ var getChipColors = (status) => {
16138
16239
  };
16139
16240
  };
16140
16241
  var IAMPermissionItem = ({ event }) => {
16141
- const [isOpen, setIsOpen] = useState9(false);
16242
+ const [isOpen, setIsOpen] = useState10(false);
16142
16243
  const parsedData = useMemo8(() => {
16143
16244
  const payloadString = event.attributes?.payload;
16144
16245
  if (!payloadString) {
@@ -16209,15 +16310,15 @@ var DetailRow2 = ({ content, label }) => /* @__PURE__ */ jsxs126(Grid3, { contai
16209
16310
  ) : content })
16210
16311
  ] });
16211
16312
  var EventMessage = ({ event }) => {
16212
- const [isOpen, setIsOpen] = useState10(false);
16213
- const [isOverflowing, setIsOverflowing] = useState10(false);
16214
- const textReference = useRef12(null);
16313
+ const [isOpen, setIsOpen] = useState11(false);
16314
+ const [isOverflowing, setIsOverflowing] = useState11(false);
16315
+ const textReference = useRef13(null);
16215
16316
  const parsedMessage = useMemo9(() => parseEventMessage(event), [event]);
16216
16317
  const isIAMPolicyEvent = useMemo9(
16217
16318
  () => event.event_type === "iam.policy_evaluation" && event.attributes?.payload && typeof event.attributes.payload === "string",
16218
16319
  [event]
16219
16320
  );
16220
- useEffect16(() => {
16321
+ useEffect17(() => {
16221
16322
  const checkOverflow = () => {
16222
16323
  const element = textReference.current;
16223
16324
  if (element) {
@@ -26061,7 +26162,7 @@ var QueryStatus = {
26061
26162
 
26062
26163
  // src/components/event-details/lambda-invoke-logs-section.tsx
26063
26164
  import { Box as Box11, CircularProgress as CircularProgress2, Stack, Typography as Typography7 } from "@mui/material";
26064
- import { useEffect as useEffect17, useMemo as useMemo10, useRef as useRef13, useState as useState11 } from "react";
26165
+ import { useEffect as useEffect18, useMemo as useMemo10, useRef as useRef14, useState as useState12 } from "react";
26065
26166
  import { jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
26066
26167
  var POLL_INTERVAL_MS = 1e3;
26067
26168
  async function pollQueryResults(client, queryId) {
@@ -26090,12 +26191,12 @@ function useCloudWatchLogsClient(region) {
26090
26191
  return client;
26091
26192
  }
26092
26193
  function useLambdaInvokeLogs(functionName2, requestId, region, startTimeNano, endTimeNano) {
26093
- const [loading, setLoading] = useState11(true);
26094
- const [logs, setLogs] = useState11([]);
26095
- const [error, setError] = useState11();
26096
- const pollTimerRef = useRef13(null);
26194
+ const [loading, setLoading] = useState12(true);
26195
+ const [logs, setLogs] = useState12([]);
26196
+ const [error, setError] = useState12();
26197
+ const pollTimerRef = useRef14(null);
26097
26198
  const cloudWatchLogs = useCloudWatchLogsClient(region);
26098
- useEffect17(() => {
26199
+ useEffect18(() => {
26099
26200
  let cancelled = false;
26100
26201
  const startTimeSec = Math.floor(Number(BigInt(startTimeNano) / BigInt(1e9)));
26101
26202
  const endTimeSec = Math.ceil(Number(BigInt(endTimeNano) / BigInt(1e9)));
@@ -26169,10 +26270,10 @@ var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, regio
26169
26270
  // src/components/event-details/toggle-section.tsx
26170
26271
  import { KeyboardArrowDown as KeyboardArrowDown3, KeyboardArrowRight as KeyboardArrowRight3 } from "@mui/icons-material";
26171
26272
  import { Box as Box12, Typography as Typography8 } from "@mui/material";
26172
- import { useState as useState12 } from "react";
26273
+ import { useState as useState13 } from "react";
26173
26274
  import { jsx as jsx135, jsxs as jsxs128 } from "react/jsx-runtime";
26174
26275
  var ToggleSection = ({ action, children, headline, initialOpen = true }) => {
26175
- const [isOpen, setIsOpen] = useState12(initialOpen);
26276
+ const [isOpen, setIsOpen] = useState13(initialOpen);
26176
26277
  return /* @__PURE__ */ jsxs128(Box12, { sx: { mt: 4 }, children: [
26177
26278
  /* @__PURE__ */ jsxs128(
26178
26279
  Box12,
@@ -26243,7 +26344,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
26243
26344
  () => getEventGroupsByType(selectedEvent?.events ?? []),
26244
26345
  [selectedEvent?.events]
26245
26346
  );
26246
- const [parseNestedJson, setParseNestedJson] = useState13(true);
26347
+ const [parseNestedJson, setParseNestedJson] = useState14(true);
26247
26348
  if (!selectedEvent) {
26248
26349
  return /* @__PURE__ */ jsx136(Box13, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ jsx136(Typography9, { color: "text.secondary", variant: "body2", children: "Select an event to view details" }) });
26249
26350
  }
@@ -26431,7 +26532,7 @@ var PayloadViewer = memo10(({ value }) => {
26431
26532
  import "@xyflow/react/dist/base.css";
26432
26533
  import { Alert as Alert3, Button as Button4, useTheme as useTheme4 } from "@mui/material";
26433
26534
  import { Background, MarkerType, Position as Position2, ReactFlow, useEdgesState, useNodesState } from "@xyflow/react";
26434
- import { useEffect as useEffect18 } from "react";
26535
+ import { useEffect as useEffect19 } from "react";
26435
26536
 
26436
26537
  // src/components/trace-graph/service-node.tsx
26437
26538
  import { Box as Box15, Stack as Stack3, Typography as Typography10 } from "@mui/material";
@@ -26694,7 +26795,7 @@ var TraceGraph = ({
26694
26795
  }) => {
26695
26796
  const [nodes, setNodes, onNodesChange] = useNodesState([]);
26696
26797
  const [edges, setEdges] = useEdgesState([]);
26697
- useEffect18(() => {
26798
+ useEffect19(() => {
26698
26799
  const allNodes = [];
26699
26800
  const allEdges = [];
26700
26801
  for (const span of spans.data ?? []) {
@@ -26946,9 +27047,9 @@ async function fetchConnectedTraces(api, traceIds, allSpans = /* @__PURE__ */ ne
26946
27047
  }
26947
27048
  var TraceGraphPage = ({ onClose, spanId, traceId }) => {
26948
27049
  const api = useAppInspectorApi();
26949
- const [spans, setSpans] = useState14();
26950
- const [loading, setLoading] = useState14(false);
26951
- const [fetchError, setFetchError] = useState14();
27050
+ const [spans, setSpans] = useState15();
27051
+ const [loading, setLoading] = useState15(false);
27052
+ const [fetchError, setFetchError] = useState15();
26952
27053
  const fetchSpans = useCallback9(async () => {
26953
27054
  setLoading(true);
26954
27055
  try {
@@ -26962,13 +27063,13 @@ var TraceGraphPage = ({ onClose, spanId, traceId }) => {
26962
27063
  setLoading(false);
26963
27064
  }
26964
27065
  }, [api, traceId]);
26965
- useEffect19(() => {
27066
+ useEffect20(() => {
26966
27067
  void fetchSpans();
26967
27068
  }, [fetchSpans]);
26968
- const [open, setOpen] = useState14(true);
26969
- const [selectedEvent, setSelectedEvent] = useState14(() => spans?.find((span) => span.span_id === spanId));
26970
- const spansReference = useRef14();
26971
- useEffect19(() => {
27069
+ const [open, setOpen] = useState15(true);
27070
+ const [selectedEvent, setSelectedEvent] = useState15(() => spans?.find((span) => span.span_id === spanId));
27071
+ const spansReference = useRef15();
27072
+ useEffect20(() => {
26972
27073
  if (!spansReference.current && spans) {
26973
27074
  setSelectedEvent(spans.find((span) => span.span_id === spanId));
26974
27075
  spansReference.current = spans;
@@ -27033,8 +27134,8 @@ var SpansListPage = () => {
27033
27134
  void clearSpans();
27034
27135
  }, [clearSpans]);
27035
27136
  const [order2, setOrder] = useLocalStorage("spans-order", "oldest_first");
27036
- const [selectedTraceId, setSelectedTraceId] = useState15();
27037
- const [selectedSpanId, setSelectedSpanId] = useState15();
27137
+ const [selectedTraceId, setSelectedTraceId] = useState16();
27138
+ const [selectedSpanId, setSelectedSpanId] = useState16();
27038
27139
  const navigateToSpan = useCallback10((span) => {
27039
27140
  setSelectedTraceId(span.trace_id);
27040
27141
  setSelectedSpanId(span.span_id);