gz-research-assistant 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./core-CJ37HVMm.js";
2
2
  import { Component as _, createElement as ee, useCallback as v, useEffect as y, useId as b, useLayoutEffect as te, useMemo as ne, useRef as re, useState as x, useSyncExternalStore as ie } from "react";
3
3
  import { StyleProvider as ae } from "@ant-design/cssinjs";
4
- import { Alert as S, Badge as oe, Button as C, Card as se, Checkbox as ce, Collapse as w, ConfigProvider as le, Dropdown as ue, Empty as de, Input as T, InputNumber as fe, Select as E, Tabs as pe, Tag as D, Tooltip as me, Upload as he, getDesignTokenCssVariables as O } from "gz-ui-web";
5
- import { ApiOutlined as k, BulbOutlined as A, CameraOutlined as ge, CheckCircleOutlined as j, CheckOutlined as _e, CloseOutlined as ve, CodeOutlined as M, DashboardOutlined as N, DeleteOutlined as ye, DesktopOutlined as be, DownloadOutlined as xe, EditOutlined as P, EllipsisOutlined as F, ExperimentOutlined as Se, FieldTimeOutlined as Ce, FileAddOutlined as we, FileTextOutlined as Te, FlagOutlined as I, FolderOpenOutlined as Ee, FullscreenExitOutlined as L, FullscreenOutlined as R, HistoryOutlined as De, InfoCircleOutlined as z, LineChartOutlined as Oe, LinkOutlined as ke, MessageOutlined as Ae, MinusOutlined as B, PauseOutlined as je, PlayCircleOutlined as Me, PlusOutlined as V, ReadOutlined as Ne, SaveOutlined as H, ScissorOutlined as U, SearchOutlined as Pe, StopOutlined as Fe, UploadOutlined as Ie, VideoCameraOutlined as Le, WarningOutlined as Re } from "@ant-design/icons";
4
+ import { Alert as S, Badge as oe, Button as C, Card as se, Checkbox as w, Collapse as T, ConfigProvider as ce, Dropdown as le, Empty as ue, Input as E, InputNumber as de, Select as D, Tabs as fe, Tag as O, Tooltip as pe, Upload as me, getDesignTokenCssVariables as k } from "gz-ui-web";
5
+ import { ApiOutlined as A, BulbOutlined as j, CameraOutlined as he, CheckCircleOutlined as M, CheckOutlined as ge, CloseOutlined as _e, CodeOutlined as N, DashboardOutlined as P, DeleteOutlined as ve, DesktopOutlined as ye, DownloadOutlined as be, EditOutlined as F, EllipsisOutlined as I, ExperimentOutlined as xe, FieldTimeOutlined as Se, FileAddOutlined as Ce, FileTextOutlined as we, FlagOutlined as Te, FolderOpenOutlined as Ee, FullscreenExitOutlined as L, FullscreenOutlined as R, HistoryOutlined as De, InfoCircleOutlined as z, LineChartOutlined as Oe, LinkOutlined as ke, MessageOutlined as Ae, MinusOutlined as B, PauseOutlined as je, PlayCircleOutlined as Me, PlusOutlined as V, ReadOutlined as Ne, SaveOutlined as H, ScissorOutlined as U, SearchOutlined as Pe, StopOutlined as Fe, UploadOutlined as Ie, VideoCameraOutlined as Le, WarningOutlined as Re } from "@ant-design/icons";
6
6
  import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
7
7
  import { OverlayScrollbars as ze } from "overlayscrollbars";
8
8
  import { createRoot as Be } from "react-dom/client";
@@ -169,13 +169,13 @@ import * as Qe from "gz-laya-pilot/schema";
169
169
  qe(Y, Qe);
170
170
  // src/pages/assistant/components/ActionMenu.tsx
171
171
  function $e({ label: e, items: t, disabled: n }) {
172
- return /* @__PURE__ */ G(ue, {
172
+ return /* @__PURE__ */ G(le, {
173
173
  trigger: ["click"],
174
174
  menu: { items: t },
175
175
  disabled: n,
176
176
  children: /* @__PURE__ */ G(C, {
177
177
  type: "text",
178
- icon: /* @__PURE__ */ G(F, {}),
178
+ icon: /* @__PURE__ */ G(I, {}),
179
179
  "aria-label": e,
180
180
  disabled: n,
181
181
  children: "更多"
@@ -211,7 +211,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
211
211
  /* @__PURE__ */ K("h3", {
212
212
  className: X.subheading,
213
213
  "data-assistant-part": "subheading",
214
- children: [/* @__PURE__ */ G(j, {}), e ? "编辑断言" : "添加断言"]
214
+ children: [/* @__PURE__ */ G(M, {}), e ? "编辑断言" : "添加断言"]
215
215
  }),
216
216
  /* @__PURE__ */ K("div", {
217
217
  className: X.field,
@@ -219,7 +219,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
219
219
  children: [/* @__PURE__ */ G("label", {
220
220
  htmlFor: `${o}-name`,
221
221
  children: "断言名称"
222
- }), /* @__PURE__ */ G(T, {
222
+ }), /* @__PURE__ */ G(E, {
223
223
  id: `${o}-name`,
224
224
  placeholder: "例如:保存后显示成功提示",
225
225
  value: s.name,
@@ -234,7 +234,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
234
234
  children: [/* @__PURE__ */ G("label", {
235
235
  htmlFor: `${o}-position`,
236
236
  children: "执行位置"
237
- }), /* @__PURE__ */ G(E, {
237
+ }), /* @__PURE__ */ G(D, {
238
238
  id: `${o}-position`,
239
239
  value: l,
240
240
  disabled: r,
@@ -257,7 +257,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
257
257
  children: [/* @__PURE__ */ G("label", {
258
258
  htmlFor: `${o}-source`,
259
259
  children: "断言对象"
260
- }), /* @__PURE__ */ G(E, {
260
+ }), /* @__PURE__ */ G(D, {
261
261
  id: `${o}-source`,
262
262
  value: s.source,
263
263
  disabled: r,
@@ -280,7 +280,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
280
280
  children: [/* @__PURE__ */ G("label", {
281
281
  htmlFor: `${o}-operator`,
282
282
  children: "比较条件"
283
- }), /* @__PURE__ */ G(E, {
283
+ }), /* @__PURE__ */ G(D, {
284
284
  id: `${o}-operator`,
285
285
  value: s.operator,
286
286
  disabled: r,
@@ -301,7 +301,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
301
301
  children: [/* @__PURE__ */ G("label", {
302
302
  htmlFor: `${o}-method`,
303
303
  children: "请求方法"
304
- }), /* @__PURE__ */ G(E, {
304
+ }), /* @__PURE__ */ G(D, {
305
305
  id: `${o}-method`,
306
306
  value: s.method,
307
307
  disabled: r,
@@ -324,7 +324,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
324
324
  children: [/* @__PURE__ */ G("label", {
325
325
  htmlFor: `${o}-pathname`,
326
326
  children: "接口路径"
327
- }), /* @__PURE__ */ G(T, {
327
+ }), /* @__PURE__ */ G(E, {
328
328
  id: `${o}-pathname`,
329
329
  placeholder: "/api/orders",
330
330
  maxLength: 2e3,
@@ -351,7 +351,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
351
351
  htmlFor: `${o}-selector`,
352
352
  children: "元素定位(CSS)"
353
353
  }),
354
- /* @__PURE__ */ G(T, {
354
+ /* @__PURE__ */ G(E, {
355
355
  id: `${o}-selector`,
356
356
  value: s.selector,
357
357
  maxLength: 2e3,
@@ -372,7 +372,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
372
372
  children: [/* @__PURE__ */ G("label", {
373
373
  htmlFor: `${o}-expected`,
374
374
  children: m ? "调用次数" : "期望值"
375
- }), /* @__PURE__ */ G(T, {
375
+ }), /* @__PURE__ */ G(E, {
376
376
  id: `${o}-expected`,
377
377
  value: s.expected,
378
378
  maxLength: 2e3,
@@ -387,7 +387,7 @@ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
387
387
  children: [/* @__PURE__ */ G("label", {
388
388
  htmlFor: `${o}-timeout`,
389
389
  children: m ? "观察时间(毫秒)" : "最长等待时间(毫秒)"
390
- }), /* @__PURE__ */ G(fe, {
390
+ }), /* @__PURE__ */ G(de, {
391
391
  id: `${o}-timeout`,
392
392
  min: 500,
393
393
  max: 3e4,
@@ -440,7 +440,7 @@ var tt = {
440
440
  // src/pages/assistant/components/StepSupplement/index.tsx
441
441
  function nt({ step: e, disabled: t, onApply: n }) {
442
442
  let r = b(), [i, a] = x("click"), [o, s] = x(""), [c, l] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, h] = x("");
443
- return /* @__PURE__ */ G(w, {
443
+ return /* @__PURE__ */ G(T, {
444
444
  className: tt.supplement,
445
445
  "data-assistant-part": "supplement",
446
446
  ghost: !0,
@@ -470,7 +470,7 @@ function nt({ step: e, disabled: t, onApply: n }) {
470
470
  children: [/* @__PURE__ */ G("label", {
471
471
  htmlFor: r,
472
472
  children: "操作类型"
473
- }), /* @__PURE__ */ G(E, {
473
+ }), /* @__PURE__ */ G(D, {
474
474
  id: r,
475
475
  "aria-label": "补充操作类型",
476
476
  value: i,
@@ -511,9 +511,9 @@ function nt({ step: e, disabled: t, onApply: n }) {
511
511
  children: [/* @__PURE__ */ G("label", {
512
512
  htmlFor: `${r}-selector`,
513
513
  children: "CSS 定位"
514
- }), /* @__PURE__ */ G(T, {
514
+ }), /* @__PURE__ */ G(E, {
515
515
  id: `${r}-selector`,
516
- prefix: /* @__PURE__ */ G(M, {}),
516
+ prefix: /* @__PURE__ */ G(N, {}),
517
517
  placeholder: "例如 button[aria-label=\"展开\"]",
518
518
  maxLength: 2e3,
519
519
  value: o,
@@ -526,9 +526,9 @@ function nt({ step: e, disabled: t, onApply: n }) {
526
526
  children: [/* @__PURE__ */ G("label", {
527
527
  htmlFor: `${r}-label`,
528
528
  children: "控件文字"
529
- }), /* @__PURE__ */ G(T, {
529
+ }), /* @__PURE__ */ G(E, {
530
530
  id: `${r}-label`,
531
- prefix: /* @__PURE__ */ G(P, {}),
531
+ prefix: /* @__PURE__ */ G(F, {}),
532
532
  placeholder: "如按钮文字、无障碍名称或输入提示",
533
533
  maxLength: 200,
534
534
  value: c,
@@ -547,7 +547,7 @@ function nt({ step: e, disabled: t, onApply: n }) {
547
547
  children: [/* @__PURE__ */ G("label", {
548
548
  htmlFor: `${r}-value`,
549
549
  children: i === "press" ? "按键" : i === "assert-text" ? "预期文字" : "输入值"
550
- }), /* @__PURE__ */ G(T, {
550
+ }), /* @__PURE__ */ G(E, {
551
551
  id: `${r}-value`,
552
552
  placeholder: i === "press" ? "Enter / Escape / Tab" : void 0,
553
553
  maxLength: 2e3,
@@ -556,14 +556,14 @@ function nt({ step: e, disabled: t, onApply: n }) {
556
556
  onChange: (e) => d(e.target.value)
557
557
  })]
558
558
  }),
559
- i === "check" && /* @__PURE__ */ G(ce, {
559
+ i === "check" && /* @__PURE__ */ G(w, {
560
560
  checked: f,
561
561
  disabled: t,
562
562
  onChange: (e) => p(e.target.checked),
563
563
  children: "选中"
564
564
  }),
565
565
  /* @__PURE__ */ G(C, {
566
- icon: /* @__PURE__ */ G(_e, {}),
566
+ icon: /* @__PURE__ */ G(ge, {}),
567
567
  disabled: t,
568
568
  onClick: () => {
569
569
  try {
@@ -693,7 +693,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
693
693
  }
694
694
  }, te = (t, n) => r.id && /* @__PURE__ */ G(C, {
695
695
  type: "link",
696
- icon: /* @__PURE__ */ G(xe, {}),
696
+ icon: /* @__PURE__ */ G(be, {}),
697
697
  href: it(e, r.id, t),
698
698
  children: n
699
699
  });
@@ -710,7 +710,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
710
710
  children: [
711
711
  /* @__PURE__ */ K("div", {
712
712
  className: Z.cardHeading,
713
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Se, {}), "自主探索"] }), /* @__PURE__ */ G(D, {
713
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(xe, {}), "自主探索"] }), /* @__PURE__ */ G(O, {
714
714
  color: v ? "processing" : r.state === "passed" ? "success" : "default",
715
715
  children: at[r.state]
716
716
  })]
@@ -727,7 +727,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
727
727
  children: [/* @__PURE__ */ G("label", {
728
728
  htmlFor: "assistant-explore-target",
729
729
  children: "测试页面"
730
- }), /* @__PURE__ */ G(E, {
730
+ }), /* @__PURE__ */ G(D, {
731
731
  id: "assistant-explore-target",
732
732
  "aria-label": "自主探索测试页面",
733
733
  placeholder: "选择测试页面",
@@ -741,7 +741,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
741
741
  })) ?? []
742
742
  })]
743
743
  }),
744
- /* @__PURE__ */ G(ce, {
744
+ /* @__PURE__ */ G(w, {
745
745
  disabled: v || t,
746
746
  checked: l,
747
747
  onChange: (e) => u(e.target.checked),
@@ -758,7 +758,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
758
758
  children: "停止探索"
759
759
  }) : /* @__PURE__ */ G(C, {
760
760
  type: "primary",
761
- icon: /* @__PURE__ */ G(Se, {}),
761
+ icon: /* @__PURE__ */ G(xe, {}),
762
762
  disabled: v || t || !s || !h || !a?.configured,
763
763
  onClick: () => void b("explore"),
764
764
  children: "开始自主探索"
@@ -786,7 +786,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
786
786
  r.trace && te(r.trace, "下载 Trace")
787
787
  ]
788
788
  }),
789
- /* @__PURE__ */ G(w, {
789
+ /* @__PURE__ */ G(T, {
790
790
  size: "small",
791
791
  items: [{
792
792
  key: "replay",
@@ -800,7 +800,7 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
800
800
  }),
801
801
  /* @__PURE__ */ K("div", {
802
802
  className: Z.buttonRow,
803
- children: [/* @__PURE__ */ G(he, {
803
+ children: [/* @__PURE__ */ G(me, {
804
804
  accept: ".xlsx",
805
805
  maxCount: 1,
806
806
  showUploadList: !1,
@@ -840,13 +840,13 @@ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
840
840
  })
841
841
  }]
842
842
  }),
843
- r.cases.length > 0 && /* @__PURE__ */ G(w, {
843
+ r.cases.length > 0 && /* @__PURE__ */ G(T, {
844
844
  size: "small",
845
845
  items: r.cases.map((e) => ({
846
846
  key: e.id,
847
847
  label: /* @__PURE__ */ K("div", {
848
848
  className: Z.caseHeading,
849
- children: [/* @__PURE__ */ G(D, {
849
+ children: [/* @__PURE__ */ G(O, {
850
850
  color: e.state === "passed" ? "success" : e.state === "failed" ? "error" : "default",
851
851
  children: ot[e.state]
852
852
  }), /* @__PURE__ */ G("span", { children: e.title })]
@@ -932,7 +932,7 @@ function dt({ run: e, base: t, onExport: n }) {
932
932
  children: "导出报告 JSON"
933
933
  })
934
934
  }),
935
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(D, { children: ut[e.state] ?? e.state }), e.message] }),
935
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(O, { children: ut[e.state] ?? e.state }), e.message] }),
936
936
  e.iterations?.map(({ iteration: n, cases: r }) => /* @__PURE__ */ K("details", { children: [/* @__PURE__ */ K("summary", { children: [
937
937
  "第 ",
938
938
  n,
@@ -951,7 +951,7 @@ function dt({ run: e, base: t, onExport: n }) {
951
951
  ] }),
952
952
  /* @__PURE__ */ G("code", { children: r.url ?? r.path }),
953
953
  /* @__PURE__ */ K("span", { children: [
954
- /* @__PURE__ */ G(D, { children: ut[r.status.state] ?? r.status.state }),
954
+ /* @__PURE__ */ G(O, { children: ut[r.status.state] ?? r.status.state }),
955
955
  "步骤 ",
956
956
  r.status.step,
957
957
  " / ",
@@ -974,7 +974,7 @@ function dt({ run: e, base: t, onExport: n }) {
974
974
  r.status.failure.hint && /* @__PURE__ */ K("div", { children: ["建议检查:", r.status.failure.hint] })
975
975
  ] }),
976
976
  r.status.assertions?.map((e) => /* @__PURE__ */ K("div", { children: [
977
- /* @__PURE__ */ G(D, {
977
+ /* @__PURE__ */ G(O, {
978
978
  color: e.passed ? "green" : "red",
979
979
  children: e.passed ? "通过" : "失败"
980
980
  }),
@@ -1007,7 +1007,7 @@ function dt({ run: e, base: t, onExport: n }) {
1007
1007
  }
1008
1008
  // src/pages/assistant/components/TestLibraryPanel/LibraryDetail.tsx
1009
1009
  function ft({ options: e, values: t, onChange: n }) {
1010
- return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(E, {
1010
+ return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(D, {
1011
1011
  "aria-label": "添加到执行顺序",
1012
1012
  placeholder: "选择要添加的项目",
1013
1013
  value: null,
@@ -1040,37 +1040,37 @@ function ft({ options: e, values: t, onChange: n }) {
1040
1040
  })] }, i))
1041
1041
  })] });
1042
1042
  }
1043
- function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, onEdit: o, recording: s, incomingDraft: c, onConsumeDraft: l, renderEditor: u }) {
1044
- let [d, f] = x(), [m, h] = x([]), [g, _] = x("cases"), ee = re(null), [b, ne] = x(!1), [ie, ae] = x(""), [oe, ce] = x(), [w, le] = x(), [ue, me] = x(!1), [he, O] = x(!1), [k, A] = x(), ge = !!(k && k.baseline !== JSON.stringify(i)), j = () => !s && (!ge || window.confirm("当前用例有未保存修改,确定离开?")), _e = (e, t, n) => {
1045
- o(e), ce(t), xe(void 0), le(n), A({
1043
+ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, onEdit: o, recording: s, incomingDraft: c, onConsumeDraft: l, renderCase: u }) {
1044
+ let [d, f] = x(), [m, h] = x([]), [g, _] = x("cases"), ee = re(null), [b, ne] = x(!1), [ie, ae] = x(""), [oe, w] = x(), [T, ce] = x(), [le, pe] = x(!1), [me, k] = x(!1), [A, j] = x(), he = !!(A && A.baseline !== JSON.stringify(i)), M = () => !s && (!he || window.confirm("当前用例有未保存修改,确定离开?")), ge = (e, t, n) => {
1045
+ o(e), w(t), be(void 0), ce(n), j({
1046
1046
  caseId: t,
1047
1047
  suiteId: n,
1048
1048
  baseline: JSON.stringify(e)
1049
1049
  }), _("cases");
1050
- }, ve = (e) => {
1051
- !b && !s && j() && Le() && Re() && (A(void 0), me(!1), O(!1), _(e));
1052
- }, [M, N] = x({
1050
+ }, _e = (e) => {
1051
+ !b && !s && M() && Le() && Re() && (j(void 0), pe(!1), k(!1), _(e));
1052
+ }, [N, P] = x({
1053
1053
  id: "",
1054
1054
  name: "",
1055
1055
  caseIds: []
1056
- }), ye = re(null), [be, xe] = x(), [P, F] = x({
1056
+ }), ve = re(null), [ye, be] = x(), [F, I] = x({
1057
1057
  id: "",
1058
1058
  name: "",
1059
1059
  suiteIds: [],
1060
1060
  repeat: 1
1061
- }), [Se, Ce] = x(), [we, Te] = x();
1061
+ }), [xe, Se] = x(), [Ce, we] = x();
1062
1062
  y(() => {
1063
- c && d && !s && !b && ((!ge || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && Le() && Re() && (me(!1), O(!1), ce(void 0), le(void 0), o(c), A({ baseline: "" }), _("cases")), l?.());
1063
+ c && d && !s && !b && ((!he || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && Le() && Re() && (pe(!1), k(!1), w(void 0), ce(void 0), o(c), j({ baseline: "" }), _("cases")), l?.());
1064
1064
  }, [
1065
1065
  c,
1066
1066
  d,
1067
1067
  s,
1068
1068
  b,
1069
- ge,
1069
+ he,
1070
1070
  o,
1071
1071
  l
1072
1072
  ]);
1073
- let I = Se ?? m[0]?.id, Ee = m.some((e) => e.state === "running" || e.state === "stopping"), L = lt(e), R = async (e) => {
1073
+ let Te = xe ?? m[0]?.id, Ee = m.some((e) => e.state === "running" || e.state === "stopping"), L = lt(e), R = async (e) => {
1074
1074
  if (!b) {
1075
1075
  ne(!0), ae("");
1076
1076
  try {
@@ -1095,10 +1095,10 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1095
1095
  e.signal.aborted || ne(!1);
1096
1096
  }), () => e.abort();
1097
1097
  }, [De]), y(() => {
1098
- if (!Ee && (!I || g !== "reports")) return;
1098
+ if (!Ee && (!Te || g !== "reports")) return;
1099
1099
  let e = new AbortController(), t = async () => {
1100
- let t = await L("/runs", "GET", void 0, e.signal), n = g === "reports" && I ? await L(`/runs/${I}`, "GET", void 0, e.signal) : void 0;
1101
- e.signal.aborted || (h(t), n && Te(n));
1100
+ let t = await L("/runs", "GET", void 0, e.signal), n = g === "reports" && Te ? await L(`/runs/${Te}`, "GET", void 0, e.signal) : void 0;
1101
+ e.signal.aborted || (h(t), n && we(n));
1102
1102
  }, n = () => void t().catch(() => {});
1103
1103
  n();
1104
1104
  let r = Ee ? setInterval(n, 1e3) : void 0;
@@ -1107,7 +1107,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1107
1107
  };
1108
1108
  }, [
1109
1109
  L,
1110
- I,
1110
+ Te,
1111
1111
  Ee,
1112
1112
  g
1113
1113
  ]);
@@ -1122,25 +1122,25 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1122
1122
  })) ?? [], Me = d?.suites.map(({ id: e, name: t }) => ({
1123
1123
  label: t,
1124
1124
  value: e
1125
- })) ?? [], V = d?.cases.find(({ id: e }) => e === oe), Ne = V ? d?.suites.filter((e) => !e.caseIds.includes(V.id)) ?? [] : [], H = d?.suites.find(({ id: e }) => e === M.id), U = d?.plans.find(({ id: e }) => e === P.id), Pe = H?.caseIds ?? [], Fe = M.name !== (H?.name ?? "") || JSON.stringify(M.caseIds) !== JSON.stringify(Pe), Ie = P.name !== (U?.name ?? "") || P.repeat !== (U?.repeat ?? 1) || JSON.stringify(P.suiteIds) !== JSON.stringify(U?.suiteIds ?? []), Le = () => !ue || !Fe || window.confirm("当前套件有未保存修改,确定放弃?"), Re = () => !he || !Ie || window.confirm("当前计划有未保存修改,确定放弃?");
1125
+ })) ?? [], V = d?.cases.find(({ id: e }) => e === oe), Ne = V ? d?.suites.filter((e) => !e.caseIds.includes(V.id)) ?? [] : [], H = d?.suites.find(({ id: e }) => e === N.id), U = d?.plans.find(({ id: e }) => e === F.id), Pe = H?.caseIds ?? [], Fe = N.name !== (H?.name ?? "") || JSON.stringify(N.caseIds) !== JSON.stringify(Pe), Ie = F.name !== (U?.name ?? "") || F.repeat !== (U?.repeat ?? 1) || JSON.stringify(F.suiteIds) !== JSON.stringify(U?.suiteIds ?? []), Le = () => !le || !Fe || window.confirm("当前套件有未保存修改,确定放弃?"), Re = () => !me || !Ie || window.confirm("当前计划有未保存修改,确定放弃?");
1126
1126
  te(() => {
1127
1127
  let e = ee.current?.closest("[role=\"dialog\"]");
1128
1128
  if (e) for (let t = ee.current?.parentElement; t && t !== e; t = t.parentElement) t.scrollTop && (t.scrollTop = 0);
1129
1129
  }, [
1130
1130
  g,
1131
1131
  oe,
1132
- k,
1133
- M.id,
1134
- ue,
1135
- P.id,
1136
- he
1132
+ A,
1133
+ N.id,
1134
+ le,
1135
+ F.id,
1136
+ me
1137
1137
  ]);
1138
1138
  let ze = g === "cases" ? V?.testCase.name : g === "suites" ? H?.name : g === "plans" ? U?.name : void 0, Be = () => {
1139
- !b && j() && Le() && Re() && (ce(void 0), A(void 0), me(!1), O(!1), N({
1139
+ !b && M() && Le() && Re() && (w(void 0), j(void 0), pe(!1), k(!1), P({
1140
1140
  id: "",
1141
1141
  name: "",
1142
1142
  caseIds: []
1143
- }), F({
1143
+ }), I({
1144
1144
  id: "",
1145
1145
  name: "",
1146
1146
  suiteIds: [],
@@ -1170,7 +1170,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1170
1170
  className: Q.entryLink,
1171
1171
  disabled: b || s,
1172
1172
  onClick: () => {
1173
- j() && Le() && Re() && n();
1173
+ M() && Le() && Re() && n();
1174
1174
  },
1175
1175
  children: "测试库"
1176
1176
  }),
@@ -1178,7 +1178,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1178
1178
  "aria-hidden": "true",
1179
1179
  children: "/"
1180
1180
  }),
1181
- ze || k || ue || he ? /* @__PURE__ */ K(W, { children: [
1181
+ ze || A || le || me ? /* @__PURE__ */ K(W, { children: [
1182
1182
  /* @__PURE__ */ G(C, {
1183
1183
  type: "link",
1184
1184
  size: "small",
@@ -1199,7 +1199,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1199
1199
  "aria-current": "page",
1200
1200
  className: Q.resourceName,
1201
1201
  title: ze,
1202
- children: ze ?? (k ? "新建用例" : ue ? "新建套件" : "新建计划")
1202
+ children: ze ?? (A ? "新建用例" : le ? "新建套件" : "新建计划")
1203
1203
  })
1204
1204
  ] }) : /* @__PURE__ */ G("h3", {
1205
1205
  className: Q.resourceName,
@@ -1207,7 +1207,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1207
1207
  children: t
1208
1208
  })
1209
1209
  ]
1210
- }), d && !ze && !k && !ue && !he && /* @__PURE__ */ K("div", {
1210
+ }), d && !ze && !A && !le && !me && /* @__PURE__ */ K("div", {
1211
1211
  className: Q.headerAction,
1212
1212
  children: [/* @__PURE__ */ G($e, {
1213
1213
  label: "测试库更多操作",
@@ -1228,7 +1228,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1228
1228
  key: "import",
1229
1229
  label: "导入测试库",
1230
1230
  disabled: !B,
1231
- onClick: () => ye.current?.click()
1231
+ onClick: () => ve.current?.click()
1232
1232
  },
1233
1233
  {
1234
1234
  key: "export",
@@ -1241,7 +1241,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1241
1241
  }), /* @__PURE__ */ G("input", {
1242
1242
  hidden: !0,
1243
1243
  type: "file",
1244
- ref: ye,
1244
+ ref: ve,
1245
1245
  accept: ".json,application/json",
1246
1246
  onChange: (e) => {
1247
1247
  let t = e.target.files?.[0];
@@ -1251,7 +1251,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1251
1251
  await Oe({
1252
1252
  ...e,
1253
1253
  revision: d.revision
1254
- }), Be(), Ce(void 0), _("cases");
1254
+ }), Be(), Se(void 0), _("cases");
1255
1255
  });
1256
1256
  }
1257
1257
  })]
@@ -1268,45 +1268,45 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1268
1268
  children: "刷新测试库"
1269
1269
  })
1270
1270
  }),
1271
- d ? /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(pe, {
1271
+ d ? /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(fe, {
1272
1272
  activeKey: g,
1273
- onChange: ve,
1273
+ onChange: _e,
1274
1274
  tabBarExtraContent: { right: /* @__PURE__ */ K("div", {
1275
1275
  className: Q.tabAction,
1276
1276
  children: [
1277
- g === "cases" && !k && !V && /* @__PURE__ */ G(C, {
1277
+ g === "cases" && !A && !V && /* @__PURE__ */ G(C, {
1278
1278
  type: "primary",
1279
1279
  size: "small",
1280
1280
  disabled: !B,
1281
1281
  onClick: () => {
1282
- _e(p());
1282
+ ge(p());
1283
1283
  },
1284
1284
  children: "新建用例"
1285
1285
  }),
1286
- g === "suites" && !ue && !H && /* @__PURE__ */ G(C, {
1286
+ g === "suites" && !le && !H && /* @__PURE__ */ G(C, {
1287
1287
  type: "primary",
1288
1288
  size: "small",
1289
1289
  disabled: !B,
1290
1290
  onClick: () => {
1291
- N({
1291
+ P({
1292
1292
  id: "",
1293
1293
  name: "",
1294
1294
  caseIds: []
1295
- }), me(!0);
1295
+ }), pe(!0);
1296
1296
  },
1297
1297
  children: "新建套件"
1298
1298
  }),
1299
- g === "plans" && !he && !U && /* @__PURE__ */ G(C, {
1299
+ g === "plans" && !me && !U && /* @__PURE__ */ G(C, {
1300
1300
  type: "primary",
1301
1301
  size: "small",
1302
1302
  disabled: !B,
1303
1303
  onClick: () => {
1304
- F({
1304
+ I({
1305
1305
  id: "",
1306
1306
  name: "",
1307
1307
  suiteIds: [],
1308
1308
  repeat: 1
1309
- }), O(!0);
1309
+ }), k(!0);
1310
1310
  },
1311
1311
  children: "新建计划"
1312
1312
  })
@@ -1316,22 +1316,23 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1316
1316
  {
1317
1317
  key: "cases",
1318
1318
  label: "用例",
1319
- children: k ? /* @__PURE__ */ K("div", {
1319
+ children: A ? /* @__PURE__ */ K("div", {
1320
1320
  className: Q.stack,
1321
1321
  children: [/* @__PURE__ */ K("div", {
1322
1322
  className: Q.buttonRow,
1323
- children: [/* @__PURE__ */ G("h4", { children: k.caseId ? "编辑用例" : "新建用例" }), /* @__PURE__ */ G(D, { children: ge ? "未保存" : k.caseId ? "已保存" : "新用例" })]
1323
+ children: [/* @__PURE__ */ G("h4", { children: A.caseId ? "编辑用例" : "新建用例" }), /* @__PURE__ */ G(O, { children: he ? "未保存" : A.caseId ? "已保存" : "新用例" })]
1324
1324
  }), u({
1325
+ testCase: i,
1325
1326
  busy: b || Ee || a && !s,
1326
- dirty: ge,
1327
+ dirty: he,
1327
1328
  cancel: () => {
1328
- j() && (A(void 0), k.suiteId && !k.caseId && _("suites"));
1329
+ M() && (j(void 0), A.suiteId && !A.caseId && _("suites"));
1329
1330
  },
1330
1331
  save: (e) => R(async () => {
1331
- let t = k.caseId ?? crypto.randomUUID();
1332
- if (k.caseId && !d.cases.some(({ id: e }) => e === t)) throw Error("当前用例已被删除,可返回后另存为新用例");
1333
- let n = d.suites.find(({ id: e }) => e === k.suiteId);
1334
- if (k.suiteId && !n) throw Error("原套件已被删除");
1332
+ let t = A.caseId ?? crypto.randomUUID();
1333
+ if (A.caseId && !d.cases.some(({ id: e }) => e === t)) throw Error("当前用例已被删除,可返回后另存为新用例");
1334
+ let n = d.suites.find(({ id: e }) => e === A.suiteId);
1335
+ if (A.suiteId && !n) throw Error("原套件已被删除");
1335
1336
  let r = n && !n.caseIds.includes(t) ? {
1336
1337
  ...n,
1337
1338
  caseIds: [...n.caseIds, t]
@@ -1343,45 +1344,28 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1343
1344
  testCase: e
1344
1345
  }),
1345
1346
  suites: r ? Ae(d.suites, r) : d.suites
1346
- }), r && N(r), o(e), ce(t), A(void 0);
1347
+ }), r && P(r), o(e), w(t), j(void 0);
1347
1348
  })
1348
1349
  })]
1349
1350
  }) : V ? /* @__PURE__ */ K("section", {
1350
1351
  className: Q.stack,
1351
1352
  "aria-label": "用例详情",
1352
1353
  children: [
1353
- /* @__PURE__ */ G("h4", { children: V.testCase.name }),
1354
- /* @__PURE__ */ G("code", { children: V.url ?? V.testCase.path }),
1355
- /* @__PURE__ */ G("ol", {
1356
- className: Q.list,
1357
- children: V.testCase.steps.map((e, t) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ K("strong", { children: [Ze[e.kind], e.assertion?.name ? ` · ${e.assertion.name}` : ""] }), e.assertion ? /* @__PURE__ */ K(W, { children: [
1358
- /* @__PURE__ */ G("span", { children: Y.assertionSources[e.assertion.source] }),
1359
- e.assertion.method && /* @__PURE__ */ K("code", { children: [
1360
- e.assertion.method,
1361
- " ",
1362
- e.assertion.pathname
1363
- ] }),
1364
- e.assertion.selector && /* @__PURE__ */ G("code", { children: e.assertion.selector }),
1365
- /* @__PURE__ */ K("span", { children: [
1366
- Y.assertionOperators[e.assertion.operator],
1367
- e.assertion.expected !== void 0 && ` · 期望:${e.assertion.expected === "" ? "空字符串" : e.assertion.expected}`,
1368
- " · ",
1369
- e.assertion.timeout / 1e3,
1370
- " 秒"
1371
- ] })
1372
- ] }) : /* @__PURE__ */ K(W, { children: [
1373
- e.target?.label && /* @__PURE__ */ G("span", { children: e.target.label }),
1374
- e.target?.selector && /* @__PURE__ */ G("code", { children: e.target.selector }),
1375
- e.kind === "check" && /* @__PURE__ */ G("span", { children: e.checked ? "选中" : "取消选中" }),
1376
- e.value !== void 0 && /* @__PURE__ */ G("span", { children: e.value || "空字符串" })
1377
- ] })] }, t))
1354
+ /* @__PURE__ */ K("div", {
1355
+ className: Q.buttonRow,
1356
+ children: [/* @__PURE__ */ G("h4", { children: "用例详情" }), /* @__PURE__ */ G(O, { children: "已保存" })]
1357
+ }),
1358
+ u({
1359
+ testCase: V.testCase,
1360
+ readOnly: !0,
1361
+ busy: b || Ee
1378
1362
  }),
1379
1363
  /* @__PURE__ */ K("div", {
1380
1364
  className: Q.buttonRow,
1381
1365
  children: [/* @__PURE__ */ G(C, {
1382
1366
  type: "primary",
1383
1367
  disabled: !B,
1384
- onClick: () => _e(V.testCase, V.id, w),
1368
+ onClick: () => ge(V.testCase, V.id, T),
1385
1369
  children: "编辑用例"
1386
1370
  }), /* @__PURE__ */ G($e, {
1387
1371
  label: "用例更多操作",
@@ -1395,7 +1379,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1395
1379
  window.confirm("删除该用例?") && (await Oe({
1396
1380
  ...d,
1397
1381
  cases: d.cases.filter(({ id: e }) => e !== V.id)
1398
- }), ce(void 0));
1382
+ }), w(void 0));
1399
1383
  })
1400
1384
  }]
1401
1385
  })]
@@ -1411,26 +1395,26 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1411
1395
  type: "link",
1412
1396
  size: "small",
1413
1397
  onClick: () => {
1414
- N(e), _("suites");
1398
+ P(e), _("suites");
1415
1399
  },
1416
1400
  children: e.name
1417
1401
  }, e.id)),
1418
- Ne.length > 0 && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(E, {
1402
+ Ne.length > 0 && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(D, {
1419
1403
  "aria-label": "选择套件",
1420
1404
  placeholder: "选择套件",
1421
- value: be,
1405
+ value: ye,
1422
1406
  options: Ne.map(({ id: e, name: t }) => ({
1423
1407
  value: e,
1424
1408
  label: t
1425
1409
  })),
1426
1410
  loading: b,
1427
1411
  disabled: !B,
1428
- onChange: xe
1412
+ onChange: be
1429
1413
  }), /* @__PURE__ */ G(C, {
1430
1414
  type: "text",
1431
- disabled: !B || !be,
1415
+ disabled: !B || !ye,
1432
1416
  onClick: () => {
1433
- let e = Ne.find((e) => e.id === be);
1417
+ let e = Ne.find((e) => e.id === ye);
1434
1418
  e && R(async () => {
1435
1419
  await Oe({
1436
1420
  ...d,
@@ -1438,7 +1422,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1438
1422
  ...e,
1439
1423
  caseIds: [...e.caseIds, V.id]
1440
1424
  })
1441
- }), xe(void 0);
1425
+ }), be(void 0);
1442
1426
  });
1443
1427
  },
1444
1428
  children: "添加到套件"
@@ -1447,11 +1431,11 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1447
1431
  type: "link",
1448
1432
  disabled: !B,
1449
1433
  onClick: () => {
1450
- N({
1434
+ P({
1451
1435
  id: "",
1452
1436
  name: "",
1453
1437
  caseIds: [V.id]
1454
- }), me(!0), _("suites");
1438
+ }), pe(!0), _("suites");
1455
1439
  },
1456
1440
  children: "新建套件"
1457
1441
  })
@@ -1461,7 +1445,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1461
1445
  ]
1462
1446
  }) : /* @__PURE__ */ K("div", {
1463
1447
  className: Q.stack,
1464
- children: [!d.cases.length && /* @__PURE__ */ G(de, { description: "暂无用例" }), /* @__PURE__ */ G("ul", {
1448
+ children: [!d.cases.length && /* @__PURE__ */ G(ue, { description: "暂无用例" }), /* @__PURE__ */ G("ul", {
1465
1449
  className: Q.resourceList,
1466
1450
  children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ K("div", { children: [
1467
1451
  /* @__PURE__ */ G(C, {
@@ -1469,7 +1453,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1469
1453
  size: "small",
1470
1454
  className: Q.entryLink,
1471
1455
  onClick: () => {
1472
- le(void 0), ce(e), xe(void 0);
1456
+ ce(void 0), w(e), be(void 0);
1473
1457
  },
1474
1458
  children: /* @__PURE__ */ G("span", {
1475
1459
  className: Q.resourceName,
@@ -1478,7 +1462,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1478
1462
  })
1479
1463
  }),
1480
1464
  " ",
1481
- /* @__PURE__ */ K(D, { children: [t.steps.length, " 步"] }),
1465
+ /* @__PURE__ */ K(O, { children: [t.steps.length, " 步"] }),
1482
1466
  /* @__PURE__ */ G("br", {}),
1483
1467
  /* @__PURE__ */ G("code", { children: n ?? t.path })
1484
1468
  ] }) }, e))
@@ -1488,18 +1472,18 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1488
1472
  {
1489
1473
  key: "suites",
1490
1474
  label: "套件",
1491
- children: ue ? /* @__PURE__ */ K("section", {
1475
+ children: le ? /* @__PURE__ */ K("section", {
1492
1476
  className: Q.stack,
1493
1477
  "aria-label": "套件编辑",
1494
1478
  children: [
1495
1479
  /* @__PURE__ */ G(C, {
1496
1480
  disabled: b,
1497
1481
  onClick: () => {
1498
- Le() && me(!1);
1482
+ Le() && pe(!1);
1499
1483
  },
1500
1484
  children: "取消"
1501
1485
  }),
1502
- /* @__PURE__ */ G("h4", { children: M.id ? "编辑套件" : "新建套件" }),
1486
+ /* @__PURE__ */ G("h4", { children: N.id ? "编辑套件" : "新建套件" }),
1503
1487
  /* @__PURE__ */ K("div", {
1504
1488
  className: Q.stack,
1505
1489
  children: [
@@ -1507,19 +1491,19 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1507
1491
  htmlFor: "assistant-suite-name",
1508
1492
  children: "套件名称"
1509
1493
  }),
1510
- /* @__PURE__ */ G(T, {
1494
+ /* @__PURE__ */ G(E, {
1511
1495
  id: "assistant-suite-name",
1512
1496
  "aria-required": "true",
1513
- "aria-invalid": !M.name.trim(),
1514
- "aria-describedby": M.name.trim() ? void 0 : "assistant-suite-name-error",
1497
+ "aria-invalid": !N.name.trim(),
1498
+ "aria-describedby": N.name.trim() ? void 0 : "assistant-suite-name-error",
1515
1499
  maxLength: 100,
1516
- value: M.name,
1517
- onChange: (e) => N({
1518
- ...M,
1500
+ value: N.name,
1501
+ onChange: (e) => P({
1502
+ ...N,
1519
1503
  name: e.target.value
1520
1504
  })
1521
1505
  }),
1522
- !M.name.trim() && /* @__PURE__ */ G("span", {
1506
+ !N.name.trim() && /* @__PURE__ */ G("span", {
1523
1507
  className: Q.hint,
1524
1508
  id: "assistant-suite-name-error",
1525
1509
  children: "请输入套件名称"
@@ -1528,25 +1512,25 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1528
1512
  }),
1529
1513
  /* @__PURE__ */ G(ft, {
1530
1514
  options: je,
1531
- values: M.caseIds,
1532
- onChange: (e) => N({
1533
- ...M,
1515
+ values: N.caseIds,
1516
+ onChange: (e) => P({
1517
+ ...N,
1534
1518
  caseIds: e
1535
1519
  })
1536
1520
  }),
1537
1521
  /* @__PURE__ */ G(C, {
1538
1522
  type: "primary",
1539
- disabled: !B || !M.name.trim() || !M.caseIds.length,
1523
+ disabled: !B || !N.name.trim() || !N.caseIds.length,
1540
1524
  onClick: () => void R(async () => {
1541
1525
  let e = {
1542
- ...M,
1543
- id: M.id || crypto.randomUUID(),
1544
- name: M.name.trim()
1526
+ ...N,
1527
+ id: N.id || crypto.randomUUID(),
1528
+ name: N.name.trim()
1545
1529
  };
1546
1530
  await Oe({
1547
1531
  ...d,
1548
1532
  suites: Ae(d.suites, e)
1549
- }), N(e), me(!1);
1533
+ }), P(e), pe(!1);
1550
1534
  }),
1551
1535
  children: "保存套件"
1552
1536
  })
@@ -1563,7 +1547,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1563
1547
  size: "small",
1564
1548
  className: Q.entryLink,
1565
1549
  onClick: () => {
1566
- ce(e), le(H.id), xe(void 0), _("cases");
1550
+ w(e), ce(H.id), be(void 0), _("cases");
1567
1551
  },
1568
1552
  children: je.find(({ value: t }) => t === e)?.label ?? e
1569
1553
  }) }, t))
@@ -1575,26 +1559,26 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1575
1559
  type: "primary",
1576
1560
  disabled: !B,
1577
1561
  onClick: () => {
1578
- N(H), me(!0);
1562
+ P(H), pe(!0);
1579
1563
  },
1580
1564
  children: "编辑套件"
1581
1565
  }),
1582
1566
  /* @__PURE__ */ G(C, {
1583
1567
  type: "text",
1584
1568
  disabled: !B,
1585
- onClick: () => _e(p(), void 0, H.id),
1569
+ onClick: () => ge(p(), void 0, H.id),
1586
1570
  children: "新建用例"
1587
1571
  }),
1588
1572
  /* @__PURE__ */ G(C, {
1589
1573
  type: "text",
1590
1574
  disabled: !B,
1591
1575
  onClick: () => {
1592
- F({
1576
+ I({
1593
1577
  id: "",
1594
1578
  name: "",
1595
1579
  suiteIds: [H.id],
1596
1580
  repeat: 1
1597
- }), O(!0), _("plans");
1581
+ }), k(!0), _("plans");
1598
1582
  },
1599
1583
  children: "创建计划"
1600
1584
  }),
@@ -1610,7 +1594,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1610
1594
  window.confirm("删除该套件?") && (await Oe({
1611
1595
  ...d,
1612
1596
  suites: d.suites.filter(({ id: e }) => e !== H.id)
1613
- }), N({
1597
+ }), P({
1614
1598
  id: "",
1615
1599
  name: "",
1616
1600
  caseIds: []
@@ -1623,14 +1607,14 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1623
1607
  ]
1624
1608
  }) : /* @__PURE__ */ K("div", {
1625
1609
  className: Q.stack,
1626
- children: [!d.suites.length && /* @__PURE__ */ G(de, { description: "暂无套件" }), /* @__PURE__ */ G("ul", {
1610
+ children: [!d.suites.length && /* @__PURE__ */ G(ue, { description: "暂无套件" }), /* @__PURE__ */ G("ul", {
1627
1611
  className: Q.resourceList,
1628
1612
  children: d.suites.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1629
1613
  type: "link",
1630
1614
  size: "small",
1631
1615
  className: Q.entryLink,
1632
1616
  onClick: () => {
1633
- N(e);
1617
+ P(e);
1634
1618
  },
1635
1619
  children: /* @__PURE__ */ G("span", {
1636
1620
  className: Q.resourceName,
@@ -1644,18 +1628,18 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1644
1628
  {
1645
1629
  key: "plans",
1646
1630
  label: "计划",
1647
- children: he ? /* @__PURE__ */ K("section", {
1631
+ children: me ? /* @__PURE__ */ K("section", {
1648
1632
  className: Q.stack,
1649
1633
  "aria-label": "计划编辑",
1650
1634
  children: [
1651
1635
  /* @__PURE__ */ G(C, {
1652
1636
  disabled: b,
1653
1637
  onClick: () => {
1654
- Re() && O(!1);
1638
+ Re() && k(!1);
1655
1639
  },
1656
1640
  children: "取消"
1657
1641
  }),
1658
- /* @__PURE__ */ G("h4", { children: P.id ? "编辑计划" : "新建计划" }),
1642
+ /* @__PURE__ */ G("h4", { children: F.id ? "编辑计划" : "新建计划" }),
1659
1643
  /* @__PURE__ */ K("div", {
1660
1644
  className: Q.stack,
1661
1645
  children: [
@@ -1663,19 +1647,19 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1663
1647
  htmlFor: "assistant-plan-name",
1664
1648
  children: "计划名称"
1665
1649
  }),
1666
- /* @__PURE__ */ G(T, {
1650
+ /* @__PURE__ */ G(E, {
1667
1651
  id: "assistant-plan-name",
1668
1652
  "aria-required": "true",
1669
- "aria-invalid": !P.name.trim(),
1670
- "aria-describedby": P.name.trim() ? void 0 : "assistant-plan-name-error",
1653
+ "aria-invalid": !F.name.trim(),
1654
+ "aria-describedby": F.name.trim() ? void 0 : "assistant-plan-name-error",
1671
1655
  maxLength: 100,
1672
- value: P.name,
1673
- onChange: (e) => F({
1674
- ...P,
1656
+ value: F.name,
1657
+ onChange: (e) => I({
1658
+ ...F,
1675
1659
  name: e.target.value
1676
1660
  })
1677
1661
  }),
1678
- !P.name.trim() && /* @__PURE__ */ G("span", {
1662
+ !F.name.trim() && /* @__PURE__ */ G("span", {
1679
1663
  className: Q.hint,
1680
1664
  id: "assistant-plan-name-error",
1681
1665
  children: "请输入计划名称"
@@ -1685,39 +1669,39 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1685
1669
  /* @__PURE__ */ K("label", { children: [
1686
1670
  "重复轮数",
1687
1671
  " ",
1688
- /* @__PURE__ */ G(fe, {
1672
+ /* @__PURE__ */ G(de, {
1689
1673
  min: 1,
1690
1674
  max: 20,
1691
1675
  precision: 0,
1692
1676
  "aria-label": "重复轮数",
1693
- value: P.repeat,
1694
- onChange: (e) => F({
1695
- ...P,
1677
+ value: F.repeat,
1678
+ onChange: (e) => I({
1679
+ ...F,
1696
1680
  repeat: e ?? 1
1697
1681
  })
1698
1682
  })
1699
1683
  ] }),
1700
1684
  /* @__PURE__ */ G(ft, {
1701
1685
  options: Me,
1702
- values: P.suiteIds,
1703
- onChange: (e) => F({
1704
- ...P,
1686
+ values: F.suiteIds,
1687
+ onChange: (e) => I({
1688
+ ...F,
1705
1689
  suiteIds: e
1706
1690
  })
1707
1691
  }),
1708
1692
  /* @__PURE__ */ G(C, {
1709
1693
  type: "primary",
1710
- disabled: !B || !P.name.trim() || !P.suiteIds.length,
1694
+ disabled: !B || !F.name.trim() || !F.suiteIds.length,
1711
1695
  onClick: () => void R(async () => {
1712
1696
  let e = {
1713
- ...P,
1714
- id: P.id || crypto.randomUUID(),
1715
- name: P.name.trim()
1697
+ ...F,
1698
+ id: F.id || crypto.randomUUID(),
1699
+ name: F.name.trim()
1716
1700
  };
1717
1701
  await Oe({
1718
1702
  ...d,
1719
1703
  plans: Ae(d.plans, e)
1720
- }), F(e), O(!1);
1704
+ }), I(e), k(!1);
1721
1705
  }),
1722
1706
  children: "保存计划"
1723
1707
  })
@@ -1740,7 +1724,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1740
1724
  className: Q.entryLink,
1741
1725
  onClick: () => {
1742
1726
  let t = d.suites.find((t) => t.id === e);
1743
- t && (N(t), _("suites"));
1727
+ t && (P(t), _("suites"));
1744
1728
  },
1745
1729
  children: Me.find(({ value: t }) => t === e)?.label ?? e
1746
1730
  }) }, t))
@@ -1751,7 +1735,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1751
1735
  type: "text",
1752
1736
  disabled: !B,
1753
1737
  onClick: () => {
1754
- F(U), O(!0);
1738
+ I(U), k(!0);
1755
1739
  },
1756
1740
  children: "编辑计划"
1757
1741
  }), /* @__PURE__ */ G($e, {
@@ -1765,7 +1749,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1765
1749
  window.confirm("删除该计划?") && (await Oe({
1766
1750
  ...d,
1767
1751
  plans: d.plans.filter(({ id: e }) => e !== U.id)
1768
- }), F({
1752
+ }), I({
1769
1753
  id: "",
1770
1754
  name: "",
1771
1755
  suiteIds: [],
@@ -1784,20 +1768,20 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1784
1768
  disabled: !B,
1785
1769
  onClick: () => void R(async () => {
1786
1770
  let e = await L("/run", "POST", { planId: U.id });
1787
- h([e, ...m]), Ce(e.id), _("reports");
1771
+ h([e, ...m]), Se(e.id), _("reports");
1788
1772
  }),
1789
1773
  children: "运行计划"
1790
1774
  })
1791
1775
  ]
1792
1776
  }) : /* @__PURE__ */ K("div", {
1793
1777
  className: Q.stack,
1794
- children: [!d.plans.length && /* @__PURE__ */ G(de, { description: "暂无计划" }), /* @__PURE__ */ G("ul", {
1778
+ children: [!d.plans.length && /* @__PURE__ */ G(ue, { description: "暂无计划" }), /* @__PURE__ */ G("ul", {
1795
1779
  className: Q.resourceList,
1796
1780
  children: d.plans.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1797
1781
  type: "link",
1798
1782
  size: "small",
1799
1783
  className: Q.entryLink,
1800
- onClick: () => F(e),
1784
+ onClick: () => I(e),
1801
1785
  children: /* @__PURE__ */ G("span", {
1802
1786
  className: Q.resourceName,
1803
1787
  title: e.name,
@@ -1824,7 +1808,7 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1824
1808
  type: "text",
1825
1809
  disabled: b,
1826
1810
  onClick: () => void R(async () => {
1827
- h(await L("/runs")), I && Te(await L(`/runs/${I}`));
1811
+ h(await L("/runs")), Te && we(await L(`/runs/${Te}`));
1828
1812
  }),
1829
1813
  children: "刷新报告"
1830
1814
  }), /* @__PURE__ */ G(C, {
@@ -1838,20 +1822,20 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1838
1822
  children: "停止计划"
1839
1823
  })]
1840
1824
  }),
1841
- !m.length && /* @__PURE__ */ G(de, { description: "暂无运行报告" }),
1842
- m.length > 0 && /* @__PURE__ */ G(E, {
1825
+ !m.length && /* @__PURE__ */ G(ue, { description: "暂无运行报告" }),
1826
+ m.length > 0 && /* @__PURE__ */ G(D, {
1843
1827
  "aria-label": "运行报告",
1844
- value: Se ?? m[0].id,
1845
- onChange: Ce,
1828
+ value: xe ?? m[0].id,
1829
+ onChange: Se,
1846
1830
  options: m.map((e) => ({
1847
1831
  value: e.id,
1848
1832
  label: `${e.planName} · ${ut[e.state] ?? e.state} · ${e.id.slice(0, 8)}`
1849
1833
  }))
1850
1834
  }),
1851
- we && we.id === I && /* @__PURE__ */ G(dt, {
1852
- run: we,
1835
+ Ce && Ce.id === Te && /* @__PURE__ */ G(dt, {
1836
+ run: Ce,
1853
1837
  base: e,
1854
- onExport: () => ke(we, `研发小蜜报告-${we.id}.json`)
1838
+ onExport: () => ke(Ce, `研发小蜜报告-${Ce.id}.json`)
1855
1839
  })
1856
1840
  ]
1857
1841
  })
@@ -1868,30 +1852,24 @@ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1868
1852
  }
1869
1853
  // src/pages/assistant/components/TestLibraryPanel/index.tsx
1870
1854
  function mt({ bridgeUrl: e, exploration: t, ...n }) {
1871
- let r = `${e.replace(/\/$/, "")}/library`, i = lt(r), [a, o] = x(), [s, c] = x(), [l, u] = x(), [d, f] = x("libraries"), [p, m] = x(!1), [h, g] = x(""), _ = async (e) => {
1855
+ let r = `${e.replace(/\/$/, "")}/library`, i = lt(r), [a, o] = x(), [s, c] = x(), [l, u] = x(), [d, f] = x(!1), [p, m] = x(""), h = async (e) => {
1872
1856
  let t = await i("/collections", "GET", void 0, e);
1873
1857
  e?.aborted || o(t.collections);
1874
- }, v = async (e, t) => {
1875
- g(""), m(!0);
1858
+ }, g = async (e, t) => {
1859
+ m(""), f(!0);
1876
1860
  try {
1877
1861
  await e();
1878
1862
  } catch (e) {
1879
- t?.aborted || g(e instanceof Error ? e.message : "读取测试库失败");
1863
+ t?.aborted || m(e instanceof Error ? e.message : "读取测试库失败");
1880
1864
  } finally {
1881
- t?.aborted || m(!1);
1865
+ t?.aborted || f(!1);
1882
1866
  }
1883
1867
  };
1884
1868
  y(() => {
1885
1869
  let e = new AbortController();
1886
- return v(() => _(e.signal), e.signal), () => e.abort();
1887
- }, [i]), y(() => {
1888
- n.incomingDraft && f("libraries");
1889
- }, [n.incomingDraft]);
1890
- let b = (e) => {
1891
- if (p) return;
1892
- let t = a?.find(({ id: e }) => e === l?.id);
1893
- (!l || l.name === (t?.name ?? "") || window.confirm("测试库名称尚未保存,确定放弃?")) && (u(void 0), f(e));
1894
- }, te = /* @__PURE__ */ K(se, {
1870
+ return g(() => h(e.signal), e.signal), () => e.abort();
1871
+ }, [i]);
1872
+ let _ = /* @__PURE__ */ K(se, {
1895
1873
  className: Q.card,
1896
1874
  "aria-label": "测试库列表",
1897
1875
  styles: { body: {
@@ -1905,14 +1883,14 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1905
1883
  className: Q.header,
1906
1884
  children: [/* @__PURE__ */ G("h3", { children: "测试库" }), a && !l && /* @__PURE__ */ G(C, {
1907
1885
  type: "primary",
1908
- disabled: p || n.disabled,
1886
+ disabled: d || n.disabled,
1909
1887
  onClick: () => u({ name: "" }),
1910
1888
  children: "新建测试库"
1911
1889
  })]
1912
1890
  }),
1913
- h && /* @__PURE__ */ G(S, {
1891
+ p && /* @__PURE__ */ G(S, {
1914
1892
  type: "error",
1915
- title: h
1893
+ title: p
1916
1894
  }),
1917
1895
  n.incomingDraft && /* @__PURE__ */ G(S, {
1918
1896
  type: "info",
@@ -1921,7 +1899,7 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1921
1899
  a ? l ? /* @__PURE__ */ K("form", {
1922
1900
  className: Q.stack,
1923
1901
  onSubmit: (e) => {
1924
- e.preventDefault(), l.name.trim() && !p && v(async () => {
1902
+ e.preventDefault(), l.name.trim() && !d && g(async () => {
1925
1903
  let e = await i(l.id ? "/collections/" + encodeURIComponent(l.id) : "/collections", l.id ? "PATCH" : "POST", { name: l.name.trim() });
1926
1904
  o((t) => l.id ? t?.map((t) => t.id === e.id ? e : t) : [...t ?? [], e]), u(void 0), c(e);
1927
1905
  });
@@ -1931,14 +1909,14 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1931
1909
  htmlFor: "assistant-library-name",
1932
1910
  children: "测试库名称"
1933
1911
  }),
1934
- /* @__PURE__ */ G(T, {
1912
+ /* @__PURE__ */ G(E, {
1935
1913
  id: "assistant-library-name",
1936
1914
  "aria-required": "true",
1937
1915
  "aria-invalid": !l.name.trim(),
1938
1916
  "aria-describedby": l.name.trim() ? void 0 : "assistant-library-name-error",
1939
1917
  maxLength: 100,
1940
1918
  value: l.name,
1941
- disabled: p,
1919
+ disabled: d,
1942
1920
  onChange: (e) => u({
1943
1921
  ...l,
1944
1922
  name: e.target.value
@@ -1954,24 +1932,24 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1954
1932
  children: [/* @__PURE__ */ G(C, {
1955
1933
  htmlType: "submit",
1956
1934
  type: "primary",
1957
- loading: p,
1935
+ loading: d,
1958
1936
  disabled: !l.name.trim(),
1959
1937
  children: l.id ? "保存" : "创建"
1960
1938
  }), /* @__PURE__ */ G(C, {
1961
- disabled: p,
1939
+ disabled: d,
1962
1940
  onClick: () => u(void 0),
1963
1941
  children: "取消"
1964
1942
  })]
1965
1943
  })
1966
1944
  ]
1967
- }) : /* @__PURE__ */ K(W, { children: [!a.length && /* @__PURE__ */ G(de, { description: "暂无测试库" }), /* @__PURE__ */ G("ul", {
1945
+ }) : /* @__PURE__ */ K(W, { children: [!a.length && /* @__PURE__ */ G(ue, { description: "暂无测试库" }), /* @__PURE__ */ G("ul", {
1968
1946
  className: Q.resourceList,
1969
1947
  children: a.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1970
1948
  type: "link",
1971
1949
  size: "small",
1972
1950
  className: Q.entryLink,
1973
1951
  title: e.name,
1974
- disabled: p || n.recording,
1952
+ disabled: d || n.recording,
1975
1953
  onClick: () => c(e),
1976
1954
  children: /* @__PURE__ */ G("span", {
1977
1955
  className: Q.resourceName,
@@ -1988,46 +1966,40 @@ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1988
1966
  ] })] }, e.id))
1989
1967
  })] }) : /* @__PURE__ */ G(C, {
1990
1968
  className: Q.fitButton,
1991
- loading: p,
1992
- onClick: () => void v(_),
1993
- children: p ? "正在读取测试库列表" : "重试读取测试库列表"
1969
+ loading: d,
1970
+ onClick: () => void g(h),
1971
+ children: d ? "正在读取测试库列表" : "重试读取测试库列表"
1994
1972
  })
1995
1973
  ]
1996
1974
  });
1997
- return /* @__PURE__ */ K(W, { children: [s && /* @__PURE__ */ G("div", {
1998
- hidden: !!l,
1999
- children: /* @__PURE__ */ ee(pt, {
2000
- ...n,
2001
- key: s.id,
2002
- base: `${r}/collections/${encodeURIComponent(s.id)}`,
2003
- name: s.name,
2004
- onBack: () => {
2005
- c(void 0), v(_);
2006
- },
2007
- onRename: () => {
2008
- u({
2009
- id: s.id,
2010
- name: s.name
2011
- });
2012
- }
2013
- })
2014
- }), /* @__PURE__ */ G("div", {
2015
- hidden: !!s && !l,
2016
- children: /* @__PURE__ */ G(pe, {
2017
- activeKey: d,
2018
- onChange: b,
2019
- items: [{
2020
- key: "libraries",
2021
- label: "测试库",
2022
- children: te
2023
- }, {
2024
- key: "explore",
2025
- label: "自主探索",
2026
- children: t,
2027
- disabled: !!s
2028
- }]
1975
+ return /* @__PURE__ */ K(W, { children: [
1976
+ s && /* @__PURE__ */ G("div", {
1977
+ hidden: !!l,
1978
+ children: /* @__PURE__ */ ee(pt, {
1979
+ ...n,
1980
+ key: s.id,
1981
+ base: `${r}/collections/${encodeURIComponent(s.id)}`,
1982
+ name: s.name,
1983
+ onBack: () => {
1984
+ c(void 0), g(h);
1985
+ },
1986
+ onRename: () => {
1987
+ u({
1988
+ id: s.id,
1989
+ name: s.name
1990
+ });
1991
+ }
1992
+ })
1993
+ }),
1994
+ /* @__PURE__ */ G("div", {
1995
+ hidden: !!s && !l,
1996
+ children: _
1997
+ }),
1998
+ /* @__PURE__ */ G("div", {
1999
+ hidden: !!s || !!l,
2000
+ children: t
2029
2001
  })
2030
- })] });
2002
+ ] });
2031
2003
  }
2032
2004
  // src/pages/assistant/components/AutomationPanel/index.tsx
2033
2005
  function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
@@ -2079,7 +2051,7 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2079
2051
  disabled: i.recording,
2080
2052
  onRunningChange: m
2081
2053
  }),
2082
- renderEditor: ({ save: t, busy: n, dirty: r, cancel: o }) => /* @__PURE__ */ K(W, { children: [
2054
+ renderCase: ({ testCase: t, readOnly: n = !1, save: r, busy: o, dirty: c, cancel: p }) => /* @__PURE__ */ K(W, { children: [
2083
2055
  /* @__PURE__ */ K("div", {
2084
2056
  className: J.field,
2085
2057
  "data-assistant-part": "field",
@@ -2088,22 +2060,23 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2088
2060
  htmlFor: "assistant-case-name",
2089
2061
  children: "用例名称"
2090
2062
  }),
2091
- /* @__PURE__ */ G(T, {
2063
+ /* @__PURE__ */ G(E, {
2092
2064
  id: "assistant-case-name",
2093
- "aria-required": "true",
2094
- "aria-invalid": !i.draft.name.trim(),
2095
- "aria-describedby": i.draft.name.trim() ? void 0 : "assistant-case-name-error",
2096
- prefix: /* @__PURE__ */ G(Te, {}),
2065
+ readOnly: n,
2066
+ "aria-required": !n,
2067
+ "aria-invalid": !t.name.trim(),
2068
+ "aria-describedby": t.name.trim() ? void 0 : "assistant-case-name-error",
2069
+ prefix: /* @__PURE__ */ G(we, {}),
2097
2070
  "aria-label": "测试用例名称",
2098
- value: i.draft.name,
2071
+ value: t.name,
2099
2072
  maxLength: 100,
2100
- disabled: i.recording || n,
2073
+ disabled: i.recording || o,
2101
2074
  onChange: (e) => s.edit({
2102
- ...i.draft,
2075
+ ...t,
2103
2076
  name: e.target.value
2104
2077
  })
2105
2078
  }),
2106
- !i.draft.name.trim() && /* @__PURE__ */ G("span", {
2079
+ !t.name.trim() && /* @__PURE__ */ G("span", {
2107
2080
  className: J.hint,
2108
2081
  id: "assistant-case-name-error",
2109
2082
  children: "请输入用例名称"
@@ -2116,13 +2089,14 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2116
2089
  children: [/* @__PURE__ */ G("label", {
2117
2090
  htmlFor: "assistant-case-path",
2118
2091
  children: "用例入口"
2119
- }), /* @__PURE__ */ G(T, {
2092
+ }), /* @__PURE__ */ G(E, {
2120
2093
  id: "assistant-case-path",
2121
- value: i.draft.path,
2094
+ readOnly: n,
2095
+ value: t.path,
2122
2096
  maxLength: 2e3,
2123
- disabled: i.recording || n,
2097
+ disabled: i.recording || o,
2124
2098
  onChange: (e) => s.edit({
2125
- ...i.draft,
2099
+ ...t,
2126
2100
  path: e.target.value
2127
2101
  })
2128
2102
  })]
@@ -2141,17 +2115,18 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2141
2115
  /* @__PURE__ */ K("div", {
2142
2116
  className: J.cardHeading,
2143
2117
  "data-assistant-part": "card-heading",
2144
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Le, {}), "录制操作"] }), /* @__PURE__ */ K(D, {
2118
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Le, {}), "录制操作"] }), /* @__PURE__ */ K(O, {
2145
2119
  color: i.recording ? "red" : "default",
2146
2120
  children: [
2147
- i.recording ? "录制中" : "待录制",
2148
- " · ",
2149
- i.draft.steps.length,
2121
+ n ? "已保存" : i.recording ? "录制中" : "待录制",
2122
+ " ·",
2123
+ " ",
2124
+ t.steps.length,
2150
2125
  "/100 步"
2151
2126
  ]
2152
2127
  })]
2153
2128
  }),
2154
- /* @__PURE__ */ G("div", {
2129
+ !n && /* @__PURE__ */ G("div", {
2155
2130
  className: J.buttonRow,
2156
2131
  "data-assistant-part": "button-row",
2157
2132
  children: i.recording ? /* @__PURE__ */ G(C, {
@@ -2164,11 +2139,11 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2164
2139
  }) : /* @__PURE__ */ G(C, {
2165
2140
  icon: /* @__PURE__ */ G(Le, {}),
2166
2141
  type: "primary",
2167
- disabled: n || i.recording,
2142
+ disabled: o || i.recording,
2168
2143
  onClick: () => void h(() => {
2169
- (!i.draft.steps.length || window.confirm("新录制会替换当前用例的步骤。继续?")) && (u(null), s.start(), s.edit({
2144
+ (!t.steps.length || window.confirm("新录制会替换当前用例的步骤。继续?")) && (u(null), s.start(), s.edit({
2170
2145
  ...s.getState().draft,
2171
- name: i.draft.name
2146
+ name: t.name
2172
2147
  }), e());
2173
2148
  }),
2174
2149
  children: "开始录制"
@@ -2179,7 +2154,7 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2179
2154
  "data-assistant-part": "hint",
2180
2155
  children: "展开、切换页签等准备操作也需录下来。"
2181
2156
  }),
2182
- /* @__PURE__ */ G(w, {
2157
+ /* @__PURE__ */ G(T, {
2183
2158
  className: J.help,
2184
2159
  "data-assistant-part": "help",
2185
2160
  ghost: !0,
@@ -2211,7 +2186,7 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2211
2186
  /* @__PURE__ */ K(se, {
2212
2187
  className: J.card,
2213
2188
  "data-assistant-part": "card editor-card",
2214
- "aria-label": "编辑用例",
2189
+ "aria-label": "用例步骤",
2215
2190
  styles: { body: {
2216
2191
  padding: 0,
2217
2192
  display: "flex",
@@ -2222,17 +2197,17 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2222
2197
  /* @__PURE__ */ K("div", {
2223
2198
  className: J.cardHeading,
2224
2199
  "data-assistant-part": "card-heading",
2225
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(P, {}), "编辑用例"] }), /* @__PURE__ */ K("span", { children: [i.draft.steps.length, " 个步骤"] })]
2200
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(F, {}), "用例步骤"] }), /* @__PURE__ */ K("span", { children: [t.steps.length, " 个步骤"] })]
2226
2201
  }),
2227
- !i.draft.steps.length && /* @__PURE__ */ K("div", {
2202
+ !t.steps.length && /* @__PURE__ */ K("div", {
2228
2203
  className: J.emptySteps,
2229
2204
  "data-assistant-part": "empty-steps",
2230
- children: [/* @__PURE__ */ G(Te, {}), /* @__PURE__ */ G("span", { children: "暂无操作步骤" })]
2205
+ children: [/* @__PURE__ */ G(we, {}), /* @__PURE__ */ G("span", { children: "暂无操作步骤" })]
2231
2206
  }),
2232
2207
  /* @__PURE__ */ G("ol", {
2233
2208
  className: J.caseSteps,
2234
2209
  "data-assistant-part": "case-steps",
2235
- children: i.draft.steps.map((e, t) => /* @__PURE__ */ K("li", { children: [
2210
+ children: t.steps.map((e, r) => /* @__PURE__ */ K("li", { children: [
2236
2211
  /* @__PURE__ */ K("div", {
2237
2212
  className: J.stepHeading,
2238
2213
  "data-assistant-part": "step-heading",
@@ -2240,15 +2215,15 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2240
2215
  /* @__PURE__ */ G("span", {
2241
2216
  className: J.stepNumber,
2242
2217
  "data-assistant-part": "step-number",
2243
- children: String(t + 1).padStart(2, "0")
2218
+ children: String(r + 1).padStart(2, "0")
2244
2219
  }),
2245
- /* @__PURE__ */ G(D, {
2220
+ /* @__PURE__ */ G(O, {
2246
2221
  color: e.kind === "unsupported" ? "red" : "blue",
2247
2222
  children: Ze[e.kind]
2248
2223
  }),
2249
2224
  /* @__PURE__ */ G("strong", { children: e.assertion?.name ?? e.target?.label ?? e.value }),
2250
- e.sourceEventId && /* @__PURE__ */ K(D, { children: ["源事件 #", e.sourceEventId] }),
2251
- e.supplemented && /* @__PURE__ */ G(D, {
2225
+ e.sourceEventId && /* @__PURE__ */ K(O, { children: ["源事件 #", e.sourceEventId] }),
2226
+ e.supplemented && /* @__PURE__ */ G(O, {
2252
2227
  color: "orange",
2253
2228
  children: "人工补充"
2254
2229
  })
@@ -2258,7 +2233,7 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2258
2233
  className: J.assertionSummary,
2259
2234
  "data-assistant-part": "assertion-summary",
2260
2235
  children: [
2261
- /* @__PURE__ */ G(D, {
2236
+ /* @__PURE__ */ G(O, {
2262
2237
  color: "green",
2263
2238
  children: Y.assertionSources[e.assertion.source]
2264
2239
  }),
@@ -2285,23 +2260,24 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2285
2260
  ] })
2286
2261
  ]
2287
2262
  }),
2288
- e.kind === "unsupported" && /* @__PURE__ */ G(nt, {
2263
+ e.kind === "unsupported" && !n && /* @__PURE__ */ G(nt, {
2289
2264
  step: e,
2290
- disabled: i.recording || n,
2265
+ disabled: i.recording || o,
2291
2266
  onApply: (e) => s.edit({
2292
- ...i.draft,
2293
- steps: i.draft.steps.map((n, r) => r === t ? e : n)
2267
+ ...t,
2268
+ steps: t.steps.map((t, n) => n === r ? e : t)
2294
2269
  })
2295
2270
  }, JSON.stringify(e)),
2296
- e.value !== void 0 && e.kind !== "unsupported" && /* @__PURE__ */ G(T, {
2297
- "aria-label": `第 ${t + 1} 步内容`,
2271
+ e.value !== void 0 && (n || e.kind !== "unsupported") && /* @__PURE__ */ G(E, {
2272
+ "aria-label": `第 ${r + 1} 步内容`,
2273
+ readOnly: n,
2298
2274
  value: e.value,
2299
2275
  maxLength: 2e3,
2300
- disabled: i.recording || n,
2301
- onChange: (e) => g(t, { value: e.target.value })
2276
+ disabled: i.recording || o,
2277
+ onChange: (e) => g(r, { value: e.target.value })
2302
2278
  }),
2303
2279
  e.kind === "check" && /* @__PURE__ */ G("span", { children: e.checked ? "选中" : "取消选中" }),
2304
- e.target && /* @__PURE__ */ G(w, {
2280
+ e.target && /* @__PURE__ */ G(T, {
2305
2281
  ghost: !0,
2306
2282
  size: "small",
2307
2283
  styles: {
@@ -2318,65 +2294,65 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2318
2294
  children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G("code", { children: e.target.selector }) })
2319
2295
  }]
2320
2296
  }),
2321
- /* @__PURE__ */ K("div", {
2297
+ !n && /* @__PURE__ */ K("div", {
2322
2298
  className: [J.buttonRow, J.stepActions].join(" "),
2323
2299
  "data-assistant-part": "button-row step-actions",
2324
2300
  children: [
2325
2301
  /* @__PURE__ */ G(C, {
2326
2302
  size: "small",
2327
2303
  type: "text",
2328
- icon: /* @__PURE__ */ G(j, {}),
2329
- disabled: i.recording || n || !e.assertion && i.draft.steps.length >= 100,
2330
- onClick: () => f(t + 1, e.assertion ? t : void 0),
2304
+ icon: /* @__PURE__ */ G(M, {}),
2305
+ disabled: i.recording || o || !e.assertion && t.steps.length >= 100,
2306
+ onClick: () => f(r + 1, e.assertion ? r : void 0),
2331
2307
  children: e.assertion ? "编辑断言" : "在此步后添加断言"
2332
2308
  }),
2333
2309
  /* @__PURE__ */ K(C, {
2334
2310
  type: "text",
2335
2311
  icon: /* @__PURE__ */ G(V, {}),
2336
2312
  size: "small",
2337
- disabled: i.recording || n || i.draft.steps.length >= 100,
2313
+ disabled: i.recording || o || t.steps.length >= 100,
2338
2314
  onClick: () => {
2339
2315
  u(null), s.edit({
2340
- ...i.draft,
2316
+ ...t,
2341
2317
  steps: [
2342
- ...i.draft.steps.slice(0, t),
2318
+ ...t.steps.slice(0, r),
2343
2319
  {
2344
2320
  kind: "unsupported",
2345
2321
  value: "人工前置步骤待补充"
2346
2322
  },
2347
- ...i.draft.steps.slice(t)
2323
+ ...t.steps.slice(r)
2348
2324
  ]
2349
2325
  });
2350
2326
  },
2351
2327
  children: [
2352
2328
  "在第 ",
2353
- t + 1,
2329
+ r + 1,
2354
2330
  " 步前插入"
2355
2331
  ]
2356
2332
  }),
2357
2333
  /* @__PURE__ */ K(C, {
2358
2334
  type: "text",
2359
- icon: /* @__PURE__ */ G(ye, {}),
2335
+ icon: /* @__PURE__ */ G(ve, {}),
2360
2336
  danger: !0,
2361
2337
  size: "small",
2362
- disabled: i.recording || n,
2338
+ disabled: i.recording || o,
2363
2339
  onClick: () => {
2364
2340
  u(null), s.edit({
2365
- ...i.draft,
2366
- steps: i.draft.steps.filter((e, n) => n !== t)
2341
+ ...t,
2342
+ steps: t.steps.filter((e, t) => t !== r)
2367
2343
  });
2368
2344
  },
2369
2345
  children: [
2370
2346
  "移除第 ",
2371
- t + 1,
2347
+ r + 1,
2372
2348
  " 步"
2373
2349
  ]
2374
2350
  })
2375
2351
  ]
2376
2352
  })
2377
- ] }, t))
2353
+ ] }, r))
2378
2354
  }),
2379
- i.draft.timeline && /* @__PURE__ */ G(w, {
2355
+ t.timeline && /* @__PURE__ */ G(T, {
2380
2356
  ghost: !0,
2381
2357
  size: "small",
2382
2358
  styles: {
@@ -2391,13 +2367,13 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2391
2367
  key: "details",
2392
2368
  label: /* @__PURE__ */ K(W, { children: [
2393
2369
  "选段原始证据(",
2394
- i.draft.timeline.events.length,
2370
+ t.timeline.events.length,
2395
2371
  " 条,只读)"
2396
2372
  ] }),
2397
2373
  children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", { children: "接口、异常和性能事件不执行;人工补充与移除步骤不会改写这里的来源记录。" }), /* @__PURE__ */ G("pre", {
2398
2374
  className: J.json,
2399
2375
  "data-assistant-part": "json",
2400
- children: JSON.stringify(i.draft.timeline, null, 2)
2376
+ children: JSON.stringify(t.timeline, null, 2)
2401
2377
  })] })
2402
2378
  }]
2403
2379
  }),
@@ -2408,60 +2384,63 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2408
2384
  children: [/* @__PURE__ */ K("div", {
2409
2385
  className: J.cardHeading,
2410
2386
  "data-assistant-part": "card-heading",
2411
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(j, {}), " 结果断言"] }), /* @__PURE__ */ K(D, { children: [
2412
- i.draft.steps.filter((e) => e.kind === "assert" || e.kind === "assert-text").length,
2387
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(M, {}), " 结果断言"] }), /* @__PURE__ */ K(O, { children: [
2388
+ t.steps.filter((e) => e.kind === "assert" || e.kind === "assert-text").length,
2413
2389
  " ",
2414
2390
  "条"
2415
2391
  ] })]
2416
- }), l ? /* @__PURE__ */ G(et, {
2417
- initial: l.edit === void 0 ? void 0 : i.draft.steps[l.edit]?.assertion,
2418
- steps: i.draft.steps,
2392
+ }), !n && (l ? /* @__PURE__ */ G(et, {
2393
+ initial: l.edit === void 0 ? void 0 : t.steps[l.edit]?.assertion,
2394
+ steps: t.steps,
2419
2395
  position: l.position,
2420
- disabled: n || i.recording,
2396
+ disabled: o || i.recording,
2421
2397
  onCancel: () => u(null),
2422
- onSave: (e, t) => {
2423
- let n = [...i.draft.steps];
2424
- l.edit === void 0 ? n.splice(t, 0, {
2398
+ onSave: (e, n) => {
2399
+ let r = [...t.steps];
2400
+ l.edit === void 0 ? r.splice(n, 0, {
2425
2401
  kind: "assert",
2426
2402
  assertion: e,
2427
2403
  supplemented: !0
2428
- }) : n[l.edit] = {
2429
- ...n[l.edit],
2404
+ }) : r[l.edit] = {
2405
+ ...r[l.edit],
2430
2406
  kind: "assert",
2431
2407
  assertion: e,
2432
2408
  supplemented: !0
2433
2409
  }, s.edit((0, Y.parseCase)({
2434
- ...i.draft,
2435
- steps: n
2410
+ ...t,
2411
+ steps: r
2436
2412
  })), u(null);
2437
2413
  }
2438
2414
  }, `${l.position}-${l.edit ?? "new"}`) : /* @__PURE__ */ G(C, {
2439
2415
  type: "text",
2440
2416
  icon: /* @__PURE__ */ G(V, {}),
2441
- disabled: n || i.recording || i.draft.steps.length >= 100,
2442
- onClick: () => f(i.draft.steps.length),
2417
+ disabled: o || i.recording || t.steps.length >= 100,
2418
+ onClick: () => f(t.steps.length),
2443
2419
  children: "添加断言"
2444
- })]
2420
+ }))]
2445
2421
  }),
2446
- /* @__PURE__ */ K("div", {
2422
+ !n && /* @__PURE__ */ K("div", {
2447
2423
  className: [J.buttonRow, J.cardActions].join(" "),
2448
2424
  "data-assistant-part": "button-row card-actions",
2449
2425
  children: [
2450
2426
  /* @__PURE__ */ G(C, {
2451
2427
  icon: /* @__PURE__ */ G(H, {}),
2452
2428
  type: "primary",
2453
- disabled: i.recording || n || !i.draft.name.trim() || !i.draft.steps.length,
2454
- onClick: () => void h(() => t((0, Y.parseCase)(i.draft))),
2429
+ disabled: i.recording || o || !t.name.trim() || !t.steps.length,
2430
+ onClick: () => void h(() => {
2431
+ let e = (0, Y.parseCase)(t);
2432
+ return r?.(e);
2433
+ }),
2455
2434
  children: "保存用例"
2456
2435
  }),
2457
2436
  /* @__PURE__ */ G(C, {
2458
- disabled: n || i.recording,
2459
- onClick: o,
2437
+ disabled: o || i.recording,
2438
+ onClick: p,
2460
2439
  children: "取消"
2461
2440
  }),
2462
2441
  /* @__PURE__ */ G($e, {
2463
2442
  label: "用例文件操作",
2464
- disabled: n || i.recording,
2443
+ disabled: o || i.recording,
2465
2444
  items: [{
2466
2445
  key: "import",
2467
2446
  label: "导入用例",
@@ -2469,10 +2448,10 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2469
2448
  }, {
2470
2449
  key: "export",
2471
2450
  label: "导出用例 JSON",
2472
- disabled: !i.draft.steps.length,
2451
+ disabled: !t.steps.length,
2473
2452
  onClick: () => void h(() => {
2474
- let e = (0, Y.parseCase)(i.draft), t = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), n = document.createElement("a");
2475
- n.href = t, n.download = "页面录制用例.json", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 3e4);
2453
+ let e = (0, Y.parseCase)(t), n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
2454
+ r.href = n, r.download = "页面录制用例.json", document.body.append(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 3e4);
2476
2455
  })
2477
2456
  }]
2478
2457
  }),
@@ -2483,9 +2462,9 @@ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2483
2462
  accept: ".json,application/json",
2484
2463
  onChange: (e) => {
2485
2464
  let t = e.target.files?.[0];
2486
- e.target.value = "", !t || i.recording || n || h(async () => {
2465
+ e.target.value = "", !t || i.recording || o || h(async () => {
2487
2466
  if (t.size > 524288) throw Error("用例不能超过 512 KB");
2488
- (!r || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, Y.parseCase)(JSON.parse(await t.text()))), u(null));
2467
+ (!c || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, Y.parseCase)(JSON.parse(await t.text()))), u(null));
2489
2468
  });
2490
2469
  }
2491
2470
  })
@@ -2599,13 +2578,13 @@ function xt({ events: e, onDraft: t }) {
2599
2578
  },
2600
2579
  children: "开始选段"
2601
2580
  }), r && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
2602
- icon: /* @__PURE__ */ G(ve, {}),
2581
+ icon: /* @__PURE__ */ G(_e, {}),
2603
2582
  onClick: () => {
2604
2583
  i(null), o(void 0), l(void 0), h("");
2605
2584
  },
2606
2585
  children: "退出选段"
2607
2586
  }), /* @__PURE__ */ G(C, {
2608
- icon: /* @__PURE__ */ G(we, {}),
2587
+ icon: /* @__PURE__ */ G(Ce, {}),
2609
2588
  type: "primary",
2610
2589
  disabled: !g.length || n.recording,
2611
2590
  onClick: () => {
@@ -2638,7 +2617,7 @@ function xt({ events: e, onDraft: t }) {
2638
2617
  !r && /* @__PURE__ */ K("div", {
2639
2618
  className: gt.filters,
2640
2619
  "data-assistant-part": "filters",
2641
- children: [/* @__PURE__ */ G(E, {
2620
+ children: [/* @__PURE__ */ G(D, {
2642
2621
  "aria-label": "事件类型",
2643
2622
  value: u,
2644
2623
  onChange: d,
@@ -2649,7 +2628,7 @@ function xt({ events: e, onDraft: t }) {
2649
2628
  value: e,
2650
2629
  label: t
2651
2630
  }))]
2652
- }), /* @__PURE__ */ G(T, {
2631
+ }), /* @__PURE__ */ G(E, {
2653
2632
  prefix: /* @__PURE__ */ G(Pe, {}),
2654
2633
  "aria-label": "搜索时间线",
2655
2634
  placeholder: "搜索操作或页面",
@@ -2658,7 +2637,7 @@ function xt({ events: e, onDraft: t }) {
2658
2637
  allowClear: !0
2659
2638
  })]
2660
2639
  }),
2661
- !ee.length && /* @__PURE__ */ G(de, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2640
+ !ee.length && /* @__PURE__ */ G(ue, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2662
2641
  /* @__PURE__ */ G("ol", {
2663
2642
  className: gt.timeline,
2664
2643
  "data-assistant-part": "timeline",
@@ -2669,13 +2648,13 @@ function xt({ events: e, onDraft: t }) {
2669
2648
  className: gt.eventMeta,
2670
2649
  "data-assistant-part": "event-meta",
2671
2650
  children: [
2672
- /* @__PURE__ */ G(D, {
2651
+ /* @__PURE__ */ G(O, {
2673
2652
  color: e.kind === "error" ? "red" : "blue",
2674
2653
  children: bt[e.kind]
2675
2654
  }),
2676
2655
  /* @__PURE__ */ G("time", { children: new Date(e.time).toLocaleTimeString("zh-CN", { hour12: !1 }) }),
2677
2656
  /* @__PURE__ */ K("small", { children: ["#", e.id] }),
2678
- _.has(e.id) && /* @__PURE__ */ G(D, {
2657
+ _.has(e.id) && /* @__PURE__ */ G(O, {
2679
2658
  color: "gold",
2680
2659
  children: "已选"
2681
2660
  })
@@ -2686,7 +2665,7 @@ function xt({ events: e, onDraft: t }) {
2686
2665
  className: gt.buttonRow,
2687
2666
  "data-assistant-part": "button-row",
2688
2667
  children: [/* @__PURE__ */ G(C, {
2689
- icon: /* @__PURE__ */ G(I, {}),
2668
+ icon: /* @__PURE__ */ G(Te, {}),
2690
2669
  size: "small",
2691
2670
  "aria-label": `从事件 ${e.id} 开始`,
2692
2671
  "aria-pressed": a === e.id,
@@ -2695,7 +2674,7 @@ function xt({ events: e, onDraft: t }) {
2695
2674
  },
2696
2675
  children: "设为起点"
2697
2676
  }), /* @__PURE__ */ G(C, {
2698
- icon: /* @__PURE__ */ G(j, {}),
2677
+ icon: /* @__PURE__ */ G(M, {}),
2699
2678
  size: "small",
2700
2679
  "aria-label": `到事件 ${e.id} 结束`,
2701
2680
  "aria-pressed": c === e.id,
@@ -2704,7 +2683,7 @@ function xt({ events: e, onDraft: t }) {
2704
2683
  children: "设为终点"
2705
2684
  })]
2706
2685
  }),
2707
- /* @__PURE__ */ G(w, {
2686
+ /* @__PURE__ */ G(T, {
2708
2687
  ghost: !0,
2709
2688
  size: "small",
2710
2689
  styles: {
@@ -3031,11 +3010,11 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3031
3010
  /* @__PURE__ */ G("span", {
3032
3011
  className: $.headingIcon,
3033
3012
  "data-assistant-part": "heading-icon",
3034
- children: /* @__PURE__ */ G(N, {})
3013
+ children: /* @__PURE__ */ G(P, {})
3035
3014
  }),
3036
3015
  /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "性能诊断" }) }),
3037
- /* @__PURE__ */ G(D, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
3038
- !a.length && /* @__PURE__ */ G(D, { children: "未触发告警" })
3016
+ /* @__PURE__ */ G(O, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
3017
+ !a.length && /* @__PURE__ */ G(O, { children: "未触发告警" })
3039
3018
  ]
3040
3019
  }),
3041
3020
  /* @__PURE__ */ G("div", {
@@ -3054,13 +3033,13 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3054
3033
  /* @__PURE__ */ G("div", {
3055
3034
  className: $.cardHeading,
3056
3035
  "data-assistant-part": "card-heading",
3057
- children: /* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(D, {
3036
+ children: /* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(O, {
3058
3037
  color: e.severity === "error" ? "red" : "orange",
3059
3038
  children: e.severity === "error" ? "较高风险" : "需关注"
3060
3039
  }), e.title] })
3061
3040
  }),
3062
3041
  /* @__PURE__ */ G("p", { children: e.evidence }),
3063
- /* @__PURE__ */ G(w, {
3042
+ /* @__PURE__ */ G(T, {
3064
3043
  ghost: !0,
3065
3044
  size: "small",
3066
3045
  styles: {
@@ -3073,7 +3052,7 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3073
3052
  },
3074
3053
  items: [{
3075
3054
  key: "details",
3076
- label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(A, {}), " 排查建议与触发依据"] }),
3055
+ label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(j, {}), " 排查建议与触发依据"] }),
3077
3056
  children: /* @__PURE__ */ K(W, { children: [
3078
3057
  /* @__PURE__ */ G("ol", { children: e.suggestions.map((e) => /* @__PURE__ */ G("li", { children: e }, e)) }),
3079
3058
  /* @__PURE__ */ G("p", {
@@ -3144,7 +3123,7 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3144
3123
  /* @__PURE__ */ K("h3", {
3145
3124
  className: $.subheading,
3146
3125
  "data-assistant-part": "subheading",
3147
- children: [/* @__PURE__ */ G(N, {}), " 页面指标"]
3126
+ children: [/* @__PURE__ */ G(P, {}), " 页面指标"]
3148
3127
  }),
3149
3128
  /* @__PURE__ */ G("div", {
3150
3129
  className: $.metrics,
@@ -3187,23 +3166,23 @@ var jt = (e) => new Date(e).toLocaleTimeString("zh-CN", { hour12: !1 });
3187
3166
  function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly: i = !1 } = {}) {
3188
3167
  let a = ie(m.subscribe, m.getState), o = ie(s.subscribe, s.getState), [u, p] = x(!1), [h, _] = x(i ? "diagnostics" : "feedback"), [ee, b] = x("timeline"), [te, ne] = x(), ae = re(null), se = () => {
3189
3168
  p(!1), requestAnimationFrame(() => ae.current?.focus({ preventScroll: !0 }));
3190
- }, [ce, le] = x(""), [ue, fe] = x(""), [E, O] = x(null), [A, j] = x("live"), [_e, M] = x(c), [F, we] = x(!1), [Te, I] = x(!1), L = v(() => {
3191
- I(!1), p(!0), M(c());
3169
+ }, [w, ce] = x(""), [le, de] = x(""), [D, k] = x(null), [j, M] = x("live"), [ge, N] = x(c), [I, Ce] = x(!1), [we, Te] = x(!1), L = v(() => {
3170
+ Te(!1), p(!0), N(c());
3192
3171
  }, []);
3193
3172
  Xe(ae, L, v((e) => {
3194
- we(e), e && I(!1);
3173
+ Ce(e), e && Te(!1);
3195
3174
  }, []));
3196
3175
  let R = v(() => {
3197
- m.clear(), i && s.clear(), j("live"), O(null), fe("内存记录已清空");
3176
+ m.clear(), i && s.clear(), M("live"), k(null), de("内存记录已清空");
3198
3177
  }, [i]);
3199
3178
  y(() => {
3200
3179
  if (i) return window.addEventListener("gz-research-assistant:clear-data", R), () => window.removeEventListener("gz-research-assistant:clear-data", R);
3201
3180
  }, [i, R]), y(() => {
3202
3181
  if (!u) return;
3203
- let e = setInterval(() => M(c()), 2e3);
3182
+ let e = setInterval(() => N(c()), 2e3);
3204
3183
  return () => clearInterval(e);
3205
3184
  }, [u]);
3206
- let z = A === "imported" ? E : A === "frozen" ? a.frozen : null, ke = z?.events ?? a.events, B = z?.requests ?? a.requests, V = z?.metrics ?? a.metrics, H = z?.environment ?? _e, U = z ?? a.frozen, Pe = /* @__PURE__ */ K("div", {
3185
+ let z = j === "imported" ? D : j === "frozen" ? a.frozen : null, ke = z?.events ?? a.events, B = z?.requests ?? a.requests, V = z?.metrics ?? a.metrics, H = z?.environment ?? ge, U = z ?? a.frozen, Pe = /* @__PURE__ */ K("div", {
3207
3186
  className: q.section,
3208
3187
  "data-assistant-part": "section",
3209
3188
  children: [
@@ -3219,7 +3198,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3219
3198
  /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [B.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3220
3199
  className: q.statLabel,
3221
3200
  "data-assistant-part": "stat-label",
3222
- children: [/* @__PURE__ */ G(k, {}), "接口记录"]
3201
+ children: [/* @__PURE__ */ G(A, {}), "接口记录"]
3223
3202
  })] }),
3224
3203
  /* @__PURE__ */ K("div", {
3225
3204
  className: B.some((e) => e.failed) ? q.hasErrors : "",
@@ -3236,16 +3215,16 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3236
3215
  "data-assistant-part": "button-row actions",
3237
3216
  children: [/* @__PURE__ */ G(C, {
3238
3217
  type: "primary",
3239
- icon: /* @__PURE__ */ G(ge, {}),
3218
+ icon: /* @__PURE__ */ G(he, {}),
3240
3219
  onClick: () => {
3241
- g("用户手动截取现场"), j("frozen"), fe("已冻结现场。后续操作不会改变这份快照。");
3220
+ g("用户手动截取现场"), M("frozen"), de("已冻结现场。后续操作不会改变这份快照。");
3242
3221
  },
3243
3222
  children: "截取当前现场"
3244
3223
  }), /* @__PURE__ */ G(C, {
3245
- icon: /* @__PURE__ */ G(xe, {}),
3224
+ icon: /* @__PURE__ */ G(be, {}),
3246
3225
  onClick: () => {
3247
3226
  let e = U ?? n();
3248
- t(e, ce), fe(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3227
+ t(e, w), de(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3249
3228
  },
3250
3229
  children: "导出快照 JSON"
3251
3230
  })]
@@ -3260,18 +3239,18 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3260
3239
  "data-assistant-part": "field",
3261
3240
  children: [/* @__PURE__ */ K("label", {
3262
3241
  htmlFor: "research-feedback",
3263
- children: [/* @__PURE__ */ G(P, {}), "问题描述"]
3264
- }), /* @__PURE__ */ G(T.TextArea, {
3242
+ children: [/* @__PURE__ */ G(F, {}), "问题描述"]
3243
+ }), /* @__PURE__ */ G(E.TextArea, {
3265
3244
  id: "research-feedback",
3266
- value: ce,
3267
- onChange: (e) => le(e.target.value),
3245
+ value: w,
3246
+ onChange: (e) => ce(e.target.value),
3268
3247
  maxLength: 1e3,
3269
3248
  showCount: !0,
3270
3249
  rows: 3,
3271
3250
  placeholder: "例如:保存表单时报错"
3272
3251
  })]
3273
3252
  }),
3274
- /* @__PURE__ */ G(w, {
3253
+ /* @__PURE__ */ G(T, {
3275
3254
  ghost: !0,
3276
3255
  size: "small",
3277
3256
  styles: {
@@ -3294,7 +3273,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3294
3273
  onDraft: i ? void 0 : (e) => {
3295
3274
  ne(e), _("automation");
3296
3275
  }
3297
- }, 0 + A + (z?.capturedAt ?? "live")), Le = /* @__PURE__ */ K("div", {
3276
+ }, 0 + j + (z?.capturedAt ?? "live")), Le = /* @__PURE__ */ K("div", {
3298
3277
  className: q.section,
3299
3278
  "data-assistant-part": "section",
3300
3279
  children: [
@@ -3305,18 +3284,18 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3305
3284
  /* @__PURE__ */ G("span", {
3306
3285
  className: q.headingIcon,
3307
3286
  "data-assistant-part": "heading-icon",
3308
- children: /* @__PURE__ */ G(k, {})
3287
+ children: /* @__PURE__ */ G(A, {})
3309
3288
  }),
3310
3289
  /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "接口记录" }) }),
3311
- /* @__PURE__ */ K(D, { children: [B.length, " 条"] })
3290
+ /* @__PURE__ */ K(O, { children: [B.length, " 条"] })
3312
3291
  ]
3313
3292
  }),
3314
3293
  /* @__PURE__ */ K("details", {
3315
3294
  className: q.hint,
3316
3295
  children: [/* @__PURE__ */ G("summary", { children: "采集范围" }), "Fetch / XHR 正文最多读取 16 KB,认证接口不采集正文。 耗时截至 Fetch 响应头到达或 XHR 请求结束。"]
3317
3296
  }),
3318
- !B.length && /* @__PURE__ */ G(de, { description: "暂无接口记录" }),
3319
- B.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ G(w, {
3297
+ !B.length && /* @__PURE__ */ G(ue, { description: "暂无接口记录" }),
3298
+ B.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ G(T, {
3320
3299
  className: q.request,
3321
3300
  "data-assistant-part": "request",
3322
3301
  ghost: !0,
@@ -3335,14 +3314,14 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3335
3314
  className: q.requestMeta,
3336
3315
  "data-assistant-part": "request-meta",
3337
3316
  children: [
3338
- /* @__PURE__ */ G(D, {
3317
+ /* @__PURE__ */ G(O, {
3339
3318
  color: e.failed ? "red" : "green",
3340
3319
  children: e.status || "失败"
3341
3320
  }),
3342
3321
  /* @__PURE__ */ G("b", { children: e.method }),
3343
3322
  " ",
3344
3323
  /* @__PURE__ */ K("span", { children: [
3345
- /* @__PURE__ */ G(Ce, {}),
3324
+ /* @__PURE__ */ G(Se, {}),
3346
3325
  Math.round(e.duration),
3347
3326
  " ms"
3348
3327
  ] })
@@ -3372,7 +3351,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3372
3351
  children: [/* @__PURE__ */ G("span", {
3373
3352
  className: q.headingIcon,
3374
3353
  "data-assistant-part": "heading-icon",
3375
- children: /* @__PURE__ */ G(be, {})
3354
+ children: /* @__PURE__ */ G(ye, {})
3376
3355
  }), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "环境与数据" }) })]
3377
3356
  }),
3378
3357
  /* @__PURE__ */ K("dl", { children: [
@@ -3398,7 +3377,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3398
3377
  }), Ge = /* @__PURE__ */ G("div", {
3399
3378
  className: q.section,
3400
3379
  "data-assistant-part": "section",
3401
- children: /* @__PURE__ */ G(de, { description: "知识问答尚未接入" })
3380
+ children: /* @__PURE__ */ G(ue, { description: "知识问答尚未接入" })
3402
3381
  });
3403
3382
  return /* @__PURE__ */ K("div", {
3404
3383
  "data-research-assistant": !0,
@@ -3407,10 +3386,10 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3407
3386
  "data-assistant-part": "dock",
3408
3387
  "data-recording": o.recording,
3409
3388
  hidden: u,
3410
- children: [/* @__PURE__ */ G(me, {
3411
- open: Te && !F && !u,
3412
- trigger: F ? [] : "hover",
3413
- onOpenChange: (e) => I(e && !F && !u),
3389
+ children: [/* @__PURE__ */ G(pe, {
3390
+ open: we && !I && !u,
3391
+ trigger: I ? [] : "hover",
3392
+ onOpenChange: (e) => Te(e && !I && !u),
3414
3393
  title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` : He ? `研发小蜜 · ${He} 项性能告警` : a.frozen ? "研发小蜜 · 已保留异常现场" : "研发小蜜",
3415
3394
  children: /* @__PURE__ */ G(oe, {
3416
3395
  dot: o.recording || !!a.frozen || He > 0,
@@ -3459,17 +3438,17 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3459
3438
  type: "text",
3460
3439
  danger: !0,
3461
3440
  size: "small",
3462
- icon: /* @__PURE__ */ G(ye, {}),
3441
+ icon: /* @__PURE__ */ G(ve, {}),
3463
3442
  onClick: R,
3464
3443
  children: "清空记录"
3465
3444
  })]
3466
3445
  })]
3467
3446
  }),
3468
- ue && /* @__PURE__ */ G(S, {
3447
+ le && /* @__PURE__ */ G(S, {
3469
3448
  closable: !0,
3470
- title: ue,
3449
+ title: le,
3471
3450
  type: "info",
3472
- onClose: () => fe("")
3451
+ onClose: () => de("")
3473
3452
  }),
3474
3453
  z?.feedback && /* @__PURE__ */ G(S, {
3475
3454
  title: "快照中的问题描述",
@@ -3483,31 +3462,31 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3483
3462
  /* @__PURE__ */ G(C, {
3484
3463
  size: "small",
3485
3464
  icon: /* @__PURE__ */ G(De, {}),
3486
- "aria-pressed": A === "live",
3487
- type: A === "live" ? "primary" : "text",
3488
- onClick: () => j("live"),
3465
+ "aria-pressed": j === "live",
3466
+ type: j === "live" ? "primary" : "text",
3467
+ onClick: () => M("live"),
3489
3468
  children: "实时记录"
3490
3469
  }),
3491
3470
  (!i || a.frozen) && /* @__PURE__ */ G(C, {
3492
3471
  size: "small",
3493
- icon: /* @__PURE__ */ G(ge, {}),
3472
+ icon: /* @__PURE__ */ G(he, {}),
3494
3473
  disabled: !a.frozen,
3495
- "aria-pressed": A === "frozen",
3496
- type: A === "frozen" ? "primary" : "text",
3497
- onClick: () => j("frozen"),
3474
+ "aria-pressed": j === "frozen",
3475
+ type: j === "frozen" ? "primary" : "text",
3476
+ onClick: () => M("frozen"),
3498
3477
  children: "已冻结现场"
3499
3478
  }),
3500
- /* @__PURE__ */ G(he, {
3479
+ /* @__PURE__ */ G(me, {
3501
3480
  accept: ".json,application/json",
3502
3481
  showUploadList: !1,
3503
3482
  beforeUpload: async (e) => {
3504
3483
  try {
3505
3484
  if (e.size > 2097152) throw Error("快照不能超过 2 MB");
3506
- O(d(await e.text())), j("imported"), _("diagnostics"), b("timeline"), fe("已载入本地快照,未上传文件");
3485
+ k(d(await e.text())), M("imported"), _("diagnostics"), b("timeline"), de("已载入本地快照,未上传文件");
3507
3486
  } catch (e) {
3508
- fe(e instanceof Error ? e.message : "快照读取失败");
3487
+ de(e instanceof Error ? e.message : "快照读取失败");
3509
3488
  }
3510
- return he.LIST_IGNORE;
3489
+ return me.LIST_IGNORE;
3511
3490
  },
3512
3491
  children: /* @__PURE__ */ G(C, {
3513
3492
  type: "text",
@@ -3516,25 +3495,25 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3516
3495
  children: "导入快照"
3517
3496
  })
3518
3497
  }),
3519
- E && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
3498
+ D && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
3520
3499
  size: "small",
3521
3500
  icon: /* @__PURE__ */ G(Ee, {}),
3522
- "aria-pressed": A === "imported",
3523
- type: A === "imported" ? "primary" : "text",
3524
- onClick: () => j("imported"),
3501
+ "aria-pressed": j === "imported",
3502
+ type: j === "imported" ? "primary" : "text",
3503
+ onClick: () => M("imported"),
3525
3504
  children: "导入的现场"
3526
3505
  }), /* @__PURE__ */ G(C, {
3527
3506
  type: "text",
3528
3507
  "aria-label": "关闭导入现场",
3529
3508
  size: "small",
3530
- icon: /* @__PURE__ */ G(ve, {}),
3509
+ icon: /* @__PURE__ */ G(_e, {}),
3531
3510
  onClick: () => {
3532
- O(null), j("live");
3511
+ k(null), M("live");
3533
3512
  }
3534
3513
  })] })
3535
3514
  ]
3536
3515
  }),
3537
- /* @__PURE__ */ G(pe, {
3516
+ /* @__PURE__ */ G(fe, {
3538
3517
  className: q.mainTabs,
3539
3518
  "data-assistant-part": "main-tabs",
3540
3519
  "data-diagnostics-only": i || void 0,
@@ -3550,7 +3529,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3550
3529
  ...e ? [{
3551
3530
  key: "automation",
3552
3531
  label: "自动化测试",
3553
- icon: /* @__PURE__ */ G(Se, { "aria-hidden": !0 }),
3532
+ icon: /* @__PURE__ */ G(xe, { "aria-hidden": !0 }),
3554
3533
  children: /* @__PURE__ */ G(ht, {
3555
3534
  close: se,
3556
3535
  bridgeUrl: r,
@@ -3561,7 +3540,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3561
3540
  key: "diagnostics",
3562
3541
  label: !z && He > 0 ? `诊断(${He})` : "诊断",
3563
3542
  icon: /* @__PURE__ */ G(Oe, { "aria-hidden": !0 }),
3564
- children: /* @__PURE__ */ G(pe, {
3543
+ children: /* @__PURE__ */ G(fe, {
3565
3544
  className: q.diagnosticTabs,
3566
3545
  "data-assistant-part": "diagnostic-tabs",
3567
3546
  activeKey: ee,
@@ -3576,19 +3555,19 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3576
3555
  {
3577
3556
  key: "network",
3578
3557
  label: "接口",
3579
- icon: /* @__PURE__ */ G(k, { "aria-hidden": !0 }),
3558
+ icon: /* @__PURE__ */ G(A, { "aria-hidden": !0 }),
3580
3559
  children: Le
3581
3560
  },
3582
3561
  {
3583
3562
  key: "performance",
3584
3563
  label: Ve.length ? `性能 (${Ve.length})` : "性能",
3585
- icon: /* @__PURE__ */ G(N, { "aria-hidden": !0 }),
3564
+ icon: /* @__PURE__ */ G(P, { "aria-hidden": !0 }),
3586
3565
  children: Ue
3587
3566
  },
3588
3567
  {
3589
3568
  key: "data",
3590
3569
  label: "环境与数据",
3591
- icon: /* @__PURE__ */ G(be, { "aria-hidden": !0 }),
3570
+ icon: /* @__PURE__ */ G(ye, { "aria-hidden": !0 }),
3592
3571
  children: We
3593
3572
  }
3594
3573
  ]
@@ -3639,13 +3618,13 @@ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3639
3618
  c,
3640
3619
  l
3641
3620
  ]);
3642
- let u = ne(() => O({
3621
+ let u = ne(() => k({
3643
3622
  themeMode: r,
3644
3623
  includeCustom: !1
3645
3624
  }), [r]);
3646
3625
  return /* @__PURE__ */ G(ae, {
3647
3626
  hashPriority: "high",
3648
- children: /* @__PURE__ */ G(le, {
3627
+ children: /* @__PURE__ */ G(ce, {
3649
3628
  themeMode: r,
3650
3629
  theme: {
3651
3630
  inherit: !1,