@modelcontextprotocol/inspector 0.17.1 → 0.17.2

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.
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
1
  function _mergeNamespaces(n, m2) {
5
2
  for (var i = 0; i < m2.length; i++) {
6
3
  const e = m2[i];
@@ -22,36 +19,28 @@ function _mergeNamespaces(n, m2) {
22
19
  }
23
20
  (function polyfill() {
24
21
  const relList = document.createElement("link").relList;
25
- if (relList && relList.supports && relList.supports("modulepreload")) {
26
- return;
27
- }
28
- for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
29
- processPreload(link);
30
- }
22
+ if (relList && relList.supports && relList.supports("modulepreload")) return;
23
+ for (const link of document.querySelectorAll('link[rel="modulepreload"]')) processPreload(link);
31
24
  new MutationObserver((mutations) => {
32
25
  for (const mutation of mutations) {
33
- if (mutation.type !== "childList") {
34
- continue;
35
- }
36
- for (const node of mutation.addedNodes) {
37
- if (node.tagName === "LINK" && node.rel === "modulepreload")
38
- processPreload(node);
39
- }
26
+ if (mutation.type !== "childList") continue;
27
+ for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node);
40
28
  }
41
- }).observe(document, { childList: true, subtree: true });
29
+ }).observe(document, {
30
+ childList: true,
31
+ subtree: true
32
+ });
42
33
  function getFetchOpts(link) {
43
34
  const fetchOpts = {};
44
35
  if (link.integrity) fetchOpts.integrity = link.integrity;
45
36
  if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
46
- if (link.crossOrigin === "use-credentials")
47
- fetchOpts.credentials = "include";
37
+ if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include";
48
38
  else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
49
39
  else fetchOpts.credentials = "same-origin";
50
40
  return fetchOpts;
51
41
  }
52
42
  function processPreload(link) {
53
- if (link.ep)
54
- return;
43
+ if (link.ep) return;
55
44
  link.ep = true;
56
45
  const fetchOpts = getFetchOpts(link);
57
46
  fetch(link.href, fetchOpts);
@@ -7203,9 +7192,9 @@ var reactDomExports = requireReactDom();
7203
7192
  const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(reactDomExports);
7204
7193
  function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
7205
7194
  return function handleEvent(event) {
7206
- originalEventHandler == null ? void 0 : originalEventHandler(event);
7195
+ originalEventHandler?.(event);
7207
7196
  if (checkForDefaultPrevented === false || !event.defaultPrevented) {
7208
- return ourEventHandler == null ? void 0 : ourEventHandler(event);
7197
+ return ourEventHandler?.(event);
7209
7198
  }
7210
7199
  };
7211
7200
  }
@@ -7266,16 +7255,14 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
7266
7255
  const index2 = defaultContexts.length;
7267
7256
  defaultContexts = [...defaultContexts, defaultContext];
7268
7257
  const Provider2 = (props) => {
7269
- var _a;
7270
7258
  const { scope, children, ...context } = props;
7271
- const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
7259
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
7272
7260
  const value = reactExports.useMemo(() => context, Object.values(context));
7273
7261
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
7274
7262
  };
7275
7263
  Provider2.displayName = rootComponentName + "Provider";
7276
7264
  function useContext2(consumerName, scope) {
7277
- var _a;
7278
- const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
7265
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
7279
7266
  const context = reactExports.useContext(Context);
7280
7267
  if (context) return context;
7281
7268
  if (defaultContext !== void 0) return defaultContext;
@@ -7288,7 +7275,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
7288
7275
  return reactExports.createContext(defaultContext);
7289
7276
  });
7290
7277
  return function useScope(scope) {
7291
- const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
7278
+ const contexts = scope?.[scopeName] || scopeContexts;
7292
7279
  return reactExports.useMemo(
7293
7280
  () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
7294
7281
  [scope, contexts]
@@ -7398,13 +7385,12 @@ function mergeProps(slotProps, childProps) {
7398
7385
  return { ...slotProps, ...overrideProps };
7399
7386
  }
7400
7387
  function getElementRef$1(element) {
7401
- var _a, _b;
7402
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
7388
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
7403
7389
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7404
7390
  if (mayWarn) {
7405
7391
  return element.ref;
7406
7392
  }
7407
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
7393
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
7408
7394
  mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7409
7395
  if (mayWarn) {
7410
7396
  return element.props.ref;
@@ -7513,12 +7499,9 @@ function useCallbackRef$1(callback) {
7513
7499
  reactExports.useEffect(() => {
7514
7500
  callbackRef.current = callback;
7515
7501
  });
7516
- return reactExports.useMemo(() => (...args) => {
7517
- var _a;
7518
- return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
7519
- }, []);
7502
+ return reactExports.useMemo(() => (...args) => callbackRef.current?.(...args), []);
7520
7503
  }
7521
- function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
7504
+ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
7522
7505
  const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
7523
7506
  reactExports.useEffect(() => {
7524
7507
  const handleKeyDown = (event) => {
@@ -7553,7 +7536,7 @@ var DismissableLayer = reactExports.forwardRef(
7553
7536
  } = props;
7554
7537
  const context = reactExports.useContext(DismissableLayerContext);
7555
7538
  const [node, setNode] = reactExports.useState(null);
7556
- const ownerDocument = (node == null ? void 0 : node.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
7539
+ const ownerDocument = node?.ownerDocument ?? globalThis?.document;
7557
7540
  const [, force] = reactExports.useState({});
7558
7541
  const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
7559
7542
  const layers = Array.from(context.layers);
@@ -7566,22 +7549,22 @@ var DismissableLayer = reactExports.forwardRef(
7566
7549
  const target = event.target;
7567
7550
  const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
7568
7551
  if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
7569
- onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
7570
- onInteractOutside == null ? void 0 : onInteractOutside(event);
7571
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
7552
+ onPointerDownOutside?.(event);
7553
+ onInteractOutside?.(event);
7554
+ if (!event.defaultPrevented) onDismiss?.();
7572
7555
  }, ownerDocument);
7573
7556
  const focusOutside = useFocusOutside((event) => {
7574
7557
  const target = event.target;
7575
7558
  const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
7576
7559
  if (isFocusInBranch) return;
7577
- onFocusOutside == null ? void 0 : onFocusOutside(event);
7578
- onInteractOutside == null ? void 0 : onInteractOutside(event);
7579
- if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
7560
+ onFocusOutside?.(event);
7561
+ onInteractOutside?.(event);
7562
+ if (!event.defaultPrevented) onDismiss?.();
7580
7563
  }, ownerDocument);
7581
7564
  useEscapeKeydown((event) => {
7582
7565
  const isHighestLayer = index2 === context.layers.size - 1;
7583
7566
  if (!isHighestLayer) return;
7584
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
7567
+ onEscapeKeyDown?.(event);
7585
7568
  if (!event.defaultPrevented && onDismiss) {
7586
7569
  event.preventDefault();
7587
7570
  onDismiss();
@@ -7654,7 +7637,7 @@ var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => {
7654
7637
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs });
7655
7638
  });
7656
7639
  DismissableLayerBranch.displayName = BRANCH_NAME;
7657
- function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
7640
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
7658
7641
  const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
7659
7642
  const isPointerInsideReactTreeRef = reactExports.useRef(false);
7660
7643
  const handleClickRef = reactExports.useRef(() => {
@@ -7697,7 +7680,7 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis
7697
7680
  onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
7698
7681
  };
7699
7682
  }
7700
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
7683
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
7701
7684
  const handleFocusOutside = useCallbackRef$1(onFocusOutside);
7702
7685
  const isFocusInsideReactTreeRef = reactExports.useRef(false);
7703
7686
  reactExports.useEffect(() => {
@@ -7733,15 +7716,14 @@ function handleAndDispatchCustomEvent$1(name2, handler, detail, { discrete }) {
7733
7716
  }
7734
7717
  var Root$6 = DismissableLayer;
7735
7718
  var Branch = DismissableLayerBranch;
7736
- var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? reactExports.useLayoutEffect : () => {
7719
+ var useLayoutEffect2 = globalThis?.document ? reactExports.useLayoutEffect : () => {
7737
7720
  };
7738
7721
  var PORTAL_NAME$4 = "Portal";
7739
7722
  var Portal$3 = reactExports.forwardRef((props, forwardedRef) => {
7740
- var _a;
7741
7723
  const { container: containerProp, ...portalProps } = props;
7742
7724
  const [mounted, setMounted] = reactExports.useState(false);
7743
7725
  useLayoutEffect2(() => setMounted(true), []);
7744
- const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
7726
+ const container = containerProp || mounted && globalThis?.document?.body;
7745
7727
  return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
7746
7728
  });
7747
7729
  Portal$3.displayName = PORTAL_NAME$4;
@@ -7792,7 +7774,7 @@ function usePresence(present) {
7792
7774
  const currentAnimationName = getAnimationName(styles);
7793
7775
  if (present) {
7794
7776
  send("MOUNT");
7795
- } else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
7777
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
7796
7778
  send("UNMOUNT");
7797
7779
  } else {
7798
7780
  const isAnimating = prevAnimationName !== currentAnimationName;
@@ -7852,16 +7834,15 @@ function usePresence(present) {
7852
7834
  };
7853
7835
  }
7854
7836
  function getAnimationName(styles) {
7855
- return (styles == null ? void 0 : styles.animationName) || "none";
7837
+ return styles?.animationName || "none";
7856
7838
  }
7857
7839
  function getElementRef(element) {
7858
- var _a, _b;
7859
- let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
7840
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
7860
7841
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7861
7842
  if (mayWarn) {
7862
7843
  return element.ref;
7863
7844
  }
7864
- getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
7845
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
7865
7846
  mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
7866
7847
  if (mayWarn) {
7867
7848
  return element.props.ref;
@@ -7898,11 +7879,10 @@ function useControllableState({
7898
7879
  }
7899
7880
  const setValue = reactExports.useCallback(
7900
7881
  (nextValue) => {
7901
- var _a;
7902
7882
  if (isControlled) {
7903
7883
  const value2 = isFunction$1(nextValue) ? nextValue(prop) : nextValue;
7904
7884
  if (value2 !== prop) {
7905
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
7885
+ onChangeRef.current?.(value2);
7906
7886
  }
7907
7887
  } else {
7908
7888
  setUncontrolledProp(nextValue);
@@ -7923,9 +7903,8 @@ function useUncontrolledState({
7923
7903
  onChangeRef.current = onChange;
7924
7904
  }, [onChange]);
7925
7905
  reactExports.useEffect(() => {
7926
- var _a;
7927
7906
  if (prevValueRef.current !== value) {
7928
- (_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
7907
+ onChangeRef.current?.(value);
7929
7908
  prevValueRef.current = value;
7930
7909
  }
7931
7910
  }, [value, prevValueRef]);
@@ -8027,9 +8006,8 @@ var ToastViewport$1 = reactExports.forwardRef(
8027
8006
  const hasToasts = context.toastCount > 0;
8028
8007
  reactExports.useEffect(() => {
8029
8008
  const handleKeyDown = (event) => {
8030
- var _a;
8031
8009
  const isHotkeyPressed = hotkey.length !== 0 && hotkey.every((key) => event[key] || event.code === key);
8032
- if (isHotkeyPressed) (_a = ref2.current) == null ? void 0 : _a.focus();
8010
+ if (isHotkeyPressed) ref2.current?.focus();
8033
8011
  };
8034
8012
  document.addEventListener("keydown", handleKeyDown);
8035
8013
  return () => document.removeEventListener("keydown", handleKeyDown);
@@ -8092,7 +8070,6 @@ var ToastViewport$1 = reactExports.forwardRef(
8092
8070
  const viewport = ref2.current;
8093
8071
  if (viewport) {
8094
8072
  const handleKeyDown = (event) => {
8095
- var _a, _b, _c;
8096
8073
  const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
8097
8074
  const isTabKey = event.key === "Tab" && !isMetaKey;
8098
8075
  if (isTabKey) {
@@ -8100,7 +8077,7 @@ var ToastViewport$1 = reactExports.forwardRef(
8100
8077
  const isTabbingBackwards = event.shiftKey;
8101
8078
  const targetIsViewport = event.target === viewport;
8102
8079
  if (targetIsViewport && isTabbingBackwards) {
8103
- (_a = headFocusProxyRef.current) == null ? void 0 : _a.focus();
8080
+ headFocusProxyRef.current?.focus();
8104
8081
  return;
8105
8082
  }
8106
8083
  const tabbingDirection = isTabbingBackwards ? "backwards" : "forwards";
@@ -8109,7 +8086,7 @@ var ToastViewport$1 = reactExports.forwardRef(
8109
8086
  if (focusFirst$2(sortedCandidates.slice(index2 + 1))) {
8110
8087
  event.preventDefault();
8111
8088
  } else {
8112
- isTabbingBackwards ? (_b = headFocusProxyRef.current) == null ? void 0 : _b.focus() : (_c = tailFocusProxyRef.current) == null ? void 0 : _c.focus();
8089
+ isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();
8113
8090
  }
8114
8091
  }
8115
8092
  };
@@ -8170,9 +8147,8 @@ var FocusProxy = reactExports.forwardRef(
8170
8147
  ref: forwardedRef,
8171
8148
  style: { position: "fixed" },
8172
8149
  onFocus: (event) => {
8173
- var _a;
8174
8150
  const prevFocusedElement = event.relatedTarget;
8175
- const isFocusFromOutsideViewport = !((_a = context.viewport) == null ? void 0 : _a.contains(prevFocusedElement));
8151
+ const isFocusFromOutsideViewport = !context.viewport?.contains(prevFocusedElement);
8176
8152
  if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();
8177
8153
  }
8178
8154
  }
@@ -8265,9 +8241,8 @@ var ToastImpl = reactExports.forwardRef(
8265
8241
  const closeTimerRef = reactExports.useRef(0);
8266
8242
  const { onToastAdd, onToastRemove } = context;
8267
8243
  const handleClose = useCallbackRef$1(() => {
8268
- var _a;
8269
- const isFocusInToast = node == null ? void 0 : node.contains(document.activeElement);
8270
- if (isFocusInToast) (_a = context.viewport) == null ? void 0 : _a.focus();
8244
+ const isFocusInToast = node?.contains(document.activeElement);
8245
+ if (isFocusInToast) context.viewport?.focus();
8271
8246
  onClose();
8272
8247
  });
8273
8248
  const startTimer = reactExports.useCallback(
@@ -8284,13 +8259,13 @@ var ToastImpl = reactExports.forwardRef(
8284
8259
  if (viewport) {
8285
8260
  const handleResume = () => {
8286
8261
  startTimer(closeTimerRemainingTimeRef.current);
8287
- onResume == null ? void 0 : onResume();
8262
+ onResume?.();
8288
8263
  };
8289
8264
  const handlePause = () => {
8290
8265
  const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
8291
8266
  closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;
8292
8267
  window.clearTimeout(closeTimerRef.current);
8293
- onPause == null ? void 0 : onPause();
8268
+ onPause?.();
8294
8269
  };
8295
8270
  viewport.addEventListener(VIEWPORT_PAUSE, handlePause);
8296
8271
  viewport.addEventListener(VIEWPORT_RESUME, handleResume);
@@ -8341,7 +8316,7 @@ var ToastImpl = reactExports.forwardRef(
8341
8316
  style: { userSelect: "none", touchAction: "none", ...props.style },
8342
8317
  onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
8343
8318
  if (event.key !== "Escape") return;
8344
- onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event.nativeEvent);
8319
+ onEscapeKeyDown?.(event.nativeEvent);
8345
8320
  if (!event.nativeEvent.defaultPrevented) {
8346
8321
  context.isFocusedToastEscapeKeyDownRef.current = true;
8347
8322
  handleClose();
@@ -8655,7 +8630,6 @@ const createClassGroupUtils = (config) => {
8655
8630
  };
8656
8631
  };
8657
8632
  const getGroupRecursive = (classParts, classPartObject) => {
8658
- var _a;
8659
8633
  if (classParts.length === 0) {
8660
8634
  return classPartObject.classGroupId;
8661
8635
  }
@@ -8669,15 +8643,15 @@ const getGroupRecursive = (classParts, classPartObject) => {
8669
8643
  return void 0;
8670
8644
  }
8671
8645
  const classRest = classParts.join(CLASS_PART_SEPARATOR);
8672
- return (_a = classPartObject.validators.find(({
8646
+ return classPartObject.validators.find(({
8673
8647
  validator
8674
- }) => validator(classRest))) == null ? void 0 : _a.classGroupId;
8648
+ }) => validator(classRest))?.classGroupId;
8675
8649
  };
8676
8650
  const arbitraryPropertyRegex = /^\[(.+)\]$/;
8677
8651
  const getGroupIdForArbitraryProperty = (className) => {
8678
8652
  if (arbitraryPropertyRegex.test(className)) {
8679
8653
  const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
8680
- const property = arbitraryPropertyClassName == null ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(":"));
8654
+ const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
8681
8655
  if (property) {
8682
8656
  return "arbitrary.." + property;
8683
8657
  }
@@ -11316,63 +11290,43 @@ const seen = {};
11316
11290
  const __vitePreload = function preload(baseModule, deps, importerUrl) {
11317
11291
  let promise = Promise.resolve();
11318
11292
  if (deps && deps.length > 0) {
11319
- let allSettled2 = function(promises) {
11320
- return Promise.all(
11321
- promises.map(
11322
- (p2) => Promise.resolve(p2).then(
11323
- (value) => ({ status: "fulfilled", value }),
11324
- (reason) => ({ status: "rejected", reason })
11325
- )
11326
- )
11327
- );
11293
+ let allSettled = function(promises$2) {
11294
+ return Promise.all(promises$2.map((p2) => Promise.resolve(p2).then((value$1) => ({
11295
+ status: "fulfilled",
11296
+ value: value$1
11297
+ }), (reason) => ({
11298
+ status: "rejected",
11299
+ reason
11300
+ }))));
11328
11301
  };
11329
11302
  document.getElementsByTagName("link");
11330
- const cspNonceMeta = document.querySelector(
11331
- "meta[property=csp-nonce]"
11332
- );
11333
- const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
11334
- promise = allSettled2(
11335
- deps.map((dep) => {
11336
- dep = assetsURL(dep);
11337
- if (dep in seen) return;
11338
- seen[dep] = true;
11339
- const isCss = dep.endsWith(".css");
11340
- const cssSelector = isCss ? '[rel="stylesheet"]' : "";
11341
- if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
11342
- return;
11343
- }
11344
- const link = document.createElement("link");
11345
- link.rel = isCss ? "stylesheet" : scriptRel;
11346
- if (!isCss) {
11347
- link.as = "script";
11348
- }
11349
- link.crossOrigin = "";
11350
- link.href = dep;
11351
- if (cspNonce) {
11352
- link.setAttribute("nonce", cspNonce);
11353
- }
11354
- document.head.appendChild(link);
11355
- if (isCss) {
11356
- return new Promise((res, rej) => {
11357
- link.addEventListener("load", res);
11358
- link.addEventListener(
11359
- "error",
11360
- () => rej(new Error(`Unable to preload CSS for ${dep}`))
11361
- );
11362
- });
11363
- }
11364
- })
11365
- );
11303
+ const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
11304
+ const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
11305
+ promise = allSettled(deps.map((dep) => {
11306
+ dep = assetsURL(dep);
11307
+ if (dep in seen) return;
11308
+ seen[dep] = true;
11309
+ const isCss = dep.endsWith(".css");
11310
+ const cssSelector = isCss ? '[rel="stylesheet"]' : "";
11311
+ if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
11312
+ const link = document.createElement("link");
11313
+ link.rel = isCss ? "stylesheet" : scriptRel;
11314
+ if (!isCss) link.as = "script";
11315
+ link.crossOrigin = "";
11316
+ link.href = dep;
11317
+ if (cspNonce) link.setAttribute("nonce", cspNonce);
11318
+ document.head.appendChild(link);
11319
+ if (isCss) return new Promise((res, rej) => {
11320
+ link.addEventListener("load", res);
11321
+ link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
11322
+ });
11323
+ }));
11366
11324
  }
11367
- function handlePreloadError(err) {
11368
- const e = new Event("vite:preloadError", {
11369
- cancelable: true
11370
- });
11371
- e.payload = err;
11372
- window.dispatchEvent(e);
11373
- if (!e.defaultPrevented) {
11374
- throw err;
11375
- }
11325
+ function handlePreloadError(err$2) {
11326
+ const e$1 = new Event("vite:preloadError", { cancelable: true });
11327
+ e$1.payload = err$2;
11328
+ window.dispatchEvent(e$1);
11329
+ if (!e$1.defaultPrevented) throw err$2;
11376
11330
  }
11377
11331
  return promise.then((res) => {
11378
11332
  for (const item of res || []) {
@@ -11840,7 +11794,7 @@ const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
11840
11794
  var errorUtil;
11841
11795
  (function(errorUtil2) {
11842
11796
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
11843
- errorUtil2.toString = (message) => typeof message === "string" ? message : message == null ? void 0 : message.message;
11797
+ errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
11844
11798
  })(errorUtil || (errorUtil = {}));
11845
11799
  class ParseInputLazyPath {
11846
11800
  constructor(parent, value, path, key) {
@@ -11954,10 +11908,10 @@ class ZodType {
11954
11908
  const ctx = {
11955
11909
  common: {
11956
11910
  issues: [],
11957
- async: (params == null ? void 0 : params.async) ?? false,
11958
- contextualErrorMap: params == null ? void 0 : params.errorMap
11911
+ async: params?.async ?? false,
11912
+ contextualErrorMap: params?.errorMap
11959
11913
  },
11960
- path: (params == null ? void 0 : params.path) || [],
11914
+ path: params?.path || [],
11961
11915
  schemaErrorMap: this._def.errorMap,
11962
11916
  parent: null,
11963
11917
  data: data2,
@@ -11967,7 +11921,6 @@ class ZodType {
11967
11921
  return handleResult(ctx, result);
11968
11922
  }
11969
11923
  "~validate"(data2) {
11970
- var _a, _b;
11971
11924
  const ctx = {
11972
11925
  common: {
11973
11926
  issues: [],
@@ -11988,7 +11941,7 @@ class ZodType {
11988
11941
  issues: ctx.common.issues
11989
11942
  };
11990
11943
  } catch (err) {
11991
- if ((_b = (_a = err == null ? void 0 : err.message) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("encountered")) {
11944
+ if (err?.message?.toLowerCase()?.includes("encountered")) {
11992
11945
  this["~standard"].async = true;
11993
11946
  }
11994
11947
  ctx.common = {
@@ -12013,10 +11966,10 @@ class ZodType {
12013
11966
  const ctx = {
12014
11967
  common: {
12015
11968
  issues: [],
12016
- contextualErrorMap: params == null ? void 0 : params.errorMap,
11969
+ contextualErrorMap: params?.errorMap,
12017
11970
  async: true
12018
11971
  },
12019
- path: (params == null ? void 0 : params.path) || [],
11972
+ path: params?.path || [],
12020
11973
  schemaErrorMap: this._def.errorMap,
12021
11974
  parent: null,
12022
11975
  data: data2,
@@ -12247,7 +12200,7 @@ function isValidJWT(jwt, alg) {
12247
12200
  const decoded = JSON.parse(atob(base64));
12248
12201
  if (typeof decoded !== "object" || decoded === null)
12249
12202
  return false;
12250
- if ("typ" in decoded && (decoded == null ? void 0 : decoded.typ) !== "JWT")
12203
+ if ("typ" in decoded && decoded?.typ !== "JWT")
12251
12204
  return false;
12252
12205
  if (!decoded.alg)
12253
12206
  return false;
@@ -12636,10 +12589,10 @@ class ZodString extends ZodType {
12636
12589
  }
12637
12590
  return this._addCheck({
12638
12591
  kind: "datetime",
12639
- precision: typeof (options == null ? void 0 : options.precision) === "undefined" ? null : options == null ? void 0 : options.precision,
12640
- offset: (options == null ? void 0 : options.offset) ?? false,
12641
- local: (options == null ? void 0 : options.local) ?? false,
12642
- ...errorUtil.errToObj(options == null ? void 0 : options.message)
12592
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
12593
+ offset: options?.offset ?? false,
12594
+ local: options?.local ?? false,
12595
+ ...errorUtil.errToObj(options?.message)
12643
12596
  });
12644
12597
  }
12645
12598
  date(message) {
@@ -12655,8 +12608,8 @@ class ZodString extends ZodType {
12655
12608
  }
12656
12609
  return this._addCheck({
12657
12610
  kind: "time",
12658
- precision: typeof (options == null ? void 0 : options.precision) === "undefined" ? null : options == null ? void 0 : options.precision,
12659
- ...errorUtil.errToObj(options == null ? void 0 : options.message)
12611
+ precision: typeof options?.precision === "undefined" ? null : options?.precision,
12612
+ ...errorUtil.errToObj(options?.message)
12660
12613
  });
12661
12614
  }
12662
12615
  duration(message) {
@@ -12673,8 +12626,8 @@ class ZodString extends ZodType {
12673
12626
  return this._addCheck({
12674
12627
  kind: "includes",
12675
12628
  value,
12676
- position: options == null ? void 0 : options.position,
12677
- ...errorUtil.errToObj(options == null ? void 0 : options.message)
12629
+ position: options?.position,
12630
+ ...errorUtil.errToObj(options?.message)
12678
12631
  });
12679
12632
  }
12680
12633
  startsWith(value, message) {
@@ -12809,7 +12762,7 @@ ZodString.create = (params) => {
12809
12762
  return new ZodString({
12810
12763
  checks: [],
12811
12764
  typeName: ZodFirstPartyTypeKind.ZodString,
12812
- coerce: (params == null ? void 0 : params.coerce) ?? false,
12765
+ coerce: params?.coerce ?? false,
12813
12766
  ...processCreateParams(params)
12814
12767
  });
12815
12768
  };
@@ -13049,7 +13002,7 @@ ZodNumber.create = (params) => {
13049
13002
  return new ZodNumber({
13050
13003
  checks: [],
13051
13004
  typeName: ZodFirstPartyTypeKind.ZodNumber,
13052
- coerce: (params == null ? void 0 : params.coerce) || false,
13005
+ coerce: params?.coerce || false,
13053
13006
  ...processCreateParams(params)
13054
13007
  });
13055
13008
  };
@@ -13221,7 +13174,7 @@ ZodBigInt.create = (params) => {
13221
13174
  return new ZodBigInt({
13222
13175
  checks: [],
13223
13176
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
13224
- coerce: (params == null ? void 0 : params.coerce) ?? false,
13177
+ coerce: params?.coerce ?? false,
13225
13178
  ...processCreateParams(params)
13226
13179
  });
13227
13180
  };
@@ -13246,7 +13199,7 @@ class ZodBoolean extends ZodType {
13246
13199
  ZodBoolean.create = (params) => {
13247
13200
  return new ZodBoolean({
13248
13201
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
13249
- coerce: (params == null ? void 0 : params.coerce) || false,
13202
+ coerce: params?.coerce || false,
13250
13203
  ...processCreateParams(params)
13251
13204
  });
13252
13205
  };
@@ -13354,7 +13307,7 @@ class ZodDate extends ZodType {
13354
13307
  ZodDate.create = (params) => {
13355
13308
  return new ZodDate({
13356
13309
  checks: [],
13357
- coerce: (params == null ? void 0 : params.coerce) || false,
13310
+ coerce: params?.coerce || false,
13358
13311
  typeName: ZodFirstPartyTypeKind.ZodDate,
13359
13312
  ...processCreateParams(params)
13360
13313
  });
@@ -13728,8 +13681,7 @@ class ZodObject extends ZodType {
13728
13681
  unknownKeys: "strict",
13729
13682
  ...message !== void 0 ? {
13730
13683
  errorMap: (issue, ctx) => {
13731
- var _a, _b;
13732
- const defaultError = ((_b = (_a = this._def).errorMap) == null ? void 0 : _b.call(_a, issue, ctx).message) ?? ctx.defaultError;
13684
+ const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
13733
13685
  if (issue.code === "unrecognized_keys")
13734
13686
  return {
13735
13687
  message: errorUtil.errToObj(message).message ?? defaultError
@@ -16171,6 +16123,7 @@ const OAuthErrorResponseSchema = objectType({
16171
16123
  error_description: stringType().optional(),
16172
16124
  error_uri: stringType().optional()
16173
16125
  });
16126
+ const OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literalType("").transform(() => void 0));
16174
16127
  const OAuthClientMetadataSchema = objectType({
16175
16128
  redirect_uris: arrayType(SafeUrlSchema),
16176
16129
  token_endpoint_auth_method: stringType().optional(),
@@ -16178,10 +16131,10 @@ const OAuthClientMetadataSchema = objectType({
16178
16131
  response_types: arrayType(stringType()).optional(),
16179
16132
  client_name: stringType().optional(),
16180
16133
  client_uri: SafeUrlSchema.optional(),
16181
- logo_uri: SafeUrlSchema.optional(),
16134
+ logo_uri: OptionalSafeUrlSchema,
16182
16135
  scope: stringType().optional(),
16183
16136
  contacts: arrayType(stringType()).optional(),
16184
- tos_uri: SafeUrlSchema.optional(),
16137
+ tos_uri: OptionalSafeUrlSchema,
16185
16138
  policy_uri: stringType().optional(),
16186
16139
  jwks_uri: SafeUrlSchema.optional(),
16187
16140
  jwks: anyType().optional(),
@@ -16205,7 +16158,7 @@ objectType({
16205
16158
  token_type_hint: stringType().optional()
16206
16159
  }).strip();
16207
16160
  const name = "@modelcontextprotocol/inspector-client";
16208
- const version$1 = "0.17.1";
16161
+ const version$1 = "0.17.2";
16209
16162
  const packageJson = {
16210
16163
  name,
16211
16164
  version: version$1
@@ -16232,8 +16185,9 @@ const DEFAULT_MCP_PROXY_LISTEN_PORT = "6277";
16232
16185
  const DEFAULT_INSPECTOR_CONFIG = {
16233
16186
  MCP_SERVER_REQUEST_TIMEOUT: {
16234
16187
  label: "Request Timeout",
16235
- description: "Timeout for requests to the MCP server (ms)",
16236
- value: 1e4,
16188
+ description: "Client-side timeout (ms) - Inspector will cancel requests after this time",
16189
+ value: 3e5,
16190
+ // 5 minutes - increased to support elicitation and other long-running tools
16237
16191
  is_session_item: false
16238
16192
  },
16239
16193
  MCP_REQUEST_TIMEOUT_RESET_ON_PROGRESS: {
@@ -16715,7 +16669,10 @@ function buildDiscoveryUrls(authorizationServerUrl) {
16715
16669
  return urlsToTry;
16716
16670
  }
16717
16671
  async function discoverAuthorizationServerMetadata(authorizationServerUrl, { fetchFn = fetch, protocolVersion = LATEST_PROTOCOL_VERSION } = {}) {
16718
- const headers = { "MCP-Protocol-Version": protocolVersion };
16672
+ const headers = {
16673
+ "MCP-Protocol-Version": protocolVersion,
16674
+ Accept: "application/json"
16675
+ };
16719
16676
  const urlsToTry = buildDiscoveryUrls(authorizationServerUrl);
16720
16677
  for (const { url: endpointUrl, type: type2 } of urlsToTry) {
16721
16678
  const response = await fetchWithCorsRetry(endpointUrl, headers, fetchFn);
@@ -16923,8 +16880,8 @@ const discoverScopes = async (serverUrl, resourceMetadata) => {
16923
16880
  const metadata = await discoverAuthorizationServerMetadata(
16924
16881
  new URL("/", serverUrl)
16925
16882
  );
16926
- const resourceScopes = resourceMetadata == null ? void 0 : resourceMetadata.scopes_supported;
16927
- const oauthScopes = metadata == null ? void 0 : metadata.scopes_supported;
16883
+ const resourceScopes = resourceMetadata?.scopes_supported;
16884
+ const oauthScopes = metadata?.scopes_supported;
16928
16885
  const scopesSupported = resourceScopes && resourceScopes.length > 0 ? resourceScopes : oauthScopes;
16929
16886
  return scopesSupported && scopesSupported.length > 0 ? scopesSupported.join(" ") : void 0;
16930
16887
  } catch (error) {
@@ -16969,11 +16926,11 @@ const clearClientInformationFromSessionStorage = ({
16969
16926
  };
16970
16927
  class InspectorOAuthClientProvider {
16971
16928
  constructor(serverUrl, scope) {
16972
- __publicField(this, "scope");
16973
16929
  this.serverUrl = serverUrl;
16974
16930
  this.scope = scope;
16975
16931
  sessionStorage.setItem(SESSION_KEYS.SERVER_URL, serverUrl);
16976
16932
  }
16933
+ scope;
16977
16934
  get redirectUrl() {
16978
16935
  return window.location.origin + "/oauth/callback";
16979
16936
  }
@@ -17094,7 +17051,6 @@ const oauthTransitions = {
17094
17051
  metadata_discovery: {
17095
17052
  canTransition: async () => true,
17096
17053
  execute: async (context) => {
17097
- var _a;
17098
17054
  let authServerUrl = new URL("/", context.serverUrl);
17099
17055
  let resourceMetadata = null;
17100
17056
  let resourceMetadataError = null;
@@ -17102,7 +17058,7 @@ const oauthTransitions = {
17102
17058
  resourceMetadata = await discoverOAuthProtectedResourceMetadata(
17103
17059
  context.serverUrl
17104
17060
  );
17105
- if ((_a = resourceMetadata == null ? void 0 : resourceMetadata.authorization_servers) == null ? void 0 : _a.length) {
17061
+ if (resourceMetadata?.authorization_servers?.length) {
17106
17062
  authServerUrl = new URL(resourceMetadata.authorization_servers[0]);
17107
17063
  }
17108
17064
  } catch (e) {
@@ -17137,10 +17093,9 @@ const oauthTransitions = {
17137
17093
  client_registration: {
17138
17094
  canTransition: async (context) => !!context.state.oauthMetadata,
17139
17095
  execute: async (context) => {
17140
- var _a;
17141
17096
  const metadata = context.state.oauthMetadata;
17142
17097
  const clientMetadata = context.provider.clientMetadata;
17143
- const scopesSupported = ((_a = context.state.resourceMetadata) == null ? void 0 : _a.scopes_supported) || metadata.scopes_supported;
17098
+ const scopesSupported = context.state.resourceMetadata?.scopes_supported || metadata.scopes_supported;
17144
17099
  if (scopesSupported) {
17145
17100
  clientMetadata.scope = scopesSupported.join(" ");
17146
17101
  }
@@ -23360,8 +23315,7 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
23360
23315
  }
23361
23316
  }
23362
23317
  function isPropertyRequired(propertyName, schema) {
23363
- var _a;
23364
- return ((_a = schema.required) == null ? void 0 : _a.includes(propertyName)) ?? false;
23318
+ return schema.required?.includes(propertyName) ?? false;
23365
23319
  }
23366
23320
  function normalizeUnionType(schema) {
23367
23321
  if (schema.anyOf && schema.anyOf.length === 2 && schema.anyOf.some((t) => t.type === "string") && schema.anyOf.some((t) => t.type === "null")) {
@@ -23393,10 +23347,16 @@ function normalizeUnionType(schema) {
23393
23347
  function cleanParams(params, schema) {
23394
23348
  const cleaned = {};
23395
23349
  const required2 = schema.required || [];
23350
+ const properties2 = schema.properties || {};
23396
23351
  for (const [key, value] of Object.entries(params)) {
23397
23352
  const isFieldRequired = required2.includes(key);
23353
+ const fieldSchema = properties2[key];
23354
+ const hasDefault = fieldSchema && "default" in fieldSchema;
23355
+ const defaultValue = hasDefault ? fieldSchema.default : void 0;
23398
23356
  if (isFieldRequired) {
23399
23357
  cleaned[key] = value;
23358
+ } else if (hasDefault && value === defaultValue) {
23359
+ cleaned[key] = value;
23400
23360
  } else {
23401
23361
  if (value !== void 0 && value !== "" && value !== null) {
23402
23362
  cleaned[key] = value;
@@ -25103,10 +25063,10 @@ function useConnection({
25103
25063
  try {
25104
25064
  const abortController = new AbortController();
25105
25065
  const mcpRequestOptions = {
25106
- signal: (options == null ? void 0 : options.signal) ?? abortController.signal,
25107
- resetTimeoutOnProgress: (options == null ? void 0 : options.resetTimeoutOnProgress) ?? resetRequestTimeoutOnProgress(config),
25108
- timeout: (options == null ? void 0 : options.timeout) ?? getMCPServerRequestTimeout(config),
25109
- maxTotalTimeout: (options == null ? void 0 : options.maxTotalTimeout) ?? getMCPServerRequestMaxTotalTimeout(config)
25066
+ signal: options?.signal ?? abortController.signal,
25067
+ resetTimeoutOnProgress: options?.resetTimeoutOnProgress ?? resetRequestTimeoutOnProgress(config),
25068
+ timeout: options?.timeout ?? getMCPServerRequestTimeout(config),
25069
+ maxTotalTimeout: options?.maxTotalTimeout ?? getMCPServerRequestMaxTotalTimeout(config)
25110
25070
  };
25111
25071
  if (mcpRequestOptions.resetTimeoutOnProgress) {
25112
25072
  mcpRequestOptions.onprogress = (params) => {
@@ -25129,7 +25089,7 @@ function useConnection({
25129
25089
  }
25130
25090
  return response;
25131
25091
  } catch (e) {
25132
- if (!(options == null ? void 0 : options.suppressToast)) {
25092
+ if (!options?.suppressToast) {
25133
25093
  const errorString = e.message ?? String(e);
25134
25094
  toast2({
25135
25095
  title: "Error",
@@ -25164,7 +25124,7 @@ function useConnection({
25164
25124
  signal,
25165
25125
  suppressToast: true
25166
25126
  });
25167
- return (response == null ? void 0 : response.completion.values) || [];
25127
+ return response?.completion.values || [];
25168
25128
  } catch (e) {
25169
25129
  if (e instanceof McpError && e.code === ErrorCode.MethodNotFound) {
25170
25130
  setCompletionsSupported(false);
@@ -25213,7 +25173,7 @@ function useConnection({
25213
25173
  }
25214
25174
  const proxyHealthResponse = await fetch(proxyHealthUrl, { headers });
25215
25175
  const proxyHealth = await proxyHealthResponse.json();
25216
- if ((proxyHealth == null ? void 0 : proxyHealth.status) !== "ok") {
25176
+ if (proxyHealth?.status !== "ok") {
25217
25177
  throw new Error("MCP Proxy Server is not healthy");
25218
25178
  }
25219
25179
  } catch (e) {
@@ -25229,7 +25189,7 @@ function useConnection({
25229
25189
  };
25230
25190
  const handleAuthError = async (error) => {
25231
25191
  if (is401Error(error)) {
25232
- let scope = oauthScope == null ? void 0 : oauthScope.trim();
25192
+ let scope = oauthScope?.trim();
25233
25193
  if (!scope) {
25234
25194
  let resourceMetadata;
25235
25195
  try {
@@ -25263,7 +25223,6 @@ function useConnection({
25263
25223
  }
25264
25224
  };
25265
25225
  const connect = async (_e2, retryCount = 0) => {
25266
- var _a;
25267
25226
  const clientCapabilities = {
25268
25227
  capabilities: {
25269
25228
  sampling: {},
@@ -25305,7 +25264,7 @@ function useConnection({
25305
25264
  (header) => header.enabled && header.name.trim().toLowerCase() === "authorization"
25306
25265
  );
25307
25266
  if (needsOAuthToken) {
25308
- const oauthToken = (_a = await serverAuthProvider.tokens()) == null ? void 0 : _a.access_token;
25267
+ const oauthToken = (await serverAuthProvider.tokens())?.access_token;
25309
25268
  if (oauthToken) {
25310
25269
  finalHeaders = [
25311
25270
  // Remove any existing Authorization headers with empty tokens
@@ -25523,7 +25482,7 @@ function useConnection({
25523
25482
  throw error;
25524
25483
  }
25525
25484
  setServerCapabilities(capabilities ?? null);
25526
- setCompletionsSupported((capabilities == null ? void 0 : capabilities.completions) !== void 0);
25485
+ setCompletionsSupported(capabilities?.completions !== void 0);
25527
25486
  if (onPendingRequest) {
25528
25487
  client2.setRequestHandler(CreateMessageRequestSchema, (request) => {
25529
25488
  return new Promise((resolve, reject) => {
@@ -25536,7 +25495,7 @@ function useConnection({
25536
25495
  return { roots: getRoots() };
25537
25496
  });
25538
25497
  }
25539
- if ((capabilities == null ? void 0 : capabilities.logging) && defaultLoggingLevel) {
25498
+ if (capabilities?.logging && defaultLoggingLevel) {
25540
25499
  lastRequest = "logging/setLevel";
25541
25500
  await client2.setLoggingLevel(defaultLoggingLevel);
25542
25501
  pushHistory(
@@ -25574,7 +25533,7 @@ function useConnection({
25574
25533
  const disconnect = async () => {
25575
25534
  if (transportType === "streamable-http")
25576
25535
  await clientTransport.terminateSession();
25577
- await (mcpClient == null ? void 0 : mcpClient.close());
25536
+ await mcpClient?.close();
25578
25537
  const authProvider = new InspectorOAuthClientProvider(sseUrl);
25579
25538
  authProvider.clear();
25580
25539
  setMcpClient(null);
@@ -28029,15 +27988,14 @@ function createFocusScopesStack() {
28029
27988
  add(focusScope) {
28030
27989
  const activeFocusScope = stack[0];
28031
27990
  if (focusScope !== activeFocusScope) {
28032
- activeFocusScope == null ? void 0 : activeFocusScope.pause();
27991
+ activeFocusScope?.pause();
28033
27992
  }
28034
27993
  stack = arrayRemove(stack, focusScope);
28035
27994
  stack.unshift(focusScope);
28036
27995
  },
28037
27996
  remove(focusScope) {
28038
- var _a;
28039
27997
  stack = arrayRemove(stack, focusScope);
28040
- (_a = stack[0]) == null ? void 0 : _a.resume();
27998
+ stack[0]?.resume();
28041
27999
  }
28042
28000
  };
28043
28001
  }
@@ -28977,9 +28935,8 @@ var DialogContentModal = reactExports.forwardRef(
28977
28935
  trapFocus: context.open,
28978
28936
  disableOutsidePointerEvents: true,
28979
28937
  onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
28980
- var _a;
28981
28938
  event.preventDefault();
28982
- (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
28939
+ context.triggerRef.current?.focus();
28983
28940
  }),
28984
28941
  onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
28985
28942
  const originalEvent = event.detail.originalEvent;
@@ -29008,18 +28965,16 @@ var DialogContentNonModal = reactExports.forwardRef(
29008
28965
  trapFocus: false,
29009
28966
  disableOutsidePointerEvents: false,
29010
28967
  onCloseAutoFocus: (event) => {
29011
- var _a, _b;
29012
- (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
28968
+ props.onCloseAutoFocus?.(event);
29013
28969
  if (!event.defaultPrevented) {
29014
- if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
28970
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
29015
28971
  event.preventDefault();
29016
28972
  }
29017
28973
  hasInteractedOutsideRef.current = false;
29018
28974
  hasPointerDownOutsideRef.current = false;
29019
28975
  },
29020
28976
  onInteractOutside: (event) => {
29021
- var _a, _b;
29022
- (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
28977
+ props.onInteractOutside?.(event);
29023
28978
  if (!event.defaultPrevented) {
29024
28979
  hasInteractedOutsideRef.current = true;
29025
28980
  if (event.detail.originalEvent.type === "pointerdown") {
@@ -29027,7 +28982,7 @@ var DialogContentNonModal = reactExports.forwardRef(
29027
28982
  }
29028
28983
  }
29029
28984
  const target = event.target;
29030
- const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
28985
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
29031
28986
  if (targetIsTrigger) event.preventDefault();
29032
28987
  if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
29033
28988
  event.preventDefault();
@@ -29139,8 +29094,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
29139
29094
  const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
29140
29095
  const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
29141
29096
  reactExports.useEffect(() => {
29142
- var _a;
29143
- const describedById = (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby");
29097
+ const describedById = contentRef.current?.getAttribute("aria-describedby");
29144
29098
  if (descriptionId && describedById) {
29145
29099
  const hasDescription = document.getElementById(descriptionId);
29146
29100
  if (!hasDescription) console.warn(MESSAGE);
@@ -31529,7 +31483,7 @@ var PopperAnchor = reactExports.forwardRef(
31529
31483
  const anchorRef = reactExports.useRef(null);
31530
31484
  reactExports.useEffect(() => {
31531
31485
  const previousAnchor = anchorRef.current;
31532
- anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref2.current;
31486
+ anchorRef.current = virtualRef?.current || ref2.current;
31533
31487
  if (previousAnchor !== anchorRef.current) {
31534
31488
  context.onAnchorChange(anchorRef.current);
31535
31489
  }
@@ -31542,7 +31496,6 @@ var CONTENT_NAME$3 = "PopperContent";
31542
31496
  var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$3);
31543
31497
  var PopperContent = reactExports.forwardRef(
31544
31498
  (props, forwardedRef) => {
31545
- var _a, _b, _c, _d, _e2, _f;
31546
31499
  const {
31547
31500
  __scopePopper,
31548
31501
  side = "bottom",
@@ -31564,8 +31517,8 @@ var PopperContent = reactExports.forwardRef(
31564
31517
  const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
31565
31518
  const [arrow$12, setArrow] = reactExports.useState(null);
31566
31519
  const arrowSize = useSize(arrow$12);
31567
- const arrowWidth = (arrowSize == null ? void 0 : arrowSize.width) ?? 0;
31568
- const arrowHeight = (arrowSize == null ? void 0 : arrowSize.height) ?? 0;
31520
+ const arrowWidth = arrowSize?.width ?? 0;
31521
+ const arrowHeight = arrowSize?.height ?? 0;
31569
31522
  const desiredPlacement = side + (align !== "center" ? "-" + align : "");
31570
31523
  const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
31571
31524
  const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
@@ -31618,12 +31571,12 @@ var PopperContent = reactExports.forwardRef(
31618
31571
  const handlePlaced = useCallbackRef$1(onPlaced);
31619
31572
  useLayoutEffect2(() => {
31620
31573
  if (isPositioned) {
31621
- handlePlaced == null ? void 0 : handlePlaced();
31574
+ handlePlaced?.();
31622
31575
  }
31623
31576
  }, [isPositioned, handlePlaced]);
31624
- const arrowX = (_a = middlewareData.arrow) == null ? void 0 : _a.x;
31625
- const arrowY = (_b = middlewareData.arrow) == null ? void 0 : _b.y;
31626
- const cannotCenterArrow = ((_c = middlewareData.arrow) == null ? void 0 : _c.centerOffset) !== 0;
31577
+ const arrowX = middlewareData.arrow?.x;
31578
+ const arrowY = middlewareData.arrow?.y;
31579
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
31627
31580
  const [contentZIndex, setContentZIndex] = reactExports.useState();
31628
31581
  useLayoutEffect2(() => {
31629
31582
  if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
@@ -31640,13 +31593,13 @@ var PopperContent = reactExports.forwardRef(
31640
31593
  minWidth: "max-content",
31641
31594
  zIndex: contentZIndex,
31642
31595
  ["--radix-popper-transform-origin"]: [
31643
- (_d = middlewareData.transformOrigin) == null ? void 0 : _d.x,
31644
- (_e2 = middlewareData.transformOrigin) == null ? void 0 : _e2.y
31596
+ middlewareData.transformOrigin?.x,
31597
+ middlewareData.transformOrigin?.y
31645
31598
  ].join(" "),
31646
31599
  // hide the content if using the hide middleware and should be hidden
31647
31600
  // set visibility to hidden and disable pointer events so the UI behaves
31648
31601
  // as if the PopperContent isn't there at all
31649
- ...((_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden) && {
31602
+ ...middlewareData.hide?.referenceHidden && {
31650
31603
  visibility: "hidden",
31651
31604
  pointerEvents: "none"
31652
31605
  }
@@ -31745,16 +31698,15 @@ var transformOrigin = (options) => ({
31745
31698
  name: "transformOrigin",
31746
31699
  options,
31747
31700
  fn(data2) {
31748
- var _a, _b, _c;
31749
31701
  const { placement, rects, middlewareData } = data2;
31750
- const cannotCenterArrow = ((_a = middlewareData.arrow) == null ? void 0 : _a.centerOffset) !== 0;
31702
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
31751
31703
  const isArrowHidden = cannotCenterArrow;
31752
31704
  const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
31753
31705
  const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
31754
31706
  const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
31755
31707
  const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
31756
- const arrowXCenter = (((_b = middlewareData.arrow) == null ? void 0 : _b.x) ?? 0) + arrowWidth / 2;
31757
- const arrowYCenter = (((_c = middlewareData.arrow) == null ? void 0 : _c.y) ?? 0) + arrowHeight / 2;
31708
+ const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
31709
+ const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
31758
31710
  let x = "";
31759
31711
  let y = "";
31760
31712
  if (placedSide === "bottom") {
@@ -31901,9 +31853,8 @@ var PopoverContentModal = reactExports.forwardRef(
31901
31853
  trapFocus: context.open,
31902
31854
  disableOutsidePointerEvents: true,
31903
31855
  onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
31904
- var _a;
31905
31856
  event.preventDefault();
31906
- if (!isRightClickOutsideRef.current) (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
31857
+ if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
31907
31858
  }),
31908
31859
  onPointerDownOutside: composeEventHandlers(
31909
31860
  props.onPointerDownOutside,
@@ -31937,18 +31888,16 @@ var PopoverContentNonModal = reactExports.forwardRef(
31937
31888
  trapFocus: false,
31938
31889
  disableOutsidePointerEvents: false,
31939
31890
  onCloseAutoFocus: (event) => {
31940
- var _a, _b;
31941
- (_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
31891
+ props.onCloseAutoFocus?.(event);
31942
31892
  if (!event.defaultPrevented) {
31943
- if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
31893
+ if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
31944
31894
  event.preventDefault();
31945
31895
  }
31946
31896
  hasInteractedOutsideRef.current = false;
31947
31897
  hasPointerDownOutsideRef.current = false;
31948
31898
  },
31949
31899
  onInteractOutside: (event) => {
31950
- var _a, _b;
31951
- (_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
31900
+ props.onInteractOutside?.(event);
31952
31901
  if (!event.defaultPrevented) {
31953
31902
  hasInteractedOutsideRef.current = true;
31954
31903
  if (event.detail.originalEvent.type === "pointerdown") {
@@ -31956,7 +31905,7 @@ var PopoverContentNonModal = reactExports.forwardRef(
31956
31905
  }
31957
31906
  }
31958
31907
  const target = event.target;
31959
- const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
31908
+ const targetIsTrigger = context.triggerRef.current?.contains(target);
31960
31909
  if (targetIsTrigger) event.preventDefault();
31961
31910
  if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
31962
31911
  event.preventDefault();
@@ -32167,10 +32116,9 @@ var Label$2 = reactExports.forwardRef((props, forwardedRef) => {
32167
32116
  ...props,
32168
32117
  ref: forwardedRef,
32169
32118
  onMouseDown: (event) => {
32170
- var _a;
32171
32119
  const target = event.target;
32172
32120
  if (target.closest("button, input, select, textarea")) return;
32173
- (_a = props.onMouseDown) == null ? void 0 : _a.call(props, event);
32121
+ props.onMouseDown?.(event);
32174
32122
  if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
32175
32123
  }
32176
32124
  }
@@ -32233,8 +32181,7 @@ const ListPane = ({
32233
32181
  const handleSearchClick = () => {
32234
32182
  setIsSearchExpanded(true);
32235
32183
  setTimeout(() => {
32236
- var _a;
32237
- (_a = searchInputRef.current) == null ? void 0 : _a.focus();
32184
+ searchInputRef.current?.focus();
32238
32185
  }, 100);
32239
32186
  };
32240
32187
  const handleSearchBlur = () => {
@@ -32415,7 +32362,6 @@ const PromptsTab = ({
32415
32362
  nextCursor,
32416
32363
  error
32417
32364
  }) => {
32418
- var _a;
32419
32365
  const [promptArgs, setPromptArgs] = reactExports.useState({});
32420
32366
  const { completions, clearCompletions, requestCompletions } = useCompletionState(handleCompletion, completionsSupported);
32421
32367
  reactExports.useEffect(() => {
@@ -32478,7 +32424,7 @@ const PromptsTab = ({
32478
32424
  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "break-all", children: error })
32479
32425
  ] }) : selectedPrompt ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
32480
32426
  selectedPrompt.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedPrompt.description }),
32481
- (_a = selectedPrompt.arguments) == null ? void 0 : _a.map((arg) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
32427
+ selectedPrompt.arguments?.map((arg) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
32482
32428
  /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { htmlFor: arg.name, children: arg.name }),
32483
32429
  /* @__PURE__ */ jsxRuntimeExports.jsx(
32484
32430
  Combobox,
@@ -32744,7 +32690,6 @@ const ResourcesTab = ({
32744
32690
  nextTemplateCursor,
32745
32691
  error
32746
32692
  }) => {
32747
- var _a;
32748
32693
  const [selectedTemplate, setSelectedTemplate] = reactExports.useState(null);
32749
32694
  const [templateValues, setTemplateValues] = reactExports.useState(
32750
32695
  {}
@@ -32758,7 +32703,7 @@ const ResourcesTab = ({
32758
32703
  };
32759
32704
  const handleTemplateValueChange = async (key, value) => {
32760
32705
  setTemplateValues((prev) => ({ ...prev, [key]: value }));
32761
- if (selectedTemplate == null ? void 0 : selectedTemplate.uriTemplate) {
32706
+ if (selectedTemplate?.uriTemplate) {
32762
32707
  requestCompletions(
32763
32708
  {
32764
32709
  type: "ref/resource",
@@ -32837,7 +32782,7 @@ const ResourcesTab = ({
32837
32782
  "h3",
32838
32783
  {
32839
32784
  className: "font-semibold truncate",
32840
- title: (selectedResource == null ? void 0 : selectedResource.name) || (selectedTemplate == null ? void 0 : selectedTemplate.name),
32785
+ title: selectedResource?.name || selectedTemplate?.name,
32841
32786
  children: selectedResource ? selectedResource.name : selectedTemplate ? selectedTemplate.name : "Select a resource or template"
32842
32787
  }
32843
32788
  ),
@@ -32886,9 +32831,9 @@ const ResourcesTab = ({
32886
32831
  }
32887
32832
  ) : selectedTemplate ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
32888
32833
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedTemplate.description }),
32889
- (_a = new UriTemplate(
32834
+ new UriTemplate(
32890
32835
  selectedTemplate.uriTemplate
32891
- ).variableNames) == null ? void 0 : _a.map((key) => {
32836
+ ).variableNames?.map((key) => {
32892
32837
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
32893
32838
  /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { htmlFor: key, children: key }),
32894
32839
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -35058,7 +35003,6 @@ const DynamicJsonForm = reactExports.forwardRef(
35058
35003
  validateJson
35059
35004
  }));
35060
35005
  const renderFormFields = (propSchema, currentValue, path = [], depth = 0, parentSchema, propertyName) => {
35061
- var _a, _b, _c;
35062
35006
  if (depth >= maxDepth && (propSchema.type === "object" || propSchema.type === "array")) {
35063
35007
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
35064
35008
  JsonEditor,
@@ -35083,7 +35027,7 @@ const DynamicJsonForm = reactExports.forwardRef(
35083
35027
  }
35084
35028
  );
35085
35029
  }
35086
- const isRequired = ((_a = parentSchema == null ? void 0 : parentSchema.required) == null ? void 0 : _a.includes(propertyName || "")) ?? false;
35030
+ const isRequired = parentSchema?.required?.includes(propertyName || "") ?? false;
35087
35031
  let fieldType = propSchema.type;
35088
35032
  if (Array.isArray(fieldType)) {
35089
35033
  fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
@@ -35183,7 +35127,7 @@ const DynamicJsonForm = reactExports.forwardRef(
35183
35127
  Input,
35184
35128
  {
35185
35129
  type: "number",
35186
- value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
35130
+ value: currentValue?.toString() ?? "",
35187
35131
  onChange: (e) => {
35188
35132
  const val = e.target.value;
35189
35133
  if (!val && !isRequired) {
@@ -35207,7 +35151,7 @@ const DynamicJsonForm = reactExports.forwardRef(
35207
35151
  {
35208
35152
  type: "number",
35209
35153
  step: "1",
35210
- value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
35154
+ value: currentValue?.toString() ?? "",
35211
35155
  onChange: (e) => {
35212
35156
  const val = e.target.value;
35213
35157
  if (!val && !isRequired) {
@@ -35259,30 +35203,27 @@ const DynamicJsonForm = reactExports.forwardRef(
35259
35203
  }
35260
35204
  );
35261
35205
  }
35262
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => {
35263
- var _a2;
35264
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35265
- /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
35266
- key,
35267
- ((_a2 = propSchema.required) == null ? void 0 : _a2.includes(key)) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
35268
- ] }),
35269
- renderFormFields(
35270
- subSchema,
35271
- currentValue == null ? void 0 : currentValue[key],
35272
- [...path, key],
35273
- depth + 1,
35274
- propSchema,
35275
- key
35276
- )
35277
- ] }, key);
35278
- }) });
35206
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35207
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
35208
+ key,
35209
+ propSchema.required?.includes(key) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
35210
+ ] }),
35211
+ renderFormFields(
35212
+ subSchema,
35213
+ currentValue?.[key],
35214
+ [...path, key],
35215
+ depth + 1,
35216
+ propSchema,
35217
+ key
35218
+ )
35219
+ ] }, key)) });
35279
35220
  case "array": {
35280
35221
  const arrayValue = Array.isArray(currentValue) ? currentValue : [];
35281
35222
  if (!propSchema.items) return null;
35282
35223
  if (isSimpleObject(propSchema.items)) {
35283
35224
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
35284
35225
  propSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: propSchema.description }),
35285
- ((_b = propSchema.items) == null ? void 0 : _b.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
35226
+ propSchema.items?.description && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
35286
35227
  "Items: ",
35287
35228
  propSchema.items.description
35288
35229
  ] }),
@@ -35319,7 +35260,7 @@ const DynamicJsonForm = reactExports.forwardRef(
35319
35260
  );
35320
35261
  handleFieldChange(path, [...arrayValue, defaultValue]);
35321
35262
  },
35322
- title: ((_c = propSchema.items) == null ? void 0 : _c.description) ? `Add new ${propSchema.items.description}` : "Add new item",
35263
+ title: propSchema.items?.description ? `Add new ${propSchema.items.description}` : "Add new item",
35323
35264
  children: "Add Item"
35324
35265
  }
35325
35266
  )
@@ -35432,7 +35373,6 @@ const SamplingRequest = ({
35432
35373
  request,
35433
35374
  onReject
35434
35375
  }) => {
35435
- var _a;
35436
35376
  const { toast: toast2 } = useToast();
35437
35377
  const [messageResult, setMessageResult] = reactExports.useState({
35438
35378
  model: "stub-model",
@@ -35443,7 +35383,7 @@ const SamplingRequest = ({
35443
35383
  text: ""
35444
35384
  }
35445
35385
  });
35446
- const contentType = (_a = messageResult == null ? void 0 : messageResult.content) == null ? void 0 : _a.type;
35386
+ const contentType = messageResult?.content?.type;
35447
35387
  const schema = reactExports.useMemo(() => {
35448
35388
  const s = {
35449
35389
  type: "object",
@@ -35887,10 +35827,10 @@ var SelectContentImpl = reactExports.forwardRef(
35887
35827
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
35888
35828
  for (const candidate of candidates) {
35889
35829
  if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
35890
- candidate == null ? void 0 : candidate.scrollIntoView({ block: "nearest" });
35830
+ candidate?.scrollIntoView({ block: "nearest" });
35891
35831
  if (candidate === firstItem && viewport) viewport.scrollTop = 0;
35892
35832
  if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;
35893
- candidate == null ? void 0 : candidate.focus();
35833
+ candidate?.focus();
35894
35834
  if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
35895
35835
  }
35896
35836
  },
@@ -35910,10 +35850,9 @@ var SelectContentImpl = reactExports.forwardRef(
35910
35850
  if (content) {
35911
35851
  let pointerMoveDelta = { x: 0, y: 0 };
35912
35852
  const handlePointerMove = (event) => {
35913
- var _a, _b;
35914
35853
  pointerMoveDelta = {
35915
- x: Math.abs(Math.round(event.pageX) - (((_a = triggerPointerDownPosRef.current) == null ? void 0 : _a.x) ?? 0)),
35916
- y: Math.abs(Math.round(event.pageY) - (((_b = triggerPointerDownPosRef.current) == null ? void 0 : _b.y) ?? 0))
35854
+ x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),
35855
+ y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))
35917
35856
  };
35918
35857
  };
35919
35858
  const handlePointerUp = (event) => {
@@ -35965,7 +35904,7 @@ var SelectContentImpl = reactExports.forwardRef(
35965
35904
  },
35966
35905
  [context.value]
35967
35906
  );
35968
- const handleItemLeave = reactExports.useCallback(() => content == null ? void 0 : content.focus(), [content]);
35907
+ const handleItemLeave = reactExports.useCallback(() => content?.focus(), [content]);
35969
35908
  const itemTextRefCallback = reactExports.useCallback(
35970
35909
  (node, value, disabled) => {
35971
35910
  const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
@@ -36014,8 +35953,7 @@ var SelectContentImpl = reactExports.forwardRef(
36014
35953
  event.preventDefault();
36015
35954
  },
36016
35955
  onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {
36017
- var _a;
36018
- (_a = context.trigger) == null ? void 0 : _a.focus({ preventScroll: true });
35956
+ context.trigger?.focus({ preventScroll: true });
36019
35957
  event.preventDefault();
36020
35958
  }),
36021
35959
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -36173,7 +36111,7 @@ var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) =>
36173
36111
  contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;
36174
36112
  contentWrapper.style.minHeight = minContentHeight + "px";
36175
36113
  contentWrapper.style.maxHeight = availableHeight + "px";
36176
- onPlaced == null ? void 0 : onPlaced();
36114
+ onPlaced?.();
36177
36115
  requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);
36178
36116
  }
36179
36117
  }, [
@@ -36197,7 +36135,7 @@ var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) =>
36197
36135
  (node) => {
36198
36136
  if (node && shouldRepositionRef.current === true) {
36199
36137
  position();
36200
- focusSelectedItem == null ? void 0 : focusSelectedItem();
36138
+ focusSelectedItem?.();
36201
36139
  shouldRepositionRef.current = false;
36202
36140
  }
36203
36141
  },
@@ -36317,7 +36255,7 @@ var SelectViewport = reactExports.forwardRef(
36317
36255
  onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {
36318
36256
  const viewport = event.currentTarget;
36319
36257
  const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
36320
- if ((shouldExpandOnScrollRef == null ? void 0 : shouldExpandOnScrollRef.current) && contentWrapper) {
36258
+ if (shouldExpandOnScrollRef?.current && contentWrapper) {
36321
36259
  const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
36322
36260
  if (scrolledBy > 0) {
36323
36261
  const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
@@ -36381,10 +36319,7 @@ var SelectItem$1 = reactExports.forwardRef(
36381
36319
  const [isFocused, setIsFocused] = reactExports.useState(false);
36382
36320
  const composedRefs = useComposedRefs(
36383
36321
  forwardedRef,
36384
- (node) => {
36385
- var _a;
36386
- return (_a = contentContext.itemRefCallback) == null ? void 0 : _a.call(contentContext, node, value, disabled);
36387
- }
36322
+ (node) => contentContext.itemRefCallback?.(node, value, disabled)
36388
36323
  );
36389
36324
  const textId = useId();
36390
36325
  const pointerTypeRef = reactExports.useRef("touch");
@@ -36408,7 +36343,7 @@ var SelectItem$1 = reactExports.forwardRef(
36408
36343
  textId,
36409
36344
  isSelected,
36410
36345
  onItemTextChange: reactExports.useCallback((node) => {
36411
- setTextValue((prevTextValue) => prevTextValue || ((node == null ? void 0 : node.textContent) ?? "").trim());
36346
+ setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
36412
36347
  }, []),
36413
36348
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36414
36349
  Collection.ItemSlot,
@@ -36442,23 +36377,20 @@ var SelectItem$1 = reactExports.forwardRef(
36442
36377
  pointerTypeRef.current = event.pointerType;
36443
36378
  }),
36444
36379
  onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {
36445
- var _a;
36446
36380
  pointerTypeRef.current = event.pointerType;
36447
36381
  if (disabled) {
36448
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
36382
+ contentContext.onItemLeave?.();
36449
36383
  } else if (pointerTypeRef.current === "mouse") {
36450
36384
  event.currentTarget.focus({ preventScroll: true });
36451
36385
  }
36452
36386
  }),
36453
36387
  onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {
36454
- var _a;
36455
36388
  if (event.currentTarget === document.activeElement) {
36456
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
36389
+ contentContext.onItemLeave?.();
36457
36390
  }
36458
36391
  }),
36459
36392
  onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {
36460
- var _a;
36461
- const isTypingAhead = ((_a = contentContext.searchRef) == null ? void 0 : _a.current) !== "";
36393
+ const isTypingAhead = contentContext.searchRef?.current !== "";
36462
36394
  if (isTypingAhead && event.key === " ") return;
36463
36395
  if (SELECTION_KEYS.includes(event.key)) handleSelect();
36464
36396
  if (event.key === " ") event.preventDefault();
@@ -36485,12 +36417,9 @@ var SelectItemText = reactExports.forwardRef(
36485
36417
  forwardedRef,
36486
36418
  (node) => setItemTextNode(node),
36487
36419
  itemContext.onItemTextChange,
36488
- (node) => {
36489
- var _a;
36490
- return (_a = contentContext.itemTextRefCallback) == null ? void 0 : _a.call(contentContext, node, itemContext.value, itemContext.disabled);
36491
- }
36420
+ (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
36492
36421
  );
36493
- const textContent = itemTextNode == null ? void 0 : itemTextNode.textContent;
36422
+ const textContent = itemTextNode?.textContent;
36494
36423
  const nativeOption = reactExports.useMemo(
36495
36424
  () => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
36496
36425
  [itemContext.disabled, itemContext.value, textContent]
@@ -36598,9 +36527,8 @@ var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
36598
36527
  return () => clearAutoScrollTimer();
36599
36528
  }, [clearAutoScrollTimer]);
36600
36529
  useLayoutEffect2(() => {
36601
- var _a;
36602
36530
  const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
36603
- (_a = activeItem == null ? void 0 : activeItem.ref.current) == null ? void 0 : _a.scrollIntoView({ block: "nearest" });
36531
+ activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
36604
36532
  }, [getItems]);
36605
36533
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
36606
36534
  Primitive.div,
@@ -36615,8 +36543,7 @@ var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
36615
36543
  }
36616
36544
  }),
36617
36545
  onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {
36618
- var _a;
36619
- (_a = contentContext.onItemLeave) == null ? void 0 : _a.call(contentContext);
36546
+ contentContext.onItemLeave?.();
36620
36547
  if (autoScrollTimerRef.current === null) {
36621
36548
  autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
36622
36549
  }
@@ -36881,7 +36808,7 @@ const useTheme = () => {
36881
36808
  [theme, setThemeWithSideEffect]
36882
36809
  );
36883
36810
  };
36884
- const version = "0.17.1";
36811
+ const version = "0.17.2";
36885
36812
  var [createTooltipContext] = createContextScope("Tooltip", [
36886
36813
  createPopperScope
36887
36814
  ]);
@@ -36962,7 +36889,7 @@ var Tooltip$1 = (props) => {
36962
36889
  } else {
36963
36890
  providerContext.onClose();
36964
36891
  }
36965
- onOpenChange == null ? void 0 : onOpenChange(open2);
36892
+ onOpenChange?.(open2);
36966
36893
  },
36967
36894
  caller: TOOLTIP_NAME
36968
36895
  });
@@ -37134,7 +37061,7 @@ var TooltipContentHoverable = reactExports.forwardRef((props, forwardedRef) => {
37134
37061
  const handleTrackPointerGrace = (event) => {
37135
37062
  const target = event.target;
37136
37063
  const pointerPosition = { x: event.clientX, y: event.clientY };
37137
- const hasEnteredTarget = (trigger == null ? void 0 : trigger.contains(target)) || (content == null ? void 0 : content.contains(target));
37064
+ const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);
37138
37065
  const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
37139
37066
  if (hasEnteredTarget) {
37140
37067
  handleRemoveGraceArea();
@@ -37172,7 +37099,7 @@ var TooltipContentImpl = reactExports.forwardRef(
37172
37099
  if (context.trigger) {
37173
37100
  const handleScroll2 = (event) => {
37174
37101
  const target = event.target;
37175
- if (target == null ? void 0 : target.contains(context.trigger)) onClose();
37102
+ if (target?.contains(context.trigger)) onClose();
37176
37103
  };
37177
37104
  window.addEventListener("scroll", handleScroll2, { capture: true });
37178
37105
  return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
@@ -37547,7 +37474,7 @@ const createEmptyHeader = () => ({
37547
37474
  });
37548
37475
  const createHeaderFromBearerToken = (bearerToken, headerName) => ({
37549
37476
  name: headerName || "Authorization",
37550
- value: (headerName == null ? void 0 : headerName.toLowerCase()) === "authorization" || !headerName ? `Bearer ${bearerToken}` : bearerToken,
37477
+ value: headerName?.toLowerCase() === "authorization" || !headerName ? `Bearer ${bearerToken}` : bearerToken,
37551
37478
  enabled: true
37552
37479
  });
37553
37480
  const migrateFromLegacyAuth = (bearerToken, headerName) => {
@@ -38378,12 +38305,11 @@ const Sidebar = ({
38378
38305
  }
38379
38306
  ),
38380
38307
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-600 dark:text-gray-400", children: (() => {
38381
- var _a;
38382
38308
  switch (connectionStatus) {
38383
38309
  case "connected":
38384
38310
  return "Connected";
38385
38311
  case "error": {
38386
- const hasProxyToken = (_a = config.MCP_PROXY_AUTH_TOKEN) == null ? void 0 : _a.value;
38312
+ const hasProxyToken = config.MCP_PROXY_AUTH_TOKEN?.value;
38387
38313
  if (!hasProxyToken) {
38388
38314
  return "Connection Error - Did you add the proxy session token in Configuration?";
38389
38315
  }
@@ -38549,7 +38475,7 @@ var CheckboxTrigger = reactExports.forwardRef(
38549
38475
  const composedRefs = useComposedRefs(forwardedRef, setControl);
38550
38476
  const initialCheckedStateRef = reactExports.useRef(checked);
38551
38477
  reactExports.useEffect(() => {
38552
- const form = control == null ? void 0 : control.form;
38478
+ const form = control?.form;
38553
38479
  if (form) {
38554
38480
  const reset = () => setChecked(initialCheckedStateRef.current);
38555
38481
  form.addEventListener("reset", reset);
@@ -38937,40 +38863,37 @@ const ToolResults = ({
38937
38863
  }
38938
38864
  )
38939
38865
  ] }),
38940
- structuredResult.content.map((item, index2) => {
38941
- var _a, _b;
38942
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
38943
- item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text, isError }),
38944
- item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38945
- "img",
38946
- {
38947
- src: `data:${item.mimeType};base64,${item.data}`,
38948
- alt: "Tool result image",
38949
- className: "max-w-full h-auto"
38950
- }
38951
- ),
38952
- item.type === "resource" && (((_b = (_a = item.resource) == null ? void 0 : _a.mimeType) == null ? void 0 : _b.startsWith("audio/")) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
38953
- "audio",
38954
- {
38955
- controls: true,
38956
- src: `data:${item.resource.mimeType};base64,${item.resource.blob}`,
38957
- className: "w-full",
38958
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Your browser does not support audio playback" })
38959
- }
38960
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.resource })),
38961
- item.type === "resource_link" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38962
- ResourceLinkView,
38963
- {
38964
- uri: item.uri,
38965
- name: item.name,
38966
- description: item.description,
38967
- mimeType: item.mimeType,
38968
- resourceContent: resourceContent[item.uri] || "",
38969
- onReadResource
38970
- }
38971
- )
38972
- ] }, index2);
38973
- })
38866
+ structuredResult.content.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
38867
+ item.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.text, isError }),
38868
+ item.type === "image" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38869
+ "img",
38870
+ {
38871
+ src: `data:${item.mimeType};base64,${item.data}`,
38872
+ alt: "Tool result image",
38873
+ className: "max-w-full h-auto"
38874
+ }
38875
+ ),
38876
+ item.type === "resource" && (item.resource?.mimeType?.startsWith("audio/") ? /* @__PURE__ */ jsxRuntimeExports.jsx(
38877
+ "audio",
38878
+ {
38879
+ controls: true,
38880
+ src: `data:${item.resource.mimeType};base64,${item.resource.blob}`,
38881
+ className: "w-full",
38882
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Your browser does not support audio playback" })
38883
+ }
38884
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: item.resource })),
38885
+ item.type === "resource_link" && /* @__PURE__ */ jsxRuntimeExports.jsx(
38886
+ ResourceLinkView,
38887
+ {
38888
+ uri: item.uri,
38889
+ name: item.name,
38890
+ description: item.description,
38891
+ mimeType: item.mimeType,
38892
+ resourceContent: resourceContent[item.uri] || "",
38893
+ onReadResource
38894
+ }
38895
+ )
38896
+ ] }, index2))
38974
38897
  ] })
38975
38898
  ] });
38976
38899
  } else if ("toolResult" in toolResult) {
@@ -39012,13 +38935,13 @@ const ToolsTab = ({
39012
38935
  };
39013
38936
  reactExports.useEffect(() => {
39014
38937
  const params2 = Object.entries(
39015
- (selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
38938
+ selectedTool?.inputSchema.properties ?? []
39016
38939
  ).map(([key, value]) => [
39017
38940
  key,
39018
38941
  generateDefaultValue(
39019
38942
  value,
39020
38943
  key,
39021
- selectedTool == null ? void 0 : selectedTool.inputSchema
38944
+ selectedTool?.inputSchema
39022
38945
  )
39023
38946
  ]);
39024
38947
  setParams(Object.fromEntries(params2));
@@ -39081,7 +39004,7 @@ const ToolsTab = ({
39081
39004
  checked: params[key] === null,
39082
39005
  onCheckedChange: (checked) => setParams({
39083
39006
  ...params,
39084
- [key]: checked ? null : prop.default
39007
+ [key]: checked ? null : prop.default !== null ? prop.default : prop.type === "boolean" ? false : prop.type === "string" ? "" : prop.type === "number" || prop.type === "integer" ? void 0 : void 0
39085
39008
  })
39086
39009
  }
39087
39010
  ),
@@ -39502,7 +39425,6 @@ const ElicitationTab = ({ pendingRequests, onResolve }) => {
39502
39425
  };
39503
39426
  const CONFIG_LOCAL_STORAGE_KEY = "inspectorConfig_v1";
39504
39427
  const App = () => {
39505
- var _a;
39506
39428
  const [resources, setResources] = reactExports.useState([]);
39507
39429
  const [resourceTemplates, setResourceTemplates] = reactExports.useState([]);
39508
39430
  const [resourceContent, setResourceContent] = reactExports.useState("");
@@ -39669,9 +39591,9 @@ const App = () => {
39669
39591
  if (serverCapabilities) {
39670
39592
  const hash = window.location.hash.slice(1);
39671
39593
  const validTabs = [
39672
- ...(serverCapabilities == null ? void 0 : serverCapabilities.resources) ? ["resources"] : [],
39673
- ...(serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? ["prompts"] : [],
39674
- ...(serverCapabilities == null ? void 0 : serverCapabilities.tools) ? ["tools"] : [],
39594
+ ...serverCapabilities?.resources ? ["resources"] : [],
39595
+ ...serverCapabilities?.prompts ? ["prompts"] : [],
39596
+ ...serverCapabilities?.tools ? ["tools"] : [],
39675
39597
  "ping",
39676
39598
  "sampling",
39677
39599
  "elicitations",
@@ -39680,7 +39602,7 @@ const App = () => {
39680
39602
  ];
39681
39603
  const isValidTab = validTabs.includes(hash);
39682
39604
  if (!isValidTab) {
39683
- const defaultTab = (serverCapabilities == null ? void 0 : serverCapabilities.resources) ? "resources" : (serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? "prompts" : (serverCapabilities == null ? void 0 : serverCapabilities.tools) ? "tools" : "ping";
39605
+ const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : "ping";
39684
39606
  setActiveTab(defaultTab);
39685
39607
  window.location.hash = defaultTab;
39686
39608
  }
@@ -39860,7 +39782,7 @@ const App = () => {
39860
39782
  }, [roots]);
39861
39783
  reactExports.useEffect(() => {
39862
39784
  if (mcpClient && !window.location.hash) {
39863
- const defaultTab = (serverCapabilities == null ? void 0 : serverCapabilities.resources) ? "resources" : (serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? "prompts" : (serverCapabilities == null ? void 0 : serverCapabilities.tools) ? "tools" : "ping";
39785
+ const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : "ping";
39864
39786
  window.location.hash = defaultTab;
39865
39787
  } else if (!mcpClient && window.location.hash) {
39866
39788
  window.history.replaceState(
@@ -39883,14 +39805,14 @@ const App = () => {
39883
39805
  const handleApproveSampling = (id, result) => {
39884
39806
  setPendingSampleRequests((prev) => {
39885
39807
  const request = prev.find((r2) => r2.id === id);
39886
- request == null ? void 0 : request.resolve(result);
39808
+ request?.resolve(result);
39887
39809
  return prev.filter((r2) => r2.id !== id);
39888
39810
  });
39889
39811
  };
39890
39812
  const handleRejectSampling = (id) => {
39891
39813
  setPendingSampleRequests((prev) => {
39892
39814
  const request = prev.find((r2) => r2.id === id);
39893
- request == null ? void 0 : request.reject(new Error("Sampling request rejected"));
39815
+ request?.reject(new Error("Sampling request rejected"));
39894
39816
  return prev.filter((r2) => r2.id !== id);
39895
39817
  });
39896
39818
  };
@@ -39902,9 +39824,9 @@ const App = () => {
39902
39824
  if (request.originatingTab) {
39903
39825
  const originatingTab = request.originatingTab;
39904
39826
  const validTabs = [
39905
- ...(serverCapabilities == null ? void 0 : serverCapabilities.resources) ? ["resources"] : [],
39906
- ...(serverCapabilities == null ? void 0 : serverCapabilities.prompts) ? ["prompts"] : [],
39907
- ...(serverCapabilities == null ? void 0 : serverCapabilities.tools) ? ["tools"] : [],
39827
+ ...serverCapabilities?.resources ? ["resources"] : [],
39828
+ ...serverCapabilities?.prompts ? ["prompts"] : [],
39829
+ ...serverCapabilities?.tools ? ["tools"] : [],
39908
39830
  "ping",
39909
39831
  "sampling",
39910
39832
  "elicitations",
@@ -40059,7 +39981,7 @@ const App = () => {
40059
39981
  lastToolCallOriginTabRef.current = currentTabRef.current;
40060
39982
  try {
40061
39983
  const tool = tools.find((t) => t.name === name2);
40062
- const cleanedParams = (tool == null ? void 0 : tool.inputSchema) ? cleanParams(params, tool.inputSchema) : params;
39984
+ const cleanedParams = tool?.inputSchema ? cleanParams(params, tool.inputSchema) : params;
40063
39985
  const response = await sendMCPRequest(
40064
39986
  {
40065
39987
  method: "tools/call",
@@ -40117,13 +40039,13 @@ const App = () => {
40117
40039
  ) });
40118
40040
  if (window.location.pathname === "/oauth/callback") {
40119
40041
  const OAuthCallback = React.lazy(
40120
- () => __vitePreload(() => import("./OAuthCallback-0GeGMxax.js"), true ? [] : void 0)
40042
+ () => __vitePreload(() => import("./OAuthCallback-DOgG8dke.js"), true ? [] : void 0)
40121
40043
  );
40122
40044
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
40123
40045
  }
40124
40046
  if (window.location.pathname === "/oauth/callback/debug") {
40125
40047
  const OAuthDebugCallback = React.lazy(
40126
- () => __vitePreload(() => import("./OAuthDebugCallback-DEQBSYMe.js"), true ? [] : void 0)
40048
+ () => __vitePreload(() => import("./OAuthDebugCallback-m70IPFbL.js"), true ? [] : void 0)
40127
40049
  );
40128
40050
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
40129
40051
  }
@@ -40167,7 +40089,7 @@ const App = () => {
40167
40089
  onDisconnect: disconnectMcpServer,
40168
40090
  logLevel,
40169
40091
  sendLogLevelRequest,
40170
- loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false,
40092
+ loggingSupported: !!serverCapabilities?.logging || false,
40171
40093
  connectionType,
40172
40094
  setConnectionType
40173
40095
  }
@@ -40209,7 +40131,7 @@ const App = () => {
40209
40131
  TabsTrigger,
40210
40132
  {
40211
40133
  value: "resources",
40212
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.resources),
40134
+ disabled: !serverCapabilities?.resources,
40213
40135
  children: [
40214
40136
  /* @__PURE__ */ jsxRuntimeExports.jsx(Files, { className: "w-4 h-4 mr-2" }),
40215
40137
  "Resources"
@@ -40220,7 +40142,7 @@ const App = () => {
40220
40142
  TabsTrigger,
40221
40143
  {
40222
40144
  value: "prompts",
40223
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.prompts),
40145
+ disabled: !serverCapabilities?.prompts,
40224
40146
  children: [
40225
40147
  /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { className: "w-4 h-4 mr-2" }),
40226
40148
  "Prompts"
@@ -40231,7 +40153,7 @@ const App = () => {
40231
40153
  TabsTrigger,
40232
40154
  {
40233
40155
  value: "tools",
40234
- disabled: !(serverCapabilities == null ? void 0 : serverCapabilities.tools),
40156
+ disabled: !serverCapabilities?.tools,
40235
40157
  children: [
40236
40158
  /* @__PURE__ */ jsxRuntimeExports.jsx(Hammer, { className: "w-4 h-4 mr-2" }),
40237
40159
  "Tools"
@@ -40261,7 +40183,7 @@ const App = () => {
40261
40183
  "Auth"
40262
40184
  ] })
40263
40185
  ] }),
40264
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full", children: !(serverCapabilities == null ? void 0 : serverCapabilities.resources) && !(serverCapabilities == null ? void 0 : serverCapabilities.prompts) && !(serverCapabilities == null ? void 0 : serverCapabilities.tools) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
40186
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full", children: !serverCapabilities?.resources && !serverCapabilities?.prompts && !serverCapabilities?.tools ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
40265
40187
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg text-gray-500 dark:text-gray-400", children: "The connected server does not support any MCP capabilities" }) }),
40266
40188
  /* @__PURE__ */ jsxRuntimeExports.jsx(
40267
40189
  PingTab,
@@ -40307,7 +40229,7 @@ const App = () => {
40307
40229
  clearError("resources");
40308
40230
  setSelectedResource(resource);
40309
40231
  },
40310
- resourceSubscriptionsSupported: ((_a = serverCapabilities == null ? void 0 : serverCapabilities.resources) == null ? void 0 : _a.subscribe) || false,
40232
+ resourceSubscriptionsSupported: serverCapabilities?.resources?.subscribe || false,
40311
40233
  resourceSubscriptions,
40312
40234
  subscribeToResource: (uri) => {
40313
40235
  clearError("resources");