@blade-hq/agent-react 2612.0.0-beta.6 → 2612.0.0-beta.7

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.
@@ -2446,7 +2446,7 @@ var X = createLucideIcon("X", [
2446
2446
  ]);
2447
2447
 
2448
2448
  // src/components/PlanUpdateBlock.tsx
2449
- import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
2449
+ import { useEffect, useRef, useState } from "react";
2450
2450
 
2451
2451
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
2452
2452
  function r(e2) {
@@ -5666,382 +5666,6 @@ async function copyToClipboard(text) {
5666
5666
  }
5667
5667
  }
5668
5668
 
5669
- // src/chat/lib/code-language.ts
5670
- var FILE_EXTENSION_ALIASES = {
5671
- ".bash": "bash",
5672
- ".css": "css",
5673
- ".go": "go",
5674
- ".htm": "html",
5675
- ".html": "html",
5676
- ".js": "javascript",
5677
- ".json": "json",
5678
- ".jsonc": "json",
5679
- ".jsx": "jsx",
5680
- ".md": "markdown",
5681
- ".mdx": "markdown",
5682
- ".py": "python",
5683
- ".rs": "rust",
5684
- ".scss": "css",
5685
- ".sh": "bash",
5686
- ".ts": "typescript",
5687
- ".tsx": "tsx",
5688
- ".yaml": "yaml",
5689
- ".yml": "yaml",
5690
- ".zsh": "bash"
5691
- };
5692
- function getCodeLanguageFromFilename(filePath) {
5693
- if (!filePath) return null;
5694
- const dotIndex = filePath.lastIndexOf(".");
5695
- if (dotIndex < 0) return null;
5696
- return FILE_EXTENSION_ALIASES[filePath.slice(dotIndex).toLowerCase()] ?? null;
5697
- }
5698
-
5699
- // src/chat/runtime/environment.tsx
5700
- import { createContext as createContext3, useContext as useContext3, useMemo as useMemo2 } from "react";
5701
-
5702
- // src/chat/runtime/session-source.tsx
5703
- import { createInitialSessionState } from "@blade-hq/agent-client/internal";
5704
- import {
5705
- createContext as createContext2,
5706
- useContext as useContext2,
5707
- useEffect,
5708
- useLayoutEffect,
5709
- useMemo,
5710
- useRef,
5711
- useState,
5712
- useSyncExternalStore
5713
- } from "react";
5714
- import { jsx as jsx2 } from "react/jsx-runtime";
5715
- var EMPTY_SOURCE = {
5716
- subscribe: () => () => {
5717
- },
5718
- getSession: () => void 0,
5719
- isHistoryLoading: () => false,
5720
- planRevealRevision: () => 0
5721
- };
5722
- var SessionSourceContext = createContext2(EMPTY_SOURCE);
5723
- function SessionSourceProvider({ source, children }) {
5724
- return /* @__PURE__ */ jsx2(SessionSourceContext.Provider, { value: source, children });
5725
- }
5726
- function useSessionSource() {
5727
- return useContext2(SessionSourceContext);
5728
- }
5729
- var SingleSessionSource = class {
5730
- session = null;
5731
- loading = false;
5732
- listeners = /* @__PURE__ */ new Set();
5733
- revisions = /* @__PURE__ */ new Map();
5734
- subscribe = (listener) => {
5735
- this.listeners.add(listener);
5736
- return () => {
5737
- this.listeners.delete(listener);
5738
- };
5739
- };
5740
- getSession = (sessionId) => {
5741
- const current = this.session;
5742
- return current && (!sessionId || current.sessionId === sessionId) ? current : void 0;
5743
- };
5744
- isHistoryLoading = (sessionId) => {
5745
- if (!this.session) return this.loading;
5746
- return (!sessionId || this.session.sessionId === sessionId) && this.loading;
5747
- };
5748
- planRevealRevision = (sessionId) => sessionId ? this.revisions.get(sessionId) ?? 0 : 0;
5749
- update(session, loading) {
5750
- if (this.session === session && this.loading === loading) return;
5751
- this.session = session;
5752
- this.loading = loading;
5753
- this.notify();
5754
- }
5755
- /** 只认实时成功的根回路 update_plan:历史加载与断线补数不算「新揭示」。 */
5756
- watchPlan(session) {
5757
- return session.on("toolResult", ({ toolCall, turn, source }) => {
5758
- if (source === "reconnect_replay" || (turn.loop_id || "root") !== "root" || toolCall.status !== "done" || !isPlanUpdateTool(toolCall) || !parsePlanUpdate(toolCall.arguments)) {
5759
- return;
5760
- }
5761
- this.revisions.set(session.sessionId, (this.revisions.get(session.sessionId) ?? 0) + 1);
5762
- this.notify();
5763
- });
5764
- }
5765
- notify() {
5766
- for (const listener of [...this.listeners]) listener();
5767
- }
5768
- };
5769
- function useSingleSessionSource(session, loading) {
5770
- const [source] = useState(() => new SingleSessionSource());
5771
- useLayoutEffect(() => {
5772
- source.update(session, loading);
5773
- }, [source, session, loading]);
5774
- useEffect(() => session ? source.watchPlan(session) : void 0, [source, session]);
5775
- return source;
5776
- }
5777
- var EMPTY_STATE = createInitialSessionState("");
5778
- var noopSubscribe = () => () => {
5779
- };
5780
- function useSessionHandle(sessionId) {
5781
- const source = useSessionSource();
5782
- return useSyncExternalStore(
5783
- source.subscribe,
5784
- () => source.getSession(sessionId) ?? null,
5785
- () => source.getSession(sessionId) ?? null
5786
- );
5787
- }
5788
- function useSessionState(sessionId, selector) {
5789
- const session = useSessionHandle(sessionId);
5790
- const selectorRef = useRef(selector);
5791
- selectorRef.current = selector;
5792
- const store = useMemo(() => {
5793
- let lastState = null;
5794
- let lastSelector = null;
5795
- let lastSelected;
5796
- const getSnapshot = () => {
5797
- const state = session ? session.getState() : EMPTY_STATE;
5798
- const current = selectorRef.current;
5799
- if (state !== lastState || current !== lastSelector) {
5800
- const next = current(state);
5801
- if (!(lastState !== null && Object.is(next, lastSelected))) lastSelected = next;
5802
- lastState = state;
5803
- lastSelector = current;
5804
- }
5805
- return lastSelected;
5806
- };
5807
- return {
5808
- subscribe: session ? (listener) => session.subscribe(listener) : noopSubscribe,
5809
- getSnapshot
5810
- };
5811
- }, [session]);
5812
- return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
5813
- }
5814
- function useIsSessionHistoryLoading(sessionId) {
5815
- const source = useSessionSource();
5816
- return useSyncExternalStore(
5817
- source.subscribe,
5818
- () => source.isHistoryLoading(sessionId),
5819
- () => source.isHistoryLoading(sessionId)
5820
- );
5821
- }
5822
- function usePlanRevealRevision(sessionId) {
5823
- const source = useSessionSource();
5824
- return useSyncExternalStore(
5825
- source.subscribe,
5826
- () => source.planRevealRevision(sessionId),
5827
- () => source.planRevealRevision(sessionId)
5828
- );
5829
- }
5830
- var CurrentChatSessionContext = createContext2(null);
5831
- function CurrentChatSessionProvider({ sessionId, children }) {
5832
- return /* @__PURE__ */ jsx2(CurrentChatSessionContext.Provider, { value: sessionId, children });
5833
- }
5834
- function useCurrentChatSessionId() {
5835
- return useContext2(CurrentChatSessionContext);
5836
- }
5837
-
5838
- // src/chat/runtime/environment.tsx
5839
- import { jsx as jsx3 } from "react/jsx-runtime";
5840
- var EMPTY_ENVIRONMENT = {};
5841
- var ChatEnvironmentContext = createContext3(EMPTY_ENVIRONMENT);
5842
- function ChatEnvironmentProvider({ value, children }) {
5843
- return /* @__PURE__ */ jsx3(ChatEnvironmentContext.Provider, { value, children });
5844
- }
5845
- function useChatEnvironment() {
5846
- return useContext3(ChatEnvironmentContext);
5847
- }
5848
- var NO_HIGHLIGHT = { highlightedHtml: null };
5849
- function usePlainCode() {
5850
- return NO_HIGHLIGHT;
5851
- }
5852
- function useHighlightedCode(code, language) {
5853
- const use = useChatEnvironment().useHighlightedCode ?? usePlainCode;
5854
- return use(code, language);
5855
- }
5856
- function useNoDetail() {
5857
- return null;
5858
- }
5859
- function useChatSessionDetail(sessionId) {
5860
- const use = useChatEnvironment().useSessionDetail ?? useNoDetail;
5861
- return use(sessionId);
5862
- }
5863
- function useShowTodo() {
5864
- return false;
5865
- }
5866
- function useHideTodo() {
5867
- const use = useChatEnvironment().useHideTodo ?? useShowTodo;
5868
- return use();
5869
- }
5870
- function useChatRenderMode() {
5871
- return useChatEnvironment().renderMode ?? "normal";
5872
- }
5873
- function notifyChat(environment, kind, message, options) {
5874
- if (environment.notify) environment.notify(kind, message, options);
5875
- else if (kind === "error") console.error(message);
5876
- }
5877
- function useComposerBridge(sessionId) {
5878
- const environment = useChatEnvironment();
5879
- const session = useSessionHandle(sessionId);
5880
- return useMemo2(
5881
- () => ({
5882
- appendText(text, separate = false) {
5883
- if (!sessionId) return;
5884
- if (environment.appendToComposer) environment.appendToComposer(sessionId, text, separate);
5885
- else session?.insertText(separate ? `
5886
-
5887
- ${text}` : text);
5888
- },
5889
- addContext(context) {
5890
- if (!sessionId) return;
5891
- if (environment.addComposerContext) environment.addComposerContext(sessionId, context);
5892
- else session?.attach(context.label, context.content);
5893
- }
5894
- }),
5895
- [environment, session, sessionId]
5896
- );
5897
- }
5898
- var NO_VIRTUAL_ITEMS = [];
5899
- var NO_VIRTUALIZER = {
5900
- getVirtualItems: () => NO_VIRTUAL_ITEMS,
5901
- getTotalSize: () => 0,
5902
- measureElement: () => {
5903
- },
5904
- scrollToIndex: () => {
5905
- },
5906
- getOffsetForIndex: () => void 0
5907
- };
5908
- function useNoVirtualizer() {
5909
- return NO_VIRTUALIZER;
5910
- }
5911
- function useChatVirtualizer(options) {
5912
- const injected = useChatEnvironment().useVirtualizer;
5913
- const use = injected ?? useNoVirtualizer;
5914
- const virtualizer = use(options);
5915
- return { virtualizer, enabled: Boolean(injected) };
5916
- }
5917
-
5918
- // src/chat/tool-renderers/shared.tsx
5919
- import { jsx as jsx4 } from "react/jsx-runtime";
5920
- function getResultText(result) {
5921
- if (typeof result === "string") return result;
5922
- if (Array.isArray(result)) {
5923
- const texts = result.filter(
5924
- (p2) => typeof p2 === "object" && p2 !== null && p2.type === "text" && typeof p2.text === "string"
5925
- ).map((p2) => p2.text);
5926
- return texts.length > 0 ? texts.join("\n") : null;
5927
- }
5928
- return result != null ? String(result) : null;
5929
- }
5930
- function getResultImages(result) {
5931
- if (!Array.isArray(result)) return [];
5932
- return result.filter(
5933
- (p2) => typeof p2 === "object" && p2 !== null && p2.type === "image_url" && typeof p2.image_url?.url === "string"
5934
- ).map((p2) => p2.image_url);
5935
- }
5936
- function parseJsonValue(value) {
5937
- if (!value) return null;
5938
- try {
5939
- return JSON.parse(value);
5940
- } catch {
5941
- return null;
5942
- }
5943
- }
5944
- function isPlainObject(value) {
5945
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
5946
- }
5947
- function getStringValue(data, key) {
5948
- const value = data?.[key];
5949
- return typeof value === "string" && value.trim() ? value.trim() : null;
5950
- }
5951
- function getNumberValue(data, key) {
5952
- const value = data?.[key];
5953
- return typeof value === "number" && Number.isFinite(value) ? value : null;
5954
- }
5955
- function getBooleanValue(data, key) {
5956
- return data?.[key] === true;
5957
- }
5958
- function extractErrorMessage(value) {
5959
- const text = typeof value === "string" ? value : getResultText(value);
5960
- if (!text?.trim()) return null;
5961
- const parsed = parseJsonValue(text);
5962
- if (!isPlainObject(parsed)) return null;
5963
- return typeof parsed.error === "string" && parsed.error.trim() ? parsed.error.trim() : null;
5964
- }
5965
- function getFileName(filePath) {
5966
- if (!filePath) return "\u672A\u547D\u540D\u6587\u4EF6";
5967
- return filePath.split(/[\\/]/).pop() ?? filePath;
5968
- }
5969
- function getCodeLanguage(filePath) {
5970
- return getCodeLanguageFromFilename(filePath);
5971
- }
5972
- function formatBytes(size4) {
5973
- if (typeof size4 !== "number" || !Number.isFinite(size4) || size4 < 0) return null;
5974
- if (size4 < 1024) return `${size4} B`;
5975
- if (size4 < 1024 * 1024) return `${(size4 / 1024).toFixed(1)} KB`;
5976
- return `${(size4 / (1024 * 1024)).toFixed(1)} MB`;
5977
- }
5978
- function CodePreview({
5979
- content,
5980
- filePath,
5981
- emptyLabel = "\uFF08\u6682\u65E0\u5185\u5BB9\uFF09",
5982
- className
5983
- }) {
5984
- const { highlightedHtml } = useHighlightedCode(content, getCodeLanguage(filePath));
5985
- if (!content.trim()) {
5986
- return /* @__PURE__ */ jsx4(
5987
- "pre",
5988
- {
5989
- className: cn(
5990
- "overflow-auto rounded-lg border border-[hsl(var(--border))]",
5991
- "bg-[hsl(var(--muted))]/35 p-3 font-mono text-[11px] text-[hsl(var(--muted-foreground))]",
5992
- className
5993
- ),
5994
- children: /* @__PURE__ */ jsx4("code", { children: emptyLabel })
5995
- }
5996
- );
5997
- }
5998
- return /* @__PURE__ */ jsx4(
5999
- "pre",
6000
- {
6001
- className: cn(
6002
- "overflow-auto rounded-lg border border-[hsl(var(--border))]",
6003
- "bg-[hsl(var(--muted))]/35 p-3 text-[11px]",
6004
- className
6005
- ),
6006
- children: highlightedHtml ? /* @__PURE__ */ jsx4(
6007
- "code",
6008
- {
6009
- className: "font-mono",
6010
- dangerouslySetInnerHTML: { __html: highlightedHtml }
6011
- }
6012
- ) : /* @__PURE__ */ jsx4("code", { className: "whitespace-pre-wrap break-words font-mono text-[hsl(var(--foreground))]", children: content })
6013
- }
6014
- );
6015
- }
6016
-
6017
- // src/chat/tool-renderers/kb-search-result.ts
6018
- function parseKbSearchResult(result) {
6019
- const value = parseJsonValue(getResultText(result));
6020
- if (!isPlainObject(value) || !Array.isArray(value.hits)) return null;
6021
- const hits = value.hits.filter(isPlainObject).map((hit, index2) => ({
6022
- n: typeof hit.n === "number" ? hit.n : index2 + 1,
6023
- kbName: getStringValue(hit, "kb_name") ?? "",
6024
- title: getStringValue(hit, "title") ?? getStringValue(hit, "path") ?? "\u672A\u547D\u540D\u6587\u6863",
6025
- path: getStringValue(hit, "path") ?? "",
6026
- page: typeof hit.page === "number" ? hit.page : null,
6027
- heading: getStringValue(hit, "heading"),
6028
- text: getStringValue(hit, "text") ?? "",
6029
- previewUrl: getStringValue(hit, "preview_url")
6030
- }));
6031
- return {
6032
- summary: getStringValue(value, "summary"),
6033
- query: getStringValue(value, "query"),
6034
- hits
6035
- };
6036
- }
6037
- function formatKbSearchLabel(result) {
6038
- const parsed = parseKbSearchResult(result);
6039
- if (!parsed) return null;
6040
- const names = [...new Set(parsed.hits.map((hit) => hit.kbName).filter(Boolean))];
6041
- const scope = names.length > 0 ? names.map((name) => `\u300A${name}\u300B`).join("") : "\u77E5\u8BC6\u5E93";
6042
- return `\u{1F50D} \u5728${scope}\u68C0\u7D22\u5230 ${parsed.hits.length} \u6761`;
6043
- }
6044
-
6045
5669
  // src/chat/display-utils.ts
6046
5670
  var TOOL_NAME_ALIASES = {
6047
5671
  agent: "Agent",
@@ -6056,7 +5680,6 @@ var TOOL_NAME_ALIASES = {
6056
5680
  finish_task: "FinishTask",
6057
5681
  glob: "Glob",
6058
5682
  grep: "Grep",
6059
- kb_search: "KbSearch",
6060
5683
  ls: "Ls",
6061
5684
  multi_edit: "MultiEdit",
6062
5685
  read: "Read",
@@ -6076,7 +5699,6 @@ var TOOL_DISPLAY_LABELS = {
6076
5699
  Ls: "\u5217\u51FA\u76EE\u5F55",
6077
5700
  Glob: "\u5339\u914D\u6587\u4EF6",
6078
5701
  Grep: "\u641C\u7D22\u6587\u672C",
6079
- KbSearch: "\u68C0\u7D22\u77E5\u8BC6\u5E93",
6080
5702
  WebSearch: "\u641C\u7D22\u7F51\u9875",
6081
5703
  WebFetch: "\u6574\u7406\u7F51\u9875\u5185\u5BB9",
6082
5704
  Agent: "\u6D3E\u751F\u5B50\u667A\u80FD\u4F53",
@@ -6114,7 +5736,7 @@ function safeParseJson(value) {
6114
5736
  return null;
6115
5737
  }
6116
5738
  }
6117
- function isPlainObject2(value) {
5739
+ function isPlainObject(value) {
6118
5740
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
6119
5741
  }
6120
5742
  function getStringArgValue(args, key) {
@@ -6126,7 +5748,7 @@ function getCommandDescription(args) {
6126
5748
  }
6127
5749
  function getToolDescription(toolCall) {
6128
5750
  const args = safeParseJson(toolCall.arguments);
6129
- if (!isPlainObject2(args)) return null;
5751
+ if (!isPlainObject(args)) return null;
6130
5752
  return getCommandDescription(args) || null;
6131
5753
  }
6132
5754
  function formatFileName(filePath) {
@@ -6184,12 +5806,6 @@ function getToolDisplayLabel(toolCall) {
6184
5806
  const title = args && typeof args.title === "string" ? args.title : "";
6185
5807
  return title ? `${baseLabel}\uFF1A${title}` : baseLabel;
6186
5808
  }
6187
- if (normalized === "KbSearch") {
6188
- const resultLabel = formatKbSearchLabel(toolCall.result);
6189
- if (resultLabel) return resultLabel;
6190
- const query = getStringArgValue(args, "query");
6191
- return query ? `${baseLabel}\uFF1A${query}` : baseLabel;
6192
- }
6193
5809
  return description || baseLabel;
6194
5810
  }
6195
5811
  function getToolTone(status) {
@@ -6226,7 +5842,7 @@ function extractToolFilePaths(toolCall) {
6226
5842
  for (const item of value) collect(item, depth + 1, allowPlainString);
6227
5843
  return;
6228
5844
  }
6229
- if (!isPlainObject2(value)) return;
5845
+ if (!isPlainObject(value)) return;
6230
5846
  for (const key of PRIORITY_FILE_KEYS) collect(value[key], depth + 1, true);
6231
5847
  for (const [key, nested] of Object.entries(value)) {
6232
5848
  if (!PRIORITY_FILE_KEYS.includes(key) && nested && typeof nested === "object") collect(nested, depth + 1, false);
@@ -6241,7 +5857,7 @@ function extractToolFilePaths(toolCall) {
6241
5857
  }
6242
5858
  } else if (Array.isArray(value)) {
6243
5859
  for (const item of value) collectPatchHeaders(item);
6244
- } else if (isPlainObject2(value)) {
5860
+ } else if (isPlainObject(value)) {
6245
5861
  for (const [key, nested] of Object.entries(value)) {
6246
5862
  if (key.toLowerCase().includes("patch") || key.toLowerCase().includes("diff")) collectPatchHeaders(nested);
6247
5863
  }
@@ -6265,7 +5881,7 @@ function getToolOutputTag(toolCall) {
6265
5881
  }
6266
5882
 
6267
5883
  // src/components/PlanUpdateBlock.tsx
6268
- import { jsx as jsx5, jsxs } from "react/jsx-runtime";
5884
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
6269
5885
  var PLAN_STEP_STATUSES = /* @__PURE__ */ new Set(["pending", "in_progress", "completed"]);
6270
5886
  var PLAN_AUTO_COLLAPSE_MS = 5e3;
6271
5887
  function isPlanUpdateTool(toolCall) {
@@ -6320,12 +5936,12 @@ function PlanStepIcon({
6320
5936
  running = false
6321
5937
  }) {
6322
5938
  if (status === "completed") {
6323
- return /* @__PURE__ */ jsx5(Check, { size: size4, strokeWidth: 2, className: "shrink-0 text-emerald-500" });
5939
+ return /* @__PURE__ */ jsx2(Check, { size: size4, strokeWidth: 2, className: "shrink-0 text-emerald-500" });
6324
5940
  }
6325
5941
  if (status === "in_progress") {
6326
- return running ? /* @__PURE__ */ jsx5(LoaderCircle, { size: size4, className: "shrink-0 animate-spin text-[hsl(var(--muted-foreground))]" }) : /* @__PURE__ */ jsx5(CircleDot, { size: size4, className: "shrink-0 text-amber-500" });
5942
+ return running ? /* @__PURE__ */ jsx2(LoaderCircle, { size: size4, className: "shrink-0 animate-spin text-[hsl(var(--muted-foreground))]" }) : /* @__PURE__ */ jsx2(CircleDot, { size: size4, className: "shrink-0 text-amber-500" });
6327
5943
  }
6328
- return /* @__PURE__ */ jsx5(Circle, { size: size4, className: "shrink-0 text-[hsl(var(--muted-foreground))]/60" });
5944
+ return /* @__PURE__ */ jsx2(Circle, { size: size4, className: "shrink-0 text-[hsl(var(--muted-foreground))]/60" });
6329
5945
  }
6330
5946
  function PlanUpdateBlock({
6331
5947
  toolCall,
@@ -6335,10 +5951,10 @@ function PlanUpdateBlock({
6335
5951
  }) {
6336
5952
  const updateKey = `${toolCall.id}:${toolCall.arguments}`;
6337
5953
  const revealKey = autoReveal ? updateKey : null;
6338
- const [collapsed, setCollapsed] = useState2(!autoReveal);
6339
- const collapseTimerRef = useRef2(null);
5954
+ const [collapsed, setCollapsed] = useState(!autoReveal);
5955
+ const collapseTimerRef = useRef(null);
6340
5956
  const data = parsePlanUpdate(toolCall.arguments);
6341
- useEffect2(() => {
5957
+ useEffect(() => {
6342
5958
  if (!revealKey) return;
6343
5959
  if (collapseTimerRef.current) clearTimeout(collapseTimerRef.current);
6344
5960
  setCollapsed(false);
@@ -6347,7 +5963,7 @@ function PlanUpdateBlock({
6347
5963
  collapseTimerRef.current = null;
6348
5964
  }, PLAN_AUTO_COLLAPSE_MS);
6349
5965
  }, [revealKey]);
6350
- useEffect2(
5966
+ useEffect(
6351
5967
  () => () => {
6352
5968
  if (collapseTimerRef.current) clearTimeout(collapseTimerRef.current);
6353
5969
  },
@@ -6376,20 +5992,20 @@ function PlanUpdateBlock({
6376
5992
  ),
6377
5993
  children: [
6378
5994
  collapsed && currentStep ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5 text-xs text-[hsl(var(--foreground))]", children: [
6379
- /* @__PURE__ */ jsx5(PlanStepIcon, { status: currentStep.status, size: 14, running }),
6380
- /* @__PURE__ */ jsx5("span", { className: "truncate", children: currentStep.step }),
6381
- pausedAtCurrentStep ? /* @__PURE__ */ jsx5("span", { className: "shrink-0 text-[11px] text-amber-500", children: "\u5DF2\u6682\u505C" }) : null
5995
+ /* @__PURE__ */ jsx2(PlanStepIcon, { status: currentStep.status, size: 14, running }),
5996
+ /* @__PURE__ */ jsx2("span", { className: "truncate", children: currentStep.step }),
5997
+ pausedAtCurrentStep ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-[11px] text-amber-500", children: "\u5DF2\u6682\u505C" }) : null
6382
5998
  ] }) : /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
6383
- /* @__PURE__ */ jsx5(ListChecks, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
6384
- /* @__PURE__ */ jsx5("span", { className: "truncate", children: "\u4EFB\u52A1\u8FDB\u5EA6" }),
6385
- pausedAtCurrentStep ? /* @__PURE__ */ jsx5("span", { className: "shrink-0 text-amber-500", children: "\u5DF2\u6682\u505C" }) : null
5999
+ /* @__PURE__ */ jsx2(ListChecks, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
6000
+ /* @__PURE__ */ jsx2("span", { className: "truncate", children: "\u4EFB\u52A1\u8FDB\u5EA6" }),
6001
+ pausedAtCurrentStep ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-amber-500", children: "\u5DF2\u6682\u505C" }) : null
6386
6002
  ] }),
6387
6003
  /* @__PURE__ */ jsxs("span", { className: "shrink-0 text-[11px] tabular-nums text-[hsl(var(--muted-foreground))]", children: [
6388
6004
  completed,
6389
6005
  "/",
6390
6006
  data.plan.length
6391
6007
  ] }),
6392
- /* @__PURE__ */ jsx5(
6008
+ /* @__PURE__ */ jsx2(
6393
6009
  ChevronDown,
6394
6010
  {
6395
6011
  size: 14,
@@ -6402,7 +6018,7 @@ function PlanUpdateBlock({
6402
6018
  ]
6403
6019
  }
6404
6020
  ),
6405
- /* @__PURE__ */ jsx5(
6021
+ /* @__PURE__ */ jsx2(
6406
6022
  "div",
6407
6023
  {
6408
6024
  "aria-hidden": collapsed,
@@ -6410,9 +6026,9 @@ function PlanUpdateBlock({
6410
6026
  "grid transition-[grid-template-rows,opacity] duration-300 ease-out motion-reduce:transition-none",
6411
6027
  collapsed ? "grid-rows-[0fr] opacity-0" : "grid-rows-[1fr] opacity-100"
6412
6028
  ),
6413
- children: /* @__PURE__ */ jsx5("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx5("div", { className: "flex max-h-40 flex-col gap-0.5 overflow-y-auto px-3 py-2", children: data.plan.length === 0 ? /* @__PURE__ */ jsx5("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u4EFB\u52A1\u6B65\u9AA4" }) : data.plan.map((item, index2) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 py-0.5", children: [
6414
- /* @__PURE__ */ jsx5("span", { className: "mt-[3px] flex shrink-0", children: /* @__PURE__ */ jsx5(PlanStepIcon, { status: item.status, size: 14, running }) }),
6415
- /* @__PURE__ */ jsx5(
6029
+ children: /* @__PURE__ */ jsx2("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx2("div", { className: "flex max-h-40 flex-col gap-0.5 overflow-y-auto px-3 py-2", children: data.plan.length === 0 ? /* @__PURE__ */ jsx2("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u4EFB\u52A1\u6B65\u9AA4" }) : data.plan.map((item, index2) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 py-0.5", children: [
6030
+ /* @__PURE__ */ jsx2("span", { className: "mt-[3px] flex shrink-0", children: /* @__PURE__ */ jsx2(PlanStepIcon, { status: item.status, size: 14, running }) }),
6031
+ /* @__PURE__ */ jsx2(
6416
6032
  "span",
6417
6033
  {
6418
6034
  className: cn(
@@ -7690,7 +7306,7 @@ function canExpand(schema, uiSchema = {}, formData) {
7690
7306
  }
7691
7307
 
7692
7308
  // ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/isPlainObject.js
7693
- function isPlainObject3(thing) {
7309
+ function isPlainObject2(thing) {
7694
7310
  if (typeof thing !== "object" || thing === null) {
7695
7311
  return false;
7696
7312
  }
@@ -11584,7 +11200,7 @@ var ErrorSchemaBuilder = class {
11584
11200
 
11585
11201
  // ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/getChangedFields.js
11586
11202
  function getChangedDescendants(a, b) {
11587
- if (isPlainObject3(a) && isPlainObject3(b)) {
11203
+ if (isPlainObject2(a) && isPlainObject2(b)) {
11588
11204
  return getChangedFields(a, b, true);
11589
11205
  }
11590
11206
  if (Array.isArray(a) && Array.isArray(b) && a.length === b.length) {
@@ -11602,10 +11218,10 @@ function getChangedFields(a, b, deep = false) {
11602
11218
  if (a === b) {
11603
11219
  return [];
11604
11220
  }
11605
- if (!isPlainObject3(a)) {
11606
- return isPlainObject3(b) ? Object.keys(b) : [];
11221
+ if (!isPlainObject2(a)) {
11222
+ return isPlainObject2(b) ? Object.keys(b) : [];
11607
11223
  }
11608
- if (!isPlainObject3(b)) {
11224
+ if (!isPlainObject2(b)) {
11609
11225
  return Object.keys(a);
11610
11226
  }
11611
11227
  const aKeys = Object.keys(a);
@@ -12196,7 +11812,7 @@ function errorsFrom(errorSchema, fieldPath) {
12196
11812
  const errorList = Array.isArray(errors) ? errors.map((message) => ({ property, message, stack: `${property} ${message}` })) : [];
12197
11813
  return Object.keys(errorSchema).reduce((currentList, key) => {
12198
11814
  const childSchema = errorSchema[key];
12199
- if (key !== ERRORS_KEY && isPlainObject3(childSchema)) {
11815
+ if (key !== ERRORS_KEY && isPlainObject2(childSchema)) {
12200
11816
  return currentList.concat(errorsFrom(childSchema, [...fieldPath, key]));
12201
11817
  }
12202
11818
  return currentList;
@@ -12218,7 +11834,7 @@ function toFieldPathId(fieldPath, globalFormOptions, parentPath, isMultiValue) {
12218
11834
 
12219
11835
  // ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/useAltDateWidgetProps.js
12220
11836
  import { jsx as _jsx3 } from "react/jsx-runtime";
12221
- import { useCallback, useEffect as useEffect3, useMemo as useMemo3, useState as useState3 } from "react";
11837
+ import { useCallback, useEffect as useEffect2, useMemo, useState as useState2 } from "react";
12222
11838
  function readyForChange(state) {
12223
11839
  return Object.values(state).every((value) => value !== -1);
12224
11840
  }
@@ -12231,8 +11847,8 @@ function DateElement(props) {
12231
11847
  }
12232
11848
  function useAltDateWidgetProps(props) {
12233
11849
  const { time: time2 = false, disabled = false, readonly = false, options, onChange, value } = props;
12234
- const [state, setState] = useState3(parseDateString(value, time2));
12235
- useEffect3(() => {
11850
+ const [state, setState] = useState2(parseDateString(value, time2));
11851
+ useEffect2(() => {
12236
11852
  setState(parseDateString(value, time2));
12237
11853
  }, [time2, value]);
12238
11854
  const handleChange = useCallback((property, newValue) => {
@@ -12261,14 +11877,14 @@ function useAltDateWidgetProps(props) {
12261
11877
  const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), time2);
12262
11878
  onChange(toDateString(nextState, time2));
12263
11879
  }, [disabled, readonly, time2, onChange]);
12264
- const elements = useMemo3(() => getDateElementProps(state, time2, options.yearsRange, options.format), [state, time2, options.yearsRange, options.format]);
11880
+ const elements = useMemo(() => getDateElementProps(state, time2, options.yearsRange, options.format), [state, time2, options.yearsRange, options.format]);
12265
11881
  return { elements, handleChange, handleClear, handleSetNow };
12266
11882
  }
12267
11883
 
12268
11884
  // ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/useDeepCompareMemo.js
12269
- import { useRef as useRef3 } from "react";
11885
+ import { useRef as useRef2 } from "react";
12270
11886
  function useDeepCompareMemo(newValue) {
12271
- const valueRef = useRef3(newValue);
11887
+ const valueRef = useRef2(newValue);
12272
11888
  if (!deepEquals_default(newValue, valueRef.current)) {
12273
11889
  valueRef.current = newValue;
12274
11890
  }
@@ -12276,7 +11892,7 @@ function useDeepCompareMemo(newValue) {
12276
11892
  }
12277
11893
 
12278
11894
  // ../../node_modules/.pnpm/@rjsf+utils@6.10.0_react@19.2.4/node_modules/@rjsf/utils/lib/useFileWidgetProps.js
12279
- import { useCallback as useCallback2, useMemo as useMemo4 } from "react";
11895
+ import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
12280
11896
  function addNameToDataURL(dataURL, name) {
12281
11897
  return dataURL.replace(";base64", `;name=${encodeURIComponent(name)};base64`);
12282
11898
  }
@@ -12330,13 +11946,13 @@ function extractFileInfo(dataURLs) {
12330
11946
  }, []);
12331
11947
  }
12332
11948
  function useFileWidgetProps(value, onChange, multiple = false) {
12333
- const values = useMemo4(() => {
11949
+ const values = useMemo2(() => {
12334
11950
  if (multiple && value) {
12335
11951
  return Array.isArray(value) ? value : [value];
12336
11952
  }
12337
11953
  return [];
12338
11954
  }, [value, multiple]);
12339
- const filesInfo = useMemo4(() => Array.isArray(value) ? extractFileInfo(value) : extractFileInfo([value || ""]), [value]);
11955
+ const filesInfo = useMemo2(() => Array.isArray(value) ? extractFileInfo(value) : extractFileInfo([value || ""]), [value]);
12340
11956
  const handleChange = useCallback2(async (files) => {
12341
11957
  const filesInfoEvent = await processFiles(files);
12342
11958
  const newValue = filesInfoEvent.map((fileInfo) => fileInfo.dataURL || null);
@@ -12462,7 +12078,7 @@ var TranslatableString;
12462
12078
 
12463
12079
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/ArrayField.js
12464
12080
  import { jsx as _jsx4 } from "react/jsx-runtime";
12465
- import { memo, useCallback as useCallback3, useMemo as useMemo5, useRef as useRef4, useState as useState4 } from "react";
12081
+ import { memo, useCallback as useCallback3, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
12466
12082
  var rowIdCounter = 0;
12467
12083
  function generateRowId() {
12468
12084
  rowIdCounter += 1;
@@ -12556,8 +12172,8 @@ function ArrayAsFiles(props) {
12556
12172
  function ArrayFieldItemInner(props) {
12557
12173
  const { itemKey, index: index2, name, disabled, hideError, readonly, registry, uiOptions, parentUiSchema, canAdd, canRemove = true, canMoveUp, canMoveDown, rawItemSchema, itemData, itemUiSchema, parentFieldPathId, itemErrorSchema, autofocus, onBlur, onFocus, onChange, rawErrors, totalItems, title, handleAddItem, handleCopyItem, handleRemoveItem, handleReorderItems } = props;
12558
12174
  const { schemaUtils, fields: { ArraySchemaField, SchemaField: SchemaField2 }, globalUiOptions, globalFormOptions } = registry;
12559
- const itemSchema = useMemo5(() => schemaUtils.retrieveSchema(rawItemSchema, itemData), [schemaUtils, rawItemSchema, itemData]);
12560
- const fieldPathId = useMemo5(() => toFieldPathId(index2, globalFormOptions, parentFieldPathId), [index2, globalFormOptions, parentFieldPathId]);
12175
+ const itemSchema = useMemo3(() => schemaUtils.retrieveSchema(rawItemSchema, itemData), [schemaUtils, rawItemSchema, itemData]);
12176
+ const fieldPathId = useMemo3(() => toFieldPathId(index2, globalFormOptions, parentFieldPathId), [index2, globalFormOptions, parentFieldPathId]);
12561
12177
  const ItemSchemaField = ArraySchemaField || SchemaField2;
12562
12178
  const ArrayFieldItemTemplate2 = getTemplate("ArrayFieldItemTemplate", registry, uiOptions);
12563
12179
  const displayLabel = schemaUtils.getDisplayLabel(itemSchema, itemUiSchema, globalUiOptions);
@@ -12631,13 +12247,13 @@ function NormalArray(props) {
12631
12247
  const fieldTitle = schema.title || title || name;
12632
12248
  const { schemaUtils, fields: fields2, formContext, globalUiOptions } = registry;
12633
12249
  const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
12634
- const uiOptions = useMemo5(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
12635
- const schemaItems = useMemo5(() => isObject(schema.items) ? schema.items : {}, [schema.items]);
12636
- const itemsSchema = useMemo5(() => schemaUtils.retrieveSchema(schemaItems), [schemaUtils, schemaItems]);
12637
- const formData = useMemo5(() => keyedToPlainFormData(keyedFormData), [keyedFormData]);
12250
+ const uiOptions = useMemo3(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
12251
+ const schemaItems = useMemo3(() => isObject(schema.items) ? schema.items : {}, [schema.items]);
12252
+ const itemsSchema = useMemo3(() => schemaUtils.retrieveSchema(schemaItems), [schemaUtils, schemaItems]);
12253
+ const formData = useMemo3(() => keyedToPlainFormData(keyedFormData), [keyedFormData]);
12638
12254
  const renderOptionalField = shouldRenderOptionalField(registry, schema, required, uiSchema);
12639
12255
  const hasFormData = isFormDataAvailable(formDataFromProps);
12640
- const canAdd = useMemo5(() => canAddItem(registry, schema, formData, uiSchema) && (!renderOptionalField || hasFormData), [registry, schema, formData, uiSchema, renderOptionalField, hasFormData]);
12256
+ const canAdd = useMemo3(() => canAddItem(registry, schema, formData, uiSchema) && (!renderOptionalField || hasFormData), [registry, schema, formData, uiSchema, renderOptionalField, hasFormData]);
12641
12257
  const actualFormData = hasFormData ? keyedFormData : [];
12642
12258
  const extraClass = renderOptionalField ? " rjsf-optional-array-field" : "";
12643
12259
  const childFieldPathId = props.childFieldPathId ?? fieldPathId;
@@ -12704,11 +12320,11 @@ function FixedArray(props) {
12704
12320
  let { formData: items = [] } = props;
12705
12321
  const fieldTitle = schema.title || title || name;
12706
12322
  const { fields: fields2, formContext, globalUiOptions } = registry;
12707
- const uiOptions = useMemo5(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
12323
+ const uiOptions = useMemo3(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
12708
12324
  const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
12709
12325
  const renderOptionalField = shouldRenderOptionalField(registry, schema, required, uiSchema);
12710
12326
  const hasFormData = isFormDataAvailable(formData);
12711
- const schemaItems = useMemo5(() => Array.isArray(schema.items) ? schema.items : [], [schema.items]);
12327
+ const schemaItems = useMemo3(() => Array.isArray(schema.items) ? schema.items : [], [schema.items]);
12712
12328
  const hasAdditionalItems = isObject(schema.additionalItems);
12713
12329
  const childFieldPathId = props.childFieldPathId ?? fieldPathId;
12714
12330
  if (items.length < schemaItems.length) {
@@ -12787,8 +12403,8 @@ function FixedArray(props) {
12787
12403
  return _jsx4(Template, { ...arrayProps });
12788
12404
  }
12789
12405
  function useKeyedFormData(formData = []) {
12790
- const newHash = useMemo5(() => hashObject(formData), [formData]);
12791
- const [state, setState] = useState4(() => ({
12406
+ const newHash = useMemo3(() => hashObject(formData), [formData]);
12407
+ const [state, setState] = useState3(() => ({
12792
12408
  formDataHash: newHash,
12793
12409
  keyedFormData: generateKeyedFormData(formData)
12794
12410
  }));
@@ -12815,9 +12431,9 @@ function ArrayField(props) {
12815
12431
  const { schema, uiSchema, errorSchema, fieldPathId, registry, formData, onChange } = props;
12816
12432
  const { globalFormOptions, schemaUtils, translateString } = registry;
12817
12433
  const { keyedFormData, updateKeyedFormData } = useKeyedFormData(formData);
12818
- const keyedFormDataRef = useRef4(keyedFormData);
12434
+ const keyedFormDataRef = useRef3(keyedFormData);
12819
12435
  keyedFormDataRef.current = keyedFormData;
12820
- const errorSchemaRef = useRef4(errorSchema);
12436
+ const errorSchemaRef = useRef3(errorSchema);
12821
12437
  errorSchemaRef.current = errorSchema;
12822
12438
  const childFieldPathId = props.childFieldPathId ?? fieldPathId;
12823
12439
  const handleAddItem = useCallback3((event, index2) => {
@@ -13035,9 +12651,9 @@ var BooleanField_default = BooleanField;
13035
12651
 
13036
12652
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/CyclicSchemaField.js
13037
12653
  import { jsx as _jsx6 } from "react/jsx-runtime";
13038
- import { useState as useState5 } from "react";
12654
+ import { useState as useState4 } from "react";
13039
12655
  function CyclicSchemaField(props) {
13040
- const [expanded, setExpanded] = useState5(false);
12656
+ const [expanded, setExpanded] = useState4(false);
13041
12657
  const { name, registry, schema, uiSchema, fieldPathId } = props;
13042
12658
  const { globalUiOptions } = registry;
13043
12659
  const uiOptions = getUiOptions(uiSchema, globalUiOptions);
@@ -13052,7 +12668,7 @@ function CyclicSchemaField(props) {
13052
12668
 
13053
12669
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/FallbackField.js
13054
12670
  import { jsx as _jsx7 } from "react/jsx-runtime";
13055
- import { useMemo as useMemo6, useState as useState6 } from "react";
12671
+ import { useMemo as useMemo4, useState as useState5 } from "react";
13056
12672
  function getFallbackTypeSelectionSchema(title) {
13057
12673
  return {
13058
12674
  type: "string",
@@ -13088,11 +12704,11 @@ function castToNewType(formData, newType) {
13088
12704
  function FallbackField(props) {
13089
12705
  const { id, formData, displayLabel = true, schema, name, uiSchema, required, disabled = false, readonly = false, onBlur, onFocus, registry, fieldPathId, onChange, errorSchema } = props;
13090
12706
  const { translateString, fields: fields2, globalFormOptions } = registry;
13091
- const [type, setType] = useState6(getTypeOfFormData(formData));
12707
+ const [type, setType] = useState5(getTypeOfFormData(formData));
13092
12708
  const uiOptions = getUiOptions(uiSchema);
13093
12709
  const typeSelectorInnerFieldPathId = useDeepCompareMemo(toFieldPathId("__internal_type_selector", globalFormOptions, fieldPathId));
13094
12710
  const schemaTitle = translateString(TranslatableString.Type);
13095
- const typesOptionSchema = useMemo6(() => getFallbackTypeSelectionSchema(schemaTitle), [schemaTitle]);
12711
+ const typesOptionSchema = useMemo4(() => getFallbackTypeSelectionSchema(schemaTitle), [schemaTitle]);
13096
12712
  const onTypeChange = (newType) => {
13097
12713
  if (newType != null) {
13098
12714
  setType(newType);
@@ -13179,7 +12795,7 @@ function conditionMatches(operator, datum, value = "$0m3tH1nG Un3xP3cT3d") {
13179
12795
  function findChildrenAndProps(layoutGridSchema, schemaKey, registry) {
13180
12796
  let gridProps = {};
13181
12797
  let children = layoutGridSchema[schemaKey];
13182
- if (isPlainObject3(children)) {
12798
+ if (isPlainObject2(children)) {
13183
12799
  const { children: elements, className: toMapClassNames, ...otherProps } = children;
13184
12800
  children = elements;
13185
12801
  if (toMapClassNames) {
@@ -13431,7 +13047,7 @@ function LayoutHeaderField(props) {
13431
13047
 
13432
13048
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/LayoutMultiSchemaField.js
13433
13049
  import { jsx as _jsx10 } from "react/jsx-runtime";
13434
- import { useState as useState7, useEffect as useEffect4 } from "react";
13050
+ import { useState as useState6, useEffect as useEffect3 } from "react";
13435
13051
  function getSelectedOption(options, selectorField, value) {
13436
13052
  const defaultValue = "!@#!@$@#$!@$#";
13437
13053
  const schemaOptions = options.map(({ schema }) => schema);
@@ -13458,7 +13074,7 @@ function computeEnumOptions(schema, options, schemaUtils, uiSchema, formData) {
13458
13074
  function LayoutMultiSchemaField(props) {
13459
13075
  const { name, baseType, disabled = false, formData, fieldPathId, onBlur, onChange, options, onFocus, registry, uiSchema, schema, autofocus, readonly, required, errorSchema, hideError = false } = props;
13460
13076
  const { widgets: widgets2, schemaUtils, globalUiOptions } = registry;
13461
- const [enumOptions, setEnumOptions] = useState7(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
13077
+ const [enumOptions, setEnumOptions] = useState6(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
13462
13078
  const id = fieldPathId[ID_KEY];
13463
13079
  const discriminator = getDiscriminatorFieldFromSchema(schema);
13464
13080
  const FieldErrorTemplate2 = getTemplate("FieldErrorTemplate", registry, options);
@@ -13467,7 +13083,7 @@ function LayoutMultiSchemaField(props) {
13467
13083
  const optionsHash = hashObject(options);
13468
13084
  const uiSchemaHash = uiSchema ? hashObject(uiSchema) : "";
13469
13085
  const formDataHash = formData ? hashObject(formData) : "";
13470
- useEffect4(() => {
13086
+ useEffect3(() => {
13471
13087
  setEnumOptions(computeEnumOptions(schema, options, schemaUtils, uiSchema, formData));
13472
13088
  }, [schemaHash, optionsHash, schemaUtils, uiSchemaHash, formDataHash]);
13473
13089
  const { widget = discriminator ? "radio" : "select", title = "", placeholder = "", optionsSchemaSelector: selectorField = discriminator, hideError: uiSchemaHideError, ...uiOptions } = getUiOptions(uiSchema);
@@ -13506,24 +13122,24 @@ function LayoutMultiSchemaField(props) {
13506
13122
 
13507
13123
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/MultiSchemaField.js
13508
13124
  import { jsx as _jsx11 } from "react/jsx-runtime";
13509
- import { useCallback as useCallback5, useEffect as useEffect5, useMemo as useMemo7, useRef as useRef5, useState as useState8 } from "react";
13125
+ import { useCallback as useCallback5, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef4, useState as useState7 } from "react";
13510
13126
  function AnyOfField(props) {
13511
13127
  const { name, disabled = false, errorSchema, formData, fieldPathId, onBlur, onChange, onFocus, options, readonly, registry, required = false, schema, uiSchema } = props;
13512
13128
  const { schemaUtils } = registry;
13513
13129
  const formDataHash = hashObject(formData ?? null);
13514
- const retrievedOptions = useMemo7(
13130
+ const retrievedOptions = useMemo5(
13515
13131
  () => options.map((opt) => schemaUtils.retrieveSchema(opt, formData)),
13516
13132
  // oxlint-disable-next-line react-hooks/exhaustive-deps -- formDataHash is the value-stable proxy for formData
13517
13133
  [options, schemaUtils, formDataHash]
13518
13134
  );
13519
- const [selectedOption, setSelectedOption] = useState8(() => {
13135
+ const [selectedOption, setSelectedOption] = useState7(() => {
13520
13136
  const discriminator = getDiscriminatorFieldFromSchema(schema);
13521
13137
  return schemaUtils.getClosestMatchingOption(formData, retrievedOptions, 0, discriminator);
13522
13138
  });
13523
- const skipNextOptionRecalculation = useRef5(false);
13524
- const prevFormDataRef = useRef5(formData);
13525
- const prevFieldIdRef = useRef5(fieldPathId.$id);
13526
- useEffect5(() => {
13139
+ const skipNextOptionRecalculation = useRef4(false);
13140
+ const prevFormDataRef = useRef4(formData);
13141
+ const prevFieldIdRef = useRef4(fieldPathId.$id);
13142
+ useEffect4(() => {
13527
13143
  const prevFormData = prevFormDataRef.current;
13528
13144
  const prevFieldId = prevFieldIdRef.current;
13529
13145
  prevFormDataRef.current = formData;
@@ -13621,10 +13237,10 @@ function AnyOfField(props) {
13621
13237
  var MultiSchemaField_default = AnyOfField;
13622
13238
 
13623
13239
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/NullField.js
13624
- import { useEffect as useEffect6 } from "react";
13240
+ import { useEffect as useEffect5 } from "react";
13625
13241
  function NullField(props) {
13626
13242
  const { formData, onChange, fieldPathId } = props;
13627
- useEffect6(() => {
13243
+ useEffect5(() => {
13628
13244
  if (formData === void 0) {
13629
13245
  onChange(null, fieldPathId.path);
13630
13246
  }
@@ -13635,12 +13251,12 @@ var NullField_default = NullField;
13635
13251
 
13636
13252
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/NumberField.js
13637
13253
  import { jsx as _jsx12 } from "react/jsx-runtime";
13638
- import { useState as useState9, useCallback as useCallback6 } from "react";
13254
+ import { useState as useState8, useCallback as useCallback6 } from "react";
13639
13255
  var trailingCharMatcherWithPrefix = /\.([0-9]*0)*$/;
13640
13256
  var trailingCharMatcher = /[0.]0*$/;
13641
13257
  function NumberField(props) {
13642
13258
  const { registry, onChange, formData, value: initialValue } = props;
13643
- const [lastValue, setLastValue] = useState9(initialValue);
13259
+ const [lastValue, setLastValue] = useState8(initialValue);
13644
13260
  const { StringField: StringField2 } = registry.fields;
13645
13261
  const separator = getDecimalSeparator();
13646
13262
  const escapedSeparator = separator === "." ? "\\." : separator;
@@ -13675,7 +13291,7 @@ var NumberField_default = NumberField;
13675
13291
 
13676
13292
  // ../../node_modules/.pnpm/@rjsf+core@6.10.0_@rjsf+utils@6.10.0_react@19.2.4__react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/@rjsf/core/lib/components/fields/ObjectField.js
13677
13293
  import { jsx as _jsx13, jsxs as _jsxs } from "react/jsx-runtime";
13678
- import { memo as memo2, useCallback as useCallback7, useMemo as useMemo9, useRef as useRef7, useState as useState10 } from "react";
13294
+ import { memo as memo2, useCallback as useCallback7, useMemo as useMemo7, useRef as useRef6, useState as useState9 } from "react";
13679
13295
 
13680
13296
  // ../../node_modules/.pnpm/markdown-to-jsx@9.10.2_react@19.2.4_vue@3.5.40_typescript@5.9.3_/node_modules/markdown-to-jsx/dist/react.js
13681
13297
  import * as i0 from "react";
@@ -16810,7 +16426,7 @@ function getAdditionalPropertyOrder(schemaProperties) {
16810
16426
  }
16811
16427
  function ObjectFieldPropertyFn(props) {
16812
16428
  const { fieldPathId, schema, registry, uiSchema, errorSchema, formData, onChange, onBlur, onFocus, disabled, readonly, required, hideError, propertyName, handleKeyRename, handleRemoveProperty, addedByAdditionalProperties } = props;
16813
- const [wasPropertyKeyModified, setWasPropertyKeyModified] = useState10(false);
16429
+ const [wasPropertyKeyModified, setWasPropertyKeyModified] = useState9(false);
16814
16430
  const { globalFormOptions, fields: fields2 } = registry;
16815
16431
  const { SchemaField: SchemaField2 } = fields2;
16816
16432
  const innerFieldIdPathId = useDeepCompareMemo(toFieldPathId(propertyName, globalFormOptions, fieldPathId.path));
@@ -16841,15 +16457,15 @@ function ObjectField(props) {
16841
16457
  const { schema: rawSchema, uiSchema = {}, formData, errorSchema, fieldPathId, name, required = false, disabled, readonly, hideError, onBlur, onFocus, onChange, registry, title } = props;
16842
16458
  const { fields: fields2, schemaUtils, translateString, globalUiOptions } = registry;
16843
16459
  const { OptionalDataControlsField: OptionalDataControlsField2 } = fields2;
16844
- const formDataRef = useRef7(formData);
16460
+ const formDataRef = useRef6(formData);
16845
16461
  formDataRef.current = formData;
16846
- const schema = useMemo9(() => schemaUtils.retrieveSchema(rawSchema, formData, true), [schemaUtils, rawSchema, formData]);
16847
- const uiOptions = useMemo9(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
16848
- const schemaProperties = useMemo9(() => schema.properties ?? {}, [schema.properties]);
16462
+ const schema = useMemo7(() => schemaUtils.retrieveSchema(rawSchema, formData, true), [schemaUtils, rawSchema, formData]);
16463
+ const uiOptions = useMemo7(() => getUiOptions(uiSchema, globalUiOptions), [uiSchema, globalUiOptions]);
16464
+ const schemaProperties = useMemo7(() => schema.properties ?? {}, [schema.properties]);
16849
16465
  const childFieldPathId = props.childFieldPathId ?? fieldPathId;
16850
- const lastRenamedProperty = useRef7({ previousKey: "", currentKey: void 0 });
16851
- const [additionalPropertyOrder, setAdditionalPropertyOrder] = useState10(() => getAdditionalPropertyOrder(schemaProperties));
16852
- const definedPropertyOrder = useMemo9(() => {
16466
+ const lastRenamedProperty = useRef6({ previousKey: "", currentKey: void 0 });
16467
+ const [additionalPropertyOrder, setAdditionalPropertyOrder] = useState9(() => getAdditionalPropertyOrder(schemaProperties));
16468
+ const definedPropertyOrder = useMemo7(() => {
16853
16469
  const additionalPropertySet = new Set(getAdditionalPropertyOrder(schemaProperties));
16854
16470
  return Object.keys(schemaProperties).filter((property) => !additionalPropertySet.has(property));
16855
16471
  }, [schemaProperties]);
@@ -18803,7 +18419,7 @@ var Form = class _Form extends Component {
18803
18419
  };
18804
18420
 
18805
18421
  // src/components/SessionPluginConfigForm.tsx
18806
- import { isValidElement, useMemo as useMemo10, useState as useState11 } from "react";
18422
+ import { isValidElement, useMemo as useMemo8, useState as useState10 } from "react";
18807
18423
 
18808
18424
  // src/components/plugin-config-schema.ts
18809
18425
  function asSchema(value) {
@@ -18998,7 +18614,7 @@ function configDraftOperations(initial, values, retained, removed) {
18998
18614
  }
18999
18615
 
19000
18616
  // src/components/SessionPluginConfigForm.tsx
19001
- import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
18617
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
19002
18618
  var defaults = getDefaultRegistry();
19003
18619
  var validator = {
19004
18620
  isValid(schema, data, rootSchema) {
@@ -19055,7 +18671,7 @@ function presentationSchema(schema) {
19055
18671
  }
19056
18672
  function ConfigMultiSchemaField(props) {
19057
18673
  return /* @__PURE__ */ jsxs2("div", { className: "rjsf-field", children: [
19058
- /* @__PURE__ */ jsx6("label", { htmlFor: isValidElement(props.selector) ? props.selector.props.id : void 0, children: "\u914D\u7F6E\u65B9\u5F0F" }),
18674
+ /* @__PURE__ */ jsx3("label", { htmlFor: isValidElement(props.selector) ? props.selector.props.id : void 0, children: "\u914D\u7F6E\u65B9\u5F0F" }),
19059
18675
  props.selector,
19060
18676
  props.optionSchemaField
19061
18677
  ] });
@@ -19083,12 +18699,12 @@ function ConfigSchemaField(inputProps) {
19083
18699
  const pointer = pointerOf(originalConfigPath(fieldPathId.path, context.removed));
19084
18700
  const originalMarker = [...context.retained].find(([, path2]) => path2 === pointer)?.[0];
19085
18701
  if (schema.const !== void 0 && schema.writeOnly !== true)
19086
- return /* @__PURE__ */ jsx6(Fragment2, { children: context.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx6("p", { role: "alert", children: error.message }, error.message)) });
18702
+ return /* @__PURE__ */ jsx3(Fragment2, { children: context.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx3("p", { role: "alert", children: error.message }, error.message)) });
19087
18703
  if (schema.writeOnly === true) {
19088
18704
  const kept = typeof formData === "string" && context.retained.has(formData);
19089
18705
  return /* @__PURE__ */ jsxs2("div", { className: "rjsf-field", children: [
19090
18706
  Array.isArray(schema.type) && schema.type.includes("null") ? /* @__PURE__ */ jsxs2("label", { children: [
19091
- /* @__PURE__ */ jsx6(
18707
+ /* @__PURE__ */ jsx3(
19092
18708
  "input",
19093
18709
  {
19094
18710
  type: "checkbox",
@@ -19100,8 +18716,8 @@ function ConfigSchemaField(inputProps) {
19100
18716
  schema.title ?? props.name,
19101
18717
  "\uFF1A\u7F6E\u4E3A\u7A7A\u503C"
19102
18718
  ] }) : null,
19103
- /* @__PURE__ */ jsx6("label", { htmlFor: fieldPathId.$id, "data-required": props.required, children: schema.title ?? props.name }),
19104
- /* @__PURE__ */ jsx6(
18719
+ /* @__PURE__ */ jsx3("label", { htmlFor: fieldPathId.$id, "data-required": props.required, children: schema.title ?? props.name }),
18720
+ /* @__PURE__ */ jsx3(
19105
18721
  "input",
19106
18722
  {
19107
18723
  id: fieldPathId.$id,
@@ -19114,8 +18730,8 @@ function ConfigSchemaField(inputProps) {
19114
18730
  onChange: (event) => onChange(event.target.value || originalMarker, fieldPathId.path)
19115
18731
  }
19116
18732
  ),
19117
- kept ? /* @__PURE__ */ jsx6("p", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8" }) : null,
19118
- formData !== void 0 ? /* @__PURE__ */ jsx6(
18733
+ kept ? /* @__PURE__ */ jsx3("p", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8" }) : null,
18734
+ formData !== void 0 ? /* @__PURE__ */ jsx3(
19119
18735
  "button",
19120
18736
  {
19121
18737
  type: "button",
@@ -19124,8 +18740,8 @@ function ConfigSchemaField(inputProps) {
19124
18740
  children: "\u6E05\u9664\u5DF2\u4FDD\u5B58\u7684\u503C"
19125
18741
  }
19126
18742
  ) : null,
19127
- schema.description ? /* @__PURE__ */ jsx6("p", { children: schema.description }) : null,
19128
- context.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx6("p", { role: "alert", children: error.message }, error.message))
18743
+ schema.description ? /* @__PURE__ */ jsx3("p", { children: schema.description }) : null,
18744
+ context.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx3("p", { role: "alert", children: error.message }, error.message))
19129
18745
  ] });
19130
18746
  }
19131
18747
  const types = Array.isArray(schema.type) ? schema.type : [schema.type];
@@ -19134,7 +18750,7 @@ function ConfigSchemaField(inputProps) {
19134
18750
  const inner = { ...schema, type: nonNull[0] };
19135
18751
  return /* @__PURE__ */ jsxs2("div", { className: "rjsf-field", children: [
19136
18752
  /* @__PURE__ */ jsxs2("label", { children: [
19137
- /* @__PURE__ */ jsx6(
18753
+ /* @__PURE__ */ jsx3(
19138
18754
  "input",
19139
18755
  {
19140
18756
  type: "checkbox",
@@ -19149,28 +18765,28 @@ function ConfigSchemaField(inputProps) {
19149
18765
  schema.title ?? props.name,
19150
18766
  "\uFF1A\u7F6E\u4E3A\u7A7A\u503C"
19151
18767
  ] }),
19152
- nonNull.length && formData !== null ? /* @__PURE__ */ jsx6(defaults.fields.SchemaField, { ...props, schema: inner }) : null
18768
+ nonNull.length && formData !== null ? /* @__PURE__ */ jsx3(defaults.fields.SchemaField, { ...props, schema: inner }) : null
19153
18769
  ] });
19154
18770
  }
19155
- return /* @__PURE__ */ jsx6(defaults.fields.SchemaField, { ...props });
18771
+ return /* @__PURE__ */ jsx3(defaults.fields.SchemaField, { ...props });
19156
18772
  }
19157
18773
  function ConfigFieldTemplate(props) {
19158
18774
  const pointer = pointerOf(
19159
18775
  originalConfigPath(props.fieldPathId.path, props.registry.formContext.removed)
19160
18776
  );
19161
18777
  return /* @__PURE__ */ jsxs2("div", { className: props.classNames, hidden: props.hidden, children: [
19162
- props.displayLabel ? /* @__PURE__ */ jsx6("label", { htmlFor: props.id, "data-required": props.required, children: props.label }) : null,
18778
+ props.displayLabel ? /* @__PURE__ */ jsx3("label", { htmlFor: props.id, "data-required": props.required, children: props.label }) : null,
19163
18779
  props.displayLabel ? props.description : null,
19164
18780
  props.children,
19165
18781
  props.help,
19166
- props.registry.formContext.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx6("p", { role: "alert", children: error.message }, error.message))
18782
+ props.registry.formContext.errors.filter((error) => error.path === pointer).map((error) => /* @__PURE__ */ jsx3("p", { role: "alert", children: error.message }, error.message))
19167
18783
  ] });
19168
18784
  }
19169
18785
  function ConfigArrayItem(props) {
19170
18786
  const { buttonsProps: buttons, registry } = props;
19171
18787
  return /* @__PURE__ */ jsxs2("div", { className: "rjsf-array-item", children: [
19172
18788
  props.children,
19173
- buttons.hasRemove ? /* @__PURE__ */ jsx6(
18789
+ buttons.hasRemove ? /* @__PURE__ */ jsx3(
19174
18790
  "button",
19175
18791
  {
19176
18792
  type: "button",
@@ -19185,7 +18801,7 @@ function ConfigArrayItem(props) {
19185
18801
  if (previous !== void 0) registry.formContext.removed.add(pointerOf(path));
19186
18802
  buttons.onRemoveItem(event);
19187
18803
  },
19188
- children: /* @__PURE__ */ jsx6(Trash2, { size: 14 })
18804
+ children: /* @__PURE__ */ jsx3(Trash2, { size: 14 })
19189
18805
  }
19190
18806
  ) : null
19191
18807
  ] });
@@ -19198,12 +18814,12 @@ function SessionPluginConfigForm({
19198
18814
  onSubmit,
19199
18815
  onCancel
19200
18816
  }) {
19201
- const [initial] = useState11(() => createConfigDraft(config));
19202
- const [values, setValues] = useState11(initial.values);
19203
- const [removed] = useState11(() => /* @__PURE__ */ new Set());
19204
- const [draftFailure, setDraftFailure] = useState11(null);
19205
- const support = useMemo10(() => formSupport(config.schema), [config.schema]);
19206
- const schema = useMemo10(() => {
18817
+ const [initial] = useState10(() => createConfigDraft(config));
18818
+ const [values, setValues] = useState10(initial.values);
18819
+ const [removed] = useState10(() => /* @__PURE__ */ new Set());
18820
+ const [draftFailure, setDraftFailure] = useState10(null);
18821
+ const support = useMemo8(() => formSupport(config.schema), [config.schema]);
18822
+ const schema = useMemo8(() => {
19207
18823
  try {
19208
18824
  return config.schema ? presentationSchema(config.schema) : null;
19209
18825
  } catch {
@@ -19220,11 +18836,11 @@ function SessionPluginConfigForm({
19220
18836
  };
19221
18837
  if (!schema || support)
19222
18838
  return /* @__PURE__ */ jsxs2("div", { className: "space-y-3 text-xs", children: [
19223
- /* @__PURE__ */ jsx6("p", { children: support ?? "\u914D\u7F6E\u58F0\u660E\u7684\u7EC4\u5408\u65E0\u6CD5\u5448\u73B0\uFF0C\u8BF7\u8054\u7CFB\u63D2\u4EF6\u63D0\u4F9B\u65B9" }),
19224
- /* @__PURE__ */ jsx6("button", { type: "button", onClick: onCancel, children: "\u5173\u95ED" })
18839
+ /* @__PURE__ */ jsx3("p", { children: support ?? "\u914D\u7F6E\u58F0\u660E\u7684\u7EC4\u5408\u65E0\u6CD5\u5448\u73B0\uFF0C\u8BF7\u8054\u7CFB\u63D2\u4EF6\u63D0\u4F9B\u65B9" }),
18840
+ /* @__PURE__ */ jsx3("button", { type: "button", onClick: onCancel, children: "\u5173\u95ED" })
19225
18841
  ] });
19226
18842
  return /* @__PURE__ */ jsxs2("div", { className: "blade-plugin-config text-xs", children: [
19227
- /* @__PURE__ */ jsx6("style", { children: `
18843
+ /* @__PURE__ */ jsx3("style", { children: `
19228
18844
  .blade-plugin-config .rjsf-field, .blade-plugin-config fieldset { min-width:0; margin:0 0 10px; padding:0; border:0 }
19229
18845
  .blade-plugin-config label, .blade-plugin-config legend { display:block; font-size:12px; font-weight:500; overflow-wrap:anywhere; margin-bottom:4px }
19230
18846
  .blade-plugin-config label[data-required=true]::after { content:' *'; color:hsl(var(--destructive)) }
@@ -19237,8 +18853,8 @@ function SessionPluginConfigForm({
19237
18853
  .blade-plugin-config button:disabled { opacity:.5 }
19238
18854
  .blade-plugin-config .control-label { display:block }
19239
18855
  ` }),
19240
- failure || draftFailure ? /* @__PURE__ */ jsx6("p", { role: "alert", children: failure ?? draftFailure }) : null,
19241
- /* @__PURE__ */ jsx6(
18856
+ failure || draftFailure ? /* @__PURE__ */ jsx3("p", { role: "alert", children: failure ?? draftFailure }) : null,
18857
+ /* @__PURE__ */ jsx3(
19242
18858
  Form,
19243
18859
  {
19244
18860
  schema,
@@ -19252,7 +18868,7 @@ function SessionPluginConfigForm({
19252
18868
  MultiSchemaFieldTemplate: ConfigMultiSchemaField,
19253
18869
  ButtonTemplates: {
19254
18870
  ...defaults.templates.ButtonTemplates,
19255
- AddButton: (props) => /* @__PURE__ */ jsx6(
18871
+ AddButton: (props) => /* @__PURE__ */ jsx3(
19256
18872
  "button",
19257
18873
  {
19258
18874
  type: "button",
@@ -19260,7 +18876,7 @@ function SessionPluginConfigForm({
19260
18876
  "aria-label": "\u6DFB\u52A0\u4E00\u9879",
19261
18877
  disabled: props.disabled,
19262
18878
  onClick: props.onClick,
19263
- children: /* @__PURE__ */ jsx6(Plus, { size: 14 })
18879
+ children: /* @__PURE__ */ jsx3(Plus, { size: 14 })
19264
18880
  }
19265
18881
  )
19266
18882
  }
@@ -19302,8 +18918,8 @@ function SessionPluginConfigForm({
19302
18918
  }
19303
18919
  },
19304
18920
  children: /* @__PURE__ */ jsxs2("div", { className: "flex justify-end gap-2", children: [
19305
- /* @__PURE__ */ jsx6("button", { type: "button", onClick: onCancel, children: "\u53D6\u6D88" }),
19306
- /* @__PURE__ */ jsx6("button", { type: "submit", disabled: submitting, children: submitting ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58" })
18921
+ /* @__PURE__ */ jsx3("button", { type: "button", onClick: onCancel, children: "\u53D6\u6D88" }),
18922
+ /* @__PURE__ */ jsx3("button", { type: "submit", disabled: submitting, children: submitting ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58" })
19307
18923
  ] })
19308
18924
  }
19309
18925
  )
@@ -19311,8 +18927,8 @@ function SessionPluginConfigForm({
19311
18927
  }
19312
18928
 
19313
18929
  // src/components/SessionPluginIcon.tsx
19314
- import { useEffect as useEffect7, useState as useState12 } from "react";
19315
- import { jsx as jsx7 } from "react/jsx-runtime";
18930
+ import { useEffect as useEffect6, useState as useState11 } from "react";
18931
+ import { jsx as jsx4 } from "react/jsx-runtime";
19316
18932
  function sessionPluginLabel(plugin) {
19317
18933
  const display = typeof plugin.display_name === "string" ? plugin.display_name.trim() : "";
19318
18934
  return display || plugin.name;
@@ -19337,9 +18953,9 @@ function iconBlob(client, sessionId, name, token) {
19337
18953
  return pending;
19338
18954
  }
19339
18955
  function SessionPluginIcon({ client, sessionId, plugin, size: size4 = 20, shape = "rounded", className }) {
19340
- const [url, setUrl] = useState12(null);
18956
+ const [url, setUrl] = useState11(null);
19341
18957
  const token = plugin.icon;
19342
- useEffect7(() => {
18958
+ useEffect6(() => {
19343
18959
  setUrl(null);
19344
18960
  if (!token) return;
19345
18961
  let alive = true;
@@ -19357,14 +18973,14 @@ function SessionPluginIcon({ client, sessionId, plugin, size: size4 = 20, shape
19357
18973
  const frame = `flex shrink-0 items-center justify-center overflow-hidden ${shape === "circle" ? "rounded-full" : "rounded"} ${className ?? ""}`;
19358
18974
  const frameStyle = { width: size4, height: size4 };
19359
18975
  if (!url) {
19360
- return /* @__PURE__ */ jsx7("span", { className: `${frame} bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]`, style: frameStyle, "data-plugin-icon": "placeholder", children: /* @__PURE__ */ jsx7(Puzzle, { "aria-hidden": true, size: Math.round(size4 * 0.7) }) });
18976
+ return /* @__PURE__ */ jsx4("span", { className: `${frame} bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]`, style: frameStyle, "data-plugin-icon": "placeholder", children: /* @__PURE__ */ jsx4(Puzzle, { "aria-hidden": true, size: Math.round(size4 * 0.7) }) });
19361
18977
  }
19362
- return /* @__PURE__ */ jsx7("span", { className: frame, style: frameStyle, "data-plugin-icon": "image", children: /* @__PURE__ */ jsx7("img", { src: url, alt: "", "aria-hidden": true, className: "h-full w-full object-cover", onError: () => setUrl(null) }) });
18978
+ return /* @__PURE__ */ jsx4("span", { className: frame, style: frameStyle, "data-plugin-icon": "image", children: /* @__PURE__ */ jsx4("img", { src: url, alt: "", "aria-hidden": true, className: "h-full w-full object-cover", onError: () => setUrl(null) }) });
19363
18979
  }
19364
18980
 
19365
18981
  // src/components/SessionPluginConfigDialog.tsx
19366
- import { useEffect as useEffect8, useRef as useRef8, useState as useState13 } from "react";
19367
- import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
18982
+ import { useEffect as useEffect7, useRef as useRef7, useState as useState12 } from "react";
18983
+ import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
19368
18984
  async function readFailure(error) {
19369
18985
  const response = error?.response;
19370
18986
  if (!response || typeof response.json !== "function") {
@@ -19391,7 +19007,7 @@ function SessionPluginConfigDialog({
19391
19007
  plugin,
19392
19008
  ...props
19393
19009
  }) {
19394
- return /* @__PURE__ */ jsx8(
19010
+ return /* @__PURE__ */ jsx5(
19395
19011
  ConfigDialogState,
19396
19012
  {
19397
19013
  client,
@@ -19409,11 +19025,11 @@ function ConfigDialogState({
19409
19025
  onSaved,
19410
19026
  onClose
19411
19027
  }) {
19412
- const [host, setHost] = useState13(null);
19413
- const [restarting, setRestarting] = useState13(false);
19414
- const [scope, setScope] = useState13("personal");
19028
+ const [host, setHost] = useState12(null);
19029
+ const [restarting, setRestarting] = useState12(false);
19030
+ const [scope, setScope] = useState12("personal");
19415
19031
  const waitingForHost = host?.state === "starting" || host?.state === "updating";
19416
- useEffect8(() => {
19032
+ useEffect7(() => {
19417
19033
  if (!waitingForHost) return;
19418
19034
  const abort = new AbortController();
19419
19035
  let timer;
@@ -19431,18 +19047,18 @@ function ConfigDialogState({
19431
19047
  clearTimeout(timer);
19432
19048
  };
19433
19049
  }, [client, sessionId, plugin.name, scope, waitingForHost]);
19434
- const [canConfigureGlobal, setCanConfigureGlobal] = useState13(false);
19435
- const [config, setConfig] = useState13(null);
19436
- const [loading, setLoading] = useState13(true);
19437
- const [loadFailure, setLoadFailure] = useState13(null);
19438
- const [saving, setSaving] = useState13(false);
19439
- const [failure, setFailure] = useState13(null);
19440
- const [fieldErrors, setFieldErrors] = useState13([]);
19441
- const [formVersion, setFormVersion] = useState13(0);
19442
- const alive = useRef8(true);
19443
- const generation2 = useRef8(0);
19444
- const dialog = useRef8(null);
19445
- useEffect8(() => {
19050
+ const [canConfigureGlobal, setCanConfigureGlobal] = useState12(false);
19051
+ const [config, setConfig] = useState12(null);
19052
+ const [loading, setLoading] = useState12(true);
19053
+ const [loadFailure, setLoadFailure] = useState12(null);
19054
+ const [saving, setSaving] = useState12(false);
19055
+ const [failure, setFailure] = useState12(null);
19056
+ const [fieldErrors, setFieldErrors] = useState12([]);
19057
+ const [formVersion, setFormVersion] = useState12(0);
19058
+ const alive = useRef7(true);
19059
+ const generation2 = useRef7(0);
19060
+ const dialog = useRef7(null);
19061
+ useEffect7(() => {
19446
19062
  const element = dialog.current;
19447
19063
  if (!element || element.open) return;
19448
19064
  if (typeof element.showModal === "function") element.showModal();
@@ -19468,7 +19084,7 @@ function ConfigDialogState({
19468
19084
  if (alive.current && generation2.current === current) setLoading(false);
19469
19085
  }
19470
19086
  };
19471
- useEffect8(() => {
19087
+ useEffect7(() => {
19472
19088
  alive.current = true;
19473
19089
  setConfig(null);
19474
19090
  setFailure(null);
@@ -19513,7 +19129,7 @@ function ConfigDialogState({
19513
19129
  }
19514
19130
  };
19515
19131
  return /* @__PURE__ */ jsxs3(Fragment3, { children: [
19516
- /* @__PURE__ */ jsx8("style", { children: ".blade-plugin-dialog::backdrop { background: rgb(0 0 0 / 40%); }" }),
19132
+ /* @__PURE__ */ jsx5("style", { children: ".blade-plugin-dialog::backdrop { background: rgb(0 0 0 / 40%); }" }),
19517
19133
  /* @__PURE__ */ jsxs3(
19518
19134
  "dialog",
19519
19135
  {
@@ -19540,8 +19156,8 @@ function ConfigDialogState({
19540
19156
  className: "blade-plugin-dialog max-h-[80vh] overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-4 text-[hsl(var(--popover-foreground))] shadow-lg",
19541
19157
  children: [
19542
19158
  /* @__PURE__ */ jsxs3("div", { className: "mb-3 flex items-center gap-2", children: [
19543
- /* @__PURE__ */ jsx8(SessionPluginIcon, { client, sessionId, plugin }),
19544
- /* @__PURE__ */ jsx8(
19159
+ /* @__PURE__ */ jsx5(SessionPluginIcon, { client, sessionId, plugin }),
19160
+ /* @__PURE__ */ jsx5(
19545
19161
  "span",
19546
19162
  {
19547
19163
  className: "min-w-0 flex-1 truncate text-sm font-medium",
@@ -19549,7 +19165,7 @@ function ConfigDialogState({
19549
19165
  children: sessionPluginLabel(plugin)
19550
19166
  }
19551
19167
  ),
19552
- /* @__PURE__ */ jsx8(
19168
+ /* @__PURE__ */ jsx5(
19553
19169
  "button",
19554
19170
  {
19555
19171
  type: "button",
@@ -19561,8 +19177,8 @@ function ConfigDialogState({
19561
19177
  )
19562
19178
  ] }),
19563
19179
  canConfigureGlobal ? /* @__PURE__ */ jsxs3("div", { className: "mb-3 flex gap-2 text-xs", children: [
19564
- /* @__PURE__ */ jsx8("button", { type: "button", disabled: saving, "aria-pressed": scope === "personal", onClick: () => setScope("personal"), children: "\u6211\u7684\u767B\u5F55" }),
19565
- /* @__PURE__ */ jsx8("button", { type: "button", disabled: saving, "aria-pressed": scope === "global", onClick: () => setScope("global"), children: "\u7EC4\u7EC7\u5171\u4EAB\u914D\u7F6E" })
19180
+ /* @__PURE__ */ jsx5("button", { type: "button", disabled: saving, "aria-pressed": scope === "personal", onClick: () => setScope("personal"), children: "\u6211\u7684\u767B\u5F55" }),
19181
+ /* @__PURE__ */ jsx5("button", { type: "button", disabled: saving, "aria-pressed": scope === "global", onClick: () => setScope("global"), children: "\u7EC4\u7EC7\u5171\u4EAB\u914D\u7F6E" })
19566
19182
  ] }) : null,
19567
19183
  host ? /* @__PURE__ */ jsxs3("div", { className: "mb-3 space-y-1 text-xs", children: [
19568
19184
  /* @__PURE__ */ jsxs3("p", { children: [
@@ -19579,25 +19195,25 @@ function ConfigDialogState({
19579
19195
  " \xB7 \u914D\u7F6E\uFF1A",
19580
19196
  host.revision
19581
19197
  ] }),
19582
- /* @__PURE__ */ jsx8("button", { type: "button", disabled: restarting || saving, onClick: () => {
19198
+ /* @__PURE__ */ jsx5("button", { type: "button", disabled: restarting || saving, onClick: () => {
19583
19199
  setRestarting(true);
19584
19200
  void client.sessions.restartSessionPluginHost(sessionId, plugin.name).then(() => load()).catch(() => setFailure("\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")).finally(() => {
19585
19201
  if (alive.current) setRestarting(false);
19586
19202
  });
19587
19203
  }, children: restarting ? "\u6B63\u5728\u91CD\u542F\u2026" : "\u91CD\u542F\u670D\u52A1" }),
19588
19204
  host.recent?.length ? /* @__PURE__ */ jsxs3("details", { children: [
19589
- /* @__PURE__ */ jsx8("summary", { children: "\u6700\u8FD1\u6D3B\u52A8" }),
19590
- host.recent.map((line, index2) => /* @__PURE__ */ jsx8("p", { children: line }, `${index2}-${line}`))
19205
+ /* @__PURE__ */ jsx5("summary", { children: "\u6700\u8FD1\u6D3B\u52A8" }),
19206
+ host.recent.map((line, index2) => /* @__PURE__ */ jsx5("p", { children: line }, `${index2}-${line}`))
19591
19207
  ] }) : null
19592
19208
  ] }) : null
19593
19209
  ] }) : null,
19594
- scope === "personal" && config?.auth_status === "expired" ? /* @__PURE__ */ jsx8("p", { className: "mb-2 text-xs", children: "\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199" }) : null,
19595
- scope === "personal" && config?.global_ready === false ? /* @__PURE__ */ jsx8("p", { className: "mb-2 text-xs", children: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u586B\u5199\u5171\u4EAB\u914D\u7F6E" }) : null,
19596
- scope === "global" ? /* @__PURE__ */ jsx8("p", { className: "mb-2 text-xs", children: "\u5171\u4EAB\u5BC6\u94A5\u7528\u4E8E\u63D2\u4EF6\u670D\u52A1\u3002\u547D\u4EE4\u7C7B\u63D2\u4EF6\u7684\u6C99\u76D2\u4EE3\u7801\u53EF\u4EE5\u8BFB\u53D6\u5B83\uFF1B\u9700\u4FDD\u5BC6\u65F6\u8BF7\u4F7F\u7528\u6258\u7BA1\u670D\u52A1\u3002" }) : null,
19597
- loading ? /* @__PURE__ */ jsx8("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u8BFB\u53D6\u914D\u7F6E\u2026" }) : null,
19210
+ scope === "personal" && config?.auth_status === "expired" ? /* @__PURE__ */ jsx5("p", { className: "mb-2 text-xs", children: "\u767B\u5F55\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199" }) : null,
19211
+ scope === "personal" && config?.global_ready === false ? /* @__PURE__ */ jsx5("p", { className: "mb-2 text-xs", children: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u586B\u5199\u5171\u4EAB\u914D\u7F6E" }) : null,
19212
+ scope === "global" ? /* @__PURE__ */ jsx5("p", { className: "mb-2 text-xs", children: "\u5171\u4EAB\u5BC6\u94A5\u7528\u4E8E\u63D2\u4EF6\u670D\u52A1\u3002\u547D\u4EE4\u7C7B\u63D2\u4EF6\u7684\u6C99\u76D2\u4EE3\u7801\u53EF\u4EE5\u8BFB\u53D6\u5B83\uFF1B\u9700\u4FDD\u5BC6\u65F6\u8BF7\u4F7F\u7528\u6258\u7BA1\u670D\u52A1\u3002" }) : null,
19213
+ loading ? /* @__PURE__ */ jsx5("p", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6B63\u5728\u8BFB\u53D6\u914D\u7F6E\u2026" }) : null,
19598
19214
  loadFailure ? /* @__PURE__ */ jsxs3("div", { className: "space-y-2 text-xs", children: [
19599
- /* @__PURE__ */ jsx8("p", { children: loadFailure }),
19600
- /* @__PURE__ */ jsx8(
19215
+ /* @__PURE__ */ jsx5("p", { children: loadFailure }),
19216
+ /* @__PURE__ */ jsx5(
19601
19217
  "button",
19602
19218
  {
19603
19219
  type: "button",
@@ -19607,7 +19223,7 @@ function ConfigDialogState({
19607
19223
  }
19608
19224
  )
19609
19225
  ] }) : null,
19610
- config && !loading ? /* @__PURE__ */ jsx8(
19226
+ config && !loading ? /* @__PURE__ */ jsx5(
19611
19227
  SessionPluginConfigForm,
19612
19228
  {
19613
19229
  config,
@@ -19626,7 +19242,7 @@ function ConfigDialogState({
19626
19242
  }
19627
19243
 
19628
19244
  // src/components/PluginConnectorList.tsx
19629
- import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
19245
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
19630
19246
  function PluginSwitch({
19631
19247
  label,
19632
19248
  checked,
@@ -19636,7 +19252,7 @@ function PluginSwitch({
19636
19252
  draft = false,
19637
19253
  onToggle
19638
19254
  }) {
19639
- return /* @__PURE__ */ jsx9(
19255
+ return /* @__PURE__ */ jsx6(
19640
19256
  "button",
19641
19257
  {
19642
19258
  type: "button",
@@ -19646,12 +19262,12 @@ function PluginSwitch({
19646
19262
  disabled,
19647
19263
  onClick: () => onToggle(!checked),
19648
19264
  className: `relative inline-flex h-[18px] w-8 shrink-0 cursor-pointer items-center rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${checked ? "border-transparent bg-[hsl(213_94%_55%)]" : "border-[hsl(var(--border))] bg-[hsl(var(--muted))]"}`,
19649
- children: /* @__PURE__ */ jsx9(
19265
+ children: /* @__PURE__ */ jsx6(
19650
19266
  "span",
19651
19267
  {
19652
19268
  "aria-hidden": "true",
19653
19269
  className: `pointer-events-none flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white shadow transition-transform ${checked ? "translate-x-[16px]" : "translate-x-[2px]"}`,
19654
- children: pending ? /* @__PURE__ */ jsx9(LoaderCircle, { size: 9, className: "animate-spin text-[hsl(var(--muted-foreground))]" }) : null
19270
+ children: pending ? /* @__PURE__ */ jsx6(LoaderCircle, { size: 9, className: "animate-spin text-[hsl(var(--muted-foreground))]" }) : null
19655
19271
  }
19656
19272
  )
19657
19273
  }
@@ -19677,8 +19293,8 @@ function PluginConnectorList({
19677
19293
  }) {
19678
19294
  const configuringItem = configuring ? items.find((item) => item.name === configuring.name) ?? null : null;
19679
19295
  return /* @__PURE__ */ jsxs4("div", { className: "py-0.5", children: [
19680
- disabledReason ? /* @__PURE__ */ jsx9("div", { className: "px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: disabledReason }) : null,
19681
- items.length === 0 ? /* @__PURE__ */ jsx9("div", { className: "px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: unavailableText ?? emptyText }) : null,
19296
+ disabledReason ? /* @__PURE__ */ jsx6("div", { className: "px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: disabledReason }) : null,
19297
+ items.length === 0 ? /* @__PURE__ */ jsx6("div", { className: "px-3 py-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: unavailableText ?? emptyText }) : null,
19682
19298
  items.map((item) => {
19683
19299
  const label = sessionPluginLabel(item);
19684
19300
  const actionable = !disabledReason && item.installed !== false || item.active;
@@ -19686,7 +19302,7 @@ function PluginConnectorList({
19686
19302
  const checked = item.active;
19687
19303
  return /* @__PURE__ */ jsxs4("div", { className: "group px-3 py-1", children: [
19688
19304
  /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
19689
- /* @__PURE__ */ jsx9(
19305
+ /* @__PURE__ */ jsx6(
19690
19306
  SessionPluginIcon,
19691
19307
  {
19692
19308
  client,
@@ -19694,9 +19310,9 @@ function PluginConnectorList({
19694
19310
  plugin: item
19695
19311
  }
19696
19312
  ),
19697
- /* @__PURE__ */ jsx9("span", { className: "min-w-0 flex-1 truncate text-[11px]", title: label, children: label }),
19698
- item.auth_status === "expired" || item.auth_status === "login_required" || item.auth_status === "unavailable" ? /* @__PURE__ */ jsx9("button", { type: "button", disabled: !sessionId || busy, onClick: () => onEditConfig(item), className: "shrink-0 text-[10px] underline", children: item.auth_status === "expired" ? "\u767B\u5F55\u5DF2\u8FC7\u671F" : item.auth_status === "unavailable" ? "\u6682\u65F6\u4E0D\u53EF\u7528" : "\u672A\u767B\u5F55" }) : null,
19699
- !draft && item.config === "configured" ? /* @__PURE__ */ jsx9(
19313
+ /* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1 truncate text-[11px]", title: label, children: label }),
19314
+ item.auth_status === "expired" || item.auth_status === "login_required" || item.auth_status === "unavailable" ? /* @__PURE__ */ jsx6("button", { type: "button", disabled: !sessionId || busy, onClick: () => onEditConfig(item), className: "shrink-0 text-[10px] underline", children: item.auth_status === "expired" ? "\u767B\u5F55\u5DF2\u8FC7\u671F" : item.auth_status === "unavailable" ? "\u6682\u65F6\u4E0D\u53EF\u7528" : "\u672A\u767B\u5F55" }) : null,
19315
+ !draft && item.config === "configured" ? /* @__PURE__ */ jsx6(
19700
19316
  "button",
19701
19317
  {
19702
19318
  type: "button",
@@ -19707,7 +19323,7 @@ function PluginConnectorList({
19707
19323
  children: "\u66F4\u65B0\u914D\u7F6E"
19708
19324
  }
19709
19325
  ) : null,
19710
- !draft && (item.config === "required" || item.config === "error") ? /* @__PURE__ */ jsx9(
19326
+ !draft && (item.config === "required" || item.config === "error") ? /* @__PURE__ */ jsx6(
19711
19327
  "button",
19712
19328
  {
19713
19329
  type: "button",
@@ -19718,7 +19334,7 @@ function PluginConnectorList({
19718
19334
  children: "\u586B\u5199\u914D\u7F6E"
19719
19335
  }
19720
19336
  ) : null,
19721
- /* @__PURE__ */ jsx9(
19337
+ /* @__PURE__ */ jsx6(
19722
19338
  PluginSwitch,
19723
19339
  {
19724
19340
  label,
@@ -19731,8 +19347,8 @@ function PluginConnectorList({
19731
19347
  )
19732
19348
  ] }),
19733
19349
  !draft && item.active && item.status !== "valid" && item.status !== "required" ? /* @__PURE__ */ jsxs4("div", { className: "mt-0.5 flex items-center gap-2 pl-7 text-[10px] text-[hsl(var(--muted-foreground))]", children: [
19734
- /* @__PURE__ */ jsx9("span", { children: item.reason || "\u63D2\u4EF6\u6682\u4E0D\u53EF\u7528" }),
19735
- /* @__PURE__ */ jsx9(
19350
+ /* @__PURE__ */ jsx6("span", { children: item.reason || "\u63D2\u4EF6\u6682\u4E0D\u53EF\u7528" }),
19351
+ /* @__PURE__ */ jsx6(
19736
19352
  "button",
19737
19353
  {
19738
19354
  type: "button",
@@ -19745,8 +19361,8 @@ function PluginConnectorList({
19745
19361
  ] }) : null
19746
19362
  ] }, item.name);
19747
19363
  }),
19748
- mutationError ? /* @__PURE__ */ jsx9("div", { className: "px-3 pt-1 text-[10px] text-[hsl(var(--destructive))]", children: "\u64CD\u4F5C\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5" }) : null,
19749
- configuring && configuringItem && sessionId ? /* @__PURE__ */ jsx9(
19364
+ mutationError ? /* @__PURE__ */ jsx6("div", { className: "px-3 pt-1 text-[10px] text-[hsl(var(--destructive))]", children: "\u64CD\u4F5C\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5" }) : null,
19365
+ configuring && configuringItem && sessionId ? /* @__PURE__ */ jsx6(
19750
19366
  SessionPluginConfigDialog,
19751
19367
  {
19752
19368
  client,
@@ -19815,29 +19431,29 @@ function filterConnectorItems(items, query) {
19815
19431
  }
19816
19432
 
19817
19433
  // src/components/use-session-plugin-activation.ts
19818
- import { useCallback as useCallback19, useEffect as useEffect9, useMemo as useMemo11, useRef as useRef9, useState as useState14 } from "react";
19434
+ import { useCallback as useCallback19, useEffect as useEffect8, useMemo as useMemo9, useRef as useRef8, useState as useState13 } from "react";
19819
19435
  function useSessionPluginActivation({
19820
19436
  client,
19821
19437
  sessionId,
19822
19438
  onChange
19823
19439
  }) {
19824
- const [plugins, setPlugins] = useState14([]);
19825
- const [catalog, setCatalog] = useState14(null);
19826
- const [loading, setLoading] = useState14(false);
19827
- const [listError, setListError] = useState14(false);
19828
- const [mutationError, setMutationError] = useState14(false);
19829
- const [inFlight, setInFlight] = useState14({});
19830
- const [configuring, setConfiguring] = useState14(null);
19831
- const alive = useRef9(true);
19832
- const generation2 = useRef9(0);
19833
- const mutationGenerations = useRef9(/* @__PURE__ */ new Map());
19834
- const desiredActivations = useRef9(/* @__PURE__ */ new Map());
19835
- const pendingMutations = useRef9(/* @__PURE__ */ new Map());
19836
- const submittedActivations = useRef9(/* @__PURE__ */ new Set());
19837
- const serverActive = useRef9(/* @__PURE__ */ new Set());
19838
- const lifetime = useRef9(0);
19839
- const request = useRef9(null);
19840
- const [desiredVersion, setDesiredVersion] = useState14(0);
19440
+ const [plugins, setPlugins] = useState13([]);
19441
+ const [catalog, setCatalog] = useState13(null);
19442
+ const [loading, setLoading] = useState13(false);
19443
+ const [listError, setListError] = useState13(false);
19444
+ const [mutationError, setMutationError] = useState13(false);
19445
+ const [inFlight, setInFlight] = useState13({});
19446
+ const [configuring, setConfiguring] = useState13(null);
19447
+ const alive = useRef8(true);
19448
+ const generation2 = useRef8(0);
19449
+ const mutationGenerations = useRef8(/* @__PURE__ */ new Map());
19450
+ const desiredActivations = useRef8(/* @__PURE__ */ new Map());
19451
+ const pendingMutations = useRef8(/* @__PURE__ */ new Map());
19452
+ const submittedActivations = useRef8(/* @__PURE__ */ new Set());
19453
+ const serverActive = useRef8(/* @__PURE__ */ new Set());
19454
+ const lifetime = useRef8(0);
19455
+ const request = useRef8(null);
19456
+ const [desiredVersion, setDesiredVersion] = useState13(0);
19841
19457
  const setDesired = useCallback19((name, value) => {
19842
19458
  if (value === null) {
19843
19459
  if (!desiredActivations.current.delete(name)) return;
@@ -19847,7 +19463,7 @@ function useSessionPluginActivation({
19847
19463
  }
19848
19464
  setDesiredVersion((version) => version + 1);
19849
19465
  }, []);
19850
- const items = useMemo11(() => {
19466
+ const items = useMemo9(() => {
19851
19467
  void desiredVersion;
19852
19468
  const merged = mergeConnectorItems(plugins, catalog);
19853
19469
  return merged.map((item) => {
@@ -19867,7 +19483,7 @@ function useSessionPluginActivation({
19867
19483
  return rest;
19868
19484
  });
19869
19485
  }, []);
19870
- useEffect9(() => {
19486
+ useEffect8(() => {
19871
19487
  alive.current = true;
19872
19488
  setPlugins([]);
19873
19489
  setCatalog(null);
@@ -20091,6 +19707,223 @@ function useSessionPluginActivation({
20091
19707
  };
20092
19708
  }
20093
19709
 
19710
+ // src/chat/runtime/session-source.tsx
19711
+ import { createInitialSessionState } from "@blade-hq/agent-client/internal";
19712
+ import {
19713
+ createContext as createContext3,
19714
+ useContext as useContext3,
19715
+ useEffect as useEffect9,
19716
+ useLayoutEffect,
19717
+ useMemo as useMemo10,
19718
+ useRef as useRef9,
19719
+ useState as useState14,
19720
+ useSyncExternalStore
19721
+ } from "react";
19722
+ import { jsx as jsx7 } from "react/jsx-runtime";
19723
+ var EMPTY_SOURCE = {
19724
+ subscribe: () => () => {
19725
+ },
19726
+ getSession: () => void 0,
19727
+ isHistoryLoading: () => false,
19728
+ planRevealRevision: () => 0
19729
+ };
19730
+ var SessionSourceContext = createContext3(EMPTY_SOURCE);
19731
+ function SessionSourceProvider({ source, children }) {
19732
+ return /* @__PURE__ */ jsx7(SessionSourceContext.Provider, { value: source, children });
19733
+ }
19734
+ function useSessionSource() {
19735
+ return useContext3(SessionSourceContext);
19736
+ }
19737
+ var SingleSessionSource = class {
19738
+ session = null;
19739
+ loading = false;
19740
+ listeners = /* @__PURE__ */ new Set();
19741
+ revisions = /* @__PURE__ */ new Map();
19742
+ subscribe = (listener) => {
19743
+ this.listeners.add(listener);
19744
+ return () => {
19745
+ this.listeners.delete(listener);
19746
+ };
19747
+ };
19748
+ getSession = (sessionId) => {
19749
+ const current = this.session;
19750
+ return current && (!sessionId || current.sessionId === sessionId) ? current : void 0;
19751
+ };
19752
+ isHistoryLoading = (sessionId) => {
19753
+ if (!this.session) return this.loading;
19754
+ return (!sessionId || this.session.sessionId === sessionId) && this.loading;
19755
+ };
19756
+ planRevealRevision = (sessionId) => sessionId ? this.revisions.get(sessionId) ?? 0 : 0;
19757
+ update(session, loading) {
19758
+ if (this.session === session && this.loading === loading) return;
19759
+ this.session = session;
19760
+ this.loading = loading;
19761
+ this.notify();
19762
+ }
19763
+ /** 只认实时成功的根回路 update_plan:历史加载与断线补数不算「新揭示」。 */
19764
+ watchPlan(session) {
19765
+ return session.on("toolResult", ({ toolCall, turn, source }) => {
19766
+ if (source === "reconnect_replay" || (turn.loop_id || "root") !== "root" || toolCall.status !== "done" || !isPlanUpdateTool(toolCall) || !parsePlanUpdate(toolCall.arguments)) {
19767
+ return;
19768
+ }
19769
+ this.revisions.set(session.sessionId, (this.revisions.get(session.sessionId) ?? 0) + 1);
19770
+ this.notify();
19771
+ });
19772
+ }
19773
+ notify() {
19774
+ for (const listener of [...this.listeners]) listener();
19775
+ }
19776
+ };
19777
+ function useSingleSessionSource(session, loading) {
19778
+ const [source] = useState14(() => new SingleSessionSource());
19779
+ useLayoutEffect(() => {
19780
+ source.update(session, loading);
19781
+ }, [source, session, loading]);
19782
+ useEffect9(() => session ? source.watchPlan(session) : void 0, [source, session]);
19783
+ return source;
19784
+ }
19785
+ var EMPTY_STATE = createInitialSessionState("");
19786
+ var noopSubscribe = () => () => {
19787
+ };
19788
+ function useSessionHandle(sessionId) {
19789
+ const source = useSessionSource();
19790
+ return useSyncExternalStore(
19791
+ source.subscribe,
19792
+ () => source.getSession(sessionId) ?? null,
19793
+ () => source.getSession(sessionId) ?? null
19794
+ );
19795
+ }
19796
+ function useSessionState(sessionId, selector) {
19797
+ const session = useSessionHandle(sessionId);
19798
+ const selectorRef = useRef9(selector);
19799
+ selectorRef.current = selector;
19800
+ const store = useMemo10(() => {
19801
+ let lastState = null;
19802
+ let lastSelector = null;
19803
+ let lastSelected;
19804
+ const getSnapshot = () => {
19805
+ const state = session ? session.getState() : EMPTY_STATE;
19806
+ const current = selectorRef.current;
19807
+ if (state !== lastState || current !== lastSelector) {
19808
+ const next = current(state);
19809
+ if (!(lastState !== null && Object.is(next, lastSelected))) lastSelected = next;
19810
+ lastState = state;
19811
+ lastSelector = current;
19812
+ }
19813
+ return lastSelected;
19814
+ };
19815
+ return {
19816
+ subscribe: session ? (listener) => session.subscribe(listener) : noopSubscribe,
19817
+ getSnapshot
19818
+ };
19819
+ }, [session]);
19820
+ return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
19821
+ }
19822
+ function useIsSessionHistoryLoading(sessionId) {
19823
+ const source = useSessionSource();
19824
+ return useSyncExternalStore(
19825
+ source.subscribe,
19826
+ () => source.isHistoryLoading(sessionId),
19827
+ () => source.isHistoryLoading(sessionId)
19828
+ );
19829
+ }
19830
+ function usePlanRevealRevision(sessionId) {
19831
+ const source = useSessionSource();
19832
+ return useSyncExternalStore(
19833
+ source.subscribe,
19834
+ () => source.planRevealRevision(sessionId),
19835
+ () => source.planRevealRevision(sessionId)
19836
+ );
19837
+ }
19838
+ var CurrentChatSessionContext = createContext3(null);
19839
+ function CurrentChatSessionProvider({ sessionId, children }) {
19840
+ return /* @__PURE__ */ jsx7(CurrentChatSessionContext.Provider, { value: sessionId, children });
19841
+ }
19842
+ function useCurrentChatSessionId() {
19843
+ return useContext3(CurrentChatSessionContext);
19844
+ }
19845
+
19846
+ // src/chat/runtime/environment.tsx
19847
+ import { createContext as createContext4, useContext as useContext4, useMemo as useMemo11 } from "react";
19848
+ import { jsx as jsx8 } from "react/jsx-runtime";
19849
+ var EMPTY_ENVIRONMENT = {};
19850
+ var ChatEnvironmentContext = createContext4(EMPTY_ENVIRONMENT);
19851
+ function ChatEnvironmentProvider({ value, children }) {
19852
+ return /* @__PURE__ */ jsx8(ChatEnvironmentContext.Provider, { value, children });
19853
+ }
19854
+ function useChatEnvironment() {
19855
+ return useContext4(ChatEnvironmentContext);
19856
+ }
19857
+ var NO_HIGHLIGHT = { highlightedHtml: null };
19858
+ function usePlainCode() {
19859
+ return NO_HIGHLIGHT;
19860
+ }
19861
+ function useHighlightedCode(code, language) {
19862
+ const use = useChatEnvironment().useHighlightedCode ?? usePlainCode;
19863
+ return use(code, language);
19864
+ }
19865
+ function useNoDetail() {
19866
+ return null;
19867
+ }
19868
+ function useChatSessionDetail(sessionId) {
19869
+ const use = useChatEnvironment().useSessionDetail ?? useNoDetail;
19870
+ return use(sessionId);
19871
+ }
19872
+ function useShowTodo() {
19873
+ return false;
19874
+ }
19875
+ function useHideTodo() {
19876
+ const use = useChatEnvironment().useHideTodo ?? useShowTodo;
19877
+ return use();
19878
+ }
19879
+ function useChatRenderMode() {
19880
+ return useChatEnvironment().renderMode ?? "normal";
19881
+ }
19882
+ function notifyChat(environment, kind, message, options) {
19883
+ if (environment.notify) environment.notify(kind, message, options);
19884
+ else if (kind === "error") console.error(message);
19885
+ }
19886
+ function useComposerBridge(sessionId) {
19887
+ const environment = useChatEnvironment();
19888
+ const session = useSessionHandle(sessionId);
19889
+ return useMemo11(
19890
+ () => ({
19891
+ appendText(text, separate = false) {
19892
+ if (!sessionId) return;
19893
+ if (environment.appendToComposer) environment.appendToComposer(sessionId, text, separate);
19894
+ else session?.insertText(separate ? `
19895
+
19896
+ ${text}` : text);
19897
+ },
19898
+ addContext(context) {
19899
+ if (!sessionId) return;
19900
+ if (environment.addComposerContext) environment.addComposerContext(sessionId, context);
19901
+ else session?.attach(context.label, context.content);
19902
+ }
19903
+ }),
19904
+ [environment, session, sessionId]
19905
+ );
19906
+ }
19907
+ var NO_VIRTUAL_ITEMS = [];
19908
+ var NO_VIRTUALIZER = {
19909
+ getVirtualItems: () => NO_VIRTUAL_ITEMS,
19910
+ getTotalSize: () => 0,
19911
+ measureElement: () => {
19912
+ },
19913
+ scrollToIndex: () => {
19914
+ },
19915
+ getOffsetForIndex: () => void 0
19916
+ };
19917
+ function useNoVirtualizer() {
19918
+ return NO_VIRTUALIZER;
19919
+ }
19920
+ function useChatVirtualizer(options) {
19921
+ const injected = useChatEnvironment().useVirtualizer;
19922
+ const use = injected ?? useNoVirtualizer;
19923
+ const virtualizer = use(options);
19924
+ return { virtualizer, enabled: Boolean(injected) };
19925
+ }
19926
+
20094
19927
  // src/chat/runtime/actions.ts
20095
19928
  function buildPendingAskUserAnswer(state, message) {
20096
19929
  if (state.status !== "waiting_for_input") return void 0;
@@ -20119,7 +19952,6 @@ function sendToSession(session, message, mode, askUserAnswer, extras = {}) {
20119
19952
  model: extras.model,
20120
19953
  thinkingOverride: extras.thinkingOverride,
20121
19954
  reasoningLevel: extras.reasoningLevel,
20122
- kbIds: extras.kbIds,
20123
19955
  refs: extras.refs,
20124
19956
  topicAssetRefs: extras.topicAssetRefs,
20125
19957
  whatif: extras.whatif,
@@ -20199,13 +20031,13 @@ function useComposedRefs(...refs) {
20199
20031
 
20200
20032
  // ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.14_react@19.2.4/node_modules/@radix-ui/react-context/dist/index.mjs
20201
20033
  import * as React2 from "react";
20202
- import { jsx as jsx10 } from "react/jsx-runtime";
20034
+ import { jsx as jsx9 } from "react/jsx-runtime";
20203
20035
  function createContext22(rootComponentName, defaultContext) {
20204
20036
  const Context = React2.createContext(defaultContext);
20205
20037
  const Provider2 = (props) => {
20206
20038
  const { children, ...context } = props;
20207
20039
  const value = React2.useMemo(() => context, Object.values(context));
20208
- return /* @__PURE__ */ jsx10(Context.Provider, { value, children });
20040
+ return /* @__PURE__ */ jsx9(Context.Provider, { value, children });
20209
20041
  };
20210
20042
  Provider2.displayName = rootComponentName + "Provider";
20211
20043
  function useContext22(consumerName) {
@@ -20226,7 +20058,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
20226
20058
  const { scope, children, ...context } = props;
20227
20059
  const Context = scope?.[scopeName]?.[index2] || BaseContext;
20228
20060
  const value = React2.useMemo(() => context, Object.values(context));
20229
- return /* @__PURE__ */ jsx10(Context.Provider, { value, children });
20061
+ return /* @__PURE__ */ jsx9(Context.Provider, { value, children });
20230
20062
  };
20231
20063
  Provider2.displayName = rootComponentName + "Provider";
20232
20064
  function useContext22(consumerName, scope) {
@@ -20283,7 +20115,7 @@ import * as ReactDOM from "react-dom";
20283
20115
 
20284
20116
  // ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.14_react@19.2.4/node_modules/@radix-ui/react-slot/dist/index.mjs
20285
20117
  import * as React3 from "react";
20286
- import { Fragment as Fragment22, jsx as jsx11 } from "react/jsx-runtime";
20118
+ import { Fragment as Fragment22, jsx as jsx10 } from "react/jsx-runtime";
20287
20119
  // @__NO_SIDE_EFFECTS__
20288
20120
  function createSlot(ownerName) {
20289
20121
  const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
@@ -20301,9 +20133,9 @@ function createSlot(ownerName) {
20301
20133
  return child;
20302
20134
  }
20303
20135
  });
20304
- return /* @__PURE__ */ jsx11(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
20136
+ return /* @__PURE__ */ jsx10(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
20305
20137
  }
20306
- return /* @__PURE__ */ jsx11(SlotClone, { ...slotProps, ref: forwardedRef, children });
20138
+ return /* @__PURE__ */ jsx10(SlotClone, { ...slotProps, ref: forwardedRef, children });
20307
20139
  });
20308
20140
  Slot22.displayName = `${ownerName}.Slot`;
20309
20141
  return Slot22;
@@ -20329,7 +20161,7 @@ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
20329
20161
  // @__NO_SIDE_EFFECTS__
20330
20162
  function createSlottable(ownerName) {
20331
20163
  const Slottable2 = ({ children }) => {
20332
- return /* @__PURE__ */ jsx11(Fragment22, { children });
20164
+ return /* @__PURE__ */ jsx10(Fragment22, { children });
20333
20165
  };
20334
20166
  Slottable2.displayName = `${ownerName}.Slottable`;
20335
20167
  Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
@@ -20377,7 +20209,7 @@ function getElementRef(element) {
20377
20209
  }
20378
20210
 
20379
20211
  // ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_1181ea5061ec9212248424669240e4ec/node_modules/@radix-ui/react-primitive/dist/index.mjs
20380
- import { jsx as jsx12 } from "react/jsx-runtime";
20212
+ import { jsx as jsx11 } from "react/jsx-runtime";
20381
20213
  var NODES = [
20382
20214
  "a",
20383
20215
  "button",
@@ -20405,7 +20237,7 @@ var Primitive = NODES.reduce((primitive, node) => {
20405
20237
  if (typeof window !== "undefined") {
20406
20238
  window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
20407
20239
  }
20408
- return /* @__PURE__ */ jsx12(Comp, { ...primitiveProps, ref: forwardedRef });
20240
+ return /* @__PURE__ */ jsx11(Comp, { ...primitiveProps, ref: forwardedRef });
20409
20241
  });
20410
20242
  Node2.displayName = `Primitive.${node}`;
20411
20243
  return { ...primitive, [node]: Node2 };
@@ -20440,7 +20272,7 @@ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.docum
20440
20272
  }
20441
20273
 
20442
20274
  // ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.11_@types+react-dom@19.2.3_@types+react@19.2.14___3d3960154a4c07d09bb90cb341135fc5/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
20443
- import { jsx as jsx13 } from "react/jsx-runtime";
20275
+ import { jsx as jsx12 } from "react/jsx-runtime";
20444
20276
  var DISMISSABLE_LAYER_NAME = "DismissableLayer";
20445
20277
  var CONTEXT_UPDATE = "dismissableLayer.update";
20446
20278
  var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
@@ -20528,7 +20360,7 @@ var DismissableLayer = React7.forwardRef(
20528
20360
  document.addEventListener(CONTEXT_UPDATE, handleUpdate);
20529
20361
  return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
20530
20362
  }, []);
20531
- return /* @__PURE__ */ jsx13(
20363
+ return /* @__PURE__ */ jsx12(
20532
20364
  Primitive.div,
20533
20365
  {
20534
20366
  ...layerProps,
@@ -20562,7 +20394,7 @@ var DismissableLayerBranch = React7.forwardRef((props, forwardedRef) => {
20562
20394
  };
20563
20395
  }
20564
20396
  }, [context.branches]);
20565
- return /* @__PURE__ */ jsx13(Primitive.div, { ...props, ref: composedRefs });
20397
+ return /* @__PURE__ */ jsx12(Primitive.div, { ...props, ref: composedRefs });
20566
20398
  });
20567
20399
  DismissableLayerBranch.displayName = BRANCH_NAME;
20568
20400
  function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
@@ -20674,7 +20506,7 @@ function createFocusGuard() {
20674
20506
 
20675
20507
  // ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+_f62f3af4ca2ba305a7aecf04c8534604/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
20676
20508
  import * as React9 from "react";
20677
- import { jsx as jsx14 } from "react/jsx-runtime";
20509
+ import { jsx as jsx13 } from "react/jsx-runtime";
20678
20510
  var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
20679
20511
  var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
20680
20512
  var EVENT_OPTIONS = { bubbles: false, cancelable: true };
@@ -20793,7 +20625,7 @@ var FocusScope = React9.forwardRef((props, forwardedRef) => {
20793
20625
  },
20794
20626
  [loop, trapped, focusScope.paused]
20795
20627
  );
20796
- return /* @__PURE__ */ jsx14(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
20628
+ return /* @__PURE__ */ jsx13(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
20797
20629
  });
20798
20630
  FocusScope.displayName = FOCUS_SCOPE_NAME;
20799
20631
  function focusFirst(candidates, { select = false } = {}) {
@@ -22828,11 +22660,11 @@ var arrow3 = (options, deps) => {
22828
22660
 
22829
22661
  // ../../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_e05f2c19a58a99fddf374207b5e3778c/node_modules/@radix-ui/react-arrow/dist/index.mjs
22830
22662
  import * as React13 from "react";
22831
- import { jsx as jsx15 } from "react/jsx-runtime";
22663
+ import { jsx as jsx14 } from "react/jsx-runtime";
22832
22664
  var NAME = "Arrow";
22833
22665
  var Arrow = React13.forwardRef((props, forwardedRef) => {
22834
22666
  const { children, width = 10, height = 5, ...arrowProps } = props;
22835
- return /* @__PURE__ */ jsx15(
22667
+ return /* @__PURE__ */ jsx14(
22836
22668
  Primitive.svg,
22837
22669
  {
22838
22670
  ...arrowProps,
@@ -22841,7 +22673,7 @@ var Arrow = React13.forwardRef((props, forwardedRef) => {
22841
22673
  height,
22842
22674
  viewBox: "0 0 30 10",
22843
22675
  preserveAspectRatio: "none",
22844
- children: props.asChild ? children : /* @__PURE__ */ jsx15("polygon", { points: "0,0 30,0 15,10" })
22676
+ children: props.asChild ? children : /* @__PURE__ */ jsx14("polygon", { points: "0,0 30,0 15,10" })
22845
22677
  }
22846
22678
  );
22847
22679
  });
@@ -22886,14 +22718,14 @@ function useSize(element) {
22886
22718
  }
22887
22719
 
22888
22720
  // ../../node_modules/.pnpm/@radix-ui+react-popper@1.2.8_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react_13e0521d8aea7ebfbfb8bee1fb615c05/node_modules/@radix-ui/react-popper/dist/index.mjs
22889
- import { jsx as jsx16 } from "react/jsx-runtime";
22721
+ import { jsx as jsx15 } from "react/jsx-runtime";
22890
22722
  var POPPER_NAME = "Popper";
22891
22723
  var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
22892
22724
  var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
22893
22725
  var Popper = (props) => {
22894
22726
  const { __scopePopper, children } = props;
22895
22727
  const [anchor, setAnchor] = React15.useState(null);
22896
- return /* @__PURE__ */ jsx16(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
22728
+ return /* @__PURE__ */ jsx15(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
22897
22729
  };
22898
22730
  Popper.displayName = POPPER_NAME;
22899
22731
  var ANCHOR_NAME = "PopperAnchor";
@@ -22911,7 +22743,7 @@ var PopperAnchor = React15.forwardRef(
22911
22743
  context.onAnchorChange(anchorRef.current);
22912
22744
  }
22913
22745
  });
22914
- return virtualRef ? null : /* @__PURE__ */ jsx16(Primitive.div, { ...anchorProps, ref: composedRefs });
22746
+ return virtualRef ? null : /* @__PURE__ */ jsx15(Primitive.div, { ...anchorProps, ref: composedRefs });
22915
22747
  }
22916
22748
  );
22917
22749
  PopperAnchor.displayName = ANCHOR_NAME;
@@ -23004,7 +22836,7 @@ var PopperContent = React15.forwardRef(
23004
22836
  useLayoutEffect22(() => {
23005
22837
  if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
23006
22838
  }, [content]);
23007
- return /* @__PURE__ */ jsx16(
22839
+ return /* @__PURE__ */ jsx15(
23008
22840
  "div",
23009
22841
  {
23010
22842
  ref: refs.setFloating,
@@ -23028,7 +22860,7 @@ var PopperContent = React15.forwardRef(
23028
22860
  }
23029
22861
  },
23030
22862
  dir: props.dir,
23031
- children: /* @__PURE__ */ jsx16(
22863
+ children: /* @__PURE__ */ jsx15(
23032
22864
  PopperContentProvider,
23033
22865
  {
23034
22866
  scope: __scopePopper,
@@ -23037,7 +22869,7 @@ var PopperContent = React15.forwardRef(
23037
22869
  arrowX,
23038
22870
  arrowY,
23039
22871
  shouldHideArrow: cannotCenterArrow,
23040
- children: /* @__PURE__ */ jsx16(
22872
+ children: /* @__PURE__ */ jsx15(
23041
22873
  Primitive.div,
23042
22874
  {
23043
22875
  "data-side": placedSide,
@@ -23074,7 +22906,7 @@ var PopperArrow = React15.forwardRef(function PopperArrow2(props, forwardedRef)
23074
22906
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
23075
22907
  // doesn't report size as we'd expect on SVG elements.
23076
22908
  // it reports their bounding box which is effectively the largest path inside the SVG.
23077
- /* @__PURE__ */ jsx16(
22909
+ /* @__PURE__ */ jsx15(
23078
22910
  "span",
23079
22911
  {
23080
22912
  ref: contentContext.onArrowChange,
@@ -23097,7 +22929,7 @@ var PopperArrow = React15.forwardRef(function PopperArrow2(props, forwardedRef)
23097
22929
  }[contentContext.placedSide],
23098
22930
  visibility: contentContext.shouldHideArrow ? "hidden" : void 0
23099
22931
  },
23100
- children: /* @__PURE__ */ jsx16(
22932
+ children: /* @__PURE__ */ jsx15(
23101
22933
  Root,
23102
22934
  {
23103
22935
  ...arrowProps,
@@ -23160,14 +22992,14 @@ var Arrow2 = PopperArrow;
23160
22992
  // ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react_7668895bec2444446faa4e0f4eb5244b/node_modules/@radix-ui/react-portal/dist/index.mjs
23161
22993
  import * as React16 from "react";
23162
22994
  import ReactDOM3 from "react-dom";
23163
- import { jsx as jsx17 } from "react/jsx-runtime";
22995
+ import { jsx as jsx16 } from "react/jsx-runtime";
23164
22996
  var PORTAL_NAME = "Portal";
23165
22997
  var Portal = React16.forwardRef((props, forwardedRef) => {
23166
22998
  const { container: containerProp, ...portalProps } = props;
23167
22999
  const [mounted, setMounted] = React16.useState(false);
23168
23000
  useLayoutEffect22(() => setMounted(true), []);
23169
23001
  const container = containerProp || mounted && globalThis?.document?.body;
23170
- return container ? ReactDOM3.createPortal(/* @__PURE__ */ jsx17(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
23002
+ return container ? ReactDOM3.createPortal(/* @__PURE__ */ jsx16(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
23171
23003
  });
23172
23004
  Portal.displayName = PORTAL_NAME;
23173
23005
 
@@ -24207,7 +24039,7 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames;
24207
24039
  var Combination_default = ReactRemoveScroll;
24208
24040
 
24209
24041
  // ../../node_modules/.pnpm/@radix-ui+react-popover@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.14__@types+rea_8b5332f8e883134e9d9ab2856fc4395d/node_modules/@radix-ui/react-popover/dist/index.mjs
24210
- import { jsx as jsx18 } from "react/jsx-runtime";
24042
+ import { jsx as jsx17 } from "react/jsx-runtime";
24211
24043
  var POPOVER_NAME = "Popover";
24212
24044
  var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
24213
24045
  createPopperScope
@@ -24232,7 +24064,7 @@ var Popover = (props) => {
24232
24064
  onChange: onOpenChange,
24233
24065
  caller: POPOVER_NAME
24234
24066
  });
24235
- return /* @__PURE__ */ jsx18(Root2, { ...popperScope, children: /* @__PURE__ */ jsx18(
24067
+ return /* @__PURE__ */ jsx17(Root2, { ...popperScope, children: /* @__PURE__ */ jsx17(
24236
24068
  PopoverProvider,
24237
24069
  {
24238
24070
  scope: __scopePopover,
@@ -24261,7 +24093,7 @@ var PopoverAnchor = React28.forwardRef(
24261
24093
  onCustomAnchorAdd();
24262
24094
  return () => onCustomAnchorRemove();
24263
24095
  }, [onCustomAnchorAdd, onCustomAnchorRemove]);
24264
- return /* @__PURE__ */ jsx18(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
24096
+ return /* @__PURE__ */ jsx17(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
24265
24097
  }
24266
24098
  );
24267
24099
  PopoverAnchor.displayName = ANCHOR_NAME2;
@@ -24272,7 +24104,7 @@ var PopoverTrigger = React28.forwardRef(
24272
24104
  const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
24273
24105
  const popperScope = usePopperScope(__scopePopover);
24274
24106
  const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
24275
- const trigger = /* @__PURE__ */ jsx18(
24107
+ const trigger = /* @__PURE__ */ jsx17(
24276
24108
  Primitive.button,
24277
24109
  {
24278
24110
  type: "button",
@@ -24285,7 +24117,7 @@ var PopoverTrigger = React28.forwardRef(
24285
24117
  onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
24286
24118
  }
24287
24119
  );
24288
- return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx18(Anchor, { asChild: true, ...popperScope, children: trigger });
24120
+ return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx17(Anchor, { asChild: true, ...popperScope, children: trigger });
24289
24121
  }
24290
24122
  );
24291
24123
  PopoverTrigger.displayName = TRIGGER_NAME;
@@ -24296,7 +24128,7 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
24296
24128
  var PopoverPortal = (props) => {
24297
24129
  const { __scopePopover, forceMount, children, container } = props;
24298
24130
  const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
24299
- return /* @__PURE__ */ jsx18(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx18(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx18(Portal, { asChild: true, container, children }) }) });
24131
+ return /* @__PURE__ */ jsx17(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx17(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx17(Portal, { asChild: true, container, children }) }) });
24300
24132
  };
24301
24133
  PopoverPortal.displayName = PORTAL_NAME2;
24302
24134
  var CONTENT_NAME2 = "PopoverContent";
@@ -24305,7 +24137,7 @@ var PopoverContent = React28.forwardRef(
24305
24137
  const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
24306
24138
  const { forceMount = portalContext.forceMount, ...contentProps } = props;
24307
24139
  const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
24308
- return /* @__PURE__ */ jsx18(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx18(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx18(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
24140
+ return /* @__PURE__ */ jsx17(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx17(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx17(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
24309
24141
  }
24310
24142
  );
24311
24143
  PopoverContent.displayName = CONTENT_NAME2;
@@ -24320,7 +24152,7 @@ var PopoverContentModal = React28.forwardRef(
24320
24152
  const content = contentRef.current;
24321
24153
  if (content) return hideOthers(content);
24322
24154
  }, []);
24323
- return /* @__PURE__ */ jsx18(Combination_default, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx18(
24155
+ return /* @__PURE__ */ jsx17(Combination_default, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx17(
24324
24156
  PopoverContentImpl,
24325
24157
  {
24326
24158
  ...props,
@@ -24355,7 +24187,7 @@ var PopoverContentNonModal = React28.forwardRef(
24355
24187
  const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
24356
24188
  const hasInteractedOutsideRef = React28.useRef(false);
24357
24189
  const hasPointerDownOutsideRef = React28.useRef(false);
24358
- return /* @__PURE__ */ jsx18(
24190
+ return /* @__PURE__ */ jsx17(
24359
24191
  PopoverContentImpl,
24360
24192
  {
24361
24193
  ...props,
@@ -24407,7 +24239,7 @@ var PopoverContentImpl = React28.forwardRef(
24407
24239
  const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
24408
24240
  const popperScope = usePopperScope(__scopePopover);
24409
24241
  useFocusGuards();
24410
- return /* @__PURE__ */ jsx18(
24242
+ return /* @__PURE__ */ jsx17(
24411
24243
  FocusScope,
24412
24244
  {
24413
24245
  asChild: true,
@@ -24415,7 +24247,7 @@ var PopoverContentImpl = React28.forwardRef(
24415
24247
  trapped: trapFocus,
24416
24248
  onMountAutoFocus: onOpenAutoFocus,
24417
24249
  onUnmountAutoFocus: onCloseAutoFocus,
24418
- children: /* @__PURE__ */ jsx18(
24250
+ children: /* @__PURE__ */ jsx17(
24419
24251
  DismissableLayer,
24420
24252
  {
24421
24253
  asChild: true,
@@ -24425,7 +24257,7 @@ var PopoverContentImpl = React28.forwardRef(
24425
24257
  onPointerDownOutside,
24426
24258
  onFocusOutside,
24427
24259
  onDismiss: () => context.onOpenChange(false),
24428
- children: /* @__PURE__ */ jsx18(
24260
+ children: /* @__PURE__ */ jsx17(
24429
24261
  Content,
24430
24262
  {
24431
24263
  "data-state": getState(context.open),
@@ -24458,7 +24290,7 @@ var PopoverClose = React28.forwardRef(
24458
24290
  (props, forwardedRef) => {
24459
24291
  const { __scopePopover, ...closeProps } = props;
24460
24292
  const context = usePopoverContext(CLOSE_NAME, __scopePopover);
24461
- return /* @__PURE__ */ jsx18(
24293
+ return /* @__PURE__ */ jsx17(
24462
24294
  Primitive.button,
24463
24295
  {
24464
24296
  type: "button",
@@ -24475,7 +24307,7 @@ var PopoverArrow = React28.forwardRef(
24475
24307
  (props, forwardedRef) => {
24476
24308
  const { __scopePopover, ...arrowProps } = props;
24477
24309
  const popperScope = usePopperScope(__scopePopover);
24478
- return /* @__PURE__ */ jsx18(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
24310
+ return /* @__PURE__ */ jsx17(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
24479
24311
  }
24480
24312
  );
24481
24313
  PopoverArrow.displayName = ARROW_NAME2;
@@ -24511,7 +24343,7 @@ import * as React30 from "react";
24511
24343
 
24512
24344
  // ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.14__@ty_fa89646d7248b32d1762bf88948f6339/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
24513
24345
  import * as React29 from "react";
24514
- import { jsx as jsx19 } from "react/jsx-runtime";
24346
+ import { jsx as jsx18 } from "react/jsx-runtime";
24515
24347
  var VISUALLY_HIDDEN_STYLES = Object.freeze({
24516
24348
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
24517
24349
  position: "absolute",
@@ -24528,7 +24360,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
24528
24360
  var NAME2 = "VisuallyHidden";
24529
24361
  var VisuallyHidden = React29.forwardRef(
24530
24362
  (props, forwardedRef) => {
24531
- return /* @__PURE__ */ jsx19(
24363
+ return /* @__PURE__ */ jsx18(
24532
24364
  Primitive.span,
24533
24365
  {
24534
24366
  ...props,
@@ -24542,7 +24374,7 @@ VisuallyHidden.displayName = NAME2;
24542
24374
  var Root3 = VisuallyHidden;
24543
24375
 
24544
24376
  // ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.8_@types+react-dom@19.2.3_@types+react@19.2.14__@types+reac_9074d9fb06315b089b2bee17c4c65951/node_modules/@radix-ui/react-tooltip/dist/index.mjs
24545
- import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
24377
+ import { jsx as jsx19, jsxs as jsxs5 } from "react/jsx-runtime";
24546
24378
  var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
24547
24379
  createPopperScope
24548
24380
  ]);
@@ -24566,7 +24398,7 @@ var TooltipProvider = (props) => {
24566
24398
  const skipDelayTimer = skipDelayTimerRef.current;
24567
24399
  return () => window.clearTimeout(skipDelayTimer);
24568
24400
  }, []);
24569
- return /* @__PURE__ */ jsx20(
24401
+ return /* @__PURE__ */ jsx19(
24570
24402
  TooltipProviderContextProvider,
24571
24403
  {
24572
24404
  scope: __scopeTooltip,
@@ -24657,7 +24489,7 @@ var Tooltip = (props) => {
24657
24489
  }
24658
24490
  };
24659
24491
  }, []);
24660
- return /* @__PURE__ */ jsx20(Root2, { ...popperScope, children: /* @__PURE__ */ jsx20(
24492
+ return /* @__PURE__ */ jsx19(Root2, { ...popperScope, children: /* @__PURE__ */ jsx19(
24661
24493
  TooltipContextProvider,
24662
24494
  {
24663
24495
  scope: __scopeTooltip,
@@ -24701,7 +24533,7 @@ var TooltipTrigger = React30.forwardRef(
24701
24533
  React30.useEffect(() => {
24702
24534
  return () => document.removeEventListener("pointerup", handlePointerUp);
24703
24535
  }, [handlePointerUp]);
24704
- return /* @__PURE__ */ jsx20(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx20(
24536
+ return /* @__PURE__ */ jsx19(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx19(
24705
24537
  Primitive.button,
24706
24538
  {
24707
24539
  "aria-describedby": context.open ? context.contentId : void 0,
@@ -24743,7 +24575,7 @@ var [PortalProvider2, usePortalContext2] = createTooltipContext(PORTAL_NAME3, {
24743
24575
  var TooltipPortal = (props) => {
24744
24576
  const { __scopeTooltip, forceMount, children, container } = props;
24745
24577
  const context = useTooltipContext(PORTAL_NAME3, __scopeTooltip);
24746
- return /* @__PURE__ */ jsx20(PortalProvider2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx20(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx20(Portal, { asChild: true, container, children }) }) });
24578
+ return /* @__PURE__ */ jsx19(PortalProvider2, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx19(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx19(Portal, { asChild: true, container, children }) }) });
24747
24579
  };
24748
24580
  TooltipPortal.displayName = PORTAL_NAME3;
24749
24581
  var CONTENT_NAME3 = "TooltipContent";
@@ -24752,7 +24584,7 @@ var TooltipContent = React30.forwardRef(
24752
24584
  const portalContext = usePortalContext2(CONTENT_NAME3, props.__scopeTooltip);
24753
24585
  const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
24754
24586
  const context = useTooltipContext(CONTENT_NAME3, props.__scopeTooltip);
24755
- return /* @__PURE__ */ jsx20(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx20(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx20(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
24587
+ return /* @__PURE__ */ jsx19(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx19(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx19(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
24756
24588
  }
24757
24589
  );
24758
24590
  var TooltipContentHoverable = React30.forwardRef((props, forwardedRef) => {
@@ -24814,7 +24646,7 @@ var TooltipContentHoverable = React30.forwardRef((props, forwardedRef) => {
24814
24646
  return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
24815
24647
  }
24816
24648
  }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
24817
- return /* @__PURE__ */ jsx20(TooltipContentImpl, { ...props, ref: composedRefs });
24649
+ return /* @__PURE__ */ jsx19(TooltipContentImpl, { ...props, ref: composedRefs });
24818
24650
  });
24819
24651
  var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
24820
24652
  var Slottable = createSlottable("TooltipContent");
@@ -24845,7 +24677,7 @@ var TooltipContentImpl = React30.forwardRef(
24845
24677
  return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
24846
24678
  }
24847
24679
  }, [context.trigger, onClose]);
24848
- return /* @__PURE__ */ jsx20(
24680
+ return /* @__PURE__ */ jsx19(
24849
24681
  DismissableLayer,
24850
24682
  {
24851
24683
  asChild: true,
@@ -24873,8 +24705,8 @@ var TooltipContentImpl = React30.forwardRef(
24873
24705
  }
24874
24706
  },
24875
24707
  children: [
24876
- /* @__PURE__ */ jsx20(Slottable, { children }),
24877
- /* @__PURE__ */ jsx20(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx20(Root3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
24708
+ /* @__PURE__ */ jsx19(Slottable, { children }),
24709
+ /* @__PURE__ */ jsx19(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx19(Root3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
24878
24710
  ]
24879
24711
  }
24880
24712
  )
@@ -24892,7 +24724,7 @@ var TooltipArrow = React30.forwardRef(
24892
24724
  ARROW_NAME3,
24893
24725
  __scopeTooltip
24894
24726
  );
24895
- return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx20(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
24727
+ return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx19(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
24896
24728
  }
24897
24729
  );
24898
24730
  TooltipArrow.displayName = ARROW_NAME3;
@@ -25030,7 +24862,7 @@ __export(dist_exports6, {
25030
24862
  createCollapsibleScope: () => createCollapsibleScope
25031
24863
  });
25032
24864
  import * as React31 from "react";
25033
- import { jsx as jsx21 } from "react/jsx-runtime";
24865
+ import { jsx as jsx20 } from "react/jsx-runtime";
25034
24866
  var COLLAPSIBLE_NAME = "Collapsible";
25035
24867
  var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
25036
24868
  var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
@@ -25050,7 +24882,7 @@ var Collapsible = React31.forwardRef(
25050
24882
  onChange: onOpenChange,
25051
24883
  caller: COLLAPSIBLE_NAME
25052
24884
  });
25053
- return /* @__PURE__ */ jsx21(
24885
+ return /* @__PURE__ */ jsx20(
25054
24886
  CollapsibleProvider,
25055
24887
  {
25056
24888
  scope: __scopeCollapsible,
@@ -25058,7 +24890,7 @@ var Collapsible = React31.forwardRef(
25058
24890
  contentId: useId(),
25059
24891
  open,
25060
24892
  onOpenToggle: React31.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
25061
- children: /* @__PURE__ */ jsx21(
24893
+ children: /* @__PURE__ */ jsx20(
25062
24894
  Primitive.div,
25063
24895
  {
25064
24896
  "data-state": getState2(open),
@@ -25077,7 +24909,7 @@ var CollapsibleTrigger = React31.forwardRef(
25077
24909
  (props, forwardedRef) => {
25078
24910
  const { __scopeCollapsible, ...triggerProps } = props;
25079
24911
  const context = useCollapsibleContext(TRIGGER_NAME3, __scopeCollapsible);
25080
- return /* @__PURE__ */ jsx21(
24912
+ return /* @__PURE__ */ jsx20(
25081
24913
  Primitive.button,
25082
24914
  {
25083
24915
  type: "button",
@@ -25099,7 +24931,7 @@ var CollapsibleContent = React31.forwardRef(
25099
24931
  (props, forwardedRef) => {
25100
24932
  const { forceMount, ...contentProps } = props;
25101
24933
  const context = useCollapsibleContext(CONTENT_NAME4, props.__scopeCollapsible);
25102
- return /* @__PURE__ */ jsx21(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx21(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
24934
+ return /* @__PURE__ */ jsx20(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx20(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
25103
24935
  }
25104
24936
  );
25105
24937
  CollapsibleContent.displayName = CONTENT_NAME4;
@@ -25139,7 +24971,7 @@ var CollapsibleContentImpl = React31.forwardRef((props, forwardedRef) => {
25139
24971
  setIsPresent(present);
25140
24972
  }
25141
24973
  }, [context.open, present]);
25142
- return /* @__PURE__ */ jsx21(
24974
+ return /* @__PURE__ */ jsx20(
25143
24975
  Primitive.div,
25144
24976
  {
25145
24977
  "data-state": getState2(context.open),
@@ -25187,7 +25019,7 @@ __export(dist_exports7, {
25187
25019
  createDialogScope: () => createDialogScope
25188
25020
  });
25189
25021
  import * as React32 from "react";
25190
- import { Fragment as Fragment7, jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
25022
+ import { Fragment as Fragment7, jsx as jsx21, jsxs as jsxs6 } from "react/jsx-runtime";
25191
25023
  var DIALOG_NAME = "Dialog";
25192
25024
  var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
25193
25025
  var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
@@ -25208,7 +25040,7 @@ var Dialog = (props) => {
25208
25040
  onChange: onOpenChange,
25209
25041
  caller: DIALOG_NAME
25210
25042
  });
25211
- return /* @__PURE__ */ jsx22(
25043
+ return /* @__PURE__ */ jsx21(
25212
25044
  DialogProvider,
25213
25045
  {
25214
25046
  scope: __scopeDialog,
@@ -25232,7 +25064,7 @@ var DialogTrigger = React32.forwardRef(
25232
25064
  const { __scopeDialog, ...triggerProps } = props;
25233
25065
  const context = useDialogContext(TRIGGER_NAME4, __scopeDialog);
25234
25066
  const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
25235
- return /* @__PURE__ */ jsx22(
25067
+ return /* @__PURE__ */ jsx21(
25236
25068
  Primitive.button,
25237
25069
  {
25238
25070
  type: "button",
@@ -25255,7 +25087,7 @@ var [PortalProvider3, usePortalContext3] = createDialogContext(PORTAL_NAME4, {
25255
25087
  var DialogPortal = (props) => {
25256
25088
  const { __scopeDialog, forceMount, children, container } = props;
25257
25089
  const context = useDialogContext(PORTAL_NAME4, __scopeDialog);
25258
- return /* @__PURE__ */ jsx22(PortalProvider3, { scope: __scopeDialog, forceMount, children: React32.Children.map(children, (child) => /* @__PURE__ */ jsx22(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx22(Portal, { asChild: true, container, children: child }) })) });
25090
+ return /* @__PURE__ */ jsx21(PortalProvider3, { scope: __scopeDialog, forceMount, children: React32.Children.map(children, (child) => /* @__PURE__ */ jsx21(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx21(Portal, { asChild: true, container, children: child }) })) });
25259
25091
  };
25260
25092
  DialogPortal.displayName = PORTAL_NAME4;
25261
25093
  var OVERLAY_NAME = "DialogOverlay";
@@ -25264,7 +25096,7 @@ var DialogOverlay = React32.forwardRef(
25264
25096
  const portalContext = usePortalContext3(OVERLAY_NAME, props.__scopeDialog);
25265
25097
  const { forceMount = portalContext.forceMount, ...overlayProps } = props;
25266
25098
  const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
25267
- return context.modal ? /* @__PURE__ */ jsx22(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx22(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
25099
+ return context.modal ? /* @__PURE__ */ jsx21(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx21(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
25268
25100
  }
25269
25101
  );
25270
25102
  DialogOverlay.displayName = OVERLAY_NAME;
@@ -25276,7 +25108,7 @@ var DialogOverlayImpl = React32.forwardRef(
25276
25108
  return (
25277
25109
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
25278
25110
  // ie. when `Overlay` and `Content` are siblings
25279
- /* @__PURE__ */ jsx22(Combination_default, { as: Slot2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx22(
25111
+ /* @__PURE__ */ jsx21(Combination_default, { as: Slot2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx21(
25280
25112
  Primitive.div,
25281
25113
  {
25282
25114
  "data-state": getState3(context.open),
@@ -25294,7 +25126,7 @@ var DialogContent = React32.forwardRef(
25294
25126
  const portalContext = usePortalContext3(CONTENT_NAME5, props.__scopeDialog);
25295
25127
  const { forceMount = portalContext.forceMount, ...contentProps } = props;
25296
25128
  const context = useDialogContext(CONTENT_NAME5, props.__scopeDialog);
25297
- return /* @__PURE__ */ jsx22(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx22(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx22(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
25129
+ return /* @__PURE__ */ jsx21(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx21(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx21(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
25298
25130
  }
25299
25131
  );
25300
25132
  DialogContent.displayName = CONTENT_NAME5;
@@ -25307,7 +25139,7 @@ var DialogContentModal = React32.forwardRef(
25307
25139
  const content = contentRef.current;
25308
25140
  if (content) return hideOthers(content);
25309
25141
  }, []);
25310
- return /* @__PURE__ */ jsx22(
25142
+ return /* @__PURE__ */ jsx21(
25311
25143
  DialogContentImpl,
25312
25144
  {
25313
25145
  ...props,
@@ -25337,7 +25169,7 @@ var DialogContentNonModal = React32.forwardRef(
25337
25169
  const context = useDialogContext(CONTENT_NAME5, props.__scopeDialog);
25338
25170
  const hasInteractedOutsideRef = React32.useRef(false);
25339
25171
  const hasPointerDownOutsideRef = React32.useRef(false);
25340
- return /* @__PURE__ */ jsx22(
25172
+ return /* @__PURE__ */ jsx21(
25341
25173
  DialogContentImpl,
25342
25174
  {
25343
25175
  ...props,
@@ -25380,7 +25212,7 @@ var DialogContentImpl = React32.forwardRef(
25380
25212
  const composedRefs = useComposedRefs(forwardedRef, contentRef);
25381
25213
  useFocusGuards();
25382
25214
  return /* @__PURE__ */ jsxs6(Fragment7, { children: [
25383
- /* @__PURE__ */ jsx22(
25215
+ /* @__PURE__ */ jsx21(
25384
25216
  FocusScope,
25385
25217
  {
25386
25218
  asChild: true,
@@ -25388,7 +25220,7 @@ var DialogContentImpl = React32.forwardRef(
25388
25220
  trapped: trapFocus,
25389
25221
  onMountAutoFocus: onOpenAutoFocus,
25390
25222
  onUnmountAutoFocus: onCloseAutoFocus,
25391
- children: /* @__PURE__ */ jsx22(
25223
+ children: /* @__PURE__ */ jsx21(
25392
25224
  DismissableLayer,
25393
25225
  {
25394
25226
  role: "dialog",
@@ -25404,8 +25236,8 @@ var DialogContentImpl = React32.forwardRef(
25404
25236
  }
25405
25237
  ),
25406
25238
  /* @__PURE__ */ jsxs6(Fragment7, { children: [
25407
- /* @__PURE__ */ jsx22(TitleWarning, { titleId: context.titleId }),
25408
- /* @__PURE__ */ jsx22(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
25239
+ /* @__PURE__ */ jsx21(TitleWarning, { titleId: context.titleId }),
25240
+ /* @__PURE__ */ jsx21(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
25409
25241
  ] })
25410
25242
  ] });
25411
25243
  }
@@ -25415,7 +25247,7 @@ var DialogTitle = React32.forwardRef(
25415
25247
  (props, forwardedRef) => {
25416
25248
  const { __scopeDialog, ...titleProps } = props;
25417
25249
  const context = useDialogContext(TITLE_NAME, __scopeDialog);
25418
- return /* @__PURE__ */ jsx22(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
25250
+ return /* @__PURE__ */ jsx21(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
25419
25251
  }
25420
25252
  );
25421
25253
  DialogTitle.displayName = TITLE_NAME;
@@ -25424,7 +25256,7 @@ var DialogDescription = React32.forwardRef(
25424
25256
  (props, forwardedRef) => {
25425
25257
  const { __scopeDialog, ...descriptionProps } = props;
25426
25258
  const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
25427
- return /* @__PURE__ */ jsx22(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
25259
+ return /* @__PURE__ */ jsx21(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
25428
25260
  }
25429
25261
  );
25430
25262
  DialogDescription.displayName = DESCRIPTION_NAME;
@@ -25433,7 +25265,7 @@ var DialogClose = React32.forwardRef(
25433
25265
  (props, forwardedRef) => {
25434
25266
  const { __scopeDialog, ...closeProps } = props;
25435
25267
  const context = useDialogContext(CLOSE_NAME2, __scopeDialog);
25436
- return /* @__PURE__ */ jsx22(
25268
+ return /* @__PURE__ */ jsx21(
25437
25269
  Primitive.button,
25438
25270
  {
25439
25271
  type: "button",
@@ -26682,16 +26514,16 @@ var cn2 = /* @__PURE__ */ wrapClsx(instance.mergeString, instance);
26682
26514
  var twMerge2 = instance.merge;
26683
26515
 
26684
26516
  // ../ui/src/components/dialog.tsx
26685
- import { jsx as jsx23, jsxs as jsxs7 } from "react/jsx-runtime";
26517
+ import { jsx as jsx22, jsxs as jsxs7 } from "react/jsx-runtime";
26686
26518
  function Dialog2({
26687
26519
  ...props
26688
26520
  }) {
26689
- return /* @__PURE__ */ jsx23(dist_exports7.Root, { "data-slot": "dialog", ...props });
26521
+ return /* @__PURE__ */ jsx22(dist_exports7.Root, { "data-slot": "dialog", ...props });
26690
26522
  }
26691
26523
  function DialogClose2({
26692
26524
  ...props
26693
26525
  }) {
26694
- return /* @__PURE__ */ jsx23(dist_exports7.Close, { "data-slot": "dialog-close", ...props });
26526
+ return /* @__PURE__ */ jsx22(dist_exports7.Close, { "data-slot": "dialog-close", ...props });
26695
26527
  }
26696
26528
 
26697
26529
  // ../ui/src/composites/dialog.tsx
@@ -26731,9 +26563,9 @@ function loopTabInShadowRoot(event) {
26731
26563
  }
26732
26564
 
26733
26565
  // ../ui/src/composites/dialog.tsx
26734
- import { jsx as jsx24, jsxs as jsxs8 } from "react/jsx-runtime";
26566
+ import { jsx as jsx23, jsxs as jsxs8 } from "react/jsx-runtime";
26735
26567
  var DialogOverlay2 = forwardRef17(function DialogOverlay3({ className, ...props }, ref) {
26736
- return /* @__PURE__ */ jsx24(
26568
+ return /* @__PURE__ */ jsx23(
26737
26569
  dist_exports7.Overlay,
26738
26570
  {
26739
26571
  ref,
@@ -26756,7 +26588,7 @@ function DialogContent2({
26756
26588
  }) {
26757
26589
  const overlayRoot = useOverlayRoot();
26758
26590
  return /* @__PURE__ */ jsxs8(dist_exports7.Portal, { "data-slot": "dialog-portal", container: overlayRoot, children: [
26759
- /* @__PURE__ */ jsx24(DialogOverlay2, { className: overlayClassName }),
26591
+ /* @__PURE__ */ jsx23(DialogOverlay2, { className: overlayClassName }),
26760
26592
  /* @__PURE__ */ jsxs8(
26761
26593
  dist_exports7.Content,
26762
26594
  {
@@ -26778,8 +26610,8 @@ function DialogContent2({
26778
26610
  "data-slot": "dialog-close",
26779
26611
  className: "absolute top-4 right-4 rounded-[8px] p-2 text-[hsl(var(--muted-foreground))] opacity-90 transition-colors hover:bg-[hsl(var(--accent))] hover:opacity-100 focus:outline-none disabled:pointer-events-none",
26780
26612
  children: [
26781
- /* @__PURE__ */ jsx24(X, { size: 16 }),
26782
- /* @__PURE__ */ jsx24("span", { className: "sr-only", children: "\u5173\u95ED" })
26613
+ /* @__PURE__ */ jsx23(X, { size: 16 }),
26614
+ /* @__PURE__ */ jsx23("span", { className: "sr-only", children: "\u5173\u95ED" })
26783
26615
  ]
26784
26616
  }
26785
26617
  )
@@ -26789,7 +26621,7 @@ function DialogContent2({
26789
26621
  ] });
26790
26622
  }
26791
26623
  function DialogTitle2({ className, ...props }) {
26792
- return /* @__PURE__ */ jsx24(
26624
+ return /* @__PURE__ */ jsx23(
26793
26625
  dist_exports7.Title,
26794
26626
  {
26795
26627
  "data-slot": "dialog-title",
@@ -26802,7 +26634,7 @@ function DialogDescription2({
26802
26634
  className,
26803
26635
  ...props
26804
26636
  }) {
26805
- return /* @__PURE__ */ jsx24(
26637
+ return /* @__PURE__ */ jsx23(
26806
26638
  dist_exports7.Description,
26807
26639
  {
26808
26640
  "data-slot": "dialog-description",
@@ -26932,27 +26764,6 @@ export {
26932
26764
  X,
26933
26765
  cn,
26934
26766
  copyToClipboard,
26935
- ChatEnvironmentProvider,
26936
- useChatEnvironment,
26937
- useHighlightedCode,
26938
- useChatSessionDetail,
26939
- useHideTodo,
26940
- useChatRenderMode,
26941
- notifyChat,
26942
- useComposerBridge,
26943
- useChatVirtualizer,
26944
- getResultText,
26945
- getResultImages,
26946
- parseJsonValue,
26947
- isPlainObject,
26948
- getStringValue,
26949
- getNumberValue,
26950
- getBooleanValue,
26951
- extractErrorMessage,
26952
- getFileName,
26953
- formatBytes,
26954
- CodePreview,
26955
- parseKbSearchResult,
26956
26767
  getToolDescription,
26957
26768
  formatToolFileName,
26958
26769
  formatToolName,
@@ -26976,6 +26787,15 @@ export {
26976
26787
  usePlanRevealRevision,
26977
26788
  CurrentChatSessionProvider,
26978
26789
  useCurrentChatSessionId,
26790
+ ChatEnvironmentProvider,
26791
+ useChatEnvironment,
26792
+ useHighlightedCode,
26793
+ useChatSessionDetail,
26794
+ useHideTodo,
26795
+ useChatRenderMode,
26796
+ notifyChat,
26797
+ useComposerBridge,
26798
+ useChatVirtualizer,
26979
26799
  getInputHistoryGeneration,
26980
26800
  onInputCachesReset,
26981
26801
  pluginRefsForSend,
@@ -27111,4 +26931,4 @@ lucide-react/dist/esm/lucide-react.js:
27111
26931
  * See the LICENSE file in the root directory of this source tree.
27112
26932
  *)
27113
26933
  */
27114
- //# sourceMappingURL=chunk-UKQFSXGC.js.map
26934
+ //# sourceMappingURL=chunk-MERN5XEM.js.map