gz-research-assistant 1.0.9 → 1.0.11

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,26 +1,26 @@
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, Empty as ue, Input as T, InputNumber as de, Select as E, Tabs as fe, Tag as D, Tooltip as pe, Upload as me, getDesignTokenCssVariables as O } from "gz-ui-web";
5
- import { ApiOutlined as he, BulbOutlined as k, CameraOutlined as A, CheckCircleOutlined as j, CheckOutlined as M, CloseOutlined as ge, CodeOutlined as _e, DashboardOutlined as ve, DeleteOutlined as N, DesktopOutlined as P, DownloadOutlined as ye, EditOutlined as be, ExperimentOutlined as xe, FieldTimeOutlined as Se, FileAddOutlined as F, FileTextOutlined as I, FlagOutlined as Ce, FolderOpenOutlined as we, FullscreenExitOutlined as Te, FullscreenOutlined as Ee, HistoryOutlined as De, InfoCircleOutlined as Oe, LineChartOutlined as L, LinkOutlined as R, MessageOutlined as ke, MinusOutlined as z, PauseOutlined as Ae, PlayCircleOutlined as je, PlusOutlined as Me, ReadOutlined as B, SaveOutlined as Ne, ScissorOutlined as Pe, SearchOutlined as V, StopOutlined as Fe, UploadOutlined as H, VideoCameraOutlined as U, WarningOutlined as Ie } from "@ant-design/icons";
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";
6
6
  import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
7
- import { OverlayScrollbars as Le } from "overlayscrollbars";
8
- import { createRoot as Re } from "react-dom/client";
7
+ import { OverlayScrollbars as ze } from "overlayscrollbars";
8
+ import { createRoot as Be } from "react-dom/client";
9
9
  // \0rolldown/runtime.js
10
- var ze = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, Ve = Object.getOwnPropertyNames, He = Object.prototype.hasOwnProperty, Ue = (e, t) => {
10
+ var Ve = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Ue = Object.getOwnPropertyNames, We = Object.prototype.hasOwnProperty, Ge = (e, t) => {
11
11
  let n = {};
12
- for (var r in e) ze(n, r, {
12
+ for (var r in e) Ve(n, r, {
13
13
  get: e[r],
14
14
  enumerable: !0
15
15
  });
16
- return t || ze(n, Symbol.toStringTag, { value: "Module" }), n;
17
- }, We = (e, t, n, r) => {
18
- if (t && typeof t == "object" || typeof t == "function") for (var i = Ve(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !He.call(e, s) && s !== n && ze(e, s, {
16
+ return t || Ve(n, Symbol.toStringTag, { value: "Module" }), n;
17
+ }, Ke = (e, t, n, r) => {
18
+ if (t && typeof t == "object" || typeof t == "function") for (var i = Ue(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !We.call(e, s) && s !== n && Ve(e, s, {
19
19
  get: ((e) => t[e]).bind(null, s),
20
- enumerable: !(r = Be(t, s)) || r.enumerable
20
+ enumerable: !(r = He(t, s)) || r.enumerable
21
21
  });
22
22
  return e;
23
- }, Ge = (e, t, n) => (We(e, t, "default"), n && We(n, t, "default")), Ke = { scope: "_scope_tudpr_1" }, q = {
23
+ }, qe = (e, t, n) => (Ke(e, t, "default"), n && Ke(n, t, "default")), Je = { scope: "_scope_tudpr_1" }, q = {
24
24
  dock: "_dock_1oshs_1",
25
25
  launcher: "_launcher_1oshs_12",
26
26
  launcherAvatar: "_launcherAvatar_1oshs_42",
@@ -55,11 +55,11 @@ var ze = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, Ve = Objec
55
55
  request: "_request_1oshs_316",
56
56
  requestUrl: "_requestUrl_1oshs_448",
57
57
  toolbarActions: "_toolbarActions_1oshs_465"
58
- }, qe = (e, t) => ({
58
+ }, Ye = (e, t) => ({
59
59
  x: Math.max(0, Math.min(e.x, Math.max(0, window.innerWidth - t.width - 12))),
60
60
  y: Math.max(0, Math.min(e.y, Math.max(0, window.innerHeight - t.height - 12)))
61
61
  });
62
- function Je(e, t, n) {
62
+ function Xe(e, t, n) {
63
63
  y(() => {
64
64
  let r = e.current, i = r?.closest("[data-assistant-part=\"dock\"]");
65
65
  if (!r || !i) return;
@@ -97,7 +97,7 @@ function Je(e, t, n) {
97
97
  }, m = (e) => {
98
98
  if (!s || s.id !== e.pointerId) return;
99
99
  let t = e.clientX - s.pointer.x, i = e.clientY - s.pointer.y;
100
- !s.moved && Math.hypot(t, i) < 5 || (s.moved || (s.moved = !0, c = !0, n(!0), r.setPointerCapture(e.pointerId)), e.preventDefault(), e.stopPropagation(), a = qe({
100
+ !s.moved && Math.hypot(t, i) < 5 || (s.moved || (s.moved = !0, c = !0, n(!0), r.setPointerCapture(e.pointerId)), e.preventDefault(), e.stopPropagation(), a = Ye({
101
101
  x: s.origin.x + t,
102
102
  y: s.origin.y + i
103
103
  }, o), l ||= requestAnimationFrame(d));
@@ -111,7 +111,7 @@ function Je(e, t, n) {
111
111
  }, ee = (e) => {
112
112
  u(e) && e.preventDefault();
113
113
  }, v = () => {
114
- a && (a = qe(a, o), f());
114
+ a && (a = Ye(a, o), f());
115
115
  }, y = () => {
116
116
  s && (c = !0, h());
117
117
  };
@@ -155,7 +155,7 @@ var J = {
155
155
  assertionResults: "_assertionResults_175v2_175",
156
156
  assertionResult: "_assertionResult_175v2_175",
157
157
  assertionSummary: "_assertionSummary_175v2_202"
158
- }, Ye = {
158
+ }, Ze = {
159
159
  click: "点击",
160
160
  fill: "输入",
161
161
  select: "选择",
@@ -164,9 +164,24 @@ var J = {
164
164
  "assert-text": "检查文字",
165
165
  assert: "断言",
166
166
  unsupported: "需要处理"
167
- }, Y = /* @__PURE__ */ Ue({});
168
- import * as Xe from "gz-laya-pilot/schema";
169
- Ge(Y, Xe);
167
+ }, Y = /* @__PURE__ */ Ge({});
168
+ import * as Qe from "gz-laya-pilot/schema";
169
+ qe(Y, Qe);
170
+ // src/pages/assistant/components/ActionMenu.tsx
171
+ function $e({ label: e, items: t, disabled: n }) {
172
+ return /* @__PURE__ */ G(ue, {
173
+ trigger: ["click"],
174
+ menu: { items: t },
175
+ disabled: n,
176
+ children: /* @__PURE__ */ G(C, {
177
+ type: "text",
178
+ icon: /* @__PURE__ */ G(F, {}),
179
+ "aria-label": e,
180
+ disabled: n,
181
+ children: "更多"
182
+ })
183
+ });
184
+ }
170
185
  var X = {
171
186
  buttonRow: "_buttonRow_gry3r_1 _buttonRow_13kbl_627",
172
187
  field: "_field_gry3r_4 _field_13kbl_761",
@@ -177,7 +192,7 @@ var X = {
177
192
  assertionFields: "_assertionFields_gry3r_29"
178
193
  };
179
194
  // src/pages/assistant/components/AssertionEditor/index.tsx
180
- function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCancel: a }) {
195
+ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCancel: a }) {
181
196
  let o = b(), [s, c] = x(e ?? {
182
197
  name: "",
183
198
  source: "page-text",
@@ -372,7 +387,7 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
372
387
  children: [/* @__PURE__ */ G("label", {
373
388
  htmlFor: `${o}-timeout`,
374
389
  children: m ? "观察时间(毫秒)" : "最长等待时间(毫秒)"
375
- }), /* @__PURE__ */ G(de, {
390
+ }), /* @__PURE__ */ G(fe, {
376
391
  id: `${o}-timeout`,
377
392
  min: 500,
378
393
  max: 3e4,
@@ -391,7 +406,7 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
391
406
  className: X.buttonRow,
392
407
  "data-assistant-part": "button-row",
393
408
  children: [/* @__PURE__ */ G(C, {
394
- icon: /* @__PURE__ */ G(Ne, {}),
409
+ icon: /* @__PURE__ */ G(H, {}),
395
410
  type: "primary",
396
411
  disabled: r || m && !h,
397
412
  onClick: () => {
@@ -416,17 +431,17 @@ function Ze({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
416
431
  ]
417
432
  });
418
433
  }
419
- var Qe = {
434
+ var tt = {
420
435
  field: "_field_1qtxy_1 _field_13kbl_761",
421
436
  formStack: "_formStack_1qtxy_4 _formStack_13kbl_763",
422
437
  hint: "_hint_1qtxy_7 _hint_13kbl_515",
423
438
  supplement: "_supplement_1qtxy_10"
424
439
  };
425
440
  // src/pages/assistant/components/StepSupplement/index.tsx
426
- function $e({ step: e, disabled: t, onApply: n }) {
441
+ function nt({ step: e, disabled: t, onApply: n }) {
427
442
  let r = b(), [i, a] = x("click"), [o, s] = x(""), [c, l] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, h] = x("");
428
443
  return /* @__PURE__ */ G(w, {
429
- className: Qe.supplement,
444
+ className: tt.supplement,
430
445
  "data-assistant-part": "supplement",
431
446
  ghost: !0,
432
447
  size: "small",
@@ -442,15 +457,15 @@ function $e({ step: e, disabled: t, onApply: n }) {
442
457
  key: "details",
443
458
  label: /* @__PURE__ */ G(W, { children: "补充为可执行步骤" }),
444
459
  children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", {
445
- className: Qe.hint,
460
+ className: tt.hint,
446
461
  "data-assistant-part": "hint",
447
462
  children: "补充步骤不会改写原始事件。无法定位控件时,可退出选段后重新录制。"
448
463
  }), /* @__PURE__ */ K("div", {
449
- className: Qe.formStack,
464
+ className: tt.formStack,
450
465
  "data-assistant-part": "form-stack",
451
466
  children: [
452
467
  /* @__PURE__ */ K("div", {
453
- className: Qe.field,
468
+ className: tt.field,
454
469
  "data-assistant-part": "field",
455
470
  children: [/* @__PURE__ */ G("label", {
456
471
  htmlFor: r,
@@ -491,14 +506,14 @@ function $e({ step: e, disabled: t, onApply: n }) {
491
506
  })]
492
507
  }),
493
508
  i !== "assert-text" && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("div", {
494
- className: Qe.field,
509
+ className: tt.field,
495
510
  "data-assistant-part": "field",
496
511
  children: [/* @__PURE__ */ G("label", {
497
512
  htmlFor: `${r}-selector`,
498
513
  children: "CSS 定位"
499
514
  }), /* @__PURE__ */ G(T, {
500
515
  id: `${r}-selector`,
501
- prefix: /* @__PURE__ */ G(_e, {}),
516
+ prefix: /* @__PURE__ */ G(M, {}),
502
517
  placeholder: "例如 button[aria-label=\"展开\"]",
503
518
  maxLength: 2e3,
504
519
  value: o,
@@ -506,14 +521,14 @@ function $e({ step: e, disabled: t, onApply: n }) {
506
521
  onChange: (e) => s(e.target.value)
507
522
  })]
508
523
  }), /* @__PURE__ */ K("div", {
509
- className: Qe.field,
524
+ className: tt.field,
510
525
  "data-assistant-part": "field",
511
526
  children: [/* @__PURE__ */ G("label", {
512
527
  htmlFor: `${r}-label`,
513
528
  children: "控件文字"
514
529
  }), /* @__PURE__ */ G(T, {
515
530
  id: `${r}-label`,
516
- prefix: /* @__PURE__ */ G(be, {}),
531
+ prefix: /* @__PURE__ */ G(P, {}),
517
532
  placeholder: "如按钮文字、无障碍名称或输入提示",
518
533
  maxLength: 200,
519
534
  value: c,
@@ -527,7 +542,7 @@ function $e({ step: e, disabled: t, onApply: n }) {
527
542
  "press",
528
543
  "assert-text"
529
544
  ].includes(i) && /* @__PURE__ */ K("div", {
530
- className: Qe.field,
545
+ className: tt.field,
531
546
  "data-assistant-part": "field",
532
547
  children: [/* @__PURE__ */ G("label", {
533
548
  htmlFor: `${r}-value`,
@@ -548,7 +563,7 @@ function $e({ step: e, disabled: t, onApply: n }) {
548
563
  children: "选中"
549
564
  }),
550
565
  /* @__PURE__ */ G(C, {
551
- icon: /* @__PURE__ */ G(M, {}),
566
+ icon: /* @__PURE__ */ G(_e, {}),
552
567
  disabled: t,
553
568
  onClick: () => {
554
569
  try {
@@ -594,7 +609,7 @@ function $e({ step: e, disabled: t, onApply: n }) {
594
609
  });
595
610
  }
596
611
  // src/api/automation.ts
597
- async function et(e, t, n) {
612
+ async function rt(e, t, n) {
598
613
  let r = await fetch(`${e.replace(/\/$/, "")}/agent/${t}`, n === void 0 ? {} : {
599
614
  method: "POST",
600
615
  headers: {
@@ -616,7 +631,7 @@ async function et(e, t, n) {
616
631
  ].includes(i.state)) throw Error("自主探索服务版本不匹配");
617
632
  return i;
618
633
  }
619
- var tt = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchParams({
634
+ var it = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchParams({
620
635
  id: t,
621
636
  file: n
622
637
  })}`, Z = {
@@ -627,30 +642,30 @@ var tt = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchPar
627
642
  hint: "_hint_1ixz9_15 _hint_13kbl_515",
628
643
  stack: "_stack_1ixz9_18",
629
644
  caseHeading: "_caseHeading_1ixz9_25"
630
- }, nt = {
645
+ }, at = {
631
646
  idle: "待探索",
632
647
  running: "执行中",
633
648
  passed: "全部通过",
634
649
  partial: "部分完成",
635
650
  failed: "执行失败",
636
651
  stopped: "已停止"
637
- }, rt = {
652
+ }, ot = {
638
653
  passed: "通过",
639
654
  failed: "失败",
640
655
  skipped: "未执行"
641
- }, it = {
656
+ }, st = {
642
657
  state: "idle",
643
658
  mode: "explore",
644
659
  message: "",
645
660
  cases: [],
646
661
  decisions: 0
647
662
  };
648
- function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
649
- let [r, i] = x(it), [a, o] = x(), [s, c] = x(""), [l, u] = x(!1), [d, f] = x(!1), [p, m] = x(""), [h, g] = x(!1), [_, ee] = x();
663
+ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
664
+ let [r, i] = x(st), [a, o] = x(), [s, c] = x(""), [l, u] = x(!1), [d, f] = x(!1), [p, m] = x(""), [h, g] = x(!1), [_, ee] = x();
650
665
  y(() => {
651
666
  let t = !1, r, a = async () => {
652
667
  try {
653
- let r = await et(e, "status");
668
+ let r = await rt(e, "status");
654
669
  t || (g(!0), i(r), o(r.capabilities), n(r.state === "running"), c((e) => e || r.capabilities?.targets[0] || ""));
655
670
  } catch {
656
671
  t || g(!1);
@@ -665,7 +680,7 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
665
680
  let v = d || r.state === "running", b = async (t) => {
666
681
  f(!0), m("");
667
682
  try {
668
- let r = await et(e, t, {
683
+ let r = await rt(e, t, {
669
684
  url: s,
670
685
  allowWrite: l,
671
686
  ...t === "replay" ? { workbook: _?.data } : {}
@@ -677,8 +692,9 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
677
692
  f(!1);
678
693
  }
679
694
  }, te = (t, n) => r.id && /* @__PURE__ */ G(C, {
680
- icon: /* @__PURE__ */ G(ye, {}),
681
- href: tt(e, r.id, t),
695
+ type: "link",
696
+ icon: /* @__PURE__ */ G(xe, {}),
697
+ href: it(e, r.id, t),
682
698
  children: n
683
699
  });
684
700
  return /* @__PURE__ */ K(se, {
@@ -694,9 +710,9 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
694
710
  children: [
695
711
  /* @__PURE__ */ K("div", {
696
712
  className: Z.cardHeading,
697
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(xe, {}), "自主探索"] }), /* @__PURE__ */ G(D, {
713
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Se, {}), "自主探索"] }), /* @__PURE__ */ G(D, {
698
714
  color: v ? "processing" : r.state === "passed" ? "success" : "default",
699
- children: nt[r.state]
715
+ children: at[r.state]
700
716
  })]
701
717
  }),
702
718
  h ? !a?.configured && /* @__PURE__ */ G(S, {
@@ -734,13 +750,15 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
734
750
  /* @__PURE__ */ G("div", {
735
751
  className: Z.buttonRow,
736
752
  children: v ? /* @__PURE__ */ G(C, {
753
+ type: "primary",
754
+ danger: !0,
737
755
  icon: /* @__PURE__ */ G(Fe, {}),
738
756
  disabled: !v || d,
739
757
  onClick: () => void b("stop"),
740
758
  children: "停止探索"
741
759
  }) : /* @__PURE__ */ G(C, {
742
760
  type: "primary",
743
- icon: /* @__PURE__ */ G(xe, {}),
761
+ icon: /* @__PURE__ */ G(Se, {}),
744
762
  disabled: v || t || !s || !h || !a?.configured,
745
763
  onClick: () => void b("explore"),
746
764
  children: "开始自主探索"
@@ -782,7 +800,7 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
782
800
  }),
783
801
  /* @__PURE__ */ K("div", {
784
802
  className: Z.buttonRow,
785
- children: [/* @__PURE__ */ G(me, {
803
+ children: [/* @__PURE__ */ G(he, {
786
804
  accept: ".xlsx",
787
805
  maxCount: 1,
788
806
  showUploadList: !1,
@@ -804,12 +822,14 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
804
822
  return !1;
805
823
  },
806
824
  children: /* @__PURE__ */ G(C, {
807
- icon: /* @__PURE__ */ G(H, {}),
825
+ type: "text",
826
+ icon: /* @__PURE__ */ G(Ie, {}),
808
827
  disabled: v || t,
809
828
  children: "导入 Excel"
810
829
  })
811
830
  }), /* @__PURE__ */ G(C, {
812
- icon: /* @__PURE__ */ G(je, {}),
831
+ type: "primary",
832
+ icon: /* @__PURE__ */ G(Me, {}),
813
833
  disabled: v || t || !h || !a?.configured || !s || !_,
814
834
  onClick: () => void b("replay"),
815
835
  children: "新会话回放"
@@ -828,7 +848,7 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
828
848
  className: Z.caseHeading,
829
849
  children: [/* @__PURE__ */ G(D, {
830
850
  color: e.state === "passed" ? "success" : e.state === "failed" ? "error" : "default",
831
- children: rt[e.state]
851
+ children: ot[e.state]
832
852
  }), /* @__PURE__ */ G("span", { children: e.title })]
833
853
  }),
834
854
  children: /* @__PURE__ */ K("div", {
@@ -857,7 +877,7 @@ function at({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
857
877
  });
858
878
  }
859
879
  // src/pages/assistant/components/TestLibraryPanel/libraryRequest.ts
860
- function ot(e) {
880
+ function lt(e) {
861
881
  return v(async (t = "", n = "GET", r, i) => {
862
882
  let a = await fetch(e + t, {
863
883
  method: n,
@@ -876,14 +896,21 @@ function ot(e) {
876
896
  }, [e]);
877
897
  }
878
898
  var Q = {
879
- card: "_card_137oe_1 _card_13kbl_633",
880
- hint: "_hint_137oe_4 _hint_13kbl_515",
881
- buttonRow: "_buttonRow_137oe_7 _buttonRow_13kbl_627",
882
- stack: "_stack_137oe_10",
883
- list: "_list_137oe_11",
884
- entryLink: "_entryLink_137oe_26",
885
- resourceList: "_resourceList_137oe_33"
886
- }, st = {
899
+ card: "_card_1xwqo_1 _card_13kbl_633",
900
+ hint: "_hint_1xwqo_4 _hint_13kbl_515",
901
+ buttonRow: "_buttonRow_1xwqo_7 _buttonRow_13kbl_627",
902
+ stack: "_stack_1xwqo_10",
903
+ list: "_list_1xwqo_11",
904
+ entryLink: "_entryLink_1xwqo_26",
905
+ resourceList: "_resourceList_1xwqo_33",
906
+ header: "_header_1xwqo_54",
907
+ headerAction: "_headerAction_1xwqo_71",
908
+ tabAction: "_tabAction_1xwqo_75",
909
+ fitButton: "_fitButton_1xwqo_78",
910
+ resourceName: "_resourceName_1xwqo_88",
911
+ breadcrumbs: "_breadcrumbs_1xwqo_95",
912
+ breadcrumbName: "_breadcrumbName_1xwqo_103"
913
+ }, ut = {
887
914
  running: "执行中",
888
915
  stopping: "停止中",
889
916
  passed: "通过",
@@ -893,18 +920,19 @@ var Q = {
893
920
  idle: "未执行",
894
921
  interrupted: "已中断"
895
922
  };
896
- function ct({ run: e, base: t, onExport: n }) {
923
+ function dt({ run: e, base: t, onExport: n }) {
897
924
  return /* @__PURE__ */ K("div", {
898
925
  className: Q.stack,
899
926
  children: [
900
927
  /* @__PURE__ */ G("div", {
901
928
  className: Q.buttonRow,
902
929
  children: /* @__PURE__ */ G(C, {
930
+ type: "text",
903
931
  onClick: n,
904
932
  children: "导出报告 JSON"
905
933
  })
906
934
  }),
907
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(D, { children: st[e.state] ?? e.state }), e.message] }),
935
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(D, { children: ut[e.state] ?? e.state }), e.message] }),
908
936
  e.iterations?.map(({ iteration: n, cases: r }) => /* @__PURE__ */ K("details", { children: [/* @__PURE__ */ K("summary", { children: [
909
937
  "第 ",
910
938
  n,
@@ -923,7 +951,7 @@ function ct({ run: e, base: t, onExport: n }) {
923
951
  ] }),
924
952
  /* @__PURE__ */ G("code", { children: r.url ?? r.path }),
925
953
  /* @__PURE__ */ K("span", { children: [
926
- /* @__PURE__ */ G(D, { children: st[r.status.state] ?? r.status.state }),
954
+ /* @__PURE__ */ G(D, { children: ut[r.status.state] ?? r.status.state }),
927
955
  "步骤 ",
928
956
  r.status.step,
929
957
  " / ",
@@ -978,7 +1006,7 @@ function ct({ run: e, base: t, onExport: n }) {
978
1006
  });
979
1007
  }
980
1008
  // src/pages/assistant/components/TestLibraryPanel/LibraryDetail.tsx
981
- function lt({ options: e, values: t, onChange: n }) {
1009
+ function ft({ options: e, values: t, onChange: n }) {
982
1010
  return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(E, {
983
1011
  "aria-label": "添加到执行顺序",
984
1012
  placeholder: "选择要添加的项目",
@@ -994,6 +1022,7 @@ function lt({ options: e, values: t, onChange: n }) {
994
1022
  className: Q.buttonRow,
995
1023
  children: [/* @__PURE__ */ G(C, {
996
1024
  size: "small",
1025
+ type: "text",
997
1026
  "aria-label": `上移第 ${i + 1} 项`,
998
1027
  disabled: i === 0,
999
1028
  onClick: () => {
@@ -1003,6 +1032,7 @@ function lt({ options: e, values: t, onChange: n }) {
1003
1032
  children: "上移"
1004
1033
  }), /* @__PURE__ */ G(C, {
1005
1034
  size: "small",
1035
+ type: "text",
1006
1036
  "aria-label": `移除第 ${i + 1} 项`,
1007
1037
  onClick: () => n(t.filter((e, t) => t !== i)),
1008
1038
  children: "移除"
@@ -1010,37 +1040,37 @@ function lt({ options: e, values: t, onChange: n }) {
1010
1040
  })] }, i))
1011
1041
  })] });
1012
1042
  }
1013
- function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, onEdit: o, recording: s, incomingDraft: c, onConsumeDraft: l, renderEditor: u }) {
1014
- 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(), [pe, O] = x(!1), [he, k] = x(!1), [A, j] = x(), M = !!(A && A.baseline !== JSON.stringify(i)), ge = () => !s && (!M || window.confirm("当前用例有未保存修改,确定离开?")), _e = (e, t, n) => {
1015
- o(e), ce(t), Se(void 0), le(n), j({
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({
1016
1046
  caseId: t,
1017
1047
  suiteId: n,
1018
1048
  baseline: JSON.stringify(e)
1019
1049
  }), _("cases");
1020
1050
  }, ve = (e) => {
1021
- !b && !s && ge() && ze() && Be() && (j(void 0), O(!1), k(!1), _(e));
1022
- }, [N, P] = x({
1051
+ !b && !s && j() && Le() && Re() && (A(void 0), me(!1), O(!1), _(e));
1052
+ }, [M, N] = x({
1023
1053
  id: "",
1024
1054
  name: "",
1025
1055
  caseIds: []
1026
- }), [ye, be] = x(), [xe, Se] = x(), [F, I] = x({
1056
+ }), ye = re(null), [be, xe] = x(), [P, F] = x({
1027
1057
  id: "",
1028
1058
  name: "",
1029
1059
  suiteIds: [],
1030
1060
  repeat: 1
1031
- }), [Ce, we] = x(), [Te, Ee] = x();
1061
+ }), [Se, Ce] = x(), [we, Te] = x();
1032
1062
  y(() => {
1033
- c && d && !s && !b && ((!M || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && ze() && Be() && (O(!1), k(!1), ce(void 0), le(void 0), o(c), j({ baseline: "" }), _("cases")), l?.());
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?.());
1034
1064
  }, [
1035
1065
  c,
1036
1066
  d,
1037
1067
  s,
1038
1068
  b,
1039
- M,
1069
+ ge,
1040
1070
  o,
1041
1071
  l
1042
1072
  ]);
1043
- let De = Ce ?? m[0]?.id, Oe = m.some((e) => e.state === "running" || e.state === "stopping"), L = ot(e), R = async (e) => {
1073
+ let I = Se ?? m[0]?.id, Ee = m.some((e) => e.state === "running" || e.state === "stopping"), L = lt(e), R = async (e) => {
1044
1074
  if (!b) {
1045
1075
  ne(!0), ae("");
1046
1076
  try {
@@ -1051,61 +1081,72 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1051
1081
  ne(!1);
1052
1082
  }
1053
1083
  }
1054
- }, ke = v(async (e) => {
1084
+ }, De = v(async (e) => {
1055
1085
  let t = await L("", "GET", void 0, e);
1056
1086
  if (t.version !== 1 || !Array.isArray(t.cases)) throw Error("本机测试库服务版本不匹配");
1057
1087
  let n = await L("/runs", "GET", void 0, e);
1058
1088
  e?.aborted || (f(t), h(n));
1059
- }, [L]), z = () => void R(ke);
1089
+ }, [L]), z = () => void R(De);
1060
1090
  y(() => {
1061
1091
  let e = new AbortController();
1062
- return ne(!0), ke(e.signal).catch((t) => {
1092
+ return ne(!0), De(e.signal).catch((t) => {
1063
1093
  e.signal.aborted || ae(t instanceof Error ? t.message : "本机测试库服务未连接");
1064
1094
  }).finally(() => {
1065
1095
  e.signal.aborted || ne(!1);
1066
1096
  }), () => e.abort();
1067
- }, [ke]), y(() => {
1068
- if (!Oe && (!De || g !== "reports")) return;
1097
+ }, [De]), y(() => {
1098
+ if (!Ee && (!I || g !== "reports")) return;
1069
1099
  let e = new AbortController(), t = async () => {
1070
- let t = await L("/runs", "GET", void 0, e.signal), n = g === "reports" && De ? await L(`/runs/${De}`, "GET", void 0, e.signal) : void 0;
1071
- e.signal.aborted || (h(t), n && Ee(n));
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));
1072
1102
  }, n = () => void t().catch(() => {});
1073
1103
  n();
1074
- let r = Oe ? setInterval(n, 1e3) : void 0;
1104
+ let r = Ee ? setInterval(n, 1e3) : void 0;
1075
1105
  return () => {
1076
1106
  clearInterval(r), e.abort();
1077
1107
  };
1078
1108
  }, [
1079
1109
  L,
1080
- De,
1081
- Oe,
1110
+ I,
1111
+ Ee,
1082
1112
  g
1083
1113
  ]);
1084
- let Ae = async (e) => {
1114
+ let Oe = async (e) => {
1085
1115
  f(await L("", "PUT", e));
1086
- }, je = (e, t) => {
1116
+ }, ke = (e, t) => {
1087
1117
  let n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
1088
1118
  r.href = n, r.download = t, r.click(), setTimeout(() => URL.revokeObjectURL(n), 3e4);
1089
- }, Me = (e, t) => e.some(({ id: e }) => e === t.id) ? e.map((e) => e.id === t.id ? t : e) : [...e, t], B = !a && !b && !Oe, Ne = d?.cases.map(({ id: e, testCase: t }) => ({
1119
+ }, Ae = (e, t) => e.some(({ id: e }) => e === t.id) ? e.map((e) => e.id === t.id ? t : e) : [...e, t], B = !a && !b && !Ee, je = d?.cases.map(({ id: e, testCase: t }) => ({
1090
1120
  label: t.name,
1091
1121
  value: e
1092
- })) ?? [], Pe = d?.suites.map(({ id: e, name: t }) => ({
1122
+ })) ?? [], Me = d?.suites.map(({ id: e, name: t }) => ({
1093
1123
  label: t,
1094
1124
  value: e
1095
- })) ?? [], V = d?.cases.find(({ id: e }) => e === oe), Fe = 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), Ie = H?.caseIds ?? (ye ? [ye] : []), Le = N.name !== (H?.name ?? "") || JSON.stringify(N.caseIds) !== JSON.stringify(Ie), Re = F.name !== (U?.name ?? "") || F.repeat !== (U?.repeat ?? 1) || JSON.stringify(F.suiteIds) !== JSON.stringify(U?.suiteIds ?? []), ze = () => !pe || !Le || window.confirm("当前套件有未保存修改,确定放弃?"), Be = () => !he || !Re || 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 === 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("当前计划有未保存修改,确定放弃?");
1096
1126
  te(() => {
1097
1127
  let e = ee.current?.closest("[role=\"dialog\"]");
1098
1128
  if (e) for (let t = ee.current?.parentElement; t && t !== e; t = t.parentElement) t.scrollTop && (t.scrollTop = 0);
1099
1129
  }, [
1100
1130
  g,
1101
1131
  oe,
1102
- A,
1103
- N.id,
1104
- pe,
1105
- F.id,
1132
+ k,
1133
+ M.id,
1134
+ ue,
1135
+ P.id,
1106
1136
  he
1107
1137
  ]);
1108
- let Ve = g === "cases" ? V?.testCase.name : g === "suites" ? H?.name : g === "plans" ? U?.name : void 0;
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({
1140
+ id: "",
1141
+ name: "",
1142
+ caseIds: []
1143
+ }), F({
1144
+ id: "",
1145
+ name: "",
1146
+ suiteIds: [],
1147
+ repeat: 1
1148
+ }));
1149
+ };
1109
1150
  return /* @__PURE__ */ K(se, {
1110
1151
  className: Q.card,
1111
1152
  "aria-label": "本机测试库",
@@ -1116,160 +1157,193 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1116
1157
  gap: 16
1117
1158
  } },
1118
1159
  children: [
1119
- /* @__PURE__ */ K("nav", {
1120
- ref: ee,
1121
- "aria-label": "当前位置",
1122
- className: Q.buttonRow,
1123
- children: [
1124
- /* @__PURE__ */ G(C, {
1125
- type: "link",
1126
- size: "small",
1127
- className: Q.entryLink,
1128
- disabled: b || s,
1129
- onClick: () => {
1130
- ge() && ze() && Be() && n();
1131
- },
1132
- children: "测试库"
1133
- }),
1134
- /* @__PURE__ */ G("span", {
1135
- "aria-hidden": "true",
1136
- children: "/"
1137
- }),
1138
- Ve || A || pe || he ? /* @__PURE__ */ K(W, { children: [
1160
+ /* @__PURE__ */ K("header", {
1161
+ className: Q.header,
1162
+ children: [/* @__PURE__ */ K("nav", {
1163
+ ref: ee,
1164
+ "aria-label": "当前位置",
1165
+ className: Q.breadcrumbs,
1166
+ children: [
1139
1167
  /* @__PURE__ */ G(C, {
1140
1168
  type: "link",
1141
1169
  size: "small",
1142
1170
  className: Q.entryLink,
1143
1171
  disabled: b || s,
1144
1172
  onClick: () => {
1145
- !b && ge() && ze() && Be() && (ce(void 0), j(void 0), O(!1), k(!1), be(void 0), P({
1146
- id: "",
1147
- name: "",
1148
- caseIds: []
1149
- }), I({
1150
- id: "",
1151
- name: "",
1152
- suiteIds: [],
1153
- repeat: 1
1154
- }));
1173
+ j() && Le() && Re() && n();
1155
1174
  },
1156
- children: t
1175
+ children: "测试库"
1157
1176
  }),
1158
1177
  /* @__PURE__ */ G("span", {
1159
1178
  "aria-hidden": "true",
1160
1179
  children: "/"
1161
1180
  }),
1162
- /* @__PURE__ */ G("span", {
1163
- "aria-current": "page",
1164
- children: Ve ?? (A ? "新建用例" : pe ? "新建套件" : "新建计划")
1181
+ ze || k || ue || he ? /* @__PURE__ */ K(W, { children: [
1182
+ /* @__PURE__ */ G(C, {
1183
+ type: "link",
1184
+ size: "small",
1185
+ className: Q.breadcrumbName,
1186
+ title: t,
1187
+ disabled: b || s,
1188
+ onClick: Be,
1189
+ children: /* @__PURE__ */ G("span", {
1190
+ className: Q.resourceName,
1191
+ children: t
1192
+ })
1193
+ }),
1194
+ /* @__PURE__ */ G("span", {
1195
+ "aria-hidden": "true",
1196
+ children: "/"
1197
+ }),
1198
+ /* @__PURE__ */ G("span", {
1199
+ "aria-current": "page",
1200
+ className: Q.resourceName,
1201
+ title: ze,
1202
+ children: ze ?? (k ? "新建用例" : ue ? "新建套件" : "新建计划")
1203
+ })
1204
+ ] }) : /* @__PURE__ */ G("h3", {
1205
+ className: Q.resourceName,
1206
+ title: t,
1207
+ children: t
1165
1208
  })
1166
- ] }) : /* @__PURE__ */ G("h3", { children: t })
1167
- ]
1209
+ ]
1210
+ }), d && !ze && !k && !ue && !he && /* @__PURE__ */ K("div", {
1211
+ className: Q.headerAction,
1212
+ children: [/* @__PURE__ */ G($e, {
1213
+ label: "测试库更多操作",
1214
+ items: [
1215
+ {
1216
+ key: "rename",
1217
+ label: "重命名",
1218
+ disabled: !B,
1219
+ onClick: r
1220
+ },
1221
+ {
1222
+ key: "refresh",
1223
+ label: "刷新测试库",
1224
+ disabled: b,
1225
+ onClick: z
1226
+ },
1227
+ {
1228
+ key: "import",
1229
+ label: "导入测试库",
1230
+ disabled: !B,
1231
+ onClick: () => ye.current?.click()
1232
+ },
1233
+ {
1234
+ key: "export",
1235
+ label: "导出测试库",
1236
+ title: "导出包含用例入口的查询参数和片段,分享前请移除敏感值。",
1237
+ disabled: b,
1238
+ onClick: () => ke(d, "研发小蜜测试库.json")
1239
+ }
1240
+ ]
1241
+ }), /* @__PURE__ */ G("input", {
1242
+ hidden: !0,
1243
+ type: "file",
1244
+ ref: ye,
1245
+ accept: ".json,application/json",
1246
+ onChange: (e) => {
1247
+ let t = e.target.files?.[0];
1248
+ e.target.value = "", t && B && window.confirm("导入会替换当前测试库中的用例、套件和计划。继续?") && R(async () => {
1249
+ if (t.size > 2097152) throw Error("测试库文件不能超过 2 MB");
1250
+ let e = JSON.parse(await t.text());
1251
+ await Oe({
1252
+ ...e,
1253
+ revision: d.revision
1254
+ }), Be(), Ce(void 0), _("cases");
1255
+ });
1256
+ }
1257
+ })]
1258
+ })]
1168
1259
  }),
1169
1260
  ie && /* @__PURE__ */ G(S, {
1170
1261
  type: "error",
1171
1262
  title: ie,
1172
1263
  action: d && /* @__PURE__ */ G(C, {
1264
+ type: "text",
1173
1265
  size: "small",
1174
1266
  disabled: b || s,
1175
1267
  onClick: z,
1176
1268
  children: "刷新测试库"
1177
1269
  })
1178
1270
  }),
1179
- d ? /* @__PURE__ */ K(W, { children: [!A && !pe && !he && !(g === "cases" && V) && !(g === "suites" && H) && !(g === "plans" && U) && /* @__PURE__ */ K("details", { children: [
1180
- /* @__PURE__ */ G("summary", { children: "库设置" }),
1181
- /* @__PURE__ */ K("div", {
1182
- className: Q.buttonRow,
1271
+ d ? /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(pe, {
1272
+ activeKey: g,
1273
+ onChange: ve,
1274
+ tabBarExtraContent: { right: /* @__PURE__ */ K("div", {
1275
+ className: Q.tabAction,
1183
1276
  children: [
1184
- /* @__PURE__ */ G(C, {
1277
+ g === "cases" && !k && !V && /* @__PURE__ */ G(C, {
1278
+ type: "primary",
1279
+ size: "small",
1185
1280
  disabled: !B,
1186
- onClick: r,
1187
- children: "重命名"
1188
- }),
1189
- /* @__PURE__ */ G(C, {
1190
- disabled: b,
1191
- onClick: z,
1192
- children: "刷新测试库"
1193
- }),
1194
- /* @__PURE__ */ G(C, {
1195
- disabled: b,
1196
- onClick: () => je(d, "研发小蜜测试库.json"),
1197
- children: "导出测试库"
1281
+ onClick: () => {
1282
+ _e(p());
1283
+ },
1284
+ children: "新建用例"
1198
1285
  }),
1199
- /* @__PURE__ */ G(me, {
1200
- accept: ".json,application/json",
1201
- showUploadList: !1,
1286
+ g === "suites" && !ue && !H && /* @__PURE__ */ G(C, {
1287
+ type: "primary",
1288
+ size: "small",
1202
1289
  disabled: !B,
1203
- beforeUpload: async (e) => (s || A && !ge() || !window.confirm("导入会替换本机测试库,并丢弃未保存的套件和计划。继续?") || await R(async () => {
1204
- if (e.size > 2097152) throw Error("测试库文件不能超过 2 MB");
1205
- let t = JSON.parse(await e.text());
1206
- await Ae({
1207
- ...t,
1208
- revision: d.revision
1209
- }), j(void 0), ce(void 0), O(!1), k(!1), P({
1290
+ onClick: () => {
1291
+ N({
1210
1292
  id: "",
1211
1293
  name: "",
1212
1294
  caseIds: []
1213
- }), be(void 0), I({
1295
+ }), me(!0);
1296
+ },
1297
+ children: "新建套件"
1298
+ }),
1299
+ g === "plans" && !he && !U && /* @__PURE__ */ G(C, {
1300
+ type: "primary",
1301
+ size: "small",
1302
+ disabled: !B,
1303
+ onClick: () => {
1304
+ F({
1214
1305
  id: "",
1215
1306
  name: "",
1216
1307
  suiteIds: [],
1217
1308
  repeat: 1
1218
- }), we(void 0), _("cases");
1219
- }), me.LIST_IGNORE),
1220
- children: /* @__PURE__ */ G(C, {
1221
- disabled: !B,
1222
- children: "导入测试库"
1223
- })
1309
+ }), O(!0);
1310
+ },
1311
+ children: "新建计划"
1224
1312
  })
1225
1313
  ]
1226
- }),
1227
- /* @__PURE__ */ G("span", {
1228
- className: Q.hint,
1229
- children: "导出会保留用例入口的查询参数和片段,分享前请移除敏感值。"
1230
- })
1231
- ] }), /* @__PURE__ */ G(fe, {
1232
- activeKey: g,
1233
- onChange: ve,
1314
+ }) },
1234
1315
  items: [
1235
1316
  {
1236
1317
  key: "cases",
1237
1318
  label: "用例",
1238
- children: A ? /* @__PURE__ */ K("div", {
1319
+ children: k ? /* @__PURE__ */ K("div", {
1239
1320
  className: Q.stack,
1240
1321
  children: [/* @__PURE__ */ K("div", {
1241
1322
  className: Q.buttonRow,
1242
- children: [
1243
- /* @__PURE__ */ G(C, {
1244
- disabled: b || s,
1245
- onClick: () => {
1246
- ge() && (j(void 0), A.suiteId && !A.caseId && _("suites"));
1247
- },
1248
- children: A.caseId ? "返回用例详情" : A.suiteId ? "返回原套件" : "返回用例列表"
1249
- }),
1250
- /* @__PURE__ */ G("h4", { children: A.caseId ? "编辑用例" : "新建用例" }),
1251
- /* @__PURE__ */ G(D, { children: M ? "未保存" : A.caseId ? "已保存" : "新用例" })
1252
- ]
1323
+ children: [/* @__PURE__ */ G("h4", { children: k.caseId ? "编辑用例" : "新建用例" }), /* @__PURE__ */ G(D, { children: ge ? "未保存" : k.caseId ? "已保存" : "新用例" })]
1253
1324
  }), u({
1254
- busy: b || Oe || a && !s,
1255
- dirty: M,
1325
+ busy: b || Ee || a && !s,
1326
+ dirty: ge,
1327
+ cancel: () => {
1328
+ j() && (A(void 0), k.suiteId && !k.caseId && _("suites"));
1329
+ },
1256
1330
  save: (e) => R(async () => {
1257
- let t = A.caseId ?? crypto.randomUUID();
1258
- if (A.caseId && !d.cases.some(({ id: e }) => e === t)) throw Error("当前用例已被删除,可返回后另存为新用例");
1259
- let n = d.suites.find(({ id: e }) => e === A.suiteId);
1260
- if (A.suiteId && !n) throw Error("原套件已被删除");
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("原套件已被删除");
1261
1335
  let r = n && !n.caseIds.includes(t) ? {
1262
1336
  ...n,
1263
1337
  caseIds: [...n.caseIds, t]
1264
1338
  } : n;
1265
- await Ae({
1339
+ await Oe({
1266
1340
  ...d,
1267
- cases: Me(d.cases, {
1341
+ cases: Ae(d.cases, {
1268
1342
  id: t,
1269
1343
  testCase: e
1270
1344
  }),
1271
- suites: r ? Me(d.suites, r) : d.suites
1272
- }), r && P(r), o(e), ce(t), j(void 0);
1345
+ suites: r ? Ae(d.suites, r) : d.suites
1346
+ }), r && N(r), o(e), ce(t), A(void 0);
1273
1347
  })
1274
1348
  })]
1275
1349
  }) : V ? /* @__PURE__ */ K("section", {
@@ -1280,7 +1354,7 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1280
1354
  /* @__PURE__ */ G("code", { children: V.url ?? V.testCase.path }),
1281
1355
  /* @__PURE__ */ G("ol", {
1282
1356
  className: Q.list,
1283
- children: V.testCase.steps.map((e, t) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ K("strong", { children: [Ye[e.kind], e.assertion?.name ? ` · ${e.assertion.name}` : ""] }), e.assertion ? /* @__PURE__ */ K(W, { children: [
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: [
1284
1358
  /* @__PURE__ */ G("span", { children: Y.assertionSources[e.assertion.source] }),
1285
1359
  e.assertion.method && /* @__PURE__ */ K("code", { children: [
1286
1360
  e.assertion.method,
@@ -1304,128 +1378,128 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1304
1378
  }),
1305
1379
  /* @__PURE__ */ K("div", {
1306
1380
  className: Q.buttonRow,
1307
- children: [
1308
- /* @__PURE__ */ G(C, {
1309
- disabled: !B,
1310
- onClick: () => _e(V.testCase, V.id, w),
1311
- children: "编辑用例"
1312
- }),
1313
- w && H?.id === w && /* @__PURE__ */ G(C, {
1314
- onClick: () => {
1315
- be(void 0), _("suites");
1316
- },
1317
- children: "返回原套件"
1318
- }),
1319
- /* @__PURE__ */ G(C, {
1381
+ children: [/* @__PURE__ */ G(C, {
1382
+ type: "primary",
1383
+ disabled: !B,
1384
+ onClick: () => _e(V.testCase, V.id, w),
1385
+ children: "编辑用例"
1386
+ }), /* @__PURE__ */ G($e, {
1387
+ label: "用例更多操作",
1388
+ disabled: !B,
1389
+ items: [{
1390
+ key: "delete",
1391
+ label: "删除用例",
1320
1392
  danger: !0,
1321
- disabled: !B,
1322
1393
  onClick: () => void R(async () => {
1323
1394
  if (d.suites.some((e) => e.caseIds.includes(V.id))) throw Error("请先从套件移除此用例");
1324
- window.confirm("删除该用例?") && (await Ae({
1395
+ window.confirm("删除该用例?") && (await Oe({
1325
1396
  ...d,
1326
1397
  cases: d.cases.filter(({ id: e }) => e !== V.id)
1327
1398
  }), ce(void 0));
1328
- }),
1329
- children: "删除用例"
1330
- })
1331
- ]
1399
+ })
1400
+ }]
1401
+ })]
1332
1402
  }),
1333
1403
  /* @__PURE__ */ K("section", {
1334
1404
  className: Q.stack,
1335
1405
  "aria-label": "所属套件",
1336
- children: [
1337
- /* @__PURE__ */ G("h5", { children: "所属套件" }),
1338
- /* @__PURE__ */ G("div", {
1339
- className: Q.buttonRow,
1340
- children: d.suites.filter((e) => e.caseIds.includes(V.id)).map((e) => /* @__PURE__ */ G(D, { children: e.name }, e.id))
1341
- }),
1342
- /* @__PURE__ */ K("div", {
1343
- className: Q.buttonRow,
1344
- children: [Fe.length > 0 && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(E, {
1406
+ children: [/* @__PURE__ */ G("h5", { children: "所属套件" }), /* @__PURE__ */ K("div", {
1407
+ className: Q.buttonRow,
1408
+ children: [
1409
+ d.suites.filter((e) => e.caseIds.includes(V.id)).map((e) => /* @__PURE__ */ G(C, {
1410
+ className: Q.entryLink,
1411
+ type: "link",
1412
+ size: "small",
1413
+ onClick: () => {
1414
+ N(e), _("suites");
1415
+ },
1416
+ children: e.name
1417
+ }, e.id)),
1418
+ Ne.length > 0 && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(E, {
1345
1419
  "aria-label": "选择套件",
1346
1420
  placeholder: "选择套件",
1347
- value: xe,
1348
- options: Fe.map(({ id: e, name: t }) => ({
1421
+ value: be,
1422
+ options: Ne.map(({ id: e, name: t }) => ({
1349
1423
  value: e,
1350
1424
  label: t
1351
1425
  })),
1426
+ loading: b,
1352
1427
  disabled: !B,
1353
- onChange: Se
1428
+ onChange: xe
1354
1429
  }), /* @__PURE__ */ G(C, {
1355
- disabled: !B || !xe,
1356
- onClick: () => void R(async () => {
1357
- let e = d.suites.find(({ id: e }) => e === xe);
1358
- e && !e.caseIds.includes(V.id) && (await Ae({
1359
- ...d,
1360
- suites: Me(d.suites, {
1361
- ...e,
1362
- caseIds: [...e.caseIds, V.id]
1363
- })
1364
- }), Se(void 0));
1365
- }),
1430
+ type: "text",
1431
+ disabled: !B || !be,
1432
+ onClick: () => {
1433
+ let e = Ne.find((e) => e.id === be);
1434
+ e && R(async () => {
1435
+ await Oe({
1436
+ ...d,
1437
+ suites: Ae(d.suites, {
1438
+ ...e,
1439
+ caseIds: [...e.caseIds, V.id]
1440
+ })
1441
+ }), xe(void 0);
1442
+ });
1443
+ },
1366
1444
  children: "添加到套件"
1367
- })] }), /* @__PURE__ */ G(C, {
1445
+ })] }),
1446
+ /* @__PURE__ */ G(C, {
1368
1447
  type: "link",
1369
1448
  disabled: !B,
1370
1449
  onClick: () => {
1371
- be(V.id), P({
1450
+ N({
1372
1451
  id: "",
1373
1452
  name: "",
1374
1453
  caseIds: [V.id]
1375
- }), O(!0), _("suites");
1454
+ }), me(!0), _("suites");
1376
1455
  },
1377
1456
  children: "新建套件"
1378
- })]
1379
- })
1380
- ]
1457
+ })
1458
+ ]
1459
+ })]
1381
1460
  })
1382
1461
  ]
1383
1462
  }) : /* @__PURE__ */ K("div", {
1384
1463
  className: Q.stack,
1385
- children: [
1386
- /* @__PURE__ */ G(C, {
1387
- type: "primary",
1388
- disabled: !B,
1389
- onClick: () => _e(p()),
1390
- children: "新建用例"
1391
- }),
1392
- !d.cases.length && /* @__PURE__ */ G(ue, { description: "暂无用例" }),
1393
- /* @__PURE__ */ G("ul", {
1394
- className: Q.resourceList,
1395
- children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ K("div", { children: [
1396
- /* @__PURE__ */ G(C, {
1397
- type: "link",
1398
- size: "small",
1399
- className: Q.entryLink,
1400
- onClick: () => {
1401
- le(void 0), ce(e), Se(void 0);
1402
- },
1464
+ children: [!d.cases.length && /* @__PURE__ */ G(de, { description: "暂无用例" }), /* @__PURE__ */ G("ul", {
1465
+ className: Q.resourceList,
1466
+ children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ K("div", { children: [
1467
+ /* @__PURE__ */ G(C, {
1468
+ type: "link",
1469
+ size: "small",
1470
+ className: Q.entryLink,
1471
+ onClick: () => {
1472
+ le(void 0), ce(e), xe(void 0);
1473
+ },
1474
+ children: /* @__PURE__ */ G("span", {
1475
+ className: Q.resourceName,
1476
+ title: t.name,
1403
1477
  children: t.name
1404
- }),
1405
- " ",
1406
- /* @__PURE__ */ K(D, { children: [t.steps.length, " 步"] }),
1407
- /* @__PURE__ */ G("br", {}),
1408
- /* @__PURE__ */ G("code", { children: n ?? t.path })
1409
- ] }) }, e))
1410
- })
1411
- ]
1478
+ })
1479
+ }),
1480
+ " ",
1481
+ /* @__PURE__ */ K(D, { children: [t.steps.length, " 步"] }),
1482
+ /* @__PURE__ */ G("br", {}),
1483
+ /* @__PURE__ */ G("code", { children: n ?? t.path })
1484
+ ] }) }, e))
1485
+ })]
1412
1486
  })
1413
1487
  },
1414
1488
  {
1415
1489
  key: "suites",
1416
1490
  label: "套件",
1417
- children: pe ? /* @__PURE__ */ K("section", {
1491
+ children: ue ? /* @__PURE__ */ K("section", {
1418
1492
  className: Q.stack,
1419
1493
  "aria-label": "套件编辑",
1420
1494
  children: [
1421
1495
  /* @__PURE__ */ G(C, {
1422
1496
  disabled: b,
1423
1497
  onClick: () => {
1424
- ze() && O(!1);
1498
+ Le() && me(!1);
1425
1499
  },
1426
1500
  children: "取消"
1427
1501
  }),
1428
- /* @__PURE__ */ G("h4", { children: N.id ? "编辑套件" : "新建套件" }),
1502
+ /* @__PURE__ */ G("h4", { children: M.id ? "编辑套件" : "新建套件" }),
1429
1503
  /* @__PURE__ */ K("div", {
1430
1504
  className: Q.stack,
1431
1505
  children: [
@@ -1436,43 +1510,43 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1436
1510
  /* @__PURE__ */ G(T, {
1437
1511
  id: "assistant-suite-name",
1438
1512
  "aria-required": "true",
1439
- "aria-invalid": !N.name.trim(),
1440
- "aria-describedby": N.name.trim() ? void 0 : "assistant-suite-name-error",
1513
+ "aria-invalid": !M.name.trim(),
1514
+ "aria-describedby": M.name.trim() ? void 0 : "assistant-suite-name-error",
1441
1515
  maxLength: 100,
1442
- value: N.name,
1443
- onChange: (e) => P({
1444
- ...N,
1516
+ value: M.name,
1517
+ onChange: (e) => N({
1518
+ ...M,
1445
1519
  name: e.target.value
1446
1520
  })
1447
1521
  }),
1448
- !N.name.trim() && /* @__PURE__ */ G("span", {
1522
+ !M.name.trim() && /* @__PURE__ */ G("span", {
1449
1523
  className: Q.hint,
1450
1524
  id: "assistant-suite-name-error",
1451
1525
  children: "请输入套件名称"
1452
1526
  })
1453
1527
  ]
1454
1528
  }),
1455
- /* @__PURE__ */ G(lt, {
1456
- options: Ne,
1457
- values: N.caseIds,
1458
- onChange: (e) => P({
1459
- ...N,
1529
+ /* @__PURE__ */ G(ft, {
1530
+ options: je,
1531
+ values: M.caseIds,
1532
+ onChange: (e) => N({
1533
+ ...M,
1460
1534
  caseIds: e
1461
1535
  })
1462
1536
  }),
1463
1537
  /* @__PURE__ */ G(C, {
1464
1538
  type: "primary",
1465
- disabled: !B || !N.name.trim() || !N.caseIds.length,
1539
+ disabled: !B || !M.name.trim() || !M.caseIds.length,
1466
1540
  onClick: () => void R(async () => {
1467
1541
  let e = {
1468
- ...N,
1469
- id: N.id || crypto.randomUUID(),
1470
- name: N.name.trim()
1542
+ ...M,
1543
+ id: M.id || crypto.randomUUID(),
1544
+ name: M.name.trim()
1471
1545
  };
1472
- await Ae({
1546
+ await Oe({
1473
1547
  ...d,
1474
- suites: Me(d.suites, e)
1475
- }), P(e), be(void 0), O(!1);
1548
+ suites: Ae(d.suites, e)
1549
+ }), N(e), me(!1);
1476
1550
  }),
1477
1551
  children: "保存套件"
1478
1552
  })
@@ -1484,86 +1558,87 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1484
1558
  /* @__PURE__ */ G("h4", { children: H.name }),
1485
1559
  /* @__PURE__ */ G("ol", {
1486
1560
  className: Q.list,
1487
- children: H.caseIds.map((e, t) => /* @__PURE__ */ G("li", { children: Ne.find(({ value: t }) => t === e)?.label ?? e }, t))
1561
+ children: H.caseIds.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(C, {
1562
+ type: "link",
1563
+ size: "small",
1564
+ className: Q.entryLink,
1565
+ onClick: () => {
1566
+ ce(e), le(H.id), xe(void 0), _("cases");
1567
+ },
1568
+ children: je.find(({ value: t }) => t === e)?.label ?? e
1569
+ }) }, t))
1488
1570
  }),
1489
1571
  /* @__PURE__ */ K("div", {
1490
1572
  className: Q.buttonRow,
1491
1573
  children: [
1492
1574
  /* @__PURE__ */ G(C, {
1575
+ type: "primary",
1493
1576
  disabled: !B,
1494
1577
  onClick: () => {
1495
- P(ye && !H.caseIds.includes(ye) ? {
1496
- ...H,
1497
- caseIds: [...H.caseIds, ye]
1498
- } : H), O(!0);
1578
+ N(H), me(!0);
1499
1579
  },
1500
1580
  children: "编辑套件"
1501
1581
  }),
1502
1582
  /* @__PURE__ */ G(C, {
1583
+ type: "text",
1503
1584
  disabled: !B,
1504
1585
  onClick: () => _e(p(), void 0, H.id),
1505
1586
  children: "新建用例"
1506
1587
  }),
1507
1588
  /* @__PURE__ */ G(C, {
1589
+ type: "text",
1508
1590
  disabled: !B,
1509
1591
  onClick: () => {
1510
- I({
1592
+ F({
1511
1593
  id: "",
1512
1594
  name: "",
1513
1595
  suiteIds: [H.id],
1514
1596
  repeat: 1
1515
- }), k(!0), _("plans");
1597
+ }), O(!0), _("plans");
1516
1598
  },
1517
1599
  children: "创建计划"
1518
1600
  }),
1519
- /* @__PURE__ */ G(C, {
1520
- danger: !0,
1601
+ /* @__PURE__ */ G($e, {
1602
+ label: "套件更多操作",
1521
1603
  disabled: !B,
1522
- onClick: () => void R(async () => {
1523
- if (d.plans.some((e) => e.suiteIds.includes(H.id))) throw Error("请先从计划移除此套件");
1524
- window.confirm("删除该套件?") && (await Ae({
1525
- ...d,
1526
- suites: d.suites.filter(({ id: e }) => e !== H.id)
1527
- }), P({
1528
- id: "",
1529
- name: "",
1530
- caseIds: []
1531
- }));
1532
- }),
1533
- children: "删除套件"
1604
+ items: [{
1605
+ key: "delete",
1606
+ label: "删除套件",
1607
+ danger: !0,
1608
+ onClick: () => void R(async () => {
1609
+ if (d.plans.some((e) => e.suiteIds.includes(H.id))) throw Error("请先从计划移除此套件");
1610
+ window.confirm("删除该套件?") && (await Oe({
1611
+ ...d,
1612
+ suites: d.suites.filter(({ id: e }) => e !== H.id)
1613
+ }), N({
1614
+ id: "",
1615
+ name: "",
1616
+ caseIds: []
1617
+ }));
1618
+ })
1619
+ }]
1534
1620
  })
1535
1621
  ]
1536
1622
  })
1537
1623
  ]
1538
1624
  }) : /* @__PURE__ */ K("div", {
1539
1625
  className: Q.stack,
1540
- children: [
1541
- /* @__PURE__ */ G(C, {
1542
- type: "primary",
1543
- disabled: !B,
1626
+ children: [!d.suites.length && /* @__PURE__ */ G(de, { description: "暂无套件" }), /* @__PURE__ */ G("ul", {
1627
+ className: Q.resourceList,
1628
+ children: d.suites.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1629
+ type: "link",
1630
+ size: "small",
1631
+ className: Q.entryLink,
1544
1632
  onClick: () => {
1545
- P({
1546
- id: "",
1547
- name: "",
1548
- caseIds: ye ? [ye] : []
1549
- }), O(!0);
1633
+ N(e);
1550
1634
  },
1551
- children: "新建套件"
1552
- }),
1553
- !d.suites.length && /* @__PURE__ */ G(ue, { description: "暂无套件" }),
1554
- /* @__PURE__ */ G("ul", {
1555
- className: Q.resourceList,
1556
- children: d.suites.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1557
- type: "link",
1558
- size: "small",
1559
- className: Q.entryLink,
1560
- onClick: () => {
1561
- P(e), be(void 0);
1562
- },
1635
+ children: /* @__PURE__ */ G("span", {
1636
+ className: Q.resourceName,
1637
+ title: e.name,
1563
1638
  children: e.name
1564
- }), /* @__PURE__ */ K("span", { children: [e.caseIds.length, " 个用例"] })] }, e.id))
1565
- })
1566
- ]
1639
+ })
1640
+ }), /* @__PURE__ */ K("span", { children: [e.caseIds.length, " 个用例"] })] }, e.id))
1641
+ })]
1567
1642
  })
1568
1643
  },
1569
1644
  {
@@ -1576,11 +1651,11 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1576
1651
  /* @__PURE__ */ G(C, {
1577
1652
  disabled: b,
1578
1653
  onClick: () => {
1579
- Be() && k(!1);
1654
+ Re() && O(!1);
1580
1655
  },
1581
1656
  children: "取消"
1582
1657
  }),
1583
- /* @__PURE__ */ G("h4", { children: F.id ? "编辑计划" : "新建计划" }),
1658
+ /* @__PURE__ */ G("h4", { children: P.id ? "编辑计划" : "新建计划" }),
1584
1659
  /* @__PURE__ */ K("div", {
1585
1660
  className: Q.stack,
1586
1661
  children: [
@@ -1591,16 +1666,16 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1591
1666
  /* @__PURE__ */ G(T, {
1592
1667
  id: "assistant-plan-name",
1593
1668
  "aria-required": "true",
1594
- "aria-invalid": !F.name.trim(),
1595
- "aria-describedby": F.name.trim() ? void 0 : "assistant-plan-name-error",
1669
+ "aria-invalid": !P.name.trim(),
1670
+ "aria-describedby": P.name.trim() ? void 0 : "assistant-plan-name-error",
1596
1671
  maxLength: 100,
1597
- value: F.name,
1598
- onChange: (e) => I({
1599
- ...F,
1672
+ value: P.name,
1673
+ onChange: (e) => F({
1674
+ ...P,
1600
1675
  name: e.target.value
1601
1676
  })
1602
1677
  }),
1603
- !F.name.trim() && /* @__PURE__ */ G("span", {
1678
+ !P.name.trim() && /* @__PURE__ */ G("span", {
1604
1679
  className: Q.hint,
1605
1680
  id: "assistant-plan-name-error",
1606
1681
  children: "请输入计划名称"
@@ -1610,39 +1685,39 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1610
1685
  /* @__PURE__ */ K("label", { children: [
1611
1686
  "重复轮数",
1612
1687
  " ",
1613
- /* @__PURE__ */ G(de, {
1688
+ /* @__PURE__ */ G(fe, {
1614
1689
  min: 1,
1615
1690
  max: 20,
1616
1691
  precision: 0,
1617
1692
  "aria-label": "重复轮数",
1618
- value: F.repeat,
1619
- onChange: (e) => I({
1620
- ...F,
1693
+ value: P.repeat,
1694
+ onChange: (e) => F({
1695
+ ...P,
1621
1696
  repeat: e ?? 1
1622
1697
  })
1623
1698
  })
1624
1699
  ] }),
1625
- /* @__PURE__ */ G(lt, {
1626
- options: Pe,
1627
- values: F.suiteIds,
1628
- onChange: (e) => I({
1629
- ...F,
1700
+ /* @__PURE__ */ G(ft, {
1701
+ options: Me,
1702
+ values: P.suiteIds,
1703
+ onChange: (e) => F({
1704
+ ...P,
1630
1705
  suiteIds: e
1631
1706
  })
1632
1707
  }),
1633
1708
  /* @__PURE__ */ G(C, {
1634
1709
  type: "primary",
1635
- disabled: !B || !F.name.trim() || !F.suiteIds.length,
1710
+ disabled: !B || !P.name.trim() || !P.suiteIds.length,
1636
1711
  onClick: () => void R(async () => {
1637
1712
  let e = {
1638
- ...F,
1639
- id: F.id || crypto.randomUUID(),
1640
- name: F.name.trim()
1713
+ ...P,
1714
+ id: P.id || crypto.randomUUID(),
1715
+ name: P.name.trim()
1641
1716
  };
1642
- await Ae({
1717
+ await Oe({
1643
1718
  ...d,
1644
- plans: Me(d.plans, e)
1645
- }), I(e), k(!1);
1719
+ plans: Ae(d.plans, e)
1720
+ }), F(e), O(!1);
1646
1721
  }),
1647
1722
  children: "保存计划"
1648
1723
  })
@@ -1659,31 +1734,45 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1659
1734
  ] }),
1660
1735
  /* @__PURE__ */ G("ol", {
1661
1736
  className: Q.list,
1662
- children: U.suiteIds.map((e, t) => /* @__PURE__ */ G("li", { children: Pe.find(({ value: t }) => t === e)?.label ?? e }, t))
1737
+ children: U.suiteIds.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(C, {
1738
+ type: "link",
1739
+ size: "small",
1740
+ className: Q.entryLink,
1741
+ onClick: () => {
1742
+ let t = d.suites.find((t) => t.id === e);
1743
+ t && (N(t), _("suites"));
1744
+ },
1745
+ children: Me.find(({ value: t }) => t === e)?.label ?? e
1746
+ }) }, t))
1663
1747
  }),
1664
1748
  /* @__PURE__ */ K("div", {
1665
1749
  className: Q.buttonRow,
1666
1750
  children: [/* @__PURE__ */ G(C, {
1751
+ type: "text",
1667
1752
  disabled: !B,
1668
1753
  onClick: () => {
1669
- I(U), k(!0);
1754
+ F(U), O(!0);
1670
1755
  },
1671
1756
  children: "编辑计划"
1672
- }), /* @__PURE__ */ G(C, {
1673
- danger: !0,
1757
+ }), /* @__PURE__ */ G($e, {
1758
+ label: "计划更多操作",
1674
1759
  disabled: !B,
1675
- onClick: () => void R(async () => {
1676
- window.confirm("删除该计划?") && (await Ae({
1677
- ...d,
1678
- plans: d.plans.filter(({ id: e }) => e !== U.id)
1679
- }), I({
1680
- id: "",
1681
- name: "",
1682
- suiteIds: [],
1683
- repeat: 1
1684
- }));
1685
- }),
1686
- children: "删除计划"
1760
+ items: [{
1761
+ key: "delete",
1762
+ label: "删除计划",
1763
+ danger: !0,
1764
+ onClick: () => void R(async () => {
1765
+ window.confirm("删除该计划?") && (await Oe({
1766
+ ...d,
1767
+ plans: d.plans.filter(({ id: e }) => e !== U.id)
1768
+ }), F({
1769
+ id: "",
1770
+ name: "",
1771
+ suiteIds: [],
1772
+ repeat: 1
1773
+ }));
1774
+ })
1775
+ }]
1687
1776
  })]
1688
1777
  }),
1689
1778
  /* @__PURE__ */ G("p", {
@@ -1695,38 +1784,32 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1695
1784
  disabled: !B,
1696
1785
  onClick: () => void R(async () => {
1697
1786
  let e = await L("/run", "POST", { planId: U.id });
1698
- h([e, ...m]), we(e.id), _("reports");
1787
+ h([e, ...m]), Ce(e.id), _("reports");
1699
1788
  }),
1700
1789
  children: "运行计划"
1701
1790
  })
1702
1791
  ]
1703
1792
  }) : /* @__PURE__ */ K("div", {
1704
1793
  className: Q.stack,
1705
- children: [
1706
- /* @__PURE__ */ G(C, {
1707
- type: "primary",
1708
- disabled: !B,
1709
- onClick: () => {
1710
- I({
1711
- id: "",
1712
- name: "",
1713
- suiteIds: [],
1714
- repeat: 1
1715
- }), k(!0);
1716
- },
1717
- children: "新建计划"
1718
- }),
1719
- !d.plans.length && /* @__PURE__ */ G(ue, { description: "暂无计划" }),
1720
- /* @__PURE__ */ G("ul", {
1721
- className: Q.resourceList,
1722
- children: d.plans.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G("strong", { children: e.name }), /* @__PURE__ */ K("span", { children: [
1723
- e.suiteIds.length,
1724
- " 个套件 · 重复 ",
1725
- e.repeat,
1726
- " 轮"
1727
- ] })] }, e.id))
1728
- })
1729
- ]
1794
+ children: [!d.plans.length && /* @__PURE__ */ G(de, { description: "暂无计划" }), /* @__PURE__ */ G("ul", {
1795
+ className: Q.resourceList,
1796
+ children: d.plans.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1797
+ type: "link",
1798
+ size: "small",
1799
+ className: Q.entryLink,
1800
+ onClick: () => F(e),
1801
+ children: /* @__PURE__ */ G("span", {
1802
+ className: Q.resourceName,
1803
+ title: e.name,
1804
+ children: e.name
1805
+ })
1806
+ }), /* @__PURE__ */ K("span", { children: [
1807
+ e.suiteIds.length,
1808
+ " 个套件 · 重复 ",
1809
+ e.repeat,
1810
+ " 轮"
1811
+ ] })] }, e.id))
1812
+ })]
1730
1813
  })
1731
1814
  },
1732
1815
  {
@@ -1738,13 +1821,16 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1738
1821
  /* @__PURE__ */ K("div", {
1739
1822
  className: Q.buttonRow,
1740
1823
  children: [/* @__PURE__ */ G(C, {
1824
+ type: "text",
1741
1825
  disabled: b,
1742
1826
  onClick: () => void R(async () => {
1743
- h(await L("/runs")), De && Ee(await L(`/runs/${De}`));
1827
+ h(await L("/runs")), I && Te(await L(`/runs/${I}`));
1744
1828
  }),
1745
1829
  children: "刷新报告"
1746
1830
  }), /* @__PURE__ */ G(C, {
1747
- disabled: b || !Oe,
1831
+ type: "primary",
1832
+ danger: !0,
1833
+ disabled: b || !Ee,
1748
1834
  onClick: () => void R(async () => {
1749
1835
  let e = await L("/stop", "POST", {});
1750
1836
  h(m.map((t) => t.id === e.id ? e : t));
@@ -1752,26 +1838,27 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1752
1838
  children: "停止计划"
1753
1839
  })]
1754
1840
  }),
1755
- !m.length && /* @__PURE__ */ G(ue, { description: "暂无运行报告" }),
1841
+ !m.length && /* @__PURE__ */ G(de, { description: "暂无运行报告" }),
1756
1842
  m.length > 0 && /* @__PURE__ */ G(E, {
1757
1843
  "aria-label": "运行报告",
1758
- value: Ce ?? m[0].id,
1759
- onChange: we,
1844
+ value: Se ?? m[0].id,
1845
+ onChange: Ce,
1760
1846
  options: m.map((e) => ({
1761
1847
  value: e.id,
1762
- label: `${e.planName} · ${st[e.state] ?? e.state} · ${e.id.slice(0, 8)}`
1848
+ label: `${e.planName} · ${ut[e.state] ?? e.state} · ${e.id.slice(0, 8)}`
1763
1849
  }))
1764
1850
  }),
1765
- Te && Te.id === De && /* @__PURE__ */ G(ct, {
1766
- run: Te,
1851
+ we && we.id === I && /* @__PURE__ */ G(dt, {
1852
+ run: we,
1767
1853
  base: e,
1768
- onExport: () => je(Te, `研发小蜜报告-${Te.id}.json`)
1854
+ onExport: () => ke(we, `研发小蜜报告-${we.id}.json`)
1769
1855
  })
1770
1856
  ]
1771
1857
  })
1772
1858
  }
1773
1859
  ]
1774
- })] }) : /* @__PURE__ */ G(C, {
1860
+ }) }) : /* @__PURE__ */ G(C, {
1861
+ className: Q.fitButton,
1775
1862
  loading: b,
1776
1863
  onClick: z,
1777
1864
  children: b ? "正在读取测试库" : "重试读取测试库"
@@ -1780,8 +1867,8 @@ function ut({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1780
1867
  });
1781
1868
  }
1782
1869
  // src/pages/assistant/components/TestLibraryPanel/index.tsx
1783
- function dt({ bridgeUrl: e, exploration: t, ...n }) {
1784
- let r = `${e.replace(/\/$/, "")}/library`, i = ot(r), [a, o] = x(), [s, c] = x(), [l, u] = x(), [d, f] = x("libraries"), [p, m] = x(!1), [h, g] = x(""), _ = async (e) => {
1870
+ 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) => {
1785
1872
  let t = await i("/collections", "GET", void 0, e);
1786
1873
  e?.aborted || o(t.collections);
1787
1874
  }, v = async (e, t) => {
@@ -1814,7 +1901,15 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
1814
1901
  gap: 16
1815
1902
  } },
1816
1903
  children: [
1817
- /* @__PURE__ */ G("h3", { children: "测试库" }),
1904
+ /* @__PURE__ */ K("header", {
1905
+ className: Q.header,
1906
+ children: [/* @__PURE__ */ G("h3", { children: "测试库" }), a && !l && /* @__PURE__ */ G(C, {
1907
+ type: "primary",
1908
+ disabled: p || n.disabled,
1909
+ onClick: () => u({ name: "" }),
1910
+ children: "新建测试库"
1911
+ })]
1912
+ }),
1818
1913
  h && /* @__PURE__ */ G(S, {
1819
1914
  type: "error",
1820
1915
  title: h
@@ -1869,34 +1964,30 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
1869
1964
  })]
1870
1965
  })
1871
1966
  ]
1872
- }) : /* @__PURE__ */ K(W, { children: [
1873
- /* @__PURE__ */ G(C, {
1874
- type: "primary",
1875
- disabled: p || n.disabled,
1876
- onClick: () => u({ name: "" }),
1877
- children: "新建测试库"
1878
- }),
1879
- !a.length && /* @__PURE__ */ G(ue, { description: "暂无测试库" }),
1880
- /* @__PURE__ */ G("ul", {
1881
- className: Q.resourceList,
1882
- children: a.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1883
- type: "link",
1884
- size: "small",
1885
- className: Q.entryLink,
1886
- disabled: p || n.recording,
1887
- onClick: () => c(e),
1967
+ }) : /* @__PURE__ */ K(W, { children: [!a.length && /* @__PURE__ */ G(de, { description: "暂无测试库" }), /* @__PURE__ */ G("ul", {
1968
+ className: Q.resourceList,
1969
+ children: a.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1970
+ type: "link",
1971
+ size: "small",
1972
+ className: Q.entryLink,
1973
+ title: e.name,
1974
+ disabled: p || n.recording,
1975
+ onClick: () => c(e),
1976
+ children: /* @__PURE__ */ G("span", {
1977
+ className: Q.resourceName,
1888
1978
  children: e.name
1889
- }), /* @__PURE__ */ K("span", { children: [
1890
- e.caseCount,
1891
- " 个用例 · ",
1892
- e.suiteCount,
1893
- " 个套件 ·",
1894
- " ",
1895
- e.planCount,
1896
- " 个计划"
1897
- ] })] }, e.id))
1898
- })
1899
- ] }) : /* @__PURE__ */ G(C, {
1979
+ })
1980
+ }), /* @__PURE__ */ K("span", { children: [
1981
+ e.caseCount,
1982
+ " 个用例 · ",
1983
+ e.suiteCount,
1984
+ " 个套件 ·",
1985
+ " ",
1986
+ e.planCount,
1987
+ " 个计划"
1988
+ ] })] }, e.id))
1989
+ })] }) : /* @__PURE__ */ G(C, {
1990
+ className: Q.fitButton,
1900
1991
  loading: p,
1901
1992
  onClick: () => void v(_),
1902
1993
  children: p ? "正在读取测试库列表" : "重试读取测试库列表"
@@ -1905,7 +1996,7 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
1905
1996
  });
1906
1997
  return /* @__PURE__ */ K(W, { children: [s && /* @__PURE__ */ G("div", {
1907
1998
  hidden: !!l,
1908
- children: /* @__PURE__ */ ee(ut, {
1999
+ children: /* @__PURE__ */ ee(pt, {
1909
2000
  ...n,
1910
2001
  key: s.id,
1911
2002
  base: `${r}/collections/${encodeURIComponent(s.id)}`,
@@ -1922,7 +2013,7 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
1922
2013
  })
1923
2014
  }), /* @__PURE__ */ G("div", {
1924
2015
  hidden: !!s && !l,
1925
- children: /* @__PURE__ */ G(fe, {
2016
+ children: /* @__PURE__ */ G(pe, {
1926
2017
  activeKey: d,
1927
2018
  onChange: b,
1928
2019
  items: [{
@@ -1939,22 +2030,22 @@ function dt({ bridgeUrl: e, exploration: t, ...n }) {
1939
2030
  })] });
1940
2031
  }
1941
2032
  // src/pages/assistant/components/AutomationPanel/index.tsx
1942
- function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
1943
- let i = ie(s.subscribe, s.getState), [a, o] = x(""), [c, l] = x(null), u = re(null), d = (e, t) => {
1944
- l({
2033
+ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2034
+ let i = ie(s.subscribe, s.getState), a = re(null), [o, c] = x(""), [l, u] = x(null), d = re(null), f = (e, t) => {
2035
+ u({
1945
2036
  position: e,
1946
2037
  edit: t
1947
- }), requestAnimationFrame(() => u.current?.scrollIntoView({
2038
+ }), requestAnimationFrame(() => d.current?.scrollIntoView({
1948
2039
  behavior: "smooth",
1949
2040
  block: "nearest"
1950
2041
  }));
1951
- }, [f, p] = x(!1), m = async (e) => {
2042
+ }, [p, m] = x(!1), h = async (e) => {
1952
2043
  try {
1953
- o(""), await e();
2044
+ c(""), await e();
1954
2045
  } catch (e) {
1955
- o(e instanceof Error ? e.message : "操作失败");
2046
+ c(e instanceof Error ? e.message : "操作失败");
1956
2047
  }
1957
- }, h = (e, t) => s.edit({
2048
+ }, g = (e, t) => s.edit({
1958
2049
  ...i.draft,
1959
2050
  steps: i.draft.steps.map((n, r) => r === e ? {
1960
2051
  ...n,
@@ -1965,30 +2056,30 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
1965
2056
  return /* @__PURE__ */ K("div", {
1966
2057
  className: J.section,
1967
2058
  "data-assistant-part": "section automation",
1968
- children: [a && /* @__PURE__ */ G(S, {
2059
+ children: [o && /* @__PURE__ */ G(S, {
1969
2060
  closable: !0,
1970
- onClose: () => o(""),
2061
+ onClose: () => c(""),
1971
2062
  type: "error",
1972
- title: a
2063
+ title: o
1973
2064
  }), /* @__PURE__ */ G("div", {
1974
2065
  className: J.automationLayout,
1975
2066
  "data-assistant-part": "automation-layout",
1976
- children: /* @__PURE__ */ G(dt, {
2067
+ children: /* @__PURE__ */ G(mt, {
1977
2068
  bridgeUrl: t,
1978
2069
  draft: i.draft,
1979
- disabled: f || i.recording,
2070
+ disabled: p || i.recording,
1980
2071
  recording: i.recording,
1981
2072
  incomingDraft: n,
1982
2073
  onConsumeDraft: r,
1983
2074
  onEdit: (e) => {
1984
- s.loadDraft(e), l(null);
2075
+ s.loadDraft(e), u(null);
1985
2076
  },
1986
- exploration: /* @__PURE__ */ G(at, {
2077
+ exploration: /* @__PURE__ */ G(ct, {
1987
2078
  bridgeUrl: t,
1988
2079
  disabled: i.recording,
1989
- onRunningChange: p
2080
+ onRunningChange: m
1990
2081
  }),
1991
- renderEditor: ({ save: t, busy: n, dirty: r }) => /* @__PURE__ */ K(W, { children: [
2082
+ renderEditor: ({ save: t, busy: n, dirty: r, cancel: o }) => /* @__PURE__ */ K(W, { children: [
1992
2083
  /* @__PURE__ */ K("div", {
1993
2084
  className: J.field,
1994
2085
  "data-assistant-part": "field",
@@ -2002,7 +2093,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2002
2093
  "aria-required": "true",
2003
2094
  "aria-invalid": !i.draft.name.trim(),
2004
2095
  "aria-describedby": i.draft.name.trim() ? void 0 : "assistant-case-name-error",
2005
- prefix: /* @__PURE__ */ G(I, {}),
2096
+ prefix: /* @__PURE__ */ G(Te, {}),
2006
2097
  "aria-label": "测试用例名称",
2007
2098
  value: i.draft.name,
2008
2099
  maxLength: 100,
@@ -2050,7 +2141,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2050
2141
  /* @__PURE__ */ K("div", {
2051
2142
  className: J.cardHeading,
2052
2143
  "data-assistant-part": "card-heading",
2053
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(U, {}), "录制操作"] }), /* @__PURE__ */ K(D, {
2144
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Le, {}), "录制操作"] }), /* @__PURE__ */ K(D, {
2054
2145
  color: i.recording ? "red" : "default",
2055
2146
  children: [
2056
2147
  i.recording ? "录制中" : "待录制",
@@ -2064,16 +2155,18 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2064
2155
  className: J.buttonRow,
2065
2156
  "data-assistant-part": "button-row",
2066
2157
  children: i.recording ? /* @__PURE__ */ G(C, {
2158
+ type: "primary",
2159
+ danger: !0,
2067
2160
  icon: /* @__PURE__ */ G(Fe, {}),
2068
2161
  disabled: !i.recording,
2069
2162
  onClick: () => s.stop(),
2070
2163
  children: "结束录制"
2071
2164
  }) : /* @__PURE__ */ G(C, {
2072
- icon: /* @__PURE__ */ G(U, {}),
2165
+ icon: /* @__PURE__ */ G(Le, {}),
2073
2166
  type: "primary",
2074
2167
  disabled: n || i.recording,
2075
- onClick: () => void m(() => {
2076
- (!i.draft.steps.length || window.confirm("新录制会替换当前用例的步骤。继续?")) && (l(null), s.start(), s.edit({
2168
+ onClick: () => void h(() => {
2169
+ (!i.draft.steps.length || window.confirm("新录制会替换当前用例的步骤。继续?")) && (u(null), s.start(), s.edit({
2077
2170
  ...s.getState().draft,
2078
2171
  name: i.draft.name
2079
2172
  }), e());
@@ -2101,7 +2194,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2101
2194
  },
2102
2195
  items: [{
2103
2196
  key: "details",
2104
- label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(Oe, {}), "录制范围"] }),
2197
+ label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(z, {}), "录制范围"] }),
2105
2198
  children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", {
2106
2199
  className: J.hint,
2107
2200
  "data-assistant-part": "hint",
@@ -2129,12 +2222,12 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2129
2222
  /* @__PURE__ */ K("div", {
2130
2223
  className: J.cardHeading,
2131
2224
  "data-assistant-part": "card-heading",
2132
- children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(be, {}), "编辑用例"] }), /* @__PURE__ */ K("span", { children: [i.draft.steps.length, " 个步骤"] })]
2225
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(P, {}), "编辑用例"] }), /* @__PURE__ */ K("span", { children: [i.draft.steps.length, " 个步骤"] })]
2133
2226
  }),
2134
2227
  !i.draft.steps.length && /* @__PURE__ */ K("div", {
2135
2228
  className: J.emptySteps,
2136
2229
  "data-assistant-part": "empty-steps",
2137
- children: [/* @__PURE__ */ G(I, {}), /* @__PURE__ */ G("span", { children: "暂无操作步骤" })]
2230
+ children: [/* @__PURE__ */ G(Te, {}), /* @__PURE__ */ G("span", { children: "暂无操作步骤" })]
2138
2231
  }),
2139
2232
  /* @__PURE__ */ G("ol", {
2140
2233
  className: J.caseSteps,
@@ -2151,7 +2244,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2151
2244
  }),
2152
2245
  /* @__PURE__ */ G(D, {
2153
2246
  color: e.kind === "unsupported" ? "red" : "blue",
2154
- children: Ye[e.kind]
2247
+ children: Ze[e.kind]
2155
2248
  }),
2156
2249
  /* @__PURE__ */ G("strong", { children: e.assertion?.name ?? e.target?.label ?? e.value }),
2157
2250
  e.sourceEventId && /* @__PURE__ */ K(D, { children: ["源事件 #", e.sourceEventId] }),
@@ -2192,7 +2285,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2192
2285
  ] })
2193
2286
  ]
2194
2287
  }),
2195
- e.kind === "unsupported" && /* @__PURE__ */ G($e, {
2288
+ e.kind === "unsupported" && /* @__PURE__ */ G(nt, {
2196
2289
  step: e,
2197
2290
  disabled: i.recording || n,
2198
2291
  onApply: (e) => s.edit({
@@ -2205,7 +2298,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2205
2298
  value: e.value,
2206
2299
  maxLength: 2e3,
2207
2300
  disabled: i.recording || n,
2208
- onChange: (e) => h(t, { value: e.target.value })
2301
+ onChange: (e) => g(t, { value: e.target.value })
2209
2302
  }),
2210
2303
  e.kind === "check" && /* @__PURE__ */ G("span", { children: e.checked ? "选中" : "取消选中" }),
2211
2304
  e.target && /* @__PURE__ */ G(w, {
@@ -2231,17 +2324,19 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2231
2324
  children: [
2232
2325
  /* @__PURE__ */ G(C, {
2233
2326
  size: "small",
2327
+ type: "text",
2234
2328
  icon: /* @__PURE__ */ G(j, {}),
2235
2329
  disabled: i.recording || n || !e.assertion && i.draft.steps.length >= 100,
2236
- onClick: () => d(t + 1, e.assertion ? t : void 0),
2330
+ onClick: () => f(t + 1, e.assertion ? t : void 0),
2237
2331
  children: e.assertion ? "编辑断言" : "在此步后添加断言"
2238
2332
  }),
2239
2333
  /* @__PURE__ */ K(C, {
2240
- icon: /* @__PURE__ */ G(Me, {}),
2334
+ type: "text",
2335
+ icon: /* @__PURE__ */ G(V, {}),
2241
2336
  size: "small",
2242
2337
  disabled: i.recording || n || i.draft.steps.length >= 100,
2243
2338
  onClick: () => {
2244
- l(null), s.edit({
2339
+ u(null), s.edit({
2245
2340
  ...i.draft,
2246
2341
  steps: [
2247
2342
  ...i.draft.steps.slice(0, t),
@@ -2260,12 +2355,13 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2260
2355
  ]
2261
2356
  }),
2262
2357
  /* @__PURE__ */ K(C, {
2263
- icon: /* @__PURE__ */ G(N, {}),
2358
+ type: "text",
2359
+ icon: /* @__PURE__ */ G(ye, {}),
2264
2360
  danger: !0,
2265
2361
  size: "small",
2266
2362
  disabled: i.recording || n,
2267
2363
  onClick: () => {
2268
- l(null), s.edit({
2364
+ u(null), s.edit({
2269
2365
  ...i.draft,
2270
2366
  steps: i.draft.steps.filter((e, n) => n !== t)
2271
2367
  });
@@ -2306,7 +2402,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2306
2402
  }]
2307
2403
  }),
2308
2404
  /* @__PURE__ */ K("div", {
2309
- ref: u,
2405
+ ref: d,
2310
2406
  className: J.assertionArea,
2311
2407
  "data-assistant-part": "assertion-area",
2312
2408
  children: [/* @__PURE__ */ K("div", {
@@ -2317,32 +2413,33 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2317
2413
  " ",
2318
2414
  "条"
2319
2415
  ] })]
2320
- }), c ? /* @__PURE__ */ G(Ze, {
2321
- initial: c.edit === void 0 ? void 0 : i.draft.steps[c.edit]?.assertion,
2416
+ }), l ? /* @__PURE__ */ G(et, {
2417
+ initial: l.edit === void 0 ? void 0 : i.draft.steps[l.edit]?.assertion,
2322
2418
  steps: i.draft.steps,
2323
- position: c.position,
2419
+ position: l.position,
2324
2420
  disabled: n || i.recording,
2325
- onCancel: () => l(null),
2421
+ onCancel: () => u(null),
2326
2422
  onSave: (e, t) => {
2327
2423
  let n = [...i.draft.steps];
2328
- c.edit === void 0 ? n.splice(t, 0, {
2424
+ l.edit === void 0 ? n.splice(t, 0, {
2329
2425
  kind: "assert",
2330
2426
  assertion: e,
2331
2427
  supplemented: !0
2332
- }) : n[c.edit] = {
2333
- ...n[c.edit],
2428
+ }) : n[l.edit] = {
2429
+ ...n[l.edit],
2334
2430
  kind: "assert",
2335
2431
  assertion: e,
2336
2432
  supplemented: !0
2337
2433
  }, s.edit((0, Y.parseCase)({
2338
2434
  ...i.draft,
2339
2435
  steps: n
2340
- })), l(null);
2436
+ })), u(null);
2341
2437
  }
2342
- }, `${c.position}-${c.edit ?? "new"}`) : /* @__PURE__ */ G(C, {
2343
- icon: /* @__PURE__ */ G(Me, {}),
2438
+ }, `${l.position}-${l.edit ?? "new"}`) : /* @__PURE__ */ G(C, {
2439
+ type: "text",
2440
+ icon: /* @__PURE__ */ G(V, {}),
2344
2441
  disabled: n || i.recording || i.draft.steps.length >= 100,
2345
- onClick: () => d(i.draft.steps.length),
2442
+ onClick: () => f(i.draft.steps.length),
2346
2443
  children: "添加断言"
2347
2444
  })]
2348
2445
  }),
@@ -2351,35 +2448,46 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2351
2448
  "data-assistant-part": "button-row card-actions",
2352
2449
  children: [
2353
2450
  /* @__PURE__ */ G(C, {
2354
- icon: /* @__PURE__ */ G(Ne, {}),
2451
+ icon: /* @__PURE__ */ G(H, {}),
2452
+ type: "primary",
2355
2453
  disabled: i.recording || n || !i.draft.name.trim() || !i.draft.steps.length,
2356
- onClick: () => void m(() => t((0, Y.parseCase)(i.draft))),
2454
+ onClick: () => void h(() => t((0, Y.parseCase)(i.draft))),
2357
2455
  children: "保存用例"
2358
2456
  }),
2359
2457
  /* @__PURE__ */ G(C, {
2360
- icon: /* @__PURE__ */ G(ye, {}),
2361
- disabled: !i.draft.steps.length || i.recording,
2362
- onClick: () => void m(() => {
2363
- let e = (0, Y.parseCase)(i.draft), t = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), n = document.createElement("a");
2364
- n.href = t, n.download = "页面录制用例.json", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 3e4);
2365
- }),
2366
- children: "导出用例 JSON"
2458
+ disabled: n || i.recording,
2459
+ onClick: o,
2460
+ children: "取消"
2461
+ }),
2462
+ /* @__PURE__ */ G($e, {
2463
+ label: "用例文件操作",
2464
+ disabled: n || i.recording,
2465
+ items: [{
2466
+ key: "import",
2467
+ label: "导入用例",
2468
+ onClick: () => a.current?.click()
2469
+ }, {
2470
+ key: "export",
2471
+ label: "导出用例 JSON",
2472
+ disabled: !i.draft.steps.length,
2473
+ 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);
2476
+ })
2477
+ }]
2367
2478
  }),
2368
- /* @__PURE__ */ G(me, {
2369
- className: J.upload,
2370
- "data-assistant-part": "upload",
2479
+ /* @__PURE__ */ G("input", {
2480
+ hidden: !0,
2481
+ type: "file",
2482
+ ref: a,
2371
2483
  accept: ".json,application/json",
2372
- showUploadList: !1,
2373
- disabled: i.recording || n,
2374
- beforeUpload: async (e) => (await m(async () => {
2375
- if (e.size > 524288) throw Error("用例不能超过 512 KB");
2376
- (!r || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, Y.parseCase)(JSON.parse(await e.text()))), l(null));
2377
- }), me.LIST_IGNORE),
2378
- children: /* @__PURE__ */ G(C, {
2379
- icon: /* @__PURE__ */ G(H, {}),
2380
- disabled: i.recording || n,
2381
- children: "导入用例"
2382
- })
2484
+ onChange: (e) => {
2485
+ let t = e.target.files?.[0];
2486
+ e.target.value = "", !t || i.recording || n || h(async () => {
2487
+ if (t.size > 524288) throw Error("用例不能超过 512 KB");
2488
+ (!r || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, Y.parseCase)(JSON.parse(await t.text()))), u(null));
2489
+ });
2490
+ }
2383
2491
  })
2384
2492
  ]
2385
2493
  })
@@ -2390,7 +2498,7 @@ function ft({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2390
2498
  })]
2391
2499
  });
2392
2500
  }
2393
- var pt = {
2501
+ var gt = {
2394
2502
  json: "_json_62man_1 _json_13kbl_377",
2395
2503
  eventMeta: "_eventMeta_62man_4 _eventMeta_13kbl_629",
2396
2504
  hint: "_hint_62man_7 _hint_13kbl_515",
@@ -2403,7 +2511,7 @@ var pt = {
2403
2511
  error: "_error_62man_58"
2404
2512
  };
2405
2513
  // src/utils/automation/timeline-case.ts
2406
- function mt(t) {
2514
+ function _t(t) {
2407
2515
  let n = /* @__PURE__ */ new Set();
2408
2516
  return t.map((t) => {
2409
2517
  if (!Number.isSafeInteger(t.id) || t.id <= 0 || n.has(t.id)) throw Error("事件编号重复或无效,无法选段");
@@ -2417,12 +2525,12 @@ function mt(t) {
2417
2525
  };
2418
2526
  }).sort((e, t) => e.time - t.time || e.id - t.id);
2419
2527
  }
2420
- function ht(e, t, n) {
2528
+ function vt(e, t, n) {
2421
2529
  let r = e.findIndex((e) => e.id === t), i = e.findIndex((e) => e.id === n);
2422
2530
  return r < 0 || i < r ? [] : e.slice(r, i + 1);
2423
2531
  }
2424
- function gt(e, t, n) {
2425
- let r = ht(e, t, n);
2532
+ function yt(e, t, n) {
2533
+ let r = vt(e, t, n);
2426
2534
  if (!r.length) throw Error("请选择按时间先后排列的起点和终点");
2427
2535
  let i = r.filter((e) => [
2428
2536
  "route",
@@ -2453,7 +2561,7 @@ function gt(e, t, n) {
2453
2561
  });
2454
2562
  }
2455
2563
  // src/pages/assistant/components/TimelinePanel/index.tsx
2456
- var _t = {
2564
+ var bt = {
2457
2565
  route: "页面",
2458
2566
  click: "点击",
2459
2567
  change: "字段",
@@ -2461,48 +2569,48 @@ var _t = {
2461
2569
  error: "异常",
2462
2570
  performance: "性能"
2463
2571
  };
2464
- function vt({ events: e, onDraft: t }) {
2465
- let n = ie(s.subscribe, s.getState), [r, i] = x(null), [a, o] = x(), [c, l] = x(), [u, d] = x("all"), [f, p] = x(""), [m, h] = x(""), g = r ? ht(r, a, c) : [], _ = new Set(g.map((e) => e.id)), ee = r ?? e.filter((e) => (u === "all" || e.kind === u) && (e.title + e.page).includes(f));
2572
+ function xt({ events: e, onDraft: t }) {
2573
+ let n = ie(s.subscribe, s.getState), [r, i] = x(null), [a, o] = x(), [c, l] = x(), [u, d] = x("all"), [f, p] = x(""), [m, h] = x(""), g = r ? vt(r, a, c) : [], _ = new Set(g.map((e) => e.id)), ee = r ?? e.filter((e) => (u === "all" || e.kind === u) && (e.title + e.page).includes(f));
2466
2574
  return /* @__PURE__ */ K("div", {
2467
- className: pt.section,
2575
+ className: gt.section,
2468
2576
  "data-assistant-part": "section",
2469
2577
  children: [
2470
2578
  /* @__PURE__ */ K("div", {
2471
- className: pt.sectionHeading,
2579
+ className: gt.sectionHeading,
2472
2580
  "data-assistant-part": "section-heading",
2473
2581
  children: [/* @__PURE__ */ G("span", {
2474
- className: pt.headingIcon,
2582
+ className: gt.headingIcon,
2475
2583
  "data-assistant-part": "heading-icon",
2476
2584
  children: /* @__PURE__ */ G(De, {})
2477
2585
  }), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "操作时间线" }) })]
2478
2586
  }),
2479
2587
  t && /* @__PURE__ */ K("div", {
2480
- className: pt.buttonRow,
2588
+ className: gt.buttonRow,
2481
2589
  "data-assistant-part": "button-row",
2482
2590
  children: [!r && /* @__PURE__ */ G(C, {
2483
- icon: /* @__PURE__ */ G(Pe, {}),
2591
+ icon: /* @__PURE__ */ G(U, {}),
2484
2592
  disabled: n.recording || !e.length,
2485
2593
  onClick: () => {
2486
2594
  try {
2487
- i(mt(e)), o(void 0), l(void 0), h("");
2595
+ i(_t(e)), o(void 0), l(void 0), h("");
2488
2596
  } catch (e) {
2489
2597
  h(e.message);
2490
2598
  }
2491
2599
  },
2492
2600
  children: "开始选段"
2493
2601
  }), r && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
2494
- icon: /* @__PURE__ */ G(ge, {}),
2602
+ icon: /* @__PURE__ */ G(ve, {}),
2495
2603
  onClick: () => {
2496
2604
  i(null), o(void 0), l(void 0), h("");
2497
2605
  },
2498
2606
  children: "退出选段"
2499
2607
  }), /* @__PURE__ */ G(C, {
2500
- icon: /* @__PURE__ */ G(F, {}),
2608
+ icon: /* @__PURE__ */ G(we, {}),
2501
2609
  type: "primary",
2502
2610
  disabled: !g.length || n.recording,
2503
2611
  onClick: () => {
2504
2612
  try {
2505
- t(gt(r, a, c));
2613
+ t(yt(r, a, c));
2506
2614
  } catch (e) {
2507
2615
  h(e.message);
2508
2616
  }
@@ -2511,7 +2619,7 @@ function vt({ events: e, onDraft: t }) {
2511
2619
  })] })]
2512
2620
  }),
2513
2621
  r && /* @__PURE__ */ K("p", {
2514
- className: pt.hint,
2622
+ className: gt.hint,
2515
2623
  "aria-live": "polite",
2516
2624
  children: [
2517
2625
  a ? "#" + a : "选起点",
@@ -2528,7 +2636,7 @@ function vt({ events: e, onDraft: t }) {
2528
2636
  title: m
2529
2637
  }),
2530
2638
  !r && /* @__PURE__ */ K("div", {
2531
- className: pt.filters,
2639
+ className: gt.filters,
2532
2640
  "data-assistant-part": "filters",
2533
2641
  children: [/* @__PURE__ */ G(E, {
2534
2642
  "aria-label": "事件类型",
@@ -2537,12 +2645,12 @@ function vt({ events: e, onDraft: t }) {
2537
2645
  options: [{
2538
2646
  value: "all",
2539
2647
  label: "全部事件"
2540
- }, ...Object.entries(_t).map(([e, t]) => ({
2648
+ }, ...Object.entries(bt).map(([e, t]) => ({
2541
2649
  value: e,
2542
2650
  label: t
2543
2651
  }))]
2544
2652
  }), /* @__PURE__ */ G(T, {
2545
- prefix: /* @__PURE__ */ G(V, {}),
2653
+ prefix: /* @__PURE__ */ G(Pe, {}),
2546
2654
  "aria-label": "搜索时间线",
2547
2655
  placeholder: "搜索操作或页面",
2548
2656
  value: f,
@@ -2550,20 +2658,20 @@ function vt({ events: e, onDraft: t }) {
2550
2658
  allowClear: !0
2551
2659
  })]
2552
2660
  }),
2553
- !ee.length && /* @__PURE__ */ G(ue, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2661
+ !ee.length && /* @__PURE__ */ G(de, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2554
2662
  /* @__PURE__ */ G("ol", {
2555
- className: pt.timeline,
2663
+ className: gt.timeline,
2556
2664
  "data-assistant-part": "timeline",
2557
2665
  children: ee.slice().sort((e, t) => t.time - e.time || t.id - e.id).map((e) => /* @__PURE__ */ K("li", {
2558
- className: e.kind === "error" ? pt.error : "",
2666
+ className: e.kind === "error" ? gt.error : "",
2559
2667
  children: [
2560
2668
  /* @__PURE__ */ K("div", {
2561
- className: pt.eventMeta,
2669
+ className: gt.eventMeta,
2562
2670
  "data-assistant-part": "event-meta",
2563
2671
  children: [
2564
2672
  /* @__PURE__ */ G(D, {
2565
2673
  color: e.kind === "error" ? "red" : "blue",
2566
- children: _t[e.kind]
2674
+ children: bt[e.kind]
2567
2675
  }),
2568
2676
  /* @__PURE__ */ G("time", { children: new Date(e.time).toLocaleTimeString("zh-CN", { hour12: !1 }) }),
2569
2677
  /* @__PURE__ */ K("small", { children: ["#", e.id] }),
@@ -2575,10 +2683,10 @@ function vt({ events: e, onDraft: t }) {
2575
2683
  }),
2576
2684
  /* @__PURE__ */ G("strong", { children: e.title }),
2577
2685
  r && /* @__PURE__ */ K("div", {
2578
- className: pt.buttonRow,
2686
+ className: gt.buttonRow,
2579
2687
  "data-assistant-part": "button-row",
2580
2688
  children: [/* @__PURE__ */ G(C, {
2581
- icon: /* @__PURE__ */ G(Ce, {}),
2689
+ icon: /* @__PURE__ */ G(I, {}),
2582
2690
  size: "small",
2583
2691
  "aria-label": `从事件 ${e.id} 开始`,
2584
2692
  "aria-pressed": a === e.id,
@@ -2611,7 +2719,7 @@ function vt({ events: e, onDraft: t }) {
2611
2719
  key: "details",
2612
2720
  label: /* @__PURE__ */ K(W, { children: ["详情", e.actionId ? ` · 关联操作 #${e.actionId}` : ""] }),
2613
2721
  children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G("pre", {
2614
- className: pt.json,
2722
+ className: gt.json,
2615
2723
  "data-assistant-part": "json",
2616
2724
  children: JSON.stringify({
2617
2725
  page: e.page,
@@ -2626,11 +2734,11 @@ function vt({ events: e, onDraft: t }) {
2626
2734
  ]
2627
2735
  });
2628
2736
  }
2629
- var yt = { avatar: "_avatar_1modk_1" };
2737
+ var St = { avatar: "_avatar_1modk_1" };
2630
2738
  // src/components/AssistantAvatar/index.tsx
2631
- function bt({ className: e }) {
2739
+ function Ct({ className: e }) {
2632
2740
  return /* @__PURE__ */ G("span", {
2633
- className: [yt.avatar, e].filter(Boolean).join(" "),
2741
+ className: [St.avatar, e].filter(Boolean).join(" "),
2634
2742
  "data-assistant-part": "avatar",
2635
2743
  "aria-hidden": "true",
2636
2744
  children: /* @__PURE__ */ K("svg", {
@@ -2700,7 +2808,7 @@ function bt({ className: e }) {
2700
2808
  })
2701
2809
  });
2702
2810
  }
2703
- var xt = {
2811
+ var wt = {
2704
2812
  window: "_window_gvvdi_1",
2705
2813
  expanded: "_expanded_gvvdi_26",
2706
2814
  moving: "_moving_gvvdi_32",
@@ -2711,13 +2819,13 @@ var xt = {
2711
2819
  resize: "_resize_gvvdi_110"
2712
2820
  };
2713
2821
  // src/layouts/FloatingPanel/useOverlayScrollbars.ts
2714
- function St(e, t) {
2822
+ function Tt(e, t) {
2715
2823
  y(() => {
2716
2824
  let n = e.current;
2717
2825
  if (!n || !t) return;
2718
2826
  let r = /* @__PURE__ */ new Map(), i = 0, a = () => {
2719
2827
  for (let [e, t] of r) n.contains(e) || (t.destroy(), r.delete(e));
2720
- for (let e of n.querySelectorAll("[data-assistant-part~=\"body\"],[data-assistant-part~=\"json\"],.ant-tabs-content-holder,.ant-tabs-body-holder")) r.has(e) || r.set(e, Le({
2828
+ for (let e of n.querySelectorAll("[data-assistant-part~=\"body\"],[data-assistant-part~=\"json\"],.ant-tabs-content-holder,.ant-tabs-body-holder")) r.has(e) || r.set(e, ze({
2721
2829
  target: e,
2722
2830
  elements: { viewport: e }
2723
2831
  }, {
@@ -2744,25 +2852,25 @@ function St(e, t) {
2744
2852
  }, [e, t]);
2745
2853
  }
2746
2854
  // src/layouts/FloatingPanel/index.tsx
2747
- var Ct = 12, wt = (e) => {
2855
+ var Et = 12, Dt = (e) => {
2748
2856
  let t = Math.min(Math.max(360, e.width), window.innerWidth - 24), n = Math.min(Math.max(380, e.height), window.innerHeight - 24);
2749
2857
  return {
2750
2858
  width: t,
2751
2859
  height: n,
2752
- x: Math.max(Ct, Math.min(e.x, window.innerWidth - t - Ct)),
2753
- y: Math.max(Ct, Math.min(e.y, window.innerHeight - n - Ct))
2860
+ x: Math.max(Et, Math.min(e.x, window.innerWidth - t - Et)),
2861
+ y: Math.max(Et, Math.min(e.y, window.innerHeight - n - Et))
2754
2862
  };
2755
- }, Tt = (e) => {
2756
- let { open: t, onMinimize: n, children: r, developer: i } = e, [a, o] = x(() => wt({
2863
+ }, Ot = (e) => {
2864
+ let { open: t, onMinimize: n, children: r, developer: i } = e, [a, o] = x(() => Dt({
2757
2865
  x: window.innerWidth - 564,
2758
2866
  y: window.innerHeight - 744,
2759
2867
  width: 540,
2760
2868
  height: 720
2761
2869
  })), [s, c] = x(!1), [l, u] = x(!1), d = re(null);
2762
- St(d, t);
2870
+ Tt(d, t);
2763
2871
  let f = re(null);
2764
2872
  y(() => {
2765
- let e = () => o((e) => wt(e));
2873
+ let e = () => o((e) => Dt(e));
2766
2874
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
2767
2875
  }, []), y(() => {
2768
2876
  t && d.current?.focus({ preventScroll: !0 });
@@ -2778,10 +2886,10 @@ var Ct = 12, wt = (e) => {
2778
2886
  let t = f.current;
2779
2887
  if (!t) return;
2780
2888
  let n = e.clientX - t.x, r = e.clientY - t.y;
2781
- o(wt(t.resize ? {
2889
+ o(Dt(t.resize ? {
2782
2890
  ...t.rect,
2783
- width: Math.min(t.rect.width + n, window.innerWidth - t.rect.x - Ct),
2784
- height: Math.min(t.rect.height + r, window.innerHeight - t.rect.y - Ct)
2891
+ width: Math.min(t.rect.width + n, window.innerWidth - t.rect.x - Et),
2892
+ height: Math.min(t.rect.height + r, window.innerHeight - t.rect.y - Et)
2785
2893
  } : {
2786
2894
  ...t.rect,
2787
2895
  x: t.rect.x + n,
@@ -2800,10 +2908,10 @@ var Ct = 12, wt = (e) => {
2800
2908
  hidden: !t,
2801
2909
  "data-research-assistant": !0,
2802
2910
  className: [
2803
- xt.root,
2804
- xt.window,
2805
- s && xt.expanded,
2806
- l && xt.moving
2911
+ wt.root,
2912
+ wt.window,
2913
+ s && wt.expanded,
2914
+ l && wt.moving
2807
2915
  ].filter(Boolean).join(" "),
2808
2916
  "data-assistant-part": "window",
2809
2917
  "data-expanded": s,
@@ -2818,10 +2926,10 @@ var Ct = 12, wt = (e) => {
2818
2926
  },
2819
2927
  children: [
2820
2928
  /* @__PURE__ */ K("header", {
2821
- className: xt.header,
2929
+ className: wt.header,
2822
2930
  "data-assistant-part": "header",
2823
2931
  children: [/* @__PURE__ */ K("div", {
2824
- className: xt.drag,
2932
+ className: wt.drag,
2825
2933
  "data-assistant-part": "drag",
2826
2934
  tabIndex: 0,
2827
2935
  role: "group",
@@ -2841,37 +2949,37 @@ var Ct = 12, wt = (e) => {
2841
2949
  ].includes(e.key)) return;
2842
2950
  e.preventDefault();
2843
2951
  let t = e.shiftKey ? 40 : 10;
2844
- o((n) => wt({
2952
+ o((n) => Dt({
2845
2953
  ...n,
2846
2954
  x: n.x + (e.key === "ArrowLeft" ? -t : e.key === "ArrowRight" ? t : 0),
2847
2955
  y: n.y + (e.key === "ArrowUp" ? -t : e.key === "ArrowDown" ? t : 0)
2848
2956
  }));
2849
2957
  },
2850
- children: [/* @__PURE__ */ G(bt, {}), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ K("h2", {
2958
+ children: [/* @__PURE__ */ G(Ct, {}), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ K("h2", {
2851
2959
  id: "research-assistant-title",
2852
2960
  children: ["研发小蜜 ", /* @__PURE__ */ G("span", { children: i ? "开发助手" : "问题反馈" })]
2853
2961
  }) })]
2854
2962
  }), /* @__PURE__ */ K("div", {
2855
- className: xt.windowActions,
2963
+ className: wt.windowActions,
2856
2964
  "data-assistant-part": "window-actions",
2857
2965
  children: [/* @__PURE__ */ G(C, {
2858
2966
  type: "text",
2859
2967
  "aria-label": s ? "还原小窗" : "放大分析",
2860
2968
  title: s ? "还原小窗" : "放大分析",
2861
2969
  onClick: () => c((e) => !e),
2862
- children: G(s ? Te : Ee, {})
2970
+ children: G(s ? L : R, {})
2863
2971
  }), /* @__PURE__ */ G(C, {
2864
2972
  type: "text",
2865
2973
  "aria-label": "最小化研发小蜜",
2866
2974
  title: "最小化",
2867
2975
  onClick: n,
2868
- children: /* @__PURE__ */ G(z, {})
2976
+ children: /* @__PURE__ */ G(B, {})
2869
2977
  })]
2870
2978
  })]
2871
2979
  }),
2872
2980
  r,
2873
2981
  !s && /* @__PURE__ */ G("div", {
2874
- className: xt.resize,
2982
+ className: wt.resize,
2875
2983
  "data-assistant-part": "resize",
2876
2984
  role: "group",
2877
2985
  tabIndex: 0,
@@ -2887,10 +2995,10 @@ var Ct = 12, wt = (e) => {
2887
2995
  "ArrowRight",
2888
2996
  "ArrowUp",
2889
2997
  "ArrowDown"
2890
- ].includes(e.key) && (e.preventDefault(), o((t) => wt({
2998
+ ].includes(e.key) && (e.preventDefault(), o((t) => Dt({
2891
2999
  ...t,
2892
- width: Math.min(t.width + (e.key === "ArrowLeft" ? -20 : e.key === "ArrowRight" ? 20 : 0), window.innerWidth - t.x - Ct),
2893
- height: Math.min(t.height + (e.key === "ArrowUp" ? -20 : e.key === "ArrowDown" ? 20 : 0), window.innerHeight - t.y - Ct)
3000
+ width: Math.min(t.width + (e.key === "ArrowLeft" ? -20 : e.key === "ArrowRight" ? 20 : 0), window.innerWidth - t.x - Et),
3001
+ height: Math.min(t.height + (e.key === "ArrowUp" ? -20 : e.key === "ArrowDown" ? 20 : 0), window.innerHeight - t.y - Et)
2894
3002
  })));
2895
3003
  }
2896
3004
  })
@@ -2910,7 +3018,7 @@ var Ct = 12, wt = (e) => {
2910
3018
  memoryChart: "_memoryChart_1y43c_62"
2911
3019
  };
2912
3020
  // src/pages/assistant/components/PerformancePanel/index.tsx
2913
- function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3021
+ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
2914
3022
  let a = f(e, t, n), s = t.heapSamples, c = s.at(-1), l = Math.min(...s.map((e) => e.used)), u = Math.max(...s.map((e) => e.used)), d = s[0]?.time ?? n, p = s.map((e) => `${4 + (e.time - d) / Math.max(1, (c?.time ?? n) - d) * 592},${76 - (e.used - l) / Math.max(1048576, u - l) * 60}`).join(" ");
2915
3023
  return /* @__PURE__ */ K("div", {
2916
3024
  className: $.section,
@@ -2923,7 +3031,7 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
2923
3031
  /* @__PURE__ */ G("span", {
2924
3032
  className: $.headingIcon,
2925
3033
  "data-assistant-part": "heading-icon",
2926
- children: /* @__PURE__ */ G(ve, {})
3034
+ children: /* @__PURE__ */ G(N, {})
2927
3035
  }),
2928
3036
  /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "性能诊断" }) }),
2929
3037
  /* @__PURE__ */ G(D, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
@@ -2965,7 +3073,7 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
2965
3073
  },
2966
3074
  items: [{
2967
3075
  key: "details",
2968
- label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(k, {}), " 排查建议与触发依据"] }),
3076
+ label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(A, {}), " 排查建议与触发依据"] }),
2969
3077
  children: /* @__PURE__ */ K(W, { children: [
2970
3078
  /* @__PURE__ */ G("ol", { children: e.suggestions.map((e) => /* @__PURE__ */ G("li", { children: e }, e)) }),
2971
3079
  /* @__PURE__ */ G("p", {
@@ -2977,7 +3085,7 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
2977
3085
  href: e.url,
2978
3086
  target: "_blank",
2979
3087
  rel: "noreferrer",
2980
- children: [/* @__PURE__ */ G(R, {}), " 查看官方排查文档"]
3088
+ children: [/* @__PURE__ */ G(ke, {}), " 查看官方排查文档"]
2981
3089
  })
2982
3090
  ] })
2983
3091
  }]
@@ -3036,7 +3144,7 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3036
3144
  /* @__PURE__ */ K("h3", {
3037
3145
  className: $.subheading,
3038
3146
  "data-assistant-part": "subheading",
3039
- children: [/* @__PURE__ */ G(ve, {}), " 页面指标"]
3147
+ children: [/* @__PURE__ */ G(N, {}), " 页面指标"]
3040
3148
  }),
3041
3149
  /* @__PURE__ */ G("div", {
3042
3150
  className: $.metrics,
@@ -3068,34 +3176,34 @@ function Et({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3068
3176
  });
3069
3177
  }
3070
3178
  // src/pages/assistant/index.tsx
3071
- function Dt({ value: e }) {
3179
+ function At({ value: e }) {
3072
3180
  return /* @__PURE__ */ G("pre", {
3073
3181
  className: q.json,
3074
3182
  "data-assistant-part": "json",
3075
3183
  children: JSON.stringify(e, null, 2)
3076
3184
  });
3077
3185
  }
3078
- var Ot = (e) => new Date(e).toLocaleTimeString("zh-CN", { hour12: !1 });
3079
- function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly: i = !1 } = {}) {
3186
+ var jt = (e) => new Date(e).toLocaleTimeString("zh-CN", { hour12: !1 });
3187
+ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly: i = !1 } = {}) {
3080
3188
  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 = () => {
3081
3189
  p(!1), requestAnimationFrame(() => ae.current?.focus({ preventScroll: !0 }));
3082
- }, [ce, le] = x(""), [de, E] = x(""), [O, k] = x(null), [j, M] = x("live"), [_e, F] = x(c), [I, Ce] = x(!1), [Te, Ee] = x(!1), Oe = v(() => {
3083
- Ee(!1), p(!0), F(c());
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());
3084
3192
  }, []);
3085
- Je(ae, Oe, v((e) => {
3086
- Ce(e), e && Ee(!1);
3193
+ Xe(ae, L, v((e) => {
3194
+ we(e), e && I(!1);
3087
3195
  }, []));
3088
3196
  let R = v(() => {
3089
- m.clear(), i && s.clear(), M("live"), k(null), E("内存记录已清空");
3197
+ m.clear(), i && s.clear(), j("live"), O(null), fe("内存记录已清空");
3090
3198
  }, [i]);
3091
3199
  y(() => {
3092
3200
  if (i) return window.addEventListener("gz-research-assistant:clear-data", R), () => window.removeEventListener("gz-research-assistant:clear-data", R);
3093
3201
  }, [i, R]), y(() => {
3094
3202
  if (!u) return;
3095
- let e = setInterval(() => F(c()), 2e3);
3203
+ let e = setInterval(() => M(c()), 2e3);
3096
3204
  return () => clearInterval(e);
3097
3205
  }, [u]);
3098
- let z = j === "imported" ? O : j === "frozen" ? a.frozen : null, Me = z?.events ?? a.events, Ne = z?.requests ?? a.requests, Pe = z?.metrics ?? a.metrics, V = z?.environment ?? _e, Fe = z ?? a.frozen, U = /* @__PURE__ */ K("div", {
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", {
3099
3207
  className: q.section,
3100
3208
  "data-assistant-part": "section",
3101
3209
  children: [
@@ -3103,22 +3211,22 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3103
3211
  className: q.stats,
3104
3212
  "data-assistant-part": "stats",
3105
3213
  children: [
3106
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [Me.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3214
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [ke.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3107
3215
  className: q.statLabel,
3108
3216
  "data-assistant-part": "stat-label",
3109
3217
  children: [/* @__PURE__ */ G(De, {}), "操作与事件"]
3110
3218
  })] }),
3111
- /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [Ne.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3219
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [B.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3112
3220
  className: q.statLabel,
3113
3221
  "data-assistant-part": "stat-label",
3114
- children: [/* @__PURE__ */ G(he, {}), "接口记录"]
3222
+ children: [/* @__PURE__ */ G(k, {}), "接口记录"]
3115
3223
  })] }),
3116
3224
  /* @__PURE__ */ K("div", {
3117
- className: Ne.some((e) => e.failed) ? q.hasErrors : "",
3118
- children: [/* @__PURE__ */ K("strong", { children: [Ne.filter((e) => e.failed).length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3225
+ className: B.some((e) => e.failed) ? q.hasErrors : "",
3226
+ children: [/* @__PURE__ */ K("strong", { children: [B.filter((e) => e.failed).length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3119
3227
  className: q.statLabel,
3120
3228
  "data-assistant-part": "stat-label",
3121
- children: [/* @__PURE__ */ G(Ie, {}), "失败接口"]
3229
+ children: [/* @__PURE__ */ G(Re, {}), "失败接口"]
3122
3230
  })]
3123
3231
  })
3124
3232
  ]
@@ -3128,16 +3236,16 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3128
3236
  "data-assistant-part": "button-row actions",
3129
3237
  children: [/* @__PURE__ */ G(C, {
3130
3238
  type: "primary",
3131
- icon: /* @__PURE__ */ G(A, {}),
3239
+ icon: /* @__PURE__ */ G(ge, {}),
3132
3240
  onClick: () => {
3133
- g("用户手动截取现场"), M("frozen"), E("已冻结现场。后续操作不会改变这份快照。");
3241
+ g("用户手动截取现场"), j("frozen"), fe("已冻结现场。后续操作不会改变这份快照。");
3134
3242
  },
3135
3243
  children: "截取当前现场"
3136
3244
  }), /* @__PURE__ */ G(C, {
3137
- icon: /* @__PURE__ */ G(ye, {}),
3245
+ icon: /* @__PURE__ */ G(xe, {}),
3138
3246
  onClick: () => {
3139
- let e = Fe ?? n();
3140
- t(e, ce), E(`已导出 ${Ot(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3247
+ let e = U ?? n();
3248
+ t(e, ce), fe(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3141
3249
  },
3142
3250
  children: "导出快照 JSON"
3143
3251
  })]
@@ -3145,14 +3253,14 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3145
3253
  /* @__PURE__ */ K("p", {
3146
3254
  className: q.hint,
3147
3255
  "data-assistant-part": "hint",
3148
- children: [Fe ? `导出:${Fe.reason} · ${Ot(Fe.capturedAt)}` : "导出:当前现场", " · 现场仅存于内存,刷新或关闭前请导出"]
3256
+ children: [U ? `导出:${U.reason} · ${jt(U.capturedAt)}` : "导出:当前现场", " · 现场仅存于内存,刷新或关闭前请导出"]
3149
3257
  }),
3150
3258
  /* @__PURE__ */ K("div", {
3151
3259
  className: q.field,
3152
3260
  "data-assistant-part": "field",
3153
3261
  children: [/* @__PURE__ */ K("label", {
3154
3262
  htmlFor: "research-feedback",
3155
- children: [/* @__PURE__ */ G(be, {}), "问题描述"]
3263
+ children: [/* @__PURE__ */ G(P, {}), "问题描述"]
3156
3264
  }), /* @__PURE__ */ G(T.TextArea, {
3157
3265
  id: "research-feedback",
3158
3266
  value: ce,
@@ -3181,12 +3289,12 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3181
3289
  }]
3182
3290
  })
3183
3291
  ]
3184
- }), Le = /* @__PURE__ */ G(vt, {
3185
- events: Me,
3292
+ }), Fe = /* @__PURE__ */ G(xt, {
3293
+ events: ke,
3186
3294
  onDraft: i ? void 0 : (e) => {
3187
3295
  ne(e), _("automation");
3188
3296
  }
3189
- }, 0 + j + (z?.capturedAt ?? "live")), Re = /* @__PURE__ */ K("div", {
3297
+ }, 0 + A + (z?.capturedAt ?? "live")), Le = /* @__PURE__ */ K("div", {
3190
3298
  className: q.section,
3191
3299
  "data-assistant-part": "section",
3192
3300
  children: [
@@ -3197,18 +3305,18 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3197
3305
  /* @__PURE__ */ G("span", {
3198
3306
  className: q.headingIcon,
3199
3307
  "data-assistant-part": "heading-icon",
3200
- children: /* @__PURE__ */ G(he, {})
3308
+ children: /* @__PURE__ */ G(k, {})
3201
3309
  }),
3202
3310
  /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "接口记录" }) }),
3203
- /* @__PURE__ */ K(D, { children: [Ne.length, " 条"] })
3311
+ /* @__PURE__ */ K(D, { children: [B.length, " 条"] })
3204
3312
  ]
3205
3313
  }),
3206
3314
  /* @__PURE__ */ K("details", {
3207
3315
  className: q.hint,
3208
3316
  children: [/* @__PURE__ */ G("summary", { children: "采集范围" }), "Fetch / XHR 正文最多读取 16 KB,认证接口不采集正文。 耗时截至 Fetch 响应头到达或 XHR 请求结束。"]
3209
3317
  }),
3210
- !Ne.length && /* @__PURE__ */ G(ue, { description: "暂无接口记录" }),
3211
- Ne.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ G(w, {
3318
+ !B.length && /* @__PURE__ */ G(de, { description: "暂无接口记录" }),
3319
+ B.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ G(w, {
3212
3320
  className: q.request,
3213
3321
  "data-assistant-part": "request",
3214
3322
  ghost: !0,
@@ -3234,7 +3342,7 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3234
3342
  /* @__PURE__ */ G("b", { children: e.method }),
3235
3343
  " ",
3236
3344
  /* @__PURE__ */ K("span", { children: [
3237
- /* @__PURE__ */ G(Se, {}),
3345
+ /* @__PURE__ */ G(Ce, {}),
3238
3346
  Math.round(e.duration),
3239
3347
  " ms"
3240
3348
  ] })
@@ -3244,12 +3352,12 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3244
3352
  "data-assistant-part": "request-url",
3245
3353
  children: e.url
3246
3354
  })] }),
3247
- children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(Dt, { value: e }) })
3355
+ children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(At, { value: e }) })
3248
3356
  }]
3249
3357
  }, e.id))
3250
3358
  ]
3251
- }), ze = z ? z.performance ?? l() : a.performance, Be = z ? Date.parse(z.capturedAt) : a.performanceUpdatedAt, Ve = f(Pe, ze, Be), He = f(a.metrics, a.performance, a.performanceUpdatedAt).length, Ue = /* @__PURE__ */ G(Et, {
3252
- metrics: Pe,
3359
+ }), ze = z ? z.performance ?? l() : a.performance, Be = z ? Date.parse(z.capturedAt) : a.performanceUpdatedAt, Ve = f(V, ze, Be), He = f(a.metrics, a.performance, a.performanceUpdatedAt).length, Ue = /* @__PURE__ */ G(kt, {
3360
+ metrics: V,
3253
3361
  data: ze,
3254
3362
  now: Be,
3255
3363
  paused: a.paused,
@@ -3264,18 +3372,18 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3264
3372
  children: [/* @__PURE__ */ G("span", {
3265
3373
  className: q.headingIcon,
3266
3374
  "data-assistant-part": "heading-icon",
3267
- children: /* @__PURE__ */ G(P, {})
3375
+ children: /* @__PURE__ */ G(be, {})
3268
3376
  }), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "环境与数据" }) })]
3269
3377
  }),
3270
3378
  /* @__PURE__ */ K("dl", { children: [
3271
3379
  /* @__PURE__ */ G("dt", { children: "网络状态" }),
3272
- /* @__PURE__ */ G("dd", { children: V.online == null ? "未知" : V.online ? "在线" : "离线" }),
3380
+ /* @__PURE__ */ G("dd", { children: H.online == null ? "未知" : H.online ? "在线" : "离线" }),
3273
3381
  /* @__PURE__ */ G("dt", { children: "浏览器语言" }),
3274
- /* @__PURE__ */ G("dd", { children: V.language || "未知" }),
3382
+ /* @__PURE__ */ G("dd", { children: H.language || "未知" }),
3275
3383
  /* @__PURE__ */ G("dt", { children: "时区" }),
3276
- /* @__PURE__ */ G("dd", { children: V.timezone || "未知" }),
3384
+ /* @__PURE__ */ G("dd", { children: H.timezone || "未知" }),
3277
3385
  /* @__PURE__ */ G("dt", { children: "设备内存" }),
3278
- /* @__PURE__ */ G("dd", { children: typeof V.deviceMemoryGB == "number" ? `${V.deviceMemoryGB} GB` : "不可用" })
3386
+ /* @__PURE__ */ G("dd", { children: typeof H.deviceMemoryGB == "number" ? `${H.deviceMemoryGB} GB` : "不可用" })
3279
3387
  ] }),
3280
3388
  /* @__PURE__ */ K("details", { children: [
3281
3389
  /* @__PURE__ */ G("summary", { children: "完整环境与采集范围" }),
@@ -3283,14 +3391,14 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3283
3391
  className: q.hint,
3284
3392
  children: "不采集 Cookie、localStorage、sessionStorage 的值。"
3285
3393
  }),
3286
- /* @__PURE__ */ G(Dt, { value: V })
3394
+ /* @__PURE__ */ G(At, { value: H })
3287
3395
  ] }),
3288
- z && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("h3", { children: "现场页面状态" }), /* @__PURE__ */ G(Dt, { value: z.page })] })
3396
+ z && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("h3", { children: "现场页面状态" }), /* @__PURE__ */ G(At, { value: z.page })] })
3289
3397
  ]
3290
3398
  }), Ge = /* @__PURE__ */ G("div", {
3291
3399
  className: q.section,
3292
3400
  "data-assistant-part": "section",
3293
- children: /* @__PURE__ */ G(ue, { description: "知识问答尚未接入" })
3401
+ children: /* @__PURE__ */ G(de, { description: "知识问答尚未接入" })
3294
3402
  });
3295
3403
  return /* @__PURE__ */ K("div", {
3296
3404
  "data-research-assistant": !0,
@@ -3299,10 +3407,10 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3299
3407
  "data-assistant-part": "dock",
3300
3408
  "data-recording": o.recording,
3301
3409
  hidden: u,
3302
- children: [/* @__PURE__ */ G(pe, {
3303
- open: Te && !I && !u,
3304
- trigger: I ? [] : "hover",
3305
- onOpenChange: (e) => Ee(e && !I && !u),
3410
+ children: [/* @__PURE__ */ G(me, {
3411
+ open: Te && !F && !u,
3412
+ trigger: F ? [] : "hover",
3413
+ onOpenChange: (e) => I(e && !F && !u),
3306
3414
  title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` : He ? `研发小蜜 · ${He} 项性能告警` : a.frozen ? "研发小蜜 · 已保留异常现场" : "研发小蜜",
3307
3415
  children: /* @__PURE__ */ G(oe, {
3308
3416
  dot: o.recording || !!a.frozen || He > 0,
@@ -3316,8 +3424,8 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3316
3424
  "aria-label": "打开研发小蜜",
3317
3425
  "aria-expanded": u,
3318
3426
  "aria-controls": "research-assistant-window",
3319
- onClick: Oe,
3320
- icon: /* @__PURE__ */ G(bt, { className: q.launcherAvatar })
3427
+ onClick: L,
3428
+ icon: /* @__PURE__ */ G(Ct, { className: q.launcherAvatar })
3321
3429
  })
3322
3430
  })
3323
3431
  }), /* @__PURE__ */ G("span", {
@@ -3326,7 +3434,7 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3326
3434
  role: "status",
3327
3435
  children: o.recording ? `录制中 ${o.draft.steps.length} 步` : He ? `${He} 项性能告警` : a.frozen ? "已保留异常现场" : ""
3328
3436
  })]
3329
- }), /* @__PURE__ */ G(Tt, {
3437
+ }), /* @__PURE__ */ G(Ot, {
3330
3438
  open: u,
3331
3439
  onMinimize: se,
3332
3440
  developer: e,
@@ -3344,23 +3452,24 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3344
3452
  children: [/* @__PURE__ */ G(C, {
3345
3453
  type: "text",
3346
3454
  size: "small",
3347
- icon: a.paused ? /* @__PURE__ */ G(je, {}) : /* @__PURE__ */ G(Ae, {}),
3455
+ icon: a.paused ? /* @__PURE__ */ G(Me, {}) : /* @__PURE__ */ G(je, {}),
3348
3456
  onClick: () => m.pause(!a.paused),
3349
3457
  children: a.paused ? "继续采集" : "暂停采集"
3350
3458
  }), /* @__PURE__ */ G(C, {
3351
- size: "small",
3352
3459
  type: "text",
3353
- icon: /* @__PURE__ */ G(N, {}),
3460
+ danger: !0,
3461
+ size: "small",
3462
+ icon: /* @__PURE__ */ G(ye, {}),
3354
3463
  onClick: R,
3355
3464
  children: "清空记录"
3356
3465
  })]
3357
3466
  })]
3358
3467
  }),
3359
- de && /* @__PURE__ */ G(S, {
3468
+ ue && /* @__PURE__ */ G(S, {
3360
3469
  closable: !0,
3361
- title: de,
3470
+ title: ue,
3362
3471
  type: "info",
3363
- onClose: () => E("")
3472
+ onClose: () => fe("")
3364
3473
  }),
3365
3474
  z?.feedback && /* @__PURE__ */ G(S, {
3366
3475
  title: "快照中的问题描述",
@@ -3374,56 +3483,58 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3374
3483
  /* @__PURE__ */ G(C, {
3375
3484
  size: "small",
3376
3485
  icon: /* @__PURE__ */ G(De, {}),
3377
- "aria-pressed": j === "live",
3378
- type: j === "live" ? "primary" : "default",
3379
- onClick: () => M("live"),
3486
+ "aria-pressed": A === "live",
3487
+ type: A === "live" ? "primary" : "text",
3488
+ onClick: () => j("live"),
3380
3489
  children: "实时记录"
3381
3490
  }),
3382
3491
  (!i || a.frozen) && /* @__PURE__ */ G(C, {
3383
3492
  size: "small",
3384
- icon: /* @__PURE__ */ G(A, {}),
3493
+ icon: /* @__PURE__ */ G(ge, {}),
3385
3494
  disabled: !a.frozen,
3386
- "aria-pressed": j === "frozen",
3387
- type: j === "frozen" ? "primary" : "default",
3388
- onClick: () => M("frozen"),
3495
+ "aria-pressed": A === "frozen",
3496
+ type: A === "frozen" ? "primary" : "text",
3497
+ onClick: () => j("frozen"),
3389
3498
  children: "已冻结现场"
3390
3499
  }),
3391
- /* @__PURE__ */ G(me, {
3500
+ /* @__PURE__ */ G(he, {
3392
3501
  accept: ".json,application/json",
3393
3502
  showUploadList: !1,
3394
3503
  beforeUpload: async (e) => {
3395
3504
  try {
3396
3505
  if (e.size > 2097152) throw Error("快照不能超过 2 MB");
3397
- k(d(await e.text())), M("imported"), _("diagnostics"), b("timeline"), E("已载入本地快照,未上传文件");
3506
+ O(d(await e.text())), j("imported"), _("diagnostics"), b("timeline"), fe("已载入本地快照,未上传文件");
3398
3507
  } catch (e) {
3399
- E(e instanceof Error ? e.message : "快照读取失败");
3508
+ fe(e instanceof Error ? e.message : "快照读取失败");
3400
3509
  }
3401
- return me.LIST_IGNORE;
3510
+ return he.LIST_IGNORE;
3402
3511
  },
3403
3512
  children: /* @__PURE__ */ G(C, {
3513
+ type: "text",
3404
3514
  size: "small",
3405
- icon: /* @__PURE__ */ G(H, {}),
3515
+ icon: /* @__PURE__ */ G(Ie, {}),
3406
3516
  children: "导入快照"
3407
3517
  })
3408
3518
  }),
3409
- O && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
3519
+ E && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
3410
3520
  size: "small",
3411
- icon: /* @__PURE__ */ G(we, {}),
3412
- "aria-pressed": j === "imported",
3413
- type: j === "imported" ? "primary" : "default",
3414
- onClick: () => M("imported"),
3521
+ icon: /* @__PURE__ */ G(Ee, {}),
3522
+ "aria-pressed": A === "imported",
3523
+ type: A === "imported" ? "primary" : "text",
3524
+ onClick: () => j("imported"),
3415
3525
  children: "导入的现场"
3416
3526
  }), /* @__PURE__ */ G(C, {
3527
+ type: "text",
3417
3528
  "aria-label": "关闭导入现场",
3418
3529
  size: "small",
3419
- icon: /* @__PURE__ */ G(ge, {}),
3530
+ icon: /* @__PURE__ */ G(ve, {}),
3420
3531
  onClick: () => {
3421
- k(null), M("live");
3532
+ O(null), j("live");
3422
3533
  }
3423
3534
  })] })
3424
3535
  ]
3425
3536
  }),
3426
- /* @__PURE__ */ G(fe, {
3537
+ /* @__PURE__ */ G(pe, {
3427
3538
  className: q.mainTabs,
3428
3539
  "data-assistant-part": "main-tabs",
3429
3540
  "data-diagnostics-only": i || void 0,
@@ -3433,14 +3544,14 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3433
3544
  {
3434
3545
  key: "feedback",
3435
3546
  label: "问题反馈",
3436
- icon: /* @__PURE__ */ G(ke, { "aria-hidden": !0 }),
3437
- children: U
3547
+ icon: /* @__PURE__ */ G(Ae, { "aria-hidden": !0 }),
3548
+ children: Pe
3438
3549
  },
3439
3550
  ...e ? [{
3440
3551
  key: "automation",
3441
3552
  label: "自动化测试",
3442
- icon: /* @__PURE__ */ G(xe, { "aria-hidden": !0 }),
3443
- children: /* @__PURE__ */ G(ft, {
3553
+ icon: /* @__PURE__ */ G(Se, { "aria-hidden": !0 }),
3554
+ children: /* @__PURE__ */ G(ht, {
3444
3555
  close: se,
3445
3556
  bridgeUrl: r,
3446
3557
  incomingDraft: te,
@@ -3449,8 +3560,8 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3449
3560
  }, {
3450
3561
  key: "diagnostics",
3451
3562
  label: !z && He > 0 ? `诊断(${He})` : "诊断",
3452
- icon: /* @__PURE__ */ G(L, { "aria-hidden": !0 }),
3453
- children: /* @__PURE__ */ G(fe, {
3563
+ icon: /* @__PURE__ */ G(Oe, { "aria-hidden": !0 }),
3564
+ children: /* @__PURE__ */ G(pe, {
3454
3565
  className: q.diagnosticTabs,
3455
3566
  "data-assistant-part": "diagnostic-tabs",
3456
3567
  activeKey: ee,
@@ -3460,24 +3571,24 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3460
3571
  key: "timeline",
3461
3572
  label: "时间线",
3462
3573
  icon: /* @__PURE__ */ G(De, { "aria-hidden": !0 }),
3463
- children: Le
3574
+ children: Fe
3464
3575
  },
3465
3576
  {
3466
3577
  key: "network",
3467
3578
  label: "接口",
3468
- icon: /* @__PURE__ */ G(he, { "aria-hidden": !0 }),
3469
- children: Re
3579
+ icon: /* @__PURE__ */ G(k, { "aria-hidden": !0 }),
3580
+ children: Le
3470
3581
  },
3471
3582
  {
3472
3583
  key: "performance",
3473
3584
  label: Ve.length ? `性能 (${Ve.length})` : "性能",
3474
- icon: /* @__PURE__ */ G(ve, { "aria-hidden": !0 }),
3585
+ icon: /* @__PURE__ */ G(N, { "aria-hidden": !0 }),
3475
3586
  children: Ue
3476
3587
  },
3477
3588
  {
3478
3589
  key: "data",
3479
3590
  label: "环境与数据",
3480
- icon: /* @__PURE__ */ G(P, { "aria-hidden": !0 }),
3591
+ icon: /* @__PURE__ */ G(be, { "aria-hidden": !0 }),
3481
3592
  children: We
3482
3593
  }
3483
3594
  ]
@@ -3486,7 +3597,7 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3486
3597
  {
3487
3598
  key: "knowledge",
3488
3599
  label: "知识问答",
3489
- icon: /* @__PURE__ */ G(B, { "aria-hidden": !0 }),
3600
+ icon: /* @__PURE__ */ G(Ne, { "aria-hidden": !0 }),
3490
3601
  children: Ge
3491
3602
  }
3492
3603
  ].filter((e) => !i || e.key === "diagnostics")
@@ -3497,7 +3608,7 @@ function kt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3497
3608
  });
3498
3609
  }
3499
3610
  // src/components/AssistantErrorBoundary/index.tsx
3500
- var At = class extends _ {
3611
+ var Nt = class extends _ {
3501
3612
  state = { failed: !1 };
3502
3613
  static getDerivedStateFromError() {
3503
3614
  return { failed: !0 };
@@ -3510,7 +3621,7 @@ var At = class extends _ {
3510
3621
  }
3511
3622
  };
3512
3623
  // src/App.tsx
3513
- function jt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, themeMode: r = "gold-dark", popupContainer: a, diagnosticsOnly: o }) {
3624
+ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, themeMode: r = "gold-dark", popupContainer: a, diagnosticsOnly: o }) {
3514
3625
  let { isBusinessFailure: c, ignoreRequest: l } = n ?? {};
3515
3626
  y(() => {
3516
3627
  if (m.isActive()) throw Error("每页只能启动一个研发小蜜;npm 组件和浏览器扩展已管理采集,请勿额外调用 startAssistant");
@@ -3569,9 +3680,9 @@ function jt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3569
3680
  children: /* @__PURE__ */ G("div", {
3570
3681
  "data-research-assistant": !0,
3571
3682
  "data-assistant-part": "scope",
3572
- className: Ke.scope,
3683
+ className: Je.scope,
3573
3684
  style: u,
3574
- children: /* @__PURE__ */ G(kt, {
3685
+ children: /* @__PURE__ */ G(Mt, {
3575
3686
  developer: e,
3576
3687
  bridgeUrl: t,
3577
3688
  diagnosticsOnly: o
@@ -3580,56 +3691,56 @@ function jt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3580
3691
  })
3581
3692
  });
3582
3693
  }
3583
- function Mt(e = {}) {
3584
- return e.enabled === !1 ? null : /* @__PURE__ */ G(At, { children: /* @__PURE__ */ G(jt, { ...e }) }, e.sessionKey);
3694
+ function Ft(e = {}) {
3695
+ return e.enabled === !1 ? null : /* @__PURE__ */ G(Nt, { children: /* @__PURE__ */ G(Pt, { ...e }) }, e.sessionKey);
3585
3696
  }
3586
3697
  // src/inject.tsx
3587
- var Nt = (e) => typeof e == "function" ? e() : e, Pt = {}, Ft, It, Lt, Rt = () => {
3588
- if (!It) return;
3589
- let { enabled: e = !0, sessionKey: t, themeMode: n } = Pt;
3698
+ var It = (e) => typeof e == "function" ? e() : e, Lt = {}, Rt, zt, Bt, Vt = () => {
3699
+ if (!zt) return;
3700
+ let { enabled: e = !0, sessionKey: t, themeMode: n } = Lt;
3590
3701
  try {
3591
- It.render(/* @__PURE__ */ G(Mt, {
3592
- developer: Pt.developer,
3593
- bridgeUrl: Pt.bridgeUrl,
3594
- runtimeOptions: Pt.runtimeOptions,
3595
- diagnosticsOnly: Pt.diagnosticsOnly,
3596
- enabled: Nt(e),
3597
- sessionKey: Nt(t),
3598
- themeMode: Nt(n),
3599
- popupContainer: Ft
3702
+ zt.render(/* @__PURE__ */ G(Ft, {
3703
+ developer: Lt.developer,
3704
+ bridgeUrl: Lt.bridgeUrl,
3705
+ runtimeOptions: Lt.runtimeOptions,
3706
+ diagnosticsOnly: Lt.diagnosticsOnly,
3707
+ enabled: It(e),
3708
+ sessionKey: It(t),
3709
+ themeMode: It(n),
3710
+ popupContainer: Rt
3600
3711
  }));
3601
3712
  } catch (e) {
3602
- It.render(null), console.error("[研发小蜜] 读取应用配置失败,已停用当前小蜜会话", e);
3713
+ zt.render(null), console.error("[研发小蜜] 读取应用配置失败,已停用当前小蜜会话", e);
3603
3714
  }
3604
- }, zt = () => {
3605
- let e = Lt;
3606
- Lt = void 0;
3715
+ }, Ht = () => {
3716
+ let e = Bt;
3717
+ Bt = void 0;
3607
3718
  try {
3608
3719
  e?.();
3609
3720
  } catch (e) {
3610
3721
  console.error("[研发小蜜] 释放应用状态订阅失败", e);
3611
3722
  } finally {
3612
- It?.unmount(), It = void 0, Ft?.remove(), Ft = void 0;
3723
+ zt?.unmount(), zt = void 0, Rt?.remove(), Rt = void 0;
3613
3724
  }
3614
- }, Bt = () => {
3615
- if (!(It || typeof document > "u")) {
3616
- Ft = document.createElement("div"), Ft.dataset.researchAssistantMount = "npm", document.body.append(Ft), It = Re(Ft);
3725
+ }, Ut = () => {
3726
+ if (!(zt || typeof document > "u")) {
3727
+ Rt = document.createElement("div"), Rt.dataset.researchAssistantMount = "npm", document.body.append(Rt), zt = Be(Rt);
3617
3728
  try {
3618
- Rt(), Lt = Pt.subscribe?.(Rt);
3729
+ Vt(), Bt = Lt.subscribe?.(Vt);
3619
3730
  } catch (e) {
3620
- zt(), console.error("[研发小蜜] 初始化失败", e);
3731
+ Ht(), console.error("[研发小蜜] 初始化失败", e);
3621
3732
  }
3622
3733
  }
3623
- }, Vt = {
3734
+ }, Wt = {
3624
3735
  inject(e = {}) {
3625
- zt(), Pt = e, Bt();
3736
+ Ht(), Lt = e, Ut();
3626
3737
  },
3627
- start: Bt,
3628
- stop: zt,
3738
+ start: Ut,
3739
+ stop: Ht,
3629
3740
  destroy() {
3630
- zt(), Pt = {};
3741
+ Ht(), Lt = {};
3631
3742
  }
3632
3743
  };
3633
- export { Mt as ResearchAssistant, m as assistantRuntime, n as captureSnapshot, t as downloadSnapshot, g as freezeSnapshot, h as parseAssertion, u as parseCase, d as parseSnapshot, s as recorder, r as reportError, Vt as researchAssistant, i as startAssistant };
3744
+ export { Ft as ResearchAssistant, m as assistantRuntime, n as captureSnapshot, t as downloadSnapshot, g as freezeSnapshot, h as parseAssertion, u as parseCase, d as parseSnapshot, s as recorder, r as reportError, Wt as researchAssistant, i as startAssistant };
3634
3745
 
3635
3746
  //# sourceMappingURL=index.js.map